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.

127 lines
3.0 KiB

11 months ago
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: '账号',
11 months ago
field: 'accountNo',
11 months ago
component: 'NsInput',
componentProps: {
placeholder: '请输入账号',
maxLength: 20,
},
rules: [
{
required: true,
message: '请输入账号',
},
],
},
{
label: '姓名',
11 months ago
field: 'realName',
11 months ago
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: '手机号',
11 months ago
field: 'telephone',
11 months ago
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: '产品总监',
},
],
},
],
},
],
},
},
]);
};