平安校园
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.
 
 
 
 
 
 

346 lines
7.3 KiB

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