Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
front-backend
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
framework
front-backend
Commits
b428376e
Commit
b428376e
authored
Nov 24, 2019
by
dqjdda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
f7d78f4b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
266 deletions
+80
-266
src/api/monitor/log.js
+0
-9
src/api/monitor/redis.js
+1
-8
src/api/system/timing.js
+1
-17
src/views/monitor/redis/index.vue
+25
-49
src/views/system/timing/index.vue
+43
-145
src/views/system/timing/log.vue
+10
-38
No files found.
src/api/monitor/log.js
View file @
b428376e
...
...
@@ -6,12 +6,3 @@ export function getErrDetail(id) {
method
:
'get'
})
}
export
function
downloadLog
(
params
)
{
return
request
({
url
:
'api/logs/download'
,
method
:
'get'
,
params
,
responseType
:
'blob'
})
}
src/api/monitor/redis.js
View file @
b428376e
...
...
@@ -34,11 +34,4 @@ export function edit(data) {
})
}
export
function
downloadRedis
(
params
)
{
return
request
({
url
:
'api/redis/download'
,
method
:
'get'
,
params
,
responseType
:
'blob'
})
}
export
default
{
del
,
delAll
}
src/api/system/timing.js
View file @
b428376e
...
...
@@ -37,20 +37,4 @@ export function execution(id) {
})
}
export
function
downloadJobs
(
params
)
{
return
request
({
url
:
'api/jobs/download'
,
method
:
'get'
,
params
,
responseType
:
'blob'
})
}
export
function
downloadLogs
(
params
)
{
return
request
({
url
:
'api/jobs/download/log'
,
method
:
'get'
,
params
,
responseType
:
'blob'
})
}
export
default
{
del
,
updateIsPause
,
execution
,
add
,
edit
}
src/views/monitor/redis/index.vue
View file @
b428376e
...
...
@@ -3,23 +3,19 @@
<!--工具栏-->
<div
class=
"head-container"
>
<!-- 搜索 -->
<el-input
v-model=
"query.
value"
clearable
size=
"small"
placeholder=
"输入关键词
搜索"
style=
"width: 200px;"
class=
"filter-item"
@
keyup
.
enter
.
native=
"toQuery"
/>
<el-input
v-model=
"query.
key"
clearable
size=
"small"
placeholder=
"输入Key
搜索"
style=
"width: 200px;"
class=
"filter-item"
@
keyup
.
enter
.
native=
"toQuery"
/>
<el-button
class=
"filter-item"
size=
"mini"
type=
"success"
icon=
"el-icon-search"
@
click=
"toQuery"
>
搜索
</el-button>
<div
style=
"display: inline-block;"
>
<!-- 清空缓存 -->
<el-button
v-permission=
"['admin','redis:del']"
:loading=
"deleteAllLoading"
type=
"danger"
size=
"mini"
class=
"filter-item"
icon=
"el-icon-delete"
@
click=
"deleteAll"
>
清空
</el-button>
</div>
<!-- 清空缓存 -->
<el-button
v-permission=
"['admin','redis:del']"
:loading=
"deleteAllLoading"
type=
"danger"
size=
"mini"
class=
"filter-item"
icon=
"el-icon-delete"
@
click=
"deleteAll"
>
清空
</el-button>
<!-- 导出 -->
<div
style=
"display: inline-block;"
>
<el-button
:loading=
"downloadLoading"
size=
"mini"
class=
"filter-item"
type=
"warning"
icon=
"el-icon-download"
@
click=
"download"
>
导出
</el-button>
</div>
<el-button
:loading=
"downloadLoading"
size=
"mini"
class=
"filter-item"
type=
"warning"
icon=
"el-icon-download"
@
click=
"downloadMethod"
>
导出
</el-button>
</div>
<!--表格渲染-->
<el-table
v-loading=
"loading"
:data=
"data"
size=
"small"
style=
"width: 100%;"
>
...
...
@@ -42,7 +38,7 @@
<p>
确定删除本条数据吗?
</p>
<div
style=
"text-align: right; margin: 0"
>
<el-button
size=
"mini"
type=
"text"
@
click=
"$refs[scope.$index].doClose()"
>
取消
</el-button>
<el-button
:loading=
"delLoading"
type=
"primary"
size=
"mini"
@
click=
"
subDelete
(scope.$index, scope.row)"
>
确定
</el-button>
<el-button
:loading=
"delLoading"
type=
"primary"
size=
"mini"
@
click=
"
delMethod
(scope.$index, scope.row)"
>
确定
</el-button>
</div>
<el-button
slot=
"reference"
type=
"danger"
icon=
"el-icon-delete"
size=
"mini"
/>
</el-popover>
...
...
@@ -62,16 +58,16 @@
</template>
<
script
>
import
checkPermission
from
'@/utils/permission'
// 权限判断函数
import
initData
from
'@/mixins/initData'
import
{
del
,
delAll
,
downloadRedis
}
from
'@/api/monitor/redis'
import
{
downloadFile
}
from
'@/utils/index'
import
crud
from
'@/mixins/crud'
import
crudRedis
from
'@/api/monitor/redis'
export
default
{
name
:
'Redis'
,
mixins
:
[
initData
],
mixins
:
[
crud
],
data
()
{
return
{
delLoading
:
false
,
permissions
:
[],
deleteAllLoading
:
false
title
:
'系统缓存'
,
crudMethod
:
{
...
crudRedis
},
deleteAllLoading
:
false
}
},
created
()
{
...
...
@@ -80,35 +76,25 @@ export default {
})
},
methods
:
{
checkPermission
,
beforeInit
()
{
this
.
url
=
'api/redis'
const
query
=
this
.
query
const
value
=
query
.
value
this
.
params
=
{
page
:
this
.
page
,
size
:
this
.
size
}
if
(
value
)
{
this
.
params
[
'key'
]
=
value
}
else
{
if
(
!
this
.
query
.
key
)
{
this
.
params
[
'key'
]
=
'*'
}
return
true
},
subDelete
(
index
,
row
)
{
delMethod
(
index
,
row
)
{
this
.
delLoading
=
true
del
(
row
.
key
).
then
(
res
=>
{
this
.
crudMethod
.
del
(
row
.
key
).
then
(
res
=>
{
this
.
delLoading
=
false
this
.
$refs
[
index
].
doClose
()
this
.
dleChangePage
()
this
.
init
()
this
.
$notify
({
title
:
'删除成功'
,
type
:
'success'
,
duration
:
2500
})
}).
catch
(
err
=>
{
this
.
notify
(
'删除成功'
,
'success'
)
}).
catch
(()
=>
{
this
.
delLoading
=
false
this
.
$refs
[
index
].
doClose
()
console
.
log
(
err
.
response
.
data
.
message
)
})
},
deleteAll
()
{
...
...
@@ -118,22 +104,12 @@ export default {
type
:
'warning'
}).
then
(()
=>
{
this
.
deleteAllLoading
=
true
delAll
().
then
(
res
=>
{
this
.
crudMethod
.
delAll
().
then
(
res
=>
{
this
.
page
=
0
this
.
init
()
this
.
deleteAllLoading
=
false
})
})
},
download
()
{
this
.
beforeInit
()
this
.
downloadLoading
=
true
downloadRedis
(
this
.
params
).
then
(
result
=>
{
downloadFile
(
result
,
'缓存列表'
,
'xlsx'
)
this
.
downloadLoading
=
false
}).
catch
(()
=>
{
this
.
downloadLoading
=
false
})
}
}
}
...
...
src/views/system/timing/index.vue
View file @
b428376e
This diff is collapsed.
Click to expand it.
src/views/system/timing/log.vue
View file @
b428376e
...
...
@@ -2,9 +2,9 @@
<el-dialog
:visible
.
sync=
"dialog"
append-to-body
title=
"执行日志"
width=
"88%"
>
<!-- 搜索 -->
<div
class=
"head-container"
>
<el-input
v-model=
"query.
valu
e"
clearable
size=
"small"
placeholder=
"输入任务名称搜索"
style=
"width: 200px;"
class=
"filter-item"
@
keyup
.
enter
.
native=
"toQuery"
/>
<el-input
v-model=
"query.
jobNam
e"
clearable
size=
"small"
placeholder=
"输入任务名称搜索"
style=
"width: 200px;"
class=
"filter-item"
@
keyup
.
enter
.
native=
"toQuery"
/>
<el-date-picker
v-model=
"query.
dat
e"
v-model=
"query.
createTim
e"
:default-time=
"['00:00:00','23:59:59']"
type=
"daterange"
range-separator=
":"
...
...
@@ -26,7 +26,7 @@
class=
"filter-item"
type=
"warning"
icon=
"el-icon-download"
@
click=
"download"
@
click=
"download
Method
"
>
导出
</el-button>
</div>
</div>
...
...
@@ -55,9 +55,9 @@
</el-table-column>
</el-table>
<el-dialog
:visible
.
sync=
"errorDialog"
append-to-body
title=
"异常详情"
width=
"85%"
>
<
span
>
<
pre
>
{{ errorInfo }}
</
span
>
</
pre
>
</el-dialog>
<!--分页组件-->
<el-pagination
...
...
@@ -73,16 +73,13 @@
</template>
<
script
>
import
checkPermission
from
'@/utils/permission'
import
initData
from
'@/mixins/initData'
import
{
downloadLogs
}
from
'@/api/system/timing'
import
{
parseTime
,
downloadFile
}
from
'@/utils/index'
import
crud
from
'@/mixins/crud'
export
default
{
mixins
:
[
initData
],
mixins
:
[
crud
],
data
()
{
return
{
title
:
'任务日志'
,
errorInfo
:
''
,
errorDialog
:
false
,
dialog
:
false
,
delLoading
:
false
,
enabledTypeOptions
:
[
{
key
:
'true'
,
display_name
:
'成功'
},
{
key
:
'false'
,
display_name
:
'失败'
}
...
...
@@ -90,46 +87,21 @@ export default {
}
},
methods
:
{
parseTime
,
checkPermission
,
doInit
()
{
this
.
$nextTick
(()
=>
{
this
.
init
()
})
},
toQuery
()
{
this
.
page
=
0
this
.
doInit
()
},
// 获取数据前设置好接口地址
beforeInit
()
{
this
.
url
=
'api/jobs/logs'
const
sort
=
'id,desc'
const
query
=
this
.
query
const
value
=
query
.
value
const
isSuccess
=
query
.
isSuccess
this
.
size
=
6
this
.
params
=
{
page
:
this
.
page
,
size
:
this
.
size
,
sort
:
sort
}
if
(
value
)
{
this
.
params
[
'jobName'
]
=
value
}
if
(
query
.
date
)
{
this
.
params
[
'startTime'
]
=
query
.
date
[
0
]
this
.
params
[
'endTime'
]
=
query
.
date
[
1
]
}
if
(
isSuccess
!==
''
&&
isSuccess
!==
null
)
{
this
.
params
[
'isSuccess'
]
=
isSuccess
}
return
true
},
// 异常详情
info
(
errorInfo
)
{
this
.
errorInfo
=
errorInfo
this
.
errorDialog
=
true
},
download
()
{
this
.
beforeInit
()
this
.
downloadLoading
=
true
downloadLogs
(
this
.
params
).
then
(
result
=>
{
downloadFile
(
result
,
'任务日志列表'
,
'xlsx'
)
this
.
downloadLoading
=
false
}).
catch
(()
=>
{
this
.
downloadLoading
=
false
})
}
}
}
...
...
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