ZaiZai 2 月之前
父節點
當前提交
7e8229c6d0
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6 6
      src/views/project/list/edit-formula.vue

+ 6 - 6
src/views/project/list/edit-formula.vue

@@ -566,15 +566,15 @@ const handleFormulaMenu = async (index, path) => {
             return
         }
         try {
-            let index = Number(path[1].split('-')[1]) - 1
-            const item = formulaMenuList.value[path[0]][index]
+            let indexs = Number(path[1].split('-')[1]) - 1
+            const item = formulaMenuList.value[path[0]][indexs]
             const val = symbolReg.exec(item.name)[1]
             resetFunOperator(val)
         } catch (e) {
             console.error(e)
         }
     } else {
-       await equationSelect(path)
+        await equationSelect(path)
         //深拷贝数据
         equationSelectEleCopy.value = deepClone(equationSelectEle.value)
     }
@@ -593,6 +593,7 @@ const equationSelect = async (path) => {
         const index = Number(path[1].split('-')[1]) - 1
         const expression = formulaMenuList.value[path[0]][index]
         obj = deepClone(expression)
+        obj.template = isNullES(obj.template) ? {} : JSON.parse(obj.template)
     } catch (error) {
         console.log(error)
     }
@@ -1357,9 +1358,8 @@ const selectingElements = (item, indexs) => {
 //当前元素
 const setCurElement = (item, index, indexs) => {
     let tmp = deepClone(equationSelectEleCopy.value)
-    console.log(tmp)
-    //tmp['tableElementKey'] = tmp['tableElementKey'].replace('_key', ':key')
-    //item.arguments[indexs] = tmp.children[index].arguments[indexs]
+    tmp['tableElementKey'] = tmp['tableElementKey'].replace('_key', ':key')
+    item.arguments[indexs] = tmp.children[index].arguments[indexs]
 }
 
 //保存