This commit is contained in:
USER-20220102CG\noblelift
2022-10-27 18:58:02 +08:00
parent 7ca4fb98c4
commit 3da7abdd8d
1308 changed files with 122315 additions and 0 deletions

View File

@@ -0,0 +1,94 @@
<template>
<div class="app-container">
<!--工具栏-->
<div class="head-container">
<div v-if="crud.props.searchToggle">
<!-- 搜索 -->
<el-input v-model="query.name" clearable size="mini" placeholder="输入名称" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
<date-range-picker v-model="query.createTime" class="date-item" />
<rrOperation />
</div>
</div>
<!--表格渲染-->
<el-table ref="table" v-loading="crud.loading" :data="crud.data" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
<el-table-column :selectable="checkboxT" type="selection" width="55" />
<el-table-column show-overflow-tooltip prop="name" label="名称" />
<el-table-column :show-overflow-tooltip="false" prop="code" label="编号" width="200" />
<el-table-column show-overflow-tooltip prop="status" label="状态" />
<el-table-column show-overflow-tooltip prop="thread_name" label="线程名" />
<el-table-column show-overflow-tooltip prop="thread_state" label="线程状态" />
<el-table-column show-overflow-tooltip prop="usedStatus" label="使用状态" />
<el-table-column show-overflow-tooltip prop="stopMessage" width="90px" label="停止信息" />
<el-table-column v-permission="['admin','timing:edit','timing:del']" label="操作" width="170px" align="center" fixed="right">
<template slot-scope="scope">
<el-button v-permission="['admin','timing:edit']" style="margin-left: -2px" type="text" size="mini" @click="start(scope.row.code)">启动</el-button>
<el-popover
:ref="scope.row.code"
placement="top"
width="200"
>
<p>确定停止该线程吗</p>
<div style="text-align: right; margin: 0">
<el-button size="mini" type="text" @click="$refs[scope.row.code].doClose()">取消</el-button>
<el-button :loading="delLoading" type="primary" size="mini" @click="stop(scope.row.code)">确定</el-button>
</div>
<el-button slot="reference" type="text" size="mini">停止</el-button>
</el-popover>
</template>
</el-table-column>
</el-table>
<!--分页组件-->
<pagination />
</div>
</template>
<script>
import crudAutoRun from '@/api/system/autorun'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import pagination from '@crud/Pagination'
import crudJob from '@/api/system/timing'
export default {
name: 'Autorun',
components: { pagination, crudOperation, rrOperation },
cruds() {
return CRUD({ title: '自动线程', url: 'api/autorun', crudMethod: { ...crudAutoRun }})
},
mixins: [presenter(), header(), crud()],
data() {
return {
stopLoading: false,
permission: {
},
rules: {
}
}
},
methods: {
start(id) {
crudAutoRun.start(id).then(res => {
this.crud.notify('启动成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
this.crud.toQuery()
}).catch(err => {
console.log(err.response.data.message)
})
},
stop(id) {
this.stopLoading = true
crudAutoRun.stop([id]).then(() => {
this.stopLoading = false
this.$refs[id].doClose()
this.crud.toQuery()
}).catch(() => {
this.stopLoading = false
this.$refs[id].doClose()
})
}
}
}
</script>

View File

@@ -0,0 +1,108 @@
<template>
<el-dialog :visible.sync="dialog" append-to-body title="执行日志" width="88%">
<!-- 搜索 -->
<div class="head-container">
<el-input v-model="query.jobName" clearable size="mini" placeholder="输入任务名称搜索" style="width: 200px;" class="filter-item" @keyup.enter.native="toQuery" />
<date-range-picker v-model="query.createTime" class="date-item" />
<el-select v-model="query.isSuccess" placeholder="日志状态" clearable size="mini" class="filter-item" style="width: 110px" @change="toQuery">
<el-option v-for="item in enabledTypeOptions" :key="item.key" :label="item.display_name" :value="item.key" />
</el-select>
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="toQuery">搜索</el-button>
<!-- 导出 -->
<div style="display: inline-block;">
<el-button
:loading="downloadLoading"
size="mini"
class="filter-item"
type="warning"
icon="el-icon-download"
@click="downloadMethod"
>导出</el-button>
</div>
</div>
<!--表格渲染-->
<el-table v-loading="loading" :data="data" style="width: 100%;margin-top: -10px;">
<el-table-column show-overflow-tooltip prop="jobName" label="任务名称" />
<el-table-column show-overflow-tooltip prop="beanName" label="Bean名称" />
<el-table-column show-overflow-tooltip prop="methodName" label="执行方法" />
<el-table-column show-overflow-tooltip prop="params" width="120px" label="参数" />
<el-table-column show-overflow-tooltip prop="cronExpression" label="cron表达式" />
<el-table-column prop="createTime" label="异常详情" width="110px">
<template slot-scope="scope">
<el-button v-show="scope.row.exceptionDetail" size="mini" type="text" @click="info(scope.row.exceptionDetail)">查看详情</el-button>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip align="center" prop="time" width="100px" label="耗时(毫秒)" />
<el-table-column align="center" prop="isSuccess" width="80px" label="状态">
<template slot-scope="scope">
<el-tag :type="scope.row.isSuccess ? 'success' : 'danger'">{{ scope.row.isSuccess ? '成功' : '失败' }}</el-tag>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip prop="createTime" label="创建日期">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
</el-table>
<el-dialog :visible.sync="errorDialog" append-to-body title="异常详情" width="85%">
<pre v-highlightjs="errorInfo"><code class="java" /></pre>
</el-dialog>
<!--分页组件-->
<el-pagination
:total="total"
:current-page="page + 1"
:page-size="6"
style="margin-top:8px;"
layout="total, prev, pager, next"
@size-change="sizeChange"
@current-change="pageChange"
/>
</el-dialog>
</template>
<script>
import crud from '@/mixins/crud'
import DateRangePicker from '@/components/DateRangePicker'
export default {
components: { DateRangePicker },
mixins: [crud],
data() {
return {
title: '任务日志',
errorInfo: '', errorDialog: false,
enabledTypeOptions: [
{ key: 'true', display_name: '成功' },
{ key: 'false', display_name: '失败' }
]
}
},
methods: {
doInit() {
this.$nextTick(() => {
this.init()
})
},
// 获取数据前设置好接口地址
beforeInit() {
this.url = 'api/jobs/logs'
this.size = 6
return true
},
// 异常详情
info(errorInfo) {
this.errorInfo = errorInfo
this.errorDialog = true
}
}
}
</script>
<style scoped>
.java.hljs{
color: #444;
background: #ffffff !important;
}
::v-deep .el-dialog__body{
padding: 0 20px 10px 20px !important;
}
</style>