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

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