From 6c8e8f36089e7ff1a5a9dc54110f803ecaf6cb58 Mon Sep 17 00:00:00 2001 From: qiaochuLei <124648559+qiaochuLei@users.noreply.github.com> Date: Thu, 23 Nov 2023 10:09:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=9B=86=E6=88=90=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=8F=9C=E5=8D=95=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: api新增菜单 * feat: 集成菜单新增菜单功能 * feat: 集成菜单应用新增菜单 * fix: bug#20293 --- src/api/system/menu.ts | 4 +- src/views/system/Apply/index.vue | 1 + src/views/system/Menu/Detail/BasicInfo.vue | 365 +++++++++------------ src/views/system/Menu/index.vue | 4 +- 4 files changed, 153 insertions(+), 221 deletions(-) diff --git a/src/api/system/menu.ts b/src/api/system/menu.ts index 93be944c..30165eb7 100644 --- a/src/api/system/menu.ts +++ b/src/api/system/menu.ts @@ -20,4 +20,6 @@ export const saveMenuInfo_api = (data: object) => server.patch(`/menu`, data); // 新增菜单信息 export const addMenuInfo_api = (data: object) => server.post(`/menu`, data); // 删除菜单信息 -export const delMenuInfo_api = (id: string) => server.remove(`/menu/${id}`); \ No newline at end of file +export const delMenuInfo_api = (id: string) => server.remove(`/menu/${id}`); +//查询集成菜单 +export const queryApp = (data:any) => server.post('/application/_query/no-paging',data) \ No newline at end of file diff --git a/src/views/system/Apply/index.vue b/src/views/system/Apply/index.vue index 486a395c..10589b6a 100644 --- a/src/views/system/Apply/index.vue +++ b/src/views/system/Apply/index.vue @@ -221,6 +221,7 @@ const permission = 'system/Apply'; const typeOptions = ref([]) const visible = ref(false) +const addMenuVisible = ref(false) onMounted(() => { queryType().then((resp: any) => { diff --git a/src/views/system/Menu/Detail/BasicInfo.vue b/src/views/system/Menu/Detail/BasicInfo.vue index 82f55070..74797a06 100644 --- a/src/views/system/Menu/Detail/BasicInfo.vue +++ b/src/views/system/Menu/Detail/BasicInfo.vue @@ -4,209 +4,125 @@

基本信息

- +
- - 点击修改 + + 点击修改
-
+
- +

点击选择图标

- - + + - - + + - - + + - - + + + + + + + - - - - -
- +
-
+

权限配置

- + - + 不支持 支持 间接控制 - - + + - - + + - +
@@ -285,10 +172,12 @@ import { saveMenuInfo_api, addMenuInfo_api, validCode_api, + queryApp } from '@/api/system/menu'; import { Rule } from 'ant-design-vue/lib/form'; import { isNoCommunity } from '@/utils/utils'; import { onlyMessage } from '@/utils/comm'; +import { applicationInfo } from '@/api/bind'; const permission = 'system/Menu'; // 路由 @@ -300,11 +189,13 @@ const routeParams = { url: route.query.basePath, parentId: route.query.pid, }; - +const isChildren = route.query?.isChildren // 表单 const basicFormRef = ref(); const permissFormRef = ref(); const uploadIcon = ref(); +//菜单应用选项 +const appOptions = ref([]) const form = reactive({ data: { name: '', @@ -316,6 +207,8 @@ const form = reactive({ accessSupport: 'unsupported', assetType: undefined, indirectMenus: [], + appId: '', + application:'', ...routeParams, } as formType, treeData: [], // 关联菜单 @@ -383,20 +276,23 @@ const form = reactive({ const api = routeParams.id ? saveMenuInfo_api : addMenuInfo_api; form.saveLoading = true; const accessSupportValue = form.data.accessSupport; - const params = { + const params:any = { ...form.data, - owner: form.data?.owner ?? null, - options: form.data?.options || { show: true }, + owner: 'iot', + options: { show: true }, accessSupport: { value: accessSupportValue, label: accessSupportValue === 'unsupported' ? '不支持' : accessSupportValue === 'support' - ? '支持' - : '间接控制', + ? '支持' + : '间接控制', }, }; + if(params?.isChildren){ + delete params.isChildren + } api(params) .then((resp: any) => { if (resp.status === 200) { @@ -415,18 +311,41 @@ const form = reactive({ }) .finally(() => (form.saveLoading = false)); }) - .catch((err) => {}); + .catch((err) => { }); }, }); form.init(); -const choseIcon = (typeStr:string) =>{ +const choseIcon = (typeStr: string) => { form.data.icon = typeStr; uploadIcon.value?.clearValidate(); } + +const selectApp = (value:string,options:any) =>{ + form.data.application = options?.label +} // 弹窗 const dialogVisible = ref(false); +onMounted(() => { + queryApp({ + terms: [ + { + "column": "integrationModes", + "termType": "in$any", + "value": "page" + } + ], + paging: false + }).then((res:any)=>{ + appOptions.value = res.result?.map((i:any)=>{ + return { + label:i.name, + value:i.id + } + }) + }) +}) type formType = { id?: string; name: string; @@ -440,6 +359,8 @@ type formType = { assetType: string | undefined; indirectMenus: any[]; parentId?: string; + appId:string, + application:string }; type assetType = { @@ -450,11 +371,11 @@ type assetType = {