浏览代码

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

zhouj1203@hotmail.com 4 年之前
父节点
当前提交
63a0994583
共有 23 个文件被更改,包括 940 次插入382 次删除
  1. 2 5
      TEAMModelOS/ClientApp/public/index.html
  2. 1 7
      TEAMModelOS/ClientApp/src/api/learnActivity.js
  3. 127 97
      TEAMModelOS/ClientApp/src/components/learnactivity/NewChooseContent.vue
  4. 3 3
      TEAMModelOS/ClientApp/src/components/learnactivity/QuestionList.less
  5. 10 2
      TEAMModelOS/ClientApp/src/utils/js-fn.js
  6. 18 14
      TEAMModelOS/ClientApp/src/utils/public.js
  7. 5 2
      TEAMModelOS/ClientApp/src/view/classrecord/ClassRecord.vue
  8. 13 9
      TEAMModelOS/ClientApp/src/view/evaluation/bank/ExerciseList.vue
  9. 23 14
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseEditExercise.vue
  10. 17 10
      TEAMModelOS/ClientApp/src/view/evaluation/components/BaseExerciseList.vue
  11. 26 20
      TEAMModelOS/ClientApp/src/view/evaluation/index/CreateExercises.vue
  12. 46 37
      TEAMModelOS/ClientApp/src/view/evaluation/index/CreatePaper.vue
  13. 0 1
      TEAMModelOS/ClientApp/src/view/learnactivity/CreateEvaluation.less
  14. 273 136
      TEAMModelOS/ClientApp/src/view/learnactivity/CreateEvaluation.vue
  15. 6 6
      TEAMModelOS/ClientApp/src/view/learnactivity/ExamPaperAnalysis.vue
  16. 11 5
      TEAMModelOS/ClientApp/src/view/learnactivity/ManualPaper.vue
  17. 322 0
      TEAMModelOS/ClientApp/src/view/learnactivity/MultiCascader.vue
  18. 3 4
      TEAMModelOS/ClientApp/src/view/newcourse/ManageCourse.vue
  19. 20 3
      TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue
  20. 4 3
      TEAMModelOS/ClientApp/src/view/newcourse/NewCoursePlan.vue
  21. 4 1
      TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/SystemSetting.vue
  22. 5 2
      TEAMModelOS/Controllers/School/CourseController.cs
  23. 1 1
      TEAMModelOS/Controllers/Syllabus/ItemInfoController.cs

+ 2 - 5
TEAMModelOS/ClientApp/public/index.html

@@ -7,12 +7,9 @@
     <link rel="icon" href="<%= BASE_URL %>favicon.ico">
     <link id="theme" type="text/css" rel="stylesheet" href="<%= BASE_URL %>theme/dark-theme.css">
     <title>vuex-oidc-example</title>
-<!--    <script type="text/javascript" id="MathJax-script" async
+   <script type="text/javascript" id="MathJax-script" async
             src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-MML-AM_CHTML">
-        MathJax.Hub.Config({
-            tex2jax: { inlineMath: [['$', '$'], ['\(', '\)']] }
-        });
-    </script> -->
+    </script>
     <script>
         let cloudSetting = localStorage.getItem('cloudSetting')
         if (cloudSetting) {

+ 1 - 7
TEAMModelOS/ClientApp/src/api/learnActivity.js

@@ -58,7 +58,7 @@ export default {
      *删除最小单元
      */
     DeleteUnit: function (data) {
-        return post('/api/Learn/DeleteUnit', data)
+        return post('/teacher/learn/delete-unit', data)
     },
     /*
     *根据id数组查询资源文件
@@ -193,12 +193,6 @@ export default {
         return post('/api/Learn/DeleteProcess', data)
     },
     /*
-    *删除最小单元
-    */
-    DeleteUnit: function (data) {
-        return post('/api/Learn/DeleteUnit', data)
-    },
-    /*
     * 新增或者修改投票活动
     */
     SaveorUpdataVote: function (data) {

+ 127 - 97
TEAMModelOS/ClientApp/src/components/learnactivity/NewChooseContent.vue

@@ -66,7 +66,7 @@
                         </div>
                         <div class="content-filter-item">
                             <span class="content-filter-label">类型:</span>
-                            <RadioGroup v-model="contentFilter.fileType" style="display:inline-block;" @on-change="filterContentByType">
+                            <RadioGroup v-model="contentFilter.fileType" style="display:inline-block;" @on-change="getFileList">
                                 <Radio class="radio-width" :key="index" v-for="(item,index) in contentTypeList" :label="item.type">{{item.label}}</Radio>
                             </RadioGroup>
                         </div>
@@ -89,12 +89,14 @@
                             <template slot-scope="{ row, index }" slot="name">
                                 <div>
                                     <div class="file-icon">
-                                        <img v-if="row.extension == 'ppt' || row.extension == 'pptx'" src="../../assets/icon/ppt50.png" width="15" />
-                                        <img v-else-if="row.extension == 'doc' || row.extension == 'docx'" src="../../assets/icon/word50.png" width="15" />
-                                        <img v-else-if="row.extension == 'xls' || row.extension == 'xlsx'" src="../../assets/icon/xls50.png" width="15" />
-                                        <img v-else-if="row.extension == 'pdf'" src="../../assets/icon/pdf50.png" width="15" />
-                                        <img v-else-if="row.type == 'picture'" src="../../assets/icon/icon_img.png" width="15" />
+                                        <img v-if="row.extension == 'PPT' || row.extension == 'PPTX'" src="../../assets/icon/ppt50.png" width="15" />
+                                        <img v-else-if="row.extension == 'DOC' || row.extension == 'DOCX'" src="../../assets/icon/word50.png" width="15" />
+                                        <img v-else-if="row.extension == 'XLS' || row.extension == 'XLSX' || row.extension == 'CSV'" src="../../assets/icon/xls50.png" width="15" />
+                                        <img v-else-if="row.extension == 'PDF'" src="../../assets/icon/pdf50.png" width="15" />
+                                        <img v-else-if="row.extension == 'ZIP' || row.extension == 'RAR'" src="../../assets/icon/zip50.png" width="15" />
+                                        <img v-else-if="row.type == 'image'" src="../../assets/icon/icon_img.png" width="15" />
                                         <img v-else-if="row.type == 'video'" src="../../assets/icon/icon_video.png" width="15" />
+                                        <img v-else-if="row.type == 'res'" src="../../assets/icon/htex.png" width="15" />
                                         <img v-else src="../../assets/icon/prelearn50.png" width="15" />
                                     </div>
                                     <span style="margin-left:8px;vertical-align: text-bottom;">{{row.name}}</span>
@@ -177,9 +179,9 @@
                             <div>
                                 <EmptyData v-if="questionList.length == 0"></EmptyData>
                             </div>
-                            <div class="page-wrap">
+                            <!--<div class="page-wrap">
                                 <Page :current.sync="pageNum" :total="totalNum" :page-size="pageSize" size="small" show-total show-sizer @on-change="getCurrentPageData" />
-                            </div>
+                            </div>-->
                         </div>
                     </vuescroll>
                 </div>
@@ -254,13 +256,13 @@
                 },
                 contentFilter: {
                     scope: 'private',
-                    fileType: 'teach'
+                    fileType: 'res'
                 },
                 keyWord: '',
                 contentTypeList: [
                     {
                         label: '教材',
-                        type: 'teach',
+                        type: 'res',
                     },
                     {
                         label: this.$t('teachContent.filterPicture'),
@@ -270,9 +272,13 @@
                         label: this.$t('teachContent.filterVideo'),
                         type: 'video',
                     },
+                    {
+                        label: '音频',
+                        type: 'audio',
+                    },
                     {
                         label: this.$t('teachContent.filterDoc'),
-                        type: 'document',
+                        type: 'doc',
                     },
                     {
                         label: this.$t('teachContent.filterOther'),
@@ -280,8 +286,22 @@
                     }
                 ],
                 fileList: {
-                    school: [],
-                    private: []
+                    school: {
+                        res: [],
+                        image: [],
+                        video: [],
+                        audio: [],
+                        doc: [],
+                        other: []
+                    },
+                    private: {
+                        res: [],
+                        image: [],
+                        video: [],
+                        audio: [],
+                        doc: [],
+                        other:[]
+                    }
                 },
                 selectedFiles: [],
                 fileListShow: [],
@@ -393,10 +413,11 @@
              */
             queryQuestionByPage() {
                 let queryData = {
-                    '@CURRPAGE': this.pageNum,
-                    '@PAGESIZE': this.pageSize,
+                    //'@CURRPAGE': this.pageNum,
+                    //'@PAGESIZE': this.pageSize,
                     '@DESC': "createTime",
                     'code': this.questionFilter.code,
+                    'scope': this.questionFilter.code == this.$store.state.userInfo.TEAMModelId ? 'private':'school',
                     'periodId': this.questionFilter.periodId == "" ? [] : [this.questionFilter.periodId],
                     'level': this.deleteAll(this.questionFilter.level),
                     'type': this.deleteAll(this.questionFilter.type),
@@ -404,27 +425,21 @@
                     'subjectId': this.questionFilter.subjectId == "" ? [] : [this.questionFilter.subjectId],
                 }
                 this.isLoading = true
-                this.$api.newEvaluation.FindExerciseList(queryData).then(async res => {
-                    let privateSas = await this.$tools.getPrivateSas()
-                    let schoolSas = await this.$tools.getSchoolSas()
+                this.$api.newEvaluation.FindExerciseList(queryData).then(res => {
+                    
                     /* 拿到Summary的题目之后要通过每个题目的JSON URL 换取完整题目数据 */
                     let list = res.items
-                    list.forEach(async (i, index) => {
-                        if (i.url) {
-                            try {
-                                let sasString = i.code === this.$store.state.userInfo.TEAMModelId ? privateSas : schoolSas
-                                let jsonInfo = await this.$tools.getFile(i.url + sasString.sas)
-                                let jsonData = JSON.parse(jsonInfo)
-                                jsonData.id = i.id
-                                jsonData.fileName = i.url.split('/')[i.url.split('/').length - 1].split('.json')[0]
-                                this.$set(list, index, jsonData)
-                            } catch (e) {
-                                this.$Message.warning('存在试题读取异常!')
-                            }
-
+                    this.$evTools.getFullItem(list).then(
+                        (res) => {
+                            this.questionList = res
+                        },
+                        (err) => {
+                            this.$Message.error('题库获取失败')
                         }
-                    })
-                    this.questionList = list
+                    )
+                    
+                    
+                }).finally(() => {
                     setTimeout(() => {
                         this.isLoading = false
                     }, 500)
@@ -536,80 +551,95 @@
                 let type = this.contentFilter.fileType
                 let files = this.fileList[this.contentFilter.scope]
                 this.fileListShow = []
-                switch (type) {
-                    case 'teach':
-                        this.fileListShow = files.filter(item => {
-                            return item.type === 'teach'
-                        })
-                        break
-                    case 'image':
-                        this.fileListShow = files.filter(item => {
-                            return item.type === 'image'
-                        })
-                        break
-                    case 'video':
-                        this.fileListShow = files.filter(item => {
-                            return item.type === 'video'
-                        })
-                        break
-                    case 'doc':
-                        this.fileListShow = files.filter(item => {
-                            return item.type === 'doc'
-                        })
-                        break
-                    case 'other':
-                        this.fileListShow = files.filter(item => {
-                            return item.type === 'other'
-                        })
-                        break
-                }
+                this.fileListShow = this.fileList[this.contentFilter.scope][this.contentFilter.fileType]
+                //switch (type) {
+                //    case 'res':
+                //        this.fileListShow = files.filter(item => {
+                //            return item.type === 'res'
+                //        })
+                //        break
+                //    case 'image':
+                //        this.fileListShow = files.filter(item => {
+                //            return item.type === 'image'
+                //        })
+                //        break
+                //    case 'video':
+                //        this.fileListShow = files.filter(item => {
+                //            return item.type === 'video'
+                //        })
+                //        break
+                //    case 'doc':
+                //        this.fileListShow = files.filter(item => {
+                //            return item.type === 'doc'
+                //        })
+                //        break
+                //    case 'other':
+                //        this.fileListShow = files.filter(item => {
+                //            return item.type === 'other'
+                //        })
+                //        break
+                //}
                 this.searchBefore = this.fileListShow
                 this.keyWord = ''
                 this.handleCheckStatus()
             },
             //获取文件列表
             async getFileList() {
-                if (this.contentFilter.scope == 'private' && this.fileList[this.contentFilter.scope].length == 0) {
-                    let sasRes = await this.$tools.getPrivateSas()
-                    let op1 = new BlobTool(sasRes.url, sasRes.name, sasRes.sas, this.contentFilter.scope)
-                    op1.listBlob({
-                        prefix: 'res'
-                    }).then(
-                        (res) => {
-                            this.fileList[this.contentFilter.scope] = res.blobList
-                            this.fileListShow = this.fileList[this.contentFilter.scope].filter((item) => {
-                                return item.type == this.contentFilter.fileType
-                            })
-                            this.searchBefore = [...this.fileListShow]
-                        },
-                        (err) => {
-                            this.$Message.error('API Error')
-                        }
-                    )
-                } else if (this.contentFilter.scope == 'school' && this.fileList[this.contentFilter.scope].length == 0) {
-                    let sasRes = await this.$tools.getSchoolSas()
-                    let op1 = new BlobTool(sasRes.url, sasRes.name, sasRes.sas, this.contentFilter.scope)
-                    op1.listBlob({
-                        prefix: 'res'
-                    }).then(
-                        (res) => {
-                            this.fileList[this.contentFilter.scope] = res.blobList
-                            this.fileListShow = this.fileList[this.contentFilter.scope].filter((item) => {
-                                return item.type == this.contentFilter.fileType
-                            })
-                            this.searchBefore = [...this.fileListShow]
-                        },
-                        (err) => {
-                            this.$Message.error('API Error')
-                        }
-                    )
+                if (this.fileList[this.contentFilter.scope][this.contentFilter.fileType].length == 0) {
+                    let sasRes
+                    if (this.contentFilter.scope == 'private') {
+                        sasRes = await this.$tools.getPrivateSas()
+                    } else if (this.contentFilter.scope == 'school'){
+                        sasRes = await this.$tools.getSchoolSas()
+                    }
+                    if (sasRes) {
+                        let op1 = new BlobTool(sasRes.url, sasRes.name, sasRes.sas, this.contentFilter.scope)
+                        op1.listBlob({
+                            prefix: this.contentFilter.fileType
+                        }).then(
+                            (res) => {
+                                this.fileList[this.contentFilter.scope][this.contentFilter.fileType] = res.blobList
+                                this.fileListShow = this.fileList[this.contentFilter.scope][this.contentFilter.fileType]
+                                this.searchBefore = [...this.fileListShow]
+                            },
+                            (err) => {
+                                this.$Message.error('API Error')
+                            }
+                        )
+                    } else {
+                        this.$Message.error('获取Blob授权信息失败')
+                    }
                 } else {
-                    this.fileListShow = this.fileList[this.contentFilter.scope].filter((item) => {
-                        return item.type == this.contentFilter.fileType
-                    })
+                    this.fileListShow = this.fileList[this.contentFilter.scope][this.contentFilter.fileType]
                     this.searchBefore = [...this.fileListShow]
                     this.handleCheckStatus()
                 }
+
+                //if (this.contentFilter.scope == 'private' && this.fileList[this.contentFilter.scope][this.contentFilter.fileType].length == 0) {
+                //    let sasRes = await this.$tools.getPrivateSas()
+                //    let op1 = new BlobTool(sasRes.url, sasRes.name, sasRes.sas, this.contentFilter.scope)
+                //    op1.listBlob({
+                //        prefix: this.contentFilter.fileType
+                //    }).then(
+                //        (res) => {
+                //            this.fileList[this.contentFilter.scope][this.contentFilter.fileType] = res.blobList
+                //            this.fileListShow = this.fileList[this.contentFilter.scope][this.contentFilter.fileType]
+                //            this.searchBefore = [...this.fileListShow]
+                //        },
+                //        (err) => {
+                //            this.$Message.error('API Error')
+                //        }
+                //    )
+                //} else if (this.contentFilter.scope == 'school' && this.fileList[this.contentFilter.scope].length == 0) {
+                //    let sasRes = await this.$tools.getSchoolSas()
+                    
+                //} else {
+                //    this.fileListShow = this.fileList[this.contentFilter.scope].filter((item) => {
+                //        return item.type == this.contentFilter.fileType
+                //    })
+                //    this.searchBefore = [...this.fileListShow]
+                //    this.handleCheckStatus()
+                //}
             },
             selectVolume(index) {
                 this.currentVolumeIndex = index

+ 3 - 3
TEAMModelOS/ClientApp/src/components/learnactivity/QuestionList.less

@@ -6,15 +6,15 @@
 @second-fontSize: 16px;
 
 .question-item-wrap {
-    background-color: #505050;
+    background-color: #454545;
     margin-bottom: 3px;
     padding: 10px 30px 10px 10px;
     position: relative;
     border-radius: 4px;
 
     &:hover {
-        background: #525252;
-        transform: translate(-2px,-2px);
+        background: #606060;
+        /*transform: translate(-2px,-2px);*/
         transition: all .1s;
         box-shadow: 1px 4px 5px #191919;
     }

+ 10 - 2
TEAMModelOS/ClientApp/src/utils/js-fn.js

@@ -223,11 +223,17 @@ function throttle(func, delay) {
 function formatBytes(bytes) {
     return bytes / 1024 < 1024 ? (bytes / 1024).toFixed(1) + 'KB' : bytes / 1024 / 1024 < 1024 ? (bytes / 1024 / 1024).toFixed(1) + 'M' : (bytes / 1024 / 1024 / 1024).toFixed(1) + 'G'
 }
+//生成uuid
+function uuid() {
+    function S4() {
+        return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1)
+    }
+    return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4())
+}
 
 
 export default {
     groupBy,
-    groupBynew,
     isObjEqual,
     getIndex,
     getBtwRandom,
@@ -239,5 +245,7 @@ export default {
     createVideoPoster,
     debounce,
     throttle,
-    formatBytes
+    formatBytes,
+    groupBynew,
+    uuid
 }

+ 18 - 14
TEAMModelOS/ClientApp/src/utils/public.js

@@ -469,23 +469,27 @@ export default {
 			}
 		});
 		const blobTool = require('./blobTool.js')
-		const isSchool = vm.$parent.exerciseScope === 0
+		const isSchool = vm.$parent.exerciseScope === 1
 		const sasData = isSchool ? await this.getPrivateSas() : await this.getSchoolSas()
-		console.log()
+		const scope = isSchool ? 'school' : 'private'
 		const blobToolClass = blobTool.default
 		//初始化Blob
-		let containerClient = new blobToolClass(sasData.url, sasData.name, sasData.sas)
-		// 上传文件
-		let blobFile = await containerClient.upload(file, 'item')
-		console.log(blobFile)
-		// let host = isSchool ? JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri : JSON.parse(decodeURIComponent(localStorage.user_profile, "utf-8")).blob_uri
-		// 获取blob链接以及视频封面截图
-		const fileBlobUrl = blobFile.url + sasData.sas
-		const posterBase64 = await this.getVideoBase64(fileBlobUrl)
-		editor.txt.append('<img data-url=' + fileBlobUrl + ' data-name=' + blobFile.name + ' src=' +
-			posterBase64 + ' class="richText-video"></img>')
-		editor.change()
-		vm.$Spin.hide();
+		let containerClient = new blobToolClass(sasData.url, sasData.name, sasData.sas, scope)
+		try{
+			// 上传文件
+			let blobFile = await containerClient.upload(file, 'item')
+			// 获取blob链接以及视频封面截图
+			const fileBlobUrl = blobFile.url + sasData.sas
+			const posterBase64 = await this.getVideoBase64(fileBlobUrl)
+			editor.txt.append('<img data-url=' + fileBlobUrl + ' data-name=' + blobFile.name + ' src=' +
+				posterBase64 + ' class="richText-video"></img>')
+			editor.change()
+			vm.$Spin.hide();
+		}catch(e){
+			vm.$Message.error(e.spaceError)
+			vm.$Spin.hide();
+		}
+		
 	},
 	isEqual: function(x, y) {
 		// If both x and y are null or undefined and exactly the same 

+ 5 - 2
TEAMModelOS/ClientApp/src/view/classrecord/ClassRecord.vue

@@ -4,9 +4,9 @@
             <div style="padding: 1% 3% 0px 3%;">
                 <!--头部信息-->
                 <div class="class-record-header">
-                    <span class="course-name">物理</span>
+                    <span class="course-name">数学</span>
                     <span class="record-name">
-                        力的组成
+                        速度与时间
                     </span>
                     <div style="float:right;">
                         <span class="label-text">
@@ -753,6 +753,9 @@
     @import "./ClassRecord.less";
 </style>
 <style>
+    .class-content .vjs-progress-holder {
+        font-size:10px !important;
+    }
     .mouse-over-status .vjs-control-bar {
         opacity: 1 !important;
     }

+ 13 - 9
TEAMModelOS/ClientApp/src/view/evaluation/bank/ExerciseList.vue

@@ -80,7 +80,7 @@
 			<img src="../../../assets/icon/no_data.svg" width="120" />
 			<span style="margin-top:15px;color:#808080">暂无数据</span>
 		</div>
-		<div class="content-wrap" v-else>
+		<div class="content-wrap" ref="mathJaxContainer" v-else>
 			<Loading :top="100" v-show="dataLoading" type="1" hideMask></Loading>
 			<div class="exercise-item" v-for="(item,index) of exerciseList" :key="index" @click="onQuestionToggle(index,item.id,$event)">
 				<!-- 题干部分 -->
@@ -165,8 +165,9 @@
 
 		<Modal v-model="editExerciseModal" class-name="edit-exercise-modal" width="1200px" footer-hide @on-visible-change="editModalChange"
 		 title="编辑习题">
-
-			<BaseEditExercise :exerciseItem="currentExercise" @onEditSuccess="onEditSuccess" refId="listEdit" ref="editRef"></BaseEditExercise>
+			<template v-if="periodList.length">
+				<BaseEditExercise :exerciseItem="currentExercise" @onEditSuccess="onEditSuccess" refId="listEdit" ref="editRef"></BaseEditExercise>
+			</template>
 
 			<div slot="footer">
 				<Button type="success">确认</Button>
@@ -323,7 +324,7 @@
 				// 获取初始化Blob需要的数据
 				let sasData = this.isShowSchoolBank ? await this.$tools.getSchoolSas() : await this.$tools.getPrivateSas()
 				//初始化Blob
-				let containerClient = new blobTool(sasData.url, sasData.name, sasData.sas)
+				let containerClient = new blobTool(sasData.url, sasData.name, sasData.sas , this.isShowSchoolBank ? 'school' : 'private')
 				// 等待blob的返回结果
 				containerClient.listBlob({
 				    prefix: 'paper'
@@ -420,7 +421,7 @@
 			},
 
 			editModalChange(val) {
-				//this.$refs.editModal.backToTop()
+				this.$refs.editRef.backToTop()
 			},
 
 			/**
@@ -627,9 +628,9 @@
 					this.currentPage = page
 					this.pageScrollTo(0)
 					// 公式渲染
-					// this.$nextTick(()=>{
-					// 	window.MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
-					// })
+					this.$nextTick(()=>{
+						window.MathJax.Hub.Queue(["Typeset", MathJax.Hub,this.$refs.mathJaxContainer]);
+					})
 				}catch(e){
 					console.log(e)
 				}
@@ -765,7 +766,10 @@
 
 		},
 		mounted() {
-			
+			// 公式渲染
+			this.$nextTick(()=>{
+				window.MathJax.Hub.Queue(["Typeset", MathJax.Hub,this.$refs.mathJaxContainer]);
+			})
 		},
 		computed: {
 			headers() {

+ 23 - 14
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseEditExercise.vue

@@ -1,5 +1,5 @@
 <template>
-	<div class="ev-container component-ev-container" :id="refId">
+	<div class="ev-container component-ev-container" :id="refId" ref="editContainer">
 		<div class="display-flex" v-if="isSchool">
 			<div class="exersices-attr my-radio-style">
 				<IconText :text="'选择学段'" :color="'#00b8ff'" :icon="'md-school'"></IconText>
@@ -220,9 +220,7 @@
 		},
 		created() {
 			// 初始化区班校信息
-			setTimeout(() => {
-				this.getSchoolInfo()
-			},1000)
+			this.getSchoolInfo()
 		},
 		methods: {
 			getSchoolInfo() {
@@ -261,6 +259,11 @@
 					this.curVideoName = e.srcElement.dataset.name
 				}
 			},
+			
+			/* 滚回顶部 */
+			backToTop(){
+				this.$refs.editContainer.scrollIntoView()
+			},
 
 			onSelectFile(val) {
 				this.relateFileList = val.files
@@ -348,17 +351,23 @@
 						// 获取初始化Blob需要的数据
 						let sasData = this.exerciseScope === 0 ? await this.$tools.getPrivateSas() : await this.$tools.getSchoolSas()
 						//初始化Blob
-						let containerClient = new blobTool(sasData.url, sasData.name, sasData.sas)
-						// 等待上传blob的返回结果
-						let blobFile = await containerClient.upload(file, 'item')
-						if (blobFile.blob) {
-							// 保存到COSMOS是不含base64图片编码的数据 避免数据量过大
-							exerciseItem.blob = blobFile.blob
-							let cosmosItem = await this.$evTools.createCosmosItem(exerciseItem)
-							this.saveExercise(cosmosItem) 
-						}else{
-							this.$Message.error('试题文件上传失败,请稍后重试!')
+						let containerClient = new blobTool(sasData.url, sasData.name, sasData.sas, exerciseItem.scope)
+						
+						try{
+							// 等待上传blob的返回结果
+							let blobFile = await containerClient.upload(file, 'item')
+							if (blobFile.blob) {
+								// 保存到COSMOS是不含base64图片编码的数据 避免数据量过大
+								exerciseItem.blob = blobFile.blob
+								let cosmosItem = await this.$evTools.createCosmosItem(exerciseItem)
+								this.saveExercise(cosmosItem) 
+							}else{
+								this.$Message.error('试题文件上传失败,请稍后重试!')
+							}
+						}catch(e){
+							this.$Message.error(e.spaceError)
 						}
+						
 					}else{
 						// 如果是试卷内编辑试题 则返回编辑好的数据 再统一进行保存
 						this.saveExercise(exerciseItem) 

+ 17 - 10
TEAMModelOS/ClientApp/src/view/evaluation/components/BaseExerciseList.vue

@@ -5,7 +5,7 @@
 			<img src="../../../assets/icon/no_data.svg" width="120" />
 			<span style="margin-top:15px;color:#808080">暂无数据</span>
 		</div>
-		<div class="content-wrap" v-else>
+		<div class="content-wrap" ref="mathJaxContainer" v-else>
 			<Loading :top="200" v-show="dataLoading" type="1"></Loading>
 			<div class="list-view" :key="typeIndex" v-for="(typeItem,typeIndex) in listData">
 				<p v-show="viewModel === 'type' && typeItem.list.length" class="type-name">{{ numberConvertToUppercase(getLatestTypeIndex(typeItem.type) + 1) }}
@@ -40,7 +40,7 @@
 							<div class="item-question-text" v-html="item.question" @click="onRichTextClick($event)"></div>
 						</div>
 						<span class="item-btn-toggle">
-							<span class="item-score">{{ item.score }} 分</span>
+							<span class="item-score">{{ item.score.toFixed(2) }} 分</span>
 							<Icon :type="collapseList.indexOf(index) > -1 ? 'ios-arrow-dropup' : 'ios-arrow-dropdown'" />
 						</span>
 					</div>
@@ -113,6 +113,7 @@
 		</Modal>
 
 		<Modal v-model="typeScoreModel" title="题型配分" footer-hide>
+			<span class="type-score-item">试卷总分 : {{ paper.score }}</span>
 			<span class="type-score-item">已分配总分 : {{ getTotalScore(groupTypeList) }}</span>
 			<div v-for="(item,index) in groupTypeList" :key="index" class="type-score-item">
 				<div v-if="item.list.length">
@@ -490,17 +491,24 @@
 				if (this.surPlusScore < 0) {
 					this.$Message.warning("当前配分超过试卷总分,请重新分配!")
 				} else {
+					console.log(this.groupTypeList)
+					
 					/* 按照题型配分后平均分配给每个子题 */
 					this.groupTypeList.forEach(item => {
+						console.log(item.score)
 						item.list.forEach(exercise => {
+							console.log(exercise.score)
 							exercise.score = item.score / item.list.length
+							console.log(exercise.score)
 							if (item.id) {
+								console.log(item.score)
 								this.exerciseList.filter(item => item.id === exercise.id)[0].score = item.score / item.list.length
 							} else {
 								this.exerciseList.filter(item => item.shaCode === exercise.shaCode)[0].score = item.score / item.list.length
 							}
 						})
 					})
+					console.log(JSON.stringify(this.groupTypeList))
 					/** 回到题型视图 */
 					this.groupList = this.groupTypeList
 					this.$parent.viewModel = 'type'
@@ -635,11 +643,6 @@
 									}
 								})
 							});
-
-							/* 查找当前页面所有知识点ID换名称 */
-							// this.getPointsByIds(this.getPointIds(this.exerciseList)).then(res => {
-							// 	this.allPointList = res
-							// })
 						}
 						
 						this.originData = this.exerciseList
@@ -648,9 +651,9 @@
 						this.surPlusScore = newPaper.score - newPaper.item.reduce((p, e) => p + e.score, 0);
 						this.pageScrollTo(0)
 						this.pageChange(1)
-						// this.$nextTick(()=>{
-						// 	window.MathJax.Hub.Queue(["Typeset", MathJax.Hub]);
-						// })
+						this.$nextTick(()=>{
+							window.MathJax.Hub.Queue(["Typeset", MathJax.Hub,this.$refs.mathJaxContainer]);
+						})
 					}
 				},
 				deep: true
@@ -695,6 +698,10 @@
 	}
 
 
+	.components-el-container .exercise-item:hover {
+		border: 1px solid #01b4ef;
+	}
+	
 	.components-el-container .exercise-item {
 		position: relative;
 		margin-top: 30px;

+ 26 - 20
TEAMModelOS/ClientApp/src/view/evaluation/index/CreateExercises.vue

@@ -369,27 +369,33 @@
 					// 获取初始化Blob需要的数据
 					let sasData = this.exerciseScope === 0 ? await this.$tools.getPrivateSas() : await this.$tools.getSchoolSas()
 					//初始化Blob
-					let containerClient = new blobTool(sasData.url, sasData.name, sasData.sas)
-					// 等待上传blob的返回结果
-					let blobFile = await containerClient.upload(file, 'item')
-					if (blobFile.blob) {
-						// 保存到COSMOS是不含base64图片编码的数据 避免数据量过大
-						exerciseItem.blob = blobFile.blob
-						this.saveExercise({
-							itemInfo:await this.$evTools.createCosmosItem(exerciseItem),
-							option:'insert'
-						}).then(res => {
-							this.$router.push({
-								name: this.exerciseScope === 0 ? 'personalBank' : 'schoolBank',
-								params: {
-									tabName: 'exercise'
-								}
-							})
-							this.saveLoading = false
-						}) 
-					}else{
-						this.$Message.error('试题文件上传失败,请稍后重试!')
+					let containerClient = new blobTool(sasData.url, sasData.name, sasData.sas,exerciseItem.scope)
+					
+					try{
+						// 等待上传blob的返回结果
+						let blobFile = await containerClient.upload(file, 'item')
+						if (blobFile.blob) {
+							// 保存到COSMOS是不含base64图片编码的数据 避免数据量过大
+							exerciseItem.blob = blobFile.blob
+							this.saveExercise({
+								itemInfo:await this.$evTools.createCosmosItem(exerciseItem),
+								option:'insert'
+							}).then(res => {
+								this.$router.push({
+									name: this.exerciseScope === 0 ? 'personalBank' : 'schoolBank',
+									params: {
+										tabName: 'exercise'
+									}
+								})
+								this.saveLoading = false
+							}) 
+						}else{
+							this.$Message.error('试题文件上传失败,请稍后重试!')
+						}
+					}catch(e){
+						this.$Message.error(e.spaceError)
 					}
+					
 				} else {
 					console.log(exerciseItem)
 					this.$Message.warning('请将题目填写完整!')

+ 46 - 37
TEAMModelOS/ClientApp/src/view/evaluation/index/CreatePaper.vue

@@ -123,23 +123,6 @@
 				periodList: [],
 				gradeList: [],
 				subjectList: [],
-				ruleValidate: {
-					name: [{
-						required: true,
-						message: '试卷名称不能为空!',
-						trigger: 'change'
-					}],
-					type: [{
-						required: true,
-						message: '测试类型不能为空!',
-						trigger: 'change'
-					}],
-					publish: [{
-						required: true,
-						message: '发布方式不能为空!',
-						trigger: 'change'
-					}]
-				},
 				deleteIndex: -1,
 				testSubjects: [],
 				activeTab: 'auto',
@@ -191,7 +174,7 @@
 			/* 返回试卷库 */
 			goBack() {
 				this.$router.push({
-					name: 'personalBank',
+					name: this.isSchool ? 'schoolBank' : 'personalBank',
 					params: {
 						tabName: 'paper'
 					}
@@ -199,7 +182,7 @@
 			},
 			
 			onTabChange(val){
-				console.log(val)
+				// console.log(val)
 			},
 
 			/* 返回顶部 */
@@ -288,10 +271,21 @@
 				data.questions.forEach(jsonData => {
 					jsonData.exercise.id = jsonData.id
 					jsonData.exercise.question = jsonData.item[0].question
+					jsonData.exercise.score = 0
 					jsonData.exercise.option = jsonData.item[0].option
 					arr.push(jsonData.exercise)
 				})
-                this.evaluationInfo.item = arr
+				// 如果是编辑试卷 则往原试卷添加不包含的新题目进入
+				if(this.isEditPaper){
+					let list = this.evaluationInfo.item
+					arr.forEach(i => {
+						if(list.map(j => j.id).indexOf(i.id) < 0){
+							list.push(i)
+						}
+					})
+				}else{
+					this.evaluationInfo.item = arr
+				}
             },
 
 			/** 预览试卷 */
@@ -349,7 +343,7 @@
 				let itemJsonFiles = []
 				let itemJsonUrls = []
 				//初始化Blob
-				let containerClient = new blobTool(sasData.url, sasData.name, sasData.sas)
+				let containerClient = new blobTool(sasData.url, sasData.name, sasData.sas,this.evaluationInfo.type)
 				return new Promise(async (resolve, j) => {
 					let promiseArr = []
 					for (let i = 0; i < list.length; i++) {
@@ -388,19 +382,26 @@
 								const cosmosItem = await this.$evTools.createCosmosItem(exerciseItem)
 								// 首先保存新题目的JSON文件到Blob 然后返回URL链接
 								let file = new File([JSON.stringify(itemJsonFile)], exerciseItem.id + ".json");
-								// 等待上传blob的返回结果
-								let blobFile = await containerClient.upload(file, 'item')
-								if (blobFile.blob) {
-									// 保存试题JSON文件到试卷文件夹需要
-									itemJsonFiles.push(file)
-									itemJsonUrls.push(exerciseItem.id + ".json")
-									// 保存到COSMOS是不含base64图片编码的数据 避免数据量过大
-									cosmosItem.blob = blobFile.blob
-									// 保存当前试题到数据库
-									that.saveExercise(cosmosItem).then(res => {
-										r(res)
-									})
+								try{
+									// 等待上传blob的返回结果
+									let blobFile = await containerClient.upload(file, 'item')
+									if (blobFile.blob) {
+										// 保存试题JSON文件到试卷文件夹需要
+										itemJsonFiles.push(file)
+										itemJsonUrls.push(exerciseItem.id + ".json")
+										// 保存到COSMOS是不含base64图片编码的数据 避免数据量过大
+										cosmosItem.blob = blobFile.blob
+										// 保存当前试题到数据库
+										that.saveExercise(cosmosItem).then(res => {
+											r(res)
+										})
+									}else{
+										j(500)
+									}
+								}catch(e){
+									this.$Message.error(e.spaceError)
 								}
+								
 							}))
 						}
 					}
@@ -409,6 +410,8 @@
 							urls:itemJsonUrls,
 							files:itemJsonFiles
 						})
+					}).catch(err => {
+						this.$Message.error('操作失败')
 					})
 				})
 			},
@@ -444,7 +447,7 @@
 					// 获取初始化Blob需要的数据
 					let sasData = this.isSchool ? await this.$tools.getSchoolSas() : await this.$tools.getPrivateSas()
 					//初始化Blob
-					let containerClient = new blobTool(sasData.url, sasData.name, sasData.sas)
+					let containerClient = new blobTool(sasData.url, sasData.name, sasData.sas, this.isSchool ? 'school' : 'private')
 					containerClient.exists('paper/' + paperName + '/index.json').then(
 					    (res) => {
 					        r(res)
@@ -528,7 +531,7 @@
 					// 获取初始化Blob需要的数据
 					let sasData = this.evaluationInfo.type === 'private' ? await this.$tools.getPrivateSas() : await this.$tools.getSchoolSas()
 					//初始化Blob
-					let containerClient = new blobTool(sasData.url, sasData.name, sasData.sas)
+					let containerClient = new blobTool(sasData.url, sasData.name, sasData.sas,this.evaluationInfo.type)
 						try {
 							let promiseArr = []
 							let blobFile = null
@@ -540,8 +543,14 @@
 								}))
 							}
 								promiseArr.push(new Promise(async (r,j) =>{
-									blobFile = await containerClient.upload(paperFile, 'paper/' + paperItem.name)
-									r(blobFile)
+									try{
+										blobFile = await containerClient.upload(paperFile, 'paper/' + paperItem.name)
+										r(blobFile)
+									}catch(e){
+										j(e)
+										this.$Message.error(e.spaceError)
+									}
+									
 								}))
 							// 进行试卷文件上传Blob
 							Promise.all(promiseArr).then(async result => {

+ 0 - 1
TEAMModelOS/ClientApp/src/view/learnactivity/CreateEvaluation.less

@@ -27,7 +27,6 @@
         }
 
         .btn-save {
-            color: rgb(107, 223, 195);
             float: right;
             cursor: pointer;
             margin-top: 6px;

+ 273 - 136
TEAMModelOS/ClientApp/src/view/learnactivity/CreateEvaluation.vue

@@ -14,19 +14,27 @@
                             <Input v-model="evaluationInfo.name" placeholder="评测名称" @on-change="handlePaperName"></Input>
                         </FormItem>
                         <FormItem label="评量模式" prop="evaType">
-                            <Select v-model="evaluationInfo.evaType" >
+                            <Select v-model="evaluationInfo.evaType">
                                 <Option v-for="(item,index) in evaType" :value="item.value" :key="index">{{ item.label }}</Option>
                             </Select>
                         </FormItem>
+                        <FormItem label="测试類別" prop="type">
+                            <Select v-model="evaluationInfo.type">
+                                <Option v-for="(item,index) in typeList" :value="item.value" :key="index">{{ item.label }}</Option>
+                            </Select>
+                        </FormItem>
                         <FormItem label="测试类型" prop="type">
                             <Select v-model="evaluationInfo.type">
                                 <Option v-for="(item,index) in typeList" :value="item.value" :key="index">{{ item.label }}</Option>
                             </Select>
                         </FormItem>
+
                         <FormItem label="施测对象">
-                            <Select v-model="evaluationInfo.target" multiple>
-                                <Option v-for="(item,index) in classroomList" :value="item.id" :key="index">{{ item.name }}</Option>
-                            </Select>
+                            <!--<Cascader :list="list" @onClick="handleClick"></Cascader>-->
+                            <!--<Select v-model="evaluationInfo.target" multiple>
+            <Option v-for="(item,index) in classroomList" :value="item.id" :key="index">{{ item.name }}</Option>
+        </Select>-->
+                            <MultiCascader ref="addMulti" v-bind="config" @son="changeSon" hasValue :firstOpen="open" v-model="formChange.scope" @on-change="setChangeScope"></MultiCascader>
                         </FormItem>
                         <FormItem label="发布方式" prop="publish">
                             <RadioGroup v-model="evaluationInfo.publish" style="color:white;">
@@ -48,44 +56,43 @@
             <div class="evaluation-question-wrap">
                 <div class="wrap-label" v-if="mode == 'school'">
                     <p>测试科目:</p>
-                    <span v-for="(item,index) in evaluationInfo.testPaper" :key="index" :class="index == currentSubjectIndex ? 'subject-item subject-item-active':'subject-item'" @click="selectSubject(index)">
-                        {{ jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo, item.periodCode).name}}
+                    <span v-for="(item,index) in evaluationInfo.paperInfo" :key="index" :class="index == currentSubjectIndex ? 'subject-item subject-item-active':'subject-item'" @click="selectSubject(index)">
+                        {{ jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo, item.periodId).name}}
                         <span style="margin:0px 5px;">·</span>
-                        {{jsFn.getSubjectName(jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo, item.periodCode), item.subjectCode)}}
+                        {{jsFn.getSubjectName(jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo, item.periodId), item.subjectId)}}
                         <Icon type="ios-close" size="18" class="delete-subject-btn" @click="deleteSubject(index)" />
                     </span>
                     <Icon @click="addSubject" type="md-add-circle" title="添加科目" color="white" class="add-subject-icon" size="20" />
                 </div>
 
                 <div class="evaluation-question-main">
-                    <EmptyData :top="0" style="padding-top:100px;" v-if="evaluationInfo.testPaper.length == 0" textContent="暂无科目,请添加科目"></EmptyData>
-                    <div class="create-type-wrap" v-if="evaluationInfo.testPaper.length > 0 || mode == 'class'" >
+                    <EmptyData :top="0" style="padding-top:100px;" v-if="evaluationInfo.paperInfo.length == 0" textContent="暂无科目,请添加科目"></EmptyData>
+                    <div class="create-type-wrap" v-if="evaluationInfo.paperInfo.length > 0 || mode == 'class'" >
                         <span>创建方式:</span>
-                        <RadioGroup v-model="evaluationInfo.testPaper[currentSubjectIndex].createType" style="margin-left:25px;" @on-change="setActiveTab">
+                        <RadioGroup v-model="evaluationInfo.paperInfo[currentSubjectIndex].createType" style="margin-left:25px;" @on-change="setActiveTab">
                             <!--<Radio label="auto">自动组题</Radio>-->
                             <Radio label="manualPaper">手动挑卷</Radio>
                             <!--<Radio label="manualQuestion">手动挑题</Radio>-->
                             <Radio label="import">试卷导入</Radio>
                         </RadioGroup>
                     </div>
-                    <Tabs v-model="activeTab" type="card" class="question-main-tabs" v-if="evaluationInfo.testPaper.length > 0 || mode == 'class' " name="createTest">
-                        <!--<TabPane label="组题条件" name="auto" v-if="evaluationInfo.testPaper[currentSubjectIndex].createType == 'auto'" :index="1" tab="createTest">
-                            <AutoCreate :subjectCode="evaluationInfo.testPaper[currentSubjectIndex].subjectCode" :periodCode="evaluationInfo.testPaper[currentSubjectIndex].periodCode" @goToPreview="goToPreview" @autoQuestions="getAutoQuestions"></AutoCreate>
+
+
+                    <Tabs v-model="activeTab" type="card" class="question-main-tabs" v-if="evaluationInfo.paperInfo.length > 0 || mode == 'class' " name="createTest">
+                        <!--<TabPane label="组题条件" name="auto" v-if="evaluationInfo.paperInfo[currentSubjectIndex].createType == 'auto'" :index="1" tab="createTest">
+                            <AutoCreate :subjectCode="evaluationInfo.paperInfo[currentSubjectIndex].subjectCode" :periodCode="evaluationInfo.paperInfo[currentSubjectIndex].periodCode" @goToPreview="goToPreview" @autoQuestions="getAutoQuestions"></AutoCreate>
                         </TabPane>-->
-                        <!--<TabPane label="备选题目" name="manualQuestion" v-if="evaluationInfo.testPaper[currentSubjectIndex].createType == 'manualQuestion'" :index="2" tab="createTest">
+                        <!--<TabPane label="备选题目" name="manualQuestion" v-if="evaluationInfo.paperInfo[currentSubjectIndex].createType == 'manualQuestion'" :index="2" tab="createTest">
                             <ManualCreate @goToPreview="goToPreview" @selectedQuestion="getSelectedQuestion"></ManualCreate>
                         </TabPane>-->
-                        <TabPane label="备选试卷" name="manualPaper" v-if="evaluationInfo.testPaper[currentSubjectIndex].createType == 'manualPaper'" :index="3" tab="createTest">
-                            <ManualPaper :periodCode="evaluationInfo.testPaper[currentSubjectIndex].periodCode" :subjectCode="evaluationInfo.testPaper[currentSubjectIndex].subjectCode" @selectPaper="selectPaper"></ManualPaper>
+                        <TabPane label="备选试卷" name="manualPaper" v-if="evaluationInfo.paperInfo[currentSubjectIndex].createType == 'manualPaper'" :index="3" tab="createTest">
+                            <ManualPaper :periodCode="evaluationInfo.paperInfo[currentSubjectIndex].periodCode" :subjectCode="evaluationInfo.paperInfo[currentSubjectIndex].subjectCode" @selectPaper="selectPaper"></ManualPaper>
                         </TabPane>
-                        <TabPane label="导入说明" name="import" v-if="evaluationInfo.testPaper[currentSubjectIndex].createType == 'import'" :index="4" tab="createTest">
+                        <TabPane label="导入说明" name="import" v-if="evaluationInfo.paperInfo[currentSubjectIndex].createType == 'import'" :index="4" tab="createTest">
                             <ImportCreate @importedQuestions="getImportQuestions" @goToPreview="goToPreview"></ImportCreate>
                         </TabPane>
                         <TabPane label="试题预览" name="preview" :index="5" tab="createTest">
-                            <TeacherPreview :testPaper="evaluationInfo.testPaper[currentSubjectIndex]" :examAnalysisStatus="examAnalysisStatus"></TeacherPreview>
-                            <!--<div class="back-to-top" title="返回顶部" v-show="showBack" @click="handleBackToTop">
-                                <Icon type="ios-arrow-up" />
-                            </div>-->
+                            <TeacherPreview :testPaper="evaluationInfo.paperInfo[currentSubjectIndex]" :examAnalysisStatus="examAnalysisStatus"></TeacherPreview>
                         </TabPane>
                         <TabPane label="学生作答体验" name="student" :index="6" tab="createTest">
                             <StudentPreview></StudentPreview>
@@ -95,25 +102,31 @@
                             {{examAnalysisStatus ? '试卷预览':'试卷分析'}}
                         </span>
                     </Tabs>
+
+
+
                 </div>
             </div>
         </div>
+
         <Modal v-model="addSubjectStatus"
                title="添加测试学科"
                class-name="dark-iview-modal"
                @on-ok="confirmAddSubject"
-               @on-cancel="cancelAddSubject">
+               >
+               <!--@on-cancel="cancelAddSubject"-->
             <div v-for="(item,index) in $store.state.schoolBaseInfo.schoolBaseInfo.period" :key="index" style="margin-top:10px;margin-bottom:30px;color:white;">
                 <div style="padding-bottom:6px;margin-bottom:6px;">
                     <span>{{item.name}}</span>
                 </div>
                 <CheckboxGroup v-model="testSubjects[index]">
-                    <Checkbox v-for="(subjectItem,i) in item.subjects" :key="i" :label="subjectItem.id" :disabled="checkIsDisabled(index,subjectItem.id)" @input="newAddSubject(index,i,subjectItem.id)">
+                    <Checkbox v-for="(subjectItem,indexs) in item.subjects" :key="indexs" :label="subjectItem.id" :disabled="checkIsDisabled(index,subjectItem.id)" @input="newAddSubject(index,indexs,subjectItem.id)">
                         <span>{{subjectItem.name}}</span>
                     </Checkbox>
                 </CheckboxGroup>
             </div>
         </Modal>
+
         <Modal v-model="goToManageStatus"
                title="管理评测"
                :mask-closable="false"
@@ -122,13 +135,13 @@
                @on-ok="confirmToManage">
             <p>评测保存成功,是否跳转到管理评测页面查看?</p>
         </Modal>
-        <Modal v-model="comfirmPreviewStatus"
+        <!--<Modal v-model="comfirmPreviewStatus"
                ok-text="是"
                cancel-text="否"
                :mask-closable="false"
                @on-ok="goToPreview">
             <p style="font-size:18px;padding-top:15px;">自动组题成功,是否跳转到试题预览界面预览题目?</p>
-        </Modal>
+        </Modal>-->
         <Modal v-model="confirmPaperStatus"
                title="挑选试卷"
                ok-text="是"
@@ -140,6 +153,7 @@
 </template>
 <script>
     import AutoCreate from './AutoCreate.vue'
+    import MultiCascader from './MultiCascader.vue'
     import ManualCreate from './ManualCreate.vue'
     import ManualPaper from './ManualPaper.vue'
     import ImportCreate from './ImportCreate.vue'
@@ -154,16 +168,19 @@
             TeacherPreview,
             StudentPreview,
             ImportCreate,
-            ManualPaper
+            ManualPaper,
+            MultiCascader
         },
         data() {
             return {
+                data3: [],
                 //isTeacher: true,  //判定当前教师是否分配学校
                 startTime: '',
                 endTime:'',
                 examAnalysisStatus: false,
                 confirmPaperStatus: false,
                 selectedPaper: {},
+                selectedPaperInfo: {},
                 jsFn,
                 isLoading: false,
                 comfirmPreviewStatus: false,
@@ -204,25 +221,22 @@
                     publish: '',
                     startTime: undefined,
                     endTime: undefined,
-                    testPaper: []
+                    paperInfo: [],
+                    papers: []
                 },
                 classroomList: [],
                 typeList: [
                     {
                         value: '1',
-                        label: '考'
+                        label: '正規考'
                     },
                     {
                         value: '2',
-                        label: '考'
+                        label: '模擬考'
                     },
                     {
                         value: '3',
-                        label: '平常考'
-                    },
-                    {
-                        value: '4',
-                        label: '其他'
+                        label: '普通考'
                     }
                 ],
                 evaType: [
@@ -245,17 +259,101 @@
                         label:'定时发布'
                     }
                 ],
-                mode:''
+                mode: '',
+
+
+                config: {
+                    clearable: true,
+                    multiple: true,
+                    data: [
+                        {
+                            value: 'beijing',
+                            label: '北京',
+                            children: [
+                                {
+                                    value: 'gugong',
+                                    label: '故宫'
+                                },
+                                {
+                                    value: 'tiantan',
+                                    label: '天坛'
+                                },
+                                {
+                                    value: 'wangfujing',
+                                    label: '王府井'
+                                }
+                            ]
+                        }, {
+                            value: 'jiangsu',
+                            label: '江苏',
+                            children: [
+                                {
+                                    value: 'nanjing',
+                                    label: '南京',
+                                    children: [
+                                        {
+                                            value: 'fuzimiao',
+                                            label: '夫子庙',
+                                        }
+                                    ]
+                                },
+                                {
+                                    value: 'suzhou',
+                                    label: '苏州',
+                                    children: [
+                                        {
+                                            value: 'zhuozhengyuan',
+                                            label: '拙政园',
+                                        },
+                                        {
+                                            value: 'shizilin',
+                                            label: '狮子林',
+                                        }
+                                    ]
+                                }
+                            ],
+                        }
+                    ],
+                    placeholder: '请选择施測對象',
+                    style: "width:100%"
+                },
+                formChange: {
+                    id: '',
+                    status: false,
+                    scope: [],
+                    end_date: ''
+                },
+                open: false
+
             }
         },
         methods: {
+            /**
+             * 多選組件配置信息
+             * */
+            setChangeScope(value) {
+                console.log(value)
+                let self = this;
+                let data = [];
+                if (value) {
+                    for (let i = 0; i < value.length; i++) {
+                        data.push(value[i].value)
+                    }
+                    self.formChange.scope = data
+                }
+            },
+            changeSon() {
+                this.open = false
+            },
+
+
             /**显示试卷分析 */
             showAnalysis() {
                 this.examAnalysisStatus = !this.examAnalysisStatus
             },
             /**修改评测名称时修改试卷名称 */
             handlePaperName() {
-                for (let item of this.evaluationInfo.testPaper) {
+                for (let item of this.evaluationInfo.paperInfo) {
                     item.name = this.evaluationInfo.name + '--' + item.subjectName
                 }
             },
@@ -277,16 +375,22 @@
              * 处理挑选试卷事件
              * @param data
              */
-            selectPaper(data) {
-                this.selectedPaper = data
+            selectPaper(data,info) {
+                console.log('返回試卷')
+                console.log(data)
+                console.log(info)
+                this.selectedPaper = info
+                this.selectedPaperInfo = data
+                console.log(this.selectedPaperInfo)
                 this.confirmPaperStatus = true
             },
             comfirmSelectPaper() {
-                //this.evaluationInfo.testPaper[this.currentSubjectIndex].item = [...this.selectedPaper.item]
-                //this.evaluationInfo.testPaper[this.currentSubjectIndex].markConfig = this.selectedPaper.markConfig
-                this.evaluationInfo.testPaper[this.currentSubjectIndex] = JSON.parse(JSON.stringify(this.selectedPaper))
-                this.evaluationInfo.testPaper[this.currentSubjectIndex].id = undefined
-                console.log(this.evaluationInfo.testPaper)
+                //this.evaluationInfo.paperInfo[this.currentSubjectIndex].item = [...this.selectedPaper.item]
+                //this.evaluationInfo.paperInfo[this.currentSubjectIndex].markConfig = this.selectedPaper.markConfig
+                console.log(this.evaluationInfo.paperInfo)
+                this.evaluationInfo.paperInfo[this.currentSubjectIndex] = JSON.parse(JSON.stringify(this.selectedPaper))
+                this.evaluationInfo.papers[this.currentSubjectIndex] = JSON.parse(JSON.stringify(this.selectedPaperInfo))
+                this.evaluationInfo.paperInfo[this.currentSubjectIndex].id = undefined
                 this.goToPreview()
             },
            
@@ -306,51 +410,52 @@
              * 获取自动组题结果
              * @param questions
              */
-            getAutoQuestions(questions) {
-                if (this.evaluationInfo.testPaper[this.currentSubjectIndex].item != undefined) {
-                    this.evaluationInfo.testPaper[this.currentSubjectIndex].item = [...questions, ...this.evaluationInfo.testPaper[this.currentSubjectIndex].item]
-                } else {
-                    this.evaluationInfo.testPaper[this.currentSubjectIndex].item = [...questions]
-                }
-                //this.comfirmPreviewStatus = true//自动跳转到预览页面,无需手动确认
-                this.goToPreview()//自动跳转
-            },
+            //getAutoQuestions(questions) {
+            //    if (this.evaluationInfo.paperInfo[this.currentSubjectIndex].item != undefined) {
+            //        this.evaluationInfo.paperInfo[this.currentSubjectIndex].item = [...questions, ...this.evaluationInfo.paperInfo[this.currentSubjectIndex].item]
+            //    } else {
+            //        this.evaluationInfo.paperInfo[this.currentSubjectIndex].item = [...questions]
+            //    }
+            //    //this.comfirmPreviewStatus = true//自动跳转到预览页面,无需手动确认
+            //    this.goToPreview()//自动跳转
+            //},
             /**
              * 获取导入试卷题目
              * @param questions
              */
             getImportQuestions(questions) {
-                if (this.evaluationInfo.testPaper[this.currentSubjectIndex].item != undefined) {
-                    this.evaluationInfo.testPaper[this.currentSubjectIndex].item = [...questions, ...this.evaluationInfo.testPaper[this.currentSubjectIndex].item]
+                if (this.evaluationInfo.paperInfo[this.currentSubjectIndex].item != undefined) {
+                    this.evaluationInfo.paperInfo[this.currentSubjectIndex].item = [...questions, ...this.evaluationInfo.paperInfo[this.currentSubjectIndex].item]
                 } else {
-                    this.evaluationInfo.testPaper[this.currentSubjectIndex].item = [...questions]
+                    this.evaluationInfo.paperInfo[this.currentSubjectIndex].item = [...questions]
                 }
             },
             getSelectedQuestion(data) {
-                this.evaluationInfo.testPaper[this.currentSubjectIndex].item = []
-                this.evaluationInfo.testPaper[this.currentSubjectIndex].item = data.questions
+                this.evaluationInfo.paperInfo[this.currentSubjectIndex].item = []
+                this.evaluationInfo.paperInfo[this.currentSubjectIndex].item = data.questions
             },
             goToPreview() {
                 this.activeTab = 'preview'
+                this.evaluationInfo.paperInfo[this.currentSubjectIndex].createType = 'manualPaper'
             },
             deleteSubject(index) {
                 this.deleteIndex = index
                 this.$Modal.confirm({
                     title: '删除科目',
-                    content: '确认删除' + this.evaluationInfo.testPaper[index].periodName + '·' + this.evaluationInfo.testPaper[index].subjectName + '吗?',
+                    content: '确认删除' + this.evaluationInfo.paperInfo[index].periodName + '·' + this.evaluationInfo.paperInfo[index].subjectName + '吗?',
                     onOk: () => {
                         let periodIndex = -1
                         for (let i in this.$store.state.schoolBaseInfo.schoolBaseInfo.period) {
-                            if (this.$store.state.schoolBaseInfo.schoolBaseInfo.period[i].id == this.evaluationInfo.testPaper[index].periodCode) {
+                            if (this.$store.state.schoolBaseInfo.schoolBaseInfo.period[i].id == this.evaluationInfo.paperInfo[index].periodCode) {
                                 periodIndex = i
                             }
                         }
                         for (let i = 0; i < this.testSubjects[periodIndex].length; i++) {
-                            if (this.evaluationInfo.testPaper[index].subjectCode == this.testSubjects[periodIndex][i]) {
+                            if (this.evaluationInfo.paperInfo[index].subjectCode == this.testSubjects[periodIndex][i]) {
                                 this.testSubjects[periodIndex].splice(i, 1)
                             }
                         }
-                        this.evaluationInfo.testPaper.splice(this.deleteIndex, 1)
+                        this.evaluationInfo.paperInfo.splice(this.deleteIndex, 1)
                         this.currentSubjectIndex = 0
                         this.deleteIndex = -1
                         this.$Message.success('删除成功!')
@@ -360,25 +465,25 @@
                     },
                 })
             },
-            //newAddSubject(index, i, code) {
-            //    if (!this.checkIsDisabled(index, code)) {
-            //        let flag = true
-            //        for (let j = 0; j < this.newAddSubjects.length; j++) {
-            //            if (this.newAddSubjects[j].index == index && this.newAddSubjects[j].i == i) {
-            //                flag = false
-            //                this.newAddSubjects.splice(j, 1)
-            //                break
-            //            }
-            //        }
-            //        if (flag) {
-            //            this.newAddSubjects.push({
-            //                index, i
-            //            })
-            //        }
-            //    } else {
-            //        alert('disabled')
-            //    }
-            //},
+            newAddSubject(index, i, code) {
+                if (!this.checkIsDisabled(index, code)) {
+                    let flag = true
+                    for (let j = 0; j < this.newAddSubjects.length; j++) {
+                        if (this.newAddSubjects[j].index == index && this.newAddSubjects[j].i == i) {
+                            flag = false
+                            this.newAddSubjects.splice(j, 1)
+                            break
+                        }
+                    }
+                    if (flag) {
+                        this.newAddSubjects.push({
+                            index, code,i
+                        })
+                    }
+                } else {
+                    alert('disabled')
+                }
+            },
             checkIsDisabled(index, code) {
                 if (this.addSubjectBefore[index] !== undefined) {
                     return this.addSubjectBefore[index].indexOf(code) !== -1
@@ -393,8 +498,8 @@
                 this.activeTab = data
             },
             //getClassType() {
-            //    if (this.evaluationInfo.testPaper.length == 0) {
-            //        this.evaluationInfo.testPaper.push({
+            //    if (this.evaluationInfo.paperInfo.length == 0) {
+            //        this.evaluationInfo.paperInfo.push({
             //            periodName: '默认学段',
             //            periodCode: '80650390',
             //            subjectName: '默认学科',
@@ -408,30 +513,54 @@
             //        this.newAddSubjects.length = 0
             //        this.addSubjectBefore.length = 0
             //    } else {
-            //        this.evaluationInfo.testPaper.length = 0
+            //        this.evaluationInfo.paperInfo.length = 0
             //    }
             //},
-            //confirmAddSubject() {
-            //        for (let item of this.newAddSubjects) {
-            //            this.evaluationInfo.testPaper.push({
-            //                periodName: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].name,
-            //                periodCode: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].id,
-            //                subjectName: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].subjects[item.i].name,
-            //                subjectCode: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].subjects[item.i].id,
-            //                createType: 'manualPaper',
-            //                score: 100,
-            //                item: [],
-            //                filter: {},
-            //                name: this.evaluationInfo.name + '--' + this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].subjects[item.i].name
-            //            })
-            //        }
-            //    this.newAddSubjects.length = 0
-            //    this.addSubjectBefore.length = 0
-            //},
-            //cancelAddSubject() {
-            //    [...this.testSubjects] = this.addSubjectBefore
-            //    this.addSubjectBefore.length = 0
-            //},
+            confirmAddSubject() {
+                let data = {
+                    pk: 'Exam',
+                    code: "Exam-" + this.$store.state.userInfo.schoolCode,
+                    school: this.$store.state.userInfo.schoolCode,
+                    id: this.$jsFn.uuid(),
+                    name: this.evaluationInfo.name,
+                    creatorId: this.$store.state.userInfo.TEAMModelId,
+                    type: "union",
+                    period: {},
+                    grades: [],
+                    subjects: [],
+                    examType: {},
+                    year: new Date().getFullYear(),
+                    range: this.mode,
+                    source: this.evaluationInfo.evaType,
+                    targetClasseIds: [],
+                    startTime: this.evaluationInfo.startTime,
+                    endTime: this.evaluationInfo.endTime,
+                    progress: 'going',
+                    scope: this.mode,
+                    create: Math.round(new Date() / 1000)
+
+
+
+                }
+                for (let item of this.newAddSubjects) {
+                    this.evaluationInfo.paperInfo.push({
+                        periodName: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].name,
+                        periodId: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].id,
+                        subjectName: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].subjects[item.i].name,
+                        subjectId: this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].subjects[item.i].id,
+                        createType: 'manualPaper',
+                        score: 100,
+                        item: [],
+                        filter: {},
+                        name: this.evaluationInfo.name + '--' + this.$store.state.schoolBaseInfo.schoolBaseInfo.period[item.index].subjects[item.i].name
+                    })
+                }
+                this.newAddSubjects.length = 0
+                this.addSubjectBefore.length = 0
+            },
+            cancelAddSubject() {
+                 this.addSubjectBefore = [...this.testSubjects]
+            },
             getSchoolBaseInfo() {
                 this.$store.dispatch('schoolBaseInfo/getSchoolBaseData').then(
                     (res) => {
@@ -443,6 +572,16 @@
                         this.$Message.error('API error!')
                     }
                 )
+                this.$store.dispatch('schoolBaseInfo/getClassroom').then(
+                    (res) => {
+                        if (res.code == 2) {
+                            alert('数据为空!')
+                        }
+                    },
+                    (err) => {
+                        this.$Message.error('API error!')
+                    }
+                )
             },
             /**
              * 查找教师课程下的班级
@@ -459,9 +598,6 @@
                         res => {
                             if (res.error == null) {
                                 this.classroomList = res.courses
-                                console.log(this.$store.state)
-                                //console.log(jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo, item.periodCode))
-                                console.log(this.classroomList)
                             } else {
                                 this.$Message.error('API ERROR!')
                             }
@@ -471,7 +607,7 @@
             },
             selectSubject(index) {
                 this.currentSubjectIndex = index
-                this.activeTab = this.evaluationInfo.testPaper[index].createType
+                this.activeTab = this.evaluationInfo.paperInfo[index].createType
             },
             checkData() {
                 let flag = true
@@ -504,11 +640,10 @@
                     res => {
                         if (res.error == null) {
                             this.examInfo = res.result.data
-                            for (let index in this.evaluationInfo.testPaper) {
-                                this.saveTestPaper(this.evaluationInfo.testPaper[index], index)
+                            for (let index in this.evaluationInfo.paperInfo) {
+                                this.saveTestPaper(this.evaluationInfo.paperInfo[index], index)
                             }
                             this.goToManageStatus = true
-
                         } else {
                             this.$Message.error('API ERROR!')
                         }
@@ -521,14 +656,14 @@
             },
             /**
              * 检查试卷数据完整性
-             * @param testPaper
+             * @param paperInfo
              */
-            checkPaper(testPaper) {
-                if (!testPaper.code) {
-                    testPaper.code = this.examInfo.id
+            checkPaper(paperInfo) {
+                if (!paperInfo.code) {
+                    paperInfo.code = this.examInfo.id
                 }
-                if (!testPaper.markConfig) {
-                    testPaper.markConfig = {
+                if (!paperInfo.markConfig) {
+                    paperInfo.markConfig = {
                         "auto": false,
                         "type": 0,
                         "score": 0
@@ -537,29 +672,29 @@
             },
             /**
              * 保存试卷
-             * @param testPaper
+             * @param paperInfo
              * @param index
              */
-            saveTestPaper(testPaper, index) {
+            saveTestPaper(paperInfo, index) {
 
                 if (this.examInfo.id == undefined) {
                     this.saveEvaluation()
                 } else {
                     //let requestData = {
-                    //    id: testPaper.id == undefined ? null : testPaper.id,
+                    //    id: paperInfo.id == undefined ? null : paperInfo.id,
                     //    code: this.examInfo.id,
                     //    schoolCode: this.$store.state.userInfo.schoolCode,
-                    //    subjectCode: testPaper.subjectCode,
-                    //    periodCode: testPaper.periodCode,
-                    //    item: testPaper.item,
-                    //    score: testPaper.score,
-                    //    name: testPaper.name
+                    //    subjectCode: paperInfo.subjectCode,
+                    //    periodCode: paperInfo.periodCode,
+                    //    item: paperInfo.item,
+                    //    score: paperInfo.score,
+                    //    name: paperInfo.name
                     //}
-                    this.checkPaper(testPaper)
-                    this.$api.learnActivity.SaveExamPaper(testPaper).then(
+                    this.checkPaper(paperInfo)
+                    this.$api.learnActivity.SaveExamPaper(paperInfo).then(
                         res => {
                             if (res.error == null) {
-                                this.evaluationInfo.testPaper[index].id = res.result.data.id
+                                this.evaluationInfo.paperInfo[index].id = res.result.data.id
                             } else {
                                 this.$Message.error('API ERROR!')
                             }
@@ -571,12 +706,14 @@
                 }
             },
             saveEvaluation() {
-                if (this.checkData()) {
-                    this.handleData()
+                console.log('最後數據')
+                console.log(this.evaluationInfo)
+                //if (this.checkData()) {
+                //    this.handleData()
 
-                } else {
-                    this.$Message.error('请完善基础信息,再保存!')
-                }
+                //} else {
+                //    this.$Message.error('请完善基础信息,再保存!')
+                //}
             },
             addSubject() {
                 [...this.addSubjectBefore] = this.testSubjects
@@ -589,15 +726,15 @@
             if (routerData !== undefined) {
                 this.startTime = new Date(routerData.startTime)    
                 this.endTime = new Date(routerData.endTime)   
-                for (let i = 0; i < routerData.testPaper.length; i++) {
-                    routerData.testPaper[i].createType = 'manualPaper'
+                for (let i = 0; i < routerData.paperInfo.length; i++) {
+                    routerData.paperInfo[i].createType = 'manualPaper'
                 }
                 this.evaluationInfo = routerData
 
                 /**
                 处理无接口数据时返回为个人课程或校本课程
                 */  
-                if (routerData.testPaper.length > 1) {
+                if (routerData.paperInfo.length > 1) {
                     this.mode = 'school'
                 } else {
                     this.mode = 'class'

+ 6 - 6
TEAMModelOS/ClientApp/src/view/learnactivity/ExamPaperAnalysis.vue

@@ -338,22 +338,22 @@
             },
             getQuestionLabel(key) {
                 switch (key) {
-                    case 'Multiple':
+                    case 'multiple':
                         return '多选题'
                         break
-                    case 'Subjective':
+                    case 'subjective':
                         return '问答题'
                         break
-                    case 'Judge':
+                    case 'judge':
                         return '判断题'
                         break
-                    case 'Complete':
+                    case 'complete':
                         return '填空题'
                         break
-                    case 'Single':
+                    case 'single':
                         return '单选题'
                         break
-                    case 'Compose':
+                    case 'compose':
                         return '综合题'
                         break
                 }

+ 11 - 5
TEAMModelOS/ClientApp/src/view/learnactivity/ManualPaper.vue

@@ -33,9 +33,9 @@
                     </div>
                     <div class="paper-item-info">
                         <span class="info-item">适用学段:<span class="info-bold">{{$jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo.period,item.periodId).name}}</span></span>
-                        <span class="info-item">适用年级:<span class="info-bold">{{$jsFn.getPeriod($store.state.schoolBaseInfo.schoolBaseInfo.period[Number(item.periodId).gredes],item.gradeIds).name}}</span></span>
-                        <span class="info-item">题量:<span class="info-bold">{{ item.item ? item.item.length : 0 }}</span></span>
-                        <span class="info-item">难度系数:<span class="info-bold">0.6</span></span>
+                        <span class="info-item">适用科目:<span class="info-bold">{{item.subjectName}}</span></span>
+                        <span class="info-item">题量:<span class="info-bold">{{ item.scoring.length > 0 ? item.scoring.length : 0 }}</span></span>
+                        <span class="info-item">使用次數:<span class="info-bold">{{item.useCount}}</span></span>
                     </div>
                     <div class="paper-item-tools">
                         <span @click.stop="choosePaper(index)">选择试卷</span>
@@ -95,8 +95,14 @@
         methods: {
             /**挑选试卷 */
             async choosePaper(index) {
-                let data = await this.$evTools.getFullPaper(this.paperList[index]) 
-                this.$emit('selectPaper', data)
+                if (index !== undefined) {
+                    let data = this.paperList[index]
+                    let paperInfo = await this.$evTools.getFullPaper(this.paperList[index])
+                    this.$emit('selectPaper', data, paperInfo)
+                } else {
+                    this.$Message.warning('請重新選擇試卷!')
+                }
+
             },
             /**
              * 预览试卷

+ 322 - 0
TEAMModelOS/ClientApp/src/view/learnactivity/MultiCascader.vue

@@ -0,0 +1,322 @@
+
+<template>
+    <div :class="classes">
+        <div :class="selectionCls"
+             ref="reference">
+            <slot name="input">
+                <input type="hidden" :name="name" :value="model">
+                <Cascader :data="data"
+                          style="display: inline-block; width: 100%"
+                          v-model="cascader"
+                          change-on-select
+                          @on-visible-change="toggleMenu"
+                          @on-change="(value, selectedData) => handleChange(value, selectedData)" transfer>
+                    <span v-show="noSel && !filterable" :class="[prefixCls + '-placeholder']" style="display: inline">{{ placeholder }}</span>
+                    <div v-if="noSel" class="ivu-tag" style="background: none;"></div>
+                    <div class="ivu-tag" v-for="(item, index) in selData" :key="item.value" style="display: inline-block;background: #efefef">
+                        <span class="ivu-tag-text">{{ item.name }}</span>
+                        <span class="ivu-tag-text">{{ item.label }}</span>
+                        <Icon type="ios-close-empty" @click.native.stop="removeTag(index)"></Icon>
+                    </div>
+                </Cascader>
+                <Icon type="ios-close" :class="[prefixCls + '-arrow']" v-show="showCloseIcon" @click.native.stop="clearSelect"></Icon>
+                <Icon type="arrow-down-b" :class="[prefixCls + '-arrow']" v-if="!remote"></Icon>
+            </slot>
+        </div>
+    </div>
+</template>
+<script>
+  const prefixCls = 'ivu-select';
+  export default {
+    props: {
+      data: {
+        type    : Array,
+        default : ()=>[],
+      },
+      value: {
+        type: [String, Number, Array],
+        default: ''
+      },
+      valueField: {
+        type: String,
+        default: 'value',
+      },
+      label: {
+        type: [String, Number, Array],
+        default: ''
+      },
+      multiple: {
+        type: Boolean,
+        default: true
+      },
+      disabled: {
+        type: Boolean,
+        default: false
+      },
+      clearable: {
+        type: Boolean,
+        default: false
+      },
+      placeholder: {
+        type: String
+      },
+      filterable: {
+        type: Boolean,
+        default: false
+      },
+      filterMethod: {
+        type: Function
+      },
+      remote: {
+        type: Boolean,
+        default: false
+      },
+      remoteMethod: {
+        type: Function
+      },
+      loading: {
+        type: Boolean,
+        default: false
+      },
+      loadingText: {
+        type: String
+      },
+      //size: {
+      //  // validator (value) {
+      //  //     return oneOf(value, ['small', 'large', 'default']);
+      //  // }
+      //},
+      labelInValue: {
+        type: Boolean,
+        default: false
+      },
+      firstOpen: {
+        type: Boolean,
+        default: true
+      },
+      notFoundText: {
+        type: String
+      },
+      placement: {
+        // validator (value) {
+        //     return oneOf(value, ['top', 'bottom']);
+        // },
+        default: 'bottom'
+      },
+      transfer: {
+        type: Boolean,
+        default: false
+      },
+      hasValue: {
+        type: Boolean,
+        default: false
+      },
+      // Use for AutoComplete
+      autoComplete: {
+        type: Boolean,
+        default: false
+      },
+      name: {
+        type: String
+      },
+      elementId: {
+        type: String
+      },
+      renderFormat: {
+        type: Function,
+        default: (labels) => labels.join(' / ')
+      }
+    },
+    data () {
+      return {
+        cascader: [],
+        selData: [],
+        propData: [],
+        noSel: true,
+        addTag: true,
+//        firstOpen: true,
+        // 转换后的选项
+        prefixCls: prefixCls,
+        visible: false,
+        options: [],
+        optionInstances: [],
+        selectedSingle: '',    // label
+        // selectedMultiple: [],
+        focusIndex: 0,
+        query: '',
+        lastQuery: '',
+        selectToChangeQuery: false,    // when select an option, set this first and set query, because query is watching, it will emit event
+        inputLength: 20,
+        notFound: false,
+        slotChangeDuration: false,    // if slot change duration and in multiple, set true and after slot change, set false
+        model: this.value,
+        currentLabel: this.label
+      }
+    },
+    watch: {
+      value: function value(val) {
+        if (this.hasValue) {
+          if (this.firstOpen) {
+            this.setTag()
+            this.$emit('son',false);
+          }
+        }
+      }
+    },
+    computed: {
+      classes () {
+        return [
+          `${prefixCls}`,
+          {
+            [`${prefixCls}-visible`]: this.visible,
+            [`${prefixCls}-disabled`]: this.disabled,
+            [`${prefixCls}-multiple`]: this.multiple,
+            [`${prefixCls}-single`]: !this.multiple,
+            [`${prefixCls}-show-clear`]: this.showCloseIcon,
+            [`${prefixCls}-${this.size}`]: !!this.size
+          }
+        ];
+      },
+      selectionCls () {
+        return {
+          [`${prefixCls}-selection`]: !this.autoComplete
+        };
+      },
+      showCloseIcon () {
+        return this.multiple && this.clearable;
+//        return this.multiple && this.clearable && !this.noSel;
+      }
+    },
+    methods:{
+      dispatch(componentName, eventName, params) {
+        var parent = this.$parent || this.$root;
+        var name = parent.$options.name;
+        while (parent && (!name || name !== componentName)) {
+          parent = parent.$parent;
+          if (parent) {
+            name = parent.$options.name;
+          }
+        }
+        if (parent) {
+          parent.$emit.apply(parent, [eventName].concat(params));
+        }
+      },
+      setTag() {
+        let self = this;
+        let value = self.value;
+        let data = [];
+        if (value) {
+          for (let i = 0; i < value.length; i++) {
+            let ob = {value: value[i].id, label: value[i].name}
+            data.push(ob);
+          }
+        }
+        if (data.length > 0) {
+          self.noSel = false;
+        }
+        else self.noSel = true;
+        self.selData = data.concat()
+        self.propData = data.concat()
+        self.setValue(self.propData);
+      },
+      // 设置值
+      setValue(val) {
+        this.$nextTick(() => {
+          this.$emit('input', val);
+          this.$emit('on-change', val);
+          this.dispatch('FormItem', 'on-form-change', val);
+        });
+      },
+      clearSelect() {
+        let self = this;
+        self.selData =[]
+        self.propData =[]
+        self.noSel = true;
+        self.setValue([])
+      },
+      getValue() {
+        let self = this;
+        return self.selData
+      },
+      removeTag(index) {
+        let self = this;
+        self.selData.splice(index, 1);
+        self.propData.splice(index, 1);
+        self.setValue(self.propData)
+        if (self.selData.length == 0) {
+          self.noSel = true;
+        }
+      },
+      isInArray (arr,value){
+        for(var i = 0; i < arr.length; i++){
+          if(value.value == arr[i].value){
+            return true;
+          }
+        }
+        return false;
+      },
+      handleChange (value, selectedData) {
+        let self = this;
+        let val = selectedData[selectedData.length-1];
+        let _val = {value:val.value, label: val.label};
+        if (!self.isInArray(self.selData, val)) {
+          if (self.addTag) {
+            self.addTag = false;
+            self.noSel = false;
+            self.selData.push(val);
+            self.propData.push(_val);
+            self.setValue(self.propData);
+          }
+          else {
+            self.selData[self.selData.length-1] = val
+            self.propData[self.propData.length-1] = _val
+            self.setValue(self.propData);
+          }
+        }
+      },
+      toggleMenu (visible) {
+        let self = this;
+        if (this.disabled || this.autoComplete) {
+          return false;
+        }
+        // 关闭
+        if (!visible) {
+          self.addTag = true;
+          self.cascader = []
+        }
+        this.visible = !this.visible;
+      },
+    }
+  }
+</script>
+<style lang="less">
+    .MultiCascader {
+        width: 100%;
+        position: relative;
+    }
+
+    .placeholder {
+        color: #cccccc
+    }
+
+    .selection-container {
+        margin-bottom: 10px;
+        border: 1px solid #dddee1;
+        width: 100%;
+        border-radius: 4px;
+        min-height: 40px;
+        padding: 5px;
+        position: relative;
+        cursor: pointer;
+        background-color: white;
+        transition: border 0.2s ease-in-out, background 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
+    }
+
+    .selection {
+        display: flex;
+        align-items: center;
+        flex-wrap: wrap;
+        width: 100%;
+        padding-right: 5px;
+    }
+</style>

+ 3 - 4
TEAMModelOS/ClientApp/src/view/newcourse/ManageCourse.vue

@@ -374,7 +374,7 @@
                                     }
                                     this.keyWord = ''
                                     this.searchCourse()
-                                    
+                                    this.teacherId = []
                                 } else {
                                     this.$Message.error('API ERROR!')
                                 }
@@ -400,11 +400,10 @@
                     this.tableHeight = dom[0].offsetHeight - 20
                 }
             })
+            this.$store.dispatch('schoolBaseInfo/getClassroom').then(res => {
+            })
             this.$store.dispatch('teachers/getTeacherList').then(res => {
             })
-        },
-        mounted() {
-            
         }
     }
 </script>

+ 20 - 3
TEAMModelOS/ClientApp/src/view/newcourse/MyCourse.vue

@@ -591,12 +591,29 @@
             },
             //删除个人课程
             delCourse() {
-                let _this = this
                 this.$Modal.confirm({
                     title: '删除课程',
                     content: `确认删除${this.courseListP[this.curCusIndex].name}吗?`,
-                    onOk: function () {
-                        _this.$Message.warning('暂未对接API')
+                    onOk:()=> {
+                        this.$Message.warning('暂未对接API')
+                        this.$api.courseMgmt.deleteCourse({
+                            id: '',
+                            code: '',
+                            scope: ''
+                        }).then(
+                            res => {
+                                if (!res.error) {
+                                    let index = this.curCusIndex
+                                    this.courseListP.splice(index,1)
+                                    this.$Message.success('删除成功!')
+                                } else {
+                                    this.$Message.error('删除失败!')
+                                }
+                            },
+                            err => {
+                                this.$Message.error('删除失败!')
+                            }
+                        )
                     }
                 })
             },

+ 4 - 3
TEAMModelOS/ClientApp/src/view/newcourse/NewCoursePlan.vue

@@ -39,7 +39,7 @@
                 <Button style="float:right;margin-right:10px;margin-top:6px;" :loading="isLoading" :disabled="!updated" icon="ios-albums-outline" @click="saveCusPlan()">
                     {{$t('schoolBaseInfo.saveInfo')}}
                 </Button>
-                <Button style="float:right;margin-right:10px;margin-top:6px;" :disabled="0" @click="showImportCus" icon="md-arrow-round-up">导入安排</Button>
+                <Button style="float:right;margin-right:10px;margin-top:6px;" :disabled="true" @click="showImportCus" icon="md-arrow-round-up">导入安排</Button>
             </div>
             <div class="cus-table-content dark-iview-select">
                 <vuescroll>
@@ -98,7 +98,6 @@
     </div>
 </template>
 <script>
-
     import ImportExcel from '@/common/ImportExcel.vue'
     export default {
         components: {
@@ -297,6 +296,8 @@
                 this.importData.length = 0
             },
             selectClass(index) {
+                console.log('0.0.0.0')
+                console.log(this.classListShow[index])
                 if (!this.classListShow[index].cusSetting) {
                     this.findClassPlan(index)
                 }
@@ -344,7 +345,7 @@
             this.isLoading = true
             await this.getCourseList()
             await this.$store.dispatch('schoolBaseInfo/getClassroom').then(res => {
-                this.classList = this.$store.state.schoolBaseInfo.classroomList
+                this.classList = JSON.parse(JSON.stringify(this.$store.state.schoolBaseInfo.classroomList))
                 this.classListShow = [...this.classList]
                 this.findClassPlan(0)
                 this.schoolInfo = this.$store.state.schoolBaseInfo.schoolBaseInfo

+ 4 - 1
TEAMModelOS/ClientApp/src/view/schoolmgmt/SystemSetting/SystemSetting.vue

@@ -139,11 +139,14 @@
                                     <Icon type="md-create" class="action-btn-icon" @click.stop="editAnaStatus = !editAnaStatus" v-if="$access.ability('admin','schoolSetting-upd').validateAll" />
                                 </div>
                                 <div class="attr-box-item" style="margin-top:15px;">
+                                    <p>
+                                        <span>考试类型:</span>
+                                    </p>
                                     <div class="attr-content">
                                         <div class="tag-item item-active" @click.stop v-for="(item,index) in schoolSetting.period[curPriodIndex].analysis.type" :key="index">
                                             <!--<span class="tag-item-icon"></span>-->
                                             <Input v-model="item.name" :disabled="!editAnaStatus" placeholder="设置考试类型..." :style="{width: getWidth(index,item.name)+'px'}" />
-                                            <Icon type="md-close" @click="confirmDelAna(index,typeIndex)" v-show="delAnaStatus" />
+                                            <Icon type="md-close" @click="confirmDelAna(index)" v-show="delAnaStatus" />
                                         </div>
                                     </div>
                                 </div>

+ 5 - 2
TEAMModelOS/Controllers/School/CourseController.cs

@@ -265,7 +265,7 @@ namespace TEAMModelOS.Controllers
                     {
                         for (int j = 0; j < managements[i].courses.Count; j++)
                         {                      
-                            if (!managements[i].courses[j].course.id.Equals(request.ids[k].ToString()))
+                            if (managements[i].courses[j].course.id.Equals(request.ids[k].ToString()))
                             {
                                 managements[i].courses.Remove(managements[i].courses[j]);
                                 flag = true;
@@ -415,8 +415,11 @@ namespace TEAMModelOS.Controllers
                 var response = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(requert.id, new PartitionKey($"{requert.code}"));
                 if (response.Status == 200)
                 {
+/*                    using var json = await JsonDocument.ParseAsync(response.ContentStream);
+                    CourseManagement courseManagement = json.ToObject<CourseManagement>();
+                    courseManagement.courses = requert.courses;*/
                     //return Ok(new { error = ResponseCode.DATA_EXIST, V = "课程编码已经存在!" });
-                    course = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").UpsertItemAsync(requert, new PartitionKey($"{requert.code}"));
+                    course = await _azureCosmos.GetCosmosClient().GetContainer("TEAMModelOS", "School").ReplaceItemAsync(requert,requert.id, new PartitionKey($"{requert.code}"));
 
                 }
                 else

+ 1 - 1
TEAMModelOS/Controllers/Syllabus/ItemInfoController.cs

@@ -84,7 +84,7 @@ namespace TEAMModelOS.Controllers
                 var response = await client.GetContainer("TEAMModelOS", "School").ReadItemStreamAsync(itemInfo.id, new PartitionKey($"{itemInfo.code}"));
                 if (response.Status == 200)
                 {
-                    return Ok(new { error = ResponseCode.DATA_EXIST, V = "题目已经存在!" });
+                    return Ok();
                 }
                 else {
                     if (itemInfo.scope.Equals("private"))