<template>
  <BasicModal
    v-bind="$attrs"
    destroyOnClose
    @register="registerModal"
    title="数据表SQL语句"
    width="55%"
    :showCancelBtn="false"
    @ok="closeModal"
  >
    <CodeEditor v-model:value="codeData" language="sql" />
  </BasicModal>
</template>
<script lang="ts" setup>
  import { ref } from 'vue';

  import { BasicModal, useModalInner } from '/@/components/Modal';

  import { CodeEditor } from '/@/components/CodeEditor';

  const codeData = ref('');

  const [registerModal, { setModalProps, closeModal }] = useModalInner((data) => {
    setTimeout(() => {
      codeData.value = data;
    }, 100);
    setModalProps({ confirmLoading: false, defaultFullscreen: true });
  });
</script>
