<template>
  <div class="page-container">
    <div id="my-richText"></div>
  </div>
</template>

<script setup>
import { reactive, onMounted } from "vue";
import { NSelect, NInput, NButton } from "naive-ui";

import { useI18n } from "vue-i18n";
const { t } = useI18n();
import { useRoute } from "vue-router";
const route = useRoute();
import axios from 'axios'

const state = reactive({
  id: "", // 新闻id
});
onMounted(() => {
  if (route.query.id) {
    state.id = route.query.id;
  }
  getPressReleasesInfo();
});

//获取新闻信息
const getPressReleasesInfo = () => {
  let url = 'https://erpapi.fiee.com/api/fiee/pressreleases?id=' + state.id
  axios.get(url).then((res) => {
    // console.log(res)
    if (res.status === 200) {
      if (res.data.status === 0) {
       const myRichText = document.getElementById('my-richText')
       myRichText.innerHTML = res.data.data.content
      }
    }
  })
}
</script>
<style scoped lang="scss">
.page-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px;
}
</style>
