<template>
  <el-tabs v-model="tabIndex" type="border-card">
    <el-tab-pane label="微信消息记录" :name="0">
      <!-- 搜索工作栏 -->
      <Search
        :schema="allSchemas.searchSchema"
        labelWidth="0"
        @search="setSearchParams"
        @reset="setSearchParams"
      />
      <!-- 列表 -->
      <SSTable
        class="mt-20px"
        v-model:tableObject="tableObject"
        :tableColumns="allSchemas.tableColumns"
        @get-list="getTableList"
      >
        <el-table-column
          v-for="item in allSchemas.tableColumns"
          :key="item.field"
          :prop="item.field"
          :label="item.label"
          :fixed="item.fixed"
          min-width="150px"
          showOverflowTooltip
        />
        <el-table-column label="操作" width="150px" fixed="right">
          <template #default="{ row }">
            <el-button type="primary" link @click="sendMsg(row)">再次发送</el-button>
          </template>
        </el-table-column>
      </SSTable>
    </el-tab-pane>
  </el-tabs>
</template>

<script setup>
import { allSchemas } from './index.data.js'

const tabIndex = ref(0)

const tableObject = ref({
  tableList: [],
  loading: false,
  total: 1,
  pageSize: 20,
  currentPage: 1
})

function setSearchParams() {
  tableObject.value.tableList = [
    {
      sendUser: '测试',
      content: '您今日有10条待跟进的线索',
      status: '发送成功',
      createTime: '2024-04-25 12:00:00'
    }
  ]
}

function getTableList() {
  tableObject.value.tableList = [
    {
      sendUser: '测试',
      content: '您今日有10条待跟进的线索',
      status: '发送成功',
      createTime: '2024-04-25 12:00:00'
    }
  ]
}

function sendMsg() {
  console.log('测试')
}
</script>

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