Browse Source

Merge branch 'master' into test-dev

duy 1 week ago
parent
commit
d6419b054c
4 changed files with 41 additions and 9 deletions
  1. 1 1
      package.json
  2. 18 2
      src/views/data-fill/query.vue
  3. 18 2
      src/views/data-fill/wbs.vue
  4. 4 4
      yarn.lock

+ 1 - 1
package.json

@@ -25,7 +25,7 @@
         "dayjs": "^1.11.13",
         "echarts": "^5.5.1",
         "element-plus": "^2.8.7",
-        "hc-vue3-ui": "^4.8.5",
+        "hc-vue3-ui": "^4.8.6",
         "js-base64": "^3.7.7",
         "js-fast-way": "^0.5.7",
         "js-md5": "^0.8.3",

+ 18 - 2
src/views/data-fill/query.vue

@@ -373,7 +373,7 @@
 import { nextTick, onMounted, ref, watch } from 'vue'
 import { useAppStore } from '~src/store'
 import { getStoreValue, setStoreValue } from '~src/utils/storage'
-import { arrToId, arrToKey, downloadBlob, getArrValue, getObjValue, isString } from 'js-fast-way'
+import { arrToId, arrToKey, downloadBlob, getArrValue, getObjValue, isNullES, isString } from 'js-fast-way'
 import queryApi from '~api/data-fill/query'
 
 import { eVisaTaskCheckApi } from '~api/other'
@@ -381,7 +381,8 @@ import { toPdfPage } from '~uti/btn-auth'
 import wbsApi from '~api/data-fill/wbs'
 import website from '~src/config'
 import { getDictionaryData } from '~uti/tools'
-import { getDictionary } from '~api/other'
+import { getDictionary, userConfigSave } from '~api/other'
+import { useClick } from 'hc-vue3-ui'
 
 //变量
 const useAppState = useAppStore()
@@ -420,6 +421,8 @@ onMounted(() => {
     getDictBizClassify()
     getMajorDataTypeOptions()
     isCanDown.value = !website.localModel
+    const treeWidth = useAppState.getTreeWidth
+    leftWidth.value = isNullES(treeWidth) || treeWidth <= 0 ? 440 : treeWidth
     
 })
 
@@ -996,6 +999,19 @@ const setWbsTreeShow = () => {
 
 //左右拖动,改变树形结构宽度
 const leftWidth = ref(300)
+//更新配置
+watch(
+    () => leftWidth.value,
+    (diffVal) => {
+     
+        setUserConfig(diffVal)
+    },
+)
+const setUserConfig = async (data) => {
+    await useClick()
+    useAppState.setTreeWidth(data)
+    await userConfigSave({ treeWidth: data })
+}
 const onmousedown = () => {
     let leftNum = 0
     if (isLayout.value === 'no') {

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

@@ -1,6 +1,6 @@
 <template>
     <div class="h-full">
-        <hc-page-split v-if="wbsTypeTabKey === 'tree'">
+        <hc-page-split v-if="wbsTypeTabKey === 'tree'" ref="pageSplitRef">
             <template #left>
                 <div class="left-box-container bg-white">
                     <div class="hc-project-box">
@@ -1505,17 +1505,32 @@ watch(
         }
     },
 )
+const pageSplitRef = ref(null)
+
+watch(() => pageSplitRef.value?.leftPanelWidth, (newWidth) => {
+  
+        // pageSplitRef.value?.setLeftWidth(newWidth)
+         setUserConfig(newWidth)
+   
+})
 //渲染完成
 onMounted(() => {
     console.log(projectInfo.value)
     treeLoading.value = typeName === 'tree'
     const treeWidth = useAppState.getTreeWidth
     leftWidth.value = isNullES(treeWidth) || treeWidth <= 0 ? 440 : treeWidth
-    console.log(contractInfo.value, 'contractInfo.value')
     setContractType(contractInfo.value?.contractType)
     getDictionaryApi()
     getStandardTypeOptions()
     getMajorDataTypeOptions()
+
+    setUserConfig( leftWidth.value)
+
+    nextTick(() => {
+        pageSplitRef.value?.setLeftWidth( leftWidth.value)
+    })
+     
+    
 })
 
 //身份按钮切换数据
@@ -3255,6 +3270,7 @@ const setUserConfig = async (data) => {
     await useClick()
     useAppState.setTreeWidth(data)
     await userConfigSave({ treeWidth: data })
+
 }
 
 //同步质检资料

+ 4 - 4
yarn.lock

@@ -2109,10 +2109,10 @@ has-flag@^4.0.0:
   resolved "http://219.151.181.73:9000/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
   integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
 
-hc-vue3-ui@^4.8.5:
-  version "4.8.5"
-  resolved "http://219.151.181.73:9000/hc-vue3-ui/-/hc-vue3-ui-4.8.5.tgz#3c2a159f5337b37b93d6b8ae466a395dc122ba3b"
-  integrity sha512-awTXjNeBkDpTsqsCCT4MAI2d3XFFR2a/wdIH5BeF+FDJwa/LDeEISv6g3JQrIF3NKZxaB8qEpQcpcHr9dlvQvA==
+hc-vue3-ui@^4.8.6:
+  version "4.8.6"
+  resolved "http://219.151.181.73:9000/hc-vue3-ui/-/hc-vue3-ui-4.8.6.tgz#f234633109d7feb46fb08a99d433995d8ed5b910"
+  integrity sha512-TuB/Tris0GfvYI59k8EiSRDl/5WWqkI+bURI6TxZgR2kCLlJmhHfLc4rD0RoMT0tePoPb2L3ja7aSrSrMCTY6w==
   dependencies:
     axios "^1.7.7"
     dayjs "^1.11.13"