ContentProjectTimeline.vue 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <ContentModuleCard
  3. title="招标/采购进度"
  4. class="content-project-timeline"
  5. v-if="stepList.length"
  6. >
  7. <div class="action-right-container" slot="header-actions">
  8. <span class="action-item clickable download-project-doc" v-if="false">
  9. <AppIcon name="xiazaixiangmubaogao"></AppIcon>
  10. <span class="action-text">下载项目报告</span>
  11. </span>
  12. <span class="action-item clickable follow-project">
  13. <QuickMonitor
  14. :id="content.id"
  15. type="project"
  16. :cache="true"
  17. :auto="false"
  18. direction="row"
  19. />
  20. </span>
  21. </div>
  22. <div class="bg-white">
  23. <TimeLine
  24. :markedSameId="content.id"
  25. :stepList="stepList"
  26. @itemClick="itemClick"
  27. >
  28. <template v-slot:step-footer="{ step }">
  29. <span v-if="step.bidAmountFormatted">
  30. {{ step.bidAmountFormatted }}中标
  31. </span>
  32. </template>
  33. </TimeLine>
  34. </div>
  35. </ContentModuleCard>
  36. </template>
  37. <script>
  38. import ContentModuleCard from '@/views/article/ui/ContentModuleCard.vue'
  39. import QuickMonitor from '@/composables/quick-monitor/component/QuickMonitor.vue'
  40. import { AppIcon, TimeLine } from '@/ui'
  41. import { mapState, mapGetters } from 'vuex'
  42. import { replaceKeyword, openAppOrWxPage, formatMoney } from '@/utils'
  43. import { LINKS } from '@/data'
  44. export default {
  45. name: 'ContentProjectTimeline',
  46. components: {
  47. AppIcon,
  48. TimeLine,
  49. QuickMonitor,
  50. ContentModuleCard
  51. },
  52. data() {
  53. return {
  54. // stepList: [
  55. // {
  56. // id: '226',
  57. // step_time: '2024-02-26',
  58. // // step_bidamount: 'moneyUnit(111)',
  59. // tags: [111],
  60. // content: '226-内容内容内容内容内容内容'
  61. // },
  62. // {
  63. // id: '225',
  64. // step_time: '2024-02-25',
  65. // tags: [111, 222, 333],
  66. // content: '225-内容内容内容内容内容内容'
  67. // },
  68. // {
  69. // id: '224',
  70. // step_time: '2024-02-24',
  71. // tags: [111, 222, 333],
  72. // content: '224-内容内容内容内容内容内容'
  73. // }
  74. // ]
  75. }
  76. },
  77. computed: {
  78. ...mapState({
  79. content: (state) => state.article.mainModel.content,
  80. expandModel: (state) => state.article.expandModel
  81. }),
  82. ...mapGetters('user', ['isNewBusiness']),
  83. stepList() {
  84. const projectProgress = this.expandModel.projectProgress || {}
  85. const projectName = projectProgress.name || ''
  86. const progressList = projectProgress?.list || []
  87. return progressList.map((p) => {
  88. return {
  89. ...p,
  90. step_time: p.time,
  91. tags: [p.tag],
  92. bidAmountFormatted: p.bidAmount ? formatMoney(p.bidAmount) : '',
  93. content: replaceKeyword(p.title, projectName, [
  94. '<span class="highlight-text">',
  95. '</span>'
  96. ])
  97. }
  98. })
  99. }
  100. },
  101. methods: {
  102. itemClick(item) {
  103. const id = item.id
  104. sessionStorage.setItem('bigvip-fid', JSON.stringify({ sid: id }))
  105. if (this.isNewBusiness) {
  106. openAppOrWxPage(LINKS.项目信息, {
  107. query: {}
  108. })
  109. } else {
  110. openAppOrWxPage(LINKS.项目详情页, {
  111. query: {}
  112. })
  113. }
  114. }
  115. }
  116. }
  117. </script>
  118. <style lang="scss" scoped>
  119. .action-item {
  120. color: $main;
  121. font-size: 14px;
  122. line-height: 20px;
  123. &:not(:last-of-type) {
  124. margin-right: 16px;
  125. }
  126. .action-text {
  127. margin-left: 4px;
  128. }
  129. }
  130. </style>