rightCenter.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <template>
  2. <div class="cointan">
  3. <div class="title1">
  4. <img src="../assets/index/title_icon.png" style="width:22px;height:22px;float: left;">
  5. <div style="margin-left:25px;line-height: 22px;">班级未归人员统计</div>
  6. </div>
  7. <!-- 表格 -->
  8. <div class="xia-table">
  9. <el-table
  10. v-loading="loading"
  11. :data="tableData" size="mini"
  12. :row-style="tableRowClassName"
  13. :header-cell-style="{ color: 'rgba(0, 218, 216, 1)',background: 'transparent',height:'32 !important',fontSize:'16' }"
  14. >
  15. <!-- :cell-style="{background: '#4EC8FF'}" -->
  16. <el-table-column prop="clazz" label="班级名称" align="center"/>
  17. <el-table-column prop="totalPeople" label="入住人数" align="center" />
  18. <el-table-column prop="noReturnBedroom" label="闭寝未归" align="center" />
  19. </el-table>
  20. </div>
  21. </div>
  22. </template>
  23. <script>
  24. export default {
  25. name: 'rightCenter',
  26. props: {
  27. msg: String
  28. },
  29. data() {
  30. return {
  31. loading:false,
  32. tableData:[
  33. {name:'人工智能1班',num:8,zhuang:3},
  34. {name:'人工智能1班',num:8,zhuang:3},
  35. {name:'人工智能1班',num:8,zhuang:3},
  36. {name:'人工智能1班',num:8,zhuang:3},
  37. {name:'人工智能1班',num:8,zhuang:3},
  38. {name:'人工智能1班',num:8,zhuang:3},
  39. {name:'人工智能1班',num:8,zhuang:3},
  40. {name:'人工智能1班',num:8,zhuang:3},
  41. ],
  42. size:0,//总条数
  43. build:'',//楼栋
  44. token:'',//请求头token
  45. }
  46. },
  47. mounted(){
  48. this.token=sessionStorage.getItem('token')
  49. this.build=sessionStorage.getItem('build')
  50. this.getWeigui()
  51. },
  52. methods:{
  53. tableRowClassName({row, rowIndex}) {
  54. let stylejson = {};
  55. if(rowIndex%2==1){
  56. return stylejson;
  57. }else{
  58. stylejson.background = "rgba(0, 72, 91, 0.4)";// 背景颜色
  59. return stylejson;
  60. }
  61. },
  62. //班级未归人员统计
  63. getWeigui(){
  64. this.tableData=[]
  65. this.$axios.get('/auto/face-recognition/classesCounted?build='+this.build.split(",")[0]+'栋&build='+this.build.split(",")[1]+'栋',
  66. {
  67. headers: {
  68. "token": this.token,
  69. },
  70. }
  71. ).then(res => {
  72. if (res.data.success) {
  73. this.size=res.data.data.total
  74. // console.log(this.studentList)
  75. this.$axios.get('/auto/face-recognition/classesCounted?build=1栋&build=2栋&size='+this.size,
  76. {
  77. headers: {
  78. "token": this.token,
  79. },
  80. }
  81. ).then(res => {
  82. if (res.data.success) {
  83. // 未归班级人员
  84. res.data.data.records.forEach(data => {
  85. this.tableData.push(data)
  86. })
  87. // console.log(this.studentList)
  88. }
  89. })
  90. }
  91. })
  92. }
  93. },
  94. }
  95. </script>
  96. <!-- Add "scoped" attribute to limit CSS to this component only -->
  97. <style scoped lang="scss">
  98. .cointan{
  99. width: 428px;
  100. height: 296px;
  101. background-image: url('../assets/rightCenter/background.png');
  102. background-size: 100%;
  103. }
  104. .title1{
  105. position: absolute;
  106. margin: 9px 0 0 10px;
  107. font-size: 20px;
  108. font-family : '优设标题黑';
  109. color: rgba(255, 255, 255, 1);
  110. font-weight: 400;
  111. }
  112. // 表格
  113. .xia-table{
  114. position: absolute;
  115. margin: 47px 0 0 21px;
  116. height: 228px;
  117. width: 383px;
  118. overflow-y: auto;
  119. // overflow-x: hidden;
  120. }
  121. /* eslint-disable */
  122. ::v-deep .el-table,
  123. ::v-deep .el-table__expanded-cell {
  124. background-color: transparent;
  125. }
  126. ::v-deep .el-table th,
  127. ::v-deep .el-table tr,
  128. ::v-deep .el-table td {
  129. color: #fff;
  130. background-color: transparent;
  131. font-size: 14px !important;
  132. height: 38px !important;
  133. }
  134. ::v-deep .el-table .cell {
  135. box-sizing: border-box;
  136. overflow: hidden;
  137. text-overflow: ellipsis;
  138. white-space: normal;
  139. word-break: break-all;
  140. line-height: 23px;
  141. padding-left: 0px;
  142. padding-right: 0px;
  143. }
  144. // 鼠标悬停时背景颜色设置
  145. ::v-deep .el-table tbody tr:hover > td {
  146. background-color: rgba(0, 72, 91, 0.4) !important;
  147. }
  148. ::v-deep .el-table--striped .el-table__body tr.el-table__row--striped td.el-table__cell {
  149. background:rgba(0, 72, 91, 0.4);
  150. }
  151. ::v-deep .el-table__header-wrapper {
  152. background-color: transparent;
  153. }
  154. // 斑马线隔行换色设置颜色
  155. ::v-deep
  156. .el-table--striped
  157. .el-table__body
  158. tr.el-table__row--striped.el-table__row--striped.el-table__row--striped
  159. td {
  160. background-color: rgba($color: #00485B, $alpha: 0.4);
  161. }
  162. // 表格间横线
  163. // 清除表格默认下边框
  164. ::v-deep .el-table td.el-table__cell, .el-table th.el-table__cell.is-leaf {
  165. border-bottom: 0px solid #EBEEF5;
  166. }
  167. ::v-deep .el-table__cell,
  168. ::v-deep .el-table th.el-table__cell.is-leaf {
  169. border-bottom: none;
  170. }
  171. ::v-deep .el-table::before {
  172. width: 0 !important;
  173. }
  174. ::v-deep .el-table__inner-wrapper::before {
  175. left: 0;
  176. bottom: 0;
  177. width: 100%;
  178. height: 0px !important;
  179. }
  180. ::v-deep .el-input__icon {
  181. height: 100%;
  182. width: 25px;
  183. text-align: center;
  184. transition: all .3s;
  185. line-height: 30px !important;
  186. }
  187. // 加载中
  188. >>>.el-loading-mask {
  189. position: absolute;
  190. z-index: 2000;
  191. background-color: rgba(255,255,255,0);
  192. margin: 0;
  193. top: 50px;
  194. right: 0;
  195. bottom: 0;
  196. left: 0;
  197. transition: opacity .3s;
  198. }
  199. ::-webkit-scrollbar {
  200. /*隐藏滚轮*/
  201. display: none;
  202. }
  203. // 表格隔行颜色不同
  204. >>>.el-table .warning-row {
  205. background: #f7faff;
  206. }
  207. >>>.el-table .success-row {
  208. background: #ebf1fb;
  209. }
  210. </style>