feat: 新增银行卡检查插件及相关依赖与配置文件

This commit is contained in:
2026-10-29 14:21:30 +08:00
parent 0a32518060
commit c77a26cd99
494 changed files with 66923 additions and 2714 deletions
@@ -1,28 +1,71 @@
<template>
<button class="scene-card card" :class="{ running, compact }" @click="$emit('open', plugin.id)">
<span v-if="compact" class="sc-dot" :style="{ background: dotColor }"></span>
<span v-else class="sc-ic" :style="{ color: dotColor, background: tileBg }">{{ initial }}</span>
<span class="sc-body">
<span class="sc-head">
<!-- 左栏「场景」紧凑态:色点 + 名称 + 版本 + 箭头(保持原样) -->
<template v-if="compact">
<span class="sc-dot" :style="{ background: dotColor }"></span>
<span class="sc-body">
<b class="sc-name">{{ plugin.name }}</b>
<em v-if="!compact && plugin.category" class="sc-cat">{{ plugin.category }}</em>
</span>
<span v-if="!compact" class="sc-desc">{{ plugin.description || '暂无描述' }}</span>
<span class="sc-meta">
<em class="ver">v{{ plugin.version }}</em>
<span v-if="plugin.platform" class="plat" :class="platformOnline ? 'on' : 'off'"
:title="`${platformLabel} ${platformOnline ? '已登录' : '未登录,请先在运行台登录'}`">
<i class="dot"></i>{{ platformLabel }} · {{ platformOnline ? '已登录' : '未登录' }}
<span class="sc-meta">
<em class="ver">v{{ plugin.version }}</em>
<span v-if="plugin.platform" class="plat" :class="platformOnline ? 'on' : 'off'"
:title="`${platformTip} ${platformOnline ? '已登录' : '未登录,请先在运行台登录'}`">
<i class="dot"></i>{{ platformTip }} · {{ platformOnline ? '已登录' : '未登录' }}
</span>
</span>
</span>
</span>
<span class="sc-go" :class="{ busy: running }">
<template v-if="running">{{ store.progress }}%</template>
<svg v-else width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M4 12h16" /><path d="m13 5 7 7-7 7" />
</svg>
</span>
<span class="sc-go" :class="{ busy: running }">
<template v-if="running">{{ store.progress }}%</template>
<svg v-else width="13" height="13" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="M4 12h16" /><path d="m13 5 7 7-7 7" />
</svg>
</span>
</template>
<!-- 场景库卡:竖向排版(图标块 + 分类胶囊 → 标题 → 两行描述 → 标签 → 底部最近运行/配置运行) -->
<template v-else>
<span class="sc-top">
<span class="sc-tile" :style="{ color: dotColor, background: tileBg }">
<svg width="19" height="19" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path :d="iconPath" />
</svg>
</span>
<em v-if="plugin.category" class="sc-cat">{{ plugin.category }}</em>
</span>
<b class="sc-name">{{ plugin.name }}</b>
<span class="sc-desc">{{ plugin.description || '暂无描述' }}</span>
<span class="sc-tags">
<em class="sc-tag ver">v{{ plugin.version }}</em>
<em v-if="plugin.platform" class="sc-tag plat" :class="platformOnline ? 'on' : 'off'"
:title="`${platformTip} ${platformOnline ? '已登录' : '未登录,请先在运行台登录'}`">
<i class="dot"></i><span class="tx">{{ platformText }}</span>
</em>
</span>
<span class="sc-foot">
<span class="sc-when" :class="{ live: running }" :title="running ? '正在执行' : `最近一次运行:${whenText}`">
<i v-if="running" class="live-dot"></i>
<svg v-else width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<circle cx="12" cy="12" r="8.4" /><path d="M12 7.6V12l3 1.8" />
</svg>
{{ running ? '正在执行' : whenText }}
</span>
<span class="sc-cta" :class="{ busy: running }">
<template v-if="running">{{ store.progress }}%</template>
<template v-else>
配置运行
<svg width="11" height="11" viewBox="0 0 24 24" fill="none" stroke="currentColor"
stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
<path d="m9 5 7 7-7 7" />
</svg>
</template>
</span>
</span>
</template>
</button>
</template>
@@ -31,20 +74,62 @@ import { computed } from 'vue'
import { store } from '../store'
import { sceneDotColor } from '../utils/theme'
// 场景卡:首页「常用场景」(compact,无描述)与场景库共用。
// 场景卡:首页「常用场景」(compact,无描述)与场景库(竖向卡)共用。
// 色点按插件在总清单中的位置取色,搜索/筛选/分组后颜色仍稳定。
const props = defineProps({
plugin: { type: Object, required: true },
compact: { type: Boolean, default: false },
// 最近一次运行时间(场景库页用 /api/runs 汇总后传入),空 = 尚未运行
lastRun: { type: String, default: '' },
})
defineEmits(['open'])
const dotColor = computed(() => sceneDotColor(store.plugins.findIndex((p) => p.id === props.plugin.id)))
const tileBg = computed(() => `color-mix(in srgb, ${dotColor.value} 13%, var(--surface))`)
const initial = computed(() => (props.plugin.name || '·').trim().slice(0, 1))
const pluginIndex = computed(() => Math.max(0, store.plugins.findIndex((p) => p.id === props.plugin.id)))
// ---- 场景图标:按名称/分类关键词挑语义化线性图标(24×24 描边 path)----
const ICONS = {
user: 'M12 12a4 4 0 1 0 0-8 4 4 0 0 0 0 8z M5 20a7 7 0 0 1 14 0',
chart: 'M4 19V5 M4 19h16 M8 16v-4 M12 16V8 M16 16v-6',
sync: 'M4 9a8 8 0 0 1 13.2-3.4L20 8 M20 5v4h-4 M20 15a8 8 0 0 1-13.2 3.4L4 16 M4 19v-4h4',
bell: 'M15 17h5l-1.4-1.4A2 2 0 0 1 18 14.2V11a6 6 0 0 0-4-5.7V5a2 2 0 1 0-4 0v.3C7.7 6.2 6 8.4 6 11v3.2c0 .5-.2 1-.6 1.4L4 17h5 M15 17v1a3 3 0 1 1-6 0v-1',
doc: 'M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8l-5-5z M14 3v5h5 M9 13h6 M9 17h4',
globe: 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z M3.6 9h16.8 M3.6 15h16.8 M12 3a15 15 0 0 1 0 18 15 15 0 0 1 0-18z',
table: 'M4 5h16v14H4z M4 10h16 M4 15h16 M10 5v14',
mail: 'M4 6h16v12H4z M4 7l8 6 8-6',
check: 'M9 12l2 2 4-4 M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z',
clock: 'M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18z M12 7.5V12l3 2',
box: 'M12 3l8 4.5v9L12 21l-8-4.5v-9L12 3z M4 7.5l8 4.5 8-4.5 M12 12v9',
db: 'M4 6c0-1.7 3.6-3 8-3s8 1.3 8 3-3.6 3-8 3-8-1.3-8-3z M4 6v6c0 1.7 3.6 3 8 3s8-1.3 8-3V6 M4 12v6c0 1.7 3.6 3 8 3s8-1.3 8-3v-6',
}
const ICON_RULES = [
{ keys: ['考勤', '花名册', '人员', '员工', '人资', '社保', '招聘'], icon: ICONS.user },
{ keys: ['对账', '报表', '统计', '月报', '汇总', '分析', '台账'], icon: ICONS.chart },
{ keys: ['同步', '导入', '导出', '上传', '下载', '迁移', '入库'], icon: ICONS.sync },
{ keys: ['通知', '推送', '钉钉', '企微', '企业微信', '消息', '邮件'], icon: ICONS.bell },
{ keys: ['采集', '抓取', '爬取', '监控', '竞品', '数据'], icon: ICONS.db },
{ keys: ['审批', '流程', '工单', '待办', '签批'], icon: ICONS.doc },
{ keys: ['网页', '网站', '系统', '平台', '登录'], icon: ICONS.globe },
{ keys: ['excel', 'wps', '表格', '清单', '明细'], icon: ICONS.table },
{ keys: ['检查', '校验', '审核', '核对', '核验', '封存'], icon: ICONS.check },
{ keys: ['计划', '定时', '调度', '排班'], icon: ICONS.clock },
{ keys: ['库存', '物料', '订单', '采购', '仓库', '发货'], icon: ICONS.box },
]
const ICON_POOL = Object.values(ICONS)
// 关键词命中优先;都没命中时按清单序号从图标池轮取(同一场景始终同一个图标,不会乱跳)
const iconPath = computed(() => {
const text = `${props.plugin.name || ''} ${props.plugin.category || ''}`.toLowerCase()
const hit = ICON_RULES.find((r) => r.keys.some((k) => text.includes(k.toLowerCase())))
return hit ? hit.icon : ICON_POOL[pluginIndex.value % ICON_POOL.length]
})
const platform = computed(() => store.platforms.find((p) => p.id === props.plugin.platform) || null)
const platformLabel = computed(() => platform.value?.label || props.plugin.platform || '')
const platformTip = computed(() => platform.value?.label || props.plugin.platform || '')
const platformOnline = computed(() => !!platform.value?.online)
// 已登录只留平台名(绿点即状态),未登录显式标出,避免"点进去才发现要登录"
const platformText = computed(() => (platformOnline.value ? platformTip.value : `${platformTip.value} · 未登录`))
// 最近运行时间由父级(场景库页)按 /api/runs 汇总后传入,空 = 尚未运行
const whenText = computed(() => props.lastRun || '尚未运行')
const running = computed(() => store.running && store.selectedId === props.plugin.id)
</script>
@@ -70,43 +155,24 @@ const running = computed(() => store.running && store.selectedId === props.plugi
.scene-card.compact:hover { transform: none; box-shadow: var(--sh-card); }
.sc-dot { width: 6px; height: 6px; border-radius: 3px; flex-shrink: 0; }
.sc-ic {
width: 42px; height: 42px; border-radius: var(--r-sub); flex-shrink: 0;
display: grid; place-items: center; background: var(--brand-soft);
font: 600 16px/1 var(--f-cn);
}
.sc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.sc-head { display: flex; align-items: center; gap: var(--space-2); min-width: 0; }
.sc-name {
min-width: 0; font: 600 13px/18px var(--f-cn); color: var(--t1);
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 场景库(非 compact):标题更大、描述两行,卡片撑起来后一页不会半屏空 */
.scene-card:not(.compact) .sc-name { font: 600 14.5px/21px var(--f-cn); }
.sc-cat {
flex-shrink: 0; font-style: normal; font: 500 9.5px/15px var(--f-cn);
color: var(--brand-ink); background: var(--brand-soft);
border: 1px solid var(--brand-track); border-radius: var(--r-pill);
padding: 0 var(--space-2);
}
.sc-desc {
font-size: 12px; line-height: 17px; color: var(--t4);
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
overflow: hidden; white-space: normal;
}
.sc-meta { display: flex; align-items: center; gap: var(--space-2); margin-top: 1px; }
.scene-card:not(.compact) .sc-meta { margin-top: auto; }
.ver { font-style: normal; font: 400 10.5px/15px var(--f-num); color: var(--t4); flex-shrink: 0; }
.plat {
/* 紧凑态平台登录态(首页常用场景用):限定在 compact 内,避免污染场景库卡的标签色 */
.scene-card.compact .plat {
display: inline-flex; align-items: center; gap: 5px;
font-size: 10.5px; color: var(--t3);
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plat .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--t5); flex-shrink: 0; }
.plat.on { color: var(--good-ink); }
.plat.on .dot { background: var(--good); }
.plat.off { color: var(--warn-ink); }
.plat.off .dot { background: var(--warn); }
.scene-card.compact .plat .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--t5); flex-shrink: 0; }
.scene-card.compact .plat.on { color: var(--good-ink); }
.scene-card.compact .plat.on .dot { background: var(--good); }
.scene-card.compact .plat.off { color: var(--warn-ink); }
.scene-card.compact .plat.off .dot { background: var(--warn); }
.sc-go {
flex-shrink: 0; width: 26px; height: 26px; display: grid; place-items: center;
@@ -118,6 +184,92 @@ const running = computed(() => store.running && store.selectedId === props.plugi
.sc-go.busy { font-size: 9.5px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.scene-card.compact .sc-go { width: 22px; height: 22px; font-size: 11px; }
.scene-card.compact .sc-go.busy { font-size: 8.5px; }
.scene-card:hover .sc-go { background: var(--brand); color: var(--on-primary); border-color: transparent; box-shadow: var(--sh-brand-sm); }
.scene-card.running .sc-go { background: var(--brand); color: var(--on-primary); border-color: transparent; }
.scene-card.compact:hover .sc-go { background: var(--brand); color: var(--on-primary); border-color: transparent; box-shadow: var(--sh-brand-sm); }
.scene-card.compact.running .sc-go { background: var(--brand); color: var(--on-primary); border-color: transparent; }
/* ================= 场景库竖向卡(对齐设计稿:图标块 + 右上徽章 → 标题 → 两行描述 → 标签 → 底栏) ================= */
.scene-card:not(.compact) {
flex-direction: column; align-items: stretch; gap: 0;
height: 100%; min-height: 0; padding: var(--space-4);
background: var(--surface); border-radius: var(--r-sub); overflow: hidden;
}
/* 设计稿 hover:只加阴影 + 描边转品牌色,卡片不上浮 */
.scene-card:not(.compact):hover { transform: none; box-shadow: var(--sh-float); border-color: var(--brand-track); }
.scene-card:not(.compact):active { transform: none; }
.scene-card:not(.compact).running { background: linear-gradient(160deg, var(--brand-soft) 0%, var(--surface) 62%); }
/* 顶部:图标块(40×40)+ 右上分类徽章 */
.sc-top {
display: flex; align-items: flex-start; justify-content: space-between;
gap: var(--space-2); margin-bottom: 10px; flex-shrink: 0;
}
.sc-tile {
width: 40px; height: 40px; border-radius: 8px; flex-shrink: 0;
display: grid; place-items: center;
}
.sc-tile svg { display: block; }
.sc-cat {
flex-shrink: 0; font-style: normal; font: 500 10px/17px var(--f-cn);
color: var(--t3); background: var(--field); border: 1px solid var(--line);
border-radius: var(--r-pill); padding: 0 var(--space-2);
max-width: 118px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.scene-card:not(.compact) .sc-name {
flex-shrink: 0; font: 700 14px/20px var(--f-cn);
margin-bottom: 4px; transition: color var(--dur);
}
.scene-card:not(.compact):hover .sc-name { color: var(--brand); }
.sc-desc {
flex-shrink: 0; margin-bottom: 12px; color: var(--t3);
font-size: 12px; line-height: 18px;
display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
overflow: hidden; white-space: normal;
}
/* 标签行:版本 / 平台登录态(设计稿的灰底小标签,状态只靠圆点表达) */
.sc-tags { flex-shrink: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.sc-tag {
display: inline-flex; align-items: center; gap: 4px; max-width: 100%;
font-style: normal; font: 500 10px/17px var(--f-cn); color: var(--t3);
background: var(--field); border: 1px solid var(--line);
border-radius: 4px; padding: 0 var(--space-2);
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc-tag.ver { font-family: var(--f-num); color: var(--t4); }
.sc-tag.plat { flex-shrink: 1; min-width: 0; }
.sc-tag.plat .tx { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sc-tag.plat .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--t5); flex-shrink: 0; }
.sc-tag.plat.on .dot { background: var(--good); }
.sc-tag.plat.off .dot { background: var(--warn); }
/* 底部:最近运行 / hover 出现的「配置运行」 */
.sc-foot {
flex-shrink: 0; margin-top: auto; padding-top: 10px;
border-top: 1px solid var(--line-soft);
display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
}
.sc-when {
display: inline-flex; align-items: center; gap: 5px; min-width: 0;
font: 400 11px/16px var(--f-cn); color: var(--t4);
white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sc-when svg { flex-shrink: 0; color: var(--t5); }
.sc-when.live { color: var(--brand-ink); }
.live-dot {
width: 5px; height: 5px; border-radius: 50%; background: var(--brand);
flex-shrink: 0; animation: scPulse 1.4s var(--ease) infinite;
}
@keyframes scPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.72); } }
.sc-cta {
display: inline-flex; align-items: center; gap: 2px; flex-shrink: 0;
font: 500 12px/16px var(--f-cn); color: var(--brand);
opacity: 0; transition: opacity var(--dur), color var(--dur);
}
.sc-cta svg { display: block; }
.sc-cta.busy { font-family: var(--f-num); font-variant-numeric: tabular-nums; opacity: 1; }
.scene-card:hover .sc-cta, .scene-card.running .sc-cta { opacity: 1; }
.scene-card:hover .sc-cta { color: var(--brand-ink); }
</style>