Browse Source

Merge branch 'develop3.0-tmd' of http://106.12.23.251:10080/TEAMMODEL/TEAMModelOS into develop3.0-tmd

CrazyIter_Bin 4 năm trước cách đây
mục cha
commit
8d8bc6d88f

+ 4 - 3
TEAMModelOS/ClientApp/src/components/questionnaire/BaseQnForm.vue

@@ -15,7 +15,7 @@
 				</div>
 				<Select multiple v-model="qnForm.classes" :class="!qnFormEdit ? 'qn-form-disabled':''" :placeholder="$t('survey.form.targetPlace')" v-else>
 					<!-- <Option v-for="(item,index) in classRooms" :value="item.id" :key="index">{{ item.name }}</Option> -->
-						<Option v-for="item in classRooms.filter(i=>i.scope === classType)" :value="item.id" :key="item.id">{{ item.name }}</Option>
+						<Option v-for="(item,index) in classRooms.filter(i=>i.scope === classType)" :value="item.id" :key="index">{{ item.name }}</Option>
 						<!-- <Option v-for="item in classRooms" :value="item.id" :key="item.id">{{ item.name }}</Option> -->
 				</Select>
 			</FormItem>
@@ -172,8 +172,9 @@
 							params.description = this.qnForm.description
 							// 新增参数
 							params.creatorId = this.$store.state.userInfo.TEAMModelId
-							params.owner = this.$route.name === 'personalSurvey' && this.classType === 'private' ? this.$store.state.userInfo
-								.TEAMModelId : this.$store.state.userInfo.schoolCode
+							params.school = params.scope === 'school' ?  this.getCurCode : null
+							params.blobcntr = params.scope === 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
+							
 							
 							// 如果是编辑状态 则直接复制ID 如果是新增 则直接赋值新ID
 							if (this.isEdit && this.editInfo.id && this.editInfo.code) {

+ 14 - 6
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/Vote.vue

@@ -186,6 +186,7 @@
                     console.log(this.voteInfo.recordUrl)
                     let data = await this.getBlobItems(this.voteInfo)
                     this.setData(data[0])
+                    console.log(data)
                 }
             },
             // 获取blob里的试题数据
@@ -212,22 +213,29 @@
             },
             //准备图表数据
             setData(data) {
+                this.voteData = []
+                this.voteList = []
                 if (data.options.length) {
-                    this.voteData = []
-                    this.voteList = []
-                    for (let item of data.options) {
+                    let code = []
+                    code = data.options.sort((a, b) => {
+                        return (a.code < b.code) ? -1 : (a.code > b.code) ? 1 : 0;
+                    })
+                    for (let item of code) {
                         this.voteData.push({
                             value: item.count,
                             itemStyle: { color: "#00AD6C" },
                         })
                         this.voteList.push(item.code)
                     }
-                    this.voteList = this.voteList.sort()
                 }
             },
+            //排序
+            compare(val1, val2){
+                return val1.code.toLowerCase() < val2.code.toLowerCase()
+             },
             showRes() {
-                this.showResult = !this.showResult
-            },
+            this.showResult = !this.showResult
+             },
             //获取投票结果
             getVote(data) {
                 if (!this.voteInfo.repeat) {

+ 6 - 2
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/VoteResultChart.vue

@@ -1,7 +1,8 @@
 <template>
     <div class="vote-result-chart">
         <Card class="vote-chart-card">
-            <div id="main" style="height:400px;width:600px"></div>
+            <div id="main" style="height:350px;width:600px"></div>
+            <span v-if="voteData.length == 0">暂未投票结果数据</span>
         </Card>
     </div>
 </template>
@@ -28,7 +29,10 @@
             };
         },
         mounted() {
-            this.setMyMap()
+            console.log(this.voteData)
+            if (this.voteData.length) {
+                this.setMyMap()
+            }
         },
         methods: {
            setMyMap() {

+ 1 - 2
TEAMModelOS/ClientApp/src/utils/kityformula.js

@@ -31,9 +31,8 @@ export default function(editor) {
 						const kfe = node.contentWindow.kfe
 						let latex = kfe.execCommand('get.source')
 						// 去掉空格
-						latex = latex.replace(/\s/g, '') 
+						// latex = latex.replace(/\s/g, '') 
 						// 将latex转换成svg输出
-						console.log(window.MathJax)
 						const html = window.MathJax.tex2svg(latex,{em: 12, ex: 6})
 						// 匹配输出的svg标签内容直接插入到编辑器中
 						var regex = /\<svg .*\>.*\<\/svg\>/;

+ 8 - 8
TEAMModelOS/ClientApp/src/view/learnactivity/CreatePrivEva.vue

@@ -262,7 +262,7 @@ export default {
                 targets: [
                     { required: true, message: this.$t('learnActivity.createEv.errTips6'), type: 'array', trigger: 'change' }
                 ],
-                targetClassIds: [
+                classes: [
                     { required: true, message: this.$t('learnActivity.createEv.errTips6'), type: 'array', trigger: 'change' }
                 ],
                 publish: [
@@ -279,7 +279,7 @@ export default {
             evaluationInfo: {
                 name: '',
                 targets: [],
-                targetClassIds: [],
+                classes: [],
                 scope: 'school',
                 type: '',  //测试类别
                 source: '',
@@ -308,7 +308,7 @@ export default {
         //重置课程类型
         resetCourse() {
             this.evaluationInfo.targets = []
-            this.evaluationInfo.targetClassIds = []
+            this.evaluationInfo.classes = []
         },
         //新结构 校本和个人课程一个API返回
         getCourseList() {
@@ -465,7 +465,7 @@ export default {
                             })
                             if (defCus) {
                                 defCus.children.forEach(item => {
-                                    if (this.evaluationInfo.targetClassIds.indexOf(item.value) > -1) {
+                                    if (this.evaluationInfo.classes.indexOf(item.value) > -1) {
                                         let arr = [defCus.value, item.value]
                                         this.evaluationInfo.targets.push(arr)
                                     }
@@ -515,8 +515,8 @@ export default {
             }
 
             //获取施测对象id 
-            this.evaluationInfo.targetClassIds = []
-            this.evaluationInfo.targetClassIds = this.evaluationInfo.targets.map(item => {
+            this.evaluationInfo.classes = []
+            this.evaluationInfo.classes = this.evaluationInfo.targets.map(item => {
                 return item[1]
             })
             //设置评测“学科”
@@ -682,13 +682,13 @@ export default {
                 year: new Date().getFullYear(),
                 // range: this.mode,
                 source: this.evaluationInfo.source,
-                targetClassIds: this.evaluationInfo.targetClassIds,
+                classes: this.evaluationInfo.classes,
                 publish: this.evaluationInfo.publish,
                 startTime: this.evaluationInfo.publish == 0 ? Math.round(new Date()) : this.evaluationInfo.startTime,
                 endTime: this.evaluationInfo.endTime,
                 scope: this.evaluationInfo.scope,
                 createDate: Math.round(new Date()),
-                owner: this.evaluationInfo.scope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId //后面新增字段
+                blobcntr: this.evaluationInfo.scope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId //后面新增字段
             }
 
             this.$api.learnActivity.SaveExamInfo(requestData).then(

+ 5 - 5
TEAMModelOS/ClientApp/src/view/learnactivity/CreateSchoolEva.vue

@@ -176,7 +176,7 @@ export default {
             evaluationInfo: {
                 name: '',
                 targets: [],
-                targetClassIds: [],
+                classes: [],
                 grades: [],
                 type: '',  //测试类别
                 source: '',
@@ -238,7 +238,7 @@ export default {
 
         treeChange(data) {
             //获取classIds
-            this.evaluationInfo.targetClassIds = data.map(item => {
+            this.evaluationInfo.classes = data.map(item => {
                 return item[1]
             })
             //获取年级对象
@@ -496,13 +496,13 @@ export default {
                 year: new Date().getFullYear(),
                 range: this.mode,
                 source: this.evaluationInfo.source,
-                targetClassIds: this.evaluationInfo.targetClassIds,
+                classes: this.evaluationInfo.classes,
                 publish: this.evaluationInfo.publish,
                 startTime: this.evaluationInfo.publish == 0 ? Math.round(new Date()) : this.evaluationInfo.startTime,
                 endTime: this.evaluationInfo.endTime,
                 scope: this.mode,
                 createDate: Math.round(new Date()),
-                owner: this.$store.state.userInfo.schoolCode //后面新增字段
+                blobcntr: this.$store.state.userInfo.schoolCode //后面新增字段
             }
 
             this.$api.learnActivity.SaveExamInfo(requestData).then(
@@ -660,7 +660,7 @@ export default {
             this.$store.dispatch('user/getSchoolProfile').then(
                 res => {
                     let f = res.school_classes.filter((item) => {
-                        return routerData.targetClassIds.indexOf(item.id) > -1
+                        return routerData.classes.indexOf(item.id) > -1
                     })
                     this.evaluationInfo.targets = []
                     f.forEach((item, index) => {

+ 3 - 3
TEAMModelOS/ClientApp/src/view/learnactivity/PrivScoring.vue

@@ -495,7 +495,7 @@ export default {
                 }
                 if (n.scope == 'school') {
                     let requestData = {
-                        ids: this.examInfo.targetClassIds,
+                        ids: this.examInfo.classes,
                         scope: this.examInfo.scope,
                         school_code: this.$store.state.userInfo.schoolCode
                     }
@@ -547,7 +547,7 @@ export default {
     },
     computed: {
         classList() {
-            if (this.examInfo && this.examInfo.targetClassIds) {
+            if (this.examInfo && this.examInfo.classes) {
                 //发布对象为校本名单
                 if (this.examInfo.scope == 'school') {
                     this.showTest = false
@@ -581,7 +581,7 @@ export default {
                     } else {
                         //过滤当前评测对象
                         let list = this.privStuList.filter(item => {
-                            return this.examInfo.targetClassIds.indexOf(item.id) >= 0
+                            return this.examInfo.classes.indexOf(item.id) >= 0
                         })
                         return list
                     }

+ 5 - 5
TEAMModelOS/ClientApp/src/view/learnactivity/Scoring.vue

@@ -533,22 +533,22 @@ export default {
     },
     computed: {
         classList() {
-            if (this.examInfo && this.examInfo.targetClassIds) {
+            if (this.examInfo && this.examInfo.classes) {
                 //发布对象为校本名单
                 if (this.examInfo.scope == 'school') {
                     this.showTest = false
                     let classes = this.schoolClassList.filter(item => {
-                        return this.examInfo.targetClassIds.indexOf(item.id) >= 0 && (item.gradeId == this.chooseGrade || !this.chooseGrade)
+                        return this.examInfo.classes.indexOf(item.id) >= 0 && (item.gradeId == this.chooseGrade || !this.chooseGrade)
                     })
                     return classes
                 }
                 // 发布对象为个人创建的自定义名单
                 else {
-                    //根据targetClassIds查询班级信息
+                    //根据classes查询班级信息
                     if (!this.privStuList) {
                         // this.$api.schoolSetting.getClassByIds({
                         //     code: this.$store.state.userInfo.TEAMModelId,
-                        //     ids: this.examInfo.targetClassIds
+                        //     ids: this.examInfo.classes
                         // }).then(
                         //     res => {
                         //         if (res.className && res.className.length) this.chooseClass = res.className[0].id
@@ -575,7 +575,7 @@ export default {
                     } else {
                         //过滤当前评测对象
                         let list = this.privStuList.filter(item => {
-                            return this.examInfo.targetClassIds.indexOf(item.id) >= 0
+                            return this.examInfo.classes.indexOf(item.id) >= 0
                         })
                         return list
                     }

+ 2 - 2
TEAMModelOS/ClientApp/src/view/learnactivity/SimpleAnalysis.vue

@@ -19,7 +19,7 @@
             </div>
             <!-- 班级数 -->
             <div class="count-box">
-                <span class="count-subject-num">{{examInfo.targetClassIds.length}}</span>
+                <span class="count-subject-num">{{examInfo.classes.length}}</span>
                 <span class="count-subject-text">
                     <Icon custom="iconfont icon-class-self" class="count-icon" />
                     {{$t('learnActivity.simple.classLabel')}}
@@ -115,7 +115,7 @@ export default {
             default: () => {
                 return {
                     subjects: [],
-                    targetClassIds: []
+                    classes: []
                 }
             },
             type: Object

+ 26 - 0
TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.less

@@ -180,4 +180,30 @@
 .list-name-box{
     color: #a5a5a5;
     margin-bottom: -30px;
+}
+.priv-table-wrap{
+    width: 100%;
+    .table-header{
+        color: white;
+        height: 45px;
+        line-height: 45px;
+        padding-left: 15px;
+    }
+}
+.action-btn-wrap{
+    float: right;
+    color: white;
+    padding-right: 20px;
+}
+.cus-tips-wrap{
+    display: inline-block;
+    margin-left: 15px;
+}
+.no-class-tips{
+    color:#ed4014 ;
+    cursor: pointer;
+}
+.no-time-tips{
+    color:#ff9900 ;
+    cursor: pointer;
 }

+ 183 - 12
TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue

@@ -1,7 +1,7 @@
 <template>
     <div class="my-course-container dark-iview-split">
         <Loading v-if="listLoading" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
-        <Split v-model="split1">
+        <Split v-show="!isShowSchd" v-model="split1">
             <!--课程列表-->
             <div class="course-list" slot="left">
                 <!--列表内容-->
@@ -13,6 +13,7 @@
                                     <div style="margin-top:5px;">
                                         <Icon type="md-add" v-show="listType == 'private'" class="add-icon" :title="$t('cusMgt.addCus')" @click="addCusStatus = true" />
                                         <Icon type="md-create" v-show="(listType == 'school' && courseListS.length) || (listType == 'private' && courseListP.length) " class="add-icon" :title="$t('cusMgt.editCus')" @click="editCus()" />
+                                        <Icon custom="iconfont icon-schedule" v-show="listType == 'school' && courseListS.length" class="add-icon" title="课表模式" @click="showSchedule" />
                                         <Icon type="md-trash" v-show="listType == 'private'" class="add-icon" :title="$t('cusMgt.delCus')" @click="delCourse" />
                                     </div>
                                 </transition>
@@ -211,6 +212,42 @@
                 </Split>
             </div>
         </Split>
+        <div v-show="isShowSchd" class="priv-table-wrap">
+            <vuescroll>
+                <div class="table-header dark-iview-select">
+                    <span v-show="cusPd.length  >  1">学段:</span>
+                    <Select v-model="curPd" style="width:200px" v-show="cusPd.length  >  1">
+                        <Option v-for="item in cusPd" :value="item.id" :key="item.id">{{ item.name }}</Option>
+                    </Select>
+                    <div class="cus-tips-wrap">
+                        <Tooltip v-show="noClassCus.length">
+                            <div slot="content">
+                                <p v-for="(item,index) in noClassCus" :key="index">
+                                    {{`${index+1}.${item.name}`}}
+                                </p>
+                            </div>
+                            <span class="no-class-tips">课程未安排教室:{{`${noClassCus.length}/${schdData.length}`}}</span>
+                        </Tooltip>
+                        <Tooltip v-show="noTimeCus.length" style="margin-left:15px;">
+                            <div slot="content">
+                                <p v-for="(item,index) in noTimeCus" :key="index">
+                                    {{`${index+1}.${item.name}`}}
+                                </p>
+                            </div>
+                            <span class="no-time-tips">课程未设时间:{{`${noTimeCus.length}/${schdData.length}`}}</span>
+                        </Tooltip>
+                    </div>
+                    <div class="action-btn-wrap">
+                        <span @click="isShowSchd = !isShowSchd">
+                            <Icon type="md-list" />
+                            列表模式
+                        </span>
+                    </div>
+
+                </div>
+                <TeaTable :schedData="schdData" :teacher="$store.state.userInfo.TEAMModelId" :periodId="curPd" mode="view"></TeaTable>
+            </vuescroll>
+        </div>
         <Drawer :title="$t('cusMgt.cusInfo')" class-name="dark-iview-drawer" width="450" :closable="false" v-model="showCusInfo" @on-close="baseEditStatus = true">
             <!--基础信息-->
             <div class="course-base-info-content dark-iview-form disabled-iview-select dark-wang-editor">
@@ -274,9 +311,10 @@ import QRCode from 'qrcodejs2'
 import PersonalPhoto from '@/components/public/personalPhoto/Index.vue'
 import E from '@/utils/wangEditor.js'
 import StudentList from '@/components/coursemgt/StudentList.vue'
+import TeaTable from './TeaTable.vue'
 export default {
     components: {
-        StudentList, PersonalPhoto
+        StudentList, PersonalPhoto, TeaTable
     },
     data() {
         // 验证只能是字母和数字
@@ -292,6 +330,11 @@ export default {
             }
         }
         return {
+            curPd: '',
+            isShowSchd: false,
+            schoolBase: {
+                period: []
+            },
             split1: 0.2,
             split2: 0.2,
             acTypeList: [
@@ -425,6 +468,81 @@ export default {
         }
     },
     methods: {
+        //显示课表模式
+        showSchedule() {
+            let promises = []
+            this.listLoading = true
+            this.isShowSchd = !this.isShowSchd
+            this.courseListS.forEach(item => {
+                let requestData = {
+                    'code': this.$store.state.userInfo.schoolCode,
+                    'scope': 'school',
+                    'id': item.id
+                }
+                promises.push(this.$api.courseMgmt.findCusInfo(requestData))
+            })
+            Promise.all(promises).then(
+                resAll => {
+                    console.log('resALL', resAll)
+                    resAll.forEach(async (res, index) => {
+                        if (res.courses && res.courses.length > 0) {
+                            res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
+                            //过滤当前教师的schedule
+                            res.courses[0].schedule = res.courses[0].schedule.filter(item => {
+                                return item.teacherId == this.$store.state.userInfo.TEAMModelId
+                            })
+                            console.log(res.courses[0].schedule)
+                            // 获取自定义名单信息
+                            let ids = res.courses[0].schedule.map(item => {
+                                return item.stulist
+                            })
+                            for (let i = 0; i < ids.length; i++) {
+                                if (!ids[i]) {
+                                    ids.splice(i, 1)
+                                    i--
+                                }
+                            }
+                            if (ids.length) {
+                                try {
+                                    let listRes = await this.getListInfo([...ids])
+                                    if (listRes) this.stuList.push(...listRes.stuList)
+                                } catch (e) {
+                                    this.$Message.error('获取自定义名单失败')
+                                }
+                            }
+
+                            res.courses[0].schedule.forEach(item => {
+                                //补充教室信息
+                                if (item.classId) {
+                                    let classInfo = this.classList.find(classItem => {
+                                        return classItem.id == item.classId
+                                    })
+                                    item.classInfo = {
+                                        id: item.classId,
+                                        name: classInfo ? classInfo.name : '--'
+                                    }
+                                }
+                                //补充名单信息
+                                if (ids.length && item.stulist) {
+                                    let listInfo = this.stuList.find(listItem => {
+                                        return listItem.id == item.stulist
+                                    })
+                                    item.listName = listInfo ? listInfo.name : '未找到对应名单'
+                                    item.students = listInfo ? listInfo.students : []
+                                    item.fullStu = false
+                                }
+                            })
+                        }
+                        this.$set(this.courseListS, index, res.courses[0])
+                    })
+                },
+                err => {
+                    this.$Message.error('API ERROR')
+                }
+            ).finally(() => {
+                this.listLoading = false
+            })
+        },
         //获取学生名单
         getStuList() {
             this.tabName = 'stus'
@@ -713,7 +831,7 @@ export default {
                     let index = _this.curClassIndex
                     _this.curClassIndex = 0
                     _this.courseListShow[_this.curCusIndex].schedule.splice(index, 1)
-                   _this.updCusInfo()
+                    _this.updCusInfo()
                 }
             })
         },
@@ -733,7 +851,7 @@ export default {
                 this.baseEditStatus = !this.baseEditStatus
             }
         },
-        
+
         //初始化富文本编辑器
         initEditor() {
             if (!this.noticeEditor) {
@@ -753,7 +871,7 @@ export default {
                     'link', // 插入链接
                     'image' // 插入图片
                 ],
-                noticeEditor.customConfig.showLinkImg = false
+                    noticeEditor.customConfig.showLinkImg = false
                 noticeEditor.customConfig.uploadFileName = 'files'
                 noticeEditor.create()
                 noticeEditor.txt.html(this.listType == 'school' ? this.courseListS[this.curCusIndex][0].notice : this.courseListP[this.curCusIndex].notice)
@@ -832,7 +950,7 @@ export default {
                         stulist: stuList.id,
                         teacherId: this.$store.state.userInfo.TEAMModelId,
                         teacherName: this.$store.state.userInfo.name,
-                        time:[]
+                        time: []
                     })
                     this.updCusInfo()
                 },
@@ -956,7 +1074,7 @@ export default {
                 }
             ).catch(() => {
                 this.$Message.error('更新失败')
-            }).finally(()=>{
+            }).finally(() => {
                 this.listLoading = false
             })
         },
@@ -1010,6 +1128,11 @@ export default {
                     if (!res.error) {
                         if (res.courses && res.courses.length > 0) {
                             res.courses[0].schedule = res.courses[0].schedule ? res.courses[0].schedule : []
+                            //过滤当前教师的schedule
+                            res.courses[0].schedule = res.courses[0].schedule.filter(item => {
+                                return item.teacherId == this.$store.state.userInfo.TEAMModelId
+                            })
+                            console.log(res.courses[0].schedule)
                             // 获取自定义名单信息
                             let ids = res.courses[0].schedule.map(item => {
                                 return item.stulist
@@ -1059,7 +1182,7 @@ export default {
                         this.changeClassroom(0)
                     }
                 }
-            ).finally(()=>{
+            ).finally(() => {
                 this.listLoading = false
             })
         },
@@ -1077,6 +1200,7 @@ export default {
         //直接读取登录成功拿到得学校基础信息
         this.$store.dispatch('user/getSchoolProfile').then(res => {
             this.classList = res.school_classes
+            this.schoolBase = res.school_base
             this.getCourseList()
         })
 
@@ -1086,6 +1210,53 @@ export default {
         })
     },
     computed: {
+        //课程学段
+        cusPd() {
+            let pds = this.courseListS.map(item => {
+                return item.period
+            })
+            let res = []
+            pds.forEach(item => {
+                let r = res.find(resItem => {
+                    return item.id == resItem.id
+                })
+                if (!r) {
+                    res.push(item)
+                }
+            })
+            if (res.length) {
+                this.curPd = res[0].id
+            }
+            return res
+        },
+        //课程表当前显示的课程
+        schdData() {
+            let pdCus = []
+            pdCus = this.courseListS.filter(item => {
+                return item.period.id == this.curPd && item.schedule
+            })
+            console.log(pdCus)
+            return pdCus
+        },
+        //无教室课程
+        noClassCus() {
+            console.log(this.schdData)
+            return this.schdData.filter(item => {
+                let res = item.schedule.find(schdItem => {
+                    return schdItem.classId && schdItem.teacherId == this.$store.state.userInfo.TEAMModelId
+                })
+                return !res
+            })
+        },
+        //无时段课程
+        noTimeCus() {
+            return this.schdData.filter(item => {
+                let res = item.schedule.find(schdItem => {
+                    return (schdItem.time && schdItem.time.length) && schdItem.teacherId == this.$store.state.userInfo.TEAMModelId
+                })
+                return !res
+            })
+        },
         //是否为默认名单
         isDefList() {
             if (this.teaClassList[this.curClassIndex] && this.teaClassList[this.curClassIndex].stulist) {
@@ -1113,16 +1284,16 @@ export default {
             }
         },
         //当前班级活动列表
-        acList(){
+        acList() {
             let list = []
             let id = this.teaClassList[this.curClassIndex] ? this.teaClassList[this.curClassIndex].stulist || this.teaClassList[this.curClassIndex].classId : ''
-            if(!id){
+            if (!id) {
                 return []
             }
             switch (this.curAcType) {
                 case 'ev':
-                    list = this.evList.filter(item=>{
-                        return item.targetClassIds.indexOf(id) > -1
+                    list = this.evList.filter(item => {
+                        return item.classes.indexOf(id) > -1
                     })
                     break
                 case 'vote':

+ 1 - 1
TEAMModelOS/ClientApp/src/view/newcourse/NewCusMgt.vue

@@ -174,7 +174,7 @@
                             </div>
                             <!-- 教师课表 -->
                             <vuescroll v-show="curTab == 1">
-                                <TeaTable v-if="hasTimeTable" :teaClassList="schdClassList" :teacher="teaList[curTeaIndex] ? teaList[curTeaIndex].id : ''" :periodId="filterPeriod" :schedData="[courseListShow[this.curCusIndex]]" @selectCell="selectCell" @cancelCell="cancelCell"></TeaTable>
+                                <TeaTable style="height: calc(100% - 45px)" v-if="hasTimeTable" :teaClassList="schdClassList" :teacher="teaList[curTeaIndex] ? teaList[curTeaIndex].id : ''" :periodId="filterPeriod" :schedData="[courseListShow[this.curCusIndex]]" @selectCell="selectCell" @cancelCell="cancelCell"></TeaTable>
                                 <div v-else>
                                     <p class="no-time-table-tips">
                                         {{filterPeriodName}}暂未设置时段,请先

+ 2 - 1
TEAMModelOS/ClientApp/src/view/newcourse/TeaTable.less

@@ -9,7 +9,8 @@
 
 .cus-table-container {
     width: 100%;
-    height: ~"calc(100% - 45px)";
+    // height: ~"calc(100% - 45px)";
+    height: 100%;
     padding: 15px 0px 15px 10px;
 }
 .sch-title {

+ 9 - 5
TEAMModelOS/ClientApp/src/view/newcourse/TeaTable.vue

@@ -34,7 +34,7 @@
                 <!--星期一-->
                 <template slot-scope="{ row, column }" slot="MON">
                     <div :class="row.weeklies.MON.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
-                        <div class="toggle-status-btn-wrap">
+                        <div class="toggle-status-btn-wrap" v-show="mode == 'set'">
                             <Icon class="cell-action-icon" v-show="!row.weeklies[column.slot].courseName" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row, column.slot)" />
                             <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-create" title="修改课程" @click="selectCell(row, column.slot)" />
                             <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-close" title="取消课程" @click="cancelCell(row, column.slot)" />
@@ -47,7 +47,7 @@
                 <!--星期二-->
                 <template slot-scope="{ row, column }" slot="TUE">
                     <div :class="row.weeklies.TUE.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
-                        <div class="toggle-status-btn-wrap">
+                        <div class="toggle-status-btn-wrap" v-show="mode == 'set'">
                             <Icon class="cell-action-icon" v-show="!row.weeklies[column.slot].courseName" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row, column.slot)" />
                             <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-create" title="修改课程" @click="selectCell(row, column.slot)" />
                             <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-close" title="取消课程" @click="cancelCell(row, column.slot)" />
@@ -60,7 +60,7 @@
                 <!--星期三-->
                 <template slot-scope="{ row, column }" slot="WED">
                     <div :class="row.weeklies.WED.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
-                        <div class="toggle-status-btn-wrap">
+                        <div class="toggle-status-btn-wrap" v-show="mode == 'set'">
                             <Icon class="cell-action-icon" v-show="!row.weeklies[column.slot].courseName" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row, column.slot)" />
                             <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-create" title="修改课程" @click="selectCell(row, column.slot)" />
                             <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-close" title="取消课程" @click="cancelCell(row, column.slot)" />
@@ -73,7 +73,7 @@
                 <!--星期四-->
                 <template slot-scope="{ row, column }" slot="THU">
                     <div :class="row.weeklies.THU.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
-                        <div class="toggle-status-btn-wrap">
+                        <div class="toggle-status-btn-wrap" v-show="mode == 'set'">
                             <Icon class="cell-action-icon" v-show="!row.weeklies[column.slot].courseName" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row, column.slot)" />
                             <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-create" title="修改课程" @click="selectCell(row, column.slot)" />
                             <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-close" title="取消课程" @click="cancelCell(row, column.slot)" />
@@ -86,7 +86,7 @@
                 <!--星期五-->
                 <template slot-scope="{ row, column }" slot="FRI">
                     <div :class="row.weeklies.FRI.status == 1 ? 'week-day-cell':'week-day-cell vact-status'">
-                        <div class="toggle-status-btn-wrap">
+                        <div class="toggle-status-btn-wrap" v-show="mode == 'set'">
                             <Icon class="cell-action-icon" v-show="!row.weeklies[column.slot].courseName" custom="iconfont icon-choose" title="设置课程" @click="selectCell(row, column.slot)" />
                             <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-create" title="修改课程" @click="selectCell(row, column.slot)" />
                             <Icon class="cell-action-icon" v-show="row.weeklies[column.slot].courseName" type="md-close" title="取消课程" @click="cancelCell(row, column.slot)" />
@@ -142,6 +142,10 @@ export default {
             default: () => {
                 return []
             }
+        },
+        mode:{
+            type:String,
+            default:'set' //set:设置模式 view:视图模式,只渲染功能
         }
     },
     data() {

+ 35 - 25
TEAMModelOS/ClientApp/src/view/questionnaire/ManageQuestionnaire.vue

@@ -316,8 +316,8 @@
 				let qnBaseInfo = isQnFormEdit ? await this.$refs.qnForm.handleSubmit("qnForm") : this.currentQn;
 				let qnItems = this.$refs.qnPaper.items || [];
 				// 将问卷试题内容保存到blob 用blobUrl来替换quesitons字段
-				qnBaseInfo.ans = this.getSurveyAns(qnItems)
-				qnBaseInfo.questionUrl = await this.doUploadBlob(qnBaseInfo, qnItems);
+				qnBaseInfo.answers = this.getSurveyAns(qnItems)
+				qnBaseInfo.blob = await this.doUploadBlob(qnBaseInfo, qnItems);
 				// 开始保存问卷
 				this.saveorUpdataQn(qnBaseInfo)
 					.then((res) => {
@@ -334,9 +334,8 @@
 					});
 			},
 			
-			/* 保存问卷题目到Blob */
-			async doUploadBlob(qnBaseInfo, items) {
-				console.log('上传参数', qnBaseInfo)
+			/* 上传index.json */
+			async doUploadItems(qnBaseInfo,items){
 				return new Promise(async (resolve, reject) => {
 					let promiseArr = []
 					// 获取初始化Blob需要的数据
@@ -349,25 +348,6 @@
 						qnBaseInfo.scope
 					);
 					
-					// 上传index.json
-					promiseArr.push(new Promise(async (r, j) => {
-						// let itemJsonFile = await this.$evTools.createBlobItem(exerciseItem);
-						let file = new File([JSON.stringify(qnBaseInfo)], "index.json");
-						try {
-							// 等待上传blob的返回结果
-							let blobFile = await containerClient.upload(file, 'survey/' + qnBaseInfo.id);
-							if (blobFile.blob) {
-								console.log('上传Blob成功', blobFile)
-								r(blobFile.blob)
-							} else {
-								this.$Message.error(this.$t('evaluation.newExercise.uploadErrorTip'));
-							}
-						} catch (e) {
-							this.$Message.error(e.spaceError);
-						}
-					}))
-					
-					
 					for (let item of items) {
 						let curId = item.id || this.$tools.guid()
 						promiseArr.push(new Promise(async (r, j) => {
@@ -389,11 +369,41 @@
 					}
 					Promise.all(promiseArr).then(result => {
 						console.log(result)
-						resolve(result.slice(1))
+						resolve(result)
 					})
 				})
 			},
 			
+			/* 保存问卷题目到Blob */
+			async doUploadBlob(qnBaseInfo, items) {
+				console.log('上传参数', qnBaseInfo)
+				let itemUrls = await this.doUploadItems(qnBaseInfo, items)
+				qnBaseInfo.slides = itemUrls
+				// 获取初始化Blob需要的数据
+				let sasData = qnBaseInfo.scope === 'private' ? await this.$tools.getPrivateSas() : await this.$tools.getSchoolSas();
+				//初始化Blob
+				let containerClient = new blobTool(
+					sasData.url,
+					sasData.name,
+					sasData.sas,
+					qnBaseInfo.scope
+				);
+				let file = new File([JSON.stringify(qnBaseInfo)], "index.json");
+				try {
+					// 等待上传blob的返回结果
+					let blobFile = await containerClient.upload(file, 'survey/' + qnBaseInfo.id);
+					if (blobFile.blob) {
+						console.log('上传Blob成功', blobFile)
+						delete qnBaseInfo.slides
+						r(blobFile.blob)
+					} else {
+						this.$Message.error(this.$t('evaluation.newExercise.uploadErrorTip'));
+					}
+				} catch (e) {
+					this.$Message.error(e);
+				}
+			},
+			
 			/* 获取当前问卷活动学生作答数据 */
 			async getSurveyStudents(surveyItem) {
 				this.isLoading = true

+ 6 - 8
TEAMModelOS/Controllers/School/ClassRoomController.cs

@@ -488,9 +488,8 @@ namespace TEAMModelOS.Controllers
                             }
 
                         }
-                        var infos = listStuList.GroupBy(m => new { m.stuId }).Distinct().Select(t => new
-                        {
-                            stuId = t.ToList().Select(o =>
+                        var infos = listStuList.GroupBy(m => new { m.stuId }).Distinct().Select(t => 
+                             t.ToList().Select(o =>
                                     new
                                     {
                                         o.id,
@@ -498,7 +497,7 @@ namespace TEAMModelOS.Controllers
                                         o.stuId,
                                         o.name
                                     })
-                        });
+                        );
 /*                        var infos = listStuList.Select(o =>
                                     new
                                     {
@@ -542,9 +541,8 @@ namespace TEAMModelOS.Controllers
                                 }
                             }
                         }
-                        var infos = listStuList.GroupBy(m => new { m.stuId }).Distinct().Select(t => new
-                        {
-                            stuId = t.ToList().Select(o =>
+                        var infos = listStuList.GroupBy(m => new { m.stuId }).Distinct().Select(t => 
+                            t.ToList().Select(o =>
                                     new
                                     {
                                         o.id,
@@ -552,7 +550,7 @@ namespace TEAMModelOS.Controllers
                                         o.stuId,
                                         o.name
                                     })
-                        });
+                        );
                         stus.AddRange(infos);
                         //stus.Add(suList);
                     }