This commit is contained in:
FLL
2025-07-19 17:17:58 +08:00
parent 5be03ab8c5
commit 62e45c3e94
4 changed files with 146 additions and 151 deletions

View File

@@ -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',
},
];