import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' import * as AbilityInfoApi from '@/api/mes/abilityInfo' import { AbilityInfo } from '../abilityInfo/abilityInfo.data' // 表单校验 export const HrPersonAbilityRules = reactive({ ablityCode: [required], personCode: [required], }) export const HrPersonAbility = useCrudSchemas(reactive([ { label: '删除时间', field: 'deleteTime', sort: 'custom', formatter: dateFormatter, isSearch: false, isTable: false, isForm:false, isDetail:false, search: { component: 'DatePicker', componentProps: { valueFormat: 'YYYY-MM-DD HH:mm:ss', type: 'daterange', defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, form: { component: 'DatePicker', componentProps: { type: 'datetime', valueFormat: 'x' } }, }, { label: '主键', field: 'id', sort: 'custom', isForm: false, isTable: false, isDetail:false }, { label: '并发乐观锁', field: 'concurrencyStamp', sort: 'custom', isSearch: false, isTable: false, isForm:false, isDetail:false, form: { component: 'InputNumber', value: 0 }, }, { label: '创建时间', field: 'createTime', sort: 'custom', formatter: dateFormatter, isSearch: false, isTable: false, isDetail:false, search: { component: 'DatePicker', componentProps: { valueFormat: 'YYYY-MM-DD HH:mm:ss', type: 'daterange', defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, isForm: false, }, { label: '删除用户名', field: 'deleter', sort: 'custom', isSearch: false, isTable: false, isForm: false, isDetail:false, }, { label: '位置ID', field: 'siteId', sort: 'custom', isSearch: false, isTable: false, isForm: false, isDetail:false, form: { component: 'InputNumber', value: 0 }, }, { label: '人员ID', field: 'personId', sort: 'custom', isSearch: false, isTable: false, isForm: false, isDetail:false, form: { component: 'InputNumber', value: 0 }, }, { label: '人员工号', field: 'personCode', sort: 'custom', isSearch: true, }, { label: '能力编号', field: 'ablityCode', sort: 'custom', isSearch: true, form: { componentProps: { isSearchList: true, // 开启查询弹窗 searchTitle: '能力矩阵信息', // 查询弹窗标题 searchAllSchemas: AbilityInfo.allSchemas, // 查询弹窗所需类 searchField: 'ablityCode', // 查询弹窗赋值字段 searchPage: AbilityInfoApi.getAbilityInfoPage, // 查询弹窗所需分页方法 searchCondition: [{ key: 'status', value: '1', action: '==' }] } } }, { label: '能力等级', field: 'ablityLevel', sort: 'custom', isSearch: true, form: { component: 'InputNumber', value: 0 }, }, { label: '学习累计时长', field: 'studyDuration', sort: 'custom', isSearch: true, form: { component: 'InputNumber', componentProps: { min: 0, precision: 1 } }, }, { label: '工作累计时长', field: 'workDuration', sort: 'custom', isSearch: true, form: { component: 'InputNumber', componentProps: { min: 0, precision: 1 } }, }, { label: '备注', field: 'remark', sort: 'custom', isSearch: false, isTable: false }, { label: '状态', field: 'status', sort: 'custom', dictType: DICT_TYPE.QUALIFY_STATUS, dictClass: 'string', isForm: true, isSearch: true, isTable: true, form: { component: 'Switch', value: '2', componentProps: { inactiveValue: '2', activeValue: '1' } }, }, { label: '操作', field: 'action', isForm: false, table: { width: 150, fixed: 'right' } } ]))