From 18aca4254d99780f45a4e6bfea1767ca0f53a4c3 Mon Sep 17 00:00:00 2001 From: FLL <2162874245@qq.com> Date: Sat, 19 Jul 2025 14:45:35 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E5=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shiftSetting/index.ts | 61 ++++++ .../shiftSetting/model.d.ts | 129 +++++++++++++ .../attendanceManagement/shiftSetting/data.ts | 181 ++++++++++++++++++ .../shiftSetting/index.vue | 181 +++++++++++++++++- .../shiftSetting/shift-modal.vue | 101 ++++++++++ 5 files changed, 648 insertions(+), 5 deletions(-) create mode 100644 apps/web-antd/src/api/property/attendanceManagement/shiftSetting/index.ts create mode 100644 apps/web-antd/src/api/property/attendanceManagement/shiftSetting/model.d.ts create mode 100644 apps/web-antd/src/views/property/attendanceManagement/shiftSetting/data.ts create mode 100644 apps/web-antd/src/views/property/attendanceManagement/shiftSetting/shift-modal.vue diff --git a/apps/web-antd/src/api/property/attendanceManagement/shiftSetting/index.ts b/apps/web-antd/src/api/property/attendanceManagement/shiftSetting/index.ts new file mode 100644 index 00000000..2ed90e67 --- /dev/null +++ b/apps/web-antd/src/api/property/attendanceManagement/shiftSetting/index.ts @@ -0,0 +1,61 @@ +import type { ShiftVO, ShiftForm, ShiftQuery } from './model'; + +import type { ID, IDS } from '#/api/common'; +import type { PageResult } from '#/api/common'; + +import { commonExport } from '#/api/helper'; +import { requestClient } from '#/api/request'; + +/** +* 查询班次表列表 +* @param params +* @returns 班次表列表 +*/ +export function shiftList(params?: ShiftQuery) { + return requestClient.get>('/Property/shift/list', { params }); +} + +/** + * 导出班次表列表 + * @param params + * @returns 班次表列表 + */ +export function shiftExport(params?: ShiftQuery) { + return commonExport('/Property/shift/export', params ?? {}); +} + +/** + * 查询班次表详情 + * @param id id + * @returns 班次表详情 + */ +export function shiftInfo(id: ID) { + return requestClient.get(`/Property/shift/${id}`); +} + +/** + * 新增班次表 + * @param data + * @returns void + */ +export function shiftAdd(data: ShiftForm) { + return requestClient.postWithMsg('/Property/shift', data); +} + +/** + * 更新班次表 + * @param data + * @returns void + */ +export function shiftUpdate(data: ShiftForm) { + return requestClient.putWithMsg('/Property/shift', data); +} + +/** + * 删除班次表 + * @param id id + * @returns void + */ +export function shiftRemove(id: ID | IDS) { + return requestClient.deleteWithMsg(`/Property/shift/${id}`); +} 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 new file mode 100644 index 00000000..76332c84 --- /dev/null +++ b/apps/web-antd/src/api/property/attendanceManagement/shiftSetting/model.d.ts @@ -0,0 +1,129 @@ +import type { PageQuery, BaseEntity } from '#/api/common'; + +export interface ShiftVO { + /** + * 主键id + */ + id: string | number; + + /** + * 班次名称 + */ + name: string; + + /** + * 考勤开始时间 + */ + startTime: string; + + /** + * 考勤结束时间 + */ + endTime: string; + + /** + * 状态(0:off,1:on) + */ + status: number; + + /** + * 是否休息(0:不休息,1:休息) + */ + isRest: number; + + /** + * 休息开始时间 + */ + restStartTime: string; + + /** + * 休息结束时间 + */ + restEndTime: string; + +} + +export interface ShiftForm extends BaseEntity { + /** + * 主键id + */ + id?: string | number; + + /** + * 班次名称 + */ + name?: string; + + /** + * 考勤开始时间 + */ + startTime?: string; + + /** + * 考勤结束时间 + */ + endTime?: string; + + /** + * 状态(0:off,1:on) + */ + status?: number; + + /** + * 是否休息(0:不休息,1:休息) + */ + isRest?: number; + + /** + * 休息开始时间 + */ + restStartTime?: string; + + /** + * 休息结束时间 + */ + restEndTime?: string; + +} + +export interface ShiftQuery extends PageQuery { + /** + * 班次名称 + */ + name?: string; + + /** + * 考勤开始时间 + */ + startTime?: string; + + /** + * 考勤结束时间 + */ + endTime?: string; + + /** + * 状态(0:off,1:on) + */ + status?: number; + + /** + * 是否休息(0:不休息,1:休息) + */ + isRest?: number; + + /** + * 休息开始时间 + */ + restStartTime?: string; + + /** + * 休息结束时间 + */ + restEndTime?: string; + + /** + * 日期范围参数 + */ + params?: any; +} diff --git a/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/data.ts b/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/data.ts new file mode 100644 index 00000000..3f23707f --- /dev/null +++ b/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/data.ts @@ -0,0 +1,181 @@ +import type { FormSchemaGetter } from '#/adapter/form'; +import type { VxeGridProps } from '#/adapter/vxe-table'; + + +export const querySchema: FormSchemaGetter = () => [ + { + component: 'Input', + fieldName: 'name', + label: '班次名称', + }, + { + component: 'DatePicker', + componentProps: { + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + }, + fieldName: 'startTime', + label: '考勤开始时间', + }, + { + component: 'DatePicker', + componentProps: { + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + }, + fieldName: 'endTime', + label: '考勤结束时间', + }, + { + component: 'RadioGroup', + componentProps: { + buttonStyle: 'solid', + optionType: 'button', + }, + fieldName: 'status', + label: '状态', + }, + { + component: 'Input', + fieldName: 'isRest', + label: '是否休息', + }, + { + component: 'DatePicker', + componentProps: { + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + }, + fieldName: 'restStartTime', + label: '休息开始时间', + }, + { + component: 'DatePicker', + componentProps: { + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + }, + fieldName: 'restEndTime', + label: '休息结束时间', + }, +]; + +// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新 +// export const columns: () => VxeGridProps['columns'] = () => [ +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '主键id', + field: 'id', + }, + { + title: '班次名称', + field: 'name', + }, + { + title: '考勤开始时间', + field: 'startTime', + }, + { + title: '考勤结束时间', + field: 'endTime', + }, + { + title: '状态', + field: 'status', + }, + { + title: '是否休息', + field: 'isRest', + }, + { + title: '休息开始时间', + field: 'restStartTime', + }, + { + title: '休息结束时间', + field: 'restEndTime', + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '操作', + width: 180, + }, +]; + +export const modalSchema: FormSchemaGetter = () => [ + { + label: '主键id', + fieldName: 'id', + component: 'Input', + dependencies: { + show: () => false, + triggerFields: [''], + }, + }, + { + label: '班次名称', + fieldName: 'name', + component: 'Input', + }, + { + label: '考勤开始时间', + fieldName: 'startTime', + component: 'DatePicker', + componentProps: { + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + }, + }, + { + label: '考勤结束时间', + fieldName: 'endTime', + component: 'DatePicker', + componentProps: { + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + }, + }, + { + label: '状态', + fieldName: 'status', + component: 'RadioGroup', + componentProps: { + buttonStyle: 'solid', + optionType: 'button', + }, + }, + { + label: '是否休息', + fieldName: 'isRest', + component: 'Input', + }, + { + label: '休息开始时间', + fieldName: 'restStartTime', + component: 'DatePicker', + componentProps: { + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + }, + }, + { + label: '休息结束时间', + fieldName: 'restEndTime', + component: 'DatePicker', + componentProps: { + showTime: true, + format: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'YYYY-MM-DD HH:mm:ss', + }, + }, +]; diff --git a/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/index.vue b/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/index.vue index cbdee30e..278b8d2c 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/index.vue +++ b/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/index.vue @@ -1,11 +1,182 @@ - - diff --git a/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/shift-modal.vue b/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/shift-modal.vue new file mode 100644 index 00000000..8c3f0b9e --- /dev/null +++ b/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/shift-modal.vue @@ -0,0 +1,101 @@ + + + +