Kaynağa Gözat

公式配置页面,编辑元素页面,改成弹框

gangyj 2 yıl önce
ebeveyn
işleme
1e5d003e48

+ 35 - 17
src/views/formula/edit.vue

@@ -59,10 +59,10 @@
         <div><el-button type="info" size="small" @click="operationEdit">重置函数</el-button></div>
       </div>
     </div>
-    <div v-show="operationVisible" class="operation-box flex1 flex flex-d-c">
+    <div v-show="operationVisible" class="operation-box flex1 flex flex-d-c ov-hidden">
       <div>选择参数设置</div>
-      <div class="flex flex-d-c flex1">
-        <el-row :gutter="20" class="flex1">
+      <div class="flex flex-d-c flex1 ov-hidden">
+        <el-row :gutter="20" class="flex1 ov-hidden">
           <el-col :span="8" class="h-100p">
             <el-card shadow="never" class="h-100p ov-auto">
               <el-scrollbar style="height: 100%">
@@ -93,12 +93,12 @@
               </el-scrollbar>
             </el-card>
           </el-col>
-          <el-col :span="16" class="h-100p flex flex-d-c">
+          <el-col :span="16" class="h-100p flex flex-d-c ov-hidden">
             <el-select v-model="eleTableId" @change="getTableEle" placeholder="请选择元素表" style="width:300px">
               <el-option v-if="paramDataList.length" label="选择节点参数" value="选择节点参数"></el-option>
               <el-option  v-for="item in eleTableList" :key="item.id" :label="item.tableName" :value="item.id"></el-option>
             </el-select>
-            <div class="mg-t-10 no-mb-col flex1">
+            <div class="mg-t-10 no-mb-col flex1 ov-hidden">
               <el-scrollbar style="height: 100%">
                 <el-row>
                   <el-col :span="6" v-for="item in eleList" :key="item.id">
@@ -174,10 +174,6 @@
           <el-button type="info">查询</el-button>
         </div>
       </div>
-      <div class="text-align-c">
-        <el-button type="warning" @click="$router.back()">取消</el-button>
-        <el-button type="primary" @click="saveFormula">保存</el-button>
-      </div>
     </div>
     <div v-if="!operationVisible && showFunDetail" class="flex1">
       <el-tabs v-model="actiFunIndex" closable @tab-remove="removeFun" :before-leave="funLeave">
@@ -231,6 +227,10 @@
         </el-tab-pane>
       </el-tabs>
     </div>
+    <div class="text-align-c" v-show="!operationVisible">
+      <el-button type="warning" @click="$emit('hideDialog')">取消</el-button>
+      <el-button type="primary" @click="saveFormula">保存</el-button>
+    </div>
   </div>
 
     <el-dialog title="输入值" :visible.sync="inputVisible" width="300px" append-to-body :close-on-click-modal="false">
@@ -350,12 +350,30 @@ export default {
     datasJoin,
     ifelse
   },
+  props: {
+    wbsid:{
+      type:String,
+      default:''
+    },
+    eleid:{
+      type:String,
+      default:''
+    },
+    nodeid:{
+      type:String,
+      default:''
+    },
+    pid:{
+      type:String,
+      default:''
+    },
+  },
   data() {
     return {
-      wbsid: "", //从哪个wbs树过来的
-      eleid: "", //元素id
-      nodeid:'',//所在树节点id
-      pid:'',//项目id 私有树才有
+      // wbsid: "", //从哪个wbs树过来的
+      // eleid: "", //元素id
+      // nodeid:'',//所在树节点id
+      // pid:'',//项目id 私有树才有
       formulaid:'',
 
       treeData:[],//树节点
@@ -453,10 +471,10 @@ export default {
     }
   },
   created() {
-    this.wbsid = this.$route.query.wbsid;
-    this.eleid = this.$route.query.eleid;
-    this.nodeid = this.$route.query.nodeid;
-    this.pid = this.$route.query.projectid;//项目id 私有树才有
+    // this.wbsid = this.$route.query.wbsid;
+    // this.eleid = this.$route.query.eleid;
+    // this.nodeid = this.$route.query.nodeid;
+    // this.pid = this.$route.query.projectid;//项目id 私有树才有
     this.init();
   },
   methods: {

+ 82 - 22
src/views/manager/projectinfo/editElement/editElement.vue

@@ -206,15 +206,56 @@
           >确 定</el-button>
         </span>
       </el-dialog>
+
+      <!-- 公式 -->
+      <el-dialog title="元素公式" :visible.sync="formulaCompVisible" fullscreen append-to-body class="full-dialog">
+        <FormulaEdit :wbsid="wbsid" :nodeid="nodeid" :eleid="eleid" :projectid="pid" @hideDialog="formulaCompVisible = false" v-if="formulaCompVisible"></FormulaEdit>
+      </el-dialog>
+
     </basic-container>
   </div>
 </template>
 
 <script>
+import FormulaEdit from '@/views/formula/edit.vue'
+
 import { getExcelHtml } from '@/api/exctab/excelmodel'
 import { getElementInfoByTabId, submit, dictionarydataType, submitBatch } from '@/api/exctab/editelement'
 import Vue from 'vue'
 export default {
+  components:{
+    FormulaEdit
+  },
+  props: {
+    pkeyId:{
+      type:String,
+      default:''
+    },
+    excelId:{
+      type:String,
+      default:''
+    },
+    id:{
+      type:String,
+      default:''
+    },
+    initTableName:{
+      type:String,
+      default:''
+    },
+    pid:{
+      type:String,
+      default:''
+    },
+    wbsid:{
+      type:String,
+      default:''
+    },
+    nodeid:{
+      type:String,
+      default:''
+    },
+  },
   data () {
     return {
       heights: '',
@@ -254,6 +295,9 @@ export default {
 
       isMultiple:false,
       eleData:[],
+
+      formulaCompVisible:false,//公式弹框
+      eleid:'',//当前元素
     }
   },
   mounted () {
@@ -314,12 +358,13 @@ export default {
         ekey
       }
 
-      this.left = window.event.clientX - 300
-      let Y = window.event.clientY
+      
+      this.left = window.event.clientX - 80
+      let Y = window.event.clientY -54 
       if (window.outerHeight - Y > 200) {
-        this.top = window.event.clientY - 80
+        this.top = window.event.clientY - 80 +54
       } else {
-        this.top = window.event.clientY - 270
+        this.top = window.event.clientY - 270 +54
       }
       this.cascaderPanel = true
       clearTimeout(this.setTimeout)
@@ -384,7 +429,7 @@ export default {
       }).then(() => {
         _that.submit({
           colName: '/',
-          tabId: this.$route.query.pkeyId,
+          tabId: this.pkeyId,
           tdIndex: this.table.td,
           trIndex: this.table.tr,
         })
@@ -468,8 +513,8 @@ export default {
       this.$router.push({
         path: '/project/tree',
         query: {
-          pid: this.$route.query.pid,
-          wbsid: this.$route.query.wbsid,
+          pid: this.pid,
+          wbsid: this.wbsid,
         }
       })
     },
@@ -481,7 +526,7 @@ export default {
       if (this.value) {
         this.tag = true
         this.submit({
-          tabId: this.$route.query.pkeyId,
+          tabId: this.pkeyId,
           tdIndex: this.table.td,
           trIndex: this.table.tr,
           colName: "",
@@ -495,7 +540,7 @@ export default {
       }
     },
     async getElementInfoByTabId () {//获取字段信息
-      const { data: res } = await getElementInfoByTabId({ tabId: this.$route.query.id })
+      const { data: res } = await getElementInfoByTabId({ tabId: this.id })
       console.log(res);
       if (res.code === 200) {
         this.options = res.data
@@ -505,7 +550,7 @@ export default {
       const { data: res } = await submit(da)
       console.log(res);
       if (res.code == 200) {
-        const { data: res } = await getExcelHtml({ pkeyId: this.$route.query.pkeyId })
+        const { data: res } = await getExcelHtml({ pkeyId: this.pkeyId })
         console.log(res);
         if (res.code === 200) {
           this.tag = false
@@ -540,8 +585,8 @@ export default {
         })
         if (tag) {
           this.submitBatch({
-            initTableName: this.$route.query.initTableName,
-            id: this.$route.query.id,
+            initTableName: this.initTableName,
+            id: this.id,
             listData: this.tableData,
           })
         } else {
@@ -588,20 +633,25 @@ export default {
         return;
       }
 
-      this.$router.push({
-        path: '/formula/edit',
-        query: {
-          wbsid: this.$route.query.wbsid,
-          eleid: eleid,
-          nodeid:this.$route.query.nodeid,
-          projectid:this.$route.query.pid
-        }
-      });
+      // this.$router.push({
+      //   path: '/formula/edit',
+      //   query: {
+      //     wbsid: this.wbsid,
+      //     eleid: eleid,
+      //     nodeid:this.nodeid,
+      //     projectid:this.pid
+      //   }
+      // });
+
+      this.eleid = eleid;
+      this.formulaCompVisible = true;
     },
 
     // 返回上一页
     toBack(){
-      this.$router.go(-1);
+      // this.$router.go(-1);
+      
+      this.$emit('hideDialog')
     },
 
 
@@ -736,4 +786,14 @@ export default {
   }
 }
 
+.full-dialog{
+  /deep/ .el-dialog__body{
+    padding-bottom: 0;
+    padding-top: 0;
+  }
+
+  /deep/ .basic-container{
+    height: calc(100vh - 60px);
+  }
+}
 </style>

+ 74 - 21
src/views/manager/projectinfo/tree.vue

@@ -1364,12 +1364,24 @@
       </span>
     </el-dialog>
 
+    <!-- 公式 -->
+    <el-dialog title="元素公式" :visible.sync="formulaCompVisible" fullscreen append-to-body class="full-dialog">
+      <FormulaEdit :wbsid="id" :nodeid="curTreeData.id" :eleid="formulaCurRow.id" :projectid="projectid" @hideDialog="formulaCompVisible = false" v-if="formulaCompVisible"></FormulaEdit>
+    </el-dialog>
+
+    <!-- 编辑元素 -->
+    <el-dialog title="编辑元素" :visible.sync="editElementVisible" fullscreen append-to-body class="full-dialog">
+      <EditElement :pkeyId="editElementQuery.pkeyId" :excelId="editElementQuery.excelId" :id="editElementQuery.id" :initTableName="editElementQuery.initTableName" :pid="editElementQuery.pid" :wbsid="editElementQuery.wbsid" :nodeid="editElementQuery.nodeid" @hideDialog="editElementVisible = false" v-if="editElementVisible"></EditElement>
+    </el-dialog>
+
   </basic-container>
 </template>
 
 <script>
 import ManualSorting from '@/components/WbsTree/ManualSorting'
 import dynamicExcel from "./treeTemplate/dynamicExcel.vue";
+import FormulaEdit from '@/views/formula/edit.vue'
+import EditElement from '@/views/manager/projectinfo/editElement/editElement.vue'
 import {
   saveFormAndElement, selectFormElements,
   importWbsTree, findWbsTreePrivateSameLevel, wbsTreePrivateSort, parameters, saveOrUpdateBatch, keymap, updateBatchNodeTableInfo2, updateStatus
@@ -1548,6 +1560,20 @@ export default {
       aliasVisible:false,//别名
       aliasInput:'',
       aliasArr:[],
+      
+      formulaCompVisible:false,//公式弹框
+      formulaCurRow:{},//当前元素
+
+      editElementVisible:false,//编辑元素弹框
+      editElementQuery:{
+        pkeyId: '',
+        excelId: '',
+        id: '',
+        initTableName:'',
+        pid: '',
+        wbsid: '',
+        nodeid: '',
+      },//传参
     };
   },
   computed: {
@@ -2115,15 +2141,18 @@ export default {
 
     //跳转到公式配置页面
     toFormulaEdit (row) {
-      this.$router.push({
-        path: '/formula/edit',
-        query: {
-          wbsid: this.id,
-          eleid: row.id,
-          nodeid:this.curTreeData.id,
-          projectid:this.projectid
-        }
-      });
+      // this.$router.push({
+      //   path: '/formula/edit',
+      //   query: {
+      //     wbsid: this.id,
+      //     eleid: row.id,
+      //     nodeid:this.curTreeData.id,
+      //     projectid:this.projectid
+      //   }
+      // });
+
+      this.formulaCurRow = row;
+      this.formulaCompVisible = true;
     },
 
     getNodeTypelist () {
@@ -2507,18 +2536,29 @@ export default {
     //#region 编辑元素
     async rightClick (pkeyId, excelId, id, initTableName) {
       await this.getExcelHtml2(pkeyId)
-      this.$router.push({
-        path: '/project/editElement',
-        query: {
-          pkeyId: pkeyId,
-          excelId: excelId,
-          id: id,
-          initTableName,
-          pid: this.$route.query.pid,
-          wbsid: this.$route.query.wbsid,
-          nodeid:this.curTreeData.id,
-        }
-      })
+
+      // this.$router.push({
+      //   path: '/project/editElement',
+      //   query: {
+      //     pkeyId: pkeyId,
+      //     excelId: excelId,
+      //     id: id,
+      //     initTableName,
+      //     pid: this.$route.query.pid,
+      //     wbsid: this.$route.query.wbsid,
+      //     nodeid:this.curTreeData.id,
+      //   }
+      // })
+
+      this.editElementQuery.pkeyId = pkeyId;
+      this.editElementQuery.excelId = excelId;
+      this.editElementQuery.id = id;
+      this.editElementQuery.initTableName = initTableName;
+      this.editElementQuery.pid = this.$route.query.pid;
+      this.editElementQuery.wbsid = this.$route.query.wbsid;
+      this.editElementQuery.nodeid = this.curTreeData.id;
+
+      this.editElementVisible = true;
     },
     async getExcelHtml2 (pkeyId) {
       const { data: res } = await getExcelHtml({ pkeyId })
@@ -2677,6 +2717,8 @@ export default {
   components: {
     dynamicExcel,
     ManualSorting,
+    FormulaEdit,
+    EditElement
   },
 };
 </script>
@@ -2730,4 +2772,15 @@ export default {
   min-width: 100%;
   display: inline-block;
 }
+
+.full-dialog{
+  /deep/ .el-dialog__body{
+    padding-bottom: 0;
+    padding-top: 0;
+  }
+
+  /deep/ .basic-container{
+    height: calc(100vh - 60px);
+  }
+}
 </style>

+ 31 - 9
src/views/manager/wbsinfo/edit.vue

@@ -1587,11 +1587,16 @@
       </span>
     </el-dialog>
 
+    <el-dialog title="" :visible.sync="formulaCompVisible" fullscreen append-to-body class="full-dialog">
+      <FormulaEdit :wbsid="id" :nodeid="curTreeData.id" :eleid="formulaCurRow.id" @hideDialog="formulaCompVisible = false" v-if="formulaCompVisible"></FormulaEdit>
+    </el-dialog>
+
   </basic-container>
 </template>
 
 <script>
 import ManualSorting from '@/components/WbsTree/ManualSorting'
+import FormulaEdit from '@/views/formula/edit.vue'
 import {
   getLazytree, getDetail, update, selectByNodeTable, getAlltree,
   saveFormAndElement, selectFormElements, removeTableById, findWbsTreeSameLevel, wbsTreeSort, findWbsTreeTableSameLevel, wbsTreeTableSort, parameters, saveOrUpdateBatch, keymap, importwbsTreeFormBatch, exportBatchTemplate, updateBatchNodeTableInfo,
@@ -1743,6 +1748,9 @@ export default {
       aliasVisible:false,//别名
       aliasInput:'',
       aliasArr:[],
+
+      formulaCompVisible:false,//公式弹框
+      formulaCurRow:{},//当前元素
     };
   },
   computed: {
@@ -2396,15 +2404,18 @@ export default {
     },
 
     toFormulaEdit (row) {
-      this.$router.push({
-        path: '/formula/edit',
-        query: {
-          wbsid: this.id,
-          eleid: row.id,
-          nodeid:this.curTreeData.id
-        }
-      });
-      this.editEleFormulaVisible = false;
+      // this.$router.push({
+      //   path: '/formula/edit',
+      //   query: {
+      //     wbsid: this.id,
+      //     eleid: row.id,
+      //     nodeid:this.curTreeData.id
+      //   }
+      // });
+      //this.editEleFormulaVisible = false;
+
+      this.formulaCurRow = row;
+      this.formulaCompVisible = true;
     },
 
     getNodeTypelist () {
@@ -2897,6 +2908,7 @@ export default {
   },
   components: {
     ManualSorting,
+    FormulaEdit
   }
 };
 </script>
@@ -2941,4 +2953,14 @@ export default {
   min-width: 100%;
   display: inline-block;
 }
+
+.full-dialog{
+  /deep/ .el-dialog__body{
+    padding-bottom: 0;
+  }
+
+  /deep/ .basic-container{
+    height: calc(100vh - 60px);
+  }
+}
 </style>