duy 5 місяців тому
батько
коміт
ecd1c874ea

+ 9 - 0
src/api/modules/data-fill/division.js

@@ -90,4 +90,13 @@ export default {
             params, 
         })
     },
+    //获取节点命名配置
+    async getNodeNameConfig(params) {
+        return HcApi({
+            url: '/api/blade-manager/wbsTreeContract/getNameRuleByPkeyId',
+            method: 'get',
+            params,
+        })
+    },
+
 }

+ 16 - 3
src/views/data-fill/division.vue

@@ -2668,17 +2668,30 @@ const confirmTap = ()=>{
 //节点命名配置
 const nodeNameDialogShow = ref(false) 
 const editNamingConfigClick = async ()=>{
+    const { primaryKeyId } = treeItemInfo.value
+    if (!primaryKeyId) {
+        window.$message.warning('请先选择一个节点')
+        return 
+}
+    titleSetValue.value = []
     getTitleOptionsData().then()
+    getNodeNameConfigData().then()
     await nextTick()
     nodeNameDialogShow.value = true
 }
+//获取节点命名配置
+const getTitleOptionsData = async () => {
+  const { data } = await getDictionary({ code:'name_rule' })
+  titleOptions.value = getArrValue(data)
+    
+}
 const titleSetValue = ref('')
 const titleOptions = ref([])
 const inputVal = ref('')
 
-const getTitleOptionsData = async () => {
-  const { data } = await getDictionary({ code:'name_rule' })
-  titleOptions.value = getArrValue(data)
+const getNodeNameConfigData = async () => {
+  const { data } = await divisionApi.getNodeNameConfig({ pKeyId:treeItemInfo.value?.primaryKeyId })
+  inputVal.value = getArrValue(data)
     
 }
 // 添加 firstTree ref