修改bug

This commit is contained in:
hj 2023-04-10 11:13:40 +08:00
parent 9730d1c936
commit ec39d76372
3 changed files with 208 additions and 258 deletions

View File

@ -7,16 +7,12 @@
</h1> </h1>
</div> </div>
<div class="site-navbar__body clearfix"> <div class="site-navbar__body clearfix">
<el-menu <el-menu class="site-navbar__menu" mode="horizontal">
class="site-navbar__menu"
mode="horizontal">
<el-menu-item class="site-navbar__switch" index="0" @click="sidebarFold = !sidebarFold"> <el-menu-item class="site-navbar__switch" index="0" @click="sidebarFold = !sidebarFold">
<icon-svg name="zhedie"></icon-svg> <icon-svg name="zhedie"></icon-svg>
</el-menu-item> </el-menu-item>
</el-menu> </el-menu>
<el-menu <el-menu class="site-navbar__menu site-navbar__menu--right" mode="horizontal">
class="site-navbar__menu site-navbar__menu--right"
mode="horizontal">
<el-menu-item index="1" @click="$router.push({ name: 'theme' })"> <el-menu-item index="1" @click="$router.push({ name: 'theme' })">
<template slot="title"> <template slot="title">
<el-badge> <el-badge>
@ -43,10 +39,10 @@
</template> </template>
<script> <script>
import UpdatePassword from './main-navbar-update-password' import { clearLoginInfo } from '@/utils'
import { clearLoginInfo } from '@/utils' import UpdatePassword from './main-navbar-update-password'
export default { export default {
data () { data() {
return { return {
updatePassowrdVisible: false updatePassowrdVisible: false
} }
@ -56,30 +52,30 @@
}, },
computed: { computed: {
navbarLayoutType: { navbarLayoutType: {
get () { return this.$store.state.common.navbarLayoutType } get() { return this.$store.state.common.navbarLayoutType }
}, },
sidebarFold: { sidebarFold: {
get () { return this.$store.state.common.sidebarFold }, get() { return this.$store.state.common.sidebarFold },
set (val) { this.$store.commit('common/updateSidebarFold', val) } set(val) { this.$store.commit('common/updateSidebarFold', val) }
}, },
mainTabs: { mainTabs: {
get () { return this.$store.state.common.mainTabs }, get() { return this.$store.state.common.mainTabs },
set (val) { this.$store.commit('common/updateMainTabs', val) } set(val) { this.$store.commit('common/updateMainTabs', val) }
}, },
userName: { userName: {
get () { return this.$store.state.user.name } get() { return this.$store.state.user.name }
} }
}, },
methods: { methods: {
// //
updatePasswordHandle () { updatePasswordHandle() {
this.updatePassowrdVisible = true this.updatePassowrdVisible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.updatePassowrd.init() this.$refs.updatePassowrd.init()
}) })
}, },
// 退 // 退
logoutHandle () { logoutHandle() {
this.$confirm(`确定进行[退出]操作?`, '提示', { this.$confirm(`确定进行[退出]操作?`, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
@ -89,14 +85,14 @@
url: this.$http.adornUrl('/sys/logout'), url: this.$http.adornUrl('/sys/logout'),
method: 'post', method: 'post',
data: this.$http.adornData() data: this.$http.adornData()
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
clearLoginInfo() clearLoginInfo()
this.$router.push({ name: 'login' }) this.$router.push({ name: 'login' })
} }
}) })
}).catch(() => {}) }).catch(() => { })
}
} }
} }
}
</script> </script>

View File

@ -1,9 +1,7 @@
<template> <template>
<el-dialog <el-dialog :title="!dataForm.id ? '新增' : '修改'" :close-on-click-modal="false" :visible.sync="visible">
:title="!dataForm.id ? '新增' : '修改'" <el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()"
:close-on-click-modal="false" label-width="100px">
:visible.sync="visible">
<el-form :model="dataForm" :rules="dataRule" ref="dataForm" @keyup.enter.native="dataFormSubmit()" label-width="100px">
<el-form-item label="bean名称" prop="beanName"> <el-form-item label="bean名称" prop="beanName">
<el-input v-model="dataForm.beanName" placeholder="spring bean名称, 如: testTask"></el-input> <el-input v-model="dataForm.beanName" placeholder="spring bean名称, 如: testTask"></el-input>
</el-form-item> </el-form-item>
@ -25,8 +23,8 @@
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
@ -48,7 +46,7 @@
} }
}, },
methods: { methods: {
init (id) { init(id) {
this.dataForm.id = id || 0 this.dataForm.id = id || 0
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
@ -58,7 +56,7 @@
url: this.$http.adornUrl(`/sys/schedule/info/${this.dataForm.id}`), url: this.$http.adornUrl(`/sys/schedule/info/${this.dataForm.id}`),
method: 'get', method: 'get',
params: this.$http.adornParams() params: this.$http.adornParams()
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataForm.beanName = data.schedule.beanName this.dataForm.beanName = data.schedule.beanName
this.dataForm.params = data.schedule.params this.dataForm.params = data.schedule.params
@ -71,7 +69,7 @@
}) })
}, },
// //
dataFormSubmit () { dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => { this.$refs['dataForm'].validate((valid) => {
if (valid) { if (valid) {
this.$http({ this.$http({
@ -85,7 +83,7 @@
'remark': this.dataForm.remark, 'remark': this.dataForm.remark,
'status': !this.dataForm.id ? undefined : this.dataForm.status 'status': !this.dataForm.id ? undefined : this.dataForm.status
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
message: '操作成功', message: '操作成功',
@ -104,5 +102,5 @@
}) })
} }
} }
} }
</script> </script>

View File

@ -1,9 +1,5 @@
<template> <template>
<el-dialog <el-dialog title="日志列表" :close-on-click-modal="false" :visible.sync="visible" width="75%">
title="日志列表"
:close-on-click-modal="false"
:visible.sync="visible"
width="75%">
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()"> <el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
<el-form-item> <el-form-item>
<el-input v-model="dataForm.id" placeholder="任务ID" clearable></el-input> <el-input v-model="dataForm.id" placeholder="任务ID" clearable></el-input>
@ -12,77 +8,37 @@
<el-button @click="getDataList()">查询</el-button> <el-button @click="getDataList()">查询</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-table <el-table :data="dataList" border v-loading="dataListLoading" height="460" style="width: 100%;">
:data="dataList" <el-table-column prop="logId" header-align="center" align="center" width="80" label="日志ID">
border
v-loading="dataListLoading"
height="460"
style="width: 100%;">
<el-table-column
prop="logId"
header-align="center"
align="center"
width="80"
label="日志ID">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="jobId" header-align="center" align="center" width="80" label="任务ID">
prop="jobId"
header-align="center"
align="center"
width="80"
label="任务ID">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="beanName" header-align="center" align="center" label="bean名称">
prop="beanName"
header-align="center"
align="center"
label="bean名称">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="params" header-align="center" align="center" label="参数">
prop="params"
header-align="center"
align="center"
label="参数">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="status" header-align="center" align="center" label="状态">
prop="status"
header-align="center"
align="center"
label="状态">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag v-if="scope.row.status === 0" size="small">成功</el-tag> <el-tag v-if="scope.row.status === 0" size="small">成功</el-tag>
<el-tag v-else @click.native="showErrorInfo(scope.row.logId)" size="small" type="danger" style="cursor: pointer;">失败</el-tag> <el-tag v-else @click.native="showErrorInfo(scope.row.logId)" size="small" type="danger"
style="cursor: pointer;">失败</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="times" header-align="center" align="center" label="耗时(单位: 毫秒)">
prop="times"
header-align="center"
align="center"
label="耗时(单位: 毫秒)">
</el-table-column> </el-table-column>
<el-table-column <el-table-column prop="createTime" header-align="center" align="center" width="180" label="执行时间">
prop="createTime"
header-align="center"
align="center"
width="180"
label="执行时间">
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-pagination <el-pagination @size-change="sizeChangeHandle" @current-change="currentChangeHandle" :current-page="pageIndex"
@size-change="sizeChangeHandle" :page-sizes="[10, 20, 50, 100]" :page-size="pageSize" :total="totalPage"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
export default { export default {
data () { data() {
return { return {
visible: false, visible: false,
dataForm: { dataForm: {
@ -96,12 +52,12 @@
} }
}, },
methods: { methods: {
init () { init() {
this.visible = true this.visible = true
this.getDataList() this.getDataList()
}, },
// //
getDataList () { getDataList() {
this.dataListLoading = true this.dataListLoading = true
this.$http({ this.$http({
url: this.$http.adornUrl('/sys/scheduleLog/list'), url: this.$http.adornUrl('/sys/scheduleLog/list'),
@ -111,7 +67,7 @@
'limit': this.pageSize, 'limit': this.pageSize,
'jobId': this.dataForm.id 'jobId': this.dataForm.id
}) })
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataList = data.page.list this.dataList = data.page.list
this.totalPage = data.page.totalCount this.totalPage = data.page.totalCount
@ -123,23 +79,23 @@
}) })
}, },
// //
sizeChangeHandle (val) { sizeChangeHandle(val) {
this.pageSize = val this.pageSize = val
this.pageIndex = 1 this.pageIndex = 1
this.getDataList() this.getDataList()
}, },
// //
currentChangeHandle (val) { currentChangeHandle(val) {
this.pageIndex = val this.pageIndex = val
this.getDataList() this.getDataList()
}, },
// //
showErrorInfo (id) { showErrorInfo(id) {
this.$http({ this.$http({
url: this.$http.adornUrl(`/sys/scheduleLog/info/${id}`), url: this.$http.adornUrl(`/sys/scheduleLog/info/${id}`),
method: 'get', method: 'get',
params: this.$http.adornParams() params: this.$http.adornParams()
}).then(({data}) => { }).then(({ data }) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$alert(data.log.error) this.$alert(data.log.error)
} else { } else {
@ -148,5 +104,5 @@
}) })
} }
} }
} }
</script> </script>