|
@@ -466,11 +466,45 @@ func GetMixedTableCellData(mixedTableReq request.MixedTableReq, lang string) (ne
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ config = setDefaultCellSize(config)
|
|
|
|
+
|
|
newMixedTableCellDataList = config
|
|
newMixedTableCellDataList = config
|
|
|
|
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+func setDefaultCellSize(config [][]request.MixedTableCellDataReq) (newConfig [][]request.MixedTableCellDataReq) {
|
|
|
|
+ newConfig = config
|
|
|
|
+ for i, row := range config {
|
|
|
|
+ for j, cell := range row {
|
|
|
|
+ var styleConf request.MixCellShowStyle
|
|
|
|
+ if cell.ShowStyle == `` {
|
|
|
|
+ styleConf = request.MixCellShowStyle{
|
|
|
|
+ Width: 140,
|
|
|
|
+ Height: 35,
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ err := json.Unmarshal([]byte(cell.ShowStyle), &styleConf)
|
|
|
|
+ if err != nil {
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ if styleConf.Width == 0 {
|
|
|
|
+ styleConf.Width = 140
|
|
|
|
+ }
|
|
|
|
+ if styleConf.Height == 0 {
|
|
|
|
+ styleConf.Height = 35
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ tmpStyleConf, err := json.Marshal(styleConf)
|
|
|
|
+ if err == nil {
|
|
|
|
+ cell.ShowStyle = string(tmpStyleConf)
|
|
|
|
+ }
|
|
|
|
+ newConfig[i][j] = cell
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return
|
|
|
|
+}
|
|
|
|
+
|
|
// getCalculateValue 获取公式计算的结果
|
|
// getCalculateValue 获取公式计算的结果
|
|
func getCalculateValueByCell(calculateCellMap map[string]Cell, key string, cellKeyValMap map[string]float64) (val float64, has bool, err error, errMsg string) {
|
|
func getCalculateValueByCell(calculateCellMap map[string]Cell, key string, cellKeyValMap map[string]float64) (val float64, has bool, err error, errMsg string) {
|
|
// 单元格的标签名
|
|
// 单元格的标签名
|