|
|
1
|
+<template>
|
|
|
2
|
+ <el-container>
|
|
|
3
|
+ <el-main>
|
|
|
4
|
+ <el-card style="background-color: #F5F7FA">
|
|
|
5
|
+ <!-- 搜素区域 -->
|
|
|
6
|
+ <div>
|
|
|
7
|
+ <el-row>
|
|
|
8
|
+ <el-col :span="7">
|
|
|
9
|
+ <el-input v-model="queue_queryInfo.filter"
|
|
|
10
|
+ size="medium"
|
|
|
11
|
+ placeholder="过滤器内容" clearable>
|
|
|
12
|
+ <template slot="prepend" ><i class="el-icon-notebook-2"></i>过滤器内容</template>
|
|
|
13
|
+ </el-input>
|
|
|
14
|
+ </el-col>
|
|
|
15
|
+ <el-col :span="8">
|
|
|
16
|
+ <el-button type="warning" style="width:150px" size="medium" icon="el-icon-search" @click="queue_getListSub">
|
|
|
17
|
+ 查询
|
|
|
18
|
+ </el-button>
|
|
|
19
|
+ <el-button type="primary" style="width:150px" size="medium" icon="el-icon-plus" @click="queue_toAddDialog">
|
|
|
20
|
+ 添加
|
|
|
21
|
+ </el-button>
|
|
|
22
|
+ </el-col>
|
|
|
23
|
+ </el-row>
|
|
|
24
|
+ </div>
|
|
|
25
|
+ <!-- 列表区域 -->
|
|
|
26
|
+ <div style="margin-top: 20px;">
|
|
|
27
|
+ <el-row>
|
|
|
28
|
+ <el-col :span="24">
|
|
|
29
|
+ <el-table :data="queue_page.queueList" border v-loading="queue_loading.listLoading"
|
|
|
30
|
+ @selection-change="queue_selectChange"
|
|
|
31
|
+ element-loading-text="获取队列列表,拼命加载中" size="small"
|
|
|
32
|
+ :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}"
|
|
|
33
|
+ style="border-radius: 10px 10px 0px 0px;line-height: 25px;">
|
|
|
34
|
+ <el-table-column type="selection" width="55" align="center"></el-table-column>
|
|
|
35
|
+ <el-table-column type="index" align="center" width="55" ></el-table-column>
|
|
|
36
|
+ <el-table-column label="过滤规则" prop="queueName" align="center"
|
|
|
37
|
+ width="200"></el-table-column>
|
|
|
38
|
+ <el-table-column label="规则类型" prop="username" align="center"
|
|
|
39
|
+ width="200"></el-table-column>
|
|
|
40
|
+ <el-table-column label="状态" prop="partitionCount" align="center"
|
|
|
41
|
+ width="200"></el-table-column>
|
|
|
42
|
+ <el-table-column label="相关描述" prop="description" align="center" width="200"></el-table-column>
|
|
|
43
|
+ <!-- <el-table-column label="是否持久化" prop="durability" align="center" width="145">-->
|
|
|
44
|
+ <!-- <template slot-scope="scope">-->
|
|
|
45
|
+ <!-- <span v-if="scope.row.durability ===false">否</span>-->
|
|
|
46
|
+ <!-- <span v-if="scope.row.durability ===true">是</span>-->
|
|
|
47
|
+ <!-- </template>-->
|
|
|
48
|
+ <!-- </el-table-column>-->
|
|
|
49
|
+ <el-table-column label="创建时间" prop="gmtCreate" align="center" width="200">
|
|
|
50
|
+ </el-table-column>
|
|
|
51
|
+ <!-- <el-table-column label="扩展参数" prop="arguments" align="center" width="200">-->
|
|
|
52
|
+ <!-- </el-table-column>-->
|
|
|
53
|
+
|
|
|
54
|
+ <!-- fixed="right" -->
|
|
|
55
|
+ <el-table-column label="操作" width="220" align="center" fixed="right">
|
|
|
56
|
+ <template slot-scope="scope">
|
|
|
57
|
+ <!-- 编辑按钮-->
|
|
|
58
|
+ <el-tooltip effect="dark" content="编辑" placement="top-start" :enterable="false">
|
|
|
59
|
+ <el-button type="primary" icon="el-icon-edit" size="mini" style="margin-bottom: 2px"
|
|
|
60
|
+ @click="queue_toEditDialog(scope.$index,scope.row)">编辑
|
|
|
61
|
+ </el-button>
|
|
|
62
|
+ </el-tooltip>
|
|
|
63
|
+
|
|
|
64
|
+ <!-- 删除按钮-->
|
|
|
65
|
+ <el-tooltip effect="dark" content="删除" placement="top-start" :enterable="false">
|
|
|
66
|
+ <el-button type="danger" icon="el-icon-delete" size="mini"
|
|
|
67
|
+ :loading="queue_loading.delLoading"
|
|
|
68
|
+ @click="queue_remove(scope.$index,scope.row)">删除
|
|
|
69
|
+ </el-button>
|
|
|
70
|
+ </el-tooltip>
|
|
|
71
|
+ </template>
|
|
|
72
|
+ </el-table-column>
|
|
|
73
|
+ </el-table>
|
|
|
74
|
+
|
|
|
75
|
+ </el-col>
|
|
|
76
|
+ </el-row>
|
|
|
77
|
+ </div>
|
|
|
78
|
+ <!--分页区域-->
|
|
|
79
|
+ <div style="margin-top: 10px">
|
|
|
80
|
+ <el-row :gutter="24">
|
|
|
81
|
+ <el-col :span="5">
|
|
|
82
|
+ <el-button type="danger" icon="el-icon-delete"
|
|
|
83
|
+ :loading="queue_loading.listLoading"
|
|
|
84
|
+ :disabled="this.queue_page.selectList.length===0"
|
|
|
85
|
+ @click="queue_batchRemove">批量删除
|
|
|
86
|
+ </el-button>
|
|
|
87
|
+ </el-col>
|
|
|
88
|
+ <el-col :span="10" style="margin-top: 5px">
|
|
|
89
|
+ <el-pagination
|
|
|
90
|
+ @size-change="queue_handleSizeChange"
|
|
|
91
|
+ @current-change="queue_handleCurrentChange"
|
|
|
92
|
+ :current-page="queue_queryInfo.pageNum"
|
|
|
93
|
+ :page-sizes="[10,20,30,50]"
|
|
|
94
|
+ :page-size="queue_queryInfo.pageSize"
|
|
|
95
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
96
|
+ :total="queue_page.total">
|
|
|
97
|
+ </el-pagination>
|
|
|
98
|
+ </el-col>
|
|
|
99
|
+ </el-row>
|
|
|
100
|
+ </div>
|
|
|
101
|
+ </el-card>
|
|
|
102
|
+
|
|
|
103
|
+ <!-- 增加,对话框区域 -->
|
|
|
104
|
+ <div>
|
|
|
105
|
+ <el-dialog :title="dialogMap[dialogStatus]"
|
|
|
106
|
+ :visible.sync="queue_dialog.addDialog"
|
|
|
107
|
+ style="margin-top: -50px" text-align="center" width="60%"
|
|
|
108
|
+ @close="queue_addDialogClosed">
|
|
|
109
|
+ <el-form :inline="true" label-width="120px" status-icon style="margin-top: -10px"
|
|
|
110
|
+ :model="queue_addForm" :rules="queue_addFormRules" ref="queue_addFormRef" align="center">
|
|
|
111
|
+ <el-form-item label="" prop="queueName">
|
|
|
112
|
+ <el-input v-model="queue_addForm.queueName" style="width:300px" size="small" clearable
|
|
|
113
|
+ placeholder="请输入TOPIC名称">
|
|
|
114
|
+ <template slot="prepend" >TOPIC名称</template>
|
|
|
115
|
+ </el-input>
|
|
|
116
|
+ </el-form-item>
|
|
|
117
|
+
|
|
|
118
|
+ <el-form-item label="" prop="partitionCount">
|
|
|
119
|
+ <el-input v-model="queue_addForm.partitionCount" style="width:300px" size="small" clearable
|
|
|
120
|
+ placeholder="请输入TOPIC分区数量">
|
|
|
121
|
+ <template slot="prepend" >TOPIC分区数量</template>
|
|
|
122
|
+ </el-input>
|
|
|
123
|
+ </el-form-item>
|
|
|
124
|
+
|
|
|
125
|
+ <el-form-item label="" prop="username">
|
|
|
126
|
+ <el-input v-model="queue_addForm.username" style="width:300px" size="small" clearable
|
|
|
127
|
+ placeholder="请输入用户名称">
|
|
|
128
|
+ <template slot="prepend" >用户名称</template>
|
|
|
129
|
+ </el-input>
|
|
|
130
|
+ </el-form-item>
|
|
|
131
|
+
|
|
|
132
|
+ <el-form-item label="" prop="virtualHostId">
|
|
|
133
|
+ <el-input v-model="queue_addForm.consumerGroupName" style="width:300px" size="small" clearable
|
|
|
134
|
+ placeholder="请输入消费者组名称">
|
|
|
135
|
+ <template slot="prepend" >消费者组</template>
|
|
|
136
|
+ </el-input>
|
|
|
137
|
+ </el-form-item>
|
|
|
138
|
+
|
|
|
139
|
+ <el-form-item label="" prop="description">
|
|
|
140
|
+ <el-input v-model="queue_addForm.description" style="width:300px" clearable size="small"
|
|
|
141
|
+ type="textarea" autosize :rows="1"
|
|
|
142
|
+ placeholder="相关描述">
|
|
|
143
|
+ </el-input>
|
|
|
144
|
+ </el-form-item>
|
|
|
145
|
+ </el-form>
|
|
|
146
|
+ <User
|
|
|
147
|
+ v-on:getUserMessageEvent="getUserInfo">
|
|
|
148
|
+ </User>
|
|
|
149
|
+ <div slot="footer" class="dialog-footer" style="text-align: center;margin-top: -20px">
|
|
|
150
|
+ <el-button type="info" @click="queue_dialog.addDialog = false" size="medium"
|
|
|
151
|
+ style="width: 100px;background-color: #6F8294;color: #ffffff">取消
|
|
|
152
|
+ </el-button>
|
|
|
153
|
+ <el-button type="primary" @click="dialogStatus==='create'?queue_add():queue_edit()" :loading="queue_loading.addLoading"
|
|
|
154
|
+ size="medium" style="width: 100px">提交
|
|
|
155
|
+ </el-button>
|
|
|
156
|
+ </div>
|
|
|
157
|
+
|
|
|
158
|
+ </el-dialog>
|
|
|
159
|
+ </div>
|
|
|
160
|
+ </el-main>
|
|
|
161
|
+ </el-container>
|
|
|
162
|
+</template>
|
|
|
163
|
+
|
|
|
164
|
+<script>
|
|
|
165
|
+ import {
|
|
|
166
|
+ selectBusQueueList,
|
|
|
167
|
+ insertBusQueue,
|
|
|
168
|
+ updateBusQueue,
|
|
|
169
|
+ deleteBusQueue,
|
|
|
170
|
+ batchRemoveBusQueue,
|
|
|
171
|
+ getServerAndHostList, getUserInfoList,
|
|
|
172
|
+ api_addReceiverFileter,api_getReceiverFileter
|
|
|
173
|
+ } from "../../api/message_bus";
|
|
|
174
|
+
|
|
|
175
|
+ import User from "@/views/bus/dsly/user";
|
|
|
176
|
+
|
|
|
177
|
+ export default {
|
|
|
178
|
+ name: "Queue",
|
|
|
179
|
+ components: { User },
|
|
|
180
|
+ data() {
|
|
|
181
|
+ return {
|
|
|
182
|
+ dialogMap: {
|
|
|
183
|
+ update: '编辑',
|
|
|
184
|
+ create: '新增',
|
|
|
185
|
+ },
|
|
|
186
|
+ dialogStatus: 'create',
|
|
|
187
|
+ /**
|
|
|
188
|
+ * queue,配置与参数
|
|
|
189
|
+ */
|
|
|
190
|
+ queue_config: {
|
|
|
191
|
+ // 用户信息列表
|
|
|
192
|
+ userInfoList: [],
|
|
|
193
|
+ // 级联显示
|
|
|
194
|
+ cascade: {
|
|
|
195
|
+ // 服务器及虚拟主机列表
|
|
|
196
|
+ server_hostList: [],
|
|
|
197
|
+ defaultParams: {
|
|
|
198
|
+ label: 'aliasName',
|
|
|
199
|
+ value: 'id',
|
|
|
200
|
+ children: 'aliasList'
|
|
|
201
|
+ }
|
|
|
202
|
+ },
|
|
|
203
|
+ },
|
|
|
204
|
+ /**
|
|
|
205
|
+ * queue,搜索参数
|
|
|
206
|
+ */
|
|
|
207
|
+ queue_queryInfo: {
|
|
|
208
|
+ filter: '',
|
|
|
209
|
+ // 当前页数
|
|
|
210
|
+ pageNum: 1,
|
|
|
211
|
+ // 每页条数
|
|
|
212
|
+ pageSize: 10
|
|
|
213
|
+ },
|
|
|
214
|
+ /**
|
|
|
215
|
+ * queue,分页
|
|
|
216
|
+ */
|
|
|
217
|
+ queue_page: {
|
|
|
218
|
+ // 队列列表
|
|
|
219
|
+ queueList: [],
|
|
|
220
|
+ // 总条数
|
|
|
221
|
+ total: 0,
|
|
|
222
|
+ // 批量删除,选中列表
|
|
|
223
|
+ selectList: [],
|
|
|
224
|
+ },
|
|
|
225
|
+ /**
|
|
|
226
|
+ * queue,新增表单
|
|
|
227
|
+ */
|
|
|
228
|
+ queue_addForm: {
|
|
|
229
|
+ // 队列名称
|
|
|
230
|
+ queueName: '',
|
|
|
231
|
+ consumerGroupName: '',
|
|
|
232
|
+ partitionCount: 3,
|
|
|
233
|
+ queueType: 1,
|
|
|
234
|
+ // 用户名称
|
|
|
235
|
+ username: '',
|
|
|
236
|
+ // 用户id(该字段抛弃)
|
|
|
237
|
+ userId: '',
|
|
|
238
|
+ // 所属虚拟机id
|
|
|
239
|
+ virtualHostId: '',
|
|
|
240
|
+ // 是否持久化,默认 true
|
|
|
241
|
+ durability: '',
|
|
|
242
|
+ // 是否自动删除,默认 false
|
|
|
243
|
+ autoDelete: '',
|
|
|
244
|
+ // 扩展参数,以JSON格式存储
|
|
|
245
|
+ arguments: '',
|
|
|
246
|
+ // 相关描述
|
|
|
247
|
+ description: '',
|
|
|
248
|
+ },
|
|
|
249
|
+ /**
|
|
|
250
|
+ * queue,编辑表单
|
|
|
251
|
+ */
|
|
|
252
|
+ queue_editForm: {},
|
|
|
253
|
+ /**
|
|
|
254
|
+ * queue,加载
|
|
|
255
|
+ */
|
|
|
256
|
+ queue_loading: {
|
|
|
257
|
+ // 列表加载
|
|
|
258
|
+ listLoading: false,
|
|
|
259
|
+ // 添加加载
|
|
|
260
|
+ addLoading: false,
|
|
|
261
|
+ // 编辑加载
|
|
|
262
|
+ editLoading: false,
|
|
|
263
|
+ // 删除加载
|
|
|
264
|
+ delLoading: false,
|
|
|
265
|
+ // 批量删除加载
|
|
|
266
|
+ batchDelLoading: false,
|
|
|
267
|
+ },
|
|
|
268
|
+ /**
|
|
|
269
|
+ * queue,对话框管理
|
|
|
270
|
+ */
|
|
|
271
|
+ queue_dialog: {
|
|
|
272
|
+ // 添加对话框
|
|
|
273
|
+ addDialog: false,
|
|
|
274
|
+ // 编辑对话框
|
|
|
275
|
+ editDialog: false,
|
|
|
276
|
+ },
|
|
|
277
|
+ /**
|
|
|
278
|
+ * queue,添加表单,验证规则
|
|
|
279
|
+ */
|
|
|
280
|
+ queue_addFormRules: {
|
|
|
281
|
+ // 队列名称
|
|
|
282
|
+ queueName: [
|
|
|
283
|
+ {required: true, message: '请输入队列名称', trigger: ['blur', 'change']},
|
|
|
284
|
+ ],
|
|
|
285
|
+ // 用户名称
|
|
|
286
|
+ username: [
|
|
|
287
|
+ {required: true, message: '请输入用户名称', trigger: ['blur', 'change']},
|
|
|
288
|
+ ],
|
|
|
289
|
+ // // 所属虚拟机id
|
|
|
290
|
+ // virtualHostId: [
|
|
|
291
|
+ // {required: true, message: '请选择所属虚拟机', trigger: ['blur', 'change']},
|
|
|
292
|
+ // ],
|
|
|
293
|
+ // // 是否持久化,默认 true
|
|
|
294
|
+ // durability: [
|
|
|
295
|
+ // {required: true, message: '请选择是否持久化', trigger: ['blur', 'change']},
|
|
|
296
|
+ // ],
|
|
|
297
|
+ // // 是否自动删除,默认 false
|
|
|
298
|
+ // autoDelete: [
|
|
|
299
|
+ // {required: true, message: '请选择是否自动删除', trigger: ['blur', 'change']},
|
|
|
300
|
+ // ],
|
|
|
301
|
+ // // 扩展参数,以JSON格式存储
|
|
|
302
|
+ // arguments: [
|
|
|
303
|
+ // {required: true, message: '扩展参数', trigger: ['blur', 'change']},
|
|
|
304
|
+ // ],
|
|
|
305
|
+ // // 相关描述
|
|
|
306
|
+ // description: [
|
|
|
307
|
+ // {required: true, message: '请输入相关描述', trigger: ['blur', 'change']},
|
|
|
308
|
+ // ],
|
|
|
309
|
+ },
|
|
|
310
|
+ /**
|
|
|
311
|
+ * queue,编辑表单,验证规则
|
|
|
312
|
+ */
|
|
|
313
|
+ queue_editFormRules: {
|
|
|
314
|
+ // 队列名称
|
|
|
315
|
+ queueName: [
|
|
|
316
|
+ {required: true, message: '请输入队列名称', trigger: ['blur', 'change']},
|
|
|
317
|
+ ],
|
|
|
318
|
+ // 用户名称
|
|
|
319
|
+ username: [
|
|
|
320
|
+ {required: true, message: '请输入用户名称', trigger: ['blur', 'change']},
|
|
|
321
|
+ ],
|
|
|
322
|
+ // // 所属虚拟机id
|
|
|
323
|
+ // virtualHostId: [
|
|
|
324
|
+ // {required: true, message: '请选择所属虚拟机', trigger: ['blur', 'change']},
|
|
|
325
|
+ // ],
|
|
|
326
|
+ // // 是否持久化,默认 true
|
|
|
327
|
+ // durability: [
|
|
|
328
|
+ // {required: true, message: '请选择是否持久化', trigger: ['blur', 'change']},
|
|
|
329
|
+ // ],
|
|
|
330
|
+ // // 是否自动删除,默认 false
|
|
|
331
|
+ // autoDelete: [
|
|
|
332
|
+ // {required: true, message: '请选择是否自动删除', trigger: ['blur', 'change']},
|
|
|
333
|
+ // ],
|
|
|
334
|
+ // // 扩展参数,以JSON格式存储
|
|
|
335
|
+ // arguments: [
|
|
|
336
|
+ // {required: true, message: '扩展参数', trigger: ['blur', 'change']},
|
|
|
337
|
+ // ],
|
|
|
338
|
+ // // 相关描述
|
|
|
339
|
+ // description: [
|
|
|
340
|
+ // {required: true, message: '请输入相关描述', trigger: ['blur', 'change']},
|
|
|
341
|
+ // ],
|
|
|
342
|
+ },
|
|
|
343
|
+ /**
|
|
|
344
|
+ * Boolean属性,选择列表
|
|
|
345
|
+ */
|
|
|
346
|
+ booleanList: [
|
|
|
347
|
+ {
|
|
|
348
|
+ value: true,
|
|
|
349
|
+ label: '是'
|
|
|
350
|
+ },
|
|
|
351
|
+ {
|
|
|
352
|
+ value: false,
|
|
|
353
|
+ label: '否'
|
|
|
354
|
+ },
|
|
|
355
|
+ ],
|
|
|
356
|
+ }
|
|
|
357
|
+ },
|
|
|
358
|
+ methods: {
|
|
|
359
|
+ /**
|
|
|
360
|
+ * 从user获取选择的用户信息
|
|
|
361
|
+ */
|
|
|
362
|
+ getUserInfo:function(userListInfo){
|
|
|
363
|
+ let userList = [];
|
|
|
364
|
+ userList = userListInfo;
|
|
|
365
|
+ if (userList.length>0){
|
|
|
366
|
+ let user = userList.pop();
|
|
|
367
|
+ this.queue_addForm.username = user.username;
|
|
|
368
|
+ this.queue_addForm.queueName = user.username;
|
|
|
369
|
+ this.queue_addForm.userId = user.userId;
|
|
|
370
|
+ this.queue_addForm.consumerGroupName = user.username+"Group";
|
|
|
371
|
+ }
|
|
|
372
|
+ },
|
|
|
373
|
+ /**
|
|
|
374
|
+ * 分页查询,监听 pageSize 改变的事件
|
|
|
375
|
+ */
|
|
|
376
|
+ queue_handleSizeChange(newSize) {
|
|
|
377
|
+ this.queue_queryInfo.pageSize = newSize;
|
|
|
378
|
+ //刷新列表
|
|
|
379
|
+ this.queue_getList();
|
|
|
380
|
+ },
|
|
|
381
|
+ /**
|
|
|
382
|
+ * 分页查询,监听 pageNum 改变的事件
|
|
|
383
|
+ */
|
|
|
384
|
+ queue_handleCurrentChange(newPage) {
|
|
|
385
|
+ this.queue_queryInfo.pageNum = newPage;
|
|
|
386
|
+ //刷新列表
|
|
|
387
|
+ this.queue_getList();
|
|
|
388
|
+ },
|
|
|
389
|
+ queue_getListSub(){
|
|
|
390
|
+ this.queue_queryInfo.pageNum= 1;
|
|
|
391
|
+ this.queue_getList();
|
|
|
392
|
+ },
|
|
|
393
|
+ /**
|
|
|
394
|
+ * queue,分页查询
|
|
|
395
|
+ */
|
|
|
396
|
+ queue_getList() {
|
|
|
397
|
+ // 开启加载
|
|
|
398
|
+ this.queue_loading.listLoading = true;
|
|
|
399
|
+ api_getReceiverFileter(this.queue_queryInfo).then((response) => {
|
|
|
400
|
+ let res = response.data;
|
|
|
401
|
+ if (res.code !== '200') {
|
|
|
402
|
+ // 关闭加载
|
|
|
403
|
+ this.queue_loading.listLoading = false;
|
|
|
404
|
+ return this.$message.error(res.msg);
|
|
|
405
|
+ }
|
|
|
406
|
+ // 获取列表数据
|
|
|
407
|
+ this.queue_page.queueList = res.data.list;
|
|
|
408
|
+ // 获取列表的总记录数
|
|
|
409
|
+ this.queue_page.total = res.data.total;
|
|
|
410
|
+ // 关闭加载
|
|
|
411
|
+ this.queue_loading.listLoading = false;
|
|
|
412
|
+ this.$message.success(res.msg);
|
|
|
413
|
+ }).catch(error => {
|
|
|
414
|
+ // 关闭加载
|
|
|
415
|
+ this.queue_loading.listLoading = false;
|
|
|
416
|
+ this.$message.error(error.toString());
|
|
|
417
|
+ });
|
|
|
418
|
+ },
|
|
|
419
|
+ /**
|
|
|
420
|
+ * queue,添加对话框,打开事件
|
|
|
421
|
+ */
|
|
|
422
|
+ queue_toAddDialog() {
|
|
|
423
|
+ this.queue_addForm = {
|
|
|
424
|
+ // 队列名称
|
|
|
425
|
+ queueName: '',
|
|
|
426
|
+ consumerGroupName: '',
|
|
|
427
|
+ partitionCount: 3,
|
|
|
428
|
+ queueType: 1,
|
|
|
429
|
+ // 用户名称
|
|
|
430
|
+ username: '',
|
|
|
431
|
+ // 用户id(该字段抛弃)
|
|
|
432
|
+ userId: '',
|
|
|
433
|
+ // 所属虚拟机id
|
|
|
434
|
+ virtualHostId: '',
|
|
|
435
|
+ // 是否持久化,默认 true
|
|
|
436
|
+ durability: '',
|
|
|
437
|
+ // 是否自动删除,默认 false
|
|
|
438
|
+ autoDelete: '',
|
|
|
439
|
+ // 扩展参数,以JSON格式存储
|
|
|
440
|
+ arguments: '',
|
|
|
441
|
+ // 相关描述
|
|
|
442
|
+ description: '',
|
|
|
443
|
+ };
|
|
|
444
|
+ this.dialogStatus= 'create';
|
|
|
445
|
+ this.queue_dialog.addDialog = true;
|
|
|
446
|
+ },
|
|
|
447
|
+ /**
|
|
|
448
|
+ * queue,添加对话框,关闭事件
|
|
|
449
|
+ */
|
|
|
450
|
+ queue_addDialogClosed() {
|
|
|
451
|
+ // 重置对话框
|
|
|
452
|
+ this.$refs.queue_addFormRef.resetFields();
|
|
|
453
|
+ },
|
|
|
454
|
+ /**
|
|
|
455
|
+ * queue,添加功能
|
|
|
456
|
+ */
|
|
|
457
|
+ queue_add() {
|
|
|
458
|
+ // 进行表单的预验证
|
|
|
459
|
+ this.$refs.queue_addFormRef.validate(valid => {
|
|
|
460
|
+ // 未通过,表单预校验
|
|
|
461
|
+ if (!valid) return;
|
|
|
462
|
+ // 通过,表单预检验,开启加载
|
|
|
463
|
+ this.queue_loading.addLoading = true;
|
|
|
464
|
+ insertBusQueue(this.queue_addForm).then((response) => {
|
|
|
465
|
+ let res = response.data;
|
|
|
466
|
+ // 添加失败
|
|
|
467
|
+ if (res.code !== '200') {
|
|
|
468
|
+ // 关闭加载
|
|
|
469
|
+ this.queue_loading.addLoading = false;
|
|
|
470
|
+ return this.$message.error(res.msg);
|
|
|
471
|
+ }
|
|
|
472
|
+ // 添加,成功
|
|
|
473
|
+ this.$message.success(res.msg);
|
|
|
474
|
+ // 关闭加载
|
|
|
475
|
+ this.queue_loading.addLoading = false;
|
|
|
476
|
+ // 隐藏对话框
|
|
|
477
|
+ this.queue_dialog.addDialog = false;
|
|
|
478
|
+ // 刷新列表
|
|
|
479
|
+ this.queue_getList();
|
|
|
480
|
+ }).catch(error => {
|
|
|
481
|
+ // 关闭加载
|
|
|
482
|
+ this.queue_loading.addLoading = false;
|
|
|
483
|
+ this.$message.error(error.toString());
|
|
|
484
|
+ });
|
|
|
485
|
+ })
|
|
|
486
|
+ },
|
|
|
487
|
+ /**
|
|
|
488
|
+ * queue,编辑对话框,打开事件
|
|
|
489
|
+ */
|
|
|
490
|
+ queue_toEditDialog(index, row) {
|
|
|
491
|
+ this.queue_addForm = Object.assign({}, row);
|
|
|
492
|
+ this.queue_dialog.addDialog = true;
|
|
|
493
|
+ this.dialogStatus= 'update';
|
|
|
494
|
+ },
|
|
|
495
|
+ /**
|
|
|
496
|
+ * queue,编辑对话框,关闭事件
|
|
|
497
|
+ */
|
|
|
498
|
+ queue_editDialogClosed() {
|
|
|
499
|
+ //重置对话框
|
|
|
500
|
+ this.$refs.queue_editFormRef.resetFields();
|
|
|
501
|
+ },
|
|
|
502
|
+ /**
|
|
|
503
|
+ * queue,编辑功能
|
|
|
504
|
+ */
|
|
|
505
|
+ queue_edit() {
|
|
|
506
|
+ //进行表单的预验证
|
|
|
507
|
+ this.$refs.queue_addFormRef.validate(valid => {
|
|
|
508
|
+ // 未通过,表单预校验
|
|
|
509
|
+ if (!valid) return;
|
|
|
510
|
+ // 通过,表单预检验,开启加载
|
|
|
511
|
+ this.queue_loading.editLoading = true;
|
|
|
512
|
+ updateBusQueue(this.queue_addForm).then((response) => {
|
|
|
513
|
+ let res = response.data;
|
|
|
514
|
+ if (res.code !== '200') {
|
|
|
515
|
+ //关闭加载
|
|
|
516
|
+ this.queue_loading.addLoading = false;
|
|
|
517
|
+ return this.$message.error(res.msg);
|
|
|
518
|
+ }
|
|
|
519
|
+ // 关闭加载
|
|
|
520
|
+ this.queue_loading.addLoading = false;
|
|
|
521
|
+ this.$message.success(res.msg);
|
|
|
522
|
+ // 隐藏对话框
|
|
|
523
|
+ this.queue_dialog.addDialog = false;
|
|
|
524
|
+ // 刷新列表
|
|
|
525
|
+ this.queue_getList();
|
|
|
526
|
+ }).catch(error => {
|
|
|
527
|
+ // 关闭加载
|
|
|
528
|
+ this.queue_loading.addLoading = false;
|
|
|
529
|
+ this.$message.error(error.toString());
|
|
|
530
|
+ });
|
|
|
531
|
+ })
|
|
|
532
|
+ },
|
|
|
533
|
+ /**
|
|
|
534
|
+ * queue,删除功能
|
|
|
535
|
+ */
|
|
|
536
|
+ queue_remove(index, row) {
|
|
|
537
|
+ // 弹框询问是否删除?
|
|
|
538
|
+ this.$confirm('此操作永久删除该队列信息, 是否继续?', '警告', {
|
|
|
539
|
+ confirmButtonText: '确定删除',
|
|
|
540
|
+ cancelButtonText: '取消',
|
|
|
541
|
+ type: 'warning'
|
|
|
542
|
+ }
|
|
|
543
|
+ ).then(() => {
|
|
|
544
|
+ // 开启加载
|
|
|
545
|
+ this.queue_loading.delLoading = true;
|
|
|
546
|
+ deleteBusQueue(row).then((response) => {
|
|
|
547
|
+ let res = response.data;
|
|
|
548
|
+ if (res.code !== '200') {
|
|
|
549
|
+ // 关闭加载
|
|
|
550
|
+ this.queue_loading.delLoading = false;
|
|
|
551
|
+ return this.$message.error(res.msg);
|
|
|
552
|
+ }
|
|
|
553
|
+ // 关闭加载
|
|
|
554
|
+ this.queue_loading.delLoading = false;
|
|
|
555
|
+ this.$message.success(res.msg);
|
|
|
556
|
+ // 刷新列表
|
|
|
557
|
+ this.queue_getList();
|
|
|
558
|
+ }).catch(error => {
|
|
|
559
|
+ // 关闭加载
|
|
|
560
|
+ this.queue_loading.delLoading = false;
|
|
|
561
|
+ this.$message.error(error.toString());
|
|
|
562
|
+ });
|
|
|
563
|
+ }).catch(() => {
|
|
|
564
|
+ });
|
|
|
565
|
+ },
|
|
|
566
|
+ /**
|
|
|
567
|
+ * queue,批量删除---选中
|
|
|
568
|
+ */
|
|
|
569
|
+ queue_selectChange: function (selectList) {
|
|
|
570
|
+ this.$emit("getQueueListEvent",selectList);
|
|
|
571
|
+ this.queue_page.selectList = selectList;
|
|
|
572
|
+ },
|
|
|
573
|
+ /**
|
|
|
574
|
+ * queue,批量删除功能
|
|
|
575
|
+ */
|
|
|
576
|
+ queue_batchRemove() {
|
|
|
577
|
+ const ids = this.queue_page.selectList.map(item => item.id).toString();
|
|
|
578
|
+ this.$confirm('此操作将永久删除选中的队列信息, 是否继续?', '警告', {
|
|
|
579
|
+ confirmButtonText: '确定删除',
|
|
|
580
|
+ cancelButtonText: '取消',
|
|
|
581
|
+ type: 'warning'
|
|
|
582
|
+ }
|
|
|
583
|
+ ).then(() => {
|
|
|
584
|
+ // 开启加载
|
|
|
585
|
+ this.queue_loading.listLoading = true;
|
|
|
586
|
+ let params = {ids: ids};
|
|
|
587
|
+ batchRemoveBusQueue(params).then(response => {
|
|
|
588
|
+ let res = response.data;
|
|
|
589
|
+ if (res.code !== '200') {
|
|
|
590
|
+ // 关闭加载
|
|
|
591
|
+ this.queue_loading.listLoading = false;
|
|
|
592
|
+ return this.$message.error(res.msg);
|
|
|
593
|
+ }
|
|
|
594
|
+ this.$message.success(res.msg);
|
|
|
595
|
+ // 关闭加载
|
|
|
596
|
+ this.queue_loading.listLoading = false;
|
|
|
597
|
+ // 刷新列表
|
|
|
598
|
+ this.queue_getList();
|
|
|
599
|
+ }).catch(error => {
|
|
|
600
|
+ // 关闭加载
|
|
|
601
|
+ this.queue_loading.listLoading = false;
|
|
|
602
|
+ this.$message.error(error.toString());
|
|
|
603
|
+ });
|
|
|
604
|
+ }).catch(() => {
|
|
|
605
|
+ });
|
|
|
606
|
+ },
|
|
|
607
|
+ /**
|
|
|
608
|
+ * 服务器与虚拟主机 1:n
|
|
|
609
|
+ * 获取列表
|
|
|
610
|
+ */
|
|
|
611
|
+ selectServerAndHostList() {
|
|
|
612
|
+ getServerAndHostList().then((response) => {
|
|
|
613
|
+ let res = response.data;
|
|
|
614
|
+ if (res.code !== '200') {
|
|
|
615
|
+ return this.$message.error(res.msg);
|
|
|
616
|
+ }
|
|
|
617
|
+ // 获取列表数据
|
|
|
618
|
+ this.queue_config.cascade.server_hostList = res.data;
|
|
|
619
|
+ // this.$message.success('获取虚拟主机列表,成功!');
|
|
|
620
|
+ }).catch(error => {
|
|
|
621
|
+ this.$message.error(error.toString());
|
|
|
622
|
+ });
|
|
|
623
|
+ },
|
|
|
624
|
+ /**
|
|
|
625
|
+ * 查询,级联。值改变激发的方法
|
|
|
626
|
+ * @param value 改变后的值
|
|
|
627
|
+ */
|
|
|
628
|
+ cascadeQueryChange(value) {
|
|
|
629
|
+ let ids = value.join().split(",");
|
|
|
630
|
+ this.queue_queryInfo.virtualHostId = ids[ids.length - 1];
|
|
|
631
|
+ },
|
|
|
632
|
+ /**
|
|
|
633
|
+ * 添加,级联。值改变激发的方法
|
|
|
634
|
+ * @param value 改变后的值
|
|
|
635
|
+ */
|
|
|
636
|
+ cascadeAddChange(value) {
|
|
|
637
|
+ let ids = value.join().split(",");
|
|
|
638
|
+ this.queue_addForm.virtualHostId = ids[ids.length - 1];
|
|
|
639
|
+ },
|
|
|
640
|
+ /**
|
|
|
641
|
+ * 编辑,级联。值改变激发的方法
|
|
|
642
|
+ * @param value 改变后的值
|
|
|
643
|
+ */
|
|
|
644
|
+ cascadeEditChange(value) {
|
|
|
645
|
+ let ids = value.join().split(",");
|
|
|
646
|
+ this.queue_editForm.virtualHostId = ids[ids.length - 1];
|
|
|
647
|
+ },
|
|
|
648
|
+ /**
|
|
|
649
|
+ * 获取所有用户的信息
|
|
|
650
|
+ */
|
|
|
651
|
+ queue_getUserInfoList() {
|
|
|
652
|
+ getUserInfoList().then((response) => {
|
|
|
653
|
+ let res = response.data;
|
|
|
654
|
+ if (res.code !== '200') {
|
|
|
655
|
+ return this.$message.error(res.msg);
|
|
|
656
|
+ }
|
|
|
657
|
+ // 获取列表数据
|
|
|
658
|
+ this.queue_config.userInfoList = res.data;
|
|
|
659
|
+ }).catch(error => {
|
|
|
660
|
+ this.$message.error(error.toString());
|
|
|
661
|
+ });
|
|
|
662
|
+ },
|
|
|
663
|
+ },
|
|
|
664
|
+ created() {
|
|
|
665
|
+ if (this.$route.params.virtualHost_scopeRow !== undefined) {
|
|
|
666
|
+ // 参数,虚拟主机id
|
|
|
667
|
+ this.queue_queryInfo.virtualHostId = this.$route.params.virtualHost_scopeRow.id;
|
|
|
668
|
+ // 刷新列表
|
|
|
669
|
+ this.queue_getList();
|
|
|
670
|
+ } else {
|
|
|
671
|
+ // 刷新列表
|
|
|
672
|
+ // this.queue_getList();
|
|
|
673
|
+ }
|
|
|
674
|
+ },
|
|
|
675
|
+ mounted() {
|
|
|
676
|
+ this.selectServerAndHostList();
|
|
|
677
|
+ this.queue_getUserInfoList();
|
|
|
678
|
+ },
|
|
|
679
|
+ computed: {},
|
|
|
680
|
+ }
|
|
|
681
|
+</script>
|
|
|
682
|
+
|
|
|
683
|
+<style scoped>
|
|
|
684
|
+
|
|
|
685
|
+</style> |