diff --git a/package.json b/package.json index 6976a7c2..c8700605 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-4", + "jetlinks-ui-components": "^1.0.34-7", "js-cookie": "^3.0.1", "jsencrypt": "^3.3.2", "less": "^4.1.3", diff --git a/src/utils/menu.ts b/src/utils/menu.ts index 9b3b3e9d..45061013 100644 --- a/src/utils/menu.ts +++ b/src/utils/menu.ts @@ -320,6 +320,9 @@ export const handleSiderMenu = (menuData: any[]) => { if (menuData && menuData.length) { return menuData.map(item => { const { isApp, appUrl } = hasAppID(item) // 是否为第三方程序 + if ( item.options?.isShow !== undefined && item.isShow === undefined) { + item.isShow = item.options.isShow + } const meta = handleMeta(item, isApp) const route: any = { path: isApp ? appUrl : `${item.url}`, @@ -333,7 +336,7 @@ export const handleSiderMenu = (menuData: any[]) => { route.children = handleSiderMenu(route.children) } - route.meta.hideInMenu = hideInMenu(item.code) + // route.meta.hideInMenu = hideInMenu(item.code) return route }) diff --git a/src/views/account/Center/components/Subscribe/index.vue b/src/views/account/Center/components/Subscribe/index.vue index 2d4a3801..84accb4d 100644 --- a/src/views/account/Center/components/Subscribe/index.vue +++ b/src/views/account/Center/components/Subscribe/index.vue @@ -63,7 +63,7 @@ const subscribe = ref([]); const dataSource = ref([]); const activeKey = ref(); const loading = ref(false) -let initData:any[] +let initData:any[] const handleSearch = () => { loading.value = true getAllNotice().then((resp: any) => { @@ -106,7 +106,11 @@ const handleSearch = () => { }; onMounted(() => { - activeKey.value = menuStore.hasMenu('code') ? ['alarm', 'system-monitor', 'system-business','workflow-notification'] : ['alarm', 'system-monitor', 'system-business'] + const keys = ['alarm', 'system-monitor', 'system-business'] + if (menuStore.hasMenu('workflow')) { + keys.push('workflow-notification') + } + activeKey.value = keys initData = getInitData() handleSearch(); }); @@ -142,4 +146,4 @@ onMounted(() => { } } } - \ No newline at end of file + diff --git a/src/views/account/Center/components/data.ts b/src/views/account/Center/components/data.ts index 3637b0bc..7919ce9c 100644 --- a/src/views/account/Center/components/data.ts +++ b/src/views/account/Center/components/data.ts @@ -72,6 +72,5 @@ const workflowNotice = [ }, ] export const getInitData = () =>{ - let initData:any[] - return initData = menuStore.hasMenu('code') ? [...systemNotice,...workflowNotice] : [...systemNotice] -} \ No newline at end of file + return menuStore.hasMenu('workflow') ? [...systemNotice,...workflowNotice] : [...systemNotice] +} diff --git a/src/views/device/components/Metadata/Cat/index.vue b/src/views/device/components/Metadata/Cat/index.vue index 623ec1ec..8c963baf 100644 --- a/src/views/device/components/Metadata/Cat/index.vue +++ b/src/views/device/components/Metadata/Cat/index.vue @@ -158,14 +158,14 @@ watch( if (props.type === 'device') { detail(id as string).then((resp) => { loading.value = false - instanceStore.setCurrent(resp.result) + // instanceStore.setCurrent(resp.result) value.value = resp.result.metadata hideVirtualRule(resp.result.metadata) }); } else { productDetail(id as string).then((resp) => { loading.value = false - productStore.setCurrent(resp.result) + // productStore.setCurrent(resp.result) value.value = resp.result.metadata hideVirtualRule(resp.result.metadata) }); diff --git a/src/views/init-home/Menu/index.vue b/src/views/init-home/Menu/index.vue index 914ccb6d..6ce235ff 100644 --- a/src/views/init-home/Menu/index.vue +++ b/src/views/init-home/Menu/index.vue @@ -101,9 +101,9 @@ const menuCount = (menus: any[]) => { */ const dealMenu = (data:any) =>{ data.forEach((item:any)=>{ - item.options = { - show: true - } + item.options = Object.assign({ + show: true + }, item?.options || {}) if(item.children){ dealMenu(item.children) } @@ -139,4 +139,4 @@ defineExpose({ margin-right: 16px; } } - \ No newline at end of file + diff --git a/src/views/init-home/data/baseMenu.ts b/src/views/init-home/data/baseMenu.ts index e4cdbae8..139b12a9 100644 --- a/src/views/init-home/data/baseMenu.ts +++ b/src/views/init-home/data/baseMenu.ts @@ -13,6 +13,9 @@ export const USER_CENTER_MENU_DATA = { sortIndex: 9999, granted: true, owner: 'iot', + options: { + isShow: false, + }, permissions: [ { permission: 'system_config', @@ -4588,5 +4591,265 @@ export default [ supportDataAccess: false }, ], + }, + { + "path": "3n23", + "sortIndex": 5, + "level": 1, + "owner": "iot", + "name": "WEB IDE", + "code": "web_ide", + "url": "/web_ide", + "icon": "MenuUnfoldOutlined", + showPage: ["low-code-info", "low-code-editor"], + "options": { + isShow: false, + }, + "accessSupport": { + "text": "不支持", + "value": "unsupported" + }, + "indirectMenus": [], + permissions: [ + { + "permission": "low-code-info", + "actions": [ + "add", "query", "save", "delete" + ] + }, + { + "permission": "low-code-editor", + "actions": [ + "query", "deploy" + ] + } + ], + "creatorId": "1199596756811550720", + "createTime": 1698735482730, + "supportDataAccess": false + }, + { + "path": "4FgE", + "sortIndex": 6, + "level": 1, + "owner": "iot", + "name": "工作流", + "code": "workflow", + "url": "/workflow", + "icon": "MenuUnfoldOutlined", + showPage: ["process-form","process-deployment"], + "options": { + isShow: false, + }, + "accessSupport": { + "text": "不支持", + "value": "unsupported" + }, + "indirectMenus": [], + permissions: [ + { + "permission": "low-code-info", + "actions": [ + "query", + ] + }, + ], + "buttons": [ + { + "id": "form_query", + "name": "流程表单-查询", + "permissions": [ + { + "permission": "process-form", + "actions": [ + "query" + ] + } + ] + }, + { + "id": "form_save", + "name": "流程表单-保存", + "permissions": [ + { + "permission": "process-form", + "actions": [ + "save" + ] + } + ] + }, + { + "id": "form_delete", + "name": "流程表单-删除", + "permissions": [ + { + "permission": "process-form", + "actions": [ + "delete" + ] + } + ] + }, + { + "id": "definition_query", + "name": "流程定义-查询", + "permissions": [ + { + "permission": "process-definition", + "actions": [ + "query" + ] + } + ] + }, + { + "id": "definition_save", + "name": "流程定义-保存", + "permissions": [ + { + "permission": "process-definition", + "actions": [ + "save" + ] + } + ] + }, + { + "id": "definition_delete", + "name": "流程定义-删除", + "permissions": [ + { + "permission": "process-definition", + "actions": [ + "delete" + ] + } + ] + }, + { + "id": "release_query", + "name": "流程部署-查询", + "permissions": [ + { + "permission": "process-deployment", + "actions": [ + "query" + ] + } + ] + }, + { + "id": "release_save", + "name": "流程部署-保存", + "permissions": [ + { + "permission": "process-deployment", + "actions": [ + "save" + ] + } + ] + }, + { + "id": "release_delete", + "name": "流程部署-删除", + "permissions": [ + { + "permission": "process-deployment", + "actions": [ + "delete" + ] + } + ] + }, + { + "id": "runtime-dismiss", + "name": "流程运行时-驳回任务", + "permissions": [ + { + "permission": "process-runtime", + "actions": [ + "reject" + ] + } + ] + }, + { + "id": "runtime-initiate", + "name": "流程运行时-发起流程", + "permissions": [ + { + "permission": "process-runtime", + "actions": [ + "start" + ] + } + ] + }, + { + "id": "runtime-mine", + "name": "流程运行时-我的流程", + "permissions": [ + { + "permission": "process-runtime", + "actions": [ + "self" + ] + } + ] + }, + { + "id": "runtime-sign", + "name": "流程运行时-签收任务", + "permissions": [ + { + "permission": "process-runtime", + "actions": [ + "claim" + ] + } + ] + }, + { + "id": "runtime-complete", + "name": "流程运行时-完成任务", + "permissions": [ + { + "permission": "process-runtime", + "actions": [ + "complete" + ] + } + ] + }, + { + "id": "runtime-create", + "name": "流程运行时-创建/启动流程", + "permissions": [ + { + "permission": "process-runtime", + "actions": [ + "createAndStart" + ] + } + ] + }, + { + "id": "runtime-revoke", + "name": "流程运行时-撤销流程", + "permissions": [ + { + "permission": "process-runtime", + "actions": [ + "repeal" + ] + } + ] + } + ], + "creatorId": "1199596756811550720", + "createTime": 1698735482730, + "supportDataAccess": false } ]; diff --git a/src/views/system/Menu/Detail/BasicInfo.vue b/src/views/system/Menu/Detail/BasicInfo.vue index 8ecea9a7..82f55070 100644 --- a/src/views/system/Menu/Detail/BasicInfo.vue +++ b/src/views/system/Menu/Detail/BasicInfo.vue @@ -386,7 +386,7 @@ const form = reactive({ const params = { ...form.data, owner: form.data?.owner ?? null, - options: { show: true }, + options: form.data?.options || { show: true }, accessSupport: { value: accessSupportValue, label: diff --git a/src/views/system/Menu/components/ButtonAddDialog.vue b/src/views/system/Menu/components/ButtonAddDialog.vue index c769e091..bf927177 100644 --- a/src/views/system/Menu/components/ButtonAddDialog.vue +++ b/src/views/system/Menu/components/ButtonAddDialog.vue @@ -59,7 +59,7 @@ max-height="350px" v-model:value="form.data.permissions" :disabled="props.mode === '查看'" - :key="form.data.id || ''" + :btnId="form.data.id " /> diff --git a/src/views/system/Menu/components/PermissChoose.vue b/src/views/system/Menu/components/PermissChoose.vue index 83cf39cc..f62e7e3c 100644 --- a/src/views/system/Menu/components/PermissChoose.vue +++ b/src/views/system/Menu/components/PermissChoose.vue @@ -50,7 +50,7 @@ import { Form } from 'jetlinks-ui-components'; Form.useInjectFormItemContext(); const props = defineProps<{ - key: string; + btnId: string; value: any[]; firstWidth: number; maxHeight: string; @@ -77,17 +77,17 @@ const permission = reactive({ init: () => { permission.getList(); - watch( - () => props.key, - () => { - nextTick(() => { - permission.list = permission.makeList( - props.value, - permission.sourceList, - ); - }); - }, - ); + // watch( + // () => props.btnId, + // () => { + // nextTick(() => { + // permission.list = permission.makeList( + // props.value, + // permission.sourceList, + // ); + // }); + // }, + // ); }, // 获取权限列表 getList: () => { diff --git a/yarn.lock b/yarn.lock index eb31db18..11df283f 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-4: - version "1.0.34-4" - resolved "https://registry.npmjs.org/jetlinks-ui-components/-/jetlinks-ui-components-1.0.34-4.tgz#92cfc6be685988385a489f3e924383c4831f3ed5" - integrity sha512-td+RgaBC5lQxRuDsHkCg9UEzCcSy4XikufnabVGz5IxU+UmXu+PJUjz2wo9vDe8sPSctyk/5jQU+N6GBPlp8JA== +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== dependencies: "@vueuse/core" "^9.12.0" "@vueuse/router" "^9.13.0"