Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
phsl
/
admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
fe2fa21d
authored
Mar 14, 2023
by
dlarmor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构:基础设施 -> 文件管理 接口文件调整
parent
fee8245f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
27 deletions
+16
-27
src/api/infra/file/index.ts
+2
-13
src/api/infra/fileConfig/index.ts
+7
-7
src/views/infra/fileConfig/form.vue
+3
-3
src/views/infra/fileConfig/index.vue
+4
-4
No files found.
src/api/infra/file
List
/index.ts
→
src/api/infra/file/index.ts
View file @
fe2fa21d
import
request
from
'@/config/axios'
import
request
from
'@/config/axios'
export
interface
FileVO
{
id
:
number
configId
:
number
path
:
string
name
:
string
url
:
string
size
:
string
type
:
string
createTime
:
Date
}
export
interface
FilePageReqVO
extends
PageParam
{
export
interface
FilePageReqVO
extends
PageParam
{
path
?:
string
path
?:
string
type
?:
string
type
?:
string
...
@@ -18,11 +7,11 @@ export interface FilePageReqVO extends PageParam {
...
@@ -18,11 +7,11 @@ export interface FilePageReqVO extends PageParam {
}
}
// 查询文件列表
// 查询文件列表
export
const
getFilePage
Api
=
(
params
:
FilePageReqVO
)
=>
{
export
const
getFilePage
=
(
params
:
FilePageReqVO
)
=>
{
return
request
.
get
({
url
:
'/infra/file/page'
,
params
})
return
request
.
get
({
url
:
'/infra/file/page'
,
params
})
}
}
// 删除文件
// 删除文件
export
const
deleteFile
Api
=
(
id
:
number
)
=>
{
export
const
deleteFile
=
(
id
:
number
)
=>
{
return
request
.
delete
({
url
:
'/infra/file/delete?id='
+
id
})
return
request
.
delete
({
url
:
'/infra/file/delete?id='
+
id
})
}
}
src/api/infra/fileConfig/index.ts
View file @
fe2fa21d
...
@@ -31,36 +31,36 @@ export interface FileConfigPageReqVO extends PageParam {
...
@@ -31,36 +31,36 @@ export interface FileConfigPageReqVO extends PageParam {
}
}
// 查询文件配置列表
// 查询文件配置列表
export
const
getFileConfigPage
Api
=
(
params
:
FileConfigPageReqVO
)
=>
{
export
const
getFileConfigPage
=
(
params
:
FileConfigPageReqVO
)
=>
{
return
request
.
get
({
url
:
'/infra/file-config/page'
,
params
})
return
request
.
get
({
url
:
'/infra/file-config/page'
,
params
})
}
}
// 查询文件配置详情
// 查询文件配置详情
export
const
getFileConfig
Api
=
(
id
:
number
)
=>
{
export
const
getFileConfig
=
(
id
:
number
)
=>
{
return
request
.
get
({
url
:
'/infra/file-config/get?id='
+
id
})
return
request
.
get
({
url
:
'/infra/file-config/get?id='
+
id
})
}
}
// 更新文件配置为主配置
// 更新文件配置为主配置
export
const
updateFileConfigMaster
Api
=
(
id
:
number
)
=>
{
export
const
updateFileConfigMaster
=
(
id
:
number
)
=>
{
return
request
.
put
({
url
:
'/infra/file-config/update-master?id='
+
id
})
return
request
.
put
({
url
:
'/infra/file-config/update-master?id='
+
id
})
}
}
// 新增文件配置
// 新增文件配置
export
const
createFileConfig
Api
=
(
data
:
FileConfigVO
)
=>
{
export
const
createFileConfig
=
(
data
:
FileConfigVO
)
=>
{
return
request
.
post
({
url
:
'/infra/file-config/create'
,
data
})
return
request
.
post
({
url
:
'/infra/file-config/create'
,
data
})
}
}
// 修改文件配置
// 修改文件配置
export
const
updateFileConfig
Api
=
(
data
:
FileConfigVO
)
=>
{
export
const
updateFileConfig
=
(
data
:
FileConfigVO
)
=>
{
return
request
.
put
({
url
:
'/infra/file-config/update'
,
data
})
return
request
.
put
({
url
:
'/infra/file-config/update'
,
data
})
}
}
// 删除文件配置
// 删除文件配置
export
const
deleteFileConfig
Api
=
(
id
:
number
)
=>
{
export
const
deleteFileConfig
=
(
id
:
number
)
=>
{
return
request
.
delete
({
url
:
'/infra/file-config/delete?id='
+
id
})
return
request
.
delete
({
url
:
'/infra/file-config/delete?id='
+
id
})
}
}
// 测试文件配置
// 测试文件配置
export
const
testFileConfig
Api
=
(
id
:
number
)
=>
{
export
const
testFileConfig
=
(
id
:
number
)
=>
{
return
request
.
get
({
url
:
'/infra/file-config/test?id='
+
id
})
return
request
.
get
({
url
:
'/infra/file-config/test?id='
+
id
})
}
}
src/views/infra/fileConfig/form.vue
View file @
fe2fa21d
...
@@ -147,7 +147,7 @@ const openModal = async (type: string, id?: number) => {
...
@@ -147,7 +147,7 @@ const openModal = async (type: string, id?: number) => {
if
(
id
)
{
if
(
id
)
{
formLoading
.
value
=
true
formLoading
.
value
=
true
try
{
try
{
formData
.
value
=
await
FileConfigApi
.
getFileConfig
Api
(
id
)
formData
.
value
=
await
FileConfigApi
.
getFileConfig
(
id
)
}
finally
{
}
finally
{
formLoading
.
value
=
false
formLoading
.
value
=
false
}
}
...
@@ -167,10 +167,10 @@ const submitForm = async () => {
...
@@ -167,10 +167,10 @@ const submitForm = async () => {
try
{
try
{
const
data
=
formData
.
value
as
unknown
as
FileConfigApi
.
FileConfigVO
const
data
=
formData
.
value
as
unknown
as
FileConfigApi
.
FileConfigVO
if
(
formType
.
value
===
'create'
)
{
if
(
formType
.
value
===
'create'
)
{
await
FileConfigApi
.
createFileConfig
Api
(
data
)
await
FileConfigApi
.
createFileConfig
(
data
)
message
.
success
(
t
(
'common.createSuccess'
))
message
.
success
(
t
(
'common.createSuccess'
))
}
else
{
}
else
{
await
FileConfigApi
.
updateFileConfig
Api
(
data
)
await
FileConfigApi
.
updateFileConfig
(
data
)
message
.
success
(
t
(
'common.updateSuccess'
))
message
.
success
(
t
(
'common.updateSuccess'
))
}
}
modelVisible
.
value
=
false
modelVisible
.
value
=
false
...
...
src/views/infra/fileConfig/index.vue
View file @
fe2fa21d
...
@@ -135,7 +135,7 @@ const queryFormRef = ref() // 搜索的表单
...
@@ -135,7 +135,7 @@ const queryFormRef = ref() // 搜索的表单
const
getList
=
async
()
=>
{
const
getList
=
async
()
=>
{
loading
.
value
=
true
loading
.
value
=
true
try
{
try
{
const
data
=
await
FileConfigApi
.
getFileConfigPage
Api
(
queryParams
)
const
data
=
await
FileConfigApi
.
getFileConfigPage
(
queryParams
)
list
.
value
=
data
.
list
list
.
value
=
data
.
list
total
.
value
=
data
.
total
total
.
value
=
data
.
total
}
finally
{
}
finally
{
...
@@ -167,7 +167,7 @@ const handleDelete = async (id: number) => {
...
@@ -167,7 +167,7 @@ const handleDelete = async (id: number) => {
// 删除的二次确认
// 删除的二次确认
await
message
.
delConfirm
()
await
message
.
delConfirm
()
// 发起删除
// 发起删除
await
FileConfigApi
.
deleteFileConfig
Api
(
id
)
await
FileConfigApi
.
deleteFileConfig
(
id
)
message
.
success
(
t
(
'common.delSuccess'
))
message
.
success
(
t
(
'common.delSuccess'
))
// 刷新列表
// 刷新列表
await
getList
()
await
getList
()
...
@@ -178,7 +178,7 @@ const handleMaster = (id) => {
...
@@ -178,7 +178,7 @@ const handleMaster = (id) => {
message
message
.
confirm
(
'是否确认修改配置编号为"'
+
id
+
'"的数据项为主配置?'
)
.
confirm
(
'是否确认修改配置编号为"'
+
id
+
'"的数据项为主配置?'
)
.
then
(
function
()
{
.
then
(
function
()
{
return
FileConfigApi
.
updateFileConfigMaster
Api
(
id
)
return
FileConfigApi
.
updateFileConfigMaster
(
id
)
})
})
.
then
(()
=>
{
.
then
(()
=>
{
getList
()
getList
()
...
@@ -188,7 +188,7 @@ const handleMaster = (id) => {
...
@@ -188,7 +188,7 @@ const handleMaster = (id) => {
}
}
/** 测试按钮操作 */
/** 测试按钮操作 */
const
handleTest
=
(
id
)
=>
{
const
handleTest
=
(
id
)
=>
{
FileConfigApi
.
testFileConfig
Api
(
id
)
FileConfigApi
.
testFileConfig
(
id
)
.
then
((
response
)
=>
{
.
then
((
response
)
=>
{
message
.
alert
(
'测试通过,上传文件成功!访问地址:'
+
response
)
message
.
alert
(
'测试通过,上传文件成功!访问地址:'
+
response
)
})
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment