yangyj преди 2 години
родител
ревизия
579e2a4b26
променени са 4 файла, в които са добавени 15 реда и са изтрити 9 реда
  1. 1 1
      src/api/formula/formula.js
  2. 2 1
      src/views/formula/edit.vue
  3. 12 5
      src/views/manager/projectinfo/tree.vue
  4. 0 2
      src/views/manager/wbsinfo/edit.vue

+ 1 - 1
src/api/formula/formula.js

@@ -10,7 +10,7 @@ export const getTypeMap = (params) => {
   })
 }
 
-export const saveFormula = ({formula,remark,nodeId,elementId,scale,number,map,scope}) => {
+export const saveFormula = ({formula,remark,nodeId,elementId,scale,number,map,scope,projectId}) => {
   return request({
     url: '/api/blade-manager/formula/save',
     method: 'post',

+ 2 - 1
src/views/formula/edit.vue

@@ -1075,7 +1075,8 @@ export default {
           scale:this.isRetain?this.retainNum:'',
           number:number,
           map:JSON.stringify(obj.eleMap),
-          scope:this.globaltype
+          scope:this.globaltype,
+          projectId:this.curProjiect.id
         }).then((res)=>{
           if(res.data.data){
             this.formulaid = res.data.data;

+ 12 - 5
src/views/manager/projectinfo/tree.vue

@@ -1191,9 +1191,15 @@
         <el-table-column align="center" label="操作" width="200">
           <template slot-scope="scope">
             <el-link
+              :type="scope.row.globalFormula == 1 ? 'warning' : 'primary'"
+              @click="toFormulaEdit(scope.row,1)"
+              >全局公式</el-link
+            >
+            <el-link
+              class="mg-l-10"
               :type="scope.row.isSaveFormula == 1 ? 'warning' : 'primary'"
-              @click="toFormulaEdit(scope.row)"
-              >公式配置</el-link
+              @click="toFormulaEdit(scope.row,10)"
+              >节点公式</el-link
             >
             <!-- <el-link
               class="mg-l-10"
@@ -1402,9 +1408,9 @@
       class="full-dialog"
     >
       <FormulaEdit
-        :wbsid="id"
-        :nodeid="curTreeData.id"
+        :nodeid="curTreeData.id" 
         :eleid="formulaCurRow.id"
+        :globaltype="formulaCurRow.globaltype"
         :projectid="projectid"
         @hideDialog="formulaCompVisible = false"
         v-if="formulaCompVisible"
@@ -2321,7 +2327,7 @@ export default {
     },
 
     //跳转到公式配置页面
-    toFormulaEdit(row) {
+    toFormulaEdit(row,type) {
       // this.$router.push({
       //   path: '/formula/edit',
       //   query: {
@@ -2333,6 +2339,7 @@ export default {
       // });
 
       this.formulaCurRow = row;
+      this.formulaCurRow.globaltype = type;
       this.formulaCompVisible = true;
     },
 

+ 0 - 2
src/views/manager/wbsinfo/edit.vue

@@ -2515,8 +2515,6 @@ export default {
       this.formulaCurRow = row;
       this.formulaCurRow.globaltype = type;
       this.formulaCompVisible = true;
-      console.log(this.formulaCurRow)
-      console.log(this.curTreeData)
     },
 
     getNodeTypelist () {