|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 |
- <template>
- <view style="height: 100%;">
- <view class="title">
- 应到:{{list.length}}人
- </view>
- <view style="padding: 26rpx;overflow: hidden;">
- <view class="cate">
- <view class="cateList">
- <view v-for="item in cateList" :class="{active:item.value == cate}" :key="item.value" class="item"
- @click="cateItemClick(item)">
- {{item.label}}({{item.num}})
- </view>
- </view>
- </view>
- </view>
- <view style="height:calc(100% - 200rpx);overflow: auto;">
- <view class="list">
- <template v-for="(item, index) in list">
- <view class="item" @click="popupShow(item)" :key="index" v-show="cateList.length&&cateList[cate].show(item)">
- <view class="right">
- <image src="@/static/image/test/image2.png" mode="aspectFill"
- style="width: 160rpx;height: 160rpx;border-radius:10rpx"></image>
- <view class="des">
- <view class="top">
- <view class="status"
- :style="{backgroundColor:cate == 0?'#0FAF76':cate == 1?'#EF2D2D':'#F49D19' }">
- {{cateList.find(e=>e.value == cate)?cateList.find(e=>e.value == cate).label:''}}
- </view>
- <view class="name">
- {{item.name}}
- </view>
- </view>
- <view class="depart">
- 系部:{{item.majorName}}
- </view>
- <view class="bottom">
- <view class="major">专业:{{item.depName}}</view>
- <view class="class">班级:{{item.personSetName}}</view>
- </view>
- </view>
- </view>
- </view>
- </template>
- </view>
- </view>
- <u-popup :show="show" mode="center" :round="10">
- <view class="popupInfo">
- <image src="/static/image/test/image.png" mode="widthFix" style="width: 480rpx;border-radius:10rpx">
- </image>
- <view class="top">
- <view class="status" :style="{backgroundColor:cate == 0?'#0FAF76':cate == 1?'#EF2D2D':'#F49D19' }">
- {{cateList.find(e=>e.value == cate)?cateList.find(e=>e.value == cate).label:''}}
- </view>
- <view class="name">
- {{popupInfo.name}}
- </view>
- </view>
- <view class="depart">
- 系部:{{popupInfo.majorName}}
- </view>
- <view class="bottom">
- <view class="major">专业:{{popupInfo.depName}}</view>
- <view class="class">班级:{{popupInfo.personSetName}}</view>
- </view>
- <view class="closeBox">
- <image @click="show = false" src="/static/image/close.png" class="close"></image>
- </view>
- </view>
- </u-popup>
- </view>
- </template>
-
- <script>
- import {
- detail,
- page
- } from '@/api/work/rollCall.js'
- export default {
- data() {
- return {
- list: [],
- alarmList: [],
- cateList: [],
- cate: 0,
- checkboxValue: [],
-
- show: false,
- popupInfo: {},
- }
- },
- async mounted() {
- const {
- personSetId,
- taskId
- } = this.options
- // 班级人员
- if (personSetId) {
- await detail({
- personSetId,
- pageSize: 1000,
- pageNum: 1
- }).then(res => {
- if (res.code != 200) return
- this.list = res.data.list
- })
- }
- // 监控行为列表
- if (taskId) {
- page({
- taskId,
- pageSize: 1000,
- pageNum: 1
- }).then(res => {
- if (res.code != 200) return
- this.alarmList = res.data.list
- this.list = this.list.map(e => {
- e.alarmTypes = []
- // alarmType:lie_on_table 趴桌子 class_room_call 点名(实到)
- let arr = this.alarmList.filter(e1 => e1.personId == e.personId)
- e.alarmTypes = arr.map(e=>e.alarmType)
- return e
- })
- this.cateList = [{
- value: 0,
- label: '实到',
- show:(item)=>item.alarmTypes.includes('class_room_call'),
- num: this.list.filter(e=>e.alarmTypes.includes('class_room_call')).length,
- },
- {
- value: 1,
- label: '未到',
- show:(item)=>!item.alarmTypes.includes('class_room_call'),
- num: this.list.filter(e=>!e.alarmTypes.includes('class_room_call')).length
- },
- {
- value: 2,
- label: '趴桌子',
- show:(item)=>item.alarmTypes.includes('lie_on_table'),
- num: this.list.filter(e=>e.alarmTypes.includes('lie_on_table')).length,
- },
- ]
- })
- }
- },
- methods: {
- cateItemClick(item) {
- this.cate = item.value
- },
- popupShow(item) {
- this.popupInfo = item
- this.show = true
- }
- }
- }
- </script>
-
- <style scoped lang="scss">
- .popupInfo {
- padding: 30rpx;
- box-sizing: border-box;
- position: relative;
-
- .top {
- margin-top: 20rpx;
- font-size: 32rpx;
- display: flex;
-
- .status {
- display: inline-block;
- font-size: 24rpx;
- line-height: 46rpx;
- color: #fff;
- padding: 0 12rpx;
- border-radius: 8rpx;
- margin-right: 12rpx;
- }
-
- .name {
- font-size: 32rpx;
- font-weight: 700;
- }
- }
-
- .depart {
- margin-top: 22rpx;
- font-size: 26rpx;
- }
-
- .bottom {
- font-size: 26rpx;
- margin-top: 18rpx;
- display: flex;
- justify-content: space-between;
- margin-bottom: 12rpx;
-
- .major {}
-
- .class {}
- }
-
- .closeBox {
- width: 100%;
- position: absolute;
- left: 0;
- bottom: -98rpx;
- text-align: center;
-
- .close {
- width: 60rpx;
- height: 60rpx;
- }
-
- }
- }
-
- .title {
- display: flex;
- color: #333333;
- padding: 26rpx;
- background: #fff;
- border-top: 1rpx solid rgba(0, 0, 0, 0.03);
- font-size: 30rpx;
- }
-
- .cate {
- font-size: 28rpx;
- overflow-x: auto;
-
- .cateList {
- display: flex;
- width: auto;
-
- .item {
- background-color: #fff;
- border-radius: 37rpx;
- padding: 0 56rpx;
- line-height: 74rpx;
- margin-right: 30rpx;
- white-space: nowrap;
- color: #333;
-
- &.active {
- background-color: #2388FF;
- color: #fff;
- }
- }
- }
- }
-
- .list {
- padding: 0 26rpx;
- margin-bottom: 60rpx;
-
- .item {
- display: flex;
- margin-bottom: 28rpx;
-
- &:last-child {
- margin-bottom: 0;
- }
-
- .right {
- padding: 30rpx;
- flex: 1;
- background-color: #fff;
- border-radius: 18rpx;
- display: flex;
-
- .des {
- flex: 1;
- padding-left: 24rpx;
- font-size: 26rpx;
- color: #333;
-
- .top {
- font-size: 32rpx;
- display: flex;
-
- .status {
- display: inline-block;
- font-size: 24rpx;
- line-height: 46rpx;
- color: #fff;
- padding: 0 12rpx;
- border-radius: 8rpx;
- margin-right: 12rpx;
- }
-
- .name {
- font-size: 32rpx;
- font-weight: 700;
- }
- }
-
- .depart {
- margin-top: 28rpx;
- font-size: 26rpx;
- }
-
- .bottom {
- font-size: 26rpx;
- margin-top: 18rpx;
- display: flex;
- justify-content: space-between;
-
- .major {}
-
- .class {}
- }
- }
- }
- }
- }
- </style>
|