admin-vben5/apps/web-antd/src/views/property/attendanceManagement/shiftSetting/data.ts
2025-07-21 11:50:09 +08:00

119 lines
2.3 KiB
TypeScript

import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'name',
label: '班次名称',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('wy_state'),
},
fieldName: 'status',
label: '状态',
},
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '序号',
field: 'id',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
},
{
title: '班次名称',
field: 'name',
},
{
title: '考勤开始时间',
field: 'startTime',
},
{
title: '考勤结束时间',
field: 'endTime',
},
{
title: '状态',
field: 'status',
slots: {default: 'state'},
},
{
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',
rules: 'required',
},
{
label: '考勤时间',
fieldName: 'attendanceTimeRange',
component: 'Input',
rules: 'required',
slots:{
default: 'attendanceTimeRange'
}
},
{
label: '是否休息',
fieldName: 'isRest',
component: 'RadioGroup',
componentProps: {
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: 'Select',
// componentProps: {
// options: getDictOptions('wy_state'),
// },
// rules: 'required',
// },
];