Authored by 鲁尚清

Merge branch 'master' of http://192.168.1.136:82/monitor_v3/hg-monitor-web into …

…master-v32-lushangqing
1 <div > 1 <div >
2 <!-- 表格--> 2 <!-- 表格-->
3 - <el-table :border="showBorder" v-loading="loading" @selection-change="handleSelectionChange" :data="dataList" stripe header-row-class-name="tbl-header-class" :height="height" 3 + <el-table :border="showBorder" v-loading="loading" :size="size" @selection-change="handleSelectionChange" :data="dataList" stripe header-row-class-name="tbl-header-class" :height="height"
4 style="width: 100%;margin: 0px 0px;"> 4 style="width: 100%;margin: 0px 0px;">
5 <el-table-column v-if="showSelection && columns.length > 0" type="selection" width="55" /> 5 <el-table-column v-if="showSelection && columns.length > 0" type="selection" width="55" />
6 <el-table-column v-if="showIndex && columns.length > 0" type="index" :label="indexLabel" align="center" width="50"/> 6 <el-table-column v-if="showIndex && columns.length > 0" type="index" :label="indexLabel" align="center" width="50"/>
@@ -75,7 +75,12 @@ export default { @@ -75,7 +75,12 @@ export default {
75 showTools:{ 75 showTools:{
76 type: Boolean, 76 type: Boolean,
77 default: false 77 default: false
78 - } 78 + },
  79 + // medium / small / mini
  80 + size:{
  81 + type: String,
  82 + default: 'small'
  83 + },
79 }, 84 },
80 data() { 85 data() {
81 return {} 86 return {}
@@ -130,6 +135,9 @@ export default { @@ -130,6 +135,9 @@ export default {
130 135
131 // 每页展示多少条 136 // 每页展示多少条
132 let handleSizeChange = (val) => { 137 let handleSizeChange = (val) => {
  138 + // Start Wang 2021/12/15 23:46 切换页码重置初始页
  139 + currentPage.value = 1
  140 + // End Wang 2021/12/15 23:46 切换页码重置初始页
133 // console.log(`每页 ${val} 条`) 141 // console.log(`每页 ${val} 条`)
134 //props.pageSize = val; 142 //props.pageSize = val;
135 pageSize.value = val; 143 pageSize.value = val;
@@ -16,7 +16,8 @@ @@ -16,7 +16,8 @@
16 :showPage="false" 16 :showPage="false"
17 :showTools="showDetail" 17 :showTools="showDetail"
18 :maxWidth="width" 18 :maxWidth="width"
19 - :height="200"> 19 + size="mini"
  20 + :height="300">
20 <template #tools="{scope}"> 21 <template #tools="{scope}">
21 <el-button type="text" size="small" @click.prevent="handleClick(scope.row,scope.$index)"> 22 <el-button type="text" size="small" @click.prevent="handleClick(scope.row,scope.$index)">
22 明细 23 明细
@@ -180,7 +180,7 @@ const colTypes = (props, list,openLine,openAlarmDialog) => { @@ -180,7 +180,7 @@ const colTypes = (props, list,openLine,openAlarmDialog) => {
180 let col = [{ 180 let col = [{
181 prop: 'resName', 181 prop: 'resName',
182 label: props.itemName, 182 label: props.itemName,
183 - width: 100 183 + width: 150
184 }]; 184 }];
185 185
186 let index = 0; 186 let index = 0;
@@ -194,7 +194,7 @@ const colTypes = (props, list,openLine,openAlarmDialog) => { @@ -194,7 +194,7 @@ const colTypes = (props, list,openLine,openAlarmDialog) => {
194 let colInfo = { 194 let colInfo = {
195 prop: v.kpiId, 195 prop: v.kpiId,
196 label: v.kpiName, 196 label: v.kpiName,
197 - width: 80 197 + width: 50
198 }; 198 };
199 199
200 if (lineKpiIds.indexOf(v.kpiId) != -1) { 200 if (lineKpiIds.indexOf(v.kpiId) != -1) {
@@ -97,7 +97,7 @@ @@ -97,7 +97,7 @@
97 97
98 <el-tabs v-model="activeName" @tab-click="tabClick"> 98 <el-tabs v-model="activeName" @tab-click="tabClick">
99 <el-tab-pane label="已添加" name="first"> 99 <el-tab-pane label="已添加" name="first">
100 - <cm-table-page :columns="columns" :dataList="tabFirstList" @loaddata="loadFirstList" 100 + <cm-table-page :columns="columns" :dataList="tabFirstList" @loaddata="getPageInfoFirst"
101 :showIndex="true" :total="countFirst" 101 :showIndex="true" :total="countFirst"
102 :showBorder="true" :loading="false" 102 :showBorder="true" :loading="false"
103 :showPage="true" :showTools="true" :height="(height - 500)"> 103 :showPage="true" :showTools="true" :height="(height - 500)">
@@ -110,7 +110,7 @@ @@ -110,7 +110,7 @@
110 </cm-table-page> 110 </cm-table-page>
111 </el-tab-pane> 111 </el-tab-pane>
112 <el-tab-pane label="未添加" name="second"> 112 <el-tab-pane label="未添加" name="second">
113 - <cm-table-page :columns="columns" :dataList="tabSecondList" @loaddata="loadSecondList" 113 + <cm-table-page :columns="columns" :dataList="tabSecondList" @loaddata="getPageInfoSecond"
114 :showIndex="true" :total="count" 114 :showIndex="true" :total="count"
115 :showBorder="true" :loading="false" 115 :showBorder="true" :loading="false"
116 :showPage="true" :showTools="true" :height="(height - 500)"> 116 :showPage="true" :showTools="true" :height="(height - 500)">
@@ -188,26 +188,23 @@ export default { @@ -188,26 +188,23 @@ export default {
188 busTypeArr.value = types; 188 busTypeArr.value = types;
189 loeadTable(); 189 loeadTable();
190 } 190 }
191 -  
192 // 查询参数 191 // 查询参数
193 - let getParams = () =>{  
194 - return {  
195 - keyWords: keyWords.value,  
196 - resType: resTypeArr.value.join(','),  
197 - kpiId: kpiTypeArr.value.join(','),  
198 - busId: busTypeArr.value.join(','),  
199 - configId: config.value,  
200 - page: 1,  
201 - limit: 50  
202 - }  
203 - } 192 + let getParams = Vue.ref({
  193 + keyWords: keyWords.value,
  194 + resType: resTypeArr.value.join(','),
  195 + kpiId: kpiTypeArr.value.join(','),
  196 + busId: busTypeArr.value.join(','),
  197 + configId: config.value,
  198 + page: 1,
  199 + limit: 10
  200 + })
204 201
205 let loadFirstList = (reload) => { 202 let loadFirstList = (reload) => {
206 // if (!reload && tabFirstList.value.length > 0) { 203 // if (!reload && tabFirstList.value.length > 0) {
207 // return false; 204 // return false;
208 // } 205 // }
209 if(isSign.value){//true为编辑,false为新增 206 if(isSign.value){//true为编辑,false为新增
210 - proxy.$http.get(`/api-web/ContrastAnalysis/added`, getParams(), function (res) { 207 + proxy.$http.get(`/api-web/ContrastAnalysis/added`, getParams.value, function (res) {
211 if (res && res.success) { 208 if (res && res.success) {
212 proxy.countFirst = res.count; 209 proxy.countFirst = res.count;
213 tabFirstList.value = res.data; 210 tabFirstList.value = res.data;
@@ -220,7 +217,7 @@ export default { @@ -220,7 +217,7 @@ export default {
220 // if (!reload && tabSecondList.value.length > 0) { 217 // if (!reload && tabSecondList.value.length > 0) {
221 // return false; 218 // return false;
222 // } 219 // }
223 - proxy.$http.get(`/api-web/ContrastAnalysis/notAdded`, getParams(), function (res) { 220 + proxy.$http.get(`/api-web/ContrastAnalysis/notAdded`, getParams.value, function (res) {
224 if (res && res.success) { 221 if (res && res.success) {
225 proxy.count = res.count; 222 proxy.count = res.count;
226 tabSecondList.value = res.data; 223 tabSecondList.value = res.data;
@@ -228,6 +225,21 @@ export default { @@ -228,6 +225,21 @@ export default {
228 }); 225 });
229 } 226 }
230 227
  228 + let getPageInfoFirst = ({page, limit}) => {
  229 + getParams.value.page = page;
  230 + getParams.value.limit = limit;
  231 +
  232 + // 下一页搜索
  233 + loadFirstList();
  234 + }
  235 + let getPageInfoSecond = ({page, limit}) => {
  236 + getParams.value.page = page;
  237 + getParams.value.limit = limit;
  238 +
  239 + // 下一页搜索
  240 + loadSecondList();
  241 + }
  242 +
231 243
232 let tabClick = (tab, event) => { 244 let tabClick = (tab, event) => {
233 let name = tab.paneName; 245 let name = tab.paneName;
@@ -542,6 +554,8 @@ export default { @@ -542,6 +554,8 @@ export default {
542 deleteRes, 554 deleteRes,
543 onBtnSearch, 555 onBtnSearch,
544 onReset, 556 onReset,
  557 + getPageInfoFirst,
  558 + getPageInfoSecond,
545 559
546 getResType, 560 getResType,
547 getKpiType, 561 getKpiType,
@@ -15,33 +15,33 @@ const faultDetail = () => { @@ -15,33 +15,33 @@ const faultDetail = () => {
15 faultTypeName: '拨测', 15 faultTypeName: '拨测',
16 components: 'result-item', 16 components: 'result-item',
17 color: '#67C23A', 17 color: '#67C23A',
18 - itemName:'场景名称',  
19 - detail:false,  
20 - colType:'kpi'  
21 - },{ 18 + itemName: '场景名称',
  19 + detail: false,
  20 + colType: 'kpi'
  21 + }, {
22 faultType: 'NPM', 22 faultType: 'NPM',
23 faultTypeName: 'NPM', 23 faultTypeName: 'NPM',
24 components: 'result-item', 24 components: 'result-item',
25 color: '#E6A23C', 25 color: '#E6A23C',
26 - itemName:'链路(流名称)',  
27 - detail:false,  
28 - colType:'kpi'  
29 - },{ 26 + itemName: '链路(流名称)',
  27 + detail: false,
  28 + colType: 'kpi'
  29 + }, {
30 faultType: 'BASE', 30 faultType: 'BASE',
31 faultTypeName: '基础', 31 faultTypeName: '基础',
32 components: 'result-item', 32 components: 'result-item',
33 color: '#67C23A', 33 color: '#67C23A',
34 - itemName:'检测指标',  
35 - detail:true,  
36 - colType:'flag'  
37 - }, { 34 + itemName: '检测指标',
  35 + detail: true,
  36 + colType: 'flag'
  37 + }, {
38 faultType: 'APM', 38 faultType: 'APM',
39 faultTypeName: 'APM', 39 faultTypeName: 'APM',
40 components: 'result-item', 40 components: 'result-item',
41 color: '#F56C6C', 41 color: '#F56C6C',
42 - itemName:'检测指标',  
43 - detail:true,  
44 - colType:'flag' 42 + itemName: '检测指标',
  43 + detail: true,
  44 + colType: 'flag'
45 }/*, { 45 }/*, {
46 faultType: 'NETLINK', 46 faultType: 'NETLINK',
47 faultTypeName: '网络链路', 47 faultTypeName: '网络链路',
@@ -112,7 +112,7 @@ const handleInfo = () => { @@ -112,7 +112,7 @@ const handleInfo = () => {
112 trigger: 'change', 112 trigger: 'change',
113 }, 113 },
114 ], 114 ],
115 - solvetime: [ 115 + solveTime: [
116 { 116 {
117 type: 'date', 117 type: 'date',
118 required: true, 118 required: true,
@@ -162,11 +162,11 @@ const handleInfo = () => { @@ -162,11 +162,11 @@ const handleInfo = () => {
162 * 作者: Wang 162 * 作者: Wang
163 * 时间:2021/12/14 23:05 163 * 时间:2021/12/14 23:05
164 */ 164 */
165 - let saveHandleInfo = (key,callback) => { 165 + let saveHandleInfo = (key, callback) => {
166 proxy.$refs[key].validate((valid) => { 166 proxy.$refs[key].validate((valid) => {
167 if (valid) { 167 if (valid) {
168 - proxy.$http.post('/api-web/fault/solve',handleInfoForm.value,function (res){  
169 - if(res && res.success){ 168 + proxy.$http.post('/api-web/fault/solve', handleInfoForm.value, function (res) {
  169 + if (res && res.success) {
170 proxy.$global.showMsg("处理成功!"); 170 proxy.$global.showMsg("处理成功!");
171 showHandleInfoDialog(false); 171 showHandleInfoDialog(false);
172 } else { 172 } else {
@@ -234,42 +234,56 @@ export default { @@ -234,42 +234,56 @@ export default {
234 columns: [{ 234 columns: [{
235 prop: 'faultBody', 235 prop: 'faultBody',
236 label: '故障主体', 236 label: '故障主体',
  237 + width: 150,
237 click: function (row) { 238 click: function (row) {
238 // 展示弹框 239 // 展示弹框
239 closeFaultDetailDialog(true); 240 closeFaultDetailDialog(true);
240 // 设置相信信息 241 // 设置相信信息
241 settingDetail(row); 242 settingDetail(row);
  243 + },
  244 + render: function (row) {
  245 + return `<span style="text-decoration: underline;color: blue;">${row.faultBody}</span>`
242 } 246 }
243 }, { 247 }, {
244 prop: 'faulttype', 248 prop: 'faulttype',
  249 + width: 80,
245 label: '故障分类' 250 label: '故障分类'
246 }, { 251 }, {
247 prop: 'createTime', 252 prop: 'createTime',
248 - label: '发生时间' 253 + label: '发生时间',
  254 + width: 120,
249 }, { 255 }, {
250 prop: 'faultState', 256 prop: 'faultState',
251 - label: '故障状态' 257 + label: '故障状态',
  258 + width: 80,
252 }, { 259 }, {
253 prop: 'solveway', 260 prop: 'solveway',
254 - label: '处理方式' 261 + label: '处理方式',
  262 + width: 70,
255 }, { 263 }, {
256 prop: 'solveTime', 264 prop: 'solveTime',
257 - label: '处理时间' 265 + label: '处理时间',
  266 + width: 120,
258 }, { 267 }, {
259 prop: 'solveby', 268 prop: 'solveby',
260 - label: '处理人' 269 + label: '处理人',
  270 + width: 80,
261 }, { 271 }, {
262 prop: 'duration', 272 prop: 'duration',
263 - label: '持续时长' 273 + label: '持续时长',
  274 + width: 80,
264 }, { 275 }, {
265 prop: 'reason', 276 prop: 'reason',
266 - label: '原因分析' 277 + label: '原因分析',
  278 + width: 220,
267 }, { 279 }, {
268 prop: 'solution', 280 prop: 'solution',
269 - label: '处理方案' 281 + label: '处理方案',
  282 + width: 150,
270 }, { 283 }, {
271 prop: 'influenceScope', 284 prop: 'influenceScope',
272 - label: '影响范围' 285 + label: '影响范围',
  286 + width: 220,
273 }], 287 }],
274 dataList: [], 288 dataList: [],
275 total: 0 289 total: 0