@utogether/udp-core 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.ts +90 -0
- package/build/plugins.ts +26 -0
- package/dist/403-B1R-4vXw.js +64 -0
- package/dist/404-fXPl8csw.js +64 -0
- package/dist/500-eI5842YB.js +66 -0
- package/dist/AuthorityInfo-CfVH6PaB.js +4 -0
- package/dist/AuthorityInfo.vue_vue_type_style_index_0_lang-DbK-f8jH.js +102 -0
- package/dist/AuthorityPanel-BaLMwMgW.js +4 -0
- package/dist/AuthorityPanel.vue_vue_type_style_index_0_lang-C_bkqLD9.js +107 -0
- package/dist/Company-CYC9Avfz.js +25 -0
- package/dist/CompanyPanel-B4MzoqN_.js +206 -0
- package/dist/DataSet-DT-rGICv.js +147 -0
- package/dist/Department-B4BNSiYx.js +25 -0
- package/dist/DepartmentPanel-zJO89L2O.js +224 -0
- package/dist/DesignPanel-S8P0J97f.js +4 -0
- package/dist/DesignPanel.vue_vue_type_style_index_0_lang-DW-_Vqrr.js +1015 -0
- package/dist/DictView-bIS5-rK-.js +95 -0
- package/dist/InvOrganization-MuM2jtsG.js +66 -0
- package/dist/Org-kXHSjsgJ.js +35 -0
- package/dist/Preview-CRyiwUIR.js +48 -0
- package/dist/ReportDefine-WZYIx8Sm.js +10 -0
- package/dist/ReportDesign-D-7GKgpb.js +165 -0
- package/dist/ReportQuery-BIIJny6w.js +75 -0
- package/dist/ReportQueryFrom-OoUl7N2O.js +4 -0
- package/dist/ReportQueryFrom.vue_vue_type_style_index_0_lang-B878fgj8.js +177 -0
- package/dist/ReportTemplate-Cfeq9US-.js +161 -0
- package/dist/Role-BwTV2QMH.js +25 -0
- package/dist/RoleAssign-De1JjOun.js +26 -0
- package/dist/RolePanel-E3RcdByM.js +4 -0
- package/dist/RolePanel-pUBXsqCM.js +4 -0
- package/dist/RolePanel.vue_vue_type_script_setup_true_lang-B2pQwHb0.js +148 -0
- package/dist/RolePanel.vue_vue_type_script_setup_true_lang-CTIad9_Q.js +126 -0
- package/dist/ScrollPanel.vue_vue_type_style_index_0_lang-vMR1fBi0.js +100 -0
- package/dist/Staff-Czm7A8vI.js +25 -0
- package/dist/StaffInfo-DJzvBuxy.js +4 -0
- package/dist/StaffInfo.vue_vue_type_style_index_0_lang-DMTL7KCh.js +108 -0
- package/dist/StaffPanel-CHk60LEz.js +4 -0
- package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-iPKLb5wG.js +114 -0
- package/dist/SysUser-BGwbttRn.js +15 -0
- package/dist/SysUserPanel-BCbKoLKt.js +4 -0
- package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-0QUjnhjF.js +289 -0
- package/dist/SystemMenu-BkqZSDKl.js +151 -0
- package/dist/UserInfo-BsyAcT2d.js +4 -0
- package/dist/UserInfo.vue_vue_type_style_index_0_lang-D0-KDxAh.js +158 -0
- package/dist/await-to-js.es5-BtRbN2QH.js +10 -0
- package/dist/childView-CF83nhxb.js +4 -0
- package/dist/childView-CyuLTUqC.js +4 -0
- package/dist/childView.vue_vue_type_style_index_0_lang-CNSgGda3.js +187 -0
- package/dist/childView.vue_vue_type_style_index_0_lang-Cch4lE-i.js +144 -0
- package/dist/code-rule-Bz-gnktN.js +147 -0
- package/dist/core.es.js +13 -0
- package/dist/core.umd.js +173 -0
- package/dist/cron-task-CIifSUdW.js +135 -0
- package/dist/frameView-_d2mqjjQ.js +43 -0
- package/dist/img/l_img.svg +1 -0
- package/dist/img/minicolors.png +0 -0
- package/dist/img/v_img.svg +1 -0
- package/dist/index-BKIw8tSn.js +9195 -0
- package/dist/layoutView-DLKVepB8.js +3317 -0
- package/dist/log-in-e7D5Ss1P.js +110 -0
- package/dist/log-out--RRncZhN.js +120 -0
- package/dist/login-LREiDfFU.js +251 -0
- package/dist/login-log-CvVnyGi3.js +68 -0
- package/dist/lov-view-DDrIVILB.js +97 -0
- package/dist/menuInfo-B1FUV-Sk.js +4 -0
- package/dist/menuInfo.vue_vue_type_style_index_0_lang-Cnk3vdtD.js +338 -0
- package/dist/pda-app-CRhVGijN.js +2209 -0
- package/dist/redirect-DiaNDu8F.js +15 -0
- package/dist/resource-BCwx9fEv.js +97 -0
- package/dist/su-welcome-189A7N4r.js +526 -0
- package/dist/sys-config-BZ3sejow.js +277 -0
- package/dist/udp-core.css +9 -0
- package/dist/utogether-r08LNiIZ.js +182 -0
- package/index.ts +36 -0
- package/package.json +16 -0
- package/public/img/l_img.svg +1 -0
- package/public/img/minicolors.png +0 -0
- package/public/img/v_img.svg +1 -0
- package/src/App.vue +70 -0
- package/src/api/http.ts +50 -0
- package/src/api/index.ts +31 -0
- package/src/api/mock.ts +20 -0
- package/src/api/user.ts +43 -0
- package/src/assets/images/avatars.jpg +0 -0
- package/src/assets/images/empty.png +0 -0
- package/src/assets/images/login.png +0 -0
- package/src/assets/images/logo.png +0 -0
- package/src/assets/images/mask-text.jpg +0 -0
- package/src/assets/images/minicolors.png +0 -0
- package/src/assets/images/utogether.png +0 -0
- package/src/assets/images/welcome.png +0 -0
- package/src/assets/status/403.svg +1 -0
- package/src/assets/status/404.svg +1 -0
- package/src/assets/status/500.svg +1 -0
- package/src/assets/svg/back_top.svg +1 -0
- package/src/assets/svg/bg.svg +1 -0
- package/src/assets/svg/close.svg +1 -0
- package/src/assets/svg/close_all.svg +1 -0
- package/src/assets/svg/close_left.svg +1 -0
- package/src/assets/svg/close_other.svg +1 -0
- package/src/assets/svg/close_right.svg +1 -0
- package/src/assets/svg/dark.svg +1 -0
- package/src/assets/svg/day.svg +1 -0
- package/src/assets/svg/enter_outlined.svg +1 -0
- package/src/assets/svg/exit_screen.svg +1 -0
- package/src/assets/svg/full_screen.svg +1 -0
- package/src/assets/svg/globalization.svg +1 -0
- package/src/assets/svg/loading.svg +17 -0
- package/src/assets/svg/mdi_keyboard_esc.svg +1 -0
- package/src/assets/svg/refresh.svg +1 -0
- package/src/assets/svg/system.svg +1 -0
- package/src/components/ReCountTo/README.md +2 -0
- package/src/components/ReCountTo/index.ts +18 -0
- package/src/components/ReCountTo/src/normal/index.tsx +165 -0
- package/src/components/ReCountTo/src/normal/props.ts +37 -0
- package/src/components/ReCountTo/src/rebound/index.tsx +67 -0
- package/src/components/ReCountTo/src/rebound/props.ts +14 -0
- package/src/components/ReCountTo/src/rebound/rebound.css +77 -0
- package/src/components/ReCropper/index.ts +14 -0
- package/src/components/ReCropper/src/index.tsx +141 -0
- package/src/components/ReFlicker/index.css +39 -0
- package/src/components/ReFlicker/index.ts +50 -0
- package/src/components/ReFlop/index.ts +14 -0
- package/src/components/ReFlop/src/Filpper.tsx +99 -0
- package/src/components/ReFlop/src/filpper.css +184 -0
- package/src/components/ReFlop/src/index.vue +126 -0
- package/src/components/ReFlowChart/index.ts +24 -0
- package/src/components/ReFlowChart/src/Control.vue +139 -0
- package/src/components/ReFlowChart/src/DataDialog.vue +12 -0
- package/src/components/ReFlowChart/src/NodePanel.vue +151 -0
- package/src/components/ReFlowChart/src/adpterForTurbo.ts +160 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.css +49 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.eot +0 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.js +61 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.json +58 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.svg +47 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.ttf +0 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff +0 -0
- package/src/components/ReFlowChart/src/assets/iconfont/iconfont.woff2 +0 -0
- package/src/components/ReFlowChart/src/config.ts +62 -0
- package/src/components/ReIcon/index.ts +12 -0
- package/src/components/ReIcon/src/Icon.vue +81 -0
- package/src/components/ReIcon/src/hooks.ts +63 -0
- package/src/components/ReIcon/src/iconfont.ts +45 -0
- package/src/components/ReIcon/src/iconifyIconOffline.ts +36 -0
- package/src/components/ReIcon/src/iconifyIconOnline.ts +28 -0
- package/src/components/ReIcon/src/offlineIcon.ts +64 -0
- package/src/components/ReIcon/src/types.ts +20 -0
- package/src/components/ReSplitPane/index.css +49 -0
- package/src/components/ReSplitPane/index.tsx +119 -0
- package/src/components/ReSplitPane/resizer.css +45 -0
- package/src/components/ReSplitPane/resizer.tsx +30 -0
- package/src/components/SuCharts/index.ts +36 -0
- package/src/components/SuCharts/src/EchartBar.vue +134 -0
- package/src/components/SuCharts/src/UserInfo.vue +78 -0
- package/src/components/SuCharts/src/echart-line.vue +85 -0
- package/src/components/SuCharts/src/echart-pie.vue +95 -0
- package/src/components/SuCommon/card/components/Card.vue +148 -0
- package/src/components/SuCommon/card/components/DialogForm.vue +127 -0
- package/src/components/SuCommon/card/index.vue +142 -0
- package/src/components/SuCommon/icon-select/index.vue +241 -0
- package/src/components/SuCommon/table/index.vue +208 -0
- package/src/components/SuCommon/utils/index.ts +103 -0
- package/src/components/SuCommon/utils/slot.tsx +50 -0
- package/src/components/SuFloatButton/index.vue +159 -0
- package/src/components/SuQrcode/index.ts +14 -0
- package/src/components/SuQrcode/src/index.scss +9 -0
- package/src/components/SuQrcode/src/index.tsx +236 -0
- package/src/components/SuScrollTree/ScrollPanel.vue +175 -0
- package/src/components/SuTable/SuTable.vue +334 -0
- package/src/components/SuTypeit/index.ts +51 -0
- package/src/config/index.ts +35 -0
- package/src/contant/index.ts +20 -0
- package/src/directives/elResizeDetector/index.ts +33 -0
- package/src/directives/index.ts +11 -0
- package/src/directives/permission/index.ts +29 -0
- package/src/layout/components/lay-chrome/index.vue +30 -0
- package/src/layout/components/lay-content/index.vue +143 -0
- package/src/layout/components/lay-navbar/index.vue +237 -0
- package/src/layout/components/lay-notice/data.ts +59 -0
- package/src/layout/components/lay-notice/index.vue +83 -0
- package/src/layout/components/lay-notice/noticeItem.vue +160 -0
- package/src/layout/components/lay-notice/noticeList.vue +19 -0
- package/src/layout/components/lay-panel/index.vue +150 -0
- package/src/layout/components/lay-search/components/SearchFooter.vue +67 -0
- package/src/layout/components/lay-search/components/SearchModal.vue +189 -0
- package/src/layout/components/lay-search/components/SearchResult.vue +132 -0
- package/src/layout/components/lay-search/components/index.ts +10 -0
- package/src/layout/components/lay-search/index.vue +25 -0
- package/src/layout/components/lay-select-org/index.vue +69 -0
- package/src/layout/components/lay-setting/index.vue +510 -0
- package/src/layout/components/lay-sidebar/breadCrumb.vue +131 -0
- package/src/layout/components/lay-sidebar/extraIcon.vue +25 -0
- package/src/layout/components/lay-sidebar/hamBurger.vue +72 -0
- package/src/layout/components/lay-sidebar/horizontal.vue +191 -0
- package/src/layout/components/lay-sidebar/mixNav.vue +258 -0
- package/src/layout/components/lay-sidebar/sidebar-logo.vue +98 -0
- package/src/layout/components/lay-sidebar/sidebarItem.vue +205 -0
- package/src/layout/components/lay-sidebar/vertical.vue +94 -0
- package/src/layout/components/lay-tag/index.scss +375 -0
- package/src/layout/components/lay-tag/index.vue +625 -0
- package/src/layout/frameView.vue +71 -0
- package/src/layout/hooks/useBoolean.ts +33 -0
- package/src/layout/hooks/useDataThemeChange.ts +142 -0
- package/src/layout/hooks/useLayout.ts +65 -0
- package/src/layout/hooks/useNav.ts +173 -0
- package/src/layout/hooks/useTag.ts +233 -0
- package/src/layout/hooks/useTranslationLang.ts +51 -0
- package/src/layout/layoutView.vue +215 -0
- package/src/layout/redirect.vue +30 -0
- package/src/layout/routerView/parent.vue +23 -0
- package/src/layout/types.ts +92 -0
- package/src/main.ts +108 -0
- package/src/plugins/echarts/index.ts +58 -0
- package/src/plugins/echarts/theme.json +394 -0
- package/src/plugins/i18n/en.ts +289 -0
- package/src/plugins/i18n/index.ts +76 -0
- package/src/plugins/i18n/module/u-report.ts +64 -0
- package/src/plugins/i18n/module/u-workflow.ts +71 -0
- package/src/plugins/i18n/module/umsg.ts +28 -0
- package/src/plugins/i18n/zh.ts +337 -0
- package/src/plugins/vxe-table/index.ts +46 -0
- package/src/plugins/vxe-table/render.tsx +397 -0
- package/src/router/createComponent.tsx +25 -0
- package/src/router/index.ts +183 -0
- package/src/router/modules/error.ts +32 -0
- package/src/router/modules/home.ts +32 -0
- package/src/router/modules/nested.ts +93 -0
- package/src/router/modules/remaining.ts +83 -0
- package/src/router/modules/tabs.ts +55 -0
- package/src/router/utils.ts +377 -0
- package/src/store/index.ts +9 -0
- package/src/store/modules/app.ts +69 -0
- package/src/store/modules/epTheme.ts +49 -0
- package/src/store/modules/multiTags.ts +109 -0
- package/src/store/modules/permission.ts +103 -0
- package/src/store/modules/settings.ts +40 -0
- package/src/store/modules/system.ts +180 -0
- package/src/store/modules/types.ts +49 -0
- package/src/style/button.scss +78 -0
- package/src/style/clear-mixin.scss +28 -0
- package/src/style/dark.scss +218 -0
- package/src/style/element-plus.scss +206 -0
- package/src/style/index.scss +76 -0
- package/src/style/login.css +336 -0
- package/src/style/login2.css +106 -0
- package/src/style/print-lock.css +375 -0
- package/src/style/reset.scss +272 -0
- package/src/style/sidebar.scss +770 -0
- package/src/style/suprint.css +985 -0
- package/src/style/tailwind.css +68 -0
- package/src/style/theme.scss +143 -0
- package/src/style/transition.scss +42 -0
- package/src/style/vxetable.scss +256 -0
- package/src/utils/authority/index.ts +29 -0
- package/src/utils/browers.ts +59 -0
- package/src/utils/dataFormat/index.ts +223 -0
- package/src/utils/http/index.ts +297 -0
- package/src/utils/http/types.d.ts +46 -0
- package/src/utils/index.ts +47 -0
- package/src/utils/lifecycle.ts +20 -0
- package/src/utils/mitt.ts +19 -0
- package/src/utils/propTypes.ts +47 -0
- package/src/utils/storage/index.ts +51 -0
- package/src/views/components/contextmenu/basic.vue +74 -0
- package/src/views/components/contextmenu/context-menu.vue +40 -0
- package/src/views/components/contextmenu/menuDynamic.vue +99 -0
- package/src/views/components/contextmenu/menuGroup.vue +71 -0
- package/src/views/components/count-to/index.vue +43 -0
- package/src/views/components/cropping/index.vue +59 -0
- package/src/views/components/cropping/picture.jpeg +0 -0
- package/src/views/components/split-pane/index.vue +82 -0
- package/src/views/components/video/index.vue +57 -0
- package/src/views/error/403.vue +50 -0
- package/src/views/error/404.vue +50 -0
- package/src/views/error/500.vue +52 -0
- package/src/views/login/login-view.vue +314 -0
- package/src/views/login/utils/motion.ts +47 -0
- package/src/views/login/utils/rule.ts +70 -0
- package/src/views/login/utils/verifyCode.ts +52 -0
- package/src/views/organization/company/Company.vue +56 -0
- package/src/views/organization/company/CompanyPanel.vue +259 -0
- package/src/views/organization/department/Department.vue +58 -0
- package/src/views/organization/department/DepartmentPanel.vue +283 -0
- package/src/views/organization/inv-org/InvOrganization.vue +53 -0
- package/src/views/organization/org/Org.vue +43 -0
- package/src/views/organization/staff/Staff.vue +58 -0
- package/src/views/organization/staff/StaffInfo.vue +163 -0
- package/src/views/organization/staff/StaffPanel.vue +144 -0
- package/src/views/system/cron/cron-task.vue +157 -0
- package/src/views/system/menu/AuthorityPanel.vue +140 -0
- package/src/views/system/menu/SystemMenu.vue +191 -0
- package/src/views/system/menu/menuInfo.vue +368 -0
- package/src/views/system/role/AuthorityInfo.vue +147 -0
- package/src/views/system/role/Role.vue +57 -0
- package/src/views/system/role/RolePanel.vue +191 -0
- package/src/views/system/role/UserInfo.vue +193 -0
- package/src/views/system/role-assign/RoleAssign.vue +57 -0
- package/src/views/system/role-assign/RolePanel.vue +136 -0
- package/src/views/system/sys/sys-config.vue +291 -0
- package/src/views/system/sysUser/SysUser.vue +45 -0
- package/src/views/system/sysUser/SysUserPanel.vue +278 -0
- package/src/views/uapp/pda/pda-app.vue +176 -0
- package/src/views/udev/coderule/code-rule.vue +121 -0
- package/src/views/udev/dict/DictView.vue +106 -0
- package/src/views/udev/dict/childView.vue +222 -0
- package/src/views/udev/lov/childView.vue +180 -0
- package/src/views/udev/lov/lov-view.vue +91 -0
- package/src/views/ufile/aggregation/File.vue +87 -0
- package/src/views/ufile/file/water-mark.vue +103 -0
- package/src/views/uhome/components/menu-favorite.vue +331 -0
- package/src/views/uhome/su-welcome.vue +339 -0
- package/src/views/ulogin/login.vue +316 -0
- package/src/views/umsg/monitor/msg-monitor.vue +36 -0
- package/src/views/umsg/msg/TemplateContent.vue +103 -0
- package/src/views/umsg/msg/msg-template.vue +66 -0
- package/src/views/umsg/send/childView.vue +142 -0
- package/src/views/umsg/send/msg-send.vue +95 -0
- package/src/views/upms/interface/log-in.vue +106 -0
- package/src/views/upms/interface/log-out.vue +107 -0
- package/src/views/upms/user/login-log.vue +60 -0
- package/src/views/urpt/dataSet/DataSet.vue +139 -0
- package/src/views/urpt/design/DesignPanel.vue +526 -0
- package/src/views/urpt/design/Preview.vue +65 -0
- package/src/views/urpt/design/ReportDesign.vue +249 -0
- package/src/views/urpt/design/bg.png +0 -0
- package/src/views/urpt/design/panel.ts +841 -0
- package/src/views/urpt/design/print-data.ts +59 -0
- package/src/views/urpt/query/ReportQuery.vue +122 -0
- package/src/views/urpt/query/ReportQueryFrom.vue +252 -0
- package/src/views/urpt/report-request/ReportDefine.vue +10 -0
- package/src/views/urpt/static-resource/resource.vue +116 -0
- package/src/views/urpt/template/ReportTemplate.vue +198 -0
- package/tsconfig.json +30 -0
- package/types/env.d.ts +1 -0
- package/types/global-components.d.ts +12 -0
- package/types/global.d.ts +236 -0
- package/types/image.d.ts +7 -0
- package/types/index.d.ts +73 -0
- package/types/router.d.ts +107 -0
- package/types/shims-tsx.d.ts +22 -0
- package/types/shims-vue.d.ts +20 -0
- package/vite.config.ts +73 -0
|
@@ -0,0 +1,510 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { reactive, ref, unref, watch, computed, nextTick, onUnmounted, onBeforeMount } from 'vue';
|
|
3
|
+
import { templateRef } from '@vueuse/core';
|
|
4
|
+
import { useI18n } from 'vue-i18n';
|
|
5
|
+
import { useDark, useGlobal, useDebounce } from '@utogether/utils';
|
|
6
|
+
import panel from '../lay-panel/index.vue';
|
|
7
|
+
import { emitter } from '../../../utils/mitt';
|
|
8
|
+
import { useAppStoreHook } from '../../../store/modules/app';
|
|
9
|
+
import { useMultiTagsStoreHook } from '../../../store/modules/multiTags';
|
|
10
|
+
import { useDataThemeChange } from '../../hooks/useDataThemeChange';
|
|
11
|
+
import { useNav } from '../../hooks/useNav';
|
|
12
|
+
import { useRenderIcon } from '../../../components/ReIcon/src/hooks';
|
|
13
|
+
import dayIcon from '../../../assets/svg/day.svg?component';
|
|
14
|
+
import darkIcon from '../../../assets/svg/dark.svg?component';
|
|
15
|
+
import systemIcon from '../../../assets/svg/system.svg?component';
|
|
16
|
+
|
|
17
|
+
interface IThemeOption {
|
|
18
|
+
label: string;
|
|
19
|
+
icon: any;
|
|
20
|
+
theme: string;
|
|
21
|
+
value: number;
|
|
22
|
+
iconAttrs: { fill: string };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const { device } = useNav();
|
|
26
|
+
const { t } = useI18n();
|
|
27
|
+
const { isDark } = useDark();
|
|
28
|
+
const { $storage } = useGlobal();
|
|
29
|
+
|
|
30
|
+
const mixRef = templateRef<HTMLElement | null>('mixRef', null);
|
|
31
|
+
const verticalRef = templateRef<HTMLElement | null>('verticalRef', null);
|
|
32
|
+
const horizontalRef = templateRef<HTMLElement | null>('horizontalRef', null);
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
dataTheme,
|
|
36
|
+
overallStyle,
|
|
37
|
+
layoutTheme,
|
|
38
|
+
themeColors,
|
|
39
|
+
toggleClass,
|
|
40
|
+
dataThemeChange,
|
|
41
|
+
setLayoutThemeColor
|
|
42
|
+
} = useDataThemeChange();
|
|
43
|
+
|
|
44
|
+
/* body添加layout属性,作用于src/style/sidebar.scss */
|
|
45
|
+
if (unref(layoutTheme)) {
|
|
46
|
+
const layout = unref(layoutTheme).layout;
|
|
47
|
+
const theme = unref(layoutTheme).theme;
|
|
48
|
+
document.documentElement.setAttribute('data-theme', theme);
|
|
49
|
+
setLayoutModel(layout);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** 默认灵动模式 */
|
|
53
|
+
const markValue = ref($storage.configure?.showModel ?? 'smart');
|
|
54
|
+
|
|
55
|
+
const logoVal = ref($storage.configure?.showLogo ?? true);
|
|
56
|
+
|
|
57
|
+
const settings = reactive({
|
|
58
|
+
greyVal: $storage.configure.grey,
|
|
59
|
+
weakVal: $storage.configure.weak,
|
|
60
|
+
tabsVal: $storage.configure.hideTabs,
|
|
61
|
+
showLogo: $storage.configure.showLogo,
|
|
62
|
+
showModel: $storage.configure.showModel,
|
|
63
|
+
multiTagsCache: $storage.configure.multiTagsCache
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
const getThemeColorStyle = computed(() => {
|
|
67
|
+
return color => {
|
|
68
|
+
return { background: color };
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
/** 当网页整体为暗色风格时不显示亮白色主题配色切换选项 */
|
|
73
|
+
const showThemeColors = computed(() => {
|
|
74
|
+
return themeColor => {
|
|
75
|
+
return themeColor === 'light' && isDark.value ? false : true;
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
function storageConfigureChange<T>(key: string, val: T): void {
|
|
80
|
+
const storageConfigure = $storage.configure;
|
|
81
|
+
storageConfigure[key] = val;
|
|
82
|
+
$storage.configure = storageConfigure;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** 灰色模式设置 */
|
|
86
|
+
const greyChange = (value): void => {
|
|
87
|
+
const htmlEl = document.querySelector('html');
|
|
88
|
+
toggleClass(settings.greyVal, 'html-grey', htmlEl);
|
|
89
|
+
storageConfigureChange('grey', value);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/** 色弱模式设置 */
|
|
93
|
+
const weekChange = (value): void => {
|
|
94
|
+
const htmlEl = document.querySelector('html');
|
|
95
|
+
toggleClass(settings.weakVal, 'html-weakness', htmlEl);
|
|
96
|
+
storageConfigureChange('weak', value);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
/** 隐藏标签页设置 */
|
|
100
|
+
const tagsChange = () => {
|
|
101
|
+
const showVal = settings.tabsVal;
|
|
102
|
+
storageConfigureChange('hideTabs', showVal);
|
|
103
|
+
emitter.emit('tagViewsChange', showVal as unknown as string);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
/** 标签页持久化设置 */
|
|
107
|
+
const multiTagsCacheChange = () => {
|
|
108
|
+
const multiTagsCache = settings.multiTagsCache;
|
|
109
|
+
storageConfigureChange('multiTagsCache', multiTagsCache);
|
|
110
|
+
useMultiTagsStoreHook().multiTagsCacheChange(multiTagsCache);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
function onChange(value) {
|
|
114
|
+
markValue.value = value;
|
|
115
|
+
storageConfigureChange('showModel', value);
|
|
116
|
+
emitter.emit('tagViewsShowModel', value);
|
|
117
|
+
}
|
|
118
|
+
/** 主题切换 */
|
|
119
|
+
function onThemeChange(theme) {
|
|
120
|
+
// dataTheme.value = !dataTheme.value;
|
|
121
|
+
// dataThemeChange();
|
|
122
|
+
theme === 1 && theme !== 2 ? (dataTheme.value = true) : (dataTheme.value = false);
|
|
123
|
+
overallStyle.value = themeOptions.value[theme].theme;
|
|
124
|
+
dataThemeChange(overallStyle.value);
|
|
125
|
+
theme === 2 && watchSystemThemeChange();
|
|
126
|
+
}
|
|
127
|
+
/** 侧边栏Logo */
|
|
128
|
+
function logoChange() {
|
|
129
|
+
unref(logoVal) ? storageConfigureChange('showLogo', true) : storageConfigureChange('showLogo', false);
|
|
130
|
+
emitter.emit('logoChange', unref(logoVal));
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function setFalse(Doms): any {
|
|
134
|
+
Doms.forEach(v => {
|
|
135
|
+
toggleClass(false, 'is-select', unref(v));
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** 主题色 激活选择项 */
|
|
140
|
+
const getThemeColor = computed(() => {
|
|
141
|
+
return current => {
|
|
142
|
+
if (current === layoutTheme.value.theme && layoutTheme.value.theme !== 'light') {
|
|
143
|
+
return '#fff';
|
|
144
|
+
} else if (current === layoutTheme.value.theme && layoutTheme.value.theme === 'light') {
|
|
145
|
+
return '#1d2b45';
|
|
146
|
+
} else {
|
|
147
|
+
return 'transparent';
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
const themeOptions = computed<IThemeOption[]>(() => {
|
|
153
|
+
return [
|
|
154
|
+
{
|
|
155
|
+
label: t('message.udp.light'),
|
|
156
|
+
icon: dayIcon,
|
|
157
|
+
theme: 'light',
|
|
158
|
+
value: 0,
|
|
159
|
+
iconAttrs: { fill: isDark.value ? '#fff' : '#000' }
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
label: t('message.udp.dark'),
|
|
163
|
+
icon: darkIcon,
|
|
164
|
+
theme: 'dark',
|
|
165
|
+
value: 1,
|
|
166
|
+
iconAttrs: { fill: isDark.value ? '#fff' : '#000' }
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
label: '自动',
|
|
170
|
+
icon: systemIcon,
|
|
171
|
+
theme: 'system',
|
|
172
|
+
value: 2,
|
|
173
|
+
iconAttrs: { fill: isDark.value ? '#fff' : '#000' }
|
|
174
|
+
}
|
|
175
|
+
];
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
const markOptions = [
|
|
179
|
+
{ label: t('message.udp.smart'), value: 'smart' },
|
|
180
|
+
{ label: t('message.udp.card'), value: 'card' },
|
|
181
|
+
{ label: '丝滑', value: 'chrome' }
|
|
182
|
+
];
|
|
183
|
+
|
|
184
|
+
/** 设置导航模式 */
|
|
185
|
+
function setLayoutModel(layout: string) {
|
|
186
|
+
layoutTheme.value.layout = layout;
|
|
187
|
+
window.document.body.setAttribute('layout', layout);
|
|
188
|
+
window.document.body.setAttribute('layoutType', window.top === window.self ? 'normal' : 'iframe');
|
|
189
|
+
$storage.layout = {
|
|
190
|
+
layout,
|
|
191
|
+
theme: layoutTheme.value.theme,
|
|
192
|
+
darkMode: $storage.layout?.darkMode,
|
|
193
|
+
sidebarStatus: $storage.layout?.sidebarStatus,
|
|
194
|
+
epThemeColor: $storage.layout?.epThemeColor,
|
|
195
|
+
themeColor: layoutTheme.value.theme,
|
|
196
|
+
overallStyle: $storage.layout?.overallStyle
|
|
197
|
+
};
|
|
198
|
+
useAppStoreHook().setLayout(layout);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
watch($storage, ({ layout }) => {
|
|
202
|
+
switch (layout['layout']) {
|
|
203
|
+
case 'vertical':
|
|
204
|
+
toggleClass(true, 'is-select', unref(verticalRef));
|
|
205
|
+
useDebounce(setFalse([horizontalRef]), 50);
|
|
206
|
+
useDebounce(setFalse([mixRef]), 50);
|
|
207
|
+
break;
|
|
208
|
+
case 'horizontal':
|
|
209
|
+
toggleClass(true, 'is-select', unref(horizontalRef));
|
|
210
|
+
useDebounce(setFalse([verticalRef]), 50);
|
|
211
|
+
useDebounce(setFalse([mixRef]), 50);
|
|
212
|
+
break;
|
|
213
|
+
case 'mix':
|
|
214
|
+
toggleClass(true, 'is-select', unref(mixRef));
|
|
215
|
+
useDebounce(setFalse([verticalRef]), 50);
|
|
216
|
+
useDebounce(setFalse([horizontalRef]), 50);
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
const mediaQueryList = window.matchMedia('(prefers-color-scheme: dark)');
|
|
222
|
+
|
|
223
|
+
/** 根据操作系统主题设置平台整体风格 */
|
|
224
|
+
function updateTheme() {
|
|
225
|
+
if (overallStyle.value !== 'system') return;
|
|
226
|
+
if (mediaQueryList.matches) {
|
|
227
|
+
dataTheme.value = true;
|
|
228
|
+
} else {
|
|
229
|
+
dataTheme.value = false;
|
|
230
|
+
}
|
|
231
|
+
dataThemeChange(overallStyle.value);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function removeMatchMedia() {
|
|
235
|
+
mediaQueryList.removeEventListener('change', updateTheme);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** 监听操作系统主题改变 */
|
|
239
|
+
function watchSystemThemeChange() {
|
|
240
|
+
updateTheme();
|
|
241
|
+
removeMatchMedia();
|
|
242
|
+
mediaQueryList.addEventListener('change', updateTheme);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
onBeforeMount(() => {
|
|
246
|
+
/* 初始化项目配置 */
|
|
247
|
+
nextTick(() => {
|
|
248
|
+
watchSystemThemeChange();
|
|
249
|
+
settings.greyVal && document.querySelector('html')?.classList.add('html-grey');
|
|
250
|
+
settings.weakVal && document.querySelector('html')?.classList.add('html-weakness');
|
|
251
|
+
settings.tabsVal && tagsChange();
|
|
252
|
+
});
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
onUnmounted(() => removeMatchMedia);
|
|
256
|
+
</script>
|
|
257
|
+
<script lang="ts">
|
|
258
|
+
export default { name: 'SettingPanel' };
|
|
259
|
+
</script>
|
|
260
|
+
<template>
|
|
261
|
+
<panel>
|
|
262
|
+
<div class="p-6">
|
|
263
|
+
<p class="mb-3 text-sm font-medium dark:text-white">{{ $t('message.udp.pageStyle') }}</p>
|
|
264
|
+
<el-segmented
|
|
265
|
+
:model-value="overallStyle === 'system' ? 2 : dataTheme ? 1 : 0"
|
|
266
|
+
:options="themeOptions"
|
|
267
|
+
@change="onThemeChange"
|
|
268
|
+
>
|
|
269
|
+
<template #default="{ item }">
|
|
270
|
+
<div class="flex items-center gap-2 p-2">
|
|
271
|
+
<component :is="useRenderIcon(item.icon)" />
|
|
272
|
+
<span class="pl-1">{{ item.label }}</span>
|
|
273
|
+
</div>
|
|
274
|
+
</template>
|
|
275
|
+
</el-segmented>
|
|
276
|
+
|
|
277
|
+
<p class="mt-5 mb-3 text-sm font-medium dark:text-white">{{ $t('message.udp.theme') }}</p>
|
|
278
|
+
<ul class="theme-color">
|
|
279
|
+
<li
|
|
280
|
+
v-for="(item, index) in themeColors"
|
|
281
|
+
v-show="showThemeColors(item.themeColor)"
|
|
282
|
+
:key="index"
|
|
283
|
+
:style="getThemeColorStyle(item.color)"
|
|
284
|
+
@click="setLayoutThemeColor(item.themeColor)"
|
|
285
|
+
>
|
|
286
|
+
<el-icon style="margin: 0.1em 0.1em 0 0" :size="17" :color="getThemeColor(item.themeColor)">
|
|
287
|
+
<IconifyIconOffline icon="ri:check-line" />
|
|
288
|
+
</el-icon>
|
|
289
|
+
</li>
|
|
290
|
+
</ul>
|
|
291
|
+
|
|
292
|
+
<p class="mt-5 mb-3 text-sm font-medium dark:text-white">{{ $t('message.udp.navigationMode') }}</p>
|
|
293
|
+
<ul class="udp-theme">
|
|
294
|
+
<li
|
|
295
|
+
ref="verticalRef"
|
|
296
|
+
v-tippy="{
|
|
297
|
+
content: '左侧菜单',
|
|
298
|
+
zIndex: 41000
|
|
299
|
+
}"
|
|
300
|
+
:class="layoutTheme.layout === 'vertical' ? 'is-select' : ''"
|
|
301
|
+
@click="setLayoutModel('vertical')"
|
|
302
|
+
>
|
|
303
|
+
<div />
|
|
304
|
+
<div />
|
|
305
|
+
</li>
|
|
306
|
+
<li
|
|
307
|
+
v-if="device !== 'mobile'"
|
|
308
|
+
ref="horizontalRef"
|
|
309
|
+
v-tippy="{
|
|
310
|
+
content: '顶部菜单',
|
|
311
|
+
zIndex: 41000
|
|
312
|
+
}"
|
|
313
|
+
:class="layoutTheme.layout === 'horizontal' ? 'is-select' : ''"
|
|
314
|
+
@click="setLayoutModel('horizontal')"
|
|
315
|
+
>
|
|
316
|
+
<div />
|
|
317
|
+
<div />
|
|
318
|
+
</li>
|
|
319
|
+
<li
|
|
320
|
+
v-if="device !== 'mobile'"
|
|
321
|
+
ref="mixRef"
|
|
322
|
+
v-tippy="{
|
|
323
|
+
content: '混合菜单',
|
|
324
|
+
zIndex: 41000
|
|
325
|
+
}"
|
|
326
|
+
:class="layoutTheme.layout === 'mix' ? 'is-select' : ''"
|
|
327
|
+
@click="setLayoutModel('mix')"
|
|
328
|
+
>
|
|
329
|
+
<div />
|
|
330
|
+
<div />
|
|
331
|
+
</li>
|
|
332
|
+
</ul>
|
|
333
|
+
|
|
334
|
+
<p class="mt-5 mb-3 text-base font-medium dark:text-white">{{ $t('message.udp.tagStyle') }}</p>
|
|
335
|
+
<el-segmented :model-value="markValue" :options="markOptions" @change="onChange" />
|
|
336
|
+
|
|
337
|
+
<p class="mt-5 mb-1 text-base font-medium dark:text-white">界面显示</p>
|
|
338
|
+
<ul class="setting">
|
|
339
|
+
<li>
|
|
340
|
+
<span class="dark:text-white">灰色模式</span>
|
|
341
|
+
<el-switch
|
|
342
|
+
v-model="settings.greyVal"
|
|
343
|
+
inline-prompt
|
|
344
|
+
active-text="开"
|
|
345
|
+
inactive-text="关"
|
|
346
|
+
@change="greyChange"
|
|
347
|
+
/>
|
|
348
|
+
</li>
|
|
349
|
+
<li>
|
|
350
|
+
<span class="dark:text-white">色弱模式</span>
|
|
351
|
+
<el-switch
|
|
352
|
+
v-model="settings.weakVal"
|
|
353
|
+
inline-prompt
|
|
354
|
+
active-text="开"
|
|
355
|
+
inactive-text="关"
|
|
356
|
+
@change="weekChange"
|
|
357
|
+
/>
|
|
358
|
+
</li>
|
|
359
|
+
<li>
|
|
360
|
+
<span class="dark:text-white">隐藏标签页</span>
|
|
361
|
+
<el-switch
|
|
362
|
+
v-model="settings.tabsVal"
|
|
363
|
+
inline-prompt
|
|
364
|
+
active-text="开"
|
|
365
|
+
inactive-text="关"
|
|
366
|
+
@change="tagsChange"
|
|
367
|
+
/>
|
|
368
|
+
</li>
|
|
369
|
+
<li>
|
|
370
|
+
<span class="dark:text-white">Logo</span>
|
|
371
|
+
<el-switch
|
|
372
|
+
v-model="logoVal"
|
|
373
|
+
inline-prompt
|
|
374
|
+
:active-value="true"
|
|
375
|
+
:inactive-value="false"
|
|
376
|
+
active-text="开"
|
|
377
|
+
inactive-text="关"
|
|
378
|
+
@change="logoChange"
|
|
379
|
+
/>
|
|
380
|
+
</li>
|
|
381
|
+
<li>
|
|
382
|
+
<span class="dark:text-white">页签持久化</span>
|
|
383
|
+
<el-switch
|
|
384
|
+
v-model="settings.multiTagsCache"
|
|
385
|
+
inline-prompt
|
|
386
|
+
active-text="开"
|
|
387
|
+
inactive-text="关"
|
|
388
|
+
@change="multiTagsCacheChange"
|
|
389
|
+
/>
|
|
390
|
+
</li>
|
|
391
|
+
</ul>
|
|
392
|
+
</div>
|
|
393
|
+
</panel>
|
|
394
|
+
</template>
|
|
395
|
+
|
|
396
|
+
<style lang="scss" scoped>
|
|
397
|
+
::v-deep(.el-divider__text) {
|
|
398
|
+
font-size: 16px;
|
|
399
|
+
font-weight: 700;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
::v-deep(.el-switch__core) {
|
|
403
|
+
--el-switch-off-color: var(--udp-switch-off-color);
|
|
404
|
+
|
|
405
|
+
min-width: 36px;
|
|
406
|
+
height: 18px;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
::v-deep(.el-switch__core .el-switch__action) {
|
|
410
|
+
height: 14px;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
.theme-color {
|
|
414
|
+
height: 20px;
|
|
415
|
+
|
|
416
|
+
li {
|
|
417
|
+
float: left;
|
|
418
|
+
height: 20px;
|
|
419
|
+
margin-right: 8px;
|
|
420
|
+
cursor: pointer;
|
|
421
|
+
border-radius: 4px;
|
|
422
|
+
|
|
423
|
+
&:nth-child(2) {
|
|
424
|
+
border: 1px solid #ddd;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
.udp-theme {
|
|
430
|
+
display: flex;
|
|
431
|
+
gap: 12px;
|
|
432
|
+
|
|
433
|
+
li {
|
|
434
|
+
position: relative;
|
|
435
|
+
width: 46px;
|
|
436
|
+
height: 36px;
|
|
437
|
+
overflow: hidden;
|
|
438
|
+
cursor: pointer;
|
|
439
|
+
background: #f0f2f5;
|
|
440
|
+
border-radius: 4px;
|
|
441
|
+
box-shadow: 0 1px 2.5px 0 rgb(0 0 0 / 18%);
|
|
442
|
+
|
|
443
|
+
&:nth-child(1) {
|
|
444
|
+
div {
|
|
445
|
+
&:nth-child(1) {
|
|
446
|
+
width: 30%;
|
|
447
|
+
height: 100%;
|
|
448
|
+
background: #1b2a47;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
&:nth-child(2) {
|
|
452
|
+
position: absolute;
|
|
453
|
+
top: 0;
|
|
454
|
+
right: 0;
|
|
455
|
+
width: 70%;
|
|
456
|
+
height: 30%;
|
|
457
|
+
background: #fff;
|
|
458
|
+
box-shadow: 0 0 1px #888;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
&:nth-child(2) {
|
|
464
|
+
div {
|
|
465
|
+
&:nth-child(1) {
|
|
466
|
+
width: 100%;
|
|
467
|
+
height: 30%;
|
|
468
|
+
background: #1b2a47;
|
|
469
|
+
box-shadow: 0 0 1px #888;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
&:nth-child(3) {
|
|
475
|
+
div {
|
|
476
|
+
&:nth-child(1) {
|
|
477
|
+
width: 100%;
|
|
478
|
+
height: 30%;
|
|
479
|
+
background: #1b2a47;
|
|
480
|
+
box-shadow: 0 0 1px #888;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
&:nth-child(2) {
|
|
484
|
+
position: absolute;
|
|
485
|
+
bottom: 0;
|
|
486
|
+
left: 0;
|
|
487
|
+
width: 30%;
|
|
488
|
+
height: 70%;
|
|
489
|
+
background: #fff;
|
|
490
|
+
box-shadow: 0 0 1px #888;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
.is-select {
|
|
498
|
+
border: 2px solid var(--el-color-primary);
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.setting {
|
|
502
|
+
li {
|
|
503
|
+
display: flex;
|
|
504
|
+
align-items: center;
|
|
505
|
+
justify-content: space-between;
|
|
506
|
+
padding: 4px 0;
|
|
507
|
+
font-size: 14px;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
</style>
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: wei.li
|
|
3
|
+
* @Date: 2021-11-17 16:02:30
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2025-04-16 16:17:07
|
|
6
|
+
* @Description: 面包屑
|
|
7
|
+
-->
|
|
8
|
+
<script setup lang="ts">
|
|
9
|
+
import { ref, watch, toRaw, onMounted } from 'vue';
|
|
10
|
+
import { isEqual, isArray } from 'xe-utils';
|
|
11
|
+
import { transformI18n } from '../../../plugins/i18n';
|
|
12
|
+
import { getParentPaths, findRouteByPath } from '../../../router/utils';
|
|
13
|
+
import { useMultiTagsStoreHook } from '../../../store/modules/multiTags';
|
|
14
|
+
import { useRoute, useRouter, RouteLocationMatched } from 'vue-router';
|
|
15
|
+
|
|
16
|
+
const route = useRoute();
|
|
17
|
+
const levelList = ref([]);
|
|
18
|
+
const router = useRouter();
|
|
19
|
+
const routes: any = router.options.routes;
|
|
20
|
+
const multiTags: any = useMultiTagsStoreHook().multiTags;
|
|
21
|
+
|
|
22
|
+
const isDashboard = (route: RouteLocationMatched): boolean | string => {
|
|
23
|
+
const name = route && (route.name as string);
|
|
24
|
+
if (!name) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
return name.trim().toLocaleLowerCase() === 'welcome'.toLocaleLowerCase();
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const getBreadcrumb = (): void => {
|
|
31
|
+
// 当前路由信息
|
|
32
|
+
let currentRoute;
|
|
33
|
+
if (Object.keys(route.query).length > 0) {
|
|
34
|
+
multiTags.forEach(item => {
|
|
35
|
+
if (isEqual(route.query, item?.query)) {
|
|
36
|
+
currentRoute = toRaw(item);
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
} else if (Object.keys(route.params).length > 0) {
|
|
40
|
+
multiTags.forEach(item => {
|
|
41
|
+
if (isEqual(route.params, item?.params)) {
|
|
42
|
+
currentRoute = toRaw(item);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
} else {
|
|
46
|
+
currentRoute = findRouteByPath(router.currentRoute.value.path, routes);
|
|
47
|
+
}
|
|
48
|
+
// 当前路由的父级路径组成的数组
|
|
49
|
+
const parentRoutes = getParentPaths(router.currentRoute.value.name as string, routes, 'name');
|
|
50
|
+
// 存放组成面包屑的数组
|
|
51
|
+
let matched = [];
|
|
52
|
+
// 获取每个父级路径对应的路由信息
|
|
53
|
+
isArray(parentRoutes) &&
|
|
54
|
+
parentRoutes?.forEach(path => {
|
|
55
|
+
if (path !== '/') {
|
|
56
|
+
matched.push(findRouteByPath(path, routes));
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
if (currentRoute?.path !== '/welcome') matched.push(currentRoute);
|
|
61
|
+
|
|
62
|
+
if (!isDashboard(matched[0])) {
|
|
63
|
+
matched = [
|
|
64
|
+
{
|
|
65
|
+
path: '/welcome',
|
|
66
|
+
parentPath: '/',
|
|
67
|
+
meta: { title: 'message.udp.home', i18n: true }
|
|
68
|
+
} as unknown as RouteLocationMatched
|
|
69
|
+
].concat(matched);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
matched.forEach((item, index) => {
|
|
73
|
+
if (currentRoute?.query || currentRoute?.params) return;
|
|
74
|
+
if (item?.children) {
|
|
75
|
+
item.children.forEach(v => {
|
|
76
|
+
if (v?.meta?.title === item?.meta?.title) {
|
|
77
|
+
matched.splice(index, 1);
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
levelList.value = matched.filter(item => item?.meta && item?.meta.title !== false);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
const handleLink = item => {
|
|
87
|
+
const { redirect, name, path, query, params } = item;
|
|
88
|
+
|
|
89
|
+
if (redirect) {
|
|
90
|
+
router.push(redirect as any);
|
|
91
|
+
} else {
|
|
92
|
+
if (name) {
|
|
93
|
+
if (query) {
|
|
94
|
+
router.push({ name, query });
|
|
95
|
+
} else if (params) {
|
|
96
|
+
router.push({ name, params });
|
|
97
|
+
} else {
|
|
98
|
+
router.push({ name });
|
|
99
|
+
}
|
|
100
|
+
} else {
|
|
101
|
+
router.push({ path });
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
onMounted(() => {
|
|
107
|
+
getBreadcrumb();
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
watch(
|
|
111
|
+
() => route.path,
|
|
112
|
+
() => {
|
|
113
|
+
getBreadcrumb();
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
deep: true
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
</script>
|
|
120
|
+
|
|
121
|
+
<template>
|
|
122
|
+
<el-breadcrumb class="!leading-[50px] select-none" separator="/">
|
|
123
|
+
<transition-group name="breadcrumb">
|
|
124
|
+
<el-breadcrumb-item v-for="item in levelList" :key="item.path" class="inline! items-stretch!">
|
|
125
|
+
<a @click.prevent="handleLink(item)">
|
|
126
|
+
{{ transformI18n(item.meta.title) }}
|
|
127
|
+
</a>
|
|
128
|
+
</el-breadcrumb-item>
|
|
129
|
+
</transition-group>
|
|
130
|
+
</el-breadcrumb>
|
|
131
|
+
</template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: levi7754 levi7754@163.com
|
|
3
|
+
* @Date: 2023-10-10 11:04:33
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2023-10-10 11:57:17
|
|
6
|
+
* @FilePath: /sitzone-mes/src/layout/components/lay-sidebar/extraIcon.vue
|
|
7
|
+
* @Description:
|
|
8
|
+
-->
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import { toRaw } from 'vue';
|
|
11
|
+
import { useRenderIcon } from '../../../components/ReIcon/src/hooks';
|
|
12
|
+
|
|
13
|
+
const props = defineProps({
|
|
14
|
+
extraIcon: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ''
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template>
|
|
22
|
+
<div v-if="props.extraIcon" class="flex justify-center items-center">
|
|
23
|
+
<component :is="useRenderIcon(toRaw(props.extraIcon))" class="w-[30px] h-[30px]" />
|
|
24
|
+
</div>
|
|
25
|
+
</template>
|