<template>
  <div>
    <div class="basicHeader">
      <div class="videoRight">
        <el-button icon="el-icon-download" type="primary">导入</el-button>
        <el-button icon="el-icon-upload2" type="primary">导出</el-button>
      </div>
    </div>
    <div style="margin: 0 15px">
      <el-table
        :data="tableData"
        border
        stripe
        :header-cell-style="headClass"
        :height="tableHeight"
      >
        <el-table-column type="index" label="序号" width="50"></el-table-column>
        <el-table-column
          prop="numCode"
          label="变量编码"
          width=""
        ></el-table-column>
        <el-table-column
          prop="refValue"
          label="基准值"
          width=""
        ></el-table-column>
        <el-table-column fixed="right" label="操作" width="100">
          <template #default="scope">
            <el-button
              type="text"
              size="small"
              style="color: #409eff"
              @click.prevent="Update(scope.row)"
            >
              编辑
            </el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
// import { useStore } from "vuex";
import { defineComponent, ref } from 'vue'

export default defineComponent({
  name: 'consumConfig',
  components: {},
  props: {},
  setup() {
    const Update = (row) => {
      console.log('', row)
    }

    // 表头样式设置
    const headClass = () => {
      return 'background:#FAFAFA !important;color: black;'
    }

    const tableHeight = ref('200')
    tableHeight.value = window.innerHeight - 260 + 'px'
    window.onresize = function () {
      tableHeight.value = window.innerHeight - 260 + 'px'
    }
    return {
      tableHeight,
      headClass,
      Update, //修改偏差配置事件
      tableData: [
        {
          numCode: '05-01',
          refValue: 'Tom',
        },
        {
          numCode: '05-01',
          refValue: 'Tom',
        },
        {
          numCode: '05-01',
          refValue: 'Tom',
        },
        {
          numCode: '05-01',
          refValue: 'Tom',
        },
        {
          numCode: '05-01',
          refValue: 'Tom',
        },
        {
          numCode: '05-01',
          refValue: 'Tom',
        },
        {
          numCode: '05-01',
          refValue: 'Tom',
        },
        {
          numCode: '05-01',
          refValue: 'Tom',
        },
      ],
    }
  },
})
</script>