Selaa lähdekoodia

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

CrazyIter_Bin 4 vuotta sitten
vanhempi
commit
a6515a5edb

+ 2 - 2
TEAMModelOS/ClientApp/src/common/BaseMyCanvas.vue

@@ -109,7 +109,7 @@
 		methods: {
 		methods: {
 			// 移入
 			// 移入
 			mouseOver() {
 			mouseOver() {
-				this.$refs.canvasTools.style.display = 'flex'
+				// this.$refs.canvasTools.style.display = 'flex'
 			},
 			},
 			// 移出
 			// 移出
 			mouseLeave() {
 			mouseLeave() {
@@ -239,7 +239,7 @@
 		bottom: 0;
 		bottom: 0;
 		left: 50%;
 		left: 50%;
 		transform: translate(-50%, 0);
 		transform: translate(-50%, 0);
-		// display: none;
+		display: flex;
 		background-color: #696969;
 		background-color: #696969;
 		border-radius: 15px 15px 0 0;
 		border-radius: 15px 15px 0 0;
 		
 		

+ 10 - 5
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/LessonTestReport.vue

@@ -162,8 +162,9 @@
                             <div style="margin-left:10px;" v-html="question.explain != '' ?  question.explain : $t('studentWeb.exam.report.noAnalyse') "></div>
                             <div style="margin-left:10px;" v-html="question.explain != '' ?  question.explain : $t('studentWeb.exam.report.noAnalyse') "></div>
                             <div v-show="examInfo.stuScore[index] != -1 && examInfo.stuScore[index] != question.score" class="TitleRec2"><span style="margin-left:5px">{{$t("studentWeb.exam.report.repairSource")}}:</span></div>
                             <div v-show="examInfo.stuScore[index] != -1 && examInfo.stuScore[index] != question.score" class="TitleRec2"><span style="margin-left:5px">{{$t("studentWeb.exam.report.repairSource")}}:</span></div>
                             <br />
                             <br />
-                            <div style="margin-left:10px;display:flex" v-show="examInfo.stuScore[index] != -1 && examInfo.stuScore[index] != question.score && question.repair.length > 0">
-                                <div v-if="question.repair" class="repair-box">
+                            <div style="margin-left:10px;display:flex" v-show="examInfo.stuScore[index] != -1 && examInfo.stuScore[index] != question.score ">
+                                <span v-if="question.repair.length == 0">{{$t("studentWeb.exam.report.noSource")}}</span>
+                                <div v-if="question.repair && question.repair.length > 0" class="repair-box">
                                     <Collapse style="width:85%" accordion @on-change="getSource(question.repair,question)">
                                     <Collapse style="width:85%" accordion @on-change="getSource(question.repair,question)">
                                         <Panel name="1">
                                         <Panel name="1">
                                             {{$t("studentWeb.exam.report.linkSource")}}
                                             {{$t("studentWeb.exam.report.linkSource")}}
@@ -445,12 +446,15 @@
             },
             },
            async formPaper() {
            async formPaper() {
                 let paper = []
                 let paper = []
-                this.paperData.length = []
-                this.ansData.length = []
+                this.paperData.length = 0
+                this.ansData.length = 0
                 let data = this.$store.getters.getPaperInfo.item
                 let data = this.$store.getters.getPaperInfo.item
                 let exam = [...data]
                 let exam = [...data]
                 if (this.$store.getters.getPaperInfo.item.length) {
                 if (this.$store.getters.getPaperInfo.item.length) {
                     for (let i = 0; i < exam.length; i++) {
                     for (let i = 0; i < exam.length; i++) {
+                        if (exam[i].repair == undefined) {
+                            exam[i].repair = []
+                        }
                         if (exam[i].type == 'compose') {
                         if (exam[i].type == 'compose') {
                             let k = 1
                             let k = 1
                             if (exam[i].children.length > 0) {
                             if (exam[i].children.length > 0) {
@@ -467,11 +471,12 @@
                             paper.push(exam[i])
                             paper.push(exam[i])
                         }
                         }
                     }
                     }
-                }
+               }
                this.paperData = [...paper]
                this.paperData = [...paper]
                if (this.paperData.length) {
                if (this.paperData.length) {
                    this.ansData = await this.getItem(this.examInfo.stuAns[0])
                    this.ansData = await this.getItem(this.examInfo.stuAns[0])
                }
                }
+               console.log('paperData', this.paperData)
                this.$nextTick(() => {
                this.$nextTick(() => {
                    window.MathJax.Hub.Queue([
                    window.MathJax.Hub.Queue([
                        "Typeset",
                        "Typeset",

+ 4 - 4
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/PaperTest.vue

@@ -380,7 +380,7 @@
             nextQ() {
             nextQ() {
                 if (this.queNo < (this.examInfo.length - 1)) this.queNo++
                 if (this.queNo < (this.examInfo.length - 1)) this.queNo++
             },
             },
-            openWarmMessage: function (showMessageNum) {
+            openWarmMessage(showMessageNum) {
                 this.WarmMessageisOpen = true
                 this.WarmMessageisOpen = true
                 if (showMessageNum == 1) {
                 if (showMessageNum == 1) {
                     this.showMessageNum = showMessageNum
                     this.showMessageNum = showMessageNum
@@ -396,10 +396,10 @@
                     }
                     }
                 } else return;
                 } else return;
             },
             },
-            closeWarmMessage: function () {
+            closeWarmMessage() {
                 this.WarmMessageisOpen = false
                 this.WarmMessageisOpen = false
             },
             },
-            closetest: function () {
+            closetest() {
                 this.WarmMessageisOpen = false
                 this.WarmMessageisOpen = false
                 if (this.checkers.length) {
                 if (this.checkers.length) {
                     this.isLoading = true;
                     this.isLoading = true;
@@ -408,7 +408,7 @@
                         id: this.$store.getters.getItemTitle.id,
                         id: this.$store.getters.getItemTitle.id,
                         answer: this.checkers,
                         answer: this.checkers,
                         studentId: this.$store.state.userInfo.sub,
                         studentId: this.$store.state.userInfo.sub,
-                        classId: this.$store.state.user.studentProfile.classinfo.id,
+                        classId: this.$store.getters.getExamInfo.allClass,
                         subjectId: this.$store.getters.getExamInfo.subject.id,
                         subjectId: this.$store.getters.getExamInfo.subject.id,
                         multipleRule: this.$store.getters.getExamInfo.multipleRule,
                         multipleRule: this.$store.getters.getExamInfo.multipleRule,
                         paperId: this.$store.getters.getPaperInfo.id,
                         paperId: this.$store.getters.getPaperInfo.id,

+ 3 - 1
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventContentTypeTemplate/PaperView.vue

@@ -116,6 +116,7 @@
                     }
                     }
                     let isTest = 0
                     let isTest = 0
                     this.$api.studentWeb.FindStudentPaper(req).then(res => {
                     this.$api.studentWeb.FindStudentPaper(req).then(res => {
+                        console.log(res)
                         this.stuData = res
                         this.stuData = res
                         let resData = res
                         let resData = res
                         for (let item of resData.papers) {
                         for (let item of resData.papers) {
@@ -124,8 +125,8 @@
                             } 
                             } 
                         }
                         }
                         for (let i = 0; i < this.paperData.length; i++) {
                         for (let i = 0; i < this.paperData.length; i++) {
-                            console.log()
                             this.paperData[i].subject = resData.subjects[i]
                             this.paperData[i].subject = resData.subjects[i]
+                            this.paperData[i].allClass = resData.claId
                             if (resData.stuAns[i] == undefined) {
                             if (resData.stuAns[i] == undefined) {
                                 this.paperData[i].stuAns = []
                                 this.paperData[i].stuAns = []
                                 this.paperData[i].stuScore = []
                                 this.paperData[i].stuScore = []
@@ -171,6 +172,7 @@
                 }
                 }
             },
             },
             async getPaper(data) {
             async getPaper(data) {
+                console.log(data)
                 this.isExamDown = false
                 this.isExamDown = false
                 this.isLoad = true
                 this.isLoad = true
                 this.selectData = {}
                 this.selectData = {}

+ 2 - 0
TEAMModelOS/ClientApp/src/components/student-web/EventView/EventList.vue

@@ -223,6 +223,7 @@
                     }
                     }
                     this.eventList = []
                     this.eventList = []
                     this.$api.studentWeb.FindExamPaper(params).then(res => {
                     this.$api.studentWeb.FindExamPaper(params).then(res => {
+                        console.log(res)
                         let data = []
                         let data = []
                         for (let item of res.props) {
                         for (let item of res.props) {
                             let code = item.code.split('-')
                             let code = item.code.split('-')
@@ -451,6 +452,7 @@
             },
             },
 
 
             sentSelectedEventTitle(item) {
             sentSelectedEventTitle(item) {
+                console.log(item)
                 this.$router.push({
                 this.$router.push({
                     path: "/studentWeb/eventView",
                     path: "/studentWeb/eventView",
                     query: {
                     query: {

+ 1 - 1
TEAMModelOS/ClientApp/src/router/routes.js

@@ -265,7 +265,7 @@ export const routes = [
 			{
 			{
 				path: 'myCourse',
 				path: 'myCourse',
 				name: 'myCourse',
 				name: 'myCourse',
-				component: resolve => require(['@/view/newcourse/NewMyCourse.vue'], resolve)
+				component: resolve => require(['@/view/newcourse/MyCourse.vue'], resolve)
 			},
 			},
 			{
 			{
 				path: 'CourseTable',
 				path: 'CourseTable',

+ 71 - 31
TEAMModelOS/ClientApp/src/utils/blobTool.js

@@ -102,16 +102,17 @@ export default class BlobTool {
             }
             }
         })
         })
     }
     }
+
     /**
     /**
      * 更新Blob空间数据 
      * 更新Blob空间数据 
      * @params {urls} checkBlobs方法返回的数据处理size后
      * @params {urls} checkBlobs方法返回的数据处理size后
      * @params {containerName} 容器名称,如果直接对象调用则必传;如果已经初始化BlobTool对象,则优先使用参数,没有则使用初始化对象的容器
      * @params {containerName} 容器名称,如果直接对象调用则必传;如果已经初始化BlobTool对象,则优先使用参数,没有则使用初始化对象的容器
      */
      */
-    static updateSize(urls, containerName) {
+    static updateSize(optUrls, containerName) {
         return new Promise((r, j) => {
         return new Promise((r, j) => {
-            if ((containerName || this.container) && urls.length) {
+            if ((containerName || this.container) && optUrls.length) {
                 API.blob.updateSize({
                 API.blob.updateSize({
-                    urls,
+                    optUrls,
                     containerName: containerName || this.container
                     containerName: containerName || this.container
                 }).then(
                 }).then(
                     res => {
                     res => {
@@ -126,23 +127,49 @@ export default class BlobTool {
             }
             }
         })
         })
     }
     }
+
+    /**
+     * 计算上传前后size
+     * @param {any}  before 上传之前的文件大小
+     * @param {any}  after 上传之后的文件大小
+     */
+    calcSize(before, after) {
+        if (before.length == after.length) {
+            let res = []
+            before.forEach((item, index) => {
+                let afterBlob = after.find((afterItem, afterIndex) => {
+                    return afterItem.url == item.url
+                })
+                if (after) {
+                    res.push({
+                        url: item.url,
+                        size: afterBlob.size - item.size
+                    })
+                } else {
+                    throw new Error(`未找到${item.url}上传之后的大小`)
+                }
+            })
+            return res
+        } else {
+            throw new Error('beforeSize/afterSize上传前后数据不对应')
+        }
+    }
+
     /**
     /**
      * 上传文件方法,带回调上传进度
      * 上传文件方法,带回调上传进度
      * @param {any} file 文件对象
      * @param {any} file 文件对象
      * @param {any} path 文件夹路径
      * @param {any} path 文件夹路径
      * @param {any} option 官方可配置项
      * @param {any} option 官方可配置项
      * @param {any} checkSize 上传时是否检查容器空间 默认需要检查大小
      * @param {any} checkSize 上传时是否检查容器空间 默认需要检查大小
-     * @param {any} checkBlob 上传时是否检查原来是否已存在,用于上传完成更新后端缓存的Blob空间数据
-     * @param {any} updateSize 上传时是否检查原来是否已存在,用于上传完成更新后端缓存的Blob空间数据
+     * @param {any} handleSize 是否需要更新size,建议多文件上传时在外部批量处理
      * @returns {object} {url, name,size,createTime,extension,type}
      * @returns {object} {url, name,size,createTime,extension,type}
      */
      */
-    upload(file, path, option, checkSize = true, checkBlob = true, updSize = true) {
+    upload(file, path, option, checkSize = true, handleSize = true) {
         return new Promise(async (r, j) => {
         return new Promise(async (r, j) => {
             //检查容器空间大小
             //检查容器空间大小
             if (checkSize) {
             if (checkSize) {
                 if (!this.totalSize) {
                 if (!this.totalSize) {
                     try {
                     try {
-                        // this.totalSize = await this.getContainerSize()
                         let sizeRes = await BlobTool.getSizeByServe(this.container)
                         let sizeRes = await BlobTool.getSizeByServe(this.container)
                         this.totalSize = sizeRes.size
                         this.totalSize = sizeRes.size
                     } catch (e) {
                     } catch (e) {
@@ -163,10 +190,12 @@ export default class BlobTool {
                 }
                 }
             }
             }
             let blobSize = 0
             let blobSize = 0
-            if (checkBlob) {
+            // 上传之前检查size
+            if (handleSize) {
                 let u = path + "/" + file.name
                 let u = path + "/" + file.name
                 try {
                 try {
-                    blobSize = await BlobTool.checkBlobs([u],this.container)
+                    let checkRes = await BlobTool.checkBlobs([u], this.container)
+                    blobSize = checkRes && checkRes.urlsSize ? checkRes.urlsSize[0].size : 0
                 } catch (e) {
                 } catch (e) {
                     throw new Error(e)
                     throw new Error(e)
                 }
                 }
@@ -183,11 +212,13 @@ export default class BlobTool {
                     if (this.totalSize) {
                     if (this.totalSize) {
                         this.totalSize += updateSize
                         this.totalSize += updateSize
                     }
                     }
-
-                    if(updSize){
-                        BlobTool.updateSize([+ path + "/" + file.name], this.container)
+                    // 上传成功后更新size
+                    if (handleSize) {
+                        BlobTool.updateSize([{
+                            url: path + "/" + file.name,
+                            size: updateSize
+                        }], this.container)
                     }
                     }
-
                     r({
                     r({
                         url: url,
                         url: url,
                         blob: '/' + path + "/" + file.name,
                         blob: '/' + path + "/" + file.name,
@@ -331,21 +362,28 @@ export default class BlobTool {
      * 删除Blob
      * 删除Blob
      * @param {string} filePath 文件url + 容器 之后的路径
      * @param {string} filePath 文件url + 容器 之后的路径
      */
      */
-    deleteBlob(filePath) {
-        if (filePath) {
+    deleteBlob(filePath, size) {
+        if (filePath && size) {
             filePath = filePath.substring(1)
             filePath = filePath.substring(1)
+            return new Promise((r, j) => {
+                this.containerClient.deleteBlob(filePath).then(
+                    async res => {
+                        let sizeInfo = await BlobTool.updateSize([{
+                            url: filePath,
+                            size: -size
+                        }], this.container)
+                        r(sizeInfo)
+                    },
+                    err => {
+                        j(err)
+                    }
+                )
+
+            })
+        } else {
+            throw new Error("filePath或size参数不完整")
         }
         }
-        return new Promise((r, j) => {
-            this.containerClient.deleteBlob(filePath).then(
-                res => {
-                    r(res)
-                },
-                err => {
-                    j(err)
-                }
-            )
 
 
-        })
     }
     }
 
 
     /**
     /**
@@ -498,12 +536,14 @@ export default class BlobTool {
     async isContainerFull() {
     async isContainerFull() {
         return new Promise(async (r, j) => {
         return new Promise(async (r, j) => {
             try {
             try {
-                let size = await this.getContainerSize()
-                if (size > this.blobSpace) {
-                    r(true)
-                } else {
-                    r(false)
-                }
+                // let size = await this.getContainerSize()
+                let sizeRes = await BlobTool.getSizeByServe(this.container)
+                if (sizeRes)
+                    if (sizeRes.size > this.blobSpace) {
+                        r(true)
+                    } else {
+                        r(false)
+                    }
             } catch (e) {
             } catch (e) {
                 j('容器空间判断失败!')
                 j('容器空间判断失败!')
             }
             }

+ 1 - 1
TEAMModelOS/ClientApp/src/view/newcourse/CourseClassroom.less

@@ -256,7 +256,7 @@
     right: 20px;
     right: 20px;
     color: white;
     color: white;
     font-size: 23px;
     font-size: 23px;
-    top: 42px;
+    top: 32px;
     display:none;
     display:none;
 }
 }
 .qr-code-icon:hover {
 .qr-code-icon:hover {

+ 23 - 103
TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue

@@ -55,36 +55,24 @@
             <div class="course-classroom-list">
             <div class="course-classroom-list">
                 <div class="course-classroom-list-header">
                 <div class="course-classroom-list-header">
                     <span class="course-classroom-label">{{$t('courseManage.classroom.classroomList')}}</span>
                     <span class="course-classroom-label">{{$t('courseManage.classroom.classroomList')}}</span>
-                    <Icon type="md-create" v-show="listType == 'private'" class="add-icon" title="编辑班级" style="margin-top:12px;" @click="editClassStatus = true" />
-                    <Poptip trigger="hover" placement="left-start" class="add-classroom-icon" v-if="listType == 'private'">
-                        <Icon type="md-add" color="white" size="18" />
-                        <div slot="content">
-                            <p @click="addClassroom(1)">
-                                <Icon type="ios-barcode-outline" color="white" size="18" style="margin-right:8px;" />创建动态名单
-                            </p>
-                            <p @click="addClassroom(0)" style="margin-top:10px;">
-                                <Icon type="md-person" color="white" size="18" style="margin-right:8px;" />选择系统班级
-                            </p>
-                        </div>
-                    </Poptip>
-                    <Icon type="md-trash" v-show="listType == 'private'" class="add-icon" title="删除班级" style="margin-top:12px;" @click="deleteClass()" />
+                    <Icon type="md-add" class="add-icon" style="margin-top:12px;" @click="addClassroom()" />
+                    <Icon type="md-create" v-show="listType == 'private'" class="add-icon" style="margin-top:12px;" @click="editClassStatus = true" />
+                    <Icon type="md-trash" v-show="listType == 'private'" class="add-icon" style="margin-top:12px;" @click="deleteClass()" />
                 </div>
                 </div>
                 <div class="course-classroom-list-content">
                 <div class="course-classroom-list-content">
                     <div v-for="(item,index) in classList" :key="index" @click="changeClassroom(index)" :class="curClassIndex === index ? 'course-classroom-item block-bg block-bg-active':'course-classroom-item block-bg'">
                     <div v-for="(item,index) in classList" :key="index" @click="changeClassroom(index)" :class="curClassIndex === index ? 'course-classroom-item block-bg block-bg-active':'course-classroom-item block-bg'">
                         <p class="classroom-code">
                         <p class="classroom-code">
-                            <span :class="item.scope === 'private' ? 'class-type-dym': item.openType == 1 ? 'class-type-sys':'class-type-custom'">
+                            <span :class="listType === 'private' ? 'class-type-dym': item.openType == 1 ? 'class-type-sys':'class-type-custom'">
                                 {{getClassType(item.scope,item.openType).text}}
                                 {{getClassType(item.scope,item.openType).text}}
                             </span>
                             </span>
                             <!--{{item.no}}-->
                             <!--{{item.no}}-->
                         </p>
                         </p>
                         <p class="classroom-name">{{item.name}}</p>
                         <p class="classroom-name">{{item.name}}</p>
-                        <p class="classroom-info " v-if="item.openType == 1 || item.scope == 'private'">
-                            <!--<span class="classroom-info-label">{{$t('courseManage.classroom.studentCount')}}</span>
-                            <span class="classroom-info-value">{{item.studentCount}}</span>-->
+                        <!-- <p class="classroom-info" style="dispaly:none" v-if="item.openType == 1 || item.scope == 'private'">
                             <span class="classroom-info-label">{{$t('courseManage.classroom.headmaster')}}</span>
                             <span class="classroom-info-label">{{$t('courseManage.classroom.headmaster')}}</span>
                             <span class="classroom-info-value">{{item.teacher.name}}</span>
                             <span class="classroom-info-value">{{item.teacher.name}}</span>
-                        </p>
-                        <Icon size="20" custom="iconfont icon-qr-code" class="qr-code-icon" @click="showQrCode" v-if="'private' == item.scope" />
+                        </p> -->
+                        <Icon size="20" custom="iconfont icon-qr-code" class="qr-code-icon" @click="showQrCode" v-if="'private' == listType" />
                     </div>
                     </div>
                     <div v-if="classList.length == 0">
                     <div v-if="classList.length == 0">
                         <EmptyData :top="160" textContent="暂无上课班级"></EmptyData>
                         <EmptyData :top="160" textContent="暂无上课班级"></EmptyData>
@@ -100,7 +88,7 @@
                             <Icon type="md-trash" size="16" />
                             <Icon type="md-trash" size="16" />
                             删除学生
                             删除学生
                         </span>
                         </span>
-                        <span class="action-btn-wrap" @click="addStuStatus = true" v-if="classList[curClassIndex] && classList[curClassIndex].scope != 'private'">
+                        <span class="action-btn-wrap" @click="addStuStatus = true" v-if="classList[curClassIndex] && (classList[curClassIndex].openType == 2 || listType == 'private')">
                             <Icon type="md-add" size="16" />
                             <Icon type="md-add" size="16" />
                             添加学生
                             添加学生
                         </span>
                         </span>
@@ -189,7 +177,7 @@
                 </Form>
                 </Form>
             </div>
             </div>
         </Drawer>
         </Drawer>
-        <Modal v-model="newPrivateStatus" :title="$t('courseManage.classroom.personalClassroomTitle')" @on-ok="confirmNewClassroom" class-name="dark-iview-modal dark-iview-form">
+        <Modal v-model="newPrivateStatus" :title="$t('courseManage.classroom.personalClassroomTitle')" @on-ok="confirmNewClass" class-name="dark-iview-modal dark-iview-form">
             <Form ref="personalClassroom" :model="privateClass" label-position="top" label-colon>
             <Form ref="personalClassroom" :model="privateClass" label-position="top" label-colon>
                 <FormItem label="班级名称" prop="name">
                 <FormItem label="班级名称" prop="name">
                     <Input v-model="privateClass.name" :placeholder="$t('courseManage.classroom.classroomName')">
                     <Input v-model="privateClass.name" :placeholder="$t('courseManage.classroom.classroomName')">
@@ -211,18 +199,6 @@
                 </FormItem>
                 </FormItem>
             </Form>
             </Form>
         </Modal>
         </Modal>
-        <Modal v-model="selectClassStatus" title="选择预设班级" @on-ok="confirmBindingClass(sysClass.classroomCode)" class-name="dark-iview-modal dark-iview-select dark-iview-form">
-            <Form ref="sysClass" :model="sysClass" label-position="top" label-colon>
-                <FormItem label="班级名称" prop="name">
-                    <Select v-model="sysClass.name" filterable>
-                        <Option @click.native="sysClass.id = item.id" v-for="(item, index) in schoolClassList" :value="item.id" :key="index">{{ item.name }}</Option>
-                    </Select>
-                </FormItem>
-                <FormItem :label="$t('courseManage.classroom.invitationCode')" prop="id">
-                    <span style="font-size:18px;color:white;">{{sysClass.id}}</span>
-                </FormItem>
-            </Form>
-        </Modal>
         <Modal v-model="addCusStatus" title="新增课程" @on-ok="confirmAddCus" class-name="dark-iview-modal dark-iview-form">
         <Modal v-model="addCusStatus" title="新增课程" @on-ok="confirmAddCus" class-name="dark-iview-modal dark-iview-form">
             <Form ref="addCusInfo" :model="addCusInfo" :rules="ruleAddCus">
             <Form ref="addCusInfo" :model="addCusInfo" :rules="ruleAddCus">
                 <FormItem prop="courseName" label="课程名称">
                 <FormItem prop="courseName" label="课程名称">
@@ -348,16 +324,11 @@ export default {
     },
     },
     methods: {
     methods: {
         getClassType(scope, openType) {
         getClassType(scope, openType) {
-            if (scope == 'private') {
+            if (this.listType == 'private') {
                 return {
                 return {
                     text: '动态名单',
                     text: '动态名单',
                     class: ''
                     class: ''
                 }
                 }
-            } else if (this.listType == 'private') {
-                return {
-                    text: '校本名单',
-                    class: ''
-                }
             } else if (openType == 1) {
             } else if (openType == 1) {
                 return {
                 return {
                     text: '常规教室',
                     text: '常规教室',
@@ -710,33 +681,31 @@ export default {
         },
         },
         showQrCode() {
         showQrCode() {
             this.showQrStatus = true
             this.showQrStatus = true
-            this.createQRCode('http://teammodelos-test.chinacloudsites.cn/joinclass')
+            let tId = this.$store.state.userInfo.TEAMModelId
+            let tName = this.$store.state.userInfo.name
+            let cId = this.classList[this.curClassIndex].id
+            let cName = this.classList[this.curClassIndex].name
+            this.createQRCode(`http://teammodelos-test.chinacloudsites.cn/joinclass?tId=${tId}&cId=${cId}&tName=${tName}&cName=${cName}`)
         },
         },
 
 
         //添加上课班级
         //添加上课班级
-        addClassroom(value) {
-            if (value == 0) {
-
-                this.selectClassStatus = true
-            } else if (value == 1) {
-                let randomCode = 'P'
-                for (let i = 0; i < 8; i++) {
-                    randomCode += this.$jsFn.getBtwRandom(0, 9)
-                }
-                this.privateClass.id = randomCode
-                this.newPrivateStatus = true
+        addClassroom() {
+            let randomCode = 'P'
+            for (let i = 0; i < 8; i++) {
+                randomCode += this.$jsFn.getBtwRandom(0, 9)
             }
             }
+            this.privateClass.id = randomCode
+            this.newPrivateStatus = true
         },
         },
         //确认添加上课班级
         //确认添加上课班级
-        confirmNewClassroom() {
+        confirmNewClass() {
             this.privateClass['scope'] = 'private'
             this.privateClass['scope'] = 'private'
-            // this.privateClass['code'] = 'Class-' + this.$store.state.userInfo.TEAMModelId
             this.privateClass['code'] = this.$store.state.userInfo.TEAMModelId
             this.privateClass['code'] = this.$store.state.userInfo.TEAMModelId
             this.privateClass['teacher'] = {
             this.privateClass['teacher'] = {
                 id: this.$store.state.userInfo.TEAMModelId,
                 id: this.$store.state.userInfo.TEAMModelId,
                 name: this.$store.state.userInfo.name
                 name: this.$store.state.userInfo.name
             }
             }
-            this.courseListP[this.curCusIndex].classes.push(this.privateClass)
+            this.courseListP[this.curCusIndex].classes.push(this._.cloneDeep(this.privateClass))
             this.courseListP[this.curCusIndex].code = this.$store.state.userInfo.TEAMModelId
             this.courseListP[this.curCusIndex].code = this.$store.state.userInfo.TEAMModelId
             this.$api.courseMgmt.upsertPrivateCus({
             this.$api.courseMgmt.upsertPrivateCus({
                 course: this.courseListP[this.curCusIndex],
                 course: this.courseListP[this.curCusIndex],
@@ -754,55 +723,6 @@ export default {
                 }
                 }
             )
             )
         },
         },
-        //确认选择系统班级
-        confirmBindingClass() {
-            let curClass = this.schoolClassList.filter((item) => {
-                return item.id == this.sysClass.id
-            })
-            console.log('curClass', curClass)
-            if (curClass.length > 0) {
-                curClass[0].code = this.$store.state.userInfo.schoolCode
-                let params = {
-                    'school_code': this.$store.state.userInfo.schoolCode,
-                    'id': this.sysClass.id,
-                    'scope': 'school'
-                }
-                this.$api.schoolSetting.getClassroomStudent(params).then(
-                    (res) => {
-                        if (!res.error) {
-                            if (res.classrooms.length > 0) {
-                                curClass[0].students = res.classrooms[0].students
-                                this.courseListP[this.curCusIndex].classes.push(curClass[0])
-                                this.courseListP[this.curCusIndex].code = this.$store.state.userInfo.TEAMModelId
-                                this.$api.courseMgmt.upsertPrivateCus({
-                                    course: this.courseListP[this.curCusIndex],
-                                    option: 'update'
-                                }).then(
-                                    (res) => {
-                                        if (!res.error) {
-                                            let index = this.courseListP[this.curCusIndex].classes.length - 1
-                                            this.courseListP[this.curCusIndex].classes[index].code = this.$store.state.userInfo.TEAMModelId
-                                            this.$Message.success('上课班级添加成功!')
-                                        } else {
-                                            this.$Message.error('上课班级添加失败!')
-                                        }
-                                    },
-                                    (err) => {
-                                        this.$Message.error('上课班级添加失败!')
-                                    }
-                                )
-                            }
-                        } else {
-                            this.$Message.error('API error!')
-                        }
-                    },
-                    (err) => {
-                        this.$Message.error('API error!')
-                    }
-                )
-            }
-        },
-
         //课程选项卡点击事件
         //课程选项卡点击事件
         tabClick(name) {
         tabClick(name) {
             this.curCusIndex = 0
             this.curCusIndex = 0

+ 0 - 134
TEAMModelOS/ClientApp/src/view/newcourse/NewMyCourse.less

@@ -1,134 +0,0 @@
-@first-bgColor: #141414;
-@second-bgColor: #1b1b1b;
-@third-bgColor: #222222;
-@borderColor: #424242;
-@primary-textColor: #fff; //文本主颜色
-@second-textColor: #a5a5a5; //文本副级颜色
-@primary-fontSize: 14px;
-@second-fontSize: 16px;
-
-.my-course-container {
-    width: 100%;
-    height: 100%;
-    display: flex;
-    flex-direction: row;
-
-    .course-list {
-        width: 400px;
-        height: 100%;
-        border-right: 1px solid @borderColor;
-        padding-left: 10px;
-    }
-
-    .course-info-wrap {
-        width: ~"calc(100% - 400px)";
-        height: 100%;
-        padding-left: 15px;
-        display: flex;
-        flex-direction: row;
-    }
-}
-.course-list-header {
-    width: 100%;
-    height: 45px;
-    position: relative;
-    border-bottom: 1px solid @borderColor;
-    line-height: 45px;
-
-    .list-label {
-        font-size: 16px;
-        color: @second-textColor;
-    }
-
-    .search-course {
-        display: inline-block;
-        position: absolute;
-        left: 10px;
-        right: 10px;
-        top: 16px;
-    }
-    
-}
-.add-icon {
-    float: right;
-    margin-right: 20px;
-    margin-top: 8px;
-    cursor: pointer;
-    color:white;
-    font-size:18px;
-}
-.course-list {
-    /*width: 100%;*/
-    /*height: ~"calc(100% - 45px)";*/
-    /*height:100%;*/
-
-    .show-course-label {
-        font-size: 10px;
-        color: @second-textColor;
-        display: block;
-        padding: 4px 0px 4px 15px;
-        border-bottom: 1px solid @borderColor;
-        font-weight: 800;
-    }
-
-    .course-list-item {
-        width: 100%;
-        padding: 12px 0px 12px 15px;
-        color: @second-textColor;
-        border-bottom: 1px solid @borderColor;
-        position: relative;
-        cursor: pointer;
-
-        .course-code {
-        }
-
-        .course-name {
-            font-size: 20px;
-            color: white;
-            font-weight: 600;
-            margin: 5px 0px;
-        }
-
-        .course-item-tool {
-            position: absolute;
-            right: 50px;
-            top: 35px;
-            display: none;
-        }
-    }
-
-    .course-list-item-active {
-        background-image: -webkit-linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
-        background-image: -o-linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
-        background-image: -moz-linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
-        background-image: linear-gradient(90deg, rgba(30,30,30,0) 0%, rgba(110,110,110,.2) 50%, rgba(110,110,110,.4) 100%);
-
-        .course-item-tool {
-            display: inline-block;
-        }
-    }
-}
-.course-detail-header {
-    width: 100%;
-    height: 45px;
-    line-height: 45px;
-    border-bottom: 1px solid @borderColor;
-
-    .setting-label {
-        color: @second-textColor;
-        margin-right: 50px;
-        cursor: pointer;
-        height: 45px;
-        display: inline-block;
-    }
-
-    .setting-label-active {
-        color: white;
-        font-weight: 600;
-        border-bottom: 2px solid white;
-    }
-}
-.action-btn-wrap {
-    margin-left:20px;
-    cursor:pointer;
-}

+ 0 - 969
TEAMModelOS/ClientApp/src/view/newcourse/NewMyCourse.vue

@@ -1,969 +0,0 @@
-<template>
-    <div class="my-course-container">
-        <Loading v-if="listLoading" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
-        <!--课程列表-->
-        <div class="course-list">
-            <!--列表内容-->
-            <vuescroll>
-                <div class="dark-iview-tabs-line cus-list-tab">
-                    <Tabs v-model="listType" @on-click="tabClick">
-                        <div slot="extra">
-                            <transition name="fade">
-                                <div style="margin-top:5px;">
-                                    <Icon type="md-create" v-show="(listType == 'school' && courseListS.length) || (listType == 'private' && courseListP.length) " class="add-icon" title="编辑课程" @click="editCus()" />
-                                    <Icon type="md-add" v-show="listType == 'private'" class="add-icon" title="新增课程" @click="showAddCourse()" />
-                                    <Icon type="md-trash" v-show="listType == 'private'" class="add-icon" title="删除课程" @click="delCourse" />
-                                </div>
-                            </transition>
-                        </div>
-                        <TabPane label="标准课程" name="school">
-                            <div v-for="(item,index) in courseListS" :key="index" @click="selectCourse(index)" :class="index === curCusIndex ? 'course-list-item block-bg block-bg-active':'course-list-item block-bg'">
-                                <p class="course-name">
-                                    {{item[0].courseName}}
-                                    <Icon type="ios-information-circle-outline" @click="toggleCusInfo" title="课程信息" />
-                                </p>
-                                <p class="course-code">
-                                    <Icon type="md-pricetags" />
-                                    {{item[0].courseId}}
-                                </p>
-                            </div>
-                            <div v-if="courseListS.length == 0">
-                                <EmptyData :top="150" textContent="暂无学校课程"></EmptyData>
-                            </div>
-                        </TabPane>
-                        <TabPane label="个人课程" name="private">
-                            <div v-for="(item,index) in courseListP" :key="index" @click="selectCourse(index)" :class="index === curCusIndex ? 'course-list-item block-bg block-bg-active':'course-list-item block-bg'">
-                                <p class="course-name">
-                                    {{item.name}}
-                                    <Icon type="ios-information-circle-outline" @click="toggleCusInfo" title="课程信息" />
-                                </p>
-                                <p class="course-code">
-                                    <Icon type="md-pricetags" />
-                                    {{item.id}}
-                                </p>
-                            </div>
-                            <div v-if="courseListP.length == 0">
-                                <EmptyData :top="150" textContent="暂未创建课程"></EmptyData>
-                            </div>
-                        </TabPane>
-                    </Tabs>
-                </div>
-            </vuescroll>
-        </div>
-        <div class="course-info-wrap">
-            <!--课程班级列表-->
-            <div class="course-classroom-list">
-                <div class="course-classroom-list-header">
-                    <span class="course-classroom-label">{{$t('courseManage.classroom.classroomList')}}</span>
-                    <Icon type="md-add" class="add-icon" style="margin-top:12px;" @click="addClassroom()" />
-                    <Icon type="md-create" v-show="listType == 'private'" class="add-icon" style="margin-top:12px;" @click="editClassStatus = true" />
-                    <Icon type="md-trash" v-show="listType == 'private'" class="add-icon" style="margin-top:12px;" @click="deleteClass()" />
-                </div>
-                <div class="course-classroom-list-content">
-                    <div v-for="(item,index) in classList" :key="index" @click="changeClassroom(index)" :class="curClassIndex === index ? 'course-classroom-item block-bg block-bg-active':'course-classroom-item block-bg'">
-                        <p class="classroom-code">
-                            <span :class="listType === 'private' ? 'class-type-dym': item.openType == 1 ? 'class-type-sys':'class-type-custom'">
-                                {{getClassType(item.scope,item.openType).text}}
-                            </span>
-                            <!--{{item.no}}-->
-                        </p>
-                        <p class="classroom-name">{{item.name}}</p>
-                        <p class="classroom-info " v-if="item.openType == 1 || item.scope == 'private'">
-                            <!--<span class="classroom-info-label">{{$t('courseManage.classroom.studentCount')}}</span>
-                            <span class="classroom-info-value">{{item.studentCount}}</span>-->
-                            <span class="classroom-info-label">{{$t('courseManage.classroom.headmaster')}}</span>
-                            <span class="classroom-info-value">{{item.teacher.name}}</span>
-                        </p>
-                        <Icon size="20" custom="iconfont icon-qr-code" class="qr-code-icon" @click="showQrCode" v-if="'private' == listType" />
-                    </div>
-                    <div v-if="classList.length == 0">
-                        <EmptyData :top="160" textContent="暂无上课班级"></EmptyData>
-                    </div>
-                </div>
-            </div>
-            <div class="course-classroom-info" id="table-height">
-                <div class="course-classroom-info-header" style="padding-right:50px;">
-                    <span @click="tabName = 'record'" :class="tabName == 'record' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label line-bottom'">课堂记录</span>
-                    <span @click="tabName = 'stus'" :class="tabName == 'stus' ? 'course-classroom-label line-bottom line-bottom-active':'course-classroom-label line-bottom'">{{$t('courseManage.classroom.studentList')}}</span>
-                    <div style="float:right;color:white;" v-if="(listType == 'private' && tabName == 'stus') || (listType == 'school' && tabName == 'stus' && classList[curClassIndex].openType == 2)">
-                        <span class="action-btn-wrap" @click="delStudents">
-                            <Icon type="md-trash" size="16" />
-                            删除学生
-                        </span>
-                        <span class="action-btn-wrap" @click="addStuStatus = true" v-if="classList[curClassIndex] && listType == 'private'">
-                            <Icon type="md-add" size="16" />
-                            添加学生
-                        </span>
-                        <!--<span class="disable-text-icon action-btn-wrap">
-                            <Icon type="md-shuffle" size="16" />
-                            自动分组
-                        </span>
-                        <span class="disable-text-icon action-btn-wrap">
-                            <Icon :type="viewType ? 'md-card':'md-list'" size="16" />
-                            分组视图
-                        </span>-->
-                    </div>
-                </div>
-                <div class="course-classroom-info-content dark-iview-table animated fadeIn" v-show="tabName == 'stus'">
-                    <vuescroll style="height:100%;">
-                        <Table :columns="studentColumn" :data="students" @on-selection-change="(selections)=>{delSelection = selections}" :height="tableHeight" class="system-classroom-table" :loading="stuLoading" no-data-text="暂无学生">
-                            <Loading slot="loading" bgColor="rgba(103, 103, 103, 0.27)"></Loading>
-                            <template slot-scope="{ row ,index}" slot="action">
-                                <strong></strong>
-                            </template>
-                            <template slot-scope="{ row, index }" slot="groupId">
-                                <span>{{(row.groupId && listType == 'school') ? row.groupId : '- -'}}</span>
-                            </template>
-                            <template slot-scope="{ row, index }" slot="groupName">
-                                <span>{{(row.groupName && listType == 'school') ? row.groupName : '未分组'}}</span>
-                            </template>
-                        </Table>
-                    </vuescroll>
-                </div>
-                <div v-show="tabName == 'record'" class="animated fadeIn class-record-wrap">
-                    <vuescroll>
-                        <List>
-                            <ListItem v-for="(item,index) in itemNum" :key="index" style="border-color:#505050;">
-                                <ListItemMeta @click.native="toClassRecoerd">
-                                    <p slot="title" class="record-name">力的组成</p>
-                                    <span slot="avatar" style="margin-top:4px;display: inline-block;margin-left:10px;">
-                                        <Icon custom="iconfont icon-whiteboard" size="30" color="white" />
-                                    </span>
-                                    <div slot="description" style="color:white;">
-                                        <span class="hiteacher-version">
-                                            系统版本:3.0.32
-                                        </span>
-                                        <Time class="record-time" :time="((new Date()).getTime() - 60 * 3 * 1000)" />
-                                        <div class="record-action-wrap">
-                                            <Icon class="action-icon" type="md-analytics" title="课程记录" @click="toClassRecoerd" />
-                                            <Icon class="action-icon" type="ios-stats" title="苏格拉底报告" @click="toClassRecoerd" />
-                                            <Icon class="action-icon" custom="iconfont icon-video" title="苏格拉底影片/桌面" @click="toClassRecoerd" />
-                                            <Icon class="action-icon" custom="iconfont icon-hi" title="电子笔记" @click="toClassRecoerd" />
-                                            <Icon class="action-icon" custom="iconfont icon-textbook" title="课例教材" @click="toClassRecoerd" />
-                                            <Icon class="action-icon" type="md-share" title="分享到频道" @click="toClassRecoerd" />
-                                        </div>
-                                    </div>
-                                </ListItemMeta>
-                            </ListItem>
-                        </List>
-                        <p style="width:100%;text-align:center;color:#808080;margin-top:20px;">暂未对接HiTeach上传数据</p>
-                    </vuescroll>
-                </div>
-            </div>
-        </div>
-        <Drawer title="课程信息" 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">
-                <Form ref="courseBaseInfo" label-position="top">
-                    <FormItem label="课程名称" prop="name" class="disabled-iview-select">
-                        <Input v-if="listType == 'school' && courseListS[curCusIndex]" v-model="courseListS[curCusIndex][0].courseName" :disabled="true" style="width:100%" placeholder="课程名称" :clearable="true"></Input>
-                        <Input v-else-if="listType == 'private' && courseListP[curCusIndex]" v-model="courseListP[curCusIndex].name" :disabled="baseEditStatus" style="width:100%" placeholder="课程名称" :clearable="true"></Input>
-                    </FormItem>
-                    <FormItem label="课程编码" prop="id" class="disabled-iview-select">
-                        <Input v-if="listType == 'school' && courseListS[curCusIndex]" v-model="courseListS[curCusIndex][0].courseId" :disabled="true" style="width:100%" placeholder="课程编码" :clearable="true"></Input>
-                        <Input v-else-if="listType == 'private' && courseListP[curCusIndex]" v-model="courseListP[curCusIndex].id" :disabled="true" style="width:100%" placeholder="课程编码" :clearable="true"></Input>
-                    </FormItem>
-                    <FormItem :label="$t('courseManage.base.courseNotice')">
-                        <div ref="courseNotice" v-show="!baseEditStatus"></div>
-                        <div v-show="baseEditStatus" style="height:fit-content;color:white;font-size:16px;padding-left:10px;width:100%;">
-                            <vuescroll>
-                                <div v-if="listType == 'school' && courseListS[curCusIndex] && checkNotice(courseListS[curCusIndex][0].notice)" v-html="courseListS[curCusIndex][0].notice" style=""></div>
-                                <div v-else-if="listType == 'private' && courseListP[curCusIndex] && checkNotice(courseListP[curCusIndex].notice)" v-html="courseListP[curCusIndex].notice" style=""></div>
-                                <div v-else style="">暂无公告!</div>
-                            </vuescroll>
-                        </div>
-                    </FormItem>
-                    <FormItem label="">
-                        <Button style="width:100%;margin-top:10px;" @click="edNotice">{{baseEditStatus ? '编辑':'保存'}}</Button>
-                    </FormItem>
-                </Form>
-            </div>
-        </Drawer>
-        <Modal v-model="newPrivateStatus" :title="$t('courseManage.classroom.personalClassroomTitle')" @on-ok="confirmNewClass" class-name="dark-iview-modal dark-iview-form">
-            <Form ref="personalClassroom" :model="privateClass" label-position="top" label-colon>
-                <FormItem label="班级名称" prop="name">
-                    <Input v-model="privateClass.name" :placeholder="$t('courseManage.classroom.classroomName')">
-                    </Input>
-                </FormItem>
-                <FormItem :label="$t('courseManage.classroom.invitationCode')" prop="id">
-                    <span style="font-size:18px;color:white;">{{privateClass.id}}</span>
-                </FormItem>
-            </Form>
-        </Modal>
-        <Modal v-model="editClassStatus" title="修改班级信息" @on-ok="confirmUpdClass" class-name="dark-iview-modal dark-iview-form">
-            <Form v-if="editClassStatus" ref="personalClassroom" :model="courseListP[curCusIndex].classes[curClassIndex]" label-position="top" label-colon>
-                <FormItem label="班级名称" prop="name">
-                    <Input v-model="courseListP[curCusIndex].classes[curClassIndex].name" :placeholder="$t('courseManage.classroom.classroomName')">
-                    </Input>
-                </FormItem>
-                <FormItem :label="$t('courseManage.classroom.invitationCode')" prop="id">
-                    <span style="font-size:18px;color:white;">{{courseListP[curCusIndex].classes[curClassIndex].id}}</span>
-                </FormItem>
-            </Form>
-        </Modal>
-        <Modal v-model="addCusStatus" title="新增课程" @on-ok="confirmAddCus" class-name="dark-iview-modal dark-iview-form">
-            <Form ref="addCusInfo" :model="addCusInfo" :rules="ruleAddCus">
-                <FormItem prop="courseName" label="课程名称">
-                    <Input type="text" v-model="addCusInfo.courseName" placeholder="课程名称..."></Input>
-                </FormItem>
-            </Form>
-            <Form ref="addCusInfo" :model="addCusInfo" :rules="ruleAddCus">
-                <FormItem prop="courseCode" label="课程编码">
-                    <Input type="text" v-model="addCusInfo.courseCode" placeholder="课程编码..."></Input>
-                </FormItem>
-            </Form>
-        </Modal>
-        <Modal v-model="addStuStatus" title="添加学生" width="1200" @on-ok="confirmAddStu" class-name="dark-iview-modal">
-            <StudentList @getSelectInfo="(selction)=>{selections = selction}"></StudentList>
-        </Modal>
-        <div class="qr-code-wrap" v-show="showQrStatus" @click="showQrStatus = false">
-            <div id="qrcode" :class="showQrStatus ? 'animated fadeIn':'animated fadeOut'" ref="qrcode" style="padding:20px;background-color:white;width:320px;margin:auto;"></div>
-        </div>
-    </div>
-</template>
-<script>
-import QRCode from 'qrcodejs2'
-import E from '@/utils/wangEditor.js'
-import StudentList from '@/components/coursemgt/StudentList.vue'
-export default {
-    components: {
-        StudentList
-    },
-    data() {
-        // 验证只能是字母和数字
-        const validateCode = (rule, value, callback) => {
-            if (!value) {
-                return callback(new Error('课程编码不能为空!'))
-            }
-            let zg = /^[0-9a-zA-Z]+$/
-            if (zg.test(value)) {
-                callback()
-            } else {
-                callback(new Error('课程编码只能由字母和数字组成!'))
-            }
-        }
-        return {
-            delSelection: [],
-            selections: [],
-            schoolClassList: [],
-            tableHeight: 100,
-            studentColumn: [
-                {
-                    title: ' ',
-                    type: 'selection',
-                    width: 80,
-                    align: 'center'
-                },
-                {
-                    title: this.$t('courseManage.classroom.studentTableC2'),
-                    key: 'name',
-                    align: 'left '
-                },
-                {
-                    title: '账号',
-                    key: 'id',
-                    align: 'center',
-                    sortable: true
-                },
-                {
-                    title: this.$t('courseManage.classroom.studentTableC1'),
-                    key: 'no',
-                    align: 'center',
-                    sortable: true
-                },
-                {
-                    title: this.$t('courseManage.classroom.studentTableC5'),
-                    slot: 'groupId',
-                    align: 'center',
-                    sortable: true
-                },
-                {
-                    title: this.$t('courseManage.classroom.studentTableC6'),
-                    slot: 'groupName',
-                    align: 'center'
-                }
-            ],
-            itemNum: 5,
-            editClassStatus: false,
-            baseEditStatus: true,
-            showQrStatus: false,
-            showCusInfo: false,
-            listLoading: false,
-            newPrivateStatus: false,
-            stuLoading: false,
-            selectClassStatus: false,
-            listType: 'school',
-            tabName: 'record',
-            addCusStatus: false,
-            addStuStatus: false,
-            joinQRcode: undefined,
-            curCusIndex: 0,
-            curClassIndex: 0,
-            courseListS: [],
-            courseListP: [],
-            addCusInfo: {
-                courseName: '',
-                courseCode: ''
-            },
-            ruleAddCus: {
-                courseName: [
-                    { required: true, message: '课程名称不能为空', trigger: 'change' }
-                ],
-                courseCode: [
-                    { required: true, validator: validateCode, trigger: 'change' }
-                ]
-            },
-            privateClass: {
-                id: '',
-                name: '',
-                notice: ''
-            },
-            sysClass: {
-                id: '',
-                name: ''
-            },
-        }
-    },
-    methods: {
-        getClassType(scope, openType) {
-            if (this.listType == 'private') {
-                return {
-                    text: '动态名单',
-                    class: ''
-                }
-            } else if (openType == 1) {
-                return {
-                    text: '常规教室',
-                    class: ''
-                }
-            } else {
-                return {
-                    text: '专科教室',
-                    class: ''
-                }
-            }
-        },
-        //删除学生
-        delStudents() {
-            if (this.delSelection.length > 0) {
-                let names = this.delSelection.map(item => {
-                    return item.name
-                })
-                this.$Modal.confirm({
-                    title: '删除学生',
-                    content: `确认删除${names.join(', ')}共${names.length}名学生吗?`,
-                    onOk: () => {
-                        this.listLoading = true
-                        this.delSelection.forEach(item => {
-                            let index = this.courseListP[this.curCusIndex].classes[this.curClassIndex].students.findIndex(stu => {
-                                return stu.id == item.id
-                            })
-                            this.courseListP[this.curCusIndex].classes[this.curClassIndex].students.splice(index, 1)
-                        })
-                        this.$api.schoolSetting.classUpsert({
-                            classroom: this.courseListP[this.curCusIndex].classes[this.curClassIndex],
-                            option: 'update',
-                            school_code: this.$store.state.userInfo.TEAMModelId
-                        }).then(
-                            (res) => {
-                                if (!res.error) {
-                                    this.selections = []
-                                    this.$Message.success('删除成功!')
-                                } else {
-                                    this.$Message.error('删除失败!')
-                                }
-                            },
-                            (err) => {
-                                this.$Message.error('删除失败!')
-                            }
-                        ).finally(() => {
-                            this.listLoading = false
-                            this.baseEditStatus = !this.baseEditStatus
-                        })
-                    }
-                })
-            } else {
-                this.$Message.warning('请先选择需要删除的学生!')
-            }
-
-        },
-        //确认添加学生
-        confirmAddStu() {
-            if (this.selections.length > 0) {
-                if (!this.courseListP[this.curCusIndex].classes[this.curClassIndex].students) {
-                    this.$set(this.courseListP[this.curCusIndex].classes[this.curClassIndex], 'students', [])
-                }
-                let stuIds = this.courseListP[this.curCusIndex].classes[this.curClassIndex].students.map(item => {
-                    return item.id
-                })
-                if (stuIds.length > 0) {
-                    //如果已经有学生,根据账号去重
-                    let hasRepeat = false
-                    this.selections.forEach(item => {
-                        if (stuIds.indexOf(item.id) == -1) {
-                            this.courseListP[this.curCusIndex].classes[this.curClassIndex].students.push({
-                                id: item.id,
-                                name: item.name,
-                                no: item.no
-                            })
-                        } else {
-                            hasRepeat = true
-                        }
-                    })
-                    if (hasRepeat) {
-                        //this.$Message.warning('已经自动帮您去掉账号重复的学生!')
-                    }
-                } else {
-                    let stus = this.selections.map(item => {
-                        return {
-                            id: item.id,
-                            name: item.name,
-                            no: item.no
-                        }
-                    })
-                    this.courseListP[this.curCusIndex].classes[this.curClassIndex].students.push(...stus)
-                }
-                //保存操作
-                this.listLoading = true
-                this.courseListP[this.curCusIndex].code = this.$store.state.userInfo.TEAMModelId
-                //调整为更新个人班级
-                //this.$api.courseMgmt.upsertPrivateCus({
-                //    course: this.courseListP[this.curCusIndex],
-                //    option: 'update'
-                //}).then(
-                //    (res) => {
-                //        if (!res.error) {
-                //            this.selections.length = 0
-                //            this.$Message.success('添加成功!')
-                //        } else {
-                //            this.$Message.error('添加失败!')
-                //        }
-                //    },
-                //    (err) => {
-                //        this.$Message.error('添加失败!')
-                //    }
-                //).finally(() => {
-                //    this.listLoading = false
-                //    this.baseEditStatus = !this.baseEditStatus
-                //})
-                this.$api.schoolSetting.classUpsert({
-                    classroom: this.courseListP[this.curCusIndex].classes[this.curClassIndex],
-                    option: 'update',
-                    'school_code': this.$store.state.userInfo.TEAMModelId
-                }).then(
-                    (res) => {
-                        if (!res.error) {
-                            this.selections.length = 0
-                            this.$Message.success('添加成功!')
-                        } else {
-                            this.$Message.error('添加失败!')
-                        }
-                    },
-                    (err) => {
-                        this.$Message.error('添加失败!')
-                    }
-                ).finally(() => {
-                    this.listLoading = false
-                    this.baseEditStatus = !this.baseEditStatus
-                })
-            }
-        },
-        //查询班级学生名单
-        findClassStu() {
-            this.stuLoading = true
-            let params = {
-                'school_code': this.listType == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId,
-                'id': this.classList[this.curClassIndex].id,
-                //school:校本班级 teacher:私人课程校本名单 private:私人课程动态名单
-                'scope': this.listType == 'school' ? 'school' : this.classList[this.curClassIndex].scope == 'school' ? 'teacher' : 'private'
-            }
-            this.$api.schoolSetting.getClassroomStudent(params).then(
-                (res) => {
-                    if (!res.error) {
-                        if (res.classrooms.length > 0) {
-                            if (this.listType == 'school') {
-                                this.$set(this.courseListS[this.curCusIndex][this.curClassIndex], 'students', res.classrooms[0].students)
-                            }
-                            else {
-                                this.$set(this.courseListP[this.curCusIndex].classes[this.curClassIndex], 'students', res.classrooms[0].students)
-                            }
-                        }
-                    } else {
-                        this.$Message.error('API error!')
-                    }
-                },
-                (err) => {
-                    this.$Message.error('API error!')
-                }
-            ).finally(() => {
-                setTimeout(() => {
-                    this.stuLoading = false
-                }, 500)
-            })
-        },
-        //检查课程是否为“空”
-        checkNotice(content) {
-            if (!content || content == '' || content == '<p><br></p>') {
-                return false
-            } else {
-                return true
-            }
-        },
-        //确认修改班级信息
-        confirmUpdClass() {
-            this.listLoading = true
-            this.courseListP[this.curCusIndex].code = this.$store.state.userInfo.TEAMModelId
-            this.$api.courseMgmt.upsertPrivateCus({
-                course: this.courseListP[this.curCusIndex],
-                option: 'update'
-            }).then(
-                (res) => {
-                    if (!res.error) {
-                        this.$Message.success('修改成功!')
-                    } else {
-                        this.$Message.error('修改失败!')
-                    }
-                },
-                (err) => {
-                    this.$Message.error('修改失败!')
-                }
-            ).finally(() => {
-                this.listLoading = false
-                this.editClassStatus = false
-            })
-        },
-        //删除上课班级
-        deleteClass() {
-            let _this = this
-            let delClass = this._.cloneDeep(this.classList[this.curClassIndex])
-            this.$Modal.confirm({
-                title: '删除班级',
-                content: `确认删除${this.classList[this.curClassIndex].name}吗?`,
-                onOk: function () {
-                    _this.listLoading = true
-                    let index = _this.curClassIndex
-                    _this.curClassIndex = 0
-                    _this.courseListP[_this.curCusIndex].classes.splice(index, 1)
-                    _this.courseListP[_this.curCusIndex].code = _this.$store.state.userInfo.TEAMModelId
-                    _this.$api.courseMgmt.upsertPrivateCus({
-                        course: _this.courseListP[_this.curCusIndex],
-                        option: 'update'
-                    }).then(
-                        (res) => {
-                            if (!res.error) {
-                                //删除个人班级数据
-                                _this.$api.schoolSetting.delClassroom({
-                                    id: delClass.id,
-                                    scope: delClass.scope,
-                                    school_code: _this.$store.state.userInfo.TEAMModelId
-                                }).then(
-                                    res => {
-                                        _this.$Message.success('删除成功!')
-                                    },
-                                    err => {
-                                        _this.$Message.error('删除失败!')
-                                    }
-                                )
-                            } else {
-                                _this.$Message.error('删除失败!')
-                            }
-                        },
-                        (err) => {
-                            _this.$Message.error('删除失败!')
-                        }
-                    ).finally(() => {
-                        _this.listLoading = false
-                    })
-                }
-            })
-        },
-        editCus() {
-            this.toggleCusInfo()
-            this.edNotice()
-        },
-        //保存个人课程
-        saveNotice() {
-            this.listLoading = true
-            this.courseListP[this.curCusIndex].code = this.$store.state.userInfo.TEAMModelId
-            this.$api.courseMgmt.upsertPrivateCus({
-                course: this.courseListP[this.curCusIndex],
-                option: 'update'
-            }).then(
-                (res) => {
-                    if (!res.error) {
-                        this.$Message.success('修改成功!')
-                    } else {
-                        this.$Message.error('修改失败!')
-                    }
-                },
-                (err) => {
-                    this.$Message.error('修改失败!')
-                }
-            ).finally(() => {
-                this.listLoading = false
-                this.baseEditStatus = !this.baseEditStatus
-            })
-        },
-        edNotice() {
-            if (this.baseEditStatus) {
-                this.baseEditStatus = !this.baseEditStatus
-                this.initEditor()
-            } else {
-                if (this.listType == 'private') {
-                    this.saveNotice()
-                } else {
-                    this.baseEditStatus = !this.baseEditStatus
-                    this.courseListS[this.curCusIndex][this.curClassIndex].code = this.$store.state.userInfo.schoolCode
-                    this.$api.courseMgmt.upsertNotice(this.courseListS[this.curCusIndex][this.curClassIndex]).then(
-                        res => {
-                            if (!res.error) {
-                                this.$Message.success('保存成功')
-                            } else {
-                                this.$Message.error('保存失败')
-                            }
-                        },
-                        err => {
-                            this.$Message.error('保存失败')
-                        }
-                    )
-                }
-            }
-        },
-        toggleCusInfo() {
-            this.showCusInfo = !this.showCusInfo
-        },
-        //初始化富文本编辑器
-        initEditor() {
-            if (!this.noticeEditor) {
-                let noticeEditor = new E(this.$refs.courseNotice)
-                noticeEditor.customConfig.onchange = (html) => {
-                    if (this.listType == 'school') {
-                        this.courseListS[this.curCusIndex][0].notice = html
-                    } else if (this.listType == 'private') {
-                        this.courseListP[this.curCusIndex].notice = html
-                    }
-                }
-                noticeEditor.customConfig.menus = [
-                    'bold', // 粗体
-                    'italic', // 斜体
-                    'underline', // 下划线
-                    'list', // 列表
-                    'link', // 插入链接
-                    'image' // 插入图片
-                ],
-                    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)
-                this.noticeEditor = noticeEditor
-            } else {
-                console.log(this.courseListS[this.curCusIndex][0].notice)
-                let schoolNotice = this.courseListS[this.curCusIndex][0].notice ? this.courseListS[this.curCusIndex][0].notice : ''
-                this.noticeEditor.txt.html(this.listType == 'school' ? schoolNotice : this.courseListP[this.curCusIndex].notice)
-                console.log(this.courseListS)
-            }
-
-        },
-        //创建二维码
-        createQRCode(url) {
-            this.$nextTick(() => {
-                // 此时已经渲染完成
-                if (this.joinQRcode == undefined) {
-                    let qrcode = new QRCode('qrcode', {
-                        width: 280, // 设置宽度,单位像素
-                        height: 280, // 设置高度,单位像素
-                        text: url // 设置二维码内容或跳转地址
-                    })
-                    this.joinQRcode = qrcode
-                } else {
-                    this.joinQRcode.clear()
-                    this.joinQRcode.makeCode(url)
-                }
-            })
-        },
-        showQrCode() {
-            this.showQrStatus = true
-            let tId = this.$store.state.userInfo.TEAMModelId
-            let tName = this.$store.state.userInfo.name
-            let cId = this.classList[this.curClassIndex].id
-            let cName = this.classList[this.curClassIndex].name
-            this.createQRCode(`http://teammodelos-test.chinacloudsites.cn/joinclass?tId=${tId}&cId=${cId}&tName=${tName}&cName=${cName}`)
-        },
-
-        //添加上课班级
-        addClassroom() {
-            let randomCode = 'P'
-            for (let i = 0; i < 8; i++) {
-                randomCode += this.$jsFn.getBtwRandom(0, 9)
-            }
-            this.privateClass.id = randomCode
-            this.newPrivateStatus = true
-        },
-        //确认添加上课班级
-        confirmNewClass() {
-            this.privateClass['scope'] = 'private'
-            this.privateClass['code'] = this.$store.state.userInfo.TEAMModelId
-            this.privateClass['teacher'] = {
-                id: this.$store.state.userInfo.TEAMModelId,
-                name: this.$store.state.userInfo.name
-            }
-            this.courseListP[this.curCusIndex].classes.push(this._.cloneDeep(this.privateClass))
-            this.courseListP[this.curCusIndex].code = this.$store.state.userInfo.TEAMModelId
-            this.$api.courseMgmt.upsertPrivateCus({
-                course: this.courseListP[this.curCusIndex],
-                option: 'update'
-            }).then(
-                (res) => {
-                    if (!res.error) {
-                        this.$Message.success('动态名单创建成功!')
-                    } else {
-                        this.$Message.error('动态名单创建失败!')
-                    }
-                },
-                (err) => {
-                    this.$Message.error('动态名单创建失败!')
-                }
-            )
-        },
-        //课程选项卡点击事件
-        tabClick(name) {
-            this.curCusIndex = 0
-            if (name == 'school' && this.courseListS.length == 0) {
-                this.getCourseList()
-            } else if (name == 'private' && this.courseListP.length == 0) {
-                this.getPrivateCus()
-            } else {
-                this.changeClassroom(0)
-            }
-        },
-        changeClassroom(index) {
-            this.curClassIndex = index
-            if (this.listType == 'school' && !this.courseListS[this.curCusIndex][this.curClassIndex].students) {
-                this.findClassStu()
-            } else if (this.listType == 'private' && !this.courseListP[this.curCusIndex].classes[this.curClassIndex].students) {
-                this.findClassStu()
-            }
-        },
-        toClassRecoerd() {
-            this.listLoading = true
-            setTimeout(() => {
-                this.$router.push({ path: '/home/classRecord' })
-            }, 500)
-        },
-        //删除个人课程
-        delCourse() {
-            this.$Modal.confirm({
-                title: '删除课程',
-                content: `确认删除${this.courseListP[this.curCusIndex].name}吗?`,
-                onOk: () => {
-                    this.$api.courseMgmt.deleteCourse({
-                        id: this.courseListP[this.curCusIndex].id,
-                        code: this.$store.state.userInfo.TEAMModelId,
-                        scope: this.courseListP[this.curCusIndex].scope
-                    }).then(
-                        res => {
-                            if (!res.error) {
-                                let index = this.curCusIndex
-                                this.curCusIndex = 0
-                                this.courseListP.splice(index, 1)
-                                this.$Message.success('删除成功!')
-                            } else {
-                                this.$Message.error('删除失败!')
-                            }
-                        },
-                        err => {
-                            this.$Message.error('删除失败!')
-                        }
-                    )
-                }
-            })
-        },
-        selectCourse(index) {
-            this.curClassIndex = 0
-            this.curCusIndex = index
-            if (this.classList.length > 0) {
-                this.changeClassroom(0)
-            }
-        },
-        //添加个人课程
-        showAddCourse() {
-            this.addCusStatus = true
-        },
-        confirmAddCus() {
-            this.$refs['addCusInfo'].validate((valid) => {
-                if (valid) {
-                    let requestData = {
-                        option: 'insert',
-                        course: {
-                            name: this.addCusInfo.courseName,
-                            id: this.addCusInfo.courseCode,
-                            code: this.$store.state.userInfo.TEAMModelId,
-                            classes: [],
-                            scope: 'private'
-                        }
-                    }
-                    this.$api.courseMgmt.upsertPrivateCus(requestData).then(
-                        (res) => {
-                            if (res.error == null) {
-                                this.$Message.success('保存成功!')
-                                this.courseListP.push(requestData.course)
-                            } else {
-                                this.$Message.success('保存失败!')
-                            }
-                        },
-                        (err) => {
-
-                        }
-                    )
-                } else {
-                    this.$Message.error('请完善信息再保存!');
-                }
-            })
-        },
-        //获取个人课程列表
-        getPrivateCus() {
-            this.listLoading = true
-            let requestData = {
-                id: this.$store.state.userInfo.TEAMModelId
-            }
-            this.$api.courseMgmt.getPrivateCusMgt(requestData).then(
-                (res) => {
-                    if (res.error == null) {
-                        res.courses.forEach(curItem => {
-                            curItem.classes.forEach(claItem => {
-                                let c = this.schoolClassList.find((classItem) => {
-                                    return claItem.id == classItem.id
-                                })
-                                if (c) {
-                                    claItem.no = c.no
-                                    claItem.openType = c.openType
-                                }
-                            })
-                        })
-                        this.courseListP = res.courses
-
-                        this.selectCourse(0)
-                    } else {
-                        this.$Message.error('API error!')
-                    }
-                },
-                (err) => {
-                    this.$Message.error('API error!')
-                }
-            ).finally(() => {
-                this.listLoading = false
-            })
-        },
-        //获取标准课程列表
-        getCourseList() {
-            this.listLoading = true
-            let requestData = {
-                'code': this.$store.state.userInfo.schoolCode,
-                'id': this.$store.state.userInfo.TEAMModelId
-            }
-            this.$api.courseMgmt.getSchoolCusMgt(requestData).then(
-                (res) => {
-                    if (res.error == null) {
-                        res.courses.forEach((item, index) => {
-                            let c = this.schoolClassList.find((classItem) => {
-                                return item.id == classItem.id
-                            })
-                            if (c) {
-                                item.no = c.no
-                                item.openType = c.openType
-                            }
-                        })
-                        console.log('res', res)
-                        this.courseListS = this.$jsFn.groupBy(res.courses, 'courseId')
-                        this.selectCourse(0)
-                    } else {
-                        this.$Message.error('API ERROR!')
-                    }
-                },
-                (err) => {
-                    this.$Message.error('API ERROR!')
-                }
-            ).finally(() => {
-                this.listLoading = false
-            })
-        }
-    },
-    created() {
-        //直接读取登录成功拿到得学校基础信息
-        this.$store.dispatch('user/getSchoolProfile').then(res => {
-            this.schoolClassList = res.school_classes
-            this.getCourseList()
-        })
-
-        this.$nextTick(() => {
-            let dom = document.getElementById('table-height')
-            console.log(dom)
-            console.log(dom.offsetHeight)
-            this.tableHeight = dom.offsetHeight - 60
-        })
-    },
-    computed: {
-        classList() {
-            if (this.listType == 'school') {
-                if (this.courseListS.length > 0) {
-                    return this.courseListS[this.curCusIndex]
-                } else {
-                    return []
-                }
-            } else if (this.listType == 'private') {
-                if (this.courseListP.length > 0) {
-                    return this.courseListP[this.curCusIndex].classes
-                } else {
-                    return []
-                }
-            }
-        },
-        students() {
-            if (this.listType == 'school') {
-                if (this.courseListS[this.curCusIndex] && this.courseListS[this.curCusIndex][this.curClassIndex]) {
-                    return this.courseListS[this.curCusIndex][this.curClassIndex].students
-                } else {
-                    return []
-                }
-            } else if (this.listType == 'private') {
-                if (this.courseListP[this.curCusIndex] && this.courseListP[this.curCusIndex].classes && this.courseListP[this.curCusIndex].classes[this.curClassIndex]) {
-                    return this.courseListP[this.curCusIndex].classes[this.curClassIndex].students
-                } else {
-                    return []
-                }
-            } else {
-                return []
-            }
-        }
-    }
-}
-</script>
-<style scoped lang="less">
-@import "./NewMyCourse.less";
-@import "./CourseClassroom.less";
-</style>
-<style>
-.cus-list-tab .ivu-tabs-bar {
-    height: 45px;
-}
-.cus-list-tab .ivu-tabs-nav {
-    height: 45px;
-    line-height: 30px;
-}
-.course-classroom-list-header .ivu-poptip-inner {
-    background-color: #404040;
-    color: white;
-}
-
-.course-classroom-list-header .ivu-poptip-arrow::after {
-    display: none;
-}
-
-.course-classroom-list-header .ivu-poptip-title:after,
-.course-classroom-list-header .ivu-poptip-title {
-    display: none;
-}
-.course-classroom-info-content #loadingBox {
-    margin-top: 0px !important;
-}
-</style>

+ 13 - 67
TEAMModelOS/ClientApp/src/view/teachcontent/index.vue

@@ -252,10 +252,8 @@ export default {
         checkName(data) {
         checkName(data) {
             let reg = new RegExp('[?*:"<>\/|]')
             let reg = new RegExp('[?*:"<>\/|]')
             if (reg.test(this.fileListShow[this.editIndex].name)) {
             if (reg.test(this.fileListShow[this.editIndex].name)) {
-                console.log(1)
                 this.formatErr = true
                 this.formatErr = true
             } else {
             } else {
-                console.log(2)
                 this.formatErr = false
                 this.formatErr = false
             }
             }
         },
         },
@@ -285,7 +283,6 @@ export default {
                                 let orginUrl = this.fileListShow[editIndex].url
                                 let orginUrl = this.fileListShow[editIndex].url
                                 this.fileListShow[editIndex].blob = `/res/${this.newName}/index.json`
                                 this.fileListShow[editIndex].blob = `/res/${this.newName}/index.json`
                                 this.fileListShow[editIndex].url = orginUrl.replace(this.renameBefore, this.fileListShow[editIndex].name)
                                 this.fileListShow[editIndex].url = orginUrl.replace(this.renameBefore, this.fileListShow[editIndex].name)
-                                console.log(this.fileListShow[editIndex])
                             }
                             }
                         )
                         )
                     },
                     },
@@ -308,7 +305,6 @@ export default {
                                 let orginUrl = this.fileListShow[editIndex].url
                                 let orginUrl = this.fileListShow[editIndex].url
                                 this.fileListShow[editIndex].blob = '/' + targetUrl
                                 this.fileListShow[editIndex].blob = '/' + targetUrl
                                 this.fileListShow[editIndex].url = orginUrl.replace(this.renameBefore, this.fileListShow[editIndex].name)
                                 this.fileListShow[editIndex].url = orginUrl.replace(this.renameBefore, this.fileListShow[editIndex].name)
-                                console.log(this.fileListShow[editIndex])
                             }
                             }
                         )
                         )
                     },
                     },
@@ -321,7 +317,6 @@ export default {
             }
             }
         },
         },
         getFileUrl(files) { // 获取文件地址
         getFileUrl(files) { // 获取文件地址
-            console.log(files)
             this.preUpdFiles.push(...files)
             this.preUpdFiles.push(...files)
             this.confirmUpd()
             this.confirmUpd()
         },
         },
@@ -346,7 +341,6 @@ export default {
                         let n = file.blob
                         let n = file.blob
                         n = n.replace('/video/', '/thum/')
                         n = n.replace('/video/', '/thum/')
                         n = n.replace(file.name, file.name.slice(0, file.name.lastIndexOf('.'))) + '.png'
                         n = n.replace(file.name, file.name.slice(0, file.name.lastIndexOf('.'))) + '.png'
-                        console.log(n)
                         file['thum'] = file.url.replace(file.blob, n)
                         file['thum'] = file.url.replace(file.blob, n)
                     }
                     }
                     if (this.activeType == file.type) {
                     if (this.activeType == file.type) {
@@ -573,7 +567,6 @@ export default {
         },
         },
         //批量删除
         //批量删除
         delFileBatch() {
         delFileBatch() {
-            console.log(this.selections)
             if (this.selections.length == 0) {
             if (this.selections.length == 0) {
                 if (this.showType) {
                 if (this.showType) {
                     this.$Message.warning('请在列表模式使用批量删除!')
                     this.$Message.warning('请在列表模式使用批量删除!')
@@ -677,13 +670,6 @@ export default {
                             prefix: `res/${file.name.replace('.HTEX', '')}`
                             prefix: `res/${file.name.replace('.HTEX', '')}`
                         }).then(
                         }).then(
                             res => {
                             res => {
-                                // BlobTool.updateSize([{
-                                //     urls: [{
-                                //         url: `res/${file.name.replace('.HTEX', '')}`,
-                                //         size: file.size
-                                //     }],
-                                //     containerName: this.routerScope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
-                                // }])
                                 this.sizeInfo[this.activeType] -= file.size
                                 this.sizeInfo[this.activeType] -= file.size
                                 this.sizeInfo.total -= file.size
                                 this.sizeInfo.total -= file.size
                                 this.fileListShow.splice(index, 1)
                                 this.fileListShow.splice(index, 1)
@@ -702,24 +688,19 @@ export default {
                             this.isLoading = false
                             this.isLoading = false
                         })
                         })
                     } else {
                     } else {
-                        this.containerClient.deleteBlob(file.blob).then(
+                        this.containerClient.deleteBlob(file.blob, file.size).then(
                             (res) => {
                             (res) => {
                                 //删除缩略图或封面
                                 //删除缩略图或封面
                                 if (this.activeType == 'image') {
                                 if (this.activeType == 'image') {
                                     let thum = file.blob.replace('/image/', '/thum/')
                                     let thum = file.blob.replace('/image/', '/thum/')
-                                    this.containerClient.deleteBlob(thum)
+                                    //这里暂时预设缩略图大小为60KB
+                                    this.containerClient.deleteBlob(thum, 60 * 1024)
                                 } else if (this.activeType == 'video') {
                                 } else if (this.activeType == 'video') {
                                     let thum = file.blob.replace('/video/', '/thum/')
                                     let thum = file.blob.replace('/video/', '/thum/')
                                     thum = thum.slice(0, thum.lastIndexOf('.')) + '.png'
                                     thum = thum.slice(0, thum.lastIndexOf('.')) + '.png'
-                                    this.containerClient.deleteBlob(thum)
+                                    //这里暂时预封面大小为60KB
+                                    this.containerClient.deleteBlob(thum, 60 * 1024)
                                 }
                                 }
-                                // BlobTool.updateSize([{
-                                //     urls: [{
-                                //         url: `res/${file.name.replace('.HTEX', '')}`,
-                                //         size: file.size
-                                //     }],
-                                //     containerName: this.routerScope == 'school' ? this.$store.state.userInfo.schoolCode : this.$store.state.userInfo.TEAMModelId
-                                // }])
                                 this.sizeInfo[this.activeType] -= file.size
                                 this.sizeInfo[this.activeType] -= file.size
                                 this.sizeInfo.total -= file.size
                                 this.sizeInfo.total -= file.size
                                 this.fileListShow.splice(index, 1)
                                 this.fileListShow.splice(index, 1)
@@ -741,12 +722,10 @@ export default {
         downloadFile(index) {
         downloadFile(index) {
             let fileInfo = this.fileListShow[index]
             let fileInfo = this.fileListShow[index]
             if (fileInfo.extension == 'HTEX') {
             if (fileInfo.extension == 'HTEX') {
-                console.log(fileInfo)
                 this.containerClient.listBlob({
                 this.containerClient.listBlob({
                     prefix: `res/${fileInfo.name.replace('.HTEX', '')}`
                     prefix: `res/${fileInfo.name.replace('.HTEX', '')}`
                 }).then(
                 }).then(
                     res => {
                     res => {
-                        console.log(res)
                         let fileList = res.blobList
                         let fileList = res.blobList
                         this.handleBatchDownload(fileList, fileInfo.name)
                         this.handleBatchDownload(fileList, fileInfo.name)
                     }
                     }
@@ -789,11 +768,9 @@ export default {
                     // 生成二进制流
                     // 生成二进制流
                     FileSaver.saveAs(content, name); // 利用file-saver保存文件
                     FileSaver.saveAs(content, name); // 利用file-saver保存文件
                     this.isLoading = false;
                     this.isLoading = false;
-                })
-                    .catch(err => {
-                        console.log(err);
-                        this.isLoading = false;
-                    });
+                }).catch(err => {
+                    this.isLoading = false;
+                });
             });
             });
         },
         },
 
 
@@ -829,32 +806,7 @@ export default {
             let date = new Date(timestamp)
             let date = new Date(timestamp)
             return date.toLocaleString()
             return date.toLocaleString()
         },
         },
-        // 处理教材文件夹的文件 在BlobTool统一处理
-        // handleHTEXFile(fileList) {
-        //     let parseRes = []
-        //     let names = []
-        //     fileList.forEach((item, index) => {
-        //         let fileItem = {}
-        //         let startIndex = this.$jsFn.findChartIndex(item.blob, '/', 1)
-        //         let endIndex = this.$jsFn.findChartIndex(item.blob, '/', 2)
-        //         let name = item.blob.substring(startIndex + 1, endIndex)
-        //         let nameIndex = names.indexOf(name)
-        //         if (nameIndex == -1) {
-        //             fileItem.url = this.urlString + '/res/' + name
-        //             fileItem.blob = `/res/${name}/index.json`
-        //             fileItem.name = name + '.HTEX'
-        //             fileItem.size = item.size
-        //             fileItem.createTime = item.createTime
-        //             fileItem.extension = 'HTEX'
-        //             fileItem.type = 'res'
-        //             names.push(name)
-        //             parseRes.push(fileItem)
-        //         } else {
-        //             parseRes[nameIndex].size += item.size
-        //         }
-        //     })
-        //     return parseRes
-        // },
+
         /**查询文件列表 */
         /**查询文件列表 */
         findFileList() {
         findFileList() {
             if (this.containerClient) {
             if (this.containerClient) {
@@ -868,15 +820,9 @@ export default {
                 let prefix = this.activeType
                 let prefix = this.activeType
                 this.containerClient.listBlob({ prefix }, option).then(
                 this.containerClient.listBlob({ prefix }, option).then(
                     (res) => {
                     (res) => {
-                        console.log(res)
-                        console.log(this.containerName)
                         this.mk[this.activeType] = res.continuationToken
                         this.mk[this.activeType] = res.continuationToken
-                        // if (this.activeType == 'res') {
-                        //     res.blobList = this.handleHTEXFile(res.blobList)
-                        // }
                         //拼接授权字符串
                         //拼接授权字符串
                         for (let i in res.blobList) {
                         for (let i in res.blobList) {
-                            console.log(res.blobList[i].url)
                             res.blobList[i].url = res.blobList[i].url + this.sasString
                             res.blobList[i].url = res.blobList[i].url + this.sasString
                             if (res.blobList[i].type == 'image') {
                             if (res.blobList[i].type == 'image') {
                                 res.blobList[i].thum = res.blobList[i].url.replace('/image/', '/thum/')
                                 res.blobList[i].thum = res.blobList[i].url.replace('/image/', '/thum/')
@@ -884,11 +830,9 @@ export default {
                                 let n = res.blobList[i].blob
                                 let n = res.blobList[i].blob
                                 n = n.replace('/video/', '/thum/')
                                 n = n.replace('/video/', '/thum/')
                                 n = n.replace(res.blobList[i].name, res.blobList[i].name.slice(0, res.blobList[i].name.lastIndexOf('.'))) + '.png'
                                 n = n.replace(res.blobList[i].name, res.blobList[i].name.slice(0, res.blobList[i].name.lastIndexOf('.'))) + '.png'
-                                console.log(n)
                                 res.blobList[i]['thum'] = res.blobList[i].url.replace(res.blobList[i].blob, n)
                                 res.blobList[i]['thum'] = res.blobList[i].url.replace(res.blobList[i].blob, n)
                             }
                             }
                         }
                         }
-                        console.log(res.blobList)
                         this.fileList[this.activeType] = res.blobList
                         this.fileList[this.activeType] = res.blobList
                         this.fileListShow = this._.cloneDeep(this.fileList[this.activeType])
                         this.fileListShow = this._.cloneDeep(this.fileList[this.activeType])
                         setTimeout(() => {
                         setTimeout(() => {
@@ -986,16 +930,18 @@ export default {
     },
     },
     created() {
     created() {
         this.initData()
         this.initData()
+        let cont = ''
         if (this.$route.name == 'schoolcontent') {
         if (this.$route.name == 'schoolcontent') {
             this.routerScope = 'school'
             this.routerScope = 'school'
+            cont = this.$store.state.userInfo.schoolCode
         } else {
         } else {
             this.routerScope = 'private'
             this.routerScope = 'private'
+            cont = this.$store.state.userInfo.TEAMModelId
         }
         }
         this.sizeLoading = true
         this.sizeLoading = true
-        BlobTool.getSizeByServe(this.$store.state.userInfo.schoolCode).then(
+        BlobTool.getSizeByServe(cont).then(
             res => {
             res => {
                 this.sizeInfo = res
                 this.sizeInfo = res
-                console.log(this.sizeInfo)
             },
             },
             err => {
             err => {
                 this.$Message.error('空间计算异常')
                 this.$Message.error('空间计算异常')

+ 60 - 2
TEAMModelOS/Controllers/Common/ExamController.cs

@@ -319,10 +319,12 @@ namespace TEAMModelOS.Controllers
             if (!request.TryGetProperty("code", out JsonElement school)) return BadRequest();
             if (!request.TryGetProperty("code", out JsonElement school)) return BadRequest();
             try
             try
             {
             {
+                List<string> ids = new List<string>();
+                ids = classId.ToObject<List<string>>();
                 var client = _azureCosmos.GetCosmosClient();
                 var client = _azureCosmos.GetCosmosClient();
                 List<ExamClassResult> examClassResults = new List<ExamClassResult>();
                 List<ExamClassResult> examClassResults = new List<ExamClassResult>();
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(
-                    queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}' and c.info.id = '{classId}'",
+                    queryText: $"select value(c) from c where c.examId = '{id}' and c.subjectId = '{subjectId}' and c.info.id in ({string.Join(",", ids.Select(o => $"'{o}'"))})",
                     requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{school}") }))
                     requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"ExamClassResult-{school}") }))
                 {
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
@@ -767,6 +769,62 @@ namespace TEAMModelOS.Controllers
                 var query = $"select c.id,c.code,A0.id paperId,A0.code paperCode,A0.name paperName,A0.multipleRule,A0.scope,A0.blob from c join A0 in c.papers where c.id ='{id}'";
                 var query = $"select c.id,c.code,A0.id paperId,A0.code paperCode,A0.name paperName,A0.multipleRule,A0.scope,A0.blob from c join A0 in c.papers where c.id ='{id}'";
                 List<object> papers = new List<object>();
                 List<object> papers = new List<object>();
                 List<object> subjects = new List<object>();
                 List<object> subjects = new List<object>();
+                List<string> classIds = new List<string>();
+                //存放当前学生所在班级ID
+                HashSet<string> resultIds = new HashSet<string>();
+                //查询校本班级ID
+                await foreach (var item in client.GetContainer("TEAMModelOS", "School").GetItemQueryStreamIterator(
+                    queryText: $"select c.id from c join A0 in c.students where A0.id = '{studentId}' and c.pk = 'Class' "))
+                {
+                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                    {
+                        var accounts = json.RootElement.GetProperty("Documents").EnumerateArray();
+                        while (accounts.MoveNext())
+                        {
+                            JsonElement account = accounts.Current;
+                            resultIds.Add(account.GetProperty("id").GetString());
+                        }
+                    }
+                }
+                //查询私人班级ID
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Teacher").GetItemQueryStreamIterator(
+                   queryText: $"select c.id from c join A0 in c.students where A0.id = '{studentId}' and c.pk = 'Class' "))
+                {
+                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                    {
+                        var accounts = json.RootElement.GetProperty("Documents").EnumerateArray();
+                        while (accounts.MoveNext())
+                        {
+                            JsonElement account = accounts.Current;
+                            resultIds.Add(account.GetProperty("id").GetString());
+                        }
+                    }
+                }
+                var queryClassId = $"select c.targetClassIds id from c where c.id ='{id}'";
+                await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: queryClassId, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{school}") }))
+                {
+                    using var json = await JsonDocument.ParseAsync(item.ContentStream);
+                    if (json.RootElement.TryGetProperty("_count", out JsonElement count) && count.GetUInt16() > 0)
+                    {
+
+                        foreach (var obj in json.RootElement.GetProperty("Documents").EnumerateArray())
+                        {
+                            classIds = obj.GetProperty("id").ToObject<List<string>>();
+                            //classIds = obj.ToObject<List<string>>();
+                        }
+
+                    }
+                    
+                }
+                //存放该学生所在班级参与当前评测的ID
+                List<string> infoIds = new List<string>();
+                foreach (string ids in resultIds) {
+                    if (classIds.Contains(ids)) {
+                        infoIds.Add(ids);
+                    }
+                }
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{school}") }))
                 await foreach (var item in client.GetContainer("TEAMModelOS", "Common").GetItemQueryStreamIterator(queryText: query, requestOptions: new QueryRequestOptions() { PartitionKey = new PartitionKey($"Exam-{school}") }))
                 {
                 {
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
                     using var json = await JsonDocument.ParseAsync(item.ContentStream);
@@ -825,7 +883,7 @@ namespace TEAMModelOS.Controllers
                         total.Add(result.sum.Where(s => s > 90 && s <= 100).Count());
                         total.Add(result.sum.Where(s => s > 90 && s <= 100).Count());
                     }                   
                     }                   
                 }
                 }
-                return Ok(new { papers, subjects,stuScore, stuAns, total });
+                return Ok(new { papers, subjects,stuScore, stuAns, total,claId = infoIds });
             }
             }
             catch (Exception ex)
             catch (Exception ex)
             {
             {