<!--
 * @Author       : xh
 * @Date         : 2022-12-01 14:33:01
 * @LastEditors: y001554
 * @FileName     :   
-->
<template>
  <GenDrawer v-bind="$attrs" type="large" v-on="$listeners">
    <!-- <h3 slot="modalHeader">32423423</h3> -->
    <div>
      <!-- <el-button type="primary" size="mini" @click="test"> test </el-button> -->
      <el-table ref="table" height="100%" :data="tableData" header-row-class-name="tbheader" size="mini" border style="width: 100%">
        <el-table-column prop="date" label="日期" width="250" fixed="left" />
        <el-table-column prop="date" label="日期" width="250" />
        <el-table-column prop="date" label="日期" width="250" />
        <el-table-column prop="date" label="日期" width="250" />

        <el-table-column prop="name" label="姓名" width="250" />
        <el-table-column prop="address" label="地址" show-overflow-tooltip />

        <el-table-column prop="address" label="操作" fixed="right" show-overflow-tooltip>
          <template>
            <el-button type="primary" size="mini" @click="test"> 弹窗 </el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <!-- <div slot="modalFooter">
      <el-button type="primary" size="mini" plain @click="cancel"> 取消 </el-button>
      <el-button type="primary" size="mini"> 确认 </el-button>
    </div> -->
  </GenDrawer>
</template>

<script>
// import Modal from '@/components/Layout/modal'
import { dataExportList } from '@/api/export'
const defaultModel = {
  value1: [],
  value2: ''
}
export default {
  name: 'DemoDrawer',
  // components: { Modal },
  data() {
    return {
      loading: false,
      dialog: {
        width: '490px',
        visible: false,
        title: '弹出窗',
        closeOnClickModal: false
      },
      tableData: [
        {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },

        {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },

        {
          date: '2016-05-03',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },

        {
          date: '2016-05-02',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-04',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-01',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-08',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-06',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        },
        {
          date: '2016-05-07',
          name: '王小虎',
          address: '上海市普陀区金沙江路 1518 弄'
        }
      ],
      rules: {}
    }
  },
  created() {
    console.log(0, this.$props, this.$attrs, this.$listeners)
  },
  methods: {
    cancel() {
      this.$ui.hide('DemoDrawer')
    },
    test() {
      // this.$ui.hide('DemoDrawer')
      this.$ui.show('DDrawer')
    },

    // 保存
    handleSave() {
      this.$refs.form.validate(async (valid) => {
        if (valid) {
          this.loading = true
          this.$request(dataExportList, this.form.model).then((res) => {
            if (res.code === 1) {
              this.$message({
                message: '保存成功',
                type: 'success'
              })
              this.$emit('refresh')
              this.settings.visible = false
            }
          })
          this.loading = false
        }
      })
    },
    // 取消
    handleCancel() {
      this.form.model = Object.assign({}, defaultModel)
      this.dialog.visible = false
    }
  }
}
</script>
