<template>
  <BasicModal
    v-bind="$attrs"
    destroyOnClose
    @register="registerModal"
    :title="getTitle"
    @ok="handleSubmit"
    width="900px"
    :showCancelBtn="false"
    okText="关闭"
  >
    <div v-html="docInfo" id="printDoc" />
    <!-- <template #insertFooter>
      <a-button v-print="printObj" type="primary" color="warning">打印</a-button>
    </template> -->
  </BasicModal>
</template>
<script lang="ts" setup>
  import { ref, onMounted, reactive } from 'vue';
  import { BasicModal, useModalInner } from '/@/components/Modal';
  // import { viewObj } from '/@/api/info/busDocApi';

  const getTitle = '使用帮助';
  const docInfo = ref('使用帮助');

  onMounted(async () => {
    await getData();
  });

  // const printObj = reactive({
  //   id: 'printDoc',
  // });

  const [registerModal, { closeModal }] = useModalInner(async _data => {
    // console.log('data', data);
    await getData();
  });

  async function getData() {
    // const res = await viewObj('doc');
    // if (res) {
    //   docInfo.value = res.content;
    // }
  }
  // 提交按钮事件
  async function handleSubmit() {
    closeModal();
  }
</script>
