<script setup>
import { getAISummary } from '../api'

const content = ref('')
const isLoading = ref(false)
async function fetchAI() {
  isLoading.value = true
  const res = await getAISummary()
  content.value = res.data.result
  isLoading.value = false
}
onMounted(() => {
  fetchAI()
})
</script>

<template>
  <el-dialog title="AI用户整体画像分析与建议">
    <div v-loading="isLoading">
      <el-input type="textarea" :rows="15" :value="content"></el-input>
    </div>
    <template #footer>
      <el-row justify="center">
        <el-button round @click="$emit('update:modelValue', false)">关闭</el-button>
      </el-row>
    </template>
  </el-dialog>
</template>
