ExecuteJobList.vue
5.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
<template>
<el-container class="fullheight">
<el-container>
<el-main>
<ht-table
ref="executeJobTable"
@load="loadData"
:data="data"
:pageResult="pageResult"
:selection="true"
quick-search-props="jobName,trigName"
:show-export="false"
:page-sizes="[20, 50, 100, 200, 300]"
:header-cell-class-name="headerCellClassName"
custom-table-height="760"
@selection-change="handleSelectionChange"
>
<template v-slot:toolbar>
<el-button size="small" icon="icon-withdraw" @click="back()"
>返回</el-button
>
<ht-delete-button
size="small"
:url="executeJobDeleteUrl"
:htTable="$refs.executeJobTable"
:disabled="isDisabled"
>删除</ht-delete-button
>
</template>
<template v-slot:search>
<!-- <el-date-picker
v-model="startTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
end-placeholder="结束日期">
</el-date-picker> -->
<ht-table-search-panel :divide="3" :labelWidth="100">
<ht-table-search-field label="触发名称" prop="trigName" />
<ht-table-search-field
type="daterange"
label="时间范围"
prop="startTime"
operation="BETWEEN"
/>
<!-- type="daterange" -->
</ht-table-search-panel>
</template>
<template>
<ht-table-column
type="index"
width="50"
align="center"
label="序号"
/>
<ht-table-column
prop="jobName"
label="执行名称"
width="300"
:sortable="true"
:show-overflow-tooltip="true"
/>
<ht-table-column prop="trigName" label="触发名称" sortable />
<ht-table-column prop="startTime" label="开始时间" sortable />
<ht-table-column prop="endTime" label="结束时间" sortable />
<ht-table-column prop="content" label="日志内容" />
<ht-table-column
prop="state"
label="状态"
:render-header="renderHeaderMethod"
:filters="[
{text: '失败', value: 0},
{text: '正常', value: 1}
]"
>
<template v-slot="{row}">
<el-tag type="success" v-if="row.state == 1">正常</el-tag>
<el-tag type="primary" v-if="row.state == 0">失败</el-tag>
</template>
</ht-table-column>
</template>
</ht-table>
</el-main>
</el-container>
</el-container>
</template>
<script>
import sys from '@/api/portal.js'
import tableHeaderFilter from '@/mixins/tableHeaderFilter.js'
export default {
name: 'executeJobList',
mixins: [tableHeaderFilter],
props: {
jobName: String
},
components: {},
data() {
return {
data: [],
pageResult: {
page: 1,
pageSize: 50,
total: 0
},
executeJob: {},
startTime: '',
selectedList: [],
isDisabled: true
}
},
watch: {
selectedList: {
handler(val) {
this.isDisabled = val.length < 1 ? true : false
},
deep: true
}
// startTime: function(newVal, oldVal) {
// if (newVal != oldVal) {
// this.$refs.executeJobTable.querys.push({property: "startTime", operation: "BETWEEN", value: newVal, relation: "AND"});
// }
// }
},
computed: {
executeJobDeleteUrl: function() {
return window.context.portal + '/job/scheduler/v1/delJobLog'
}
},
activated: function() {
this.$refs.executeJobTable.load()
},
mounted() {
// 因为resize事件在整个项目中只能监听一次,所以这里通过全局广播发送这个事件
window.onresize = () => {
this.$root.$emit('resize')
}
},
methods: {
back() {
if (this.$route.params.trigName) {
this.$router.push({
name: 'schedulerTriggerList',
params: {jobName: this.$route.params.jobName, tobName: '触发器列表'}
})
} else {
this.$router.push('/schedulerManager')
}
},
loadData(param, cb) {
let trigName = ''
if (this.$route.params.trigName) {
trigName = this.$route.params.trigName
}
sys
.getSchedulerPageJsonbyJobName(
window.context.portal +
'/job/scheduler/v1/listJson?jobName=' +
this.$route.params.jobName +
'&trigName=' +
trigName,
param
)
.then(response => {
this.data = response.rows
this.pageResult = {
page: response.page,
pageSize: response.pageSize,
total: response.total
}
})
.finally(() => cb())
},
handleSelectionChange(selection) {
this.selectedList = selection
}
}
}
</script>
<style lang="scss" scoped>
::v-deep {
.cell > .el-table__column-filter-trigger {
display: none;
}
}
.el-main {
// padding:0px;
}
</style>