|
@@ -1,24 +1,24 @@
|
|
|
import { FormSchema } from '/@/components/Table';
|
|
|
|
|
|
-const isDir = (type: string) => type === '0';
|
|
|
-const isMenu = (type: string) => type === '1';
|
|
|
-const isButton = (type: string) => type === '2';
|
|
|
+// const isDir = (type: string) => type === '0';
|
|
|
+// const isMenu = (type: string) => type === '1';
|
|
|
+// const isButton = (type: string) => type === '2';
|
|
|
|
|
|
export const formSchema: FormSchema[] = [
|
|
|
- {
|
|
|
- field: 'type',
|
|
|
- label: '菜单类型',
|
|
|
- component: 'RadioButtonGroup',
|
|
|
- defaultValue: '0',
|
|
|
- componentProps: {
|
|
|
- options: [
|
|
|
- { label: '目录', value: '0' },
|
|
|
- { label: '菜单', value: '1' },
|
|
|
- { label: '按钮', value: '2' },
|
|
|
- ],
|
|
|
- },
|
|
|
- colProps: { lg: 24, md: 24 },
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // field: 'type',
|
|
|
+ // label: '菜单类型',
|
|
|
+ // component: 'RadioButtonGroup',
|
|
|
+ // defaultValue: '0',
|
|
|
+ // componentProps: {
|
|
|
+ // options: [
|
|
|
+ // { label: '目录', value: '0' },
|
|
|
+ // { label: '菜单', value: '1' },
|
|
|
+ // { label: '按钮', value: '2' },
|
|
|
+ // ],
|
|
|
+ // },
|
|
|
+ // colProps: { lg: 24, md: 24 },
|
|
|
+ // },
|
|
|
{
|
|
|
field: 'menuName',
|
|
|
label: '菜单名称',
|
|
@@ -27,14 +27,14 @@ export const formSchema: FormSchema[] = [
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- field: 'parentMenu',
|
|
|
+ field: 'parent',
|
|
|
label: '上级菜单',
|
|
|
component: 'TreeSelect',
|
|
|
componentProps: {
|
|
|
replaceFields: {
|
|
|
title: 'menuName',
|
|
|
- key: 'key',
|
|
|
- value: 'key',
|
|
|
+ key: 'id',
|
|
|
+ value: 'id',
|
|
|
},
|
|
|
getPopupContainer: () => document.body,
|
|
|
},
|
|
@@ -51,28 +51,35 @@ export const formSchema: FormSchema[] = [
|
|
|
label: '图标',
|
|
|
component: 'IconPicker',
|
|
|
required: true,
|
|
|
- show: ({ values }) => !isButton(values.type),
|
|
|
+ // show: ({ values }) => !isButton(values.type),
|
|
|
},
|
|
|
|
|
|
{
|
|
|
- field: 'routePath',
|
|
|
+ field: 'path',
|
|
|
label: '路由地址',
|
|
|
component: 'Input',
|
|
|
required: true,
|
|
|
- show: ({ values }) => !isButton(values.type),
|
|
|
+ // show: ({ values }) => !isButton(values.type),
|
|
|
},
|
|
|
{
|
|
|
- field: 'component',
|
|
|
- label: '组件路径',
|
|
|
+ field: 'redirect',
|
|
|
+ label: '重定向',
|
|
|
component: 'Input',
|
|
|
- show: ({ values }) => isMenu(values.type),
|
|
|
+ required: true,
|
|
|
+ // show: ({ values }) => !isButton(values.type),
|
|
|
},
|
|
|
{
|
|
|
- field: 'permission',
|
|
|
- label: '权限标识',
|
|
|
+ field: 'component',
|
|
|
+ label: '组件路径',
|
|
|
component: 'Input',
|
|
|
- show: ({ values }) => !isDir(values.type),
|
|
|
+ // show: ({ values }) => isMenu(values.type),
|
|
|
},
|
|
|
+ // {
|
|
|
+ // field: 'permission',
|
|
|
+ // label: '权限标识',
|
|
|
+ // component: 'Input',
|
|
|
+ // // show: ({ values }) => !isDir(values.type),
|
|
|
+ // },
|
|
|
{
|
|
|
field: 'status',
|
|
|
label: '状态',
|
|
@@ -85,47 +92,47 @@ export const formSchema: FormSchema[] = [
|
|
|
],
|
|
|
},
|
|
|
},
|
|
|
- {
|
|
|
- field: 'isExt',
|
|
|
- label: '是否外链',
|
|
|
- component: 'RadioButtonGroup',
|
|
|
- defaultValue: '0',
|
|
|
- componentProps: {
|
|
|
- options: [
|
|
|
- { label: '否', value: '0' },
|
|
|
- { label: '是', value: '1' },
|
|
|
- ],
|
|
|
- },
|
|
|
- show: ({ values }) => !isButton(values.type),
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // field: 'isExt',
|
|
|
+ // label: '是否外链',
|
|
|
+ // component: 'RadioButtonGroup',
|
|
|
+ // defaultValue: false,
|
|
|
+ // componentProps: {
|
|
|
+ // options: [
|
|
|
+ // { label: '否', value: false },
|
|
|
+ // { label: '是', value: true },
|
|
|
+ // ],
|
|
|
+ // },
|
|
|
+ // show: ({ values }) => !isButton(values.type),
|
|
|
+ // },
|
|
|
|
|
|
- {
|
|
|
- field: 'keepalive',
|
|
|
- label: '是否缓存',
|
|
|
- component: 'RadioButtonGroup',
|
|
|
- defaultValue: '0',
|
|
|
- componentProps: {
|
|
|
- options: [
|
|
|
- { label: '否', value: '0' },
|
|
|
- { label: '是', value: '1' },
|
|
|
- ],
|
|
|
- },
|
|
|
- show: ({ values }) => isMenu(values.type),
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // field: 'keepalive',
|
|
|
+ // label: '是否缓存',
|
|
|
+ // component: 'RadioButtonGroup',
|
|
|
+ // defaultValue: false,
|
|
|
+ // componentProps: {
|
|
|
+ // options: [
|
|
|
+ // { label: '否', value: false },
|
|
|
+ // { label: '是', value: true },
|
|
|
+ // ],
|
|
|
+ // },
|
|
|
+ // show: ({ values }) => isMenu(values.type),
|
|
|
+ // },
|
|
|
|
|
|
- {
|
|
|
- field: 'show',
|
|
|
- label: '是否显示',
|
|
|
- component: 'RadioButtonGroup',
|
|
|
- defaultValue: '0',
|
|
|
- componentProps: {
|
|
|
- options: [
|
|
|
- { label: '是', value: '0' },
|
|
|
- { label: '否', value: '1' },
|
|
|
- ],
|
|
|
- },
|
|
|
- show: ({ values }) => !isButton(values.type),
|
|
|
- },
|
|
|
+ // {
|
|
|
+ // field: 'show',
|
|
|
+ // label: '是否显示',
|
|
|
+ // component: 'RadioButtonGroup',
|
|
|
+ // defaultValue: false,
|
|
|
+ // componentProps: {
|
|
|
+ // options: [
|
|
|
+ // { label: '否', value: false },
|
|
|
+ // { label: '是', value: true },
|
|
|
+ // ],
|
|
|
+ // },
|
|
|
+ // show: ({ values }) => !isButton(values.type),
|
|
|
+ // },
|
|
|
];
|
|
|
|
|
|
export const dataSource = [
|