orderlist.vue 9.2 KB

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