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
a1292fbf
authored
Mar 11, 2023
by
YunaiV
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
重构:微调【数据源菜单】的重构
parent
a8bbccfb
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
14 deletions
+9
-14
src/api/infra/config/index.ts
+1
-8
src/views/infra/dataSourceConfig/form.vue
+2
-4
src/views/infra/dataSourceConfig/index.vue
+6
-2
No files found.
src/api/infra/config/index.ts
View file @
a1292fbf
...
@@ -12,13 +12,6 @@ export interface ConfigVO {
...
@@ -12,13 +12,6 @@ export interface ConfigVO {
createTime
:
Date
createTime
:
Date
}
}
export
interface
ConfigExportReqVO
{
name
?:
string
key
?:
string
type
?:
number
createTime
?:
Date
[]
}
// 查询参数列表
// 查询参数列表
export
const
getConfigPage
=
(
params
:
PageParam
)
=>
{
export
const
getConfigPage
=
(
params
:
PageParam
)
=>
{
return
request
.
get
({
url
:
'/infra/config/page'
,
params
})
return
request
.
get
({
url
:
'/infra/config/page'
,
params
})
...
@@ -50,6 +43,6 @@ export const deleteConfig = (id: number) => {
...
@@ -50,6 +43,6 @@ export const deleteConfig = (id: number) => {
}
}
// 导出参数
// 导出参数
export
const
exportConfigApi
=
(
params
:
ConfigExportReqVO
)
=>
{
export
const
exportConfigApi
=
(
params
)
=>
{
return
request
.
download
({
url
:
'/infra/config/export'
,
params
})
return
request
.
download
({
url
:
'/infra/config/export'
,
params
})
}
}
src/views/infra/dataSourceConfig/form.vue
View file @
a1292fbf
...
@@ -31,8 +31,6 @@
...
@@ -31,8 +31,6 @@
<
script
setup
lang=
"ts"
>
<
script
setup
lang=
"ts"
>
import
*
as
DataSourceConfigApi
from
'@/api/infra/dataSourceConfig'
import
*
as
DataSourceConfigApi
from
'@/api/infra/dataSourceConfig'
import
{
DataSourceConfigVO
}
from
'@/api/infra/dataSourceConfig'
import
{
DataSourceConfigVO
}
from
'@/api/infra/dataSourceConfig'
import
{
isNullOrUnDef
}
from
'@/utils/is'
import
{
omit
}
from
'lodash-es'
const
{
t
}
=
useI18n
()
// 国际化
const
{
t
}
=
useI18n
()
// 国际化
const
message
=
useMessage
()
// 消息弹窗
const
message
=
useMessage
()
// 消息弹窗
...
@@ -63,7 +61,7 @@ const openModal = async (type: string, id?: number) => {
...
@@ -63,7 +61,7 @@ const openModal = async (type: string, id?: number) => {
formType
.
value
=
type
formType
.
value
=
type
resetForm
()
resetForm
()
// 修改时,设置数据
// 修改时,设置数据
if
(
!
isNullOrUnDef
(
id
)
)
{
if
(
id
)
{
formLoading
.
value
=
true
formLoading
.
value
=
true
try
{
try
{
formData
.
value
=
await
DataSourceConfigApi
.
getDataSourceConfig
(
id
)
formData
.
value
=
await
DataSourceConfigApi
.
getDataSourceConfig
(
id
)
...
@@ -84,7 +82,7 @@ const submitForm = async () => {
...
@@ -84,7 +82,7 @@ const submitForm = async () => {
// 提交请求
// 提交请求
formLoading
.
value
=
true
formLoading
.
value
=
true
try
{
try
{
const
data
=
omit
(
unref
(
formData
),
'createTime'
)
const
data
=
formData
.
value
as
DataSourceConfigApi
.
DataSourceConfigVO
if
(
formType
.
value
===
'create'
)
{
if
(
formType
.
value
===
'create'
)
{
await
DataSourceConfigApi
.
createDataSourceConfig
(
data
)
await
DataSourceConfigApi
.
createDataSourceConfig
(
data
)
message
.
success
(
t
(
'common.createSuccess'
))
message
.
success
(
t
(
'common.createSuccess'
))
...
...
src/views/infra/dataSourceConfig/index.vue
View file @
a1292fbf
<
template
>
<
template
>
<content-wrap>
<content-wrap>
<!-- 搜索工作栏 -->
<!-- 搜索工作栏 -->
<el-form
:inline=
"true"
label-width=
"68px
"
>
<el-form
class=
"-mb-15px"
:inline=
"true
"
>
<el-form-item>
<el-form-item>
<el-button
<el-button
type=
"primary"
type=
"primary"
...
@@ -12,8 +12,10 @@
...
@@ -12,8 +12,10 @@
</el-button>
</el-button>
</el-form-item>
</el-form-item>
</el-form>
</el-form>
</content-wrap>
<!-- 列表 -->
<!-- 列表 -->
<content-wrap>
<el-table
v-loading=
"loading"
:data=
"list"
align=
"center"
>
<el-table
v-loading=
"loading"
:data=
"list"
align=
"center"
>
<el-table-column
label=
"主键编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"主键编号"
align=
"center"
prop=
"id"
/>
<el-table-column
label=
"数据源名称"
align=
"center"
prop=
"name"
/>
<el-table-column
label=
"数据源名称"
align=
"center"
prop=
"name"
/>
...
@@ -33,6 +35,7 @@
...
@@ -33,6 +35,7 @@
type=
"primary"
type=
"primary"
@
click=
"openModal('update', scope.row.id)"
@
click=
"openModal('update', scope.row.id)"
v-hasPermi=
"['infra:data-source-config:update']"
v-hasPermi=
"['infra:data-source-config:update']"
:disabled=
"scope.row.id === 0"
>
>
编辑
编辑
</el-button>
</el-button>
...
@@ -41,6 +44,7 @@
...
@@ -41,6 +44,7 @@
type=
"danger"
type=
"danger"
@
click=
"handleDelete(scope.row.id)"
@
click=
"handleDelete(scope.row.id)"
v-hasPermi=
"['infra:data-source-config:delete']"
v-hasPermi=
"['infra:data-source-config:delete']"
:disabled=
"scope.row.id === 0"
>
>
删除
删除
</el-button>
</el-button>
...
...
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