|
|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <view class="container" :style="showEdit ? 'padding-bottom:180rpx' : ''">
|
|
|
+ <view class="container" :style="[showEdit ? 'padding-bottom:180rpx' : '', showPage ? 'overflow:hidden' : 'overflow:visible']">
|
|
|
<!-- 背景图片区域 -->
|
|
|
<img class="img_bg" src="../../static/images/center-bg.png" />
|
|
|
|
|
|
@@ -44,6 +44,25 @@
|
|
|
|
|
|
<!-- 没有数据时展示的页面 -->
|
|
|
<NoData v-if="!list.length" style="margin-top: 140rpx" />
|
|
|
+
|
|
|
+ <!-- 弹窗区域 -->
|
|
|
+ <uni-popup ref="popupDom">
|
|
|
+ <view class="pop_up">
|
|
|
+ <!-- 头部标题区域 -->
|
|
|
+ <view class="popup_top">{{ headerName }} - 关联时间组</view>
|
|
|
+ <!-- 时间组区域 -->
|
|
|
+ <view class="popup_body">
|
|
|
+ <!-- 每一个时间组区域 -->
|
|
|
+ <view class="time_item" v-for="item in timeGroups" :key="item.id" @click="handleClickItemPop(item)">
|
|
|
+ <view class="item_left">
|
|
|
+ <view class="top">{{ item.name }}</view>
|
|
|
+ <view class="bottom">{{ item.remark }}</view>
|
|
|
+ </view>
|
|
|
+ <radio color="#0061FF" style="transform: scale(0.9)" :checked="item.isChecked" />
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </uni-popup>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
@@ -73,6 +92,20 @@ const showEdit = ref(false)
|
|
|
// 是否全选
|
|
|
const allChecked = ref(false)
|
|
|
|
|
|
+// 弹窗DOM
|
|
|
+const popupDom = ref()
|
|
|
+
|
|
|
+// 时间组列表
|
|
|
+const timeGroups = ref([])
|
|
|
+
|
|
|
+// 弹窗标题
|
|
|
+const headerName = ref('')
|
|
|
+// 当前学生id
|
|
|
+const studentId = ref()
|
|
|
+
|
|
|
+// 滚动穿透控制
|
|
|
+const showPage = ref(false)
|
|
|
+
|
|
|
onLoad(() => {
|
|
|
getData()
|
|
|
})
|
|
|
@@ -133,6 +166,69 @@ const handleClickItem = (item) => {
|
|
|
|
|
|
// 判断全选按钮的状态
|
|
|
allChecked.value = list.value.every((ele) => ele.isChecked)
|
|
|
+ } else {
|
|
|
+ // 编辑单个学生
|
|
|
+ showPage.value = true
|
|
|
+ headerName.value = item.name
|
|
|
+ studentId.value = item.id
|
|
|
+ getTimeGroups()
|
|
|
+ popupDom.value.open('center')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 获取时间组列表数据
|
|
|
+const getTimeGroups = async () => {
|
|
|
+ const res = await myRequest({
|
|
|
+ url: '/wanzai/api/smartUser/timeGroups'
|
|
|
+ })
|
|
|
+ // console.log(res)
|
|
|
+ const result = JSON.parse(decryptDes(res.data))
|
|
|
+ // console.log(result)
|
|
|
+ timeGroups.value = result
|
|
|
+ timeGroups.value.forEach((ele) => {
|
|
|
+ ele.isChecked = false
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+// 点击弹窗每一个时间组的回调
|
|
|
+const handleClickItemPop = (item) => {
|
|
|
+ timeGroups.value.forEach((ele) => {
|
|
|
+ ele.isChecked = false
|
|
|
+ })
|
|
|
+ item.isChecked = !item.isChecked
|
|
|
+
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '确定修改时间组吗?',
|
|
|
+ success: async (res) => {
|
|
|
+ if (res.confirm) {
|
|
|
+ handleConfirm(item.id)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+const handleConfirm = async (timeGroupId) => {
|
|
|
+ const res = await myRequest({
|
|
|
+ url: '/wanzai/api/smartUser/setUserTimeGroup',
|
|
|
+ method: 'post',
|
|
|
+ data: {
|
|
|
+ ids: [studentId.value],
|
|
|
+ timeGroupId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(res)
|
|
|
+ uni.showToast({
|
|
|
+ title: res.message,
|
|
|
+ icon: 'none',
|
|
|
+ mask: true
|
|
|
+ })
|
|
|
+ if (res.code == 200) {
|
|
|
+ setTimeout(() => {
|
|
|
+ uni.reLaunch({
|
|
|
+ url: '/pages/studentManage/studentManage'
|
|
|
+ })
|
|
|
+ }, 1500)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -266,5 +362,49 @@ const changeInputValue = (value) => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .pop_up {
|
|
|
+ width: 710rpx;
|
|
|
+ height: 855rpx;
|
|
|
+ border-radius: 22rpx;
|
|
|
+ background-color: #fff;
|
|
|
+
|
|
|
+ .popup_top {
|
|
|
+ height: 94rpx;
|
|
|
+ line-height: 94rpx;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 28rpx;
|
|
|
+ border-bottom: 1rpx solid #e6e6e6;
|
|
|
+ }
|
|
|
+
|
|
|
+ .popup_body {
|
|
|
+ height: 760rpx;
|
|
|
+ overflow-y: auto;
|
|
|
+
|
|
|
+ .time_item {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: center;
|
|
|
+ padding: 0 40rpx;
|
|
|
+ height: 130rpx;
|
|
|
+ border-bottom: 1rpx solid #e6e6e6;
|
|
|
+
|
|
|
+ .item_left {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+ height: 80rpx;
|
|
|
+
|
|
|
+ .top {
|
|
|
+ font-size: 28rpx;
|
|
|
+ }
|
|
|
+ .bottom {
|
|
|
+ font-size: 24rpx;
|
|
|
+ color: #b3b3b3;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|