Commit 29e47021 authored by 高超凡's avatar 高超凡

提交

parent c86644fd
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
stripe stripe
:data="tableData" :data="tableData"
style="width: 100%" style="width: 100%"
:row-class-name="differentStateColor"
:header-cell-style="{ :header-cell-style="{
background: 'rgba(0, 151, 255, 0.08)', background: 'rgba(0, 151, 255, 0.08)',
color: '#333333' color: '#333333'
...@@ -80,6 +81,16 @@ export default { ...@@ -80,6 +81,16 @@ export default {
}, },
isEdit: { isEdit: {
default: true default: true
},
// 展示每行状态颜色
showStateColor: {
type: Boolean,
default: false,
},
// 人工模式
currentMode: {
type: Number,
default: null
} }
}, },
data() { data() {
...@@ -88,7 +99,24 @@ export default { ...@@ -88,7 +99,24 @@ export default {
methods: { methods: {
handleClick() { handleClick() {
this.$emit('handleBtnClick') this.$emit('handleBtnClick')
},
// 不同状态颜色
differentStateColor({row, rowIndex}) {
if (this.showStateColor == false) return;
if (row.modeTypes === null || this.currentMode === null) {
// 原有
return "";
} else if (row.modeTypes.includes(1) && this.currentMode == "1" ) {
// 供暖模式
return "table-row-mode";
} else if (row.modeTypes.includes(2) && this.currentMode == "2") {
// 机械通风
return "table-row-mechanical";
} else if (row.modeTypes.includes(3) && this.currentMode == "3") {
// 自然通风
return "table-row-natural";
} }
},
} }
} }
</script> </script>
...@@ -112,5 +140,14 @@ export default { ...@@ -112,5 +140,14 @@ export default {
color: #32a5ea !important; color: #32a5ea !important;
background-color: red !important; background-color: red !important;
} }
.table-row-mode{
background: rgb(245, 214, 155);
}
.table-row-mechanical{
background: #71e6e6;
}
.table-row-natural{
background: #b5f096;
}
} }
</style> </style>
...@@ -2,8 +2,10 @@ ...@@ -2,8 +2,10 @@
<div class="en-table"> <div class="en-table">
<el-table <el-table
stripe stripe
border
:data="tableData" :data="tableData"
style="width: 100%" style="width: 100%"
:row-class-name="differentStateColor"
:header-cell-style="{ :header-cell-style="{
background: 'rgba(0, 151, 255, 0.08)', background: 'rgba(0, 151, 255, 0.08)',
color: '#333333', color: '#333333',
...@@ -44,7 +46,7 @@ ...@@ -44,7 +46,7 @@
</el-table-column> </el-table-column>
</template> </template>
<el-table-column v-if='showOpr' align="center" label="操作" :width="opNum * 80"> <el-table-column v-if='showOpr' align="center" label="操作" fixed="right" :width="opNum * 80">
<template slot-scope="scope"> <template slot-scope="scope">
<slot name="operation" :scope="scope.row"></slot> <slot name="operation" :scope="scope.row"></slot>
</template> </template>
...@@ -70,10 +72,39 @@ export default { ...@@ -70,10 +72,39 @@ export default {
showOpr: { showOpr: {
type: Boolean, type: Boolean,
default: true default: true
},
// 展示每行状态颜色
showStateColor: {
type: Boolean,
default: false,
},
// 人工模式
currentMode: {
type: Number,
default: null
} }
}, },
data() { data() {
return {} return {}
},
methods:{
// 不同状态颜色
differentStateColor({row, rowIndex}) {
if (this.showStateColor == false) return;
if (row.modeTypes === null || this.currentMode === null) {
// 原有
return "";
} else if (row.modeTypes.includes(1) && this.currentMode == "1" ) {
// 供暖模式
return "table-row-mode";
} else if (row.modeTypes.includes(2) && this.currentMode == "2") {
// 机械通风
return "table-row-mechanical";
} else if (row.modeTypes.includes(3) && this.currentMode == "3") {
// 自然通风
return "table-row-natural";
}
},
} }
} }
</script> </script>
......
This diff is collapsed.
...@@ -148,11 +148,68 @@ ...@@ -148,11 +148,68 @@
</div> </div>
</div> </div>
<!-- table --> <!-- table -->
<enTable <table-list :tableColums='tableColums' :tableData='tableData' :showOpr='true' :opNum='3' :showStateColor='true' :currentMode='currentId && active ? currentId :null'>
<template v-slot:operation="scope">
<el-button
type="text"
v-if="activeTab != 'c788ce98c1f248f590434394da485ce4'"
@click="statusHandle"
>开启</el-button
>
<el-button
type="text"
v-if="activeTab != 'c788ce98c1f248f590434394da485ce4'"
@click="statusHandle"
>关闭</el-button
>
<el-button
type="text"
@click="statusHandle"
v-if="activeTab == 'b45827c068254695864ee3c1d42573cb'"
>故障复位</el-button
>
<el-button
type="text"
@click="handleBtnClick(scope.scope.row)"
v-if="
activeTab == '303310efddb34a2e9bf269bdff8a7dc5' ||
activeTab == 'f4c840711eae4bcb9536a890cdfda493'
"
>设置频率</el-button
>
<el-button
type="text"
@click="statusHandle"
v-if="activeTab == 'c788ce98c1f248f590434394da485ce4'"
>上升</el-button
>
<el-button
type="text"
@click="statusHandle"
v-if="activeTab == 'c788ce98c1f248f590434394da485ce4'"
>下降</el-button
>
<el-button
type="text"
@click="statusHandle"
v-if="activeTab == 'c788ce98c1f248f590434394da485ce4'"
>停止</el-button
>
<el-button
type="text"
@click="handleUpAndDownBtnClick"
v-if="activeTab == 'c788ce98c1f248f590434394da485ce4'"
>定时升降</el-button
>
</template>
</table-list>
<!-- <enTable
:tableData="tableData" :tableData="tableData"
:tableColums="tableColums" :tableColums="tableColums"
:isShowOp="true" :isShowOp="true"
isShowPage="true" isShowPage="true"
:showStateColor='true'
:currentMode='currentId && active ? currentId :null'
> >
<template v-slot:operation="scope"> <template v-slot:operation="scope">
<el-button <el-button
...@@ -207,7 +264,7 @@ ...@@ -207,7 +264,7 @@
>定时升降</el-button >定时升降</el-button
> >
</template> </template>
</enTable> </enTable> -->
</div> </div>
</cardList> </cardList>
<table-pagination <table-pagination
...@@ -226,6 +283,7 @@ import enTabs from '../../components/enTabs' ...@@ -226,6 +283,7 @@ import enTabs from '../../components/enTabs'
import hallModal from './components/hallModal' import hallModal from './components/hallModal'
import tablePagination from '@/pages/components/tablePagination' import tablePagination from '@/pages/components/tablePagination'
import setUpAndDown from './components/setUpAndDown.vue' import setUpAndDown from './components/setUpAndDown.vue'
import tableList from '@/pages/components/tableList'
import { import {
tableColumsOne, tableColumsOne,
...@@ -241,7 +299,8 @@ export default { ...@@ -241,7 +299,8 @@ export default {
enTabs, enTabs,
hallModal, hallModal,
tablePagination, tablePagination,
setUpAndDown setUpAndDown,
tableList,
}, },
data() { data() {
return { return {
...@@ -692,7 +751,7 @@ export default { ...@@ -692,7 +751,7 @@ export default {
background: #4cb527 !important; background: #4cb527 !important;
border: 1px solid transparent; border: 1px solid transparent;
} }
.el-table__body-wrapper { // .el-table__body-wrapper {
height: 400px; // height: 400px;
} // }
</style> </style>
...@@ -338,4 +338,7 @@ export default { ...@@ -338,4 +338,7 @@ export default {
} }
} }
} }
.el-table{
height: 350px;
}
</style> </style>
...@@ -64,7 +64,13 @@ ...@@ -64,7 +64,13 @@
</el-form> </el-form>
</div> </div>
<enTable <table-list :tableColums='tableColums' :tableData='tableData' :showOpr='true' :opNum='2'>
<template #operation="data">
<el-button type="text" @click="openHistoryHandle(data.scope.row)">历史数据</el-button>
<el-button type="text" @click="openPicTHandle(data.scope.row)">统计图表</el-button>
</template>
</table-list>
<!-- <enTable
:tableColums="tableColums" :tableColums="tableColums"
:tableData="tableData" :tableData="tableData"
:isShowOp="true" :isShowOp="true"
...@@ -77,7 +83,7 @@ ...@@ -77,7 +83,7 @@
>统计图表</el-button >统计图表</el-button
> >
</template> </template>
</enTable> </enTable> -->
</div> </div>
</cardList> </cardList>
<tablePagination <tablePagination
...@@ -103,6 +109,8 @@ import historyDataModal from './components/historyDataModal' ...@@ -103,6 +109,8 @@ import historyDataModal from './components/historyDataModal'
import statisticPicTableModal from './components/statisticPicTableModal' import statisticPicTableModal from './components/statisticPicTableModal'
import tablePagination from '@/pages/components/tablePagination' import tablePagination from '@/pages/components/tablePagination'
import { tableColums } from './config' import { tableColums } from './config'
import tableList from '@/pages/components/tableList'
export default { export default {
name: 'useElectroData', name: 'useElectroData',
components: { components: {
...@@ -111,7 +119,8 @@ export default { ...@@ -111,7 +119,8 @@ export default {
enTable, enTable,
historyDataModal, historyDataModal,
statisticPicTableModal, statisticPicTableModal,
tablePagination tablePagination,
tableList,
}, },
data() { data() {
return { return {
...@@ -333,4 +342,12 @@ export default { ...@@ -333,4 +342,12 @@ export default {
margin-top: 15px; margin-top: 15px;
} }
} }
.box_main
/deep/.el-table
.el-table--fit
.el-table--striped
.el-table--enable-row-hover
.el-table--enable-row-transition {
border: 1px solid !important;
}
</style> </style>
...@@ -99,7 +99,7 @@ export default { ...@@ -99,7 +99,7 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
.m_i_dialog_lift { .m_i_dialog_lift {
width: 364px; width: 364px;
height: 450px; height: 300px;
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
border: 1px solid rgba(23, 41, 71, 0.08); border: 1px solid rgba(23, 41, 71, 0.08);
...@@ -121,7 +121,7 @@ export default { ...@@ -121,7 +121,7 @@ export default {
} }
.m_i_dialog_right { .m_i_dialog_right {
width: 670px; width: 670px;
height: 450px; height: 300px;
float: left; float: left;
background: rgba(255, 255, 255, 1); background: rgba(255, 255, 255, 1);
border: 1px solid rgba(23, 41, 71, 0.08); border: 1px solid rgba(23, 41, 71, 0.08);
...@@ -140,8 +140,5 @@ export default { ...@@ -140,8 +140,5 @@ export default {
.el-form-item { .el-form-item {
margin: 10px 0 0 0; margin: 10px 0 0 0;
} }
.el-textarea {
width: 267%;
}
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment