| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- /**
- * 审批流程表单配置
- */
- import { FormConfig } from '@/types/basic-form';
- export const APPROVAL_FORM_CONFIG: FormConfig[] = [
- {
- label: '审批流程名称:',
- prop: 'templateName',
- component: 'ElInput',
- componentProps: { placeholder: '请输入审批流程名称' },
- },
- {
- label: '审批流程描述:',
- prop: 'description',
- component: 'ElInput',
- componentProps: { placeholder: '请输入审批流程描述' },
- },
- ];
- export const APPROVAL_FORM_DATA = {
- templateName: '',
- description: '',
- };
- export const APPROVAL_FORM_RULES = {
- templateName: [{ required: true, message: '请输入审批流程名称', trigger: 'blur' }],
- };
- export const APPROVAL_NODE_FORM_CONFIG: FormConfig[] = [
- {
- label: '节点描述:',
- prop: 'nodeDescription',
- component: 'ElInput',
- componentProps: { placeholder: '请输入节点描述' },
- },
- {
- label: '审批人选择方式:',
- prop: 'approverType',
- component: 'ElSelect',
- selectOptions: [
- {
- label: '固定',
- value: 0,
- },
- {
- label: '自选',
- value: 1,
- },
- ],
- },
- {
- label: '审批方式:',
- prop: 'approvalType',
- component: 'ElSelect',
- selectOptions: [
- {
- label: '会签',
- value: 0,
- },
- {
- label: '或签',
- value: 1,
- },
- ],
- },
- {
- label: '审批节点顺序:',
- prop: 'approvalOrder',
- component: 'ElInputNumber',
- componentProps: {
- min: 1,
- },
- },
- ];
- export const APPROVAL_NODE_FORM_DATA = {
- approvalTemplateId: undefined,
- nodeDescription: '',
- approvalType: 0,
- approverType: 1,
- approvalOrder: undefined,
- };
- export const APPROVAL_NODE_FORM_RULES = {
- nodeDescription: [
- {
- required: true,
- message: '请输入节点描述',
- trigger: 'blur',
- },
- ],
- approverType: [
- {
- required: true,
- message: '请选择审批人选择方式',
- trigger: 'change',
- },
- ],
- approvalType: [
- {
- required: true,
- message: '请选择审批方式',
- trigger: 'change',
- },
- ],
- approvalOrder: [
- {
- required: true,
- // validator: (rule: any, value: any, callback: any, existingNumbers: number[]) => {
- // // 检查输入值是否与已有数组中的任何元素重复
- // if (value === null || value === undefined || value === '') {
- // callback(); // 空值校验由required规则处理
- // return;
- // }
- // if (existingNumbers.includes(Number(value))) {
- // callback(new Error('该顺序已存在,请重新输入'));
- // } else {
- // callback();
- // }
- // },
- message: '请输入审批节点顺序',
- trigger: 'blur',
- },
- ],
- };
|