zkqh-lagrange-utils 0.0.59 → 0.0.61
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -4,12 +4,14 @@
|
|
|
4
4
|
:key="treeSelectKey"
|
|
5
5
|
:value="treeSelectValue"
|
|
6
6
|
size="small"
|
|
7
|
-
placeholder="请选择本地目录"
|
|
7
|
+
:placeholder="initLoading ? '目录加载中…' : '请选择本地目录'"
|
|
8
8
|
:consistent-menu-width="false"
|
|
9
9
|
show-path
|
|
10
10
|
separator="/"
|
|
11
11
|
filterable
|
|
12
12
|
clearable
|
|
13
|
+
:loading="initLoading"
|
|
14
|
+
:disabled="initLoading"
|
|
13
15
|
:options="treeOptions"
|
|
14
16
|
:expanded-keys="expandedKeys"
|
|
15
17
|
:menu-props="{ class: 'plugin_dir_select_tree' }"
|
|
@@ -71,6 +73,7 @@ export default defineComponent({
|
|
|
71
73
|
const expandedKeys = ref([])
|
|
72
74
|
const treeSelectKey = ref(0)
|
|
73
75
|
const defaultDisk = ref({})
|
|
76
|
+
const initLoading = ref(true)
|
|
74
77
|
|
|
75
78
|
const treeSelectValue = computed(() => toTreeKey(modelValue.value))
|
|
76
79
|
|
|
@@ -265,15 +268,20 @@ export default defineComponent({
|
|
|
265
268
|
* 并行拉默认目录与磁盘列表;有默认目录则先反填,再展开树
|
|
266
269
|
*/
|
|
267
270
|
const initDirectory = async () => {
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
271
|
+
initLoading.value = true
|
|
272
|
+
try {
|
|
273
|
+
const [info] = await Promise.all([fetchDefault(), loadDisks()])
|
|
274
|
+
if (!info) {
|
|
275
|
+
setDirname("")
|
|
276
|
+
applyDisk(null)
|
|
277
|
+
return
|
|
278
|
+
}
|
|
279
|
+
setDirname(info.root)
|
|
280
|
+
applyDisk(info.disk)
|
|
281
|
+
await hydrateTreePath(info.root)
|
|
282
|
+
} finally {
|
|
283
|
+
initLoading.value = false
|
|
273
284
|
}
|
|
274
|
-
setDirname(info.root)
|
|
275
|
-
applyDisk(info.disk)
|
|
276
|
-
await hydrateTreePath(info.root)
|
|
277
285
|
}
|
|
278
286
|
|
|
279
287
|
/**
|
|
@@ -325,6 +333,7 @@ export default defineComponent({
|
|
|
325
333
|
expandedKeys,
|
|
326
334
|
treeSelectKey,
|
|
327
335
|
treeSelectValue,
|
|
336
|
+
initLoading,
|
|
328
337
|
diskUsageText,
|
|
329
338
|
usagePercent,
|
|
330
339
|
renderTreeLabel,
|