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
72b0ec23
authored
Mar 10, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构:完善配置管理的导出功能
parent
faaa47ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
7 deletions
+22
-7
src/views/infra/config/index.vue
+22
-7
No files found.
src/views/infra/config/index.vue
View file @
72b0ec23
...
...
@@ -144,6 +144,7 @@ import { DICT_TYPE, getDictOptions } from '@/utils/dict'
import
*
as
ConfigApi
from
'@/api/infra/config'
import
ConfigForm
from
'./form.vue'
import
dayjs
from
'dayjs'
import
download
from
'@/utils/download'
const
message
=
useMessage
()
// 消息弹窗
const
{
t
}
=
useI18n
()
// 国际化
...
...
@@ -162,12 +163,6 @@ const queryParams = reactive({
const
queryFormRef
=
ref
()
// 搜索的表单
const
exportLoading
=
ref
(
false
)
// 导出的加载中
/** 搜索按钮操作 */
const
handleQuery
=
()
=>
{
queryParams
.
pageNo
=
1
getList
()
}
/** 查询参数列表 */
const
getList
=
async
()
=>
{
loading
.
value
=
true
...
...
@@ -180,6 +175,12 @@ const getList = async () => {
}
}
/** 搜索按钮操作 */
const
handleQuery
=
()
=>
{
queryParams
.
pageNo
=
1
getList
()
}
/** 重置按钮操作 */
const
resetQuery
=
()
=>
{
queryFormRef
.
value
.
resetFields
()
...
...
@@ -195,7 +196,7 @@ const openModal = (type: string, id?: number) => {
/** 删除按钮操作 */
const
handleDelete
=
async
(
id
:
number
)
=>
{
try
{
// 二次确认
//
删除的
二次确认
await
message
.
delConfirm
()
// 发起删除
await
ConfigApi
.
deleteConfig
(
id
)
...
...
@@ -205,6 +206,20 @@ const handleDelete = async (id: number) => {
}
catch
{}
}
const
handleExport
=
async
()
=>
{
try
{
// 导出的二次确认
await
message
.
exportConfirm
()
// 发起导出
exportLoading
.
value
=
true
const
data
=
await
ConfigApi
.
exportConfigApi
(
queryParams
)
download
.
excel
(
data
,
'参数配置.xls'
)
}
catch
{
}
finally
{
exportLoading
.
value
=
false
}
}
/** 初始化 **/
onMounted
(()
=>
{
getList
()
...
...
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