feat(后台分组): 分组筛选与分组列仅超管可见,非超管一律隐藏

管理员/普通用户数据已由后端裁剪到本人可访问分组,分组维度对其无意义;
账号归属分组是超管职责,故只有超管需要按分组筛选与区分。

- 隐藏分组筛选+分组列:品牌数据库、查询ASIN、最低价ASIN、去重总数据、
  店铺管理、用户密钥
- 仅隐藏分组展示:店铺数据记录(筛选框+卡片行)、图片视频任务(所属分组行)、
  撞款检测(明细抽屉分组列+卡片分组标签)
- 弹窗分组选择保留展示但锁定:非超管仅1个可访问分组时自动选中并置灰
  (查询/最低价ASIN 另联动加载该分组店铺),多分组不锁以免限制用户
- 空数据行 colspan 随列显隐动态化
- 新增 tests/align-group-visibility.test.ts 回归守卫(5 条)
This commit is contained in:
2026-09-13 14:00:19 +08:00
parent 0323f0bb7b
commit 3f6ad0c6ad
10 changed files with 191 additions and 52 deletions
@@ -183,9 +183,9 @@ onMounted(() => {
<label>品牌</label>
<input v-model="filter.brand" type="text" placeholder="输入品牌" @keyup.enter="apply" />
</div>
<div class="form-group" style="min-width: 180px">
<div v-if="isSuperAdmin" class="form-group" style="min-width: 180px">
<label>分组</label>
<el-select v-model="filter.groupId" class="admin-filter" filterable clearable placeholder="全部分组" :disabled="!isSuperAdmin">
<el-select v-model="filter.groupId" class="admin-filter" filterable clearable placeholder="全部分组">
<el-option v-for="group in groupOptions" :key="group.id" :label="group.groupName" :value="group.id" />
</el-select>
</div>
@@ -199,7 +199,7 @@ onMounted(() => {
<th style="width: 70px">ID</th>
<th style="width: 170px">ASIN</th>
<th style="width: 150px">品牌</th>
<th style="width: 140px">分组</th>
<th v-if="isSuperAdmin" style="width: 140px">分组</th>
<th style="width: 110px">来源</th>
<th style="width: 170px">创建时间</th>
<th style="width: 150px">操作</th>
@@ -211,7 +211,7 @@ onMounted(() => {
<td>{{ row.id }}</td>
<td class="mono-cell">{{ row.dataValue }}</td>
<td>{{ row.brand || '—' }}</td>
<td>{{ row.groupName || '未分组' }}</td>
<td v-if="isSuperAdmin">{{ row.groupName || '未分组' }}</td>
<td>
<span class="source-text" :class="{ 'is-auto': row.recordSource !== 'MANUAL' }">
{{ recordSourceLabel(row.recordSource) }}
@@ -225,10 +225,10 @@ onMounted(() => {
</tr>
</template>
<tr v-else-if="loading">
<td colspan="7" class="empty-tip">加载中...</td>
<td :colspan="isSuperAdmin ? 7 : 6" class="empty-tip">加载中...</td>
</tr>
<tr v-else>
<td colspan="7" class="empty-tip">暂无数据</td>
<td :colspan="isSuperAdmin ? 7 : 6" class="empty-tip">暂无数据</td>
</tr>
</tbody>
</table>