@epxing/business 5.3.0-beta.2 → 5.3.0-beta.4
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/API.md +115 -111
- package/README.md +44 -44
- package/dist/src/base/AiSkillEditor.js +1 -1
- package/dist/src/base/AiSkillEditor.vue.js +2 -0
- package/dist/src/base/AppConfigFormItem.js +1 -3
- package/dist/src/base/AppConfigFormItem.vue.js +210 -85
- package/dist/src/base/CommonFieldList.js +1 -1
- package/dist/src/base/CommonFieldList.vue.js +2 -1
- package/dist/src/base/ConfigModuleIndex.js +38 -1
- package/dist/src/base/ManageAppNav.js +1 -1
- package/dist/src/base/ManageMenu.js +1 -1
- package/dist/src/base/RoleBindTrace.js +253 -0
- package/dist/src/base/RoleGroupManage.js +1037 -0
- package/dist/src/base/ServiceMenu.js +7 -6
- package/dist/src/components/AiList.js +1278 -3
- package/dist/src/components/EntityCheckboxFind.vue.js +14 -10
- package/dist/src/components/EntityRightFormItem.js +1 -5
- package/dist/src/components/EntityRightFormItem.vue.js +3 -1
- package/dist/src/components/EntitySystemEr.js +492 -0
- package/dist/src/components/HallNav.vue.js +7 -36
- package/dist/src/components/IconFontLibrary.js +22 -1
- package/dist/src/components/IconFontList.js +21 -1
- package/dist/src/components/PrintFormList.js +2 -1
- package/dist/src/components/PrintFormList.vue.js +3 -1
- package/dist/src/components/WikiWorkbench.js +153 -129
- package/dist/src/components/authorization/AuthorizationInterface.js +3 -1
- package/dist/src/components/custom-bpmn/PropertiesView.js +1991 -1942
- package/dist/src/components/icon-gallery/IconGallery.js +193 -0
- package/dist/src/components/icon-gallery/mixin.js +150 -0
- package/dist/src/components/wiki-workbench/WikiIntake.js +86 -93
- package/dist/src/components/wiki-workbench/WikiIntake.vue.js +153 -73
- package/dist/src/index.js +26 -20
- package/dist/src/public-components.js +16 -14
- package/dist/src/route-components.js +5 -5
- package/dist/src/system.component.index.js +1 -1
- package/dist/src/system.component.js +8 -3
- package/dist/src/system.component.lazy.js +1 -1
- package/dist/src/views/Add.js +1 -1
- package/dist/src/views/Add.vue.js +8 -3
- package/dist/src/views/AiToolManager.js +792 -317
- package/dist/src/views/App.js +3 -45
- package/dist/src/views/AppRoleSelect.js +3 -230
- package/dist/src/views/Error.js +3 -207
- package/dist/src/views/ExcelDesign.js +326 -316
- package/dist/src/views/JvmMemoryMonitor.js +463 -0
- package/dist/src/views/Module.js +3 -170
- package/dist/src/views/WikiBinding.js +88 -25
- package/dist/style.css +2867 -1487
- package/package.json +12 -6
- package/src/base/AiSkillEditor.vue +2 -0
- package/src/base/AppConfigFormItem.vue +211 -145
- package/src/base/CommonFieldList.vue +9 -6
- package/src/base/ConfigModuleIndex.vue +37 -1
- package/src/base/ManageAppNav.vue +1188 -1188
- package/src/base/ManageMenu.vue +933 -933
- package/src/base/RoleBindTrace.vue +364 -0
- package/src/base/RoleGroupManage.vue +1160 -0
- package/src/base/ServiceMenu.vue +6 -5
- package/src/components/AiList.vue +439 -113
- package/src/components/EntityCheckboxFind.vue +12 -8
- package/src/components/EntityRightFormItem.vue +9 -10
- package/src/components/EntitySystemEr.vue +517 -0
- package/src/components/HallNav.vue +6 -33
- package/src/components/IconFontLibrary.vue +27 -60
- package/src/components/IconFontList.vue +13 -64
- package/src/components/PrintFormList.vue +33 -27
- package/src/components/WikiWorkbench.vue +90 -60
- package/src/components/authorization/AuthorizationInterface.vue +2 -0
- package/src/components/custom-bpmn/CustomPalette.js +1 -1
- package/src/components/custom-bpmn/CustomRenderer.js +1 -1
- package/src/components/custom-bpmn/PropertiesView.vue +35 -4
- package/src/components/custom-bpmn/index.js +1 -1
- package/src/components/icon-gallery/IconGallery.vue +130 -0
- package/src/components/icon-gallery/mixin.jsx +109 -0
- package/src/components/wiki-workbench/WikiIntake.vue +178 -104
- package/src/index.js +24 -20
- package/src/public-components.js +1 -0
- package/src/route-components.js +4 -4
- package/src/system.component.index.js +1 -1
- package/src/views/Add.vue +8 -5
- package/src/views/AiToolManager.vue +326 -4
- package/src/views/App.vue +4 -53
- package/src/views/AppRoleSelect.vue +4 -334
- package/src/views/Error.vue +4 -63
- package/src/views/ExcelDesign.vue +24 -7
- package/src/views/JvmMemoryMonitor.vue +284 -0
- package/src/views/Module.vue +4 -210
- package/src/views/WikiBinding.vue +42 -0
- package/types/app.d.ts +1 -0
- package/types/dept-find.d.ts +1 -1
- package/types/index.d.ts +15 -14
- package/types/popup.d.ts +2 -2
- package/types/route-components.d.ts +1 -1
- package/types/user-find.d.ts +1 -1
- package/dist/assets/role_select-DTqRlFNz.webp +0 -0
- package/dist/src/components/AiList.vue.js +0 -93
- package/dist/src/components/IconFontLibrary.vue.js +0 -67
- package/dist/src/components/IconFontList.vue.js +0 -79
|
@@ -1,1190 +1,1190 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
// @jsx-vue3(T30 JSX 批:Vue3 JSX 语法,@vue/babel-plugin-jsx 编译)
|
|
3
|
-
|
|
4
|
-
// '侧边导航', value: '0' '顶部导航', value: '1'
|
|
5
|
-
// '经典(默认)', value: '1' '左侧', value: '0' '顶部', value: '2'
|
|
6
|
-
import AppNav from '@epxing/components/src/app-nav/AppNav.vue'
|
|
7
|
-
import draggable from '@epxing/core/src/components/draggable'
|
|
8
|
-
export default {
|
|
9
|
-
name: 'epx-manage-app-nav',
|
|
10
|
-
extends: AppNav,
|
|
11
|
-
components: {
|
|
12
|
-
draggable
|
|
13
|
-
},
|
|
14
|
-
computed: {
|
|
15
|
-
currentRoleName () {
|
|
16
|
-
if (this.$route.name === 'manage') return '管理模式'
|
|
17
|
-
const role = this.roleList.find(item => item.ID === this.$currentRoleId)
|
|
18
|
-
if (role) return role['NAME#'] || this.$t(role.NAME)
|
|
19
|
-
return this.$t('set the role')
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
data () {
|
|
23
|
-
return {
|
|
24
|
-
addMenuTypeList: [
|
|
25
|
-
{ label: '列表查询页面', value: 'list', preview: require('@/assets/images/addmenu/list.png') },
|
|
26
|
-
{ label: '数据看板页面', value: 'data', preview: require('@/assets/images/addmenu/data.png') },
|
|
27
|
-
{ label: '空白页面', value: 'blank', preview: require('@/assets/images/addmenu/basepage.png') },
|
|
28
|
-
{ label: '自选模版页面', value: 'choose', preview: require('@/assets/images/addmenu/zxmb.png') },
|
|
29
|
-
{ label: '关联已有页面', value: 'select', preview: require('@/assets/images/addmenu/link.png') },
|
|
30
|
-
{ label: '菜单目录', value: 'dir', preview: require('@/assets/images/addmenu/menu.png') }
|
|
31
|
-
],
|
|
32
|
-
showEditAppDialog: false,
|
|
33
|
-
dialogTitle: '',
|
|
34
|
-
editType: '1',
|
|
35
|
-
inputAppName: '',
|
|
36
|
-
navOptions: [
|
|
37
|
-
{ label: '经典(默认)', value: '1', preview: require('@/assets/images/nav/1.png') },
|
|
38
|
-
{ label: '左侧', value: '0', preview: require('@/assets/images/nav/0.png') },
|
|
39
|
-
{ label: '顶部', value: '2', preview: require('@/assets/images/nav/2.png') },
|
|
40
|
-
{ label: '双列', value: '3', preview: require('@/assets/images/nav/3.svg') }
|
|
41
|
-
],
|
|
42
|
-
dialogWidth: '610',
|
|
43
|
-
navType: '',
|
|
44
|
-
navAppType: '',
|
|
45
|
-
editMenuInfo: {},
|
|
46
|
-
addMenuData: {},
|
|
47
|
-
appAllRoleList: [],
|
|
48
|
-
checkRoleList: []
|
|
49
|
-
// popoverManualVisible: false
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
watch: {
|
|
53
|
-
menu () {
|
|
54
|
-
this.judgeClickMenu()
|
|
55
|
-
this.validateNavWidth()
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
methods: {
|
|
59
|
-
switchRole (role) {
|
|
60
|
-
const { params = {}, query = {} } = this.$route
|
|
61
|
-
if (role === 'app-manage-code') {
|
|
62
|
-
return
|
|
63
|
-
}
|
|
64
|
-
const switchRoleCode = role.CODE + (role.TYPE === 'client' ? '-client' : '')
|
|
65
|
-
// if (switchRoleCode !== params.role) {
|
|
66
|
-
this.$router.replace({
|
|
67
|
-
name: 'app1',
|
|
68
|
-
params: {
|
|
69
|
-
...params,
|
|
70
|
-
role: switchRoleCode
|
|
71
|
-
},
|
|
72
|
-
query
|
|
73
|
-
})
|
|
74
|
-
.then(() => {
|
|
75
|
-
const timer = setTimeout(() => {
|
|
76
|
-
location.reload()
|
|
77
|
-
clearTimeout(timer)
|
|
78
|
-
}, 10)
|
|
79
|
-
})
|
|
80
|
-
// }
|
|
81
|
-
},
|
|
82
|
-
editAppMenu (nav, name, type, width) {
|
|
83
|
-
this.editMenuInfo = { ...nav }
|
|
84
|
-
this.dialogTitle = name
|
|
85
|
-
this.editType = type
|
|
86
|
-
if (name === 'delete-menu') {
|
|
87
|
-
this.removeEntity(nav, type)
|
|
88
|
-
} else {
|
|
89
|
-
if (type === 'menu-rename') {
|
|
90
|
-
this.inputAppName = nav.text
|
|
91
|
-
} else if (type === 'menu-setting') {
|
|
92
|
-
const query = {
|
|
93
|
-
openType: '2',
|
|
94
|
-
pageType: 'DETAIL',
|
|
95
|
-
flag: 'v_service_menu_detail_mobile',
|
|
96
|
-
metaId: 'FM_MODULE',
|
|
97
|
-
title: name,
|
|
98
|
-
id: nav.id,
|
|
99
|
-
callback: this.reloadMenu
|
|
100
|
-
}
|
|
101
|
-
this.$createPage(query)
|
|
102
|
-
return
|
|
103
|
-
} else if (type === 'menu-sq') {
|
|
104
|
-
// const query = {
|
|
105
|
-
// openType: '2',
|
|
106
|
-
// pageType: 'ADD',
|
|
107
|
-
// flag: 'manage-client-system-app-menu-add-role',
|
|
108
|
-
// metaId: 'FM_ROLE_MODULE',
|
|
109
|
-
// title: name,
|
|
110
|
-
// parentId: nav.id
|
|
111
|
-
// }
|
|
112
|
-
// this.$createPage(query)
|
|
113
|
-
// return
|
|
114
|
-
this.checkRoleList = []
|
|
115
|
-
this.showEditAppDialog = true
|
|
116
|
-
this.getSqList()
|
|
117
|
-
return
|
|
118
|
-
}
|
|
119
|
-
this.dialogWidth = width || '610'
|
|
120
|
-
this.showEditAppDialog = true
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
getClientSystemAppRole () {
|
|
124
|
-
const scopeParams = [
|
|
125
|
-
{
|
|
126
|
-
field: 'SYSTEM',
|
|
127
|
-
mode: 'equal',
|
|
128
|
-
values: this.SYSTEM,
|
|
129
|
-
link: 'or'
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
field: 'TYPE',
|
|
133
|
-
mode: 'equal',
|
|
134
|
-
values: 'client'
|
|
135
|
-
}
|
|
136
|
-
]
|
|
137
|
-
const params = {
|
|
138
|
-
entityId: 'FM_ROLE',
|
|
139
|
-
scopeParams: JSON.stringify(scopeParams),
|
|
140
|
-
order_field: 'TYPE',
|
|
141
|
-
order_mode: 'desc'
|
|
142
|
-
}
|
|
143
|
-
this.$http.list(params)
|
|
144
|
-
.then(data => {
|
|
145
|
-
this.appAllRoleList = data.entitys
|
|
146
|
-
})
|
|
147
|
-
},
|
|
148
|
-
getSqList () {
|
|
149
|
-
this.$http.list({
|
|
150
|
-
entityId: 'FM_ROLE_MODULE',
|
|
151
|
-
'scope.MODULE': this.editMenuInfo.id
|
|
152
|
-
})
|
|
153
|
-
.then(data => {
|
|
154
|
-
this.checkRoleList = data.entitys.map(item => item.ROLE)
|
|
155
|
-
})
|
|
156
|
-
},
|
|
157
|
-
addAppMenu (nav, menuTypeItem, name, type, width) {
|
|
158
|
-
this.editMenuInfo = { ...nav }
|
|
159
|
-
this.editType = type
|
|
160
|
-
const defaultValue = {}
|
|
161
|
-
// 这里的add-nav-menu为新增同级菜单
|
|
162
|
-
defaultValue.UP_ID = (type === 'add-nav-menu' || type === 'add-tj') ? nav.parent : nav.id
|
|
163
|
-
// 新增菜单
|
|
164
|
-
const query = {
|
|
165
|
-
flag: 'manage-client-system-app-add-menu',
|
|
166
|
-
metaId: 'FM_MODULE',
|
|
167
|
-
defaultValue,
|
|
168
|
-
title: name,
|
|
169
|
-
serviceId: this.appConfig.ID,
|
|
170
|
-
moduleType: menuTypeItem.value,
|
|
1
|
+
<script>
|
|
2
|
+
// @jsx-vue3(T30 JSX 批:Vue3 JSX 语法,@vue/babel-plugin-jsx 编译)
|
|
3
|
+
|
|
4
|
+
// '侧边导航', value: '0' '顶部导航', value: '1'
|
|
5
|
+
// '经典(默认)', value: '1' '左侧', value: '0' '顶部', value: '2'
|
|
6
|
+
import AppNav from '@epxing/components/src/app-nav/AppNav.vue'
|
|
7
|
+
import draggable from '@epxing/core/src/components/draggable'
|
|
8
|
+
export default {
|
|
9
|
+
name: 'epx-manage-app-nav',
|
|
10
|
+
extends: AppNav,
|
|
11
|
+
components: {
|
|
12
|
+
draggable
|
|
13
|
+
},
|
|
14
|
+
computed: {
|
|
15
|
+
currentRoleName () {
|
|
16
|
+
if (this.$route.name === 'manage') return '管理模式'
|
|
17
|
+
const role = this.roleList.find(item => item.ID === this.$currentRoleId)
|
|
18
|
+
if (role) return role['NAME#'] || this.$t(role.NAME)
|
|
19
|
+
return this.$t('set the role')
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
data () {
|
|
23
|
+
return {
|
|
24
|
+
addMenuTypeList: [
|
|
25
|
+
{ label: '列表查询页面', value: 'list', preview: require('@/assets/images/addmenu/list.png') },
|
|
26
|
+
{ label: '数据看板页面', value: 'data', preview: require('@/assets/images/addmenu/data.png') },
|
|
27
|
+
{ label: '空白页面', value: 'blank', preview: require('@/assets/images/addmenu/basepage.png') },
|
|
28
|
+
{ label: '自选模版页面', value: 'choose', preview: require('@/assets/images/addmenu/zxmb.png') },
|
|
29
|
+
{ label: '关联已有页面', value: 'select', preview: require('@/assets/images/addmenu/link.png') },
|
|
30
|
+
{ label: '菜单目录', value: 'dir', preview: require('@/assets/images/addmenu/menu.png') }
|
|
31
|
+
],
|
|
32
|
+
showEditAppDialog: false,
|
|
33
|
+
dialogTitle: '',
|
|
34
|
+
editType: '1',
|
|
35
|
+
inputAppName: '',
|
|
36
|
+
navOptions: [
|
|
37
|
+
{ label: '经典(默认)', value: '1', preview: require('@/assets/images/nav/1.png') },
|
|
38
|
+
{ label: '左侧', value: '0', preview: require('@/assets/images/nav/0.png') },
|
|
39
|
+
{ label: '顶部', value: '2', preview: require('@/assets/images/nav/2.png') },
|
|
40
|
+
{ label: '双列', value: '3', preview: require('@/assets/images/nav/3.svg') }
|
|
41
|
+
],
|
|
42
|
+
dialogWidth: '610',
|
|
43
|
+
navType: '',
|
|
44
|
+
navAppType: '',
|
|
45
|
+
editMenuInfo: {},
|
|
46
|
+
addMenuData: {},
|
|
47
|
+
appAllRoleList: [],
|
|
48
|
+
checkRoleList: []
|
|
49
|
+
// popoverManualVisible: false
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
watch: {
|
|
53
|
+
menu () {
|
|
54
|
+
this.judgeClickMenu()
|
|
55
|
+
this.validateNavWidth()
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
methods: {
|
|
59
|
+
switchRole (role) {
|
|
60
|
+
const { params = {}, query = {} } = this.$route
|
|
61
|
+
if (role === 'app-manage-code') {
|
|
62
|
+
return
|
|
63
|
+
}
|
|
64
|
+
const switchRoleCode = role.CODE + (role.TYPE === 'client' ? '-client' : '')
|
|
65
|
+
// if (switchRoleCode !== params.role) {
|
|
66
|
+
this.$router.replace({
|
|
67
|
+
name: 'app1',
|
|
68
|
+
params: {
|
|
69
|
+
...params,
|
|
70
|
+
role: switchRoleCode
|
|
71
|
+
},
|
|
72
|
+
query
|
|
73
|
+
})
|
|
74
|
+
.then(() => {
|
|
75
|
+
const timer = setTimeout(() => {
|
|
76
|
+
location.reload()
|
|
77
|
+
clearTimeout(timer)
|
|
78
|
+
}, 10)
|
|
79
|
+
})
|
|
80
|
+
// }
|
|
81
|
+
},
|
|
82
|
+
editAppMenu (nav, name, type, width) {
|
|
83
|
+
this.editMenuInfo = { ...nav }
|
|
84
|
+
this.dialogTitle = name
|
|
85
|
+
this.editType = type
|
|
86
|
+
if (name === 'delete-menu') {
|
|
87
|
+
this.removeEntity(nav, type)
|
|
88
|
+
} else {
|
|
89
|
+
if (type === 'menu-rename') {
|
|
90
|
+
this.inputAppName = nav.text
|
|
91
|
+
} else if (type === 'menu-setting') {
|
|
92
|
+
const query = {
|
|
93
|
+
openType: '2',
|
|
94
|
+
pageType: 'DETAIL',
|
|
95
|
+
flag: 'v_service_menu_detail_mobile',
|
|
96
|
+
metaId: 'FM_MODULE',
|
|
97
|
+
title: name,
|
|
98
|
+
id: nav.id,
|
|
99
|
+
callback: this.reloadMenu
|
|
100
|
+
}
|
|
101
|
+
this.$createPage(query)
|
|
102
|
+
return
|
|
103
|
+
} else if (type === 'menu-sq') {
|
|
104
|
+
// const query = {
|
|
105
|
+
// openType: '2',
|
|
106
|
+
// pageType: 'ADD',
|
|
107
|
+
// flag: 'manage-client-system-app-menu-add-role',
|
|
108
|
+
// metaId: 'FM_ROLE_MODULE',
|
|
109
|
+
// title: name,
|
|
110
|
+
// parentId: nav.id
|
|
111
|
+
// }
|
|
112
|
+
// this.$createPage(query)
|
|
113
|
+
// return
|
|
114
|
+
this.checkRoleList = []
|
|
115
|
+
this.showEditAppDialog = true
|
|
116
|
+
this.getSqList()
|
|
117
|
+
return
|
|
118
|
+
}
|
|
119
|
+
this.dialogWidth = width || '610'
|
|
120
|
+
this.showEditAppDialog = true
|
|
121
|
+
}
|
|
122
|
+
},
|
|
123
|
+
getClientSystemAppRole () {
|
|
124
|
+
const scopeParams = [
|
|
125
|
+
{
|
|
126
|
+
field: 'SYSTEM',
|
|
127
|
+
mode: 'equal',
|
|
128
|
+
values: this.SYSTEM,
|
|
129
|
+
link: 'or'
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
field: 'TYPE',
|
|
133
|
+
mode: 'equal',
|
|
134
|
+
values: 'client'
|
|
135
|
+
}
|
|
136
|
+
]
|
|
137
|
+
const params = {
|
|
138
|
+
entityId: 'FM_ROLE',
|
|
139
|
+
scopeParams: JSON.stringify(scopeParams),
|
|
140
|
+
order_field: 'TYPE',
|
|
141
|
+
order_mode: 'desc'
|
|
142
|
+
}
|
|
143
|
+
this.$http.list(params)
|
|
144
|
+
.then(data => {
|
|
145
|
+
this.appAllRoleList = data.entitys
|
|
146
|
+
})
|
|
147
|
+
},
|
|
148
|
+
getSqList () {
|
|
149
|
+
this.$http.list({
|
|
150
|
+
entityId: 'FM_ROLE_MODULE',
|
|
151
|
+
'scope.MODULE': this.editMenuInfo.id
|
|
152
|
+
})
|
|
153
|
+
.then(data => {
|
|
154
|
+
this.checkRoleList = data.entitys.map(item => item.ROLE)
|
|
155
|
+
})
|
|
156
|
+
},
|
|
157
|
+
addAppMenu (nav, menuTypeItem, name, type, width) {
|
|
158
|
+
this.editMenuInfo = { ...nav }
|
|
159
|
+
this.editType = type
|
|
160
|
+
const defaultValue = {}
|
|
161
|
+
// 这里的add-nav-menu为新增同级菜单
|
|
162
|
+
defaultValue.UP_ID = (type === 'add-nav-menu' || type === 'add-tj') ? nav.parent : nav.id
|
|
163
|
+
// 新增菜单
|
|
164
|
+
const query = {
|
|
165
|
+
flag: 'manage-client-system-app-add-menu',
|
|
166
|
+
metaId: 'FM_MODULE',
|
|
167
|
+
defaultValue,
|
|
168
|
+
title: name,
|
|
169
|
+
serviceId: this.appConfig.ID,
|
|
170
|
+
moduleType: menuTypeItem.value,
|
|
171
171
|
...(menuTypeItem.value === 'data' ? { component: 'dashboard-create', flag: undefined, title: '创建数据看板', dialogWidth: '560px' } : {}),
|
|
172
|
-
openType: '2',
|
|
173
|
-
callback: this.reloadMenu
|
|
174
|
-
}
|
|
175
|
-
this.$createPage(query)
|
|
176
|
-
},
|
|
177
|
-
chooseMenuType (item) {
|
|
178
|
-
this.editType = 'add-nav-menu'
|
|
179
|
-
// 新增菜单
|
|
180
|
-
const query = {
|
|
181
|
-
flag: 'manage-client-system-app-add-menu',
|
|
182
|
-
metaId: 'FM_MODULE',
|
|
183
|
-
serviceId: this.appConfig.ID,
|
|
184
|
-
moduleType: item.value,
|
|
172
|
+
openType: '2',
|
|
173
|
+
callback: this.reloadMenu
|
|
174
|
+
}
|
|
175
|
+
this.$createPage(query)
|
|
176
|
+
},
|
|
177
|
+
chooseMenuType (item) {
|
|
178
|
+
this.editType = 'add-nav-menu'
|
|
179
|
+
// 新增菜单
|
|
180
|
+
const query = {
|
|
181
|
+
flag: 'manage-client-system-app-add-menu',
|
|
182
|
+
metaId: 'FM_MODULE',
|
|
183
|
+
serviceId: this.appConfig.ID,
|
|
184
|
+
moduleType: item.value,
|
|
185
185
|
...(item.value === 'data' ? { component: 'dashboard-create', flag: undefined, title: '创建数据看板', dialogWidth: '560px' } : {}),
|
|
186
|
-
openType: '2',
|
|
187
|
-
callback: this.reloadMenu
|
|
188
|
-
}
|
|
189
|
-
const popover = this.$refs.popover
|
|
190
|
-
if (popover)popover.doClose()
|
|
191
|
-
// this.popoverManualVisible = false
|
|
192
|
-
this.$createPage(query)
|
|
193
|
-
},
|
|
194
|
-
judgeClickMenu () {
|
|
195
|
-
// 一级导航菜单信息后点击查看该新增菜单信息
|
|
196
|
-
if (this.editType === 'add-nav-menu') {
|
|
197
|
-
const nav = this.menu.find(item => item.ID === this.addMenuData.ID)
|
|
198
|
-
if (nav) {
|
|
199
|
-
// this.clickNavMenu(nav)
|
|
200
|
-
this.toPage(nav)
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
reloadMenu (v) {
|
|
205
|
-
// 经典模式新增下级菜单
|
|
206
|
-
if (this.type === '1' && this.editType === 'add-xj') {
|
|
207
|
-
this.toPage(this.editMenuInfo)
|
|
208
|
-
} else {
|
|
209
|
-
// 一级导航菜单信息后点击查看该新增菜单信息
|
|
210
|
-
if (this.editType === 'add-nav-menu') {
|
|
211
|
-
this.addMenuData = v
|
|
212
|
-
}
|
|
213
|
-
this.$emit('updateMenu')
|
|
214
|
-
}
|
|
215
|
-
},
|
|
216
|
-
removeEntity (select, type) {
|
|
217
|
-
this.showPopover = null
|
|
218
|
-
let selectItem = this.clickItem
|
|
219
|
-
if (select && select.id) {
|
|
220
|
-
selectItem = select
|
|
221
|
-
}
|
|
222
|
-
this.expandKeys = []
|
|
223
|
-
if (!selectItem || !selectItem.id) {
|
|
224
|
-
this.$message.error(this.$t('please select a record'))
|
|
225
|
-
return
|
|
226
|
-
}
|
|
227
|
-
// const idArr = [selectItem.id]
|
|
228
|
-
// this.getSubIds(idArr, selectItem.children)
|
|
229
|
-
const params = {
|
|
230
|
-
action: 'removeMulti',
|
|
231
|
-
entityId: 'FM_MODULE',
|
|
232
|
-
ids: selectItem.id
|
|
233
|
-
// ids: idArr.join(',')
|
|
234
|
-
}
|
|
235
|
-
if (type === '1') {
|
|
236
|
-
params.deletePag = '1'
|
|
237
|
-
}
|
|
238
|
-
this.$confirm(this.$t('Confirm the deletion') + '?')
|
|
239
|
-
.then(() => {
|
|
240
|
-
this.$http.$request(params)
|
|
241
|
-
.then(data => {
|
|
242
|
-
this.$message.success(this.$t('deleted successfully'))
|
|
243
|
-
// 删除菜单
|
|
244
|
-
if (!selectItem.parent) {
|
|
245
|
-
const key = 'default-' + selectItem.ID
|
|
246
|
-
this.$store.commit('DESTORY_TAB', key)
|
|
247
|
-
}
|
|
248
|
-
this.reloadMenu()
|
|
249
|
-
})
|
|
250
|
-
})
|
|
251
|
-
},
|
|
252
|
-
getSubIds (idArr = [], data) {
|
|
253
|
-
data.forEach(item => {
|
|
254
|
-
idArr.push(item.id)
|
|
255
|
-
if (item.children) {
|
|
256
|
-
this.getSubIds(idArr, item.children)
|
|
257
|
-
}
|
|
258
|
-
})
|
|
259
|
-
},
|
|
260
|
-
editAppConfig (name, type, width, e) {
|
|
261
|
-
this.dialogTitle = name
|
|
262
|
-
this.editType = type
|
|
263
|
-
if (type === '1') {
|
|
264
|
-
this.inputAppName = this.appConfig.NAME
|
|
265
|
-
} else if (type === '2') {
|
|
266
|
-
const appConfig = this.appConfig.APP_CONFIG ? JSON.parse(this.appConfig.APP_CONFIG) : {}
|
|
267
|
-
this.navAppType = appConfig.navType
|
|
268
|
-
this.navType = appConfig.navType
|
|
269
|
-
} else if (type === '3') {
|
|
270
|
-
const query = {
|
|
271
|
-
flag: 'manage-client-system-app-accredit',
|
|
272
|
-
metaId: 'FM_ROLE',
|
|
273
|
-
systemId: this.SYSTEM,
|
|
274
|
-
serviceId: this.appConfig.ID,
|
|
275
|
-
systemName: this.appConfig['SYSTEM|NAME'],
|
|
276
|
-
appName: this.appConfig.NAME,
|
|
277
|
-
appType: this.appConfig.TYPE
|
|
278
|
-
}
|
|
279
|
-
this.$store.commit('CREATE_TAB', {
|
|
280
|
-
key: 'default-' + this.appConfig.ID,
|
|
281
|
-
moduleId: this.appConfig.ID,
|
|
282
|
-
component: 'module-index-page',
|
|
283
|
-
title: name,
|
|
284
|
-
showBack: true,
|
|
285
|
-
...query
|
|
286
|
-
})
|
|
287
|
-
return
|
|
288
|
-
} else {
|
|
289
|
-
const query = {
|
|
290
|
-
flag: 'manage-client-system-app-detail',
|
|
291
|
-
metaId: 'FM_SERVICE',
|
|
292
|
-
id: this.appConfig.ID
|
|
293
|
-
}
|
|
294
|
-
this.$store.commit('CREATE_TAB', {
|
|
295
|
-
key: 'default-' + new Date().getTime(),
|
|
296
|
-
moduleId: this.appConfig.ID,
|
|
297
|
-
component: 'module-index-page',
|
|
298
|
-
title: name,
|
|
299
|
-
showBack: true,
|
|
300
|
-
...query
|
|
301
|
-
})
|
|
302
|
-
return
|
|
303
|
-
}
|
|
304
|
-
this.dialogWidth = width || '610'
|
|
305
|
-
this.showEditAppDialog = true
|
|
306
|
-
},
|
|
307
|
-
editAppDialog () {
|
|
308
|
-
if (this.editType === 'menu-rename') {
|
|
309
|
-
if (!this.inputAppName) {
|
|
310
|
-
this.$message.error('名称不能为空')
|
|
311
|
-
return
|
|
312
|
-
}
|
|
313
|
-
this.$http.update({
|
|
314
|
-
entityId: 'FM_MODULE',
|
|
315
|
-
'bean.ID': this.editMenuInfo.id,
|
|
316
|
-
'bean.NAME': this.inputAppName
|
|
317
|
-
})
|
|
318
|
-
.then(data => {
|
|
319
|
-
this.$emit('updateMenu')
|
|
320
|
-
this.$message.success('修改成功')
|
|
321
|
-
this.showEditAppDialog = false
|
|
322
|
-
})
|
|
323
|
-
.catch(err => {
|
|
324
|
-
this.$message.error(err.message || '修改失败')
|
|
325
|
-
this.showEditAppDialog = false
|
|
326
|
-
})
|
|
327
|
-
} else if (this.editType === 'menu-sq') {
|
|
328
|
-
// if (this.checkRoleList.length === 0) {
|
|
329
|
-
// this.$message.error('请先选择授权角色')
|
|
330
|
-
// return
|
|
331
|
-
// }
|
|
332
|
-
this.$http.$post({
|
|
333
|
-
action: 'refreshModuleRoles',
|
|
334
|
-
entityId: 'FM_ROLE_MODULE',
|
|
335
|
-
moduleId: this.editMenuInfo.id,
|
|
336
|
-
roleIds: this.checkRoleList.join(',')
|
|
337
|
-
})
|
|
338
|
-
.then(data => {
|
|
339
|
-
this.$message.success('添加成功')
|
|
340
|
-
this.showEditAppDialog = false
|
|
341
|
-
})
|
|
342
|
-
.catch(err => {
|
|
343
|
-
this.$message.error(err.message || '操作失败')
|
|
344
|
-
})
|
|
345
|
-
} else {
|
|
346
|
-
const params = {
|
|
347
|
-
entityId: 'FM_SERVICE',
|
|
348
|
-
'bean.ID': this.appConfig.ID
|
|
349
|
-
}
|
|
350
|
-
if (this.editType === '1') {
|
|
351
|
-
params['bean.NAME'] = this.inputAppName
|
|
352
|
-
if (!this.inputAppName) {
|
|
353
|
-
this.$message.error('名称不能为空')
|
|
354
|
-
return
|
|
355
|
-
}
|
|
356
|
-
} else if (this.editType === '2') {
|
|
357
|
-
if (this.navAppType === this.navType) {
|
|
358
|
-
this.$message.error('您未修改导航模式')
|
|
359
|
-
return
|
|
360
|
-
}
|
|
361
|
-
const appConfig = this.appConfig.APP_CONFIG ? JSON.parse(this.appConfig.APP_CONFIG) : {}
|
|
362
|
-
const obj = { ...appConfig, navType: this.navType }
|
|
363
|
-
params['bean.APP_CONFIG'] = JSON.stringify(obj)
|
|
364
|
-
}
|
|
365
|
-
this.$http.update(params)
|
|
366
|
-
.then(data => {
|
|
367
|
-
if (this.editType === '1') {
|
|
368
|
-
this.appName = ''
|
|
369
|
-
this.$store.dispatch({ type: 'GET_APP_CONFIG', client: this.appConfig['CLIENT|CODE'], system: this.appConfig['SYSTEM|CODE'], app: this.appConfig.CODE })
|
|
370
|
-
} else if (this.editType === '2') {
|
|
371
|
-
window.location.reload()
|
|
372
|
-
}
|
|
373
|
-
this.$message.success('修改成功')
|
|
374
|
-
this.showEditAppDialog = false
|
|
375
|
-
})
|
|
376
|
-
.catch(err => {
|
|
377
|
-
this.$message.error(err.message || '修改失败')
|
|
378
|
-
this.showEditAppDialog = false
|
|
379
|
-
})
|
|
380
|
-
}
|
|
381
|
-
},
|
|
382
|
-
switchNav (option) {
|
|
383
|
-
this.navType = option.value
|
|
384
|
-
},
|
|
385
|
-
renderEditDialog () {
|
|
386
|
-
return (
|
|
387
|
-
<el-dialog
|
|
388
|
-
title={this.dialogTitle}
|
|
389
|
-
modelValue={!!this.showEditAppDialog}
|
|
390
|
-
class="popup-dialog"
|
|
391
|
-
append-to-body={true}
|
|
392
|
-
width={this.dialogWidth + 'px'}
|
|
393
|
-
onClose={() => (this.showEditAppDialog = false)}
|
|
394
|
-
>
|
|
395
|
-
<div class="epx-add-form__check-dialog">
|
|
396
|
-
<div>
|
|
397
|
-
{this.editType === '1' &&
|
|
398
|
-
<div>
|
|
399
|
-
<div style="width:300px;margin:auto;marginBottom:20px">
|
|
400
|
-
<el-input v-model={this.inputAppName} clearable placeholder="请输入要修改的应用名称"></el-input>
|
|
401
|
-
</div>
|
|
402
|
-
</div>
|
|
403
|
-
}
|
|
404
|
-
{this.editType === 'menu-rename' &&
|
|
405
|
-
<div>
|
|
406
|
-
<div style="width:300px;margin:auto;marginBottom:20px">
|
|
407
|
-
<el-input v-model={this.inputAppName} clearable placeholder="请输入要修改的菜单名称"></el-input>
|
|
408
|
-
</div>
|
|
409
|
-
</div>
|
|
410
|
-
}
|
|
411
|
-
{this.editType === '2' &&
|
|
412
|
-
<div class='add-type nav-type'>
|
|
413
|
-
{
|
|
414
|
-
this.navOptions.map(option => (
|
|
415
|
-
<div class={['add-menu-type__item', 'manage-nav-mode-item', 'nav-type__item', { 'is-active': this.navType === option.value }]} key={option.value} onClick={this.switchNav.bind(this, option)}>
|
|
416
|
-
<div class="nav-img">
|
|
417
|
-
<img src={option.preview} />
|
|
418
|
-
</div>
|
|
419
|
-
<p class="add-menu-type-label">{option.label}</p>
|
|
420
|
-
</div>
|
|
421
|
-
))
|
|
422
|
-
}
|
|
423
|
-
</div>
|
|
424
|
-
}
|
|
425
|
-
{this.editType === 'menu-sq' &&
|
|
426
|
-
<div class='role-system__content'>
|
|
427
|
-
<el-checkbox-group v-model={this.checkRoleList}>
|
|
428
|
-
{
|
|
429
|
-
this.appAllRoleList.map(item => (
|
|
430
|
-
<el-checkbox key={item.ID} label={item.ID} value={item.ID}>{item.NAME}
|
|
431
|
-
{item.TYPE === 'client' && <el-tag style="marginLeft:4px" size="small">通用</el-tag>}
|
|
432
|
-
</el-checkbox>
|
|
433
|
-
))
|
|
434
|
-
}
|
|
435
|
-
</el-checkbox-group>
|
|
436
|
-
</div>
|
|
437
|
-
}
|
|
438
|
-
</div>
|
|
439
|
-
<div class="epx-add-form__sign-buttongroup">
|
|
440
|
-
<el-button size="middle" type="primary" onClick={this.editAppDialog}>{this.$t('determine')}</el-button>
|
|
441
|
-
<el-button size="middle" onClick={() => (this.showEditAppDialog = false)}>{this.$t('return')}</el-button>
|
|
442
|
-
</div>
|
|
443
|
-
</div>
|
|
444
|
-
</el-dialog>
|
|
445
|
-
)
|
|
446
|
-
},
|
|
447
|
-
renderLogo () {
|
|
448
|
-
return (
|
|
449
|
-
<div class="epx-app-nav__logo" ref="logo" onClick={this.backIndex}>
|
|
450
|
-
{this.renderEditDialog()}
|
|
451
|
-
{ this.logo && <img class="epx-app-nav__logo-icon" src={this.logo} />}
|
|
452
|
-
<span title={this.appName || this.NAME || this.appConfig.NAME}>{this.appName || this.NAME || this.appConfig.NAME}<span style="marginLeft:6px">{'[管理模式]'}</span></span>
|
|
453
|
-
<el-dropdown
|
|
454
|
-
placement="bottom-start"
|
|
455
|
-
trigger="click"
|
|
456
|
-
v-slots={{
|
|
457
|
-
dropdown: () => (<el-dropdown-menu>
|
|
458
|
-
<el-dropdown-item onClick={this.editAppConfig.bind(this, '重命名', '1')} class="app-config-item"><i class="el-icon-edit"></i>重命名</el-dropdown-item>
|
|
459
|
-
<el-dropdown-item onClick={this.editAppConfig.bind(this, '修改导航模式', '2')} class="app-config-item"><i class="el-icon-receiving"></i>导航模式</el-dropdown-item>
|
|
460
|
-
<el-dropdown-item onClick={this.editAppConfig.bind(this, '应用授权', '3')} class="app-config-item"><i class="el-icon-finished"></i>应用授权</el-dropdown-item>
|
|
461
|
-
<el-dropdown-item onClick={this.editAppConfig.bind(this, '更多设置', '4')} class="app-config-item"><i class="el-icon-setting"></i>更多设置</el-dropdown-item>
|
|
462
|
-
</el-dropdown-menu>)
|
|
463
|
-
}}>
|
|
464
|
-
<div class="app-logo-right" onClick={(e) => { e.stopPropagation() }}>
|
|
465
|
-
<i class="el-icon-caret-bottom"></i>
|
|
466
|
-
</div>
|
|
467
|
-
</el-dropdown>
|
|
468
|
-
</div>
|
|
469
|
-
)
|
|
470
|
-
},
|
|
471
|
-
renderMenuItem (nav, isSub = false) {
|
|
472
|
-
if (this.showAllLevel && nav.children && nav.children.length > 0) {
|
|
473
|
-
return (
|
|
474
|
-
<el-sub-menu class={['epx-app-nav__submenu', 'top-type-nav-menu', 'epx-app-nav__menu-item', { 'epx-app-nav__menu-item--sub': isSub }, { active: this.$tab.key === ('default-' + nav.ID) }]} index={nav.ID} onClick={this.clickNavMenu.bind(this, nav)} v-slots={{
|
|
475
|
-
// JSX 里必须用 v-slots 传具名插槽,v-slot 不生效(内容会被当默认插槽塞错位置)
|
|
476
|
-
title: () => (
|
|
477
|
-
// 原 <template> 允许多根,但箭头函数返回值必须单根 ⇒ 用 Fragment 包住
|
|
478
|
-
// 下面这两个相邻顶层元素(菜单名 + 配置下拉)
|
|
479
|
-
<>
|
|
480
|
-
<span>
|
|
481
|
-
<i class={['fa', nav.FONT_ICON]}></i>
|
|
482
|
-
<span style={{ fontSize: this.navMenuFontSize ? `${this.navMenuFontSize}px` : '' }}>{nav.text}1</span>
|
|
483
|
-
</span>
|
|
484
|
-
<el-dropdown
|
|
485
|
-
placement={nav.parent ? 'right-start' : 'bottom-start'}
|
|
486
|
-
trigger="click"
|
|
487
|
-
v-slots={{
|
|
488
|
-
dropdown: () => (<el-dropdown-menu>
|
|
489
|
-
<el-dropdown-item onClick={this.editAppMenu.bind(this, nav, '菜单-重命名', 'menu-rename')} class="app-config-item" ><i class="el-icon-edit"></i>重命名</el-dropdown-item>
|
|
490
|
-
<el-dropdown-item onClick={this.editAppMenu.bind(this, nav, '菜单-设置', 'menu-setting')}><i class="el-icon-setting"></i>设置</el-dropdown-item>
|
|
491
|
-
<el-popover
|
|
492
|
-
popper-class="manage-menu-popover"
|
|
493
|
-
placement="right-start"
|
|
494
|
-
trigger="hover"
|
|
495
|
-
v-slots={{
|
|
496
|
-
reference: () => (<div class="delete-dropdown-item">
|
|
497
|
-
<div class="app-config-delete-item"><i class="el-icon-delete"></i>删除</div>
|
|
498
|
-
<i class="el-icon-arrow-right"></i>
|
|
499
|
-
</div>)
|
|
500
|
-
}}>
|
|
501
|
-
<div>
|
|
502
|
-
<div class="app-config-item" onClick={this.editAppMenu.bind(this, nav, 'delete-menu', '0')}>删除菜单1</div>
|
|
503
|
-
<div class="app-config-item" onClick={this.editAppMenu.bind(this, nav, 'delete-menu', '1')}>删除菜单及页面</div>
|
|
504
|
-
</div>
|
|
505
|
-
</el-popover>
|
|
506
|
-
<el-dropdown-item onClick={this.editAppMenu.bind(this, nav, '菜单授权', 'menu-sq')} class="app-config-item"><i class="el-icon-finished"></i>菜单授权</el-dropdown-item>
|
|
507
|
-
<el-popover
|
|
508
|
-
popper-class="manage-menu-popover"
|
|
509
|
-
placement="right-start"
|
|
510
|
-
trigger="hover"
|
|
511
|
-
v-slots={{
|
|
512
|
-
reference: () => (<div class="delete-dropdown-item">
|
|
513
|
-
<div class="app-config-delete-item"><i class="el-icon-plus"></i>新增同级菜单</div>
|
|
514
|
-
<i class="el-icon-arrow-right"></i>
|
|
515
|
-
</div>)
|
|
516
|
-
}}>
|
|
517
|
-
<div class="add-menu-container">
|
|
518
|
-
<div>选择新增菜单类型</div>
|
|
519
|
-
<div class="add-type">
|
|
520
|
-
{this.addMenuTypeList.map(item => {
|
|
521
|
-
return (
|
|
522
|
-
<div class="add-menu-type__item" key={item.value} onClick={this.addAppMenu.bind(this, nav, item, '新增同级菜单', 'add-nav-menu')}>
|
|
523
|
-
<div>
|
|
524
|
-
<img src={item.preview} />
|
|
525
|
-
</div>
|
|
526
|
-
<p class="add-menu-type-label">{item.label}</p>
|
|
527
|
-
</div>
|
|
528
|
-
)
|
|
529
|
-
})
|
|
530
|
-
}
|
|
531
|
-
</div>
|
|
532
|
-
</div>
|
|
533
|
-
</el-popover>
|
|
534
|
-
<el-popover
|
|
535
|
-
popper-class="manage-menu-popover"
|
|
536
|
-
placement="right-start"
|
|
537
|
-
trigger="hover"
|
|
538
|
-
v-slots={{
|
|
539
|
-
reference: () => (<div class="delete-dropdown-item">
|
|
540
|
-
<div class="app-config-delete-item"><i class="el-icon-bottom"></i>新增下级菜单</div>
|
|
541
|
-
<i class="el-icon-arrow-right"></i>
|
|
542
|
-
</div>)
|
|
543
|
-
}}>
|
|
544
|
-
<div class="add-menu-container">
|
|
545
|
-
<div>选择新增菜单类型</div>
|
|
546
|
-
<div class="add-type">
|
|
547
|
-
{this.addMenuTypeList.map(item => {
|
|
548
|
-
return (
|
|
549
|
-
<div class="add-menu-type__item" key={item.value} onClick={this.addAppMenu.bind(this, nav, item, '新增下级菜单', 'add-xj')}>
|
|
550
|
-
<div>
|
|
551
|
-
<img src={item.preview} />
|
|
552
|
-
</div>
|
|
553
|
-
<p class="add-menu-type-label">{item.label}</p>
|
|
554
|
-
</div>
|
|
555
|
-
)
|
|
556
|
-
})
|
|
557
|
-
}
|
|
558
|
-
</div>
|
|
559
|
-
</div>
|
|
560
|
-
</el-popover>
|
|
561
|
-
</el-dropdown-menu>)
|
|
562
|
-
}}>
|
|
563
|
-
<span onClick={this.settingAppMenu.bind(this, nav)} class="app-menu-setting has-children-app-menu-setting"><i class="el-icon-s-tools"></i></span>
|
|
564
|
-
</el-dropdown>
|
|
565
|
-
</>
|
|
566
|
-
)
|
|
567
|
-
}}>
|
|
568
|
-
{
|
|
569
|
-
nav.children.map(item => this.renderMenuItem(item, true))
|
|
570
|
-
}
|
|
571
|
-
</el-sub-menu>
|
|
572
|
-
)
|
|
573
|
-
} else {
|
|
574
|
-
return (
|
|
575
|
-
<el-menu-item key={nav.ID} index={nav.ID} class={['epx-app-nav__menu-item', 'top-type-nav-menu', 'top-type-nav-menu-no-children', { 'epx-app-nav__menu-item--sub': isSub }, { active: this.$tab.key === ('default-' + nav.ID) }]} onClick={this.toPage.bind(this, nav)} >
|
|
576
|
-
<span>
|
|
577
|
-
<i class={['fa', nav.FONT_ICON]}></i>
|
|
578
|
-
<span style={this.navMenuFontSize ? { fontSize: this.navMenuFontSize + 'px' } : {}}>{nav.text}</span>
|
|
579
|
-
</span>
|
|
580
|
-
<el-dropdown
|
|
581
|
-
placement={nav.parent ? 'right-start' : 'bottom-start'}
|
|
582
|
-
trigger="click"
|
|
583
|
-
v-slots={{
|
|
584
|
-
dropdown: () => (<el-dropdown-menu>
|
|
585
|
-
<el-dropdown-item onClick={this.editAppMenu.bind(this, nav, '菜单-重命名', 'menu-rename')} class="app-config-item" ><i class="el-icon-edit"></i>重命名</el-dropdown-item>
|
|
586
|
-
<el-dropdown-item onClick={this.editAppMenu.bind(this, nav, '菜单-设置', 'menu-setting')}><i class="el-icon-setting"></i>设置</el-dropdown-item>
|
|
587
|
-
<el-popover
|
|
588
|
-
popper-class="manage-menu-popover"
|
|
589
|
-
placement="right-start"
|
|
590
|
-
trigger="hover"
|
|
591
|
-
v-slots={{
|
|
592
|
-
reference: () => (<div class="delete-dropdown-item">
|
|
593
|
-
<div class="app-config-delete-item"><i class="el-icon-delete"></i>删除</div>
|
|
594
|
-
<i class="el-icon-arrow-right"></i>
|
|
595
|
-
</div>)
|
|
596
|
-
}}>
|
|
597
|
-
<div>
|
|
598
|
-
<div class="app-config-item" onClick={this.editAppMenu.bind(this, nav, 'delete-menu', '0')}>删除菜单</div>
|
|
599
|
-
<div class="app-config-item" onClick={this.editAppMenu.bind(this, nav, 'delete-menu', '1')}>删除菜单及页面</div>
|
|
600
|
-
</div>
|
|
601
|
-
</el-popover>
|
|
602
|
-
<el-dropdown-item onClick={this.editAppMenu.bind(this, nav, '菜单授权', 'menu-sq')} class="app-config-item"><i class="el-icon-finished"></i>菜单授权</el-dropdown-item>
|
|
603
|
-
<el-popover
|
|
604
|
-
popper-class="manage-menu-popover"
|
|
605
|
-
placement="right-start"
|
|
606
|
-
trigger="hover"
|
|
607
|
-
v-slots={{
|
|
608
|
-
reference: () => (<div class="delete-dropdown-item">
|
|
609
|
-
<div class="app-config-delete-item"><i class="el-icon-plus"></i>新增同级菜单</div>
|
|
610
|
-
<i class="el-icon-arrow-right"></i>
|
|
611
|
-
</div>)
|
|
612
|
-
}}>
|
|
613
|
-
<div class="add-menu-container">
|
|
614
|
-
<div>选择新增菜单类型</div>
|
|
615
|
-
<div class="add-type">
|
|
616
|
-
{this.addMenuTypeList.map(item => {
|
|
617
|
-
return (
|
|
618
|
-
<div class="add-menu-type__item" key={item.value} onClick={this.addAppMenu.bind(this, nav, item, '新增同级菜单', 'add-nav-menu')}>
|
|
619
|
-
<div>
|
|
620
|
-
<img src={item.preview} />
|
|
621
|
-
</div>
|
|
622
|
-
<p class="add-menu-type-label">{item.label}</p>
|
|
623
|
-
</div>
|
|
624
|
-
)
|
|
625
|
-
})
|
|
626
|
-
}
|
|
627
|
-
</div>
|
|
628
|
-
</div>
|
|
629
|
-
</el-popover>
|
|
630
|
-
<el-popover
|
|
631
|
-
popper-class="manage-menu-popover"
|
|
632
|
-
placement="right-start"
|
|
633
|
-
trigger="hover"
|
|
634
|
-
v-slots={{
|
|
635
|
-
reference: () => (<div class="delete-dropdown-item">
|
|
636
|
-
<div class="app-config-delete-item"><i class="el-icon-bottom"></i>新增下级菜单</div>
|
|
637
|
-
<i class="el-icon-arrow-right"></i>
|
|
638
|
-
</div>)
|
|
639
|
-
}}>
|
|
640
|
-
<div class="add-menu-container">
|
|
641
|
-
<div>选择新增菜单类型</div>
|
|
642
|
-
<div class="add-type">
|
|
643
|
-
{this.addMenuTypeList.map(item => {
|
|
644
|
-
return (
|
|
645
|
-
<div class="add-menu-type__item" key={item.value} onClick={this.addAppMenu.bind(this, nav, item, '新增下级菜单', 'add-xj')}>
|
|
646
|
-
<div>
|
|
647
|
-
<img src={item.preview} />
|
|
648
|
-
</div>
|
|
649
|
-
<p class="add-menu-type-label">{item.label}</p>
|
|
650
|
-
</div>
|
|
651
|
-
)
|
|
652
|
-
})
|
|
653
|
-
}
|
|
654
|
-
</div>
|
|
655
|
-
</div>
|
|
656
|
-
</el-popover>
|
|
657
|
-
</el-dropdown-menu>)
|
|
658
|
-
}}>
|
|
659
|
-
<span onClick={this.settingAppMenu.bind(this, nav)} class="app-menu-setting"><i class="el-icon-s-tools"></i></span>
|
|
660
|
-
</el-dropdown>
|
|
661
|
-
</el-menu-item>
|
|
662
|
-
)
|
|
663
|
-
}
|
|
664
|
-
},
|
|
665
|
-
validateNavWidth () {
|
|
666
|
-
if (!this.$refs.container) return
|
|
667
|
-
let maxWidth = this.$refs.container.offsetWidth - this.$refs.logo.offsetWidth - this.$refs.rightContainer.offsetWidth - 128
|
|
668
|
-
if (this.tabs.length > 0) {
|
|
669
|
-
maxWidth -= 138
|
|
670
|
-
}
|
|
671
|
-
let foldMenuIndex = 0
|
|
672
|
-
let width = 0
|
|
673
|
-
if (!this.showMenu) return
|
|
674
|
-
for (let i = 0; i < this.showMenu.length; i++) {
|
|
675
|
-
const item = this.showMenu[i]
|
|
676
|
-
const itemWidth = (item.text || '').length * 14 + (item.FONT_ICON ? 20 : 0) + 44 + 12
|
|
677
|
-
if (width + itemWidth > maxWidth) {
|
|
678
|
-
if (width + 100 <= maxWidth) {
|
|
679
|
-
foldMenuIndex = i
|
|
680
|
-
} else {
|
|
681
|
-
foldMenuIndex = i - 1
|
|
682
|
-
}
|
|
683
|
-
break
|
|
684
|
-
}
|
|
685
|
-
width += itemWidth
|
|
686
|
-
}
|
|
687
|
-
if (foldMenuIndex) {
|
|
688
|
-
this.openMenu = this.showMenu.slice(0, foldMenuIndex)
|
|
689
|
-
this.foldMenu = this.showMenu.slice(foldMenuIndex)
|
|
690
|
-
} else {
|
|
691
|
-
this.openMenu = [...this.showMenu]
|
|
692
|
-
this.foldMenu = []
|
|
693
|
-
}
|
|
694
|
-
},
|
|
695
|
-
moveEnd (e) {
|
|
696
|
-
const index = e.newIndex
|
|
697
|
-
const node = this.openMenu[index]
|
|
698
|
-
const parentId = 'root'
|
|
699
|
-
// 获取其父节点的所有子节点orderString
|
|
700
|
-
const str = this.openMenu.reduce((str, item, index) => (str += item.id + ':' + index + ','), '')
|
|
701
|
-
// // this.drag = false
|
|
702
|
-
this.$http.$post({
|
|
703
|
-
action: 'moveTree',
|
|
704
|
-
entityId: 'FM_MODULE',
|
|
705
|
-
orderString: str,
|
|
706
|
-
newParentId: parentId,
|
|
707
|
-
id: node.id,
|
|
708
|
-
selfAttriName: 'ID',
|
|
709
|
-
orderAtrriName: 'ORDER_NUM'
|
|
710
|
-
})
|
|
711
|
-
.then(() => {
|
|
712
|
-
|
|
713
|
-
})
|
|
714
|
-
.catch(err => {
|
|
715
|
-
this.$message.error(err.message || '拖拽排序失败')
|
|
716
|
-
this.reloadMenu()
|
|
717
|
-
})
|
|
718
|
-
},
|
|
719
|
-
renderNav () {
|
|
720
|
-
// menu-trigger="click" 菜单点击 子菜单打开的触发方式(只在 mode 为 horizontal 时有效)
|
|
721
|
-
return (
|
|
722
|
-
<div class="epx-app-nav__home">
|
|
723
|
-
{
|
|
724
|
-
(this.type === '1' || this.type === '2') ? (
|
|
725
|
-
<div class="epx-app-nav__menu-content">
|
|
726
|
-
<el-menu ref="menu" style="display:flex" class="epx-app-nav__menu" mode="horizontal" ellipsis={false}>
|
|
727
|
-
{
|
|
728
|
-
this.showMenu && (
|
|
729
|
-
<draggable
|
|
730
|
-
class="el-menu--horizontal epx-app-nav__menu nav-draggable"
|
|
731
|
-
v-model={this.openMenu}
|
|
732
|
-
group="description"
|
|
733
|
-
ghostClass="ghost"
|
|
734
|
-
animation={300}
|
|
735
|
-
onEnd={this.moveEnd}
|
|
736
|
-
>
|
|
737
|
-
{this.openMenu.map(nav => {
|
|
738
|
-
if (nav.HIDDEN_MENU !== '1') {
|
|
739
|
-
return this.renderMenuItem(nav, false)
|
|
740
|
-
}
|
|
741
|
-
})}
|
|
742
|
-
|
|
743
|
-
</draggable>
|
|
744
|
-
)
|
|
745
|
-
}
|
|
746
|
-
</el-menu>
|
|
747
|
-
{
|
|
748
|
-
this.foldMenu.length > 0 && (
|
|
749
|
-
<el-dropdown class="epx-app-nav__foldmenu" onCommand={this.toPage} trigger="click" v-slots={{
|
|
750
|
-
dropdown: () => (<el-dropdown-menu>
|
|
751
|
-
{
|
|
752
|
-
this.foldMenu.map(menu => (
|
|
753
|
-
<el-dropdown-item key={menu.ID} command={menu} class={{ 'epx-app-nav__foldmenu-item': true, ' more-menu-item': true, 'is-active': this.$tab.key === ('default-' + menu.ID) }}>
|
|
754
|
-
<span>
|
|
755
|
-
<i class={['fa', menu.FONT_ICON]}></i>
|
|
756
|
-
<span>{menu.text}</span>
|
|
757
|
-
</span>
|
|
758
|
-
<el-dropdown
|
|
759
|
-
placement="right-start"
|
|
760
|
-
trigger="click"
|
|
761
|
-
v-slots={{
|
|
762
|
-
dropdown: () => (<el-dropdown-menu>
|
|
763
|
-
<el-dropdown-item onClick={this.editAppMenu.bind(this, menu, '菜单-重命名', 'menu-rename')} class="app-config-item"><i class="el-icon-edit"></i>重命名</el-dropdown-item>
|
|
764
|
-
<el-dropdown-item onClick={this.editAppMenu.bind(this, menu, '菜单-设置', 'menu-setting')}><i class="el-icon-setting"></i>设置</el-dropdown-item>
|
|
765
|
-
<el-popover
|
|
766
|
-
popper-class="manage-menu-popover"
|
|
767
|
-
placement="right-start"
|
|
768
|
-
trigger="hover"
|
|
769
|
-
v-slots={{
|
|
770
|
-
reference: () => (<div class="delete-dropdown-item">
|
|
771
|
-
<div class="app-config-delete-item"><i class="el-icon-delete"></i>删除</div>
|
|
772
|
-
<i class="el-icon-arrow-right"></i>
|
|
773
|
-
</div>)
|
|
774
|
-
}}>
|
|
775
|
-
<div>
|
|
776
|
-
<div class="app-config-item" onClick={this.editAppMenu.bind(this, menu, 'delete-menu', '0')}>删除菜单</div>
|
|
777
|
-
<div class="app-config-item" onClick={this.editAppMenu.bind(this, menu, 'delete-menu', '1')}>删除菜单及页面</div>
|
|
778
|
-
</div>
|
|
779
|
-
</el-popover>
|
|
780
|
-
<el-dropdown-item onClick={this.editAppMenu.bind(this, menu, '菜单授权', 'menu-sq')} class="app-config-item"><i class="el-icon-finished"></i>菜单授权</el-dropdown-item>
|
|
781
|
-
<el-popover
|
|
782
|
-
popper-class="manage-menu-popover"
|
|
783
|
-
placement="right-start"
|
|
784
|
-
trigger="hover"
|
|
785
|
-
v-slots={{
|
|
786
|
-
reference: () => (<div class="delete-dropdown-item">
|
|
787
|
-
<div class="app-config-delete-item"><i class="el-icon-plus"></i>新增同级菜单</div>
|
|
788
|
-
<i class="el-icon-arrow-right"></i>
|
|
789
|
-
</div>)
|
|
790
|
-
}}>
|
|
791
|
-
<div class="add-menu-container">
|
|
792
|
-
<div>选择新增菜单类型</div>
|
|
793
|
-
<div class="add-type">
|
|
794
|
-
{this.addMenuTypeList.map(item => {
|
|
795
|
-
return (
|
|
796
|
-
<div class="add-menu-type__item" key={item.value} onClick={this.addAppMenu.bind(this, menu, item, '新增同级菜单', 'add-nav-menu')}>
|
|
797
|
-
<div>
|
|
798
|
-
<img src={item.preview} />
|
|
799
|
-
</div>
|
|
800
|
-
<p class="add-menu-type-label">{item.label}</p>
|
|
801
|
-
</div>
|
|
802
|
-
)
|
|
803
|
-
})
|
|
804
|
-
}
|
|
805
|
-
</div>
|
|
806
|
-
</div>
|
|
807
|
-
</el-popover>
|
|
808
|
-
<el-popover
|
|
809
|
-
popper-class="manage-menu-popover"
|
|
810
|
-
placement="right-start"
|
|
811
|
-
trigger="hover"
|
|
812
|
-
v-slots={{
|
|
813
|
-
reference: () => (<div class="delete-dropdown-item">
|
|
814
|
-
<div class="app-config-delete-item"><i class="el-icon-bottom"></i>新增下级菜单</div>
|
|
815
|
-
<i class="el-icon-arrow-right"></i>
|
|
816
|
-
</div>)
|
|
817
|
-
}}>
|
|
818
|
-
<div class="add-menu-container">
|
|
819
|
-
<div>选择新增菜单类型</div>
|
|
820
|
-
<div class="add-type">
|
|
821
|
-
{this.addMenuTypeList.map(item => {
|
|
822
|
-
return (
|
|
823
|
-
<div class="add-menu-type__item" key={item.value} onClick={this.addAppMenu.bind(this, menu, item, '新增下级菜单', 'add-xj')}>
|
|
824
|
-
<div>
|
|
825
|
-
<img src={item.preview} />
|
|
826
|
-
</div>
|
|
827
|
-
<p class="add-menu-type-label">{item.label}</p>
|
|
828
|
-
</div>
|
|
829
|
-
)
|
|
830
|
-
})
|
|
831
|
-
}
|
|
832
|
-
</div>
|
|
833
|
-
</div>
|
|
834
|
-
</el-popover>
|
|
835
|
-
</el-dropdown-menu>)
|
|
836
|
-
}}>
|
|
837
|
-
<span onClick={this.settingAppMenu.bind(this, menu)} class="app-menu-setting"><i class="el-icon-s-tools"></i></span>
|
|
838
|
-
</el-dropdown>
|
|
839
|
-
</el-dropdown-item>
|
|
840
|
-
))
|
|
841
|
-
}
|
|
842
|
-
</el-dropdown-menu>)
|
|
843
|
-
}}>
|
|
844
|
-
<span class={{ 'epx-app-nav__foldmenu-text': true, 'is-active': this.activeMenuInMore }} >
|
|
845
|
-
{this.$t('more')}<i class="el-icon-caret-bottom"></i>
|
|
846
|
-
</span>
|
|
847
|
-
</el-dropdown>
|
|
848
|
-
)
|
|
849
|
-
}
|
|
850
|
-
<el-popover
|
|
851
|
-
ref="popover"
|
|
852
|
-
popper-class="manage-menu-popover"
|
|
853
|
-
placement="bottom"
|
|
854
|
-
trigger="click"
|
|
855
|
-
v-slots={{ reference: () => (<span class="app-add-menu"><i class="el-icon-circle-plus-outline"></i></span>) }}>
|
|
856
|
-
<div class="add-menu-container">
|
|
857
|
-
<div>选择新增菜单类型</div>
|
|
858
|
-
<div class="add-type">
|
|
859
|
-
{this.addMenuTypeList.map(item => {
|
|
860
|
-
return (
|
|
861
|
-
<div class="add-menu-type__item" key={item.value} onClick={this.chooseMenuType.bind(this, item)}>
|
|
862
|
-
<div>
|
|
863
|
-
<img src={item.preview} />
|
|
864
|
-
</div>
|
|
865
|
-
<p class="add-menu-type-label">{item.label}</p>
|
|
866
|
-
</div>
|
|
867
|
-
)
|
|
868
|
-
})
|
|
869
|
-
}
|
|
870
|
-
</div>
|
|
871
|
-
</div>
|
|
872
|
-
</el-popover>
|
|
873
|
-
{
|
|
874
|
-
this.tabs.length > 0 && (
|
|
875
|
-
<el-dropdown onCommand={this.selectTab} v-slots={{
|
|
876
|
-
dropdown: () => (<el-dropdown-menu>
|
|
877
|
-
{
|
|
878
|
-
this.tabs.map(tab => (
|
|
879
|
-
<el-dropdown-item key={tab.key} command={tab}>
|
|
880
|
-
{tab.title || tab.menuTitle}
|
|
881
|
-
<i class="epx-app-nav__tabs-delete el-icon-error" onClick={this.tabRemove.bind(this, tab.key)}></i>
|
|
882
|
-
</el-dropdown-item>
|
|
883
|
-
))
|
|
884
|
-
}
|
|
885
|
-
<el-dropdown-item onClick={this.clearTabs}>
|
|
886
|
-
<el-button class="epx-app-nav__tabs-clear" type="primary" link><i class="el-icon-document-delete"></i>{this.$t('empty')}</el-button>
|
|
887
|
-
</el-dropdown-item>
|
|
888
|
-
</el-dropdown-menu>)
|
|
889
|
-
}}>
|
|
890
|
-
<el-button round size="default" class="epx-app-nav__tabs-page">{this.$tab && this.$tab.title}<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
|
891
|
-
</el-dropdown>
|
|
892
|
-
)
|
|
893
|
-
}
|
|
894
|
-
</div>
|
|
895
|
-
) : (
|
|
896
|
-
<div class="epx-app-nav__menu-tabs">
|
|
897
|
-
{
|
|
898
|
-
this.tabs.length > 0 && (
|
|
899
|
-
<div class="epx-app-nav__menu-home">
|
|
900
|
-
<i class="el-icon-s-home" onClick={this.toAppIndex}></i>
|
|
901
|
-
</div>
|
|
902
|
-
)
|
|
903
|
-
}
|
|
904
|
-
<el-tabs class="epx-app-nav__tabs" modelValue={this.$tab.key} onTabClick={this.tabClick} closable onTabRemove={this.tabRemove} onContextmenu={this.tabsContextmenu}>
|
|
905
|
-
{
|
|
906
|
-
this.tabs.map(tab => (
|
|
907
|
-
<el-tab-pane key={tab.key} label={tab.title || tab.menuTitle} name={tab.key}></el-tab-pane>
|
|
908
|
-
))
|
|
909
|
-
}
|
|
910
|
-
</el-tabs>
|
|
911
|
-
</div>
|
|
912
|
-
)
|
|
913
|
-
}
|
|
914
|
-
<el-popover
|
|
915
|
-
ref="tabPopover"
|
|
916
|
-
placement="bottom"
|
|
917
|
-
width="200"
|
|
918
|
-
trigger="manual"
|
|
919
|
-
v-model:visible={this.popoverVisible}
|
|
920
|
-
v-slots={{ reference: () => (<span > </span>) }}>
|
|
921
|
-
<div class="tabs-popover-clear" onClick={this.clearTabs}>{this.$t('Clear tabs')}</div>
|
|
922
|
-
</el-popover>
|
|
923
|
-
</div>
|
|
924
|
-
)
|
|
925
|
-
},
|
|
926
|
-
renderRole () {
|
|
927
|
-
const { EXTEND_OF_COMPETENCE } = this.appConfig
|
|
928
|
-
// 本组件只在管理模式下渲染。这个下拉显示「管理模式」并提供退回运行模式的唯一入口,
|
|
929
|
-
// 不能被应用自定义工具栏(TOOLBAR,如智能体应用只留 language)裁掉
|
|
930
|
-
if (EXTEND_OF_COMPETENCE !== 'allRole') {
|
|
931
|
-
return (
|
|
932
|
-
<el-dropdown trigger="click" placement="bottom-start" onCommand={this.switchRole} v-slots={{
|
|
933
|
-
dropdown: () => (<el-dropdown-menu>
|
|
934
|
-
<el-dropdown-item command='app-manage-code'>
|
|
935
|
-
管理模式
|
|
936
|
-
</el-dropdown-item>
|
|
937
|
-
{
|
|
938
|
-
this.roleList.map(role => (
|
|
939
|
-
<el-dropdown-item
|
|
940
|
-
class={['epx-app-nav__role-dropdown-item', { 'epx-app-nav__role-dropdown-item--default': role.MAIN_ROLE === 'true' }]}
|
|
941
|
-
key={role.CODE}
|
|
942
|
-
command={role}
|
|
943
|
-
>
|
|
944
|
-
<span class="epx-app-nav__role-name">{role['NAME#'] || this.$t(role.NAME)}</span>
|
|
945
|
-
<i class="epx-app-nav__role-icon epx-icon-qizhi" ></i>
|
|
946
|
-
<span class="epx-app-nav__role-text" onClick={this.setMainRole.bind(this, role)}>{role.MAIN_ROLE === 'true' ? this.$t('default') : this.$t('Set to the default')}</span>
|
|
947
|
-
</el-dropdown-item>
|
|
948
|
-
))
|
|
949
|
-
}
|
|
950
|
-
</el-dropdown-menu>)
|
|
951
|
-
}}>
|
|
952
|
-
<el-button size="default" type="primary" plain class="epx-app-nav__role-button">
|
|
953
|
-
{this.currentRoleName}<i class="el-icon-arrow-down el-icon--right"></i>
|
|
954
|
-
</el-button>
|
|
955
|
-
</el-dropdown>
|
|
956
|
-
)
|
|
957
|
-
}
|
|
958
|
-
},
|
|
959
|
-
settingAppMenu (menu, event) {
|
|
960
|
-
event.stopPropagation()
|
|
961
|
-
}
|
|
962
|
-
},
|
|
963
|
-
created () {
|
|
964
|
-
this.getClientSystemAppRole()
|
|
965
|
-
}
|
|
966
|
-
}
|
|
967
|
-
</script>
|
|
968
|
-
|
|
969
|
-
<style lang="scss" scoped>
|
|
970
|
-
.app-logo-right .el-icon-caret-bottom{
|
|
971
|
-
font-size: var(--epx-font-size-l);
|
|
972
|
-
color: #fff;
|
|
973
|
-
}
|
|
974
|
-
.app-config-item{
|
|
975
|
-
box-sizing: border-box;
|
|
976
|
-
height: 36px;
|
|
977
|
-
background: var(--epx-bg-card);
|
|
978
|
-
cursor: pointer;
|
|
979
|
-
line-height: 36px;
|
|
980
|
-
padding: 0 40px 0 20px;
|
|
981
|
-
color: var(--epx-text);
|
|
982
|
-
i{
|
|
983
|
-
margin-right: 10px;
|
|
984
|
-
}
|
|
985
|
-
&:hover{
|
|
986
|
-
@include font_color_primary;
|
|
987
|
-
@include bg_color_primary(0.1);
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
|
-
.top-type-nav-menu:hover,.more-menu-item:hover{
|
|
991
|
-
.app-menu-setting{
|
|
992
|
-
visibility: visible;
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
.app-menu-setting{
|
|
996
|
-
visibility: hidden;
|
|
997
|
-
margin-left: 4px;
|
|
998
|
-
width: 24px;
|
|
999
|
-
display: inline-block;
|
|
1000
|
-
i{
|
|
1001
|
-
font-size: var(--epx-font-size-l);
|
|
1002
|
-
position: relative;
|
|
1003
|
-
top: 2px;
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
.has-children-app-menu-setting{
|
|
1007
|
-
padding-left: 16px;
|
|
1008
|
-
}
|
|
1009
|
-
.more-menu-item{
|
|
1010
|
-
padding-right: 10px;
|
|
1011
|
-
display: flex;
|
|
1012
|
-
justify-content: space-between;
|
|
1013
|
-
}
|
|
1014
|
-
.app-add-menu{
|
|
1015
|
-
display: inline-block;
|
|
1016
|
-
width: 64px;
|
|
1017
|
-
color: #fff;
|
|
1018
|
-
cursor: pointer;
|
|
1019
|
-
text-align: center;
|
|
1020
|
-
font-size: 21px;
|
|
1021
|
-
}
|
|
1022
|
-
.app-add-menu:hover{
|
|
1023
|
-
background-color: rgba(0,0,0,.2);
|
|
1024
|
-
}
|
|
1025
|
-
.add-menu-container{
|
|
1026
|
-
box-sizing: border-box;
|
|
1027
|
-
padding: 4px 0 0 20px;
|
|
1028
|
-
width: 560px;
|
|
1029
|
-
height: 352px;
|
|
1030
|
-
font-size: var(--epx-font-size-l);
|
|
1031
|
-
color: var(--epx-text);
|
|
1032
|
-
font-weight: bold;
|
|
1033
|
-
}
|
|
1034
|
-
.add-type {
|
|
1035
|
-
display: flex;
|
|
1036
|
-
flex-wrap: wrap;
|
|
1037
|
-
margin-top: 12px;
|
|
1038
|
-
}
|
|
1039
|
-
.add-menu-type-label{
|
|
1040
|
-
font-size: var(--epx-font-size-base);
|
|
1041
|
-
color: #444444;
|
|
1042
|
-
margin-top: 10px;
|
|
1043
|
-
margin-bottom: 10px;
|
|
1044
|
-
line-height: 19px;
|
|
1045
|
-
font-weight: 500;
|
|
1046
|
-
}
|
|
1047
|
-
.add-menu-type__item {
|
|
1048
|
-
box-sizing: border-box;
|
|
1049
|
-
width: 160px;
|
|
1050
|
-
margin-right: 20px;
|
|
1051
|
-
margin-bottom: 20px;
|
|
1052
|
-
text-align: center;
|
|
1053
|
-
cursor: pointer;
|
|
1054
|
-
img {
|
|
1055
|
-
width: 100%;
|
|
1056
|
-
}
|
|
1057
|
-
&:hover {
|
|
1058
|
-
.add-menu-type-label{
|
|
1059
|
-
@include font_color_primary;
|
|
1060
|
-
}
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
.manage-nav-mode-item{
|
|
1064
|
-
margin-bottom: 40px;
|
|
1065
|
-
margin-left: 10px;
|
|
1066
|
-
margin-right: 10px;
|
|
1067
|
-
}
|
|
1068
|
-
.nav-type {
|
|
1069
|
-
img {
|
|
1070
|
-
opacity: 0.5;
|
|
1071
|
-
transition: all .5s;
|
|
1072
|
-
}
|
|
1073
|
-
.is-active {
|
|
1074
|
-
.add-menu-type-label{
|
|
1075
|
-
@include font_color_primary;
|
|
1076
|
-
}
|
|
1077
|
-
img {
|
|
1078
|
-
opacity: 1;
|
|
1079
|
-
}
|
|
1080
|
-
.nav-img{
|
|
1081
|
-
border: 1px solid;
|
|
1082
|
-
@include border_color_primary;
|
|
1083
|
-
}
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
.top-type-nav-menu{
|
|
1087
|
-
display: flex;
|
|
1088
|
-
align-items: center;
|
|
1089
|
-
justify-content: space-between;
|
|
1090
|
-
padding-right: 4px !important;
|
|
1091
|
-
|
|
1092
|
-
:deep(.el-sub-menu__title) {
|
|
1093
|
-
// padding-right: 34px;
|
|
1094
|
-
width: 100%;
|
|
1095
|
-
display: flex;
|
|
1096
|
-
align-items: center;
|
|
1097
|
-
justify-content: space-between;
|
|
1098
|
-
padding-right: 0;
|
|
1099
|
-
.el-sub-menu__icon-arrow{
|
|
1100
|
-
position: absolute;
|
|
1101
|
-
top: 42%;
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
|
|
1105
|
-
}
|
|
1106
|
-
.epx-app-nav__menu-item--sub {
|
|
1107
|
-
// padding: 0 !important;
|
|
1108
|
-
|
|
1109
|
-
:deep(.el-sub-menu__title .el-sub-menu__icon-arrow) {
|
|
1110
|
-
top: 50%;
|
|
1111
|
-
}
|
|
1112
|
-
:deep(.app-menu-setting i) {
|
|
1113
|
-
top:0;
|
|
1114
|
-
}
|
|
1115
|
-
|
|
1116
|
-
}
|
|
1117
|
-
.top-type-app-menu-setting{
|
|
1118
|
-
position: absolute;
|
|
1119
|
-
right: -10px;
|
|
1120
|
-
top: 0;
|
|
1121
|
-
}
|
|
1122
|
-
// .top-type-nav-menu-no-children{
|
|
1123
|
-
// padding-right: 10px !important;
|
|
1124
|
-
// }
|
|
1125
|
-
// .top-menu-setting-item{
|
|
1126
|
-
// display: flex;
|
|
1127
|
-
// align-items: center;
|
|
1128
|
-
// justify-content: space-between;
|
|
1129
|
-
// padding-right: 10px;
|
|
1130
|
-
// }
|
|
1131
|
-
.mode-manage-choose{
|
|
1132
|
-
display: flex;
|
|
1133
|
-
justify-content: space-between;
|
|
1134
|
-
align-items: center;
|
|
1135
|
-
border-bottom: 1px solid var(--epx-border);
|
|
1136
|
-
}
|
|
1137
|
-
.nav-draggable{
|
|
1138
|
-
display: flex;
|
|
1139
|
-
}
|
|
1140
|
-
.delete-dropdown-item{
|
|
1141
|
-
display: flex;
|
|
1142
|
-
align-items: center;
|
|
1143
|
-
justify-content: space-between;
|
|
1144
|
-
padding-right: 10px;
|
|
1145
|
-
cursor: pointer;
|
|
1146
|
-
background: var(--epx-bg-card);
|
|
1147
|
-
color: var(--epx-text);
|
|
1148
|
-
}
|
|
1149
|
-
.delete-dropdown-item:hover{
|
|
1150
|
-
@include font_color_primary;
|
|
1151
|
-
@include bg_color_primary(0.1);
|
|
1152
|
-
}
|
|
1153
|
-
.app-config-delete-item{
|
|
1154
|
-
box-sizing: border-box;
|
|
1155
|
-
height: 36px;
|
|
1156
|
-
cursor: pointer;
|
|
1157
|
-
line-height: 36px;
|
|
1158
|
-
padding: 0 40px 0 20px;
|
|
1159
|
-
i{
|
|
1160
|
-
margin-right: 10px;
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
|
-
.role-system__content {
|
|
1164
|
-
padding-bottom: 20px;
|
|
1165
|
-
|
|
1166
|
-
:deep(.el-checkbox) {
|
|
1167
|
-
padding: 10px 0;
|
|
1168
|
-
color: var(--epx-text);
|
|
1169
|
-
}
|
|
1170
|
-
|
|
1171
|
-
}
|
|
1172
|
-
.popup-dialog{
|
|
1173
|
-
:deep(.el-dialog__header){
|
|
1174
|
-
padding: 16px;
|
|
1175
|
-
}
|
|
1176
|
-
}
|
|
1177
|
-
.epx-add-form__sign-buttongroup .el-button + .el-button{
|
|
1178
|
-
margin-left: 20px;
|
|
1179
|
-
}
|
|
1180
|
-
</style>
|
|
1181
|
-
|
|
1182
|
-
<style lang="scss">
|
|
1183
|
-
.manage-menu-popover{
|
|
1184
|
-
box-sizing: border-box;
|
|
1185
|
-
padding: 8px 0;
|
|
1186
|
-
box-shadow: 0px 4px 12px 0px rgba(0,0,0,0.15);
|
|
1187
|
-
border-radius: var(--epx-radius-base);
|
|
1188
|
-
border: 1px solid var(--epx-border);
|
|
1189
|
-
}
|
|
1190
|
-
</style>
|
|
186
|
+
openType: '2',
|
|
187
|
+
callback: this.reloadMenu
|
|
188
|
+
}
|
|
189
|
+
const popover = this.$refs.popover
|
|
190
|
+
if (popover)popover.doClose()
|
|
191
|
+
// this.popoverManualVisible = false
|
|
192
|
+
this.$createPage(query)
|
|
193
|
+
},
|
|
194
|
+
judgeClickMenu () {
|
|
195
|
+
// 一级导航菜单信息后点击查看该新增菜单信息
|
|
196
|
+
if (this.editType === 'add-nav-menu') {
|
|
197
|
+
const nav = this.menu.find(item => item.ID === this.addMenuData.ID)
|
|
198
|
+
if (nav) {
|
|
199
|
+
// this.clickNavMenu(nav)
|
|
200
|
+
this.toPage(nav)
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
reloadMenu (v) {
|
|
205
|
+
// 经典模式新增下级菜单
|
|
206
|
+
if (this.type === '1' && this.editType === 'add-xj') {
|
|
207
|
+
this.toPage(this.editMenuInfo)
|
|
208
|
+
} else {
|
|
209
|
+
// 一级导航菜单信息后点击查看该新增菜单信息
|
|
210
|
+
if (this.editType === 'add-nav-menu') {
|
|
211
|
+
this.addMenuData = v
|
|
212
|
+
}
|
|
213
|
+
this.$emit('updateMenu')
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
removeEntity (select, type) {
|
|
217
|
+
this.showPopover = null
|
|
218
|
+
let selectItem = this.clickItem
|
|
219
|
+
if (select && select.id) {
|
|
220
|
+
selectItem = select
|
|
221
|
+
}
|
|
222
|
+
this.expandKeys = []
|
|
223
|
+
if (!selectItem || !selectItem.id) {
|
|
224
|
+
this.$message.error(this.$t('please select a record'))
|
|
225
|
+
return
|
|
226
|
+
}
|
|
227
|
+
// const idArr = [selectItem.id]
|
|
228
|
+
// this.getSubIds(idArr, selectItem.children)
|
|
229
|
+
const params = {
|
|
230
|
+
action: 'removeMulti',
|
|
231
|
+
entityId: 'FM_MODULE',
|
|
232
|
+
ids: selectItem.id
|
|
233
|
+
// ids: idArr.join(',')
|
|
234
|
+
}
|
|
235
|
+
if (type === '1') {
|
|
236
|
+
params.deletePag = '1'
|
|
237
|
+
}
|
|
238
|
+
this.$confirm(this.$t('Confirm the deletion') + '?')
|
|
239
|
+
.then(() => {
|
|
240
|
+
this.$http.$request(params)
|
|
241
|
+
.then(data => {
|
|
242
|
+
this.$message.success(this.$t('deleted successfully'))
|
|
243
|
+
// 删除菜单
|
|
244
|
+
if (!selectItem.parent) {
|
|
245
|
+
const key = 'default-' + selectItem.ID
|
|
246
|
+
this.$store.commit('DESTORY_TAB', key)
|
|
247
|
+
}
|
|
248
|
+
this.reloadMenu()
|
|
249
|
+
})
|
|
250
|
+
})
|
|
251
|
+
},
|
|
252
|
+
getSubIds (idArr = [], data) {
|
|
253
|
+
data.forEach(item => {
|
|
254
|
+
idArr.push(item.id)
|
|
255
|
+
if (item.children) {
|
|
256
|
+
this.getSubIds(idArr, item.children)
|
|
257
|
+
}
|
|
258
|
+
})
|
|
259
|
+
},
|
|
260
|
+
editAppConfig (name, type, width, e) {
|
|
261
|
+
this.dialogTitle = name
|
|
262
|
+
this.editType = type
|
|
263
|
+
if (type === '1') {
|
|
264
|
+
this.inputAppName = this.appConfig.NAME
|
|
265
|
+
} else if (type === '2') {
|
|
266
|
+
const appConfig = this.appConfig.APP_CONFIG ? JSON.parse(this.appConfig.APP_CONFIG) : {}
|
|
267
|
+
this.navAppType = appConfig.navType
|
|
268
|
+
this.navType = appConfig.navType
|
|
269
|
+
} else if (type === '3') {
|
|
270
|
+
const query = {
|
|
271
|
+
flag: 'manage-client-system-app-accredit',
|
|
272
|
+
metaId: 'FM_ROLE',
|
|
273
|
+
systemId: this.SYSTEM,
|
|
274
|
+
serviceId: this.appConfig.ID,
|
|
275
|
+
systemName: this.appConfig['SYSTEM|NAME'],
|
|
276
|
+
appName: this.appConfig.NAME,
|
|
277
|
+
appType: this.appConfig.TYPE
|
|
278
|
+
}
|
|
279
|
+
this.$store.commit('CREATE_TAB', {
|
|
280
|
+
key: 'default-' + this.appConfig.ID,
|
|
281
|
+
moduleId: this.appConfig.ID,
|
|
282
|
+
component: 'module-index-page',
|
|
283
|
+
title: name,
|
|
284
|
+
showBack: true,
|
|
285
|
+
...query
|
|
286
|
+
})
|
|
287
|
+
return
|
|
288
|
+
} else {
|
|
289
|
+
const query = {
|
|
290
|
+
flag: 'manage-client-system-app-detail',
|
|
291
|
+
metaId: 'FM_SERVICE',
|
|
292
|
+
id: this.appConfig.ID
|
|
293
|
+
}
|
|
294
|
+
this.$store.commit('CREATE_TAB', {
|
|
295
|
+
key: 'default-' + new Date().getTime(),
|
|
296
|
+
moduleId: this.appConfig.ID,
|
|
297
|
+
component: 'module-index-page',
|
|
298
|
+
title: name,
|
|
299
|
+
showBack: true,
|
|
300
|
+
...query
|
|
301
|
+
})
|
|
302
|
+
return
|
|
303
|
+
}
|
|
304
|
+
this.dialogWidth = width || '610'
|
|
305
|
+
this.showEditAppDialog = true
|
|
306
|
+
},
|
|
307
|
+
editAppDialog () {
|
|
308
|
+
if (this.editType === 'menu-rename') {
|
|
309
|
+
if (!this.inputAppName) {
|
|
310
|
+
this.$message.error('名称不能为空')
|
|
311
|
+
return
|
|
312
|
+
}
|
|
313
|
+
this.$http.update({
|
|
314
|
+
entityId: 'FM_MODULE',
|
|
315
|
+
'bean.ID': this.editMenuInfo.id,
|
|
316
|
+
'bean.NAME': this.inputAppName
|
|
317
|
+
})
|
|
318
|
+
.then(data => {
|
|
319
|
+
this.$emit('updateMenu')
|
|
320
|
+
this.$message.success('修改成功')
|
|
321
|
+
this.showEditAppDialog = false
|
|
322
|
+
})
|
|
323
|
+
.catch(err => {
|
|
324
|
+
this.$message.error(err.message || '修改失败')
|
|
325
|
+
this.showEditAppDialog = false
|
|
326
|
+
})
|
|
327
|
+
} else if (this.editType === 'menu-sq') {
|
|
328
|
+
// if (this.checkRoleList.length === 0) {
|
|
329
|
+
// this.$message.error('请先选择授权角色')
|
|
330
|
+
// return
|
|
331
|
+
// }
|
|
332
|
+
this.$http.$post({
|
|
333
|
+
action: 'refreshModuleRoles',
|
|
334
|
+
entityId: 'FM_ROLE_MODULE',
|
|
335
|
+
moduleId: this.editMenuInfo.id,
|
|
336
|
+
roleIds: this.checkRoleList.join(',')
|
|
337
|
+
})
|
|
338
|
+
.then(data => {
|
|
339
|
+
this.$message.success('添加成功')
|
|
340
|
+
this.showEditAppDialog = false
|
|
341
|
+
})
|
|
342
|
+
.catch(err => {
|
|
343
|
+
this.$message.error(err.message || '操作失败')
|
|
344
|
+
})
|
|
345
|
+
} else {
|
|
346
|
+
const params = {
|
|
347
|
+
entityId: 'FM_SERVICE',
|
|
348
|
+
'bean.ID': this.appConfig.ID
|
|
349
|
+
}
|
|
350
|
+
if (this.editType === '1') {
|
|
351
|
+
params['bean.NAME'] = this.inputAppName
|
|
352
|
+
if (!this.inputAppName) {
|
|
353
|
+
this.$message.error('名称不能为空')
|
|
354
|
+
return
|
|
355
|
+
}
|
|
356
|
+
} else if (this.editType === '2') {
|
|
357
|
+
if (this.navAppType === this.navType) {
|
|
358
|
+
this.$message.error('您未修改导航模式')
|
|
359
|
+
return
|
|
360
|
+
}
|
|
361
|
+
const appConfig = this.appConfig.APP_CONFIG ? JSON.parse(this.appConfig.APP_CONFIG) : {}
|
|
362
|
+
const obj = { ...appConfig, navType: this.navType }
|
|
363
|
+
params['bean.APP_CONFIG'] = JSON.stringify(obj)
|
|
364
|
+
}
|
|
365
|
+
this.$http.update(params)
|
|
366
|
+
.then(data => {
|
|
367
|
+
if (this.editType === '1') {
|
|
368
|
+
this.appName = ''
|
|
369
|
+
this.$store.dispatch({ type: 'GET_APP_CONFIG', client: this.appConfig['CLIENT|CODE'], system: this.appConfig['SYSTEM|CODE'], app: this.appConfig.CODE })
|
|
370
|
+
} else if (this.editType === '2') {
|
|
371
|
+
window.location.reload()
|
|
372
|
+
}
|
|
373
|
+
this.$message.success('修改成功')
|
|
374
|
+
this.showEditAppDialog = false
|
|
375
|
+
})
|
|
376
|
+
.catch(err => {
|
|
377
|
+
this.$message.error(err.message || '修改失败')
|
|
378
|
+
this.showEditAppDialog = false
|
|
379
|
+
})
|
|
380
|
+
}
|
|
381
|
+
},
|
|
382
|
+
switchNav (option) {
|
|
383
|
+
this.navType = option.value
|
|
384
|
+
},
|
|
385
|
+
renderEditDialog () {
|
|
386
|
+
return (
|
|
387
|
+
<el-dialog
|
|
388
|
+
title={this.dialogTitle}
|
|
389
|
+
modelValue={!!this.showEditAppDialog}
|
|
390
|
+
class="popup-dialog"
|
|
391
|
+
append-to-body={true}
|
|
392
|
+
width={this.dialogWidth + 'px'}
|
|
393
|
+
onClose={() => (this.showEditAppDialog = false)}
|
|
394
|
+
>
|
|
395
|
+
<div class="epx-add-form__check-dialog">
|
|
396
|
+
<div>
|
|
397
|
+
{this.editType === '1' &&
|
|
398
|
+
<div>
|
|
399
|
+
<div style="width:300px;margin:auto;marginBottom:20px">
|
|
400
|
+
<el-input v-model={this.inputAppName} clearable placeholder="请输入要修改的应用名称"></el-input>
|
|
401
|
+
</div>
|
|
402
|
+
</div>
|
|
403
|
+
}
|
|
404
|
+
{this.editType === 'menu-rename' &&
|
|
405
|
+
<div>
|
|
406
|
+
<div style="width:300px;margin:auto;marginBottom:20px">
|
|
407
|
+
<el-input v-model={this.inputAppName} clearable placeholder="请输入要修改的菜单名称"></el-input>
|
|
408
|
+
</div>
|
|
409
|
+
</div>
|
|
410
|
+
}
|
|
411
|
+
{this.editType === '2' &&
|
|
412
|
+
<div class='add-type nav-type'>
|
|
413
|
+
{
|
|
414
|
+
this.navOptions.map(option => (
|
|
415
|
+
<div class={['add-menu-type__item', 'manage-nav-mode-item', 'nav-type__item', { 'is-active': this.navType === option.value }]} key={option.value} onClick={this.switchNav.bind(this, option)}>
|
|
416
|
+
<div class="nav-img">
|
|
417
|
+
<img src={option.preview} />
|
|
418
|
+
</div>
|
|
419
|
+
<p class="add-menu-type-label">{option.label}</p>
|
|
420
|
+
</div>
|
|
421
|
+
))
|
|
422
|
+
}
|
|
423
|
+
</div>
|
|
424
|
+
}
|
|
425
|
+
{this.editType === 'menu-sq' &&
|
|
426
|
+
<div class='role-system__content'>
|
|
427
|
+
<el-checkbox-group v-model={this.checkRoleList}>
|
|
428
|
+
{
|
|
429
|
+
this.appAllRoleList.map(item => (
|
|
430
|
+
<el-checkbox key={item.ID} label={item.ID} value={item.ID}>{item.NAME}
|
|
431
|
+
{item.TYPE === 'client' && <el-tag style="marginLeft:4px" size="small">通用</el-tag>}
|
|
432
|
+
</el-checkbox>
|
|
433
|
+
))
|
|
434
|
+
}
|
|
435
|
+
</el-checkbox-group>
|
|
436
|
+
</div>
|
|
437
|
+
}
|
|
438
|
+
</div>
|
|
439
|
+
<div class="epx-add-form__sign-buttongroup">
|
|
440
|
+
<el-button size="middle" type="primary" onClick={this.editAppDialog}>{this.$t('determine')}</el-button>
|
|
441
|
+
<el-button size="middle" onClick={() => (this.showEditAppDialog = false)}>{this.$t('return')}</el-button>
|
|
442
|
+
</div>
|
|
443
|
+
</div>
|
|
444
|
+
</el-dialog>
|
|
445
|
+
)
|
|
446
|
+
},
|
|
447
|
+
renderLogo () {
|
|
448
|
+
return (
|
|
449
|
+
<div class="epx-app-nav__logo" ref="logo" onClick={this.backIndex}>
|
|
450
|
+
{this.renderEditDialog()}
|
|
451
|
+
{ this.logo && <img class="epx-app-nav__logo-icon" src={this.logo} />}
|
|
452
|
+
<span title={this.appName || this.NAME || this.appConfig.NAME}>{this.appName || this.NAME || this.appConfig.NAME}<span style="marginLeft:6px">{'[管理模式]'}</span></span>
|
|
453
|
+
<el-dropdown
|
|
454
|
+
placement="bottom-start"
|
|
455
|
+
trigger="click"
|
|
456
|
+
v-slots={{
|
|
457
|
+
dropdown: () => (<el-dropdown-menu>
|
|
458
|
+
<el-dropdown-item onClick={this.editAppConfig.bind(this, '重命名', '1')} class="app-config-item"><i class="el-icon-edit"></i>重命名</el-dropdown-item>
|
|
459
|
+
<el-dropdown-item onClick={this.editAppConfig.bind(this, '修改导航模式', '2')} class="app-config-item"><i class="el-icon-receiving"></i>导航模式</el-dropdown-item>
|
|
460
|
+
<el-dropdown-item onClick={this.editAppConfig.bind(this, '应用授权', '3')} class="app-config-item"><i class="el-icon-finished"></i>应用授权</el-dropdown-item>
|
|
461
|
+
<el-dropdown-item onClick={this.editAppConfig.bind(this, '更多设置', '4')} class="app-config-item"><i class="el-icon-setting"></i>更多设置</el-dropdown-item>
|
|
462
|
+
</el-dropdown-menu>)
|
|
463
|
+
}}>
|
|
464
|
+
<div class="app-logo-right" onClick={(e) => { e.stopPropagation() }}>
|
|
465
|
+
<i class="el-icon-caret-bottom"></i>
|
|
466
|
+
</div>
|
|
467
|
+
</el-dropdown>
|
|
468
|
+
</div>
|
|
469
|
+
)
|
|
470
|
+
},
|
|
471
|
+
renderMenuItem (nav, isSub = false) {
|
|
472
|
+
if (this.showAllLevel && nav.children && nav.children.length > 0) {
|
|
473
|
+
return (
|
|
474
|
+
<el-sub-menu class={['epx-app-nav__submenu', 'top-type-nav-menu', 'epx-app-nav__menu-item', { 'epx-app-nav__menu-item--sub': isSub }, { active: this.$tab.key === ('default-' + nav.ID) }]} index={nav.ID} onClick={this.clickNavMenu.bind(this, nav)} v-slots={{
|
|
475
|
+
// JSX 里必须用 v-slots 传具名插槽,v-slot 不生效(内容会被当默认插槽塞错位置)
|
|
476
|
+
title: () => (
|
|
477
|
+
// 原 <template> 允许多根,但箭头函数返回值必须单根 ⇒ 用 Fragment 包住
|
|
478
|
+
// 下面这两个相邻顶层元素(菜单名 + 配置下拉)
|
|
479
|
+
<>
|
|
480
|
+
<span>
|
|
481
|
+
<i class={['fa', nav.FONT_ICON]}></i>
|
|
482
|
+
<span style={{ fontSize: this.navMenuFontSize ? `${this.navMenuFontSize}px` : '' }}>{nav.text}1</span>
|
|
483
|
+
</span>
|
|
484
|
+
<el-dropdown
|
|
485
|
+
placement={nav.parent ? 'right-start' : 'bottom-start'}
|
|
486
|
+
trigger="click"
|
|
487
|
+
v-slots={{
|
|
488
|
+
dropdown: () => (<el-dropdown-menu>
|
|
489
|
+
<el-dropdown-item onClick={this.editAppMenu.bind(this, nav, '菜单-重命名', 'menu-rename')} class="app-config-item" ><i class="el-icon-edit"></i>重命名</el-dropdown-item>
|
|
490
|
+
<el-dropdown-item onClick={this.editAppMenu.bind(this, nav, '菜单-设置', 'menu-setting')}><i class="el-icon-setting"></i>设置</el-dropdown-item>
|
|
491
|
+
<el-popover
|
|
492
|
+
popper-class="manage-menu-popover"
|
|
493
|
+
placement="right-start"
|
|
494
|
+
trigger="hover"
|
|
495
|
+
v-slots={{
|
|
496
|
+
reference: () => (<div class="delete-dropdown-item">
|
|
497
|
+
<div class="app-config-delete-item"><i class="el-icon-delete"></i>删除</div>
|
|
498
|
+
<i class="el-icon-arrow-right"></i>
|
|
499
|
+
</div>)
|
|
500
|
+
}}>
|
|
501
|
+
<div>
|
|
502
|
+
<div class="app-config-item" onClick={this.editAppMenu.bind(this, nav, 'delete-menu', '0')}>删除菜单1</div>
|
|
503
|
+
<div class="app-config-item" onClick={this.editAppMenu.bind(this, nav, 'delete-menu', '1')}>删除菜单及页面</div>
|
|
504
|
+
</div>
|
|
505
|
+
</el-popover>
|
|
506
|
+
<el-dropdown-item onClick={this.editAppMenu.bind(this, nav, '菜单授权', 'menu-sq')} class="app-config-item"><i class="el-icon-finished"></i>菜单授权</el-dropdown-item>
|
|
507
|
+
<el-popover
|
|
508
|
+
popper-class="manage-menu-popover"
|
|
509
|
+
placement="right-start"
|
|
510
|
+
trigger="hover"
|
|
511
|
+
v-slots={{
|
|
512
|
+
reference: () => (<div class="delete-dropdown-item">
|
|
513
|
+
<div class="app-config-delete-item"><i class="el-icon-plus"></i>新增同级菜单</div>
|
|
514
|
+
<i class="el-icon-arrow-right"></i>
|
|
515
|
+
</div>)
|
|
516
|
+
}}>
|
|
517
|
+
<div class="add-menu-container">
|
|
518
|
+
<div>选择新增菜单类型</div>
|
|
519
|
+
<div class="add-type">
|
|
520
|
+
{this.addMenuTypeList.map(item => {
|
|
521
|
+
return (
|
|
522
|
+
<div class="add-menu-type__item" key={item.value} onClick={this.addAppMenu.bind(this, nav, item, '新增同级菜单', 'add-nav-menu')}>
|
|
523
|
+
<div>
|
|
524
|
+
<img src={item.preview} />
|
|
525
|
+
</div>
|
|
526
|
+
<p class="add-menu-type-label">{item.label}</p>
|
|
527
|
+
</div>
|
|
528
|
+
)
|
|
529
|
+
})
|
|
530
|
+
}
|
|
531
|
+
</div>
|
|
532
|
+
</div>
|
|
533
|
+
</el-popover>
|
|
534
|
+
<el-popover
|
|
535
|
+
popper-class="manage-menu-popover"
|
|
536
|
+
placement="right-start"
|
|
537
|
+
trigger="hover"
|
|
538
|
+
v-slots={{
|
|
539
|
+
reference: () => (<div class="delete-dropdown-item">
|
|
540
|
+
<div class="app-config-delete-item"><i class="el-icon-bottom"></i>新增下级菜单</div>
|
|
541
|
+
<i class="el-icon-arrow-right"></i>
|
|
542
|
+
</div>)
|
|
543
|
+
}}>
|
|
544
|
+
<div class="add-menu-container">
|
|
545
|
+
<div>选择新增菜单类型</div>
|
|
546
|
+
<div class="add-type">
|
|
547
|
+
{this.addMenuTypeList.map(item => {
|
|
548
|
+
return (
|
|
549
|
+
<div class="add-menu-type__item" key={item.value} onClick={this.addAppMenu.bind(this, nav, item, '新增下级菜单', 'add-xj')}>
|
|
550
|
+
<div>
|
|
551
|
+
<img src={item.preview} />
|
|
552
|
+
</div>
|
|
553
|
+
<p class="add-menu-type-label">{item.label}</p>
|
|
554
|
+
</div>
|
|
555
|
+
)
|
|
556
|
+
})
|
|
557
|
+
}
|
|
558
|
+
</div>
|
|
559
|
+
</div>
|
|
560
|
+
</el-popover>
|
|
561
|
+
</el-dropdown-menu>)
|
|
562
|
+
}}>
|
|
563
|
+
<span onClick={this.settingAppMenu.bind(this, nav)} class="app-menu-setting has-children-app-menu-setting"><i class="el-icon-s-tools"></i></span>
|
|
564
|
+
</el-dropdown>
|
|
565
|
+
</>
|
|
566
|
+
)
|
|
567
|
+
}}>
|
|
568
|
+
{
|
|
569
|
+
nav.children.map(item => this.renderMenuItem(item, true))
|
|
570
|
+
}
|
|
571
|
+
</el-sub-menu>
|
|
572
|
+
)
|
|
573
|
+
} else {
|
|
574
|
+
return (
|
|
575
|
+
<el-menu-item key={nav.ID} index={nav.ID} class={['epx-app-nav__menu-item', 'top-type-nav-menu', 'top-type-nav-menu-no-children', { 'epx-app-nav__menu-item--sub': isSub }, { active: this.$tab.key === ('default-' + nav.ID) }]} onClick={this.toPage.bind(this, nav)} >
|
|
576
|
+
<span>
|
|
577
|
+
<i class={['fa', nav.FONT_ICON]}></i>
|
|
578
|
+
<span style={this.navMenuFontSize ? { fontSize: this.navMenuFontSize + 'px' } : {}}>{nav.text}</span>
|
|
579
|
+
</span>
|
|
580
|
+
<el-dropdown
|
|
581
|
+
placement={nav.parent ? 'right-start' : 'bottom-start'}
|
|
582
|
+
trigger="click"
|
|
583
|
+
v-slots={{
|
|
584
|
+
dropdown: () => (<el-dropdown-menu>
|
|
585
|
+
<el-dropdown-item onClick={this.editAppMenu.bind(this, nav, '菜单-重命名', 'menu-rename')} class="app-config-item" ><i class="el-icon-edit"></i>重命名</el-dropdown-item>
|
|
586
|
+
<el-dropdown-item onClick={this.editAppMenu.bind(this, nav, '菜单-设置', 'menu-setting')}><i class="el-icon-setting"></i>设置</el-dropdown-item>
|
|
587
|
+
<el-popover
|
|
588
|
+
popper-class="manage-menu-popover"
|
|
589
|
+
placement="right-start"
|
|
590
|
+
trigger="hover"
|
|
591
|
+
v-slots={{
|
|
592
|
+
reference: () => (<div class="delete-dropdown-item">
|
|
593
|
+
<div class="app-config-delete-item"><i class="el-icon-delete"></i>删除</div>
|
|
594
|
+
<i class="el-icon-arrow-right"></i>
|
|
595
|
+
</div>)
|
|
596
|
+
}}>
|
|
597
|
+
<div>
|
|
598
|
+
<div class="app-config-item" onClick={this.editAppMenu.bind(this, nav, 'delete-menu', '0')}>删除菜单</div>
|
|
599
|
+
<div class="app-config-item" onClick={this.editAppMenu.bind(this, nav, 'delete-menu', '1')}>删除菜单及页面</div>
|
|
600
|
+
</div>
|
|
601
|
+
</el-popover>
|
|
602
|
+
<el-dropdown-item onClick={this.editAppMenu.bind(this, nav, '菜单授权', 'menu-sq')} class="app-config-item"><i class="el-icon-finished"></i>菜单授权</el-dropdown-item>
|
|
603
|
+
<el-popover
|
|
604
|
+
popper-class="manage-menu-popover"
|
|
605
|
+
placement="right-start"
|
|
606
|
+
trigger="hover"
|
|
607
|
+
v-slots={{
|
|
608
|
+
reference: () => (<div class="delete-dropdown-item">
|
|
609
|
+
<div class="app-config-delete-item"><i class="el-icon-plus"></i>新增同级菜单</div>
|
|
610
|
+
<i class="el-icon-arrow-right"></i>
|
|
611
|
+
</div>)
|
|
612
|
+
}}>
|
|
613
|
+
<div class="add-menu-container">
|
|
614
|
+
<div>选择新增菜单类型</div>
|
|
615
|
+
<div class="add-type">
|
|
616
|
+
{this.addMenuTypeList.map(item => {
|
|
617
|
+
return (
|
|
618
|
+
<div class="add-menu-type__item" key={item.value} onClick={this.addAppMenu.bind(this, nav, item, '新增同级菜单', 'add-nav-menu')}>
|
|
619
|
+
<div>
|
|
620
|
+
<img src={item.preview} />
|
|
621
|
+
</div>
|
|
622
|
+
<p class="add-menu-type-label">{item.label}</p>
|
|
623
|
+
</div>
|
|
624
|
+
)
|
|
625
|
+
})
|
|
626
|
+
}
|
|
627
|
+
</div>
|
|
628
|
+
</div>
|
|
629
|
+
</el-popover>
|
|
630
|
+
<el-popover
|
|
631
|
+
popper-class="manage-menu-popover"
|
|
632
|
+
placement="right-start"
|
|
633
|
+
trigger="hover"
|
|
634
|
+
v-slots={{
|
|
635
|
+
reference: () => (<div class="delete-dropdown-item">
|
|
636
|
+
<div class="app-config-delete-item"><i class="el-icon-bottom"></i>新增下级菜单</div>
|
|
637
|
+
<i class="el-icon-arrow-right"></i>
|
|
638
|
+
</div>)
|
|
639
|
+
}}>
|
|
640
|
+
<div class="add-menu-container">
|
|
641
|
+
<div>选择新增菜单类型</div>
|
|
642
|
+
<div class="add-type">
|
|
643
|
+
{this.addMenuTypeList.map(item => {
|
|
644
|
+
return (
|
|
645
|
+
<div class="add-menu-type__item" key={item.value} onClick={this.addAppMenu.bind(this, nav, item, '新增下级菜单', 'add-xj')}>
|
|
646
|
+
<div>
|
|
647
|
+
<img src={item.preview} />
|
|
648
|
+
</div>
|
|
649
|
+
<p class="add-menu-type-label">{item.label}</p>
|
|
650
|
+
</div>
|
|
651
|
+
)
|
|
652
|
+
})
|
|
653
|
+
}
|
|
654
|
+
</div>
|
|
655
|
+
</div>
|
|
656
|
+
</el-popover>
|
|
657
|
+
</el-dropdown-menu>)
|
|
658
|
+
}}>
|
|
659
|
+
<span onClick={this.settingAppMenu.bind(this, nav)} class="app-menu-setting"><i class="el-icon-s-tools"></i></span>
|
|
660
|
+
</el-dropdown>
|
|
661
|
+
</el-menu-item>
|
|
662
|
+
)
|
|
663
|
+
}
|
|
664
|
+
},
|
|
665
|
+
validateNavWidth () {
|
|
666
|
+
if (!this.$refs.container) return
|
|
667
|
+
let maxWidth = this.$refs.container.offsetWidth - this.$refs.logo.offsetWidth - this.$refs.rightContainer.offsetWidth - 128
|
|
668
|
+
if (this.tabs.length > 0) {
|
|
669
|
+
maxWidth -= 138
|
|
670
|
+
}
|
|
671
|
+
let foldMenuIndex = 0
|
|
672
|
+
let width = 0
|
|
673
|
+
if (!this.showMenu) return
|
|
674
|
+
for (let i = 0; i < this.showMenu.length; i++) {
|
|
675
|
+
const item = this.showMenu[i]
|
|
676
|
+
const itemWidth = (item.text || '').length * 14 + (item.FONT_ICON ? 20 : 0) + 44 + 12
|
|
677
|
+
if (width + itemWidth > maxWidth) {
|
|
678
|
+
if (width + 100 <= maxWidth) {
|
|
679
|
+
foldMenuIndex = i
|
|
680
|
+
} else {
|
|
681
|
+
foldMenuIndex = i - 1
|
|
682
|
+
}
|
|
683
|
+
break
|
|
684
|
+
}
|
|
685
|
+
width += itemWidth
|
|
686
|
+
}
|
|
687
|
+
if (foldMenuIndex) {
|
|
688
|
+
this.openMenu = this.showMenu.slice(0, foldMenuIndex)
|
|
689
|
+
this.foldMenu = this.showMenu.slice(foldMenuIndex)
|
|
690
|
+
} else {
|
|
691
|
+
this.openMenu = [...this.showMenu]
|
|
692
|
+
this.foldMenu = []
|
|
693
|
+
}
|
|
694
|
+
},
|
|
695
|
+
moveEnd (e) {
|
|
696
|
+
const index = e.newIndex
|
|
697
|
+
const node = this.openMenu[index]
|
|
698
|
+
const parentId = 'root'
|
|
699
|
+
// 获取其父节点的所有子节点orderString
|
|
700
|
+
const str = this.openMenu.reduce((str, item, index) => (str += item.id + ':' + index + ','), '')
|
|
701
|
+
// // this.drag = false
|
|
702
|
+
this.$http.$post({
|
|
703
|
+
action: 'moveTree',
|
|
704
|
+
entityId: 'FM_MODULE',
|
|
705
|
+
orderString: str,
|
|
706
|
+
newParentId: parentId,
|
|
707
|
+
id: node.id,
|
|
708
|
+
selfAttriName: 'ID',
|
|
709
|
+
orderAtrriName: 'ORDER_NUM'
|
|
710
|
+
})
|
|
711
|
+
.then(() => {
|
|
712
|
+
|
|
713
|
+
})
|
|
714
|
+
.catch(err => {
|
|
715
|
+
this.$message.error(err.message || '拖拽排序失败')
|
|
716
|
+
this.reloadMenu()
|
|
717
|
+
})
|
|
718
|
+
},
|
|
719
|
+
renderNav () {
|
|
720
|
+
// menu-trigger="click" 菜单点击 子菜单打开的触发方式(只在 mode 为 horizontal 时有效)
|
|
721
|
+
return (
|
|
722
|
+
<div class="epx-app-nav__home">
|
|
723
|
+
{
|
|
724
|
+
(this.type === '1' || this.type === '2') ? (
|
|
725
|
+
<div class="epx-app-nav__menu-content">
|
|
726
|
+
<el-menu ref="menu" style="display:flex" class="epx-app-nav__menu" mode="horizontal" ellipsis={false}>
|
|
727
|
+
{
|
|
728
|
+
this.showMenu && (
|
|
729
|
+
<draggable
|
|
730
|
+
class="el-menu--horizontal epx-app-nav__menu nav-draggable"
|
|
731
|
+
v-model={this.openMenu}
|
|
732
|
+
group="description"
|
|
733
|
+
ghostClass="ghost"
|
|
734
|
+
animation={300}
|
|
735
|
+
onEnd={this.moveEnd}
|
|
736
|
+
>
|
|
737
|
+
{this.openMenu.map(nav => {
|
|
738
|
+
if (nav.HIDDEN_MENU !== '1') {
|
|
739
|
+
return this.renderMenuItem(nav, false)
|
|
740
|
+
}
|
|
741
|
+
})}
|
|
742
|
+
|
|
743
|
+
</draggable>
|
|
744
|
+
)
|
|
745
|
+
}
|
|
746
|
+
</el-menu>
|
|
747
|
+
{
|
|
748
|
+
this.foldMenu.length > 0 && (
|
|
749
|
+
<el-dropdown class="epx-app-nav__foldmenu" onCommand={this.toPage} trigger="click" v-slots={{
|
|
750
|
+
dropdown: () => (<el-dropdown-menu>
|
|
751
|
+
{
|
|
752
|
+
this.foldMenu.map(menu => (
|
|
753
|
+
<el-dropdown-item key={menu.ID} command={menu} class={{ 'epx-app-nav__foldmenu-item': true, ' more-menu-item': true, 'is-active': this.$tab.key === ('default-' + menu.ID) }}>
|
|
754
|
+
<span>
|
|
755
|
+
<i class={['fa', menu.FONT_ICON]}></i>
|
|
756
|
+
<span>{menu.text}</span>
|
|
757
|
+
</span>
|
|
758
|
+
<el-dropdown
|
|
759
|
+
placement="right-start"
|
|
760
|
+
trigger="click"
|
|
761
|
+
v-slots={{
|
|
762
|
+
dropdown: () => (<el-dropdown-menu>
|
|
763
|
+
<el-dropdown-item onClick={this.editAppMenu.bind(this, menu, '菜单-重命名', 'menu-rename')} class="app-config-item"><i class="el-icon-edit"></i>重命名</el-dropdown-item>
|
|
764
|
+
<el-dropdown-item onClick={this.editAppMenu.bind(this, menu, '菜单-设置', 'menu-setting')}><i class="el-icon-setting"></i>设置</el-dropdown-item>
|
|
765
|
+
<el-popover
|
|
766
|
+
popper-class="manage-menu-popover"
|
|
767
|
+
placement="right-start"
|
|
768
|
+
trigger="hover"
|
|
769
|
+
v-slots={{
|
|
770
|
+
reference: () => (<div class="delete-dropdown-item">
|
|
771
|
+
<div class="app-config-delete-item"><i class="el-icon-delete"></i>删除</div>
|
|
772
|
+
<i class="el-icon-arrow-right"></i>
|
|
773
|
+
</div>)
|
|
774
|
+
}}>
|
|
775
|
+
<div>
|
|
776
|
+
<div class="app-config-item" onClick={this.editAppMenu.bind(this, menu, 'delete-menu', '0')}>删除菜单</div>
|
|
777
|
+
<div class="app-config-item" onClick={this.editAppMenu.bind(this, menu, 'delete-menu', '1')}>删除菜单及页面</div>
|
|
778
|
+
</div>
|
|
779
|
+
</el-popover>
|
|
780
|
+
<el-dropdown-item onClick={this.editAppMenu.bind(this, menu, '菜单授权', 'menu-sq')} class="app-config-item"><i class="el-icon-finished"></i>菜单授权</el-dropdown-item>
|
|
781
|
+
<el-popover
|
|
782
|
+
popper-class="manage-menu-popover"
|
|
783
|
+
placement="right-start"
|
|
784
|
+
trigger="hover"
|
|
785
|
+
v-slots={{
|
|
786
|
+
reference: () => (<div class="delete-dropdown-item">
|
|
787
|
+
<div class="app-config-delete-item"><i class="el-icon-plus"></i>新增同级菜单</div>
|
|
788
|
+
<i class="el-icon-arrow-right"></i>
|
|
789
|
+
</div>)
|
|
790
|
+
}}>
|
|
791
|
+
<div class="add-menu-container">
|
|
792
|
+
<div>选择新增菜单类型</div>
|
|
793
|
+
<div class="add-type">
|
|
794
|
+
{this.addMenuTypeList.map(item => {
|
|
795
|
+
return (
|
|
796
|
+
<div class="add-menu-type__item" key={item.value} onClick={this.addAppMenu.bind(this, menu, item, '新增同级菜单', 'add-nav-menu')}>
|
|
797
|
+
<div>
|
|
798
|
+
<img src={item.preview} />
|
|
799
|
+
</div>
|
|
800
|
+
<p class="add-menu-type-label">{item.label}</p>
|
|
801
|
+
</div>
|
|
802
|
+
)
|
|
803
|
+
})
|
|
804
|
+
}
|
|
805
|
+
</div>
|
|
806
|
+
</div>
|
|
807
|
+
</el-popover>
|
|
808
|
+
<el-popover
|
|
809
|
+
popper-class="manage-menu-popover"
|
|
810
|
+
placement="right-start"
|
|
811
|
+
trigger="hover"
|
|
812
|
+
v-slots={{
|
|
813
|
+
reference: () => (<div class="delete-dropdown-item">
|
|
814
|
+
<div class="app-config-delete-item"><i class="el-icon-bottom"></i>新增下级菜单</div>
|
|
815
|
+
<i class="el-icon-arrow-right"></i>
|
|
816
|
+
</div>)
|
|
817
|
+
}}>
|
|
818
|
+
<div class="add-menu-container">
|
|
819
|
+
<div>选择新增菜单类型</div>
|
|
820
|
+
<div class="add-type">
|
|
821
|
+
{this.addMenuTypeList.map(item => {
|
|
822
|
+
return (
|
|
823
|
+
<div class="add-menu-type__item" key={item.value} onClick={this.addAppMenu.bind(this, menu, item, '新增下级菜单', 'add-xj')}>
|
|
824
|
+
<div>
|
|
825
|
+
<img src={item.preview} />
|
|
826
|
+
</div>
|
|
827
|
+
<p class="add-menu-type-label">{item.label}</p>
|
|
828
|
+
</div>
|
|
829
|
+
)
|
|
830
|
+
})
|
|
831
|
+
}
|
|
832
|
+
</div>
|
|
833
|
+
</div>
|
|
834
|
+
</el-popover>
|
|
835
|
+
</el-dropdown-menu>)
|
|
836
|
+
}}>
|
|
837
|
+
<span onClick={this.settingAppMenu.bind(this, menu)} class="app-menu-setting"><i class="el-icon-s-tools"></i></span>
|
|
838
|
+
</el-dropdown>
|
|
839
|
+
</el-dropdown-item>
|
|
840
|
+
))
|
|
841
|
+
}
|
|
842
|
+
</el-dropdown-menu>)
|
|
843
|
+
}}>
|
|
844
|
+
<span class={{ 'epx-app-nav__foldmenu-text': true, 'is-active': this.activeMenuInMore }} >
|
|
845
|
+
{this.$t('more')}<i class="el-icon-caret-bottom"></i>
|
|
846
|
+
</span>
|
|
847
|
+
</el-dropdown>
|
|
848
|
+
)
|
|
849
|
+
}
|
|
850
|
+
<el-popover
|
|
851
|
+
ref="popover"
|
|
852
|
+
popper-class="manage-menu-popover"
|
|
853
|
+
placement="bottom"
|
|
854
|
+
trigger="click"
|
|
855
|
+
v-slots={{ reference: () => (<span class="app-add-menu"><i class="el-icon-circle-plus-outline"></i></span>) }}>
|
|
856
|
+
<div class="add-menu-container">
|
|
857
|
+
<div>选择新增菜单类型</div>
|
|
858
|
+
<div class="add-type">
|
|
859
|
+
{this.addMenuTypeList.map(item => {
|
|
860
|
+
return (
|
|
861
|
+
<div class="add-menu-type__item" key={item.value} onClick={this.chooseMenuType.bind(this, item)}>
|
|
862
|
+
<div>
|
|
863
|
+
<img src={item.preview} />
|
|
864
|
+
</div>
|
|
865
|
+
<p class="add-menu-type-label">{item.label}</p>
|
|
866
|
+
</div>
|
|
867
|
+
)
|
|
868
|
+
})
|
|
869
|
+
}
|
|
870
|
+
</div>
|
|
871
|
+
</div>
|
|
872
|
+
</el-popover>
|
|
873
|
+
{
|
|
874
|
+
this.tabs.length > 0 && (
|
|
875
|
+
<el-dropdown onCommand={this.selectTab} v-slots={{
|
|
876
|
+
dropdown: () => (<el-dropdown-menu>
|
|
877
|
+
{
|
|
878
|
+
this.tabs.map(tab => (
|
|
879
|
+
<el-dropdown-item key={tab.key} command={tab}>
|
|
880
|
+
{tab.title || tab.menuTitle}
|
|
881
|
+
<i class="epx-app-nav__tabs-delete el-icon-error" onClick={this.tabRemove.bind(this, tab.key)}></i>
|
|
882
|
+
</el-dropdown-item>
|
|
883
|
+
))
|
|
884
|
+
}
|
|
885
|
+
<el-dropdown-item onClick={this.clearTabs}>
|
|
886
|
+
<el-button class="epx-app-nav__tabs-clear" type="primary" link><i class="el-icon-document-delete"></i>{this.$t('empty')}</el-button>
|
|
887
|
+
</el-dropdown-item>
|
|
888
|
+
</el-dropdown-menu>)
|
|
889
|
+
}}>
|
|
890
|
+
<el-button round size="default" class="epx-app-nav__tabs-page">{this.$tab && this.$tab.title}<i class="el-icon-arrow-down el-icon--right"></i></el-button>
|
|
891
|
+
</el-dropdown>
|
|
892
|
+
)
|
|
893
|
+
}
|
|
894
|
+
</div>
|
|
895
|
+
) : (
|
|
896
|
+
<div class="epx-app-nav__menu-tabs">
|
|
897
|
+
{
|
|
898
|
+
this.tabs.length > 0 && (
|
|
899
|
+
<div class="epx-app-nav__menu-home">
|
|
900
|
+
<i class="el-icon-s-home" onClick={this.toAppIndex}></i>
|
|
901
|
+
</div>
|
|
902
|
+
)
|
|
903
|
+
}
|
|
904
|
+
<el-tabs class="epx-app-nav__tabs" modelValue={this.$tab.key} onTabClick={this.tabClick} closable onTabRemove={this.tabRemove} onContextmenu={this.tabsContextmenu}>
|
|
905
|
+
{
|
|
906
|
+
this.tabs.map(tab => (
|
|
907
|
+
<el-tab-pane key={tab.key} label={tab.title || tab.menuTitle} name={tab.key}></el-tab-pane>
|
|
908
|
+
))
|
|
909
|
+
}
|
|
910
|
+
</el-tabs>
|
|
911
|
+
</div>
|
|
912
|
+
)
|
|
913
|
+
}
|
|
914
|
+
<el-popover
|
|
915
|
+
ref="tabPopover"
|
|
916
|
+
placement="bottom"
|
|
917
|
+
width="200"
|
|
918
|
+
trigger="manual"
|
|
919
|
+
v-model:visible={this.popoverVisible}
|
|
920
|
+
v-slots={{ reference: () => (<span > </span>) }}>
|
|
921
|
+
<div class="tabs-popover-clear" onClick={this.clearTabs}>{this.$t('Clear tabs')}</div>
|
|
922
|
+
</el-popover>
|
|
923
|
+
</div>
|
|
924
|
+
)
|
|
925
|
+
},
|
|
926
|
+
renderRole () {
|
|
927
|
+
const { EXTEND_OF_COMPETENCE } = this.appConfig
|
|
928
|
+
// 本组件只在管理模式下渲染。这个下拉显示「管理模式」并提供退回运行模式的唯一入口,
|
|
929
|
+
// 不能被应用自定义工具栏(TOOLBAR,如智能体应用只留 language)裁掉
|
|
930
|
+
if (EXTEND_OF_COMPETENCE !== 'allRole') {
|
|
931
|
+
return (
|
|
932
|
+
<el-dropdown trigger="click" placement="bottom-start" onCommand={this.switchRole} v-slots={{
|
|
933
|
+
dropdown: () => (<el-dropdown-menu>
|
|
934
|
+
<el-dropdown-item command='app-manage-code'>
|
|
935
|
+
管理模式
|
|
936
|
+
</el-dropdown-item>
|
|
937
|
+
{
|
|
938
|
+
this.roleList.map(role => (
|
|
939
|
+
<el-dropdown-item
|
|
940
|
+
class={['epx-app-nav__role-dropdown-item', { 'epx-app-nav__role-dropdown-item--default': role.MAIN_ROLE === 'true' }]}
|
|
941
|
+
key={role.CODE}
|
|
942
|
+
command={role}
|
|
943
|
+
>
|
|
944
|
+
<span class="epx-app-nav__role-name">{role['NAME#'] || this.$t(role.NAME)}</span>
|
|
945
|
+
<i class="epx-app-nav__role-icon epx-icon-qizhi" ></i>
|
|
946
|
+
<span class="epx-app-nav__role-text" onClick={this.setMainRole.bind(this, role)}>{role.MAIN_ROLE === 'true' ? this.$t('default') : this.$t('Set to the default')}</span>
|
|
947
|
+
</el-dropdown-item>
|
|
948
|
+
))
|
|
949
|
+
}
|
|
950
|
+
</el-dropdown-menu>)
|
|
951
|
+
}}>
|
|
952
|
+
<el-button size="default" type="primary" plain class="epx-app-nav__role-button">
|
|
953
|
+
{this.currentRoleName}<i class="el-icon-arrow-down el-icon--right"></i>
|
|
954
|
+
</el-button>
|
|
955
|
+
</el-dropdown>
|
|
956
|
+
)
|
|
957
|
+
}
|
|
958
|
+
},
|
|
959
|
+
settingAppMenu (menu, event) {
|
|
960
|
+
event.stopPropagation()
|
|
961
|
+
}
|
|
962
|
+
},
|
|
963
|
+
created () {
|
|
964
|
+
this.getClientSystemAppRole()
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
</script>
|
|
968
|
+
|
|
969
|
+
<style lang="scss" scoped>
|
|
970
|
+
.app-logo-right .el-icon-caret-bottom{
|
|
971
|
+
font-size: var(--epx-font-size-l);
|
|
972
|
+
color: #fff;
|
|
973
|
+
}
|
|
974
|
+
.app-config-item{
|
|
975
|
+
box-sizing: border-box;
|
|
976
|
+
height: 36px;
|
|
977
|
+
background: var(--epx-bg-card);
|
|
978
|
+
cursor: pointer;
|
|
979
|
+
line-height: 36px;
|
|
980
|
+
padding: 0 40px 0 20px;
|
|
981
|
+
color: var(--epx-text);
|
|
982
|
+
i{
|
|
983
|
+
margin-right: 10px;
|
|
984
|
+
}
|
|
985
|
+
&:hover{
|
|
986
|
+
@include font_color_primary;
|
|
987
|
+
@include bg_color_primary(0.1);
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
.top-type-nav-menu:hover,.more-menu-item:hover{
|
|
991
|
+
.app-menu-setting{
|
|
992
|
+
visibility: visible;
|
|
993
|
+
}
|
|
994
|
+
}
|
|
995
|
+
.app-menu-setting{
|
|
996
|
+
visibility: hidden;
|
|
997
|
+
margin-left: 4px;
|
|
998
|
+
width: 24px;
|
|
999
|
+
display: inline-block;
|
|
1000
|
+
i{
|
|
1001
|
+
font-size: var(--epx-font-size-l);
|
|
1002
|
+
position: relative;
|
|
1003
|
+
top: 2px;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
.has-children-app-menu-setting{
|
|
1007
|
+
padding-left: 16px;
|
|
1008
|
+
}
|
|
1009
|
+
.more-menu-item{
|
|
1010
|
+
padding-right: 10px;
|
|
1011
|
+
display: flex;
|
|
1012
|
+
justify-content: space-between;
|
|
1013
|
+
}
|
|
1014
|
+
.app-add-menu{
|
|
1015
|
+
display: inline-block;
|
|
1016
|
+
width: 64px;
|
|
1017
|
+
color: #fff;
|
|
1018
|
+
cursor: pointer;
|
|
1019
|
+
text-align: center;
|
|
1020
|
+
font-size: 21px;
|
|
1021
|
+
}
|
|
1022
|
+
.app-add-menu:hover{
|
|
1023
|
+
background-color: rgba(0,0,0,.2);
|
|
1024
|
+
}
|
|
1025
|
+
.add-menu-container{
|
|
1026
|
+
box-sizing: border-box;
|
|
1027
|
+
padding: 4px 0 0 20px;
|
|
1028
|
+
width: 560px;
|
|
1029
|
+
height: 352px;
|
|
1030
|
+
font-size: var(--epx-font-size-l);
|
|
1031
|
+
color: var(--epx-text);
|
|
1032
|
+
font-weight: bold;
|
|
1033
|
+
}
|
|
1034
|
+
.add-type {
|
|
1035
|
+
display: flex;
|
|
1036
|
+
flex-wrap: wrap;
|
|
1037
|
+
margin-top: 12px;
|
|
1038
|
+
}
|
|
1039
|
+
.add-menu-type-label{
|
|
1040
|
+
font-size: var(--epx-font-size-base);
|
|
1041
|
+
color: #444444;
|
|
1042
|
+
margin-top: 10px;
|
|
1043
|
+
margin-bottom: 10px;
|
|
1044
|
+
line-height: 19px;
|
|
1045
|
+
font-weight: 500;
|
|
1046
|
+
}
|
|
1047
|
+
.add-menu-type__item {
|
|
1048
|
+
box-sizing: border-box;
|
|
1049
|
+
width: 160px;
|
|
1050
|
+
margin-right: 20px;
|
|
1051
|
+
margin-bottom: 20px;
|
|
1052
|
+
text-align: center;
|
|
1053
|
+
cursor: pointer;
|
|
1054
|
+
img {
|
|
1055
|
+
width: 100%;
|
|
1056
|
+
}
|
|
1057
|
+
&:hover {
|
|
1058
|
+
.add-menu-type-label{
|
|
1059
|
+
@include font_color_primary;
|
|
1060
|
+
}
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
.manage-nav-mode-item{
|
|
1064
|
+
margin-bottom: 40px;
|
|
1065
|
+
margin-left: 10px;
|
|
1066
|
+
margin-right: 10px;
|
|
1067
|
+
}
|
|
1068
|
+
.nav-type {
|
|
1069
|
+
img {
|
|
1070
|
+
opacity: 0.5;
|
|
1071
|
+
transition: all .5s;
|
|
1072
|
+
}
|
|
1073
|
+
.is-active {
|
|
1074
|
+
.add-menu-type-label{
|
|
1075
|
+
@include font_color_primary;
|
|
1076
|
+
}
|
|
1077
|
+
img {
|
|
1078
|
+
opacity: 1;
|
|
1079
|
+
}
|
|
1080
|
+
.nav-img{
|
|
1081
|
+
border: 1px solid;
|
|
1082
|
+
@include border_color_primary;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
.top-type-nav-menu{
|
|
1087
|
+
display: flex;
|
|
1088
|
+
align-items: center;
|
|
1089
|
+
justify-content: space-between;
|
|
1090
|
+
padding-right: 4px !important;
|
|
1091
|
+
|
|
1092
|
+
:deep(.el-sub-menu__title) {
|
|
1093
|
+
// padding-right: 34px;
|
|
1094
|
+
width: 100%;
|
|
1095
|
+
display: flex;
|
|
1096
|
+
align-items: center;
|
|
1097
|
+
justify-content: space-between;
|
|
1098
|
+
padding-right: 0;
|
|
1099
|
+
.el-sub-menu__icon-arrow{
|
|
1100
|
+
position: absolute;
|
|
1101
|
+
top: 42%;
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
}
|
|
1106
|
+
.epx-app-nav__menu-item--sub {
|
|
1107
|
+
// padding: 0 !important;
|
|
1108
|
+
|
|
1109
|
+
:deep(.el-sub-menu__title .el-sub-menu__icon-arrow) {
|
|
1110
|
+
top: 50%;
|
|
1111
|
+
}
|
|
1112
|
+
:deep(.app-menu-setting i) {
|
|
1113
|
+
top:0;
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1116
|
+
}
|
|
1117
|
+
.top-type-app-menu-setting{
|
|
1118
|
+
position: absolute;
|
|
1119
|
+
right: -10px;
|
|
1120
|
+
top: 0;
|
|
1121
|
+
}
|
|
1122
|
+
// .top-type-nav-menu-no-children{
|
|
1123
|
+
// padding-right: 10px !important;
|
|
1124
|
+
// }
|
|
1125
|
+
// .top-menu-setting-item{
|
|
1126
|
+
// display: flex;
|
|
1127
|
+
// align-items: center;
|
|
1128
|
+
// justify-content: space-between;
|
|
1129
|
+
// padding-right: 10px;
|
|
1130
|
+
// }
|
|
1131
|
+
.mode-manage-choose{
|
|
1132
|
+
display: flex;
|
|
1133
|
+
justify-content: space-between;
|
|
1134
|
+
align-items: center;
|
|
1135
|
+
border-bottom: 1px solid var(--epx-border);
|
|
1136
|
+
}
|
|
1137
|
+
.nav-draggable{
|
|
1138
|
+
display: flex;
|
|
1139
|
+
}
|
|
1140
|
+
.delete-dropdown-item{
|
|
1141
|
+
display: flex;
|
|
1142
|
+
align-items: center;
|
|
1143
|
+
justify-content: space-between;
|
|
1144
|
+
padding-right: 10px;
|
|
1145
|
+
cursor: pointer;
|
|
1146
|
+
background: var(--epx-bg-card);
|
|
1147
|
+
color: var(--epx-text);
|
|
1148
|
+
}
|
|
1149
|
+
.delete-dropdown-item:hover{
|
|
1150
|
+
@include font_color_primary;
|
|
1151
|
+
@include bg_color_primary(0.1);
|
|
1152
|
+
}
|
|
1153
|
+
.app-config-delete-item{
|
|
1154
|
+
box-sizing: border-box;
|
|
1155
|
+
height: 36px;
|
|
1156
|
+
cursor: pointer;
|
|
1157
|
+
line-height: 36px;
|
|
1158
|
+
padding: 0 40px 0 20px;
|
|
1159
|
+
i{
|
|
1160
|
+
margin-right: 10px;
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
.role-system__content {
|
|
1164
|
+
padding-bottom: 20px;
|
|
1165
|
+
|
|
1166
|
+
:deep(.el-checkbox) {
|
|
1167
|
+
padding: 10px 0;
|
|
1168
|
+
color: var(--epx-text);
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
}
|
|
1172
|
+
.popup-dialog{
|
|
1173
|
+
:deep(.el-dialog__header){
|
|
1174
|
+
padding: 16px;
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
.epx-add-form__sign-buttongroup .el-button + .el-button{
|
|
1178
|
+
margin-left: 20px;
|
|
1179
|
+
}
|
|
1180
|
+
</style>
|
|
1181
|
+
|
|
1182
|
+
<style lang="scss">
|
|
1183
|
+
.manage-menu-popover{
|
|
1184
|
+
box-sizing: border-box;
|
|
1185
|
+
padding: 8px 0;
|
|
1186
|
+
box-shadow: 0px 4px 12px 0px rgba(0,0,0,0.15);
|
|
1187
|
+
border-radius: var(--epx-radius-base);
|
|
1188
|
+
border: 1px solid var(--epx-border);
|
|
1189
|
+
}
|
|
1190
|
+
</style>
|