
<template>
  <div class="noticeManage app-container">
    <div class="search">
      <el-button class="add-btn" type="primary" size="small" @click="handleAdd"
        >添加</el-button
      >
    </div>

    <el-table
      :data="tableData"
      tooltip-effect="dark"
      border
      v-loading="loading"
      style="width: 100%"
    >
      <el-table-column
        align="center"
        label="序号"
        prop="name"
        show-overflow-tooltip
      >
      </el-table-column>
      <el-table-column
        prop="shopName"
        align="center"
        label="标题"
        show-overflow-tooltip
      >
      </el-table-column>
      <el-table-column
        prop="createTime"
        align="center"
        label="发送对象"
        show-overflow-tooltip
      >
      </el-table-column>
      <el-table-column
        prop="createTime"
        align="center"
        label="发送时间"
        show-overflow-tooltip
      >
      </el-table-column>
      <el-table-column
        prop="createTime"
        align="center"
        label="权重排序"
        show-overflow-tooltip
      >
      </el-table-column>
      <el-table-column
        prop="createTime"
        align="center"
        label="状态"
        show-overflow-tooltip
      >
      </el-table-column>
      <el-table-column prop="address" align="center" label="操作">
        <template slot-scope="scope">
          <el-button type="text" size="small" @click="handleTop(scope.row)">置顶</el-button>
          <el-button type="text" size="small" @click="handleEdit(scope.row)">编辑</el-button>
          <el-button type="text" size="small" @click="handleDel(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <div class="page-box">
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        background
        :current-page="query.page"
        :page-sizes="[10, 20, 30, 40]"
        :page-size="query.pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="tableData.length"
      >
      </el-pagination>
    </div>
  </div>
</template>
  
  <script>
import { debounce } from "@/utils/index";

export default {
  name: "noticeManage",
  data() {
    return {
     
      tableData: [
        {
          id: 1,
          name: "张三",
          shopName: "中石油",
          status: 1,
          createTime: "2023-05-23 16:56",
          IDnumber: 41166554551223445,
          phone: 13789459456,
        },
        {
          id: 2,
          name: "李四",
          shopName: "山姆会员店",
          status: 1,
          createTime: "2023-05-23 16:56",
          IDnumber: 41166554551223445,
          phone: 13949455678,
        },
        {
          id: 3,
          name: "万强",
          shopName: "烤匠",
          status: 1,
          createTime: "2023-05-23 16:56",
          IDnumber: 41166554551223445,
          phone: 13948956745,
        },
        {
          id: 4,
          name: "李丹",
          shopName: "中石油",
          status: 1,
          createTime: "2023-05-23 16:56",
          IDnumber: 41166554551223445,
          phone: 15678394945,
        },
      ],
      options: [
        {
          value: "0",
          label: "全部类型",
        },
        {
          value: "1",
          label: "加油充电",
        },
        {
          value: "2",
          label: "酒店民宿",
        },
        {
          value: "3",
          label: "餐饮美食",
        },
        {
          value: "4",
          label: "慧妍学",
        },
        {
          value: "5",
          label: "超市购物",
        },
        {
          value: "6",
          label: "健身运动",
        },
        {
          value: "7",
          label: "医疗健康",
        },
        {
          value: "8",
          label: "家政服务",
        },
      ],
      loading: false,
      query: {
        type: "0",
        phone: "",
        shopName: "",
        address: "0",
        page: 1,
        pageSize: 10,
      },
      title: "",
      total: 0,
    };
  },
  watch: {
    query: {
      handler: debounce(function (val) {
        console.log(1);
      }),
      deep: true,
    },
  },
  methods: {
    handleTop(){

    },
    handleEdit(){
      this.$router.push('/noticeManage/editNotice')
    },
    handleAdd(){
      this.$router.push('/noticeManage/addNotice')
    },
    // 点击下架
    handleDel(row) {},
    handleSizeChange(val) {
      this.query.page = 1;
      this.query.pageSize = val;
    },
    handleCurrentChange(val) {
      this.query.page = val;
    },

    search() {
      this.query.page = 1;
    },
  },
  created() {},
};
</script>
  
<style lang="scss" scoped>
.noticeManage {
  .search{
    justify-content: space-between;
  }
}
</style>
  