yfyd.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <div class="simulation">
  3. <el-card class="mt20 mb20">
  4. <div
  5. :style="{ 'background-image': backimg }"
  6. class="back"
  7. >
  8. <p class="f24 bold" style="color: #a6a6a6">
  9. SEGMENT OF RANKING
  10. </p>
  11. <p class="f24" style="color: #414141;">
  12. 一分一段
  13. </p>
  14. <hr
  15. class="layui-bg-orange f24 bold mt10"
  16. style="width: 40px; height: 4px"
  17. />
  18. </div>
  19. </el-card>
  20. <el-card>
  21. <mx-search-group class="mb10" justify="end" :span="6" v-model="scoreRank" placeholder="请输入分数或位次"
  22. @search="getList"/>
  23. <mx-condition ref="condition" :query-params="queryParams" :require-fields="requireFields"
  24. :invisible-fields="invisibleFields"
  25. use-alias-mapping tiny-margin-bottom @query="handleQuery"/>
  26. <div class="content mt15">
  27. <div class="table-wrap" v-loading="loading">
  28. <mx-table :rows="batchData" :propDefines="propDefines">
  29. <template #rank="{row}">
  30. <p>
  31. {{ row.highestRank == row.lowestRank ? `${row.highestRank}` : `${row.highestRank}~${row.lowestRank}` }}</p>
  32. </template>
  33. <template #score="{row}">
  34. <p>{{ row.score == row.maxScore ? `${row.score}` : `${row.score}~${row.maxScore}` }}</p>
  35. </template>
  36. </mx-table>
  37. </div>
  38. <pagination :total="pageForm.total" :autoScroll="false" :page.sync="pageForm.pageNum"
  39. :limit.sync="pageForm.pageSize" @pagination="getList"/>
  40. </div>
  41. </el-card>
  42. </div>
  43. </template>
  44. <script>
  45. import {yfydList} from '@/api/webApi/career-other'
  46. import MxCondition from '@/components/MxCondition/mx-condition'
  47. import MxSearchGroup from '@/components/MxSearch/mx-search-group'
  48. import Pagination from '@/components/Pagination'
  49. import {mapGetters} from 'vuex'
  50. export default {
  51. components: {
  52. MxCondition,
  53. Pagination,
  54. MxSearchGroup
  55. },
  56. data() {
  57. return {
  58. loading: false,
  59. queryParams: {
  60. yfydLocation: '',
  61. yfydYear: '',
  62. yfydMode: ''
  63. },
  64. requireFields: ['yfydLocation', 'yfydYear', 'yfydMode'],
  65. invisibleFields: ['yfydLocation'],
  66. firedParams: null,
  67. pageForm: {pageNum: 1, pageSize: 20, total: 0},
  68. backimg:
  69. 'url(' + require('@/assets/images/career/icon_colleges.png') + ')',
  70. batchData: [],
  71. scoreRank: '',
  72. propDefines: {
  73. location: {
  74. label: '地域'
  75. },
  76. year: {
  77. label: '年份'
  78. },
  79. mode: {
  80. label: '科类'
  81. },
  82. score: {
  83. label: '分数',
  84. slot: 'score'
  85. },
  86. lowestRank: {
  87. label: '位次',
  88. slot: 'rank'
  89. },
  90. num: {
  91. label: '人数'
  92. },
  93. numTotal: {
  94. label: '累计人数'
  95. }
  96. }
  97. }
  98. },
  99. computed: {
  100. ...mapGetters(['currentUser']),
  101. },
  102. created() {
  103. this.queryParams.yfydLocation = this.currentUser.provinceName
  104. },
  105. methods: {
  106. getList() {
  107. this.getYfydList()
  108. },
  109. onChangePage(page) {
  110. this.getYfydList()
  111. },
  112. handleQuery(model) {
  113. this.firedParams = model
  114. this.pageForm.pageNum = 1
  115. this.getYfydList()
  116. },
  117. getYfydList() {
  118. this.loading = true
  119. yfydList({
  120. ...this.firedParams,
  121. scoreRank: this.scoreRank,
  122. ...this.pageForm
  123. }).then((res) => {
  124. this.batchData = res.rows
  125. this.pageForm.total = res.total
  126. console.log(res)
  127. }).finally(_ => {
  128. this.loading = false
  129. })
  130. }
  131. }
  132. }
  133. </script>
  134. <style lang="scss" scoped>
  135. .layui-bg-orange {
  136. background-color: #47c6a2;
  137. margin-left: 0;
  138. }
  139. .back {
  140. padding: 30px;
  141. margin: 10px 0;
  142. background-color: white;
  143. background-repeat: no-repeat;
  144. background-position: bottom right;
  145. }
  146. </style>