Преглед изворни кода

节点类型下拉框修改

duy пре 1 година
родитељ
комит
945f5e993d
2 измењених фајлова са 15 додато и 6 уклоњено
  1. 8 0
      src/api/measure/template.js
  2. 7 6
      src/views/measure/systemUnit.vue

+ 8 - 0
src/api/measure/template.js

@@ -109,4 +109,12 @@ export const getEngineeringTypeName = (params) => {
       method: 'get',
       params
   })
+}
+//系统、项目、合同段获取节点类型列表接口
+export const getNodeTypeList = (params) => {
+  return request({
+      url: '/api/blade-meter/tree/getNodeTypeList',
+      method: 'get',
+      params
+  })
 }

+ 7 - 6
src/views/measure/systemUnit.vue

@@ -163,7 +163,7 @@
 
 <script >
 import ManualSorting from '@/components/WbsTree/ManualSorting'
-import { getLazyTree,add,getDetail,getChildList,updateNode,removeNode,getSameList,sortNode,getEngineeringTypeName } from "@/api/measure/template.js";
+import { getLazyTree,add,getDetail,getChildList,updateNode,removeNode,getSameList,sortNode,getEngineeringTypeName,getNodeTypeList } from "@/api/measure/template.js";
 import { getDictionary } from "@/api/system/dict";
 import {isObjectEmpty} from "@/util/util";
 
@@ -244,16 +244,14 @@ import {isObjectEmpty} from "@/util/util";
     init(){
       const {id} = this.$route.query;
       this.id = id
-      this.getNodeTypelist()
+      // this.getNodeTypelist(id)
     },
     //获取节点类型
-    getNodeTypelist () {
+    getNodeTypelist (id) {
       if (this.dataTypeList.length > 1) {
         return;
       }
-      getDictionary({
-        code: 'meter_node_type'
-      }).then((res) => {
+      getNodeTypeList({id}).then((res) => {
         res.data.data.forEach(element => {
           element.dictKey = Number(element.dictKey)
         });
@@ -327,6 +325,7 @@ import {isObjectEmpty} from "@/util/util";
         e.preventDefault();
         if(item.key==='add'){
           console.log('新增');
+          this.getNodeTypelist(data.id)
           this.menuKey='add'
           this.adddialogVisible=true
           this.getEngineeringTypeNameById(data.id)
@@ -336,6 +335,7 @@ import {isObjectEmpty} from "@/util/util";
         
         else if(item.key==='edit'){
           console.log('编辑',data,node);
+          this.getNodeTypelist(data.id)
           this.menuKey='edit'
           this.adddialogVisible=true
           this.editNodeHandle()
@@ -422,6 +422,7 @@ import {isObjectEmpty} from "@/util/util";
       }
     },
     getNodeDetail (data, node) {
+      this.getNodeTypelist(data.id)
       let parentName = '';
       if (node.parent.data) {
         parentName = node.parent.data.title;