<template>
  <div>
    <vxe-modal
      show-footer
      show-cancel-button
      show-confirm-button
      v-model="showPopup"
      title="标题"
      width="70%"
      height="70vh"
      :confirm-closable="false">
      <div>
        <CommonTable ref="refCommonTable"></CommonTable>
      </div>
    </vxe-modal>
  </div>
</template>

<script lang="ts" setup>
import { ref ,nextTick } from 'vue'
import CommonTable  from '../../components//CommonTable.vue'
const showPopup = ref(false)
const refCommonTable = ref()
const columns = ref();
function setIniData(row) {
  let columns = row.children.map(column => {  
      return {  
          field:column.code,
          title:column.title,
          minWidth:200,
          showHeaderOverflow:true,
          editRender: { name: 'input' }
      };   
   });  
  showPopup.value = true;
  let datas= []

  nextTick(async ()=>{
    refCommonTable.value.iniTable(columns,datas)
  })
}

defineExpose({
  setIniData,
});
</script>