ソースを参照

fix:excel管理规则列表

zqbao 7 ヶ月 前
コミット
bb9e28c48b

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

@@ -3243,6 +3243,9 @@ func (c *ExcelInfoController) GetExcelRuleList() {
 		br.ErrMsg = "管理规则添加失败,Err:" + err.Error()
 		return
 	}
+	if items.List == nil {
+		items.List = []*excel3.ExcelInfoRuleMappingView{}
+	}
 
 	br.Data = items
 	br.Msg = "获取成功"

+ 1 - 1
models/data_manage/excel/excel_info_rule_mapping.go

@@ -61,7 +61,7 @@ func (e *ExcelInfoRuleMapping) Update(cols []string) (err error) {
 // GetExcelRuleMappingByExcelInfoId 根据excelInfoId获取规则映射信息
 func GetExcelRuleMappingByExcelInfoId(id int) (items []*ExcelInfoRuleMappingView, err error) {
 	o := orm.NewOrmUsingDB("data")
-	sql := `SELECT * FROM excel_info_rule_mapping WHERE excel_info_id = ?`
+	sql := `SELECT * FROM excel_info_rule_mapping WHERE excel_info_id = ? ORDER BY create_time ASC`
 	_, err = o.Raw(sql, id).QueryRows(&items)
 	return
 }

+ 2 - 1
services/data/excel/excel_info.go

@@ -735,10 +735,11 @@ func ExcelRuleFormat(req *request.ExcelRuleMappingReq, lang string) (res *excel.
 		res.RightValue = fmt.Sprintf("%d,%d", x, y)
 		res.RightValueShow = req.RightValue
 	default:
-		res.RightValue = req.LeftValue
+		res.RightValue = req.RightValue
 		res.RightValueShow = req.RightValue
 	}
 
+	res.RuleType = req.RuleType
 	res.ExcelInfoId = req.ExcelInfoId
 	res.ExcelInfoRuleMappingId = req.ExcelRuleMappingId
 	res.LeftValueType = req.LeftValueType