Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c15f0ce229 | |||
| 6ccf7f2bb3 | |||
| ae250ea182 | |||
| d850c46f46 | |||
| 2a0cc86572 |
@@ -19,11 +19,24 @@ export const PLATFORM_TABS: readonly PlatformTabDef[] = [
|
||||
* 2026-11-17 晚:分类管理子菜单(admin_jd_category_manage,V204)随「京东分类管理并到
|
||||
* 京东数据库分类编辑里」用户口径整体下线(页/路由/菜单行 V208 删),key 从清单摘除。
|
||||
* 后续京东新页面上线把 key 加进这里即可,清单外的 key(含店铺管理/生成记录等
|
||||
* 存量页)一律归亚马逊或双侧清单。 */
|
||||
* 存量页)一律归亚马逊或双侧清单。
|
||||
* ⚠ 本清单只收后台(admin)侧 key——护栏用例要求每条都在 routes.ts 登记 menuKey;
|
||||
* 桌面端(app)京东菜单走 {@link JD_APP_MENU_KEYS}(无 admin 路由,不进侧边栏)。 */
|
||||
export const JD_MENU_KEYS: readonly string[] = [
|
||||
'admin_jd_database',
|
||||
]
|
||||
|
||||
/** 桌面端(app)京东菜单的 column_key 清单(V209,2026-11-17 用户口径「前台的京东少了」):
|
||||
* 组行 jd_tools(京东工具台)+两工具子行 jd-collect(京东店铺数据采集)/jd-publish(京东商品上架),
|
||||
* 与用户端 permissionKeys 逐字一致。app 菜单不进后管侧边栏与 routes.ts 路由表,故与
|
||||
* {@link JD_MENU_KEYS} 分列——判定出口 {@link platformsOfMenuKey} 两份同认。
|
||||
* 后续用户端京东新工具上线把 column_key 加进这里即可。 */
|
||||
export const JD_APP_MENU_KEYS: readonly string[] = [
|
||||
'jd_tools',
|
||||
'jd-collect',
|
||||
'jd-publish',
|
||||
]
|
||||
|
||||
/** 双侧共用菜单(2026-11-17 用户口径「这些亚马逊这边也要有」):三个账号域页面在两个
|
||||
* 平台 tab 下都显示——同一套组件、按当前 tab 给接口传 platform,各自只看/管各自平台的
|
||||
* 账号、分组、公司(后端 V206 三表加列,存量默认亚马逊,京东侧数据在编辑弹窗里翻档)。 */
|
||||
@@ -33,10 +46,10 @@ export const BOTH_PLATFORM_MENU_KEYS: readonly string[] = [
|
||||
'admin_companies',
|
||||
]
|
||||
|
||||
/** menuKey → 平台归属清单(唯一判定出口):京东独占 → ['jd'];双侧清单 → ['amazon','jd'];
|
||||
* 其余(未知 key 在内)默认亚马逊。 */
|
||||
/** menuKey → 平台归属清单(唯一判定出口):京东独占(后台或桌面端清单)→ ['jd'];
|
||||
* 双侧清单 → ['amazon','jd'];其余(未知 key 在内)默认亚马逊。 */
|
||||
export function platformsOfMenuKey(key: string): PlatformTabId[] {
|
||||
if (JD_MENU_KEYS.includes(key)) return ['jd']
|
||||
if (JD_MENU_KEYS.includes(key) || JD_APP_MENU_KEYS.includes(key)) return ['jd']
|
||||
if (BOTH_PLATFORM_MENU_KEYS.includes(key)) return ['amazon', 'jd']
|
||||
return ['amazon']
|
||||
}
|
||||
|
||||
@@ -13,7 +13,9 @@ import {
|
||||
import { showAdminFeedback } from '@/components/admin-feedback-ui'
|
||||
import { actionableErrorText } from '@/components/admin-feedback'
|
||||
|
||||
/** 新建/编辑公司(改名 + 启停 + 备注 + 所属平台 V206);写操作仅超管可用,权限由后端把关。 */
|
||||
/** 新建/编辑公司(改名 + 启停 + 备注);写操作仅超管可用,权限由后端把关。
|
||||
* 所属平台不设手选(2026-11-17 用户口径「有京东就不需要亚马逊了,亚马逊那边也是」):
|
||||
* 平台跟随当前平台 tab——新建取当前 tab(props.platform),编辑保持行值原样下发。 */
|
||||
const props = defineProps<{ modelValue: boolean; company: CompanyItem | null; platform?: PlatformTabId }>()
|
||||
const emit = defineEmits<{ (e: 'update:modelValue', v: boolean): void; (e: 'saved'): void }>()
|
||||
|
||||
@@ -77,12 +79,6 @@ async function save() {
|
||||
placeholder="请输入公司名称(全平台唯一)"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属平台">
|
||||
<el-radio-group v-model="form.platform">
|
||||
<el-radio-button value="amazon">亚马逊</el-radio-button>
|
||||
<el-radio-button value="jd">京东</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-select v-model="form.status" style="width: 100%">
|
||||
<el-option :value="COMPANY_STATUS_ACTIVE" label="启用" />
|
||||
|
||||
@@ -29,7 +29,7 @@ const props = defineProps<{
|
||||
operatorCompanyId?: number | null
|
||||
/** 当前公司 tab:这次建号落在哪家,就决定能建哪些角色。 */
|
||||
activeCompanyId?: number | null
|
||||
/** 当前平台 tab(V206):新号默认落当前平台,单选可改。 */
|
||||
/** 当前平台 tab(V206):新号落当前平台(跟随所在 tab,弹窗不再手选——2026-11-17 用户口径)。 */
|
||||
platform?: PlatformTabId
|
||||
}>()
|
||||
const emit = defineEmits<{ (e: 'update:modelValue', v: boolean): void; (e: 'created'): void }>()
|
||||
@@ -136,12 +136,6 @@ async function create(): Promise<void> {
|
||||
<el-option v-for="opt in roleChoices" :key="opt.value" :label="opt.label" :value="opt.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属平台">
|
||||
<el-radio-group v-model="form.platform">
|
||||
<el-radio-button value="amazon">亚马逊</el-radio-button>
|
||||
<el-radio-button value="jd">京东</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
v-if="operatorSuper && form.role === 'company_super_admin'"
|
||||
label="所属公司"
|
||||
@@ -184,8 +178,8 @@ async function create(): Promise<void> {
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单权限(勾选上级菜单会继承全部子菜单)">
|
||||
<div class="auth-tree-box">
|
||||
<!-- 授权树按所选平台收(2026-11-17 用户口径):选京东只给京东侧菜单,
|
||||
平台单选翻档时另一侧勾选自动剪掉(见 UserMenuAuthTree pruneChecked)。 -->
|
||||
<!-- 授权树按账号平台收(2026-11-17 用户口径):京东 tab 只给京东侧菜单。
|
||||
平台不再手选(跟随当前 tab),树收窄的判定出口不变。 -->
|
||||
<UserMenuAuthTree v-model:checked="form.columnIds" :company-id="form.companyId" :platform="form.platform" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
@@ -128,12 +128,6 @@ async function save(): Promise<void> {
|
||||
<el-form-item v-if="targetIsCompanySuperAdmin" label="角色">
|
||||
<el-input model-value="公司超级管理员" readonly />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属平台">
|
||||
<el-radio-group v-model="form.platform">
|
||||
<el-radio-button value="amazon">亚马逊</el-radio-button>
|
||||
<el-radio-button value="jd">京东</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="expiryEditable" label="到期时间(清空 = 永不过期;到期后该账号及其名下账号将停用)">
|
||||
<el-date-picker
|
||||
v-model="form.expiresAt"
|
||||
@@ -152,8 +146,8 @@ async function save(): Promise<void> {
|
||||
</el-form-item>
|
||||
<el-form-item label="菜单权限(勾选上级菜单会继承全部子菜单)">
|
||||
<div class="auth-tree-box">
|
||||
<!-- 授权树按账号平台收(2026-11-17 用户口径):京东档账号不再整树混发亚马逊菜单,
|
||||
翻档时另一侧勾选自动剪掉(见 UserMenuAuthTree pruneChecked)。 -->
|
||||
<!-- 授权树按账号平台收(2026-11-17 用户口径):京东档账号不再整树混发亚马逊菜单。
|
||||
平台不再手选(跟随当前平台 tab,编辑取行值),树收窄的判定出口不变。 -->
|
||||
<UserMenuAuthTree v-model:checked="form.columnIds" :company-id="props.companyId" :platform="form.platform" />
|
||||
<div v-if="loadingAuth" class="auth-loading">菜单权限加载中…</div>
|
||||
<div v-else-if="!authReady" class="auth-loading auth-loading-error">
|
||||
|
||||
@@ -19,7 +19,8 @@ const emit = defineEmits<{ (e: 'update:modelValue', v: boolean): void; (e: 'save
|
||||
|
||||
const session = useAdminSessionStore()
|
||||
const groupName = ref('')
|
||||
/** 所属平台(V206):新建默认当前平台 tab,编辑回填分组原值,单选可翻档。 */
|
||||
/** 所属平台(V206):不设手选(2026-11-17 用户口径「有京东就不需要亚马逊了,亚马逊那边也是」)——
|
||||
* 新建取当前平台 tab(props.platform),编辑保持分组原值,值仍随保存下发。 */
|
||||
const groupPlatform = ref<PlatformTabId>('amazon')
|
||||
const memberIds = ref<number[]>([])
|
||||
const errorText = ref('')
|
||||
@@ -119,12 +120,6 @@ onMounted(loadCandidates)
|
||||
<el-form-item label="分组名称" :error="errorText || undefined">
|
||||
<el-input v-model="groupName" placeholder="请输入分组名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="所属平台">
|
||||
<el-radio-group v-model="groupPlatform">
|
||||
<el-radio-button value="amazon">亚马逊</el-radio-button>
|
||||
<el-radio-button value="jd">京东</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="组长">
|
||||
<el-input :model-value="leaderUsername" readonly placeholder="当前登录用户" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -22,7 +22,7 @@ const loaded = ref(false)
|
||||
/**
|
||||
* 按平台过滤后的可见树(2026-11-17 用户口径「授权树也按平台收,选京东就去掉亚马逊的」):
|
||||
* 平台缺省按亚马逊(历史调用形状)。过滤算法与侧边栏同源(platform-scope 唯一出口),
|
||||
* 叶子按 menuKey 判定——京东侧只剩「京东数据库+双侧账号域三件」。
|
||||
* 叶子按 menuKey 判定——京东侧=「京东数据库+双侧账号域三件+桌面端京东工具台三件」。
|
||||
*/
|
||||
const visibleData = computed(() => filterMenuTreeNodesByPlatform(data.value, props.platform ?? 'amazon'))
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface CreateUserForm {
|
||||
expiresAt: string
|
||||
/** 所属公司 id:仅 role=company_super_admin 时由站点超管必选(2026-10-05 需求)。 */
|
||||
companyId?: number | null
|
||||
/** 所属平台(V206):弹窗打开时预填当前平台 tab,单选可改。 */
|
||||
/** 所属平台(V206):弹窗打开时预填当前平台 tab(不设手选——2026-11-17 用户口径)。 */
|
||||
platform: PlatformTabId
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ export interface CreateUserPayload {
|
||||
* 反向钉(company-user-create.test.ts)唯一豁免的例外:公司超管必须落指定公司,
|
||||
* 否则会静默落操作者自己的公司(公司 1),用户需求就是给别家公司开超管。 */
|
||||
companyId?: number
|
||||
/** 所属平台(V206):恒下发(弹窗单选默认当前平台 tab),缺省后端落 amazon。 */
|
||||
/** 所属平台(V206):恒下发(预填当前平台 tab),缺省后端落 amazon。 */
|
||||
platform: PlatformTabId
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ export interface EditUserForm {
|
||||
originalRole: string
|
||||
/** 到期时间(yyyy-MM-dd HH:mm:ss);空串 = 永不过期。null = 后端本来就无到期。 */
|
||||
expiresAt: string
|
||||
/** 所属平台(V206):单选可翻档,未知/缺省归亚马逊(存量默认)。 */
|
||||
/** 所属平台(V206):编辑回填行值(不设手选——2026-11-17 用户口径),未知/缺省归亚马逊(存量默认)。 */
|
||||
platform: PlatformTabId
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ export interface EditUserUpdateRequest {
|
||||
password?: string
|
||||
/** 到期时间:空串=清除(恢复永不过期),有值=改期;总是下发(与后端"传了就更新"对齐)。 */
|
||||
expiresAt: string
|
||||
/** 所属平台(V206):总是下发(弹窗单选恒渲染),翻档即把记录挪到另一平台的列表。 */
|
||||
/** 所属平台(V206):总是下发(编辑保持行值原样,后端显式才落)。 */
|
||||
platform: PlatformTabId
|
||||
}
|
||||
|
||||
|
||||
@@ -257,10 +257,6 @@ watch(totalPages, (pages) => {
|
||||
<h3>分类管理<span v-if="ownerGroupName" class="modal-sub">· {{ ownerGroupName }}</span></h3>
|
||||
<button class="modal-close" type="button" aria-label="关闭" @click="emit('close')">×</button>
|
||||
</div>
|
||||
<p class="modal-tip">
|
||||
分类按「数据权限分组」隔离,当前组{{ editable ? '只组长/超管可维护' : '由组长/超管维护' }};
|
||||
给商品归类:关掉本框,勾选商品后点「批量编辑分类」。
|
||||
</p>
|
||||
|
||||
<div class="manage-bar">
|
||||
<input v-model="keyword" class="search-input" type="text" placeholder="搜索分类名称" aria-label="搜索分类名称" />
|
||||
@@ -296,7 +292,6 @@ watch(totalPages, (pages) => {
|
||||
<li v-else-if="loading" class="manage-empty">加载中...</li>
|
||||
<li v-else class="manage-empty">
|
||||
<template v-if="canBootstrapGroup">
|
||||
<p class="bootstrap-lead">京东侧还没有数据权限分组,先新建一个:</p>
|
||||
<div class="group-bootstrap">
|
||||
<input
|
||||
v-model="newGroupName"
|
||||
@@ -308,7 +303,6 @@ watch(totalPages, (pages) => {
|
||||
/>
|
||||
<button class="btn" type="button" :disabled="!canCreateGroup" @click="submitCreateGroup">新建分组</button>
|
||||
</div>
|
||||
<p class="bootstrap-hint">组长=你(当前登录账号);组员稍后可在「分组管理(京东)」里加</p>
|
||||
</template>
|
||||
<template v-else>{{ emptyListText }}</template>
|
||||
</li>
|
||||
@@ -387,12 +381,6 @@ watch(totalPages, (pages) => {
|
||||
background: #eef4fa;
|
||||
color: #24384d;
|
||||
}
|
||||
.modal-tip {
|
||||
margin: 8px 0 10px;
|
||||
color: #8293a5;
|
||||
font-size: 12.5px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
/* 2026-11-17 用户口径「垂直排阿,这样好看」「不然留白太多了」:搜索与新建各占整行
|
||||
(原来两件并排 flex:1 各挤一半宽),弹窗内容变高、列表下方空白收窄,两行输入等宽也更整齐。 */
|
||||
.manage-bar {
|
||||
@@ -499,11 +487,7 @@ watch(totalPages, (pages) => {
|
||||
font-size: 13px;
|
||||
list-style: none;
|
||||
}
|
||||
/* 平台超管空态直建分组:引导语+输入行+组长说明(2026-11-17 用户口径「admin 权限最大」)。 */
|
||||
.bootstrap-lead {
|
||||
margin: 0 0 10px;
|
||||
color: #5b6f83;
|
||||
}
|
||||
/* 平台超管空态直建分组:只有输入行(引导语/组长说明等小字 2026-11-17 用户口径「小字不需要」删除)。 */
|
||||
.group-bootstrap {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
@@ -513,11 +497,6 @@ watch(totalPages, (pages) => {
|
||||
min-width: 0;
|
||||
text-align: left;
|
||||
}
|
||||
.bootstrap-hint {
|
||||
margin: 10px 0 0;
|
||||
font-size: 12px;
|
||||
color: #97a7b8;
|
||||
}
|
||||
.manage-pager {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -51,7 +51,7 @@ test('请求体:admin/normal 一律不带 companyId;公司超管必须带且
|
||||
password: 'secret123',
|
||||
role: 'normal',
|
||||
columnIds: [3, 1],
|
||||
// V206:所属平台恒下发(弹窗单选默认当前平台 tab,空表单缺省亚马逊)。
|
||||
// V206:所属平台恒下发(预填当前平台 tab,空表单缺省亚马逊;弹窗不设手选)。
|
||||
platform: 'amazon',
|
||||
})
|
||||
// 所属管理员仍按原语义携带(仅 normal 角色)
|
||||
|
||||
@@ -259,7 +259,8 @@ describe('京东分类管理对话框(V204 独立页 2026-11-17 并入京东
|
||||
jdApi.fetchJdProductGroups.mockResolvedValue([group(7, '裙装', 3)])
|
||||
const wrapper = await mountDialog()
|
||||
expect(wrapper.findAll('button').some((b) => b.text() === '批量编辑分类')).toBe(false, '归类入口在京东数据库页')
|
||||
expect(wrapper.text()).toContain('批量编辑分类', '但提示要指路(关掉本框去勾选商品归类)')
|
||||
expect(wrapper.text()).not.toContain('批量编辑分类',
|
||||
'指路小字已随 2026-11-17 用户口径「小字不需要」删除,弹窗里不该再出现这句')
|
||||
expect(jdApi.deleteJdProductGroup).not.toHaveBeenCalled()
|
||||
wrapper.unmount()
|
||||
})
|
||||
@@ -281,8 +282,8 @@ describe('平台超管空态直建京东档分组', () => {
|
||||
await flushPromises()
|
||||
await flushPromises()
|
||||
expect(jdApi.fetchJdProductGroups).not.toHaveBeenCalled()
|
||||
expect(wrapper.get('.manage-empty').text()).toContain('京东侧还没有数据权限分组')
|
||||
expect(wrapper.get('[aria-label="新分组名称"]').exists()).toBe(true)
|
||||
expect(wrapper.get('.manage-empty').find('[aria-label="新分组名称"]').exists()).toBe(true,
|
||||
'空态直建表单就在空态区里(引导语小字已删,表单本身还在)')
|
||||
|
||||
const input = wrapper.get('[aria-label="新分组名称"]')
|
||||
await input.setValue('京东-团队')
|
||||
@@ -355,7 +356,7 @@ describe('平台超管空态直建京东档分组', () => {
|
||||
await flushPromises()
|
||||
await flushPromises()
|
||||
expect(wrapper.find('[aria-label="新分组名称"]').exists()).toBe(false)
|
||||
expect(wrapper.text()).not.toContain('京东侧还没有数据权限分组')
|
||||
expect(wrapper.find('.group-bootstrap').exists()).toBe(false, '有组时直建表单整体不渲染')
|
||||
wrapper.unmount()
|
||||
})
|
||||
})
|
||||
|
||||
@@ -13,20 +13,22 @@ import { toCompanyPayload } from '../src/api/companies-dto.ts'
|
||||
/**
|
||||
* 账号域三页按平台 tab 分列(V206,2026-11-17 用户口径「这些亚马逊这边也要有……数据都是新的
|
||||
* 别把亚马逊的带过来」):users/company/biz_shop_manage_group 三表加 platform 列,存量默认亚马逊;
|
||||
* 前端同一套组件两 tab 共显,请求带 platform=当前 tab,弹窗单选默认当前平台、可翻档归侧。
|
||||
* 前端同一套组件两 tab 共显,请求带 platform=当前 tab。
|
||||
* 平台不设手选(2026-11-17 用户口径「有京东就不需要亚马逊了,亚马逊那边也是」):弹窗不再出
|
||||
* 「所属平台」单选——新建取当前平台 tab,编辑保持行值;值仍随保存下发(后端契约不变)。
|
||||
* 上架上限(jd_publish_quota)只属京东口径:编辑弹窗隐藏 + 校验/下发都跳过 + 列表列仅京东侧。
|
||||
*/
|
||||
|
||||
// ---------- 纯函数:payload 的 platform 下发与翻档 ----------
|
||||
// ---------- 纯函数:payload 的 platform 下发 ----------
|
||||
|
||||
test('建号 payload 恒带 platform:京东 tab 建的号默认归京东,单选翻档即改归属', () => {
|
||||
test('建号 payload 恒带 platform:京东 tab 建的号默认归京东(平台跟随当前 tab,弹窗不手选)', () => {
|
||||
const jd = toCreateUserRequest({ ...createEmptyCreateUserForm(), username: 'a', password: 'secret123', platform: 'jd' })
|
||||
assert.equal(jd.platform, 'jd')
|
||||
const amazon = toCreateUserRequest({ ...createEmptyCreateUserForm(), username: 'a', password: 'secret123' })
|
||||
assert.equal(amazon.platform, 'amazon', '空表单缺省亚马逊(存量口径),后端 normalizeOrCreate 同口径兜底')
|
||||
})
|
||||
|
||||
test('编辑回填 platform:行值 jd→jd,缺省/未知→amazon;请求体恒下发 platform(翻档即挪列)', () => {
|
||||
test('编辑回填 platform:行值 jd→jd,缺省/未知→amazon;请求体恒下发 platform(编辑保持行值)', () => {
|
||||
const jdForm = fillEditUserForm({ id: 7, username: '京东号', role: 'normal', platform: 'jd' })
|
||||
assert.equal(jdForm.platform, 'jd')
|
||||
assert.equal(toEditUserUpdateRequest(jdForm).platform, 'jd')
|
||||
@@ -34,7 +36,7 @@ test('编辑回填 platform:行值 jd→jd,缺省/未知→amazon;请求
|
||||
const legacy = fillEditUserForm({ id: 8, username: '存量号', role: 'normal' })
|
||||
assert.equal(legacy.platform, 'amazon', '旧负载没有 platform 时归亚马逊(存量默认),不许渲染成空串')
|
||||
|
||||
assert.equal(toEditUserUpdateRequest(legacy).platform, 'amazon', 'platform 恒下发:单选恒渲染,后端显式才落')
|
||||
assert.equal(toEditUserUpdateRequest(legacy).platform, 'amazon', 'platform 恒下发:编辑保持行值,后端显式才落')
|
||||
})
|
||||
|
||||
test('includeQuota=false(亚马逊侧编辑):不下发 jdPublishQuota,校验也跳过;platform 照常下发', () => {
|
||||
@@ -97,7 +99,7 @@ test('CompaniesPage:公司列表带平台、切平台重取数、编辑弹窗
|
||||
assert.match(page, /:platform="platformTab\.active"/, '新建公司弹窗默认落当前平台')
|
||||
})
|
||||
|
||||
test('EditUserDialog:上架上限仅京东侧显示且不参与亚马逊侧提交;所属平台单选恒在', () => {
|
||||
test('EditUserDialog:上架上限仅京东侧显示且不参与亚马逊侧提交;所属平台不设手选', () => {
|
||||
const dialog = readSource('src/pages/account/EditUserDialog.vue')
|
||||
assert.match(dialog, /v-if="includeQuota && \(targetIsCompanySuperAdmin \|\| form\.role === 'admin'\)"/,
|
||||
'quota 项必须叠上 includeQuota(京东侧)条件——只按角色判断会把该项带进亚马逊侧弹窗')
|
||||
@@ -105,26 +107,30 @@ test('EditUserDialog:上架上限仅京东侧显示且不参与亚马逊侧提
|
||||
'提交必须透传 includeQuota:亚马逊侧校验与下发都跳过 quota')
|
||||
assert.match(dialog, /validateEditUserForm\(form, \{ includeQuota: includeQuota\.value \}\)/,
|
||||
'校验与下发同口径(校验过了但不下发 = 静默改值)')
|
||||
assert.match(dialog, /v-model="form\.platform"/, '所属平台单选恒在:翻档是把记录挪到另一平台列表的唯一入口')
|
||||
assert.doesNotMatch(dialog, /v-model="form\.platform"/,
|
||||
'所属平台不设手选(2026-11-17 用户口径):平台跟随当前平台 tab,把单选写回来即红')
|
||||
assert.match(dialog, /props\.platform === 'jd'/, 'includeQuota 取自页面透传的当前平台')
|
||||
assert.match(dialog, /form\.platform = base\.platform/, '打开弹窗必须回填行值(旧负载缺省归亚马逊)')
|
||||
assert.match(dialog, /form\.platform = base\.platform/, '打开弹窗必须回填行值(旧负载缺省归亚马逊;保存原样下发)')
|
||||
})
|
||||
|
||||
test('CreateUserDialog/GroupEditorDialog/CompanyEditorDialog:新建默认当前平台、编辑回填行值', () => {
|
||||
test('CreateUserDialog/GroupEditorDialog/CompanyEditorDialog:平台不设手选,新建默认当前平台、编辑回填行值', () => {
|
||||
const create = readSource('src/pages/account/CreateUserDialog.vue')
|
||||
assert.match(create, /form\.platform = props\.platform \?\? 'amazon'/, '建号默认当前平台 tab')
|
||||
assert.match(create, /v-model="form\.platform"/, '所属平台单选在')
|
||||
assert.doesNotMatch(create, /v-model="form\.platform"/,
|
||||
'建号弹窗不设平台手选(2026-11-17 用户口径):把单选写回来即红')
|
||||
|
||||
const group = readSource('src/pages/account/GroupEditorDialog.vue')
|
||||
assert.match(group, /groupPlatform\.value = props\.platform \?\? 'amazon'/, '新建分组默认当前平台 tab')
|
||||
assert.match(group, /props\.group\.platform === 'jd' \? 'jd' : 'amazon'/, '编辑分组回填行值')
|
||||
assert.doesNotMatch(group, /v-model="groupPlatform"/, '分组弹窗不设平台手选:把单选写回来即红')
|
||||
assert.match(group, /createShopGroup\(groupName\.value, memberIds\.value, operatorId, groupPlatform\.value\)/,
|
||||
'创建分组必须带平台')
|
||||
assert.match(group, /updateShopGroup\(props\.group\.id, groupName\.value, memberIds\.value, groupPlatform\.value\)/,
|
||||
'更新分组必须带平台(翻档归侧)')
|
||||
'更新分组必须带平台(编辑保持行值下发)')
|
||||
assert.doesNotMatch(group, /companyTab/, '分组弹窗不读公司 tab(既有口径:候选按组长公司取人)')
|
||||
|
||||
const company = readSource('src/pages/account/CompanyEditorDialog.vue')
|
||||
assert.match(company, /platform: props\.platform \?\? 'amazon'/, '新建公司默认当前平台 tab')
|
||||
assert.match(company, /props\.company\.platform === 'jd' \? 'jd' : 'amazon'/, '编辑公司回填行值')
|
||||
assert.doesNotMatch(company, /v-model="form\.platform"/, '公司弹窗不设平台手选:把单选写回来即红')
|
||||
})
|
||||
|
||||
@@ -3,6 +3,7 @@ import assert from 'node:assert/strict'
|
||||
import type { AdminMenuNode } from '../src/types/admin.ts'
|
||||
import {
|
||||
BOTH_PLATFORM_MENU_KEYS,
|
||||
JD_APP_MENU_KEYS,
|
||||
JD_MENU_KEYS,
|
||||
PLATFORM_TABS,
|
||||
platformsOfMenuKey,
|
||||
@@ -115,7 +116,7 @@ test('tab 显示依据:两侧都有可见页才画 tab 条,仅一侧授权
|
||||
assert.deepEqual(visiblePlatformsFor(null), [])
|
||||
})
|
||||
|
||||
test('平台 tab 定义与两份菜单清单钉死(防清单漂移):京东独占仅数据库一页、双侧共用账号域三页', () => {
|
||||
test('平台 tab 定义与菜单清单钉死(防清单漂移):京东独占后台仅数据库一页、双侧共用账号域三页、桌面端京东工具台三件(V209)', () => {
|
||||
assert.deepEqual(PLATFORM_TABS, [
|
||||
{ id: 'amazon', label: '亚马逊' },
|
||||
{ id: 'jd', label: '京东' },
|
||||
@@ -124,6 +125,9 @@ test('平台 tab 定义与两份菜单清单钉死(防清单漂移):京东
|
||||
assert.deepEqual([...JD_MENU_KEYS], ['admin_jd_database'])
|
||||
assert.deepEqual([...BOTH_PLATFORM_MENU_KEYS].sort(),
|
||||
['admin_companies', 'admin_group_manage', 'admin_users'])
|
||||
// 桌面端(app)清单与 JD_MENU_KEYS 分列:app 菜单没有 admin 路由,不得混进
|
||||
// 「与 routes.ts 对撞」的那份(下方护栏用例只扫 JD_MENU_KEYS/BOTH 两份是刻意的)。
|
||||
assert.deepEqual([...JD_APP_MENU_KEYS].sort(), ['jd-collect', 'jd-publish', 'jd_tools'])
|
||||
})
|
||||
|
||||
test('两份清单的每一条都必须在路由注册表登记(同 company-menu-route 护栏形状:少登记=看得见点进去404)', () => {
|
||||
|
||||
@@ -88,10 +88,9 @@ test('test_task_048_normal_role_wording_agrees_across_all_exits', () => {
|
||||
const buttons = [...dialog.matchAll(/<el-radio-button\s+value="([a-z_]+)">([^<]*)</g)].map(
|
||||
(m) => [m[1], m[2]] as const,
|
||||
)
|
||||
// 2026-11-17 V206:弹窗新增「所属平台」单选(amazon/jd 两档)——角色按钮仍是前两枚,
|
||||
// 平台按钮单独钉,四出口文案对平的意图不变。
|
||||
assert.deepEqual(buttons.slice(0, 2), [['normal', word], ['admin', '管理员']], '编辑用户弹窗的角色按钮文案')
|
||||
assert.deepEqual(buttons.slice(2), [['amazon', '亚马逊'], ['jd', '京东']], '所属平台单选两档(V206 翻档归侧的唯一入口)')
|
||||
// 2026-11-17 V206 曾加「所属平台」单选;同日晚按用户口径「有京东就不需要亚马逊了」撤掉——
|
||||
// 平台跟随当前平台 tab,弹窗回到只剩角色两枚按钮(平台手选回流会在这里红)。
|
||||
assert.deepEqual(buttons, [['normal', word], ['admin', '管理员']], '编辑用户弹窗的角色按钮文案(且平台单选不得回流)')
|
||||
})
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { test } from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { filterMenuTreeNodesByPlatform, platformsOfMenuKey } from '../src/config/platform-scope.ts'
|
||||
import {
|
||||
filterMenuTreeNodesByPlatform,
|
||||
JD_APP_MENU_KEYS,
|
||||
platformsOfMenuKey,
|
||||
} from '../src/config/platform-scope.ts'
|
||||
import { filterMenuTreeByPlatform } from '../src/layout/platform-menu-filter.ts'
|
||||
import type { MenuOptionNode } from '../src/pages/account/user-menu-auth.ts'
|
||||
import { pruneCheckedIdsToTree } from '../src/pages/account/user-menu-auth.ts'
|
||||
@@ -70,6 +74,26 @@ test('判定出口不变:京东独占/双侧/默认亚马逊三个档位原样
|
||||
assert.deepEqual(platformsOfMenuKey('admin_shop_keys'), ['amazon'])
|
||||
})
|
||||
|
||||
/** 桌面端(app)分区缩影:V209 京东工具台组+两工具子行,旁置亚马逊侧 app 菜单。 */
|
||||
const APP_TREE: MenuOptionNode[] = [
|
||||
node(51, 'jd_tools', [node(511, 'jd-collect'), node(512, 'jd-publish')]),
|
||||
node(52, 'app_variant_collection'),
|
||||
]
|
||||
|
||||
test('桌面端京东侧不再整组消失:jd_tools 组+两工具保留,亚马逊 app 菜单剪掉(2026-11-17「前台的京东少了」回归钉)', () => {
|
||||
for (const key of JD_APP_MENU_KEYS) {
|
||||
assert.deepEqual(platformsOfMenuKey(key), ['jd'], `V209 app 菜单 ${key} 必须判京东侧`)
|
||||
}
|
||||
const jd = filterMenuTreeNodesByPlatform(APP_TREE, 'jd')
|
||||
assert.deepEqual(keysOf(jd), ['jd_tools(jd-collect,jd-publish)'],
|
||||
'选京东时桌面端分区必须保留京东工具台整组(叶子 key 认京东,组按存活子项去留)')
|
||||
})
|
||||
|
||||
test('桌面端亚马逊侧:京东工具台消失,亚马逊 app 菜单原样', () => {
|
||||
const amazon = filterMenuTreeNodesByPlatform(APP_TREE, 'amazon')
|
||||
assert.deepEqual(keysOf(amazon), ['app_variant_collection'])
|
||||
})
|
||||
|
||||
test('pruneCheckedIdsToTree:勾选集收敛进可见树,隐藏侧 id 被剔除且原数组不动', () => {
|
||||
const jd = filterMenuTreeNodesByPlatform(TREE, 'jd')
|
||||
const checked = [11, 12, 2, 31, 99]
|
||||
|
||||
@@ -56,8 +56,11 @@
|
||||
WHERE accessible_group_id IS NOT NULL
|
||||
ORDER BY accessible_group_id ASC
|
||||
</select>
|
||||
<!-- platform 列(2026-11-17):JdCategoryScopeService.retainJdPlatformGroups 只认本投影读出的
|
||||
platform,少了这列每行都是 null ⇒ 平台闸把全部分组(含 jd 档)判成非 jd 清空——
|
||||
与下面 selectLedGroups 同病,投影契约由 ShopManageGroupScopeSqlTest 钉。 -->
|
||||
<select id="selectAllGroups" resultType="com.nanri.aiimage.common.model.entity.ShopManageGroupEntity">
|
||||
SELECT g.id AS id, g.group_name AS groupName, g.company_id AS companyId
|
||||
SELECT g.id AS id, g.group_name AS groupName, g.company_id AS companyId, g.platform AS platform
|
||||
FROM biz_shop_manage_group g
|
||||
ORDER BY g.id ASC
|
||||
</select>
|
||||
@@ -81,7 +84,7 @@
|
||||
AND COALESCE(g.created_by_id, g.user_id) IS NOT NULL
|
||||
</select>
|
||||
<select id="selectLedGroups" resultType="com.nanri.aiimage.common.model.entity.ShopManageGroupEntity">
|
||||
SELECT g.id AS id, g.group_name AS groupName
|
||||
SELECT g.id AS id, g.group_name AS groupName, g.platform AS platform
|
||||
FROM biz_shop_manage_group g
|
||||
WHERE g.created_by_id = #{operatorId} OR g.user_id = #{operatorId}
|
||||
ORDER BY g.id ASC
|
||||
|
||||
@@ -59,9 +59,15 @@ class MigratedSqlEquivalenceTest {
|
||||
// 补 g.company_id AS companyId(注解时代原文没有这列)——改动是有意的,按 selectTaskPage/V188
|
||||
// 同款处理整行摘出、点名 NOT_MIGRATED;新形状由 47fc0e08 那单的守卫钉。该笔走 fast 档发版
|
||||
// 没点本支,2026-11-17 京东分类管理发版窗 full 闸门抓到补记。
|
||||
private static final int LEDGER_ROWS = 82;
|
||||
// 60 → 59:摘出去那行是一条 select。(59 → 58:摘 ShopManageGroupMapper#selectAllGroups 同上。)
|
||||
private static final int LEDGER_SELECTS = 58;
|
||||
// 82 → 81:2026-11-17 京东分组作用域平台闸(retainJdPlatformGroups)上线当窗事故——
|
||||
// selectAllGroups 与 selectLedGroups 都没补 g.platform AS platform 投影,每行 getPlatform()
|
||||
// 恒 null ⇒ 平台闸把全部分组(含刚建的 jd 档)判成非 jd 清空(「建组建成功、京东侧永远
|
||||
// 不显示」)。selectLedGroups 同批补列,按同款先例整行摘账本点名 NOT_MIGRATED;新形状由
|
||||
// ShopManageGroupScopeSqlTest 两条投影钉。
|
||||
private static final int LEDGER_ROWS = 81;
|
||||
// 60 → 59:摘出去那行是一条 select。(59 → 58:摘 ShopManageGroupMapper#selectAllGroups 同上。
|
||||
// 58 → 57:摘 ShopManageGroupMapper#selectLedGroups 同上(2026-11-17 platform 补列)。)
|
||||
private static final int LEDGER_SELECTS = 57;
|
||||
/** 全部 mapper XML 里的 select 总数:账本 60 + TaskImageCache 5 + AsinResultCache 1。 */
|
||||
/** 66 → 67:会话容忍新增的 {@code AdminUserMapper#countLiveWorkFor} 也是一条 select。 */
|
||||
// 67 → 78:keywordshare 模块新写 11 条 select,逐条登记进下方 NOT_MIGRATED。
|
||||
@@ -206,7 +212,12 @@ class MigratedSqlEquivalenceTest {
|
||||
// g.company_id AS companyId:注解时代原文没有这列,等价性这支对撞即红。
|
||||
// 有意改动按先例整行摘账本点名留痕(LEDGER_ROWS 83 → 82 / SELECTS 59 → 58);
|
||||
// 该笔 fast 档发版漏记,2026-11-17 京东分类管理发版窗 full 闸门抓到补记。
|
||||
"ShopManageGroupMapper#selectAllGroups");
|
||||
"ShopManageGroupMapper#selectAllGroups",
|
||||
// 2026-11-17 京东分组作用域平台闸给 selectLedGroups 补 g.platform AS platform:
|
||||
// 注解时代原文没有这列(同批 selectAllGroups 也漏了 platform 投影,那已在
|
||||
// 上面豁免),平台闸读不到平台档把全部组清空。按同款先例整行摘账本点名留痕
|
||||
// (LEDGER_ROWS 82 → 81 / SELECTS 58 → 57);新形状由 ShopManageGroupScopeSqlTest 钉。
|
||||
"ShopManageGroupMapper#selectLedGroups");
|
||||
|
||||
/** 账本 5 列:接口 / 方法 / @Select 种类 / 是否含常量插值 / 注解原文(Java 反转义后那条串)。 */
|
||||
private static final int LEDGER_COLUMNS = 5;
|
||||
|
||||
+23
-6
@@ -23,7 +23,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
* NullPointerException。平台超管是唯一走这条投影的档位,所以只有超管整页炸,非超管一切正常,
|
||||
* mock 掉 mapper 的单元用例也全都绿。
|
||||
*
|
||||
* <p>判据:投影里少了 {@code company_id},本格直接红——那条查询是「组归属公司」的唯一来源。
|
||||
* <p>2026-11-17 同一条查询再缺一次列:平台闸({@code retainJdPlatformGroups})上线时
|
||||
* {@code selectAllGroups}/{@code selectLedGroups} 都没补 {@code platform} 投影,每行
|
||||
* {@code getPlatform()} 都是 {@code null} ⇒ 平台闸把<b>全部分组(含刚建的 jd 档)判成非 jd
|
||||
* 清空</b>——平台超管在京东侧永远空作用域、空态直建口永远在、建完的组永远不显示
|
||||
* (「建组建成功、界面永远不显示」的生产实录)。两条投影的判据一并钉进本格:
|
||||
* 少 {@code company_id} 或少 {@code platform} 都直接红。
|
||||
*/
|
||||
class ShopManageGroupScopeSqlTest {
|
||||
|
||||
@@ -31,13 +36,25 @@ class ShopManageGroupScopeSqlTest {
|
||||
private static final String NS = "com.nanri.aiimage.common.mapper.ShopManageGroupMapper";
|
||||
|
||||
@Test
|
||||
void 平台超管的组清单必须投影归属公司() throws Exception {
|
||||
void 平台超管的组清单必须投影归属公司与平台档() throws Exception {
|
||||
String sql = render("selectAllGroups");
|
||||
|
||||
assertEquals("SELECT g.id AS id, g.group_name AS groupName, g.company_id AS companyId"
|
||||
+ " FROM biz_shop_manage_group g ORDER BY g.id ASC", sql,
|
||||
"投影变了:少了 company_id 就是 2026-11-16 那次线上 500(公司名映射为空、"
|
||||
+ "组标签前缀失效);多了列则要把 assemble 的跨公司前缀判据一起复核");
|
||||
assertEquals("SELECT g.id AS id, g.group_name AS groupName, g.company_id AS companyId,"
|
||||
+ " g.platform AS platform FROM biz_shop_manage_group g ORDER BY g.id ASC", sql,
|
||||
"投影变了:少 company_id 就是 2026-11-16 那次线上 500(公司名映射为空、"
|
||||
+ "组标签前缀失效);少 platform 就是 2026-11-17 那次平台闸清空全部分组"
|
||||
+ "(jd 档组建了也不显示);多了列则要把 assemble 的跨公司前缀判据一起复核");
|
||||
}
|
||||
|
||||
@Test
|
||||
void 管理员档的组清单必须投影平台档() throws Exception {
|
||||
String sql = render("selectLedGroups");
|
||||
|
||||
assertEquals("SELECT g.id AS id, g.group_name AS groupName, g.platform AS platform"
|
||||
+ " FROM biz_shop_manage_group g WHERE g.created_by_id = ? OR g.user_id = ?"
|
||||
+ " ORDER BY g.id ASC", sql,
|
||||
"组长/普通号档走这条投影过平台闸:少 platform 则 jd 档组对非超管永远不可见"
|
||||
+ "(与 selectAllGroups 同一批病灶,2026-11-17 实录)");
|
||||
}
|
||||
|
||||
private static String render(String id) throws Exception {
|
||||
|
||||
@@ -44,7 +44,6 @@ ShopManageGroupMapper selectAccessibleCreatorUserIds Select PURE SELECT DISTINCT
|
||||
ShopManageGroupMapper selectAccessibleGroupIds Select PURE SELECT DISTINCT accessible_group_id\nFROM (\n SELECT g.id AS accessible_group_id\n FROM biz_shop_manage_group g\n WHERE g.created_by_id = #{operatorId}\n OR g.user_id = #{operatorId}\n UNION\n SELECT gm.group_id AS accessible_group_id\n FROM biz_shop_manage_group_member gm\n WHERE gm.user_id = #{operatorId}\n UNION\n SELECT g2.id AS accessible_group_id\n FROM biz_shop_manage_group_member gm\n INNER JOIN biz_shop_manage_group g1 ON g1.id = gm.group_id\n INNER JOIN biz_shop_manage_group g2\n ON g2.created_by_id = COALESCE(g1.created_by_id, g1.user_id)\n OR g2.user_id = COALESCE(g1.created_by_id, g1.user_id)\n WHERE gm.user_id = #{operatorId}\n AND COALESCE(g1.created_by_id, g1.user_id) IS NOT NULL\n UNION\n SELECT member_groups.id AS accessible_group_id\n FROM biz_shop_manage_group leader_group\n INNER JOIN biz_shop_manage_group_member direct_member ON direct_member.group_id = leader_group.id\n INNER JOIN biz_shop_manage_group member_groups\n ON member_groups.created_by_id = direct_member.user_id\n OR member_groups.user_id = direct_member.user_id\n WHERE leader_group.created_by_id = #{operatorId}\n OR leader_group.user_id = #{operatorId}\n) accessible_groups\nWHERE accessible_group_id IS NOT NULL\nORDER BY accessible_group_id ASC
|
||||
ShopManageGroupMapper selectGroupNamesByUserIds Select PURE <script>\nSELECT u.id AS userId, g.group_name AS groupName\nFROM users u\nINNER JOIN biz_shop_manage_group g\n ON g.created_by_id = u.created_by_id OR g.user_id = u.created_by_id\nWHERE u.created_by_id IS NOT NULL\n AND u.id IN\n<foreach collection='userIds' item='userId' open='(' separator=',' close=')'>\n #{userId}\n</foreach>\nORDER BY g.id ASC\n</script>
|
||||
ShopManageGroupMapper selectLeaderIdsByMemberUserId Select PURE SELECT DISTINCT COALESCE(g.created_by_id, g.user_id) AS leader_id\nFROM biz_shop_manage_group_member gm\nINNER JOIN biz_shop_manage_group g ON g.id = gm.group_id\nWHERE gm.user_id = #{userId}\n AND COALESCE(g.created_by_id, g.user_id) IS NOT NULL
|
||||
ShopManageGroupMapper selectLedGroups Select PURE SELECT g.id AS id, g.group_name AS groupName\nFROM biz_shop_manage_group g\nWHERE g.created_by_id = #{operatorId} OR g.user_id = #{operatorId}\nORDER BY g.id ASC
|
||||
ShopManageGroupMapper selectManagedMemberUserIds Select PURE SELECT DISTINCT gm.user_id\nFROM biz_shop_manage_group g\nINNER JOIN biz_shop_manage_group_member gm ON gm.group_id = g.id\nINNER JOIN users u ON u.id = gm.user_id\nWHERE g.created_by_id = #{operatorId}\n OR g.user_id = #{operatorId}\nORDER BY gm.user_id ASC
|
||||
ShopManageGroupMapper selectUserIdsByGroupId Select PURE SELECT u.id AS userId\nFROM users u\nINNER JOIN biz_shop_manage_group g ON g.id = #{groupId}\nWHERE u.id = COALESCE(g.created_by_id, g.user_id)\n OR u.created_by_id = COALESCE(g.created_by_id, g.user_id)\nORDER BY u.id ASC
|
||||
ShopManageGroupMapper selectUserIdsByGroupIds Select PURE <script>\nSELECT DISTINCT visible_user_id\nFROM (\n SELECT COALESCE(g.created_by_id, g.user_id) AS visible_user_id\n FROM biz_shop_manage_group g\n WHERE g.id IN\n <foreach collection='groupIds' item='groupId' open='(' separator=',' close=')'>\n #{groupId}\n </foreach>\n UNION\n SELECT gm.user_id AS visible_user_id\n FROM biz_shop_manage_group_member gm\n WHERE gm.group_id IN\n <foreach collection='groupIds' item='groupId' open='(' separator=',' close=')'>\n #{groupId}\n </foreach>\n) visible_users\nWHERE visible_user_id IS NOT NULL\nORDER BY visible_user_id ASC\n</script>
|
||||
|
||||
|
Can't render this file because it contains an unexpected character in line 1 and column 222.
|
@@ -414,14 +414,14 @@ onUnmounted(() => {
|
||||
<div class="category-block">
|
||||
<span class="category-label">采集分类(可选,多选)</span>
|
||||
<el-select v-model="selectedShopCategoryValues" multiple collapse-tags collapse-tags-tooltip
|
||||
:max-collapse-tags="1" placeholder="不选=全店采集(点击选择分类)" class="shop-cat-select">
|
||||
:max-collapse-tags="1" placeholder="全店采集(点击选择分类)" class="shop-cat-select">
|
||||
<el-option v-for="category in shopCategoryOptions" :key="category.value"
|
||||
:label="category.label" :value="category.value" />
|
||||
</el-select>
|
||||
<p class="category-hint">
|
||||
{{ selectedShopCategoryValues.length
|
||||
? `只采选中 ${selectedShopCategoryValues.length} 个分类的商品;`
|
||||
: '不选=全店采集。' }}
|
||||
: '默认全店采集。' }}
|
||||
分类是京麦后台「店内分类」(2026-11-16 快照);商品要先在京麦挂上分类才会被选中。
|
||||
<button v-if="selectedShopCategoryValues.length" class="shop-cat-clear" type="button"
|
||||
@click="clearShopCategories">清空</button>
|
||||
|
||||
@@ -344,7 +344,8 @@ describe('获取店铺数据:一键采集 + 任务面板', () => {
|
||||
// 弹层 teleport 到 body,选项组件仍挂在页面组件树里,按组件计数不按 DOM)
|
||||
expect(w.findAllComponents(ElOption).length).toBe(9)
|
||||
expect(block!.find('.shop-cat-select').exists(), '分类块必须是 el-select 下拉').toBe(true)
|
||||
expect(block!.text()).toContain('不选=全店采集')
|
||||
expect(block!.text()).toContain('默认全店采集')
|
||||
expect(block!.findComponent(ElSelect).props('placeholder')).toBe('全店采集(点击选择分类)')
|
||||
|
||||
const select = block!.findComponent(ElSelect)
|
||||
await select.vm.$emit('update:modelValue', ['1024347567'])
|
||||
@@ -353,6 +354,6 @@ describe('获取店铺数据:一键采集 + 任务面板', () => {
|
||||
expect(block!.find('.shop-cat-clear').exists(), '选中后出「清空」').toBe(true)
|
||||
await block!.find('.shop-cat-clear').trigger('click')
|
||||
await flushPromises()
|
||||
expect(block!.text()).toContain('不选=全店采集')
|
||||
expect(block!.text()).toContain('默认全店采集')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user