synthetical.vue 5.9 KB

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