ソースを参照

左右移动保存宽度

duy 1 週間 前
コミット
668061629f
1 ファイル変更18 行追加2 行削除
  1. 18 2
      src/views/data-fill/query.vue

+ 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') {