招聘网页
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <div style="height: 100%;">
  3. <template v-if="detail">
  4. <a-page-header>
  5. <template #title>
  6. <a-button @click="back" type="link">
  7. <ArrowLeftOutlined />返回
  8. </a-button>
  9. </template>
  10. <a-card style="width: 100%">
  11. <a-card-meta :title="detail.title" :description="'发布时间:'+detail.created_at">
  12. </a-card-meta>
  13. <a-divider />
  14. <div v-html="detail.content"></div>
  15. </a-card>
  16. </a-page-header>
  17. </template>
  18. <template v-else>
  19. <a-list item-layout="horizontal" :data-source="articleList">
  20. <template #renderItem="{ item }">
  21. <a-list-item @click="toDetail(item)">
  22. <a-list-item-meta :title="item.title" :description="'发布时间:'+item.created_at">
  23. </a-list-item-meta>
  24. <template #extra>
  25. <image-container
  26. :imgObj="{src: imageprefix + item.cover_img,width: '153px',height:'100px'}"></image-container>
  27. </template>
  28. </a-list-item>
  29. </template>
  30. </a-list>
  31. <a-flex align="center" justify="center">
  32. <a-pagination hideOnSinglePage v-model:current="current" :total="total" @change="pageChange" />
  33. </a-flex>
  34. </template>
  35. </div>
  36. </template>
  37. <script setup lang="ts">
  38. import { ref, computed, onMounted, defineProps, watch } from 'vue';
  39. import { GetArticleList } from '@/apis/models';
  40. import { ArrowLeftOutlined } from '@ant-design/icons-vue';
  41. import { useCommon } from '@/hooks/useCommon';
  42. let { store, dayjs, richOption, ExclamationCircleOutlined, Modal, imageprefix, disabledDateFront } = useCommon();
  43. let props = defineProps(['key_id']);
  44. let articleList = ref<object[]>([])
  45. let detail = ref<Object>(null)
  46. let key = ref<Number>(10)
  47. let current = ref<Number>(1)
  48. let total = ref<Number>(0)
  49. const pageChange = (page) => {
  50. current.value = page
  51. getArticleList(key.value)
  52. }
  53. const getArticleList = (val) => {
  54. GetArticleList({ section_id: val, page: current.value, sortby: 'desc' }).then(res => {
  55. articleList.value = res.data.articles;
  56. total.value = res.data.total;
  57. })
  58. }
  59. const toDetail = (data) => {
  60. detail.value = data
  61. }
  62. const back = (data) => {
  63. detail.value = null
  64. }
  65. // const download = (val) => {
  66. // let url = 'https://rcsc-test.jcjob.cn/img' + val;
  67. // window.open(url);
  68. // }
  69. watch(() => props.key_id, (newVal) => {
  70. key.value = newVal
  71. getArticleList(newVal)
  72. }, { immediate: true })
  73. </script>
  74. <style>
  75. </style>