duy 1 týždeň pred
rodič
commit
4a600caa6e
1 zmenil súbory, kde vykonal 17 pridanie a 10 odobranie
  1. 17 10
      src/views/data-fill/wbs.vue

+ 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 })
+    }
+   
 
 }