<template>
    <basic-container>
        <avue-crud 
            :data="data" 
            :option="option"
            :page.sync="page"
            @search-change="searchChange"
            @current-change="currentChange"
            @size-change="sizeChange"
        >
        <template
            slot-scope="scope"
            slot="menu"
        >
        <el-button
          type="text"
          icon="el-icon-circle-plus-outline"
          size="small"
          @click.stop="editUnit(scope.row, scope.index)"
        >编辑计量系统单元
        </el-button>
        </template>
        </avue-crud>
    </basic-container>
  </template>
  
  
  <script>

export default {
  data () {
    return {
      data: [
        {
          name: '广西二级路公路计量单元划分模板',
          tips: '备注111'
        }, {
          name: '计量测试',
          tips: '备注222'
        }, 
        {
          name: '广西二级路公路计量单元划分模板',
          tips: '备注111'
        }, {
          name: '计量测试',
          tips: '备注222'
        }, 
        {
          name: '广西二级路公路计量单元划分模板',
          tips: '备注111'
        }, {
          name: '计量测试',
          tips: '备注222'
        }, 
        {
          name: '广西二级路公路计量单元划分模板',
          tips: '备注111'
        }, {
          name: '计量测试',
          tips: '备注222'
        }, 
        {
          name: '广西二级路公路计量单元划分模板',
          tips: '备注111'
        }, {
          name: '计量测试',
          tips: '备注222'
        }, 
       
      ],
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 16
      },
      option: {
        height: 'auto',
        calcHeight: 30,
        tip: false,
        searchShow: true,
        searchMenuSpan: 6,
        border: true,
        index: true,
        menuWidth: 400,
        dialogClickModal: false,
        column: [
          {
            label: "模版名称",
            prop: "name",
            search: true,
            rules: [{
              required: true,
              message: "请输入名称",
              trigger: "blur"
            }]
          },
    

          {
            label: "备注",
            prop: "tips",
            editDisplay: true,
            addDisplay: true,
            rules: [{
              message: "请输入表数量",
              trigger: "blur",
            }]
          }
        ]
      },
    };
  },
  methods: {
    searchChange (params, done) {
     console.log(params,'params');
      done();
    },
    editUnit(row){
        console.log(row);
        this.$router.push({
        path: '/measure/template',
        query: {
         
        }
      })
    },
    currentChange (currentPage) {
      this.page.currentPage = currentPage;
    },
    sizeChange (pageSize) {
      this.page.pageSize = pageSize;
    },
  }
}
  
  </script>
  
  <style>
  </style>
  