From e155cb2724be10bbc040ba31d2a8867f7c882576 Mon Sep 17 00:00:00 2001 From: JinMao Date: Sun, 29 Aug 2021 19:53:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E7=AB=AF=E8=B7=AF=E7=94=B1=E7=9A=84cu?= =?UTF-8?q?rd=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/Curd.ts | 2 +- src/utils/http/axios/checkStatus.ts | 1 - src/views/menu/MenuDrawer.vue | 95 ++++++++-------- src/views/menu/index.vue | 116 +++++++++---------- src/views/menu/menu.data.ts | 165 +++++++++++++++++----------- 5 files changed, 201 insertions(+), 178 deletions(-) diff --git a/src/api/Curd.ts b/src/api/Curd.ts index b56c24a6..2fd340cf 100644 --- a/src/api/Curd.ts +++ b/src/api/Curd.ts @@ -1,3 +1,3 @@ import { defHttp } from '/@/utils/http/axios'; -export const Curd = (params) => defHttp.post({ url: '/curd', params }); +export const Curd = (params) => defHttp.post({ url: '/curd', params, headers: {} }); diff --git a/src/utils/http/axios/checkStatus.ts b/src/utils/http/axios/checkStatus.ts index acadffaa..f3b60294 100644 --- a/src/utils/http/axios/checkStatus.ts +++ b/src/utils/http/axios/checkStatus.ts @@ -19,7 +19,6 @@ export function checkStatus( const { t } = useI18n(); const userStore = useUserStoreWithOut(); let errMessage = ''; - switch (status) { case 400: errMessage = `${msg}`; diff --git a/src/views/menu/MenuDrawer.vue b/src/views/menu/MenuDrawer.vue index 04025102..38024371 100644 --- a/src/views/menu/MenuDrawer.vue +++ b/src/views/menu/MenuDrawer.vue @@ -10,61 +10,66 @@ - diff --git a/src/views/menu/index.vue b/src/views/menu/index.vue index 651b1533..106967c5 100644 --- a/src/views/menu/index.vue +++ b/src/views/menu/index.vue @@ -26,9 +26,7 @@ - diff --git a/src/views/menu/menu.data.ts b/src/views/menu/menu.data.ts index 2ed1a631..e7841adb 100644 --- a/src/views/menu/menu.data.ts +++ b/src/views/menu/menu.data.ts @@ -11,6 +11,12 @@ export const columns: BasicColumn[] = [ width: 200, align: 'left', }, + { + title: '菜单标题', + dataIndex: 'meta.title', + width: 200, + align: 'left', + }, { title: '图标', dataIndex: 'icon', @@ -30,7 +36,7 @@ export const columns: BasicColumn[] = [ }, { title: '排序', - dataIndex: 'orderNo', + dataIndex: 'order_no', width: 50, }, { @@ -53,7 +59,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[] = [ @@ -78,34 +84,40 @@ 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: '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: 'menuName', - label: '菜单名称', + field: 'title', + label: '菜单标题', component: 'Input', required: true, }, { - field: 'parentMenu', + field: 'parent', label: '上级菜单', component: 'TreeSelect', componentProps: { replaceFields: { - title: 'menuName', + title: 'name', key: 'id', value: 'id', }, @@ -114,31 +126,36 @@ export const formSchema: FormSchema[] = [ }, { - field: 'orderNo', + field: 'order_no', label: '排序', + defaultValue: 0, component: 'InputNumber', + componentProps: { + min: 0, + }, required: true, }, { field: 'icon', label: '图标', component: 'IconPicker', - required: true, 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: '组件路径', component: 'Input', - show: ({ values }) => isMenu(values.type), + required: true, + // show: ({ values }) => isMenu(values.type), }, { field: 'permission', @@ -146,57 +163,75 @@ 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: '0', + defaultValue: 1, componentProps: { options: [ - { label: '启用', value: '0' }, - { label: '禁用', value: '1' }, + { label: '启用', value: 1 }, + { label: '禁用', value: 0 }, ], }, }, - { - 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), + // }, ];