Browse Source

fix:去除时间序列表格的宽高调整

zqbao 3 tháng trước cách đây
mục cha
commit
7314665868

+ 0 - 31
controllers/data_manage/excel/excel_info.go

@@ -1857,11 +1857,6 @@ func (c *ExcelInfoController) GetFirstEdbData() {
 			dataList[i], dataList[j] = dataList[j], dataList[i]
 		}
 	}
-	// 修改数据默认高度和宽度
-	for i := range dataList {
-		dataList[i].Width = 140
-		dataList[i].Height = 35
-	}
 
 	sourceNameList, sourceNameEnList, err := excel2.GetEdbSourceByEdbInfoIdList([]int{edbInfoId})
 	if err != nil {
@@ -1946,11 +1941,6 @@ func (c *ExcelInfoController) GetOtherEdbData() {
 			dataList[i], dataList[j] = dataList[j], dataList[i]
 		}
 	}
-	// 设置数据默认高度和宽度
-	for i := range dataList {
-		dataList[i].Width = 140
-		dataList[i].Height = 35
-	}
 
 	sourceNameList, sourceNameEnList, err := excel2.GetEdbSourceByEdbInfoIdList([]int{req.EdbInfoId})
 	if err != nil {
@@ -2056,11 +2046,6 @@ func (c *ExcelInfoController) GetBatchEdbData() {
 				br.Msg = "指标数据异常,请检查"
 				return
 			}
-			// 设置数据默认高度和宽度
-			for i := range dataList {
-				dataList[i].Width = 140
-				dataList[i].Height = 35
-			}
 			tableList = append(tableList, &response.TableDataItem{
 				EdbInfoId:     v,
 				Data:          dataList,
@@ -2089,11 +2074,6 @@ func (c *ExcelInfoController) GetBatchEdbData() {
 					dataList[i], dataList[j] = dataList[j], dataList[i]
 				}
 			}
-			// 设置数据默认高度和宽度
-			for i := range dataList {
-				dataList[i].Width = 140
-				dataList[i].Height = 35
-			}
 			sourceNameList, sourceNameEnList, err := excel2.GetEdbSourceByEdbInfoIdList([]int{v})
 			if err != nil {
 				br.Msg = "自定义表格数据获取失败"
@@ -2366,12 +2346,6 @@ func (c *ExcelInfoController) GetHistoryDateData() {
 			Data:      firstDataList,
 		})
 
-		// 设置数据默认高度和宽度
-		for i := range firstDataList {
-			firstDataList[i].Width = 140
-			firstDataList[i].Height = 35
-		}
-
 		for _, v := range firstDataList {
 			dateStrList = append(dateStrList, v.DataTime)
 		}
@@ -2396,11 +2370,6 @@ func (c *ExcelInfoController) GetHistoryDateData() {
 				return
 			}
 
-			// 设置数据默认高度和宽度
-			for i := range dataList {
-				dataList[i].Width = 140
-				dataList[i].Height = 35
-			}
 			result = append(result, response.TableDataItem{
 				EdbInfoId: v,
 				Decimal:   req.Decimal[k],

+ 0 - 6
models/data_manage/excel/request/excel_info.go

@@ -184,8 +184,6 @@ type ManualDataReq struct {
 	ShowValue           string            `description:"展示值"`
 	Value               string            `description:"实际值(计算公式)"`
 	Decimal             int               `description:"小数位数"`
-	Width               int               `description:"单元格宽度"`
-	Height              int               `description:"单元格高度"`
 	RelationEdbInfoList []RelationEdbInfo `description:"关联指标(计算公式中关联的指标,用于计算的时候去匹配)"`
 }
 
@@ -196,8 +194,6 @@ type ManualDataTemp struct {
 	ShowValue           string            `description:"展示值"`
 	Value               string            `description:"实际值(计算公式)"`
 	Decimal             *int              `description:"小数位数"`
-	Width               int               `description:"单元格宽度"`
-	Height              int               `description:"单元格高度"`
 	RelationEdbInfoList []RelationEdbInfo `description:"关联指标(计算公式中关联的指标,用于计算的时候去匹配)"`
 }
 
@@ -217,8 +213,6 @@ func (m *ManualDataReq) UnmarshalJSON(data []byte) error {
 	m.DataTimeType = alias.DataTimeType
 	m.ShowValue = alias.ShowValue
 	m.Value = alias.Value
-	m.Width = alias.Width
-	m.Height = alias.Height
 	m.RelationEdbInfoList = alias.RelationEdbInfoList
 	return nil
 }

+ 0 - 25
services/data/excel/excel_info.go

@@ -158,17 +158,6 @@ func formatExcelInfo2Detail(excelInfo *excel.ExcelInfo, sysUserId int, lang stri
 					result.Data[i].HaveOperaAuth = data_manage_permission.CheckEdbPermissionByPermissionIdList(v.IsJoinPermission, currClassify.IsJoinPermission, v.EdbInfoId, v.ClassifyId, permissionEdbIdList, permissionClassifyIdList)
 				}
 			}
-			for i, edbData := range result.Data {
-				for j := range edbData.Data {
-					if result.Data[i].Data[j].Width == 0 {
-						result.Data[i].Data[j].Width = 140
-					}
-					if result.Data[i].Data[j].Height == 0 {
-						result.Data[i].Data[j].Height = 35
-					}
-				}
-			}
-			setTextCellDefaultSize(result.TextRowData)
 		}
 
 		excelDetail.TableData = result
@@ -197,20 +186,6 @@ func formatExcelInfo2Detail(excelInfo *excel.ExcelInfo, sysUserId int, lang stri
 	return
 }
 
-// 设置默认的文本单元格大小
-func setTextCellDefaultSize(textRowData [][]request.ManualDataReq) {
-	for i := range textRowData {
-		for j := range textRowData[i] {
-			if textRowData[i][j].Width == 0 {
-				textRowData[i][j].Width = 140
-			}
-			if textRowData[i][j].Height == 0 {
-				textRowData[i][j].Height = 35
-			}
-		}
-	}
-}
-
 // SetExcelByDecimalConfig 设置表格的小数位
 func SetExcelByDecimalConfig(tableData request.TableDataReq, config []request.DecimalConfig) request.TableDataReq {
 	excelData := tableData.Data