<!--
 * @Author: howie
 * @Date: 2022-06-21 10:34:10
 * @LastEditors: howie
 * @LastEditTime: 2022-06-21 10:48:30
 * @FilePath: \supply-front\src\views\supply\policy\components\common\dia_table.vue
 * @Description:弹框table
 *
 * Copyright (c) 2022, All Rights Reserved.
-->
<template>
  <div>
    <el-dialog title="提示" :visible.sync="isShow" width="30%" center @click="handleClose">
      <span v-if="title"></span>
      <div>
        <slot name="form"></slot>
      </div>
      <el-table
        v-loading="listLoading"
        :data="dataList"
        element-loading-text="Loading"
        border
        fit
        show-summary
        highlight-current-row
        stripe
      >
        <template v-for="col in columns">
          <el-table-column
            align="center"
            :label="col.lable"
            :prop="col.prop"
            :min-width="col.widht"
            show-overflow-tooltip
          >
          </el-table-column>
        </template>
      </el-table>
      <span slot="footer" class="dialog-footer">
        <el-button @click="hnadleCancel">取 消</el-button>
        <el-button type="primary" @click="handleSubmit">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    title: {
      type: String,
      default: ''
    },
    isShow: {
      type: Boolean,
      default: false
    },
    listLoading: {
      // table 加载loading
      type: Boolean,
      default: false
    },
    dataList: {
      type: Array,
      default: [] // table 数据
    },
    columns: {
      type: Array,
      default: [] // table的label和prop
    }
  },
  methods: {
    handleClose() {},
    hnadleCancel() {},
    handleSubmit() {}
  }
}
</script>

<style lang="sass" scoped></style>
