From f2c8563d7f3bcc3131524214456464a512e2624a Mon Sep 17 00:00:00 2001 From: wangqi <magical1908@outlook.com> Date: 星期一, 15 三月 2021 11:51:34 +0800 Subject: [PATCH] 企业指标统计右侧 --- src/components/table/summarySheets.vue | 123 +++++++++++--------- src/components/table/components/AirQuality.vue | 5 src/components/table/components/WasteWater.vue | 75 +++++++++++- src/components/table/components/componented/ChemicalWastewater.vue | 120 ++++++++++++++++++++ src/components/table/components/WasteGas.vue | 1 src/views/MapTemplate.vue | 16 + 6 files changed, 274 insertions(+), 66 deletions(-) diff --git a/src/components/table/components/AirQuality.vue b/src/components/table/components/AirQuality.vue index b0dc855..7e52808 100644 --- a/src/components/table/components/AirQuality.vue +++ b/src/components/table/components/AirQuality.vue @@ -45,6 +45,11 @@ prop="RegionalColor" label="鍖哄煙棰滆壊" width="200px"> + <template slot-scope="scope"> + <div v-if="scope.row.RegionalColor==='鍥涚骇绾㈣壊'" style="background-color: red">{{scope.row.RegionalColor}}</div> + <div v-else-if="scope.row.RegionalColor==='涓夌骇姗欒壊'" style="background-color: orange">{{scope.row.RegionalColor}}</div> + <div v-else style="background-color: green">{{scope.row.RegionalColor}}</div> + </template> </el-table-column> </el-table> </div> diff --git a/src/components/table/components/WasteGas.vue b/src/components/table/components/WasteGas.vue index 1068b8b..5014038 100644 --- a/src/components/table/components/WasteGas.vue +++ b/src/components/table/components/WasteGas.vue @@ -98,6 +98,7 @@ </template> <script> + export default { name: 'WasteGas', data () { diff --git a/src/components/table/components/WasteWater.vue b/src/components/table/components/WasteWater.vue index a196886..346934f 100644 --- a/src/components/table/components/WasteWater.vue +++ b/src/components/table/components/WasteWater.vue @@ -5,16 +5,29 @@ <el-table class="tableBox" :data="tableData" - :header-cell-style="tableHeaderColor" :cell-style="rowClass" + :header-cell-style="tableHeaderColor" > <el-table-column width="30px" label="" > - <template> - <i class="el-icon-caret-right"></i> - <span style="margin-left: 10px"></span> + <template > + <el-popover :value= "show" + placement="bottom" + width="200" + trigger="click" + popper-class="popovers" + > + <ChemicalWastewater @isshow= "show=false"></ChemicalWastewater> + <i class="el-icon-caret-right" slot="reference" v-if="!isShowIcon" ></i> + <i class="el-icon-caret-bottom" slot="reference" v-else-if="isShowIcon"></i> +<!-- <i class="el-icon-caret-bottom" v-else-if="isShowIcon&&scope.row.index===1"></i>--> +<!-- <i v-if="isShowIcon" class="el-icon-caret-bottom" slot="reference" @click="isbtn"></i>--> +<!-- <i v-else class="el-icon-caret-right" slot="reference" @click="isbtn"></i>--> + </el-popover> +<!-- <i class="el-icon-caret-right" v-if="!isShowIcon"></i>--> +<!-- <i class="el-icon-caret-bottom" v-else-if="isShowIcon&&scope.row.index===1"></i>--> </template> </el-table-column> <el-table-column @@ -26,7 +39,12 @@ prop="UserName" label="浼佷笟鍚嶇О" width="120px"> - </el-table-column> + <template slot-scope="scope"> + <div v-if="scope.row.UserName==='闆嗗洟鍚嶇О'" style="color: #00ffff">{{scope.row.UserName}}</div> + <div v-else-if="scope.row.UserName==='澶╂触鐭冲寲'" style="color: #00ffff">{{scope.row.UserName}}</div> + <div v-else >{{scope.row.UserName}}</div> + </template> + </el-table-column>v- <el-table-column prop="WasteWaters" label="澶栨帓搴熸按閲忥紙m鲁锛�" @@ -61,6 +79,20 @@ prop="normal" label="姝e父" width="60px"> + <template slot-scope="{row,$index}"> + <u v-if="$index!=2" >{{row.normal}}</u> + <el-popover v-else + placement="bottom-end" + width="200" + trigger="click" + > + <ChemicalWastewater></ChemicalWastewater> + <u slot="reference" style="color: #00ffff">{{row.normal}}</u> + <!-- <i class="el-icon-caret-bottom" v-else-if="isShowIcon&&scope.row.index===1"></i>--> + <!-- <i v-if="isShowIcon" class="el-icon-caret-bottom" slot="reference" @click="isbtn"></i>--> + <!-- <i v-else class="el-icon-caret-right" slot="reference" @click="isbtn"></i>--> + </el-popover> + </template> </el-table-column> <el-table-column prop="overProof" @@ -84,16 +116,23 @@ </el-table-column> </el-table-column> </el-table> +<!-- <ChemicalWastewater v-show="isShowIcon"></ChemicalWastewater>--> <!-- </el-col>--> <!-- </el-row>--> </div> </template> <script> +import ChemicalWastewater from './componented/ChemicalWastewater' export default { name: 'WasteWater', + components: { + ChemicalWastewater + }, data () { return { + show: false, + isShowIcon: false, tableData: [{ UserName: '闆嗗洟鍚嶇О', WasteWaters: '', @@ -152,11 +191,35 @@ // 琛ㄥご鏍峰紡璁剧疆 rowClass () { return 'text-align: center;background-color: rgba(26, 73, 81, 0.901960784313726);color:#fff;width:64px' + }, + // cellClick (row, column, cell, event) { + // console.log(row.index) + // if (row.index === 1) { + // this.isShowIcon = !this.isShowIcon + // } + // // console.log(column) + // // console.log(cell) + // // console.log(event) + // }, + // isbtn () { + // this.isShowIcon = !this.isShowIcon + // // this.isShowIcon = !this.isShowIcon + // // console.log(1) + // }, + tableCellClassName ({ row, column, rowIndex, columnIndex }) { + row.index = rowIndex + column.index = columnIndex } } } </script> -<style scoped> +<style > +.popovers{ + width: auto !important; +} +.popovers.el-popover{ +padding:0; +} </style> diff --git a/src/components/table/components/componented/ChemicalWastewater.vue b/src/components/table/components/componented/ChemicalWastewater.vue new file mode 100644 index 0000000..4bdfdd7 --- /dev/null +++ b/src/components/table/components/componented/ChemicalWastewater.vue @@ -0,0 +1,120 @@ +<template> + <div class="Chemical-Waste-water" id="Chemical-Waste-water"> + <el-row type="flex" class="head-area" align="middle"> + <el-col> + <span>浼佷笟鎸囨爣鍒嗙被缁熻</span> + </el-col> + <el-col class="head-area-button"> + <el-button style="float: right; padding: 3px 0" icon="el-icon-close" type="info" @click="closebtns"></el-button> + </el-col> + </el-row> + <el-table + class="tableBox" + :data="tableData" + > + <el-table-column + label="搴忓彿" + width="60px" + type="index"> + </el-table-column> + <el-table-column + prop="UserName" + label="浼佷笟鍚嶇О" + width="120px"> + </el-table-column> + <el-table-column + prop="WasteWaters" + label="宸ヤ笟澶栨帓搴熸按閲忥紙m鲁锛�" + width="200px"> + </el-table-column> + <el-table-column label="浜х敓閲� 锛堝惃锛�"> + <el-table-column + prop="AddOutPut" + label="涓�鑸浐搴�" + width="100px"> + </el-table-column> + <el-table-column + prop="MonthOutPut" + label="鍗遍櫓搴熺墿" + width="100px"> + </el-table-column> + </el-table-column> + <el-table-column label="璐瓨鐘舵�侊紙涓級"> + <el-table-column + prop="normal" + label="姝e父" + width="100px"> + </el-table-column> + <el-table-column + prop="warning" + label="棰勮" + width="100px"> + </el-table-column> + </el-table-column> + <el-table-column label="璐瓨鐘舵�侊紙涓級"> + <el-table-column + prop="normal" + label="姝e父" + width="100px"> + </el-table-column> + <el-table-column + prop="warning" + label="棰勮" + width="100px"> + </el-table-column> + </el-table-column> + </el-table> + </div> +</template> + +<script> +export default { + name: 'ChemicalWastewater', + data: function () { + return { + tableData: [{ + UserName: '#鐏偓鎺掓斁鍙�', + WasteWaters: '1', + AddOutPut: '', + MonthOutPut: '', + normal: '', + warning: '' + }] + } + }, + methods: { + closebtns () { + // const summary = document.getElementById('Chemical-Waste-water') + // summary.style.display = 'none' + // console.log(1) + this.$emit('isshow') + } + } +} +</script> +<style scoped> + /*.Chemical-Waste-water {*/ + /* position:fixed;*/ + /* top: 330px;*/ + /* left: 65px;*/ + /* !*width: 850px;*!*/ + /* !*height: 265px;*!*/ + /* border: #90c8e0 1px solid;*/ + /* z-index:3000;*/ + /* background-color: rgba(26, 73, 81, 0.901960784313726);*/ + /* !*color: #fff;*!*/ + /*}*/ + /*.head-area{*/ + /* color: #fff;*/ + /* width: 100%;*/ + /* height: 40px;*/ + /* background-color: #002433;*/ + /* font-size: 16px;*/ + /* border-bottom: #90c8e0 2px solid;*/ + /* padding-left: 16px;*/ + /* !*line-height: 40px;*!*/ + /*}*/ + /*.head-area-button{*/ + /* margin-right: 5px;*/ + /*}*/ +</style> diff --git a/src/components/table/summarySheets.vue b/src/components/table/summarySheets.vue index e4bd2ef..1bb0dc4 100644 --- a/src/components/table/summarySheets.vue +++ b/src/components/table/summarySheets.vue @@ -1,34 +1,38 @@ <template> <div class="summary-sheets"> - <div id="summary"> - <el-row type="flex" class="head-area" align="middle"> - <el-col> - <span>浼佷笟鎸囨爣鍒嗙被缁熻</span> - </el-col> - <el-col class="head-area-button"> - <el-button style="float: right; padding: 3px 0" icon="el-icon-close" type="info" @click="closebtn"></el-button> - </el-col> - </el-row> +<!-- <div id="summary">--> +<!-- <el-row type="flex" class="head-area" align="middle">--> +<!-- <el-col>--> +<!-- <span>浼佷笟鎸囨爣鍒嗙被缁熻</span>--> +<!-- </el-col>--> +<!-- <el-col class="head-area-button">--> +<!-- <el-button style="float: right; padding: 3px 0" icon="el-icon-close" type="info" @click="closeBtn"></el-button>--> +<!-- </el-col>--> +<!-- </el-row>--> <!-- <el-tabs class="tabs-text">--> - <el-row :gutter="20" class="el-rowscol"> - <el-col> - <el-tabs class="tabs-text" v-model="activeName" type="border-card" @tab-click="handleClick"> - <el-tab-pane label="搴熸按" name="first"> - <waste-water></waste-water> - </el-tab-pane> - <el-tab-pane label="搴熸皵" name="second"> - <waste-gas></waste-gas> - </el-tab-pane> - <el-tab-pane label="鍥哄簾" name="third"> - <solid-waste></solid-waste> - </el-tab-pane> - <el-tab-pane label="绌烘皵璐ㄩ噺" name="fourth"> - <AirQuality></AirQuality> - </el-tab-pane> - </el-tabs> - </el-col> - </el-row> - </div> + <div> + <i class="el-icon-c-scale-to-original" @click="closeBtn"></i> + </div> + <Dialog ref="summarySheets" title="浼佷笟鎸囨爣鍒嗙被缁熻"> +<!-- <el-row :gutter="20" >--> +<!-- <el-col>--> + <el-tabs v-model="activeName" type="border-card"> + <el-tab-pane label="搴熸按" name="first"> + <waste-water></waste-water> + </el-tab-pane> + <el-tab-pane label="搴熸皵" name="second"> + <waste-gas></waste-gas> + </el-tab-pane> + <el-tab-pane label="鍥哄簾" name="third"> + <solid-waste></solid-waste> + </el-tab-pane> + <el-tab-pane label="绌烘皵璐ㄩ噺" name="fourth"> + <AirQuality></AirQuality> + </el-tab-pane> + </el-tabs> +<!-- </el-col>--> +<!-- </el-row>--> + </Dialog > </div> </template> @@ -37,9 +41,11 @@ import WasteGas from './components/WasteGas' import SolidWaste from './components/SolidWaste' import AirQuality from './components/AirQuality' +import Dialog from '@views/popup/Dialog' export default { - name: 'summary sheet.vue', + name: 'summary-sheet.vue', components: { + Dialog, WasteWater, WasteGas, SolidWaste, @@ -51,44 +57,51 @@ } }, methods: { - handleClick (tab, event) { - console.log(tab, event) + closeBtn () { + // const summary = document.getElementById('summary') + // summary.style.display = 'none' + this.$refs.summarySheets.show() }, - closebtn () { - const summary = document.getElementById('summary') - summary.style.display = 'none' - console.log(1) + tableHeaderColor ({ row, column, owIndex, columnIndex }) { + return 'background-color: rgba(26, 73, 81, 0.901960784313726);color:#fff;font-wight:500;font-size:12px;text-align:center;height:0px' + }, + // 琛ㄥご鏍峰紡璁剧疆 + rowClass () { + return 'text-align: center;background-color: rgba(26, 73, 81, 0.901960784313726);color:#fff;width:64px' } } } </script> -<style> +<style scoped lang="less"> .summary-sheets { position: absolute; - top: 50px; - left: 50px; + top: 450px; + left: 200px; + width: 40px; + height: 40px; /*width: 850px;*/ /*height: 265px;*/ border: #90c8e0 1px solid; - z-index:9999999; + z-index:2000; background-color: rgba(26, 73, 81, 0.901960784313726); /*color: #fff;*/ + .el-icon-c-scale-to-original { + width: 100%; + height: 100%; + } } - .head-area{ - color: #fff; - width: 100%; - height: 40px; - background-color: #002433; - font-size: 16px; - border-bottom: #90c8e0 2px solid; - padding-left: 16px; - /*line-height: 40px;*/ - } - .head-area-button{ - margin-right: 5px; - } - .tabs-text{ - background-color: rgba(26, 73, 81, 0.901960784313726); - } + /*.head-area{*/ + /* color: #fff;*/ + /* width: 100%;*/ + /* height: 40px;*/ + /* background-color: #002433;*/ + /* font-size: 16px;*/ + /* border-bottom: #90c8e0 2px solid;*/ + /* padding-left: 16px;*/ + /* !*line-height: 40px;*!*/ + /*}*/ + /*.head-area-button{*/ + /* margin-right: 5px;*/ + /*}*/ </style> diff --git a/src/views/MapTemplate.vue b/src/views/MapTemplate.vue index 4d8b9d7..612e145 100644 --- a/src/views/MapTemplate.vue +++ b/src/views/MapTemplate.vue @@ -13,9 +13,9 @@ <tool-box-panel ref="toolBox"></tool-box-panel> <!-- <menu-special></menu-special>--> <legend-panel></legend-panel> - <summary-sheets v-show="isShowbtn"></summary-sheets> + <summary-sheets></summary-sheets> <enterprise></enterprise> - <el-button id="mapbtn" type="primary" icon="el-icon-c-scale-to-original" circle @click="isshowhidden"></el-button> +<!-- <el-button id="map-btn" el-icon-c-scale-to-original icon="el-icon-c-scale-to-original" circle @click="isShowHidden"></el-button>--> </div> </template> @@ -52,7 +52,7 @@ }, data () { return { - isShowbtn: false, + // isShowBtn: false, map: null, lcServiceLayerVisible: false, basemapHelper: {}, @@ -71,8 +71,8 @@ }) }, methods: { - isshowhidden () { - this.isShowbtn = !this.isShowbtn + isShowHidden () { + this.isShowBtn = !this.isShowBtn }, saveMapStatus () { window.serviceLayerHelper = this.serviceLayerHelper @@ -164,5 +164,11 @@ //background-color: #0661AE; border-top: 1px solid #0661AE; } + #map-btn { + position: fixed; + top: 20px; + left: 100px; + z-index: 9999; + } } </style> -- Gitblit v1.8.0