fix: 采集弹窗收好已选表,全量检查只提示一次汇总
This commit is contained in:
@@ -61,8 +61,9 @@ async function checkAll() {
|
||||
try {
|
||||
const result = await api<{ accounts: Account[] }>("/api/admin/pool/check", { method: "POST" });
|
||||
accounts.value = result.accounts;
|
||||
const total = result.accounts.length;
|
||||
const invalid = result.accounts.filter((item) => !item.credentialValid).length;
|
||||
toast.success(invalid ? `${invalid} 个凭证已失效` : "全部凭证有效");
|
||||
toast.info(`共 ${total} 个,有效 ${total - invalid} 个,失效 ${invalid} 个`);
|
||||
} catch (error) {
|
||||
toast.error(error instanceof Error ? error.message : "检查失败");
|
||||
} finally {
|
||||
|
||||
@@ -69,8 +69,8 @@ const tableOptions = computed(() => groups.value.map((group) => ({
|
||||
children: group.tables.map((table) => ({ label: table.name, value: table.tablename })),
|
||||
})));
|
||||
const picked = computed(() => chosen.value.map((item) => item.tablename));
|
||||
const pickedText = computed(() => chosen.value.length ? `已选 ${chosen.value.length}:${chosen.value.map((item) => item.name).join("、")}` : "");
|
||||
const renderTag: SelectRenderTag = () => h("span", { class: "picker-inline" }, pickedText.value || "请选择表");
|
||||
const pickedText = computed(() => chosen.value.map((item) => item.name).join("、"));
|
||||
const renderTag: SelectRenderTag = () => h("span", { class: "picker-inline" }, pickedText.value);
|
||||
|
||||
function scheduleText(source: Source) {
|
||||
const schedule = source.config.schedule;
|
||||
@@ -270,10 +270,7 @@ onMounted(load);
|
||||
:render-tag="renderTag"
|
||||
@update:value="setPicked"
|
||||
/>
|
||||
<div class="table-picker-meta">
|
||||
<span>已选 {{ chosen.length }}</span>
|
||||
<n-button text type="primary" :disabled="!chosen.length" @click="details = true">选择详情</n-button>
|
||||
</div>
|
||||
<n-button class="picked-link" text type="primary" :disabled="!chosen.length" @click="details = true">已选 {{ chosen.length }}</n-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row"><label>数据时间</label><n-select v-model:value="timeMode" :options="timeOptions" /></div>
|
||||
@@ -291,7 +288,7 @@ onMounted(load);
|
||||
<n-time-picker v-model:formatted-value="clock" format="HH:mm" value-format="HH:mm" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row"><label>启用</label><n-switch v-model:value="enabled" /></div>
|
||||
<div class="form-row form-row-switch"><label>启用</label><n-switch v-model:value="enabled" /></div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-actions">
|
||||
@@ -323,14 +320,21 @@ onMounted(load);
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.collect-form { display: grid; gap: 12px; }
|
||||
.table-picker { display: grid; gap: 6px; min-width: 0; }
|
||||
.table-picker-meta { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
|
||||
.table-select :deep(.n-base-selection-tags) { flex-wrap: nowrap; overflow: hidden; }
|
||||
.collect-form { display: grid; gap: 12px; min-width: 0; }
|
||||
.table-picker { display: flex; align-items: center; gap: 12px; min-width: 0; }
|
||||
.table-select { flex: 1; min-width: 0; }
|
||||
.picked-link { flex: none; }
|
||||
.form-row-switch :deep(.n-switch) { width: auto; justify-self: start; }
|
||||
.table-select :deep(.n-base-selection),
|
||||
.table-select :deep(.n-base-selection-tags) { min-width: 0; overflow: hidden; }
|
||||
.table-select :deep(.n-base-selection-tags) { flex-wrap: nowrap; }
|
||||
.table-select :deep(.n-base-selection-tag-wrapper) { min-width: 0; max-width: 100%; overflow: hidden; }
|
||||
.table-select :deep(.n-base-selection-tag-wrapper:first-child) { flex: 1 1 0; }
|
||||
.table-select :deep(.n-base-selection-tag-wrapper:not(:first-child)) { display: none; }
|
||||
.table-select :deep(.picker-inline) {
|
||||
display: block;
|
||||
max-width: 280px;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
+7
-4
@@ -244,10 +244,6 @@ button, input, select { font: inherit; }
|
||||
min-width: 0;
|
||||
}
|
||||
.page-head-actions .n-input { width: min(280px, 42vw); }
|
||||
.n-card.app-dialog-collect,
|
||||
.app-dialog-collect.app-dialog {
|
||||
width: min(640px, calc(100vw - 32px));
|
||||
}
|
||||
|
||||
/* forms: label left, control right */
|
||||
.form-row {
|
||||
@@ -513,6 +509,13 @@ button, input, select { font: inherit; }
|
||||
.app-dialog-wide .n-card {
|
||||
width: min(480px, calc(100vw - 32px));
|
||||
}
|
||||
.n-dialog.app-dialog.app-dialog-collect,
|
||||
.n-card.app-dialog.app-dialog-collect {
|
||||
width: min(760px, calc(100vw - 32px));
|
||||
}
|
||||
.n-card.app-dialog.app-dialog-collect .n-card__content {
|
||||
overflow-x: hidden;
|
||||
}
|
||||
.n-dialog.app-dialog .n-dialog__content,
|
||||
.n-dialog.app-dialog-wide .n-dialog__content,
|
||||
.n-card.app-dialog .n-card__content,
|
||||
|
||||
Reference in New Issue
Block a user