infoDetail.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <index-card :title="`${type}/${title}`">
  3. <el-button slot="more" size="small" round @click="closeDetail">返回</el-button>
  4. <div v-loading="loading" class="mt20" style="padding: 0 30px" v-html="data.content" />
  5. </index-card>
  6. </template>
  7. <script>
  8. import * as career from '@/api/webApi/career-news'
  9. import IndexCard from '@/views/login/components/modules/shared/IndexCard'
  10. export default {
  11. components: { IndexCard },
  12. props: {
  13. type: {
  14. type: String | Number,
  15. default: ''
  16. },
  17. title: {
  18. type: String,
  19. default: ''
  20. },
  21. id: {
  22. type: String | Number,
  23. default: ''
  24. }
  25. },
  26. data() {
  27. return {
  28. loading: false,
  29. data: {}
  30. }
  31. },
  32. watch: {
  33. id(newVal, oldVal) {
  34. this.getDetail()
  35. }
  36. },
  37. created() {
  38. this.getDetail()
  39. },
  40. methods: {
  41. closeDetail() {
  42. this.$emit('close')
  43. },
  44. getDetail() {
  45. if (!this.id) return
  46. this.loading = true
  47. career.info({ id: this.id }).then((res) => {
  48. console.log('career news info res', res)
  49. if (res.code == 200 || res.code == 0) {
  50. this.data = res.data
  51. } else {
  52. this.msgError(res.msg || 'career news info 请求异常')
  53. }
  54. this.loading = false
  55. })
  56. }
  57. }
  58. }
  59. </script>
  60. <style lang="scss" scoped>
  61. </style>