zhiyuan-list.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <dynamic-table v-loading="loading" ref="table" height="800px" :rows="tableList" :columns="columns" @expand-change="expand" >
  3. <template #t0="{row}">
  4. <!-- 录取概率 -->
  5. <div>
  6. <!-- <p class="mb10"><span class="f18">{{ row.enrollRatio }}</span>%</p>-->
  7. <!-- <p class="mb10 f-9b f12">{{ row.enrollRatioText }}</p>-->
  8. <p>
  9. <el-tag type="danger" v-if="row.pickType == 0">冲</el-tag>
  10. <el-tag type="warning" v-if="row.pickType == 1">稳</el-tag>
  11. <el-tag type="success" v-if="row.pickType == 2">保</el-tag>
  12. </p>
  13. </div>
  14. </template>
  15. <template #t1="{row}">
  16. <!-- 院校 -->
  17. <div>
  18. <p class="mb10"><span class="pointer">{{ `${row.university.name}` || '' }}</span></p>
  19. <p class="mb5 f-9b f12">{{ row.university.features.split(',').join(' ') }}</p>
  20. <p class="mb5 f-9b f12">{{ row.university.location }} {{ row.university.cityName }}
  21. 排名{{ row.university.ranking }}</p>
  22. <p class="f-9b f12">代码 {{ row.recruitPlan.collegeCode }}</p>
  23. </div>
  24. </template>
  25. <template #t2="{row}">
  26. <!-- 招生计划 -->
  27. <div>
  28. <p><span class="f18">{{ row.recruitPlan.planCount }}</span>人</p>
  29. <p class="f-9b f12">{{ row.recruitPlan.course }}</p>
  30. </div>
  31. </template>
  32. <template #t3="{row}">
  33. <!-- 历年 -->
  34. <div class="f14">
  35. <p>{{ row.history? row.history.year || '-' : '-' }}</p>
  36. </div>
  37. </template>
  38. <template #t4="{row}">
  39. <div class="f14">
  40. <p>{{ row.history? row.history.numReal || '-' : '-'}}</p>
  41. </div>
  42. </template>
  43. <template #t5="{row}">
  44. <div class="f14">
  45. <p>{{ row.history? row.history.score || '-' : '-' }}</p>
  46. </div>
  47. </template>
  48. <template #t6="{row}">
  49. <div class="f14">
  50. <p>{{ row.history? row.history.seat || '-' : '-'}}</p>
  51. </div>
  52. </template>
  53. <template #t7="{row}">
  54. <p type="primary"> {{ `专业(${row.recruitPlan.majorCount}个)` }}</p>
  55. <p class="f12 f-primary" v-show="row.majors.filter(major => {return major.selected}).length"> 已填 <span>{{ row.majors.filter(major => {return major.selected}).length }}</span> </p>
  56. </template>
  57. <template #expand="{row,$index}">
  58. <div>
  59. <dynamic-table :columns="majorCol" :show-header="false" :rows="row.majors">
  60. <template #t0="{row}">
  61. <!-- 录取概率 -->
  62. <div>
  63. </div>
  64. </template>
  65. <template #t1="{row}">
  66. <div>
  67. <p class="mb10"><span class="pointer">{{ row.marjorName }}</span></p>
  68. <p class="f-9b f12">代码 {{ row.marjorBelongs }}</p>
  69. </div>
  70. </template>
  71. <template #t2="{row}">
  72. <div>
  73. <p><span class="f18">{{ row.planCount || '-' }}</span>人</p>
  74. <p class="f-9b f12">{{ `${row.xuezhi} ¥${row.xuefei}` }}</p>
  75. </div>
  76. </template>
  77. <template #t3="{row}">
  78. <div class="f14">
  79. <p>{{ row.history? row.history.year || '-' : '-' }}</p>
  80. </div>
  81. </template>
  82. <template #t4="{row}">
  83. <div class="f14">
  84. <p>{{ row.history? row.history.numReal || '-' : '-' }}</p>
  85. </div>
  86. </template>
  87. <template #t5="{row}">
  88. <div class="f14">
  89. <p>{{ row.history ? row.history.score || '-' : '-' }}</p>
  90. </div>
  91. </template>
  92. <template #t6="{row}">
  93. <div class="f14">
  94. <p>{{ row.history? row.history.seat || '-' : '-' }}</p>
  95. </div>
  96. </template>
  97. <template #t7="{row}">
  98. <el-button :type="row.selected ? 'danger' : 'primary'" @click="apply(row,$index)"> {{row.selected ?'取消' : '填报' }}</el-button>
  99. </template>
  100. </dynamic-table>
  101. </div>
  102. </template>
  103. </dynamic-table>
  104. </template>
  105. <script>
  106. import DynamicTable from '@/components/dynamic-table'
  107. export default {
  108. components: {
  109. DynamicTable,
  110. },
  111. props: {
  112. tableList: {
  113. type: Array,
  114. default: []
  115. },
  116. cols: {
  117. type: Array,
  118. default: []
  119. },
  120. loading:{
  121. type: Boolean,
  122. default: []
  123. }
  124. },
  125. data() {
  126. return {
  127. show:false,
  128. input:'',
  129. selectedList:[]
  130. }
  131. },
  132. computed: {
  133. columns() {
  134. if(!this.cols.length) return []
  135. const columns = [
  136. // {
  137. // type: 'expand',
  138. // slotBody: 'expand'
  139. // }
  140. ]
  141. this.cols.map((item, index) => {
  142. columns.push({
  143. label: item,
  144. slotBody: 't' + index,
  145. width: index >= 2 || index == 0 ? 100+'px' : ''
  146. })
  147. })
  148. columns.push({
  149. type: 'expand',
  150. slotBody: 'expand',
  151. label:'查看'
  152. })
  153. return columns
  154. },
  155. majorCol() {
  156. return this.cols.map((item, index) => {
  157. return {
  158. label: item,
  159. slotBody: 't' + index,
  160. width: index >= 2 || index == 0 ? 100+'px' : ''
  161. }
  162. })
  163. },
  164. },
  165. methods: {
  166. expand(item) {
  167. this.$emit('expand', item)
  168. },
  169. scrollTop() {
  170. this.$refs.table.toScrollTop()
  171. },
  172. apply(item,index) {
  173. this.$emit('apply',item,index)
  174. },
  175. }
  176. }
  177. </script>
  178. <style scoped lang="scss">
  179. .f-9b {
  180. color: #9b9b9b;
  181. }
  182. ::v-deep .el-table__expanded-cell {
  183. padding-top: 0;
  184. //padding-right: 50;
  185. padding-bottom: 0;
  186. padding-left: 0;
  187. }
  188. ::v-deep .el-table__expand-icon{
  189. font-size: 18px;
  190. color: #666;
  191. .el-icon-arrow-right{
  192. font-weight: bold;
  193. }
  194. }
  195. </style>