user.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <template>
  2. <view class="m_right">
  3. <view class="m_right_hander">
  4. <button size="mini" class="m_btn_red">添加用户</button>
  5. </view>
  6. <view class="m_right_container">
  7. <table style="width: 100%;border: 1px solid #DDDDDD;border-collapse: collapse">
  8. <thead class="m-table-hander">
  9. <tr>
  10. <th>用户名</th>
  11. <th>姓名</th>
  12. <th>班级</th>
  13. <th>学号</th>
  14. <th>电话</th>
  15. <th>ilab账户</th>
  16. <th>注册时间</th>
  17. <th>分数</th>
  18. <th>修改信息</th>
  19. <th>删除</th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. <tr v-for="(item,index) in tabledata" :key="index">
  24. <th style="color: #EA252C;">{{item.UserID}}</th>
  25. <th>{{item.Name}}</th>
  26. <th>{{item.Class}}</th>
  27. <th>CMII09</th>
  28. <th>{{item.PhoneNum}}</th>
  29. <th>{{item.IlabAccount}}</th>
  30. <th>{{item.SiginTime}}</th>
  31. <th>90</th>
  32. <th style="position: relative;"><button type="default" size="mini" class="m_edit">修改</button></th>
  33. <th style="position: relative;"><button type="default" size="mini" class="m_delete">删除</button></th>
  34. </tr>
  35. </tbody>
  36. </table>
  37. </view>
  38. <view class="m_right_footer">
  39. <view class="m_paging">
  40. <text class="m_paging_item m_paging_upper" v-show="pageIndex>1&&pageCount>0">上一页</text>
  41. <text class="m_paging_item" :key="i" v-for="i in pageCount" @click="paging(i)" :class="i==pageIndex?'p_act':''">
  42. {{i}}
  43. </text>
  44. <text class="m_paging_item m_paging_lower" v-show="pageIndex!=pageCount&&pageCount>0">下一页</text>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. export default {
  51. name: "manager_user",
  52. data() {
  53. return {
  54. queryList: {
  55. UserID: "",
  56. BeginNum: 0,
  57. EndNum: 15,
  58. },
  59. pageIndex: 1,
  60. pageSize: 16,
  61. pageCount: 12,
  62. tabledata: []
  63. }
  64. },
  65. created() {
  66. this.getlist();
  67. },
  68. methods: {
  69. paging(obj) {
  70. this.pageIndex = obj;
  71. this.queryList.BeginNum = (this.pageIndex - 1) * this.pageSize;
  72. this.queryList.EndNum = this.pageIndex * this.pageSize - 1;
  73. this.getlist();
  74. },
  75. getlist() {
  76. this.queryList.UserID = this.$UserId;
  77. uni.request({
  78. url: this.$Api + "/backstage/getalluser",
  79. data: this.queryList,
  80. method: "POST",
  81. dataType: "json",
  82. success: res => {
  83. var {
  84. data
  85. } = res;
  86. if (data.code == 100) {
  87. if (data.AllNumOfList > 0) {
  88. this.tabledata = res.Users
  89. var tempCount = parseInt(data.AllNumOfList / this.pageSize);
  90. if (tempCount * this.pageSize == data.AllNumOfList)
  91. this.pageCount = tempCount;
  92. else
  93. this.pageCount = tempCount + 1;
  94. } else {
  95. this.tabledata = [];
  96. }
  97. } else {
  98. this.tabledata = [];
  99. this.pageCount = 0;
  100. }
  101. }
  102. })
  103. }
  104. }
  105. }
  106. </script>
  107. <style lang="scss">
  108. .m_right {
  109. width: 100%;
  110. margin-top: 5rpx;
  111. padding: 0 150rpx;
  112. background-color: #fff;
  113. box-shadow: 3px 0px 6px 0px rgba(0, 0, 0, 0.1);
  114. .m_right_hander {
  115. text-align: right;
  116. height: 250rpx;
  117. position: relative;
  118. .m_btn_red {
  119. position: absolute;
  120. height: 80rpx;
  121. line-height: 80rpx;
  122. padding: 0 40rpx;
  123. right: 0;
  124. top: 50%;
  125. transform: translateY(-50%);
  126. background: #EA252C;
  127. color: #fff;
  128. }
  129. }
  130. }
  131. tbody tr {
  132. border-top: 2rpx solid #DDDDDD !important;
  133. }
  134. tbody tr th {
  135. font-weight: 400 !important;
  136. height: 140rpx;
  137. line-height: 140rpx;
  138. }
  139. tbody tr:hover {
  140. // color: #fff;
  141. background: #FDEBEC;
  142. // opacity: 0.08;
  143. }
  144. .m-table-hander {
  145. background-color: #FFF8F7;
  146. height: 140rpx;
  147. line-height: 140rpx;
  148. font-family: MicrosoftYaHei-Bold, MicrosoftYaHei;
  149. font-weight: bold;
  150. }
  151. .m_edit {
  152. position: absolute;
  153. top: 50%;
  154. left: 50%;
  155. transform: translate(-50%, -50%);
  156. background: rgb(67, 127, 250);
  157. color: rgb(255, 255, 255);
  158. min-width: 130rpx;
  159. }
  160. .m_delete {
  161. position: absolute;
  162. top: 50%;
  163. left: 50%;
  164. min-width: 130rpx;
  165. transform: translate(-50%, -50%);
  166. background: rgb(234, 37, 44);
  167. color: rgb(255, 255, 255);
  168. }
  169. .m_right_footer {
  170. margin-top: 80rpx;
  171. }
  172. .m_paging {
  173. text-align: right;
  174. .m_paging_item {
  175. padding: 10rpx 18rpx;
  176. border: 1rpx solid #DDDDDD;
  177. border-radius: 8rpx;
  178. margin-right: 10rpx;
  179. }
  180. .p_act {
  181. background: #EA252C;
  182. color: #fff;
  183. border: inherit;
  184. }
  185. }
  186. .m_paging_item:hover {
  187. background: #EA252C;
  188. color: #fff;
  189. border: inherit;
  190. }
  191. .m_act1 {
  192. color: #FF0019;
  193. }
  194. </style>