fix(jd-database): 2026-11-21 用户口径三件——面板删标题行(筛选往上摆顶齐侧栏)、左右等高对齐(stretch+侧栏内部滚动、窄屏恢复上限)、新建分类/分类管理置顶贴 Tab 行;删除商品按钮按原型并入按钮组紧跟取消本页

This commit is contained in:
2026-11-21 11:38:46 +08:00
parent 427f22e0b4
commit a2aeae9974
3 changed files with 72 additions and 67 deletions
@@ -234,8 +234,21 @@ function submitCreate(): void {
</div>
</div>
<!-- 店铺分类:当前分组分类平铺 + 新建分类(可写档)+ 分类管理入口(所有人) -->
<!-- 店铺分类:新建分类(可写档)+ 分类管理入口(所有人)置顶(2026-11-21 用户口径
「换一下位置」,红框块挪到 Tab 正下方),分类平铺随其后。 -->
<div v-show="activeTab === 'custom'" class="jd-sidebar-body jd-side-custom">
<div v-if="editable" class="jd-side-create">
<input
v-model="newCategoryName"
type="text"
placeholder="新分类名称"
aria-label="新分类名称"
@keyup.enter="submitCreate"
/>
<button type="button" :disabled="!newCategoryName.trim()" @click="submitCreate">新建分类</button>
</div>
<button type="button" class="jd-side-manage" @click="emit('manage-categories')">分类管理</button>
<template v-if="categories.length">
<button
v-for="cat in categories"
@@ -252,18 +265,6 @@ function submitCreate(): void {
</button>
</template>
<p v-else class="jd-side-empty">{{ editable ? '本组暂无分类,先新建一个' : '本组暂无分类' }}</p>
<div v-if="editable" class="jd-side-create">
<input
v-model="newCategoryName"
type="text"
placeholder="新分类名称"
aria-label="新分类名称"
@keyup.enter="submitCreate"
/>
<button type="button" :disabled="!newCategoryName.trim()" @click="submitCreate">新建分类</button>
</div>
<button type="button" class="jd-side-manage" @click="emit('manage-categories')">分类管理</button>
</div>
</aside>
</template>
@@ -276,11 +277,16 @@ function submitCreate(): void {
border: 1px solid #e4e7ed;
border-radius: 8px;
overflow: hidden;
align-self: flex-start;
/* 左右高度对齐(2026-11-21 用户口径):侧栏外框随主面板拉满(页面容器已改 stretch),
自身转纵向 flex——Tab 行固定、滚动区吃剩余高度,第三张截图红框那截空白带消失。 */
display: flex;
flex-direction: column;
align-self: stretch;
}
.jd-sidebar-tabs {
display: flex;
flex-shrink: 0;
border-bottom: 1px solid #e4e7ed;
}
@@ -303,11 +309,21 @@ function submitCreate(): void {
.jd-sidebar-body {
display: flex;
flex-direction: column;
max-height: 640px;
/* 等高对齐下的滚动区:放弃 640px 上限(上限会让宽屏侧栏短于主面板=又不对齐),
flex 吃满侧栏剩余高度,树/分类超出时内部滚动。窄屏(≤980px)侧栏整行摆放时
恢复上限,防树全展开把整页拉长(断点与页面装配层一致)。 */
flex: 1 1 auto;
min-height: 0;
overflow-y: auto;
padding: 6px;
}
@media (max-width: 980px) {
.jd-sidebar-body {
max-height: 480px;
}
}
.jd-side-row {
display: flex;
align-items: center;
@@ -403,9 +419,9 @@ function submitCreate(): void {
.jd-side-create {
display: flex;
gap: 6px;
margin-top: 8px;
/* 置顶档(2026-11-21 换位):贴 Tab 行下方,分隔虚线随位置挪到「分类管理」与列表之间。 */
margin-top: 4px;
padding: 6px 4px;
border-top: 1px dashed #e4e7ed;
}
.jd-side-create input {
@@ -433,10 +449,12 @@ function submitCreate(): void {
}
.jd-side-manage {
margin-top: 8px;
margin-top: 0;
margin-bottom: 4px;
padding: 6px 8px;
border: none;
border-top: 1px dashed #e4e7ed;
/* 置顶档:虚线分隔「控制块 ↔ 分类列表」。 */
border-bottom: 1px dashed #e4e7ed;
background: transparent;
color: #606266;
font-size: 13px;