feat: 新增银行卡检查插件及相关依赖与配置文件
This commit is contained in:
@@ -1,38 +1,47 @@
|
||||
<template>
|
||||
<div class="plat-page">
|
||||
<PageHead eyebrow="PLATFORMS · 平台账号" title="平台账号" sub="账号密码仅保存在本机;登录后场景按当前账号身份执行" />
|
||||
<div class="paccs">
|
||||
<div v-if="!platStatus.length" class="pacc pacc-loading card">
|
||||
<span class="spin"></span>
|
||||
<b>{{ loading ? '正在读取平台清单…' : '暂无可用平台' }}</b>
|
||||
<span>{{ loading ? '首次启动需校验平台登录态,请稍候' : '请稍后重试或联系管理员' }}</span>
|
||||
</div>
|
||||
<div v-for="p in platStatus" :key="p.id" class="pacc card" :class="{ on: p.online }">
|
||||
<div class="p-top">
|
||||
<span class="p-dot" :class="{ on: p.online }"></span>
|
||||
<span class="p-name">{{ p.label }}</span>
|
||||
<span class="p-state" :class="{ on: p.online, waiting: p.has_creds === null }">
|
||||
{{ p.has_creds === null ? (failed ? '校验失败' : '校验中') : p.online ? '已登录' : '未登录' }}
|
||||
</span>
|
||||
<PageHead eyebrow="平台账号" title="登录状态" :sub="headSub">
|
||||
<template #actions>
|
||||
<button class="btn-ghost" :disabled="loading" @click="refresh">
|
||||
{{ loading ? '校验中…' : '重新校验' }}
|
||||
</button>
|
||||
</template>
|
||||
</PageHead>
|
||||
|
||||
<div class="page-body">
|
||||
<div class="paccs">
|
||||
<div v-if="!platStatus.length" class="pacc pacc-loading">
|
||||
<span class="spin"></span>
|
||||
<b>{{ loading ? '正在读取平台清单…' : '暂无可用平台' }}</b>
|
||||
<span>{{ loading ? '首次启动需校验平台登录态,请稍候' : '请稍后重试或联系管理员' }}</span>
|
||||
</div>
|
||||
<div class="p-user" :class="{ none: p.has_creds === false, waiting: p.has_creds === null }">
|
||||
{{ p.has_creds === null ? (failed ? '登录态校验失败' : '正在校验登录态…') : p.has_creds ? p.user : '未配置个人账号' }}
|
||||
</div>
|
||||
<div class="p-acts">
|
||||
<el-button v-if="!p.online" size="small" :loading="busy === p.id" @click="login(p.id)">
|
||||
{{ busy === p.id ? '登录中…' : '登录' }}
|
||||
</el-button>
|
||||
<el-button v-else size="small" plain type="danger" :disabled="!!busy" @click="logout(p.id)">
|
||||
登出
|
||||
</el-button>
|
||||
<el-button size="small" text :disabled="p.has_creds === null" @click="openEdit(p)">配置账号</el-button>
|
||||
<div v-for="p in platStatus" :key="p.id" class="pacc" :class="{ on: p.online }">
|
||||
<div class="p-top">
|
||||
<span class="p-dot" :class="{ on: p.online }"></span>
|
||||
<span class="p-name">{{ p.label }}</span>
|
||||
<span class="p-state" :class="{ on: p.online, waiting: p.has_creds === null }">
|
||||
{{ p.has_creds === null ? (failed ? '校验失败' : '校验中') : p.online ? '已登录' : '未登录' }}
|
||||
</span>
|
||||
</div>
|
||||
<div class="p-user" :class="{ none: p.has_creds === false, waiting: p.has_creds === null }">
|
||||
{{ p.has_creds === null ? (failed ? '登录态校验失败' : '正在校验登录态…') : p.has_creds ? p.user : '未配置个人账号' }}
|
||||
</div>
|
||||
<div class="p-acts">
|
||||
<el-button v-if="!p.online" size="small" :loading="busy === p.id" @click="login(p.id)">
|
||||
{{ busy === p.id ? '登录中…' : '登录' }}
|
||||
</el-button>
|
||||
<el-button v-else size="small" plain type="danger" :disabled="!!busy" @click="logout(p.id)">
|
||||
登出
|
||||
</el-button>
|
||||
<el-button size="small" text :disabled="p.has_creds === null" @click="openEdit(p)">配置账号</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p v-if="failed" class="pacc-note">
|
||||
登录态校验未完成(平台无响应或网络异常)
|
||||
<button type="button" class="pacc-retry" :disabled="loading" @click="refresh">重新校验</button>
|
||||
</p>
|
||||
</div>
|
||||
<p v-if="failed" class="pacc-note">
|
||||
登录态校验未完成(平台无响应或网络异常)
|
||||
<button type="button" class="pacc-retry" :disabled="loading" @click="refresh">重新校验</button>
|
||||
</p>
|
||||
|
||||
<!-- 账号配置弹窗(必须 append-to-body:避免被容器包含块劫持 fixed 定位) -->
|
||||
<el-dialog v-model="dlg" :title="`配置 ${editLabel} 账号`" width="380px" align-center
|
||||
@@ -77,6 +86,12 @@ const saving = ref(false)
|
||||
|
||||
const editLabel = computed(() => (editing.value ? editing.value.label : ''))
|
||||
const hasCreds = computed(() => !!(editing.value && editing.value.has_creds))
|
||||
// 页头副标题:在线数 + 一句凭证说明(与其它页统一的"统计 + 说明"格式)
|
||||
const headSub = computed(() => {
|
||||
const total = platStatus.value.length
|
||||
const on = platStatus.value.filter((p) => p.online).length
|
||||
return `${on} / ${total} 个平台已登录 · 账号密码仅保存在本机;登录后场景按当前账号身份执行`
|
||||
})
|
||||
|
||||
async function refresh() {
|
||||
loading.value = true
|
||||
@@ -162,13 +177,30 @@ async function logout(id) {
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.plat-page { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--page-pad); flex-shrink: 0; }
|
||||
.paccs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: var(--space-2-5); }
|
||||
.plat-page { flex: 1; min-height: 0; display: flex; flex-direction: column; }
|
||||
.page-body {
|
||||
flex: 1; min-height: 0; overflow-y: auto;
|
||||
padding: 20px 24px 18px;
|
||||
display: flex; flex-direction: column; gap: var(--space-3);
|
||||
}
|
||||
.btn-ghost {
|
||||
height: 32px; padding: 0 var(--space-3);
|
||||
border: 1px solid var(--line-btn); border-radius: var(--r-row);
|
||||
background: var(--surface); color: var(--t2); cursor: pointer;
|
||||
font: 500 12.5px/1 var(--f-cn);
|
||||
transition: background var(--dur), color var(--dur);
|
||||
}
|
||||
.btn-ghost:hover:not(:disabled) { background: var(--field); color: var(--t1); }
|
||||
.btn-ghost:disabled { opacity: .5; cursor: not-allowed; }
|
||||
.paccs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
|
||||
.pacc {
|
||||
padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-2);
|
||||
background: linear-gradient(160deg, var(--subtle) 0%, var(--surface) 64%);
|
||||
padding: 16px; display: flex; flex-direction: column; gap: 10px;
|
||||
background: var(--subtle); border: 1px solid var(--line); border-radius: var(--r-sub);
|
||||
}
|
||||
.pacc.on {
|
||||
background: linear-gradient(160deg, var(--good-soft) 0%, var(--surface) 72%);
|
||||
border-color: var(--good-line);
|
||||
}
|
||||
.pacc.on { background: linear-gradient(160deg, var(--good-soft) 0%, var(--surface) 64%); }
|
||||
.p-top { display: flex; align-items: center; gap: var(--space-2); }
|
||||
.p-dot {
|
||||
flex: none; width: 8px; height: 8px; border-radius: 50%;
|
||||
@@ -192,7 +224,7 @@ async function logout(id) {
|
||||
|
||||
/* 校验中:避免空白页,给出明确的进度反馈 */
|
||||
.pacc-loading {
|
||||
grid-column: 1 / -1; min-height: 132px;
|
||||
grid-column: 1 / -1; min-height: 150px;
|
||||
align-items: center; justify-content: center; text-align: center;
|
||||
color: var(--t3); font-size: 12px;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user