|
@@ -162,7 +162,7 @@ func (c *AiPredictModelFrameworkController) Add() {
|
|
nodes = append(nodes, t)
|
|
nodes = append(nodes, t)
|
|
num := 1
|
|
num := 1
|
|
// 响应节点数据
|
|
// 响应节点数据
|
|
- td := aiPredictModel.FormatAiPredictModelFrameworkNode2Item(t, num)
|
|
|
|
|
|
+ td := aiPredictModel.FormatAiPredictModelFrameworkNode2Item(t, num, map[int]*aiPredictModel.AiPredictModelIndex{})
|
|
itemNodes = append(itemNodes, td)
|
|
itemNodes = append(itemNodes, td)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -279,7 +279,7 @@ func (c *AiPredictModelFrameworkController) Edit() {
|
|
nodes = append(nodes, t)
|
|
nodes = append(nodes, t)
|
|
|
|
|
|
// 响应节点数据
|
|
// 响应节点数据
|
|
- td := aiPredictModel.FormatAiPredictModelFrameworkNode2Item(t, 1)
|
|
|
|
|
|
+ td := aiPredictModel.FormatAiPredictModelFrameworkNode2Item(t, 1, map[int]*aiPredictModel.AiPredictModelIndex{})
|
|
itemNodes = append(itemNodes, td)
|
|
itemNodes = append(itemNodes, td)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -620,6 +620,34 @@ func (c *AiPredictModelFrameworkController) Detail() {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 模型标的map
|
|
|
|
+ aiPredictModelIndexMap := make(map[int]*aiPredictModel.AiPredictModelIndex)
|
|
|
|
+ {
|
|
|
|
+ aiPredictModelIndexIdList := make([]interface{}, 0)
|
|
|
|
+ for _, v := range nodes {
|
|
|
|
+ if v.AiPredictModelIndexId > 0 {
|
|
|
|
+ aiPredictModelIndexIdList = append(aiPredictModelIndexIdList, v.AiPredictModelIndexId)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if len(aiPredictModelIndexIdList) > 0 {
|
|
|
|
+ indexObj := aiPredictModel.AiPredictModelIndex{}
|
|
|
|
+ indexList, e := indexObj.GetItemsByCondition(`ai_predict_model_index_id in (?)`, aiPredictModelIndexIdList, []string{}, "")
|
|
|
|
+ if e != nil {
|
|
|
|
+ if e.Error() == utils.ErrNoRow() {
|
|
|
|
+ br.Msg = "框架不存在, 请刷新页面"
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ br.Msg = "获取失败"
|
|
|
|
+ br.ErrMsg = "获取标的列表失败, Err: " + e.Error()
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ for _, v := range indexList {
|
|
|
|
+ aiPredictModelIndexMap[v.AiPredictModelIndexId] = v
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
// 格式化响应数据
|
|
// 格式化响应数据
|
|
itemNodes := make([]*aiPredictModel.AiPredictModelFrameworkNodeItem, 0)
|
|
itemNodes := make([]*aiPredictModel.AiPredictModelFrameworkNodeItem, 0)
|
|
for _, v := range nodes {
|
|
for _, v := range nodes {
|
|
@@ -627,7 +655,8 @@ func (c *AiPredictModelFrameworkController) Detail() {
|
|
continue
|
|
continue
|
|
}
|
|
}
|
|
num := 1
|
|
num := 1
|
|
- itemNodes = append(itemNodes, aiPredictModel.FormatAiPredictModelFrameworkNode2Item(v, num))
|
|
|
|
|
|
+
|
|
|
|
+ itemNodes = append(itemNodes, aiPredictModel.FormatAiPredictModelFrameworkNode2Item(v, num, aiPredictModelIndexMap))
|
|
}
|
|
}
|
|
detail := aiPredictModel.FormatAiPredictModelFramework2Item(item, itemNodes)
|
|
detail := aiPredictModel.FormatAiPredictModelFramework2Item(item, itemNodes)
|
|
|
|
|