浏览代码

Merge branch 'master' into test-dev

duy 1 周之前
父节点
当前提交
13d6dc19c4
共有 3 个文件被更改,包括 65 次插入22 次删除
  1. 44 11
      src/views/data-fill/query.vue
  2. 17 10
      src/views/data-fill/wbs.vue
  3. 4 1
      src/views/tentative/detect/components/linkAssociation.vue

+ 44 - 11
src/views/data-fill/query.vue

@@ -383,6 +383,7 @@ import website from '~src/config'
 import { getDictionaryData } from '~uti/tools'
 import { getDictionary, userConfigSave } from '~api/other'
 import { useClick } from 'hc-vue3-ui'
+import { nodeModuleNameResolver } from 'typescript'
 
 //变量
 const useAppState = useAppStore()
@@ -1241,6 +1242,20 @@ const batchSetRule = async ()=>{
     }
    ruleTableData.value.forEach( (ele)=>{
         ele.rule = setValue.value
+        let matchedItems = [] // 存储匹配的项
+        if (ele.rule.length > 0) {
+            // 1. 找出所有匹配的项
+            matchedItems = nodeTypeData.value.filter(dataItem => 
+                ele.rule.includes(dataItem.value),
+            )
+            // 2. 按原始 sort 排序
+            matchedItems.sort((a, b) => a.sort - b.sort)
+            
+            // 3. 更新 ele.rule 为排序后的 value 数组
+            ele.rule = matchedItems.map(item => item.value)
+            
+           
+        }
    })
 
    let arr = []
@@ -1262,19 +1277,37 @@ const batchSetRule = async ()=>{
         }
 
 }
-const ruleChange = async (ele)=>{
-   let str = ''
-   if (ele.rule.length > 0) {
-    str = ele.rule.join('-')
-   }
- let arr = [{
-    wbsId:ele.wbsId,
-  
-    nameRule:str,
- }]
+
+
+const ruleChange = async (ele) => {
+    let str = ''
+    let matchedItems = [] // 存储匹配的项
+    
+    if (ele.rule.length > 0) {
+        // 1. 找出所有匹配的项
+        matchedItems = nodeTypeData.value.filter(dataItem => 
+            ele.rule.includes(dataItem.value),
+        )
+        
+        // 2. 按原始 sort 排序
+        matchedItems.sort((a, b) => a.sort - b.sort)
+        
+        // 3. 更新 ele.rule 为排序后的 value 数组
+        ele.rule = matchedItems.map(item => item.value)
+        
+        // 4. 生成连接字符串
+        str = ele.rule.join('-')
+    }
+ 
+    
+    // 5. 调用API
+    let arr = [{
+        wbsId: ele.wbsId,
+        nameRule: str,
+    }]
+    
     let afterArr = await getRuleValue(arr)
     ele.newNodeName = afterArr[0].newNodeName
-   
 }
 const getRuleLoad = ref(false)
 const ruleTableLoading = ref(false)

+ 17 - 10
src/views/data-fill/wbs.vue

@@ -1508,9 +1508,10 @@ watch(
 const pageSplitRef = ref(null)
 
 watch(() => pageSplitRef.value?.leftPanelWidth, (newWidth) => {
-  
-        // pageSplitRef.value?.setLeftWidth(newWidth)
-         setUserConfig(newWidth)
+
+    
+    leftWidth.value = newWidth
+    setUserConfig(newWidth)
    
 })
 //渲染完成
@@ -1518,18 +1519,20 @@ onMounted(() => {
     console.log(projectInfo.value)
     treeLoading.value = typeName === 'tree'
     const treeWidth = useAppState.getTreeWidth
+    console.log(treeWidth, 'treeWidth')
+    
     leftWidth.value = isNullES(treeWidth) || treeWidth <= 0 ? 440 : treeWidth
     setContractType(contractInfo.value?.contractType)
     getDictionaryApi()
     getStandardTypeOptions()
     getMajorDataTypeOptions()
 
-    setUserConfig( leftWidth.value)
 
-    nextTick(() => {
-        pageSplitRef.value?.setLeftWidth( leftWidth.value)
-    })
+
      
+      nextTick(() => {
+       pageSplitRef.value?.setLeftWidth(leftWidth.value)
+    })
     
 })
 
@@ -3267,9 +3270,13 @@ watch(
     },
 )
 const setUserConfig = async (data) => {
-    await useClick()
-    useAppState.setTreeWidth(data)
-    await userConfigSave({ treeWidth: data })
+
+    if (data > 0) {
+         await useClick()
+        useAppState.setTreeWidth(data)
+        await userConfigSave({ treeWidth: data })
+    }
+   
 
 }
 

+ 4 - 1
src/views/tentative/detect/components/linkAssociation.vue

@@ -12,11 +12,14 @@
             </template>
             <hc-new-card>
                 <template #header>
-                    <div class="w-50">
+                    <div class="w-60">
                         <el-select v-model="searchForm.contractId" placeholder="选择合同段" filterable block>
                             <el-option v-for="item in contractData" :key="item.id" :label="item.contractName" :value="item.id" />
                         </el-select>
                     </div>
+                    <div class="ml-2 w-60">
+                        <el-input v-model="searchForm.entrustNo" clearable placeholder="委托编号" />
+                    </div>
                     <div class="ml-2">
                         <el-button type="primary" @click="searchClick">
                             <hc-icon name="search-2" />