Selaa lähdekoodia

fix:列表页的权限

Roc 2 kuukautta sitten
vanhempi
commit
48796c8722

+ 5 - 0
controllers/data_manage/ai_predict_model/framework.go

@@ -68,6 +68,11 @@ func (c *AiPredictModelFrameworkController) List() {
 	resp := make([]*aiPredictModel.AiPredictModelFrameworkItem, 0)
 	for _, v := range list {
 		t := aiPredictModel.FormatAiPredictModelFramework2Item(v, make([]*aiPredictModel.AiPredictModelFrameworkNodeItem, 0))
+		if t.AdminId == sysUser.AdminId || utils.IsAdminRole(sysUser.RoleTypeCode) {
+			t.Button.OpButton = true
+			t.Button.DeleteButton = true
+			t.Button.MoveButton = true
+		}
 		resp = append(resp, t)
 	}
 

+ 8 - 0
models/ai_predict_model/ai_predict_model_framework.go

@@ -326,6 +326,14 @@ type AiPredictModelFrameworkItem struct {
 	CreateTime                string                             `description:"创建时间"`
 	ModifyTime                string                             `description:"更新时间"`
 	Nodes                     []*AiPredictModelFrameworkNodeItem `description:"框架节点"`
+	Button                    AiPredictModelFrameworkItemButton  `description:"操作按钮"`
+}
+
+// AiPredictModelFrameworkItemButton 操作按钮
+type AiPredictModelFrameworkItemButton struct {
+	OpButton     bool `description:"是否可编辑"`
+	DeleteButton bool `description:"是否可删除"`
+	MoveButton   bool `description:"是否可移动"`
 }
 
 // FormatAiPredictModelFramework2Item 格式化框架信息