@sugarat/easypicker2-client 2.4.1
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/.env +6 -0
- package/.env.production +3 -0
- package/.env.test +4 -0
- package/.eslintignore +0 -0
- package/.eslintrc.json +57 -0
- package/.github/workflows/main.yml +61 -0
- package/.prettierrc.js +9 -0
- package/LICENSE +21 -0
- package/README.md +86 -0
- package/auto-imports.d.ts +6 -0
- package/components.d.ts +56 -0
- package/docker/ep_backup/easypicker2.sql +214 -0
- package/docker/ep_backup/mongodb/easypicker2/action.bson +0 -0
- package/docker/ep_backup/mongodb/easypicker2/action.metadata.json +1 -0
- package/docker/ep_backup/mongodb/easypicker2/log.bson +0 -0
- package/docker/ep_backup/mongodb/easypicker2/log.metadata.json +1 -0
- package/docker/ep_backup/user-config.json +176 -0
- package/docs/.env +1 -0
- package/docs/.env.production +2 -0
- package/docs/.vitepress/config.ts +204 -0
- package/docs/.vitepress/theme/bg.png +0 -0
- package/docs/.vitepress/theme/index.scss +41 -0
- package/docs/.vitepress/theme/index.ts +5 -0
- package/docs/author.md +24 -0
- package/docs/auto-imports.d.ts +6 -0
- package/docs/components.d.ts +17 -0
- package/docs/deploy/design/api.md +3 -0
- package/docs/deploy/design/db.md +3 -0
- package/docs/deploy/design/index.md +3 -0
- package/docs/deploy/design/shell.md +9 -0
- package/docs/deploy/faq.md +86 -0
- package/docs/deploy/index.md +9 -0
- package/docs/deploy/local.md +275 -0
- package/docs/deploy/online-new.md +610 -0
- package/docs/deploy/online.md +683 -0
- package/docs/deploy/qiniu.md +183 -0
- package/docs/index.md +40 -0
- package/docs/introduction/about/code.md +26 -0
- package/docs/introduction/about/index.md +33 -0
- package/docs/introduction/feature/index.md +3 -0
- package/docs/plan/log.md +333 -0
- package/docs/plan/todo.md +127 -0
- package/docs/plan/wish.md +29 -0
- package/docs/praise/index.md +45 -0
- package/docs/public/favicon.ico +0 -0
- package/docs/public/logo.png +0 -0
- package/docs/public/robots.txt +2 -0
- package/docs/src/apis/ajax.ts +66 -0
- package/docs/src/apis/index.ts +1 -0
- package/docs/src/apis/modules/wish.ts +20 -0
- package/docs/src/components/Avatar.vue +60 -0
- package/docs/src/components/Home.vue +85 -0
- package/docs/src/components/Picture.vue +13 -0
- package/docs/src/components/Praise.vue +52 -0
- package/docs/src/components/WishBtn.vue +98 -0
- package/docs/src/components/WishPanel.vue +170 -0
- package/docs/src/components/callme/index.vue +72 -0
- package/docs/vite.config.ts +42 -0
- package/index.html +127 -0
- package/package.json +52 -0
- package/public/favicon.ico +0 -0
- package/public/logo.png +0 -0
- package/scripts/deploy/docs.mjs +24 -0
- package/scripts/deploy/prod.mjs +24 -0
- package/scripts/deploy/test.mjs +26 -0
- package/src/@types/ajax.d.ts +5 -0
- package/src/@types/api.d.ts +305 -0
- package/src/@types/lib.d.ts +26 -0
- package/src/@types/page.d.ts +18 -0
- package/src/App.vue +36 -0
- package/src/apis/ajax.ts +70 -0
- package/src/apis/index.ts +20 -0
- package/src/apis/modules/action.ts +17 -0
- package/src/apis/modules/category.ts +20 -0
- package/src/apis/modules/config.ts +19 -0
- package/src/apis/modules/file.ts +150 -0
- package/src/apis/modules/people.ts +81 -0
- package/src/apis/modules/public.ts +49 -0
- package/src/apis/modules/super/overview.ts +56 -0
- package/src/apis/modules/super/user.ts +62 -0
- package/src/apis/modules/task.ts +67 -0
- package/src/apis/modules/user.ts +56 -0
- package/src/apis/modules/wish.ts +31 -0
- package/src/assets/i/EasyPicker.png +0 -0
- package/src/assets/logo.png +0 -0
- package/src/assets/styles/app.css +69 -0
- package/src/components/HomeFooter/index.vue +134 -0
- package/src/components/HomeHeader/index.vue +156 -0
- package/src/components/InfosForm/index.vue +73 -0
- package/src/components/MessageList/index.vue +155 -0
- package/src/components/MessagePanel/index.vue +42 -0
- package/src/components/Praise/index.vue +102 -0
- package/src/components/QrCode.vue +44 -0
- package/src/components/linkDialog.vue +104 -0
- package/src/components/loginPanel.vue +92 -0
- package/src/constants/index.ts +83 -0
- package/src/env.d.ts +8 -0
- package/src/main.ts +19 -0
- package/src/pages/404/index.vue +59 -0
- package/src/pages/about/index.vue +152 -0
- package/src/pages/callme/index.vue +155 -0
- package/src/pages/dashboard/config/index.vue +264 -0
- package/src/pages/dashboard/files/index.vue +1152 -0
- package/src/pages/dashboard/index.vue +335 -0
- package/src/pages/dashboard/manage/config/index.vue +97 -0
- package/src/pages/dashboard/manage/index.vue +105 -0
- package/src/pages/dashboard/manage/overview/index.vue +488 -0
- package/src/pages/dashboard/manage/user/index.vue +679 -0
- package/src/pages/dashboard/manage/wish/index.vue +257 -0
- package/src/pages/dashboard/tasks/components/CategoryPanel.vue +208 -0
- package/src/pages/dashboard/tasks/components/CreateTask.vue +93 -0
- package/src/pages/dashboard/tasks/components/TaskInfo.vue +129 -0
- package/src/pages/dashboard/tasks/components/infoPanel/ddl.vue +96 -0
- package/src/pages/dashboard/tasks/components/infoPanel/file.vue +175 -0
- package/src/pages/dashboard/tasks/components/infoPanel/info.vue +477 -0
- package/src/pages/dashboard/tasks/components/infoPanel/people.vue +567 -0
- package/src/pages/dashboard/tasks/components/infoPanel/template.vue +146 -0
- package/src/pages/dashboard/tasks/components/infoPanel/tip.vue +55 -0
- package/src/pages/dashboard/tasks/components/infoPanel/tipInfo.vue +196 -0
- package/src/pages/dashboard/tasks/index.vue +302 -0
- package/src/pages/dashboard/tasks/public.ts +32 -0
- package/src/pages/disabled/index.vue +47 -0
- package/src/pages/feedback/index.vue +5 -0
- package/src/pages/home/index.vue +72 -0
- package/src/pages/login/index.vue +270 -0
- package/src/pages/register/index.vue +211 -0
- package/src/pages/reset/index.vue +186 -0
- package/src/pages/task/index.vue +897 -0
- package/src/pages/wish/index.vue +152 -0
- package/src/router/Interceptor/index.ts +112 -0
- package/src/router/index.ts +13 -0
- package/src/router/routes/index.ts +197 -0
- package/src/shims-vue.d.ts +6 -0
- package/src/store/index.ts +17 -0
- package/src/store/modules/category.ts +44 -0
- package/src/store/modules/public.ts +27 -0
- package/src/store/modules/task.ts +55 -0
- package/src/store/modules/user.ts +57 -0
- package/src/utils/elementUI.ts +8 -0
- package/src/utils/networkUtil.ts +236 -0
- package/src/utils/other.ts +25 -0
- package/src/utils/regExp.ts +11 -0
- package/src/utils/stringUtil.ts +242 -0
- package/tsconfig.json +24 -0
- package/vite.config.ts +55 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
// 接口的响应值类型定义
|
|
2
|
+
type ResponseData<T = any> = Promise<BaseResponse<T>>
|
|
3
|
+
declare namespace FileApiTypes {
|
|
4
|
+
interface UploadToken {
|
|
5
|
+
token: string
|
|
6
|
+
}
|
|
7
|
+
interface FileOptions {
|
|
8
|
+
size: number
|
|
9
|
+
taskKey: string
|
|
10
|
+
taskName: string
|
|
11
|
+
originName: string
|
|
12
|
+
categoryKey?: string
|
|
13
|
+
name: string
|
|
14
|
+
info: string
|
|
15
|
+
hash: string
|
|
16
|
+
people?: string
|
|
17
|
+
}
|
|
18
|
+
interface File {
|
|
19
|
+
id: number
|
|
20
|
+
info: string
|
|
21
|
+
name: string
|
|
22
|
+
people: string
|
|
23
|
+
size: number
|
|
24
|
+
task_key: string
|
|
25
|
+
task_name: string
|
|
26
|
+
user_id: number
|
|
27
|
+
category_key: string
|
|
28
|
+
origin_name: string
|
|
29
|
+
date: string
|
|
30
|
+
hash: string
|
|
31
|
+
cover?: string
|
|
32
|
+
preview?: string
|
|
33
|
+
}
|
|
34
|
+
interface WithdrawFileOptions {
|
|
35
|
+
taskKey: string
|
|
36
|
+
taskName: string
|
|
37
|
+
filename: string
|
|
38
|
+
hash: string
|
|
39
|
+
peopleName: string
|
|
40
|
+
info: string
|
|
41
|
+
}
|
|
42
|
+
type getUploadToken = ResponseData<UploadToken>
|
|
43
|
+
type addFile = ResponseData<any>
|
|
44
|
+
type getFileList = ResponseData<{ files: File[] }>
|
|
45
|
+
type getTemplateUrl = ResponseData<{ link: string }>
|
|
46
|
+
type getOneFileUrl = ResponseData<{ link: string; mimeType: string }>
|
|
47
|
+
type deleteOneFile = ResponseData
|
|
48
|
+
type batchDownload = ResponseData<{ k: string }>
|
|
49
|
+
type batchDel = ResponseData
|
|
50
|
+
type checkCompressStatus = ResponseData<{ code: number; key?: string }>
|
|
51
|
+
type getCompressDownUrl = ResponseData<{ url: string }>
|
|
52
|
+
type withdrawFile = ResponseData
|
|
53
|
+
type checkSubmitStatus = ResponseData<{ isSubmit: boolean; txt?: string }>
|
|
54
|
+
type checkImageFilePreviewUrl = ResponseData<
|
|
55
|
+
{ cover: string; preview: string }[]
|
|
56
|
+
>
|
|
57
|
+
type updateFilename = ResponseData
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
declare namespace UserApiTypes {
|
|
61
|
+
interface RegisterOptions {
|
|
62
|
+
account: string
|
|
63
|
+
pwd: string
|
|
64
|
+
bindPhone: boolean
|
|
65
|
+
phone?: string
|
|
66
|
+
code?: string
|
|
67
|
+
}
|
|
68
|
+
type register = ResponseData<{ token?: string }>
|
|
69
|
+
type login = ResponseData<{
|
|
70
|
+
token?: string
|
|
71
|
+
openTime?: string
|
|
72
|
+
system: boolean
|
|
73
|
+
}>
|
|
74
|
+
type codeLogin = ResponseData<{ token?: string; openTime?: string }>
|
|
75
|
+
type resetPwd = ResponseData<{ token?: string; openTime?: string }>
|
|
76
|
+
type checkPower = ResponseData<{
|
|
77
|
+
power: boolean
|
|
78
|
+
name: string
|
|
79
|
+
system: boolean
|
|
80
|
+
}>
|
|
81
|
+
type logout = ResponseData
|
|
82
|
+
type checkLoginStatus = ResponseData<boolean>
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
declare namespace TaskApiTypes {
|
|
86
|
+
interface TaskLog {
|
|
87
|
+
date: string
|
|
88
|
+
filename: string
|
|
89
|
+
}
|
|
90
|
+
interface TaskItem {
|
|
91
|
+
category: string
|
|
92
|
+
key: string
|
|
93
|
+
name: string
|
|
94
|
+
recentLog: TaskLog[]
|
|
95
|
+
}
|
|
96
|
+
interface TaskInfo {
|
|
97
|
+
ddl?: string | null
|
|
98
|
+
format?: string
|
|
99
|
+
info?: string
|
|
100
|
+
people?: number
|
|
101
|
+
rewrite?: number
|
|
102
|
+
share?: string
|
|
103
|
+
template?: string
|
|
104
|
+
name?: string
|
|
105
|
+
category?: string
|
|
106
|
+
tip?: string
|
|
107
|
+
size?: number
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
type getList = ResponseData<{ tasks: TaskItem[] }>
|
|
111
|
+
type create = ResponseData
|
|
112
|
+
type deleteOne = ResponseData
|
|
113
|
+
type updateBaseInfo = ResponseData
|
|
114
|
+
type getTaskInfo = ResponseData<TaskInfo>
|
|
115
|
+
type getTaskMoreInfo = ResponseData<TaskInfo>
|
|
116
|
+
type updateTaskMoreInfo = ResponseData
|
|
117
|
+
type getUsefulTemplate = ResponseData<
|
|
118
|
+
{ taskKey: string; name: string; info: string }[]
|
|
119
|
+
>
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
declare namespace PublicApiTypes {
|
|
123
|
+
type getCode = ResponseData
|
|
124
|
+
type reportPv = ResponseData
|
|
125
|
+
type checkPhone = ResponseData
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
declare namespace PeopleApiTypes {
|
|
129
|
+
interface People {
|
|
130
|
+
count: number
|
|
131
|
+
id: number
|
|
132
|
+
lastDate: string
|
|
133
|
+
name: string
|
|
134
|
+
statue: number
|
|
135
|
+
}
|
|
136
|
+
type importPeople = ResponseData<{ success: number; fail: string[] }>
|
|
137
|
+
type getPeople = ResponseData<{ people: People[] }>
|
|
138
|
+
type deletePeople = ResponseData
|
|
139
|
+
type updatePeopleStatus = ResponseData
|
|
140
|
+
type checkPeopleIsExist = ResponseData<{ exist: boolean }>
|
|
141
|
+
type getUsefulTemplate = ResponseData<
|
|
142
|
+
{ taskKey: string; name: string; count: number }[]
|
|
143
|
+
>
|
|
144
|
+
type importFromTpl = ResponseData<{ fail: string[]; success: number }>
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
declare namespace CateGoryApiTypes {
|
|
148
|
+
interface CategoryItem {
|
|
149
|
+
id: number
|
|
150
|
+
name: string
|
|
151
|
+
k: string
|
|
152
|
+
}
|
|
153
|
+
type getList = ResponseData<{ categories: CategoryItem[] }>
|
|
154
|
+
type createNew = ResponseData
|
|
155
|
+
type deleteOne = ResponseData
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
declare namespace OverviewApiTypes {
|
|
159
|
+
interface CountLog {
|
|
160
|
+
sum: number
|
|
161
|
+
recent?: number
|
|
162
|
+
uv?: number
|
|
163
|
+
size?: string
|
|
164
|
+
}
|
|
165
|
+
interface LogItem {
|
|
166
|
+
date: string
|
|
167
|
+
ip: string
|
|
168
|
+
msg: string
|
|
169
|
+
type: string
|
|
170
|
+
}
|
|
171
|
+
type getCount = ResponseData<{
|
|
172
|
+
file: {
|
|
173
|
+
server: CountLog
|
|
174
|
+
oss: CountLog
|
|
175
|
+
}
|
|
176
|
+
log: CountLog
|
|
177
|
+
pv: {
|
|
178
|
+
all: CountLog
|
|
179
|
+
today: CountLog
|
|
180
|
+
}
|
|
181
|
+
user: CountLog
|
|
182
|
+
compress: {
|
|
183
|
+
all: CountLog
|
|
184
|
+
expired: CountLog
|
|
185
|
+
}
|
|
186
|
+
}>
|
|
187
|
+
type getAllLogMsg = ResponseData<{ logs: LogItem[] }>
|
|
188
|
+
type getLogMsg = ResponseData<{
|
|
189
|
+
logs: LogItem[]
|
|
190
|
+
sum: number
|
|
191
|
+
pageIndex: number
|
|
192
|
+
pageSize: number
|
|
193
|
+
}>
|
|
194
|
+
type disabledStatus = ResponseData<{ status: boolean }>
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
declare namespace SuperUserApiTypes {
|
|
198
|
+
interface UserItem {
|
|
199
|
+
account: string
|
|
200
|
+
id: number
|
|
201
|
+
join_time: string
|
|
202
|
+
login_count: number
|
|
203
|
+
login_time: string
|
|
204
|
+
open_time: string
|
|
205
|
+
phone: string
|
|
206
|
+
status: number
|
|
207
|
+
}
|
|
208
|
+
interface MessageItem {
|
|
209
|
+
id: string
|
|
210
|
+
type: number
|
|
211
|
+
style: number
|
|
212
|
+
date: string
|
|
213
|
+
text: string
|
|
214
|
+
read: boolean
|
|
215
|
+
}
|
|
216
|
+
type getUserList = ResponseData<{ list: UserItem[] }>
|
|
217
|
+
type getMessageList = ResponseData<MessageItem[]>
|
|
218
|
+
type updateUserStatus = ResponseData
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
declare namespace WishApiTypes {
|
|
222
|
+
interface Wish {
|
|
223
|
+
id: string
|
|
224
|
+
title: string
|
|
225
|
+
/**
|
|
226
|
+
* 详细描述
|
|
227
|
+
*/
|
|
228
|
+
des: string
|
|
229
|
+
/**
|
|
230
|
+
* 联系方式
|
|
231
|
+
*/
|
|
232
|
+
contact?: string
|
|
233
|
+
/**
|
|
234
|
+
* 当前进度
|
|
235
|
+
*/
|
|
236
|
+
status: number
|
|
237
|
+
startDate: Date
|
|
238
|
+
endDate: Date
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
type addWish = ResponseData
|
|
242
|
+
|
|
243
|
+
type WishItem = Wish & {
|
|
244
|
+
createDate: number
|
|
245
|
+
}
|
|
246
|
+
type allWishData = ResponseData<WishItem[]>
|
|
247
|
+
|
|
248
|
+
type updateWish = ResponseData
|
|
249
|
+
|
|
250
|
+
type DocsWishItem = {
|
|
251
|
+
id: string
|
|
252
|
+
title: string
|
|
253
|
+
des: string
|
|
254
|
+
status: number
|
|
255
|
+
startDate?: string
|
|
256
|
+
count: number
|
|
257
|
+
alreadyPraise: boolean
|
|
258
|
+
}
|
|
259
|
+
type allDocsWishData = ResponseData<DocsWishItem[]>
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
declare namespace ConfigServiceAPITypes {
|
|
263
|
+
interface ServiceOverviewItem {
|
|
264
|
+
status: boolean
|
|
265
|
+
}
|
|
266
|
+
type getServiceOverview = ResponseData<{
|
|
267
|
+
qiniu: ServiceOverviewItem
|
|
268
|
+
tx: ServiceOverviewItem
|
|
269
|
+
redis: ServiceOverviewItem
|
|
270
|
+
mysql: ServiceOverviewItem
|
|
271
|
+
mongodb: ServiceOverviewItem
|
|
272
|
+
}>
|
|
273
|
+
|
|
274
|
+
interface ServiceConfigItem {
|
|
275
|
+
key: string
|
|
276
|
+
value: string
|
|
277
|
+
type: string
|
|
278
|
+
disabled?: boolean
|
|
279
|
+
label?: string
|
|
280
|
+
}
|
|
281
|
+
interface ConfigData {
|
|
282
|
+
title: string
|
|
283
|
+
data: ServiceConfigItem[]
|
|
284
|
+
}
|
|
285
|
+
type getServiceConfig = ResponseData<ConfigData[]>
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
declare namespace ActionApiTypes {
|
|
289
|
+
interface DownloadActionData {
|
|
290
|
+
id: string
|
|
291
|
+
type: number
|
|
292
|
+
url: string
|
|
293
|
+
status: number
|
|
294
|
+
tip: string
|
|
295
|
+
date: number
|
|
296
|
+
size: number
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
type getDownloadActions = ResponseData<{
|
|
300
|
+
sum: number
|
|
301
|
+
pageSize: number
|
|
302
|
+
pageIndex: number
|
|
303
|
+
actions: DownloadActionData[]
|
|
304
|
+
}>
|
|
305
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// 第三方库的类型定义
|
|
2
|
+
declare namespace qiniu {
|
|
3
|
+
interface Subscription {
|
|
4
|
+
unsubscribe(): void
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
interface SubscriptionConfig {
|
|
8
|
+
next(res: any): void
|
|
9
|
+
error(err: any): void
|
|
10
|
+
complete(res: any): void
|
|
11
|
+
}
|
|
12
|
+
interface Observable {
|
|
13
|
+
subscribe(cf: SubscriptionConfig): Subscription
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type upload = (file: File, key: string, token: string) => Observable
|
|
17
|
+
const upload: upload
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
declare namespace XLSX {
|
|
21
|
+
interface utils {
|
|
22
|
+
table_to_book: (dom: HTMLElement) => any
|
|
23
|
+
}
|
|
24
|
+
const utils: utils
|
|
25
|
+
const writeFile: (wb: any, filename: string) => void
|
|
26
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
interface DownloadItem {
|
|
2
|
+
url: string
|
|
3
|
+
filename: string
|
|
4
|
+
mimeType: string
|
|
5
|
+
status: 'ready' | 'downloading' | 'done' | 'error'
|
|
6
|
+
percentage: number
|
|
7
|
+
size: number
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
type InfoItemType = 'input' | 'radio' | 'text' | 'select'
|
|
11
|
+
interface InfoItem {
|
|
12
|
+
type?: InfoItemType
|
|
13
|
+
// 描述信息
|
|
14
|
+
text?: string
|
|
15
|
+
// 表单项的值
|
|
16
|
+
value?: string
|
|
17
|
+
children?: InfoItem[]
|
|
18
|
+
}
|
package/src/App.vue
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-config-provider size="large" :zIndex="1000" :locale="zhCn">
|
|
3
|
+
<router-view style="min-height: 100vh"></router-view>
|
|
4
|
+
</el-config-provider>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script lang="ts" setup>
|
|
8
|
+
import { onMounted } from 'vue'
|
|
9
|
+
import { useStore } from 'vuex'
|
|
10
|
+
import { ElConfigProvider } from 'element-plus'
|
|
11
|
+
import 'element-plus/es/components/message/style/css'
|
|
12
|
+
import 'element-plus/es/components/message-box/style/css'
|
|
13
|
+
import zhCn from 'element-plus/lib/locale/lang/zh-cn'
|
|
14
|
+
|
|
15
|
+
const $store = useStore()
|
|
16
|
+
const refreshWidth = () => {
|
|
17
|
+
const clientWIdth = window.document.body.clientWidth
|
|
18
|
+
$store.commit('public/setWidth', clientWIdth)
|
|
19
|
+
}
|
|
20
|
+
onMounted(() => {
|
|
21
|
+
window.addEventListener('load', refreshWidth)
|
|
22
|
+
window.addEventListener('resize', refreshWidth)
|
|
23
|
+
})
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<style>
|
|
27
|
+
@import './assets/styles/app.css';
|
|
28
|
+
|
|
29
|
+
* {
|
|
30
|
+
padding: 0;
|
|
31
|
+
margin: 0;
|
|
32
|
+
}
|
|
33
|
+
a {
|
|
34
|
+
text-decoration: none;
|
|
35
|
+
}
|
|
36
|
+
</style>
|
package/src/apis/ajax.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import axios from 'axios'
|
|
2
|
+
import { ElMessage } from 'element-plus'
|
|
3
|
+
import router from '@/router'
|
|
4
|
+
|
|
5
|
+
const instance = axios.create({
|
|
6
|
+
baseURL: import.meta.env.VITE_APP_AXIOS_BASE_URL
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 请求拦截
|
|
11
|
+
*/
|
|
12
|
+
instance.interceptors.request.use((config) => {
|
|
13
|
+
const { method, params } = config
|
|
14
|
+
// 附带鉴权的token
|
|
15
|
+
const headers: any = {
|
|
16
|
+
token: localStorage.getItem('token')
|
|
17
|
+
}
|
|
18
|
+
// 不缓存get请求
|
|
19
|
+
if (method === 'get') {
|
|
20
|
+
headers['Cache-Control'] = 'no-cache'
|
|
21
|
+
}
|
|
22
|
+
// delete请求参数放入body中
|
|
23
|
+
if (method === 'delete') {
|
|
24
|
+
headers['Content-type'] = 'application/json;'
|
|
25
|
+
Object.assign(config, {
|
|
26
|
+
data: params,
|
|
27
|
+
params: {}
|
|
28
|
+
})
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return {
|
|
32
|
+
...config,
|
|
33
|
+
headers
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* 响应拦截
|
|
39
|
+
*/
|
|
40
|
+
instance.interceptors.response.use(
|
|
41
|
+
(v) => {
|
|
42
|
+
if (v.status === 200) {
|
|
43
|
+
if (v.data.code === 0) {
|
|
44
|
+
return v.data
|
|
45
|
+
}
|
|
46
|
+
if (v.data?.code === 3004 && router.currentRoute.value.name !== 'login') {
|
|
47
|
+
localStorage.removeItem('token')
|
|
48
|
+
localStorage.removeItem('system')
|
|
49
|
+
ElMessage.error('登录过期,跳转登录')
|
|
50
|
+
router.replace({
|
|
51
|
+
name: 'login',
|
|
52
|
+
query: {
|
|
53
|
+
redirect: router.currentRoute.value.fullPath
|
|
54
|
+
}
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
if (v?.data?.code === 500) {
|
|
58
|
+
ElMessage.error(v?.data?.msg)
|
|
59
|
+
}
|
|
60
|
+
return Promise.reject(v.data)
|
|
61
|
+
}
|
|
62
|
+
ElMessage.error(v.statusText)
|
|
63
|
+
return Promise.reject(v)
|
|
64
|
+
},
|
|
65
|
+
(err) => {
|
|
66
|
+
ElMessage.error(`网络错误:${err}`)
|
|
67
|
+
return Promise.reject(err)
|
|
68
|
+
}
|
|
69
|
+
)
|
|
70
|
+
export default instance
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import p from './modules/public'
|
|
2
|
+
import user from './modules/user'
|
|
3
|
+
import category from './modules/category'
|
|
4
|
+
import task from './modules/task'
|
|
5
|
+
import people from './modules/people'
|
|
6
|
+
import file from './modules/file'
|
|
7
|
+
import superOverview from './modules/super/overview'
|
|
8
|
+
import superUser from './modules/super/user'
|
|
9
|
+
|
|
10
|
+
export const PublicApi = p
|
|
11
|
+
export const UserApi = user
|
|
12
|
+
export const CategoryApi = category
|
|
13
|
+
export const TaskApi = task
|
|
14
|
+
export const PeopleApi = people
|
|
15
|
+
export const FileApi = file
|
|
16
|
+
export const SuperOverviewApi = superOverview
|
|
17
|
+
export const SuperUserApi = superUser
|
|
18
|
+
export { default as WishApi } from './modules/wish'
|
|
19
|
+
export { default as ConfigServiceAPI } from './modules/config'
|
|
20
|
+
export { default as ActionServiceAPI } from './modules/action'
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import ajax from '../ajax'
|
|
2
|
+
|
|
3
|
+
function getDownloadActions(
|
|
4
|
+
pageSize: number,
|
|
5
|
+
pageIndex: number,
|
|
6
|
+
extraIds: string[] = []
|
|
7
|
+
): ActionApiTypes.getDownloadActions {
|
|
8
|
+
return ajax.post('/action/download/list', {
|
|
9
|
+
pageSize,
|
|
10
|
+
pageIndex,
|
|
11
|
+
extraIds
|
|
12
|
+
})
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
getDownloadActions
|
|
17
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import ajax from '../ajax'
|
|
2
|
+
|
|
3
|
+
function getList(): CateGoryApiTypes.getList {
|
|
4
|
+
return ajax.get('category')
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function createNew(name: string): CateGoryApiTypes.createNew {
|
|
8
|
+
return ajax.post('category/create', {
|
|
9
|
+
name
|
|
10
|
+
})
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function deleteOne(key: string): CateGoryApiTypes.deleteOne {
|
|
14
|
+
return ajax.delete(`category/${key}`)
|
|
15
|
+
}
|
|
16
|
+
export default {
|
|
17
|
+
getList,
|
|
18
|
+
createNew,
|
|
19
|
+
deleteOne
|
|
20
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import ajax from '../ajax'
|
|
2
|
+
|
|
3
|
+
function getServiceOverview(): ConfigServiceAPITypes.getServiceOverview {
|
|
4
|
+
return ajax.get('/config/service/overview')
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function getServiceConfig(): ConfigServiceAPITypes.getServiceConfig {
|
|
8
|
+
return ajax.get('/config/service/config')
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function updateCfg(data: ConfigServiceAPITypes.ServiceConfigItem) {
|
|
12
|
+
return ajax.put('/config/service/config', data)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export default {
|
|
16
|
+
getServiceOverview,
|
|
17
|
+
getServiceConfig,
|
|
18
|
+
updateCfg
|
|
19
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import ajax from '../ajax'
|
|
2
|
+
|
|
3
|
+
function getUploadToken(): FileApiTypes.getUploadToken {
|
|
4
|
+
return ajax.get('file/token')
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function addFile(options: FileApiTypes.FileOptions): FileApiTypes.addFile {
|
|
8
|
+
return ajax.post('file/info', options)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function getFileList(): FileApiTypes.getFileList {
|
|
12
|
+
return ajax.get('file/list')
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function getTemplateUrl(
|
|
16
|
+
template: string,
|
|
17
|
+
key: string
|
|
18
|
+
): FileApiTypes.getTemplateUrl {
|
|
19
|
+
return ajax.get('file/template', {
|
|
20
|
+
params: {
|
|
21
|
+
template,
|
|
22
|
+
key
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function getOneFileUrl(id: number): FileApiTypes.getOneFileUrl {
|
|
28
|
+
return ajax.get('file/one', {
|
|
29
|
+
params: {
|
|
30
|
+
id
|
|
31
|
+
}
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function deleteOneFile(id: number): FileApiTypes.deleteOneFile {
|
|
36
|
+
return ajax.delete('file/one', {
|
|
37
|
+
params: {
|
|
38
|
+
id
|
|
39
|
+
}
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function batchDownload(
|
|
44
|
+
ids: number[],
|
|
45
|
+
zipName?: string
|
|
46
|
+
): FileApiTypes.batchDownload {
|
|
47
|
+
return ajax.post('file/batch/down', {
|
|
48
|
+
ids,
|
|
49
|
+
zipName
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function batchDel(ids: number[]): FileApiTypes.batchDel {
|
|
54
|
+
return ajax.delete('file/batch/del', {
|
|
55
|
+
params: {
|
|
56
|
+
ids
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function checkCompressStatus(id: string): FileApiTypes.checkCompressStatus {
|
|
62
|
+
return ajax.post('file/compress/status', {
|
|
63
|
+
id
|
|
64
|
+
})
|
|
65
|
+
}
|
|
66
|
+
function getCompressDownUrl(key: string): FileApiTypes.getCompressDownUrl {
|
|
67
|
+
return ajax.post('file/compress/down', {
|
|
68
|
+
key
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
function getCompressFileUrl(id: string): Promise<string> {
|
|
72
|
+
const check = (_r: any, _rej) => {
|
|
73
|
+
checkCompressStatus(id)
|
|
74
|
+
.then((r) => {
|
|
75
|
+
const { code, key } = r.data
|
|
76
|
+
if (code === 0) {
|
|
77
|
+
getCompressDownUrl(key ?? '').then((v) => {
|
|
78
|
+
const { url } = v.data
|
|
79
|
+
_r(url)
|
|
80
|
+
})
|
|
81
|
+
} else {
|
|
82
|
+
setTimeout(() => {
|
|
83
|
+
check(_r, _rej)
|
|
84
|
+
}, 1000)
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
.catch((err) => {
|
|
88
|
+
_rej(err)
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
return new Promise((resolve, rej) => {
|
|
93
|
+
check(resolve, rej)
|
|
94
|
+
})
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function withdrawFile(
|
|
98
|
+
options: FileApiTypes.WithdrawFileOptions
|
|
99
|
+
): FileApiTypes.withdrawFile {
|
|
100
|
+
return ajax.delete('file/withdraw', {
|
|
101
|
+
params: options
|
|
102
|
+
})
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function checkSubmitStatus(
|
|
106
|
+
taskKey: string,
|
|
107
|
+
info: any,
|
|
108
|
+
name = ''
|
|
109
|
+
): FileApiTypes.checkSubmitStatus {
|
|
110
|
+
return ajax.post('file/submit/people', {
|
|
111
|
+
taskKey,
|
|
112
|
+
info,
|
|
113
|
+
name
|
|
114
|
+
})
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function checkImageFilePreviewUrl(
|
|
118
|
+
ids: number[]
|
|
119
|
+
): FileApiTypes.checkImageFilePreviewUrl {
|
|
120
|
+
return ajax.post('file/image/preview', {
|
|
121
|
+
ids
|
|
122
|
+
})
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function updateFilename(
|
|
126
|
+
id: number,
|
|
127
|
+
newName: string
|
|
128
|
+
): FileApiTypes.updateFilename {
|
|
129
|
+
return ajax.put('file/name/rewrite', {
|
|
130
|
+
id,
|
|
131
|
+
name: newName
|
|
132
|
+
})
|
|
133
|
+
}
|
|
134
|
+
export default {
|
|
135
|
+
getUploadToken,
|
|
136
|
+
addFile,
|
|
137
|
+
getFileList,
|
|
138
|
+
getTemplateUrl,
|
|
139
|
+
withdrawFile,
|
|
140
|
+
getOneFileUrl,
|
|
141
|
+
deleteOneFile,
|
|
142
|
+
batchDownload,
|
|
143
|
+
batchDel,
|
|
144
|
+
checkCompressStatus,
|
|
145
|
+
getCompressFileUrl,
|
|
146
|
+
getCompressDownUrl,
|
|
147
|
+
checkSubmitStatus,
|
|
148
|
+
checkImageFilePreviewUrl,
|
|
149
|
+
updateFilename
|
|
150
|
+
}
|