From 62e45c3e94c24099e424afdd32471c1564b5f823 Mon Sep 17 00:00:00 2001 From: FLL <2162874245@qq.com> Date: Sat, 19 Jul 2025 17:17:58 +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 --- .../attendanceManagement/shiftSetting/data.ts | 147 +++++------------- .../shiftSetting/index.vue | 70 ++++----- .../shiftSetting/shift-detail.vue | 58 +++++++ .../shiftSetting/shift-modal.vue | 22 ++- 4 files changed, 146 insertions(+), 151 deletions(-) create mode 100644 apps/web-antd/src/views/property/attendanceManagement/shiftSetting/shift-detail.vue diff --git a/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/data.ts b/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/data.ts index 3f23707f..6f6fbdd2 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/data.ts +++ b/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/data.ts @@ -1,6 +1,6 @@ import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; - +import {getDictOptions} from "#/utils/dict"; export const querySchema: FormSchemaGetter = () => [ { @@ -9,68 +9,25 @@ export const querySchema: FormSchemaGetter = () => [ label: '班次名称', }, { - component: 'DatePicker', + component: 'Select', 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', + options: getDictOptions('wy_state'), }, 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', + title: '序号', field: 'id', + slots: { + default: ({ rowIndex }) => { + return (rowIndex + 1).toString(); + }, + }, }, { title: '班次名称', @@ -87,18 +44,7 @@ export const columns: VxeGridProps['columns'] = [ { title: '状态', field: 'status', - }, - { - title: '是否休息', - field: 'isRest', - }, - { - title: '休息开始时间', - field: 'restStartTime', - }, - { - title: '休息结束时间', - field: 'restEndTime', + slots: {default: 'state'}, }, { field: 'action', @@ -125,57 +71,46 @@ export const modalSchema: FormSchemaGetter = () => [ 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: 'attendanceTimeRange', + component: 'Input', + rules: 'required', + slots:{ + default: 'attendanceTimeRange' + } }, { - label: '考勤结束时间', - fieldName: 'endTime', - component: 'DatePicker', + label: '是否休息', + fieldName: 'isRest', + component: 'RadioGroup', componentProps: { - showTime: true, - format: 'YYYY-MM-DD HH:mm:ss', - valueFormat: 'YYYY-MM-DD HH:mm:ss', + options: [ + { label: '不休息', value: '0' }, + { label: '休息', value: '1' }, + ], + }, + rules: 'required', + }, + { + label: '中途休息时间', + fieldName: 'restTimeRange', + component: 'Input', + rules: 'required', + slots:{ + default: 'restTimeRange' + }, + dependencies: { + show: (formValue) =>formValue.isRest==1 , + triggerFields: ['isRest'], }, }, { label: '状态', fieldName: 'status', - component: 'RadioGroup', + component: 'Select', 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', + options: getDictOptions('wy_state'), }, + rules: 'required', }, ]; 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 278b8d2c..c356c100 100644 --- a/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/index.vue +++ b/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/index.vue @@ -1,30 +1,22 @@