@sugarat/easypicker2-client 2.4.3 → 2.6.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.
- package/dist/assets/aria-bc8e8b0f.js +2 -0
- package/dist/assets/aria-bc8e8b0f.js.map +1 -0
- package/dist/assets/aria-legacy.af0825d3.js +2 -0
- package/dist/assets/data-analysis-3ce8c1c1.js +2 -0
- package/dist/assets/data-analysis-3ce8c1c1.js.map +1 -0
- package/dist/assets/data-analysis-legacy.985137a1.js +2 -0
- package/dist/assets/data-board-fc2c2ec1.js +2 -0
- package/dist/assets/data-board-fc2c2ec1.js.map +1 -0
- package/dist/assets/data-board-legacy.33116f7c.js +2 -0
- package/dist/assets/el-date-picker-b377a533.js +2 -0
- package/dist/assets/el-date-picker-b377a533.js.map +1 -0
- package/dist/assets/el-date-picker-cf2e83b6.css +1 -0
- package/dist/assets/el-date-picker-legacy.127f0787.js +2 -0
- package/dist/assets/el-dialog-25bd2fb8.css +1 -0
- package/dist/assets/el-dialog-5b7bce58.js +2 -0
- package/dist/assets/el-dialog-5b7bce58.js.map +1 -0
- package/dist/assets/el-dialog-legacy.e6ef2c86.js +2 -0
- package/dist/assets/el-dropdown-item-0c6ddabc.css +1 -0
- package/dist/assets/el-dropdown-item-e0275106.js +2 -0
- package/dist/assets/el-dropdown-item-e0275106.js.map +1 -0
- package/dist/assets/el-dropdown-item-legacy.4888d114.js +2 -0
- package/dist/assets/el-form-item-3aad794a.css +1 -0
- package/dist/assets/el-form-item-c0658f70.js +2 -0
- package/dist/assets/el-form-item-c0658f70.js.map +1 -0
- package/dist/assets/el-form-item-legacy.a8e8784e.js +2 -0
- package/dist/assets/el-loading-c8798044.js +2 -0
- package/dist/assets/el-loading-c8798044.js.map +1 -0
- package/dist/assets/el-loading-d0f2d079.css +1 -0
- package/dist/assets/el-loading-legacy.534bd799.js +2 -0
- package/dist/assets/el-pagination-bf7c736d.css +1 -0
- package/dist/assets/el-pagination-dabcccbb.js +2 -0
- package/dist/assets/el-pagination-dabcccbb.js.map +1 -0
- package/dist/assets/el-pagination-legacy.7d2ae10d.js +2 -0
- package/dist/assets/el-progress-54b274cd.js +2 -0
- package/dist/assets/el-progress-54b274cd.js.map +1 -0
- package/dist/assets/el-progress-63aabe3a.css +1 -0
- package/dist/assets/el-progress-legacy.07ca6502.js +2 -0
- package/dist/assets/el-select-6be23320.css +1 -0
- package/dist/assets/el-select-f81a7377.js +2 -0
- package/dist/assets/el-select-f81a7377.js.map +1 -0
- package/dist/assets/el-select-legacy.94fad7fa.js +2 -0
- package/dist/assets/el-switch-9eba6fd0.js +2 -0
- package/dist/assets/el-switch-9eba6fd0.js.map +1 -0
- package/dist/assets/el-switch-aeab2c6b.css +1 -0
- package/dist/assets/el-switch-legacy.490534be.js +2 -0
- package/dist/assets/el-tab-pane-4a1bb4c7.css +1 -0
- package/dist/assets/el-tab-pane-89bdd69b.js +2 -0
- package/dist/assets/el-tab-pane-89bdd69b.js.map +1 -0
- package/dist/assets/el-tab-pane-legacy.cfdbc441.js +2 -0
- package/dist/assets/el-table-column-6716308a.js +21 -0
- package/dist/assets/el-table-column-6716308a.js.map +1 -0
- package/dist/assets/el-table-column-6c2089f9.css +1 -0
- package/dist/assets/el-table-column-legacy.49685e5a.js +24 -0
- package/dist/assets/index-01e33329.css +1 -0
- package/dist/assets/index-0b0f29ec.js +2 -0
- package/dist/assets/index-0b0f29ec.js.map +1 -0
- package/dist/assets/index-17c6005d.css +1 -0
- package/dist/assets/index-20019c57.js +2 -0
- package/dist/assets/index-20019c57.js.map +1 -0
- package/dist/assets/index-247f2c67.css +1 -0
- package/dist/assets/index-248e88e2.js +2 -0
- package/dist/assets/index-248e88e2.js.map +1 -0
- package/dist/assets/index-3091894a.css +1 -0
- package/dist/assets/index-37e15bc6.css +1 -0
- package/dist/assets/index-39637d43.js +2 -0
- package/dist/assets/index-39637d43.js.map +1 -0
- package/dist/assets/index-3f82ab7a.css +1 -0
- package/dist/assets/index-4c81cf78.css +1 -0
- package/dist/assets/index-5099f123.js +2 -0
- package/dist/assets/index-5099f123.js.map +1 -0
- package/dist/assets/index-57513f17.css +1 -0
- package/dist/assets/index-76f31e30.css +1 -0
- package/dist/assets/index-76ff9b9b.css +1 -0
- package/dist/assets/index-8557974a.js +2 -0
- package/dist/assets/index-8557974a.js.map +1 -0
- package/dist/assets/index-85fcd87a.css +1 -0
- package/dist/assets/index-867d07e4.js +2 -0
- package/dist/assets/index-867d07e4.js.map +1 -0
- package/dist/assets/index-8f353d3b.js +2 -0
- package/dist/assets/index-8f353d3b.js.map +1 -0
- package/dist/assets/index-8f7abc30.js +2 -0
- package/dist/assets/index-8f7abc30.js.map +1 -0
- package/dist/assets/index-8fbd06a5.js +2 -0
- package/dist/assets/index-8fbd06a5.js.map +1 -0
- package/dist/assets/index-93c733b3.css +1 -0
- package/dist/assets/index-98b55468.css +1 -0
- package/dist/assets/index-9e6bd406.js +2 -0
- package/dist/assets/index-9e6bd406.js.map +1 -0
- package/dist/assets/index-a880597c.css +1 -0
- package/dist/assets/index-acdbf3b6.js +2 -0
- package/dist/assets/index-acdbf3b6.js.map +1 -0
- package/dist/assets/index-b3e58b02.js +2 -0
- package/dist/assets/index-b3e58b02.js.map +1 -0
- package/dist/assets/index-c13133c5.js +2 -0
- package/dist/assets/index-c13133c5.js.map +1 -0
- package/dist/assets/index-c1d6836c.js +2 -0
- package/dist/assets/index-c1d6836c.js.map +1 -0
- package/dist/assets/index-d26aeed5.css +1 -0
- package/dist/assets/index-d98be3e4.js +19 -0
- package/dist/assets/index-d98be3e4.js.map +1 -0
- package/dist/assets/index-d9db6cc1.js +2 -0
- package/dist/assets/index-d9db6cc1.js.map +1 -0
- package/dist/assets/index-da51da36.css +1 -0
- package/dist/assets/index-e0ef7135.js +2 -0
- package/dist/assets/index-e0ef7135.js.map +1 -0
- package/dist/assets/index-e7d8a83e.css +1 -0
- package/dist/assets/index-ebf625c9.js +2 -0
- package/dist/assets/index-ebf625c9.js.map +1 -0
- package/dist/assets/index-eda7d85a.js +2 -0
- package/dist/assets/index-eda7d85a.js.map +1 -0
- package/dist/assets/index-fdc557f8.js +2 -0
- package/dist/assets/index-fdc557f8.js.map +1 -0
- package/dist/assets/index-legacy.0c570346.js +2 -0
- package/dist/assets/index-legacy.24edddf9.js +2 -0
- package/dist/assets/index-legacy.31681402.js +2 -0
- package/dist/assets/index-legacy.3e6b32cf.js +2 -0
- package/dist/assets/index-legacy.4edc099d.js +2 -0
- package/dist/assets/index-legacy.614df679.js +2 -0
- package/dist/assets/index-legacy.6420d0ab.js +2 -0
- package/dist/assets/index-legacy.679e5ce1.js +2 -0
- package/dist/assets/index-legacy.7b42e0cb.js +2 -0
- package/dist/assets/index-legacy.7bafa2e6.js +2 -0
- package/dist/assets/index-legacy.7ff3d773.js +2 -0
- package/dist/assets/index-legacy.84e0eca9.js +2 -0
- package/dist/assets/index-legacy.9ca64f8c.js +2 -0
- package/dist/assets/index-legacy.a4371211.js +2 -0
- package/dist/assets/index-legacy.acb8b137.js +23 -0
- package/dist/assets/index-legacy.bc3790f6.js +2 -0
- package/dist/assets/index-legacy.d0e21cb1.js +2 -0
- package/dist/assets/index-legacy.daf56c8f.js +2 -0
- package/dist/assets/index-legacy.e12feae0.js +2 -0
- package/dist/assets/index-legacy.e7f8790c.js +2 -0
- package/dist/assets/index-legacy.f84efe08.js +2 -0
- package/dist/assets/isEqual-82bb65ad.js +2 -0
- package/dist/assets/isEqual-82bb65ad.js.map +1 -0
- package/dist/assets/isEqual-legacy.dbaa2a6e.js +2 -0
- package/dist/assets/other-8d7ba6a0.js +2 -0
- package/dist/assets/other-8d7ba6a0.js.map +1 -0
- package/dist/assets/other-legacy.39078796.js +2 -0
- package/dist/assets/polyfills-legacy.99e38685.js +4 -0
- package/dist/assets/refresh-f2c4c532.js +2 -0
- package/dist/assets/refresh-f2c4c532.js.map +1 -0
- package/dist/assets/refresh-legacy.0ee83ca1.js +2 -0
- package/dist/assets/tip-3d272885.js +2 -0
- package/dist/assets/tip-3d272885.js.map +1 -0
- package/dist/assets/tip-9cb18ee8.css +1 -0
- package/dist/assets/tip-legacy.dee89e85.js +2 -0
- package/dist/assets/validator-d4ea1237.js +2 -0
- package/dist/assets/validator-d4ea1237.js.map +1 -0
- package/dist/assets/validator-legacy.ecd1e5dd.js +2 -0
- package/{index.html → dist/index.html} +8 -1
- package/package.json +30 -19
- package/.env +0 -6
- package/.env.production +0 -3
- package/.env.test +0 -4
- package/.eslintignore +0 -0
- package/.eslintrc.json +0 -57
- package/.github/workflows/main.yml +0 -61
- package/.prettierrc.js +0 -9
- package/auto-imports.d.ts +0 -6
- package/components.d.ts +0 -56
- package/docker/ep_backup/easypicker2.sql +0 -214
- package/docker/ep_backup/mongodb/easypicker2/action.bson +0 -0
- package/docker/ep_backup/mongodb/easypicker2/action.metadata.json +0 -1
- package/docker/ep_backup/mongodb/easypicker2/log.bson +0 -0
- package/docker/ep_backup/mongodb/easypicker2/log.metadata.json +0 -1
- package/docker/ep_backup/user-config.json +0 -176
- package/docs/.env +0 -1
- package/docs/.env.production +0 -2
- package/docs/.vitepress/config.ts +0 -204
- package/docs/.vitepress/theme/bg.png +0 -0
- package/docs/.vitepress/theme/index.scss +0 -41
- package/docs/.vitepress/theme/index.ts +0 -5
- package/docs/author.md +0 -24
- package/docs/auto-imports.d.ts +0 -6
- package/docs/components.d.ts +0 -17
- package/docs/deploy/design/api.md +0 -3
- package/docs/deploy/design/db.md +0 -3
- package/docs/deploy/design/index.md +0 -3
- package/docs/deploy/design/shell.md +0 -9
- package/docs/deploy/faq.md +0 -86
- package/docs/deploy/index.md +0 -9
- package/docs/deploy/local.md +0 -275
- package/docs/deploy/online-new.md +0 -610
- package/docs/deploy/online.md +0 -683
- package/docs/deploy/qiniu.md +0 -183
- package/docs/index.md +0 -40
- package/docs/introduction/about/code.md +0 -26
- package/docs/introduction/about/index.md +0 -33
- package/docs/introduction/feature/index.md +0 -3
- package/docs/plan/log.md +0 -346
- package/docs/plan/todo.md +0 -127
- package/docs/plan/wish.md +0 -29
- package/docs/praise/index.md +0 -45
- package/docs/public/robots.txt +0 -2
- package/docs/src/apis/ajax.ts +0 -66
- package/docs/src/apis/index.ts +0 -1
- package/docs/src/apis/modules/wish.ts +0 -20
- package/docs/src/components/Avatar.vue +0 -60
- package/docs/src/components/Home.vue +0 -85
- package/docs/src/components/Picture.vue +0 -13
- package/docs/src/components/Praise.vue +0 -52
- package/docs/src/components/WishBtn.vue +0 -98
- package/docs/src/components/WishPanel.vue +0 -170
- package/docs/src/components/callme/index.vue +0 -72
- package/docs/vite.config.ts +0 -42
- package/public/favicon.ico +0 -0
- package/public/logo.png +0 -0
- package/scripts/deploy/docs.mjs +0 -24
- package/scripts/deploy/prod.mjs +0 -24
- package/scripts/deploy/test.mjs +0 -26
- package/src/@types/ajax.d.ts +0 -5
- package/src/@types/api.d.ts +0 -305
- package/src/@types/lib.d.ts +0 -26
- package/src/@types/page.d.ts +0 -18
- package/src/App.vue +0 -36
- package/src/apis/ajax.ts +0 -72
- package/src/apis/index.ts +0 -20
- package/src/apis/modules/action.ts +0 -17
- package/src/apis/modules/category.ts +0 -20
- package/src/apis/modules/config.ts +0 -19
- package/src/apis/modules/file.ts +0 -150
- package/src/apis/modules/people.ts +0 -81
- package/src/apis/modules/public.ts +0 -49
- package/src/apis/modules/super/overview.ts +0 -56
- package/src/apis/modules/super/user.ts +0 -62
- package/src/apis/modules/task.ts +0 -67
- package/src/apis/modules/user.ts +0 -56
- package/src/apis/modules/wish.ts +0 -31
- package/src/assets/i/EasyPicker.png +0 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/styles/app.css +0 -69
- package/src/components/HomeFooter/index.vue +0 -134
- package/src/components/HomeHeader/index.vue +0 -156
- package/src/components/InfosForm/index.vue +0 -73
- package/src/components/MessageList/index.vue +0 -155
- package/src/components/MessagePanel/index.vue +0 -46
- package/src/components/Praise/index.vue +0 -102
- package/src/components/QrCode.vue +0 -44
- package/src/components/linkDialog.vue +0 -104
- package/src/components/loginPanel.vue +0 -92
- package/src/constants/index.ts +0 -83
- package/src/env.d.ts +0 -8
- package/src/main.ts +0 -19
- package/src/pages/404/index.vue +0 -59
- package/src/pages/about/index.vue +0 -152
- package/src/pages/callme/index.vue +0 -155
- package/src/pages/dashboard/config/index.vue +0 -304
- package/src/pages/dashboard/files/index.vue +0 -1152
- package/src/pages/dashboard/index.vue +0 -335
- package/src/pages/dashboard/manage/config/index.vue +0 -97
- package/src/pages/dashboard/manage/index.vue +0 -105
- package/src/pages/dashboard/manage/overview/index.vue +0 -486
- package/src/pages/dashboard/manage/user/index.vue +0 -678
- package/src/pages/dashboard/manage/wish/index.vue +0 -257
- package/src/pages/dashboard/tasks/components/CategoryPanel.vue +0 -208
- package/src/pages/dashboard/tasks/components/CreateTask.vue +0 -93
- package/src/pages/dashboard/tasks/components/TaskInfo.vue +0 -129
- package/src/pages/dashboard/tasks/components/infoPanel/ddl.vue +0 -96
- package/src/pages/dashboard/tasks/components/infoPanel/file.vue +0 -175
- package/src/pages/dashboard/tasks/components/infoPanel/info.vue +0 -467
- package/src/pages/dashboard/tasks/components/infoPanel/people.vue +0 -566
- package/src/pages/dashboard/tasks/components/infoPanel/template.vue +0 -146
- package/src/pages/dashboard/tasks/components/infoPanel/tip.vue +0 -55
- package/src/pages/dashboard/tasks/components/infoPanel/tipInfo.vue +0 -196
- package/src/pages/dashboard/tasks/index.vue +0 -302
- package/src/pages/dashboard/tasks/public.ts +0 -32
- package/src/pages/disabled/index.vue +0 -47
- package/src/pages/feedback/index.vue +0 -5
- package/src/pages/home/index.vue +0 -72
- package/src/pages/login/index.vue +0 -270
- package/src/pages/register/index.vue +0 -211
- package/src/pages/reset/index.vue +0 -186
- package/src/pages/task/index.vue +0 -895
- package/src/pages/wish/index.vue +0 -152
- package/src/router/Interceptor/index.ts +0 -112
- package/src/router/index.ts +0 -13
- package/src/router/routes/index.ts +0 -197
- package/src/shims-vue.d.ts +0 -6
- package/src/store/index.ts +0 -17
- package/src/store/modules/category.ts +0 -44
- package/src/store/modules/public.ts +0 -27
- package/src/store/modules/task.ts +0 -55
- package/src/store/modules/user.ts +0 -57
- package/src/utils/elementUI.ts +0 -8
- package/src/utils/networkUtil.ts +0 -236
- package/src/utils/other.ts +0 -25
- package/src/utils/regExp.ts +0 -11
- package/src/utils/stringUtil.ts +0 -241
- package/tsconfig.json +0 -24
- package/vite.config.ts +0 -55
- /package/{docs/public → dist}/favicon.ico +0 -0
- /package/{docs/public → dist}/logo.png +0 -0
|
@@ -1,1152 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="files">
|
|
3
|
-
<!-- 筛选框 -->
|
|
4
|
-
<div class="panel header">
|
|
5
|
-
<div class="item">
|
|
6
|
-
<span class="label">分类</span>
|
|
7
|
-
<!--TODO: multiple 多选待评估 -->
|
|
8
|
-
<el-select
|
|
9
|
-
size="default"
|
|
10
|
-
v-model="selectCategory"
|
|
11
|
-
filterable
|
|
12
|
-
placeholder="请选择"
|
|
13
|
-
>
|
|
14
|
-
<el-option label="全部" value="all" />
|
|
15
|
-
<el-option label="默认" value="default" />
|
|
16
|
-
<el-option
|
|
17
|
-
v-for="item in categories"
|
|
18
|
-
:key="item.k"
|
|
19
|
-
:label="item.name"
|
|
20
|
-
:value="item.k"
|
|
21
|
-
/>
|
|
22
|
-
<el-option label="无关联任务" value="no-task" />
|
|
23
|
-
<el-option label="♻️回收站♻️" value="trash" />
|
|
24
|
-
</el-select>
|
|
25
|
-
</div>
|
|
26
|
-
<div class="item">
|
|
27
|
-
<span class="label">任务</span>
|
|
28
|
-
<el-select
|
|
29
|
-
size="default"
|
|
30
|
-
v-model="selectTask"
|
|
31
|
-
filterable
|
|
32
|
-
placeholder="请选择"
|
|
33
|
-
>
|
|
34
|
-
<el-option label="全部" value="all" />
|
|
35
|
-
<el-option
|
|
36
|
-
v-for="item in filterTasks"
|
|
37
|
-
:key="item.key"
|
|
38
|
-
:label="item.name"
|
|
39
|
-
:value="item.key"
|
|
40
|
-
></el-option>
|
|
41
|
-
</el-select>
|
|
42
|
-
</div>
|
|
43
|
-
<div class="item">
|
|
44
|
-
<el-button
|
|
45
|
-
:loading="batchDownStart"
|
|
46
|
-
:disabled="selectTask === 'all'"
|
|
47
|
-
type="primary"
|
|
48
|
-
size="default"
|
|
49
|
-
:icon="Download"
|
|
50
|
-
@click="handleDownloadTask"
|
|
51
|
-
>下载任务中的文件</el-button
|
|
52
|
-
>
|
|
53
|
-
</div>
|
|
54
|
-
<div class="item">
|
|
55
|
-
<el-input
|
|
56
|
-
size="default"
|
|
57
|
-
clearable
|
|
58
|
-
placeholder="请输入要检索的内容"
|
|
59
|
-
:prefix-icon="Search"
|
|
60
|
-
v-model="searchWord"
|
|
61
|
-
>
|
|
62
|
-
</el-input>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
<div class="panel">
|
|
66
|
-
<div class="export-btns flex fac">
|
|
67
|
-
<el-dropdown trigger="click" @command="handleDropdownClick">
|
|
68
|
-
<el-button type="primary" size="default">
|
|
69
|
-
批量操作<el-icon class="el-icon--right">
|
|
70
|
-
<arrow-down />
|
|
71
|
-
</el-icon>
|
|
72
|
-
</el-button>
|
|
73
|
-
<template #dropdown>
|
|
74
|
-
<el-dropdown-menu>
|
|
75
|
-
<el-dropdown-item
|
|
76
|
-
:disabled="selectItem.length === 0"
|
|
77
|
-
command="download"
|
|
78
|
-
>下载</el-dropdown-item
|
|
79
|
-
>
|
|
80
|
-
<el-dropdown-item
|
|
81
|
-
:disabled="selectItem.length === 0"
|
|
82
|
-
command="delete"
|
|
83
|
-
>删除</el-dropdown-item
|
|
84
|
-
>
|
|
85
|
-
<el-dropdown-item
|
|
86
|
-
:disabled="selectItem.length === 0"
|
|
87
|
-
command="excel"
|
|
88
|
-
>导出记录</el-dropdown-item
|
|
89
|
-
>
|
|
90
|
-
</el-dropdown-menu>
|
|
91
|
-
</template>
|
|
92
|
-
</el-dropdown>
|
|
93
|
-
<div v-show="false">
|
|
94
|
-
<!-- 迷惑的解决bug的手段 -->
|
|
95
|
-
<el-dropdown trigger="click" @command="handleDropdownClick">
|
|
96
|
-
<el-button
|
|
97
|
-
type="primary"
|
|
98
|
-
:disabled="selectItem.length === 0"
|
|
99
|
-
size="default"
|
|
100
|
-
>
|
|
101
|
-
批量操作
|
|
102
|
-
<el-icon>
|
|
103
|
-
<ArrowDown />
|
|
104
|
-
</el-icon>
|
|
105
|
-
</el-button>
|
|
106
|
-
<template #dropdown>
|
|
107
|
-
<el-dropdown-menu>
|
|
108
|
-
<el-dropdown-item command="download">下载</el-dropdown-item>
|
|
109
|
-
<el-dropdown-item command="delete">删除</el-dropdown-item>
|
|
110
|
-
<el-dropdown-item command="excel">导出记录</el-dropdown-item>
|
|
111
|
-
</el-dropdown-menu>
|
|
112
|
-
</template>
|
|
113
|
-
</el-dropdown>
|
|
114
|
-
</div>
|
|
115
|
-
<el-button size="default" :icon="Refresh" @click="handleRefresh"
|
|
116
|
-
>刷新</el-button
|
|
117
|
-
>
|
|
118
|
-
<el-button
|
|
119
|
-
title="导出表格中所有的数据"
|
|
120
|
-
type="success"
|
|
121
|
-
size="default"
|
|
122
|
-
:icon="DataAnalysis"
|
|
123
|
-
@click="
|
|
124
|
-
() => {
|
|
125
|
-
handleExportExcel(
|
|
126
|
-
filterFiles,
|
|
127
|
-
`筛选数据导出_${formatDate(
|
|
128
|
-
new Date(),
|
|
129
|
-
'yyyy年MM月日hh时mm分ss秒'
|
|
130
|
-
)}.xlsx`
|
|
131
|
-
)
|
|
132
|
-
}
|
|
133
|
-
"
|
|
134
|
-
:disabled="showFilterFiles.length === 0"
|
|
135
|
-
>导出记录</el-button
|
|
136
|
-
>
|
|
137
|
-
<div class="control-item">
|
|
138
|
-
显示图片
|
|
139
|
-
<el-switch
|
|
140
|
-
inline-prompt
|
|
141
|
-
v-model="showImg"
|
|
142
|
-
active-color="#13ce66"
|
|
143
|
-
inactive-color="#ff4949"
|
|
144
|
-
active-text="是"
|
|
145
|
-
inactive-text="否"
|
|
146
|
-
/>
|
|
147
|
-
</div>
|
|
148
|
-
<div class="control-item">
|
|
149
|
-
展示原文件名
|
|
150
|
-
<el-switch
|
|
151
|
-
inline-prompt
|
|
152
|
-
v-model="showOriginName"
|
|
153
|
-
active-color="#13ce66"
|
|
154
|
-
inactive-color="#ff4949"
|
|
155
|
-
active-text="是"
|
|
156
|
-
inactive-text="否"
|
|
157
|
-
/>
|
|
158
|
-
</div>
|
|
159
|
-
<div class="control-item">
|
|
160
|
-
显示提交人姓名
|
|
161
|
-
<el-switch
|
|
162
|
-
inline-prompt
|
|
163
|
-
v-model="showPeople"
|
|
164
|
-
active-color="#13ce66"
|
|
165
|
-
inactive-color="#ff4949"
|
|
166
|
-
active-text="是"
|
|
167
|
-
inactive-text="否"
|
|
168
|
-
/>
|
|
169
|
-
</div>
|
|
170
|
-
<div class="control-item">
|
|
171
|
-
⏰ 查看下载历史
|
|
172
|
-
<el-switch
|
|
173
|
-
v-model="showHistoryPanel"
|
|
174
|
-
style="
|
|
175
|
-
--el-switch-on-color: #13ce66;
|
|
176
|
-
--el-switch-off-color: #ff4949;
|
|
177
|
-
"
|
|
178
|
-
/>
|
|
179
|
-
</div>
|
|
180
|
-
</div>
|
|
181
|
-
</div>
|
|
182
|
-
<div
|
|
183
|
-
class="panel"
|
|
184
|
-
v-show="historyDownloadRecord.compressTask.length && !showHistoryPanel"
|
|
185
|
-
>
|
|
186
|
-
<tip style="font-size: 16px"
|
|
187
|
-
>正在进行归档的任务
|
|
188
|
-
{{ historyDownloadRecord.compressTask.length }}个</tip
|
|
189
|
-
>
|
|
190
|
-
<tip>详细归档记录点击右上角 “⏰查看下载历史”</tip>
|
|
191
|
-
<p
|
|
192
|
-
v-for="(record, idx) in historyDownloadRecord.compressTask"
|
|
193
|
-
:key="record.id"
|
|
194
|
-
class="tc"
|
|
195
|
-
style="margin-top: 10px"
|
|
196
|
-
>
|
|
197
|
-
{{ idx + 1 }}. {{ record.tip }}
|
|
198
|
-
<span
|
|
199
|
-
v-loading="true"
|
|
200
|
-
element-loading-text="..."
|
|
201
|
-
style="--el-loading-spinner-size: 20px"
|
|
202
|
-
></span>
|
|
203
|
-
</p>
|
|
204
|
-
</div>
|
|
205
|
-
<div class="panel" v-show="showHistoryPanel">
|
|
206
|
-
<tip style="font-size: 16px"
|
|
207
|
-
>”❤️下面展示历史的下载记录与归档任务完成情况❤️“</tip
|
|
208
|
-
>
|
|
209
|
-
<tip>”再也不需要在页面停留等待归档完成“</tip>
|
|
210
|
-
<div>
|
|
211
|
-
<el-table
|
|
212
|
-
v-loading="isLoadingData"
|
|
213
|
-
element-loading-text="Loading..."
|
|
214
|
-
tooltip-effect="dark"
|
|
215
|
-
multipleTable
|
|
216
|
-
ref="multipleTable"
|
|
217
|
-
@selection-change="handleSelectionChange"
|
|
218
|
-
stripe
|
|
219
|
-
border
|
|
220
|
-
:default-sort="{ prop: 'date', order: 'descending' }"
|
|
221
|
-
:max-height="666"
|
|
222
|
-
:data="historyDownloadRecord.actions"
|
|
223
|
-
style="width: 100%"
|
|
224
|
-
>
|
|
225
|
-
<el-table-column prop="date" label="触发时间" width="200">
|
|
226
|
-
<template #default="scope">{{
|
|
227
|
-
formatDate(new Date(scope.row.date))
|
|
228
|
-
}}</template>
|
|
229
|
-
</el-table-column>
|
|
230
|
-
<el-table-column prop="tip" label="文件信息"></el-table-column>
|
|
231
|
-
<el-table-column prop="type" label="任务类型">
|
|
232
|
-
<template #default="scope">
|
|
233
|
-
<el-link
|
|
234
|
-
v-if="scope.row.type === ActionType.Compress"
|
|
235
|
-
type="primary"
|
|
236
|
-
>归档下载</el-link
|
|
237
|
-
>
|
|
238
|
-
<el-link v-else type="default">普通下载</el-link>
|
|
239
|
-
</template>
|
|
240
|
-
</el-table-column>
|
|
241
|
-
<el-table-column prop="size" label="大小" width="100">
|
|
242
|
-
<template #default="scope">
|
|
243
|
-
<span v-if="scope.row.status === DownloadStatus.ARCHIVE"
|
|
244
|
-
><el-link type="danger">归档中...</el-link></span
|
|
245
|
-
>
|
|
246
|
-
<span v-else-if="scope.row.status !== DownloadStatus.FAIL">{{
|
|
247
|
-
!scope.row.size ? '未知大小' : formatSize(scope.row.size)
|
|
248
|
-
}}</span>
|
|
249
|
-
<span v-if="scope.row.status === DownloadStatus.FAIL"
|
|
250
|
-
><el-link type="danger">归档失败</el-link></span
|
|
251
|
-
>
|
|
252
|
-
</template>
|
|
253
|
-
</el-table-column>
|
|
254
|
-
<el-table-column fixed="right" label="操作" width="140">
|
|
255
|
-
<template #default="scope">
|
|
256
|
-
<div
|
|
257
|
-
v-loading="true"
|
|
258
|
-
v-if="scope.row.status === DownloadStatus.ARCHIVE"
|
|
259
|
-
>
|
|
260
|
-
归档中...
|
|
261
|
-
</div>
|
|
262
|
-
<div v-if="scope.row.status === DownloadStatus.EXPIRED">
|
|
263
|
-
链接已失效
|
|
264
|
-
</div>
|
|
265
|
-
<div v-if="scope.row.status === DownloadStatus.FAIL">
|
|
266
|
-
联系开发者,提供错误信息:{{ scope.row.error }}
|
|
267
|
-
</div>
|
|
268
|
-
<div v-if="scope.row.status === DownloadStatus.SUCCESS">
|
|
269
|
-
<el-link @click="downLoadByUrl(scope.row.url)" type="primary"
|
|
270
|
-
>下载</el-link
|
|
271
|
-
>
|
|
272
|
-
<el-link
|
|
273
|
-
type="success"
|
|
274
|
-
style="margin-left: 10px"
|
|
275
|
-
@click="copyRes(scope.row.url)"
|
|
276
|
-
>链接</el-link
|
|
277
|
-
>
|
|
278
|
-
<el-link
|
|
279
|
-
type="warning"
|
|
280
|
-
style="margin-left: 10px"
|
|
281
|
-
@click="
|
|
282
|
-
() => {
|
|
283
|
-
showLinkModel = true
|
|
284
|
-
downloadUrl = scope.row.url
|
|
285
|
-
}
|
|
286
|
-
"
|
|
287
|
-
>二维码</el-link
|
|
288
|
-
>
|
|
289
|
-
</div>
|
|
290
|
-
</template>
|
|
291
|
-
</el-table-column>
|
|
292
|
-
</el-table>
|
|
293
|
-
<div class="flex fc">
|
|
294
|
-
<el-pagination
|
|
295
|
-
small
|
|
296
|
-
:current-page="historyDownloadRecord.pageCurrent"
|
|
297
|
-
:page-count="historyDownloadRecord.pageCount"
|
|
298
|
-
:total="historyDownloadRecord.pageTotal"
|
|
299
|
-
layout="total, prev, pager, next"
|
|
300
|
-
@current-change="handleHistoryActionPageChange"
|
|
301
|
-
></el-pagination>
|
|
302
|
-
</div>
|
|
303
|
-
</div>
|
|
304
|
-
</div>
|
|
305
|
-
<!-- 主体内容 -->
|
|
306
|
-
<div class="panel">
|
|
307
|
-
<Tip>空间占用情况:{{ filterFileSize }} / {{ fileListSize }}</Tip>
|
|
308
|
-
<Tip>↑ 仅供使用者参考,应用无存储空间上限,也不收费</Tip>
|
|
309
|
-
<Tip
|
|
310
|
-
><strong
|
|
311
|
-
>如果你觉得应用不错,<a
|
|
312
|
-
style="color: #409eff"
|
|
313
|
-
href="http://docs.ep.sugarat.top/praise/index.html"
|
|
314
|
-
target="_blank"
|
|
315
|
-
rel="noopener noreferrer"
|
|
316
|
-
>请作者喝茶 🍵</a
|
|
317
|
-
></strong
|
|
318
|
-
>
|
|
319
|
-
<!-- <Praise>
|
|
320
|
-
<el-button style="margin:0 0 2px;" size="small" type="primary" text>Go!Go!❓</el-button>
|
|
321
|
-
</Praise> -->
|
|
322
|
-
</Tip>
|
|
323
|
-
<el-table
|
|
324
|
-
v-loading="isLoadingData"
|
|
325
|
-
element-loading-text="Loading..."
|
|
326
|
-
tooltip-effect="dark"
|
|
327
|
-
multipleTable
|
|
328
|
-
ref="multipleTable"
|
|
329
|
-
@selection-change="handleSelectionChange"
|
|
330
|
-
stripe
|
|
331
|
-
border
|
|
332
|
-
:max-height="666"
|
|
333
|
-
:data="showFilterFiles"
|
|
334
|
-
style="width: 100%"
|
|
335
|
-
>
|
|
336
|
-
<el-table-column type="selection" width="55" />
|
|
337
|
-
<el-table-column prop="date" label="提交时间" width="200">
|
|
338
|
-
<template #default="scope">{{
|
|
339
|
-
formatDate(new Date(scope.row.date))
|
|
340
|
-
}}</template>
|
|
341
|
-
</el-table-column>
|
|
342
|
-
<el-table-column
|
|
343
|
-
prop="task_name"
|
|
344
|
-
label="任务"
|
|
345
|
-
width="150"
|
|
346
|
-
></el-table-column>
|
|
347
|
-
<el-table-column
|
|
348
|
-
prop="name"
|
|
349
|
-
label="文件名"
|
|
350
|
-
width="200"
|
|
351
|
-
></el-table-column>
|
|
352
|
-
<template v-if="showOriginName">
|
|
353
|
-
<el-table-column prop="origin_name" label="原文件名" width="200">
|
|
354
|
-
<template #default="scope">
|
|
355
|
-
{{ scope.row.origin_name || '-' }}
|
|
356
|
-
</template>
|
|
357
|
-
</el-table-column>
|
|
358
|
-
</template>
|
|
359
|
-
<el-table-column prop="size" label="大小">
|
|
360
|
-
<template #default="scope">{{
|
|
361
|
-
scope.row.size === 0 ? '未知大小' : formatSize(scope.row.size)
|
|
362
|
-
}}</template>
|
|
363
|
-
</el-table-column>
|
|
364
|
-
<template v-if="showImg">
|
|
365
|
-
<el-table-column label="缩略图" width="120">
|
|
366
|
-
<template #default="scope">
|
|
367
|
-
<el-image
|
|
368
|
-
@switch="handleSwitchImage"
|
|
369
|
-
@click="handleSwitchImage(scope.$index)"
|
|
370
|
-
preview-teleported
|
|
371
|
-
:preview-src-list="previewImages"
|
|
372
|
-
:initial-index="scope.$index"
|
|
373
|
-
lazy
|
|
374
|
-
style="width: 100px; height: 100px"
|
|
375
|
-
:src="scope.row.cover"
|
|
376
|
-
fit="cover"
|
|
377
|
-
>
|
|
378
|
-
<template #viewer>
|
|
379
|
-
<div class="imageDes">{{ viewImageFilename }}</div>
|
|
380
|
-
</template>
|
|
381
|
-
<template #placeholder>
|
|
382
|
-
<div class="imageLoading">Loading...</div>
|
|
383
|
-
</template>
|
|
384
|
-
<template #error>
|
|
385
|
-
<div class="imageLoading">
|
|
386
|
-
不支持
|
|
387
|
-
<el-icon>
|
|
388
|
-
<Picture />
|
|
389
|
-
</el-icon>
|
|
390
|
-
</div>
|
|
391
|
-
</template>
|
|
392
|
-
</el-image>
|
|
393
|
-
</template>
|
|
394
|
-
</el-table-column>
|
|
395
|
-
</template>
|
|
396
|
-
<template v-if="showPeople">
|
|
397
|
-
<el-table-column prop="people" label="姓名">
|
|
398
|
-
<template #default="scope">
|
|
399
|
-
{{ scope.row.people || '-' }}
|
|
400
|
-
</template>
|
|
401
|
-
</el-table-column>
|
|
402
|
-
</template>
|
|
403
|
-
<el-table-column fixed="right" label="操作" width="140">
|
|
404
|
-
<template #default="scope">
|
|
405
|
-
<div class="text-btns">
|
|
406
|
-
<el-button
|
|
407
|
-
@click="checkInfo(scope.row)"
|
|
408
|
-
type="primary"
|
|
409
|
-
text
|
|
410
|
-
size="small"
|
|
411
|
-
>查看提交信息</el-button
|
|
412
|
-
>
|
|
413
|
-
<el-button
|
|
414
|
-
@click="rewriteFilename(scope.row)"
|
|
415
|
-
type="primary"
|
|
416
|
-
text
|
|
417
|
-
size="small"
|
|
418
|
-
>修改文件名</el-button
|
|
419
|
-
>
|
|
420
|
-
<el-button
|
|
421
|
-
@click="downloadOne(scope.row)"
|
|
422
|
-
type="primary"
|
|
423
|
-
text
|
|
424
|
-
size="small"
|
|
425
|
-
>下载</el-button
|
|
426
|
-
>
|
|
427
|
-
<el-button
|
|
428
|
-
@click="handleDelete(scope.row)"
|
|
429
|
-
type="primary"
|
|
430
|
-
text
|
|
431
|
-
size="small"
|
|
432
|
-
>删除</el-button
|
|
433
|
-
>
|
|
434
|
-
</div>
|
|
435
|
-
</template>
|
|
436
|
-
</el-table-column>
|
|
437
|
-
</el-table>
|
|
438
|
-
</div>
|
|
439
|
-
<!-- 分页 -->
|
|
440
|
-
<div class="panel flex fc">
|
|
441
|
-
<el-pagination
|
|
442
|
-
:current-page="pageCurrent"
|
|
443
|
-
@current-change="handlePageChange"
|
|
444
|
-
background
|
|
445
|
-
:page-count="pageCount"
|
|
446
|
-
:page-sizes="[6, 10, 50, 100]"
|
|
447
|
-
:page-size="pageSize"
|
|
448
|
-
@size-change="handleSizeChange"
|
|
449
|
-
:total="filterFiles.length"
|
|
450
|
-
layout="total, sizes, prev, pager, next, jumper"
|
|
451
|
-
></el-pagination>
|
|
452
|
-
</div>
|
|
453
|
-
<!-- 信息弹窗 -->
|
|
454
|
-
<el-dialog
|
|
455
|
-
:fullscreen="isMobile"
|
|
456
|
-
title="提交填写的信息"
|
|
457
|
-
v-model="showInfoDialog"
|
|
458
|
-
>
|
|
459
|
-
<InfosForm :infos="infos" :disabled="true" />
|
|
460
|
-
</el-dialog>
|
|
461
|
-
<LinkDialog
|
|
462
|
-
v-model:value="showLinkModel"
|
|
463
|
-
title="下载链接"
|
|
464
|
-
:link="downloadUrl"
|
|
465
|
-
></LinkDialog>
|
|
466
|
-
<el-dialog
|
|
467
|
-
:fullscreen="isMobile"
|
|
468
|
-
title="修改文件名"
|
|
469
|
-
v-model="showRenameDialog"
|
|
470
|
-
>
|
|
471
|
-
<div>
|
|
472
|
-
<el-form label-width="100px" :model="renameForm">
|
|
473
|
-
<el-form-item label="原文件名" prop="newName">
|
|
474
|
-
<el-input v-model="renameForm.oldName" disabled />
|
|
475
|
-
</el-form-item>
|
|
476
|
-
<el-form-item label="新文件名" prop="newName">
|
|
477
|
-
<el-input v-model="renameForm.newName" placeholder="请输入新文件名">
|
|
478
|
-
<template #append>
|
|
479
|
-
{{ renameForm.suffix }}
|
|
480
|
-
</template>
|
|
481
|
-
</el-input>
|
|
482
|
-
</el-form-item>
|
|
483
|
-
<el-form-item>
|
|
484
|
-
<el-button type="success" @click="handleSaveNewName"
|
|
485
|
-
>保存</el-button
|
|
486
|
-
>
|
|
487
|
-
<el-button @click="showRenameDialog = false">取消</el-button>
|
|
488
|
-
</el-form-item>
|
|
489
|
-
</el-form>
|
|
490
|
-
</div>
|
|
491
|
-
</el-dialog>
|
|
492
|
-
</div>
|
|
493
|
-
</template>
|
|
494
|
-
<script lang="ts" setup>
|
|
495
|
-
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
496
|
-
import { computed, onMounted, reactive, ref, watchEffect } from 'vue'
|
|
497
|
-
import { useStore } from 'vuex'
|
|
498
|
-
import LinkDialog from '@components/linkDialog.vue'
|
|
499
|
-
import {
|
|
500
|
-
ArrowDown,
|
|
501
|
-
Refresh,
|
|
502
|
-
DataAnalysis,
|
|
503
|
-
Download,
|
|
504
|
-
Search,
|
|
505
|
-
Picture
|
|
506
|
-
} from '@element-plus/icons-vue'
|
|
507
|
-
import { useRoute } from 'vue-router'
|
|
508
|
-
import {
|
|
509
|
-
copyRes,
|
|
510
|
-
formatDate,
|
|
511
|
-
formatSize,
|
|
512
|
-
getFileSuffix,
|
|
513
|
-
parseInfo
|
|
514
|
-
} from '@/utils/stringUtil'
|
|
515
|
-
import { ActionServiceAPI, FileApi } from '@/apis'
|
|
516
|
-
import { downLoadByUrl, tableItem, tableToExcel } from '@/utils/networkUtil'
|
|
517
|
-
import Tip from '../tasks/components/infoPanel/tip.vue'
|
|
518
|
-
import InfosForm from '@/components/InfosForm/index.vue'
|
|
519
|
-
import { DownloadStatus, ActionType, filenamePattern } from '@/constants'
|
|
520
|
-
|
|
521
|
-
const $store = useStore()
|
|
522
|
-
const $route = useRoute()
|
|
523
|
-
const showLinkModel = ref(false)
|
|
524
|
-
const downloadUrl = ref('')
|
|
525
|
-
const showImg = ref(localStorage.getItem('ep-show-images') === 'true')
|
|
526
|
-
const showPeople = ref(true)
|
|
527
|
-
const showOriginName = ref(false)
|
|
528
|
-
const showHistoryPanel = ref(false)
|
|
529
|
-
const historyDownloadRecord = reactive({
|
|
530
|
-
actions: [],
|
|
531
|
-
pageSize: 3,
|
|
532
|
-
/**
|
|
533
|
-
* 总页数
|
|
534
|
-
*/
|
|
535
|
-
pageCount: 0,
|
|
536
|
-
pageCurrent: 1,
|
|
537
|
-
pageTotal: 0,
|
|
538
|
-
compressTask: []
|
|
539
|
-
})
|
|
540
|
-
|
|
541
|
-
const loadActions = () => {
|
|
542
|
-
// 已记录的task
|
|
543
|
-
const compressTask: ActionApiTypes.DownloadActionData[] = JSON.parse(
|
|
544
|
-
localStorage.getItem('ep_compress_task') || '[]'
|
|
545
|
-
)
|
|
546
|
-
historyDownloadRecord.compressTask = compressTask
|
|
547
|
-
|
|
548
|
-
ActionServiceAPI.getDownloadActions(
|
|
549
|
-
historyDownloadRecord.pageSize,
|
|
550
|
-
historyDownloadRecord.pageCurrent,
|
|
551
|
-
compressTask.map((v) => v.id)
|
|
552
|
-
).then((v) => {
|
|
553
|
-
const { actions, sum } = v.data
|
|
554
|
-
const haveArchive = !!actions.find(
|
|
555
|
-
(v) => v.status === DownloadStatus.ARCHIVE
|
|
556
|
-
)
|
|
557
|
-
|
|
558
|
-
actions
|
|
559
|
-
.filter((v) => v.type === ActionType.Compress)
|
|
560
|
-
.forEach((action) => {
|
|
561
|
-
const existIndex = compressTask.findIndex((v) => v.id === action.id)
|
|
562
|
-
// 判断状态
|
|
563
|
-
// SUCCESS
|
|
564
|
-
// 存在,触发下载,从compressTask移除
|
|
565
|
-
if (action.status === DownloadStatus.SUCCESS && existIndex !== -1) {
|
|
566
|
-
// 展示弹窗
|
|
567
|
-
downloadUrl.value = action.url
|
|
568
|
-
showLinkModel.value = true
|
|
569
|
-
downLoadByUrl(action.url)
|
|
570
|
-
// ElMessage.success(`自动下载归档任务 ${action.tip}`)
|
|
571
|
-
compressTask.splice(existIndex, 1)
|
|
572
|
-
}
|
|
573
|
-
// Archive
|
|
574
|
-
// 不存在,push进compressTask
|
|
575
|
-
if (action.status === DownloadStatus.ARCHIVE && existIndex === -1) {
|
|
576
|
-
compressTask.push(action)
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
// ERROR
|
|
580
|
-
if (action.status === DownloadStatus.FAIL && existIndex !== -1) {
|
|
581
|
-
compressTask.splice(existIndex, 1)
|
|
582
|
-
}
|
|
583
|
-
})
|
|
584
|
-
// TODO:之后根据反馈优化
|
|
585
|
-
historyDownloadRecord.compressTask = compressTask
|
|
586
|
-
localStorage.setItem('ep_compress_task', JSON.stringify(compressTask))
|
|
587
|
-
if (haveArchive) {
|
|
588
|
-
// 递归查询
|
|
589
|
-
setTimeout(loadActions, 1000)
|
|
590
|
-
}
|
|
591
|
-
historyDownloadRecord.pageTotal = sum
|
|
592
|
-
historyDownloadRecord.actions = actions
|
|
593
|
-
historyDownloadRecord.pageCount = Math.ceil(
|
|
594
|
-
sum / historyDownloadRecord.pageSize
|
|
595
|
-
)
|
|
596
|
-
})
|
|
597
|
-
}
|
|
598
|
-
const handleHistoryActionPageChange = (v) => {
|
|
599
|
-
historyDownloadRecord.pageCurrent = v
|
|
600
|
-
loadActions()
|
|
601
|
-
}
|
|
602
|
-
// 记录导出
|
|
603
|
-
const handleExportExcel = (files: FileApiTypes.File[], filename?: string) => {
|
|
604
|
-
if (files.length === 0) {
|
|
605
|
-
ElMessage.warning('表格中没有可导出的内容')
|
|
606
|
-
return
|
|
607
|
-
}
|
|
608
|
-
const baseHeaders = ['提交时间', '任务', '文件名', '大小']
|
|
609
|
-
if (showOriginName.value) {
|
|
610
|
-
baseHeaders.push('原文件名')
|
|
611
|
-
}
|
|
612
|
-
if (showPeople.value) {
|
|
613
|
-
baseHeaders.push('姓名')
|
|
614
|
-
}
|
|
615
|
-
const headers: (string | tableItem)[] = baseHeaders.map((v) => ({
|
|
616
|
-
value: v,
|
|
617
|
-
row: 2
|
|
618
|
-
}))
|
|
619
|
-
|
|
620
|
-
const infosHeader = files.reduce((pre, value) => {
|
|
621
|
-
JSON.parse(value.info).forEach((i: any) => {
|
|
622
|
-
if (!pre.includes(i.text)) {
|
|
623
|
-
pre.push(i.text)
|
|
624
|
-
}
|
|
625
|
-
})
|
|
626
|
-
return pre
|
|
627
|
-
}, [])
|
|
628
|
-
headers.push({
|
|
629
|
-
value: '提交信息',
|
|
630
|
-
col: infosHeader.length
|
|
631
|
-
})
|
|
632
|
-
|
|
633
|
-
const body = files.map((v) => {
|
|
634
|
-
const { date, task_name: taskName, name, size, people } = v
|
|
635
|
-
const infoObj = JSON.parse(v.info).reduce((pre, v) => {
|
|
636
|
-
pre[v.text] = v.value
|
|
637
|
-
return pre
|
|
638
|
-
}, {})
|
|
639
|
-
const info = infosHeader.map((v) => infoObj[v] ?? '-')
|
|
640
|
-
const rows = [formatDate(new Date(date)), taskName, name, formatSize(size)]
|
|
641
|
-
if (showOriginName.value) {
|
|
642
|
-
rows.push(v.origin_name || '-')
|
|
643
|
-
}
|
|
644
|
-
if (showPeople.value) {
|
|
645
|
-
rows.push(people || '-')
|
|
646
|
-
}
|
|
647
|
-
rows.push(...info)
|
|
648
|
-
return rows
|
|
649
|
-
})
|
|
650
|
-
body.unshift(infosHeader)
|
|
651
|
-
tableToExcel(
|
|
652
|
-
headers,
|
|
653
|
-
body,
|
|
654
|
-
filename ||
|
|
655
|
-
`数据导出_${formatDate(new Date(), 'yyyy年MM月日hh时mm分ss秒')}.xlsx`
|
|
656
|
-
)
|
|
657
|
-
ElMessage.success('导出成功')
|
|
658
|
-
}
|
|
659
|
-
// 分类相关
|
|
660
|
-
const categories = computed(() => $store.state.category.categoryList)
|
|
661
|
-
const selectCategory = ref('all')
|
|
662
|
-
// 任务相关
|
|
663
|
-
const tasks = computed<TaskApiTypes.TaskItem[]>(
|
|
664
|
-
() => $store.state.task.taskList
|
|
665
|
-
)
|
|
666
|
-
const selectTask = ref('all')
|
|
667
|
-
const filterTasks = computed(() => {
|
|
668
|
-
if (selectCategory.value === 'all') {
|
|
669
|
-
return tasks.value
|
|
670
|
-
}
|
|
671
|
-
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
|
|
672
|
-
selectTask.value = 'all'
|
|
673
|
-
return tasks.value.filter((t) => t.category === selectCategory.value)
|
|
674
|
-
})
|
|
675
|
-
const selectTaskName = computed(() => {
|
|
676
|
-
const t = filterTasks.value.find((v) => v.key === selectTask.value)
|
|
677
|
-
return t?.name
|
|
678
|
-
})
|
|
679
|
-
|
|
680
|
-
watchEffect(() => {
|
|
681
|
-
if (
|
|
682
|
-
tasks.value.length &&
|
|
683
|
-
tasks.value.some((v) => v.key === $route.query.task)
|
|
684
|
-
) {
|
|
685
|
-
selectTask.value = `${$route.query.task}`
|
|
686
|
-
}
|
|
687
|
-
})
|
|
688
|
-
|
|
689
|
-
const isLoadingData = ref(false)
|
|
690
|
-
// 提交的所有文件
|
|
691
|
-
const files: FileApiTypes.File[] = reactive([])
|
|
692
|
-
const loadFiles = () => {
|
|
693
|
-
isLoadingData.value = true
|
|
694
|
-
files.splice(0, files.length)
|
|
695
|
-
FileApi.getFileList().then((res) => {
|
|
696
|
-
files.push(...res.data.files)
|
|
697
|
-
isLoadingData.value = false
|
|
698
|
-
})
|
|
699
|
-
}
|
|
700
|
-
const multipleTable: any = ref()
|
|
701
|
-
const searchWord = ref('')
|
|
702
|
-
|
|
703
|
-
// 用于展示的文件
|
|
704
|
-
// 1. 过滤指定任务
|
|
705
|
-
const filterFiles = computed(() =>
|
|
706
|
-
files
|
|
707
|
-
.filter((f) => {
|
|
708
|
-
if (selectCategory.value === 'no-task') {
|
|
709
|
-
return tasks.value.every((t) => t.key !== f.task_key)
|
|
710
|
-
}
|
|
711
|
-
if (filterTasks.value.length === 0) {
|
|
712
|
-
return false
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
if (selectTask.value === 'all') {
|
|
716
|
-
return filterTasks.value.find((t) => t.key === f.task_key)
|
|
717
|
-
}
|
|
718
|
-
|
|
719
|
-
return selectTask.value === f.task_key
|
|
720
|
-
// 2. 过滤关键词(精细优化)
|
|
721
|
-
})
|
|
722
|
-
.filter((t) =>
|
|
723
|
-
searchWord.value
|
|
724
|
-
? JSON.stringify([
|
|
725
|
-
formatDate(new Date(t.date)),
|
|
726
|
-
formatSize(t.size),
|
|
727
|
-
t.people,
|
|
728
|
-
t.name,
|
|
729
|
-
t.task_name,
|
|
730
|
-
// eslint-disable-next-line no-useless-escape
|
|
731
|
-
t.info
|
|
732
|
-
])
|
|
733
|
-
.replace(/[:'"{},[\]]/g, '')
|
|
734
|
-
.includes(searchWord.value)
|
|
735
|
-
: true
|
|
736
|
-
)
|
|
737
|
-
)
|
|
738
|
-
|
|
739
|
-
/**
|
|
740
|
-
* 清空所有选项
|
|
741
|
-
*/
|
|
742
|
-
const clearSelection = () => {
|
|
743
|
-
multipleTable.value.clearSelection()
|
|
744
|
-
}
|
|
745
|
-
// 多选选中的项
|
|
746
|
-
const selectItem: any[] = reactive([])
|
|
747
|
-
const handleSelectionChange = (e: any) => {
|
|
748
|
-
selectItem.splice(0, selectItem.length)
|
|
749
|
-
selectItem.push(...e)
|
|
750
|
-
}
|
|
751
|
-
const batchDownStart = ref(false)
|
|
752
|
-
const handleDropdownClick = (e: string) => {
|
|
753
|
-
const ids: number[] = selectItem.map((v) => v.id)
|
|
754
|
-
switch (e) {
|
|
755
|
-
case 'download':
|
|
756
|
-
if (selectItem.length === 0) {
|
|
757
|
-
ElMessage.warning('没有选中需要下载的内容')
|
|
758
|
-
return
|
|
759
|
-
}
|
|
760
|
-
if (batchDownStart.value) {
|
|
761
|
-
ElMessage.warning('已经有批量下载任务正在进行,请稍后再试')
|
|
762
|
-
return
|
|
763
|
-
}
|
|
764
|
-
FileApi.batchDownload(
|
|
765
|
-
ids,
|
|
766
|
-
`批量下载_${formatDate(new Date(), 'yyyy年MM月日hh时mm分ss秒')}`
|
|
767
|
-
)
|
|
768
|
-
.then(() => {
|
|
769
|
-
loadActions()
|
|
770
|
-
})
|
|
771
|
-
.catch(() => {
|
|
772
|
-
ElMessage.error('所选文件均已从服务器上移除')
|
|
773
|
-
batchDownStart.value = false
|
|
774
|
-
})
|
|
775
|
-
ElMessage.info('开始归档选中的文件,请赖心等待')
|
|
776
|
-
break
|
|
777
|
-
case 'delete':
|
|
778
|
-
if (selectItem.length === 0) {
|
|
779
|
-
ElMessage.warning('没有选中需要删除的内容')
|
|
780
|
-
return
|
|
781
|
-
}
|
|
782
|
-
ElMessageBox.confirm('删除后无法恢复,是否删除', '数据无价,请谨慎操作')
|
|
783
|
-
.then(() => {
|
|
784
|
-
FileApi.batchDel(ids).then(() => {
|
|
785
|
-
files.splice(
|
|
786
|
-
0,
|
|
787
|
-
files.length,
|
|
788
|
-
...files.filter((v) => !ids.includes(v.id))
|
|
789
|
-
)
|
|
790
|
-
ElMessage.success('删除成功')
|
|
791
|
-
})
|
|
792
|
-
})
|
|
793
|
-
.catch(() => {
|
|
794
|
-
ElMessage.info('取消')
|
|
795
|
-
})
|
|
796
|
-
break
|
|
797
|
-
case 'excel':
|
|
798
|
-
if (selectItem.length === 0) {
|
|
799
|
-
ElMessage.warning('没有选中需要导出的内容')
|
|
800
|
-
return
|
|
801
|
-
}
|
|
802
|
-
handleExportExcel(
|
|
803
|
-
selectItem,
|
|
804
|
-
`批量导出_${formatDate(new Date(), 'yyyy年MM月日hh时mm分ss秒')}.xlsx`
|
|
805
|
-
)
|
|
806
|
-
ElMessage.success('导出成功')
|
|
807
|
-
break
|
|
808
|
-
default:
|
|
809
|
-
break
|
|
810
|
-
}
|
|
811
|
-
clearSelection()
|
|
812
|
-
}
|
|
813
|
-
const showInfoDialog = ref(false)
|
|
814
|
-
const infos: any[] = reactive([])
|
|
815
|
-
const checkInfo = (e: any) => {
|
|
816
|
-
infos.splice(0, infos.length)
|
|
817
|
-
infos.push(...parseInfo(e.info))
|
|
818
|
-
showInfoDialog.value = true
|
|
819
|
-
}
|
|
820
|
-
|
|
821
|
-
const showRenameDialog = ref(false)
|
|
822
|
-
const renameForm = reactive({
|
|
823
|
-
oldName: '',
|
|
824
|
-
newName: '',
|
|
825
|
-
suffix: '',
|
|
826
|
-
id: -1
|
|
827
|
-
})
|
|
828
|
-
const rewriteFilename = (e: any) => {
|
|
829
|
-
const { id, name } = e
|
|
830
|
-
const suffix = getFileSuffix(name)
|
|
831
|
-
renameForm.oldName = name
|
|
832
|
-
renameForm.suffix = suffix
|
|
833
|
-
renameForm.id = id
|
|
834
|
-
showRenameDialog.value = true
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
const handleSaveNewName = () => {
|
|
838
|
-
// 文件名校验,不能有系统不支持的字符
|
|
839
|
-
if (filenamePattern.test(renameForm.newName)) {
|
|
840
|
-
ElMessage.error(`文件名不能包含${filenamePattern.source}等字符`)
|
|
841
|
-
filenamePattern.lastIndex = 0
|
|
842
|
-
return
|
|
843
|
-
}
|
|
844
|
-
FileApi.updateFilename(
|
|
845
|
-
renameForm.id,
|
|
846
|
-
`${renameForm.newName}${renameForm.suffix}`
|
|
847
|
-
)
|
|
848
|
-
.then(() => {
|
|
849
|
-
ElMessage.success('修改成功')
|
|
850
|
-
const file = files.find((v) => v.id === renameForm.id)
|
|
851
|
-
file.name = `${renameForm.newName}${renameForm.suffix}`
|
|
852
|
-
})
|
|
853
|
-
.catch(() => {
|
|
854
|
-
ElMessage.error('修改失败')
|
|
855
|
-
})
|
|
856
|
-
.finally(() => {
|
|
857
|
-
showRenameDialog.value = false
|
|
858
|
-
})
|
|
859
|
-
}
|
|
860
|
-
|
|
861
|
-
const downloadOne = (e: any) => {
|
|
862
|
-
const { id, name } = e
|
|
863
|
-
FileApi.getOneFileUrl(id)
|
|
864
|
-
.then((res) => {
|
|
865
|
-
const { link } = res.data
|
|
866
|
-
showLinkModel.value = true
|
|
867
|
-
downloadUrl.value = link
|
|
868
|
-
downLoadByUrl(link, name)
|
|
869
|
-
// 刷新
|
|
870
|
-
loadActions()
|
|
871
|
-
})
|
|
872
|
-
.catch(() => {
|
|
873
|
-
ElMessage.error('文件已从服务器上移除')
|
|
874
|
-
})
|
|
875
|
-
}
|
|
876
|
-
const handleDelete = (e: any) => {
|
|
877
|
-
const idx = files.findIndex((v) => v === e)
|
|
878
|
-
ElMessageBox.confirm('确认删除此文件吗?', '数据无价,请谨慎操作')
|
|
879
|
-
.then(() => {
|
|
880
|
-
FileApi.deleteOneFile(e.id).then(() => {
|
|
881
|
-
ElMessage.success('删除成功')
|
|
882
|
-
files.splice(idx, 1)
|
|
883
|
-
})
|
|
884
|
-
})
|
|
885
|
-
.catch(() => {
|
|
886
|
-
ElMessage.info('取消删除')
|
|
887
|
-
})
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
// 分页
|
|
891
|
-
const pageSize = ref(6)
|
|
892
|
-
const handleSizeChange = (v: number) => {
|
|
893
|
-
pageSize.value = v
|
|
894
|
-
}
|
|
895
|
-
const pageCount = computed(() => {
|
|
896
|
-
const t = Math.ceil(filterFiles.value.length / pageSize.value)
|
|
897
|
-
return t
|
|
898
|
-
})
|
|
899
|
-
// 当前页
|
|
900
|
-
const pageCurrent = ref(1)
|
|
901
|
-
const showFilterFiles = computed(() => {
|
|
902
|
-
const start = (pageCurrent.value - 1) * pageSize.value
|
|
903
|
-
const end = pageCurrent.value * pageSize.value
|
|
904
|
-
return filterFiles.value.slice(start, end)
|
|
905
|
-
})
|
|
906
|
-
|
|
907
|
-
const filterFileSize = computed(() =>
|
|
908
|
-
formatSize(filterFiles.value.reduce((acc, cur) => acc + cur.size, 0))
|
|
909
|
-
)
|
|
910
|
-
const fileListSize = computed(() =>
|
|
911
|
-
formatSize(files.reduce((acc, cur) => acc + cur.size, 0))
|
|
912
|
-
)
|
|
913
|
-
const handlePageChange = (idx: number) => {
|
|
914
|
-
pageCurrent.value = idx
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
// 刷新文件列表
|
|
918
|
-
|
|
919
|
-
const handleRefresh = () => {
|
|
920
|
-
ElMessage.success({
|
|
921
|
-
message: '刷新成功'
|
|
922
|
-
})
|
|
923
|
-
loadFiles()
|
|
924
|
-
}
|
|
925
|
-
const handleDownloadTask = () => {
|
|
926
|
-
const ids: number[] = files
|
|
927
|
-
.filter((f) => f.task_key === selectTask.value)
|
|
928
|
-
.map((v) => v.id)
|
|
929
|
-
if (ids.length === 0) {
|
|
930
|
-
ElMessage.warning('该任务中没有数据')
|
|
931
|
-
return
|
|
932
|
-
}
|
|
933
|
-
if (batchDownStart.value) {
|
|
934
|
-
ElMessage.warning('已经有批量下载任务正在进行,请稍后再试')
|
|
935
|
-
return
|
|
936
|
-
}
|
|
937
|
-
batchDownStart.value = true
|
|
938
|
-
FileApi.batchDownload(ids, selectTaskName.value)
|
|
939
|
-
.then(() => {
|
|
940
|
-
loadActions()
|
|
941
|
-
})
|
|
942
|
-
.catch(() => {
|
|
943
|
-
ElMessage.error('所选任务中的文件均已从服务器上移除')
|
|
944
|
-
})
|
|
945
|
-
.finally(() => {
|
|
946
|
-
setTimeout(() => {
|
|
947
|
-
batchDownStart.value = false
|
|
948
|
-
}, 1000)
|
|
949
|
-
})
|
|
950
|
-
ElMessage.info('开始归档选中的文件,请赖心等待')
|
|
951
|
-
}
|
|
952
|
-
|
|
953
|
-
const previewData = reactive<
|
|
954
|
-
{ cover: string; preview: string; name: string; date: string; id: number }[]
|
|
955
|
-
>([])
|
|
956
|
-
const sortProps = reactive({
|
|
957
|
-
order: null,
|
|
958
|
-
prop: null
|
|
959
|
-
})
|
|
960
|
-
const viewImageFilename = ref('')
|
|
961
|
-
const handleFilesSortChange = (v) => {
|
|
962
|
-
sortProps.prop = v.prop
|
|
963
|
-
sortProps.order = v.order
|
|
964
|
-
}
|
|
965
|
-
const previewImages = computed(() => {
|
|
966
|
-
// if (!sortProps.prop) {
|
|
967
|
-
return previewData.map((v) => v.preview)
|
|
968
|
-
// }
|
|
969
|
-
// TODO:下面代码暂不生效,后续再支持表格排序场景
|
|
970
|
-
// const temp = [...previewData]
|
|
971
|
-
// temp.sort((a, b) => {
|
|
972
|
-
// if (sortProps.order === 'descending') {
|
|
973
|
-
// return a[sortProps.prop] - b[sortProps.prop]
|
|
974
|
-
// }
|
|
975
|
-
// return b[sortProps.prop] - a[sortProps.prop]
|
|
976
|
-
// })
|
|
977
|
-
// return temp.map((v) => v.preview)
|
|
978
|
-
})
|
|
979
|
-
|
|
980
|
-
const handleSwitchImage = (idx: number) => {
|
|
981
|
-
viewImageFilename.value = showFilterFiles.value[idx].name
|
|
982
|
-
}
|
|
983
|
-
|
|
984
|
-
let fetching = false
|
|
985
|
-
const refreshFilesCover = () => {
|
|
986
|
-
const ids = showFilterFiles.value.map((v) => v.id)
|
|
987
|
-
if (ids.length === 0 || fetching) {
|
|
988
|
-
return
|
|
989
|
-
}
|
|
990
|
-
fetching = true
|
|
991
|
-
FileApi.checkImageFilePreviewUrl(ids).then((r) => {
|
|
992
|
-
fetching = false
|
|
993
|
-
const { data } = r
|
|
994
|
-
if (data.length === 0 || data.length !== showFilterFiles.value.length) {
|
|
995
|
-
return
|
|
996
|
-
}
|
|
997
|
-
previewData.splice(0, previewData.length)
|
|
998
|
-
showFilterFiles.value.forEach((v, idx) => {
|
|
999
|
-
const { cover, preview } = data[idx]
|
|
1000
|
-
v.cover = cover
|
|
1001
|
-
previewData.push({ cover, preview, name: v.name, date: v.date, id: v.id })
|
|
1002
|
-
})
|
|
1003
|
-
})
|
|
1004
|
-
}
|
|
1005
|
-
watchEffect(() => {
|
|
1006
|
-
window.localStorage.setItem('ep-show-images', `${showImg.value}`)
|
|
1007
|
-
if (!showImg.value) {
|
|
1008
|
-
return
|
|
1009
|
-
}
|
|
1010
|
-
if (searchWord.value || pageCurrent.value || pageSize.value) {
|
|
1011
|
-
refreshFilesCover()
|
|
1012
|
-
return
|
|
1013
|
-
}
|
|
1014
|
-
refreshFilesCover()
|
|
1015
|
-
})
|
|
1016
|
-
|
|
1017
|
-
onMounted(() => {
|
|
1018
|
-
loadFiles()
|
|
1019
|
-
loadActions()
|
|
1020
|
-
$store.dispatch('category/getCategory')
|
|
1021
|
-
$store.dispatch('task/getTask')
|
|
1022
|
-
})
|
|
1023
|
-
|
|
1024
|
-
const isMobile = computed(() => $store.getters['public/isMobile'])
|
|
1025
|
-
</script>
|
|
1026
|
-
<style scoped lang="scss">
|
|
1027
|
-
.files {
|
|
1028
|
-
max-width: 1024px;
|
|
1029
|
-
margin: 0 auto;
|
|
1030
|
-
padding-bottom: 2em;
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
@media screen and (max-width: 700px) {
|
|
1034
|
-
.files {
|
|
1035
|
-
margin-top: 70px;
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
.text-btns {
|
|
1039
|
-
display: flex;
|
|
1040
|
-
flex-direction: column;
|
|
1041
|
-
|
|
1042
|
-
:deep(.el-button) {
|
|
1043
|
-
margin-left: 0px;
|
|
1044
|
-
margin-bottom: 0px;
|
|
1045
|
-
}
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
.header {
|
|
1049
|
-
justify-content: center;
|
|
1050
|
-
}
|
|
1051
|
-
|
|
1052
|
-
.export-btns {
|
|
1053
|
-
display: flex;
|
|
1054
|
-
flex-wrap: wrap;
|
|
1055
|
-
justify-content: space-around;
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
|
|
1059
|
-
.panel {
|
|
1060
|
-
padding: 1em;
|
|
1061
|
-
background-color: #fff;
|
|
1062
|
-
margin: 10px auto;
|
|
1063
|
-
box-sizing: border-box;
|
|
1064
|
-
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
1065
|
-
border-radius: 4px;
|
|
1066
|
-
z-index: 1;
|
|
1067
|
-
|
|
1068
|
-
.label {
|
|
1069
|
-
font-size: 12px;
|
|
1070
|
-
margin-right: 10px;
|
|
1071
|
-
}
|
|
1072
|
-
}
|
|
1073
|
-
|
|
1074
|
-
.header {
|
|
1075
|
-
display: flex;
|
|
1076
|
-
flex-wrap: wrap;
|
|
1077
|
-
|
|
1078
|
-
.item {
|
|
1079
|
-
margin-right: 10px;
|
|
1080
|
-
margin-bottom: 10px;
|
|
1081
|
-
}
|
|
1082
|
-
}
|
|
1083
|
-
|
|
1084
|
-
.el-button {
|
|
1085
|
-
margin-left: 10px;
|
|
1086
|
-
margin-bottom: 10px;
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
.control-item {
|
|
1090
|
-
margin-left: 10px;
|
|
1091
|
-
margin-bottom: 10px;
|
|
1092
|
-
font-size: 14px;
|
|
1093
|
-
}
|
|
1094
|
-
|
|
1095
|
-
.imageLoading {
|
|
1096
|
-
display: flex;
|
|
1097
|
-
align-items: center;
|
|
1098
|
-
justify-content: center;
|
|
1099
|
-
height: 100%;
|
|
1100
|
-
}
|
|
1101
|
-
.imageDes {
|
|
1102
|
-
position: absolute;
|
|
1103
|
-
bottom: 80px;
|
|
1104
|
-
color: #fff;
|
|
1105
|
-
left: 50%;
|
|
1106
|
-
transform: translateX(-50%);
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
.progress-list {
|
|
1110
|
-
margin-top: 10px;
|
|
1111
|
-
|
|
1112
|
-
.progress-item {
|
|
1113
|
-
margin-bottom: 10px;
|
|
1114
|
-
|
|
1115
|
-
.progress {
|
|
1116
|
-
display: flex;
|
|
1117
|
-
justify-content: center;
|
|
1118
|
-
align-items: center;
|
|
1119
|
-
margin-bottom: 6px;
|
|
1120
|
-
|
|
1121
|
-
.el-progress--line {
|
|
1122
|
-
min-width: 200px;
|
|
1123
|
-
width: 260px;
|
|
1124
|
-
}
|
|
1125
|
-
|
|
1126
|
-
.el-button {
|
|
1127
|
-
margin: 0 6px;
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
|
|
1131
|
-
.des {
|
|
1132
|
-
font-size: 12px;
|
|
1133
|
-
|
|
1134
|
-
.filename {
|
|
1135
|
-
max-width: 200px;
|
|
1136
|
-
overflow: hidden;
|
|
1137
|
-
text-overflow: ellipsis;
|
|
1138
|
-
white-space: nowrap;
|
|
1139
|
-
word-break: keep-all;
|
|
1140
|
-
margin-right: 10px;
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
.mimeType {
|
|
1144
|
-
width: 60px;
|
|
1145
|
-
color: #409eff;
|
|
1146
|
-
}
|
|
1147
|
-
}
|
|
1148
|
-
|
|
1149
|
-
text-align: center;
|
|
1150
|
-
}
|
|
1151
|
-
}
|
|
1152
|
-
</style>
|