zhiyuan-list.vue 5.9 KB

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