|
|
|
1
|
+<template>
|
|
|
|
2
|
+ <el-container>
|
|
|
|
3
|
+ <el-main>
|
|
|
|
4
|
+ <el-card style="background-color: #F5F7FA">
|
|
|
|
5
|
+ <!-- 搜素区域 -->
|
|
|
|
6
|
+ <el-row>
|
|
|
|
7
|
+ <el-col :span="6">
|
|
|
|
8
|
+ <el-input v-model="umb_queryInfo.sndr"
|
|
|
|
9
|
+ size="medium"
|
|
|
|
10
|
+ placeholder="帐户名称" clearable>
|
|
|
|
11
|
+ <template slot="prepend" ><i class="el-icon-user"></i>帐户名称</template>
|
|
|
|
12
|
+ </el-input>
|
|
|
|
13
|
+ </el-col>
|
|
|
|
14
|
+ <el-col :span="6">
|
|
|
|
15
|
+ <el-input v-model="umb_queryInfo.btype"
|
|
|
|
16
|
+ size="medium"
|
|
|
|
17
|
+ placeholder="消息大类" clearable>
|
|
|
|
18
|
+ <template slot="prepend"><i class="el-icon-s-platform"></i>消息大类</template>
|
|
|
|
19
|
+ </el-input>
|
|
|
|
20
|
+ </el-col>
|
|
|
|
21
|
+ <el-col :span="6">
|
|
|
|
22
|
+ <el-input v-model="umb_queryInfo.stype"
|
|
|
|
23
|
+ size="medium"
|
|
|
|
24
|
+ placeholder="消息子类" clearable>
|
|
|
|
25
|
+ <template slot="prepend"><i class="el-icon-s-operation"></i>消息子类</template>
|
|
|
|
26
|
+ </el-input>
|
|
|
|
27
|
+ </el-col>
|
|
|
|
28
|
+ <el-col :span="6">
|
|
|
|
29
|
+ <el-button type="warning" size="medium" icon="el-icon-search" @click="queryRouterList">
|
|
|
|
30
|
+ 查询
|
|
|
|
31
|
+ </el-button>
|
|
|
|
32
|
+ <el-button type="primary" size="medium" icon="el-icon-plus" @click="dialogFormVisible = true">
|
|
|
|
33
|
+ 添加
|
|
|
|
34
|
+ </el-button>
|
|
|
|
35
|
+ </el-col>
|
|
|
|
36
|
+ </el-row>
|
|
|
|
37
|
+ <el-row>
|
|
|
|
38
|
+ <el-table
|
|
|
|
39
|
+ :data="umb_queryData.tableData"
|
|
|
|
40
|
+ border
|
|
|
|
41
|
+ :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}"
|
|
|
|
42
|
+ style="width: 100%">
|
|
|
|
43
|
+ <el-table-column
|
|
|
|
44
|
+ prop="sndr"
|
|
|
|
45
|
+ label="帐户名称"
|
|
|
|
46
|
+ >
|
|
|
|
47
|
+ </el-table-column>
|
|
|
|
48
|
+ <el-table-column
|
|
|
|
49
|
+ prop="btype"
|
|
|
|
50
|
+ label="消息大类"
|
|
|
|
51
|
+ >
|
|
|
|
52
|
+ </el-table-column>
|
|
|
|
53
|
+ <el-table-column
|
|
|
|
54
|
+ prop="stype"
|
|
|
|
55
|
+ label="消息子类"
|
|
|
|
56
|
+ >
|
|
|
|
57
|
+ </el-table-column>
|
|
|
|
58
|
+ <el-table-column
|
|
|
|
59
|
+ prop="rcvr_topic"
|
|
|
|
60
|
+ label="订阅主题"
|
|
|
|
61
|
+ >
|
|
|
|
62
|
+ <template slot-scope="scope">
|
|
|
|
63
|
+ <div v-for="reciver in scope.row.rcvrList">
|
|
|
|
64
|
+ {{reciver.rcvrTopic}}<!--,{{reciver.filterList.filter}}-->
|
|
|
|
65
|
+ <!-- <div v-for="filters in reciver.filterList">{{filters.filter}}</div>-->
|
|
|
|
66
|
+ </div>
|
|
|
|
67
|
+ </template>
|
|
|
|
68
|
+ </el-table-column>
|
|
|
|
69
|
+ <el-table-column
|
|
|
|
70
|
+ prop="filter"
|
|
|
|
71
|
+ label="过滤规则"
|
|
|
|
72
|
+ >
|
|
|
|
73
|
+ <template slot-scope="scope">
|
|
|
|
74
|
+ <div v-for="reciver in scope.row.rcvrList">
|
|
|
|
75
|
+ <!-- {{reciver.rcvrTopic}},{{reciver.filterList.filter}}-->
|
|
|
|
76
|
+ <div v-for="filters in reciver.filterList">{{reciver.rcvrTopic}}:[{{filters.filter}}]</div>
|
|
|
|
77
|
+ </div>
|
|
|
|
78
|
+ </template>
|
|
|
|
79
|
+ </el-table-column>
|
|
|
|
80
|
+ <el-table-column label="操作" width="145px" align="center" fixed="right">
|
|
|
|
81
|
+ <template slot-scope="scope">
|
|
|
|
82
|
+ <el-button type="danger" size="mini" @click="delRouter(scope.$index,scope.row)">删除</el-button>
|
|
|
|
83
|
+ </template>
|
|
|
|
84
|
+ </el-table-column>
|
|
|
|
85
|
+ </el-table>
|
|
|
|
86
|
+ </el-row>
|
|
|
|
87
|
+ <el-row>
|
|
|
|
88
|
+ <div class="block">
|
|
|
|
89
|
+ <el-pagination
|
|
|
|
90
|
+ @size-change="handleSizeChange"
|
|
|
|
91
|
+ @current-change="handleCurrentChange"
|
|
|
|
92
|
+ :current-page="umb_queryInfo.pageNum"
|
|
|
|
93
|
+ :page-sizes="[100, 200, 300, 400]"
|
|
|
|
94
|
+ :page-size="umb_queryInfo.pageSize"
|
|
|
|
95
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
96
|
+ :total="umb_queryData.total">
|
|
|
|
97
|
+ </el-pagination>
|
|
|
|
98
|
+ </div>
|
|
|
|
99
|
+ </el-row>
|
|
|
|
100
|
+ <el-row>
|
|
|
|
101
|
+ <el-dialog title="路由消息添加" :visible.sync="dialogFormVisible">
|
|
|
|
102
|
+ <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="100px" class="demo-ruleForm">
|
|
|
|
103
|
+ <el-form-item label="账户名称" prop="sndr">
|
|
|
|
104
|
+ <el-input v-model="ruleForm.sndr"></el-input>
|
|
|
|
105
|
+ </el-form-item>
|
|
|
|
106
|
+ <el-form-item label="消息大类" prop="btype">
|
|
|
|
107
|
+ <el-input v-model="ruleForm.btype"></el-input>
|
|
|
|
108
|
+ </el-form-item>
|
|
|
|
109
|
+ <el-form-item label="消息子类" prop="stype">
|
|
|
|
110
|
+ <el-input v-model="ruleForm.stype"></el-input>
|
|
|
|
111
|
+ </el-form-item>
|
|
|
|
112
|
+ <el-form-item label="订阅主题">
|
|
|
|
113
|
+ <el-input v-model="ruleForm.reciver.rcvrTopic"></el-input>
|
|
|
|
114
|
+ </el-form-item>
|
|
|
|
115
|
+ <el-form-item label="过滤规则">
|
|
|
|
116
|
+ <el-input v-model="ruleForm.reciver.reciverFilter.filter"></el-input>
|
|
|
|
117
|
+ </el-form-item>
|
|
|
|
118
|
+ </el-form>
|
|
|
|
119
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
120
|
+ <el-button @click="dialogFormVisible = false">取 消</el-button>
|
|
|
|
121
|
+ <el-button type="primary" @click="submitForm('ruleForm')">确 定</el-button>
|
|
|
|
122
|
+ </div>
|
|
|
|
123
|
+ </el-dialog>
|
|
|
|
124
|
+ </el-row>
|
|
|
|
125
|
+ </el-card>
|
|
|
|
126
|
+ </el-main>
|
|
|
|
127
|
+ </el-container>
|
|
|
|
128
|
+</template>
|
|
|
|
129
|
+<script>
|
|
|
|
130
|
+ import {queRouter, deleteRouter, addRouter} from "../../api/message_bus";
|
|
|
|
131
|
+ export default {
|
|
|
|
132
|
+ data(){
|
|
|
|
133
|
+ return{
|
|
|
|
134
|
+ dialogFormVisible:false,
|
|
|
|
135
|
+ ruleForm:{
|
|
|
|
136
|
+ sndr:undefined,
|
|
|
|
137
|
+ btype:undefined,
|
|
|
|
138
|
+ stype:undefined,
|
|
|
|
139
|
+ reciver:{
|
|
|
|
140
|
+ rcvrTopic:undefined,
|
|
|
|
141
|
+ reciverFilter:{
|
|
|
|
142
|
+ filter:undefined
|
|
|
|
143
|
+ }
|
|
|
|
144
|
+ },
|
|
|
|
145
|
+
|
|
|
|
146
|
+
|
|
|
|
147
|
+ },
|
|
|
|
148
|
+ rules: {
|
|
|
|
149
|
+ sndr: [
|
|
|
|
150
|
+ { required: true, message: '请输入账户名称', trigger: 'blur' },
|
|
|
|
151
|
+ { min: 3, max: 10, message: '长度在 3 到 10 个字符', trigger: 'blur' }
|
|
|
|
152
|
+ ],
|
|
|
|
153
|
+ btype: [
|
|
|
|
154
|
+ { required: true, message: '请输入消息大类', trigger: 'blur' }
|
|
|
|
155
|
+ ],
|
|
|
|
156
|
+ stype: [
|
|
|
|
157
|
+ { required: true, message: '请输入消息子类', trigger: 'blur' }
|
|
|
|
158
|
+ ]
|
|
|
|
159
|
+ },
|
|
|
|
160
|
+ user_cloud: {
|
|
|
|
161
|
+ cloudUserList: [],
|
|
|
|
162
|
+ queryInfo: {
|
|
|
|
163
|
+ pageNum: 1,
|
|
|
|
164
|
+ pageSize: 10000,
|
|
|
|
165
|
+ }
|
|
|
|
166
|
+ },
|
|
|
|
167
|
+ umb_queryInfo: {
|
|
|
|
168
|
+ // 用户名称
|
|
|
|
169
|
+ sndr: undefined,
|
|
|
|
170
|
+ // 消息大类
|
|
|
|
171
|
+ btype: undefined,
|
|
|
|
172
|
+ // 消息子类
|
|
|
|
173
|
+ stype: undefined,
|
|
|
|
174
|
+ // 当前页数
|
|
|
|
175
|
+ pageNum: 1,
|
|
|
|
176
|
+ // 每页条数
|
|
|
|
177
|
+ pageSize: 10
|
|
|
|
178
|
+
|
|
|
|
179
|
+ },
|
|
|
|
180
|
+ umb_queryData: {
|
|
|
|
181
|
+ tableData: [],
|
|
|
|
182
|
+ total:0
|
|
|
|
183
|
+ }
|
|
|
|
184
|
+
|
|
|
|
185
|
+ }
|
|
|
|
186
|
+ },
|
|
|
|
187
|
+ methods: {
|
|
|
|
188
|
+ handleSizeChange(val) {
|
|
|
|
189
|
+ this.umb_queryInfo.pageSize=val;
|
|
|
|
190
|
+ this.queryRouterList();
|
|
|
|
191
|
+ },
|
|
|
|
192
|
+ handleCurrentChange(val) {
|
|
|
|
193
|
+ this.umb_queryInfo.pageNum=val;
|
|
|
|
194
|
+ this.queryRouterList();
|
|
|
|
195
|
+ },
|
|
|
|
196
|
+ queryRouterList(){
|
|
|
|
197
|
+ queRouter(this.umb_queryInfo).then((response) => {
|
|
|
|
198
|
+ let res = response.data;
|
|
|
|
199
|
+ this.umb_queryData.tableData=res.data.list;
|
|
|
|
200
|
+ this.umb_queryData.total=res.data.total;
|
|
|
|
201
|
+ }).catch(error => {
|
|
|
|
202
|
+
|
|
|
|
203
|
+ });
|
|
|
|
204
|
+ },
|
|
|
|
205
|
+ delRouter(index,row){
|
|
|
|
206
|
+ // 弹框询问是否删除?
|
|
|
|
207
|
+ this.$confirm('此操作永久删除该消息收发记录, 是否继续?', '警告', {
|
|
|
|
208
|
+ confirmButtonText: '确定删除',
|
|
|
|
209
|
+ cancelButtonText: '取消',
|
|
|
|
210
|
+ type: 'warning'
|
|
|
|
211
|
+ }
|
|
|
|
212
|
+ ).then(() => {
|
|
|
|
213
|
+ deleteRouter({id:row.id}).then((response) => {
|
|
|
|
214
|
+ let res = response.data;
|
|
|
|
215
|
+ this.$message.success(res.msg);
|
|
|
|
216
|
+ this.queryRouterList();
|
|
|
|
217
|
+ }).catch(error => {
|
|
|
|
218
|
+ this.$message.error(res.msg);
|
|
|
|
219
|
+ });
|
|
|
|
220
|
+ }).catch(() => {
|
|
|
|
221
|
+ });
|
|
|
|
222
|
+ },
|
|
|
|
223
|
+ submitForm(formName){
|
|
|
|
224
|
+ this.$refs[formName].validate((valid) => {
|
|
|
|
225
|
+ if (valid) {
|
|
|
|
226
|
+ addRouter(this.ruleForm).then((response) => {
|
|
|
|
227
|
+ let res = response.data;
|
|
|
|
228
|
+ this.dialogFormVisible=false;
|
|
|
|
229
|
+ this.$message.success(res.msg);
|
|
|
|
230
|
+ this.queryRouterList();
|
|
|
|
231
|
+ }).catch(error => {
|
|
|
|
232
|
+ this.$message.error(res.msg);
|
|
|
|
233
|
+ });
|
|
|
|
234
|
+ } else {
|
|
|
|
235
|
+ console.log('error submit!!');
|
|
|
|
236
|
+ return false;
|
|
|
|
237
|
+ }
|
|
|
|
238
|
+ });
|
|
|
|
239
|
+ }
|
|
|
|
240
|
+ }
|
|
|
|
241
|
+ }
|
|
|
|
242
|
+</script> |