diff --git a/apps/web-antd/src/api/property/attendanceManagement/shiftSetting/model.d.ts b/apps/web-antd/src/api/property/attendanceManagement/shiftSetting/model.d.ts index e0d1b668..04902ade 100644 --- a/apps/web-antd/src/api/property/attendanceManagement/shiftSetting/model.d.ts +++ b/apps/web-antd/src/api/property/attendanceManagement/shiftSetting/model.d.ts @@ -5,7 +5,7 @@ export interface ShiftVO { /** * 主键id */ - id: string | number; + id: string; /** * 班次名称 diff --git a/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/attendance-group-detail.vue b/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/attendance-group-detail.vue new file mode 100644 index 00000000..30ed4436 --- /dev/null +++ b/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/attendance-group-detail.vue @@ -0,0 +1,166 @@ + + + + diff --git a/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/change-shift-schedule.vue b/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/change-shift-schedule.vue index 81d6ebe6..7aa45d56 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/change-shift-schedule.vue +++ b/apps/web-antd/src/views/property/attendanceManagement/attendanceGroupSettings/change-shift-schedule.vue @@ -14,19 +14,21 @@ const [BasicModal, modalApi] = useVbenModal({ onConfirm: handleConfirm, }); -const emit = defineEmits<{ shiftInfo: [info: ShiftVO], shiftList: [list: ShiftVO[]] }>(); +const emit = defineEmits(['shiftInfo', 'shiftList', 'afterValue']); + const handleType = ref(1); -const tableLoading = ref(true); async function handleConfirm() { try { modalApi.lock(true); if (state.selectedRowKeys.length) { - let arr = shiftData.value.filter(item => state.selectedRowKeys.includes(item.id)) - if (handleType.value == 1 && arr.length) { - await emit('shiftInfo', arr[0]); - } else if (handleType.value == 2 && arr.length) { - await emit('shiftList', arr); + let arr = shiftData.value.filter((item: ShiftVO) => state.selectedRowKeys.includes(item.id)); + if (handleType.value === 1 && arr.length) { + emit('shiftInfo', arr[0]); + } else if (handleType.value === 2 && arr.length) { + emit('shiftList', arr); + } else if (handleType.value === 3 && arr.length) { + emit('afterValue', arr[0]); } } modalApi.close(); @@ -41,10 +43,11 @@ async function handleOpenChange(open: boolean) { if (!open) { return null; } - state.selectedRowKeys = [] - handleType.value = modalApi.getData()?.type; - await queryShiftData() modalApi.modalLoading(true); + state.selectedRowKeys = [] + const {type} = await modalApi.getData() as {type:number}; + handleType.value = type; + await queryShiftData() modalApi.modalLoading(false); } @@ -52,7 +55,6 @@ const shiftData = ref([]) const shiftName = ref('') async function queryShiftData() { - tableLoading.value = true let params = { name: shiftName.value, pageNum: 1, @@ -60,17 +62,16 @@ async function queryShiftData() { } const res = await shiftList(params) shiftData.value = res.rows - tableLoading.value = false } // 行勾选状态 const state = reactive({ - selectedRowKeys: [], + selectedRowKeys: [] as string[], }); // 勾选变化时的回调 const onSelectChange = (selectedRowKeys: string[]) => { - if (selectedRowKeys.length > 1 && handleType.value == 1) { + if (selectedRowKeys.length > 1 && (handleType.value == 1||handleType.value == 3)) { state.selectedRowKeys = selectedRowKeys.slice(-1); } else { state.selectedRowKeys = selectedRowKeys; @@ -110,7 +111,6 @@ const resetHandle = () => { :pagination="false" rowKey="id" :scroll="{ y: 350 }" - :loading="tableLoading" >