From ac1470b6b37f4b2ff67c830624a68b58f0341168 Mon Sep 17 00:00:00 2001
From: "@fawn-nine" <1271023382@qq.com>
Date: Thu, 12 Sep 2024 16:04:49 +0800
Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/modules/miniClass/miniClass.vue | 76 +++++++++++++++++--
src/views/modules/miniClass/miniClassList.vue | 19 +++--
src/views/modules/miniClass/miniClassType.vue | 34 ++++++---
3 files changed, 107 insertions(+), 22 deletions(-)
diff --git a/src/views/modules/miniClass/miniClass.vue b/src/views/modules/miniClass/miniClass.vue
index 155b6eb..938ebd7 100644
--- a/src/views/modules/miniClass/miniClass.vue
+++ b/src/views/modules/miniClass/miniClass.vue
@@ -111,8 +111,13 @@
>创建班级
保 存开班结班
+ >
+
+
+ 开 班结 班
+
@@ -341,13 +346,17 @@ export default {
}
},
placeholder: "请输入正文"
- }
+ },
+ showOverbtn: false, // 是否显示结班按钮
+
+
};
},
mounted() {
// console.log('激活了')
- if (this.miniClass) {
+ if (this.miniClass) {
console.log("编辑小班", this.miniClass);
+ this.getClassInfo()
if (this.miniClass.classModel.id) {
this.modelList.push(this.miniClass.classModel);
}
@@ -383,13 +392,70 @@ export default {
this.userList.push(item)
})
// console.log("处理后的",this.userList);
-
+
+ console.log("处理后的开班日期",this.miniClassForm.mstartseconds, this.miniClassForm.nowseconds);
}
} else {
console.log("添加小班");
}
},
methods: {
+ // 获取小班详情
+ async getClassInfo() {
+ console.log('班级详情')
+ this.$http({
+ url: this.$http.adornUrl("/common/class/getClassInfo"),
+ method: "post",
+ data: this.$http.adornData({
+ classId: this.miniClass.id
+ })
+ })
+ .then(async ({ data }) => {
+
+ if (data && data.code === 0) {
+ this.miniClassForm.startTime = data.result.class.startTime;
+ var strStartTime = new Date(this.miniClassForm.startTime)
+ var StartTime = strStartTime.getTime()
+ console.log(';shijia',StartTime, data.result.class.startTime)
+ var nowTime = await this.getServerTime() // 服务器当前时间
+ console.log('服务器时间',nowTime)
+ this.miniClassForm.mstartseconds = StartTime
+ this.miniClassForm.nowseconds = nowTime
+ // if(this.miniClass.classModel.isExam == 0){ // 没有考试模块
+ // var off70 = undefined // 时长过70%显示结班按钮天数
+ // off70 = Math.ceil(parseInt(this.miniClass.classModel.days) * 0.7)
+ var endminiSecond = this.miniClass.classModel.days * 1000 * 60 * 60 * 24
+ console.log('时间比较', (endminiSecond + StartTime), nowTime)
+ if (StartTime > 0 && (endminiSecond + StartTime) <= nowTime) {
+ console.log('显示结班按钮');
+ this.showOverbtn = true
+ } else {
+ this.showOverbtn = false
+ console.log('不显示');
+ }
+ }else{
+ this.showOverbtn = false
+ }
+ // }else{
+ // this.miniClassForm.startTime = undefined
+ // }
+ })
+ },
+ // 获取服务器时间
+ async getServerTime() {
+ var time = undefined
+ await this.$http({
+ url: this.$http.adornUrl("/common/classExam/getServerTime"),
+ method: "post",
+ data: this.$http.adornData({})
+ })
+ .then( async ({ data }) => {
+ if (data && data.code === 0) {
+ time = data.serverTime;
+ }}
+ )
+ return time
+ },
// 开班
kaiban(){
if(this.miniClass.classUsers.length == 0 || !this.miniClass.classUsers){
diff --git a/src/views/modules/miniClass/miniClassList.vue b/src/views/modules/miniClass/miniClassList.vue
index 4257475..cf1cd67 100644
--- a/src/views/modules/miniClass/miniClassList.vue
+++ b/src/views/modules/miniClass/miniClassList.vue
@@ -74,10 +74,10 @@
昵称:
{{
- scope.row.createUser.nickname != "" && scope.row.createUser.nickname != null && scope.row.createUser.nickname != 'null'
- ? scope.row.createUser.nickname
+ scope.row.newName!= "" && scope.row.newName != null && scope.row.newName != 'null'
+ ? scope.row.newName
: "匿名用户"
- }}
电话:{{ scope.row.createUser.tel }}
+ }}
电话:{{ scope.row.newTel }}
- 创建日期:{{ scope.row.createTime }}
- 开班日期
结班日期
+ 创建日期:{{ scope.row.createTime }}
+ 开班日期:{{ scope.row.startTime }}
+ 结班日期:{{ scope.row.endTime }}
-
-
- 主任
- {{scope.row.director.nickname}}
- 电话:{{scope.row.director.tel}}
- 邮箱:{{scope.row.director.email}}
+ 主任:
+ {{scope.row.director.nickname}}
+ {{scope.row.director.tel}} /
+ {{scope.row.director.email}}
- 副主任
- {{scope.row.ddirector.nickname}}
- 电话:{{scope.row.ddirector.tel}}
- 邮箱:{{scope.row.ddirector.email}}
+ 副主任:
+ {{scope.row.ddirector.nickname}}
+ {{scope.row.ddirector.tel}} /
+ {{scope.row.ddirector.email}}
-