imatrix-ui 0.2.6-up → 0.2.7-up
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/README.md +7 -7
- package/index.html +13 -13
- package/lib/super-ui.css +1 -1
- package/lib/super-ui.js +2724 -1932
- package/lib/super-ui.umd.cjs +24 -24
- package/package.json +1 -1
- package/packages/IntervalSelection/index.js +6 -6
- package/packages/IntervalSelection/src/quarterScope.vue +405 -405
- package/packages/IntervalSelection/src/sectionDate.vue +475 -475
- package/packages/breadcrumb/index.js +6 -6
- package/packages/breadcrumb/src/breadcrumb.vue +81 -81
- package/packages/department-tree/index.js +6 -6
- package/packages/department-tree/src/department-tree.vue +113 -113
- package/packages/department-tree-inline/index.js +6 -6
- package/packages/department-tree-inline/src/department-multi-tree-inline.vue +472 -472
- package/packages/department-tree-inline/src/department-single-tree-inline.vue +340 -340
- package/packages/department-tree-inline/src/department-tree-inline.vue +86 -86
- package/packages/department-tree-inline/src/department-tree-service.js +344 -344
- package/packages/department-tree-inline/src/search-result.vue +235 -235
- package/packages/department-user-tree/index.js +6 -6
- package/packages/department-user-tree/src/department-user-multiple-tree.vue +129 -129
- package/packages/department-user-tree/src/department-user-single-tree.vue +94 -94
- package/packages/department-user-tree/src/department-user-tree.vue +114 -114
- package/packages/department-user-tree-inline/index.js +9 -9
- package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +731 -731
- package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +334 -334
- package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +87 -87
- package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +309 -309
- package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +179 -179
- package/packages/department-user-tree-inline/src/search-result.vue +273 -273
- package/packages/directives/prevent-reclick.js +22 -22
- package/packages/dynamic-source-select/index.js +6 -6
- package/packages/dynamic-source-select/src/dynamic-source-select-service.js +106 -106
- package/packages/dynamic-source-select/src/dynamic-source-select.vue +675 -675
- package/packages/dynamic-source-select/src/events.js +78 -78
- package/packages/fs-preview/index.js +6 -6
- package/packages/fs-preview/src/fs-preview.vue +287 -287
- package/packages/fs-upload/index.js +6 -6
- package/packages/fs-upload/src/fs-upload-multi.vue +443 -443
- package/packages/fs-upload/src/fs-upload-single.vue +353 -353
- package/packages/fs-upload/src/fs-upload.vue +191 -191
- package/packages/fs-upload/src/see-big-picture.vue +67 -67
- package/packages/fs-upload-list/index.js +6 -6
- package/packages/fs-upload-list/src/fs-upload-list.vue +372 -372
- package/packages/hamburger/index.js +6 -6
- package/packages/hamburger/src/hamburger.vue +40 -40
- package/packages/index.js +123 -123
- package/packages/multipart-upload/index.js +6 -6
- package/packages/multipart-upload/src/index.vue +66 -66
- package/packages/multipart-upload/src/multipart-upload-form.vue +377 -377
- package/packages/multipart-upload/src/multipart-upload-list.vue +517 -517
- package/packages/organization-input/index.js +6 -6
- package/packages/organization-input/src/organization-input.vue +583 -583
- package/packages/plugins/export-data-new.js +623 -623
- package/packages/plugins/export-data.js +431 -431
- package/packages/plugins/index.js +15 -15
- package/packages/plugins/public-method.js +47 -47
- package/packages/remove-department/index.js +6 -6
- package/packages/remove-department/src/remove-department.vue +200 -200
- package/packages/remove-department/src/remove-dept-service.js +31 -31
- package/packages/remove-user/index.js +6 -6
- package/packages/remove-user/src/remove-user-service.js +31 -31
- package/packages/remove-user/src/remove-user.vue +226 -226
- package/packages/remove-workgroup/index.js +6 -6
- package/packages/remove-workgroup/src/remove-workgroup-service.js +31 -31
- package/packages/remove-workgroup/src/remove-workgroup.vue +183 -183
- package/packages/rich-editor/index.js +7 -7
- package/packages/rich-editor/index.vue +297 -297
- package/packages/rich-editor/langs/zh-Hans.js +438 -438
- package/packages/rich-editor/viewer.vue +105 -105
- package/packages/scan-code-input/index.js +6 -6
- package/packages/scan-code-input/src/events.js +34 -34
- package/packages/scan-code-input/src/scan-code-input-colse.vue +140 -140
- package/packages/scan-code-input/src/scan-code-input.vue +132 -132
- package/packages/secret-info/index.js +7 -7
- package/packages/secret-info/index.vue +100 -100
- package/packages/super-grid/index.js +7 -7
- package/packages/super-grid/src/apis.js +1092 -1092
- package/packages/super-grid/src/columns-config.vue +427 -427
- package/packages/super-grid/src/custom-formatter.js +394 -394
- package/packages/super-grid/src/eventBus.js +2 -2
- package/packages/super-grid/src/events.js +56 -56
- package/packages/super-grid/src/formValidatorUtil.js +300 -300
- package/packages/super-grid/src/formatter.js +196 -196
- package/packages/super-grid/src/group-column.vue +99 -99
- package/packages/super-grid/src/header-context-menu.vue +82 -82
- package/packages/super-grid/src/index-column.vue +69 -69
- package/packages/super-grid/src/public-methods.js +30 -30
- package/packages/super-grid/src/row-operation.vue +193 -193
- package/packages/super-grid/src/search-button.vue +74 -74
- package/packages/super-grid/src/search-condition-input.vue +73 -73
- package/packages/super-grid/src/search-condition-list.vue +68 -68
- package/packages/super-grid/src/search-form-advancedQuery.vue +819 -819
- package/packages/super-grid/src/search-form-dialog.vue +77 -77
- package/packages/super-grid/src/search-form-item.vue +495 -495
- package/packages/super-grid/src/search-form-number.vue +111 -111
- package/packages/super-grid/src/search-form-ordinarySearch.vue +239 -239
- package/packages/super-grid/src/search-form.vue +762 -762
- package/packages/super-grid/src/search-methods.js +592 -592
- package/packages/super-grid/src/selection-column.vue +46 -46
- package/packages/super-grid/src/store.js +3 -3
- package/packages/super-grid/src/super-grid-service.js +728 -728
- package/packages/super-grid/src/super-grid.vue +3011 -3011
- package/packages/super-grid/src/utils.js +880 -880
- package/packages/super-grid/src/view-image-dialog.vue +176 -176
- package/packages/super-nine-grid/index.js +7 -7
- package/packages/super-nine-grid/src/apis.js +108 -108
- package/packages/super-nine-grid/src/custom-formatter.js +73 -73
- package/packages/super-nine-grid/src/formatter.js +134 -134
- package/packages/super-nine-grid/src/search-form-number.vue +35 -35
- package/packages/super-nine-grid/src/search-form.vue +700 -700
- package/packages/super-nine-grid/src/search-methods.js +151 -151
- package/packages/super-nine-grid/src/store.js +3 -3
- package/packages/super-nine-grid/src/super-grid-service.js +107 -107
- package/packages/svg-icon/index.js +6 -6
- package/packages/svg-icon/src/svg-icon.vue +43 -43
- package/packages/utils/date-util.js +292 -292
- package/packages/utils/dom.js +227 -227
- package/packages/utils/gogocodeTransfer.js +59 -59
- package/packages/utils/memory-cache-utils.js +117 -117
- package/packages/utils/utils.js +180 -180
- package/packages/utils/value-set.js +97 -97
- package/packages/valid-code/index.js +7 -7
- package/packages/valid-code/src/valid-code.vue +104 -104
- package/packages/workflow-button/index.js +6 -6
- package/packages/workflow-button/src/workflow-button.vue +550 -550
- package/packages/workflow-history-list/index.js +6 -6
- package/packages/workflow-history-list/src/api.js +7 -7
- package/packages/workflow-history-list/src/workflow-history-list.vue +291 -291
- package/packages/workgroup-tree/index.js +6 -6
- package/packages/workgroup-tree/src/workgroup-tree.vue +86 -86
- package/packages/workgroup-tree-inline/index.js +6 -6
- package/packages/workgroup-tree-inline/src/search-result.vue +222 -222
- package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +516 -516
- package/packages/workgroup-tree-inline/src/workgroup-tree-service.js +93 -93
- package/packages/workgroup-user-tree/index.js +6 -6
- package/packages/workgroup-user-tree/src/workgroup-user-tree.vue +103 -103
- package/packages/workgroup-user-tree-inline/index.js +9 -9
- package/packages/workgroup-user-tree-inline/src/search-result.vue +266 -266
- package/packages/workgroup-user-tree-inline/src/workgroup-tree-inline-service.js +239 -239
- package/packages/workgroup-user-tree-inline/src/workgroup-user-tree-inline.vue +657 -657
- package/packages/year-range-picker/index.js +6 -6
- package/packages/year-range-picker/src/year-range-picker.vue +53 -53
- package/src/api/sso-service.js +172 -172
- package/src/api/tab.js +36 -36
- package/src/api/user-service.js +11 -11
- package/src/directives/permission/index.js +13 -13
- package/src/directives/permission/permission.js +20 -20
- package/src/i18n/langs/cn.js +259 -259
- package/src/i18n/langs/en.js +269 -269
- package/src/index.js +93 -93
- package/src/plugins.js +18 -18
- package/src/router/index.js +8 -26
- package/src/store/getters.js +15 -15
- package/src/store/index.js +19 -19
- package/src/store/modules/app.js +54 -54
- package/src/store/modules/tab-content.js +36 -36
- package/src/store/modules/user.js +285 -285
- package/src/utils/auth.js +61 -61
- package/src/utils/calculator/calculator-factory-wf.js +558 -558
- package/src/utils/calculator/calculator-factory.js +145 -145
- package/src/utils/calculator/calculator-util.js +166 -166
- package/src/utils/eventBus.js +2 -2
- package/src/utils/iconUtils.js +28 -28
- package/src/utils/index.js +102 -102
- package/src/utils/jump-page-utils.js +824 -824
- package/src/utils/menu.js +19 -19
- package/src/utils/permission.js +31 -31
- package/src/utils/permissionAuth.js +96 -96
- package/src/utils/range-selector.js +188 -188
- package/src/utils/request.js +269 -269
- package/src/utils/restful-interface-utils.js +57 -57
- package/src/utils/util.js +703 -703
- package/src/utils/validate.js +34 -34
- package/src/utils/watermark.js +108 -108
- package/src/utils/workflow-util.js +93 -93
- package/src/views/404.vue +248 -248
- package/src/views/dsc-component/Sidebar/Item.vue +84 -84
- package/src/views/dsc-component/Sidebar/Link.vue +38 -38
- package/src/views/dsc-component/Sidebar/SidebarItem.vue +198 -198
- package/src/views/dsc-component/Sidebar/index.vue +229 -229
- package/src/views/dsc-component/tabs/tab-content.vue +203 -203
- package/src/views/error-page/401.vue +106 -106
- package/src/views/error-page/404.vue +248 -248
- package/src/views/layout/EmptyLayout.vue +3 -3
- package/src/views/layout/Layout.vue +81 -81
- package/src/views/layout/NewLayout.vue +18 -18
- package/src/views/layout/components/AppMain.vue +39 -39
- package/src/views/layout/components/Breadcrumb/index.vue +158 -158
- package/src/views/layout/components/Menubar/Item.vue +79 -79
- package/src/views/layout/components/Menubar/Link.vue +38 -38
- package/src/views/layout/components/Menubar/index.vue +210 -210
- package/src/views/layout/components/Sidebar/Item.vue +53 -53
- package/src/views/layout/components/Sidebar/Link.vue +38 -38
- package/src/views/layout/components/Sidebar/index.vue +141 -141
- package/src/views/layout/components/iframe-page.vue +38 -38
- package/src/views/layout/components/index.js +4 -4
- package/src/views/layout/components/tabs/tab-content.vue +207 -207
- package/src/views/layout/mixin/ResizeHandler.js +41 -41
- package/src/views/layout/tab-content-iframe-index.vue +38 -38
- package/src/views/layout/tab-content-index.vue +93 -93
- package/src/views/login/authredirect.vue +10 -10
- package/src/views/login/index.vue +296 -296
- package/src/views/login/update-password.vue +243 -243
- package/src/views/redirect/index.vue +14 -14
- package/src/views/wf-history/tache-subprocess-history.vue +45 -45
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="app-wrapper">
|
|
3
|
-
<div class="tab-main-container">
|
|
4
|
-
<!-- <tab-content/> -->
|
|
5
|
-
<app-main />
|
|
6
|
-
</div>
|
|
7
|
-
</div>
|
|
8
|
-
</template>
|
|
9
|
-
|
|
10
|
-
<script>
|
|
11
|
-
import { AppMain } from './components'
|
|
12
|
-
export default {
|
|
13
|
-
name: '
|
|
14
|
-
components: {
|
|
15
|
-
AppMain,
|
|
16
|
-
},
|
|
17
|
-
}
|
|
18
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div class="app-wrapper">
|
|
3
|
+
<div class="tab-main-container">
|
|
4
|
+
<!-- <tab-content/> -->
|
|
5
|
+
<app-main />
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
|
|
10
|
+
<script>
|
|
11
|
+
import { AppMain } from './components'
|
|
12
|
+
export default {
|
|
13
|
+
name: 'NewLayout',
|
|
14
|
+
components: {
|
|
15
|
+
AppMain,
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section class="app-main">
|
|
3
|
-
<router-view v-slot="{ Component }">
|
|
4
|
-
<transition name="fade-transform" mode="out-in">
|
|
5
|
-
<component :is="Component"></component>
|
|
6
|
-
</transition>
|
|
7
|
-
</router-view>
|
|
8
|
-
</section>
|
|
9
|
-
</template>
|
|
10
|
-
|
|
11
|
-
<script>
|
|
12
|
-
export default {
|
|
13
|
-
name: 'AppMain',
|
|
14
|
-
computed: {
|
|
15
|
-
// key() {
|
|
16
|
-
// return this.$route.name !== undefined ? this.$route.name + +new Date() : this.$route + +new Date()
|
|
17
|
-
// }
|
|
18
|
-
|
|
19
|
-
// 解决的问题如下:
|
|
20
|
-
// 改变路由参数(page?pageCode=xx)去获取对应数据,然后渲染到页面(用的是同一套组件),
|
|
21
|
-
// 问题来了:当切换菜单时,数据并没有更新,后来看了Vue-router官网,
|
|
22
|
-
// 有这么一句话:提醒一下,当使用路由参数时,例如从 /user/foo 导航到 user/bar,原来的组件实例会被复用。
|
|
23
|
-
// 因为两个路由都渲染同个组件,比起销毁再创建,复用则显得更加高效。不过,这也意味着组件的生命周期钩子不会再被调用
|
|
24
|
-
key() {
|
|
25
|
-
return this.$route.name !== undefined
|
|
26
|
-
? this.$route.name + +new Date()
|
|
27
|
-
: this.$route + +new Date()
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
}
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
|
-
<style scoped>
|
|
34
|
-
.app-main {
|
|
35
|
-
height: calc(100vh - 10px);
|
|
36
|
-
position: relative;
|
|
37
|
-
overflow: hidden;
|
|
38
|
-
}
|
|
39
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<section class="app-main">
|
|
3
|
+
<router-view v-slot="{ Component }">
|
|
4
|
+
<transition name="fade-transform" mode="out-in">
|
|
5
|
+
<component :is="Component"></component>
|
|
6
|
+
</transition>
|
|
7
|
+
</router-view>
|
|
8
|
+
</section>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: 'AppMain',
|
|
14
|
+
computed: {
|
|
15
|
+
// key() {
|
|
16
|
+
// return this.$route.name !== undefined ? this.$route.name + +new Date() : this.$route + +new Date()
|
|
17
|
+
// }
|
|
18
|
+
|
|
19
|
+
// 解决的问题如下:
|
|
20
|
+
// 改变路由参数(page?pageCode=xx)去获取对应数据,然后渲染到页面(用的是同一套组件),
|
|
21
|
+
// 问题来了:当切换菜单时,数据并没有更新,后来看了Vue-router官网,
|
|
22
|
+
// 有这么一句话:提醒一下,当使用路由参数时,例如从 /user/foo 导航到 user/bar,原来的组件实例会被复用。
|
|
23
|
+
// 因为两个路由都渲染同个组件,比起销毁再创建,复用则显得更加高效。不过,这也意味着组件的生命周期钩子不会再被调用
|
|
24
|
+
key() {
|
|
25
|
+
return this.$route.name !== undefined
|
|
26
|
+
? this.$route.name + +new Date()
|
|
27
|
+
: this.$route + +new Date()
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<style scoped>
|
|
34
|
+
.app-main {
|
|
35
|
+
height: calc(100vh - 10px);
|
|
36
|
+
position: relative;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
}
|
|
39
|
+
</style>
|
|
@@ -1,158 +1,158 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<el-breadcrumb class="app-breadcrumb" separator=">">
|
|
3
|
-
<transition-group name="breadcrumb" tag="span">
|
|
4
|
-
<el-breadcrumb-item
|
|
5
|
-
v-for="(item, index) in levelListWithTitle"
|
|
6
|
-
:key="item.path + '-' + index"
|
|
7
|
-
>
|
|
8
|
-
<span class="no-redirect">
|
|
9
|
-
{{ $t(item.meta.title) }}
|
|
10
|
-
</span>
|
|
11
|
-
</el-breadcrumb-item>
|
|
12
|
-
</transition-group>
|
|
13
|
-
</el-breadcrumb>
|
|
14
|
-
</template>
|
|
15
|
-
|
|
16
|
-
<script>
|
|
17
|
-
import {getLanguageWithLocale} from '../../../../utils/util'
|
|
18
|
-
import * as pathToRegexp from 'path-to-regexp'
|
|
19
|
-
import Cookies from 'js-cookie'
|
|
20
|
-
|
|
21
|
-
export default {
|
|
22
|
-
name: 'Breadcrumb',
|
|
23
|
-
data() {
|
|
24
|
-
return {
|
|
25
|
-
levelList: null,
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
computed: {
|
|
29
|
-
levelListWithTitle() {
|
|
30
|
-
return this.levelList.filter(
|
|
31
|
-
(item) => item.meta.title !== undefined && item.meta.title !== null
|
|
32
|
-
)
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
watch: {
|
|
36
|
-
$route() {
|
|
37
|
-
this.getBreadcrumb()
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
created() {
|
|
41
|
-
this.getBreadcrumb()
|
|
42
|
-
},
|
|
43
|
-
methods: {
|
|
44
|
-
getBreadcrumb() {
|
|
45
|
-
const {params} = this.$route
|
|
46
|
-
console.log('this.$route.matched==', this.$route.matched)
|
|
47
|
-
let matched = this.$route.matched.filter((item) => {
|
|
48
|
-
if (item.name) {
|
|
49
|
-
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
|
|
50
|
-
var toPath = pathToRegexp.compile(item.path)
|
|
51
|
-
item.path = toPath(params)
|
|
52
|
-
return true
|
|
53
|
-
}
|
|
54
|
-
})
|
|
55
|
-
// const first = matched[0]
|
|
56
|
-
if (matched) {
|
|
57
|
-
let systemName
|
|
58
|
-
const language = getLanguageWithLocale()
|
|
59
|
-
const systemNameObj =
|
|
60
|
-
window.$vueApp.config.globalProperties.systemNameObj
|
|
61
|
-
if (systemNameObj) {
|
|
62
|
-
systemName = systemNameObj[language]
|
|
63
|
-
}
|
|
64
|
-
matched = [
|
|
65
|
-
{path: '/', redirect: 'noredirect', meta: {title: systemName}},
|
|
66
|
-
].concat(matched)
|
|
67
|
-
const cookieMenu = Cookies.get('selectMenu')
|
|
68
|
-
const leftSelectMenu =
|
|
69
|
-
window.$vueApp.config.globalProperties._selectMenu
|
|
70
|
-
let selectMenu
|
|
71
|
-
if (leftSelectMenu) {
|
|
72
|
-
selectMenu = leftSelectMenu
|
|
73
|
-
} else if (cookieMenu) {
|
|
74
|
-
selectMenu = cookieMenu
|
|
75
|
-
}
|
|
76
|
-
if (selectMenu) {
|
|
77
|
-
// 解决表单页面无法获得列表路由
|
|
78
|
-
const path = selectMenu.substring(0, selectMenu.indexOf('~~'))
|
|
79
|
-
const title = selectMenu.substring(selectMenu.indexOf('~~') + 2)
|
|
80
|
-
if (matched && matched.length > 0) {
|
|
81
|
-
const lastRoute = matched[matched.length - 1]
|
|
82
|
-
if (this.isShouldConcatLastMenu(title, path, lastRoute)) {
|
|
83
|
-
matched.push({path: path, meta: {title: title}})
|
|
84
|
-
}
|
|
85
|
-
} else {
|
|
86
|
-
matched.push({path: path, meta: {title: title}})
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
this.levelList = matched
|
|
91
|
-
},
|
|
92
|
-
// 新建页面时会把列表页面路由刷没,导致菜单路径缺少最后一层菜单问题
|
|
93
|
-
isShouldConcatLastMenu(title, path, lastRoute) {
|
|
94
|
-
if (
|
|
95
|
-
this.isTitleNotEqual(title, lastRoute) &&
|
|
96
|
-
this.isPathNotEqual(path, lastRoute)
|
|
97
|
-
) {
|
|
98
|
-
// title和path都不同,表示是不同的页面,需要添加到matched集合中
|
|
99
|
-
return true
|
|
100
|
-
}
|
|
101
|
-
return false
|
|
102
|
-
},
|
|
103
|
-
/**
|
|
104
|
-
* Vue.prototype._selectMenu的菜单标题是否与最后的路由页面标题一致
|
|
105
|
-
* 返回true表示不一样,返回false表示一样
|
|
106
|
-
*/
|
|
107
|
-
isTitleNotEqual(title, lastRoute) {
|
|
108
|
-
if (
|
|
109
|
-
title &&
|
|
110
|
-
lastRoute.meta &&
|
|
111
|
-
title !== lastRoute.meta.title &&
|
|
112
|
-
title !== this.$t(lastRoute.meta.title)
|
|
113
|
-
) {
|
|
114
|
-
// 表示title不一样,当前可能是在表单页面,需要添加到matched集合中
|
|
115
|
-
return true
|
|
116
|
-
}
|
|
117
|
-
return false
|
|
118
|
-
},
|
|
119
|
-
/**
|
|
120
|
-
* Vue.prototype._selectMenu的菜单的访问路径是否与最后的路由页面的路径一致
|
|
121
|
-
* 返回true表示不一样,返回false表示一样
|
|
122
|
-
*/
|
|
123
|
-
isPathNotEqual(path, lastRoute) {
|
|
124
|
-
if (path && lastRoute.path && path !== lastRoute.path) {
|
|
125
|
-
// 表示path不一样,当前可能是在表单页面,需要添加到matched集合中
|
|
126
|
-
return true
|
|
127
|
-
}
|
|
128
|
-
return false
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
}
|
|
132
|
-
</script>
|
|
133
|
-
|
|
134
|
-
<style lang="scss" rel="stylesheet/scss" scoped>
|
|
135
|
-
.app-breadcrumb.el-breadcrumb {
|
|
136
|
-
background-color: #eee;
|
|
137
|
-
width: 100%;
|
|
138
|
-
border: 1px solid #ccc;
|
|
139
|
-
bottom: 2px;
|
|
140
|
-
margin-left: 2px;
|
|
141
|
-
display: inline-block;
|
|
142
|
-
font-size: 14px;
|
|
143
|
-
line-height: 40px;
|
|
144
|
-
|
|
145
|
-
.no-redirect {
|
|
146
|
-
color: #333;
|
|
147
|
-
cursor: text;
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
.el-breadcrumb__item {
|
|
151
|
-
padding-left: 5px;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.el-breadcrumb__separator {
|
|
155
|
-
margin: 0 5px;
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
</style>
|
|
1
|
+
<template>
|
|
2
|
+
<el-breadcrumb class="app-breadcrumb" separator=">">
|
|
3
|
+
<transition-group name="breadcrumb" tag="span">
|
|
4
|
+
<el-breadcrumb-item
|
|
5
|
+
v-for="(item, index) in levelListWithTitle"
|
|
6
|
+
:key="item.path + '-' + index"
|
|
7
|
+
>
|
|
8
|
+
<span class="no-redirect">
|
|
9
|
+
{{ $t(item.meta.title) }}
|
|
10
|
+
</span>
|
|
11
|
+
</el-breadcrumb-item>
|
|
12
|
+
</transition-group>
|
|
13
|
+
</el-breadcrumb>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
import {getLanguageWithLocale} from '../../../../utils/util'
|
|
18
|
+
import * as pathToRegexp from 'path-to-regexp'
|
|
19
|
+
import Cookies from 'js-cookie'
|
|
20
|
+
|
|
21
|
+
export default {
|
|
22
|
+
name: 'Breadcrumb',
|
|
23
|
+
data() {
|
|
24
|
+
return {
|
|
25
|
+
levelList: null,
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
computed: {
|
|
29
|
+
levelListWithTitle() {
|
|
30
|
+
return this.levelList.filter(
|
|
31
|
+
(item) => item.meta.title !== undefined && item.meta.title !== null
|
|
32
|
+
)
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
watch: {
|
|
36
|
+
$route() {
|
|
37
|
+
this.getBreadcrumb()
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
created() {
|
|
41
|
+
this.getBreadcrumb()
|
|
42
|
+
},
|
|
43
|
+
methods: {
|
|
44
|
+
getBreadcrumb() {
|
|
45
|
+
const {params} = this.$route
|
|
46
|
+
console.log('this.$route.matched==', this.$route.matched)
|
|
47
|
+
let matched = this.$route.matched.filter((item) => {
|
|
48
|
+
if (item.name) {
|
|
49
|
+
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
|
|
50
|
+
var toPath = pathToRegexp.compile(item.path)
|
|
51
|
+
item.path = toPath(params)
|
|
52
|
+
return true
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
// const first = matched[0]
|
|
56
|
+
if (matched) {
|
|
57
|
+
let systemName
|
|
58
|
+
const language = getLanguageWithLocale()
|
|
59
|
+
const systemNameObj =
|
|
60
|
+
window.$vueApp.config.globalProperties.systemNameObj
|
|
61
|
+
if (systemNameObj) {
|
|
62
|
+
systemName = systemNameObj[language]
|
|
63
|
+
}
|
|
64
|
+
matched = [
|
|
65
|
+
{path: '/', redirect: 'noredirect', meta: {title: systemName}},
|
|
66
|
+
].concat(matched)
|
|
67
|
+
const cookieMenu = Cookies.get('selectMenu')
|
|
68
|
+
const leftSelectMenu =
|
|
69
|
+
window.$vueApp.config.globalProperties._selectMenu
|
|
70
|
+
let selectMenu
|
|
71
|
+
if (leftSelectMenu) {
|
|
72
|
+
selectMenu = leftSelectMenu
|
|
73
|
+
} else if (cookieMenu) {
|
|
74
|
+
selectMenu = cookieMenu
|
|
75
|
+
}
|
|
76
|
+
if (selectMenu) {
|
|
77
|
+
// 解决表单页面无法获得列表路由
|
|
78
|
+
const path = selectMenu.substring(0, selectMenu.indexOf('~~'))
|
|
79
|
+
const title = selectMenu.substring(selectMenu.indexOf('~~') + 2)
|
|
80
|
+
if (matched && matched.length > 0) {
|
|
81
|
+
const lastRoute = matched[matched.length - 1]
|
|
82
|
+
if (this.isShouldConcatLastMenu(title, path, lastRoute)) {
|
|
83
|
+
matched.push({path: path, meta: {title: title}})
|
|
84
|
+
}
|
|
85
|
+
} else {
|
|
86
|
+
matched.push({path: path, meta: {title: title}})
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
this.levelList = matched
|
|
91
|
+
},
|
|
92
|
+
// 新建页面时会把列表页面路由刷没,导致菜单路径缺少最后一层菜单问题
|
|
93
|
+
isShouldConcatLastMenu(title, path, lastRoute) {
|
|
94
|
+
if (
|
|
95
|
+
this.isTitleNotEqual(title, lastRoute) &&
|
|
96
|
+
this.isPathNotEqual(path, lastRoute)
|
|
97
|
+
) {
|
|
98
|
+
// title和path都不同,表示是不同的页面,需要添加到matched集合中
|
|
99
|
+
return true
|
|
100
|
+
}
|
|
101
|
+
return false
|
|
102
|
+
},
|
|
103
|
+
/**
|
|
104
|
+
* Vue.prototype._selectMenu的菜单标题是否与最后的路由页面标题一致
|
|
105
|
+
* 返回true表示不一样,返回false表示一样
|
|
106
|
+
*/
|
|
107
|
+
isTitleNotEqual(title, lastRoute) {
|
|
108
|
+
if (
|
|
109
|
+
title &&
|
|
110
|
+
lastRoute.meta &&
|
|
111
|
+
title !== lastRoute.meta.title &&
|
|
112
|
+
title !== this.$t(lastRoute.meta.title)
|
|
113
|
+
) {
|
|
114
|
+
// 表示title不一样,当前可能是在表单页面,需要添加到matched集合中
|
|
115
|
+
return true
|
|
116
|
+
}
|
|
117
|
+
return false
|
|
118
|
+
},
|
|
119
|
+
/**
|
|
120
|
+
* Vue.prototype._selectMenu的菜单的访问路径是否与最后的路由页面的路径一致
|
|
121
|
+
* 返回true表示不一样,返回false表示一样
|
|
122
|
+
*/
|
|
123
|
+
isPathNotEqual(path, lastRoute) {
|
|
124
|
+
if (path && lastRoute.path && path !== lastRoute.path) {
|
|
125
|
+
// 表示path不一样,当前可能是在表单页面,需要添加到matched集合中
|
|
126
|
+
return true
|
|
127
|
+
}
|
|
128
|
+
return false
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
}
|
|
132
|
+
</script>
|
|
133
|
+
|
|
134
|
+
<style lang="scss" rel="stylesheet/scss" scoped>
|
|
135
|
+
.app-breadcrumb.el-breadcrumb {
|
|
136
|
+
background-color: #eee;
|
|
137
|
+
width: 100%;
|
|
138
|
+
border: 1px solid #ccc;
|
|
139
|
+
bottom: 2px;
|
|
140
|
+
margin-left: 2px;
|
|
141
|
+
display: inline-block;
|
|
142
|
+
font-size: 14px;
|
|
143
|
+
line-height: 40px;
|
|
144
|
+
|
|
145
|
+
.no-redirect {
|
|
146
|
+
color: #333;
|
|
147
|
+
cursor: text;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.el-breadcrumb__item {
|
|
151
|
+
padding-left: 5px;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.el-breadcrumb__separator {
|
|
155
|
+
margin: 0 5px;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
</style>
|
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
<script lang="jsx">
|
|
2
|
-
import { defineComponent, h } from 'vue'
|
|
3
|
-
import SvgIcon from '../../../svg-icon/src/svg-icon.vue'
|
|
4
|
-
export default defineComponent ({
|
|
5
|
-
name: 'MenuItem',
|
|
6
|
-
functional: true,
|
|
7
|
-
props: {
|
|
8
|
-
icon: {
|
|
9
|
-
type: String,
|
|
10
|
-
default: ''
|
|
11
|
-
},
|
|
12
|
-
title: {
|
|
13
|
-
type: String,
|
|
14
|
-
default: ''
|
|
15
|
-
},
|
|
16
|
-
hasChildren: {
|
|
17
|
-
type: Boolean,
|
|
18
|
-
default: false
|
|
19
|
-
},
|
|
20
|
-
isRoot: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: false
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
render(props) {
|
|
26
|
-
const { title, hasChildren, isRoot } = props
|
|
27
|
-
let icon = props.icon
|
|
28
|
-
const vnodes = []
|
|
29
|
-
if (icon) {
|
|
30
|
-
if (icon.indexOf('fa-') === 0) {
|
|
31
|
-
// 表示以“fa-”开头,使用font-awesome中的图标
|
|
32
|
-
icon = 'fa ' + icon
|
|
33
|
-
vnodes.push(h('div', {style:{display:'inline-block',overflow:'hidden'}},[h('i',{class:icon})]))
|
|
34
|
-
// vnodes.push(<div style='display: inline-block;overflow:hidden;'><i class={icon}/></div>)
|
|
35
|
-
} else if (icon.indexOf('svg-') === 0) {
|
|
36
|
-
icon = icon.substring(icon.indexOf('svg-') + 4)
|
|
37
|
-
vnodes.push(h('div', {style:{display:'inline-block',overflow:'hidden'}},[h(SvgIcon,{'icon-class':icon})]))
|
|
38
|
-
// vnodes.push(<div style='display: inline-block;overflow:hidden;'><svg-icon icon-class={icon}/></div>)
|
|
39
|
-
} else {
|
|
40
|
-
icon += ' svg-icon'
|
|
41
|
-
vnodes.push(h('div', {style:{display:'inline-block',overflow:'hidden'}},[h('i',{class:icon})]))
|
|
42
|
-
// vnodes.push(<div style='display: inline-block;overflow:hidden;'><i class={icon} /></div>)
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
if (title) {
|
|
47
|
-
let width = '130px'
|
|
48
|
-
if (hasChildren) {
|
|
49
|
-
// 当是父菜单时,为了使后面的三角能显示出来,需要将宽度设小点
|
|
50
|
-
width = '100px'
|
|
51
|
-
}
|
|
52
|
-
if (isRoot) {
|
|
53
|
-
// 是否是根目录,没有子菜单时
|
|
54
|
-
vnodes.push(h('div', {style:{display:'inline-block'}},
|
|
55
|
-
[h('div',{
|
|
56
|
-
title:title,
|
|
57
|
-
style:{display:'inline-block',width:width,overflow:'hidden','text-overflow':'ellipsis','white-space':'nowrap','word-break':'keep-all'}
|
|
58
|
-
}, title)])
|
|
59
|
-
)
|
|
60
|
-
// vnodes.push(<div style='display: inline-block'>
|
|
61
|
-
// <div title={title} style={'display: inline-block;width:' + width + ';overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;'}>{(title)}</div>
|
|
62
|
-
// </div>)
|
|
63
|
-
} else {
|
|
64
|
-
// 有子菜单时
|
|
65
|
-
vnodes.push(h('div', {style:{display:'inline-block'}},
|
|
66
|
-
[h('div',{
|
|
67
|
-
title:title,
|
|
68
|
-
style:{display:'inline-block',width:width,overflow:'hidden','text-overflow':'ellipsis','white-space':'nowrap','word-break':'keep-all'}
|
|
69
|
-
}, title)])
|
|
70
|
-
)
|
|
71
|
-
// vnodes.push(<div slot='title' style='display: inline-block'>
|
|
72
|
-
// <div title={title} style={'display: inline-block;width:' + width + ';overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;'}>{(title)}</div>
|
|
73
|
-
// </div>)
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
return vnodes
|
|
77
|
-
}
|
|
78
|
-
})
|
|
79
|
-
</script>
|
|
1
|
+
<script lang="jsx">
|
|
2
|
+
import { defineComponent, h } from 'vue'
|
|
3
|
+
import SvgIcon from '../../../svg-icon/src/svg-icon.vue'
|
|
4
|
+
export default defineComponent ({
|
|
5
|
+
name: 'MenuItem',
|
|
6
|
+
functional: true,
|
|
7
|
+
props: {
|
|
8
|
+
icon: {
|
|
9
|
+
type: String,
|
|
10
|
+
default: ''
|
|
11
|
+
},
|
|
12
|
+
title: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ''
|
|
15
|
+
},
|
|
16
|
+
hasChildren: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: false
|
|
19
|
+
},
|
|
20
|
+
isRoot: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
render(props) {
|
|
26
|
+
const { title, hasChildren, isRoot } = props
|
|
27
|
+
let icon = props.icon
|
|
28
|
+
const vnodes = []
|
|
29
|
+
if (icon) {
|
|
30
|
+
if (icon.indexOf('fa-') === 0) {
|
|
31
|
+
// 表示以“fa-”开头,使用font-awesome中的图标
|
|
32
|
+
icon = 'fa ' + icon
|
|
33
|
+
vnodes.push(h('div', {style:{display:'inline-block',overflow:'hidden'}},[h('i',{class:icon})]))
|
|
34
|
+
// vnodes.push(<div style='display: inline-block;overflow:hidden;'><i class={icon}/></div>)
|
|
35
|
+
} else if (icon.indexOf('svg-') === 0) {
|
|
36
|
+
icon = icon.substring(icon.indexOf('svg-') + 4)
|
|
37
|
+
vnodes.push(h('div', {style:{display:'inline-block',overflow:'hidden'}},[h(SvgIcon,{'icon-class':icon})]))
|
|
38
|
+
// vnodes.push(<div style='display: inline-block;overflow:hidden;'><svg-icon icon-class={icon}/></div>)
|
|
39
|
+
} else {
|
|
40
|
+
icon += ' svg-icon'
|
|
41
|
+
vnodes.push(h('div', {style:{display:'inline-block',overflow:'hidden'}},[h('i',{class:icon})]))
|
|
42
|
+
// vnodes.push(<div style='display: inline-block;overflow:hidden;'><i class={icon} /></div>)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (title) {
|
|
47
|
+
let width = '130px'
|
|
48
|
+
if (hasChildren) {
|
|
49
|
+
// 当是父菜单时,为了使后面的三角能显示出来,需要将宽度设小点
|
|
50
|
+
width = '100px'
|
|
51
|
+
}
|
|
52
|
+
if (isRoot) {
|
|
53
|
+
// 是否是根目录,没有子菜单时
|
|
54
|
+
vnodes.push(h('div', {style:{display:'inline-block'}},
|
|
55
|
+
[h('div',{
|
|
56
|
+
title:title,
|
|
57
|
+
style:{display:'inline-block',width:width,overflow:'hidden','text-overflow':'ellipsis','white-space':'nowrap','word-break':'keep-all'}
|
|
58
|
+
}, title)])
|
|
59
|
+
)
|
|
60
|
+
// vnodes.push(<div style='display: inline-block'>
|
|
61
|
+
// <div title={title} style={'display: inline-block;width:' + width + ';overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;'}>{(title)}</div>
|
|
62
|
+
// </div>)
|
|
63
|
+
} else {
|
|
64
|
+
// 有子菜单时
|
|
65
|
+
vnodes.push(h('div', {style:{display:'inline-block'}},
|
|
66
|
+
[h('div',{
|
|
67
|
+
title:title,
|
|
68
|
+
style:{display:'inline-block',width:width,overflow:'hidden','text-overflow':'ellipsis','white-space':'nowrap','word-break':'keep-all'}
|
|
69
|
+
}, title)])
|
|
70
|
+
)
|
|
71
|
+
// vnodes.push(<div slot='title' style='display: inline-block'>
|
|
72
|
+
// <div title={title} style={'display: inline-block;width:' + width + ';overflow:hidden;text-overflow:ellipsis;white-space:nowrap;word-break:keep-all;'}>{(title)}</div>
|
|
73
|
+
// </div>)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return vnodes
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
</script>
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div>
|
|
3
|
-
<!-- eslint-disable vue/require-component-is-->
|
|
4
|
-
<!-- <a v-if="isExter" :href="to.path" target="_blank" rel="noopener">
|
|
5
|
-
<slot />
|
|
6
|
-
</a> -->
|
|
7
|
-
|
|
8
|
-
<router-link v-if="!isOpenNewTab" :to="to">
|
|
9
|
-
<slot />
|
|
10
|
-
</router-link>
|
|
11
|
-
<div v-else>
|
|
12
|
-
<slot />
|
|
13
|
-
</div>
|
|
14
|
-
</div>
|
|
15
|
-
</template>
|
|
16
|
-
|
|
17
|
-
<script>
|
|
18
|
-
export default {
|
|
19
|
-
props: {
|
|
20
|
-
to: {
|
|
21
|
-
type: Object,
|
|
22
|
-
required: true,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
data() {
|
|
26
|
-
const isExter = this.to.isExternal
|
|
27
|
-
const openWay = this.to.openWay
|
|
28
|
-
let isOpenNewTab = false
|
|
29
|
-
if (openWay && openWay === 'NEW_PAGE_OPEN') {
|
|
30
|
-
isOpenNewTab = true
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
isExter,
|
|
34
|
-
isOpenNewTab,
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
}
|
|
38
|
-
</script>
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<!-- eslint-disable vue/require-component-is-->
|
|
4
|
+
<!-- <a v-if="isExter" :href="to.path" target="_blank" rel="noopener">
|
|
5
|
+
<slot />
|
|
6
|
+
</a> -->
|
|
7
|
+
|
|
8
|
+
<router-link v-if="!isOpenNewTab" :to="to">
|
|
9
|
+
<slot />
|
|
10
|
+
</router-link>
|
|
11
|
+
<div v-else>
|
|
12
|
+
<slot />
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
</template>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
export default {
|
|
19
|
+
props: {
|
|
20
|
+
to: {
|
|
21
|
+
type: Object,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
data() {
|
|
26
|
+
const isExter = this.to.isExternal
|
|
27
|
+
const openWay = this.to.openWay
|
|
28
|
+
let isOpenNewTab = false
|
|
29
|
+
if (openWay && openWay === 'NEW_PAGE_OPEN') {
|
|
30
|
+
isOpenNewTab = true
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
isExter,
|
|
34
|
+
isOpenNewTab,
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
</script>
|