|
|
@@ -1,6 +1,7 @@
|
|
|
import request from '@/utils/http'
|
|
|
|
|
|
-export type ShiftType = 'morning' | 'evening' | 'duty'
|
|
|
+/** 预置 morning|evening|duty,亦可为自定义 dict_value */
|
|
|
+export type ShiftType = string
|
|
|
export type LinkStatus = 'open' | 'closed'
|
|
|
|
|
|
export interface DutyAssignmentItem {
|
|
|
@@ -16,8 +17,14 @@ export interface DutySlotItem {
|
|
|
shiftLabel?: string
|
|
|
capacity: number
|
|
|
taken?: number
|
|
|
- /** 班次工作安排 */
|
|
|
+ workPlans?: string[]
|
|
|
+ workPlanLabels?: string[]
|
|
|
+ /** 备注(与工作安排分离) */
|
|
|
remark?: string | null
|
|
|
+ startTime?: string | null
|
|
|
+ endTime?: string | null
|
|
|
+ crossDay?: boolean
|
|
|
+ timeLabel?: string | null
|
|
|
assignments: DutyAssignmentItem[]
|
|
|
}
|
|
|
|
|
|
@@ -49,7 +56,11 @@ export function saveDutyDay(data: {
|
|
|
slots: Array<{
|
|
|
shiftType: ShiftType
|
|
|
capacity: number
|
|
|
+ workPlans?: string[]
|
|
|
remark?: string | null
|
|
|
+ startTime?: string | null
|
|
|
+ endTime?: string | null
|
|
|
+ crossDay?: boolean
|
|
|
assignments: DutyAssignmentItem[]
|
|
|
}>
|
|
|
linkStatus?: LinkStatus
|
|
|
@@ -78,3 +89,13 @@ export function fetchDutyUserOptions() {
|
|
|
url: '/web/admin/duty/users/options'
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+export function ensureDutyDict(data: {
|
|
|
+ dictType: 'duty_shift_type' | 'duty_work_plan'
|
|
|
+ label: string
|
|
|
+}) {
|
|
|
+ return request.post<{ label: string; value: string }>({
|
|
|
+ url: '/web/admin/duty/dict/ensure',
|
|
|
+ data
|
|
|
+ })
|
|
|
+}
|