Bladeren bron

新增子节点接口更改

duy 2 jaren geleden
bovenliggende
commit
db3dc395d1
3 gewijzigde bestanden met toevoegingen van 8 en 7 verwijderingen
  1. 1 1
      src/api/modules/data-fill/wbs.js
  2. 5 5
      src/views/data-fill/components/HcTreeNode.vue
  3. 2 1
      src/views/data-fill/wbs.vue

+ 1 - 1
src/api/modules/data-fill/wbs.js

@@ -83,7 +83,7 @@ export default {
     },
     async queryWbsTreeContractByContractIdAndId(form, msg = true) {
         return httpApi({
-            url: '/api/blade-manager/contractInfo/tree',
+            url: '/api/blade-manager/contractInfo/add-node-tree',
             method: 'get',
             params: form
         },msg);

+ 5 - 5
src/views/data-fill/components/HcTreeNode.vue

@@ -5,7 +5,7 @@
         <template #default="{ node, data }">
             <div class="custom-tree-node">
                 <div class="label" @dblclick="ElTreeDblClick(data)">
-                    <el-input v-if="data.isInputName" v-model="data.title" size="small" @blur="ElTreeBtnClick(data)"
+                    <el-input v-if="data.isInputName" v-model="data.fullName" size="small" @blur="ElTreeBtnClick(data)"
                               @keyup="keyUpEvent($event,data)">
                         <template #append>
                             <el-button plain size="small" type="primary" @click="ElTreeBtnClick(data)">
@@ -13,7 +13,7 @@
                             </el-button>
                         </template>
                     </el-input>
-                    <span v-else>{{ data.title }}</span>
+                    <span v-else>{{ data.fullName }}</span>
                 </div>
             </div>
         </template>
@@ -63,7 +63,7 @@ const projectId = ref(props.projectId)
 const contractId = ref(props.contractId)
 const isStrictly = ref(props.strictly)
 const wbsId=ref(props.wbsId)
-const ElTreeProps = ref({label: 'title', children: 'children', isLeaf: 'notExsitChild'})
+const ElTreeProps = ref({label: 'fullName', children: 'children', isLeaf: 'notExsitChild'})
 const  isElTreeLoadNode=ref(false)
 
 //监听
@@ -94,7 +94,7 @@ const ElTreeLoadNode = async () => {
     isElTreeLoadNode.value=true
     let nodeId = props.oldId || props.nodeId || ''
     const {error, code, data} = await wbsApi.queryWbsTreeContractByContractIdAndId({
-        wbsId: wbsId.value,
+        pKeyId: nodeId,
         contractId: contractId.value,
         projectId: projectId.value,
     })
@@ -136,7 +136,7 @@ const keyUpEvent = (e, item) => {
 }
 //更改节点名称完成
 const ElTreeBtnClick = (item) => {
-    if (!item?.title) {
+    if (!item?.fullName) {
         window?.$message?.warning('节点名称不能为空')
     } else {
         item.isInputName = false;

+ 2 - 1
src/views/data-fill/wbs.vue

@@ -1027,7 +1027,8 @@ const setTreeMenuDataClick = ({key, node, data}) => {
         copyNodeLoading.value = false
         copyNodeModal.value = true
     } else if (key === 'add') {
-        addTreeNodeId.value = data?.id
+        console.log(data,'data');
+        addTreeNodeId.value = data?.primaryKeyId
         addTreeNodeOldId.value = data?.oldId
         addNodeLoading.value = false
         addNodeModal.value = true