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.
167 lines
4.1 KiB
167 lines
4.1 KiB
10 months ago
|
import { ref } from 'vue';
|
||
|
|
||
|
export const formConfig = (disabled: Boolean) => {
|
||
|
return ref([
|
||
|
{
|
||
|
field: 'field111',
|
||
|
component: 'NsChildForm',
|
||
|
componentProps: {
|
||
|
schemas: [
|
||
|
{
|
||
|
label: '部门名称',
|
||
|
field: 'name',
|
||
|
component: 'NsInput',
|
||
|
componentProps: {
|
||
|
disabled: disabled,
|
||
|
placeholder: '请输入部门名称',
|
||
|
maxLength: 20,
|
||
|
},
|
||
|
rules: [
|
||
|
{
|
||
|
required: true,
|
||
|
message: '请输入部门名称',
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
{
|
||
|
label: '上级部门',
|
||
|
field: 'department',
|
||
|
component: 'NsSelect',
|
||
|
componentProps: {
|
||
|
disabled: true,
|
||
|
options: [
|
||
|
{
|
||
|
label: '部门1',
|
||
|
value: 1,
|
||
|
},
|
||
|
{
|
||
|
label: '部门2',
|
||
|
value: 2,
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '部门编码',
|
||
|
field: 'code',
|
||
|
component: 'NsInput',
|
||
|
componentProps: {
|
||
|
disabled: disabled,
|
||
|
placeholder: '请输入部门编码',
|
||
|
maxLength: 20,
|
||
|
},
|
||
|
rules: [
|
||
|
{
|
||
|
required: true,
|
||
|
message: '请输入部门编码',
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
{
|
||
|
label: '排序',
|
||
|
field: 'order',
|
||
|
component: 'NsInput',
|
||
|
componentProps: {
|
||
|
disabled: disabled,
|
||
|
placeholder: '请输入排序',
|
||
|
maxLength: 2,
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
field: 'remark',
|
||
|
label: '备注',
|
||
|
component: 'NsTextarea',
|
||
|
componentProps: {
|
||
|
disabled: disabled,
|
||
|
placeholder: '请输入',
|
||
|
maxLength: 300,
|
||
|
},
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
]);
|
||
|
};
|
||
|
|
||
|
export const formConfig2 = (disabled2: Boolean) => {
|
||
|
return ref([
|
||
|
{
|
||
|
field: 'field111',
|
||
|
component: 'NsChildForm',
|
||
|
componentProps: {
|
||
|
schemas: [
|
||
|
{
|
||
|
label: '角色名称',
|
||
|
field: 'departname',
|
||
|
component: 'NsInput',
|
||
|
componentProps: {
|
||
|
disabled: disabled2,
|
||
|
placeholder: '请输入角色名称',
|
||
|
maxLength: 20,
|
||
|
},
|
||
|
rules: [
|
||
|
{
|
||
|
required: true,
|
||
|
message: '请输入角色名称',
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
{
|
||
|
label: '上级领导',
|
||
|
field: 'department',
|
||
|
component: 'NsSelect',
|
||
|
componentProps: {
|
||
|
disabled: true,
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
label: '节点编码',
|
||
|
field: 'code',
|
||
|
component: 'NsInput',
|
||
|
componentProps: {
|
||
|
disabled: disabled2,
|
||
|
placeholder: '请输入节点编码',
|
||
|
maxLength: 20,
|
||
|
},
|
||
|
rules: [
|
||
|
{
|
||
|
required: true,
|
||
|
message: '请输入节点编码',
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
{
|
||
|
label: '是否部门领导',
|
||
|
field: 'isleader',
|
||
|
component: 'NsRadioGroup',
|
||
|
componentProps: {
|
||
|
disabled: disabled2,
|
||
|
radioType: 'radio',
|
||
|
options: [
|
||
|
{ label: '是', value: 1 },
|
||
|
{ label: '否', value: 2 },
|
||
|
],
|
||
|
rules: [
|
||
|
{
|
||
|
required: true,
|
||
|
message: '请选择是否部门领导',
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
{
|
||
|
field: 'remark',
|
||
|
label: '备注',
|
||
|
component: 'NsTextarea',
|
||
|
componentProps: {
|
||
|
disabled: disabled2,
|
||
|
placeholder: '请输入',
|
||
|
maxLength: 300,
|
||
|
},
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
},
|
||
|
]);
|
||
|
};
|