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

249 lines
4.8 KiB
TypeScript
Raw Normal View History

2025-07-19 17:25:17 +08:00
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
import {renderDict} from "#/utils/render";
2025-07-20 17:58:39 +08:00
import type { TableColumnsType } from 'ant-design-vue';
2025-07-19 17:25:17 +08:00
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'groupName',
label: '考勤组名称',
},
{
component: 'Select',
componentProps: {
options:getDictOptions('wy_kqlx')
},
fieldName: 'attendanceType',
label: '考勤类型',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '考勤组名称',
field: 'groupName',
minWidth:180,
},
{
title: '考勤类型',
field: 'attendanceType',
slots:{
default: ({row})=>{
return renderDict(row.attendanceType,'wy_kqlx')
}
},
width:150
},
{
title: '状态',
field: 'status',
slots:{
default: 'status'
},
width:180
},
{
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: 'groupName',
component: 'Input',
rules: 'required',
},
{
label: '考勤类型',//(0:固定班制,1:排班制)
fieldName: 'attendanceType',
component: 'RadioGroup',
componentProps: {
buttonStyle: 'solid',
options: getDictOptions('wy_kqlx'),
},
rules: 'selectRequired',
defaultValue:'0'
},
{
label: '工作日设置',
fieldName: 'weekdaySetting',
component: 'Input',
dependencies: {
show: (formValue) => formValue.attendanceType=='0',
triggerFields: ['attendanceType'],
},
slots:{
default:'weekdaySetting'
},
rules:'required',
defaultValue:'1',
},
{
label: '',
fieldName: 'settingItem',
component: 'Input',
dependencies: {
show: (formValue) => formValue.attendanceType=='0',
triggerFields: ['attendanceType'],
},
slots:{
default:'settingItem'
},
},
{
label: '考勤班次',
fieldName: 'attendanceShift',
component: 'Input',
dependencies: {
show: (formValue) => formValue.attendanceType=='1',
triggerFields: ['attendanceType'],
},
slots:{
default:'attendanceShift'
},
rules:'required',
defaultValue:'1',
},
2025-07-20 17:58:39 +08:00
{
label: '',
fieldName: 'shiftData',
component: 'Input',
dependencies: {
show: (formValue) => formValue.attendanceType=='1',
triggerFields: ['attendanceType'],
},
slots:{
default:'shiftData'
},
},
2025-07-19 17:25:17 +08:00
{
label: '排班周期',
fieldName: 'schedulingCycle',
component: 'Input',
dependencies: {
show: (formValue) => formValue.attendanceType=='1',
triggerFields: ['attendanceType'],
},
slots:{
default:'schedulingCycle'
},
defaultValue:'1',
rules:'required'
},
2025-07-20 17:58:39 +08:00
{
label: '',
fieldName: 'cycleData',
component: 'Input',
dependencies: {
show: (formValue) => formValue.attendanceType=='1',
triggerFields: ['attendanceType'],
},
slots:{
default:'cycleData'
},
},
2025-07-19 17:25:17 +08:00
];
2025-07-20 17:58:39 +08:00
export const weekdayColumns: TableColumnsType = [
2025-07-19 17:25:17 +08:00
{
title: '工作日',
2025-07-20 17:58:39 +08:00
key: 'label',
2025-07-19 17:25:17 +08:00
width:180,
align:'center',
dataIndex:'label'
},
{
title: '班次',
2025-07-20 17:58:39 +08:00
key: 'shift',
2025-07-19 17:25:17 +08:00
minWidth:180,
align:'center',
dataIndex:'shift'
},
{
title: '操作',
2025-07-20 17:58:39 +08:00
key: 'action',
2025-07-19 17:25:17 +08:00
dataIndex:'action',
width:180,
align:'center',
2025-07-20 17:58:39 +08:00
},
]
export const noClockingColumns: TableColumnsType = [
{
title: '无需打卡日期',
key: 'label',
width:180,
align:'center',
dataIndex:'label'
},
{
title: '操作',
key: 'action',
dataIndex:'action',
width:180,
align:'center',
},
]
export const clockingColumns: TableColumnsType = [
{
title: '必须打卡日期',
key: 'label',
width:180,
align:'center',
dataIndex:'label'
},
{
title: '操作',
key: 'action',
dataIndex:'action',
width:180,
align:'center',
},
]
2025-07-19 17:25:17 +08:00
2025-07-20 17:58:39 +08:00
export const cycleColumns: TableColumnsType = [
{
title: '天数',
key: 'label',
width:180,
align:'center',
dataIndex:'label'
},
{
title: '班次',
key: 'label',
width:180,
align:'center',
dataIndex:'label'
},
{
title: '操作',
key: 'action',
dataIndex:'action',
width:180,
align:'center',
2025-07-19 17:25:17 +08:00
},
]
2025-07-20 17:58:39 +08:00