Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
D
dqms-manage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhangzhaohui
dqms-manage
Commits
966bf72c
Commit
966bf72c
authored
Aug 03, 2022
by
zhangzhaohui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加sql执行功能
parent
8d21d29b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
338 additions
and
153 deletions
+338
-153
package-lock.json
package-lock.json
+277
-138
index.html
public/index.html
+1
-1
sql-execute.vue
src/views/modules/datasource/sql-execute.vue
+49
-0
syssqllog-add-or-update.vue
src/views/modules/datasource/syssqllog-add-or-update.vue
+2
-2
syssqllog.vue
src/views/modules/datasource/syssqllog.vue
+8
-12
vue.config.js
vue.config.js
+1
-0
No files found.
package-lock.json
View file @
966bf72c
This diff is collapsed.
Click to expand it.
public/index.html
View file @
966bf72c
...
...
@@ -9,7 +9,7 @@
window
.
SITE_CONFIG
=
{};
window
.
SITE_CONFIG
[
'version'
]
=
'v1.0.0'
;
window
.
SITE_CONFIG
[
'nodeEnv'
]
=
'<%= process.env.VUE_APP_NODE_ENV %>'
;
window
.
SITE_CONFIG
[
'apiURL'
]
=
'http://
localhost
:18000/hmit-admin'
;
// api请求地址
window
.
SITE_CONFIG
[
'apiURL'
]
=
'http://
192.168.10.229
:18000/hmit-admin'
;
// api请求地址
window
.
SITE_CONFIG
[
'storeState'
]
=
{};
// vuex本地储存初始化状态(用于不刷新页面的情况下,也能重置初始化项目中所有状态)
window
.
SITE_CONFIG
[
'contentTabDefault'
]
=
{
// 内容标签页默认属性对象
'name'
:
''
,
// 名称, 由 this.$route.name 自动赋值(默认,名称 === 路由名称 === 路由路径)
...
...
src/views/modules/datasource/sql-execute.vue
0 → 100644
View file @
966bf72c
<
template
>
<el-card
shadow=
"never"
class=
"aui-card--fill"
>
<div
class=
"mod-demo__sql-execute"
>
<el-input
type=
"textarea"
:rows=
"4"
v-model=
"sqlContent"
/>
<el-button
type=
"primary"
@
click=
"execute"
>
执行
</el-button>
<el-tabs
type=
"border-card"
v-if=
"executeResult.length > 0"
>
<el-tab-pane
:label=
"`结果集$
{index + 1}`" :key="index" v-for="(item, index) in executeResult">
<el-table
:data=
"item.data"
>
<el-table-column
v-for=
"column in item.keys"
:key=
"column.keys"
:label=
"column"
:prop=
"column"
></el-table-column>
</el-table>
</el-tab-pane>
</el-tabs>
</div>
</el-card>
</
template
>
<
script
>
export
default
{
data
()
{
return
{
sqlContent
:
''
,
executeResult
:
[]
}
},
methods
:
{
execute
()
{
this
.
$http
.
post
(
'/database/executeSql?sql='
+
this
.
sqlContent
).
then
(({
data
:
res
})
=>
{
if
(
res
.
code
!==
0
)
{
return
this
.
$message
.
error
(
res
.
msg
)
}
this
.
executeResult
=
res
.
data
.
result
this
.
executeResult
.
forEach
(
result
=>
{
result
.
keys
=
[]
Object
.
keys
(
result
.
data
[
0
]).
forEach
(
i
=>
{
result
.
keys
.
push
(
i
)
})
})
})
}
},
mounted
()
{
}
}
</
script
>
<
style
>
</
style
>
\ No newline at end of file
src/views/modules/datasource/syssqllog-add-or-update.vue
View file @
966bf72c
...
...
@@ -89,7 +89,7 @@ export default {
},
// 获取信息
getInfo
()
{
this
.
$http
.
get
(
`/d
emo
/syssqllog/
${
this
.
dataForm
.
id
}
`
).
then
(({
data
:
res
})
=>
{
this
.
$http
.
get
(
`/d
atasource
/syssqllog/
${
this
.
dataForm
.
id
}
`
).
then
(({
data
:
res
})
=>
{
if
(
res
.
code
!==
0
)
{
return
this
.
$message
.
error
(
res
.
msg
)
}
...
...
@@ -105,7 +105,7 @@ export default {
if
(
!
valid
)
{
return
false
}
this
.
$http
[
!
this
.
dataForm
.
id
?
'post'
:
'put'
](
'/d
emo
/syssqllog/'
,
this
.
dataForm
).
then
(({
data
:
res
})
=>
{
this
.
$http
[
!
this
.
dataForm
.
id
?
'post'
:
'put'
](
'/d
atasource
/syssqllog/'
,
this
.
dataForm
).
then
(({
data
:
res
})
=>
{
if
(
res
.
code
!==
0
)
{
return
this
.
$message
.
error
(
res
.
msg
)
}
...
...
src/views/modules/datasource/syssqllog.vue
View file @
966bf72c
<
template
>
<el-card
shadow=
"never"
class=
"aui-card--fill"
>
<div
class=
"mod-d
emo
__syssqllog}"
>
<div
class=
"mod-d
atasource
__syssqllog}"
>
<el-form
:inline=
"true"
:model=
"dataForm"
@
keyup
.
enter
.
native=
"getDataList()"
>
<el-form-item>
<el-input
v-model=
"dataForm.id"
placeholder=
"id"
clearable
></el-input>
...
...
@@ -12,10 +12,10 @@
<el-button
type=
"info"
@
click=
"exportHandle()"
>
{{
$t
(
'export'
)
}}
</el-button>
</el-form-item>
<el-form-item>
<el-button
v-if=
"$hasPermission('d
emo
:syssqllog:save')"
type=
"primary"
@
click=
"addOrUpdateHandle()"
>
{{
$t
(
'add'
)
}}
</el-button>
<el-button
v-if=
"$hasPermission('d
atasource
:syssqllog:save')"
type=
"primary"
@
click=
"addOrUpdateHandle()"
>
{{
$t
(
'add'
)
}}
</el-button>
</el-form-item>
<el-form-item>
<el-button
v-if=
"$hasPermission('d
emo
:syssqllog:delete')"
type=
"danger"
@
click=
"deleteHandle()"
>
{{
$t
(
'deleteBatch'
)
}}
</el-button>
<el-button
v-if=
"$hasPermission('d
atasource
:syssqllog:delete')"
type=
"danger"
@
click=
"deleteHandle()"
>
{{
$t
(
'deleteBatch'
)
}}
</el-button>
</el-form-item>
</el-form>
<el-table
v-loading=
"dataListLoading"
:data=
"dataList"
border
@
selection-change=
"dataListSelectionChangeHandle"
style=
"width: 100%;"
>
...
...
@@ -23,17 +23,13 @@
<el-table-column
prop=
"id"
label=
"编号"
header-align=
"center"
align=
"center"
></el-table-column>
<el-table-column
prop=
"sqlLogName"
label=
"日志名称"
header-align=
"center"
align=
"center"
></el-table-column>
<el-table-column
prop=
"sqlLogContent"
label=
"SQL内容"
header-align=
"center"
align=
"center"
></el-table-column>
<el-table-column
prop=
"sqlLogResult"
label=
"SQL结果"
header-align=
"center"
align=
"center"
></el-table-column>
<el-table-column
prop=
"sqlLogIp"
label=
"执行IP"
header-align=
"center"
align=
"center"
></el-table-column>
<el-table-column
prop=
"sqlExecuteTime"
label=
"执行时间"
header-align=
"center"
align=
"center"
></el-table-column>
<el-table-column
prop=
"status"
label=
"状态"
header-align=
"center"
align=
"center"
></el-table-column>
<el-table-column
prop=
"remark"
label=
"备注"
header-align=
"center"
align=
"center"
></el-table-column>
<el-table-column
prop=
"creator"
label=
"创建人"
header-align=
"center"
align=
"center"
></el-table-column>
<el-table-column
prop=
"createDate"
label=
"创建时间"
header-align=
"center"
align=
"center"
></el-table-column>
<el-table-column
:label=
"$t('handle')"
fixed=
"right"
header-align=
"center"
align=
"center"
width=
"150"
>
<template
slot-scope=
"scope"
>
<el-button
v-if=
"$hasPermission('d
emo
:syssqllog:update')"
type=
"text"
size=
"small"
@
click=
"addOrUpdateHandle(scope.row.id)"
>
{{
$t
(
'update'
)
}}
</el-button>
<el-button
v-if=
"$hasPermission('d
emo
:syssqllog:delete')"
type=
"text"
size=
"small"
@
click=
"deleteHandle(scope.row.id)"
>
{{
$t
(
'delete'
)
}}
</el-button>
<el-button
v-if=
"$hasPermission('d
atasource
:syssqllog:update')"
type=
"text"
size=
"small"
@
click=
"addOrUpdateHandle(scope.row.id)"
>
{{
$t
(
'update'
)
}}
</el-button>
<el-button
v-if=
"$hasPermission('d
atasource
:syssqllog:delete')"
type=
"text"
size=
"small"
@
click=
"deleteHandle(scope.row.id)"
>
{{
$t
(
'delete'
)
}}
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -60,10 +56,10 @@ export default {
data
()
{
return
{
mixinViewModuleOptions
:
{
getDataListURL
:
'/d
emo
/syssqllog/page'
,
getDataListURL
:
'/d
atasource
/syssqllog/page'
,
getDataListIsPage
:
true
,
exportURL
:
'/d
emo
/syssqllog/export'
,
deleteURL
:
'/d
emo
/syssqllog'
,
exportURL
:
'/d
atasource
/syssqllog/export'
,
deleteURL
:
'/d
atasource
/syssqllog'
,
deleteIsBatch
:
true
},
dataForm
:
{
...
...
vue.config.js
View file @
966bf72c
...
...
@@ -2,6 +2,7 @@
* 配置参考: https://cli.vuejs.org/zh/config/
*/
module
.
exports
=
{
lintOnSave
:
false
,
publicPath
:
process
.
env
.
NODE_ENV
===
'production'
?
'./'
:
'/'
,
chainWebpack
:
config
=>
{
const
svgRule
=
config
.
module
.
rule
(
'svg'
)
...
...
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