Commit ff418995 authored by 高超凡's avatar 高超凡

列表组件支持行点击事件

parent a6e685a9
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
background: 'rgba(0, 151, 255, 0.08)', background: 'rgba(0, 151, 255, 0.08)',
color: '#333333' color: '#333333'
}" }"
@current-change='handleCurrentChange'
> >
<el-table-column align="center" label="序号" width="100"> <el-table-column align="center" label="序号" width="100">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -85,6 +86,10 @@ export default { ...@@ -85,6 +86,10 @@ export default {
currentMode: { currentMode: {
type: Number, type: Number,
default: null default: null
},
// 行点击事件
currentChange:{
type: Function
} }
}, },
data() { data() {
...@@ -107,6 +112,10 @@ export default { ...@@ -107,6 +112,10 @@ export default {
// 自然通风 // 自然通风
return 'table-row-natural' return 'table-row-natural'
} }
},
// 行点击事件
handleCurrentChange(data){
this.currentChange(data)
} }
} }
} }
......
...@@ -39,10 +39,10 @@ el-container(style="padding:0px;height:77.6vh;") ...@@ -39,10 +39,10 @@ el-container(style="padding:0px;height:77.6vh;")
span.num(v-if="activeName == 1") {{ hcdtSnqx.carbon_dioxide }} span.num(v-if="activeName == 1") {{ hcdtSnqx.carbon_dioxide }}
span.num(v-else) {{ currentRow.carbon_dioxide?currentRow.carbon_dioxide:'-- ' }} span.num(v-else) {{ currentRow.carbon_dioxide?currentRow.carbon_dioxide:'-- ' }}
span.unit PPM span.unit PPM
table-list(:tableColums='tableHeader' :tableData='dataList' :isShowOp="true" :opNum='4') table-list(:tableColums='tableHeader' :tableData='dataList' :isShowOp="true" :opNum='4' :currentChange='handleCurrentChange')
template(#operation='data') template(#operation="data")
el-button(type='text' size='small' @click="showParams(scope.row, 1)") 历史数据 el-button(type='text' size='small' @click="showParams(data.scope, 1)") 历史数据
el-button(type='text' size='small' @click="showParams(scope.row, 2)") 统计图表 el-button(type='text' size='small' @click="showParams(data.scope, 2)") 统计图表
//- el-table( //- el-table(
//- size="mini", //- size="mini",
//- :data="dataList", //- :data="dataList",
......
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