<template>
  <div>
    <div class="container normal-panel normal-margin">
      <add @addSuccess="onSuccess"></add>
    </div>
    <div class="container normal-panel ">
      <list ref="list">
        <template v-slot:edit="scope">
          <edit v-if="tool.checkAuth($route.name,'update')"  :data="scope.data"   :type="'text'" @updateSuccess="onSuccess"></edit>
        </template>
        <template v-slot:del="scope">
          <file_del v-if="tool.checkAuth($route.name,'delete')" :data="scope.data" :type="'text'" @deleteSuccess="onSuccess"></file_del>
        </template>
        <template v-slot:bind="scope">
          <el-button  :type="'text'" @click="$router.push({path:'/relation',query:{id:scope.data.plm_technicalinfoid}})" style="font-size: 12px">关联商品</el-button>
        </template>
      </list>
    </div>
  </div>
</template>

<script>
import list from './modules/list'
import add from './modules/add'
import edit from './modules/edit'
import file_del from './modules/fileDel'
import relation from "./modules/relation"
export default {
  name: "index",
  components: {
    list,
    add,
    edit,
    file_del,
    relation
  },
  methods: {
    onSuccess(){
      this.$refs.list.listData()
    }
  }
}
</script>

<style scoped>

</style>