fix: 管理页对齐表单,操作用提示条和确认框
This commit is contained in:
+5
-1
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, watch } from "vue";
|
import { computed, watch } from "vue";
|
||||||
import { darkTheme, dateZhCN, NConfigProvider, zhCN } from "naive-ui";
|
import { darkTheme, dateZhCN, NConfigProvider, NDialogProvider, NMessageProvider, zhCN } from "naive-ui";
|
||||||
import type { GlobalThemeOverrides } from "naive-ui";
|
import type { GlobalThemeOverrides } from "naive-ui";
|
||||||
import { isDark } from "./shared/theme";
|
import { isDark } from "./shared/theme";
|
||||||
|
|
||||||
@@ -40,8 +40,12 @@ const overrides = computed<GlobalThemeOverrides>(() => ({
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<n-config-provider class="app-root" :locale="zhCN" :date-locale="dateZhCN" :theme="isDark ? darkTheme : null" :theme-overrides="overrides">
|
<n-config-provider class="app-root" :locale="zhCN" :date-locale="dateZhCN" :theme="isDark ? darkTheme : null" :theme-overrides="overrides">
|
||||||
|
<n-message-provider>
|
||||||
|
<n-dialog-provider>
|
||||||
<div class="app-root">
|
<div class="app-root">
|
||||||
<router-view />
|
<router-view />
|
||||||
</div>
|
</div>
|
||||||
|
</n-dialog-provider>
|
||||||
|
</n-message-provider>
|
||||||
</n-config-provider>
|
</n-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from "vue";
|
import { onMounted, ref } from "vue";
|
||||||
import { NButton, NModal, NSelect } from "naive-ui";
|
import { NButton, NModal, NSelect, useDialog, useMessage } from "naive-ui";
|
||||||
import Shell from "../../shell/Shell.vue";
|
import Shell from "../../shell/Shell.vue";
|
||||||
import LoginView from "../auth/LoginView.vue";
|
import LoginView from "../auth/LoginView.vue";
|
||||||
import { api } from "../../shared/http";
|
import { api } from "../../shared/http";
|
||||||
@@ -8,6 +8,8 @@ import { api } from "../../shared/http";
|
|||||||
interface Account { id: number; loginId: string; userName: string; cityName: string; role: string; sessionOpen: boolean; credentialValid: boolean }
|
interface Account { id: number; loginId: string; userName: string; cityName: string; role: string; sessionOpen: boolean; credentialValid: boolean }
|
||||||
const accounts = ref<Account[]>([]);
|
const accounts = ref<Account[]>([]);
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
|
const dialog = useDialog();
|
||||||
|
const message = useMessage();
|
||||||
|
|
||||||
async function load() {
|
async function load() {
|
||||||
const result = await api<{ accounts: Account[] }>("/api/admin/pool");
|
const result = await api<{ accounts: Account[] }>("/api/admin/pool");
|
||||||
@@ -15,13 +17,34 @@ async function load() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function setRole(id: number, role: string) {
|
async function setRole(id: number, role: string) {
|
||||||
|
try {
|
||||||
await api(`/api/admin/pool/${id}/role`, { method: "PUT", body: JSON.stringify({ role }) });
|
await api(`/api/admin/pool/${id}/role`, { method: "PUT", body: JSON.stringify({ role }) });
|
||||||
|
message.success("已保存");
|
||||||
await load();
|
await load();
|
||||||
|
} catch (error) {
|
||||||
|
message.error(error instanceof Error ? error.message : "保存失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function remove(id: number) {
|
async function remove(id: number) {
|
||||||
|
try {
|
||||||
await api(`/api/admin/pool/${id}`, { method: "DELETE" });
|
await api(`/api/admin/pool/${id}`, { method: "DELETE" });
|
||||||
|
message.success("已删除");
|
||||||
await load();
|
await load();
|
||||||
|
} catch (error) {
|
||||||
|
message.error(error instanceof Error ? error.message : "删除失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function confirmRemove(account: Account) {
|
||||||
|
dialog.warning({
|
||||||
|
title: "删除账号",
|
||||||
|
content: `从账号池删除 ${account.loginId}?`,
|
||||||
|
positiveText: "删除",
|
||||||
|
negativeText: "取消",
|
||||||
|
positiveButtonProps: { type: "error" },
|
||||||
|
onPositiveClick: () => remove(account.id),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(load);
|
onMounted(load);
|
||||||
@@ -57,7 +80,7 @@ onMounted(load);
|
|||||||
<td>
|
<td>
|
||||||
<n-select :value="account.role" size="small" style="width: 120px" :options="[{ label: '用户', value: 'user' }, { label: '管理员', value: 'admin' }]" @update:value="(value) => setRole(account.id, value)" />
|
<n-select :value="account.role" size="small" style="width: 120px" :options="[{ label: '用户', value: 'user' }, { label: '管理员', value: 'admin' }]" @update:value="(value) => setRole(account.id, value)" />
|
||||||
</td>
|
</td>
|
||||||
<td><n-button size="small" quaternary @click="remove(account.id)">删除</n-button></td>
|
<td><n-button size="small" quaternary @click="confirmRemove(account)">删除</n-button></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@@ -1,31 +1,41 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from "vue";
|
import { onMounted, ref } from "vue";
|
||||||
import { NButton, NInputNumber, NRadio, NRadioGroup } from "naive-ui";
|
import { NButton, NInputNumber, NRadio, NRadioGroup, useMessage } from "naive-ui";
|
||||||
import Shell from "../../shell/Shell.vue";
|
import Shell from "../../shell/Shell.vue";
|
||||||
import { api } from "../../shared/http";
|
import { api } from "../../shared/http";
|
||||||
|
|
||||||
|
const message = useMessage();
|
||||||
const mode = ref("local");
|
const mode = ref("local");
|
||||||
const seconds = ref(300);
|
const seconds = ref(300);
|
||||||
const concurrency = ref(4);
|
const concurrency = ref(4);
|
||||||
const message = ref("");
|
const saving = ref(false);
|
||||||
|
const loaded = ref(false);
|
||||||
|
|
||||||
async function load() {
|
async function load() {
|
||||||
|
try {
|
||||||
const result = await api<{ loginMode: string; credentialRefreshSeconds: number; workerConcurrency: number }>("/api/admin/settings");
|
const result = await api<{ loginMode: string; credentialRefreshSeconds: number; workerConcurrency: number }>("/api/admin/settings");
|
||||||
mode.value = result.loginMode;
|
mode.value = result.loginMode;
|
||||||
seconds.value = result.credentialRefreshSeconds;
|
seconds.value = result.credentialRefreshSeconds;
|
||||||
concurrency.value = result.workerConcurrency;
|
concurrency.value = result.workerConcurrency;
|
||||||
|
loaded.value = true;
|
||||||
|
} catch (error) {
|
||||||
|
message.error(error instanceof Error ? error.message : "设置没有获取到");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function save() {
|
async function save() {
|
||||||
message.value = "";
|
if (saving.value || !loaded.value) return;
|
||||||
|
saving.value = true;
|
||||||
try {
|
try {
|
||||||
await api("/api/admin/settings", {
|
await api("/api/admin/settings", {
|
||||||
method: "PUT",
|
method: "PUT",
|
||||||
body: JSON.stringify({ loginMode: mode.value, credentialRefreshSeconds: seconds.value, workerConcurrency: concurrency.value }),
|
body: JSON.stringify({ loginMode: mode.value, credentialRefreshSeconds: seconds.value, workerConcurrency: concurrency.value }),
|
||||||
});
|
});
|
||||||
message.value = "已保存";
|
message.success("已保存");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
message.value = error instanceof Error ? error.message : "保存失败";
|
message.error(error instanceof Error ? error.message : "保存失败");
|
||||||
|
} finally {
|
||||||
|
saving.value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -35,28 +45,36 @@ onMounted(load);
|
|||||||
<template>
|
<template>
|
||||||
<Shell>
|
<Shell>
|
||||||
<section class="page admin-page">
|
<section class="page admin-page">
|
||||||
|
<form class="settings-form" @submit.prevent="save">
|
||||||
<header class="page-head">
|
<header class="page-head">
|
||||||
<h2>设置</h2>
|
<h2>设置</h2>
|
||||||
<n-button type="primary" @click="save">保存</n-button>
|
<n-button type="primary" attr-type="submit" :loading="saving" :disabled="!loaded">保存</n-button>
|
||||||
</header>
|
</header>
|
||||||
<div class="settings-form">
|
<div v-if="loaded" class="admin-scroll">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label>方式</label>
|
<label for="login-mode">方式</label>
|
||||||
<n-radio-group v-model:value="mode">
|
<n-radio-group id="login-mode" v-model:value="mode">
|
||||||
<n-radio value="local">自有账号</n-radio>
|
<n-radio value="local">自有账号</n-radio>
|
||||||
<n-radio value="nqi">大数据平台账号</n-radio>
|
<n-radio value="nqi">大数据平台账号</n-radio>
|
||||||
</n-radio-group>
|
</n-radio-group>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label>刷新间隔</label>
|
<label for="refresh-seconds">刷新间隔</label>
|
||||||
<n-input-number v-model:value="seconds" :min="60" :max="86400" :show-button="false" />
|
<div class="setting-control">
|
||||||
|
<n-input-number id="refresh-seconds" v-model:value="seconds" button-placement="both" :min="60" :max="86400" :precision="0" />
|
||||||
|
<span class="setting-unit">秒</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<label>并行数量</label>
|
<label for="worker-concurrency">并行数量</label>
|
||||||
<n-input-number v-model:value="concurrency" :min="1" :max="32" :show-button="false" />
|
<div class="setting-control">
|
||||||
|
<n-input-number id="worker-concurrency" v-model:value="concurrency" button-placement="both" :min="1" :max="32" :precision="0" />
|
||||||
|
<span class="setting-unit">个</span>
|
||||||
</div>
|
</div>
|
||||||
<p v-if="message">{{ message }}</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<p v-else class="admin-status">正在获取</p>
|
||||||
|
</form>
|
||||||
</section>
|
</section>
|
||||||
</Shell>
|
</Shell>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from "vue";
|
import { onMounted, ref } from "vue";
|
||||||
import { NButton, NInput, NInputNumber, NModal, NSelect, NSwitch } from "naive-ui";
|
import { NAlert, NButton, NInput, NInputNumber, NModal, NSelect, NSwitch, useDialog, useMessage } from "naive-ui";
|
||||||
import Shell from "../../shell/Shell.vue";
|
import Shell from "../../shell/Shell.vue";
|
||||||
import { api } from "../../shared/http";
|
import { api } from "../../shared/http";
|
||||||
|
|
||||||
@@ -28,6 +28,8 @@ const password = ref("");
|
|||||||
const path = ref("");
|
const path = ref("");
|
||||||
const url = ref("");
|
const url = ref("");
|
||||||
const errorText = ref("");
|
const errorText = ref("");
|
||||||
|
const dialog = useDialog();
|
||||||
|
const message = useMessage();
|
||||||
|
|
||||||
function reset(source?: Source) {
|
function reset(source?: Source) {
|
||||||
editing.value = source || null;
|
editing.value = source || null;
|
||||||
@@ -64,6 +66,7 @@ async function save() {
|
|||||||
await api("/api/admin/sources", { method: "POST", body: JSON.stringify(body) });
|
await api("/api/admin/sources", { method: "POST", body: JSON.stringify(body) });
|
||||||
}
|
}
|
||||||
show.value = false;
|
show.value = false;
|
||||||
|
message.success("已保存");
|
||||||
await load();
|
await load();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
errorText.value = error instanceof Error ? error.message : "保存失败";
|
errorText.value = error instanceof Error ? error.message : "保存失败";
|
||||||
@@ -72,8 +75,24 @@ async function save() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function remove(id: number) {
|
async function remove(id: number) {
|
||||||
|
try {
|
||||||
await api(`/api/admin/sources/${id}`, { method: "DELETE" });
|
await api(`/api/admin/sources/${id}`, { method: "DELETE" });
|
||||||
|
message.success("已删除");
|
||||||
await load();
|
await load();
|
||||||
|
} catch (error) {
|
||||||
|
message.error(error instanceof Error ? error.message : "删除失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function confirmRemove(source: Source) {
|
||||||
|
dialog.warning({
|
||||||
|
title: "删除采集",
|
||||||
|
content: `删除 ${source.name}?`,
|
||||||
|
positiveText: "删除",
|
||||||
|
negativeText: "取消",
|
||||||
|
positiveButtonProps: { type: "error" },
|
||||||
|
onPositiveClick: () => remove(source.id),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(load);
|
onMounted(load);
|
||||||
@@ -105,7 +124,7 @@ onMounted(load);
|
|||||||
<td>{{ source.lastError || (source.enabled ? "启用" : "停用") }}</td>
|
<td>{{ source.lastError || (source.enabled ? "启用" : "停用") }}</td>
|
||||||
<td>
|
<td>
|
||||||
<n-button size="small" quaternary @click="reset(source)">编辑</n-button>
|
<n-button size="small" quaternary @click="reset(source)">编辑</n-button>
|
||||||
<n-button size="small" quaternary @click="remove(source.id)">删除</n-button>
|
<n-button size="small" quaternary @click="confirmRemove(source)">删除</n-button>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
@@ -129,7 +148,7 @@ onMounted(load);
|
|||||||
<template v-else>
|
<template v-else>
|
||||||
<div class="form-row"><label>地址</label><n-input v-model:value="url" /></div>
|
<div class="form-row"><label>地址</label><n-input v-model:value="url" /></div>
|
||||||
</template>
|
</template>
|
||||||
<p v-if="errorText" style="color: var(--danger)">{{ errorText }}</p>
|
<n-alert v-if="errorText" type="error" style="margin-bottom: 12px">{{ errorText }}</n-alert>
|
||||||
</n-modal>
|
</n-modal>
|
||||||
</Shell>
|
</Shell>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from "vue";
|
import { onMounted, ref } from "vue";
|
||||||
import { NButton, NInput, NModal, NSelect } from "naive-ui";
|
import { NAlert, NButton, NInput, NModal, NSelect, useDialog, useMessage } from "naive-ui";
|
||||||
import Shell from "../../shell/Shell.vue";
|
import Shell from "../../shell/Shell.vue";
|
||||||
import { api } from "../../shared/http";
|
import { api } from "../../shared/http";
|
||||||
|
|
||||||
interface User { id: number; username: string; role: string }
|
interface User { id: number; username: string; role: string }
|
||||||
|
const dialog = useDialog();
|
||||||
|
const message = useMessage();
|
||||||
const users = ref<User[]>([]);
|
const users = ref<User[]>([]);
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
const username = ref("");
|
const username = ref("");
|
||||||
@@ -24,6 +26,7 @@ async function create() {
|
|||||||
show.value = false;
|
show.value = false;
|
||||||
username.value = "";
|
username.value = "";
|
||||||
password.value = "";
|
password.value = "";
|
||||||
|
message.success("已添加");
|
||||||
await load();
|
await load();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
errorText.value = error instanceof Error ? error.message : "添加失败";
|
errorText.value = error instanceof Error ? error.message : "添加失败";
|
||||||
@@ -32,8 +35,24 @@ async function create() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function remove(id: number) {
|
async function remove(id: number) {
|
||||||
|
try {
|
||||||
await api(`/api/admin/users/${id}`, { method: "DELETE" });
|
await api(`/api/admin/users/${id}`, { method: "DELETE" });
|
||||||
|
message.success("已删除");
|
||||||
await load();
|
await load();
|
||||||
|
} catch (error) {
|
||||||
|
message.error(error instanceof Error ? error.message : "删除失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function confirmRemove(user: User) {
|
||||||
|
dialog.warning({
|
||||||
|
title: "删除用户",
|
||||||
|
content: `删除账号 ${user.username}?`,
|
||||||
|
positiveText: "删除",
|
||||||
|
negativeText: "取消",
|
||||||
|
positiveButtonProps: { type: "error" },
|
||||||
|
onPositiveClick: () => remove(user.id),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(load);
|
onMounted(load);
|
||||||
@@ -59,7 +78,7 @@ onMounted(load);
|
|||||||
<tr v-for="user in users" :key="user.id">
|
<tr v-for="user in users" :key="user.id">
|
||||||
<td>{{ user.username }}</td>
|
<td>{{ user.username }}</td>
|
||||||
<td>{{ user.role === "admin" ? "管理员" : "用户" }}</td>
|
<td>{{ user.role === "admin" ? "管理员" : "用户" }}</td>
|
||||||
<td><n-button size="small" quaternary @click="remove(user.id)">删除</n-button></td>
|
<td><n-button size="small" quaternary @click="confirmRemove(user)">删除</n-button></td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -70,7 +89,7 @@ onMounted(load);
|
|||||||
<div class="form-row"><label>账号</label><n-input v-model:value="username" /></div>
|
<div class="form-row"><label>账号</label><n-input v-model:value="username" /></div>
|
||||||
<div class="form-row"><label>密码</label><n-input v-model:value="password" type="password" /></div>
|
<div class="form-row"><label>密码</label><n-input v-model:value="password" type="password" /></div>
|
||||||
<div class="form-row"><label>角色</label><n-select v-model:value="role" :options="[{ label: '用户', value: 'user' }, { label: '管理员', value: 'admin' }]" /></div>
|
<div class="form-row"><label>角色</label><n-select v-model:value="role" :options="[{ label: '用户', value: 'user' }, { label: '管理员', value: 'admin' }]" /></div>
|
||||||
<p v-if="errorText" style="color: var(--danger)">{{ errorText }}</p>
|
<n-alert v-if="errorText" type="error" style="margin-bottom: 12px">{{ errorText }}</n-alert>
|
||||||
</n-modal>
|
</n-modal>
|
||||||
</Shell>
|
</Shell>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, ref } from "vue";
|
import { onMounted, ref } from "vue";
|
||||||
import { NButton, NInput, NModal, NSelect } from "naive-ui";
|
import { NAlert, NButton, NInput, NModal, NSelect, useMessage } from "naive-ui";
|
||||||
import Shell from "../../shell/Shell.vue";
|
import Shell from "../../shell/Shell.vue";
|
||||||
import { api, token } from "../../shared/http";
|
import { api, token } from "../../shared/http";
|
||||||
|
|
||||||
interface Task { id: number; status: string; format: string; cellKey: string; error: string }
|
interface Task { id: number; status: string; format: string; cellKey: string; error: string }
|
||||||
const tasks = ref<Task[]>([]);
|
const tasks = ref<Task[]>([]);
|
||||||
|
const message = useMessage();
|
||||||
const show = ref(false);
|
const show = ref(false);
|
||||||
const format = ref("xlsx");
|
const format = ref("xlsx");
|
||||||
const cellKey = ref("");
|
const cellKey = ref("");
|
||||||
@@ -34,6 +35,7 @@ async function submit() {
|
|||||||
body: JSON.stringify({ format: format.value, cellKey: cellKey.value, start: start.value, end: end.value }),
|
body: JSON.stringify({ format: format.value, cellKey: cellKey.value, start: start.value, end: end.value }),
|
||||||
});
|
});
|
||||||
show.value = false;
|
show.value = false;
|
||||||
|
message.success("已提交");
|
||||||
await load();
|
await load();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
errorText.value = error instanceof Error ? error.message : "提交失败";
|
errorText.value = error instanceof Error ? error.message : "提交失败";
|
||||||
@@ -41,7 +43,12 @@ async function submit() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function download(row: Task) {
|
async function download(row: Task) {
|
||||||
|
try {
|
||||||
const response = await fetch(`/api/tasks/${row.id}/file`, { headers: { Authorization: `Bearer ${token()}` } });
|
const response = await fetch(`/api/tasks/${row.id}/file`, { headers: { Authorization: `Bearer ${token()}` } });
|
||||||
|
if (!response.ok) {
|
||||||
|
message.error("结果还不能下载");
|
||||||
|
return;
|
||||||
|
}
|
||||||
const blob = await response.blob();
|
const blob = await response.blob();
|
||||||
const url = URL.createObjectURL(blob);
|
const url = URL.createObjectURL(blob);
|
||||||
const link = document.createElement("a");
|
const link = document.createElement("a");
|
||||||
@@ -49,6 +56,9 @@ async function download(row: Task) {
|
|||||||
link.download = `结果.${row.format}`;
|
link.download = `结果.${row.format}`;
|
||||||
link.click();
|
link.click();
|
||||||
URL.revokeObjectURL(url);
|
URL.revokeObjectURL(url);
|
||||||
|
} catch {
|
||||||
|
message.error("下载失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(load);
|
onMounted(load);
|
||||||
@@ -75,8 +85,11 @@ onMounted(load);
|
|||||||
<tr v-for="row in tasks" :key="row.id">
|
<tr v-for="row in tasks" :key="row.id">
|
||||||
<td>{{ row.cellKey || "全部" }}</td>
|
<td>{{ row.cellKey || "全部" }}</td>
|
||||||
<td>{{ row.format }}</td>
|
<td>{{ row.format }}</td>
|
||||||
<td>{{ statusLabel(row.status) }}</td>
|
<td :class="row.status === 'failed' ? 'late' : ''">{{ statusLabel(row.status) }}</td>
|
||||||
<td><n-button v-if="row.status === 'done'" size="small" quaternary @click="download(row)">下载</n-button></td>
|
<td>
|
||||||
|
<n-button v-if="row.status === 'done'" size="small" quaternary @click="download(row)">下载</n-button>
|
||||||
|
<span v-else-if="row.error" class="late">{{ row.error }}</span>
|
||||||
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@@ -88,7 +101,7 @@ onMounted(load);
|
|||||||
<div class="form-row"><label>小区</label><n-input v-model:value="cellKey" placeholder="留空则导出全部" /></div>
|
<div class="form-row"><label>小区</label><n-input v-model:value="cellKey" placeholder="留空则导出全部" /></div>
|
||||||
<div class="form-row"><label>开始</label><n-input v-model:value="start" placeholder="YYYY-MM-DD" /></div>
|
<div class="form-row"><label>开始</label><n-input v-model:value="start" placeholder="YYYY-MM-DD" /></div>
|
||||||
<div class="form-row"><label>结束</label><n-input v-model:value="end" placeholder="YYYY-MM-DD" /></div>
|
<div class="form-row"><label>结束</label><n-input v-model:value="end" placeholder="YYYY-MM-DD" /></div>
|
||||||
<p v-if="errorText" style="color: var(--danger)">{{ errorText }}</p>
|
<n-alert v-if="errorText" type="error" style="margin-bottom: 12px">{{ errorText }}</n-alert>
|
||||||
</n-modal>
|
</n-modal>
|
||||||
</Shell>
|
</Shell>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
+15
-3
@@ -5,7 +5,7 @@
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
* { box-sizing: border-box; }
|
* { box-sizing: border-box; }
|
||||||
html, body, #app, .n-config-provider, .app-root { margin: 0; height: 100%; }
|
html, body, #app, .n-config-provider, .n-message-provider, .n-dialog-provider, .app-root { margin: 0; height: 100%; }
|
||||||
body { background: var(--bg); }
|
body { background: var(--bg); }
|
||||||
button, input, select { font: inherit; }
|
button, input, select { font: inherit; }
|
||||||
::selection { background: var(--accent-soft); }
|
::selection { background: var(--accent-soft); }
|
||||||
@@ -135,8 +135,20 @@ button, input, select { font: inherit; }
|
|||||||
justify-content: start;
|
justify-content: start;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
.form-row label { white-space: nowrap; }
|
.form-row .n-input,
|
||||||
.settings-form { max-width: 640px; }
|
.form-row .n-select,
|
||||||
|
.form-row .n-input-number { width: 100%; }
|
||||||
|
.late { color: var(--danger); }
|
||||||
|
.settings-form { max-width: 720px; }
|
||||||
|
.settings-form .form-row label { min-width: 8em; }
|
||||||
|
.setting-control {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.setting-control .n-input-number { flex: 1; width: 100%; min-width: 0; }
|
||||||
|
.setting-unit { flex: none; color: var(--muted); }
|
||||||
.topbar {
|
.topbar {
|
||||||
position: sticky;
|
position: sticky;
|
||||||
top: 0;
|
top: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user