From 7a5c5250b66cc6faffbcac9e192073473c50f79f Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 28 八月 2026 17:02:04 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/dev_pro2.0' into dev_pro2.0
---
src/views/hrm/schedule/index.vue | 743 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 743 insertions(+), 0 deletions(-)
diff --git a/src/views/hrm/schedule/index.vue b/src/views/hrm/schedule/index.vue
new file mode 100644
index 0000000..6f4c443
--- /dev/null
+++ b/src/views/hrm/schedule/index.vue
@@ -0,0 +1,743 @@
+<script lang="ts" setup>
+import type { HrmEmployeeApi } from '#/api/hrm/employee';
+import type { HrmEmployeeScheduleApi } from '#/api/hrm/schedule';
+import type { HrmShiftApi } from '#/api/hrm/shift';
+
+import { computed, onMounted, ref, watch } from 'vue';
+
+import dayjs from 'dayjs';
+
+import {
+ Button,
+ Checkbox,
+ DatePicker,
+ Empty,
+ Input,
+ message,
+ Modal,
+ Pagination,
+ Radio,
+ Segmented,
+ Select,
+ TreeSelect,
+} from 'ant-design-vue';
+
+import { Page } from '#/packages/effects/common-ui/src';
+
+import { getEmployeePage } from '#/api/hrm/employee';
+import { getShiftList } from '#/api/hrm/shift';
+import { getEmployeeScheduleList, saveEmployeeSchedule } from '#/api/hrm/schedule';
+import { getDeptList } from '#/api/system/dept';
+import { handleTree } from '#/packages/utils/src';
+
+import {
+ REST_MODE,
+ REST_MODE_OPTIONS,
+ formatDate,
+ getDaysOfMonth,
+} from './data';
+import type { RestMode } from './data';
+
+defineOptions({ name: 'HrmSchedule' });
+
+// ========== 鏌ヨ鏉′欢 ==========
+const month = ref<string>('');
+const deptId = ref<number>();
+const deptTree = ref<any[]>([]);
+
+/** 鍛樺伐鍒嗛〉锛堟帓鐝綉鏍兼瘡娆″彧鏄剧ず涓�椤靛憳宸ワ級 */
+const employeePageNo = ref(1);
+const employeePageSize = ref(20);
+const employeeTotal = ref(0);
+
+/** 鎸夊憳宸ョ紪鍙�/濮撳悕/鎵嬫満鍙锋悳绱㈠崟涓憳宸� */
+const keyword = ref('');
+
+/** 淇濆瓨鏃跺崟娆¤姹傜殑鎺掔彮鏉$洰鏁帮紙闃叉澶ф壒閲忚姹傝繃澶э級 */
+const SAVE_BATCH_SIZE = 1000;
+
+// ========== 鏁版嵁 ==========
+const employees = ref<HrmEmployeeApi.Employee[]>([]);
+const shiftList = ref<HrmShiftApi.Shift[]>([]);
+const loading = ref(false);
+const saving = ref(false);
+/** 鏄惁宸叉墽琛岃繃鏌ヨ */
+const loaded = ref(false);
+
+// ========== 鍛樺伐鍕鹃�� ==========
+/** Checkbox 鍙樻洿浜嬩欢锛堜粎鍙� checked 瀛楁锛� */
+interface CheckChangeEvent {
+ target: { checked: boolean };
+}
+
+/** 鍕鹃�夌殑鍛樺伐ID闆嗗悎锛屼负绌烘椂鑷姩鎺掔彮浣滅敤浜庡叏閮ㄥ憳宸� */
+const checkedEmployeeIds = ref<Set<number>>(new Set());
+
+const isAllChecked = computed(
+ () =>
+ employees.value.length > 0 &&
+ checkedEmployeeIds.value.size === employees.value.length,
+);
+
+function isChecked(id: number): boolean {
+ return checkedEmployeeIds.value.has(id);
+}
+
+function handleCheck(id: number, e: CheckChangeEvent) {
+ const set = new Set(checkedEmployeeIds.value);
+ if (e.target.checked) {
+ set.add(id);
+ } else {
+ set.delete(id);
+ }
+ checkedEmployeeIds.value = set;
+}
+
+function handleCheckAll(e: CheckChangeEvent) {
+ if (e.target.checked) {
+ checkedEmployeeIds.value = new Set(
+ employees.value
+ .map((item) => item.id)
+ .filter((id): id is number => id != null),
+ );
+ } else {
+ checkedEmployeeIds.value = new Set();
+ }
+}
+
+// ========== 鑷姩鎺掔彮 ==========
+const autoOpen = ref(false);
+const autoShiftId = ref<number>();
+const autoRestMode = ref<RestMode>(REST_MODE.DOUBLE);
+
+/** 鑷姩鎺掔彮鐝閫夋嫨閫夐」 */
+const autoShiftOptions = computed(() =>
+ shiftList.value.map((shift) => ({
+ label: `${shift.name} (${shift.startTime}~${shift.endTime})`,
+ value: shift.id,
+ })),
+);
+
+/** 鎸変紤鎭ā寮忎负褰撳墠鍛樺伐鐢熸垚鏁存湀鎺掔彮锛堜紤鎭棩娓呴櫎锛屽伐浣滄棩濉彮娆★級 */
+function applyAutoSchedule() {
+ if (!employees.value.length || !days.value.length) {
+ message.warning('璇峰厛鏌ヨ鍑哄憳宸�');
+ return;
+ }
+ if (autoShiftId.value == null) {
+ message.warning('璇烽�夋嫨鎺掔彮鐝');
+ return;
+ }
+ // 鍕鹃�変簡鍛樺伐鍒欏彧瀵瑰嬀閫変汉鐢熸晥锛屾湭鍕鹃�夊垯浣滅敤浜庡叏閮ㄥ憳宸�
+ const targets =
+ checkedEmployeeIds.value.size > 0
+ ? employees.value.filter(
+ (item) =>
+ item.id != null && checkedEmployeeIds.value.has(item.id),
+ )
+ : employees.value;
+ if (!targets.length) {
+ message.warning('璇峰厛鍕鹃�夊憳宸�');
+ return;
+ }
+ const map = new Map(scheduleMap.value);
+ for (const emp of targets) {
+ if (emp.id == null) {
+ continue;
+ }
+ for (const day of days.value) {
+ const date = formatDate(month.value, day);
+ const week = new Date(
+ `${month.value}-${String(day).padStart(2, '0')}`,
+ ).getDay();
+ let rest = false;
+ if (autoRestMode.value === REST_MODE.DOUBLE) {
+ rest = week === 0 || week === 6;
+ } else if (autoRestMode.value === REST_MODE.SINGLE) {
+ rest = week === 0;
+ }
+ map.set(`${emp.id}_${date}`, rest ? null : autoShiftId.value);
+ }
+ }
+ scheduleMap.value = map;
+ autoOpen.value = false;
+ message.success('鑷姩鎺掔彮宸茬敓鎴愶紝鍙墜鍔ㄥ井璋冨悗淇濆瓨');
+}
+
+/** 鐝 id 鈫� 鐝 鏄犲皠 */
+const shiftMap = computed(() => {
+ const map = new Map<number, HrmShiftApi.Shift>();
+ for (const shift of shiftList.value) {
+ if (shift.id != null) {
+ map.set(shift.id, shift);
+ }
+ }
+ return map;
+});
+
+/**
+ * 鎺掔彮鏁版嵁銆俴ey = `${employeeId}_${date}`锛寁alue = shiftId锛坣ull 琛ㄧず浼戞伅锛�
+ */
+const scheduleMap = ref(new Map<string, number | null>());
+
+/** 褰撴湀澶╂暟鏁扮粍 */
+const days = computed(() => (month.value ? getDaysOfMonth(month.value) : []));
+
+// ========== 瑙嗗浘鍒囨崲锛堝懆/鏈堬級==========
+const WEEK_LABELS = ['鏃�', '涓�', '浜�', '涓�', '鍥�', '浜�', '鍏�'];
+
+interface ViewDay {
+ day: number;
+ date: string;
+ weekLabel: string;
+ isWeekend: boolean;
+}
+
+const viewMode = ref<'week' | 'month'>('week');
+/** 鏈堣鍥炬槸鍚︽樉绀哄懆鏈垪锛堥粯璁ら殣钘忥紝鍑忓垪缂撹В鎷ユ尋锛� */
+const showWeekend = ref(false);
+/** 鍛ㄨ鍥鹃敋鐐规棩鏈� */
+const viewAnchor = ref<Date>(new Date());
+
+/** 褰撳墠瑙嗗浘瑕佸睍绀虹殑鏃ユ湡鍒楄〃 */
+const viewDays = computed<ViewDay[]>(() => {
+ if (viewMode.value === 'week') {
+ // 浠ュ懆涓�涓轰竴鍛ㄨ捣鐐�
+ const base = dayjs(viewAnchor.value).day(1);
+ return Array.from({ length: 7 }, (_, i) => {
+ const date = base.add(i, 'day');
+ const week = date.day();
+ return {
+ day: date.date(),
+ date: date.format('YYYY-MM-DD'),
+ weekLabel: WEEK_LABELS[week] ?? '',
+ isWeekend: week === 0 || week === 6,
+ };
+ });
+ }
+ return days.value
+ .filter((day) => {
+ if (showWeekend.value) {
+ return true;
+ }
+ const week = new Date(
+ `${month.value}-${String(day).padStart(2, '0')}`,
+ ).getDay();
+ return week !== 0 && week !== 6;
+ })
+ .map((day) => {
+ const week = new Date(
+ `${month.value}-${String(day).padStart(2, '0')}`,
+ ).getDay();
+ return {
+ day,
+ date: formatDate(month.value, day),
+ weekLabel: WEEK_LABELS[week] ?? '',
+ isWeekend: week === 0 || week === 6,
+ };
+ });
+});
+
+/** 鍛ㄨ鍥惧綋鍓嶆樉绀鸿寖鍥存爣绛� */
+const weekRangeLabel = computed(() => {
+ const list = viewDays.value;
+ const first = list[0];
+ const last = list[list.length - 1];
+ if (!first || !last) {
+ return '';
+ }
+ return `${first.date} ~ ${last.date}`;
+});
+
+function shiftWeek(delta: number) {
+ viewAnchor.value = dayjs(viewAnchor.value).add(delta, 'week').toDate();
+}
+
+// 鏈堜唤鍙樺寲鏃讹紝鍛ㄨ鍥鹃敋鐐硅惤鍒拌鏈� 1 鍙锋墍鍦ㄥ懆
+watch(month, (value) => {
+ if (value) {
+ viewAnchor.value = new Date(`${value}-01`);
+ }
+});
+
+function getShiftByCell(employeeId: number, date: string): HrmShiftApi.Shift | undefined {
+ const shiftId = scheduleMap.value.get(`${employeeId}_${date}`);
+ if (shiftId == null) {
+ return undefined;
+ }
+ return shiftMap.value.get(shiftId);
+}
+
+// ========== 鐝閫夋嫨寮圭獥 ==========
+const pickerOpen = ref(false);
+const pickerEmployee = ref<HrmEmployeeApi.Employee>();
+const pickerDate = ref<string>('');
+
+const pickerTitle = computed(() => {
+ if (!pickerEmployee.value || !pickerDate.value) {
+ return '閫夋嫨鐝';
+ }
+ return `閫夋嫨鐝 路 ${pickerEmployee.value.name} 路 ${pickerDate.value}`;
+});
+
+function openPicker(emp: HrmEmployeeApi.Employee, date: string) {
+ pickerEmployee.value = emp;
+ pickerDate.value = date;
+ pickerOpen.value = true;
+}
+
+/** 褰撳墠寮圭獥鏍煎瓙鏄惁宸查�夎鐝 */
+function isCurrentPick(shiftId: number): boolean {
+ if (!pickerEmployee.value || !pickerDate.value) {
+ return false;
+ }
+ return (
+ scheduleMap.value.get(`${pickerEmployee.value.id}_${pickerDate.value}`) ===
+ shiftId
+ );
+}
+
+function pickShift(shiftId: number | null) {
+ if (!pickerEmployee.value || !pickerDate.value) {
+ return;
+ }
+ scheduleMap.value.set(`${pickerEmployee.value.id}_${pickerDate.value}`, shiftId);
+ pickerOpen.value = false;
+}
+
+// ========== 鍔犺浇 ==========
+async function loadDeptTree() {
+ const data = await getDeptList();
+ deptTree.value = handleTree(data);
+}
+
+/**
+ * 鍒嗛〉鎷夊彇閮ㄩ棬涓嬬殑鍏ㄩ儴鍛樺伐锛堝崟椤典笂闄� 200锛屽惊鐜嫾鍏級锛屼緵鎺掔彮缃戞牸鏁磋〃灞曠ず
+ */
+/** 鍔犺浇褰撳墠椤靛憳宸ワ紙缈婚〉鏃跺彧閲嶆柊鎷夊憳宸ワ紝鎺掔彮鏁版嵁淇濈暀锛� */
+async function loadEmployeePage() {
+ loading.value = true;
+ try {
+ const res = await getEmployeePage({
+ pageNo: employeePageNo.value,
+ pageSize: employeePageSize.value,
+ deptId: deptId.value,
+ keyword: keyword.value || undefined,
+ });
+ employees.value = res.list ?? [];
+ employeeTotal.value = res.total ?? 0;
+ } finally {
+ loading.value = false;
+ }
+}
+
+/** 鍛樺伐缈婚〉 */
+function handlePageChange(page: number, pageSize: number) {
+ if (pageSize !== employeePageSize.value) {
+ employeePageSize.value = pageSize;
+ employeePageNo.value = 1;
+ } else {
+ employeePageNo.value = page;
+ }
+ loadEmployeePage();
+}
+
+/** 鎸夊叧閿瘝鎼滅储鍛樺伐 */
+function handleSearch() {
+ employeePageNo.value = 1;
+ loadEmployeePage();
+}
+
+async function loadData() {
+ if (!month.value) {
+ message.warning('璇烽�夋嫨鏈堜唤');
+ return;
+ }
+ if (!deptId.value) {
+ message.warning('璇峰厛閫夋嫨閮ㄩ棬');
+ return;
+ }
+ loading.value = true;
+ try {
+ const [shifts, schedules] = await Promise.all([
+ getShiftList(),
+ getEmployeeScheduleList({
+ yearMonth: month.value,
+ deptId: deptId.value,
+ }),
+ ]);
+ shiftList.value = shifts;
+ const map = new Map<string, number | null>();
+ for (const item of schedules) {
+ if (item.employeeId != null && item.date) {
+ map.set(`${item.employeeId}_${item.date}`, item.shiftId ?? null);
+ }
+ }
+ scheduleMap.value = map;
+ loaded.value = true;
+ } finally {
+ loading.value = false;
+ }
+ // 鍔犺浇绗竴椤靛憳宸�
+ employeePageNo.value = 1;
+ await loadEmployeePage();
+}
+
+// ========== 淇濆瓨锛堟暣鏈堝叏閲忥級 ==========
+async function handleSave() {
+ if (!month.value || !employees.value.length) {
+ return;
+ }
+ Modal.confirm({
+ title: '纭淇濆瓨',
+ content: `灏嗕繚瀛樺綋鍓嶉〉 ${employees.value.length} 鍚嶅憳宸ュ湪 ${month.value} 鐨勫叏閮ㄦ帓鐝紝纭畾缁х画鍚楋紵`,
+ okText: '纭畾',
+ cancelText: '鍙栨秷',
+ onOk: async () => {
+ saving.value = true;
+ try {
+ const items: HrmEmployeeScheduleApi.ScheduleItem[] = [];
+ for (const emp of employees.value) {
+ if (emp.id == null) {
+ continue;
+ }
+ for (const day of days.value) {
+ const date = formatDate(month.value, day);
+ items.push({
+ employeeId: emp.id,
+ date,
+ shiftId: scheduleMap.value.get(`${emp.id}_${date}`) ?? null,
+ });
+ }
+ }
+ // 澶ф壒閲忔椂鍒嗘壒鎻愪氦锛岄伩鍏嶅崟娆¤姹傝繃澶�
+ for (let i = 0; i < items.length; i += SAVE_BATCH_SIZE) {
+ await saveEmployeeSchedule(items.slice(i, i + SAVE_BATCH_SIZE));
+ }
+ message.success('鎺掔彮淇濆瓨鎴愬姛');
+ } finally {
+ saving.value = false;
+ }
+ },
+ });
+}
+
+onMounted(() => {
+ month.value = dayjs().format('YYYY-MM');
+ loadDeptTree();
+});
+</script>
+
+<template>
+ <Page auto-content-height>
+ <!-- 鏌ヨ宸ュ叿鏍� -->
+ <div
+ class="mb-4 flex flex-wrap items-center gap-3 rounded-lg bg-white p-4"
+ >
+ <DatePicker
+ v-model:value="month"
+ picker="month"
+ :allow-clear="false"
+ value-format="YYYY-MM"
+ format="YYYY-MM"
+ style="width: 140px"
+ />
+ <TreeSelect
+ v-model:value="deptId"
+ :tree-data="deptTree"
+ :field-names="{ label: 'name', value: 'id', children: 'children' }"
+ allow-clear
+ placeholder="璇烽�夋嫨閮ㄩ棬"
+ tree-default-expand-all
+ style="width: 200px"
+ />
+ <Input
+ v-model:value="keyword"
+ allow-clear
+ placeholder="鍛樺伐缂栧彿/濮撳悕/鎵嬫満鍙�"
+ style="width: 200px"
+ @pressEnter="handleSearch"
+ />
+ <Button type="primary" :loading="loading" @click="loadData">
+ 鏌ヨ鎺掔彮
+ </Button>
+ <Button :disabled="!employees.length" @click="autoOpen = true">
+ 鑷姩鎺掔彮
+ </Button>
+ <Button
+ type="primary"
+ :loading="saving"
+ :disabled="!employees.length"
+ @click="handleSave"
+ >
+ 淇濆瓨鎺掔彮
+ </Button>
+ <Segmented
+ v-model:value="viewMode"
+ :options="[
+ { label: '鍛ㄨ鍥�', value: 'week' },
+ { label: '鏈堣鍥�', value: 'month' },
+ ]"
+ />
+ <template v-if="viewMode === 'week'">
+ <Button @click="shiftWeek(-1)">涓婁竴鍛�</Button>
+ <span class="text-sm text-gray-500">{{ weekRangeLabel }}</span>
+ <Button @click="shiftWeek(1)">涓嬩竴鍛�</Button>
+ </template>
+ <template v-else>
+ <Checkbox v-model:checked="showWeekend">鏄剧ず鍛ㄦ湯</Checkbox>
+ </template>
+ </div>
+
+ <!-- 鐝鍥句緥 -->
+ <div
+ v-if="shiftList.length"
+ class="mb-4 flex flex-wrap items-center gap-4 rounded-lg bg-white px-4 py-3"
+ >
+ <span class="text-sm text-gray-500">鐝鍥句緥锛�</span>
+ <span
+ v-for="shift in shiftList"
+ :key="shift.id"
+ class="inline-flex items-center gap-1.5 text-sm"
+ >
+ <span
+ class="inline-block h-3 w-3 rounded"
+ :style="{ backgroundColor: shift.color || '#1677ff' }"
+ />
+ <span>{{ shift.name }}</span>
+ <span class="text-xs text-gray-400"
+ >{{ shift.startTime }}~{{ shift.endTime }}</span
+ >
+ </span>
+ </div>
+
+ <!-- 鎺掔彮缃戞牸 -->
+ <div class="overflow-auto rounded-lg bg-white">
+ <Empty
+ v-if="!employees.length && !loading"
+ :description="
+ loaded
+ ? '璇ラ儴闂ㄦ殏鏃犵鍚堟潯浠剁殑鍛樺伐锛岃璋冩暣閮ㄩ棬鎴栧憳宸ョ姸鎬�'
+ : '璇烽�夋嫨鏈堜唤銆侀儴闂ㄥ悗锛岀偣鍑汇�屾煡璇㈡帓鐝��'
+ "
+ class="py-20"
+ />
+ <table v-else class="schedule-table w-full text-sm">
+ <thead>
+ <tr>
+ <th class="schedule-check-col bg-gray-100">
+ <Checkbox :checked="isAllChecked" @change="handleCheckAll" />
+ </th>
+ <th class="schedule-name-col bg-gray-100 text-left">鍛樺伐</th>
+ <th
+ v-for="vd in viewDays"
+ :key="vd.date"
+ :class="[
+ 'schedule-date-col text-center',
+ vd.isWeekend ? 'bg-red-50' : 'bg-gray-50',
+ ]"
+ >
+ <div class="font-medium">{{ vd.day }}</div>
+ <div class="text-xs text-gray-400">{{ vd.weekLabel }}</div>
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr v-for="emp in employees" :key="emp.id">
+ <td class="schedule-check-col" @click.stop>
+ <Checkbox
+ :checked="isChecked(emp.id!)"
+ @change="handleCheck(emp.id!, $event)"
+ />
+ </td>
+ <td class="schedule-name-col">
+ <div class="font-medium">{{ emp.name }}</div>
+ <div class="text-xs text-gray-400">{{ emp.employeeNo }}</div>
+ </td>
+ <td
+ v-for="vd in viewDays"
+ :key="vd.date"
+ class="schedule-cell"
+ :class="[vd.isWeekend ? 'bg-red-50/40' : '']"
+ @click="openPicker(emp, vd.date)"
+ >
+ <span
+ v-if="getShiftByCell(emp.id!, vd.date)"
+ class="shift-chip"
+ :title="getShiftByCell(emp.id!, vd.date)!.name"
+ :style="{
+ backgroundColor:
+ getShiftByCell(emp.id!, vd.date)!.color || '#1677ff',
+ }"
+ >
+ {{ getShiftByCell(emp.id!, vd.date)!.name }}
+ </span>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+
+ <!-- 鍛樺伐鍒嗛〉 -->
+ <div
+ v-if="loaded && employees.length"
+ class="mt-4 flex items-center justify-end rounded-lg bg-white p-3"
+ >
+ <Pagination
+ :current="employeePageNo"
+ :page-size="employeePageSize"
+ :total="employeeTotal"
+ show-size-changer
+ show-quick-jumper
+ :show-total="(total: number) => `鍏� ${total} 浜篳"
+ @change="handlePageChange"
+ />
+ </div>
+
+ <!-- 鐝閫夋嫨寮圭獥 -->
+ <Modal
+ v-model:open="pickerOpen"
+ :title="pickerTitle"
+ :footer="null"
+ :width="440"
+ >
+ <div class="grid grid-cols-2 gap-3">
+ <button
+ v-for="shift in shiftList"
+ :key="shift.id"
+ type="button"
+ class="flex cursor-pointer flex-col items-center gap-1 rounded-lg border px-2 py-3 transition-colors hover:border-blue-500"
+ :class="[
+ isCurrentPick(shift.id!)
+ ? 'border-blue-500 bg-blue-50'
+ : 'border-gray-200',
+ ]"
+ @click="pickShift(shift.id!)"
+ >
+ <span class="inline-flex items-center gap-2 text-sm">
+ <span
+ class="inline-block h-3 w-3 rounded"
+ :style="{ backgroundColor: shift.color || '#1677ff' }"
+ />
+ <span class="font-medium">{{ shift.name }}</span>
+ </span>
+ <span class="text-xs text-gray-400"
+ >{{ shift.startTime }} ~ {{ shift.endTime }}</span
+ >
+ </button>
+ </div>
+ <div class="mt-4 flex items-center justify-between">
+ <Button danger @click="pickShift(null)">娓呴櫎鎺掔彮锛堜紤鎭級</Button>
+ <Button @click="pickerOpen = false">鍙栨秷</Button>
+ </div>
+ </Modal>
+
+ <!-- 鑷姩鎺掔彮寮圭獥 -->
+ <Modal v-model:open="autoOpen" title="鑷姩鎺掔彮" :footer="null" :width="440">
+ <div class="space-y-4">
+ <div>
+ <div class="mb-1.5 text-sm text-gray-500">鎺掔彮鐝</div>
+ <Select
+ v-model:value="autoShiftId"
+ :options="autoShiftOptions"
+ placeholder="璇烽�夋嫨鎺掔彮鐝"
+ style="width: 100%"
+ />
+ </div>
+ <div>
+ <div class="mb-1.5 text-sm text-gray-500">浼戞伅妯″紡</div>
+ <Radio.Group
+ v-model:value="autoRestMode"
+ :options="REST_MODE_OPTIONS"
+ option-type="button"
+ />
+ </div>
+ <div class="text-xs text-gray-400">
+ 灏嗘寜鎵�閫夋ā寮忎负{{
+ checkedEmployeeIds.size > 0
+ ? checkedEmployeeIds.size
+ : employees.length
+ }}
+ 鍚嶅憳宸ョ敓鎴愭暣鏈堟帓鐝瓄{
+ checkedEmployeeIds.size > 0
+ ? '锛堜粎鍕鹃�夌殑鍛樺伐锛�'
+ : '锛堟湭鍕鹃�夋椂涓哄綋鍓嶉〉鍏ㄩ儴鍛樺伐锛�'
+ }}锛岀敓鎴愬悗鍙啀鎵嬪姩璋冩暣銆�
+ </div>
+ <div class="flex justify-end gap-2">
+ <Button @click="autoOpen = false">鍙栨秷</Button>
+ <Button type="primary" @click="applyAutoSchedule">鐢熸垚鎺掔彮</Button>
+ </div>
+ </div>
+ </Modal>
+ </Page>
+</template>
+
+<style lang="scss" scoped>
+.schedule-table {
+ width: 100%;
+ min-width: max-content;
+ border-collapse: separate;
+ border-spacing: 0;
+
+ th,
+ td {
+ height: 44px;
+ border: 1px solid #f0f0f0;
+ }
+
+ .schedule-date-col {
+ width: 52px;
+ min-width: 52px;
+ }
+
+ .schedule-check-col,
+ .schedule-name-col {
+ position: sticky;
+ z-index: 10;
+ background-color: #fafafa;
+ }
+
+ .schedule-check-col {
+ left: 0;
+ width: 40px;
+ min-width: 40px;
+ padding: 0 8px;
+ text-align: center;
+ }
+
+ .schedule-name-col {
+ left: 40px;
+ min-width: 180px;
+ padding: 0 12px;
+ line-height: 1.3;
+ }
+
+ thead .schedule-check-col,
+ thead .schedule-name-col {
+ z-index: 20;
+ }
+
+ .schedule-cell {
+ padding: 2px;
+ cursor: pointer;
+ text-align: center;
+
+ &:hover {
+ background-color: #e6f4ff;
+ }
+ }
+
+ .shift-chip {
+ display: inline-block;
+ max-width: 100%;
+ padding: 1px 6px;
+ overflow: hidden;
+ color: #fff;
+ font-size: 11px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ border-radius: 3px;
+ }
+}
+</style>
--
Gitblit v1.9.3