Commit f6240f06 authored by liwei's avatar liwei

Merge remote-tracking branch 'origin/master'

parents a7000f9d ac9c46bc
import request from '@/utils/request'
import Qs from 'qs'
/**
* 1. 列表查询
* 2. 查询详细信息
* 3. 新增
* 4. 修改
* 5. 逻辑删除
* 6. 导出
*
*/
// 1. 查询列表
export function listSysScheduledTaskLog(query) {
return request({
url: '/sysscheduledtasklog/list',
method: 'get',
params: query
})
}
// 2. 查询详细信息
export function getSysScheduledTaskLog(businessId) {
return request({
url: '/sysscheduledtasklog/detail/' + businessId,
method: 'get'
})
}
// 3. 新增
export function addSysScheduledTaskLog(data) {
data = Qs.stringify(data)
return request({
url: '/sysscheduledtasklog/add',
method: 'post',
data: data
})
}
// 4. 修改
export function updateSysScheduledTaskLog(data) {
const businessId = data.businessId
data = Qs.stringify(data)
return request({
url: '/sysscheduledtasklog/update/' + businessId,
method: 'put',
data
})
}
// 5. 逻辑删除
export function delSysScheduledTaskLog(businessId) {
return request({
url: '/sysscheduledtasklog/deleteLogical/' + businessId,
method: 'delete'
})
}
// 6. 导出
export function exportSysScheduledTaskLog(query) {
return request({
url: '/sysscheduledtasklog/export',
method: 'get',
params: query,
responseType: 'blob'
})
}
<template>
<div class="app-container">
<el-form ref="queryForm" style="padding: 0 0 0 10px" :model="queryParams" :inline="true">
<el-form-item label="任务名称" prop="taskName">
<el-input
v-model="queryParams.taskName"
placeholder="请输入任务名称"
clearable
:maxlength="255"
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="dateRange"
size="small"
style="width: 300px"
value-format="yyyy-MM-dd"
type="datetimerange"
range-separator="-"
start-placeholder="开始时间"
end-placeholder="结束时间"
/>
</el-form-item>
<el-form-item label="执行情况" prop="taskState">
<el-input
v-model="queryParams.taskState"
placeholder="请输入执行情况"
clearable
:maxlength="255"
size="small"
style="width: 150px"
/>
</el-form-item>
<el-form-item>
<el-button
:class="commonField.queryClass"
:type="commonField.typePrimary"
:icon="commonField.queryIcon"
:size="commonField.smallSize"
@click="handleQuery"
>查询</el-button>
<el-button
:class="commonField.resetClass"
:icon="commonField.resetIcon"
:size="commonField.smallSize"
@click="resetQuery"
>重置</el-button>
</el-form-item>
</el-form>
<div style="padding:5px 10px">
<div class="mb12 font-small-bold">定时任务日志列表</div>
<el-table v-loading="loading" border :data="sysScheduledTaskLogList">
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column label="任务名称" prop="taskName" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.taskName || '-' }}
</template>
</el-table-column>
<el-table-column label="任务执行时间" prop="taskTime" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.taskTime || '-' }}
</template>
</el-table-column>
<el-table-column label="创建时间" prop="createDate" :show-overflow-tooltip="true">
<template slot-scope="scope">
<span>{{ scope.row.createDate | transformDateByFormat('YYYY-MM-DD HH:mm:ss') }}</span>
</template>
</el-table-column>
<el-table-column label="执行情况" prop="taskState" :show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row.taskState || '-' }}
</template>
</el-table-column>
</el-table>
</div>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.page"
:limit.sync="queryParams.rows"
@pagination="getList"
/>
</div>
</template>
<script>
import { listSysScheduledTaskLog } from '@/api/system/sysScheduledTaskLog'
import commonField from '@/utils/commonField'
export default {
name: 'SysScheduledTaskLog',
data() {
return {
// 遮罩层
loading: true,
// 总条数
total: 0,
// 表格数据
sysScheduledTaskLogList: [],
// 弹出层标题
title: '',
// 是否显示弹出层
open: false,
// 状态菜单
statusOptions: [
{
dictLabel: '启用',
dictValue: '1'
},
{
dictLabel: '停用',
dictValue: '0'
}
],
// 日期范围
dateRange: [],
// 查询参数
queryParams: {
page: 1,
rows: 10,
taskName: undefined,
taskTime: undefined,
taskState: undefined,
flag: ''
},
// 表单参数
form: {},
// 表单校验
rules: {
}
}
},
computed: {
commonField() {
return commonField
}
},
created() {
this.getList() // 列表查询
},
methods: {
/** 查询列表 */
getList() {
this.loading = true
listSysScheduledTaskLog(this.addDateRange(this.queryParams, this.dateRange)).then(
response => {
this.sysScheduledTaskLogList = response.data
this.total = response.total
this.loading = false
}
)
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
businessId: undefined,
taskName: undefined,
taskTime: undefined,
taskState: undefined,
remarks: undefined,
flag: '1'
}
this.resetForm('form')
},
/** 查询按钮操作 */
handleQuery() {
this.queryParams.page = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.dateRange = []
this.queryParams = {
page: 1,
rows: 10,
taskName: undefined,
taskTime: undefined,
taskState: undefined,
flag: ''
}
this.handleQuery()
}
}
}
</script>
<style lang="scss" scoped>
.app-container {
font-size: 18px;
padding: 0;
.placeholder {
height: 1.3vh;
background-color: #F4F4F4;
margin-bottom: 10px
}
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment