list.vue 10 KB

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