From 0d89860479b865f3bba4274c5dca7c35ba4deb49 Mon Sep 17 00:00:00 2001 From: nixevol Date: Thu, 15 Oct 2026 17:08:59 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BD=91=E6=A0=BC=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E5=88=97=E8=A1=A8=E5=B9=B6=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E5=BA=95=E9=83=A8=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/views/Market.vue | 73 +++++++++++++++++++++++++--------------- 1 file changed, 45 insertions(+), 28 deletions(-) diff --git a/web/src/views/Market.vue b/web/src/views/Market.vue index 0bc2b86..4abfe50 100644 --- a/web/src/views/Market.vue +++ b/web/src/views/Market.vue @@ -70,12 +70,18 @@ const fileItems = computed(() => { return items }) const taskBusy = computed(() => !!lastTask.value?.active) -const canStart = computed(() => draft.ready && options.value.length > 0 && !submitting.value && !taskBusy.value) +const allChosen = computed(() => options.value.length > 0 && options.value.every((item) => draft.chosen.includes(item.id))) +const canStart = computed(() => draft.ready && draft.chosen.length > 0 && !submitting.value && !taskBusy.value) const clipOptions = [ { label: '与网格相交', value: 'intersects' }, { label: '中心点在网格内', value: 'center' }, ] +function toggleAll() { + draft.allMarkets = false + draft.chosen = allChosen.value ? [] : options.value.map((item) => item.id) +} + function fileActions(item) { if (item.key === 'MARKET_GPKG') return [{ label: '编辑图层', key: 'boundary', disabled: !draft.paths.MARKET_GPKG }] if (item.key === 'GIS_PROJECT_SOURCE') return [{ label: '编辑工程', key: 'project', disabled: !draft.paths.GIS_PROJECT_SOURCE }] @@ -198,7 +204,13 @@ async function loadMarkets(path) { const data = await getJSON(`/api/markets?path=${encodeURIComponent(path)}`) if (current !== marketTicket) return options.value = data.options || [] - draft.chosen = draft.chosen.filter((id) => options.value.some((item) => item.id === id)) + if (draft.allMarkets) { + draft.chosen = options.value.map((item) => item.id) + draft.allMarkets = false + } else { + const ids = new Set(options.value.map((item) => item.id)) + draft.chosen = draft.chosen.filter((id) => ids.has(id)) + } marketError.value = options.value.length ? '' : '请先导入可用的网格边界。' } catch (reason) { if (current !== marketTicket) return @@ -264,7 +276,7 @@ async function submit() { error.value = '请填写完整参数。' return } - const ids = draft.allMarkets ? options.value.map((item) => item.id) : [...draft.chosen] + const ids = [...draft.chosen] if (!ids.length) { error.value = '请至少选择一个网格。' return @@ -387,28 +399,19 @@ onUnmounted(() => { /> -
- 生成全量汇总包 - {{ marketError }} - - {{ taskBusy ? '正在处理' : '开始生成' }} -

当前任务还在处理。完成后可以按这次的选择再生成一次。

+ {{ marketError }} +
+
+ {{ allChosen ? '取消全选' : '全选' }} +
+
+ +
+ +
+
+
+

请先导入可用的网格边界。

@@ -419,7 +422,15 @@ onUnmounted(() => { {{ lastTask.output }}
-
+
+ 生成全量汇总包 +
+ 上一步 + {{ taskBusy ? '正在处理' : '开始生成' }} +
+
+

当前任务还在处理。完成后可以按这次的选择再生成一次。

+
上一步 下一步
@@ -483,7 +494,13 @@ onUnmounted(() => { .log-step { display: flex; flex-direction: column; gap: 12px; } .result-open { display: flex; align-items: center; gap: 12px; } .result-open .muted { word-break: break-all; } -.market-box { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; } -.pick { padding: 2px 0; } +.grid-list { border: 1px solid #e4ebf1; border-radius: 8px; background: #fff; } +.grid-list-head { padding: 8px 12px; border-bottom: 1px solid #f0f3f6; } +.grid-scroll { border: 0; border-radius: 0; max-height: 320px; padding: 0; } +.grid-row { padding: 8px 12px; } +.grid-row + .grid-row { border-top: 1px solid #f4f7f9; } +.empty-grids { margin: 0; padding: 12px; } +.step-actions { display: flex; align-items: center; justify-content: space-between; gap: 24px; } +.step-actions-right { display: flex; gap: 8px; flex: none; } .tip { border-bottom: 1px dashed #b7c2cc; cursor: help; }