timer.vue
6.88 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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<template>
<el-container style="padding: 20px">
<el-aside>
<el-card>
<el-form label-width="80px">
<el-form-item label="参数编码">
<el-input
v-model="paramCode"
placeholder="请输入参数编码"
></el-input>
</el-form-item>
<el-form-item label="参数名称">
<el-input
v-model="paramName"
placeholder="请输入参数名称"
></el-input>
</el-form-item>
<el-form-item>
<el-row>
<el-col :span="8">
<el-button type="primary" size="small" @click="handleQuery"
>查询</el-button
>
</el-col>
<el-col :span="8">
<el-button type="success" size="small" @click="handleAdd"
>新增</el-button
>
</el-col>
</el-row>
<el-row style="margin-top: 5px">
<el-col :span="8">
<el-button type="warning" size="small" @click="handleEdit"
>编辑</el-button
>
</el-col>
<el-col :span="8">
<el-button type="danger" size="small" @click="handleDelete"
>删除</el-button
>
</el-col>
</el-row>
<el-row style="margin-top: 5px">
<el-col :span="8">
<el-button type="info" size="small" @click="handleStart"
>启动</el-button
>
</el-col>
<el-col :span="8">
<el-button type="info" size="small" @click="handlePause"
>暂停</el-button
>
</el-col>
</el-row>
</el-form-item>
</el-form>
</el-card>
</el-aside>
<el-main>
<el-card>
<el-table
:data="tableData"
style="width: 100%"
max-height="400px"
border
stripe
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column prop="id" label="ID" width="80"></el-table-column>
<el-table-column prop="taskName" label="任务名称"></el-table-column>
<el-table-column prop="group" label="分组"></el-table-column>
<el-table-column prop="jobStatus" label="job状态"></el-table-column>
<el-table-column
prop="assembly"
width="180"
label="程序集"
></el-table-column>
<el-table-column
prop="className"
width="180"
label="类名"
></el-table-column>
<el-table-column
prop="expression"
width="100"
label="表达式"
></el-table-column>
<el-table-column
prop="excludeExpression"
width="180"
label="排除表达式"
></el-table-column>
<el-table-column
prop="executedCount"
label="已执行次数"
width="100"
></el-table-column>
<el-table-column
prop="taskParams"
width="180"
label="任务参数"
></el-table-column>
<el-table-column
prop="lastRunTime"
width="180"
label="最后一次运行时间"
></el-table-column>
<el-table-column
prop="lastRunSuccess"
width="180"
label="最后一次运行是否成功"
></el-table-column>
<el-table-column
prop="executionMessage"
label="执行携带的消息"
width="120"
></el-table-column>
<el-table-column
prop="remark"
width="180"
label="备注"
></el-table-column>
<el-table-column
prop="createTime"
width="180"
label="创建时间"
></el-table-column>
<el-table-column prop="creator" label="创建人"></el-table-column>
<el-table-column
prop="updateTime"
width="180"
label="更新时间"
></el-table-column>
<el-table-column prop="updater" label="更新人"></el-table-column>
</el-table>
<el-pagination
style="margin-top: 15px"
align="center"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 20, 50, 100]"
:page-size="pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="this.tableData.length"
/>
</el-card>
</el-main>
</el-container>
</template>
<script>
export default {
name: "Timer",
data() {
return {
paramCode: "",
paramName: "",
currentPage: 1,
total: 0,
pageSize: 10,
selectedItems: [],
tableData: [
{
id: 1,
taskName: "示例任务",
group: "示例分组",
jobStatus: "运行中",
assembly: "ExampleAssembly",
className: "ExampleClass",
expression: "0 0/5 * * * ?",
excludeExpression: "",
executedCount: 10,
taskParams: "param1=value1",
lastRunTime: "2025-04-23 10:00:00",
lastRunSuccess: true,
executionMessage: "执行成功",
remark: "这是一个示例任务备注",
createTime: "2025-04-20 09:00:00",
creator: "admin",
updateTime: "2025-04-23 11:00:00",
updater: "admin",
},
// 可以添加更多示例数据
],
};
},
methods: {
handleSelectionChange(val) {
this.selectedItems = val;
// console.log("选中的行数据:", this.selectedItems);
},
handleSizeChange(val) {
this.pageSize = val;
this.currentPage = 1;
this.handleQuery();
},
handleCurrentChange(val) {
this.currentPage = val;
this.handleQuery();
},
handleQuery() {
// 查询逻辑
},
handleAdd() {
// 新增逻辑
},
handleEdit() {
// 编辑逻辑
},
handleDelete() {
// 删除逻辑
},
handleStart() {
// 启动逻辑
},
handlePause() {
// 暂停逻辑
},
},
};
</script>
<style scoped lang="scss">
::v-deep .el-table__body-wrapper::-webkit-scrollbar {
width: 8px;
height: 8px;
}
::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb {
background-color: #777f87;
border-radius: 4px;
}
::v-deep .el-table__body-wrapper::-webkit-scrollbar-track {
background-color: #f5f5f5;
}
.el-card__body,
.el-main {
padding: 0 10px 0 10px;
}
::v-deep.el-table thead {
color: #101010;
font-weight: 600;
}
/* 样式定义 */
</style>