<template>
    <div> 
        <el-card>
        <el-table :data="checkPointData" style="width: 100%" border stripe>
            <el-table-column type="index" label="#" header-align="center" align="center" width="60">
            </el-table-column>
            <el-table-column prop="name" label="测点" header-align="center" align="center" width="150">
            </el-table-column>
            <el-table-column prop="type" label="数据类型" header-align="center" align="center" width="150">
            </el-table-column>
            <!-- <el-table-column prop="unit" label="工程单位" header-align="center" align="center" width="150">
            </el-table-column>
            <el-table-column prop="frequency" label="采集频率" header-align="center" align="center" width="150">
            </el-table-column>
            -->
            <el-table-column label="测点值" header-align="center" align="center" width="120">
                    <template slot-scope="scope">
                        <el-button type="text" size="small" @click="pointnum(scope.row)">...</el-button>
                    </template>
            </el-table-column>
            <el-table-column prop="remark" label="备注" header-align="center" align="center" width="150">
            </el-table-column>

</el-table>

<!-- 分页区域 -->
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage4" :page-sizes="[1, 2, 5, 10]" :page-size="1" layout="total, sizes, prev, pager, next, jumper" :total="5">
</el-pagination>
</el-card>
<pointnum v-if="pointnumVisible" ref="pointnumDialog"></pointnum>
</div>
</template>


<script>
 import pointnum from "./pointnum";
    export default {
        name: "gasCheckPoint",
        data() {
            return {
                pointnumVisible:false,
                subDevice_id: '',
                checkPointData: [],
                currentPage4: 4,
            }
        },
        components: {
            pointnum
        },
        methods: {
            // 获取测点列表数据
            getCheckpointList() {
                 this.getRequest('/dataList/getMeasurepointInfoBySubEuipId/?SubEuipId=' + this.subDevice_id).then(resp=>{
                    if (resp){
                        console.log(resp.data);
                        this.checkPointData = resp.data;
                        // this.total = resp.data.total;
                    }
                })
            },
            //点击获得该测点hbase中的数据
             pointnum(row) {
                this.pointnumVisible = true;
                this.$nextTick(() => {
                    this.$refs.pointnumDialog.init(row);
                });
            },
        },

        mounted() {
            // this.subSystem_name = this.$route.params.value;
            var subdevId = window.sessionStorage.getItem("subdevice_id");
            this.subDevice_id = subdevId;
            this.getCheckpointList()
        }

    }
</script>


<style scoped>

</style>