Files
JayuCloud/JY-Salon-Front/src/views/EmployeeDetailView.vue
T

941 lines
26 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<MobileShell title="员工详情">
<LoadingState v-if="loading" text="正在加载员工" />
<template v-else-if="employee">
<section class="card employee-hero">
<div class="employee-avatar">
<img v-if="employee.avatar" :src="employee.avatar" alt="" />
<span v-else>{{ (employee.name || employee.nickname || '员').slice(0, 1) }}</span>
</div>
<div class="employee-hero__body">
<h2>{{ employee.name || employee.nickname || '未命名员工' }}</h2>
<p>{{ employee.phone || '未填写登录手机号' }}</p>
</div>
<button class="edit-btn" type="button" @click="openEdit">
<Pencil :size="15" aria-hidden="true" />
<span>编辑</span>
</button>
</section>
<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.contactPhone || employee.phone || '未填写' }}</div></div>
</section>
<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>
<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>
</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="确认删除员工"
:close-disabled="deletingEmployee"
panel-class="employee-delete-confirm-modal"
@update:model-value="deleteConfirmVisible = $event"
>
<div class="delete-confirm">
<div class="delete-confirm__icon">
<TriangleAlert :size="22" aria-hidden="true" />
</div>
<h3>确认删除员工</h3>
<p>该操作只会移除当前店铺员工关系,不会删除员工登录账号和历史订单。</p>
<div class="delete-confirm__facts">
<div><span>员工列表</span><strong>移除</strong></div>
<div><span>登录账号</span><strong>保留</strong></div>
</div>
<div class="delete-confirm__actions">
<button class="secondary-btn" type="button" :disabled="deletingEmployee" @click="deleteConfirmVisible = false">取消</button>
<button class="danger-btn" type="button" :disabled="deletingEmployee" @click="confirmDeleteEmployee">
<Trash2 :size="15" aria-hidden="true" />
<span>{{ deletingEmployee ? '删除中...' : '确认删除' }}</span>
</button>
</div>
</div>
</BaseModal>
</template>
<EmptyState v-else title="员工不存在" />
<BaseModal
:model-value="editModalVisible"
title="编辑员工"
:close-disabled="closeDisabled"
:has-unsaved-changes="editFormChanged"
@update:model-value="updateEditModalVisible"
>
<div class="modal-form">
<div class="avatar-field">
<div class="avatar-preview">
<img v-if="editForm.avatar" :src="editForm.avatar" alt="" />
<span v-else>{{ (editForm.nickname || '员').slice(0, 1) }}</span>
</div>
<div class="avatar-actions">
<label class="secondary-btn avatar-upload" :class="{ 'is-disabled': avatarUploading }">
<Upload :size="15" aria-hidden="true" />
<span>{{ avatarUploading ? '上传中' : '上传头像' }}</span>
<input type="file" accept="image/*" :disabled="avatarUploading" @change="uploadAvatar" />
</label>
<button class="secondary-btn" type="button" :disabled="avatarUploading || !editForm.avatar" @click="clearAvatar">
<Trash2 :size="15" aria-hidden="true" />
<span>清除</span>
</button>
</div>
</div>
<div class="field"><label class="required">昵称</label><input v-model.trim="editForm.nickname" placeholder="请输入昵称" /></div>
<div class="field"><label>登录手机号</label><input v-model.trim="editForm.phone" inputmode="tel" placeholder="选填,填写后用于手机号登录" /></div>
<div class="field"><label>联系电话</label><input v-model.trim="editForm.contactPhone" inputmode="tel" placeholder="请输入联系电话" /></div>
<div class="field"><label>微信号</label><input v-model.trim="editForm.wechatId" placeholder="请输入微信号" /></div>
<div class="field"><label>身份/级别</label><input v-model.trim="editForm.identity" placeholder="例如:高级美甲师" /></div>
<div class="field">
<label>状态</label>
<select v-model.number="editForm.status">
<option :value="1">可预约</option>
<option :value="0">休息中</option>
</select>
</div>
<label class="field checkbox-field">
<span>参与制作美甲</span>
<input v-model="editForm.participateProduction" type="checkbox" />
</label>
<div class="reset-panel">
<div>
<strong>重置登录密码</strong>
<p>重置后员工可使用系统默认密码登录。</p>
</div>
<button class="secondary-btn reset-btn" type="button" :disabled="resettingPassword" @click="requestResetPassword">
<KeyRound :size="15" aria-hidden="true" />
<span>重置密码</span>
</button>
</div>
<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>
<button class="primary-btn" type="button" :disabled="saving || avatarUploading" @click="saveEdit">
{{ saving ? '保存中...' : '保存员工' }}
</button>
</div>
</BaseModal>
<DefaultPasswordNoticeModal
v-model="defaultPasswordNoticeVisible"
title="密码已重置"
message="该员工密码已重置为系统默认密码。请提醒员工首次登录后修改。"
:password="defaultPasswordNoticePassword"
/>
</MobileShell>
</template>
<script setup lang="ts">
import { computed, onMounted, reactive, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
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'
import LoadingState from '@/components/LoadingState.vue'
import MobileShell from '@/components/MobileShell.vue'
import { fileApi } from '@/api/file'
import { managerEmployeesApi } from '@/api/managerEmployees'
import { useSessionStore } from '@/stores/session'
import { useToastStore } from '@/stores/toast'
import type { Artist } from '@/types/manager'
import { readFormModalDraft, removeFormModalDraft, writeFormModalDraft } from '@/utils/form-modal-draft'
interface EditEmployeeForm {
avatar: string
nickname: string
phone: string
contactPhone: string
wechatId: string
identity: string
status: number
participateProduction: boolean
}
const EDIT_EMPLOYEE_DRAFT_NAME_PREFIX = 'employee-edit'
const phonePattern = /^1[3-9]\d{9}$/
const route = useRoute()
const router = useRouter()
const session = useSessionStore()
const toast = useToastStore()
const loading = ref(false)
const saving = ref(false)
const avatarUploading = ref(false)
const resettingPassword = ref(false)
const deletingEmployee = ref(false)
const resetConfirmVisible = ref(false)
const deleteConfirmVisible = ref(false)
const defaultPasswordNoticeVisible = ref(false)
const defaultPasswordNoticePassword = ref('')
const employee = ref<Artist | null>(null)
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`, 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: '',
nickname: '',
phone: '',
contactPhone: '',
wechatId: '',
identity: '',
status: 1,
participateProduction: false
})
const editForm = reactive<EditEmployeeForm>(buildEmptyEditForm())
const originalEditForm = ref<EditEmployeeForm>(buildEmptyEditForm())
const editFormChanged = computed(() => !sameEditForm(editForm, originalEditForm.value))
const closeDisabled = computed(() => saving.value || avatarUploading.value || resettingPassword.value || deletingEmployee.value)
function buildEditFormFromEmployee(value: Artist): EditEmployeeForm {
return {
avatar: value.avatar || '',
nickname: value.nickname || value.name || '',
phone: value.phone || '',
contactPhone: value.contactPhone || '',
wechatId: value.wechatId || '',
identity: value.identity || value.level || '',
status: value.status === 0 ? 0 : 1,
participateProduction: value.participateProduction === 1
}
}
function sameEditForm(left: EditEmployeeForm, right: EditEmployeeForm): boolean {
return left.avatar === right.avatar
&& left.nickname === right.nickname
&& left.phone === right.phone
&& left.contactPhone === right.contactPhone
&& left.wechatId === right.wechatId
&& left.identity === right.identity
&& left.status === right.status
&& left.participateProduction === right.participateProduction
}
function snapshotEditForm(): EditEmployeeForm {
return {
avatar: editForm.avatar,
nickname: editForm.nickname,
phone: editForm.phone,
contactPhone: editForm.contactPhone,
wechatId: editForm.wechatId,
identity: editForm.identity,
status: editForm.status,
participateProduction: editForm.participateProduction
}
}
function normalizeEditForm(form: EditEmployeeForm): EditEmployeeForm {
return {
avatar: String(form.avatar || ''),
nickname: String(form.nickname || ''),
phone: String(form.phone || ''),
contactPhone: String(form.contactPhone || ''),
wechatId: String(form.wechatId || ''),
identity: String(form.identity || ''),
status: Number(form.status) === 0 ? 0 : 1,
participateProduction: Boolean(form.participateProduction)
}
}
function applyEditForm(form: EditEmployeeForm): void {
const normalizedForm = normalizeEditForm(form)
editForm.avatar = normalizedForm.avatar
editForm.nickname = normalizedForm.nickname
editForm.phone = normalizedForm.phone
editForm.contactPhone = normalizedForm.contactPhone
editForm.wechatId = normalizedForm.wechatId
editForm.identity = normalizedForm.identity
editForm.status = normalizedForm.status
editForm.participateProduction = normalizedForm.participateProduction
}
function resetEditForm(): void {
const emptyForm = buildEmptyEditForm()
applyEditForm(emptyForm)
originalEditForm.value = emptyForm
}
function syncEditDraft(): void {
if (!editModalVisible.value || !editFormChanged.value) {
return
}
writeFormModalDraft(session.userInfo, editDraftName.value, snapshotEditForm(), editModalVisible.value)
}
function restoreEditDraft(): void {
if (!employee.value) {
return
}
const draft = readFormModalDraft<EditEmployeeForm>(session.userInfo, editDraftName.value)
if (!draft?.open) {
return
}
const baseForm = buildEditFormFromEmployee(employee.value)
originalEditForm.value = baseForm
applyEditForm(draft.form)
editModalVisible.value = true
}
function clearEditDraft(): void {
removeFormModalDraft(session.userInfo, editDraftName.value)
}
function updateEditModalVisible(value: boolean): void {
editModalVisible.value = value
if (!value) {
resetConfirmVisible.value = false
clearEditDraft()
resetEditForm()
}
}
function openEdit(): void {
if (!employee.value) {
return
}
clearEditDraft()
resetConfirmVisible.value = false
const form = buildEditFormFromEmployee(employee.value)
applyEditForm(form)
originalEditForm.value = snapshotEditForm()
editModalVisible.value = true
}
function errorMessage(error: { message?: string } | null, fallback: string): string {
return error?.message ? error.message : fallback
}
async function resolveResetDefaultPassword(): Promise<string> {
const response = await managerEmployeesApi.getResetDefaultPassword()
const password = response.password.trim()
if (!password) {
throw new Error('默认密码为空,请先检查系统参数配置')
}
return password
}
function showDefaultPasswordNotice(password: string): void {
defaultPasswordNoticePassword.value = password
defaultPasswordNoticeVisible.value = true
}
const loadEmployee = async (): Promise<void> => {
loading.value = true
try {
employee.value = await managerEmployeesApi.detail(employeeId.value)
} catch (error) {
toast.error(errorMessage(error as { message?: string } | null, '员工详情加载失败,请稍后重试'))
employee.value = null
} finally {
loading.value = false
}
}
const uploadAvatar = async (event: Event): Promise<void> => {
const target = event.target as HTMLInputElement
const file = target.files?.[0]
target.value = ''
if (!file) {
return
}
avatarUploading.value = true
try {
editForm.avatar = await fileApi.uploadProfileImage(file)
toast.success('头像已上传')
} catch (error) {
toast.error(errorMessage(error as { message?: string } | null, '头像上传失败,请稍后重试'))
} finally {
avatarUploading.value = false
}
}
const clearAvatar = (): void => {
editForm.avatar = ''
}
const validateEditForm = (): boolean => {
if (!editForm.nickname.trim()) {
toast.error('请输入员工昵称')
return false
}
const phone = editForm.phone.trim()
if (phone && !phonePattern.test(phone)) {
toast.error('请输入正确的登录手机号')
return false
}
return true
}
const saveEdit = async (): Promise<void> => {
if (!employee.value || !validateEditForm()) {
return
}
saving.value = true
try {
await managerEmployeesApi.save({
id: employee.value.id,
userId: employee.value.userId || employeeId.value,
avatar: editForm.avatar.trim(),
nickname: editForm.nickname.trim(),
phone: editForm.phone.trim(),
contactPhone: editForm.contactPhone.trim(),
wechatId: editForm.wechatId.trim(),
identity: editForm.identity.trim(),
status: editForm.status,
participateProduction: editForm.participateProduction ? 1 : 0
})
toast.success('员工信息已保存')
updateEditModalVisible(false)
await loadEmployee()
} catch (error) {
toast.error(errorMessage(error as { message?: string } | null, '员工信息保存失败,请稍后重试'))
} finally {
saving.value = false
}
}
const requestResetPassword = (): void => {
resetConfirmVisible.value = true
}
const confirmResetPassword = async (): Promise<void> => {
if (!employee.value) {
return
}
resettingPassword.value = true
try {
await managerEmployeesApi.resetPassword(employee.value.userId || employeeId.value)
resetConfirmVisible.value = false
try {
showDefaultPasswordNotice(await resolveResetDefaultPassword())
} catch (error) {
toast.error(errorMessage(error as { message?: string } | null, '密码已重置,但默认密码获取失败'))
}
} catch (error) {
toast.error(errorMessage(error as { message?: string } | null, '密码重置失败,请稍后重试'))
} finally {
resettingPassword.value = false
}
}
const requestDeleteEmployee = (): void => {
deleteConfirmVisible.value = true
}
const confirmDeleteEmployee = async (): Promise<void> => {
if (!employee.value) {
return
}
deletingEmployee.value = true
try {
const success = await managerEmployeesApi.deleteUser(employee.value.userId || employeeId.value)
if (!success) {
throw new Error('员工不存在或已被删除')
}
deleteConfirmVisible.value = false
toast.success('员工已删除')
await router.replace('/employees')
} catch (error) {
toast.error(errorMessage(error as { message?: string } | null, '员工删除失败,请稍后重试'))
} finally {
deletingEmployee.value = false
}
}
onMounted(async () => {
await loadEmployee()
restoreEditDraft()
})
watch(editForm, syncEditDraft, { deep: true })
watch(editModalVisible, syncEditDraft)
</script>
<style scoped>
.employee-hero {
display: flex;
align-items: center;
gap: 14px;
padding: 18px;
}
.employee-avatar {
display: grid;
place-items: center;
width: 62px;
height: 62px;
overflow: hidden;
border-radius: 22px;
background: transparent;
color: var(--accent);
font-size: 24px;
font-weight: 900;
}
.employee-hero__body {
min-width: 0;
flex: 1;
}
.employee-avatar img,
.avatar-preview img {
width: 100%;
height: 100%;
object-fit: cover;
}
.employee-avatar span,
.avatar-preview span {
display: grid;
place-items: center;
width: 100%;
height: 100%;
border-radius: inherit;
}
.avatar-preview span {
background: var(--accent-soft);
}
.employee-hero h2,
.employee-hero p {
margin: 0;
}
.employee-hero p {
margin-top: 4px;
color: var(--muted);
}
.edit-btn {
display: inline-flex;
align-items: center;
gap: 4px;
min-height: 34px;
padding: 0 12px;
border: 1px solid var(--border);
border-radius: 999px;
background: var(--card-bg);
color: var(--accent);
font-size: 13px;
font-weight: 800;
white-space: nowrap;
}
.color-line {
display: flex;
align-items: center;
gap: 8px;
}
.color-dot {
width: 16px;
height: 16px;
border-radius: 50%;
}
.summary-card {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 0 18px;
}
.summary-card .field {
min-width: 0;
}
.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: 30px;
height: 30px;
border-radius: 10px;
background: var(--accent-soft);
color: var(--accent);
}
.quick-action__title {
min-width: 0;
overflow: hidden;
font-size: 14px;
font-weight: 900;
text-overflow: ellipsis;
white-space: nowrap;
}
.quick-action > svg,
.more-info__summary > svg,
.account-action > svg,
.danger-zone__summary > svg {
color: var(--muted);
}
.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;
}
.danger-zone__body .danger-btn {
width: 100%;
gap: 6px;
}
.danger-zone__body .danger-btn svg {
flex: 0 0 auto;
}
:global(.employee-delete-confirm-modal) {
align-self: center;
width: min(calc(100vw - 32px), 340px);
max-height: calc(100vh - 64px);
border-radius: 18px;
}
:global(.employee-delete-confirm-modal .modal-panel__head),
:global(.employee-delete-confirm-modal .modal-panel__footer) {
display: none;
}
.delete-confirm {
display: grid;
gap: 12px;
padding: 18px 16px 16px;
}
.delete-confirm__icon {
display: grid;
place-items: center;
width: 50px;
height: 50px;
margin: 0 auto;
border-radius: 16px;
background: rgba(189, 71, 71, 0.12);
color: var(--danger);
}
.delete-confirm h3,
.delete-confirm p {
margin: 0;
text-align: center;
}
.delete-confirm h3 {
color: var(--ink);
font-size: 18px;
font-weight: 900;
}
.delete-confirm p {
color: #6f665d;
font-size: 13px;
line-height: 1.65;
}
.delete-confirm__facts {
display: grid;
gap: 8px;
}
.delete-confirm__facts div {
display: flex;
align-items: center;
justify-content: space-between;
min-height: 36px;
padding: 9px 10px;
border-radius: 10px;
background: rgba(240, 236, 229, 0.7);
color: #635c55;
font-size: 12px;
font-weight: 800;
}
.delete-confirm__facts strong {
color: var(--danger);
}
.delete-confirm__actions {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
}
.modal-form {
display: grid;
gap: 12px;
padding: 14px;
}
.avatar-field {
display: flex;
align-items: center;
gap: 14px;
padding: 6px 0 10px;
}
.avatar-preview {
display: grid;
place-items: center;
width: 64px;
height: 64px;
overflow: hidden;
border-radius: 22px;
background: transparent;
color: var(--accent);
font-size: 24px;
font-weight: 900;
}
.avatar-actions {
display: flex;
flex-wrap: wrap;
gap: 8px;
}
.avatar-actions .secondary-btn,
.reset-btn {
gap: 6px;
min-height: 36px;
padding: 0 12px;
}
.avatar-upload {
cursor: pointer;
}
.avatar-upload input {
display: none;
}
.avatar-upload.is-disabled {
cursor: not-allowed;
opacity: 0.65;
}
.reset-panel {
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 12px;
border: 1px solid var(--border);
border-radius: 8px;
background: rgba(255, 255, 255, 0.7);
}
.reset-panel strong,
.reset-panel p,
.reset-confirm p {
margin: 0;
}
.reset-panel strong {
display: block;
color: var(--ink);
font-size: 14px;
}
.reset-panel p,
.reset-confirm p {
margin-top: 4px;
color: var(--muted);
font-size: 12px;
line-height: 1.5;
}
.reset-confirm {
display: grid;
gap: 10px;
padding: 12px;
border: 1px solid rgba(191, 73, 73, 0.22);
border-radius: 8px;
background: rgba(191, 73, 73, 0.08);
}
.reset-confirm__actions {
display: flex;
justify-content: flex-end;
gap: 8px;
}
</style>