CooperativeCollegesIndex.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <!--
  2. * @Description: 合作院校
  3. * @Author: 空白格
  4. * @Date: 2022-08-11 17:17:33
  5. * @LastEditors: 空白格
  6. * @LastEditTime: 2022-08-11 17:48:45
  7. * @FilePath: \veterans_client_web\src\views\CooperativeColleges\CooperativeCollegesIndex.vue
  8. * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved.
  9. -->
  10. <template>
  11. <div class="cooperative-colleges">
  12. <BannerBreadcrumb title="合作院校" />
  13. <div class="cooperative-colleges-content" v-loading="loading">
  14. <div class="cooperative-colleges-content-list">
  15. <el-row :gutter="16">
  16. <el-col
  17. :xs="24"
  18. :sm="24"
  19. :md="24"
  20. :lg="12"
  21. :xl="12"
  22. v-for="(school, index) in schoolList"
  23. :key="index"
  24. >
  25. <div class="company-list-item">
  26. <div class="company-list-item-left">
  27. <el-image
  28. class="image"
  29. :src="
  30. school.schoolLogoUrl ||
  31. require('@/assets/images/default-school.png')
  32. "
  33. >
  34. <div slot="placeholder" class="image-slot">
  35. 加载中<span class="dot">...</span>
  36. </div>
  37. <div slot="error" class="image-slot">
  38. <el-image
  39. class="image"
  40. :src="require('@/assets/images/default-school.png')"
  41. ></el-image>
  42. </div>
  43. </el-image>
  44. </div>
  45. <div class="company-list-item-center">
  46. <div class="name">{{ school.schoolName }}</div>
  47. <div>
  48. {{ school.count || "-" }}个专业 ·
  49. {{ school.schoolNature | filtersDict(schoolNatureList) }}
  50. </div>
  51. </div>
  52. <div class="company-list-item-right">
  53. <i class="el-icon-arrow-right"></i>
  54. </div>
  55. </div>
  56. </el-col>
  57. </el-row>
  58. <div class="pagination" v-if="total">
  59. <el-pagination
  60. background
  61. layout="prev, pager, next"
  62. :page-size="queryParams.pageSize"
  63. :total="total"
  64. @current-change="currentChange"
  65. />
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. </template>
  71. <script>
  72. import BannerBreadcrumb from "@/components/BannerBreadcrumb";
  73. import { getDictData } from "@/api/Dict";
  74. import { getSchoolList } from "@/api/CooperativeColleges";
  75. export default {
  76. name: "CooperativeCollegesIndex",
  77. components: {
  78. BannerBreadcrumb,
  79. },
  80. data() {
  81. return {
  82. schoolNatureList: [],
  83. queryParams: {
  84. pageNum: 1,
  85. pageSize: 10,
  86. schoolName: undefined,
  87. },
  88. total: 0,
  89. schoolList: [],
  90. loading: false,
  91. };
  92. },
  93. created() {
  94. this.getDict();
  95. this.getList();
  96. },
  97. methods: {
  98. /**
  99. * 获取字典数据
  100. * @date 2022-08-11
  101. * @returns {any}
  102. */
  103. getDict() {
  104. getDictData({ key: "school_nature" }).then((res) => {
  105. this.schoolNatureList = res.data;
  106. });
  107. },
  108. /**
  109. * 获取学校列表
  110. * @date 2022-08-11
  111. * @returns {any}
  112. */
  113. getList() {
  114. this.loading = true;
  115. getSchoolList(this.queryParams).then((res) => {
  116. this.schoolList = res.rows;
  117. this.total = Number(res.total);
  118. this.loading = false;
  119. });
  120. },
  121. currentChange(page) {},
  122. },
  123. filters: {
  124. filtersDict(val, list) {
  125. let label = "-";
  126. list.forEach((element) => {
  127. if (Number(element.text) === Number(val)) {
  128. label = element.label;
  129. }
  130. });
  131. return label;
  132. },
  133. },
  134. };
  135. </script>
  136. <style lang="scss" scoped>
  137. .cooperative-colleges {
  138. &-content {
  139. width: calc(70% + 40px);
  140. min-width: 600px;
  141. margin: 23px auto 0;
  142. &-list {
  143. padding: 20px 20px 100px;
  144. background-color: #fff;
  145. .company-list-item {
  146. display: flex;
  147. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  148. padding: 16px;
  149. margin-bottom: 20px;
  150. cursor: pointer;
  151. &-left {
  152. width: 61px;
  153. height: 61px;
  154. margin-right: 15px;
  155. border: solid 1px #e2e2e2;
  156. border-radius: 4px;
  157. .image {
  158. width: 100%;
  159. height: 100%;
  160. border-radius: 4px;
  161. }
  162. }
  163. &-center {
  164. width: calc(100% - 95px);
  165. color: #919191;
  166. font-size: 14px;
  167. font-family: SourceHanSansCN;
  168. .name {
  169. color: #1a1a1a;
  170. font-size: 20px;
  171. font-family: SourceHanSansCN;
  172. margin-bottom: 5px;
  173. white-space: nowrap;
  174. overflow: hidden;
  175. text-overflow: ellipsis;
  176. word-break: break-all;
  177. }
  178. }
  179. &-right {
  180. display: flex;
  181. align-items: center;
  182. color: #9c9c9c;
  183. font-size: 18px;
  184. }
  185. }
  186. .pagination {
  187. text-align: center;
  188. :deep(.el-pager .active) {
  189. background-color: #ff3939;
  190. }
  191. :deep(.el-pagination.is-background .el-pager li:not(.disabled).active) {
  192. background-color: #ff3939;
  193. }
  194. }
  195. }
  196. }
  197. }
  198. </style>