zhiyuan-list.vue 5.9 KB

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