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

View File

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

View File

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