You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { mockData } from './mock';
|
|
|
|
import { cloneDeep } from 'lodash-es';
|
|
|
|
import { Modal } from 'ant-design-vue';
|
|
|
|
import { createVNode, ref } from 'vue';
|
|
|
|
import { NsMessage } from '/nerv-lib/component';
|
|
|
|
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
|
|
|
export const formConfig = [
|
|
|
|
{
|
|
|
|
field: 'field111',
|
|
|
|
component: 'NsChildForm',
|
|
|
|
componentProps: {
|
|
|
|
title: '用户信息',
|
|
|
|
schemas: [
|
|
|
|
{
|
|
|
|
label: '账号',
|
|
|
|
field: 'accountNo',
|
|
|
|
component: 'NsInput',
|
|
|
|
componentProps: {
|
|
|
|
placeholder: '请输入账号',
|
|
|
|
maxLength: 20,
|
|
|
|
},
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: '请输入账号',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '姓名',
|
|
|
|
field: 'realName',
|
|
|
|
component: 'NsInput',
|
|
|
|
componentProps: {
|
|
|
|
placeholder: '请输入姓名',
|
|
|
|
maxLength: 20,
|
|
|
|
},
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: '请输入姓名',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '性别',
|
|
|
|
field: 'sex',
|
|
|
|
component: 'NsRadioGroup',
|
|
|
|
componentProps: {
|
|
|
|
radioType: 'radio',
|
|
|
|
options: [
|
|
|
|
{ label: '男', value: 1 },
|
|
|
|
{ label: '女', value: 2 },
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '手机号',
|
|
|
|
field: 'telephone',
|
|
|
|
component: 'NsInput',
|
|
|
|
componentProps: {
|
|
|
|
placeholder: '请输入手机号',
|
|
|
|
maxLength: 11,
|
|
|
|
},
|
|
|
|
rules: [
|
|
|
|
{
|
|
|
|
required: true,
|
|
|
|
message: '请输入正确手机号格式',
|
|
|
|
pattern: /^[1][3-9][0-9]{9}$/,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '邮箱',
|
|
|
|
field: 'email',
|
|
|
|
component: 'NsInput',
|
|
|
|
componentProps: {
|
|
|
|
placeholder: '请输入邮箱',
|
|
|
|
maxLength: 30,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: '组织关系',
|
|
|
|
field: 'relation',
|
|
|
|
component: 'NsInput',
|
|
|
|
componentProps: {
|
|
|
|
disabled: true,
|
|
|
|
maxLength: 30,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|
|
|
|
export const formConfig2 = (casData: any) => {
|
|
|
|
return ref([
|
|
|
|
{
|
|
|
|
field: 'information',
|
|
|
|
component: 'NsCascader',
|
|
|
|
componentProps: {
|
|
|
|
placeholder: '请选择',
|
|
|
|
displayRender: ({ labels }: any) => {
|
|
|
|
casData.value = labels;
|
|
|
|
return labels.join('/');
|
|
|
|
},
|
|
|
|
options: [
|
|
|
|
{
|
|
|
|
value: '1',
|
|
|
|
label: '铁路局',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
value: '2',
|
|
|
|
label: '产品部',
|
|
|
|
children: [
|
|
|
|
{
|
|
|
|
value: '3',
|
|
|
|
label: '产品总监',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
};
|