style(admin): 分类管理弹窗搜索/新建/按钮合回一排(2026-11-17 用户口径「弄成一排呗」)
340px 弹窗里垂直两行显空,三件改回一行。宽度分配先试 flex 1:1.75 实测偏移(搜索 122、新建输入只剩 105,7 字占位 115px 被截),改成搜索定宽 108px+新建行吃剩余(输入 119px),两个占位都完整。挂载用例同步为一排结构,并钉新建行只有输入框+按钮两个子元素(用户旧构建截图里多出的空框=11-15 已下线的排序输入,重新构建即消)。判据:vitest 挂载 21 例全绿+vue-tsc rc=0。
This commit is contained in:
@@ -381,12 +381,16 @@ watch(totalPages, (pages) => {
|
||||
background: #eef4fa;
|
||||
color: #24384d;
|
||||
}
|
||||
/* 2026-11-17 用户口径「垂直排阿,这样好看」「不然留白太多了」:搜索与新建各占整行
|
||||
(原来两件并排 flex:1 各挤一半宽),弹窗内容变高、列表下方空白收窄,两行输入等宽也更整齐。 */
|
||||
/* 2026-11-17 用户口径演变:「垂直排阿」→ 弹窗收窄到 340px 后「弄成一排呗」:
|
||||
搜索框、新分类名输入、新建按钮合回一行。340−42=298px 可用宽度:新建按钮约 56
|
||||
+两处 gap 16。实测按比例分(flex 1:1.75)会偏移(搜索 122/新建输入只剩 105,
|
||||
7 字占位 115px 被截),改成搜索定宽 108px(6 字占位 102px 放得下),新建行吃剩余
|
||||
(298−108−16=174,输入约 118px,占位完整)。 */
|
||||
.manage-bar {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-wrap: nowrap;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.search-input,
|
||||
@@ -413,12 +417,14 @@ watch(totalPages, (pages) => {
|
||||
box-shadow: 0 0 0 3px rgba(95, 133, 173, 0.16);
|
||||
}
|
||||
.search-input {
|
||||
width: 100%;
|
||||
flex: 0 0 108px;
|
||||
min-width: 0;
|
||||
}
|
||||
.group-create {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
gap: 8px;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
.group-create input {
|
||||
flex: 1;
|
||||
|
||||
@@ -151,14 +151,15 @@ describe('京东分类管理对话框(V204 独立页 2026-11-17 并入京东
|
||||
wrapper.unmount()
|
||||
})
|
||||
|
||||
it('搜索与新建行同属 manage-bar 的两行(搜索在上、新建在下,2026-11-17 改垂直排列)', async () => {
|
||||
it('搜索与新建行同属 manage-bar 的一排(搜索在左、新建在右,2026-11-17 用户口径「弄成一排呗」)', async () => {
|
||||
jdApi.fetchJdProductGroups.mockResolvedValue([group(7, '裙装', 3)])
|
||||
const wrapper = await mountDialog()
|
||||
const bar = wrapper.get('.manage-bar')
|
||||
const children = Array.from(bar.element.children)
|
||||
expect(children).toHaveLength(2, 'bar 只有两件:搜索框、新建行')
|
||||
expect(children[0].classList.contains('search-input')).toBe(true, '垂直排列时搜索在上')
|
||||
expect(children[1].classList.contains('group-create')).toBe(true, '新建行在下')
|
||||
expect(children).toHaveLength(2, '一排只有两件:搜索框、新建行(新建行内=输入框+新建按钮)')
|
||||
expect(children[0].classList.contains('search-input')).toBe(true, '搜索框在左')
|
||||
expect(children[1].classList.contains('group-create')).toBe(true, '新建行在右')
|
||||
expect(children[1].children).toHaveLength(2, '新建行只有输入框+按钮(排序输入 11-15 已下线,不得长出第三个框)')
|
||||
wrapper.unmount()
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user