优化员工详情页信息层级

This commit is contained in:
2026-07-26 11:57:53 +08:00
parent 602943efeb
commit 88915ad90c
2 changed files with 197 additions and 114 deletions
+189 -114
View File
@@ -17,46 +17,71 @@
</button>
</section>
<section class="card form-card section">
<div class="field"><label>员工编号</label><div class="field-value">{{ employee.userId || employee.id }}</div></div>
<section class="card form-card section summary-card">
<div class="field"><label>身份/级别</label><div class="field-value">{{ employee.identity || employee.level || '美甲师' }}</div></div>
<div class="field"><label>状态</label><div class="field-value">{{ employee.status === 0 ? '休息中' : '可预约' }}</div></div>
<div class="field"><label>参与制作美甲</label><div class="field-value">{{ employee.participateProduction === 1 ? '是' : '否' }}</div></div>
<div class="field"><label>登录手机号</label><div class="field-value">{{ employee.phone || '未填写' }}</div></div>
<div class="field"><label>联系电话</label><div class="field-value">{{ employee.contactPhone || '未填写' }}</div></div>
<div class="field"><label>微信号</label><div class="field-value">{{ employee.wechatId || '未填写' }}</div></div>
<div class="field"><label>预约颜色</label><div class="field-value color-line"><span class="color-dot" :style="{ backgroundColor: employee.color || '#b8b0a6' }"></span>{{ employee.color || '未设置' }}</div></div>
<div class="field"><label>联系电话</label><div class="field-value">{{ employee.contactPhone || employee.phone || '未填写' }}</div></div>
</section>
<section class="card menu-list section">
<button v-for="item in menus" :key="item.path" class="menu-row" type="button" @click="router.push(item.path)">
<span>{{ item.title }}</span>
<span>›</span>
<section class="quick-actions section">
<button v-for="item in menus" :key="item.path" class="quick-action card" type="button" @click="router.push(item.path)">
<span class="quick-action__icon">
<component :is="item.icon" :size="18" aria-hidden="true" />
</span>
<span class="quick-action__title">{{ item.title }}</span>
<ChevronRight :size="16" aria-hidden="true" />
</button>
</section>
<section class="card delete-panel section">
<div class="delete-panel__head">
<div class="delete-panel__icon">
<TriangleAlert :size="18" aria-hidden="true" />
</div>
<div class="delete-panel__copy">
<div class="delete-panel__title">
<strong>删除员工</strong>
<span class="danger-badge">危险操作</span>
</div>
<p>删除后该员工会从当前店铺员工列表移除,登录账号仍会保留。</p>
</div>
<details class="card more-info section">
<summary class="more-info__summary">
<span>更多资料</span>
<ChevronRight :size="16" aria-hidden="true" />
</summary>
<div class="more-info__body">
<div class="field"><label>员工编号</label><div class="field-value">{{ employee.userId || employee.id }}</div></div>
<div class="field"><label>登录手机号</label><div class="field-value">{{ employee.phone || '未填写' }}</div></div>
<div class="field"><label>微信号</label><div class="field-value">{{ employee.wechatId || '未填写' }}</div></div>
<div class="field"><label>预约颜色</label><div class="field-value color-line"><span class="color-dot" :style="{ backgroundColor: employee.color || '#b8b0a6' }"></span>{{ employee.color || '未设置' }}</div></div>
</div>
<div class="delete-panel__facts">
<span>移除店铺关系</span>
<span>保留登录账号</span>
</div>
<button class="danger-btn delete-panel__action" type="button" :disabled="deletingEmployee" @click="requestDeleteEmployee">
<Trash2 :size="15" aria-hidden="true" />
<span>{{ deletingEmployee ? '删除中...' : '删除员工' }}</span>
</details>
<section class="card account-actions section">
<button class="account-action" type="button" @click="requestResetPassword">
<span>
<strong>重置登录密码</strong>
<small>重置后使用系统默认密码登录</small>
</span>
<ChevronRight :size="17" aria-hidden="true" />
</button>
<div v-if="resetConfirmVisible" class="reset-confirm">
<p>确定要把该员工密码重置为系统默认密码吗?</p>
<div class="reset-confirm__actions">
<button class="secondary-btn" type="button" :disabled="resettingPassword" @click="resetConfirmVisible = false">取消</button>
<button class="danger-btn" type="button" :disabled="resettingPassword" @click="confirmResetPassword">
{{ resettingPassword ? '重置中...' : '确认重置' }}
</button>
</div>
</div>
</section>
<details class="danger-zone section">
<summary class="danger-zone__summary">
<span class="danger-zone__title">
<TriangleAlert :size="16" aria-hidden="true" />
<strong>危险操作</strong>
</span>
<ChevronRight :size="16" aria-hidden="true" />
</summary>
<div class="danger-zone__body">
<p>删除后会移除当前店铺关系,但保留登录账号和历史订单。</p>
<button class="danger-btn" type="button" :disabled="deletingEmployee" @click="requestDeleteEmployee">
<Trash2 :size="15" aria-hidden="true" />
<span>{{ deletingEmployee ? '删除中...' : '删除员工' }}</span>
</button>
</div>
</details>
<BaseModal
:model-value="deleteConfirmVisible"
title="确认删除员工"
@@ -167,7 +192,7 @@
<script setup lang="ts">
import { computed, onMounted, reactive, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { KeyRound, Pencil, Trash2, TriangleAlert, Upload } from 'lucide-vue-next'
import { CalendarDays, ChevronRight, Clock3, KeyRound, Palette, Pencil, ClipboardList, Trash2, TriangleAlert, Upload } from 'lucide-vue-next'
import BaseModal from '@/components/BaseModal.vue'
import DefaultPasswordNoticeModal from '@/components/DefaultPasswordNoticeModal.vue'
import EmptyState from '@/components/EmptyState.vue'
@@ -212,10 +237,10 @@ const editModalVisible = ref(false)
const employeeId = computed(() => String(route.params.id))
const editDraftName = computed(() => `${EDIT_EMPLOYEE_DRAFT_NAME_PREFIX}-${employeeId.value}`)
const menus = computed(() => [
{ title: '排班设置', path: `/employees/${employeeId.value}/schedule` },
{ title: '请假管理', path: `/employees/${employeeId.value}/leave` },
{ title: '颜色设置', path: `/employees/${employeeId.value}/color` },
{ title: '员工作品/订单', path: `/employees/${employeeId.value}/orders` }
{ title: '排班设置', path: `/employees/${employeeId.value}/schedule`, icon: CalendarDays },
{ title: '工时管理', path: `/employees/${employeeId.value}/leave`, icon: Clock3 },
{ title: '颜色设置', path: `/employees/${employeeId.value}/color`, icon: Palette },
{ title: '订单记录', path: `/employees/${employeeId.value}/orders`, icon: ClipboardList }
])
const buildEmptyEditForm = (): EditEmployeeForm => ({
avatar: '',
@@ -579,114 +604,164 @@ watch(editModalVisible, syncEditDraft)
border-radius: 50%;
}
.menu-list {
overflow: hidden;
}
.menu-row {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
min-height: 54px;
padding: 0 14px;
border-bottom: 1px solid var(--border);
color: var(--ink);
font-weight: 800;
}
.menu-row:last-child {
border-bottom: 0;
}
.delete-panel {
.summary-card {
display: grid;
gap: 12px;
padding: 12px;
border: 1px solid rgba(189, 71, 71, 0.16);
background:
linear-gradient(90deg, rgba(189, 71, 71, 0.08), rgba(255, 253, 248, 0) 46%),
var(--card-bg);
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0 18px;
}
.delete-panel__head {
display: grid;
grid-template-columns: 42px 1fr;
gap: 12px;
.summary-card .field {
min-width: 0;
}
.delete-panel__icon {
.quick-actions {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
}
.quick-action {
display: grid;
grid-template-columns: 30px minmax(0, 1fr) 16px;
align-items: center;
gap: 8px;
min-height: 68px;
padding: 12px;
color: var(--ink);
text-align: left;
}
.quick-action__icon {
display: grid;
place-items: center;
width: 42px;
height: 42px;
border-radius: 14px;
background: rgba(189, 71, 71, 0.12);
color: var(--danger);
width: 30px;
height: 30px;
border-radius: 10px;
background: var(--accent-soft);
color: var(--accent);
}
.delete-panel__copy {
.quick-action__title {
min-width: 0;
}
.delete-panel__title {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
min-width: 0;
}
.delete-panel__title strong {
overflow: hidden;
color: var(--ink);
font-size: 15px;
font-size: 14px;
font-weight: 900;
text-overflow: ellipsis;
white-space: nowrap;
}
.danger-badge {
flex: 0 0 auto;
min-height: 24px;
padding: 3px 9px;
border-radius: 999px;
background: #fff3ef;
color: var(--danger);
font-size: 11px;
font-weight: 900;
.quick-action > svg,
.more-info__summary > svg,
.account-action > svg,
.danger-zone__summary > svg {
color: var(--muted);
}
.delete-panel p {
.more-info,
.account-actions,
.danger-zone {
overflow: hidden;
}
.more-info__summary,
.account-action,
.danger-zone__summary {
display: flex;
align-items: center;
justify-content: space-between;
width: 100%;
min-height: 52px;
padding: 0 14px;
color: var(--ink);
font-size: 14px;
font-weight: 900;
cursor: pointer;
}
.more-info__summary {
list-style: none;
}
.more-info__summary::-webkit-details-marker,
.danger-zone__summary::-webkit-details-marker {
display: none;
}
.more-info[open] .more-info__summary > svg,
.danger-zone[open] .danger-zone__summary > svg {
transform: rotate(90deg);
}
.more-info__summary > svg,
.danger-zone__summary > svg {
transition: transform 160ms ease;
}
.more-info__body {
display: grid;
gap: 0;
padding: 0 14px 10px;
border-top: 1px solid var(--border);
}
.account-action {
min-height: 64px;
text-align: left;
}
.account-action > span {
display: grid;
gap: 3px;
}
.account-action strong {
font-size: 14px;
}
.account-action small {
color: var(--muted);
font-size: 12px;
font-weight: 500;
}
.account-actions .reset-confirm {
margin: 0 12px 12px;
}
.danger-zone {
border: 1px solid rgba(189, 71, 71, 0.2);
background: rgba(255, 249, 247, 0.92);
}
.danger-zone__summary {
color: var(--danger);
}
.danger-zone__title {
display: inline-flex;
align-items: center;
gap: 8px;
}
.danger-zone__body {
display: grid;
gap: 12px;
padding: 0 14px 14px;
}
.danger-zone__body p {
margin: 5px 0 0;
color: #71665d;
font-size: 12px;
line-height: 1.6;
}
.delete-panel__facts {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 8px;
}
.delete-panel__facts span {
min-height: 34px;
padding: 8px 10px;
border-radius: 10px;
background: rgba(255, 255, 255, 0.68);
color: #6f625a;
font-size: 12px;
font-weight: 800;
text-align: center;
}
.delete-panel__action {
.danger-zone__body .danger-btn {
width: 100%;
gap: 6px;
}
.delete-panel__action svg {
.danger-zone__body .danger-btn svg {
flex: 0 0 auto;
}
+8
View File
@@ -695,3 +695,11 @@
- 数据库说明:本次不新增 SQL,不修改初始化 SQL,不需要执行数据库迁移。
- 影响范围:影响 `JY-Core` 员工资料兜底、规划候选和预约改派校验,影响 `JY-Salon-Front` 员工详情编辑,以及 `JY-Salon-WeChat` 员工详情展示;设计师端继续使用原有参与制作字段和规则。
- 验证方式:运行 Core 规划与员工资料相关测试,执行店务 Web 构建和店务小程序 JS 语法检查,并确认 `git diff --check` 通过。
## 2026-07-26 店务员工详情页信息层级优化
- 变更原因:员工详情页的快捷操作、账号安全和删除员工区域均使用大卡片展开,页面纵向过长,危险操作视觉权重过高。
- 处理方式:基础信息收敛为状态摘要,排班/工时/颜色/订单改为紧凑快捷操作网格;员工编号、登录手机号、微信号和预约颜色收进“更多资料”;重置密码改为单行操作;删除员工改为默认折叠的危险操作区,原有确认弹窗和功能逻辑保持不变。
- 数据库说明:本次不新增 SQL,不修改初始化 SQL,不需要执行数据库迁移。
- 影响范围:仅影响 `JY-Salon-Front/src/views/EmployeeDetailView.vue` 员工详情页布局与样式,不改变员工资料接口、密码重置、删除员工和业务入口行为。
- 验证方式:运行店务 Web `vue-tsc` 类型检查并确认 `git diff --check` 通过。