<template>
  <div v-if="show">
    <basicLayout 
      
      ref="basicLayout" 
      :oldFormPath="{
        add:'views/printmodel/modules'
      }"
      tableName="printmodelTable" 
      idName="sys_printmodelid" 
      :apiId="{query:20221121155801,del:20221121160101}"
      :options="options">
      <div slot="custom"></div>
      <template v-slot:tbList="scope">
        <div>
          {{scope.data.column.data[[scope.data.column.columnname]]}}
        </div>
      </template>
       <template v-slot:tbOpreation="scope">
        <el-button class="inline-16" type="text" size="small" @click="showTemp(scope.data.data)">模板设计</el-button>
        <el-popconfirm
          confirm-button-text='确定'
          cancel-button-text='取消'
          icon="el-icon-info"
          icon-color="red"
          title="删除当前模板？"
          @confirm="deleteTemp(scope.data.data)"
        >
        <el-button slot="reference" type="text" size="small">删 除</el-button>
        </el-popconfirm>
        
      </template>
    </basicLayout>
  </div>
</template>

<script>
/**
 * @basicLayout 提供this.$ref['basicLayout'].listData()方法查询列表信息
 * @param {string} formPath 新建,编辑组件所在文件夹名称,以后所有列表新增修改文件统一放入Form文件夹下面,并创建与开发应用相同的名称的子文件夹
 * @param {string} tableName 开发端配置的表格名称
 * @param {String} idName 数据主id名称
 * @param {object} apiId:{query:查询的接口id,del:删除的接口id} 
 * @param {Array} options:{label:描述,value:值} 
 */
export default {
  data () {
    return {
      options:[],
      show:true
    }
  },
  components:{
  },
  methods:{
    showTemp (row) {
      this.$router.push({path:'/printmodelDesign',query:{
        id:row.sys_printmodelid
      }})
    },
    async deleteTemp (row) {
      const res = await this.$api.requested({
        "id": 20221121160101,
        "content": { 
          "sys_printmodelid": row.sys_printmodelid
        }
      })
      this.tool.showMessage(res,()=>{
        this.$refs['basicLayout'].listData()
      })
    }
  }
}

</script>
<style>
</style>