提交 | 用户 | 时间
|
759b1c
|
1 |
<template> |
H |
2 |
<div class="app-container"> |
|
3 |
<!-- 搜索栏 --> |
|
4 |
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px"> |
|
5 |
<el-form-item label="处理器的名字" prop="handlerName"> |
|
6 |
<el-input v-model="queryParams.handlerName" placeholder="请输入处理器的名字" clearable @keyup.enter.native="handleQuery"/> |
|
7 |
</el-form-item> |
|
8 |
<el-form-item label="开始执行时间" prop="beginTime"> |
|
9 |
<el-date-picker clearable v-model="queryParams.beginTime" type="date" value-format="yyyy-MM-dd" placeholder="选择开始执行时间" /> |
|
10 |
</el-form-item> |
|
11 |
<el-form-item label="结束执行时间" prop="endTime"> |
|
12 |
<el-date-picker clearable v-model="queryParams.endTime" type="date" value-format="yyyy-MM-dd" placeholder="选择结束执行时间" /> |
|
13 |
</el-form-item> |
|
14 |
<el-form-item label="任务状态" prop="status"> |
|
15 |
<el-select v-model="queryParams.status" placeholder="请选择任务状态" clearable> |
|
16 |
<el-option v-for="dict in this.getDictDatas(DICT_TYPE.INFRA_JOB_LOG_STATUS)" |
|
17 |
:key="dict.value" :label="dict.label" :value="dict.value"/> |
|
18 |
</el-select> |
|
19 |
</el-form-item> |
|
20 |
<el-form-item> |
|
21 |
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button> |
|
22 |
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button> |
|
23 |
</el-form-item> |
|
24 |
</el-form> |
|
25 |
|
|
26 |
<el-row :gutter="10" class="mb8"> |
|
27 |
<el-col :span="1.5"> |
|
28 |
<el-button type="warning" icon="el-icon-download" size="mini" @click="handleExport" |
|
29 |
v-hasPermi="['infra:job:export']">导出</el-button> |
|
30 |
</el-col> |
|
31 |
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|
32 |
</el-row> |
|
33 |
|
|
34 |
<el-table v-loading="loading" :data="list"> |
|
35 |
<el-table-column label="日志编号" align="center" prop="id" /> |
|
36 |
<el-table-column label="任务编号" align="center" prop="jobId" /> |
|
37 |
<el-table-column label="处理器的名字" align="center" prop="handlerName" /> |
|
38 |
<el-table-column label="处理器的参数" align="center" prop="handlerParam" /> |
|
39 |
<el-table-column label="第几次执行" align="center" prop="executeIndex" /> |
|
40 |
<el-table-column label="执行时间" align="center" width="180"> |
|
41 |
<template v-slot="scope"> |
|
42 |
<span>{{ parseTime(scope.row.beginTime) + ' ~ ' + parseTime(scope.row.endTime) }}</span> |
|
43 |
</template> |
|
44 |
</el-table-column> |
|
45 |
<el-table-column label="执行时长" align="center" prop="duration"> |
|
46 |
<template v-slot="scope"> |
|
47 |
<span>{{ scope.row.duration + ' 毫秒' }}</span> |
|
48 |
</template> |
|
49 |
</el-table-column> |
|
50 |
<el-table-column label="任务状态" align="center" prop="status"> |
|
51 |
<template v-slot="scope"> |
|
52 |
<dict-tag :type="DICT_TYPE.INFRA_JOB_LOG_STATUS" :value="scope.row.status" /> |
|
53 |
</template> |
|
54 |
</el-table-column> |
|
55 |
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
|
56 |
<template v-slot="scope"> |
|
57 |
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)" :loading="exportLoading" |
|
58 |
v-hasPermi="['infra:job:query']">详细</el-button> |
|
59 |
</template> |
|
60 |
</el-table-column> |
|
61 |
</el-table> |
|
62 |
|
|
63 |
<pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNo" :limit.sync="queryParams.pageSize" |
|
64 |
@pagination="getList"/> |
|
65 |
|
|
66 |
<!-- 调度日志详细 --> |
|
67 |
<el-dialog title="调度日志详细" :visible.sync="open" width="700px" append-to-body> |
|
68 |
<el-form ref="form" :model="form" label-width="120px" size="mini"> |
|
69 |
<el-row> |
|
70 |
<el-col :span="12"> |
|
71 |
<el-form-item label="日志编号:">{{ form.id }}</el-form-item> |
|
72 |
<el-form-item label="任务编号:">{{ form.jobId }}</el-form-item> |
|
73 |
<el-form-item label="处理器的名字:">{{ form.handlerName }}</el-form-item> |
|
74 |
<el-form-item label="处理器的参数:">{{ form.handlerParam }}</el-form-item> |
|
75 |
<el-form-item label="第几次执行:">{{ form.executeIndex }}</el-form-item> |
|
76 |
<el-form-item label="执行时间:">{{ parseTime(form.beginTime) + ' ~ ' + parseTime(form.endTime) }}</el-form-item> |
|
77 |
<el-form-item label="执行时长:">{{ form.duration + ' 毫秒' }}</el-form-item> |
|
78 |
<el-form-item label="任务状态:"> |
|
79 |
<dict-tag :type="DICT_TYPE.INFRA_JOB_LOG_STATUS" :value="form.status" /> |
|
80 |
</el-form-item> |
|
81 |
<el-form-item label="执行结果:">{{ form.result }}</el-form-item> |
|
82 |
</el-col> |
|
83 |
</el-row> |
|
84 |
</el-form> |
|
85 |
<div slot="footer" class="dialog-footer"> |
|
86 |
<el-button @click="open = false">关 闭</el-button> |
|
87 |
</div> |
|
88 |
</el-dialog> |
|
89 |
</div> |
|
90 |
</template> |
|
91 |
|
|
92 |
<script> |
|
93 |
import { getJobLogPage, exportJobLogExcel } from "@/api/infra/jobLog"; |
|
94 |
|
|
95 |
export default { |
|
96 |
name: "InfraJobLog", |
|
97 |
data() { |
|
98 |
return { |
|
99 |
// 遮罩层 |
|
100 |
loading: true, |
|
101 |
// 导出遮罩层 |
|
102 |
exportLoading: false, |
|
103 |
// 显示搜索条件 |
|
104 |
showSearch: true, |
|
105 |
// 总条数 |
|
106 |
total: 0, |
|
107 |
// 调度日志表格数据 |
|
108 |
list: [], |
|
109 |
// 是否显示弹出层 |
|
110 |
open: false, |
|
111 |
// 表单参数 |
|
112 |
form: {}, |
|
113 |
// 查询参数 |
|
114 |
queryParams: { |
|
115 |
pageNo: 1, |
|
116 |
pageSize: 10, |
|
117 |
handlerName: null, |
|
118 |
beginTime: null, |
|
119 |
endTime: null, |
|
120 |
status: null, |
|
121 |
} |
|
122 |
}; |
|
123 |
}, |
|
124 |
created() { |
|
125 |
this.queryParams.jobId = this.$route.query && this.$route.query.jobId; |
|
126 |
this.getList(); |
|
127 |
}, |
|
128 |
methods: { |
|
129 |
/** 查询调度日志列表 */ |
|
130 |
getList() { |
|
131 |
this.loading = true; |
|
132 |
getJobLogPage({ |
|
133 |
...this.queryParams, |
|
134 |
beginTime: this.queryParams.beginTime ? this.queryParams.beginTime + ' 00:00:00' : undefined, |
|
135 |
endTime: this.queryParams.endTime ? this.queryParams.endTime + ' 23:59:59' : undefined, |
|
136 |
}).then(response => { |
|
137 |
this.list = response.data.list; |
|
138 |
this.total = response.data.total; |
|
139 |
this.loading = false; |
|
140 |
} |
|
141 |
); |
|
142 |
}, |
|
143 |
/** 搜索按钮操作 */ |
|
144 |
handleQuery() { |
|
145 |
this.queryParams.pageNo = 1; |
|
146 |
this.getList(); |
|
147 |
}, |
|
148 |
/** 重置按钮操作 */ |
|
149 |
resetQuery() { |
|
150 |
this.resetForm("queryForm"); |
|
151 |
this.handleQuery(); |
|
152 |
}, |
|
153 |
/** 详细按钮操作 */ |
|
154 |
handleView(row) { |
|
155 |
this.open = true; |
|
156 |
this.form = row; |
|
157 |
}, |
|
158 |
/** 导出按钮操作 */ |
|
159 |
handleExport() { |
|
160 |
// 处理查询参数 |
|
161 |
let params = {...this.queryParams, |
|
162 |
beginTime: this.queryParams.beginTime ? this.queryParams.beginTime + ' 00:00:00' : undefined, |
|
163 |
endTime: this.queryParams.endTime ? this.queryParams.endTime + ' 23:59:59' : undefined, |
|
164 |
}; |
|
165 |
params.pageNo = undefined; |
|
166 |
params.pageSize = undefined; |
|
167 |
// 执行导出 |
|
168 |
this.$modal.confirm('是否确认导出所有定时任务日志数据项?').then(() => { |
|
169 |
this.exportLoading = true; |
|
170 |
return exportJobLogExcel(params); |
|
171 |
}).then(response => { |
|
172 |
this.$download.excel(response, '定时任务日志.xls'); |
|
173 |
this.exportLoading = false; |
|
174 |
}).catch(() => {}); |
|
175 |
} |
|
176 |
} |
|
177 |
}; |
|
178 |
</script> |