admin-vben5/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/data.ts

119 lines
2.3 KiB
TypeScript
Raw Normal View History

2025-07-19 14:45:35 +08:00
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
2025-07-19 17:17:58 +08:00
import {getDictOptions} from "#/utils/dict";
2025-07-19 14:45:35 +08:00
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'name',
label: '班次名称',
},
{
2025-07-19 17:17:58 +08:00
component: 'Select',
2025-07-19 14:45:35 +08:00
componentProps: {
2025-07-19 17:17:58 +08:00
options: getDictOptions('wy_state'),
2025-07-19 14:45:35 +08:00
},
fieldName: 'status',
label: '状态',
},
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
2025-07-19 17:17:58 +08:00
title: '序号',
2025-07-19 14:45:35 +08:00
field: 'id',
2025-07-19 17:17:58 +08:00
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
2025-07-19 14:45:35 +08:00
},
{
title: '班次名称',
field: 'name',
},
2025-07-21 11:50:09 +08:00
2025-07-19 14:45:35 +08:00
{
title: '考勤开始时间',
field: 'startTime',
},
{
title: '考勤结束时间',
field: 'endTime',
},
{
title: '状态',
field: 'status',
2025-07-19 17:17:58 +08:00
slots: {default: 'state'},
2025-07-19 14:45:35 +08:00
},
{
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',
2025-07-21 11:50:09 +08:00
rules: 'required',
2025-07-19 14:45:35 +08:00
},
{
2025-07-19 17:17:58 +08:00
label: '考勤时间',
fieldName: 'attendanceTimeRange',
component: 'Input',
rules: 'required',
slots:{
default: 'attendanceTimeRange'
}
2025-07-19 14:45:35 +08:00
},
{
2025-07-19 17:17:58 +08:00
label: '是否休息',
fieldName: 'isRest',
2025-07-19 14:45:35 +08:00
component: 'RadioGroup',
componentProps: {
2025-07-19 17:17:58 +08:00
options: [
2025-07-21 11:50:09 +08:00
{ label: '不休息', value: 0 },
{ label: '休息', value: 1 },
2025-07-19 17:17:58 +08:00
],
2025-07-19 14:45:35 +08:00
},
2025-07-19 17:17:58 +08:00
rules: 'required',
2025-07-19 14:45:35 +08:00
},
{
2025-07-19 17:17:58 +08:00
label: '中途休息时间',
fieldName: 'restTimeRange',
2025-07-19 14:45:35 +08:00
component: 'Input',
2025-07-19 17:17:58 +08:00
rules: 'required',
slots:{
default: 'restTimeRange'
},
dependencies: {
show: (formValue) =>formValue.isRest==1 ,
triggerFields: ['isRest'],
2025-07-19 14:45:35 +08:00
},
},
2025-07-21 11:50:09 +08:00
// {
// label: '状态',
// fieldName: 'status',
// component: 'Select',
// componentProps: {
// options: getDictOptions('wy_state'),
// },
// rules: 'required',
// },
2025-07-19 14:45:35 +08:00
];