优化店务端员工删除确认样式

This commit is contained in:
2026-07-21 10:47:52 +08:00
parent 0d947e4784
commit 75d38dc352
2 changed files with 202 additions and 29 deletions
+194 -29
View File
@@ -35,23 +35,53 @@
</section>
<section class="card delete-panel section">
<div>
<strong>删除员工</strong>
<p>删除后该员工会从当前店铺员工列表移除,登录账号仍会保留。</p>
<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>
</div>
<button class="danger-btn" type="button" :disabled="deletingEmployee" @click="requestDeleteEmployee">
{{ deletingEmployee ? '删除中...' : '删除员工' }}
<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>
</button>
</section>
<div v-if="deleteConfirmVisible" class="reset-confirm delete-confirm">
<p>确定要删除该员工吗?该操作只移除当前店铺员工关系,不会删除登录账号。</p>
<div class="reset-confirm__actions">
<button class="secondary-btn" type="button" :disabled="deletingEmployee" @click="deleteConfirmVisible = false">取消</button>
<button class="danger-btn" type="button" :disabled="deletingEmployee" @click="confirmDeleteEmployee">
{{ deletingEmployee ? '删除中...' : '确认删除' }}
</button>
<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>
</div>
</BaseModal>
</template>
<EmptyState v-else title="员工不存在" />
@@ -132,7 +162,7 @@
<script setup lang="ts">
import { computed, onMounted, reactive, ref, watch } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { KeyRound, Pencil, Trash2, Upload } from 'lucide-vue-next'
import { KeyRound, Pencil, 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'
@@ -557,34 +587,169 @@ watch(editModalVisible, syncEditDraft)
}
.delete-panel {
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);
}
.delete-panel__head {
display: grid;
grid-template-columns: 42px 1fr;
gap: 12px;
min-width: 0;
}
.delete-panel__icon {
display: grid;
place-items: center;
width: 42px;
height: 42px;
border-radius: 14px;
background: rgba(189, 71, 71, 0.12);
color: var(--danger);
}
.delete-panel__copy {
min-width: 0;
}
.delete-panel__title {
display: flex;
align-items: center;
justify-content: space-between;
flex-wrap: wrap;
gap: 12px;
padding: 14px;
gap: 8px;
min-width: 0;
}
.delete-panel strong,
.delete-panel p {
margin: 0;
}
.delete-panel strong {
display: block;
.delete-panel__title strong {
overflow: hidden;
color: var(--ink);
font-size: 14px;
font-size: 15px;
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;
}
.delete-panel p {
margin-top: 4px;
color: var(--muted);
margin: 5px 0 0;
color: #71665d;
font-size: 12px;
line-height: 1.5;
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 {
gap: 6px;
}
.delete-panel__action 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 {
margin-top: 12px;
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 {