style: 统一内容区卡片、表单和对话框排版
This commit is contained in:
@@ -59,36 +59,40 @@ onMounted(load);
|
||||
<n-button type="primary" @click="show = true">添加账号</n-button>
|
||||
</header>
|
||||
<div class="admin-scroll">
|
||||
<table v-if="accounts.length" class="admin-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>账号</th>
|
||||
<th>姓名</th>
|
||||
<th>地市</th>
|
||||
<th>凭证</th>
|
||||
<th>登录</th>
|
||||
<th>角色</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="account in accounts" :key="account.id">
|
||||
<td>{{ account.loginId }}</td>
|
||||
<td>{{ account.userName }}</td>
|
||||
<td>{{ account.cityName }}</td>
|
||||
<td>{{ account.credentialValid ? "有效" : "失效" }}</td>
|
||||
<td>{{ account.sessionOpen ? "未退出" : "已退出" }}</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)" />
|
||||
</td>
|
||||
<td><n-button size="small" quaternary @click="confirmRemove(account)">删除</n-button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p v-else class="admin-status">没有账号</p>
|
||||
<div v-if="accounts.length" class="surface table-card">
|
||||
<table class="admin-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>账号</th>
|
||||
<th>姓名</th>
|
||||
<th>地市</th>
|
||||
<th>凭证</th>
|
||||
<th>登录</th>
|
||||
<th class="col-pick">角色</th>
|
||||
<th class="col-actions">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="account in accounts" :key="account.id">
|
||||
<td>{{ account.loginId }}</td>
|
||||
<td>{{ account.userName }}</td>
|
||||
<td>{{ account.cityName }}</td>
|
||||
<td :class="account.credentialValid ? 'status-ok' : 'status-bad'">{{ account.credentialValid ? "有效" : "失效" }}</td>
|
||||
<td :class="account.sessionOpen ? 'status-run' : 'status-wait'">{{ account.sessionOpen ? "未退出" : "已退出" }}</td>
|
||||
<td class="col-pick">
|
||||
<n-select :value="account.role" size="small" :options="[{ label: '用户', value: 'user' }, { label: '管理员', value: 'admin' }]" @update:value="(value) => setRole(account.id, value)" />
|
||||
</td>
|
||||
<td class="col-actions"><n-button size="small" quaternary @click="confirmRemove(account)">删除</n-button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div v-else class="surface empty-card">
|
||||
<p class="admin-status">没有账号</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<n-modal v-model:show="show" preset="card" title="添加账号" :style="{ width: 'min(440px, calc(100vw - 32px))' }">
|
||||
<n-modal v-model:show="show" class="app-dialog" preset="card" title="添加账号">
|
||||
<LoginView purpose="pool" @done="show = false; load()" />
|
||||
</n-modal>
|
||||
</Shell>
|
||||
|
||||
@@ -68,27 +68,29 @@ onMounted(load);
|
||||
<n-button type="primary" attr-type="submit" :loading="saving" :disabled="!loaded">保存</n-button>
|
||||
</header>
|
||||
<div class="admin-scroll">
|
||||
<p v-if="!loaded" class="admin-status">正在获取</p>
|
||||
<div v-else class="settings-fields">
|
||||
<div class="form-row">
|
||||
<label for="login-mode">登录方式<n-tooltip><template #trigger><n-icon class="hint-mark" :size="16"><HelpCircleOutline /></n-icon></template>自有账号登录不显示验证码。大数据平台登录会显示图形验证码,失败后换一张。管理员始终只校验本系统密码。</n-tooltip></label>
|
||||
<n-radio-group id="login-mode" :value="mode" @update:value="askMode">
|
||||
<n-radio value="local">自有账号</n-radio>
|
||||
<n-radio value="nqi">大数据平台账号</n-radio>
|
||||
</n-radio-group>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="refresh-seconds">凭证刷新间隔<n-tooltip><template #trigger><n-icon class="hint-mark" :size="16"><HelpCircleOutline /></n-icon></template>账号池里的平台凭证按这个间隔刷新。</n-tooltip></label>
|
||||
<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 class="surface settings-card">
|
||||
<p v-if="!loaded" class="admin-status">正在获取</p>
|
||||
<div v-else class="settings-fields">
|
||||
<div class="form-row">
|
||||
<label for="login-mode">登录方式<n-tooltip><template #trigger><n-icon class="hint-mark" :size="16"><HelpCircleOutline /></n-icon></template>自有账号登录不显示验证码。大数据平台登录会显示图形验证码,失败后换一张。管理员始终只校验本系统密码。</n-tooltip></label>
|
||||
<n-radio-group id="login-mode" :value="mode" @update:value="askMode">
|
||||
<n-radio value="local">自有账号</n-radio>
|
||||
<n-radio value="nqi">大数据平台账号</n-radio>
|
||||
</n-radio-group>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<label for="worker-concurrency">同时运行的任务数<n-tooltip><template #trigger><n-icon class="hint-mark" :size="16"><HelpCircleOutline /></n-icon></template>采集和导出共用。调大后马上多领任务。调小后不打断正在运行的任务。</n-tooltip></label>
|
||||
<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 class="form-row">
|
||||
<label for="refresh-seconds">凭证刷新间隔<n-tooltip><template #trigger><n-icon class="hint-mark" :size="16"><HelpCircleOutline /></n-icon></template>账号池里的平台凭证按这个间隔刷新。</n-tooltip></label>
|
||||
<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 class="form-row">
|
||||
<label for="worker-concurrency">同时运行的任务数<n-tooltip><template #trigger><n-icon class="hint-mark" :size="16"><HelpCircleOutline /></n-icon></template>采集和导出共用。调大后马上多领任务。调小后不打断正在运行的任务。</n-tooltip></label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -104,33 +104,42 @@ onMounted(load);
|
||||
<n-button type="primary" @click="reset()">添加采集</n-button>
|
||||
</header>
|
||||
<div class="admin-scroll">
|
||||
<table v-if="sources.length" class="admin-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<th>来源</th>
|
||||
<th>周期(天)</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="source in sources" :key="source.id">
|
||||
<td>{{ source.name }}</td>
|
||||
<td>{{ source.kind === "nqi" ? "NQI" : "FTP/SFTP" }}</td>
|
||||
<td>{{ source.periodDays }}</td>
|
||||
<td>{{ source.lastError || (source.enabled ? "启用" : "停用") }}</td>
|
||||
<td>
|
||||
<n-button size="small" quaternary @click="reset(source)">编辑</n-button>
|
||||
<n-button size="small" quaternary @click="confirmRemove(source)">删除</n-button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p v-else class="admin-status">没有采集</p>
|
||||
<div v-if="sources.length" class="surface table-card">
|
||||
<table class="admin-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>名称</th>
|
||||
<th>来源</th>
|
||||
<th>周期(天)</th>
|
||||
<th>状态</th>
|
||||
<th class="col-actions">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="source in sources" :key="source.id">
|
||||
<td>{{ source.name }}</td>
|
||||
<td>{{ source.kind === "nqi" ? "NQI" : "FTP/SFTP" }}</td>
|
||||
<td>{{ source.periodDays }}</td>
|
||||
<td>
|
||||
<span v-if="source.lastError" class="status-bad">{{ source.lastError }}</span>
|
||||
<span v-else :class="source.enabled ? 'status-ok' : 'status-wait'">{{ source.enabled ? "启用" : "停用" }}</span>
|
||||
</td>
|
||||
<td class="col-actions">
|
||||
<div class="row-actions">
|
||||
<n-button size="small" quaternary @click="reset(source)">编辑</n-button>
|
||||
<n-button size="small" quaternary @click="confirmRemove(source)">删除</n-button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div v-else class="surface empty-card">
|
||||
<p class="admin-status">没有采集</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<n-modal v-model:show="show" preset="dialog" title="采集" positive-text="保存" negative-text="取消" @positive-click="save">
|
||||
<n-modal v-model:show="show" class="app-dialog app-dialog-wide" preset="dialog" :show-icon="false" title="采集" positive-text="保存" negative-text="取消" @positive-click="save">
|
||||
<div class="form-row"><label>来源</label><n-select v-model:value="kind" :options="[{ label: 'FTP/SFTP', value: 'ftp' }, { label: 'NQI', value: 'nqi' }]" /></div>
|
||||
<div class="form-row"><label>名称</label><n-input v-model:value="name" /></div>
|
||||
<p class="form-section">连接</p>
|
||||
|
||||
@@ -65,26 +65,30 @@ onMounted(load);
|
||||
<n-button type="primary" @click="show = true">添加用户</n-button>
|
||||
</header>
|
||||
<div class="admin-scroll">
|
||||
<table v-if="users.length" class="admin-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>账号</th>
|
||||
<th>角色</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="user in users" :key="user.id">
|
||||
<td>{{ user.username }}</td>
|
||||
<td>{{ user.role === "admin" ? "管理员" : "用户" }}</td>
|
||||
<td><n-button size="small" quaternary @click="confirmRemove(user)">删除</n-button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p v-else class="admin-status">没有用户</p>
|
||||
<div v-if="users.length" class="surface table-card compact">
|
||||
<table class="admin-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>账号</th>
|
||||
<th class="col-role">角色</th>
|
||||
<th class="col-actions">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="user in users" :key="user.id">
|
||||
<td>{{ user.username }}</td>
|
||||
<td class="col-role">{{ user.role === "admin" ? "管理员" : "用户" }}</td>
|
||||
<td class="col-actions"><n-button size="small" quaternary @click="confirmRemove(user)">删除</n-button></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div v-else class="surface empty-card compact">
|
||||
<p class="admin-status">没有用户</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<n-modal v-model:show="show" preset="dialog" title="添加用户" positive-text="保存" negative-text="取消" @positive-click="create">
|
||||
<n-modal v-model:show="show" class="app-dialog" preset="dialog" :show-icon="false" title="添加用户" positive-text="保存" negative-text="取消" @positive-click="create">
|
||||
<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-select v-model:value="role" :options="[{ label: '用户', value: 'user' }, { label: '管理员', value: 'admin' }]" /></div>
|
||||
|
||||
@@ -263,7 +263,7 @@ async function finishNqi() {
|
||||
<n-button class="lv-go" type="primary" attr-type="submit" :loading="busy">{{ purpose === "pool" ? "添加" : "登录" }}</n-button>
|
||||
</form>
|
||||
</section>
|
||||
<n-modal v-model:show="smsRequired" :mask-closable="false" preset="card" title="短信认证" style="width: 420px">
|
||||
<n-modal v-model:show="smsRequired" class="app-dialog" :mask-closable="false" preset="card" title="短信认证">
|
||||
<n-input v-model:value="smsCode" placeholder="输入短信验证码" @keyup.enter="finishNqi" />
|
||||
<div class="sms-actions">
|
||||
<n-button @click="backFromSms">返回</n-button>
|
||||
|
||||
@@ -70,22 +70,15 @@ async function submit() {
|
||||
<div class="brand-mark" aria-hidden="true">D</div>
|
||||
<h1>安装 DecomEval</h1>
|
||||
</div>
|
||||
<div class="form-grid">
|
||||
<label>数据库主机</label>
|
||||
<n-input v-model:value="host" />
|
||||
<label>端口</label>
|
||||
<n-input v-model:value="port" :allow-input="allowPort" placeholder="5432" :input-props="{ inputmode: 'numeric', autocomplete: 'off' }" />
|
||||
<label>数据库名</label>
|
||||
<n-input v-model:value="database" />
|
||||
<label>数据库用户</label>
|
||||
<n-input v-model:value="username" />
|
||||
<label>数据库密码</label>
|
||||
<n-input v-model:value="password" type="password" />
|
||||
<label>管理员账号</label>
|
||||
<n-input v-model:value="adminUsername" />
|
||||
<label>管理员密码</label>
|
||||
<n-input v-model:value="adminPassword" type="password" />
|
||||
</div>
|
||||
<p class="form-section">数据库</p>
|
||||
<div class="form-row"><label>主机</label><n-input v-model:value="host" /></div>
|
||||
<div class="form-row"><label>端口</label><n-input v-model:value="port" :allow-input="allowPort" placeholder="5432" :input-props="{ inputmode: 'numeric', autocomplete: 'off' }" /></div>
|
||||
<div class="form-row"><label>数据库名</label><n-input v-model:value="database" /></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" show-password-on="click" /></div>
|
||||
<p class="form-section">管理员</p>
|
||||
<div class="form-row"><label>账号</label><n-input v-model:value="adminUsername" /></div>
|
||||
<div class="form-row"><label>密码</label><n-input v-model:value="adminPassword" type="password" show-password-on="click" /></div>
|
||||
<n-button class="gate-submit" type="primary" :loading="busy" @click="submit">完成安装</n-button>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
@@ -34,6 +34,13 @@ function statusLabel(status: string) {
|
||||
return "失败";
|
||||
}
|
||||
|
||||
function statusClass(status: string) {
|
||||
if (status === "done") return "status-ok";
|
||||
if (status === "running") return "status-run";
|
||||
if (status === "failed") return "status-bad";
|
||||
return "status-wait";
|
||||
}
|
||||
|
||||
function rangeLabel(row: Task) {
|
||||
if (row.start && row.end) return `${row.start} 至 ${row.end}`;
|
||||
return "全部时间";
|
||||
@@ -138,37 +145,41 @@ onUnmounted(stopPoll);
|
||||
<n-button type="primary" @click="show = true">提交任务</n-button>
|
||||
</header>
|
||||
<div class="admin-scroll">
|
||||
<table v-if="tasks.length" class="admin-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>小区</th>
|
||||
<th>时间</th>
|
||||
<th>提交时间</th>
|
||||
<th>格式</th>
|
||||
<th>状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="row in tasks" :key="row.id">
|
||||
<td>{{ row.cellKey || "全部" }}</td>
|
||||
<td>{{ rangeLabel(row) }}</td>
|
||||
<td>{{ submittedLabel(row.createdAt) }}</td>
|
||||
<td>{{ row.format }}</td>
|
||||
<td>
|
||||
<div :class="row.status === 'failed' ? 'late' : ''">{{ statusLabel(row.status) }}</div>
|
||||
<div v-if="row.error" class="late">{{ row.error }}</div>
|
||||
</td>
|
||||
<td>
|
||||
<n-button v-if="row.status === 'done'" type="primary" size="small" @click="download(row)">下载结果</n-button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p v-else class="admin-status">还没有任务</p>
|
||||
<div v-if="tasks.length" class="surface table-card">
|
||||
<table class="admin-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>小区</th>
|
||||
<th>时间</th>
|
||||
<th>提交时间</th>
|
||||
<th class="col-format">格式</th>
|
||||
<th>状态</th>
|
||||
<th class="col-actions">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="row in tasks" :key="row.id">
|
||||
<td>{{ row.cellKey || "全部" }}</td>
|
||||
<td>{{ rangeLabel(row) }}</td>
|
||||
<td>{{ submittedLabel(row.createdAt) }}</td>
|
||||
<td class="col-format">{{ row.format }}</td>
|
||||
<td>
|
||||
<div :class="statusClass(row.status)">{{ statusLabel(row.status) }}</div>
|
||||
<div v-if="row.error" class="status-bad">{{ row.error }}</div>
|
||||
</td>
|
||||
<td class="col-actions">
|
||||
<n-button v-if="row.status === 'done'" type="primary" size="small" @click="download(row)">下载结果</n-button>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div v-else class="surface empty-card">
|
||||
<p class="admin-status">还没有任务</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<n-modal v-model:show="show" preset="dialog" title="提交任务" positive-text="提交" negative-text="取消" @positive-click="submit">
|
||||
<n-modal v-model:show="show" class="app-dialog" preset="dialog" :show-icon="false" title="提交任务" positive-text="提交" negative-text="取消" @positive-click="submit">
|
||||
<div class="form-row"><label>格式</label><n-select v-model:value="format" :options="formats" /></div>
|
||||
<div class="form-row"><label>小区</label><n-input v-model:value="cellKey" placeholder="留空则导出全部" /></div>
|
||||
<div class="form-row">
|
||||
|
||||
Reference in New Issue
Block a user