eoss-ui 0.6.18 → 0.6.20

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.
Files changed (101) hide show
  1. package/lib/eoss-ui.common.js +761 -657
  2. package/lib/flow.js +619 -515
  3. package/lib/index.js +1 -1
  4. package/lib/main.js +132 -132
  5. package/lib/qr-code.js +13 -13
  6. package/lib/theme-chalk/index.css +1 -1
  7. package/lib/theme-chalk/login.css +1 -1
  8. package/package.json +157 -157
  9. package/packages/button/src/main.vue +418 -418
  10. package/packages/button-group/src/main.vue +298 -298
  11. package/packages/checkbox-group/src/main.vue +333 -333
  12. package/packages/clients/src/main.vue +144 -144
  13. package/packages/data-table/src/children.vue +39 -39
  14. package/packages/data-table/src/column.vue +983 -983
  15. package/packages/data-table/src/main.vue +1812 -1812
  16. package/packages/data-table/src/sizer.vue +195 -195
  17. package/packages/date-picker/src/main.vue +236 -236
  18. package/packages/flow/src/component/CustomPreset.vue +1 -1
  19. package/packages/flow/src/component/Preset.vue +1 -1
  20. package/packages/flow/src/component/SendMsg.vue +3 -1
  21. package/packages/flow/src/component/taskUnionExamine.vue +38 -20
  22. package/packages/flow/src/main.vue +2731 -2711
  23. package/packages/flow/src/processForm.vue +13 -2
  24. package/packages/flow/src/processReject.vue +14 -3
  25. package/packages/flow/src/startTaskRead.vue +23 -5
  26. package/packages/flow-group/src/main.vue +684 -684
  27. package/packages/form/src/main.vue +3582 -3582
  28. package/packages/form/src/table.vue +1420 -1420
  29. package/packages/handle-user/src/main.vue +134 -134
  30. package/packages/handler/src/main.vue +374 -374
  31. package/packages/icon/src/main.vue +101 -101
  32. package/packages/input/src/main.vue +356 -356
  33. package/packages/login/src/main.vue +1851 -1851
  34. package/packages/login/src/resetPassword.vue +557 -557
  35. package/packages/main/src/default/message.vue +249 -249
  36. package/packages/main/src/default/notice.vue +157 -157
  37. package/packages/main/src/default/userinfo.vue +494 -494
  38. package/packages/main/src/public/online.vue +89 -89
  39. package/packages/main/src/public/search.vue +454 -454
  40. package/packages/main/src/public/settings.vue +221 -221
  41. package/packages/main/src/simplicity/apps.vue +388 -388
  42. package/packages/main/src/simplicity/avatar.vue +82 -82
  43. package/packages/main/src/simplicity/handler.vue +183 -183
  44. package/packages/main/src/simplicity/index.vue +1930 -1930
  45. package/packages/main/src/simplicity/lists.vue +84 -84
  46. package/packages/main/src/simplicity/menu-list.vue +128 -128
  47. package/packages/main/src/simplicity/message.vue +259 -259
  48. package/packages/main/src/simplicity/notice.vue +190 -190
  49. package/packages/main/src/simplicity/router-page.vue +45 -45
  50. package/packages/main/src/simplicity/sub-menu.vue +241 -241
  51. package/packages/main/src/simplicity/user.vue +248 -248
  52. package/packages/main/src/simplicity/userinfo.vue +304 -304
  53. package/packages/menu/src/main.vue +536 -536
  54. package/packages/pagination/src/main.vue +96 -96
  55. package/packages/qr-code/src/main.vue +170 -170
  56. package/packages/radio-group/src/main.vue +319 -319
  57. package/packages/select/src/main.vue +761 -761
  58. package/packages/selector/src/main.vue +677 -677
  59. package/packages/selector-panel/src/main.vue +1020 -1020
  60. package/packages/selector-panel/src/selection.vue +160 -160
  61. package/packages/tabs/src/main.vue +788 -788
  62. package/packages/theme-chalk/lib/index.css +1 -1
  63. package/packages/theme-chalk/lib/login.css +1 -1
  64. package/packages/theme-chalk/src/base.scss +260 -260
  65. package/packages/theme-chalk/src/button-group.scss +175 -175
  66. package/packages/theme-chalk/src/calendar.scss +113 -113
  67. package/packages/theme-chalk/src/clients.scss +87 -87
  68. package/packages/theme-chalk/src/common/var.scss +1 -4
  69. package/packages/theme-chalk/src/data-table.scss +276 -276
  70. package/packages/theme-chalk/src/dialog.scss +77 -77
  71. package/packages/theme-chalk/src/flow-group.scss +110 -110
  72. package/packages/theme-chalk/src/form.scss +496 -496
  73. package/packages/theme-chalk/src/handler.scss +133 -133
  74. package/packages/theme-chalk/src/icon.scss +1745 -1745
  75. package/packages/theme-chalk/src/icons.scss +99 -99
  76. package/packages/theme-chalk/src/login.scss +917 -926
  77. package/packages/theme-chalk/src/main.scss +632 -632
  78. package/packages/theme-chalk/src/menu.scss +222 -222
  79. package/packages/theme-chalk/src/nav.scss +125 -125
  80. package/packages/theme-chalk/src/pagination.scss +29 -29
  81. package/packages/theme-chalk/src/selector-panel.scss +204 -204
  82. package/packages/theme-chalk/src/simplicity.scss +1246 -1246
  83. package/packages/theme-chalk/src/tabs.scss +87 -87
  84. package/packages/theme-chalk/src/toolbar.scss +179 -179
  85. package/packages/theme-chalk/src/tree-group.scss +72 -72
  86. package/packages/theme-chalk/src/tree.scss +165 -165
  87. package/packages/upload/src/main.vue +1313 -1313
  88. package/packages/wujie/src/main.vue +145 -145
  89. package/src/config/api.js +236 -236
  90. package/src/config/image.js +2 -2
  91. package/src/index.js +157 -157
  92. package/packages/.DS_Store +0 -0
  93. package/packages/checkbox-group/.DS_Store +0 -0
  94. package/packages/data-table/.DS_Store +0 -0
  95. package/packages/dialog/.DS_Store +0 -0
  96. package/packages/handler/.DS_Store +0 -0
  97. package/packages/login/.DS_Store +0 -0
  98. package/packages/main/.DS_Store +0 -0
  99. package/packages/main/src/.DS_Store +0 -0
  100. package/packages/theme-chalk/src/.DS_Store +0 -0
  101. package/src/.DS_Store +0 -0
@@ -1,374 +1,374 @@
1
- <template>
2
- <ul class="es-handler">
3
- <template v-for="(item, index) in lists">
4
- <li v-if="!item.hide" :key="index" class="es-handler-item">
5
- <es-handle-user
6
- v-if="item.type === 'user'"
7
- class="es-handler-user"
8
- :data="item"
9
- :userModel="userModel"
10
- :job-scrollbar="jobScrollbar"
11
- @visible-change="handleVisibleChange"
12
- @click="handleClick"
13
- @change="handleChange"
14
- ></es-handle-user>
15
- <div v-else-if="item.type === 'date'" class="es-handler-date">
16
- <div>
17
- {{ time }}
18
- <span v-if="show"
19
- >当前<span
20
- class="es-online-num"
21
- :class="{ 'es-pointer': onlineList }"
22
- @click.stop="onlineList ? handleClick({ type: 'online' }) : ''"
23
- >{{ online }}</span
24
- >人在线</span
25
- >
26
- </div>
27
- <div>今 天:{{ date }}</div>
28
- </div>
29
- <el-popover
30
- v-else-if="item.type === 'system'"
31
- placement="bottom"
32
- trigger="hover"
33
- ref="system"
34
- :popper-class="
35
- system.length > 4
36
- ? 'es-popper-sub-system is-width'
37
- : 'es-popper-sub-system'
38
- "
39
- @show="showPopper = true"
40
- @hide="showPopper = false"
41
- >
42
- <el-scrollbar :max-height="maxHeight" v-if="system.length">
43
- <ul class="es-sub-system">
44
- <li
45
- v-for="ele in system"
46
- class="es-sub-system-item"
47
- :class="{
48
- 'es-disabled':
49
- (application && !ele.hasPermission) ||
50
- (ele.extendData && ele.extendData.businessStatus == 0)
51
- }"
52
- :key="ele.id"
53
- :title="ele.text"
54
- @click.stop="handleSelect({ node: ele })"
55
- >
56
- <el-badge
57
- :is-dot="typeof ele.tips === 'boolean'"
58
- :hidden="!ele.tips"
59
- :max="99"
60
- :value="typeof ele.tips !== 'boolean' ? ele.tips : 0"
61
- ><i
62
- :class="[
63
- unicode(ele.icons) ? ele.icons : 'es-icon',
64
- 'es-sub-system-icon',
65
- { 'es-icon-yingyong': !ele.icons }
66
- ]"
67
- v-html="unicode(ele.icons) ? '' : ele.icons"
68
- ></i
69
- ></el-badge>
70
- <div class="es-sub-system-title">{{ ele.text }}</div>
71
- </li>
72
- </ul>
73
- </el-scrollbar>
74
- <div
75
- slot="reference"
76
- class="es-handler-icon"
77
- :title="item.title"
78
- :class="item.icon"
79
- ></div>
80
- </el-popover>
81
- <el-badge
82
- class="es-badge"
83
- v-else-if="item.type === 'notice'"
84
- :value="notice"
85
- :max="99"
86
- :hidden="notice < 1"
87
- >
88
- <div
89
- class="es-handler-icon"
90
- :title="item.title"
91
- :class="item.icon"
92
- @click.stop="handleClick(item)"
93
- ></div>
94
- </el-badge>
95
- <div
96
- v-else
97
- class="es-handler-icon"
98
- :title="item.title"
99
- :class="item.icon"
100
- @click.stop="handleClick(item)"
101
- ></div>
102
- </li>
103
- </template>
104
- </ul>
105
- </template>
106
- <script>
107
- import { logout } from 'eoss-ui/src/config/api.js';
108
- import util from 'eoss-ui/src/utils/util';
109
- export default {
110
- name: 'EsHandler',
111
- inheritAttrs: false,
112
- inject: {
113
- onQuit: {
114
- default: ''
115
- }
116
- },
117
- props: {
118
- jobScrollbar: Boolean,
119
- data: Array,
120
- color: {
121
- type: String,
122
- default: '#333333'
123
- },
124
- userModel: Object,
125
- subSystem: {
126
- type: Array,
127
- default() {
128
- return [];
129
- }
130
- },
131
- notice: {
132
- type: Number,
133
- default: 0
134
- },
135
- hide: {
136
- type: Object,
137
- default() {
138
- return { system: true, new: true };
139
- }
140
- },
141
- online: {
142
- type: [Number, Boolean],
143
- default: 1
144
- },
145
- photo: String,
146
- storage: String,
147
- application: {
148
- type: Boolean,
149
- default: false
150
- },
151
- maxHeight: {
152
- type: String,
153
- default: '100%'
154
- }
155
- },
156
- watch: {
157
- subSystem: {
158
- handler(val) {
159
- if (this.showPopper) {
160
- this.$refs.system[0].doClose();
161
- this.$nextTick(this.$refs.system[0].doShow);
162
- }
163
- }
164
- }
165
- },
166
- computed: {
167
- lists() {
168
- if (this.data === undefined) {
169
- if (Object.keys(this.hide).length) {
170
- this.list.forEach((item) => {
171
- item.hide = this.hide[item.type];
172
- });
173
- }
174
- return this.list;
175
- } else {
176
- if (Object.keys(this.hide).length) {
177
- this.data.forEach((item) => {
178
- item.hide = this.hide[item.type];
179
- });
180
- }
181
- return this.data;
182
- }
183
- },
184
- system() {
185
- return this.subSystem;
186
- },
187
- show() {
188
- if (this.online === false) {
189
- return false;
190
- }
191
- return true;
192
- },
193
- onlineList() {
194
- return (
195
- this.useCaseCodes && this.useCaseCodes.includes('sys_user_onlineList')
196
- );
197
- }
198
- },
199
- data() {
200
- return {
201
- date: '',
202
- time: '',
203
- list: [
204
- {
205
- type: 'user'
206
- },
207
- {
208
- type: 'date'
209
- },
210
- {
211
- type: 'system',
212
- icon: 'es-icon-yingyong',
213
- title: '切换子系统'
214
- },
215
- {
216
- type: 'home',
217
- icon: 'es-icon-zuomian',
218
- title: '个人工作台'
219
- },
220
- {
221
- type: 'index',
222
- icon: 'es-icon-home',
223
- title: '门户'
224
- },
225
- {
226
- type: 'notice',
227
- icon: 'es-icon-tongzhi',
228
- title: '通知消息'
229
- },
230
- {
231
- type: 'refresh',
232
- icon: 'es-icon-shuaxin',
233
- title: '刷新'
234
- },
235
- {
236
- type: 'quit',
237
- icon: 'es-icon-guanji',
238
- title: '退出'
239
- },
240
- {
241
- type: 'set',
242
- icon: 'es-icon-xitongguanli',
243
- title: '设置'
244
- }
245
- ],
246
- showPopper: false,
247
- useCaseCodes: util.getStorage('useCaseCodes')
248
- };
249
- },
250
- created() {
251
- this.time = util.timeCycle() + '好!';
252
- this.date = util.formatDate('', 'yyyy 年 M 月 d 日 ');
253
- },
254
- methods: {
255
- unicode(res) {
256
- if (!res) {
257
- return false;
258
- }
259
- var reg = new RegExp(/^es-\S+/, 'g');
260
- let len = res.match(reg) ? res.match(reg).length : 0;
261
- return len;
262
- },
263
- handleClick(res) {
264
- const { type, event } = res;
265
- if (event) {
266
- event();
267
- } else {
268
- switch (type) {
269
- case 'quit':
270
- this.handleQuit();
271
- break;
272
- }
273
- this.$emit('click', res);
274
- }
275
- },
276
- handleChange(item) {
277
- this.$emit('change', item);
278
- },
279
- handleSelect(res) {
280
- const { node } = res;
281
- if (node.extendData && node.extendData.businessStatus == 0) {
282
- this.$alert(
283
- node.extendData.businessWarnMsg
284
- ? node.extendData.businessWarnMsg
285
- : '此模块还在开发中',
286
- '提示',
287
- {
288
- type: 'warning'
289
- }
290
- );
291
- } else if (!this.application && !node.hasPermission) {
292
- this.$emit('select', res);
293
- }
294
- },
295
- handleQuit() {
296
- this.$confirm('确定退出吗?', '退出系统', {
297
- confirmButtonText: '确定',
298
- cancelButtonText: '取消',
299
- type: 'warning'
300
- })
301
- .then(() => {
302
- util
303
- .ajax({ method: 'post', url: logout })
304
- .then((res) => {
305
- if (res.rCode == 0) {
306
- util.removeStorage([
307
- 'Authorization',
308
- 'token',
309
- 'ssId',
310
- 'userId',
311
- 'userName',
312
- 'auth',
313
- 'deviceUnique',
314
- 'menus',
315
- 'useCaseCodes',
316
- 'mainConfig',
317
- 'jump'
318
- ]);
319
- if (this.onQuit && typeof this.onQuit === 'function') {
320
- this.onQuit();
321
- } else {
322
- try {
323
- const loginPage =
324
- util.getStorage('login') || util.getStorage('loginPage');
325
- if (loginPage) {
326
- let src;
327
- if (!util.startWith(loginPage, ['http', '/'], true)) {
328
- let pathname = util.win.top.location.pathname;
329
- if (pathname !== '/') {
330
- pathname = pathname.split('/');
331
- pathname.splice(pathname.length - 1);
332
- pathname = pathname.join('/');
333
- src = pathname + '/' + loginPage.replace('./', '');
334
- } else {
335
- src = pathname + loginPage.replace('./', '');
336
- }
337
- } else {
338
- src = loginPage;
339
- }
340
- util.win.top.location.href = src;
341
- } else if (
342
- util.win.top.location.href.indexOf('main.html') > -1
343
- ) {
344
- util.win.top.location.href = './login.html';
345
- } else {
346
- const hash = util.win.top.location.hash;
347
- if (hash) {
348
- const len = util.win.top.location.href.indexOf(hash);
349
- util.win.top.location.href =
350
- util.win.location.href.slice(0, len) + '#/login';
351
- } else {
352
- util.win.top.location.href = '/login.html';
353
- }
354
- }
355
- } catch (error) {
356
- util.win.postMessage({ type: 1 }, '*');
357
- }
358
- }
359
- }
360
- })
361
- .catch((err) => {
362
- if (err.message && err.message !== 'canceled') {
363
- this.$message.error(err.message);
364
- }
365
- });
366
- })
367
- .catch((e) => {});
368
- },
369
- handleVisibleChange(res) {
370
- this.$emit('visible-change', res);
371
- }
372
- }
373
- };
374
- </script>
1
+ <template>
2
+ <ul class="es-handler">
3
+ <template v-for="(item, index) in lists">
4
+ <li v-if="!item.hide" :key="index" class="es-handler-item">
5
+ <es-handle-user
6
+ v-if="item.type === 'user'"
7
+ class="es-handler-user"
8
+ :data="item"
9
+ :userModel="userModel"
10
+ :job-scrollbar="jobScrollbar"
11
+ @visible-change="handleVisibleChange"
12
+ @click="handleClick"
13
+ @change="handleChange"
14
+ ></es-handle-user>
15
+ <div v-else-if="item.type === 'date'" class="es-handler-date">
16
+ <div>
17
+ {{ time }}
18
+ <span v-if="show"
19
+ >当前<span
20
+ class="es-online-num"
21
+ :class="{ 'es-pointer': onlineList }"
22
+ @click.stop="onlineList ? handleClick({ type: 'online' }) : ''"
23
+ >{{ online }}</span
24
+ >人在线</span
25
+ >
26
+ </div>
27
+ <div>今 天:{{ date }}</div>
28
+ </div>
29
+ <el-popover
30
+ v-else-if="item.type === 'system'"
31
+ placement="bottom"
32
+ trigger="hover"
33
+ ref="system"
34
+ :popper-class="
35
+ system.length > 4
36
+ ? 'es-popper-sub-system is-width'
37
+ : 'es-popper-sub-system'
38
+ "
39
+ @show="showPopper = true"
40
+ @hide="showPopper = false"
41
+ >
42
+ <el-scrollbar :max-height="maxHeight" v-if="system.length">
43
+ <ul class="es-sub-system">
44
+ <li
45
+ v-for="ele in system"
46
+ class="es-sub-system-item"
47
+ :class="{
48
+ 'es-disabled':
49
+ (application && !ele.hasPermission) ||
50
+ (ele.extendData && ele.extendData.businessStatus == 0)
51
+ }"
52
+ :key="ele.id"
53
+ :title="ele.text"
54
+ @click.stop="handleSelect({ node: ele })"
55
+ >
56
+ <el-badge
57
+ :is-dot="typeof ele.tips === 'boolean'"
58
+ :hidden="!ele.tips"
59
+ :max="99"
60
+ :value="typeof ele.tips !== 'boolean' ? ele.tips : 0"
61
+ ><i
62
+ :class="[
63
+ unicode(ele.icons) ? ele.icons : 'es-icon',
64
+ 'es-sub-system-icon',
65
+ { 'es-icon-yingyong': !ele.icons }
66
+ ]"
67
+ v-html="unicode(ele.icons) ? '' : ele.icons"
68
+ ></i
69
+ ></el-badge>
70
+ <div class="es-sub-system-title">{{ ele.text }}</div>
71
+ </li>
72
+ </ul>
73
+ </el-scrollbar>
74
+ <div
75
+ slot="reference"
76
+ class="es-handler-icon"
77
+ :title="item.title"
78
+ :class="item.icon"
79
+ ></div>
80
+ </el-popover>
81
+ <el-badge
82
+ class="es-badge"
83
+ v-else-if="item.type === 'notice'"
84
+ :value="notice"
85
+ :max="99"
86
+ :hidden="notice < 1"
87
+ >
88
+ <div
89
+ class="es-handler-icon"
90
+ :title="item.title"
91
+ :class="item.icon"
92
+ @click.stop="handleClick(item)"
93
+ ></div>
94
+ </el-badge>
95
+ <div
96
+ v-else
97
+ class="es-handler-icon"
98
+ :title="item.title"
99
+ :class="item.icon"
100
+ @click.stop="handleClick(item)"
101
+ ></div>
102
+ </li>
103
+ </template>
104
+ </ul>
105
+ </template>
106
+ <script>
107
+ import { logout } from 'eoss-ui/src/config/api.js';
108
+ import util from 'eoss-ui/src/utils/util';
109
+ export default {
110
+ name: 'EsHandler',
111
+ inheritAttrs: false,
112
+ inject: {
113
+ onQuit: {
114
+ default: ''
115
+ }
116
+ },
117
+ props: {
118
+ jobScrollbar: Boolean,
119
+ data: Array,
120
+ color: {
121
+ type: String,
122
+ default: '#333333'
123
+ },
124
+ userModel: Object,
125
+ subSystem: {
126
+ type: Array,
127
+ default() {
128
+ return [];
129
+ }
130
+ },
131
+ notice: {
132
+ type: Number,
133
+ default: 0
134
+ },
135
+ hide: {
136
+ type: Object,
137
+ default() {
138
+ return { system: true, new: true };
139
+ }
140
+ },
141
+ online: {
142
+ type: [Number, Boolean],
143
+ default: 1
144
+ },
145
+ photo: String,
146
+ storage: String,
147
+ application: {
148
+ type: Boolean,
149
+ default: false
150
+ },
151
+ maxHeight: {
152
+ type: String,
153
+ default: '100%'
154
+ }
155
+ },
156
+ watch: {
157
+ subSystem: {
158
+ handler(val) {
159
+ if (this.showPopper) {
160
+ this.$refs.system[0].doClose();
161
+ this.$nextTick(this.$refs.system[0].doShow);
162
+ }
163
+ }
164
+ }
165
+ },
166
+ computed: {
167
+ lists() {
168
+ if (this.data === undefined) {
169
+ if (Object.keys(this.hide).length) {
170
+ this.list.forEach((item) => {
171
+ item.hide = this.hide[item.type];
172
+ });
173
+ }
174
+ return this.list;
175
+ } else {
176
+ if (Object.keys(this.hide).length) {
177
+ this.data.forEach((item) => {
178
+ item.hide = this.hide[item.type];
179
+ });
180
+ }
181
+ return this.data;
182
+ }
183
+ },
184
+ system() {
185
+ return this.subSystem;
186
+ },
187
+ show() {
188
+ if (this.online === false) {
189
+ return false;
190
+ }
191
+ return true;
192
+ },
193
+ onlineList() {
194
+ return (
195
+ this.useCaseCodes && this.useCaseCodes.includes('sys_user_onlineList')
196
+ );
197
+ }
198
+ },
199
+ data() {
200
+ return {
201
+ date: '',
202
+ time: '',
203
+ list: [
204
+ {
205
+ type: 'user'
206
+ },
207
+ {
208
+ type: 'date'
209
+ },
210
+ {
211
+ type: 'system',
212
+ icon: 'es-icon-yingyong',
213
+ title: '切换子系统'
214
+ },
215
+ {
216
+ type: 'home',
217
+ icon: 'es-icon-zuomian',
218
+ title: '个人工作台'
219
+ },
220
+ {
221
+ type: 'index',
222
+ icon: 'es-icon-home',
223
+ title: '门户'
224
+ },
225
+ {
226
+ type: 'notice',
227
+ icon: 'es-icon-tongzhi',
228
+ title: '通知消息'
229
+ },
230
+ {
231
+ type: 'refresh',
232
+ icon: 'es-icon-shuaxin',
233
+ title: '刷新'
234
+ },
235
+ {
236
+ type: 'quit',
237
+ icon: 'es-icon-guanji',
238
+ title: '退出'
239
+ },
240
+ {
241
+ type: 'set',
242
+ icon: 'es-icon-xitongguanli',
243
+ title: '设置'
244
+ }
245
+ ],
246
+ showPopper: false,
247
+ useCaseCodes: util.getStorage('useCaseCodes')
248
+ };
249
+ },
250
+ created() {
251
+ this.time = util.timeCycle() + '好!';
252
+ this.date = util.formatDate('', 'yyyy 年 M 月 d 日 ');
253
+ },
254
+ methods: {
255
+ unicode(res) {
256
+ if (!res) {
257
+ return false;
258
+ }
259
+ var reg = new RegExp(/^es-\S+/, 'g');
260
+ let len = res.match(reg) ? res.match(reg).length : 0;
261
+ return len;
262
+ },
263
+ handleClick(res) {
264
+ const { type, event } = res;
265
+ if (event) {
266
+ event();
267
+ } else {
268
+ switch (type) {
269
+ case 'quit':
270
+ this.handleQuit();
271
+ break;
272
+ }
273
+ this.$emit('click', res);
274
+ }
275
+ },
276
+ handleChange(item) {
277
+ this.$emit('change', item);
278
+ },
279
+ handleSelect(res) {
280
+ const { node } = res;
281
+ if (node.extendData && node.extendData.businessStatus == 0) {
282
+ this.$alert(
283
+ node.extendData.businessWarnMsg
284
+ ? node.extendData.businessWarnMsg
285
+ : '此模块还在开发中',
286
+ '提示',
287
+ {
288
+ type: 'warning'
289
+ }
290
+ );
291
+ } else if (!this.application && !node.hasPermission) {
292
+ this.$emit('select', res);
293
+ }
294
+ },
295
+ handleQuit() {
296
+ this.$confirm('确定退出吗?', '退出系统', {
297
+ confirmButtonText: '确定',
298
+ cancelButtonText: '取消',
299
+ type: 'warning'
300
+ })
301
+ .then(() => {
302
+ util
303
+ .ajax({ method: 'post', url: logout })
304
+ .then((res) => {
305
+ if (res.rCode == 0) {
306
+ util.removeStorage([
307
+ 'Authorization',
308
+ 'token',
309
+ 'ssId',
310
+ 'userId',
311
+ 'userName',
312
+ 'auth',
313
+ 'deviceUnique',
314
+ 'menus',
315
+ 'useCaseCodes',
316
+ 'mainConfig',
317
+ 'jump'
318
+ ]);
319
+ if (this.onQuit && typeof this.onQuit === 'function') {
320
+ this.onQuit();
321
+ } else {
322
+ try {
323
+ const loginPage =
324
+ util.getStorage('login') || util.getStorage('loginPage');
325
+ if (loginPage) {
326
+ let src;
327
+ if (!util.startWith(loginPage, ['http', '/'], true)) {
328
+ let pathname = util.win.top.location.pathname;
329
+ if (pathname !== '/') {
330
+ pathname = pathname.split('/');
331
+ pathname.splice(pathname.length - 1);
332
+ pathname = pathname.join('/');
333
+ src = pathname + '/' + loginPage.replace('./', '');
334
+ } else {
335
+ src = pathname + loginPage.replace('./', '');
336
+ }
337
+ } else {
338
+ src = loginPage;
339
+ }
340
+ util.win.top.location.href = src;
341
+ } else if (
342
+ util.win.top.location.href.indexOf('main.html') > -1
343
+ ) {
344
+ util.win.top.location.href = './login.html';
345
+ } else {
346
+ const hash = util.win.top.location.hash;
347
+ if (hash) {
348
+ const len = util.win.top.location.href.indexOf(hash);
349
+ util.win.top.location.href =
350
+ util.win.location.href.slice(0, len) + '#/login';
351
+ } else {
352
+ util.win.top.location.href = '/login.html';
353
+ }
354
+ }
355
+ } catch (error) {
356
+ util.win.postMessage({ type: 1 }, '*');
357
+ }
358
+ }
359
+ }
360
+ })
361
+ .catch((err) => {
362
+ if (err.message && err.message !== 'canceled') {
363
+ this.$message.error(err.message);
364
+ }
365
+ });
366
+ })
367
+ .catch((e) => {});
368
+ },
369
+ handleVisibleChange(res) {
370
+ this.$emit('visible-change', res);
371
+ }
372
+ }
373
+ };
374
+ </script>