<template>
  <div>
    <setRule v-if="tool.checkAuth($route.name,'update')" ref="setRule">
      <el-button slot="save" type="warning" size="small" @click="onSave">保 存</el-button>
    </setRule>
    <setAgent ref="setAgent">
      <el-button v-if="tool.checkAuth($route.name,'agent_insert')" slot="add" type="default" size="small" @click="onShow">添 加</el-button>
      <template v-slot:del="scope">
        <del-agent v-if="tool.checkAuth($route.name,'agent_delete')" :data="scope.data.data" @onSuccess="onSuccess"></del-agent>
      </template>
    </setAgent>
    <selectAgent ref="selectAgent" @onSuccess="onSuccess"></selectAgent>
  </div>
</template>

<script>
import setRule from './modules/setRule.vue'
import setAgent from './modules/setAgent.vue'
import selectAgent from './modules/select_agent.vue'
import delAgent from './modules/del_agent.vue'

export default {
  components:{
    setRule,
    setAgent,
    selectAgent,
    delAgent
  },
  methods:{
    onSave () {
      this.$refs['setRule'].updateOrderclueruleMain()
    },
    onShow () {
      this.$refs['selectAgent'].onShow()
    },
    onSuccess () {
      this.$refs['setAgent'].listData()
    },
  }
}

</script>
<style>
</style>