zwxi 7 months ago
parent
commit
6ed24ce730

+ 2 - 0
models/data_manage/excel/excel_info.go

@@ -516,6 +516,7 @@ func AddExcelInfoAndSheet(excelInfo *ExcelInfo, sheetParamsList []AddExcelSheetP
 			CalcChain:    sheetInfo.CalcChain,
 			ModifyTime:   time.Now(),
 			CreateTime:   time.Now(),
+			Frozen:       sheetInfo.Frozen,
 		}
 		sheetId, tmpErr := o.Insert(excelSheetInfo)
 		if tmpErr != nil {
@@ -591,6 +592,7 @@ func SaveExcelInfoAndSheet(excelInfo *ExcelInfo, updateExcelInfoParam []string,
 			CalcChain:    sheetInfo.CalcChain,
 			ModifyTime:   time.Now(),
 			CreateTime:   time.Now(),
+			Frozen:       sheetInfo.Frozen,
 		}
 		sheetId, tmpErr := o.Insert(excelSheetInfo)
 		if tmpErr != nil {

+ 2 - 0
models/data_manage/excel/excel_sheet.go

@@ -17,6 +17,7 @@ type ExcelSheet struct {
 	CalcChain    string    `description:"计算公式"`
 	ModifyTime   time.Time `description:"最近修改日期"`
 	CreateTime   time.Time `description:"创建日期"`
+	Frozen       string    `description:"冻结行"`
 }
 
 // Update 更新 excel表格的sheet基础信息
@@ -95,4 +96,5 @@ type AddExcelSheetParams struct {
 	Config       string            `description:"配置信息"`
 	CalcChain    string            `description:"计算公式"`
 	DataList     []*ExcelSheetData `description:"excel的数据"`
+	Frozen       string            `description:"冻结行"`
 }

+ 12 - 0
services/data/excel/custom_analysis.go

@@ -129,6 +129,11 @@ func AddCustomAnalysisTable(excelName, content, excelImage string, excelClassify
 			err = tmpErr
 			return
 		}
+		sheetFrozen, tmpErr := json.Marshal(sheetInfo.Frozen)
+		if tmpErr != nil {
+			err = tmpErr
+			return
+		}
 		addSheetItem := excel.AddExcelSheetParams{
 			ExcelSheetId: 0,
 			ExcelInfoId:  0,
@@ -137,6 +142,7 @@ func AddCustomAnalysisTable(excelName, content, excelImage string, excelClassify
 			Sort:         k,
 			Config:       string(sheetConf),
 			CalcChain:    string(sheetCalcChain),
+			Frozen:       string(sheetFrozen),
 		}
 
 		lenCellData := len(sheetInfo.CellData)
@@ -337,6 +343,11 @@ func SaveCustomAnalysisTable(excelInfo *excel.ExcelInfo, excelName, content, exc
 			err = tmpErr
 			return
 		}
+		sheetFrozen, tmpErr := json.Marshal(sheetInfo.Frozen)
+		if tmpErr != nil {
+			err = tmpErr
+			return
+		}
 		addSheetItem := excel.AddExcelSheetParams{
 			ExcelSheetId: 0,
 			ExcelInfoId:  excelInfo.ExcelInfoId,
@@ -345,6 +356,7 @@ func SaveCustomAnalysisTable(excelInfo *excel.ExcelInfo, excelName, content, exc
 			Sort:         k,
 			Config:       string(sheetConf),
 			CalcChain:    string(sheetCalcChain),
+			Frozen:       string(sheetFrozen),
 		}
 
 		lenCellData := len(sheetInfo.CellData)