synthetical.vue 7.4 KB

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