This commit is contained in:
JinMao 2021-08-25 10:04:54 +08:00
parent 3cdf6c74f8
commit 42bd7b0153
5 changed files with 11960 additions and 104 deletions

0
.husky/pre-commit Executable file
View File

0
src/api/sys/menu.ts Normal file
View File

View File

@ -11,12 +11,6 @@ export const columns: BasicColumn[] = [
width: 200,
align: 'left',
},
{
title: '菜单标题',
dataIndex: 'meta.title',
width: 200,
align: 'left',
},
{
title: '图标',
dataIndex: 'icon',
@ -36,7 +30,7 @@ export const columns: BasicColumn[] = [
},
{
title: '排序',
dataIndex: 'order_no',
dataIndex: 'orderNo',
width: 50,
},
{
@ -59,7 +53,7 @@ export const columns: BasicColumn[] = [
];
const isDir = (type: string) => type === '0';
// const isMenu = (type: string) => type === '1';
const isMenu = (type: string) => type === '1';
const isButton = (type: string) => type === '2';
export const searchFormSchema: FormSchema[] = [
@ -84,40 +78,34 @@ export const searchFormSchema: FormSchema[] = [
];
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: 'name',
label: '菜单名称',
component: 'Input',
required: true,
field: 'type',
label: '菜单类型',
component: 'RadioButtonGroup',
defaultValue: '0',
componentProps: {
options: [
{ label: '目录', value: '0' },
{ label: '菜单', value: '1' },
{ label: '按钮', value: '2' },
],
},
colProps: { lg: 24, md: 24 },
},
{
field: 'title',
label: '菜单标题',
field: 'menuName',
label: '菜单名称',
component: 'Input',
required: true,
},
{
field: 'parent',
field: 'parentMenu',
label: '上级菜单',
component: 'TreeSelect',
componentProps: {
replaceFields: {
title: 'name',
title: 'menuName',
key: 'id',
value: 'id',
},
@ -126,36 +114,31 @@ export const formSchema: FormSchema[] = [
},
{
field: 'order_no',
field: 'orderNo',
label: '排序',
defaultValue: 0,
component: 'InputNumber',
componentProps: {
min: 0,
},
required: true,
},
{
field: 'icon',
label: '图标',
component: 'IconPicker',
required: true,
show: ({ values }) => !isButton(values.type),
},
{
field: 'path',
field: 'routePath',
label: '路由地址',
component: 'Input',
required: true,
// show: ({ values }) => !isButton(values.type),
show: ({ values }) => !isButton(values.type),
},
{
field: 'component',
label: '组件路径',
component: 'Input',
required: true,
// show: ({ values }) => isMenu(values.type),
show: ({ values }) => isMenu(values.type),
},
{
field: 'permission',
@ -163,75 +146,57 @@ export const formSchema: FormSchema[] = [
component: 'Input',
show: ({ values }) => !isDir(values.type),
},
// {
// field: 'isRedirect',
// label: '是否重定向',
// component: 'RadioButtonGroup',
// defaultValue: 0,
// componentProps: {
// options: [
// { label: '是', value: 1 },
// { label: '否', value: 0 },
// ],
// },
// },
// {
// field: 'redirect',
// label: '路由重定向',
// component: 'Input',
// show: ({ values }) => !!values.isRedirect,
// },
{
field: 'status',
label: '状态',
component: 'RadioButtonGroup',
defaultValue: 1,
defaultValue: '0',
componentProps: {
options: [
{ label: '启用', value: 1 },
{ label: '禁用', value: 0 },
{ label: '启用', value: '0' },
{ label: '禁用', value: '1' },
],
},
},
// {
// 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: '0',
componentProps: {
options: [
{ label: '否', value: '0' },
{ label: '是', value: '1' },
],
},
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: '0',
componentProps: {
options: [
{ label: '否', value: '0' },
{ label: '是', value: '1' },
],
},
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: '0',
componentProps: {
options: [
{ label: '是', value: '0' },
{ label: '否', value: '1' },
],
},
show: ({ values }) => !isButton(values.type),
},
];

View File

@ -106,10 +106,10 @@ const formRef = ref();
const loading = ref(false);
const rememberMe = ref(false);
const formData = reactive({
account: '',
password: '',
});
const formData = reactive({
account: 'admin',
password: '123456',
});
const { validForm } = useFormValid(formRef);

11891
yarn.lock Normal file

File diff suppressed because it is too large Load Diff