<template>
  <BasicModal
    @register="registerModal"
    v-bind="$attrs"
    :footer="null"
    :draggable="false"
    :destroy-on-close="true"
    :width="800"
    title="AI问答"
    wrap-class-name="ai-modal"
  >
    <div class="p-5">
      <AiAnswer :isShowFill="true" @getFillVal="handleFill" />
    </div>
  </BasicModal>
</template>
<script lang="ts" setup>
  import { BasicModal, useModalInner } from '/@/components/Modal';
  import AiAnswer from './Index.vue';
  const emits = defineEmits(['getFillVal']);

  const [registerModal, { setModalProps, closeModal }] = useModalInner(async () => {
    setModalProps({
      confirmLoading: false,
      draggable: false,
      title: 'AI问答',
      footer: null,
      showOkBtn: false,
      showCancelBtn: false,
      destroyOnClose: true,
      width: 800,
      fixedHeight: true,
    });
  });

  const handleFill = (info) => {
    closeModal();
    emits('getFillVal', info);
  };
</script>
<style lang="less" scoped></style>
