Browse Source

fix:去除看板conf序列化

zqbao 3 months ago
parent
commit
8f8c2fec81
2 changed files with 3 additions and 11 deletions
  1. 2 10
      controllers/bi_dashboard.go
  2. 1 1
      models/bi_dashboard/bi_dashboard.go

+ 2 - 10
controllers/bi_dashboard.go

@@ -102,15 +102,11 @@ func (this *BIDaShboardController) AddDashboard() {
 	detailList := make([]*bi_dashboard.BiDashboardDetail, 0)
 	var isAddResource bool
 	for i, v := range req.List {
-		tmpConf, er := json.Marshal(v.Conf)
-		if er != nil {
-			tmpConf = []byte("{}")
-		}
 		item := &bi_dashboard.BiDashboardDetail{
 			BiDashboardId: int(id),
 			Type:          v.Type,
 			UniqueCode:    v.UniqueCode,
-			Conf:          string(tmpConf),
+			Conf:          v.Conf,
 			Sort:          i + 1,
 			CreateTime:    time.Now(),
 			ModifyTime:    time.Now(),
@@ -201,15 +197,11 @@ func (this *BIDaShboardController) EditDashboard() {
 	detailList := make([]*bi_dashboard.BiDashboardDetail, 0)
 	isEditResource := false
 	for _, v := range req.List {
-		tmpConf, er := json.Marshal(v.Conf)
-		if er != nil {
-			tmpConf = []byte("{}")
-		}
 		item := &bi_dashboard.BiDashboardDetail{
 			BiDashboardId: req.BiDashboardId,
 			Type:          v.Type,
 			UniqueCode:    v.UniqueCode,
-			Conf:          string(tmpConf),
+			Conf:          v.Conf,
 			Sort:          v.Sort,
 			CreateTime:    time.Now(),
 			ModifyTime:    time.Now(),

+ 1 - 1
models/bi_dashboard/bi_dashboard.go

@@ -82,7 +82,7 @@ type AddDashboardListReq struct {
 	Type       int
 	UniqueCode string
 	Sort       int
-	Conf       interface{}
+	Conf       string
 }
 
 type EditDashboardReq struct {