From 18f563ce42067b6ebc98c8f72387bb17449180e0 Mon Sep 17 00:00:00 2001 From: Kven <2955163637@qq.com> Date: Thu, 16 Jan 2025 21:26:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(menu=E6=A8=A1=E5=9D=97=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E5=90=84=E6=A8=A1=E5=9D=97bug):=20=E4=BF=AE=E5=A4=8D=E5=90=84?= =?UTF-8?q?=E6=A8=A1=E5=9D=97bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/menu.ts | 26 +- src/api/message-mgmt.ts | 5 - src/hooks/pagination.ts | 4 +- src/router/routes/modules/system.ts | 2 +- .../iot/device/components/device-edit.vue | 2 +- .../iot/product/components/product-edit.vue | 228 ++++++------------ .../notice/components/message-edit.vue | 3 +- src/views/notification/notice/index.vue | 45 ++-- .../system/menu/components/menu-edit.vue | 70 +++--- src/views/system/menu/index.vue | 1 + src/views/system/user/index.vue | 43 +--- src/views/user/bulletin-card/index.vue | 4 +- src/views/user/messages/index.vue | 2 +- 13 files changed, 157 insertions(+), 278 deletions(-) diff --git a/src/api/menu.ts b/src/api/menu.ts index 3f67ef5..eba8a5e 100644 --- a/src/api/menu.ts +++ b/src/api/menu.ts @@ -14,7 +14,7 @@ export interface MenuRecord { order: number; permissions: string[]; showInMenu?: boolean; - menuOrder?: string; + menuOrder?: number; }; children?: MenuRecord[] ; }; @@ -22,6 +22,30 @@ export interface MenuRecord { export interface MenuCreateRecord extends MenuRecord{ type: string; } +export interface MenuUpdateRecord { + pid?: number; + name: string; + path: string; + locale?: string; + icon?: string; + createTime?: string; + createBy?: string; + type: string; + requiresAuth?: boolean; + hideInMenu?: boolean; + menuOrder?: number; + permissions: string; + + + + +} + +// 获取详情 +export const queryMenuDetail = (id: string | number) => { + return axios.get(`/api/rest/menu/${id}`); +}; + export const queryMenuList = (data: string) => { return axios({ diff --git a/src/api/message-mgmt.ts b/src/api/message-mgmt.ts index 23ea754..090e468 100644 --- a/src/api/message-mgmt.ts +++ b/src/api/message-mgmt.ts @@ -3,10 +3,6 @@ import axios from 'axios'; export interface MessageRecord { userId?: string; title?: string; - type?: string; - name?: string; - system?: boolean; - isRead?: boolean; createAtBegin?: string; createAtEnd?: string; current: number; @@ -21,7 +17,6 @@ export interface MessageCreateRecord { html: string; title: string; content: string; - attachmentIds?: string[]; } // 查看详情 diff --git a/src/hooks/pagination.ts b/src/hooks/pagination.ts index 97ea2bb..026b82f 100644 --- a/src/hooks/pagination.ts +++ b/src/hooks/pagination.ts @@ -1,13 +1,13 @@ export default function usePagination(initValue = false) { const pagination: any = { - pages: 1, + page: 1, size: 10, current: 1, total: 0, }; const setPagination = (value: any) => { - pagination.pages = value.page; + pagination.page = value.page; pagination.size = value.size; pagination.current = value.current; pagination.total = value.total; diff --git a/src/router/routes/modules/system.ts b/src/router/routes/modules/system.ts index 7231e0a..f6e6138 100644 --- a/src/router/routes/modules/system.ts +++ b/src/router/routes/modules/system.ts @@ -64,7 +64,7 @@ const SYSTEM: AppRouteRecordRaw = { locale: '权限管理', title: '权限管理', requiresAuth: true, - permissions: ['system:authority'], + permissions: ['system:authorityHidden'], }, }, { diff --git a/src/views/iot/device/components/device-edit.vue b/src/views/iot/device/components/device-edit.vue index 3d21f0b..bf9055e 100644 --- a/src/views/iot/device/components/device-edit.vue +++ b/src/views/iot/device/components/device-edit.vue @@ -252,7 +252,7 @@ }; }); loading.value = false; - }, 2000); + }, 1000); } else { options.value = []; } diff --git a/src/views/iot/product/components/product-edit.vue b/src/views/iot/product/components/product-edit.vue index 338b317..fd62c2d 100644 --- a/src/views/iot/product/components/product-edit.vue +++ b/src/views/iot/product/components/product-edit.vue @@ -92,53 +92,6 @@ field="params" label="参数" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -162,75 +115,75 @@ - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + @@ -256,45 +209,7 @@ }); const { visible, setVisible } = useVisible(false); const CreateRef = ref(); - const formData = ref({ - // params: [], - // ...props.prem, - }); - const columns=[ - { - title: '参数名称', - dataIndex: 'name', - slotName: 'name', - width: '120', - }, - { - title: '参数标识', - dataIndex: 'identifier', - slotName: 'identifier', - width: '120', - align: 'left' - }, - { - title: '数据类型', - dataIndex: 'dataType', - slotName: 'dataType', - width: '150', - align: 'left' - }, - { - title: '参数类型', - dataIndex: 'type', - slotName: 'type', - width: '180', - align: 'left' - }, - { - title: '操作', - dataIndex: 'operation', - slotName: 'operation', - align: 'left' - } - ]; + const formData = ref({}); const paramsData = ref([ { name: '', @@ -362,7 +277,7 @@ }, ]); const paramsVisible = ref(false); - const paramsName = ref([]); + // const paramsName = ref([]); const fetchData = async (Id: number | undefined) => { const res = await queryProductDetail(Id); formData.value = res.data; @@ -378,6 +293,7 @@ // 提交 const handleSubmit = async () => { const valid = await CreateRef.value?.validate(); + console.log(valid); if (!valid) { // 新增 if (props.isCreate) { @@ -431,8 +347,8 @@ // 参数模态框提交 const paramsSubmit = () => { paramsVisible.value = false; - formData.value.params.push(paramsData.value); - paramsName.value.push(paramsData.value.name); + formData.value.params?.push(paramsData.value); + // paramsName.value.push(paramsData.value.name); } // 关闭 const handleCancel = async () => { diff --git a/src/views/notification/notice/components/message-edit.vue b/src/views/notification/notice/components/message-edit.vue index 99854ef..57bbfa5 100644 --- a/src/views/notification/notice/components/message-edit.vue +++ b/src/views/notification/notice/components/message-edit.vue @@ -58,7 +58,7 @@ > @@ -393,7 +393,6 @@ const handleSubmit = async () => { const valid = await CreateRef.value?.validate(); if (!valid) { - formData.value.permissionIds = checkKeys.value; // 新增 if (props.isCreate) { // formData.value.username = formData.value.email; diff --git a/src/views/notification/notice/index.vue b/src/views/notification/notice/index.vue index 10ba89b..ab2a9ad 100644 --- a/src/views/notification/notice/index.vue +++ b/src/views/notification/notice/index.vue @@ -23,7 +23,7 @@ /> - + - - - - - - + - +