Skip to content

Commit d41f520

Browse files
committed
file module complete
1 parent a350f77 commit d41f520

File tree

8 files changed

+147
-317
lines changed

8 files changed

+147
-317
lines changed

src/api/base/file/index.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@
44
55
* @Date: 2020-12-28 16:25:18
66
* @LastEditors: gumingchen
7-
* @LastEditTime: 2021-05-20 15:46:39
7+
* @LastEditTime: 2021-05-26 21:21:02
88
*/
99
import { IObject } from '@/types'
1010
import { parseJson2Param } from '@/utils'
1111
import service from '@/utils/request'
1212
import { PageData, PageParams, ResponseData } from 'axios'
1313
import { File } from 'Type/file'
14+
import { store } from '@/store'
15+
import { TOKEN_KEY } from '@/utils/constants'
16+
17+
const tokenVal = store.getters['user/tokenVal']
1418

1519
interface pageParams extends PageParams {
1620
extension?: string
@@ -38,9 +42,9 @@ export function pageApi(params: pageParams): Promise<ResponseData<PageData<File.
3842
* @return {*}
3943
* @author: gumingchen
4044
*/
41-
export function flowApi(params: number): String {
45+
export function flowApi(params: number): string {
4246
let result: string = ''
43-
const url = `/base/file/task/info/${ params }`
47+
const url = `/base/file/flow/${ params }`
4448
result = `${ process.env.VUE_APP_BASE_API! + url }`
4549
return result
4650
}
@@ -51,13 +55,16 @@ export function flowApi(params: number): String {
5155
* @return {*}
5256
* @author: gumingchen
5357
*/
54-
export function upload(params?: IObject): String {
58+
export function uploadApi(params?: IObject): string {
5559
let result: string = ''
5660
const url = '/base/file/upload'
5761
result = `${ process.env.VUE_APP_BASE_API! + url }`
58-
if (params) {
59-
result += `?${ parseJson2Param(params) }`
62+
if (!params) {
63+
params = {
64+
[TOKEN_KEY]: tokenVal
65+
}
6066
}
67+
result += `?${ parseJson2Param(params) }`
6168
return result
6269
}
6370

src/assets/icon/svg/folder.svg

Lines changed: 2 additions & 0 deletions
Loading

src/i18n/langs/cn.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
* @Date: 2021-04-15 19:20:39
66
* @LastEditors: gumingchen
7-
* @LastEditTime: 2021-05-07 13:26:10
7+
* @LastEditTime: 2021-05-26 21:14:37
88
*/
99
import zhLocale from 'element-plus/lib/locale/lang/zh-cn'
1010

@@ -50,6 +50,8 @@ const cn = {
5050
title: '标题',
5151
type: '类型',
5252
remark: '备注',
53+
start: '开始',
54+
end: '结束',
5355
state: '状态',
5456
time: '{0}时间',
5557
date: '{0}日期',
@@ -73,7 +75,9 @@ const cn = {
7375
tip: {
7476
tips: '提示',
7577
confirmTips: '确定对[id={0}]进行[{1}]操作?',
78+
confirmMessageTips: '确定对[{0}]进行[{1}]操作?',
7679
success: '操作成功',
80+
fail: '操作失败',
7781
menuCollapse: '菜单栏展开/收起',
7882
exitAccount: '您确定要退出当前账号吗?'
7983
},
@@ -103,6 +107,16 @@ const cn = {
103107
parameter: '参数',
104108
expression: '{0}表达式',
105109
batch: '批量{0}'
110+
},
111+
file: {
112+
file: '文件',
113+
original: '原始',
114+
actual: '实际',
115+
extension: '扩展',
116+
size: '大小',
117+
physicalPath: '物理路径',
118+
virtualPath: '虚拟路径',
119+
upload: '上传'
106120
}
107121
}
108122
}

src/i18n/langs/en.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
* @Date: 2021-04-15 19:20:39
66
* @LastEditors: gumingchen
7-
* @LastEditTime: 2021-05-13 17:09:25
7+
* @LastEditTime: 2021-05-26 21:15:18
88
*/
99
import enLocale from 'element-plus/lib/locale/lang/en'
1010

@@ -50,6 +50,8 @@ const en = {
5050
title: 'Title',
5151
type: 'Type',
5252
remark: 'Remark',
53+
start: 'Start',
54+
end: 'End',
5355
state: 'State',
5456
time: '{0} time',
5557
date: '{0} date',
@@ -74,6 +76,7 @@ const en = {
7476
tips: 'Tips',
7577
confirmTips: 'Confirm the [{1}] operation on [id={0}]?',
7678
success: 'Operation successful',
79+
fail: 'Operation failed',
7780
menuCollapse: 'Menu bar expand / collapse',
7881
exitAccount: 'Are you sure you want to exit the current account?'
7982
},
@@ -103,6 +106,16 @@ const en = {
103106
parameter: 'Parameter',
104107
expression: '{0} expression',
105108
batch: 'Batch {0}'
109+
},
110+
file: {
111+
file: 'File',
112+
original: 'Original',
113+
actual: 'Actual',
114+
extension: 'Extension',
115+
size: 'Size',
116+
physicalPath: 'Physical path',
117+
virtualPath: 'Virtual path',
118+
upload: 'Upload'
106119
}
107120
}
108121
}

src/types/file/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/*
2-
* @Description:
2+
* @Description:
33
* @Author: gumingchen
44
55
* @Date: 2021-04-29 14:55:34
66
* @LastEditors: gumingchen
7-
* @LastEditTime: 2021-04-30 17:43:07
7+
* @LastEditTime: 2021-05-26 20:44:38
88
*/
99
import { Po } from 'Type/index'
1010

@@ -18,5 +18,5 @@ export namespace File {
1818
path: string
1919
url: string
2020
}
21-
21+
2222
}

src/utils/request.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
* @Date: 2020-12-21 16:45:49
66
* @LastEditors: gumingchen
7-
* @LastEditTime: 2021-04-30 11:59:53
7+
* @LastEditTime: 2021-05-26 21:12:19
88
*/
99
'use strict'
1010
import axios, { ResponseData } from 'axios'

src/views/modules/base/file/components/add-edit.vue

Lines changed: 0 additions & 146 deletions
This file was deleted.

0 commit comments

Comments
 (0)