feat(web-admin): use duty staff options in schedule dialog
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
a8b5b69a1f
commit
a9c1062fbe
2 files changed
+25
-19
No files matched your search
@@ -69,3 +69,9 @@ export function deleteDutyAssignment(id: string) {
|
||||
url: `/web/admin/duty/assignments/${id}`
|
||||
})
|
||||
}
|
||||
|
||||
export function fetchDutyUserOptions() {
|
||||
return request.get<Array<{ label: string; value: string }>>({
|
||||
url: '/web/admin/duty/users/options'
|
||||
})
|
||||
}
|
||||
@@ -186,7 +186,7 @@
|
||||
>
|
||||
<el-form label-position="top" class="duty-day-form">
|
||||
<p class="form-tip">
|
||||
为当天配置班次名额,保存后生成公开链接。可直接从系统用户安排,也可留给员工抢班。
|
||||
为当天配置班次名额,保存后生成公开链接。直接安排与公开链接仅可选择已分配「值班人员」角色的用户。
|
||||
</p>
|
||||
|
||||
<div v-for="slot in formSlots" :key="slot.shiftType" class="slot-card">
|
||||
@@ -198,7 +198,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<template v-if="slot.enabled">
|
||||
<el-form-item label="直接安排(系统用户)">
|
||||
<el-form-item label="直接安排(值班人员)">
|
||||
<el-select
|
||||
v-model="slot.pendingUserId"
|
||||
filterable
|
||||
@@ -276,11 +276,11 @@
|
||||
SwitchButton
|
||||
} from '@element-plus/icons-vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { fetchUserOptions } from '@/api/admin'
|
||||
import {
|
||||
deleteDutyAssignment,
|
||||
fetchDutyDay,
|
||||
fetchDutyMonth,
|
||||
fetchDutyUserOptions,
|
||||
saveDutyDay,
|
||||
setDutyLinkStatus,
|
||||
type DutyDayItem,
|
||||
@@ -720,7 +720,7 @@
|
||||
|
||||
onMounted(async () => {
|
||||
try {
|
||||
const opts = await fetchUserOptions()
|
||||
const opts = await fetchDutyUserOptions()
|
||||
userOptions.value = (Array.isArray(opts) ? opts : []) as Array<{
|
||||
label: string
|
||||
value: string
|
||||
@@ -796,17 +796,17 @@
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
margin: 0;
|
||||
font-size: 13px;
|
||||
font-size: 14px;
|
||||
color: #334155;
|
||||
}
|
||||
.month-stats .stat {
|
||||
display: inline-flex;
|
||||
gap: 4px;
|
||||
align-items: center;
|
||||
height: 28px;
|
||||
height: 30px;
|
||||
padding: 0 10px;
|
||||
font: inherit;
|
||||
font-size: 13px;
|
||||
font-size: 14px;
|
||||
color: #334155;
|
||||
cursor: pointer;
|
||||
background: transparent;
|
||||
@@ -834,7 +834,7 @@
|
||||
}
|
||||
.month-stats .stat.total {
|
||||
padding: 4px 10px;
|
||||
font-size: 12px;
|
||||
font-size: 14px;
|
||||
color: #64748b;
|
||||
background: #f1f5f9;
|
||||
border: 1px solid var(--mint-border, #d9e8e2);
|
||||
@@ -1003,7 +1003,7 @@
|
||||
}
|
||||
.person-bar-label {
|
||||
margin-right: 4px;
|
||||
font-size: 12px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
}
|
||||
@@ -1011,9 +1011,9 @@
|
||||
display: inline-flex;
|
||||
gap: 6px;
|
||||
align-items: center;
|
||||
height: 28px;
|
||||
height: 30px;
|
||||
padding: 0 10px;
|
||||
font-size: 12px;
|
||||
font-size: 14px;
|
||||
color: #334155;
|
||||
cursor: pointer;
|
||||
background: transparent;
|
||||
@@ -1047,7 +1047,7 @@
|
||||
}
|
||||
.duty-cal th {
|
||||
padding: 10px;
|
||||
font-size: 12px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: var(--mint-text-muted, #64748b);
|
||||
background: #f8fafc;
|
||||
@@ -1057,7 +1057,7 @@
|
||||
color: #dc2626;
|
||||
}
|
||||
.duty-cal td {
|
||||
height: 108px;
|
||||
height: 120px;
|
||||
padding: 6px;
|
||||
vertical-align: top;
|
||||
border-right: 1px solid var(--mint-border, #d9e8e2);
|
||||
@@ -1083,15 +1083,15 @@
|
||||
}
|
||||
.day-num {
|
||||
margin-bottom: 4px;
|
||||
font-size: 12px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.duty-cal td.today .day-num {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
color: #fff;
|
||||
background: var(--el-color-primary, #10b981);
|
||||
border-radius: 50%;
|
||||
@@ -1099,10 +1099,10 @@
|
||||
.chip {
|
||||
display: block;
|
||||
margin-bottom: 3px;
|
||||
padding: 2px 6px;
|
||||
padding: 3px 6px;
|
||||
overflow: hidden;
|
||||
font-size: 11px;
|
||||
line-height: 1.3;
|
||||
font-size: 14px;
|
||||
line-height: 1.35;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
border-radius: 4px;
|
||||
|
||||
Reference in new issue
Block a user