<template>
  <div class="content">
    <div class="topSearch">
      <div class="left"></div>
      <div class="right">
        <Button type="primary" @click="modal1=true">新增</Button>
      </div>
    </div>
    <Table
      :loading="$store.state.app.isLoading"
      border
      ref="selection"
      :columns="columns"
      :data="data"
    >
      <template slot-scope="{ row }" slot="name">
        <span>{{ row.details.name }}</span>
      </template>
      <template slot-scope="{ row }" slot="title">
        <span>{{ row.details.title }}</span>
      </template>
      <template slot-scope="{ row }" slot="created_at">
        <span>{{ row.created_at | format }}</span>
      </template>
      <template slot-scope="{ row }" slot="enable">
        <i-switch
          :value="row.is_enable === 1 ? true : false"
          @on-change="
            value => {
              change(value, row);
            }
          "
        />
      </template>
      <template slot-scope="{ row }" slot="action">
        <a @click="edit(row)">编辑</a>
      </template>
      <template slot-scope="{ row }" slot="edit">
        <a @click="goTheme(row)">编辑</a>
      </template>
    </Table>
    <Modal v-model="modal1" title="新增关键词" @on-ok="ok" @on-cancel="cancel">
      <Input v-model="value5" type="textarea" placeholder="请输入..." />
    </Modal>
  </div>
</template>

<script>
import { getScenes, delScenes, editScenes } from "@/api/scenes";
export default {
  name: "categories",
  components: {},
  data() {
    return {
      modal1: false,
      data: [],
      columns: [
        {
          title: "关键词",
          key: "created_at"
        },
        {
          title: "添加时间",
          slot: "name"
        },
        {
          title: "操作",
          slot: "action"
        }
      ]
    };
  },
  methods: {
    goDetail() {
      this.$router.push({ path: "/signIn/detail", query: { id: "new" } });
    }
  },
  mounted() {}
};
</script>

<style lang="less"></style>
