<template>
  <base-form slot="content" :data="searchData" ref="ruleForm">
    <div slot="footer">
      <el-button :loading="listLoading" icon="el-icon-search" class="xl-form-btn bgc1" @click="searchHandle">查询</el-button>
      <!-- <el-button :loading="listLoading" class="xl-form-btn t4" @click="updateCash">更新缓存</el-button> -->
      <el-button :loading="listLoading" class="xl-form-btn t4" @click="copy">复制临时</el-button>
    </div>
  </base-form>
</template>
<script>
export default {
  props: {
    listLoading: Boolean
  },
  inject: ['parentData'],
  data () {
    return {
      searchData: [
        {label: '主题名称', key: 'theme_name'},
        {label: '备注', key: 'remark'},
      ]
    }
  },
  methods: {
    copy () {
      this.$api.other.admthemecopy({
        id: 8
      }).then(res => {
        this.$msg('复制成功~')
        this.$router.go(0)
      })
    },
    searchHandle () {
      const oldform = this.$refs.ruleForm.baseForm
      let newForm = {...oldform}
      this.$emit('change', newForm)
    },
    // updateCash () {
    //   this.$store.dispatch('user/getDict').then().then(res => {
    //     this.$msg('更新成功~')
    //   })
    // }
  }
}
</script>
