From d404fe7e11a3d86a41a5c051b7c3d114c10afac0 Mon Sep 17 00:00:00 2001 From: wangshuaiswim Date: Sat, 1 Apr 2023 14:54:42 +0800 Subject: [PATCH 01/12] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=97=A5?= =?UTF-8?q?=E6=9C=9F=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../device/components/Metadata/Base/Edit/ValueTypeForm.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/device/components/Metadata/Base/Edit/ValueTypeForm.vue b/src/views/device/components/Metadata/Base/Edit/ValueTypeForm.vue index 7f171f06..ed0942ef 100644 --- a/src/views/device/components/Metadata/Base/Edit/ValueTypeForm.vue +++ b/src/views/device/components/Metadata/Base/Edit/ValueTypeForm.vue @@ -163,7 +163,7 @@ const changeType = (val: SelectValue) => { _value.value.fileType = _value.value.fileType || 'url' } if (['date'].includes(val as string)) { - _value.value.format = _value.value.format || 'yyyy-MM-DD HH:mm:ss' + _value.value.format = _value.value.format || 'yyyy-MM-dd HH:mm:ss' } emit('changeType', val as string) } From 9557586bb9b757b7b30411dbd627f0e85f230b0a Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Sat, 1 Apr 2023 10:59:04 +0800 Subject: [PATCH 02/12] =?UTF-8?q?fix:=20=E6=9B=BF=E6=8D=A2=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Layout/components/Notice.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Layout/components/Notice.vue b/src/components/Layout/components/Notice.vue index 51d9a5df..25570448 100644 --- a/src/components/Layout/components/Notice.vue +++ b/src/components/Layout/components/Notice.vue @@ -25,7 +25,7 @@ import { getListByUnRead_api } from '@/api/account/notificationRecord'; import NoticeInfo from './NoticeInfo.vue'; import { getWebSocket } from '@/utils/websocket'; -import { notification, Button } from 'ant-design-vue'; +import { notification, Button } from 'jetlinks-ui-components'; import { changeStatus_api } from '@/api/account/notificationRecord'; import { useUserInfo } from '@/store/userInfo'; From df0b467656e380739e5c5c858b8e8882b4ff58ba Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Sat, 1 Apr 2023 11:44:02 +0800 Subject: [PATCH 03/12] fix: bug#10869 --- .../Save/action/ListItem/FilterCondition.vue | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue b/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue index 53433a86..07034878 100644 --- a/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue +++ b/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue @@ -83,7 +83,7 @@ import ParamsDropdown, { DoubleParamsDropdown } from '../../components/ParamsDro import { inject } from 'vue' import { useSceneStore } from 'store/scene' import { storeToRefs } from 'pinia'; -import {cloneDeep, flattenDeep, isArray, set} from 'lodash-es' +import { cloneDeep, flattenDeep, isArray, isObject, set } from 'lodash-es' import { Form } from 'jetlinks-ui-components' import {treeFilter} from "@/utils/comm"; import { timeTypeKeys } from '@/views/rule-engine/Scene/Save/components/Terms/util' @@ -177,12 +177,21 @@ const handOptionByColumn = (option: any) => { termTypeOptions.value = option.termTypes || [] tabsOptions.value[0].component = option.type columnType.value = option.type - const _options = isArray(option.options) ? option.options : [] + const _options = option.options if (option.type === 'boolean') { - valueOptions.value = _options?.map((item: any) => ({ ...item, label: item.name, value: item.id})) || [ - { label: '是', value: true }, - { label: '否', value: false }, - ] + // 处理_options为Object时 + if (isObject(_options)) { + const bool = (_options as any)?.bool + valueOptions.value = [ + { label: bool.falseText, name: bool.falseText, value: bool.falseValue, id: bool.falseValue }, + { label: bool.trueText, name: bool.trueText, value: bool.trueValue, id: bool.trueValue }, + ] + } else { + valueOptions.value = _options?.map((item: any) => ({ ...item, label: item.name, value: item.id})) || [ + { label: '是', name: '是', value: true, id: true }, + { label: '否', name: '否', value: false, id: false }, + ] + } } else if(option.type === 'enum') { valueOptions.value = _options?.map((item: any) => ({ ...item, label: item.name, value: item.id})) || [] } else{ From 8d2c2133dd4387e7267b7950e33e21f3958babf4 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Sat, 1 Apr 2023 12:45:20 +0800 Subject: [PATCH 04/12] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E8=81=94=E5=8A=A8=E5=B8=83=E5=B0=94=E5=80=BC=E5=9B=9E?= =?UTF-8?q?=E6=98=BE=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Scene/Save/action/ListItem/FilterCondition.vue | 4 ++-- .../Scene/Save/components/ParamsDropdown/index.vue | 1 + .../rule-engine/Scene/Save/components/Terms/ParamsItem.vue | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue b/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue index 07034878..c0248b84 100644 --- a/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue +++ b/src/views/rule-engine/Scene/Save/action/ListItem/FilterCondition.vue @@ -188,8 +188,8 @@ const handOptionByColumn = (option: any) => { ] } else { valueOptions.value = _options?.map((item: any) => ({ ...item, label: item.name, value: item.id})) || [ - { label: '是', name: '是', value: true, id: true }, - { label: '否', name: '否', value: false, id: false }, + { label: '是', name: '是', value: 'true', id: 'true' }, + { label: '否', name: '否', value: 'false', id: 'false' }, ] } } else if(option.type === 'enum') { diff --git a/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue b/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue index 385bb201..8cc74c31 100644 --- a/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue +++ b/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue @@ -162,6 +162,7 @@ watchEffect(() => { const option = getOption(_options, props.value as string, props.valueName) // 回显label值 myValue.value = props.value mySource.value = props.source + console.log(_options, props.value, props.valueName, option) if (option) { label.value = option[props.labelName] || option.name treeOpenKeys.value = openKeysByTree(_options, props.value, props.valueName) diff --git a/src/views/rule-engine/Scene/Save/components/Terms/ParamsItem.vue b/src/views/rule-engine/Scene/Save/components/Terms/ParamsItem.vue index c84abc93..bbbb5630 100644 --- a/src/views/rule-engine/Scene/Save/components/Terms/ParamsItem.vue +++ b/src/views/rule-engine/Scene/Save/components/Terms/ParamsItem.vue @@ -179,8 +179,8 @@ const handOptionByColumn = (option: any) => { if (option.dataType === 'boolean') { valueOptions.value = option.options?.map((item: any) => ({ ...item, label: item.name, value: item.id})) || [ - { label: '是', value: true, id: true }, - { label: '否', value: false, id: false }, + { label: '是', value: 'true' }, + { label: '否', value: 'false' }, ] } else if(option.dataType === 'enum') { valueOptions.value = option.options?.map((item: any) => ({ ...item, label: item.name, value: item.id})) || [] From 83b9cc8dfc80e60cce44ffd09942304d938f6392 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Sat, 1 Apr 2023 14:22:54 +0800 Subject: [PATCH 05/12] fix: bug#11218 --- .../action/Device/actions/FunctionItem.vue | 4 ++-- .../action/Device/actions/WriteProperty.vue | 11 +++++++---- .../Save/components/DropdownButton/Menus.vue | 18 +++++++++++++++--- .../Save/components/ParamsDropdown/index.vue | 1 + 4 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/views/rule-engine/Scene/Save/action/Device/actions/FunctionItem.vue b/src/views/rule-engine/Scene/Save/action/Device/actions/FunctionItem.vue index 86516c7d..cc5fe7d2 100644 --- a/src/views/rule-engine/Scene/Save/action/Device/actions/FunctionItem.vue +++ b/src/views/rule-engine/Scene/Save/action/Device/actions/FunctionItem.vue @@ -65,12 +65,12 @@ const handleOptions = computed(() => { { label: _item.trueText || true, value: _item.trueValue || true, - id: _item.trueValue || true, + id: String(_item.trueValue || true), }, { label: _item.falseText || false, value: _item.falseValue || false, - id: _item.falseValue || false, + id: String(_item.falseValue || false), }, ]; } diff --git a/src/views/rule-engine/Scene/Save/action/Device/actions/WriteProperty.vue b/src/views/rule-engine/Scene/Save/action/Device/actions/WriteProperty.vue index 66e79d5f..167f84c1 100644 --- a/src/views/rule-engine/Scene/Save/action/Device/actions/WriteProperty.vue +++ b/src/views/rule-engine/Scene/Save/action/Device/actions/WriteProperty.vue @@ -135,13 +135,15 @@ const handleOptions = computed(() => { return [ { label: _item.trueText || true, + name: _item.trueText || true, value: _item.trueValue || true, - id: _item.trueValue || true, + id: String(_item.trueValue || true), }, { label: _item.falseText || false, + name: _item.falseText || false, value: _item.falseValue || false, - id: _item.falseValue || false, + id: String(_item.falseValue || false), }, ]; } @@ -149,6 +151,7 @@ const handleOptions = computed(() => { return _item?.elements.map((i: any) => { return { label: i.text, + name: i.text, value: i.value, id: i.value, }; @@ -168,7 +171,7 @@ const onChange = () => { }); }; -const onValueChange = (val: any) => { +const onValueChange = (val: any, label: string) => { const obj = { [`${propertyModelRef.properties}`]: { value: propertyModelRef?.propertiesValue, @@ -176,7 +179,7 @@ const onValueChange = (val: any) => { }, }; emit('update:value', obj); - emit('change', val?.name || val) + emit('change', label || val) }; watch( diff --git a/src/views/rule-engine/Scene/Save/components/DropdownButton/Menus.vue b/src/views/rule-engine/Scene/Save/components/DropdownButton/Menus.vue index caf8b729..a4e76bda 100644 --- a/src/views/rule-engine/Scene/Save/components/DropdownButton/Menus.vue +++ b/src/views/rule-engine/Scene/Save/components/DropdownButton/Menus.vue @@ -11,7 +11,7 @@ diff --git a/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue b/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue index 8cc74c31..954a3db3 100644 --- a/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue +++ b/src/views/rule-engine/Scene/Save/components/ParamsDropdown/index.vue @@ -38,6 +38,7 @@ From e1dd6276019b4a1489cc24b6629203bc1e50bea2 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Sat, 1 Apr 2023 14:26:10 +0800 Subject: [PATCH 06/12] fix: bug#11369 --- src/views/init-home/data/baseMenu.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/views/init-home/data/baseMenu.ts b/src/views/init-home/data/baseMenu.ts index 7bd9aacf..2f749d08 100644 --- a/src/views/init-home/data/baseMenu.ts +++ b/src/views/init-home/data/baseMenu.ts @@ -22,7 +22,11 @@ export const USER_CENTER_MENU_DATA = { { permission: 'user', action: ['update-self-pwd'] - } + }, + { + permission: 'system_config', + actions: ['query'], + }, ] } ] From 2649b6f7558c75a2f606452e83781a4ef90a6523 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Sat, 1 Apr 2023 15:09:13 +0800 Subject: [PATCH 07/12] fix: bug#10898 --- .../system/Apply/Save/components/EditForm.vue | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/views/system/Apply/Save/components/EditForm.vue b/src/views/system/Apply/Save/components/EditForm.vue index b75ba98a..84cd8aa3 100644 --- a/src/views/system/Apply/Save/components/EditForm.vue +++ b/src/views/system/Apply/Save/components/EditForm.vue @@ -1439,7 +1439,7 @@ diff --git a/src/router/menu.ts b/src/router/menu.ts index 0224dc75..48fe3918 100644 --- a/src/router/menu.ts +++ b/src/router/menu.ts @@ -1,4 +1,4 @@ -export const LoginPath = '/login' +export const LoginPath = '/user/login' export const InitHomePath = '/init-home' export const AccountCenterBindPath = '/account/center/bind' export const InitLicense = '/init-license' From ede264c5912754c7e157a3125dc0ed891b3340c1 Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Sat, 1 Apr 2023 17:47:05 +0800 Subject: [PATCH 11/12] =?UTF-8?q?fix:=20=E4=BC=98=E5=8C=96=E4=BA=A7?= =?UTF-8?q?=E5=93=81=E8=AE=BE=E5=A4=87=E6=8E=A5=E5=85=A5=E5=BF=AB=E9=80=9F?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=BB=98=E8=AE=A4=E9=80=89=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/device/Product/Detail/DeviceAccess/index.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/views/device/Product/Detail/DeviceAccess/index.vue b/src/views/device/Product/Detail/DeviceAccess/index.vue index afda69df..bd765654 100644 --- a/src/views/device/Product/Detail/DeviceAccess/index.vue +++ b/src/views/device/Product/Detail/DeviceAccess/index.vue @@ -288,10 +288,10 @@ model="CARD" :defaultParams="{ ...temp, - sorts: [ + sorts: productStore.current?.accessId ? [ { name: 'id', value: productStore.current?.accessId }, { name: 'createTime', order: 'desc' }, - ], + ] : [{ name: 'createTime', order: 'desc' }], }" :params="queryParams" @cancelSelect="cancelSelect" From a6d869e7f0c83ffd93d8029eb979f8e98eaedbec Mon Sep 17 00:00:00 2001 From: xieyonghong <18010623010@163.com> Date: Sat, 1 Apr 2023 18:33:00 +0800 Subject: [PATCH 12/12] fix: bug#10954 --- src/components/Layout/BasicLayoutPage.vue | 1 + src/store/menu.ts | 1 - src/utils/menu.ts | 32 ++++++++++++++++------- src/views/iframe/index.vue | 9 ++++--- 4 files changed, 29 insertions(+), 14 deletions(-) diff --git a/src/components/Layout/BasicLayoutPage.vue b/src/components/Layout/BasicLayoutPage.vue index 97d0ae30..0121209e 100644 --- a/src/components/Layout/BasicLayoutPage.vue +++ b/src/components/Layout/BasicLayoutPage.vue @@ -136,6 +136,7 @@ const breadcrumb = computed(() => watchEffect(() => { if (router.currentRoute) { const paths = router.currentRoute.value.name as string + console.log(paths) if (paths) { const _metas = findRouteMeta(paths) state.selectedKeys = _metas.map(item => item.path) diff --git a/src/store/menu.ts b/src/store/menu.ts index 16f65155..509f182a 100644 --- a/src/store/menu.ts +++ b/src/store/menu.ts @@ -100,7 +100,6 @@ export const useMenuStore = defineStore({ // 是否存在通知订阅 const hasMessageSub = resp.result.some((item: { code: string }) => item.code === MESSAGE_SUBSCRIBE_MENU_CODE) - console.log('hasMessageSub', hasMessageSub) if (!hasMessageSub) { AccountMenu.children = AccountMenu.children.filter((item: { code: string }) => ![NotificationSubscriptionCode, NotificationRecordCode].includes(item.code) ) } diff --git a/src/utils/menu.ts b/src/utils/menu.ts index 2a08cba4..0fc4c8e7 100644 --- a/src/utils/menu.ts +++ b/src/utils/menu.ts @@ -212,6 +212,7 @@ export const findCodeRoute = (asyncRouterMap: any[]) => { function getDetail(code: string, url: string) { const detail = findDetailRouteItem(code, url) if (!detail) return + routeMeta[(detail as MenuItem).code] = { path: detail.url, title: detail.name, @@ -243,11 +244,19 @@ export const findCodeRoute = (asyncRouterMap: any[]) => { getDetail(_code, url) }) } - - getDetail(route.code, route.url) - + const _code = route.appId ? `/${route.appId}${route.url}` : route.code + if (!route.appId) { + getDetail(_code, route.url) + } else { + routeMeta[_code] = { + path: `/${route.appId}${route.url}`, + title: route.name, + parentName: code, + buttons: [] + } + } if (route.children) { - findChildren(route.children, route.code) + findChildren(route.children, _code) } }) } @@ -262,9 +271,11 @@ export function filterAsyncRouter(asyncRouterMap: any, parentCode = '', level = const menusData: any[] = [] const silderMenus: any[] = [] _asyncRouterMap.forEach((route: any) => { + const hasAppId = route.appId const _route: any = { - path: `${route.url}`, - name: route.code, + path: hasAppId ? `/${route.appId}${route.url}` : `${route.url}`, + name: hasAppId ? `/${route.appId}${route.url}` : route.code, + url: hasAppId ? `/${route.appId}${route.url}` : route.url, meta: { icon: route.icon, title: route.name, @@ -274,7 +285,6 @@ export function filterAsyncRouter(asyncRouterMap: any, parentCode = '', level = } const silder = { ..._route } - // 查看是否有隐藏子路由 route.children = findChildrenRoute(route.code, route.url, route.children) route.children = findDetailRoutes(route.children) @@ -287,7 +297,7 @@ export function filterAsyncRouter(asyncRouterMap: any, parentCode = '', level = if (showChildren && _route.children.length) { _route.component = level === 1 ? BasicLayoutPage : BlankLayoutPage - _route.redirect = route.children[0].url + _route.redirect = _route.children[0].url } else { const myComponent = resolveComponent(route.code) // _route.component = myComponent ? myComponent : BlankLayoutPage; @@ -300,7 +310,11 @@ export function filterAsyncRouter(asyncRouterMap: any, parentCode = '', level = } } } else { - _route.component = route.component || resolveComponent(route.code) || BlankLayoutPage + if (hasAppId) { + _route.component = route.component || resolveComponent('iframe') + } else { + _route.component = route.component || resolveComponent(route.code) || BlankLayoutPage + } } menusData.push(_route) silderMenus.push(silder) diff --git a/src/views/iframe/index.vue b/src/views/iframe/index.vue index e70e948e..f808a3bf 100644 --- a/src/views/iframe/index.vue +++ b/src/views/iframe/index.vue @@ -14,6 +14,7 @@ import { LocalStore } from '@/utils/comm'; import { getAppInfo_api } from '@/api/system/apply'; const iframeUrl = ref(''); +const route = useRoute() const handle = async (appId: string, url: string) => { const res = await getAppInfo_api(appId); @@ -25,7 +26,7 @@ const handle = async (appId: string, url: string) => { } if (res.result.provider === 'internal-standalone') { //{baseUrl}/api/application/sso/{appId}/login?redirect={menuUrl} - const urlStandalone = `${res.result.page.baseUrl}/api/application/sso/${appId}/login?redirect=${menuUrl}?layout=false`; + const urlStandalone = `${res.result.page.baseUrl}/#/api/application/sso/${appId}/login?redirect=${menuUrl}&layout=false`; iframeUrl.value = urlStandalone; // console.log(urlStandalone); } else if (res.result.provider === 'internal-integrated') { @@ -41,9 +42,9 @@ const handle = async (appId: string, url: string) => { }; watchEffect(() => { - const params = location.pathname.split('/')?.[1]; - const url = location.pathname.split('/').slice(2).join('/'); - // console.log(params, url); + const params = route.path.split('/')?.[1]; + const url = route.path.split('/').slice(2).join('/'); + console.log(params, url); handle(params, url); });