synthetical.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <template>
  2. <view>
  3. <view class="content-ul" v-if="haveData">
  4. <view class="item-ul">
  5. <block v-for="(item, index) in newDataList" :key="index">
  6. <view v-if="index % 2 == 0 && item.IsShowData">
  7. <block v-if="item.Source === 'article'"> <ReportItem :list="item.Article" /></block>
  8. <block v-if="item.Source === 'newchart'">
  9. <ChartItem :list="item.Newchart" :isMyChartCollection="isMyChartCollection" @myChartIsTop="myChartIsTop" @myChartCollect="myChartCollect" />
  10. </block>
  11. <block v-if="item.Source === 'roadshow' || item.Source === 'activityvideo' || item.Source === 'activityvoice'">
  12. <RoadshowItem :list="item.Roadshow" @isCollectionHandeler="isCollectionHandeler" />
  13. </block>
  14. <block v-if="item.Source === 'activity' || item.Source === 'activityspecial'">
  15. <ActivityItem :list="item.Activity" />
  16. </block>
  17. <block v-if="item.Source === 'industrialsource'">
  18. <Industrialsource :list="item.IndustrialResource" />
  19. </block>
  20. <block v-if="['researchsummary', 'minutessummary', 'meetingreviewchapt', 'productinterior'].includes(item.Source)">
  21. <item-content :list="dataListItem(item)" @showMorningDialog="showMorningDialog" />
  22. </block>
  23. </view>
  24. </block>
  25. </view>
  26. <view class="item-ul">
  27. <block v-for="(item, index) in newDataList" :key="index">
  28. <view v-if="index % 2 !== 0 && item.IsShowData">
  29. <block v-if="item.Source === 'article'"> <ReportItem :list="item.Article" /></block>
  30. <block v-if="item.Source === 'newchart'">
  31. <ChartItem :list="item.Newchart" :isMyChartCollection="isMyChartCollection" @myChartIsTop="myChartIsTop" @myChartCollect="myChartCollect" />
  32. </block>
  33. <block v-if="item.Source === 'industrialsource'">
  34. <Industrialsource :list="item.IndustrialResource" />
  35. </block>
  36. <block v-if="item.Source === 'roadshow' || item.Source === 'activityvideo' || item.Source === 'activityvoice'">
  37. <RoadshowItem :list="item.Roadshow" @isCollectionHandeler="isCollectionHandeler" />
  38. </block>
  39. <block v-if="item.Source === 'activity' || item.Source === 'activityspecial'">
  40. <ActivityItem :list="item.Activity" />
  41. </block>
  42. <block v-if="['researchsummary', 'minutessummary', 'meetingreviewchapt', 'productinterior'].includes(item.Source)">
  43. <item-content :list="dataListItem(item)" @showMorningDialog="showMorningDialog" />
  44. </block>
  45. </view>
  46. </block>
  47. </view>
  48. </view>
  49. <view class="nodata" v-else>
  50. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  51. <text>暂时没有符合条件的活动</text>
  52. </view>
  53. <morning-dlg v-if="isMorningShow" :isMorningShow.sync="isMorningShow" :morningItem.sync="morningItem" />
  54. </view>
  55. </template>
  56. <script>
  57. import { Search } from "@/config/api";
  58. import ChartItem from "@/components/ItemComponent/chartItem.vue";
  59. import ReportItem from "@/components/ItemComponent/reportItem.vue";
  60. import RoadshowItem from "@/components/ItemComponent/roadshowItem.vue";
  61. import ActivityItem from "@/components/ItemComponent/activityItem.vue";
  62. import ItemContent from "./ItemContent.vue";
  63. import MorningDlg from "./morningDlg.vue";
  64. import Industrialsource from "./industrialsource.vue";
  65. export default {
  66. components: { Industrialsource, ChartItem, ReportItem, RoadshowItem, ActivityItem, ItemContent, MorningDlg },
  67. props: {
  68. searchTxt: {
  69. type: String,
  70. default: "",
  71. },
  72. isSyntheticalShow: {
  73. type: Boolean,
  74. default: false,
  75. },
  76. pageNumSynthetical: {
  77. type: Number,
  78. default: "",
  79. },
  80. },
  81. data() {
  82. return {
  83. newDataList: [],
  84. isMorningShow: false, // 晨会的弹框
  85. morningItem: {}, // 晨会的弹框
  86. haveData: true,
  87. };
  88. },
  89. watch: {
  90. pageNumSynthetical: {
  91. handler(val) {
  92. if (this.isSyntheticalShow) {
  93. this.getComprehensiveList();
  94. }
  95. },
  96. deep: true,
  97. immediate: true,
  98. },
  99. },
  100. computed: {},
  101. components: {},
  102. methods: {
  103. // 获取数据
  104. async getComprehensiveList() {
  105. const res = await Search.getComprehensiveList({
  106. KeyWord: this.searchTxt.replace(/^\s+|\s+$/g, ""),
  107. CurrentIndex: this.pageNumSynthetical,
  108. PageSize: 10,
  109. });
  110. if (res.Ret === 200) {
  111. this.$parent.status = !res.Data.Paging.IsEnd ? "loadmore" : "nomore";
  112. let listArr = [];
  113. res.Data.List &&
  114. res.Data.List.forEach((item) => {
  115. let obj = {
  116. Source: item.Source,
  117. Article: item.Article,
  118. Newchart: item.Newchart,
  119. Activity: item.Activity || item.Activityspecial,
  120. Roadshow: item.Roadshow || item.Activityvideo || item.Activityvoice,
  121. ThreeSummary: item.Researchsummary || item.Minutessummary || item.Meetingreviewchapt || item.ProductInterior,
  122. IndustrialResource: item.IndustrialResource,
  123. };
  124. if (obj.Article && obj.Article.BodyHighlight) {
  125. obj.Article.Body = obj.Article.BodyHighlight;
  126. }
  127. listArr.push({ ...obj, IsShowData: obj.Article || obj.Newchart || obj.Roadshow || obj.Activity || obj.ThreeSummary || obj.IndustrialResource });
  128. });
  129. this.newDataList = this.pageNumSynthetical === 1 ? listArr : [...this.newDataList, ...listArr];
  130. this.haveData = this.newDataList && this.newDataList.length ? true : false;
  131. }
  132. },
  133. // 晨会弹框显示
  134. showMorningDialog(item) {
  135. console.log(item);
  136. if (item.Source == "meetingreviewchapt") {
  137. this.isMorningShow = true;
  138. this.morningItem = item;
  139. }
  140. },
  141. // 处理数据
  142. dataListItem(item) {
  143. let obj = item.ThreeSummary ? { ...item.ThreeSummary, Source: item.Source } : {};
  144. return obj;
  145. },
  146. },
  147. };
  148. </script>
  149. <style lang="scss" scoped>
  150. .content-ul {
  151. padding: 30rpx 10rpx;
  152. display: flex;
  153. justify-content: space-between;
  154. .item-ul {
  155. width: 49%;
  156. &:first-child {
  157. margin-right: 10rpx;
  158. }
  159. }
  160. }
  161. </style>