import type { FormSchemaGetter } from '#/adapter/form'; import type { VxeGridProps } from '#/adapter/vxe-table'; import {getDictOptions} from "#/utils/dict"; import {renderDict} from "#/utils/render"; import type { TableColumnsType } from 'ant-design-vue'; 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', }, { label: '', fieldName: 'shiftData', component: 'Input', dependencies: { show: (formValue) => formValue.attendanceType=='1', triggerFields: ['attendanceType'], }, slots:{ default:'shiftData' }, }, { label: '排班周期', fieldName: 'schedulingCycle', component: 'Input', dependencies: { show: (formValue) => formValue.attendanceType=='1', triggerFields: ['attendanceType'], }, slots:{ default:'schedulingCycle' }, defaultValue:'1', rules:'required' }, { label: '', fieldName: 'cycleData', component: 'Input', dependencies: { show: (formValue) => formValue.attendanceType=='1', triggerFields: ['attendanceType'], }, slots:{ default:'cycleData' }, }, ]; export const weekdayColumns: TableColumnsType = [ { title: '工作日', key: 'label', width:180, align:'center', dataIndex:'label' }, { title: '班次', key: 'shift', minWidth:180, align:'center', dataIndex:'shift' }, { title: '操作', key: 'action', dataIndex:'action', width:180, align:'center', }, ] 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', }, ] 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', }, ]