list copy.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <div id="list">
  3. <el-col :span="24" class="main">
  4. <el-col :span="5" class="menu">
  5. <el-image :src="squareImage"></el-image>
  6. <span>Menu</span>
  7. <el-col class="menuList" :span="24" v-for="(item, index) in menuList" :key="index">
  8. <p @click="changeMenu(item.name, index)" :style="`color:${menuIndex == index ? menuColor : ''}`">{{ item.name }}</p>
  9. </el-col>
  10. </el-col>
  11. <el-col :span="19" class="info" v-if="display == 1">
  12. <el-col v-if="menuIndex == '0'" class="leftInfo">
  13. <el-col :span="24" class="leftTop">
  14. <span>|</span> <span>{{ menuName }}</span>
  15. </el-col>
  16. <el-col class="infoLeftList" :span="24" v-for="(item, index) in zhuantiList" :key="index">
  17. <p>{{ item.publish_time }}</p>
  18. <p>
  19. <span class="textOver" @click="clickzhuanti(item.id)">{{ item.title }}</span>
  20. <span>{{ item.titlejj }}</span>
  21. </p>
  22. </el-col>
  23. </el-col>
  24. <el-col v-if="menuIndex == '1'" class="leftInfo">
  25. <el-col :span="24" class="leftTop">
  26. <span>|</span> <span>{{ menuName }}</span>
  27. </el-col>
  28. <el-col class="infoRightList" :span="24" v-for="(item, index) in exportList" :key="index">
  29. <p>
  30. <span class="textOver" @click="clickjishu(item.id)">{{ item.title }}</span
  31. ><span class="textOver">{{ item.publish_time }}</span>
  32. </p>
  33. </el-col>
  34. </el-col>
  35. <el-col v-if="menuIndex == '2'" class="leftInfo">
  36. <el-col :span="24" class="leftTop">
  37. <span>|</span> <span>{{ menuName }}</span>
  38. </el-col>
  39. <el-col class="infoRightList" :span="24" v-for="(item, index) in hangyeList" :key="index">
  40. <p>
  41. <span class="textOver" @click="clickhangye(item.id)">{{ item.title }}</span
  42. ><span class="textOver">{{ item.publish_time }}</span>
  43. </p>
  44. </el-col>
  45. </el-col>
  46. <el-col v-if="menuIndex == '3'" class="leftInfo">
  47. <el-col :span="24" class="leftTop">
  48. <span>|</span> <span>{{ menuName }}</span>
  49. </el-col>
  50. <el-col class="infoLeftList" :span="24" v-for="(item, index) in jiaoyuList" :key="index">
  51. <p>{{ item.publish_time }}</p>
  52. <p>
  53. <span class="textOver" @click="clickjiaoyu(item.id)">{{ item.title }}</span>
  54. <span>{{ item.titlejj }}</span>
  55. </p>
  56. </el-col>
  57. </el-col>
  58. <el-col class="page">
  59. <el-pagination
  60. background
  61. @current-change="handleCurrentChange"
  62. :current-page.sync="currentPage"
  63. :page-size="pageSize"
  64. layout="total,prev, pager, next, jumper"
  65. :total="pageTotal"
  66. >
  67. </el-pagination>
  68. </el-col>
  69. </el-col>
  70. <el-col :span="19" v-if="display == 2" class="info">
  71. <semDetail :newsid="newsid"></semDetail>
  72. </el-col>
  73. <el-col :span="19" v-if="display == 3" class="info">
  74. <detail :newsid="newsid"></detail>
  75. </el-col>
  76. <el-col :span="19" v-if="display == 4" class="info">
  77. <eduDetail :newsid="newsid"></eduDetail>
  78. </el-col>
  79. <el-col :span="19" v-if="display == 5" class="info">
  80. <luyanDetail :newsid="newsid"></luyanDetail>
  81. </el-col>
  82. </el-col>
  83. </div>
  84. </template>
  85. <script>
  86. import _ from 'lodash';
  87. import semDetail from '@/layout/technical/semDetail.vue';
  88. import detail from '@/layout/technical/detail.vue';
  89. import eduDetail from '@/layout/technical/eduDetail.vue';
  90. import luyanDetail from '@/layout/technical/luyanDetail.vue';
  91. import { mapState, createNamespacedHelpers } from 'vuex';
  92. const { mapActions: news } = createNamespacedHelpers('news');
  93. const { mapActions: newsguidance } = createNamespacedHelpers('newsguidance');
  94. const { mapActions: newsroadshow } = createNamespacedHelpers('newsroadshow');
  95. export default {
  96. name: 'list',
  97. props: {},
  98. components: {
  99. semDetail,
  100. detail,
  101. eduDetail,
  102. luyanDetail,
  103. },
  104. data: () => ({
  105. newsid: '',
  106. display: '1',
  107. squareImage: require('@/assets/live/square_big.png'),
  108. menuList: [{ name: '专家问诊' }, { name: '行业研究' }, { name: '嘉宾访谈' }, { name: '项目路演' }],
  109. menuIndex: '0',
  110. menuName: '专题研讨',
  111. menuColor: 'rgb(254, 149, 14)',
  112. currentPage: 1,
  113. pageTotal: 0,
  114. pageSize: 10,
  115. limit: 10,
  116. zhuantiList: [],
  117. exportList: [],
  118. hangyeList: [],
  119. jiaoyuList: [],
  120. }),
  121. created() {
  122. this.searchList();
  123. this.search();
  124. },
  125. computed: {
  126. id() {
  127. return this.$route.query.id;
  128. },
  129. pageTitle() {
  130. return `${this.$route.meta.title}`;
  131. },
  132. },
  133. metaInfo() {
  134. return { title: this.$route.meta.title };
  135. },
  136. methods: {
  137. ...news(['query']),
  138. ...newsguidance({ danceQuery: 'query' }),
  139. ...newsroadshow({ adshowQuery: 'query' }),
  140. async searchList({ skip = 0, limit = 10, ...info } = {}) {
  141. if (this.$route.query.column_name == '专家问诊') {
  142. this.changeMenu(this.$route.query.column_name, 0);
  143. } else if (this.$route.query.column_name == '行业研究') {
  144. this.changeMenu(this.$route.query.column_name, 1);
  145. } else if (this.$route.query.column_name == '嘉宾访谈') {
  146. this.changeMenu(this.$route.query.column_name, 2);
  147. } else if (this.$route.query.column_name == '项目路演') {
  148. this.changeMenu(this.$route.query.column_name, 3);
  149. }
  150. },
  151. async changeMenu(name, index) {
  152. this.menuIndex = index;
  153. this.menuColor = 'rgb(254, 149, 14)';
  154. this.menuName = name;
  155. this.initList({ name });
  156. },
  157. async initList({ name, skip = 0, limit = 10, ...info } = {}) {
  158. this.display = 1;
  159. let res = [];
  160. if (name == '专家问诊') {
  161. this.pageSize = 5;
  162. res = await this.query({ skip, limit, column_name: '专家问诊', ...info });
  163. this.$set(this, `zhuantiList`, res.data);
  164. } else if (name == '行业研究') {
  165. this.pageSize = 10;
  166. res = await this.query({ skip, limit, column_name: '行业研究', ...info });
  167. this.$set(this, `exportList`, res.data);
  168. } else if (name == '嘉宾访谈') {
  169. this.pageSize = 10;
  170. res = await this.danceQuery({ skip, limit, column_name: '嘉宾访谈', ...info });
  171. this.$set(this, `hangyeList`, res.data);
  172. } else if (name == '项目路演') {
  173. this.pageSize = 5;
  174. res = await this.adshowQuery({ skip, limit, column_name: '项目路演', ...info });
  175. this.$set(this, `jiaoyuList`, res.data);
  176. }
  177. this.$set(this, `pageTotal`, res.total);
  178. },
  179. handleCurrentChange(val) {
  180. const name = this.menuName;
  181. if (name == '专题研讨' || name == '教育培训') {
  182. this.limit = 5;
  183. }
  184. this.initList({ name: name, skip: (val - 1) * this.limit, limit: this.limit });
  185. },
  186. async search() {
  187. this.display = this.$route.query.display;
  188. this.newsid = this.id;
  189. },
  190. clickzhuanti(id) {
  191. this.display = '3';
  192. this.newsid = id;
  193. },
  194. clickjishu(id) {
  195. this.display = '3';
  196. this.newsid = id;
  197. },
  198. clickhangye(id) {
  199. this.display = '4';
  200. this.newsid = id;
  201. },
  202. clickjiaoyu(id) {
  203. this.display = '5';
  204. this.newsid = id;
  205. },
  206. },
  207. };
  208. </script>
  209. <style lang="less" scoped>
  210. .main {
  211. // width: 80%;
  212. width: 1200px;
  213. margin: 0 auto;
  214. float: none;
  215. }
  216. .menu {
  217. float: left;
  218. min-height: 600px;
  219. width: 20%;
  220. background: no-repeat bottom right;
  221. background-image: url(../../assets/live/menu_back.jpg);
  222. margin: 30px 0;
  223. padding: 10px 0 0 10px;
  224. box-sizing: border-box;
  225. box-shadow: 0 0 10px #bbbaba;
  226. }
  227. .menu .el-image {
  228. width: 30px;
  229. display: inline-table;
  230. margin: 10px 5px;
  231. }
  232. .menu span {
  233. font-size: 24px;
  234. color: #92959a;
  235. font-weight: 600;
  236. margin-left: 3px;
  237. position: relative;
  238. top: 10px;
  239. }
  240. .menuList p {
  241. line-height: 60px;
  242. font-size: 18px;
  243. cursor: pointer;
  244. border-bottom: 1px solid #2d64b3;
  245. color: #044b79;
  246. font-weight: 600;
  247. }
  248. .info {
  249. width: 77%;
  250. float: right;
  251. margin: 30px 0 30px 2px;
  252. min-height: 600px;
  253. box-shadow: 0 0 10px #2d64b3;
  254. overflow: hidden;
  255. right: 0px;
  256. background: #ffffff;
  257. }
  258. .leftInfo {
  259. height: 500px;
  260. overflow: hidden;
  261. }
  262. .leftTop {
  263. font-size: 18px;
  264. width: 96%;
  265. height: 41px;
  266. line-height: 35px;
  267. border-bottom: 1px solid #e5e5e5;
  268. position: relative;
  269. bottom: 1px;
  270. margin: 10px;
  271. font-weight: 600;
  272. color: #22529a;
  273. }
  274. .infoLeftList {
  275. float: left;
  276. width: 95%;
  277. border-bottom: 1px dashed #ccc;
  278. padding: 10px 0 10px 10px;
  279. height: 87px;
  280. margin: 0 0 0 5px;
  281. }
  282. .infoLeftList:hover p:last-child span:first-child {
  283. -webkit-transform: translateY(-3px);
  284. -ms-transform: translateY(-3px);
  285. transform: translateY(-3px);
  286. -webkit-box-shadow: 0 0 6px #999;
  287. box-shadow: 0 0 6px #999;
  288. -webkit-transition: all 0.5s ease-out;
  289. transition: all 0.5s ease-out;
  290. color: #005293;
  291. cursor: pointer;
  292. }
  293. .infoLeftList p:first-child {
  294. float: left;
  295. width: 20%;
  296. font-size: 15px;
  297. background: #044b79;
  298. text-align: center;
  299. color: #fff;
  300. font-weight: bold;
  301. padding: 4px 0px;
  302. margin: 0 0 0 5px;
  303. }
  304. .infoLeftList p:last-child {
  305. float: right;
  306. width: 70%;
  307. padding: 0 0 0 10px;
  308. }
  309. .infoLeftList p:last-child span:first-child {
  310. float: left;
  311. width: 90%;
  312. font-size: 18px;
  313. }
  314. .infoLeftList p:last-child span:last-child {
  315. float: left;
  316. width: 90%;
  317. font-size: 16px;
  318. overflow: hidden;
  319. text-overflow: ellipsis;
  320. -webkit-line-clamp: 2;
  321. word-break: break-all;
  322. display: -webkit-box;
  323. -webkit-box-orient: vertical;
  324. margin: 5px 0 0 0;
  325. color: #666;
  326. }
  327. .page {
  328. text-align: center;
  329. margin: 10px 0;
  330. }
  331. .infoRightList {
  332. float: left;
  333. width: 95%;
  334. padding: 7px 0;
  335. margin: 0 0 0 5px;
  336. }
  337. .infoRightList:nth-child(6) {
  338. border-bottom: 1px solid #ccc;
  339. padding: 0 0 17px 0;
  340. }
  341. .infoRightList:nth-child(7) {
  342. padding: 15px 0 0 0;
  343. }
  344. .infoRightList:nth-child(11) {
  345. border-bottom: 1px solid #ccc;
  346. padding: 0 0 15px 0;
  347. }
  348. .infoRightList:hover p span:first-child {
  349. -webkit-transform: translateY(-3px);
  350. -ms-transform: translateY(-3px);
  351. transform: translateY(-3px);
  352. -webkit-box-shadow: 0 0 6px #999;
  353. box-shadow: 0 0 6px #999;
  354. -webkit-transition: all 0.5s ease-out;
  355. transition: all 0.5s ease-out;
  356. color: #005293;
  357. cursor: pointer;
  358. }
  359. .infoRightList p {
  360. font-size: 18px;
  361. }
  362. .infoRightList p span:first-child {
  363. display: inline-block;
  364. width: 70%;
  365. margin: 0 20px 0 10px;
  366. }
  367. .infoRightList p span:last-child {
  368. display: inline-block;
  369. width: 21%;
  370. text-align: center;
  371. font-size: 16px;
  372. }
  373. </style>