<!--
 * @Author: chris
 * @Date: 2025-08-08 16:17:54
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2026-03-18 10:23:46
-->
<template>
  <el-table
    v-loading="loading"
    :data="dataList"
    @selection-change="handleSelectionChange"
    row-key="orchardId"
    border
    highlight-current-row
    style="width: 100%"
  >
    <el-table-column type="selection" width="50" align="center" />
    <el-table-column label="内容" align="center" prop="notifyContent" v-if="columns[0].visible" :show-overflow-tooltip="true"/>
    <el-table-column label="状态" align="center" prop="notifyStatus" v-if="columns[1].visible" />
    <!-- <el-table-column label="模板" align="center" prop="template" v-if="columns[2].visible" /> -->
    <el-table-column label="推送时间" align="center" prop="createTime" v-if="columns[3].visible">
      <template #default="scope">
        <span>{{ parseTime(scope.row.createTime) }}</span>
      </template>
    </el-table-column>
  </el-table>
</template>

<script setup>
import { parseTime } from '@/utils/ruoyi'

const props = defineProps({
  dataList: { type: Array, required: true },
  loading: { type: Boolean, required: true },
  columns: { type: Array, required: true }
})

const emits = defineEmits(['selection-change'])

function handleSelectionChange(selection) {
  emits('selection-change', selection)
}
</script>