<template>
  <div>
    <div class="container normal-panel normal-margin">
      <el-button type="primary" icon="el-icon-plus" v-if="tool.checkAuth($route.name,'insert')" size="small" @click="$router.push({path:'/notice_add'})">新 建</el-button>
    </div>
    <list ref="list">
      <template v-slot:edit="scope">
        <el-button class="inline-16" @click="$router.push({path:'/notice_edit',query:{id:scope.data.data.sat_noticeid}})" type="text" size="mini">编 辑</el-button>
      </template>
      <template v-slot:release="scope">
        <release v-if="tool.checkAuth($route.name,'update')"  :data="scope.data.data" @onSuccess="onSuccess"></release>
      </template>
      <template v-slot:topping="scope">
        <topping v-if="tool.checkAuth($route.name,'update')" :data="scope.data.data" @onSuccess="onSuccess"></topping>
      </template>
      <template v-slot:message="scope">
        <message class="inline-16" v-if="tool.checkAuth($route.name,'read')" :data="scope.data.data" @onSuccess="onSuccess"></message>
      </template>
      <template v-slot:data_statistics="scope">
        <el-button v-if="tool.checkAuth($route.name,'data_analysis')" type="text" size="small" @click="$router.push({path:'/notice_analysis',query:{id:scope.data.data.sat_noticeid}})">数据分析</el-button>
      </template>
      <template v-slot:del="scope">
        <on-del v-if="tool.checkAuth($route.name,'delete')" :data="scope.data.data" @onSuccess="onSuccess"></on-del>
      </template>
    </list>
  </div>
</template>

<script>
import list from './list/list.vue'
import release from './list/modules/release.vue'
import topping from './list/modules/tp.vue'
import message from './list/modules/message.vue'

import onDel from './list/modules/delete.vue'

export default {
  components:{
    list,
    release,
    topping,
    message,
    onDel
  },
  methods:{
    onSuccess () {
      this.$refs.list.listData()
    }
  }
}

</script>
<style>
</style>
<style scoped>
.search-panel p{
  flex: 1 0 auto;
  width:40px;
  font-size:14px
}
</style>