marketlists.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <div id="marketlists">
  3. <el-row>
  4. <el-col :span="24" class="main">
  5. <div class="w_1200">
  6. <el-col :span="5" class="menu">
  7. <el-image :src="squareImage"></el-image>
  8. <span class="menuTitle">Menu</span>
  9. <el-col :span="24" class="menuList" v-for="(item, index) in menuList" :key="index">
  10. <p @click="changeMenu(item.name, index)" :style="`color:${menuIndex == index ? menuColor : ''}`">{{ item.name }}</p>
  11. </el-col>
  12. </el-col>
  13. <el-col :span="18" class="listInfo">
  14. <span v-if="display == 'list'">
  15. <el-col :span="24" class="listTop">
  16. <el-col :span="12" class="columnname">
  17. <span>|</span> <span>{{ column_name }}</span>
  18. </el-col>
  19. <el-col :span="12" class="search">
  20. <el-input placeholder="请输入名称" v-model="infoName" class="input-with-select">
  21. <el-button slot="append" icon="el-icon-search"></el-button>
  22. </el-input>
  23. </el-col>
  24. </el-col>
  25. <el-col :span="24" class="listDown">
  26. <el-button @click="display = 'detail'">详情</el-button>
  27. </el-col>
  28. </span>
  29. <span v-else>
  30. <el-button @click="display = 'list'">返回</el-button>
  31. </span>
  32. </el-col>
  33. </div>
  34. </el-col>
  35. </el-row>
  36. </div>
  37. </template>
  38. <script>
  39. import { mapState, createNamespacedHelpers } from 'vuex';
  40. export default {
  41. name: 'marketlists',
  42. props: {},
  43. components: {},
  44. data: function() {
  45. return {
  46. squareImage: require('@/assets/live/square_big.png'),
  47. // 菜单
  48. menuList: [{ name: '科技需求' }, { name: '技术成果' }, { name: '商务信息' }, { name: '专家服务' }],
  49. menuIndex: '0',
  50. menuColor: 'rgb(254, 149, 14)',
  51. // 右侧显示
  52. // list:列表,detail:详情
  53. display: 'list',
  54. // 右侧头部栏目
  55. column_name: '科技需求',
  56. // 搜索
  57. infoName: '',
  58. };
  59. },
  60. created() {
  61. this.searchColumn();
  62. },
  63. methods: {
  64. // 查询栏目
  65. async searchColumn() {
  66. if (this.type == 0) {
  67. this.changeMenu(this.columnName, this.type);
  68. } else if (this.type == 1) {
  69. this.changeMenu(this.columnName, this.type);
  70. } else if (this.type == 2) {
  71. this.changeMenu(this.columnName, this.type);
  72. } else if (this.type == 3) {
  73. this.changeMenu(this.columnName, this.type);
  74. }
  75. if (this.id) {
  76. this.display = 'detail';
  77. } else {
  78. this.display = 'list';
  79. }
  80. },
  81. // 选择菜单
  82. changeMenu(name, index) {
  83. this.display = 'list';
  84. this.column_name = name;
  85. this.menuIndex = index;
  86. this.menuColor = 'rgb(254, 149, 14)';
  87. },
  88. },
  89. computed: {
  90. ...mapState(['user']),
  91. type() {
  92. return this.$route.query.type;
  93. },
  94. columnName() {
  95. return this.$route.query.column_name;
  96. },
  97. id() {
  98. return this.$route.query.id;
  99. },
  100. pageTitle() {
  101. return `${this.$route.meta.title}`;
  102. },
  103. },
  104. metaInfo() {
  105. return { title: this.$route.meta.title };
  106. },
  107. };
  108. </script>
  109. <style lang="less" scoped>
  110. .w_1200 {
  111. width: 80%;
  112. margin: 0 auto;
  113. }
  114. .main {
  115. margin: 15px 0;
  116. .menu {
  117. height: 600px;
  118. overflow: hidden;
  119. padding: 15px 10px;
  120. background: no-repeat 100% 100%;
  121. background-image: url('~@/assets/live/menu_back.jpg');
  122. box-sizing: border-box;
  123. box-shadow: 0 0 10px #bbbaba;
  124. .menuTitle {
  125. font-size: 24px;
  126. color: #92959a;
  127. font-weight: bold;
  128. position: relative;
  129. top: -10px;
  130. left: 10px;
  131. }
  132. .menuList {
  133. height: 60px;
  134. line-height: 60px;
  135. border-bottom: 1px solid #2d64b3;
  136. p {
  137. font-weight: bold;
  138. font-size: 18px;
  139. color: #044b79;
  140. }
  141. }
  142. .menuList:hover {
  143. cursor: pointer;
  144. }
  145. }
  146. .listInfo {
  147. float: right;
  148. width: 78%;
  149. height: 600px;
  150. overflow: hidden;
  151. box-shadow: 0 0 10px #2d64b3;
  152. padding: 10px;
  153. .listTop {
  154. height: 49px;
  155. line-height: 49px;
  156. border-bottom: 1px solid #ccc;
  157. .columnname {
  158. span:first-child {
  159. color: #22529a;
  160. font-weight: bold;
  161. font-size: 25px;
  162. }
  163. span:last-child {
  164. color: #22529a;
  165. font-size: 20px;
  166. font-weight: bold;
  167. }
  168. }
  169. }
  170. }
  171. }
  172. </style>