eoss 0.1.0-alpha.21 → 0.1.0-alpha.23

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 (213) hide show
  1. package/lib/account-login.js +125 -125
  2. package/lib/alert.js +2 -2
  3. package/lib/aside.js +2 -2
  4. package/lib/autocomplete.js +239 -239
  5. package/lib/avatar.js +2 -2
  6. package/lib/backtop.js +4 -4
  7. package/lib/badge.js +2 -2
  8. package/lib/breadcrumb-item.js +2 -2
  9. package/lib/breadcrumb.js +2 -2
  10. package/lib/button-group.js +2 -2
  11. package/lib/button.js +2 -2
  12. package/lib/ca-login.js +6 -6
  13. package/lib/calendar.js +2 -2
  14. package/lib/card.js +2 -2
  15. package/lib/carousel-item.js +22 -22
  16. package/lib/carousel.js +40 -26
  17. package/lib/cascader-panel.js +12 -12
  18. package/lib/cascader.js +506 -492
  19. package/lib/checkbox-button.js +2 -2
  20. package/lib/checkbox-group.js +137 -137
  21. package/lib/checkbox.js +2 -2
  22. package/lib/col.js +2 -2
  23. package/lib/collapse-item.js +1224 -1030
  24. package/lib/collapse.js +1225 -1030
  25. package/lib/color-picker.js +12 -12
  26. package/lib/container.js +2 -2
  27. package/lib/cron.js +2 -2
  28. package/lib/data-table.js +121 -121
  29. package/lib/date-picker.js +225 -225
  30. package/lib/dialog.js +17 -17
  31. package/lib/divider.js +2 -2
  32. package/lib/drawer.js +6 -6
  33. package/lib/dropdown-item.js +2 -2
  34. package/lib/dropdown-menu.js +10 -10
  35. package/lib/dropdown.js +13 -13
  36. package/lib/email-login.js +365 -365
  37. package/lib/empty.js +2 -2
  38. package/lib/eoss.common.js +21402 -20724
  39. package/lib/flip.js +2 -2
  40. package/lib/flow-group.js +251 -251
  41. package/lib/flow.js +15933 -18946
  42. package/lib/flows.js +9195 -0
  43. package/lib/footer.js +2 -2
  44. package/lib/form-item.js +28 -17
  45. package/lib/form.js +1228 -1033
  46. package/lib/header.js +2 -2
  47. package/lib/icon.js +129 -129
  48. package/lib/icons.js +4 -4
  49. package/lib/image-viewer.js +6 -6
  50. package/lib/image.js +4 -4
  51. package/lib/index.js +1 -1
  52. package/lib/infinite-scroll.js +4 -4
  53. package/lib/input-number.js +11 -11
  54. package/lib/input.js +28 -14
  55. package/lib/link.js +2 -2
  56. package/lib/loading.js +6 -6
  57. package/lib/login.js +277 -229
  58. package/lib/lowcode.js +964 -325
  59. package/lib/main.js +634 -565
  60. package/lib/marquee.js +6 -6
  61. package/lib/menu-item-group.js +2 -2
  62. package/lib/menu-item.js +2 -2
  63. package/lib/menu.js +1934 -1934
  64. package/lib/message-box.js +12 -12
  65. package/lib/message.js +10 -10
  66. package/lib/notification.js +16 -16
  67. package/lib/option-group.js +2 -2
  68. package/lib/option.js +6 -6
  69. package/lib/page-header.js +2 -2
  70. package/lib/pagination.js +16 -16
  71. package/lib/phone-login.js +127 -127
  72. package/lib/popconfirm.js +4 -4
  73. package/lib/popover.js +219 -219
  74. package/lib/progress.js +2 -2
  75. package/lib/qr-code.js +8 -8
  76. package/lib/qrcode-login.js +119 -119
  77. package/lib/radio-button.js +2 -2
  78. package/lib/radio-group.js +119 -119
  79. package/lib/radio.js +2 -2
  80. package/lib/rate.js +6 -6
  81. package/lib/row.js +2 -2
  82. package/lib/scrollbar.js +46 -32
  83. package/lib/select.js +823 -796
  84. package/lib/selector-panel.js +141 -141
  85. package/lib/selector.js +1040 -160
  86. package/lib/slider.js +2 -2
  87. package/lib/step.js +1225 -1030
  88. package/lib/steps.js +6 -6
  89. package/lib/submenu.js +27 -27
  90. package/lib/switch.js +15 -15
  91. package/lib/tab-pane.js +2 -2
  92. package/lib/table-column.js +8 -8
  93. package/lib/table.js +2530 -2516
  94. package/lib/tabs.js +28 -14
  95. package/lib/tag.js +2 -2
  96. package/lib/theme-chalk/autocomplete.css +1 -1
  97. package/lib/theme-chalk/base.css +1 -1
  98. package/lib/theme-chalk/cascader-panel.css +1 -1
  99. package/lib/theme-chalk/cascader.css +1 -1
  100. package/lib/theme-chalk/checkbox-group.css +1 -1
  101. package/lib/theme-chalk/date-picker.css +1 -1
  102. package/lib/theme-chalk/descriptions-item.css +1 -1
  103. package/lib/theme-chalk/descriptions.css +1 -1
  104. package/lib/theme-chalk/empty.css +1 -1
  105. package/lib/theme-chalk/flow.css +1 -1
  106. package/lib/theme-chalk/flows.css +1 -0
  107. package/lib/theme-chalk/form.css +1 -1
  108. package/lib/theme-chalk/index.css +1 -1
  109. package/lib/theme-chalk/input-number.css +1 -1
  110. package/lib/theme-chalk/input.css +1 -1
  111. package/lib/theme-chalk/lowcode.css +1 -1
  112. package/lib/theme-chalk/main.css +1 -1
  113. package/lib/theme-chalk/menu.css +1 -1
  114. package/lib/theme-chalk/message-box.css +1 -1
  115. package/lib/theme-chalk/message.css +1 -1
  116. package/lib/theme-chalk/notification.css +1 -1
  117. package/lib/theme-chalk/pagination.css +1 -1
  118. package/lib/theme-chalk/scrollbar.css +1 -1
  119. package/lib/theme-chalk/select.css +1 -1
  120. package/lib/theme-chalk/selector-panel.css +1 -1
  121. package/lib/theme-chalk/selector.css +1 -1
  122. package/lib/theme-chalk/slider.css +1 -1
  123. package/lib/theme-chalk/table.css +1 -1
  124. package/lib/theme-chalk/tabs.css +1 -1
  125. package/lib/theme-chalk/time-picker.css +1 -1
  126. package/lib/theme-chalk/time-select.css +1 -1
  127. package/lib/theme-chalk/timeline-item.css +1 -1
  128. package/lib/theme-chalk/transfer.css +1 -1
  129. package/lib/theme-chalk/tree.css +1 -1
  130. package/lib/theme-chalk/upload.css +1 -1
  131. package/lib/time-picker.js +16 -16
  132. package/lib/time-select.js +15 -15
  133. package/lib/timeline-item.js +2 -2
  134. package/lib/timeline.js +2 -2
  135. package/lib/tips.js +129 -129
  136. package/lib/toolbar.js +4 -4
  137. package/lib/tooltip.js +220 -220
  138. package/lib/transfer.js +8 -8
  139. package/lib/tree-group.js +124 -124
  140. package/lib/tree.js +144 -144
  141. package/lib/upload.js +155 -155
  142. package/lib/utils/resize-event.js +20 -6
  143. package/package.json +3 -1
  144. package/packages/carousel/src/carousel.vue +2 -2
  145. package/packages/flow/index.js +4 -4
  146. package/packages/flow/src/component/FreeCirculation.vue +4 -3
  147. package/packages/flow/src/component/SendMsg.vue +2 -4
  148. package/packages/flow/src/component/opinions.vue +203 -226
  149. package/packages/flow/src/component/taskUnionExamine.vue +2 -4
  150. package/packages/flow/src/freeStartFlow.vue +2 -2
  151. package/packages/flow/src/selectUser.vue +36 -1
  152. package/packages/flow/src/supervise.vue +4 -2
  153. package/packages/flows/index.js +7 -0
  154. package/packages/flows/readme.md +600 -0
  155. package/packages/flows/src/components/basis.vue +108 -0
  156. package/packages/flows/src/components/distribute.vue +42 -0
  157. package/packages/flows/src/components/opinions-file.vue +123 -0
  158. package/packages/{flow-copy/src/component → flows/src/components}/opinions.vue +227 -204
  159. package/packages/flows/src/components/quick-actions.vue +64 -0
  160. package/packages/flows/src/components/reject.vue +83 -0
  161. package/packages/flows/src/components/start-flow.vue +210 -0
  162. package/packages/flows/src/flow.vue +510 -0
  163. package/packages/{flow/src/flow.vue → flows/src/flows.vue} +40 -1327
  164. package/packages/form/src/form-item.vue +9 -2
  165. package/packages/form/src/label-wrap.vue +4 -1
  166. package/packages/login/src/login.vue +61 -32
  167. package/packages/lowcode/src/aside.vue +15 -2
  168. package/packages/lowcode/src/editor.vue +187 -0
  169. package/packages/lowcode/src/lowcode.vue +195 -41
  170. package/packages/lowcode/src/pages.vue +174 -26
  171. package/packages/lowcode/src/toolbar.vue +3 -18
  172. package/packages/main/src/components/pages.vue +97 -65
  173. package/packages/main/src/components/router-page.vue +0 -2
  174. package/packages/main/src/gzw.vue +3 -2
  175. package/packages/main/src/minxs.js +72 -51
  176. package/packages/menu/src/menu.vue +4 -4
  177. package/packages/select/src/select.vue +5 -0
  178. package/packages/selector/src/selector.vue +147 -17
  179. package/packages/theme-chalk/src/base.scss +6 -0
  180. package/packages/theme-chalk/src/checkbox-group.scss +1 -0
  181. package/packages/theme-chalk/src/common/var.scss +1 -1
  182. package/packages/theme-chalk/src/flow.scss +7 -4
  183. package/packages/theme-chalk/src/flows.scss +141 -0
  184. package/packages/theme-chalk/src/form.scss +1 -1
  185. package/packages/theme-chalk/src/index.scss +1 -0
  186. package/packages/theme-chalk/src/input.scss +1 -0
  187. package/packages/theme-chalk/src/lowcode.scss +21 -18
  188. package/packages/theme-chalk/src/select.scss +3 -1
  189. package/packages/theme-chalk/src/selector.scss +11 -5
  190. package/src/index.js +4 -1
  191. package/src/utils/resize-event.js +21 -7
  192. package/packages/flow/src/component/quick-actions.vue +0 -1168
  193. package/packages/flow-copy/index.js +0 -7
  194. package/packages/flow-copy/src/component/Circulate.vue +0 -452
  195. package/packages/flow-copy/src/component/CustomPreset.vue +0 -333
  196. package/packages/flow-copy/src/component/FreeCirculation.vue +0 -275
  197. package/packages/flow-copy/src/component/Preset.vue +0 -273
  198. package/packages/flow-copy/src/component/SendMsg.vue +0 -290
  199. package/packages/flow-copy/src/component/TimeLimit.vue +0 -205
  200. package/packages/flow-copy/src/component/taskUnionExamine.vue +0 -818
  201. package/packages/flow-copy/src/freeStartFlow.vue +0 -2912
  202. package/packages/flow-copy/src/processForm.vue +0 -1411
  203. package/packages/flow-copy/src/processReject.vue +0 -319
  204. package/packages/flow-copy/src/reset.vue +0 -944
  205. package/packages/flow-copy/src/selectUser.vue +0 -513
  206. package/packages/flow-copy/src/startTaskRead.vue +0 -723
  207. package/packages/flow-copy/src/supervise.vue +0 -182
  208. package/packages/flow-copy/src/table.vue +0 -65
  209. /package/packages/{flow-copy → flow}/src/component/FileList.vue +0 -0
  210. /package/packages/{flow-copy → flow}/src/main.vue +0 -0
  211. /package/packages/{flow-copy/src → flows/src/components}/form.vue +0 -0
  212. /package/packages/{flow/src/component → flows/src/components}/message.vue +0 -0
  213. /package/packages/{flow/src/component → flows/src/components}/opinions-list.vue +0 -0
@@ -11,31 +11,31 @@
11
11
  <div
12
12
  class="es-main-pages__handle--item"
13
13
  :class="{ 'is-disabled': refresh }"
14
- @click="handleRefresh"
14
+ @click.stop="handleRefresh"
15
15
  >
16
16
  刷新
17
17
  </div>
18
- <div class="es-main-pages__handle--item" @click="handleClose">
18
+ <div class="es-main-pages__handle--item" @click.stop="handleClose">
19
19
  关闭标签
20
20
  </div>
21
21
  <div
22
22
  class="es-main-pages__handle--item"
23
23
  :class="{ 'is-disabled': other }"
24
- @click="other ? '' : handleCloseOther"
24
+ @click.stop="handleCloseOther"
25
25
  >
26
26
  关闭其他
27
27
  </div>
28
28
  <div
29
29
  class="es-main-pages__handle--item"
30
30
  :class="{ 'is-disabled': left }"
31
- @click="left ? '' : handleCloseLeft"
31
+ @click.stop="handleCloseLeft"
32
32
  >
33
33
  关闭左侧
34
34
  </div>
35
35
  <div
36
36
  class="es-main-pages__handle--item"
37
37
  :class="{ 'is-disabled': right }"
38
- @click="right ? '' : handleCloseRight"
38
+ @click.stop="handleCloseRight"
39
39
  >
40
40
  关闭右侧
41
41
  </div>
@@ -72,12 +72,10 @@
72
72
  </div>
73
73
  <!-- 菜单 end -->
74
74
  <es-tab-pane
75
- v-for="(item, index) in tabs"
75
+ v-for="(item, index) in newTabs"
76
76
  :class="{
77
77
  'is-fourthTabs':
78
- isFourthTabs &&
79
- item.fourthTabs &&
80
- item.fourthTabs.length
78
+ isFourthTabs && item.fourthTabs && item.fourthTabs.length
81
79
  }"
82
80
  :key="item.id"
83
81
  :label="item.text || item.name"
@@ -85,11 +83,7 @@
85
83
  >
86
84
  <es-menu
87
85
  class="es-main-pages__sub-menu-fourthTabs"
88
- v-if="
89
- isFourthTabs &&
90
- item.fourthTabs &&
91
- item.fourthTabs.length
92
- "
86
+ v-if="isFourthTabs && item.fourthTabs && item.fourthTabs.length"
93
87
  mode="horizontal"
94
88
  :default-active="item.defaultActive"
95
89
  :contents="item.fourthTabs"
@@ -103,7 +97,6 @@
103
97
  <router-page
104
98
  v-if="item.method === 'router'"
105
99
  v-bind="item"
106
- :query="$parent.params"
107
100
  ></router-page>
108
101
  <iframe
109
102
  v-else
@@ -142,6 +135,10 @@ export default {
142
135
  },
143
136
 
144
137
  props: {
138
+ tabs: {
139
+ type: Array,
140
+ default: () => []
141
+ },
145
142
  showMenu: {
146
143
  type: Boolean,
147
144
  default: false
@@ -169,6 +166,7 @@ export default {
169
166
 
170
167
  data() {
171
168
  return {
169
+ newTabs: [],
172
170
  host: getStorage('host') || '',
173
171
  //是否显示操作栏
174
172
  operate: false,
@@ -189,20 +187,6 @@ export default {
189
187
  mode() {
190
188
  return this.mainBox.mode;
191
189
  },
192
- tabs: {
193
- get() {
194
- return this.isFourthTabs ? this.$main.tabs.map(item => {
195
- let defaultActive = ((item.fourthTabs || []).filter(ele => item.url === ele.url)[0] || {}).id || '';
196
- return defaultActive ? {
197
- ...item,
198
- defaultActive: defaultActive
199
- } : item;
200
- }):this.$main.tabs;
201
- },
202
- set(val) {
203
- this.$main.tabs = val;
204
- }
205
- },
206
190
  activeName: {
207
191
  get() {
208
192
  return this.$main.activeName;
@@ -214,15 +198,37 @@ export default {
214
198
  },
215
199
 
216
200
  watch: {
201
+ tabs: {
202
+ immediate: true,
203
+ deep: true,
204
+ handler(val) {
205
+ if (this.isFourthTabs) {
206
+ this.newTabs = val.map((item) => {
207
+ let defaultActive =
208
+ (
209
+ (item.fourthTabs || []).filter(
210
+ (ele) => item.url === ele.url
211
+ )[0] || {}
212
+ ).id || '';
213
+ return defaultActive
214
+ ? {
215
+ ...item,
216
+ defaultActive: defaultActive
217
+ }
218
+ : item;
219
+ });
220
+ return;
221
+ }
222
+ this.newTabs = val;
223
+ }
224
+ }
217
225
  },
218
226
 
219
- created() {
220
- },
227
+ created() {},
221
228
 
222
229
  mounted() {},
223
230
 
224
- beforeDestroy() {
225
- },
231
+ beforeDestroy() {},
226
232
 
227
233
  methods: {
228
234
  /**
@@ -233,11 +239,11 @@ export default {
233
239
  renderUrl(url) {
234
240
  const userInfo = this.$main.userInfo || this.$main.userModel || {};
235
241
  for (let key in userInfo) {
236
- url = url.replace(new RegExp(`{{${key}}}`, 'g'), userInfo[key]);
242
+ url = url.replace(new RegExp(`{${key}}`, 'g'), userInfo[key]);
237
243
  }
238
244
  return url;
239
245
  },
240
-
246
+
241
247
  handleSelect(res, index) {
242
248
  const { node } = res;
243
249
  if (node.urlopenmode === 1 || node.openModel === 1) {
@@ -248,7 +254,7 @@ export default {
248
254
  return;
249
255
  }
250
256
 
251
- const updatedTabs = [...this.tabs];
257
+ const updatedTabs = [...this.newTabs];
252
258
  updatedTabs[index].url = node.url;
253
259
  this.$main.tabs = updatedTabs;
254
260
  },
@@ -258,7 +264,7 @@ export default {
258
264
  * @date 2024年9月7日
259
265
  **/
260
266
  handleTabClick() {
261
- const activeTab = this.tabs.find(item => item.id == this.activeName);
267
+ const activeTab = this.newTabs.find((item) => item.id == this.activeName);
262
268
  this.$emit('tab-click', this.activeName, activeTab);
263
269
  },
264
270
  /**
@@ -267,13 +273,13 @@ export default {
267
273
  * @date 2024年9月7日
268
274
  **/
269
275
  handleRemove(name) {
270
- let len = this.tabs.length - 1;
271
- let i = indexOfObj(this.tabs, name, 'id,code,appCode');
272
- let tab = this.tabs[i];
276
+ let len = this.newTabs.length - 1;
277
+ let i = indexOfObj(this.newTabs, name, 'id,code,appCode');
278
+ let tab = this.newTabs[i];
273
279
  let activeTab;
274
280
 
275
281
  if (i > -1) {
276
- const updatedTabs = this.tabs.filter((item) => item.id !== name);
282
+ const updatedTabs = this.newTabs.filter((item) => item.id !== name);
277
283
 
278
284
  if (updatedTabs.length == 0) {
279
285
  this.activeName = '';
@@ -286,7 +292,7 @@ export default {
286
292
  }
287
293
 
288
294
  this.$emit('tab-remove', tab, activeTab);
289
- this.tabs = updatedTabs;
295
+ this.newTabs = updatedTabs;
290
296
  }
291
297
  },
292
298
  /**
@@ -304,13 +310,13 @@ export default {
304
310
  if (index == 0) {
305
311
  this.left = true;
306
312
  }
307
- if (index == this.tabs.length - 1) {
313
+ if (index == this.newTabs.length - 1) {
308
314
  this.right = true;
309
315
  }
310
- if (this.tabs.length == 1) {
316
+ if (this.newTabs.length == 1) {
311
317
  this.other = true;
312
318
  }
313
- if (this.tabs[index].id != this.activeName) {
319
+ if (this.newTabs[index].id != this.activeName) {
314
320
  this.refresh = true;
315
321
  }
316
322
 
@@ -347,12 +353,12 @@ export default {
347
353
  if (this.refresh) {
348
354
  return;
349
355
  }
350
- let tab = this.tabs[this.index];
356
+ let tab = this.newTabs[this.index];
351
357
  if (tab.method == 'iframe') {
352
- this.tabs[this.index].url = timestampUrl(tab.url);
358
+ this.newTabs[this.index].url = timestampUrl(tab.url);
353
359
  }
354
360
  if (tab.method === 'router') {
355
- this.$set(this.tabs[this.index], 'keys', uuid());
361
+ this.$set(this.newTabs[this.index], 'keys', uuid());
356
362
  }
357
363
  this.operate = false;
358
364
  window.removeEventListener('click', this.closeTabsEvents);
@@ -363,19 +369,25 @@ export default {
363
369
  * @date 2024年9月7日
364
370
  **/
365
371
  handleClose() {
366
- let i = indexOfObj(this.tabs, this.activeName, 'id');
367
- if (this.tabs.length == 1) {
372
+ let i = indexOfObj(this.newTabs, this.activeName, 'id');
373
+ let activeTab = this.newTabs[i];
374
+ let removeTab = [this.newTabs[this.index]];
375
+ if (this.newTabs.length == 1) {
368
376
  this.activeName = '';
377
+ activeTab = '';
369
378
  } else if (i == this.index) {
370
- if (this.index < this.tabs.length - 1) {
371
- this.activeName = this.tabs[this.index + 1].id;
379
+ if (this.index < this.newTabs.length - 1) {
380
+ activeTab = this.newTabs[this.index + 1];
381
+ this.activeName = activeTab.id;
372
382
  } else {
373
- this.activeName = this.tabs[this.index - 1].id;
383
+ activeTab = this.newTabs[this.index - 1];
384
+ this.activeName = activeTab.id;
374
385
  }
375
386
  }
376
- this.tabs.splice(i, 1);
387
+ this.newTabs.splice(i, 1);
377
388
  this.operate = false;
378
389
  window.removeEventListener('click', this.closeTabsEvents);
390
+ this.$emit('tab-change', this.newTabs, removeTab, activeTab);
379
391
  },
380
392
  /**
381
393
  * @desc:关闭其他标签
@@ -383,11 +395,16 @@ export default {
383
395
  * @date 2024年9月7日
384
396
  **/
385
397
  handleCloseOther() {
386
- let tab = this.tabs[this.index];
387
- this.tabs = [tab];
388
- this.activeName = tab.id;
398
+ if (this.other) {
399
+ return;
400
+ }
401
+ const activeTab = this.newTabs[this.index];
402
+ const removeTab = this.newTabs.filter((item) => item.id != activeTab.id);
403
+ this.newTabs = [activeTab];
404
+ this.activeName = activeTab.id;
389
405
  this.operate = false;
390
406
  window.removeEventListener('click', this.closeTabsEvents);
407
+ this.$emit('tab-change', this.newTabs, removeTab, activeTab);
391
408
  },
392
409
  /**
393
410
  * @desc:关闭左侧标签
@@ -395,13 +412,19 @@ export default {
395
412
  * @date 2024年9月7日
396
413
  **/
397
414
  handleCloseLeft() {
398
- let i = indexOfObj(this.tabs, this.activeName, 'id');
399
- if (i > this.index) {
400
- this.activeName = this.tabs[i].id;
415
+ if (this.left) {
416
+ return;
417
+ }
418
+ let i = indexOfObj(this.newTabs, this.activeName, 'id');
419
+ let activeTab = this.newTabs[i];
420
+ if (i < this.index) {
421
+ activeTab = this.newTabs[this.index];
401
422
  }
402
- this.tabs.splice(0, i);
423
+ this.activeName = activeTab.id;
424
+ const removeTab = this.newTabs.splice(0, this.index);
403
425
  this.operate = false;
404
426
  window.removeEventListener('click', this.closeTabsEvents);
427
+ this.$emit('tab-change', this.newTabs, removeTab, activeTab);
405
428
  },
406
429
  /**
407
430
  * @desc:关闭右侧标签
@@ -409,13 +432,22 @@ export default {
409
432
  * @date 2024年9月7日
410
433
  **/
411
434
  handleCloseRight() {
412
- let i = indexOfObj(this.tabs, this.activeName, 'id');
413
- if (i < this.index) {
414
- this.activeName = this.tabs[i].id;
435
+ if (this.right) {
436
+ return;
437
+ }
438
+ let i = indexOfObj(this.newTabs, this.activeName, 'id');
439
+ let activeTab = this.newTabs[i];
440
+ if (i > this.index) {
441
+ activeTab = this.newTabs[this.index];
415
442
  }
416
- this.tabs.splice(i + 1, this.tabs.length - 1);
443
+ this.activeName = activeTab.id;
444
+ const removeTab = this.newTabs.splice(
445
+ this.index + 1,
446
+ this.newTabs.length - 1
447
+ );
417
448
  this.operate = false;
418
449
  window.removeEventListener('click', this.closeTabsEvents);
450
+ this.$emit('tab-change', this.newTabs, removeTab, activeTab);
419
451
  }
420
452
  }
421
453
  };
@@ -111,5 +111,3 @@ export default {
111
111
  }
112
112
  };
113
113
  </script>
114
-
115
- <style lang="scss" scoped></style>
@@ -17,12 +17,13 @@
17
17
  <!-- 路由、iframe -->
18
18
  <pages
19
19
  :isFourthTabs="isFourthTabs"
20
- :tabs.sync="tabs"
20
+ :tabs="tabs"
21
21
  :show-menu="showMenu"
22
22
  :fold="fold"
23
23
  :spread="spread"
24
24
  :active="activeName"
25
25
  :tabs-type="tabsType"
26
+ @tab-change="handleTabChange"
26
27
  @tab-click="handleTabClick"
27
28
  @tab-remove="handleRemove"
28
29
  @fourthTabs="handleFourthTabs"
@@ -278,7 +279,7 @@ export default {
278
279
  handleClickAi() {
279
280
  // 只有非拖动状态才执行点击
280
281
  if (this.isDragging || this.hasDragged) return;
281
- this.handlerSetDrawer({type: 'ai', direction: 'rtl', visible: true});
282
+ this.handlerSetDrawer({ type: 'ai', direction: 'rtl', visible: true });
282
283
  },
283
284
 
284
285
  startDrag(event) {
@@ -36,7 +36,7 @@ import {
36
36
  exclAttribute,
37
37
  getParams
38
38
  } from 'eoss/src/utils/util';
39
- import { getStorage, setStorage, removeStorage} from 'eoss/src/utils/storage';
39
+ import { getStorage, setStorage, removeStorage } from 'eoss/src/utils/storage';
40
40
  import { timeCycle } from 'eoss/src/utils/date';
41
41
  import { socket } from 'eoss/src/utils/websocket';
42
42
  import { ajax, getMainConfig } from 'eoss/src/utils/ajax';
@@ -67,7 +67,7 @@ export default {
67
67
  },
68
68
  inject: {
69
69
  mainBox: {
70
- default: () => {}
70
+ default: () => { }
71
71
  }
72
72
  },
73
73
  components: {
@@ -1024,10 +1024,10 @@ export default {
1024
1024
  type = resType;
1025
1025
  }
1026
1026
  if (type === 'open') {
1027
- this.handlerSetDrawer({type: 'ai', direction: 'rtl', ...config, visible: true});
1027
+ this.handlerSetDrawer({ type: 'ai', direction: 'rtl', ...config, visible: true });
1028
1028
  this.aiOpen = true;
1029
1029
  } else if (type === 'close' || type === 'float') {
1030
- this.handlerSetDrawer({type: 'ai', direction: 'rtl', ...config, visible: false});
1030
+ this.handlerSetDrawer({ type: 'ai', direction: 'rtl', ...config, visible: false });
1031
1031
  // this.aiOpen = false;
1032
1032
  }
1033
1033
  },
@@ -1116,21 +1116,9 @@ export default {
1116
1116
  let appCode;
1117
1117
  if (res.path !== '/' && pathname === res.path) {
1118
1118
  if (res.components) {
1119
- if (!res.components[code]) {
1120
- console.error(
1121
- '路由“命名视图”规范属性名称与菜单appCode不一致',
1122
- res,
1123
- code
1124
- );
1125
- appCode = Object.keys(res.components).filter((item) => {
1126
- return item !== 'default';
1127
- })[0];
1128
- }
1129
- } else {
1130
- console.error(
1131
- '请根据路由“命名视图”规范,正确添加components属性名称',
1132
- res
1133
- );
1119
+ appCode = Object.keys(res.components).filter((item) => {
1120
+ return item !== 'default';
1121
+ })[0];
1134
1122
  }
1135
1123
  return appCode ? { path: pathname, appCode } : pathname;
1136
1124
  }
@@ -1229,7 +1217,7 @@ export default {
1229
1217
  try {
1230
1218
  window.webPageWatermark = res[i];
1231
1219
  watermark(res[i]);
1232
- } catch (error) {}
1220
+ } catch (error) { }
1233
1221
  break;
1234
1222
  case 'openModel':
1235
1223
  setStorage({ key: 'openModel', value: res[i] });
@@ -1237,12 +1225,12 @@ export default {
1237
1225
  case 'aiConfig':
1238
1226
  if (typeof res[i] === 'string') {
1239
1227
  try {
1240
- this.aiConfig = {width: 56, height: 56, ...JSON.parse(res[i])};
1228
+ this.aiConfig = { width: 56, height: 56, ...JSON.parse(res[i]) };
1241
1229
  } catch (error) {
1242
1230
  this.aiConfig = { width: 56, height: 56, url: res[i] };
1243
1231
  }
1244
1232
  } else {
1245
- this.aiConfig = {width: 56, height: 56, ...res[i]};
1233
+ this.aiConfig = { width: 56, height: 56, ...res[i] };
1246
1234
  }
1247
1235
  this.aiConfig.float && (this.aiFloat = true);
1248
1236
  break;
@@ -1458,14 +1446,14 @@ export default {
1458
1446
  let obj = null;
1459
1447
  if (appid) {
1460
1448
  obj = this.getMenu(this.menuApps, appid, 'id');
1461
- }
1462
- if (!obj) {
1463
- obj = this.getMenu(this.menus, appid, 'id');
1464
- }
1465
- if (!obj) {
1466
- console.error('未找到应用菜单', appid);
1467
- } else {
1468
- obj = JSON.parse(JSON.stringify(obj));
1449
+ if (!obj) {
1450
+ obj = this.getMenu(this.menus, appid, 'id');
1451
+ }
1452
+ if (!obj) {
1453
+ console.error('未找到应用菜单', appid);
1454
+ } else {
1455
+ obj = JSON.parse(JSON.stringify(obj));
1456
+ }
1469
1457
  }
1470
1458
  let homePage = null;
1471
1459
  if (this.indexUrl) {
@@ -1603,23 +1591,30 @@ export default {
1603
1591
  if (this.urlParseCache[cacheKey]) {
1604
1592
  const cached = this.urlParseCache[cacheKey];
1605
1593
  res.method = cached.method;
1606
- if (cached.appCode) res.appCode = cached.appCode;
1607
- if (cached.path) res.path = cached.path;
1608
- if (cached.keys) res.keys = cached.keys;
1594
+ if (cached.appCode) {
1595
+ res.appCode = cached.appCode;
1596
+ };
1597
+ if (cached.path) {
1598
+ res.path = cached.path;
1599
+ };
1600
+ if (cached.keys) {
1601
+ res.keys = cached.keys;
1602
+ };
1609
1603
  return res;
1610
1604
  }
1611
1605
  let urls = url.split('?');
1612
1606
  res.method = 'iframe';
1613
1607
  const routes = this.$router.options.routes;
1614
1608
  if (routes) {
1615
- let path = this.hasRouter(routes, urls[0], res.appCode);
1609
+ let path = this.hasRouter(routes, urls[0], res.appCode || res.code);
1616
1610
  if (path) {
1617
1611
  res.method = 'router';
1618
1612
  if (typeof path === 'string') {
1619
1613
  res.path = path;
1614
+ res.appCode = res.appCode || res.code;
1620
1615
  } else {
1621
1616
  res.path = path.path;
1622
- res.appCode = path.appCode;
1617
+ res.appCode = res.appCode || res.code || path.appCode;
1623
1618
  }
1624
1619
  res.keys = uuid();
1625
1620
  }
@@ -1914,7 +1909,7 @@ export default {
1914
1909
  if (this.$store) {
1915
1910
  try {
1916
1911
  this.$store.commit('websocket', data);
1917
- } catch (error) {}
1912
+ } catch (error) { }
1918
1913
  }
1919
1914
  const bus = this.bus || this.$eventBus || this.$root.Bus;
1920
1915
  if (bus) {
@@ -2029,16 +2024,16 @@ export default {
2029
2024
  let tab = this.setIframeType(obj);
2030
2025
  this.tabs.push(tab);
2031
2026
  this.activeName = obj.id;
2032
- this.tabMenus[tab.id] = {...menus, parentAppId: res.id};
2027
+ this.tabMenus[tab.id] = { ...menus, parentAppId: res.id };
2033
2028
  } else {
2034
2029
  this.activeName = obj.id;
2035
2030
  }
2036
2031
  if (
2037
2032
  (menus.children && menus.children.length) ||
2038
- (menus.fourthTabs && menus.fourthTabs.length)
2033
+ (menus.fourthTabs && menus.fourthTabs.length)
2039
2034
  ) {
2040
2035
  this.subActive = obj.id;
2041
- this.subMenus = {...menus, parentAppId: res.id};
2036
+ this.subMenus = { ...menus, parentAppId: res.id };
2042
2037
  this.showMenu = this.isFourthTabs ? menus.children.length > 0 : true;
2043
2038
  this.spread = false;
2044
2039
  this.fold = false;
@@ -2055,7 +2050,7 @@ export default {
2055
2050
  (menus.children && menus.children.length) ||
2056
2051
  (menus.fourthTabs && menus.fourthTabs.length)
2057
2052
  ) {
2058
- this.subMenus = {...menus, parentAppId: res.id};
2053
+ this.subMenus = { ...menus, parentAppId: res.id };
2059
2054
  this.showMenu = true;
2060
2055
  this.spread = false;
2061
2056
  this.fold = false;
@@ -2075,14 +2070,14 @@ export default {
2075
2070
  this.$alert('没有关联菜单,请联系管理员!', '提示', {
2076
2071
  confirmButtonText: '确定',
2077
2072
  type: 'warning'
2078
- }).catch(() => {});
2073
+ }).catch(() => { });
2079
2074
  } else {
2080
2075
  this.spread = false;
2081
2076
  this.fold = false;
2082
- this.subMenus = subMenus ? {...subMenus, parentAppId: res.id} : null;
2077
+ this.subMenus = subMenus ? { ...subMenus, parentAppId: res.id } : null;
2083
2078
  this.showMenu = subMenus
2084
2079
  ? (subMenus.children && subMenus.children.length > 0) ||
2085
- (subMenus.fourthTabs && subMenus.fourthTabs.length > 0)
2080
+ (subMenus.fourthTabs && subMenus.fourthTabs.length > 0)
2086
2081
  : false;
2087
2082
  if (subMenus.url) {
2088
2083
  // subMenus = JSON.parse(JSON.stringify(subMenus));
@@ -2104,7 +2099,7 @@ export default {
2104
2099
  * @author huangbo
2105
2100
  * @date 2024年9月7日
2106
2101
  **/
2107
- handlerSetDrawer({type, direction = 'ltr', visible = true, size = '100%'}) {
2102
+ handlerSetDrawer({ type, direction = 'ltr', visible = true, size = '100%' }) {
2108
2103
  this.drawer.visible = visible;
2109
2104
  this.drawer.active = type;
2110
2105
  this.drawer.direction = direction;
@@ -2144,7 +2139,7 @@ export default {
2144
2139
  n = index;
2145
2140
  return item.id === this.activeName;
2146
2141
  });
2147
- tab = this.setIframeType({...this.tabs[n], url: res.url});
2142
+ tab = this.setIframeType({ ...this.tabs[n], url: res.url });
2148
2143
  this.$set(this.tabs, n, tab);
2149
2144
  },
2150
2145
  /**
@@ -2161,8 +2156,8 @@ export default {
2161
2156
  appId: res.id
2162
2157
  }
2163
2158
  })
2164
- .then(() => {})
2165
- .catch(() => {});
2159
+ .then(() => { })
2160
+ .catch(() => { });
2166
2161
  this.showMsg = false;
2167
2162
  this.showSet = false;
2168
2163
  const tabs = [...this.tabs];
@@ -2250,6 +2245,31 @@ export default {
2250
2245
  }
2251
2246
  }
2252
2247
  },
2248
+ /**
2249
+ * @desc:tabs页签删除事件
2250
+ * @author huangbo
2251
+ * @date 2024年9月7日
2252
+ **/
2253
+ handleTabChange(tabs, removeTab, activeTab) {
2254
+ this.tabs = JSON.parse(JSON.stringify(tabs));
2255
+ removeTab.forEach((item) => {
2256
+ delete this.tabMenus[item.id];
2257
+ });
2258
+ if (Object.keys(this.tabMenus).length === 0) {
2259
+ this.subActive = '';
2260
+ }
2261
+ if (activeTab) {
2262
+ if (activeTab.text) {
2263
+ this.subActive = activeTab.id;
2264
+ return;
2265
+ }
2266
+ this.subActive = '';
2267
+ this.activeName = activeTab.id;
2268
+ return;
2269
+ }
2270
+ this.subActive = '';
2271
+ this.activeName = '';
2272
+ },
2253
2273
  /**
2254
2274
  * @desc:删除iframe
2255
2275
  * @author huangbo
@@ -2257,6 +2277,7 @@ export default {
2257
2277
  **/
2258
2278
  handleRemove(removeTab, activeTab) {
2259
2279
  delete this.tabMenus[removeTab.id];
2280
+ this.tabs = this.tabs.filter((item) => item.id !== removeTab.id);
2260
2281
  this.activeName = activeTab.id;
2261
2282
  if (Object.keys(this.tabMenus).length === 0) {
2262
2283
  this.subActive = '';
@@ -2347,10 +2368,10 @@ export default {
2347
2368
  this.showSet = false;
2348
2369
  break;
2349
2370
  case 'ai':
2350
- this.handlerSetDrawer({type: 'ai', direction: 'rtl', visible: true});
2371
+ this.handlerSetDrawer({ type: 'ai', direction: 'rtl', visible: true });
2351
2372
  break;
2352
2373
  case 'im':
2353
- this.handlerSetDrawer({type: 'im', direction: 'rtl', visible: true});
2374
+ this.handlerSetDrawer({ type: 'im', direction: 'rtl', visible: true });
2354
2375
  break;
2355
2376
  case 'goView':
2356
2377
  window.open(res.path, '_blank');
@@ -2435,9 +2456,9 @@ export default {
2435
2456
  }
2436
2457
  }
2437
2458
  })
2438
- .catch(() => {});
2459
+ .catch(() => { });
2439
2460
  })
2440
- .catch(() => {});
2461
+ .catch(() => { });
2441
2462
  },
2442
2463
  /**
2443
2464
  * @desc:主题、消息回调
@@ -424,10 +424,6 @@ export default {
424
424
  this.$nextTick(() => this.updated());
425
425
  },
426
426
  methods: {
427
- // 处理滚轮事件,阻止冒泡
428
- handleWheel(e) {
429
- this.barSize && e.stopPropagation();
430
- },
431
427
  // 更新选中项索引
432
428
  updateActiveIndex(val) {
433
429
  const item =
@@ -458,6 +454,10 @@ export default {
458
454
  }
459
455
  };
460
456
  },
457
+ // 处理滚轮事件,阻止冒泡
458
+ handleWheel(e) {
459
+ this.barSize && e.stopPropagation();
460
+ },
461
461
  // 处理滚动事件
462
462
  handleScroll() {
463
463
  const { x, y } = scrollMove(this.$refs.menuContainer);