From 9ba07046e34631cba661d626adf551d58a3b270a Mon Sep 17 00:00:00 2001 From: XieYongHong <18010623010@163.com> Date: Mon, 4 Dec 2023 16:36:59 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=BA=94=E7=94=A8=E8=8F=9C=E5=8D=95=E9=9B=86=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 优化第三方应用菜单集成 * fix: bug#20731 * fix: 修改lodash依赖包 * fix: bug#20731 --- package.json | 2 +- src/App.vue | 12 + src/api/system/menu.ts | 2 - src/components/Layout/BasicLayoutPage.vue | 4 +- src/utils/menu.ts | 4 +- src/views/DataCollect/Channel/index.vue | 2 +- .../Point/components/BatchUpdate/index.vue | 2 +- .../DataCollect/Collector/Tree/index.vue | 2 +- .../Northbound/AliCloud/Detail/index.vue | 2 +- src/views/Northbound/DuerOS/Detail/index.vue | 2 +- .../components/StationMessage/index.vue | 12 +- src/views/device/Firmware/index.vue | 2 +- .../Detail/Diagnose/Message/index.vue | 2 +- .../Detail/Info/components/Tags/Save.vue | 2 +- .../device/Instance/Detail/Parsing/index.vue | 2 +- .../device/Instance/Detail/Running/index.vue | 2 +- .../Product/Detail/DataAnalysis/index.vue | 2 +- .../Product/Detail/DeviceAccess/index.vue | 2 +- src/views/device/Product/index.vue | 3 +- .../device/components/Metadata/Base/Base.vue | 44 +- .../Metadata/Base/Edit/BaseForm.vue | 2 +- .../components/Metadata/Base/Edit/index.vue | 2 +- .../Properties/Metrics/ValueItem.vue | 2 +- .../components/Properties/OtherSetting.vue | 3 +- .../device/components/Metadata/Cat/index.vue | 3 +- src/views/iframe/index.vue | 8 +- src/views/init-home/Menu/index.vue | 11 +- src/views/link/Protocol/index.vue | 2 +- src/views/media/Device/Channel/Tree/index.vue | 2 +- .../Scene/Save/action/Device/device/index.vue | 2 +- .../Save/action/ListItem/FilterCondition.vue | 2 +- .../DropdownButton/DropdownButton.vue | 2 +- .../Save/components/Terms/ParamsItem.vue | 3 +- .../system/Apply/Save/components/EditForm.vue | 2 +- .../system/Apply/componenets/MenuDialog.vue | 12 + .../system/Apply/componenets/ThirdMenu.vue | 552 ++++++++++++++---- src/views/system/Apply/index.vue | 3 +- .../system/DataSource/Management/index.vue | 3 +- .../system/Department/components/LeftTree.vue | 3 +- src/views/system/Menu/Detail/BasicInfo.vue | 48 +- src/views/system/Menu/Setting/index.vue | 2 +- .../Menu/components/ChooseIconDialog.vue | 1 + .../Platforms/Api/components/ApiTest.vue | 2 +- src/views/system/Relationship/index.vue | 1 + .../system/User/components/EditUserDialog.vue | 14 +- yarn.lock | 8 +- 46 files changed, 570 insertions(+), 232 deletions(-) diff --git a/package.json b/package.json index c8700605..dc3a1f35 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "event-source-polyfill": "^1.0.31", "global": "^4.4.0", "jetlinks-store": "^0.0.3", - "jetlinks-ui-components": "^1.0.34-7", + "jetlinks-ui-components": "^1.0.34-12", "js-cookie": "^3.0.1", "jsencrypt": "^3.3.2", "less": "^4.1.3", diff --git a/src/App.vue b/src/App.vue index 0c14af16..376264e4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -10,11 +10,23 @@ import zhCN from 'jetlinks-ui-components/es/locale/zh_CN'; import { storeToRefs } from 'pinia'; import { useSystem } from './store/system'; import DefaultSetting from '../config/config' +import {LocalStore} from "@/utils/comm"; +import {TOKEN_KEY} from "@/utils/variable"; const system = useSystem(); const {configInfo} = storeToRefs(system); system.setDocumentTitle() + +const route = useRoute() + +watch(() => JSON.stringify(route.query || {}), () => { + if (route.query.token) { + LocalStore.set(TOKEN_KEY, route.query.token); + } +}, { immediate: true }) + + ConfigProvider.config({ theme: { primaryColor: "#315efb" diff --git a/src/api/system/menu.ts b/src/api/system/menu.ts index 30165eb7..774211a7 100644 --- a/src/api/system/menu.ts +++ b/src/api/system/menu.ts @@ -21,5 +21,3 @@ 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}`); -//查询集成菜单 -export const queryApp = (data:any) => server.post('/application/_query/no-paging',data) \ No newline at end of file diff --git a/src/components/Layout/BasicLayoutPage.vue b/src/components/Layout/BasicLayoutPage.vue index dbabb304..1e974fe2 100644 --- a/src/components/Layout/BasicLayoutPage.vue +++ b/src/components/Layout/BasicLayoutPage.vue @@ -4,8 +4,8 @@ v-model:collapsed="basicLayout.collapsed" v-model:openKeys="basicLayout.openKeys" :selectedKeys="basicLayout.selectedKeys" - :headerHeight='layout.headerHeight' - :breadcrumb="{ routes: breadcrumbs }" + :breadcrumb="basicLayout.pure ? undefined : { routes: breadcrumbs }" + :headerHeight='basicLayout.pure ? 1 : layout.headerHeight' :pure="basicLayout.pure" @backClick='routerBack' > diff --git a/src/utils/menu.ts b/src/utils/menu.ts index c7c03188..143e1e12 100644 --- a/src/utils/menu.ts +++ b/src/utils/menu.ts @@ -159,11 +159,11 @@ const extraRouteObj = { type Buttons = Array<{ id: string }> const hasAppID = (item: any): { isApp: boolean, appUrl: string } => { - const isApp = !!item.appId + const isApp = !!item.appId || item.options?.owner const isLowCode = !!item.options?.LowCode return { isApp: isApp || isLowCode, - appUrl: isApp ? `/${item.appId}${item.url}` : item.url + appUrl: isApp ? `/${item.appId || item.options?.owner}${item.url}` : item.url } } diff --git a/src/views/DataCollect/Channel/index.vue b/src/views/DataCollect/Channel/index.vue index 2b857813..0ec2378e 100644 --- a/src/views/DataCollect/Channel/index.vue +++ b/src/views/DataCollect/Channel/index.vue @@ -149,7 +149,7 @@ import { StatusColorEnum, updateStatus } from './data'; import { useMenuStore } from 'store/menu'; import Save from './Save/index.vue'; import { protocolList } from '@/utils/consts'; -import _ from 'lodash'; +import _ from 'lodash-es'; const menuStory = useMenuStore(); const tableRef = ref>({}); diff --git a/src/views/DataCollect/Collector/Point/components/BatchUpdate/index.vue b/src/views/DataCollect/Collector/Point/components/BatchUpdate/index.vue index 5864a71b..70066ea3 100644 --- a/src/views/DataCollect/Collector/Point/components/BatchUpdate/index.vue +++ b/src/views/DataCollect/Collector/Point/components/BatchUpdate/index.vue @@ -87,7 +87,7 @@ - diff --git a/src/views/system/Apply/index.vue b/src/views/system/Apply/index.vue index 10589b6a..63f61e00 100644 --- a/src/views/system/Apply/index.vue +++ b/src/views/system/Apply/index.vue @@ -312,7 +312,8 @@ const tableRef = ref(); const current = ref({}) const table = { refresh: () => { - tableRef.value.reload(queryParams.value); + // tableRef.value.reload(queryParams.value); + window.location.reload() }, toAdd: () => { visible.value = true diff --git a/src/views/system/DataSource/Management/index.vue b/src/views/system/DataSource/Management/index.vue index c3a1e21b..4be27c59 100644 --- a/src/views/system/DataSource/Management/index.vue +++ b/src/views/system/DataSource/Management/index.vue @@ -235,8 +235,7 @@ import { onlyMessage } from '@/utils/comm'; import { randomString } from '@/utils/utils'; import { FormInstance } from 'ant-design-vue'; import { DataNode } from 'ant-design-vue/lib/tree'; -import _ from 'lodash'; -import { cloneDeep } from 'lodash'; +import _ , { cloneDeep } from 'lodash-es'; import type { dbColumnType, dictItemType, sourceItemType } from '../typing'; const id = useRoute().query.id as string; diff --git a/src/views/system/Department/components/LeftTree.vue b/src/views/system/Department/components/LeftTree.vue index daa6d35e..1584e916 100644 --- a/src/views/system/Department/components/LeftTree.vue +++ b/src/views/system/Department/components/LeftTree.vue @@ -255,7 +255,6 @@ init(); width: 100%; } } - :deep(.ant-tree-treenode) { width: 100%; .ant-tree-node-content-wrapper { @@ -278,7 +277,7 @@ init(); flex: 1 1 auto; .department-tree-item-content { display: flex; - align-items: center; + align-items: stretch; .title { flex: 1; diff --git a/src/views/system/Menu/Detail/BasicInfo.vue b/src/views/system/Menu/Detail/BasicInfo.vue index 74797a06..74e0cb62 100644 --- a/src/views/system/Menu/Detail/BasicInfo.vue +++ b/src/views/system/Menu/Detail/BasicInfo.vue @@ -61,14 +61,14 @@ - + ]" :validateFirst="true" label="页面地址" name="url"> @@ -83,12 +83,6 @@ style="width: 100%" /> - - - - - @@ -98,7 +92,7 @@ -
+

权限配置

@@ -172,12 +166,11 @@ 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'; // 路由 @@ -189,7 +182,6 @@ const routeParams = { url: route.query.basePath, parentId: route.query.pid, }; -const isChildren = route.query?.isChildren // 表单 const basicFormRef = ref(); const permissFormRef = ref(); @@ -207,8 +199,6 @@ const form = reactive({ accessSupport: 'unsupported', assetType: undefined, indirectMenus: [], - appId: '', - application:'', ...routeParams, } as formType, treeData: [], // 关联菜单 @@ -290,9 +280,6 @@ const form = reactive({ : '间接控制', }, }; - if(params?.isChildren){ - delete params.isChildren - } api(params) .then((resp: any) => { if (resp.status === 200) { @@ -320,32 +307,9 @@ 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; @@ -359,8 +323,6 @@ type formType = { assetType: string | undefined; indirectMenus: any[]; parentId?: string; - appId:string, - application:string }; type assetType = { @@ -375,7 +337,7 @@ type assetType = { padding: 24px; .card { margin-bottom: 24px; - + h3 { position: relative; display: flex; diff --git a/src/views/system/Menu/Setting/index.vue b/src/views/system/Menu/Setting/index.vue index 5fc19416..fc7732c9 100644 --- a/src/views/system/Menu/Setting/index.vue +++ b/src/views/system/Menu/Setting/index.vue @@ -76,7 +76,7 @@ import { } from './utils'; import BaseMenu from '@/views/init-home/data/baseMenu'; import type { AntTreeNodeDropEvent } from 'ant-design-vue/es/tree'; -import { cloneDeep } from 'lodash'; +import { cloneDeep } from 'lodash-es'; import { onlyMessage } from '@/utils/comm'; import { USER_CENTER_MENU_CODE, diff --git a/src/views/system/Menu/components/ChooseIconDialog.vue b/src/views/system/Menu/components/ChooseIconDialog.vue index f386d633..3d0dd343 100644 --- a/src/views/system/Menu/components/ChooseIconDialog.vue +++ b/src/views/system/Menu/components/ChooseIconDialog.vue @@ -3,6 +3,7 @@ visible title="菜单图标" width="800px" + :maskClosable="false" @cancel="emits('update:visible', false)" @ok="confirm" > diff --git a/src/views/system/Platforms/Api/components/ApiTest.vue b/src/views/system/Platforms/Api/components/ApiTest.vue index ed67b4f9..891c4e44 100644 --- a/src/views/system/Platforms/Api/components/ApiTest.vue +++ b/src/views/system/Platforms/Api/components/ApiTest.vue @@ -131,7 +131,7 @@ import { JsonViewer } from 'vue3-json-viewer'; import 'vue3-json-viewer/dist/index.css'; import type { apiDetailsType } from '../typing'; import InputCard from './InputCard.vue'; -import { cloneDeep, toLower } from 'lodash'; +import { cloneDeep, toLower } from 'lodash-es'; import { FormInstance } from 'ant-design-vue'; import server from '@/utils/request'; import { findData, getCodeText } from '../utils'; diff --git a/src/views/system/Relationship/index.vue b/src/views/system/Relationship/index.vue index 78d5de64..7184bab3 100644 --- a/src/views/system/Relationship/index.vue +++ b/src/views/system/Relationship/index.vue @@ -107,6 +107,7 @@ const columns = [ ellipsis: true, fixed: 'left', search: { + rename:'objectType', type: 'select', options: async () =>{ const res:any = await getObjectList_api() diff --git a/src/views/system/User/components/EditUserDialog.vue b/src/views/system/User/components/EditUserDialog.vue index 2154f31e..2cc59751 100644 --- a/src/views/system/User/components/EditUserDialog.vue +++ b/src/views/system/User/components/EditUserDialog.vue @@ -147,7 +147,10 @@ { validator: form.rules.checkUserName, trigger: 'blur', - }, + },{ + validator: form.rules.checkCh, + trigger: 'change' + } ]" > => + new Promise((resolve,reject) => { + if (/[\u4e00-\u9fa5]/.test(value)) return reject('用户名不能包含中文'); + else return resolve('') + }), checkUserName: (_rule: Rule, value: string): Promise => new Promise((resolve, reject) => { if (props.type === 'edit') return resolve(''); - if (!value) return reject('请输入用户名'); else if (value.length > 64) return reject('最多可输入64个字符'); validateField_api('username', value).then((resp: any): any => { diff --git a/yarn.lock b/yarn.lock index 11df283f..093c3df7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3738,10 +3738,10 @@ jetlinks-store@^0.0.3: resolved "https://registry.npmjs.org/jetlinks-store/-/jetlinks-store-0.0.3.tgz" integrity sha512-AZf/soh1hmmwjBZ00fr1emuMEydeReaI6IBTGByQYhTmK1Zd5pQAxC7WLek2snRAn/HHDgJfVz2hjditKThl6Q== -jetlinks-ui-components@^1.0.34-7: - version "1.0.34-7" - resolved "https://registry.npmjs.org/jetlinks-ui-components/-/jetlinks-ui-components-1.0.34-7.tgz#3a14e85edb4c5d11427d30f3925dc5f498478940" - integrity sha512-Rgbjig3QYP8CDVHLbco20Cf7sArYralO8yWtH5E5zylYAN2lINLUsgOlIVf9aweszZR/Ps+z/NLP0CoRQf1Xtw== +jetlinks-ui-components@^1.0.34-12: + version "1.0.34-12" + resolved "https://registry.npmjs.org/jetlinks-ui-components/-/jetlinks-ui-components-1.0.34-12.tgz#13e035bae1d16af957d81a175daaa3a2fe290406" + integrity sha512-fxoncKov8IsScneXQYcaBwg+HnXrkJSaS7z9aV7uZK4/WxvTaAWozOPIOSkBwfDya+BuRpbJ9ZW3X9MtT6kLrQ== dependencies: "@vueuse/core" "^9.12.0" "@vueuse/router" "^9.13.0"