新增调度日志模块

This commit is contained in:
zCans
2022-09-23 22:43:48 +08:00
parent 61660c8e30
commit 90dd11e509
5 changed files with 146 additions and 3 deletions
+9
View File
@@ -0,0 +1,9 @@
import request from '@/utils/request'
export function fetchList(query) {
return request({
url: '/job-Log/page',
method: 'get',
params: query
})
}
+6 -2
View File
@@ -51,7 +51,8 @@ export default {
proxy: '代理配置',
license: 'License管理',
portMapping: '端口映射',
jobManager: '调度管理'
jobManager: '调度管理',
jobLog: '调度日志'
},
navbar: {
logOut: '退出登录',
@@ -131,7 +132,10 @@ export default {
cron: 'cron',
jobParam: '任务参数',
alarmEmail: '任务报警邮箱',
alarmDing: '任务报警钉钉'
alarmDing: '任务报警钉钉',
jobLogCode: '执行结果',
jobLogMsg: '执行日志',
alarmStatus: '报警状态'
},
errorLog: {
tips: '请点击右上角bug小图标',
+2 -1
View File
@@ -277,7 +277,8 @@ export const asyncRouterMap = [
children: [
{ path: 'user', component: _import('system/user'), name: 'user', meta: { title: 'user' }},
{ path: 'portPool', component: _import('system/portPool'), name: 'portPool', meta: { title: 'portPool' }},
{ path: 'jobManager', component: _import('system/jobManager'), name: 'jobManager', meta: { title: 'jobManager' }}
{ path: 'jobManager', component: _import('system/jobManager'), name: 'jobManager', meta: { title: 'jobManager' }},
{ path: 'jobLog', component: _import('system/jobLog'), name: 'jobLog', meta: { title: 'jobLog' }}
]
}
]
@@ -0,0 +1,121 @@
<template>
<div class="app-container calendar-list-container">
<div class="filter-container">
<el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">{{$t('table.search')}}</el-button>
</div>
<el-table :key='tableKey' :data="list" v-loading="listLoading" element-loading-text="给我一点时间" border fit highlight-current-row style="width: 100%">
<el-table-column align="center" :label="$t('table.id')" width="100">
<template slot-scope="scope">
<span>{{scope.row.id}}</span>
</template>
</el-table-column>
<el-table-column align="center" :label="$t('table.handler')" width="200">
<template slot-scope="scope">
<span>{{scope.row.handler}}</span>
</template>
</el-table-column>
<el-table-column align="center" :label="$t('table.jobParam')" width="200">
<template slot-scope="scope">
<span>{{scope.row.param}}</span>
</template>
</el-table-column>
<el-table-column align="center" :label="$t('table.jobLogCode')" width="200">
<template slot-scope="scope">
<span>{{scope.row.code}}</span>
</template>
</el-table-column>
<el-table-column align="center" :label="$t('table.jobLogMsg')" width="200">
<template slot-scope="scope">
<span>{{scope.row.msg}}</span>
</template>
</el-table-column>
<el-table-column align="center" :label="$t('table.alarmStatus')" width="200">
<template slot-scope="scope">
<span>{{scope.row.alarmStatus}}</span>
</template>
</el-table-column>
<el-table-column width="150px" align="center" :label="$t('table.createTime')">
<template slot-scope="scope">
<span>{{scope.row.createTime | parseTime('{y}-{m}-{d} {h}:{i}')}}</span>
</template>
</el-table-column>
<el-table-column align="center" :label="$t('table.actions')" min-width="150">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="handleShowClick(scope.row)">查看日志</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination-container">
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="listQuery.currentPage"
:page-sizes="[10,20,30, 50]" :page-size="listQuery.pageSize" layout="total, sizes, prev, pager, next, jumper" :total="total">
</el-pagination>
</div>
</div>
</template>
<script>
import { fetchList } from '@/api/jobLog'
import waves from '@/directive/waves' // 水波纹指令
export default {
name: 'jobLog',
directives: {
waves
},
data() {
return {
tableKey: 0,
list: null,
total: null,
listLoading: false,
listQuery: {
currentPage: 1,
pageSize: 20,
jobId: undefined
}
}
},
filters: {
statusFilter(status) {
const statusMap = {
1: 'success',
2: 'danger'
}
return statusMap[status]
}
},
created() {
// this.getList()
},
activated() {
this.listQuery.jobId = this.$route.query.jobId
// this.getList()
},
methods: {
getList() {
this.listLoading = true
fetchList(this.listQuery).then(response => {
this.list = response.data.data.records
this.total = response.data.data.total
this.listLoading = false
})
},
handleFilter() {
this.listQuery.currentPage = 1
this.getList()
},
handleSizeChange(val) {
this.listQuery.pageSize = val
this.getList()
},
handleCurrentChange(val) {
this.listQuery.currentPage = val
this.getList()
},
handleShowClick(row) {
console.log(row)
}
}
}
</script>
@@ -40,6 +40,11 @@
<el-tag :type="scope.row.enable | statusFilter">{{scope.row.enable | statusName}}</el-tag>
</template>
</el-table-column>
<el-table-column class-name="status-col" :label="$t('route.jobLog')" width="100">
<template slot-scope="scope">
<el-button size="mini" type="text" @click="handleLogClick(scope.row)">查看</el-button>
</template>
</el-table-column>
<el-table-column align="center" :label="$t('table.actions')" width="230" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button size="mini" type="primary" @click="handleEditClick(scope.row)">编辑</el-button>
@@ -222,6 +227,9 @@
})
}
})
},
handleLogClick(row) {
this.$router.push({ path: '/system/jobLog', query: { jobId: row.id }})
}
}
}