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

提交

parent c86644fd
......@@ -4,6 +4,7 @@
stripe
:data="tableData"
style="width: 100%"
:row-class-name="differentStateColor"
:header-cell-style="{
background: 'rgba(0, 151, 255, 0.08)',
color: '#333333'
......@@ -80,6 +81,16 @@ export default {
},
isEdit: {
default: true
},
// 展示每行状态颜色
showStateColor: {
type: Boolean,
default: false,
},
// 人工模式
currentMode: {
type: Number,
default: null
}
},
data() {
......@@ -88,7 +99,24 @@ export default {
methods: {
handleClick() {
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>
......@@ -112,5 +140,14 @@ export default {
color: #32a5ea !important;
background-color: red !important;
}
.table-row-mode{
background: rgb(245, 214, 155);
}
.table-row-mechanical{
background: #71e6e6;
}
.table-row-natural{
background: #b5f096;
}
}
</style>
......@@ -2,8 +2,10 @@
<div class="en-table">
<el-table
stripe
border
:data="tableData"
style="width: 100%"
:row-class-name="differentStateColor"
:header-cell-style="{
background: 'rgba(0, 151, 255, 0.08)',
color: '#333333',
......@@ -44,7 +46,7 @@
</el-table-column>
</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">
<slot name="operation" :scope="scope.row"></slot>
</template>
......@@ -70,10 +72,39 @@ export default {
showOpr: {
type: Boolean,
default: true
},
// 展示每行状态颜色
showStateColor: {
type: Boolean,
default: false,
},
// 人工模式
currentMode: {
type: Number,
default: null
}
},
data() {
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>
......
This diff is collapsed.
......@@ -148,11 +148,68 @@
</div>
</div>
<!-- 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"
:tableColums="tableColums"
:isShowOp="true"
isShowPage="true"
:showStateColor='true'
:currentMode='currentId && active ? currentId :null'
>
<template v-slot:operation="scope">
<el-button
......@@ -207,7 +264,7 @@
>定时升降</el-button
>
</template>
</enTable>
</enTable> -->
</div>
</cardList>
<table-pagination
......@@ -226,6 +283,7 @@ import enTabs from '../../components/enTabs'
import hallModal from './components/hallModal'
import tablePagination from '@/pages/components/tablePagination'
import setUpAndDown from './components/setUpAndDown.vue'
import tableList from '@/pages/components/tableList'
import {
tableColumsOne,
......@@ -241,7 +299,8 @@ export default {
enTabs,
hallModal,
tablePagination,
setUpAndDown
setUpAndDown,
tableList,
},
data() {
return {
......@@ -692,7 +751,7 @@ export default {
background: #4cb527 !important;
border: 1px solid transparent;
}
.el-table__body-wrapper {
height: 400px;
}
// .el-table__body-wrapper {
// height: 400px;
// }
</style>
......@@ -338,4 +338,7 @@ export default {
}
}
}
.el-table{
height: 350px;
}
</style>
......@@ -64,7 +64,13 @@
</el-form>
</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"
:tableData="tableData"
:isShowOp="true"
......@@ -77,7 +83,7 @@
>统计图表</el-button
>
</template>
</enTable>
</enTable> -->
</div>
</cardList>
<tablePagination
......@@ -103,6 +109,8 @@ import historyDataModal from './components/historyDataModal'
import statisticPicTableModal from './components/statisticPicTableModal'
import tablePagination from '@/pages/components/tablePagination'
import { tableColums } from './config'
import tableList from '@/pages/components/tableList'
export default {
name: 'useElectroData',
components: {
......@@ -111,7 +119,8 @@ export default {
enTable,
historyDataModal,
statisticPicTableModal,
tablePagination
tablePagination,
tableList,
},
data() {
return {
......@@ -333,4 +342,12 @@ export default {
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>
......@@ -99,7 +99,7 @@ export default {
<style lang="scss" scoped>
.m_i_dialog_lift {
width: 364px;
height: 450px;
height: 300px;
background: rgba(255, 255, 255, 1);
border: 1px solid rgba(23, 41, 71, 0.08);
......@@ -121,7 +121,7 @@ export default {
}
.m_i_dialog_right {
width: 670px;
height: 450px;
height: 300px;
float: left;
background: rgba(255, 255, 255, 1);
border: 1px solid rgba(23, 41, 71, 0.08);
......@@ -140,8 +140,5 @@ export default {
.el-form-item {
margin: 10px 0 0 0;
}
.el-textarea {
width: 267%;
}
}
</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