This commit is contained in:
@fawn-nine
2024-08-21 17:24:11 +08:00
parent 1179b63ae0
commit d549954559
16 changed files with 1826 additions and 351 deletions

View File

@@ -0,0 +1,110 @@
<template>
<view>
<view class="">
<view class="flex_box">
<view class="item1 fabuhomework" @click="goAddHomeWork('0')" v-if="thisClass.state == '0' && roleCode.includes('2') || thisClass.state == '0' && roleCode.includes('1')">
<!-- <view class="img">
<image src="@/static/icon/fabu.png" mode="widthFix"></image>
</view> -->
<text>发布作业</text>
</view>
<view class="item1 fabuhomework" @click="goAddHomeWork('1')" v-if="thisClass.state == '1' && ( roleCode.includes('2') || roleCode.includes('1'))">
<text>发布医案</text>
</view>
</view>
<view v-if="thisClass.state != 0" class="flex_box">
<view class="item" @click="goPingfen('/pages/miniClass/taskList',thisClass.id, '0')">
<view class="img">
<image src="@/static/icon/pigai2.png" mode="widthFix"></image>
</view>
<text>作业评分</text>
</view>
<view class="item" @click="goPingfen('/pages/miniClass/taskList',thisClass.id, '1')">
<view class="img">
<image src="@/static/icon/pigai1.png" mode="widthFix"></image>
</view>
<text>医案评分</text>
</view>
<view class="item" @click="goXindeList('/pages/miniClass/xindeList')">
<view class="img">
<image src="@/static/icon/pigai3.png" mode="widthFix"></image>
</view>
<text>心得评分</text>
</view>
<view class="item" @click="goSikaoList('/pages/miniClass/sikaoQuestionList', thisClass.id)">
<view class="img">
<image src="@/static/icon/sikaoti.png" mode="widthFix"></image>
</view>
<text>思考题</text>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
props:['thisClass','roleCode'],
name:"classInfoWorkBlank",
data() {
return {
};
},methods:{
goAddHomeWork(type){
uni.navigateTo({
url: `/pages/miniClass/addHomeWork?classId=${this.thisClass.id}&type=${type}`
})
},
goPingfen(url, classId, type) {
uni.navigateTo({
url: `${url}?classId=${classId}&type=${type}&roleCode=${this.roleCode}`
})
},
goSikaoList(url,id){
uni.navigateTo({
url:`${url}?classId=${id}&roleCode=${this.roleCode}`
})
},
goXindeList(url){
uni.navigateTo({
url:`${url}?classId=${this.thisClass.id}&type=2&roleCode=${this.roleCode}`
})
},
}
}
</script>
<style lang="scss" scoped>
.flex_box{justify-content: space-between;}
// .item1{border: 1px solid;}
.fabuhomework{ margin: 20rpx 0; margin-top: -10rpx; width: 100%;
text{ display: block; text-align: center; border-radius: 10rpx; box-sizing: border-box; padding: 20rpx; color:#fff ;
background-image: linear-gradient(-90deg, #576afc 0%, #97a1ff 100%);
}
}
.item {
text-align: center;
text {
font-size: 28rpx;
display: inline-block;
padding-top: 20rpx;
}
}
.img {
width: 100rpx;
height: 100rpx;
margin: 0 auto;
image {
width: 100%;
height: 100%;
}
}
</style>

View File

@@ -688,6 +688,13 @@
{
"navigationBarTitleText" : "主任模型列表"
}
},
{
"path" : "pages/miniClass/classInfoWork",
"style" :
{
"navigationBarTitleText" : "评分员/记分员/学委班级详情页面"
}
}
],
"globalStyle": {

View File

@@ -1015,14 +1015,14 @@
}
.noanser.lock { position: relative; align-items: center;
.lockView{ height: 300rpx; display: block !important; padding: 20rpx; color: #fff; border-radius: 10rpx;
.lockView{ min-height:100; display: block !important; padding: 20rpx; color: #fff; border-radius: 10rpx;
position: absolute; top: 0; left: 0; z-index: 2; width: 100%; background-color: rgba(0, 0, 0, .8);
.btnBox{
padding-top: 20rpx;
}
}
}
.noanser {
.noanser { margin-top: 20rpx; margin-bottom: 20rpx;
padding: 20rpx;
background-color: rgba(255, 255, 255, .6);
text-align: center;

View File

@@ -467,7 +467,7 @@
}
}
// 是班长
if (this.roleObj.isMonitor) {
if (this.roleObj.isCommittee) {
var n = this.pageList.find(item => {
return item.name == '班级管理'
})

View File

@@ -2,18 +2,10 @@
<view>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar title="模型列表">
<z-nav-bar title="教研室列表">
<!-- <view class="curseSet" slot="right" @click="shuomingPage('/pages/course/courseSet',tagId,pid)"> -->
<!-- <uni-icons type="info" size="24"></uni-icons> 课程说明</view> -->
</z-nav-bar>
<!-- 主任和副主任可以创建班级 -->
<!-- <view class="classNewBtn" v-if="isDirector">
<view class="box88 flex_box">
<view class="" style="width: 60%; text-align: center;">
<button type="primary" @click="goAddClasss">新开一个班级</button>
</view>
</view>
</view> -->
</z-nav-bar>
<!-- <view class="tabsBox" :class="[fixed ? 'fixed' : '' ]">
<u-tabs v-if="tabList.length > 0" :class="['tabList']" @click="fatherClick" :current="curTagId"

View File

@@ -22,7 +22,7 @@
<view class="888">
<view class="newBox" v-if="preClassList.length > 0">
<view class="item flexbox" v-for="(item, index) in preClassList" :key="index"
@click="onPageJump('/pages/miniClass/classList',item.id)">
@click="onPageJump('/pages/miniClass/classInfoMan',item)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer" v-if="item.icon != ''">
<image :src="item.icon" mode="aspectFit"></image>
@@ -35,15 +35,16 @@
<text v-show="item.classModel.type == 0">普通班</text>
<text v-show="item.classModel.type == 1">联合班</text>
<text v-show="item.classModel.type == 2">精英班</text>
<text class="txt555" @click="onPageJump('/pages/miniClass/classList',item.id)">
<text class="txt555" @click="onPageJump('/pages/miniClass/classInfoMan',item)">
{{item.title}}
</text>
</view>
<view class="jianjie">
目标学员人数{{item.number}}
</view>
<!-- <view class="jianjie" v-html="item.content">
</view> -->
<view class="jianjie">
班内职务{{item.roleName}}
</view>
<view class="btn_box">
<!-- <text @click="enterClass" v-show="item.state == '0'">一键加入</text> -->
<text class="seeInfo">进入班级</text>
@@ -58,7 +59,7 @@
<view class="learnBox box">
<view class="newBox" v-if="learningClassList.length > 0">
<view class="item flexbox" v-for="(item, index) in learningClassList" :key="index"
@click="onPageJump('/pages/miniClass/classList',item.id)">
@click="onPageJump('/pages/miniClass/classInfoMan',item)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer" v-if="item.icon != ''">
<image :src="item.icon" mode="aspectFit"></image>
@@ -71,15 +72,16 @@
<text v-show="item.classModel.type == 0">普通班</text>
<text v-show="item.classModel.type == 1">联合班</text>
<text v-show="item.classModel.type == 2">精英班</text>
<text class="txt555" @click="onPageJump('/pages/miniClass/classList',item.id)">
<text class="txt555" @click="onPageJump('/pages/miniClass/classInfoMan',item)">
{{item.title}}
</text>
</view>
<view class="jianjie">
目标学员人数{{item.number}}
</view>
<!-- <view class="jianjie" v-html="item.content">
</view> -->
<view class="jianjie">
班内职务{{item.roleName}}
</view>
<view class="btn_box">
<!-- <text @click="enterClass" v-show="item.state == '0'">一键加入</text> -->
<text class="seeInfo">进入班级</text>
@@ -98,7 +100,7 @@
<view class="learnBox box">
<view class="newBox" v-if="classList.length > 0">
<view class="item flexbox" v-for="(item, index) in classList" :key="index"
@click="onPageJump('/pages/miniClass/classList',item.id)">
@click="onPageJump('/pages/miniClass/classInfoMan',item)">
<!-- <view class="imgcontainer" :style="{backgroundImage:surl(item.image)}"> -->
<view class="imgcontainer" v-if="item.icon != ''">
<image :src="item.icon" mode="aspectFit"></image>
@@ -111,15 +113,16 @@
<text v-show="item.classModel.type == 0">普通班</text>
<text v-show="item.classModel.type == 1">联合班</text>
<text v-show="item.classModel.type == 2">精英班</text>
<text class="txt555" @click="onPageJump('/pages/miniClass/classList',item.id)">
<text class="txt555" @click="onPageJump('/pages/miniClass/classInfoMan',item)">
{{item.title}}
</text>
</view>
<view class="jianjie">
目标学员人数{{item.number}}
</view>
<view class="jianjie">
班内职务{{item.roleName}}
</view>
<!-- <view class="jianjie" v-html="item.content">
</view> -->
<view class="btn_box">
<!-- <text @click="enterClass" v-show="item.state == '0'">一键加入</text> -->
<text class="seeInfo">进入班级</text>
@@ -227,7 +230,8 @@
status: 3, // 0 不显示, 1 加载中2 加载全部完成3 暂无数据
page: 1,
flag: true, // 函数是否执行完
roleObj:{},
roleCode:undefined
};
},
//第一次加载
@@ -240,6 +244,7 @@
this.pageTitle = e.title
this.pid = e.pid
console.log(e, '传入分类id')
this.getUserRole()
// this.getData()
// this.getCateList(this.tagId)
},
@@ -274,13 +279,15 @@
async onShow() {
// 隐藏原生的tabbar
// uni.hideTabBar();
this.roleCode = await this.getUserRole()
// console.log('this.roleCode----',this.roleCode);
this.classList = await this.getData('1','2')
this.learningClassList = await this.getData('1','1')
this.preClassList = await this.getData('1','0')
// this.getLearingClassList()
},
components: {
musicPlay
// musicPlay
},
//方法
methods: {
@@ -296,86 +303,30 @@
},
surl(imageurl) {
return `url(${imageurl})`
},
// 待开班
getPreClassList() {
uni.showLoading({
title: "加载中"
},
async getUserRole(){
var code = undefined
await this.$http.post("common/class/getRoleType").then( (res) => {
this.roleObj = res.result
if(this.roleObj.isMonitor){
code = '1'
return
}else if(this.roleObj.isdMonitor){
code = '2'
return
}else if(this.roleObj.isLearn){
code = '3'
return
}else if(this.roleObj.isComment){
code = '4'
return
}else if(this.roleObj.isCount){
code = '5'
return
}
})
$http.request({
url: "common/class/MyClassList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"role": "1",
"state": '0', //小班状态0待开班1已开班2完成
"type": '' // 班类型 0小班 1联合班 2精英班
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
if (res.result.length > 0) {
this.preClassList = res.result
} else {
this.preClassList = []
}
}
// uni.hideLoading()
this.getData()
}).catch(e => {
// uni.hideLoading()
// this.getData()
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: `获取数据失败`,
icon: 'error'
})
});
},
// 学习中
getLearingClassList() {
uni.showLoading({
title: "加载中"
})
$http.request({
url: "common/class/MyClassList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"role": "1",
"state": '1', //小班状态0待开班1已开班2完成
"type": '' // 班类型 0小班 1联合班 2精英班
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then(res => {
if (res.code == 0) {
if (res.result.length > 0) {
this.learningClassList = res.result
} else {
this.learningClassList = []
}
}
this.getPreClassList()
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
this.getPreClassList()
console.log(e, '数据报错')
// this.status = 3
uni.showToast({
title: `获取数据失败`,
icon: 'error'
})
});
},
return code
},
goCreateClass() {
console.log('this.addType', this.addType);
if (this.addType != undefined) {
@@ -419,7 +370,7 @@
url: "common/class/MyClassList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"role": role,
"isCommittee": role,
"state": state, //小班状态0待开班1已开班2完成
"type": '' // 班类型 0小班 1联合班 2精英班
},
@@ -427,10 +378,24 @@
'Content-Type': 'application/json'
},
})
.then(res => {
.then( async res => {
if (res.code == 0) {
if (res.result.length > 0) {
// this.classList = res.result
res.result.forEach(async item => {
item.roleName = ''
item.roleCode = []
if(item.role.length > 0){
var _roleList = item.role
_roleList = _roleList.map( item => {
return item.role
})
item.roleCode = _roleList
item.roleName = await this.getRoleName(_roleList)
console.log('res.result.roleName',res.result.roleName);
}
})
_list = res.result
} else {
// this.classList = []
@@ -452,19 +417,63 @@
});
return _list
},
async getRoleName(list) {
var _roleName = ''
// var _code = ''
await list.forEach(item => {
switch (item) {
case '66':
_roleName += '主任';
break;
case '0':
_roleName += ' 学员';
break;
case '1':
_roleName += ' 班长';
break;
case '2':
_roleName += ' 副班长';
break;
case '3':
_roleName += ' 学习委员';
break;
case '4':
_roleName += ' 评分员';
break;
case '5':
_roleName += ' 记分员';
break;
}
})
return _roleName
},
// 跳转
async onPageJump(url, id, have) {
var isStudent = await this.getRealRole(id)
console.log('isStudent',isStudent);
if(isStudent){
uni.navigateTo({
url:`/pages/miniClass/classInfo?id=${id}`
})
}else{
async onPageJump(url, val) {
// var isStudent = await this.getRealRole(id)
var _url = ''
console.log('item---',val);
var nn = 0
if(val.roleCode.length > 0){
val.roleCode.forEach(item=>{
if(item == '主任' || item == '副主任' || item == '1' || item == '2' ){
console.log('符合主任',url);
nn++
}
})
}
console.log('符合主任', _url);
if(nn > 0){
_url = url
}else{
_url = "/pages/miniClass/classInfoWork"
}
uni.navigateTo({
url: `${url}?id=${id}&have=${have}`
url: `${_url}?id=${val.id}`
});
}
},
// 获取真实的身份信息
async getRealRole(id) {
@@ -617,12 +626,12 @@
.jianjie {
line-height: 30rpx;
height: 60rpx;
margin-bottom: 10rpx;
overflow: hidden;
overflow: hidden !important;
margin-top: 10rpx;
font-size: 24rpx;
@include bov();
// @include bov();
color: #9c9c9c;
}

View File

@@ -4,13 +4,13 @@
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<uni-forms :modelValue="form" :rules="rules" ref="form">
<view class="input_box " style="" v-if="!form.id">
<!-- <view class="input_box " style="" v-if="!form.id">
<uni-forms-item label="" name="modelId" label-width="0">
<view class="">
<text class="input_tit"><i>*</i>班级类型</text>
</view>
<view class="in" style="flex: 1; border: none;">
<!-- {{modelLIst}} -->
<uni-data-select placeholder="请选择班级类型"
class="addType"
v-model="form.type"
@@ -20,19 +20,19 @@
></uni-data-select>
</view>
</uni-forms-item>
</view>
<view class="input_box " style="" v-if="!form.id">
</view> -->
<!-- <view class="input_box " style="" v-if="!form.id">
<uni-forms-item label="" name="modelId" label-width="0">
<view class="">
<text class="input_tit"><i>*</i>班级模型</text>
</view>
<view class="in" style="flex: 1; border: none;">
<!-- {{modelLIst}} -->
<uni-data-select style="width: 100%;" v-model="form.modelId" placeholder="请选择班级的模型"
:localdata="modelLIst"></uni-data-select>
</view>
</uni-forms-item>
</view>
</view> -->
<view class="input_box">
<uni-forms-item label="" name="title" label-width="0">
<text class="input_tit"><i>*</i>班级名称:</text>
@@ -139,6 +139,7 @@
modelLIst: [
// { value: 0, text: "请选择" },
],
modelTitle:undefined
};
},
//第一次加载
@@ -146,8 +147,8 @@
console.log('收到的值', e);
// this.pageType = e.type
this.form.type = e.type
// this.modeType = e.type
this.form.modelId = parseInt(e.modelId)
this.modelTitle = e.modelTitle
if(e.id){
this.pageType = '编辑'
this.form.id = e.id
@@ -339,6 +340,7 @@
})
return
}
console.log('*****',this.form.modelId);
var _url = ''
this.form.id ? _url = 'common/class/editClass' : _url = "common/class/addClass"
$http.request({
@@ -367,7 +369,7 @@
this.fileList1 = []
this.fileList2 = []
uni.navigateTo({
url:'/pages/miniClass/miniClassMan'
url:`/pages/miniClass/miniClassMan?id=${this.form.modelId}&modelTitle=${this.modelTitle}`
})
// this.$nextTick(() => {
// uni.navigateBack({

View File

@@ -5,11 +5,11 @@
<public-module ></public-module>
<!-- <view class="title">{{pageName+pageType}}</view> -->
<uni-forms :modelValue="form" :rules="rules" ref="form">
<view class="input_box" v-if="!form.id && form.type != 2">
<!-- <view class="input_box" v-if="!form.id && form.type != 2">
<uni-forms-item label="" name="type" label-width="0">
<text class="input_tit"><i>*</i>类型:</text>
<view class="in" style="flex: 1; border: none;">
<!-- {{modelLIst}} -->
<uni-data-select placeholder="请选择类型"
class="addType"
v-model="form.type"
@@ -20,7 +20,7 @@
</view>
</uni-forms-item>
</view>
</view> -->
<view class="input_box">
<uni-forms-item label="" name="title" label-width="0">
<text class="input_tit"><i>*</i>标题:</text>
@@ -123,7 +123,7 @@
},
pageType: '',
pageName:''
pageName:''
};
},
//第一次加载

View File

@@ -29,6 +29,27 @@
<view><text class="ciyao">人数</text><text class="mainTxt">{{students.length}}/{{thisClass.number}}</text></view>
<view><text class="ciyao">管理成员</text><text class="mainTxt" @click="seeManager">点击查看</text></view>
</view>
<view class="pingfenBox" >
<view class="scoreTitle">
<view class="titles flex_box">
<text>表现分</text><uni-icons type="help" size="18" color="#fff" @click="clickHelp"></uni-icons>
</view>
</view>
<view class="otherItems flex_box userScore">
<view>
<text class="ciyao">作业得分</text>
<text class="ciyao"><i class="mainTxt PM_font">3</i></text>
</view>
<view><text class="ciyao">医案得分</text>
<text class="ciyao"><i class="mainTxt PM_font">6</i></text>
</view>
<view><text class="ciyao">心得得分</text>
<text class="ciyao"><i class="mainTxt PM_font">10</i></text></view>
<view><text class="ciyao">思考题分</text>
<text class="ciyao"><i class="mainTxt PM_font">2</i></text></view>
</view>
</view>
<view class="mainBox">
<view class="">
<u-tabs v-if="tabList.length > 0" :class="['tabList']" @click="tabClick" :current="curTagIndex"
@@ -226,6 +247,7 @@
</view>
</u-popup>
<z-navigation ></z-navigation>
</view>
</template>
@@ -237,6 +259,7 @@
export default {
data() {
return {
horizontal: 'right',
vertical: 'bottom',
direction: 'vertical',
@@ -265,12 +288,17 @@
thisClass: {},
students: [],
tabId: '0',
tabId: '3',
curTagIndex: 0,
scrollable: false,
pPage:0,
// 已开班
tabList02: [{
tabList02: [
{
name: '班内提交',
id: '3'
},
{
name: '班内课程',
id: '0'
},
@@ -281,10 +309,7 @@
{
name: '班内学员',
id: '2'
}, {
name: '班内提交',
id: '3'
}
}
],
// 待开班
tabList01: [{
@@ -366,14 +391,7 @@
this.taskList = []
this.getList()
uni.stopPullDownRefresh()
},
onBackPress() {
if (this.$refs.fab.isShow) {
this.$refs.fab.close()
return true
}
return false
},
},
onShow() {
this.getClassInfo()
@@ -790,6 +808,14 @@
}
});
},
clickHelp(){
uni.showModal({
title:'说明',
content:"表现分占最终总成绩的40%,由作业,医案,心得,思考题四部分构成每部分各占四分之一且每部分最高为10分总计40分。",
showCancel:false,
confirmText:'好的'
})
},
showmoreTask(){
uni.navigateTo({
url:`/pages/miniClass/classCaskList?id=${this.thisClass.id}&type=${this.tijiaoTitleId}`
@@ -847,7 +873,9 @@
this.courses = res.result.courses
this.students = res.result.students
this.refresh = true
if(this.thisClass.state != 0){
this.getList()
}
}
uni.hideLoading()
}).catch(e => {
@@ -901,12 +929,19 @@
.btn{display: inline-block; border-radius: 20rpx ; padding: 10rpx 20rpx; background-color: $themeColor; color: #fff;}
}
.taskEdit{color: $themeColor; display: inline-block; padding-left: 20rpx;}
.scoreTitle{text-align: center; margin-bottom: 20rpx;
.titles{display: inline-block; padding: 6rpx 20rpx; background-color: #258feb;
border-radius: 0 0 30rpx 30rpx ; color: #fff;
text{ font-size: 40rpx !important;}
}
span{display: block;}
}
.pingfenBox {
border: 2px dotted #bed4ee;
padding: 20rpx;
background-color: rgba(255, 255, 255, .6);
background-color: #fff;
border-radius: 20rpx;
padding-top: 0;
.flex_box {
justify-content: space-between;
}
@@ -1031,6 +1066,9 @@
border-radius: 40rpx;
}
}
.userScore{ text-align: center;
.mainTxt{font-size: 50rpx; color: $themeColor; font-style: normal; padding-right: 4rpx;}
}
.qrcode{width:100%;
image{
width: 200rpx;height: 200rpx;

View File

@@ -18,12 +18,11 @@
<h3 style="margin-top: 20rpx; font-size: 28rpx;">班级名称{{thisClass.title}}</h3>
<view class="welComeText">
<text> 班内职务{{getRoleName}} </text>
</view>
</view>
<view class="pingfenBox" >
<!-- 功能按钮 -->
<view class="optionsBtn" v-if="(roleCode.includes('66') || roleCode.includes('1') || roleCode.includes('2')) && thisClass.state != '2'">
<view class="optionsBtn" v-if="(roleCode.includes('主任') || roleCode.includes('副主任') || roleCode.includes('1') || roleCode.includes('2')) && thisClass.state != '2'">
<view class="flex_box">
<view class="item setBanewei" v-if="thisClass.state != '2'"
@click="goSetAdmin('/pages/miniClass/memberSet')">
@@ -35,51 +34,20 @@
<text>修改班级</text>
</view>
<!-- 主任班长副班长可以开班或者结班 -->
<view class="item openClass" @click="changeClassStatu('1')" v-if="thisClass.state == '0'">
<view class="item openClass" @click="changeClassStatu('1')" v-if="thisClass.state == '0' && (roleCode.includes('1') || roleCode.includes('2'))">
<text>开班</text>
</view>
<view class="item overClass" @click="changeClassStatu('2')" v-if="thisClass.state == '1' ">
<view class="item overClass" @click="changeClassStatu('2')" v-if="thisClass.state == '1' && (roleCode.includes('1') || roleCode.includes('2'))">
<text>结班</text>
</view>
<view class="item delClass" v-if="thisClass.state == '0'" @click="delClass()">
<view class="item delClass" v-if="thisClass.state == '0' && (roleCode.includes('主任') || roleCode.includes('副主任'))" @click="delClass()">
<text>删除班级</text>
</view>
</view>
</view>
<!-- 作业批改 -->
<view class="flex_box">
<view class="item" @click="goAddHomeWork" v-if="thisClass.state == '1' && roleCode.includes('2') || thisClass.state == '1' && roleCode.includes('1')">
<view class="img">
<image src="../../static/icon/fabu.png" mode="widthFix"></image>
</view>
<text>发布</text>
</view>
<view class="item" @click="goPingfen('/pages/miniClass/taskList',thisClass.id, '0')">
<view class="img">
<image src="../../static/icon/pigai2.png" mode="widthFix"></image>
</view>
<text>作业</text>
</view>
<view class="item" @click="goPingfen('/pages/miniClass/taskList',thisClass.id, '1')">
<view class="img">
<image src="../../static/icon/pigai1.png" mode="widthFix"></image>
</view>
<text>医案</text>
</view>
<view class="item" @click="goXindeList('/pages/miniClass/xindeList')">
<view class="img">
<image src="../../static/icon/pigai3.png" mode="widthFix"></image>
</view>
<text>心得</text>
</view>
<view class="item" @click="goSikaoList('/pages/miniClass/sikaoQuestionList', thisClass.id)">
<view class="img">
<image src="../../static/icon/sikaoti.png" mode="widthFix"></image>
</view>
<text>思考题</text>
</view>
</view>
<class-infoWork-blank :thisClass="thisClass" :roleCode="roleCode"></class-infoWork-blank>
</view>
<view class="otherItems flex_box">
<view><text class="ciyao">创建日期</text><text
@@ -126,12 +94,27 @@
<view class="" v-show="courses.length == 0">
<u-divider text="暂无课程"></u-divider>
</view>
<uni-section class="mb-10 nobg" title="教学目标/班级简介" type="line"></uni-section>
<!-- 作业列表 -->
<template v-if="homeWorkList.length > 0 && thisClass.state == 0">
<uni-section class="mb-10 nobg" title="班内作业" type="line"></uni-section>
<view class="newBox" v-show="homeWorkList.length > 0">
<view class="item flexbox" v-for="(item, index) in homeWorkList" :key="index"
@click="clickTask(item)">
<view class="buyItems">
<view class="txt555">
{{item.title}}
</view>
<view class="jianjie" v-html="item.content"></view>
</view>
</view>
</view>
</template>
<!-- <uni-section class="mb-10 nobg" title="教学目标/班级简介" type="line"></uni-section>
<rich-text class="banjiJianjie" :nodes="formatRichText(thisClass.content)"></rich-text>
<view class="qrcode" v-if="thisClass.qrcode != ''">
<uni-section class="mb-10 nobg" title="群二维码" type="line"></uni-section>
<image :src="thisClass.qrcode" mode="widthFix" @click="previewImage(thisClass.qrcode)"></image>
</view>
</view> -->
</view>
</view>
@@ -194,6 +177,7 @@
</template>
<script>
import classInfoWorkBlank from "@/components/classInfoWorkBlank.vue";
import $http from '@/config/requestConfig.js';
import {
mapState
@@ -290,11 +274,13 @@
taskHaveMore: false, // 是否还有更多
roleCode: [], // 角色数组
interval:null,
homeWorkList:[]
}
},
onLoad(e) {
uni.hideTabBar();
this.classId = e.id
this.interval = setInterval(() => {
if(this.thisClass.id){
uni.showLoading({
@@ -314,29 +300,29 @@
beforeDestroy() {
clearInterval(this.interval)
},
// onBackPress() {
// if (this.$refs.fab.isShow) {
// this.$refs.fab.close()
// return true
// }
// return false
// },
onShow() {
this.getClassInfo()
onShow() {
this.getClassInfo()
// this.roleCode = await this.getRealRole()
},
components: {
// musicPlay
classInfoWorkBlank,
},
computed: {
...mapState(["userInfo"]),
getRoleName() {
getRoleName() {
console.log('执行一次');
var _roleName = ''
// var _code = ''
this.roleCode.forEach(item => {
switch (item) {
case '66':
_roleName += '主任';
case '主任':
_roleName += ' 主任';
break;
case '副主任':
_roleName += ' 副主任';
break;
case '0':
_roleName += ' 学员';
@@ -359,7 +345,7 @@
}
})
return _roleName
},
},
getClassStatus() {
var _roleName = ''
switch (this.thisClass.state) {
@@ -377,10 +363,14 @@
}
},
methods: {
goAddHomeWork(){
clickTask(item){
uni.navigateTo({
url:`/pages/miniClass/taskDetailForMan?id=${item.id}&roleCode=${this.roleCode}&type=0&classState=${this.thisClass.state}`
})
},
goAddHomeWork(type){
uni.navigateTo({
url: `/pages/miniClass/addHomeWork?classId=${this.thisClass.id}`
url: `/pages/miniClass/addHomeWork?classId=${this.thisClass.id}&type=${type}`
})
},
@@ -389,41 +379,33 @@
url:`${url}?classId=${this.thisClass.id}&type=2&roleCode=${this.roleCode}`
})
},
// 获取真实的身份信息
getRealRole() {
console.log('this.thisClass.id', this.thisClass.id);
$http.request({
url: "common/class/getUserRole",
method: "POST",
data: {
"classId": this.thisClass.id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then((res) => {
uni.hideLoading()
// console.log('res获取身份信息', res);
var _list = []
if (res.result.length > 0) {
_list = res.result
_list = _list.map(item => {
return item.role
})
console.log('——list', _list)
}
this.roleCode = this.roleCode.concat(_list)
}).catch(e => {
uni.hideLoading()
this.roleCode = []
uni.showToast({
title: '获取身份信息失败',
icon: 'error'
})
});
},
// 获取真实的身份信息
getRealRole() {
console.log('this.thisClass.id', this.thisClass.id);
$http.request({
url: "common/class/getUserRole",
method: "POST",
data: {
"classId": this.thisClass.id
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
},
})
.then((res) => {
uni.hideLoading()
console.log('res获取身份信息',this.thisClass.id, res);
this.roleCode = res.result
}).catch(e => {
uni.hideLoading()
this.roleCode = []
uni.showToast({
title: '获取身份信息失败',
icon: 'error'
})
});
},
goPingfen(url, classId, type) {
uni.navigateTo({
url: `${url}?classId=${classId}&type=${type}&roleCode=${this.roleCode}`
@@ -433,12 +415,15 @@
uni.navigateTo({
url:`${url}?classId=${id}&roleCode=${this.roleCode}`
})
},
// 点击作业或者医案,进入详细介绍
clickTask() {
},
},
delClass() {
if(this.students.length > 0){
uni.showToast({
title: '已经有学员加入,不可删除班级',
icon: 'none'
})
return
}
var that = this
uni.showModal({
title: '提示',
@@ -528,16 +513,9 @@
uni.hideLoading()
this.userMes = res.result;
this.isMonitor = res.isMonitor
this.isDirector = res.isDirector
if (this.isDirector) {
this.roleCode.push('66')
}
if (this.isMonitor) {
console.log('确定具体的职位是什么');
this.isDirector = res.isDirector
this.getRealRole()
} else {
}
}).catch(e => {
uni.hideLoading()
uni.showToast({
@@ -632,18 +610,68 @@
})
}, 200)
},
// 获取固定作业的数量
async getHomeWorkLength(){
var list = []
await $http.request({
url: "common/class/getClassTaskList",
method: "POST",
data: {
"limit": 100,
"page": 1,
"classId": this.thisClass.id,
"type": "0", //类型 0班内任务1医案2心得
"title": ""
},
header: { //默认 无 说明:请求头
'Content-Type': 'application/json'
}
}).then((res) => {
// console.log('班内作业的输俩个',res);
if(res.code == 0){
list = res.page.records
}
}).catch(e => {
list = []
console.log('e',e);
})
return list
},
// 改变班级状态
changeClassStatu(statusCode) {
changeClassStatu(statusCode) {
// var mm = 0
// mm = await this.getHomeWorkLength()
let that = this
if (statusCode == '1') {
console.log('this.admins',this.admins);
if (this.admins.list.length == 0) {
if(this.homeWorkList.length == 0){
uni.showToast({
title: '请先完成管理人员的设置',
icon: 'none'
title: '开班前请发布班内作业,开班后将不可添加和更改',
icon: 'none',
duration:3000
})
return
}
if (this.students.length < this.thisClass.number) {
uni.showModal({
title: "提示",
content:'班内成员还没有招满,确定开班操作吗?',
success(res) {
if (res.confirm) {
that.opClass(statusCode)
}else{
return
}
},
})
}
}else{
that.opClass(statusCode)
}
},
// 班级操作
opClass(statusCode){
$http.request({
url: "common/class/editClass",
method: "POST",
@@ -671,12 +699,7 @@
}, 500)
}
}).catch(e => {
console.log(e, '数据报错')
// this.status = 3
// uni.showToast({
// title: e.msg,
// icon: 'error'
// })
console.log(e, '数据报错')
});
},
taskEdit(item) {
@@ -745,7 +768,7 @@
url: `/pages/miniClass/classCaskList?id=${this.thisClass.id}&type=${this.tijiaoTitleId}`
})
},
getClassInfo() {
async getClassInfo() {
uni.showLoading({
title: '正在加载'
})
@@ -759,7 +782,7 @@
'Content-Type': 'application/json'
},
})
.then(res => {
.then(async res => {
console.log('res--------',this.classId,res,);
this.refresh = false
if (res.code == 0) {
@@ -797,8 +820,12 @@
this.classModel = res.result.classModel
this.courses = res.result.courses
this.students = res.result.students
this.refresh = true
}
this.refresh = true
if(this.thisClass.state == 0){
this.homeWorkList = await this.getHomeWorkLength()
}
}
uni.hideLoading()
}).catch(e => {
uni.hideLoading()
@@ -848,7 +875,8 @@
.optionsBtn {
margin-bottom: 30rpx;
border-bottom: 1px solid #eee; padding-bottom: 30rpx;
// border-bottom: 1px solid #eee;
padding-bottom: 10rpx;
margin-top: 20rpx;
.flex_box {
@@ -939,16 +967,16 @@
}
}
.img {
width: 100rpx;
height: 100rpx;
margin: 0 auto;
// .img {
// width: 100rpx;
// height: 100rpx;
// margin: 0 auto;
image {
width: 100%;
height: 100%;
}
}
// image {
// width: 100%;
// height: 100%;
// }
// }
}
.qrcode{width:100%;
@@ -1130,7 +1158,7 @@
// background-color: #f4f7ff;
}
u-divider{font-size: 24rpx;}
.newBox {
.item {
@@ -1140,7 +1168,8 @@
@include ptop_bottm(10px);
@include pleft_right(10px);
@include mshadow(10px, 1) .imgcontainer {
// @include mshadow(10px, 1)
.imgcontainer {
display: block;
width: 80rpx;
margin-right: 20rpx;

File diff suppressed because it is too large Load Diff

View File

@@ -7,7 +7,7 @@
<public-module></public-module>
<uni-forms :modelValue="form" :rules="rules" ref="form" v-if="roleCode.length > 0">
<view class="input_box " style="">
<uni-forms-item label="" name="monitor" label-width="0" v-show="roleCode.includes('66')">
<uni-forms-item label="" name="monitor" label-width="0" v-show="roleCode.includes('主任') || roleCode.includes('副主任')">
<view class="">
<text class="input_tit"><i>*</i>班长</text>
</view>
@@ -44,7 +44,7 @@
</view>
</uni-forms-item>
<uni-forms-item label="" name="dmonitor" label-width="0"
v-show="roleCode.includes('1') || roleCode.includes('66')">
v-show="roleCode.includes('1') || roleCode.includes('主任') || roleCode.includes('副主任')">
<view class="">
<text class="input_tit">
<!-- <i>*</i> -->
@@ -256,7 +256,7 @@
"monitor": undefined, //班长
"dmonitor": undefined, //2班长
"learner": undefined, //学习委员
"scorer": [undefined, undefined], //评分员
"scorer": [undefined, undefined,undefined], //评分员
"counter": [undefined, undefined] //记分员
},
telError: false,

View File

@@ -2,7 +2,7 @@
<view>
<!-- 公共组件-每个页面必须引入 -->
<public-module></public-module>
<z-nav-bar title="主任班级管理"></z-nav-bar>
<z-nav-bar title="教研室班级管理"></z-nav-bar>
<!-- 主任和副主任可以创建班级 -->
<view class="classNewBtn" >
<view class="box88 flex_box">
@@ -12,7 +12,7 @@
</view>
</view>
<view class="modelName">
当前模型名称{{modelTitle}}
当前教研室名称{{modelTitle}}
</view>
<!-- <view class="tabsBox" :class="[fixed ? 'fixed' : '' ]">
<u-tabs v-if="tabList.length > 0" :class="['tabList']" @click="fatherClick" :current="curTagId"
@@ -51,8 +51,9 @@
<view class="jianjie">
目标学员人数{{item.number}}
</view>
<!-- <view class="jianjie" v-html="item.content">
</view> -->
<view class="jianjie" >
班内职务{{item.roleName}}
</view>
<view class="btn_box">
<!-- <text @click="enterClass" v-show="item.state == '0'">一键加入</text> -->
<text class="seeInfo">进入班级</text>
@@ -87,8 +88,9 @@
<view class="jianjie">
目标学员人数{{item.number}}
</view>
<!-- <view class="jianjie" v-html="item.content">
</view> -->
<view class="jianjie" >
班内职务{{item.roleName}}
</view>
<view class="btn_box">
<!-- <text @click="enterClass" v-show="item.state == '0'">一键加入</text> -->
<text class="seeInfo">进入班级</text>
@@ -127,8 +129,9 @@
<view class="jianjie">
目标学员人数{{item.number}}
</view>
<!-- <view class="jianjie" v-html="item.content">
</view> -->
<view class="jianjie" >
班内职务{{item.roleName}}
</view>
<view class="btn_box">
<!-- <text @click="enterClass" v-show="item.state == '0'">一键加入</text> -->
<text class="seeInfo">进入班级</text>
@@ -300,7 +303,7 @@
methods: {
goAddClasss(){
uni.navigateTo({
url:`/pages/miniClass/addClass?type=${this.modelType}`
url:`/pages/miniClass/addClass?type=${this.modelType}&modelId=${this.modelId}&modelTitle=${this.modelTitle}`
})
},
selectChange(e) {
@@ -369,11 +372,20 @@
if (res.classEntityList.length > 0) {
// this.classList = res.result
_list = res.classEntityList
_list.forEach(item => {
item.roleName = ''
if(item.ddirectorId == this.userInfo.id){
item.roleName = '副主任'
}
if(item.directorId == this.userInfo.id){
item.roleName = '主任'
}
})
} else {
// this.classList = []
_list = []
}
// this.flag = true
console.log('res.classEntityList',res.classEntityList);
}
uni.hideLoading()
}).catch(e => {

View File

@@ -343,7 +343,7 @@
url: "common/class/MyClassList",
method: "POST", // POST、GET、PUT、DELETE具体说明查看官方文档
data: {
"role": role,
"isCommittee": role,
"state": state, //小班状态0待开班1已开班2完成
"type": '' // 班类型 0小班 1联合班 2精英班
},

View File

@@ -19,8 +19,9 @@
</view>
<view class="taskContent" v-html="thisTask.content">
</view>
<view class="editBtn" @click="goEdit" v-if="zuoyeList.length == 0">
</view>
<view class="editBtn" @click="goEdit" v-if="
( classState == 0 && taskType == 0 || taskType != 0) && zuoyeList.length == 0 && (roleCode.includes('1') || roleCode.includes('2'))">
<text>修改</text>
</view>
</view>
@@ -55,7 +56,7 @@
</view>
<view class="score noscore" v-else-if="item.scoreInfo != ''">
<text v-show="item.scoreInfos < 2 && item.haveGiveScore">等待另一名评分员评分</text>
<text v-show="item.scoreInfos < 2 && !item.haveGiveScore">请您评分</text>
<text v-show="item.scoreInfos < 2 && !item.haveGiveScore && roleCode.includes('4')">请您评分</text>
<button v-show="item.scoreInfos >= 2" class="getScore" @click.stop="getRealScore(item.id)" >生成成绩</button>
</view>
<view class="score noscore" v-else>未开始评分</view>
@@ -100,15 +101,16 @@
分数:{{curReplay.score}}
</view>
<view class="score noscore" v-show="curReplay.scoreSuccess == 0">
未评分
未生成成绩
</view>
<template v-if="roleCode.includes('4') && curReplay.scoreSuccess != 1 || roleCode.includes('5') && curReplay.scoreSuccess != 1">
<view class="" style="background-color: beige; padding: 10rpx 10rpx; margin-top: 20rpx;">
<uni-forms :modelValue="form" :rules="rules" ref="form">
<uni-forms-item label="分数" name="score" >
<uni-easyinput type="number" v-model="form.score" placeholder="请输入分数:0-2.5分" />
</uni-forms-item>
</uni-forms>
<view class="" style=" padding: 10rpx 10rpx; margin-top: 20rpx;">
<view class="scoreBox flex_box">
<text>分数</text>
<text v-for="(item, index) in scoreList" @click="setScore(item)" :class="[item == form.score ?'active' : '' ]">
{{item}} 分
</text>
</view>
</view>
<view class="btn_box ">
<button class="submit" @click="onSubmit">提 交</button>
@@ -159,14 +161,21 @@
},
listDisplay: '1', // 提交记录展示类型 0 全部 1 自己的
roleCode:'',
pageType:''
pageType:'',
classState:undefined,
taskType:undefined,
scoreList:[
0,0.5,1,1.5,2,2.5
],
}
},
onLoad(e) {
uni.hideTabBar();
this.classState = e.classState
// this.thisTask = JSON.parse(e.options)
console.log('e', e)
this.roleCode = e.roleCode
this.taskType = e.type
if (e.id) {
this.thisTask.id = e.id
@@ -211,6 +220,11 @@
...mapState(["userInfo"]),
},
methods: {
setScore(val){
// if(this.form.score == val) return
this.form.score = val
console.log('this.form.score',this.form.score);
},
// 生成成绩
getRealScore(id){
uni.showLoading({
@@ -491,21 +505,14 @@
});
},
onSubmit() {
this.$refs.form.validate().then(res => {
if(this.form.score > 2.5){
// this.$refs.form.validate().then(res => {
if(!this.form.score){
uni.showToast({
title:'分数不能大于2.5',
title:'请选择分值',
icon:'none'
})
return
}
if(this.form.score < 0){
uni.showToast({
title:'分数不能小于0分',
icon:'none'
})
return
}
}
var _url = "common/class/editScore"
var data = {
"score": this.form.score,
@@ -540,13 +547,13 @@
icon: 'error'
})
});
}).catch(err => {
console.log('表单错误信息:', err);
uni.showToast({
title: '页面有未填写的内容哦',
icon: 'none'
})
})
// }).catch(err => {
// console.log('表单错误信息:', err);
// uni.showToast({
// title: '页面有未填写的内容哦',
// icon: 'none'
// })
// })
},
clickStudents(item) {
console.log('item', item);
@@ -637,10 +644,14 @@
}}
.zuoyeListBox {
margin-top: 40rpx;
background-color: #fff;
// background-color: #fff;
border-radius: 20rpx;
}
.scoreBox{
text{display: inline-block; font-size: 26rpx; width: 100%; border: 1px solid #ddd; text-align: center; line-height:60rpx; border-right: none;}
text:last-child{border-right: 1px solid #ddd;}
text.active{background-color: #55aaff; color: #fff; border-color: #55aaff;}
}
.btn_box {
margin-top: 70rpx;
padding-bottom: 20rpx;

View File

@@ -57,16 +57,22 @@
分数{{curReplay.score}}
</view>
<view class="score noscore" v-show="curReplay.scoreSuccess == 0">
评分
生成成绩
</view>
<!-- -->
<template v-if="roleCode.includes('4') && curReplay.scoreSuccess != 1 || roleCode.includes('5') && curReplay.scoreSuccess != 1 ">
<view class="" style="background-color: beige; padding: 10rpx 10rpx; margin-top: 20rpx;">
<uni-forms :modelValue="form" :rules="rules" ref="form">
<view class="" style=" padding: 10rpx 10rpx; margin-top: 20rpx;">
<view class="scoreBox flex_box">
<text>分数</text>
<text v-for="(item, index) in scoreList" @click="setScore(item)" :class="[item == form.score ?'active' : '' ]">
{{item}}
</text>
</view>
<!-- <uni-forms :modelValue="form" :rules="rules" ref="form">
<uni-forms-item label="分数" name="score" >
<uni-easyinput type="number" v-model="form.score" placeholder="请输入分数:0-2.5分" />
</uni-forms-item>
</uni-forms>
</uni-forms> -->
</view>
<view class="btn_box"><button @click="onSubmit"> </button></view>
</template>
@@ -91,6 +97,9 @@
pageName: '',
taskList: [],
fileList1:[],
scoreList:[
0,0.5,1,1.5,2,2.5
],
rules: {
score: {
rules: [{
@@ -141,22 +150,19 @@
onBackPress() {
},
methods: {
setScore(val){
// if(this.form.score == val) return
this.form.score = val
},
onSubmit() {
this.$refs.form.validate().then(res => {
if(this.form.score > 2.5){
// this.$refs.form.validate().then(res => {
if(!this.form.score){
uni.showToast({
title:'分数不能大于2.5',
title:'请选择分值',
icon:'none'
})
return
}
if(this.form.score < 0){
uni.showToast({
title:'分数不能小于0分',
icon:'none'
})
return
}
}
var _url = "common/class/editTaskScore"
var data = {
"score": this.form.score,
@@ -190,13 +196,13 @@
icon: 'error'
})
});
}).catch(err => {
console.log('表单错误信息:', err);
uni.showToast({
title: '页面有未填写的内容哦',
icon: 'none'
})
})
// }).catch(err => {
// console.log('表单错误信息:', err);
// uni.showToast({
// title: '页面有未填写的内容哦',
// icon: 'none'
// })
// })
},
previewImage(url) {
console.log(url);
@@ -352,6 +358,11 @@
border-radius: 0 0 20rpx 20rpx;
}
}
.scoreBox{
text{display: inline-block; font-size: 26rpx; width: 100%; border: 1px solid #ddd; text-align: center; line-height:60rpx; border-right: none;}
text:last-child{border-right: 1px solid #ddd;}
text.active{background-color: #55aaff; color: #fff; border-color: #55aaff;}
}
.btn_box {
margin-top: 70rpx;
padding-bottom: 20rpx;