style(admin): 全站原生下拉统一换 el-select——弹层圆角与亚马逊面一致(2026-11-17 用户口径「样式咋不是圆角 和亚马逊不统一 其他地方也要看看」)

范围:src 里原生 <select> 由 36 处清零(含全站共享分页条),15 个页面 + 1 个组件。
换法统一:class="admin-filter"(main.css 皮肤 42px/9px/#f8fbfd/focus ring)+
aria-label 定位 + el-option 显式 label;「全部 XX」空值行与 value 形状逐字保留
('' / null / String(id) / '1'/'0' / `${source}|${deviceId}` 等,下游查询参数与后端枚举不动)。

- OldPagination:每页条数下拉换 el-select(局部 import,挂载测试单 mount 也能渲染),壳压回分页条 30px/8px 档
- account 三页(菜单类型/密钥状态/分组)+ GroupsPage/UsersPage 清死 select 规则
- asin 三页(国家/弹窗分组):弹窗分组用 placeholder+clearable+:value-on-clear 钉回 null,守 number|null 契约
- patent 页(国家/分组)
- records 两页(来源/用户/终端覆盖):终端覆盖 value 仍 source|deviceId
- tasks 四页 + 任务看板(业务/状态/类型/来源/店铺/分组/场景):BrandGating/DuplicateCheck/KeywordUsage 三页本地是 34px 紧凑档,
  故把 el-select 壳压回本地 34px/7px 与同行输入框齐高(否则高 8px 错位)

测试:mount 全量 21 文件 164 passed;node --test 1924 例 1922 passed(2 红为在册:
date-range-order 环境红、company-config-entry-super-only 由 ee613db0 引入与本次无关);
vue-tsc rc=0。新增 account-select-el / records-select-el 两支换壳契约(值形状 + 空值行 + 点开→点选项)。
This commit is contained in:
2026-11-17 13:49:39 +08:00
parent 80060912ca
commit 7299166e96
25 changed files with 859 additions and 266 deletions
@@ -221,6 +221,11 @@ function modeLabel(mode: string): string {
return mode === 'selected' ? '精选' : '全量'
}
/** 终端覆盖下拉的显示文案(el-option 需要显式 label,文案与旧原生 <option> 逐字一致)。 */
function deviceOptionLabel(device: DeviceLogDevice): string {
return `${sourceLabel(device.source)} · ${device.deviceName || device.deviceId}(${device.deviceId})`
}
async function openConfig() {
configVisible.value = true
await loadConfig()
@@ -301,16 +306,20 @@ onMounted(() => {
<div class="form-row logs-filter-row">
<div class="form-group" style="min-width: 150px">
<label>来源</label>
<select v-model="sourceFilter">
<option v-for="option in SOURCE_OPTIONS" :key="option.value" :value="option.value">{{ option.label }}</option>
</select>
<!-- 2026-11-17 用户口径「和亚马逊不统一」:原生 select 弹层是直角原生物,换 el-select。
「全部来源」保留为空值首行(value 语义不变,查询参数仍是空串)。 -->
<el-select v-model="sourceFilter" class="admin-filter" aria-label="来源">
<el-option v-for="option in SOURCE_OPTIONS" :key="option.value" :label="option.label" :value="option.value" />
</el-select>
</div>
<div class="form-group" style="min-width: 180px">
<label>指定用户</label>
<select v-model="uidFilter" :disabled="usersLoading">
<option value="">全部用户</option>
<option v-for="u in userOptions" :key="u.id" :value="String(u.id)">{{ u.username }}</option>
</select>
<!-- 2026-11-17 用户口径「和亚马逊不统一」:原生 select 弹层是直角原生物,换 el-select。
「全部用户」保留为空值首行;用户值仍是 String(id)(下游按字符串判空、落库前再转数字)。 -->
<el-select v-model="uidFilter" class="admin-filter" filterable aria-label="指定用户" :disabled="usersLoading">
<el-option label="全部用户" value="" />
<el-option v-for="u in userOptions" :key="u.id" :label="u.username" :value="String(u.id)" />
</el-select>
</div>
<div class="form-group" style="min-width: 150px">
<label>日志日期(起)</label>
@@ -425,15 +434,21 @@ onMounted(() => {
<div class="config-block">
<h4>终端覆盖</h4>
<div class="override-add">
<select v-model="newOverrideKey" class="override-select">
<option value="">选择终端(最近上报的设备)</option>
<option v-for="device in devices" :key="`${device.source}|${device.deviceId}`" :value="`${device.source}|${device.deviceId}`">
{{ sourceLabel(device.source) }} · {{ device.deviceName || device.deviceId }}({{ device.deviceId }})
</option>
</select>
<select v-model="newOverrideMode">
<option v-for="option in MODE_OPTIONS" :key="option.value" :value="option.value">{{ option.label }}</option>
</select>
<!-- 2026-11-17 用户口径「和亚马逊不统一」:原生 select 弹层是直角原生物,换 el-select。
value 仍是 `${source}|${deviceId}` 与 'full'/'selected' 常量,逐字保留(addOverride
按 '|' 切分、后端按 mode 常量解析,值形状一动就错单)。 -->
<el-select v-model="newOverrideKey" class="admin-filter override-select" filterable aria-label="选择终端">
<el-option label="选择终端(最近上报的设备)" value="" />
<el-option
v-for="device in devices"
:key="`${device.source}|${device.deviceId}`"
:label="deviceOptionLabel(device)"
:value="`${device.source}|${device.deviceId}`"
/>
</el-select>
<el-select v-model="newOverrideMode" class="admin-filter override-mode" aria-label="覆盖模式">
<el-option v-for="option in MODE_OPTIONS" :key="option.value" :label="option.label" :value="option.value" />
</el-select>
<button class="btn btn-sm" type="button" @click="addOverride">添加/更新覆盖</button>
</div>
<table class="override-table">
@@ -529,8 +544,7 @@ h3 {
font-size: 12.5px;
font-weight: 600;
}
.form-group input,
.form-group select {
.form-group input {
min-width: 0;
min-height: 42px;
padding: 8px 12px;
@@ -543,8 +557,7 @@ h3 {
color-scheme: light;
outline: none;
}
.form-group input:focus,
.form-group select:focus {
.form-group input:focus {
background: #ffffff;
border-color: #5f85ad;
box-shadow: 0 0 0 3px rgba(95, 133, 173, 0.16);
@@ -743,21 +756,15 @@ td {
gap: 10px;
margin-bottom: 12px;
}
.override-add select {
min-height: 38px;
padding: 6px 10px;
border: 1px solid #cbd9e6;
border-radius: 9px;
background: #f8fbfd;
color: #24384d;
font-size: 13px;
font-family: inherit;
color-scheme: light;
}
/* 只管布局:外壳皮肤(42px/9 圆角/#f8fbfd/focus ring)由全局 .admin-filter 提供,
这里不再重复描边(旧 `.override-add select` 那段原生下拉皮肤已随 el-select 删除)。 */
.override-select {
flex: 1;
min-width: 0;
}
.override-mode {
flex: 0 0 140px;
}
.override-table td {
vertical-align: middle;
}