<template>
  <el-dialog v-model="visible" title="查看">
    <div>
      <div>
        <h3>{{ info.SYNOPSIS }}</h3>
      </div>
      <div class="mt-10">
        <span>发布人：{{ info.CREATOR }}</span>
        <span class="pl-10">发布时间：{{ info.CREATTIME }}</span>
      </div>
      <div class="mt-10">
        <div v-html="info.CONTENT" />
      </div>
      <div v-if="info.FILEPATH" class="mt-10">
        <div>
          附件：<el-button
            type="primary"
            text
            link
            @click="useDownloadFile(info.FILEPATH)"
          >
            下载
          </el-button>
        </div>
      </div>
    </div>
    <template #footer>
      <el-button @click="visible = false">关闭</el-button>
    </template>
  </el-dialog>
</template>

<script setup>
import { useVModel } from "@vueuse/core";
import useDownloadFile from "@/assets/js/useDownloadFile.js";

const props = defineProps({
  visible: {
    type: Boolean,
    required: true,
    default: false,
  },
  info: {
    type: Object,
    required: true,
    default: () => ({}),
  },
});
const emits = defineEmits(["update:visible"]);
const visible = useVModel(props, "visible", emits);
</script>

<style scoped lang="scss"></style>
