mechanism.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <div id="mechanism">
  3. <el-row>
  4. <el-col :span="24" class="info">
  5. <el-col :span="24" class="top">
  6. 机构团体
  7. </el-col>
  8. <el-col :span="24" class="list">
  9. <ul>
  10. <li v-for="(item, index) in list" :key="index">
  11. <el-link :underline="false">
  12. <el-col :span="20" class="title textOver">
  13. {{ item.name }}
  14. </el-col>
  15. <!-- <el-col :span="4" class="city textOver"> <i class="el-icon-location"></i>{{ item.city }} </el-col> -->
  16. <el-col :span="24" class="address textOver"> 地址:{{ item.addr || '暂无' }} </el-col>
  17. <el-col :span="24" class="content">
  18. <span>企业简介:</span>
  19. <p>{{ item.companybrief || '暂无' }}</p>
  20. </el-col>
  21. </el-link>
  22. </li>
  23. </ul>
  24. <el-col :span="24" class="page">
  25. <el-pagination
  26. @current-change="handleCurrentChange"
  27. :current-page="currentPage"
  28. layout="total, prev, pager, next, jumper"
  29. :total="mechanismTotal"
  30. :page-size="pageSize"
  31. >
  32. </el-pagination>
  33. </el-col>
  34. </el-col>
  35. </el-col>
  36. </el-row>
  37. </div>
  38. </template>
  39. <script>
  40. import _ from 'lodash';
  41. export default {
  42. name: 'mechanism',
  43. props: {
  44. mechanismList: null,
  45. mechanismTotal: null,
  46. },
  47. components: {},
  48. data: () => ({
  49. currentPage: 1,
  50. pageSize: 10,
  51. origin: [],
  52. list: [],
  53. }),
  54. created() {},
  55. computed: {},
  56. methods: {
  57. search(page = 1) {
  58. this.$set(this, `list`, this.origin[page - 1]);
  59. },
  60. handleCurrentChange(currentPage) {
  61. this.search(currentPage);
  62. },
  63. },
  64. watch: {
  65. mechanismList: {
  66. immediate: true,
  67. deep: true,
  68. handler(val) {
  69. if (val && val.length > 0) this.$set(this, `origin`, _.chunk(val, this.pageSize));
  70. this.search();
  71. },
  72. },
  73. },
  74. };
  75. </script>
  76. <style lang="less" scoped>
  77. ul {
  78. padding: 0;
  79. margin: 0;
  80. }
  81. li {
  82. padding: 0;
  83. margin: 0;
  84. list-style: none;
  85. }
  86. p {
  87. padding: 0;
  88. margin: 0;
  89. }
  90. .info {
  91. padding: 0 20px 20px 20px;
  92. }
  93. .top {
  94. height: 50px;
  95. line-height: 50px;
  96. border-bottom: 1px dashed #ccc;
  97. color: #215299;
  98. font-size: 18px;
  99. }
  100. .list ul li {
  101. float: left;
  102. width: 100%;
  103. height: 149px;
  104. padding: 20px 0 0 0;
  105. border-bottom: 1px dashed #ccc;
  106. }
  107. .list ul li .title {
  108. font-size: 16px;
  109. color: #215299;
  110. height: 36px;
  111. line-height: 36px;
  112. }
  113. .list ul li .city {
  114. text-align: right;
  115. font-size: 12px;
  116. color: #1b1b1b;
  117. height: 36px;
  118. line-height: 36px;
  119. }
  120. .list ul li .address {
  121. height: 30px;
  122. line-height: 30px;
  123. font-size: 16px;
  124. color: #000;
  125. }
  126. .list ul li .content span {
  127. float: left;
  128. width: 80px;
  129. text-align: center;
  130. height: 60px;
  131. line-height: 25px;
  132. font-size: 16px;
  133. color: #000;
  134. }
  135. .list ul li .content p {
  136. float: left;
  137. width: 830px;
  138. overflow: hidden;
  139. text-overflow: ellipsis;
  140. -webkit-line-clamp: 2;
  141. word-break: break-all;
  142. display: -webkit-box;
  143. -webkit-box-orient: vertical;
  144. font-size: 16px;
  145. color: #666;
  146. line-height: 30px;
  147. }
  148. .page {
  149. padding: 34px 0;
  150. text-align: center;
  151. }
  152. </style>