style: 系统配置数值改为左右加减,用户操作收进设置菜单
This commit is contained in:
@@ -147,7 +147,7 @@ async function save() {
|
||||
<div class="form-row">
|
||||
<label for="refresh-interval">定时刷新间隔</label>
|
||||
<div class="setting-control">
|
||||
<n-input-number id="refresh-interval" v-model:value="refreshInterval" :min="1" :max="1440" :precision="0" />
|
||||
<n-input-number id="refresh-interval" v-model:value="refreshInterval" button-placement="both" :min="1" :max="1440" :precision="0" />
|
||||
<span class="setting-unit">分钟</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -162,7 +162,7 @@ async function save() {
|
||||
<div class="form-row">
|
||||
<label for="auto-attempts">自动滑动次数</label>
|
||||
<div class="setting-control">
|
||||
<n-input-number id="auto-attempts" v-model:value="attempts" :min="1" :max="10" :precision="0" />
|
||||
<n-input-number id="auto-attempts" v-model:value="attempts" button-placement="both" :min="1" :max="10" :precision="0" />
|
||||
<span class="setting-unit">次</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, ref } from "vue";
|
||||
import { NAlert, NButton, NModal, useDialog } from "naive-ui";
|
||||
import { NAlert, NButton, NDropdown, NIcon, NModal, useDialog, type DropdownOption } from "naive-ui";
|
||||
import { SettingsOutline } from "@vicons/ionicons5";
|
||||
|
||||
interface UserRow {
|
||||
employee_id: string;
|
||||
@@ -287,6 +288,23 @@ function confirmDelete(row: UserRow) {
|
||||
});
|
||||
}
|
||||
|
||||
function rowActions(row: UserRow): DropdownOption[] {
|
||||
const busy = checkingAll.value || checkingId.value !== "";
|
||||
return [
|
||||
{ label: "检查", key: "check", disabled: busy },
|
||||
{ label: "查看凭据", key: "credentials" },
|
||||
{ label: row.refresh_paused ? "恢复自动刷新" : "停止自动刷新", key: "refresh" },
|
||||
{ label: "删除", key: "delete", props: { style: { color: "var(--danger)" } } },
|
||||
];
|
||||
}
|
||||
|
||||
function onRowAction(row: UserRow, key: string | number) {
|
||||
if (key === "check") void checkOne(row);
|
||||
else if (key === "credentials") void openCredentials(row);
|
||||
else if (key === "refresh") confirmRefresh(row);
|
||||
else if (key === "delete") confirmDelete(row);
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
void load();
|
||||
});
|
||||
@@ -320,12 +338,11 @@ onMounted(() => {
|
||||
<td class="when">{{ formatRefreshTime(row.last_refresh_at) }}</td>
|
||||
<td>{{ row.refresh_paused ? "已停止" : "开启" }}</td>
|
||||
<td>
|
||||
<div class="row-actions">
|
||||
<n-button size="small" :loading="checkingId === row.employee_id" :disabled="checkingAll || checkingId !== ''" @click="checkOne(row)">检查</n-button>
|
||||
<n-button size="small" @click="openCredentials(row)">查看凭据</n-button>
|
||||
<n-button size="small" @click="confirmRefresh(row)">{{ row.refresh_paused ? "恢复自动刷新" : "停止自动刷新" }}</n-button>
|
||||
<n-button size="small" type="error" quaternary @click="confirmDelete(row)">删除</n-button>
|
||||
</div>
|
||||
<n-dropdown trigger="click" placement="bottom-end" :options="rowActions(row)" @select="(key) => onRowAction(row, key)">
|
||||
<n-button size="small" quaternary circle :aria-label="`工号 ${row.employee_id} 的操作`">
|
||||
<template #icon><n-icon><SettingsOutline /></n-icon></template>
|
||||
</n-button>
|
||||
</n-dropdown>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@@ -804,12 +804,6 @@ select {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.row-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.credential-note {
|
||||
margin: 0 0 12px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user