<template>
  <a-drawer :title="drawerTitle" placement="right" width="100%" :visible="isVisible" @close="closeDrawer" style="margin:10px">
   <template #extra>
     <a-button style="margin-right: 8px" @click="closeDrawer" type="text">关闭</a-button>
   </template>
   <TplItem ref="refTplItem"></TplItem>
  </a-drawer>
</template>
<script lang="ts" setup>
 
 import { ref, nextTick } from 'vue';
 import TplItem from './TplItem.vue';
 import { saveOrUpdateBatch } from '../../alloc/BaosongTaskAlloc.api';
 import { VXETable } from 'vxe-table';
 import { textAreaProps } from 'ant-design-vue/lib/input/inputProps';


 const isVisible = ref(false)
 const refTpl = ref()
 const refTplItem = ref()
 const drawerTitle= ref();
 const curTpl = ref()
 function handleSuccess() {
 }

 function closeDrawer() {
   isVisible.value = false
 }

 function setIniData(Tpl) {
   drawerTitle.value="模板【"+Tpl.nm+"】"
   curTpl.value = Tpl
   isVisible.value = true
   nextTick(async () => {
     await refTplItem.value.setData(Tpl);
   });
 }


 async function saveData() {
   closeDrawer();
 }

 defineExpose({
   setIniData,
 });



</script>

<style scoped></style>
