平安校园
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

detail.vue 6.4 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314
  1. <template>
  2. <view style="height: 100%;">
  3. <view class="title">
  4. 应到:{{list.length}}人
  5. </view>
  6. <view style="padding: 26rpx;overflow: hidden;">
  7. <view class="cate">
  8. <view class="cateList">
  9. <view v-for="item in cateList" :class="{active:item.value == cate}" :key="item.value" class="item"
  10. @click="cateItemClick(item)">
  11. {{item.label}}({{item.num}})
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. <view style="height:calc(100% - 200rpx);overflow: auto;">
  17. <view class="list">
  18. <template v-for="(item, index) in list">
  19. <view class="item" @click="popupShow(item)" :key="index" v-show="cateList.length&&cateList[cate].show(item)">
  20. <view class="right">
  21. <image src="@/static/image/test/image2.png" mode="aspectFill"
  22. style="width: 160rpx;height: 160rpx;border-radius:10rpx"></image>
  23. <view class="des">
  24. <view class="top">
  25. <view class="status"
  26. :style="{backgroundColor:cate == 0?'#0FAF76':cate == 1?'#EF2D2D':'#F49D19' }">
  27. {{cateList.find(e=>e.value == cate)?cateList.find(e=>e.value == cate).label:''}}
  28. </view>
  29. <view class="name">
  30. {{item.name}}
  31. </view>
  32. </view>
  33. <view class="depart">
  34. 系部:{{item.majorName}}
  35. </view>
  36. <view class="bottom">
  37. <view class="major">专业:{{item.depName}}</view>
  38. <view class="class">班级:{{item.personSetName}}</view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. </template>
  44. </view>
  45. </view>
  46. <u-popup :show="show" mode="center" :round="10">
  47. <view class="popupInfo">
  48. <image src="/static/image/test/image.png" mode="widthFix" style="width: 480rpx;border-radius:10rpx">
  49. </image>
  50. <view class="top">
  51. <view class="status" :style="{backgroundColor:cate == 0?'#0FAF76':cate == 1?'#EF2D2D':'#F49D19' }">
  52. {{cateList.find(e=>e.value == cate)?cateList.find(e=>e.value == cate).label:''}}
  53. </view>
  54. <view class="name">
  55. {{popupInfo.name}}
  56. </view>
  57. </view>
  58. <view class="depart">
  59. 系部:{{popupInfo.majorName}}
  60. </view>
  61. <view class="bottom">
  62. <view class="major">专业:{{popupInfo.depName}}</view>
  63. <view class="class">班级:{{popupInfo.personSetName}}</view>
  64. </view>
  65. <view class="closeBox">
  66. <image @click="show = false" src="/static/image/close.png" class="close"></image>
  67. </view>
  68. </view>
  69. </u-popup>
  70. </view>
  71. </template>
  72. <script>
  73. import {
  74. detail,
  75. page
  76. } from '@/api/work/rollCall.js'
  77. export default {
  78. data() {
  79. return {
  80. list: [],
  81. alarmList: [],
  82. cateList: [],
  83. cate: 0,
  84. checkboxValue: [],
  85. show: false,
  86. popupInfo: {},
  87. }
  88. },
  89. async mounted() {
  90. const {
  91. personSetId,
  92. taskId
  93. } = this.options
  94. // 班级人员
  95. if (personSetId) {
  96. await detail({
  97. personSetId,
  98. pageSize: 1000,
  99. pageNum: 1
  100. }).then(res => {
  101. if (res.code != 200) return
  102. this.list = res.data.list
  103. })
  104. }
  105. // 监控行为列表
  106. if (taskId) {
  107. page({
  108. taskId,
  109. pageSize: 1000,
  110. pageNum: 1
  111. }).then(res => {
  112. if (res.code != 200) return
  113. this.alarmList = res.data.list
  114. this.list = this.list.map(e => {
  115. e.alarmTypes = []
  116. // alarmType:lie_on_table 趴桌子 class_room_call 点名(实到)
  117. let arr = this.alarmList.filter(e1 => e1.personId == e.personId)
  118. e.alarmTypes = arr.map(e=>e.alarmType)
  119. return e
  120. })
  121. this.cateList = [{
  122. value: 0,
  123. label: '实到',
  124. show:(item)=>item.alarmTypes.includes('class_room_call'),
  125. num: this.list.filter(e=>e.alarmTypes.includes('class_room_call')).length,
  126. },
  127. {
  128. value: 1,
  129. label: '未到',
  130. show:(item)=>!item.alarmTypes.includes('class_room_call'),
  131. num: this.list.filter(e=>!e.alarmTypes.includes('class_room_call')).length
  132. },
  133. {
  134. value: 2,
  135. label: '趴桌子',
  136. show:(item)=>item.alarmTypes.includes('lie_on_table'),
  137. num: this.list.filter(e=>e.alarmTypes.includes('lie_on_table')).length,
  138. },
  139. ]
  140. })
  141. }
  142. },
  143. methods: {
  144. cateItemClick(item) {
  145. this.cate = item.value
  146. },
  147. popupShow(item) {
  148. this.popupInfo = item
  149. this.show = true
  150. }
  151. }
  152. }
  153. </script>
  154. <style scoped lang="scss">
  155. .popupInfo {
  156. padding: 30rpx;
  157. box-sizing: border-box;
  158. position: relative;
  159. .top {
  160. margin-top: 20rpx;
  161. font-size: 32rpx;
  162. display: flex;
  163. .status {
  164. display: inline-block;
  165. font-size: 24rpx;
  166. line-height: 46rpx;
  167. color: #fff;
  168. padding: 0 12rpx;
  169. border-radius: 8rpx;
  170. margin-right: 12rpx;
  171. }
  172. .name {
  173. font-size: 32rpx;
  174. font-weight: 700;
  175. }
  176. }
  177. .depart {
  178. margin-top: 22rpx;
  179. font-size: 26rpx;
  180. }
  181. .bottom {
  182. font-size: 26rpx;
  183. margin-top: 18rpx;
  184. display: flex;
  185. justify-content: space-between;
  186. margin-bottom: 12rpx;
  187. .major {}
  188. .class {}
  189. }
  190. .closeBox {
  191. width: 100%;
  192. position: absolute;
  193. left: 0;
  194. bottom: -98rpx;
  195. text-align: center;
  196. .close {
  197. width: 60rpx;
  198. height: 60rpx;
  199. }
  200. }
  201. }
  202. .title {
  203. display: flex;
  204. color: #333333;
  205. padding: 26rpx;
  206. background: #fff;
  207. border-top: 1rpx solid rgba(0, 0, 0, 0.03);
  208. font-size: 30rpx;
  209. }
  210. .cate {
  211. font-size: 28rpx;
  212. overflow-x: auto;
  213. .cateList {
  214. display: flex;
  215. width: auto;
  216. .item {
  217. background-color: #fff;
  218. border-radius: 37rpx;
  219. padding: 0 56rpx;
  220. line-height: 74rpx;
  221. margin-right: 30rpx;
  222. white-space: nowrap;
  223. color: #333;
  224. &.active {
  225. background-color: #2388FF;
  226. color: #fff;
  227. }
  228. }
  229. }
  230. }
  231. .list {
  232. padding: 0 26rpx;
  233. margin-bottom: 60rpx;
  234. .item {
  235. display: flex;
  236. margin-bottom: 28rpx;
  237. &:last-child {
  238. margin-bottom: 0;
  239. }
  240. .right {
  241. padding: 30rpx;
  242. flex: 1;
  243. background-color: #fff;
  244. border-radius: 18rpx;
  245. display: flex;
  246. .des {
  247. flex: 1;
  248. padding-left: 24rpx;
  249. font-size: 26rpx;
  250. color: #333;
  251. .top {
  252. font-size: 32rpx;
  253. display: flex;
  254. .status {
  255. display: inline-block;
  256. font-size: 24rpx;
  257. line-height: 46rpx;
  258. color: #fff;
  259. padding: 0 12rpx;
  260. border-radius: 8rpx;
  261. margin-right: 12rpx;
  262. }
  263. .name {
  264. font-size: 32rpx;
  265. font-weight: 700;
  266. }
  267. }
  268. .depart {
  269. margin-top: 28rpx;
  270. font-size: 26rpx;
  271. }
  272. .bottom {
  273. font-size: 26rpx;
  274. margin-top: 18rpx;
  275. display: flex;
  276. justify-content: space-between;
  277. .major {}
  278. .class {}
  279. }
  280. }
  281. }
  282. }
  283. }
  284. </style>