synthetical.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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' || item.Source === 'yanxuanspecial'"> <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' || item.Source === 'yanxuanspecial'"> <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 v-if="showAudioBox">
  55. <audioModule :showAudioPop.sync="showAudioPop" />
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import { Search, Reports } from "@/config/api";
  61. import ChartItem from "@/components/ItemComponent/chartItem.vue";
  62. import ReportItem from "@/components/ItemComponent/reportItem.vue";
  63. import RoadshowItem from "@/components/ItemComponent/roadshowItem.vue";
  64. import ActivityItem from "@/components/ItemComponent/activityItem.vue";
  65. import ItemContent from "./ItemContent.vue";
  66. import MorningDlg from "./morningDlg.vue";
  67. import Industrialsource from "./industrialsource.vue";
  68. import audioModule from "@/components/audioModule/index";
  69. export default {
  70. components: { Industrialsource, ChartItem, ReportItem, RoadshowItem, ActivityItem, ItemContent, MorningDlg, audioModule },
  71. props: {
  72. searchTxt: {
  73. type: String,
  74. default: "",
  75. },
  76. isSyntheticalShow: {
  77. type: Boolean,
  78. default: false,
  79. },
  80. pageNumSynthetical: {
  81. type: Number,
  82. default: "",
  83. },
  84. },
  85. data() {
  86. return {
  87. newDataList: [],
  88. isMorningShow: false, // 晨会的弹框
  89. morningItem: {}, // 晨会的弹框
  90. haveData: true,
  91. showAudioPop: false,
  92. };
  93. },
  94. watch: {
  95. pageNumSynthetical: {
  96. handler(val) {
  97. if (this.isSyntheticalShow) {
  98. this.getComprehensiveList();
  99. }
  100. },
  101. deep: true,
  102. immediate: true,
  103. },
  104. },
  105. computed: {
  106. showAudioBox() {
  107. return this.$store.state.audioBg.parseIntShow;
  108. },
  109. },
  110. methods: {
  111. // 获取数据
  112. async getComprehensiveList() {
  113. const res = await Search.getComprehensiveList({
  114. KeyWord: this.searchTxt.replace(/^\s+|\s+$/g, ""),
  115. CurrentIndex: this.pageNumSynthetical,
  116. PageSize: 10,
  117. });
  118. if (res.Ret === 200) {
  119. this.$parent.status = !res.Data.Paging.IsEnd ? "loadmore" : "nomore";
  120. let listArr = [];
  121. res.Data.List &&
  122. res.Data.List.forEach((item) => {
  123. let obj = {
  124. Source: item.Source,
  125. Article: item.Article || item.YanxuanSpecial,
  126. Newchart: item.Newchart,
  127. Activity: item.Activity || item.Activityspecial,
  128. Roadshow: item.Roadshow || item.Activityvideo || item.Activityvoice,
  129. ThreeSummary: item.Researchsummary || item.Minutessummary || item.Meetingreviewchapt || item.ProductInterior,
  130. IndustrialResource: item.IndustrialResource,
  131. };
  132. if (obj.Article && obj.Article.BodyHighlight) {
  133. obj.Article.Body = obj.Article.BodyHighlight;
  134. }
  135. listArr.push({ ...obj, IsShowData: obj.Article || obj.Newchart || obj.Roadshow || obj.Activity || obj.ThreeSummary || obj.IndustrialResource });
  136. });
  137. this.newDataList = this.pageNumSynthetical === 1 ? listArr : [...this.newDataList, ...listArr];
  138. this.haveData = this.newDataList && this.newDataList.length ? true : false;
  139. }
  140. },
  141. // 晨会弹框显示
  142. async showMorningDialog(item) {
  143. if (item.Source == "meetingreviewchapt") {
  144. await Reports.morning_meeting_history({ Id: item.Id, SourcePage: "首页" });
  145. this.isMorningShow = true;
  146. this.morningItem = item;
  147. }
  148. },
  149. // 处理数据
  150. dataListItem(item) {
  151. let obj = item.ThreeSummary ? { ...item.ThreeSummary, Source: item.Source } : {};
  152. return obj;
  153. },
  154. },
  155. };
  156. </script>
  157. <style lang="scss" scoped>
  158. .content-ul {
  159. padding: 30rpx 10rpx;
  160. display: flex;
  161. justify-content: space-between;
  162. .item-ul {
  163. width: 49%;
  164. &:first-child {
  165. margin-right: 10rpx;
  166. }
  167. }
  168. }
  169. </style>