作者 朱兆平

kafka操作

  1 +/* 此文件未使用,只是为了让idea可以识别实际位置 */
  2 +const path = require('path');
  3 +
  4 +function resolve(dir) {
  5 + return path.join(__dirname, dir);
  6 +}
  7 +
  8 +module.exports = {
  9 + resolve: {
  10 + alias: {
  11 + '@': resolve('src')
  12 + }
  13 + }
  14 +};
@@ -6471,7 +6471,7 @@ @@ -6471,7 +6471,7 @@
6471 }, 6471 },
6472 "normalize-wheel": { 6472 "normalize-wheel": {
6473 "version": "1.0.1", 6473 "version": "1.0.1",
6474 - "resolved": "https://registry.npm.taobao.org/normalize-wheel/download/normalize-wheel-1.0.1.tgz", 6474 + "resolved": "https://registry.npmjs.org/normalize-wheel/-/normalize-wheel-1.0.1.tgz",
6475 "integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU=" 6475 "integrity": "sha1-rsiGr/2wRQcNhWRH32Ls+GFG7EU="
6476 }, 6476 },
6477 "npm": { 6477 "npm": {
@@ -64,8 +64,10 @@ export const batchRemoveBusQueue = params =>{return http.get(`${baseUrl}/queue/b @@ -64,8 +64,10 @@ export const batchRemoveBusQueue = params =>{return http.get(`${baseUrl}/queue/b
64 64
65 65
66 66
67 -// MQ消息收发记录,分页查询列表 67 +// ES消息搜索引擎,分页查询列表
68 export const selectMessageNoteList = params =>{return http.post(`${baseUrl}/es/search/wildmsg`, params);}; 68 export const selectMessageNoteList = params =>{return http.post(`${baseUrl}/es/search/wildmsg`, params);};
  69 +// ES消息收发记录,分页查询列表
  70 +export const selectMessageSearchList = params =>{return http.post(`${baseUrl}/es/search/term`, params);};
69 // MQ消息收发记录,新增 71 // MQ消息收发记录,新增
70 export const insertMessageNote = params =>{return http.post(`${baseUrl}/note/insert`, params);}; 72 export const insertMessageNote = params =>{return http.post(`${baseUrl}/note/insert`, params);};
71 // MQ消息收发记录,编辑 73 // MQ消息收发记录,编辑
@@ -6,66 +6,86 @@ @@ -6,66 +6,86 @@
6 <div> 6 <div>
7 <el-row> 7 <el-row>
8 <el-col :span="5"> 8 <el-col :span="5">
9 - <el-input v-model="messageNote_queryInfo.username" placeholder="用户名称" 9 + <el-input v-model="ES_queryInfo.sndr" placeholder="发送者"
10 size="medium" clearable > 10 size="medium" clearable >
11 - <template slot="prepend" ><i class="el-icon-user"></i>&nbsp;用&nbsp;户&nbsp;名&nbsp;称</template> 11 + <template slot="prepend" ><i class="el-icon-user"></i>&nbsp;消息发送者</template>
12 </el-input> 12 </el-input>
13 </el-col> 13 </el-col>
14 <el-col :span="6"> 14 <el-col :span="6">
15 - <el-input v-model="messageNote_queryInfo.alias_sendContent" placeholder="发送内容" 15 + <el-input v-model="ES_queryInfo.btype" placeholder="消息大类"
16 size="medium" clearable> 16 size="medium" clearable>
17 - <template slot="prepend" ><i class="el-icon-document-checked"></i>&nbsp;发&nbsp;送&nbsp;内&nbsp;容</template> 17 + <template slot="prepend" ><i class="el-icon-document-checked"></i>&nbsp;消 息大 类 </template>
18 </el-input> 18 </el-input>
19 </el-col> 19 </el-col>
20 <el-col :span="6"> 20 <el-col :span="6">
21 - <el-input v-model="messageNote_queryInfo.serverName" placeholder="服务器名称" 21 + <el-input v-model="ES_queryInfo.stype" placeholder="消息子类"
22 size="medium" clearable> 22 size="medium" clearable>
23 - <template slot="prepend"><i class="el-icon-s-platform"></i>服务器名称</template> 23 + <template slot="prepend"><i class="el-icon-s-platform"></i>消 息子 类</template>
24 </el-input> 24 </el-input>
25 </el-col> 25 </el-col>
26 <el-col :span="6"> 26 <el-col :span="6">
27 - <el-input v-model="messageNote_queryInfo.virtualHostName" 27 + <el-input v-model="ES_queryInfo.seqn"
28 size="medium" clearable 28 size="medium" clearable
29 - placeholder="虚拟主机名称">  
30 - <template slot="prepend"><i class="el-icon-s-operation"></i>虚拟主机名称</template> 29 + placeholder="消息序号">
  30 + <template slot="prepend"><i class="el-icon-s-operation"></i>消 息序 号</template>
31 </el-input> 31 </el-input>
32 </el-col> 32 </el-col>
33 33
34 </el-row> 34 </el-row>
35 <el-row> 35 <el-row>
36 <el-col :span="5"> 36 <el-col :span="5">
37 - <el-input v-model="messageNote_queryInfo.exchangeName" placeholder="交换机名称" 37 + <el-input v-model="ES_queryInfo.rcvrsUserName" placeholder="路由接收者"
38 size="medium" clearable > 38 size="medium" clearable >
39 - <template slot="prepend"><i class="el-icon-sort"></i>交换机名称</template> 39 + <template slot="prepend"><i class="el-icon-news"></i>路由订阅者</template>
40 </el-input> 40 </el-input>
41 </el-col> 41 </el-col>
42 <el-col :span="6"> 42 <el-col :span="6">
43 - <el-input v-model="messageNote_queryInfo.routingKeyName" placeholder="路由键名称" 43 + <el-input v-model="ES_queryInfo.rcvlogUsername" placeholder="消息接收者"
44 size="medium" clearable > 44 size="medium" clearable >
45 - <template slot="prepend" ><i class="el-icon-user"></i>路由键名称</template> 45 + <template slot="prepend" ><i class="el-icon-user"></i>消息接收者</template>
46 </el-input> 46 </el-input>
47 </el-col> 47 </el-col>
48 48
49 <el-col :span="6"> 49 <el-col :span="6">
50 - <el-date-picker v-model="messageNote_queryInfo.sendTimeBegin" placeholder="时间段-开始"  
51 - type="date" value-format="yyyy-MM-dd"  
52 - size="medium" style="width: 100%"></el-date-picker> 50 + <el-date-picker v-model="ES_queryInfo.creatimeSearch"
  51 + start-placeholder="开始日期"
  52 + end-placeholder="结束日期"
  53 + type="datetimerange"
  54 + :picker-options="pickerOptions"
  55 + :default-time="['00:00:00', '23:59:59']"
  56 + size="medium"
  57 + align="right"
  58 + format = "yyyy-MM-dd HH:mm:ss"
  59 + value-format = "yyyy-MM-dd HH:mm:ss"
  60 + style="width: 100%">
  61 + </el-date-picker>
53 </el-col> 62 </el-col>
54 <el-col :span="6"> 63 <el-col :span="6">
55 - <el-date-picker v-model="messageNote_queryInfo.sendTimeEnd" placeholder="时间段-结束"  
56 - type="date" value-format="yyyy-MM-dd"  
57 - size="medium" style="width: 100%"></el-date-picker> 64 + <el-input v-model="ES_queryInfo.alias_sendContent" placeholder="消息内容"
  65 + size="medium" clearable >
  66 + <template slot="prepend"><i class="el-icon-sort"></i>消息内容</template>
  67 + </el-input>
58 </el-col> 68 </el-col>
59 </el-row> 69 </el-row>
60 <el-row> 70 <el-row>
  71 + <el-col :span="5">
  72 + <el-input v-model="ES_queryInfo.msgid" placeholder="消息id"
  73 + size="medium" clearable >
  74 + <template slot="prepend"><i class="el-icon-sort"></i>消息入库ID</template>
  75 + </el-input>
  76 + </el-col>
61 <el-col :span="15"> 77 <el-col :span="15">
62 - <el-button type="warning" style="width:150px" size="medium" icon="el-icon-search" @click="messageNote_getList"> 78 + <el-button type="warning" style="width:150px" size="medium" icon="el-icon-search" @click="searchSubmit">
63 查询消息记录 79 查询消息记录
64 </el-button> 80 </el-button>
65 - <el-button type="primary" style="width:150px" size="medium" icon="el-icon-plus"  
66 - @click="messageNote_toAddDialog">  
67 - 发送消息 81 + <el-button type="primary" style="width:150px" size="medium" icon="el-icon-refresh"
  82 + @click="resetSearch">
  83 + 重置
68 </el-button> 84 </el-button>
  85 +<!-- <el-button type="primary" style="width:150px" size="medium" icon="el-icon-plus"-->
  86 +<!-- @click="messageNote_toAddDialog">-->
  87 +<!-- 发送消息-->
  88 +<!-- </el-button>-->
69 <!-- <el-button type="warning" style="width:150px" size="medium"--> 89 <!-- <el-button type="warning" style="width:150px" size="medium"-->
70 <!-- @click="messageNote_openDeleteTime">--> 90 <!-- @click="messageNote_openDeleteTime">-->
71 <!-- 设置保留时间--> 91 <!-- 设置保留时间-->
@@ -81,39 +101,45 @@ @@ -81,39 +101,45 @@
81 element-loading-text="获取消息收发记录,拼命加载中" 101 element-loading-text="获取消息收发记录,拼命加载中"
82 :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}" 102 :header-cell-style="{background:'#6F8294',color:'#FFFFFF'}"
83 style="border-radius: 10px 10px 0px 0px;line-height: 25px;"> 103 style="border-radius: 10px 10px 0px 0px;line-height: 25px;">
84 - <el-table-column type="selection" width="55" align="center"></el-table-column>  
85 - <el-table-column type="index" align="center"></el-table-column>  
86 - <el-table-column label="用户名称" prop="username" align="center" width="120"></el-table-column>  
87 - <el-table-column label="消息发送时间" prop="alias_sendTime" align="center" width="150"> 104 + <el-table-column label="消息ID" prop="msgid" align="center" width="120"></el-table-column>
  105 + <el-table-column label="消息序号" prop="seqn" align="center" width="150"></el-table-column>
  106 + <el-table-column label="发送者" prop="sndr" align="center" width="120"></el-table-column>
  107 +<!-- <el-table-column label="发送内容" prop="msg" align="center" width="220"></el-table-column>-->
  108 + <el-table-column label="消息大类" prop="btype" align="center" width="100"></el-table-column>
  109 + <el-table-column label="消息子类" prop="stype" align="center" width="100"></el-table-column>
  110 + <el-table-column label="消息发送时间" prop="ddtm" align="center" width="150"></el-table-column>
  111 + <el-table-column label="路由接收者" prop="rcvrs" align="center" width="150">
  112 + <template slot-scope="scope">
  113 + <div v-for="reciver in scope.row.rcvrs">{{reciver.username}}</div>
  114 + </template>
88 </el-table-column> 115 </el-table-column>
89 - <el-table-column label="发送内容" prop="alias_sendContent" align="center" width="220"> 116 + <el-table-column label="消息接收者" prop="rcvlog" align="center" width="250">
  117 + <template slot-scope="scope">
  118 + <div v-for="logitem in scope.row.rcvlog">{{logitem.username}} [{{logitem.rvtm}}]</div>
  119 + </template>
90 </el-table-column> 120 </el-table-column>
91 - <el-table-column label="服务器名称" prop="serverName" align="center" width="150"></el-table-column>  
92 - <el-table-column label="虚拟主机名称" prop="virtualHostName" align="center" width="150"></el-table-column>  
93 - <el-table-column label="交换机名称" prop="exchangeName" align="center" width="150"></el-table-column>  
94 - <el-table-column label="路由键名称" prop="routingKeyName" align="center" width="150"></el-table-column>  
95 <!-- <el-table-column label="相关描述" prop="description" align="center" width="220"></el-table-column>--> 121 <!-- <el-table-column label="相关描述" prop="description" align="center" width="220"></el-table-column>-->
96 <el-table-column label="操作" width="300px" align="center" fixed="right"> 122 <el-table-column label="操作" width="300px" align="center" fixed="right">
97 <template slot-scope="scope"> 123 <template slot-scope="scope">
98 124
99 - <el-tooltip effect="dark" content="查看" placement="top-start" :enterable="false">  
100 - <el-button type="primary" icon="el-icon-view" size="mini"  
101 - @click="messageNote_toEditDialog(scope.$index,scope.row)">查看  
102 - </el-button>  
103 - </el-tooltip> 125 +<!-- <el-tooltip effect="dark" content="查看" placement="top-start" :enterable="false">-->
  126 +<!-- <el-button type="primary" icon="el-icon-view" size="mini"-->
  127 +<!-- @click="messageNote_toEditDialog(scope.$index,scope.row)">查看-->
  128 +<!-- </el-button>-->
  129 +<!-- </el-tooltip>-->
104 130
105 <el-tooltip effect="dark" content="查看发送内容" placement="top-start" :enterable="false"> 131 <el-tooltip effect="dark" content="查看发送内容" placement="top-start" :enterable="false">
106 <el-button type="success" icon="el-icon-view" size="mini" 132 <el-button type="success" icon="el-icon-view" size="mini"
107 - @click="messageNote_toViewContentDialogDialog(scope.$index,scope.row)">发送内容 133 + @click="messageNote_toViewContentDialogDialog(scope.$index,scope.row)">查看内容
108 </el-button> 134 </el-button>
109 </el-tooltip> 135 </el-tooltip>
110 <!-- 删除按钮--> 136 <!-- 删除按钮-->
111 - <el-tooltip effect="dark" content="删除" placement="top-start" :enterable="false">  
112 - <el-button type="danger" icon="el-icon-delete" size="mini"  
113 - :loading="messageNote_loading.delLoading"  
114 - @click="messageNote_remove(scope.$index,scope.row)">删除  
115 - </el-button>  
116 - </el-tooltip> 137 +<!-- <el-tooltip effect="dark" content="删除" placement="top-start" :enterable="false">-->
  138 +<!-- <el-button type="danger" icon="el-icon-delete" size="mini"-->
  139 +<!-- :loading="messageNote_loading.delLoading"-->
  140 +<!-- @click="messageNote_remove(scope.$index,scope.row)">删除-->
  141 +<!-- </el-button>-->
  142 +<!-- </el-tooltip>-->
117 </template> 143 </template>
118 </el-table-column> 144 </el-table-column>
119 </el-table> 145 </el-table>
@@ -121,21 +147,21 @@ @@ -121,21 +147,21 @@
121 <!--分页区域--> 147 <!--分页区域-->
122 <div style="margin-top: 10px"> 148 <div style="margin-top: 10px">
123 <el-row :gutter="24"> 149 <el-row :gutter="24">
124 - <el-col :span="5">  
125 - <el-button type="danger" icon="el-icon-delete"  
126 - :loading="messageNote_loading.listLoading"  
127 - :disabled="this.messageNote_page.selectList.length===0"  
128 - @click="messageNote_batchRemove">批量删除  
129 - </el-button>  
130 - </el-col>  
131 - <el-col :span="10" style="margin-top: 5px"> 150 +<!-- <el-col :span="5">-->
  151 +<!-- <el-button type="danger" icon="el-icon-delete"-->
  152 +<!-- :loading="messageNote_loading.listLoading"-->
  153 +<!-- :disabled="this.messageNote_page.selectList.length===0"-->
  154 +<!-- @click="messageNote_batchRemove">批量删除-->
  155 +<!-- </el-button>-->
  156 +<!-- </el-col>-->
  157 + <el-col :span="24" style="margin-top: 5px">
132 <el-pagination 158 <el-pagination
133 @size-change="messageNote_handleSizeChange" 159 @size-change="messageNote_handleSizeChange"
134 @current-change="messageNote_handleCurrentChange" 160 @current-change="messageNote_handleCurrentChange"
135 - :current-page="messageNote_queryInfo.pageNum" 161 + :current-page="ES_queryInfo.pageNum"
136 :page-sizes="[10,50,200,500]" 162 :page-sizes="[10,50,200,500]"
137 - :page-size="messageNote_queryInfo.pageSize"  
138 - layout=" sizes, prev, pager, next, jumper" 163 + :page-size="ES_queryInfo.pageSize"
  164 + layout="total, sizes, prev, pager, next, jumper"
139 :total="messageNote_page.total"> 165 :total="messageNote_page.total">
140 </el-pagination> 166 </el-pagination>
141 </el-col> 167 </el-col>
@@ -469,6 +495,7 @@ @@ -469,6 +495,7 @@
469 import vkbeautify from "vkbeautify"; 495 import vkbeautify from "vkbeautify";
470 import { 496 import {
471 selectMessageNoteList, 497 selectMessageNoteList,
  498 + selectMessageSearchList,
472 insertMessageNote, 499 insertMessageNote,
473 updateMessageNote, 500 updateMessageNote,
474 deleteMessageNote, 501 deleteMessageNote,
@@ -540,6 +567,36 @@ @@ -540,6 +567,36 @@
540 // 每页条数 567 // 每页条数
541 pageSize: 10 568 pageSize: 10
542 }, 569 },
  570 + /**
  571 + * ES搜索参数
  572 + */
  573 + ES_queryInfo: {
  574 + // 消息发送者
  575 + sndr: '',
  576 + // 指定消息接收者
  577 + rcvr: '',
  578 + // 大类
  579 + btype: '',
  580 + // 二级类
  581 + stype: '',
  582 + // 消息发送时间
  583 + ddtm: '',
  584 + // 消息序号
  585 + seqn: '',
  586 + // 消息ID
  587 + msgid: '',
  588 + // 路由接收者
  589 + rcvrsUserName: '',
  590 + // 消息接收者
  591 + rcvlogUsername: '',
  592 + msg:'',
  593 + alias_sendContent:'',
  594 + creatimeSearch: [],
  595 + // 当前页数
  596 + pageNum: 1,
  597 + // 每页条数
  598 + pageSize: 10
  599 + },
543 600
544 /** 601 /**
545 * messageNote,分页 602 * messageNote,分页
@@ -748,6 +805,36 @@ @@ -748,6 +805,36 @@
748 label: '否' 805 label: '否'
749 }, 806 },
750 ], 807 ],
  808 + pickerOptions: {
  809 + shortcuts: [
  810 + {
  811 + text: '最近十分钟',
  812 + onClick(picker) {
  813 + const end = new Date();
  814 + const start = new Date();
  815 + start.setTime(start.getTime() - 600*1000);
  816 + picker.$emit('pick', [start, end]);
  817 + }
  818 + },
  819 + {
  820 + text: '最近一小时',
  821 + onClick(picker) {
  822 + const end = new Date();
  823 + const start = new Date();
  824 + start.setTime(start.getTime() - 3600 * 1000 * 24);
  825 + picker.$emit('pick', [start, end]);
  826 + }
  827 + },
  828 + {
  829 + text: '最近一天',
  830 + onClick(picker) {
  831 + const end = new Date();
  832 + const start = new Date();
  833 + start.setTime(start.getTime() - 3600 * 1000 * 24);
  834 + picker.$emit('pick', [start, end]);
  835 + }
  836 + }]
  837 + }
751 } 838 }
752 }, 839 },
753 methods: { 840 methods: {
@@ -755,7 +842,7 @@ @@ -755,7 +842,7 @@
755 * 分页查询,监听 pageSize 改变的事件 842 * 分页查询,监听 pageSize 改变的事件
756 */ 843 */
757 messageNote_handleSizeChange(newSize) { 844 messageNote_handleSizeChange(newSize) {
758 - this.messageNote_queryInfo.pageSize = newSize; 845 + this.ES_queryInfo.pageSize = newSize;
759 //刷新列表 846 //刷新列表
760 this.messageNote_getList(); 847 this.messageNote_getList();
761 }, 848 },
@@ -763,17 +850,52 @@ @@ -763,17 +850,52 @@
763 * 分页查询,监听 pageNum 改变的事件 850 * 分页查询,监听 pageNum 改变的事件
764 */ 851 */
765 messageNote_handleCurrentChange(newPage) { 852 messageNote_handleCurrentChange(newPage) {
766 - this.messageNote_queryInfo.pageNum = newPage; 853 + this.ES_queryInfo.pageNum = newPage;
767 //刷新列表 854 //刷新列表
768 this.messageNote_getList(); 855 this.messageNote_getList();
769 }, 856 },
  857 + resetSearch:function(){
  858 + this.ES_queryInfo = {
  859 + // 消息发送者
  860 + sndr: '',
  861 + // 指定消息接收者
  862 + rcvr: '',
  863 + // 大类
  864 + btype: '',
  865 + // 二级类
  866 + stype: '',
  867 + // 消息发送时间
  868 + ddtm: '',
  869 + // 消息序号
  870 + seqn: '',
  871 + // 消息ID
  872 + msgid: '',
  873 + // 路由接收者
  874 + rcvrsUserName: '',
  875 + // 消息接收者
  876 + rcvlogUsername: '',
  877 + msg:'',
  878 + alias_sendContent:'',
  879 + creatimeSearch: [],
  880 + // 当前页数
  881 + pageNum: 1,
  882 + // 每页条数
  883 + pageSize: 10
  884 + }
  885 + },
  886 + searchSubmit:function () {
  887 + this.ES_queryInfo.pageNum = 1;
  888 + this.ES_queryInfo.pageSize = 10;
  889 + this.messageNote_getList();
  890 +
  891 + } ,
770 /** 892 /**
771 * messageNote,分页查询 893 * messageNote,分页查询
772 */ 894 */
773 messageNote_getList() { 895 messageNote_getList() {
774 // 开启加载 896 // 开启加载
775 this.messageNote_loading.listLoading = true; 897 this.messageNote_loading.listLoading = true;
776 - selectMessageNoteList(this.messageNote_queryInfo).then((response) => { 898 + selectMessageSearchList(this.ES_queryInfo).then((response) => {
777 let res = response.data; 899 let res = response.data;
778 if (res.code !== '200') { 900 if (res.code !== '200') {
779 // 关闭加载 901 // 关闭加载
@@ -781,9 +903,9 @@ @@ -781,9 +903,9 @@
781 return this.$message.error('获取消息收发记录,失败!'); 903 return this.$message.error('获取消息收发记录,失败!');
782 } 904 }
783 // 获取列表数据 905 // 获取列表数据
784 - this.messageNote_page.messageNoteList = res.data; 906 + this.messageNote_page.messageNoteList = res.data.content;
785 // 获取列表的总记录数 907 // 获取列表的总记录数
786 - this.messageNote_page.total = res.total; 908 + this.messageNote_page.total = res.data.totalElements;
787 // 关闭加载 909 // 关闭加载
788 this.messageNote_loading.listLoading = false; 910 this.messageNote_loading.listLoading = false;
789 this.$message.success('获取消息收发记录,成功!'); 911 this.$message.success('获取消息收发记录,成功!');
@@ -1238,6 +1360,12 @@ @@ -1238,6 +1360,12 @@
1238 // this.messageNote_getList(); 1360 // this.messageNote_getList();
1239 // 获取删除时间 1361 // 获取删除时间
1240 this.selectDeleteTime(); 1362 this.selectDeleteTime();
  1363 + let _this = this;
  1364 + document.onkeyup= e =>{
  1365 + if (e.code === "Enter" || e.code === "enter") {
  1366 + _this.searchSubmit();//调用登录 验证方法
  1367 + }
  1368 + }
1241 }, 1369 },
1242 mounted() { 1370 mounted() {
1243 this.messageNote_selectServerList(); 1371 this.messageNote_selectServerList();
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 </el-input> 11 </el-input>
12 </el-col> 12 </el-col>
13 <el-col :span="8"> 13 <el-col :span="8">
14 - <el-button type="warning" style="width:150px" size="medium" icon="el-icon-search" @click="messageNote_getList"> 14 + <el-button type="warning" style="width:150px" size="medium" icon="el-icon-search" @click="searchSubmit">
15 查询 15 查询
16 </el-button> 16 </el-button>
17 </el-col> 17 </el-col>
@@ -191,6 +191,12 @@ @@ -191,6 +191,12 @@
191 //刷新列表 191 //刷新列表
192 this.messageNote_getList(); 192 this.messageNote_getList();
193 }, 193 },
  194 + searchSubmit:function () {
  195 + this.messageNote_queryInfo.pageNum = 1;
  196 + this.messageNote_queryInfo.pageSize = 2;
  197 + this.messageNote_getList();
  198 +
  199 + } ,
194 /** 200 /**
195 * messageNote,分页查询 201 * messageNote,分页查询
196 */ 202 */
@@ -122,7 +122,7 @@ @@ -122,7 +122,7 @@
122 122
123 <!-- 增加,对话框区域 --> 123 <!-- 增加,对话框区域 -->
124 <div> 124 <div>
125 - <el-dialog title="添加队列" 125 + <el-dialog :title="dialogMap[dialogStatus]"
126 :visible.sync="queue_dialog.addDialog" 126 :visible.sync="queue_dialog.addDialog"
127 style="margin-top: -50px" text-align="center" width="60%" 127 style="margin-top: -50px" text-align="center" width="60%"
128 @close="queue_addDialogClosed"> 128 @close="queue_addDialogClosed">
@@ -130,8 +130,15 @@ @@ -130,8 +130,15 @@
130 :model="queue_addForm" :rules="queue_addFormRules" ref="queue_addFormRef" align="center"> 130 :model="queue_addForm" :rules="queue_addFormRules" ref="queue_addFormRef" align="center">
131 <el-form-item label="" prop="queueName"> 131 <el-form-item label="" prop="queueName">
132 <el-input v-model="queue_addForm.queueName" style="width:300px" size="small" clearable 132 <el-input v-model="queue_addForm.queueName" style="width:300px" size="small" clearable
133 - placeholder="请输入队列名称">  
134 - <template slot="prepend" >队列名称</template> 133 + placeholder="请输入TOPIC名称">
  134 + <template slot="prepend" >TOPIC名称</template>
  135 + </el-input>
  136 + </el-form-item>
  137 +
  138 + <el-form-item label="" prop="partitionCount">
  139 + <el-input v-model="queue_addForm.partitionCount" style="width:300px" size="small" clearable
  140 + placeholder="请输入TOPIC分区数量">
  141 + <template slot="prepend" >TOPIC分区数量</template>
135 </el-input> 142 </el-input>
136 </el-form-item> 143 </el-form-item>
137 144
@@ -142,59 +149,13 @@ @@ -142,59 +149,13 @@
142 </el-input> 149 </el-input>
143 </el-form-item> 150 </el-form-item>
144 151
145 - <!-- <el-form-item label="用户名称:" prop="userId">-->  
146 - <!-- <el-select v-model="queue_addForm.userId" clearable-->  
147 - <!-- style="width:240px" size="small" filterable-->  
148 - <!-- placeholder="请选择用户">-->  
149 - <!-- <el-option-->  
150 - <!-- v-for="item in (queue_config.userInfoList)"-->  
151 - <!-- :key="item.id"-->  
152 - <!-- :label="item.username"-->  
153 - <!-- :value="item.id">-->  
154 - <!-- </el-option>-->  
155 - <!-- </el-select>-->  
156 - <!-- </el-form-item>-->  
157 -  
158 <el-form-item label="" prop="virtualHostId"> 152 <el-form-item label="" prop="virtualHostId">
159 - <el-cascader  
160 - clearable style="width: 300px" size="small"  
161 - v-model="queue_addForm.virtualHostId"  
162 - @change="cascadeAddChange"  
163 - :options="queue_config.cascade.server_hostList"  
164 - :show-all-levels="false"  
165 - :change-on-select="false"  
166 - :props="queue_config.cascade.defaultParams"  
167 - placeholder="请选择所属虚拟主机"></el-cascader>  
168 - </el-form-item>  
169 -  
170 - <el-form-item label="" prop="durability">  
171 - <el-select v-model="queue_addForm.durability" style="width: 300px" clearable size="small"  
172 - placeholder="请选择是否持久化">  
173 - <el-option  
174 - v-for="item in booleanList"  
175 - :key="item.value"  
176 - :label="item.label"  
177 - :value="item.value">  
178 - </el-option>  
179 - </el-select>  
180 - </el-form-item>  
181 - <el-form-item label="" prop="autoDelete">  
182 - <el-select v-model="queue_addForm.autoDelete" style="width: 300px" clearable size="small"  
183 - placeholder="请选择是否自动删除">  
184 - <el-option  
185 - v-for="item in booleanList"  
186 - :key="item.value"  
187 - :label="item.label"  
188 - :value="item.value">  
189 - </el-option>  
190 - </el-select>  
191 - </el-form-item>  
192 - <el-form-item label="" prop="arguments">  
193 - <el-input v-model="queue_addForm.arguments" style="width:300px" clearable size="small"  
194 - type="textarea" autosize :rows="1"  
195 - placeholder="扩展参数(JSON格式)"> 153 + <el-input v-model="queue_addForm.consumerGroupName" style="width:300px" size="small" clearable
  154 + placeholder="请输入消费者组名称">
  155 + <template slot="prepend" >消费者组</template>
196 </el-input> 156 </el-input>
197 </el-form-item> 157 </el-form-item>
  158 +
198 <el-form-item label="" prop="description"> 159 <el-form-item label="" prop="description">
199 <el-input v-model="queue_addForm.description" style="width:300px" clearable size="small" 160 <el-input v-model="queue_addForm.description" style="width:300px" clearable size="small"
200 type="textarea" autosize :rows="1" 161 type="textarea" autosize :rows="1"
@@ -206,106 +167,13 @@ @@ -206,106 +167,13 @@
206 <el-button type="info" @click="queue_dialog.addDialog = false" size="medium" 167 <el-button type="info" @click="queue_dialog.addDialog = false" size="medium"
207 style="width: 100px;background-color: #6F8294;color: #ffffff">取消 168 style="width: 100px;background-color: #6F8294;color: #ffffff">取消
208 </el-button> 169 </el-button>
209 - <el-button type="primary" @click="queue_add" :loading="queue_loading.addLoading"  
210 - size="medium" style="width: 100px">添加  
211 - </el-button>  
212 - </div>  
213 - </el-dialog>  
214 - </div>  
215 - <!-- 编辑,对话框区域 -->  
216 - <div>  
217 - <el-dialog title="编辑队列信息"  
218 - :visible.sync="queue_dialog.editDialog"  
219 - style="margin-top: -50px" text-align="center" width="60%"  
220 - @close="queue_editDialogClosed">  
221 - <el-form :inline="true" label-width="120px" status-icon style="margin-top: -10px" align="center"  
222 - :model="queue_editForm" :rules="queue_editFormRules" ref="queue_editFormRef">  
223 - <el-form-item label="" prop="queueName">  
224 - <el-input v-model="queue_editForm.queueName" style="width:300px" size="small" clearable  
225 - disabled  
226 - placeholder="请输入队列名称">  
227 - <template slot="prepend" >队列名称</template>  
228 - </el-input>  
229 - </el-form-item>  
230 -  
231 - <el-form-item label="" prop="username">  
232 - <el-input v-model="queue_editForm.username" placeholder="请输入用户名称"  
233 - style="width:300px" size="small" clearable disabled>  
234 - <template slot="prepend" >用户名称</template>  
235 - </el-input>  
236 - </el-form-item>  
237 -  
238 - <!-- <el-form-item label="用户名称:" prop="userId">-->  
239 - <!-- <el-select v-model="queue_editForm.userId" clearable disabled-->  
240 - <!-- style="width:240px" size="small" filterable-->  
241 - <!-- placeholder="请选择用户">-->  
242 - <!-- <el-option-->  
243 - <!-- v-for="item in (queue_config.userInfoList)"-->  
244 - <!-- :key="item.id"-->  
245 - <!-- :label="item.username"-->  
246 - <!-- :value="item.id">-->  
247 - <!-- </el-option>-->  
248 - <!-- </el-select>-->  
249 - <!-- </el-form-item>-->  
250 -  
251 - <el-form-item label="" prop="virtualHostId">  
252 - <el-cascader  
253 - disabled clearable style="width: 300px" size="small"  
254 - v-model="queue_editForm.virtualHostId"  
255 - @change="cascadeEditChange"  
256 - :options="queue_config.cascade.server_hostList"  
257 - :show-all-levels="false"  
258 - :change-on-select="false"  
259 - :props="queue_config.cascade.defaultParams"  
260 - placeholder="请选择所属虚拟主机"></el-cascader>  
261 - </el-form-item>  
262 -  
263 - <el-form-item label="" prop="durability">  
264 - <el-select v-model="queue_editForm.durability" style="width: 300px" disabled clearable  
265 - size="small"  
266 - placeholder="请选择是否持久化">  
267 - <el-option  
268 - v-for="item in booleanList"  
269 - :key="item.value"  
270 - :label="item.label"  
271 - :value="item.value">  
272 - </el-option>  
273 - </el-select>  
274 - </el-form-item>  
275 - <el-form-item label="" prop="autoDelete">  
276 - <el-select v-model="queue_editForm.autoDelete" style="width: 300px" disabled clearable  
277 - size="small"  
278 - placeholder="请选择是否自动删除">  
279 - <el-option  
280 - v-for="item in booleanList"  
281 - :key="item.value"  
282 - :label="item.label"  
283 - :value="item.value">  
284 - </el-option>  
285 - </el-select>  
286 - </el-form-item>  
287 - <el-form-item label="" prop="arguments">  
288 - <el-input v-model="queue_editForm.arguments" style="width:300px" disabled clearable  
289 - size="small" type="textarea" autosize :rows="1"  
290 - placeholder="扩展参数(JSON格式)">  
291 - </el-input>  
292 - </el-form-item>  
293 - <el-form-item label="" prop="description">  
294 - <el-input v-model="queue_editForm.description" style="width:300px" clearable size="small"  
295 - type="textarea" autosize :rows="1"  
296 - placeholder="相关描述">  
297 - </el-input>  
298 - </el-form-item>  
299 - </el-form>  
300 -  
301 - <div slot="footer" class="dialog-footer" style="text-align: center">  
302 - <el-button type="info" @click="queue_dialog.editDialog = false" size="medium"  
303 - style="width: 100px;background-color: #6F8294;color: #ffffff">取消  
304 - </el-button>  
305 - <el-button type="primary" @click="queue_edit" :loading="queue_loading.addLoading"  
306 - size="medium" style="width: 100px">编辑 170 + <el-button type="primary" @click="dialogStatus==='create'?queue_add():queue_edit()" :loading="queue_loading.addLoading"
  171 + size="medium" style="width: 100px">提交
307 </el-button> 172 </el-button>
308 </div> 173 </div>
  174 + <User
  175 + v-on:getUserMessageEvent="getUserInfo">
  176 + </User>
309 </el-dialog> 177 </el-dialog>
310 </div> 178 </div>
311 </el-main> 179 </el-main>
@@ -322,11 +190,18 @@ @@ -322,11 +190,18 @@
322 getServerAndHostList, getUserInfoList, 190 getServerAndHostList, getUserInfoList,
323 } from "../../api/message_bus"; 191 } from "../../api/message_bus";
324 192
  193 + import User from "@/views/nav1/user";
  194 +
325 export default { 195 export default {
326 name: "Queue", 196 name: "Queue",
327 - 197 + components: { User },
328 data() { 198 data() {
329 return { 199 return {
  200 + dialogMap: {
  201 + update: '编辑',
  202 + create: '新增',
  203 + },
  204 + dialogStatus: 'create',
330 /** 205 /**
331 * queue,配置与参数 206 * queue,配置与参数
332 */ 207 */
@@ -376,6 +251,9 @@ @@ -376,6 +251,9 @@
376 queue_addForm: { 251 queue_addForm: {
377 // 队列名称 252 // 队列名称
378 queueName: '', 253 queueName: '',
  254 + consumerGroupName: '',
  255 + partitionCount: 3,
  256 + queueType: 1,
379 // 用户名称 257 // 用户名称
380 username: '', 258 username: '',
381 // 用户id(该字段抛弃) 259 // 用户id(该字段抛弃)
@@ -502,6 +380,18 @@ @@ -502,6 +380,18 @@
502 }, 380 },
503 methods: { 381 methods: {
504 /** 382 /**
  383 + * 从user获取选择的用户信息
  384 + */
  385 + getUserInfo:function(userListInfo){
  386 + let userList = [];
  387 + userList = userListInfo;
  388 + if (userList.length>0){
  389 + let user = userList.pop();
  390 + this.queue_addForm.username = user.username;
  391 + this.queue_addForm.queueName = user.username;
  392 + }
  393 + },
  394 + /**
505 * 分页查询,监听 pageSize 改变的事件 395 * 分页查询,监听 pageSize 改变的事件
506 */ 396 */
507 queue_handleSizeChange(newSize) { 397 queue_handleSizeChange(newSize) {
@@ -547,6 +437,7 @@ @@ -547,6 +437,7 @@
547 * queue,添加对话框,打开事件 437 * queue,添加对话框,打开事件
548 */ 438 */
549 queue_toAddDialog() { 439 queue_toAddDialog() {
  440 + this.dialogStatus= 'create';
550 this.queue_dialog.addDialog = true; 441 this.queue_dialog.addDialog = true;
551 }, 442 },
552 /** 443 /**
@@ -593,8 +484,9 @@ @@ -593,8 +484,9 @@
593 * queue,编辑对话框,打开事件 484 * queue,编辑对话框,打开事件
594 */ 485 */
595 queue_toEditDialog(index, row) { 486 queue_toEditDialog(index, row) {
596 - this.queue_editForm = Object.assign({}, row);  
597 - this.queue_dialog.editDialog = true; 487 + this.queue_addForm = Object.assign({}, row);
  488 + this.queue_dialog.addDialog = true;
  489 + this.dialogStatus= 'update';
598 }, 490 },
599 /** 491 /**
600 * queue,编辑对话框,关闭事件 492 * queue,编辑对话框,关闭事件
@@ -608,28 +500,28 @@ @@ -608,28 +500,28 @@
608 */ 500 */
609 queue_edit() { 501 queue_edit() {
610 //进行表单的预验证 502 //进行表单的预验证
611 - this.$refs.queue_editFormRef.validate(valid => { 503 + this.$refs.queue_addFormRef.validate(valid => {
612 // 未通过,表单预校验 504 // 未通过,表单预校验
613 if (!valid) return; 505 if (!valid) return;
614 // 通过,表单预检验,开启加载 506 // 通过,表单预检验,开启加载
615 this.queue_loading.editLoading = true; 507 this.queue_loading.editLoading = true;
616 - updateBusQueue(this.queue_editForm).then((response) => { 508 + updateBusQueue(this.queue_addForm).then((response) => {
617 let res = response.data; 509 let res = response.data;
618 if (res.code !== '200') { 510 if (res.code !== '200') {
619 //关闭加载 511 //关闭加载
620 - this.queue_loading.editLoading = false; 512 + this.queue_loading.addLoading = false;
621 return this.$message.error(res.msg); 513 return this.$message.error(res.msg);
622 } 514 }
623 // 关闭加载 515 // 关闭加载
624 - this.queue_loading.editLoading = false; 516 + this.queue_loading.addLoading = false;
625 this.$message.success(res.msg); 517 this.$message.success(res.msg);
626 // 隐藏对话框 518 // 隐藏对话框
627 - this.queue_dialog.editDialog = false; 519 + this.queue_dialog.addDialog = false;
628 // 刷新列表 520 // 刷新列表
629 this.queue_getList(); 521 this.queue_getList();
630 }).catch(error => { 522 }).catch(error => {
631 // 关闭加载 523 // 关闭加载
632 - this.queue_loading.editLoading = false; 524 + this.queue_loading.addLoading = false;
633 this.$message.error(error.toString()); 525 this.$message.error(error.toString());
634 }); 526 });
635 }) 527 })
@@ -212,6 +212,7 @@ @@ -212,6 +212,7 @@
212 import {getServerAndHostList, insertUserInfo} from "../../api/message_bus"; 212 import {getServerAndHostList, insertUserInfo} from "../../api/message_bus";
213 213
214 export default { 214 export default {
  215 + name:"UserList",
215 data() { 216 data() {
216 return { 217 return {
217 user_config: { 218 user_config: {
@@ -515,6 +516,8 @@ @@ -515,6 +516,8 @@
515 }); 516 });
516 }, 517 },
517 selsChange: function (sels) { 518 selsChange: function (sels) {
  519 + //传递给父组件
  520 + this.$emit("getUserMessageEvent",sels);
518 this.sels = sels; 521 this.sels = sels;
519 }, 522 },
520 //批量删除 523 //批量删除