import OHeader from '@/components/m-header';
import request from '@/helpers/request';
import { state } from '@/state';
import { defineComponent, onMounted, ref } from 'vue';
import { useRoute } from 'vue-router';
import styles from './information-detail.module.less';

export default defineComponent({
  name: 'notice-detail',
  setup() {
    const route = useRoute();
    const detail = ref<any>({});

    const getDetails = async () => {
      try {
        const { data } = await request.get(
          '/edu-app/sysNotice/detail/' + route.query.id
        );
        detail.value = data;
      } catch {
        //
      }
    };

    onMounted(() => {
      getDetails();
    });
    return () => (
      <div class={styles.detail}>
        <OHeader />
        <div class={styles.detailContent}>
          <div class={styles.title}>{detail.value.title}</div>
          <div class={styles.who}>
            <span>酷乐秀</span>
            {detail.value.createTime}
          </div>

          <div class={styles.content} v-html={detail.value.content}></div>
        </div>
      </div>
    );
  }
});
