@arkxos/arkos-theme-classic 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (97) hide show
  1. package/README.md +36 -0
  2. package/ark_dist/ark-meta.json +81 -0
  3. package/ark_dist/ark_userChunk_1.js +5 -0
  4. package/ark_dist/ark_userChunk_2.js +5 -0
  5. package/ark_dist/ark_userChunk_3.js +49 -0
  6. package/ark_dist/config.js +79 -0
  7. package/ark_dist/css/layout.93396d23.css +125 -0
  8. package/ark_dist/favicon.ico +0 -0
  9. package/ark_dist/img/401.1800ba9e.gif +0 -0
  10. package/ark_dist/img/404.458c248a.png +0 -0
  11. package/ark_dist/img/404.png +0 -0
  12. package/ark_dist/img/auth_banner.jpg +0 -0
  13. package/ark_dist/img/avatar.jpg +0 -0
  14. package/ark_dist/img/avatar2.gif +0 -0
  15. package/ark_dist/img/avatar3.gif +0 -0
  16. package/ark_dist/img/login-background.1a699c00.jpg +0 -0
  17. package/ark_dist/img/loginbg.svg +1 -0
  18. package/ark_dist/img/logo-r.png +0 -0
  19. package/ark_dist/img/logo.png +0 -0
  20. package/ark_dist/img/no-widgets.svg +57 -0
  21. package/ark_dist/img/tasks-example.png +0 -0
  22. package/ark_dist/img/ver.svg +236 -0
  23. package/ark_dist/index.html +127 -0
  24. package/ark_dist/js/app.4a68e1f9.js +1 -0
  25. package/ark_dist/js/layout.661faa0e.js +3 -0
  26. package/ark_dist/js/layout.661faa0e.js.LICENSE.txt +6 -0
  27. package/ark_dist/js/layout.661faa0e.js.map +1 -0
  28. package/ark_proxy/entry.js +28 -0
  29. package/ark_proxy_es/entry.js +16 -0
  30. package/package.json +110 -0
  31. package/scripts/check.js +13 -0
  32. package/scripts/meta.js +21 -0
  33. package/scripts/prepublishOnly.js +28 -0
  34. package/src/assets/logo.png +0 -0
  35. package/src/auto-imports.d.ts +307 -0
  36. package/src/configs/subApp.ts +9 -0
  37. package/src/entrance/libProperties.ts +28 -0
  38. package/src/entrance/libTypes.ts +26 -0
  39. package/src/loadApp.ts +16 -0
  40. package/src/main.ts +18 -0
  41. package/src/os-themes/classic/assets/401_images/401.gif +0 -0
  42. package/src/os-themes/classic/assets/404_images/404.png +0 -0
  43. package/src/os-themes/classic/assets/404_images/404_cloud.png +0 -0
  44. package/src/os-themes/classic/assets/images/login-background.jpg +0 -0
  45. package/src/os-themes/classic/i18n/en.ts +39 -0
  46. package/src/os-themes/classic/i18n/zh-cn.ts +39 -0
  47. package/src/os-themes/classic/i18nFileBuilder/index.ts +19 -0
  48. package/src/os-themes/classic/images/tabs_images/ark-tab.png +0 -0
  49. package/src/os-themes/classic/index.js +19 -0
  50. package/src/os-themes/classic/layout/components/NavMenu.vue +56 -0
  51. package/src/os-themes/classic/layout/components/iframeView.vue +69 -0
  52. package/src/os-themes/classic/layout/components/search.vue +139 -0
  53. package/src/os-themes/classic/layout/components/setting.vue +95 -0
  54. package/src/os-themes/classic/layout/components/sideM.vue +137 -0
  55. package/src/os-themes/classic/layout/components/tags.vue +476 -0
  56. package/src/os-themes/classic/layout/components/tasks.vue +83 -0
  57. package/src/os-themes/classic/layout/components/topbar.vue +49 -0
  58. package/src/os-themes/classic/layout/components/userbar.vue +238 -0
  59. package/src/os-themes/classic/layout/index.vue +347 -0
  60. package/src/os-themes/classic/layout/other/404.vue +44 -0
  61. package/src/os-themes/classic/layout/other/autoExit.js +51 -0
  62. package/src/os-themes/classic/layout/other/empty.vue +3 -0
  63. package/src/os-themes/classic/router/routerStatic.js +103 -0
  64. package/src/os-themes/classic/router/scrollBehavior.js +22 -0
  65. package/src/os-themes/classic/router/systemRouter.js +36 -0
  66. package/src/os-themes/classic/store/index.js +6 -0
  67. package/src/os-themes/classic/store/modules/global.js +25 -0
  68. package/src/os-themes/classic/store/modules/iframe.js +40 -0
  69. package/src/os-themes/classic/store/modules/keepAlive.js +25 -0
  70. package/src/os-themes/classic/store/modules/viewTags.js +48 -0
  71. package/src/os-themes/classic/style/app.scss +318 -0
  72. package/src/os-themes/classic/style/dark.scss +42 -0
  73. package/src/os-themes/classic/style/fix.scss +87 -0
  74. package/src/os-themes/classic/style/media.scss +52 -0
  75. package/src/os-themes/classic/style/pages.scss +46 -0
  76. package/src/os-themes/classic/style/style.scss +5 -0
  77. package/src/os-themes/classic/utils/useTabs.js +66 -0
  78. package/src/os-themes/classic/views/bg.png +0 -0
  79. package/src/os-themes/classic/views/error/401.vue +82 -0
  80. package/src/os-themes/classic/views/error/404.vue +230 -0
  81. package/src/os-themes/classic/views/home.vue +13 -0
  82. package/src/os-themes/classic/views/login/components/commonPage.vue +35 -0
  83. package/src/os-themes/classic/views/login/components/passwordForm.vue +174 -0
  84. package/src/os-themes/classic/views/login/components/phoneForm.vue +74 -0
  85. package/src/os-themes/classic/views/login/index.vue +210 -0
  86. package/src/os-themes/classic/views/login/resetPassword.vue +125 -0
  87. package/src/os-themes/classic/views/login/userRegister.vue +174 -0
  88. package/src/os-themes/classic/views/redirect/index.vue +14 -0
  89. package/src/os-themes/classic/views/register.vue +219 -0
  90. package/src/shims-vue.d.ts +6 -0
  91. package/src/types/axios.d.ts +13 -0
  92. package/src/types/func.ts +14 -0
  93. package/src/types/global.d.ts +108 -0
  94. package/src/types/layout.d.ts +59 -0
  95. package/src/types/mitt.d.ts +40 -0
  96. package/src/types/pinia.d.ts +93 -0
  97. package/src/types/views.d.ts +27 -0
@@ -0,0 +1,476 @@
1
+ <template>
2
+ <div class="adminui-tags">
3
+ <div v-if="layout !== 'dock'" class="ark-tabs-toggle" @click="toggleMenuIs">
4
+ <el-icon v-if="menuIsCollapse" class="right-line" size="18" color="#3182f3"><Right /></el-icon>
5
+ <el-icon v-else class="back-line" size="18" color="#3182f3"><Back /></el-icon>
6
+ </div>
7
+ <ul ref="tags" class="ark-tabs-content">
8
+ <li v-for="tag in tagList" v-bind:key="tag" :class="[isActive(tag)?'active':'',tag.meta?.affix?'affix':'' ]" @contextmenu.prevent="openContextMenu($event, tag)">
9
+
10
+ <router-link :to="tag">
11
+ <!-- <el-icon v-if="tag.meta && tag.meta.icon"><component :is="tag.meta.icon || 'el-icon-menu'"/></el-icon> -->
12
+ <span>{{ tag.meta.title }}</span>
13
+ <el-icon class="tags-close" v-if="!tag.meta.affix && isActive(tag)" @click.prevent.stop='closeSelectedTag(tag)'>
14
+ <el-icon-close/>
15
+ </el-icon>
16
+ </router-link>
17
+ </li>
18
+ </ul>
19
+
20
+ <el-dropdown
21
+ placement="bottom-end"
22
+ popper-class="vab-tabs-more-dropdown"
23
+ @command="handleCommand"
24
+ >
25
+ <span class="vab-tabs-more" :class="{ 'vab-tabs-more-active': active }">
26
+ <span class="vab-tabs-more-icon">
27
+ <i class="box box-t"></i>
28
+ <i class="box box-b"></i>
29
+ </span>
30
+ </span>
31
+ <template #dropdown>
32
+ <el-dropdown-menu class="tabs-more">
33
+ <el-dropdown-item command="refreshTab">
34
+ <el-icon><el-icon-refresh/></el-icon>
35
+ <span>刷新</span>
36
+ </el-dropdown-item>
37
+ <!-- <el-dropdown-item command="closeTabs" v-show="!(contextMenuItem && contextMenuItem.meta && contextMenuItem.meta.affix)" :class="contextMenuItem.meta.affix?'disabled':''">-->
38
+ <!-- <el-icon><el-icon-close/></el-icon>-->
39
+ <!-- <span>关闭标签</span>-->
40
+ <!-- </el-dropdown-item>-->
41
+ <el-dropdown-item command="closeOtherTabs">
42
+ <el-icon><el-icon-folder-delete/></el-icon>
43
+ <span>关闭其他标签</span>
44
+ </el-dropdown-item>
45
+ <el-dropdown-item command="maximize">
46
+ <el-icon><el-icon-full-screen/></el-icon>
47
+ <span>最大化</span>
48
+ </el-dropdown-item>
49
+ <el-dropdown-item command="openWindow">
50
+ <el-icon><el-icon-copy-document/></el-icon>
51
+ <span>在新的窗口中打开</span>
52
+ </el-dropdown-item>
53
+ </el-dropdown-menu>
54
+ </template>
55
+ </el-dropdown>
56
+ </div>
57
+
58
+ <transition name="el-zoom-in-top">
59
+ <ul v-if="contextMenuVisible" :style="{left:left+'px',top:top+'px'}" class="contextmenu" id="contextmenu">
60
+ <li @click="refreshTab()"><el-icon><el-icon-refresh/></el-icon>刷新</li>
61
+ <hr>
62
+ <li @click="closeTabs()" :class="contextMenuItem.meta.affix?'disabled':''"><el-icon><el-icon-close/></el-icon>关闭标签</li>
63
+ <li @click="closeOtherTabs()"><el-icon><el-icon-folder-delete/></el-icon>关闭其他标签</li>
64
+ <hr>
65
+ <li @click="maximize()"><el-icon><el-icon-full-screen/></el-icon>最大化</li>
66
+ <li @click="openWindow()"><el-icon><el-icon-copy-document/></el-icon>在新的窗口中打开</li>
67
+ </ul>
68
+ </transition>
69
+ </template>
70
+
71
+ <script setup>
72
+ import { Right, Back } from '@element-plus/icons-vue'
73
+ </script>
74
+
75
+ <script>
76
+ import Sortable from 'sortablejs'
77
+ import viewTagsStore from '../../store/modules/viewTags';
78
+ import keepAliveStore from '../../store/modules/keepAlive';
79
+ import iframeStore from '../../store/modules/iframe';
80
+ import globalStore from '../../store/modules/global';
81
+
82
+ const _viewTagsStore = viewTagsStore()
83
+
84
+ export default {
85
+ name: 'tags',
86
+ data() {
87
+ return {
88
+ contextMenuVisible: false,
89
+ contextMenuItem: null,
90
+ left: 0,
91
+ top: 0,
92
+ tagList: _viewTagsStore.viewTags,
93
+ tipDisplayed: false
94
+ }
95
+ },
96
+ props: {},
97
+ computed: {
98
+ menuIsCollapse() {
99
+ const global = globalStore()
100
+ return global.menuIsCollapse
101
+ },
102
+ layout() {
103
+ const global = globalStore()
104
+ return global.layout
105
+ }
106
+ },
107
+ watch: {
108
+ $route(e) {
109
+ this.addViewTags(e);
110
+ console.log('contextMenuItem', this.contextMenuItem)
111
+ // 判断标签容器是否出现滚动条
112
+ this.$nextTick(() => {
113
+ const tags = this.$refs.tags
114
+ if (tags && tags.scrollWidth > tags.clientWidth) {
115
+ // 确保当前标签在可视范围内
116
+ const targetTag = tags.querySelector('.active')
117
+ targetTag.scrollIntoView()
118
+ // 显示提示
119
+ if (!this.tipDisplayed) {
120
+ this.$msgbox({
121
+ type: 'warning',
122
+ center: true,
123
+ title: '提示',
124
+ message: '当前标签数量过多,可通过鼠标滚轴滚动标签栏。关闭标签数量可减少系统性能消耗。',
125
+ confirmButtonText: '知道了'
126
+ })
127
+ this.tipDisplayed = true
128
+ }
129
+ }
130
+ })
131
+ },
132
+ contextMenuVisible(value) {
133
+ const cm = (e) => {
134
+ const sp = document.getElementById('contextmenu');
135
+ if (sp && !sp.contains(e.target)) {
136
+ this.closeMenu()
137
+ }
138
+ }
139
+ if (value) {
140
+ document.body.addEventListener('click', e => cm(e))
141
+ } else {
142
+ document.body.removeEventListener('click', e => cm(e))
143
+ }
144
+ }
145
+ },
146
+ created() {
147
+ // var menu = this.$router.sc_getMenu()
148
+ const systemStore = this.$pinia._s.get('system');
149
+ console.log('systemStore.menus', systemStore.menus)
150
+ const menu = systemStore.menus
151
+ const dashboardRoute = this.treeFind(menu, node => node.path == this.$CONFIG.DASHBOARD_URL)
152
+ if (dashboardRoute) {
153
+ // dashboardRoute.fullPath = dashboardRoute.path
154
+ this.addViewTags(dashboardRoute)
155
+ this.addViewTags(this.$route)
156
+ }
157
+ },
158
+ mounted() {
159
+ this.tagDrop();
160
+ this.scrollInit()
161
+ },
162
+ methods: {
163
+ // 查找树
164
+ treeFind(tree, func) {
165
+ for (const data of tree) {
166
+ if (func(data)) return data
167
+ if (data.children) {
168
+ const res = this.treeFind(data.children, func)
169
+ if (res) return res
170
+ }
171
+ }
172
+ return null
173
+ },
174
+ // 标签拖拽排序
175
+ tagDrop() {
176
+ const target = this.$refs.tags
177
+ Sortable.create(target, {
178
+ draggable: 'li',
179
+ animation: 300
180
+ })
181
+ },
182
+ // 增加tag
183
+ addViewTags(route) {
184
+ if (route.name && !(route.meta && route.meta.fullpage)) {
185
+ this.contextMenuItem = route
186
+ viewTagsStore().pushViewTags(route)
187
+ keepAliveStore().pushKeepLive(route.name)
188
+ }
189
+ },
190
+ // 高亮tag
191
+ isActive(route) {
192
+ return route.fullPath === this.$route.fullPath
193
+ },
194
+ // 关闭tag
195
+ closeSelectedTag(tag, autoPushLatestView = true) {
196
+ const nowTagIndex = this.tagList.findIndex(item => item.fullPath == tag.fullPath)
197
+ viewTagsStore().removeViewTags(tag)
198
+ iframeStore().removeIframeList(tag)
199
+ keepAliveStore().removeKeepLive(tag.name)
200
+ if (autoPushLatestView && this.isActive(tag)) {
201
+ const leftView = this.tagList[nowTagIndex - 1]
202
+ if (leftView) {
203
+ this.$router.push(leftView)
204
+ } else {
205
+ this.$router.push('/')
206
+ }
207
+ }
208
+ },
209
+ // tag右键
210
+ openContextMenu(e, tag) {
211
+ this.contextMenuItem = tag;
212
+ this.contextMenuVisible = true;
213
+ this.left = e.clientX + 1;
214
+ this.top = e.clientY + 1;
215
+
216
+ // FIX 右键菜单边缘化位置处理
217
+ this.$nextTick(() => {
218
+ const sp = document.getElementById('contextmenu');
219
+ if (document.body.offsetWidth - e.clientX < sp.offsetWidth) {
220
+ this.left = document.body.offsetWidth - sp.offsetWidth + 1;
221
+ this.top = e.clientY + 1;
222
+ }
223
+ })
224
+ },
225
+ // 关闭右键菜单
226
+ closeMenu() {
227
+ this.contextMenuItem = null;
228
+ this.contextMenuVisible = false
229
+ },
230
+ // TAB 刷新
231
+ refreshTab() {
232
+ this.contextMenuVisible = false
233
+ const nowTag = this.contextMenuItem;
234
+ // 判断是否当前路由,否的话跳转
235
+ if (this.$route.fullPath !== nowTag.fullPath) {
236
+ this.$router.push({
237
+ path: nowTag.fullPath,
238
+ query: nowTag.query
239
+ })
240
+ }
241
+
242
+ iframeStore().refreshIframe(nowTag)
243
+
244
+ setTimeout(() => {
245
+ keepAliveStore().removeKeepLive(nowTag.name)
246
+
247
+ keepAliveStore().routeShow = false
248
+ this.$nextTick(() => {
249
+ keepAliveStore().pushKeepLive(nowTag.name)
250
+ keepAliveStore().routeShow = true
251
+ })
252
+ }, 0);
253
+ },
254
+ // TAB 关闭
255
+ closeTabs() {
256
+ const nowTag = this.contextMenuItem;
257
+ if (!nowTag.meta.affix) {
258
+ this.closeSelectedTag(nowTag)
259
+ this.contextMenuVisible = false
260
+ }
261
+ },
262
+ // TAB 关闭其他
263
+ closeOtherTabs() {
264
+ const nowTag = this.contextMenuItem;
265
+ // 判断是否当前路由,否的话跳转
266
+ if (this.$route.fullPath != nowTag.fullPath) {
267
+ this.$router.push({
268
+ path: nowTag.fullPath,
269
+ query: nowTag.query
270
+ })
271
+ }
272
+ const tags = [...this.tagList];
273
+ tags.forEach(tag => {
274
+ if ((tag.meta && tag.meta.affix) || nowTag.fullPath == tag.fullPath) {
275
+ return true
276
+ } else {
277
+ this.closeSelectedTag(tag, false)
278
+ }
279
+ })
280
+ this.contextMenuVisible = false
281
+ },
282
+ // TAB 最大化
283
+ maximize() {
284
+ const nowTag = this.contextMenuItem;
285
+ this.contextMenuVisible = false
286
+ // 判断是否当前路由,否的话跳转
287
+ if (this.$route.fullPath != nowTag.fullPath) {
288
+ this.$router.push({
289
+ path: nowTag.fullPath,
290
+ query: nowTag.query
291
+ })
292
+ }
293
+ document.getElementById('app').classList.add('main-maximize')
294
+ },
295
+ // 新窗口打开
296
+ openWindow() {
297
+ const nowTag = this.contextMenuItem;
298
+ const url = nowTag.href || '/';
299
+ if (!nowTag.meta.affix) {
300
+ this.closeSelectedTag(nowTag)
301
+ }
302
+ window.open(url);
303
+ this.contextMenuVisible = false
304
+ },
305
+ // 横向滚动
306
+ scrollInit() {
307
+ const scrollDiv = this.$refs.tags;
308
+ scrollDiv.addEventListener('mousewheel', handler, false) || scrollDiv.addEventListener('DOMMouseScroll', handler, false)
309
+ function handler(event) {
310
+ const detail = event.wheelDelta || event.detail;
311
+ // 火狐上滚键值-3 下滚键值3,其他内核上滚键值120 下滚键值-120
312
+ const moveForwardStep = 1;
313
+ const moveBackStep = -1;
314
+ let step = 0;
315
+ if (detail == 3 || (detail < 0 && detail != -3)) {
316
+ step = moveForwardStep * 50;
317
+ } else {
318
+ step = moveBackStep * 50;
319
+ }
320
+ scrollDiv.scrollLeft += step;
321
+ }
322
+ },
323
+ handleCommand(command) {
324
+ // refreshTab closeTabs closeOtherTabs maximize openWindow
325
+ switch (command) {
326
+ case 'refreshTab':
327
+ this.refreshTab()
328
+ break
329
+ case 'closeTabs':
330
+ this.closeTabs()
331
+ break
332
+ case 'closeOtherTabs':
333
+ this.closeOtherTabs()
334
+ break
335
+ case 'maximize':
336
+ this.maximize()
337
+ break
338
+ case 'openWindow':
339
+ this.openWindow()
340
+ break
341
+ }
342
+ },
343
+ toggleMenuIs() {
344
+ globalStore().toggleMenuIsCollapse()
345
+ }
346
+ }
347
+ }
348
+ </script>
349
+
350
+ <style lang="scss" scoped>
351
+ .contextmenu {
352
+ position: fixed;
353
+ width: 200px;
354
+ margin:0;
355
+ border-radius: 0px;
356
+ background: var(--el-bg-color-overlay);
357
+ border: 1px solid var(--el-border-color-light);
358
+ box-shadow: 0 2px 12px 0 rgba(0,0,0,.1);
359
+ z-index: 3000;
360
+ list-style-type: none;
361
+ padding: 10px 0;
362
+ }
363
+ .contextmenu hr {
364
+ margin:5px 0;
365
+ border: none;
366
+ height: 1px;
367
+ font-size: 0px;
368
+ background-color: var(--el-border-color-light);
369
+ }
370
+ .contextmenu li {
371
+ display: flex;
372
+ align-items: center;
373
+ margin:0;
374
+ cursor: pointer;
375
+ line-height: 30px;
376
+ padding: 0 17px;
377
+ color: #606266;
378
+ }
379
+ .contextmenu li i {
380
+ font-size: 14px;
381
+ margin-right: 10px;
382
+ }
383
+ .contextmenu li:hover {
384
+ background-color: #ecf5ff;
385
+ color: #66b1ff;
386
+ }
387
+ .contextmenu li.disabled {
388
+ cursor: not-allowed;
389
+ color: #bbb;
390
+ background: transparent;
391
+ }
392
+ .tags-tip {padding:5px;}
393
+ .tags-tip p {margin-bottom: 10px;}
394
+ .dark .contextmenu li {color: var(--el-text-color-primary);}
395
+ .ark-tabs-content {
396
+ width: calc(100% - 40px);
397
+ }
398
+ .vab-tabs-more {
399
+ position: relative;
400
+ box-sizing: border-box;
401
+ display: block;
402
+ text-align: left;
403
+ }
404
+ .vab-tabs-more-icon {
405
+ display: inline-block;
406
+ color: #9a9a9a;
407
+ cursor: pointer;
408
+ transition: transform 0.3s ease-out;
409
+ }
410
+ .vab-tabs-more-icon .box {
411
+ position: relative;
412
+ display: block;
413
+ width: 14px;
414
+ height: 8px;
415
+ }
416
+ .vab-tabs-more-icon .box-t:before {
417
+ transition: transform 0.3s ease-out 0.3s;
418
+ }
419
+ .vab-tabs-more-icon .box:before {
420
+ position: absolute;
421
+ top: 2px;
422
+ left: 0;
423
+ width: 6px;
424
+ height: 6px;
425
+ content: "";
426
+ background: #9a9a9a;
427
+ }
428
+ .vab-tabs-more-icon .box:after {
429
+ position: absolute;
430
+ top: 2px;
431
+ left: 8px;
432
+ width: 6px;
433
+ height: 6px;
434
+ content: "";
435
+ background: #9a9a9a;
436
+ }
437
+ .vab-tabs-more-icon .box:before {
438
+ position: absolute;
439
+ top: 2px;
440
+ left: 0;
441
+ width: 6px;
442
+ height: 6px;
443
+ content: "";
444
+ background: #9a9a9a;
445
+ }
446
+ .vab-tabs-more-icon .box:after {
447
+ position: absolute;
448
+ top: 2px;
449
+ left: 8px;
450
+ width: 6px;
451
+ height: 6px;
452
+ content: "";
453
+ background: #9a9a9a;
454
+ }
455
+
456
+ .tags-close {
457
+ margin-left: 5px;
458
+ border-radius: 50%;
459
+ overflow: hidden;
460
+
461
+ &:hover {
462
+ background-color: var(--el-color-primary);
463
+ color: #fff;
464
+ }
465
+ }
466
+
467
+ :deep(.el-dropdown-menu__item) {
468
+ flex-direction: row !important;
469
+ align-items: center;
470
+ }
471
+
472
+ .right-line::after,
473
+ .back-line::before {
474
+ background-color: #3182f3;
475
+ }
476
+ </style>
@@ -0,0 +1,83 @@
1
+ <template>
2
+ <el-container v-loading="loading">
3
+ <el-main>
4
+ <el-empty v-if="tasks.length==0" :image-size="120" >
5
+ <template #description>
6
+ <h2>没有正在执行的任务</h2>
7
+ </template>
8
+ <p style="font-size: 14px;color: #999;line-height: 1.5;margin: 0 40px;">在处理耗时过久的任务时为了不阻碍正在处理的工作,可在任务中心进行异步执行。</p>
9
+ </el-empty>
10
+ <el-card v-for="task in tasks" :key="task.id" shadow="hover" class="user-bar-tasks-item">
11
+ <div class="user-bar-tasks-item-body">
12
+ <div class="taskIcon">
13
+ <el-icon v-if="task.type=='export'" :size="20"><el-icon-paperclip /></el-icon>
14
+ <el-icon v-if="task.type=='report'" :size="20"><el-icon-dataAnalysis /></el-icon>
15
+ </div>
16
+ <div class="taskMain">
17
+ <div class="title">
18
+ <h2>{{ task.taskName }}</h2>
19
+ <p><span v-time.tip="task.createDate"></span> 创建</p>
20
+ </div>
21
+ <div class="bottom">
22
+ <div class="state">
23
+ <el-tag type="info" v-if="task.state=='0'">执行中</el-tag>
24
+ <el-tag v-if="task.state=='1'">完成</el-tag>
25
+ </div>
26
+ <div class="handler">
27
+ <el-button v-if="task.state=='1'" type="primary" circle icon="el-icon-download" @click="download(task)"></el-button>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </div>
32
+ </el-card>
33
+ </el-main>
34
+ <el-footer style="padding:10px;text-align: right;">
35
+ <el-button circle icon="el-icon-refresh" @click="refresh"></el-button>
36
+ </el-footer>
37
+ </el-container>
38
+ </template>
39
+
40
+ <script>
41
+ export default {
42
+ data() {
43
+ return {
44
+ loading: false,
45
+ tasks: []
46
+ }
47
+ },
48
+ mounted() {
49
+ this.getData()
50
+ },
51
+ methods: {
52
+ async getData() {
53
+ this.loading = true
54
+ const res = await this.$API.system.tasks.list.get()
55
+ this.tasks = res.data
56
+ this.loading = false
57
+ },
58
+ refresh() {
59
+ this.getData()
60
+ },
61
+ download(row) {
62
+ const a = document.createElement('a')
63
+ a.style = 'display: none'
64
+ a.target = '_blank'
65
+ a.href = row.result
66
+ document.body.appendChild(a)
67
+ a.click()
68
+ document.body.removeChild(a)
69
+ }
70
+ }
71
+ }
72
+ </script>
73
+
74
+ <style scoped>
75
+ .user-bar-tasks-item {margin-bottom: 10px;}
76
+ .user-bar-tasks-item:hover {border-color: var(--el-color-primary);}
77
+ .user-bar-tasks-item-body {display: flex;}
78
+ .user-bar-tasks-item-body .taskIcon {width: 45px;height: 45px;background: var(--el-color-primary-light-9);margin-right: 20px;display: flex;justify-content:center;align-items: center;color: var(--el-color-primary);border-radius:20px;}
79
+ .user-bar-tasks-item-body .taskMain {flex: 1;}
80
+ .user-bar-tasks-item-body .title h2 {font-size: 15px;}
81
+ .user-bar-tasks-item-body .title p {font-size: 12px;color: #999;margin-top: 5px;}
82
+ .user-bar-tasks-item-body .bottom {display: flex;justify-content: space-between;align-items: center;padding-top: 20px;}
83
+ </style>
@@ -0,0 +1,49 @@
1
+ <template>
2
+ <div class="adminui-topbar">
3
+ <div class="left-panel">
4
+ <el-breadcrumb separator-icon="el-icon-arrow-right" class="hidden-sm-and-down">
5
+ <transition-group name="breadcrumb">
6
+ <template v-for="item in breadList" :key="item.title" >
7
+ <el-breadcrumb-item v-if="item.path!='/' && !item.meta.hiddenBreadcrumb" :key="item.meta.title"><el-icon class="icon" v-if="item.meta.icon"><component :is="item.meta.icon" /></el-icon>{{item.meta.title}}</el-breadcrumb-item>
8
+ </template>
9
+ </transition-group>
10
+ </el-breadcrumb>
11
+ </div>
12
+ <div class="center-panel"></div>
13
+ <div class="right-panel">
14
+ <slot></slot>
15
+ </div>
16
+ </div>
17
+ </template>
18
+
19
+ <script>
20
+ export default {
21
+ data() {
22
+ return {
23
+ breadList: []
24
+ }
25
+ },
26
+ created() {
27
+ this.getBreadcrumb();
28
+ },
29
+ watch: {
30
+ $route() {
31
+ this.getBreadcrumb();
32
+ }
33
+ },
34
+ methods: {
35
+ getBreadcrumb() {
36
+ const matched = this.$route.meta.breadcrumb;
37
+ this.breadList = matched;
38
+ }
39
+ }
40
+ }
41
+ </script>
42
+
43
+ <style scoped>
44
+ .el-breadcrumb {margin-left: 15px;}
45
+ .el-breadcrumb .el-breadcrumb__inner .icon {font-size: 14px;margin-right: 5px;float: left;}
46
+ .breadcrumb-enter-active,.breadcrumb-leave-active {transition: all 0.3s;}
47
+ .breadcrumb-enter-from,.breadcrumb-leave-active {opacity: 0;transform: translateX(20px);}
48
+ .breadcrumb-leave-active {position: absolute;}
49
+ </style>