详情表格组件功能完善-更多页面的表格和表格样式保持一致
Showing
5 changed files
with
85 additions
and
25 deletions
@@ -140,7 +140,7 @@ export function getDetailTableData(param){ | @@ -140,7 +140,7 @@ export function getDetailTableData(param){ | ||
140 | "kpiId": "KPIA91F44E7", | 140 | "kpiId": "KPIA91F44E7", |
141 | "kpiName": "文件系统总大小", | 141 | "kpiName": "文件系统总大小", |
142 | "flag": "fs-", | 142 | "flag": "fs-", |
143 | - "kpiValue": "98.30 GB", | 143 | + "kpiValue": "9812345678912563412588.30 GB", |
144 | "collTime": null, | 144 | "collTime": null, |
145 | "duration": null, | 145 | "duration": null, |
146 | "createTime": null, | 146 | "createTime": null, |
@@ -789,7 +789,7 @@ export function getDetailTableData(param){ | @@ -789,7 +789,7 @@ export function getDetailTableData(param){ | ||
789 | "kpiId": "KPI7AC1664E", | 789 | "kpiId": "KPI7AC1664E", |
790 | "kpiName": "文件系统挂载", | 790 | "kpiName": "文件系统挂载", |
791 | "flag": "fs-runuser0", | 791 | "flag": "fs-runuser0", |
792 | - "kpiValue": "/run/user/0 ", | 792 | + "kpiValue": "/run/user/0/run1/user1/01 ", |
793 | "collTime": null, | 793 | "collTime": null, |
794 | "duration": null, | 794 | "duration": null, |
795 | "createTime": null, | 795 | "createTime": null, |
@@ -2508,7 +2508,9 @@ export function getDetailTableData(param){ | @@ -2508,7 +2508,9 @@ export function getDetailTableData(param){ | ||
2508 | "str": null, | 2508 | "str": null, |
2509 | "totalRow": null | 2509 | "totalRow": null |
2510 | } | 2510 | } |
2511 | - if(params.kpiId=='KPI7AC1664E,KPI449F5365,KPIA91F44E7,KPI98306224,KPI77C28BBA'){ | 2511 | + // params.kpiId=='KPI7AC1664E,KPI449F5365,KPIA91F44E7,KPI98306224,KPI77C28BBA' |
2512 | + let kpiIdArr=params.kpiId.split(','); | ||
2513 | + if(kpiIdArr.length>4){ | ||
2512 | console.log("a1") | 2514 | console.log("a1") |
2513 | tableData=detailTableData1; | 2515 | tableData=detailTableData1; |
2514 | }else{ | 2516 | }else{ |
@@ -2638,7 +2640,7 @@ export function getDetailTableDataNoPage(){ | @@ -2638,7 +2640,7 @@ export function getDetailTableDataNoPage(){ | ||
2638 | "kpiId": "KPIA91F44E7", | 2640 | "kpiId": "KPIA91F44E7", |
2639 | "kpiName": "文件系统总大小", | 2641 | "kpiName": "文件系统总大小", |
2640 | "flag": "fs-", | 2642 | "flag": "fs-", |
2641 | - "kpiValue": "196.74 GB", | 2643 | + "kpiValue": "123456789987654321123456789987.74 GB", |
2642 | "collTime": null, | 2644 | "collTime": null, |
2643 | "duration": null, | 2645 | "duration": null, |
2644 | "createTime": null, | 2646 | "createTime": null, |
@@ -3287,7 +3289,7 @@ export function getDetailTableDataNoPage(){ | @@ -3287,7 +3289,7 @@ export function getDetailTableDataNoPage(){ | ||
3287 | "kpiId": "KPI7AC1664E", | 3289 | "kpiId": "KPI7AC1664E", |
3288 | "kpiName": "文件系统挂载", | 3290 | "kpiName": "文件系统挂载", |
3289 | "flag": "fs-runuser0", | 3291 | "flag": "fs-runuser0", |
3290 | - "kpiValue": "/run/user/0 ", | 3292 | + "kpiValue": "/run/user/0/run2/user3/03 ", |
3291 | "collTime": null, | 3293 | "collTime": null, |
3292 | "duration": null, | 3294 | "duration": null, |
3293 | "createTime": null, | 3295 | "createTime": null, |
@@ -286,16 +286,26 @@ export default { | @@ -286,16 +286,26 @@ export default { | ||
286 | arr.push({name:item.kpiName,key:item.kpiId,width:'50%',sort:false,columnSort:index,componentName:1}) | 286 | arr.push({name:item.kpiName,key:item.kpiId,width:'50%',sort:false,columnSort:index,componentName:1}) |
287 | }) | 287 | }) |
288 | this.formData=arr; | 288 | this.formData=arr; |
289 | + this.formData.sort(this.compare('columnSort')); | ||
289 | this.dialogVisible = false; | 290 | this.dialogVisible = false; |
290 | } else { | 291 | } else { |
291 | // 编辑 | 292 | // 编辑 |
292 | this.formData[this.indexEditor] = this.rowFormData; | 293 | this.formData[this.indexEditor] = this.rowFormData; |
293 | this.$set(this.formData, this.indexEditor, this.rowFormData); | 294 | this.$set(this.formData, this.indexEditor, this.rowFormData); |
295 | + this.formData.sort(this.compare('columnSort')); | ||
294 | this.editDialogVisible = false; | 296 | this.editDialogVisible = false; |
295 | } | 297 | } |
296 | this.$emit("input", this.formData); | 298 | this.$emit("input", this.formData); |
297 | this.$emit("change", this.formData); | 299 | this.$emit("change", this.formData); |
298 | }, | 300 | }, |
301 | + //数组排序 | ||
302 | + compare(property){ | ||
303 | + return function(a,b){ | ||
304 | + let value1 = a[property]; | ||
305 | + let value2 = b[property]; | ||
306 | + return value1 - value2; | ||
307 | + } | ||
308 | + }, | ||
299 | // 删除 | 309 | // 删除 |
300 | handleDeleteClick(index,row) { | 310 | handleDeleteClick(index,row) { |
301 | this.formData.splice(index, 1); | 311 | this.formData.splice(index, 1); |
@@ -49,7 +49,7 @@ export default { | @@ -49,7 +49,7 @@ export default { | ||
49 | watch: { | 49 | watch: { |
50 | dialogVisible: { | 50 | dialogVisible: { |
51 | handler(val) { | 51 | handler(val) { |
52 | - console.log("dialogVisible",val) | 52 | + // console.log("dialogVisible",val) |
53 | }, | 53 | }, |
54 | deep: true | 54 | deep: true |
55 | } | 55 | } |
@@ -64,7 +64,7 @@ export default { | @@ -64,7 +64,7 @@ export default { | ||
64 | }, | 64 | }, |
65 | okFunc(){ | 65 | okFunc(){ |
66 | // this.dialogVisible = false; | 66 | // this.dialogVisible = false; |
67 | - this.$emit('okfunc'); | 67 | + this.$emit('okFunc'); |
68 | } | 68 | } |
69 | } | 69 | } |
70 | } | 70 | } |
@@ -45,17 +45,25 @@ | @@ -45,17 +45,25 @@ | ||
45 | 45 | ||
46 | </div> | 46 | </div> |
47 | <div v-if="dialogName=='filter_sheet_indicator'" class="txtScroll-top"> | 47 | <div v-if="dialogName=='filter_sheet_indicator'" class="txtScroll-top"> |
48 | - 过滤单指标{{pressingValue}} | 48 | +<!-- 过滤单指标{{pressingValue}}--> |
49 | + 您确定要对当前指标进行过滤处理? | ||
49 | </div> | 50 | </div> |
50 | <div v-if="dialogName=='filter_multiple_indicators'" class="txtScroll-top"> | 51 | <div v-if="dialogName=='filter_multiple_indicators'" class="txtScroll-top"> |
51 | - 过滤多指标{{pressingValue}} | 52 | +<!-- 过滤多指标{{pressingValue}}--> |
53 | + 您确定要对当前指标进行过滤处理? | ||
52 | </div> | 54 | </div> |
53 | <div v-if="dialogName=='performance_trends'" class="txtScroll-top"> | 55 | <div v-if="dialogName=='performance_trends'" class="txtScroll-top"> |
54 | <div>性能趋势{{pressingValue}}</div> | 56 | <div>性能趋势{{pressingValue}}</div> |
55 | <iframe :src="trendSrc" class="layadmin-iframe" style="height: 99.5%!important;width: 100%;"/> | 57 | <iframe :src="trendSrc" class="layadmin-iframe" style="height: 99.5%!important;width: 100%;"/> |
56 | </div> | 58 | </div> |
57 | <div v-if="dialogName=='pressing_times'" class="txtScroll-top"> | 59 | <div v-if="dialogName=='pressing_times'" class="txtScroll-top"> |
58 | - 压制次数{{pressingValue}} | 60 | +<!-- 压制次数{{pressingValue}}--> |
61 | + <el-input | ||
62 | + v-model="pressingNum" | ||
63 | + :rows="2" | ||
64 | + type="textarea" | ||
65 | + placeholder="压制次数(必填,建议100以内)" | ||
66 | + /> | ||
59 | </div> | 67 | </div> |
60 | <div v-if="dialogName=='include_capacity_forecast'" class="txtScroll-top"> | 68 | <div v-if="dialogName=='include_capacity_forecast'" class="txtScroll-top"> |
61 | 纳入容量预测{{pressingValue}} | 69 | 纳入容量预测{{pressingValue}} |
@@ -68,6 +76,7 @@ | @@ -68,6 +76,7 @@ | ||
68 | 76 | ||
69 | <script> | 77 | <script> |
70 | import customDialog from "./customDialog"; | 78 | import customDialog from "./customDialog"; |
79 | +import {Message} from "_element-ui@2.15.6@element-ui"; | ||
71 | 80 | ||
72 | export default { | 81 | export default { |
73 | name: "customMenuBox", | 82 | name: "customMenuBox", |
@@ -136,7 +145,8 @@ export default { | @@ -136,7 +145,8 @@ export default { | ||
136 | dialogName: '', | 145 | dialogName: '', |
137 | // trendSrc:'',//性能走势图地址 | 146 | // trendSrc:'',//性能走势图地址 |
138 | // pressingVisible:'', | 147 | // pressingVisible:'', |
139 | - pressingValue:'', | 148 | + pressingValue:'',//压制次数 |
149 | + pressingNum:'', | ||
140 | strategyData: [{ | 150 | strategyData: [{ |
141 | label:'策略一', | 151 | label:'策略一', |
142 | value:'001' | 152 | value:'001' |
@@ -182,6 +192,11 @@ export default { | @@ -182,6 +192,11 @@ export default { | ||
182 | }, | 192 | }, |
183 | okFunc(){ | 193 | okFunc(){ |
184 | this.dialogVisible=false; | 194 | this.dialogVisible=false; |
195 | + if(this.dialogName=='filter_sheet_indicator'){ | ||
196 | + this.setKpiFilter(true); | ||
197 | + }else if(this.dialogName=='filter_multiple_indicators'){ | ||
198 | + this.setKpiFilter(false); | ||
199 | + } | ||
185 | }, | 200 | }, |
186 | //表格下探 | 201 | //表格下探 |
187 | pressingDialog(itemMenu,value,flg){ | 202 | pressingDialog(itemMenu,value,flg){ |
@@ -200,7 +215,7 @@ export default { | @@ -200,7 +215,7 @@ export default { | ||
200 | this.widthStyle=''; | 215 | this.widthStyle=''; |
201 | 216 | ||
202 | }else if(itemMenu.type=='pressing_times'){ | 217 | }else if(itemMenu.type=='pressing_times'){ |
203 | - this.widthStyle=styleStr; | 218 | + this.widthStyle='width:400px;height: 200px;min-height: 200px;overflow: hidden;'; |
204 | 219 | ||
205 | }else if(itemMenu.type=='include_capacity_forecast'){ | 220 | }else if(itemMenu.type=='include_capacity_forecast'){ |
206 | this.widthStyle=styleStr; | 221 | this.widthStyle=styleStr; |
@@ -232,6 +247,19 @@ export default { | @@ -232,6 +247,19 @@ export default { | ||
232 | 247 | ||
233 | this.dialogName=name; | 248 | this.dialogName=name; |
234 | }, | 249 | }, |
250 | + //设置指标过滤,isOne true单指标过滤,false多指标过滤 | ||
251 | + setKpiFilter(isOne){ | ||
252 | + let params={ | ||
253 | + resId: '',kpiId: '',flag:'',subFlag: '', | ||
254 | + } | ||
255 | + let datas={resId:params.resId,kpiId:params.kpiId,flag:params.flag,isOne:isOne===true?'s':'m',subFlag:params.subFlag} | ||
256 | + console.log("过滤指标",isOne,'/api-web/filterkpi/kpi/filter') | ||
257 | + Message({ | ||
258 | + message: '过滤指标失败', | ||
259 | + type: 'error', | ||
260 | + duration: 3 * 1000 | ||
261 | + }) | ||
262 | + } | ||
235 | } | 263 | } |
236 | } | 264 | } |
237 | </script> | 265 | </script> |
@@ -17,9 +17,8 @@ | @@ -17,9 +17,8 @@ | ||
17 | :key="index" | 17 | :key="index" |
18 | :class="['padding-10',{'ascending':(sortBy==item.key && sortCaret=='ascending'),'descending':(sortBy==item.key && sortCaret=='descending')}]" | 18 | :class="['padding-10',{'ascending':(sortBy==item.key && sortCaret=='ascending'),'descending':(sortBy==item.key && sortCaret=='descending')}]" |
19 | > | 19 | > |
20 | - {{ item.name }} | ||
21 | -<!-- <i v-if="tableFiledSort(index)" :class="['cursorClass',{'el-icon-caret-bottom':(sortBy==item.key && sortVal=='bottom'),'el-icon-caret-top':(sortBy==item.key && sortVal=='top')}]" @click="changeSort(item)"></i>--> | ||
22 | - <span v-if="tableFiledSort(index)" class="caret-wrapper"> | 20 | + {{ item.name }} |
21 | + <span v-if="tableFiledSort(index)" class="caret-wrapper"> | ||
23 | <i class="sort-caret ascending" @click="changeSort(item,'ascending')"></i> | 22 | <i class="sort-caret ascending" @click="changeSort(item,'ascending')"></i> |
24 | <i class="sort-caret descending" @click="changeSort(item,'descending')"></i> | 23 | <i class="sort-caret descending" @click="changeSort(item,'descending')"></i> |
25 | </span> | 24 | </span> |
@@ -36,8 +35,7 @@ | @@ -36,8 +35,7 @@ | ||
36 | :key="idx" | 35 | :key="idx" |
37 | :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]" | 36 | :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]" |
38 | @mouseenter="pressingTimes(index,idx)" | 37 | @mouseenter="pressingTimes(index,idx)" |
39 | - :ref="'headerRef'+index+'-'+idx" | ||
40 | - :data-tip="tableFiledMaxWidth('isOverflow'+index+'-'+idx,index,idx)" | 38 | + :data-tip="tableFiledMaxWidth('isOverflow'+index+'-'+idx,index,idx,'')" |
41 | > | 39 | > |
42 | <el-tooltip v-if="!itemChild.componentName || itemChild.componentName==1" :disabled="isEllipsis[index+'-'+idx]" ref="elTooltip" trigger="hover" > | 40 | <el-tooltip v-if="!itemChild.componentName || itemChild.componentName==1" :disabled="isEllipsis[index+'-'+idx]" ref="elTooltip" trigger="hover" > |
43 | <template #content> | 41 | <template #content> |
@@ -74,10 +72,9 @@ | @@ -74,10 +72,9 @@ | ||
74 | v-for="(item, index) in headerAll" | 72 | v-for="(item, index) in headerAll" |
75 | :style="[headerTableStlye,tableFiledWidth(index),tableRowHeight()]" | 73 | :style="[headerTableStlye,tableFiledWidth(index),tableRowHeight()]" |
76 | :key="index" | 74 | :key="index" |
77 | - :class="{'ascending':(sortBy==item.key && sortCaret=='ascending'),'descending':(sortBy==item.key && sortCaret=='descending')}" | 75 | + :class="['padding-10',{'ascending':(sortBy==item.key && sortCaret=='ascending'),'descending':(sortBy==item.key && sortCaret=='descending')}]" |
78 | > | 76 | > |
79 | {{ item.name }} | 77 | {{ item.name }} |
80 | -<!-- <i v-if="tableFiledSort(index)" :class="['cursorClass',{'el-icon-caret-bottom':sortVal=='bottom','el-icon-caret-top':sortVal=='top'}]" @click="changeSort(item)"></i>--> | ||
81 | <span v-if="tableFiledSort(index)" class="caret-wrapper"> | 78 | <span v-if="tableFiledSort(index)" class="caret-wrapper"> |
82 | <i class="sort-caret ascending" @click="changeSort(item,'ascending')"></i> | 79 | <i class="sort-caret ascending" @click="changeSort(item,'ascending')"></i> |
83 | <i class="sort-caret descending" @click="changeSort(item,'descending')"></i> | 80 | <i class="sort-caret descending" @click="changeSort(item,'descending')"></i> |
@@ -90,15 +87,31 @@ | @@ -90,15 +87,31 @@ | ||
90 | <li v-for="(item, index) in listAll" :key="index" :style="tableRowHeight()" @mouseenter="isHover=true" @mouseleave="isHover=false" > | 87 | <li v-for="(item, index) in listAll" :key="index" :style="tableRowHeight()" @mouseenter="isHover=true" @mouseleave="isHover=false" > |
91 | <div class="infoList-flex" :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(index),tableRowHeight(),serialNumber]"> | 88 | <div class="infoList-flex" :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(index),tableRowHeight(),serialNumber]"> |
92 | {{ index+1 }}</div> | 89 | {{ index+1 }}</div> |
93 | - <div class="infoList-flex" | 90 | + <div class="infoList-flex text-overflow padding-10" |
94 | v-for="(itemChild, idx) in headerAll" | 91 | v-for="(itemChild, idx) in headerAll" |
95 | :key="idx" | 92 | :key="idx" |
96 | :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]" | 93 | :style="[bodyTableStyle, bodyTable(index),tableFiledWidth(idx),tableRowHeight()]" |
97 | @mouseenter="pressingTimes(index,idx)" | 94 | @mouseenter="pressingTimes(index,idx)" |
95 | + :data-tip="tableFiledMaxWidth('isOverflow1'+index+'-'+idx,index,idx,'more')" | ||
98 | > | 96 | > |
99 | - <span @click="clickListName(item[itemChild.key])" :style="colorStyle(item[itemChild.key].kpiValue)" | 97 | + <el-tooltip v-if="!itemChild.componentName || itemChild.componentName==1" :disabled="isEllipsisMore[index+'-'+idx]" ref="elTooltip" trigger="hover" > |
98 | + <template #content> | ||
99 | + <span>{{ item[itemChild.key].kpiValue}}</span> | ||
100 | + </template> | ||
101 | + <span @mouseleave="" :ref="'isOverflow1'+index+'-'+idx" :data-num="index+'-'+idx" @click="clickListName(item[itemChild.key])" :style="colorStyle(item[itemChild.key].kpiValue)" | ||
102 | + :class="['listName','width-80','text-overflow',{'listName-link':item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)}]"> | ||
103 | + {{ item[itemChild.key].kpiValue}} | ||
104 | + </span> | ||
105 | + </el-tooltip> | ||
106 | + <component v-if="itemChild.componentName && itemChild.componentName!=1" :is="itemChild.componentName" :alarmLevel="item[itemChild.key].alarmLevel?item[itemChild.key].alarmLevel:'2'" :way="item[itemChild.key].way?item[itemChild.key].way:'message'" /> | ||
107 | + | ||
108 | + | ||
109 | + | ||
110 | + | ||
111 | + | ||
112 | +<!-- <span @click="clickListName(item[itemChild.key])" :style="colorStyle(item[itemChild.key].kpiValue)" | ||
100 | :class="['listName',{'listName-link':item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)}]"> | 113 | :class="['listName',{'listName-link':item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)}]"> |
101 | - {{ item[itemChild.key]?item[itemChild.key].kpiValue:'' }}</span> | 114 | + {{ item[itemChild.key]?item[itemChild.key].kpiValue:'' }}</span>--> |
102 | <customMenuBox v-if="pressingVisible==index+'-'+idx && item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)" | 115 | <customMenuBox v-if="pressingVisible==index+'-'+idx && item[itemChild.key] && (item[itemChild.key].kpiIdent==1 || item[itemChild.key].isWarning==1)" |
103 | :detailMenubox="calcDetailMenubox" | 116 | :detailMenubox="calcDetailMenubox" |
104 | :tableDataValue="item[itemChild.key].kpiValue" :flg="''" :trendSrc="trendSrc" | 117 | :tableDataValue="item[itemChild.key].kpiValue" :flg="''" :trendSrc="trendSrc" |
@@ -261,6 +274,7 @@ export default { | @@ -261,6 +274,7 @@ export default { | ||
261 | sortBy:'',//排序参数 | 274 | sortBy:'',//排序参数 |
262 | sortCaret:'',//正序倒序 | 275 | sortCaret:'',//正序倒序 |
263 | isEllipsis:[],//是否文字超出 | 276 | isEllipsis:[],//是否文字超出 |
277 | + isEllipsisMore:[],//是否文字超出 | ||
264 | componentName:'',//组件名称 | 278 | componentName:'',//组件名称 |
265 | }; | 279 | }; |
266 | }, | 280 | }, |
@@ -652,14 +666,20 @@ export default { | @@ -652,14 +666,20 @@ export default { | ||
652 | return styleJson | 666 | return styleJson |
653 | }, | 667 | }, |
654 | //列最大宽 | 668 | //列最大宽 |
655 | - tableFiledMaxWidth(obj,index,idx){ | 669 | + tableFiledMaxWidth(obj,index,idx,flg){ |
656 | let that=this; | 670 | let that=this; |
657 | this.$nextTick(() => { | 671 | this.$nextTick(() => { |
658 | let isOverflow=that.$refs[obj]; | 672 | let isOverflow=that.$refs[obj]; |
659 | - if(isOverflow && isOverflow[0]){ | 673 | + if(isOverflow && isOverflow[0]){ |
660 | let cWidth = isOverflow[0].parentElement.scrollWidth; | 674 | let cWidth = isOverflow[0].parentElement.scrollWidth; |
661 | let sWidth = isOverflow[0].scrollWidth; | 675 | let sWidth = isOverflow[0].scrollWidth; |
662 | - that.isEllipsis[index+'-'+idx]=!((sWidth+10) > cWidth); | 676 | + if(flg=='more'){ |
677 | + that.isEllipsisMore[index+'-'+idx]=!((sWidth+10) > cWidth); | ||
678 | + | ||
679 | + }else { | ||
680 | + that.isEllipsis[index+'-'+idx]=!((sWidth+10) > cWidth); | ||
681 | + | ||
682 | + } | ||
663 | } | 683 | } |
664 | 684 | ||
665 | }) | 685 | }) |
-
Please register or login to post a comment