fix: 修复model不显示assetstat的问题

This commit is contained in:
陈劲松
2020-04-16 18:49:55 +08:00
parent 8b7e173b7c
commit 5fe329e576
4 changed files with 50 additions and 30 deletions

View File

@@ -24,7 +24,6 @@ export default {
#app{ #app{
height: 100%; height: 100%;
width: 100%; width: 100%;
min-width: 1300px;
} }
</style> </style>
<style> <style>

View File

@@ -1010,6 +1010,41 @@ li{
.dc-dropdown { .dc-dropdown {
z-index: 2952 !important; z-index: 2952 !important;
} }
.asset-state .cell {
height: 38px;
}
.asset-state .cell>span {
display: block;
height: 100%;
}
.dc-asset-states {
display: flex;
align-items: center;
height: 100%;
}
.dc-asset-state {
display: inline-block;
min-width: 25px;
height: 20px;
color: white;
text-align: center;
line-height: 20px;
margin-right: 6px;
border-radius: 3px;
}
.dc-asset-state-total {
background-color: #1166bb;
margin-right: 15px
}
.dc-asset-state-in {
background-color: #90ee90;
}
.dc-asset-state-out {
background-color: orange;
}
.dc-asset-state-high {
background-color: rgba(255, 0, 0, 0.6);
}
.chart-box-dropdown { .chart-box-dropdown {
width: 519px; width: 519px;
} }

View File

@@ -2,34 +2,6 @@
.dc { .dc {
height: 100%; height: 100%;
} }
.dc-asset-states {
display: flex;
align-items: center;
height: 100%;
}
.dc-asset-state {
display: inline-block;
min-width: 25px;
height: 20px;
color: white;
text-align: center;
line-height: 20px;
margin-right: 6px;
border-radius: 3px;
}
.dc-asset-state.dc-asset-state-total {
background-color: #1166bb;
margin-right: 15px
}
.dc-asset-state-in {
background-color: #90ee90;
}
.dc-asset-state-out {
background-color: orange;
}
.dc-asset-state-high {
background-color: rgba(255, 0, 0, 0.6);
}
</style> </style>
<template> <template>
<div class="dc" > <div class="dc" >
@@ -87,6 +59,7 @@
v-scrollBar:el-table v-scrollBar:el-table
:height="mainTableHeight" :height="mainTableHeight"
ref="dcTable" ref="dcTable"
:cell-class-name="assetStatClassName"
style="width: 100%;"> style="width: 100%;">
<el-table-column <el-table-column
:resizable="false" :resizable="false"
@@ -290,6 +263,12 @@
//悬浮点击空白隐藏 //悬浮点击空白隐藏
this.$refs.elementset.elementsetHide(); this.$refs.elementset.elementsetHide();
}, },
assetStatClassName(param) {
if (param.column.label == this.$t("config.dc.assets")) {
return "asset-state";
}
return "";
},
tablelabelEmit(data) { tablelabelEmit(data) {
//获取子组件传过来的参数 //获取子组件传过来的参数
this.$store.commit('setHeaderTable', data); this.$store.commit('setHeaderTable', data);

View File

@@ -45,7 +45,7 @@
</button> </button>
</div> </div>
</div> </div>
<el-table :data="tableData" border :height="$tableHeight.normal" style="width: 100%;" ref="modelTable" class="nz-table" v-scrollBar:el-table> <el-table :data="tableData" border :height="$tableHeight.normal" style="width: 100%;" ref="modelTable" class="nz-table" v-scrollBar:el-table :cell-class-name="assetStatClassName">
<el-table-column :resizable="false" v-for="(item, index) in tablelable" v-if="item.show" :width="item.width" <el-table-column :resizable="false" v-for="(item, index) in tablelable" v-if="item.show" :width="item.width"
:key="`col-${index}`" :label="item.label"> :key="`col-${index}`" :label="item.label">
<template slot-scope="scope" :column="item"> <template slot-scope="scope" :column="item">
@@ -196,6 +196,12 @@
//悬浮点击空白隐藏 //悬浮点击空白隐藏
this.$refs.elementset.elementsetHide(); this.$refs.elementset.elementsetHide();
}, },
assetStatClassName(param) {
if (param.column.label == this.$t("config.model.assets")) {
return "asset-state";
}
return "";
},
tablelabelEmit(data) { tablelabelEmit(data) {
//获取子组件传过来的参数 //获取子组件传过来的参数
this.$store.commit('setHeaderTable', data); this.$store.commit('setHeaderTable', data);
@@ -249,6 +255,7 @@
this.tableData = []; this.tableData = [];
this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo); this.$set(this.searchLabel, "pageNo", this.pageObj.pageNo);
this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize); this.$set(this.searchLabel, "pageSize", this.pageObj.pageSize);
this.$set(this.searchLabel, "stat", 1);
this.$get('model', this.searchLabel).then(response => { this.$get('model', this.searchLabel).then(response => {
if (response.code === 200) { if (response.code === 200) {
this.tableData = response.data.list; this.tableData = response.data.list;