NEZ-290 feat: panel-alertList样式调整、resize实现
This commit is contained in:
@@ -726,7 +726,7 @@ li{
|
|||||||
.nz-table .el-table__virtual-wrapper {
|
.nz-table .el-table__virtual-wrapper {
|
||||||
width: 100% !important;
|
width: 100% !important;
|
||||||
}
|
}
|
||||||
.chart-table .nz-table td {
|
.chart-table .nz-table td, .chart-alert-info .nz-table td {
|
||||||
background-color: white;
|
background-color: white;
|
||||||
}
|
}
|
||||||
.nz-table td {
|
.nz-table td {
|
||||||
|
|||||||
@@ -1,22 +1,12 @@
|
|||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import './chart.scss';
|
@import './chart.scss';
|
||||||
</style>
|
|
||||||
<style>
|
|
||||||
.max-width-90{
|
|
||||||
max-width: 90px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
<template>
|
<template>
|
||||||
<div class="chart-table" :id="'chartTableDiv'+chartIndex" v-show="divFirstShow" @mouseenter="caretShow=true" @mouseleave="caretShow=false" :style="{'border':isPreview?'unset':'1px solid #d8dce1','height':isPreview?'92%':'100%'}">
|
<div class="nz-chart-resize">
|
||||||
|
<div class="resize-shadow" ref="resizeShadow"></div>
|
||||||
|
<div class="resize-box resize-box-alert" ref="resizeBox">
|
||||||
|
<div class="chart-alert-info" :id="'chartTableDiv'+chartIndex" v-show="divFirstShow" @mouseenter="caretShow=true" @mouseleave="caretShow=false">
|
||||||
<loading :ref="'localLoading'+chartIndex"></loading>
|
<loading :ref="'localLoading'+chartIndex"></loading>
|
||||||
<!--
|
|
||||||
<div v-show="showLoading" class="el-loading-mask" style="background-color: rgba(0, 0, 0, 0);">
|
|
||||||
<div class="el-loading-spinner">
|
|
||||||
<img width="42px" height="42px" src="../../assets/img/loading.gif"/>
|
|
||||||
<p class="el-loading-text loading-font">loading</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
-->
|
|
||||||
<div class="clearfix chartTitle" :class="{'dragTitle':dragTitleShow}" :id="'chartTitle'+chartIndex">
|
<div class="clearfix chartTitle" :class="{'dragTitle':dragTitleShow}" :id="'chartTitle'+chartIndex">
|
||||||
<el-popover
|
<el-popover
|
||||||
v-if="isError"
|
v-if="isError"
|
||||||
@@ -25,7 +15,7 @@
|
|||||||
trigger="hover"
|
trigger="hover"
|
||||||
popper-class="chart-error-popper">
|
popper-class="chart-error-popper">
|
||||||
<div >{{errorContent}}</div>
|
<div >{{errorContent}}</div>
|
||||||
<span slot="reference" style="" class="panel-info-corner panel-info-corner--error">
|
<span slot="reference" class="panel-info-corner panel-info-corner--error">
|
||||||
<i class="nz-icon nz-icon-warning fa"></i>
|
<i class="nz-icon nz-icon-warning fa"></i>
|
||||||
<span class="panel-info-corner-inner"></span>
|
<span class="panel-info-corner-inner"></span>
|
||||||
</span>
|
</span>
|
||||||
@@ -49,7 +39,6 @@
|
|||||||
<i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}</li>
|
<i class="el-icon-copy-document" style="font-size: 16px;"></i>{{$t('dashboard.duplicate')}}</li>
|
||||||
</ul>
|
</ul>
|
||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="mt-10 table-container" v-cloak v-show="firstShow || isPreview">
|
<div class="mt-10 table-container" v-cloak v-show="firstShow || isPreview">
|
||||||
<transition name="el-zoom-in-bottom">
|
<transition name="el-zoom-in-bottom">
|
||||||
@@ -60,9 +49,9 @@
|
|||||||
<el-table
|
<el-table
|
||||||
:id="'tableContainer'+chartIndex"
|
:id="'tableContainer'+chartIndex"
|
||||||
class="nz-table"
|
class="nz-table"
|
||||||
:height="290"
|
|
||||||
:data="storedTableData"
|
:data="storedTableData"
|
||||||
border
|
border
|
||||||
|
:height="tableHeight"
|
||||||
ref="alertListTable"
|
ref="alertListTable"
|
||||||
tooltip-effect="light"
|
tooltip-effect="light"
|
||||||
v-scrollBar:el-table="'large'"
|
v-scrollBar:el-table="'large'"
|
||||||
@@ -247,7 +236,6 @@
|
|||||||
</el-table>
|
</el-table>
|
||||||
<Pagination :pageObj="screenPageObj" @pageNo='screenPageNo' @pageSize='screenPageSize' ref="Pagination" ></Pagination>
|
<Pagination :pageObj="screenPageObj" @pageNo='screenPageNo' @pageSize='screenPageSize' ref="Pagination" ></Pagination>
|
||||||
<loading :ref="'localLoadingScreen'+chartIndex"></loading>
|
<loading :ref="'localLoadingScreen'+chartIndex"></loading>
|
||||||
|
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<div class="export-xlsx">
|
<div class="export-xlsx">
|
||||||
<el-dialog :visible.sync="deleteBox.show" :title="$t('overall.delete')" :modal-append-to-body='false' :show-close="true" width="300px" @close="closeDialog" class="nz-message">
|
<el-dialog :visible.sync="deleteBox.show" :title="$t('overall.delete')" :modal-append-to-body='false' :show-close="true" width="300px" @close="closeDialog" class="nz-message">
|
||||||
@@ -279,7 +267,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<chart ref="messageChart" name="alertMessageChart" :unit="chartUnit"></chart>
|
<chart ref="messageChart" name="alertMessageChart" :unit="chartUnit"></chart>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<span class="vue-resizable-handle" @mousedown="dragResize" v-if="!isPreview"></span>
|
|
||||||
<element-set
|
<element-set
|
||||||
path="/alertList"
|
path="/alertList"
|
||||||
:table-title="tableTitle"
|
:table-title="tableTitle"
|
||||||
@@ -288,6 +275,9 @@
|
|||||||
ref="elementset"
|
ref="elementset"
|
||||||
></element-set>
|
></element-set>
|
||||||
</div>
|
</div>
|
||||||
|
<span class="vue-resizable-handle" @mousedown="startResize" v-if="!isPreview"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -323,12 +313,11 @@ export default {
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
chartInfo:{
|
chartInfo:{}
|
||||||
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
tableHeight: 0,
|
||||||
data: {}, // 该图表信息,chartItem
|
data: {}, // 该图表信息,chartItem
|
||||||
unit:{},
|
unit:{},
|
||||||
isError:false,
|
isError:false,
|
||||||
@@ -461,8 +450,6 @@ export default {
|
|||||||
isPreview:false,
|
isPreview:false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
tagType() {
|
tagType() {
|
||||||
return (key) => {
|
return (key) => {
|
||||||
@@ -498,6 +485,10 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
startResize(e) {
|
||||||
|
let vm = this;
|
||||||
|
this.$chartResizeTool.start(vm, this.data, e);
|
||||||
|
},
|
||||||
labelsClassName(row) {
|
labelsClassName(row) {
|
||||||
if (row.column.label == this.$t("alert.list.labels")) {
|
if (row.column.label == this.$t("alert.list.labels")) {
|
||||||
return "alert-message-list-labels";
|
return "alert-message-list-labels";
|
||||||
@@ -636,6 +627,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
getAlertList: function (filterType,isPreview=false) {
|
getAlertList: function (filterType,isPreview=false) {
|
||||||
|
this.resize();
|
||||||
this.isPreview = isPreview;
|
this.isPreview = isPreview;
|
||||||
let queryParam={
|
let queryParam={
|
||||||
pageSize:this.pageObj.pageSize,
|
pageSize:this.pageObj.pageSize,
|
||||||
@@ -944,31 +936,23 @@ export default {
|
|||||||
this.$refs['localLoading'+this.chartIndex].endLoading();
|
this.$refs['localLoading'+this.chartIndex].endLoading();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
clearData(){
|
resize(chartItem) {
|
||||||
|
let deHeight = this.$chartResizeTool.titleHeight+this.$chartResizeTool.chartTableBlankHeight;
|
||||||
|
let container = document.querySelector('#chartTableDiv' + this.chartIndex + " .table-container");
|
||||||
|
container.style.height = `calc(100% - ${deHeight}px)`;
|
||||||
|
this.tableHeight = `calc(100% - 34px)`;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
container.querySelector(".el-table__body-wrapper")._ps_.update();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
showLoad(chartItem) {
|
showLoad(chartItem) {
|
||||||
//设置高度 chart-table
|
//设置高度 chart-table
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const chartBox = document.getElementById('chartTableDiv'+this.chartIndex);
|
this.resize(chartItem);
|
||||||
let height = Math.round(chartItem.height/10)*10;//图表高度四舍五入
|
|
||||||
if(height<this.minHeight){
|
|
||||||
height = this.minHeight;
|
|
||||||
}
|
|
||||||
chartBox.style.height = `${height-this.chartSpaceHeight}px`;
|
|
||||||
const tableBox = document.getElementById('tableContainer'+this.chartIndex);
|
|
||||||
//tableBox.style.height = `${height-75-32}px`;
|
|
||||||
tableBox.style.height = `${height-this.chartSpaceHeight-this.titleHeight-this.pageHeight}px`;// -75-32
|
|
||||||
});
|
});
|
||||||
this.startLoading();
|
this.startLoading();
|
||||||
this.divFirstShow = true;
|
this.divFirstShow = true;
|
||||||
//this.tableLoading = true;
|
|
||||||
},
|
},
|
||||||
// 展示图表编辑区
|
|
||||||
/*
|
|
||||||
showTool() {
|
|
||||||
this.toolbox = !this.toolbox;
|
|
||||||
},
|
|
||||||
*/
|
|
||||||
// 重新请求数据 刷新操作-local
|
// 重新请求数据 刷新操作-local
|
||||||
refreshChart() {
|
refreshChart() {
|
||||||
this.dropdownMenuShow=false;
|
this.dropdownMenuShow=false;
|
||||||
@@ -1045,7 +1029,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 设置数据, filter区分
|
// 设置数据, filter区分
|
||||||
setData(chartItem, seriesItem, panelId, filter,area,errorMsg) {
|
setData(chartItem, seriesItem, panelId, filter,area,errorMsg) {
|
||||||
|
console.info(chartItem,title)
|
||||||
},
|
},
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
placement="top-start"
|
placement="top-start"
|
||||||
trigger="hover"
|
trigger="hover"
|
||||||
popper-class="chart-error-popper">
|
popper-class="chart-error-popper">
|
||||||
<div >{{errorContent}}</div>
|
<div>{{errorContent}}</div>
|
||||||
<span slot="reference" class="panel-info-corner panel-info-corner--error">
|
<span slot="reference" class="panel-info-corner panel-info-corner--error">
|
||||||
<i class="nz-icon nz-icon-warning fa"></i>
|
<i class="nz-icon nz-icon-warning fa"></i>
|
||||||
<span class="panel-info-corner-inner"></span>
|
<span class="panel-info-corner-inner"></span>
|
||||||
|
|||||||
@@ -110,6 +110,7 @@
|
|||||||
<chart-alert-list :ref="'editChart'+item.id"
|
<chart-alert-list :ref="'editChart'+item.id"
|
||||||
:panel-id="filter.panelId"
|
:panel-id="filter.panelId"
|
||||||
:chart-index="index"
|
:chart-index="index"
|
||||||
|
v-if="item.type === 'alertList'"
|
||||||
:editChartId="'editChartId' + item.id"
|
:editChartId="'editChartId' + item.id"
|
||||||
:chart-info="item"
|
:chart-info="item"
|
||||||
@on-refresh-data="refreshChart"
|
@on-refresh-data="refreshChart"
|
||||||
|
|||||||
@@ -173,7 +173,7 @@
|
|||||||
.pagination {
|
.pagination {
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
}
|
}
|
||||||
.chart-table {
|
.chart-table, .chart-alert-info {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
.table-container {
|
.table-container {
|
||||||
padding: 0 6px;
|
padding: 0 6px;
|
||||||
@@ -268,6 +268,9 @@
|
|||||||
min-height: 26px;
|
min-height: 26px;
|
||||||
line-height: 26px;
|
line-height: 26px;
|
||||||
}
|
}
|
||||||
|
.el-table__body {
|
||||||
|
background-color: white;
|
||||||
|
}
|
||||||
.el-table__body tr:last-of-type td {
|
.el-table__body tr:last-of-type td {
|
||||||
border: none;
|
border: none;
|
||||||
}
|
}
|
||||||
@@ -287,7 +290,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.line-chart-block, .chart-table, .chart-single-stat, .chart-url, .chart-asset-info {
|
.line-chart-block, .chart-table, .chart-single-stat, .chart-url, .chart-asset-info, .chart-alert-info {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
trigger="hover"
|
trigger="hover"
|
||||||
popper-class="chart-error-popper">
|
popper-class="chart-error-popper">
|
||||||
<div >{{errorContent}}</div>
|
<div >{{errorContent}}</div>
|
||||||
<span slot="reference" style="" class="panel-info-corner panel-info-corner--error">
|
<span slot="reference" class="panel-info-corner panel-info-corner--error">
|
||||||
<i class="nz-icon nz-icon-warning fa"></i>
|
<i class="nz-icon nz-icon-warning fa"></i>
|
||||||
<span class="panel-info-corner-inner"></span>
|
<span class="panel-info-corner-inner"></span>
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
@@ -466,12 +466,6 @@ export const chartResizeTool = {
|
|||||||
//step时chart重绘
|
//step时chart重绘
|
||||||
if (box.classList.contains("resize-box-echarts")) { //echarts类型
|
if (box.classList.contains("resize-box-echarts")) { //echarts类型
|
||||||
vm.echartStore.resize({width: shadow.offsetWidth-16, height: shadow.offsetHeight-titleHeight-vm.$refs.legendArea.offsetHeight});
|
vm.echartStore.resize({width: shadow.offsetWidth-16, height: shadow.offsetHeight-titleHeight-vm.$refs.legendArea.offsetHeight});
|
||||||
} else if (box.classList.contains("resize-box-table")) { //table类型
|
|
||||||
//刷新滚动条
|
|
||||||
let scrollbar = box.querySelector(".el-table__body-wrapper")._ps_;
|
|
||||||
if (scrollbar) {
|
|
||||||
scrollbar.update();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//chart外层宽高调整
|
//chart外层宽高调整
|
||||||
let outerBox = document.getElementById(`chart-${data.id}`);
|
let outerBox = document.getElementById(`chart-${data.id}`);
|
||||||
|
|||||||
Reference in New Issue
Block a user