Browse Source

Merge branch 'develop5.0-tmd' of http://106.12.23.251:10000/TEAMMODEL/TEAMModelOS into develop5.0-tmd

OnePsycho 4 năm trước cách đây
mục cha
commit
ec31cbc597

+ 0 - 5
TEAMModelOS/ClientApp/src/view/learnactivity/markpaper/MarkSetting.vue

@@ -379,7 +379,6 @@ export default {
 
             // 通过验证,保存设置
             this.setting.code = this.$store.state.userInfo.schoolCode
-            console.log(this.setting)
             this.$api.mark.UpsertMarkSet(this.setting).then(
                 res => {
                     this.$Message.success('保存成功!')
@@ -394,7 +393,6 @@ export default {
             let subject = this.setting.subs.find(item => {
                 return this.subjects[this.curSubIndex].id == item.id
             })
-            console.log('点前学科', subject)
             if (subject) {
                 let ids = subject.markers.map(item => {
                     return item.id
@@ -418,7 +416,6 @@ export default {
 
                 })
             }
-            console.log(this.setting)
             this.cancel()
         },
         cancel() {
@@ -483,7 +480,6 @@ export default {
     watch: {
         'evInfo.id': {
             handler(n, o) {
-                console.log(this.evInfo)
                 if (this.evInfo.id) {
                     this.findSettingInfo()
                 } else {
@@ -495,7 +491,6 @@ export default {
         },
         isSetting: {
             handler(n, o) {
-                console.log('watch', n, o)
                 this.$emit('statusChange', this.isSetting)
             },
             immediate: true

+ 0 - 6
TEAMModelOS/ClientApp/src/view/student-account/Index.vue

@@ -547,12 +547,6 @@ export default {
                     align: 'center',
                     sortable: true
                 },
-                {
-                    key: 'stuId',
-                    title: '学号',
-                    align: 'center',
-                    sortable: true
-                },
                 {
                     key: 'year',
                     title: '学级',

+ 8 - 3
TEAMModelOS/ClientApp/src/view/task/index.vue

@@ -38,7 +38,7 @@
                             {{$t('task.markMode1')}}
                         </span>
                     </div>
-                    <vuescroll class="mark-info-content">
+                    <vuescroll class="mark-info-content" v-if="markList.length > 0">
                         <StuProg v-show="curBarIndex == 1" @getStuId="toByStuView" :stusData="markData ? markData.attr : []"  :total="markList[curTaskIndex] ? markList[curTaskIndex].count : 1"></StuProg>
                         <!-- 按题 批阅进度 -->
                         <div class="setting-block" v-show="curBarIndex == 0" style="margin-top:15px">
@@ -77,6 +77,7 @@
                             </div>
                         </div> -->
                     </vuescroll>
+                    <EmptyData textContent="暂无阅卷任务" :top="90" style="height:fit-content"></EmptyData>
                 </div>
             </Split>
         </div>
@@ -318,7 +319,10 @@ export default {
                 res => {
                     if (!res.error) {
                         this.markList = res.tasks
-                        this.curTaskIndex = sessionStorage.getItem('markIndex') || 0
+                        let ch = sessionStorage.getItem('markIndex')
+                        ch = ch || 0
+                        ch = ch > this.markList.length - 1 ? 0 : ch
+                        this.curTaskIndex = ch || 0
                         if (this.markList.length > 0) this.findTaskData()
                     } else {
                         this.$Message.error('API error!')
@@ -369,9 +373,10 @@ export default {
         //当前阅卷任务未阅数量
         unmarked() {
             if (this.markList.length > 0) {
+                console.log(this.curTaskIndex,this.markList)
                 let total = this.markList[this.curTaskIndex].count
                 let marked = this.markData ? this.markData.attr.length : 0
-                
+                return total - marked
             } else {
                 return 0
             }

+ 15 - 8
TEAMModelOS/ClientApp/src/view/task/mark/ByQu.vue

@@ -51,7 +51,7 @@
                 <!-- <Icon :custom="isFull ? 'iconfont icon-cancel-full' : 'iconfont icon-full-screen'" class="tool-icon" :title="isFull ? '取消全屏' : '全屏'" @click="togglefull" /> -->
             </div>
             <div class="mark-stage">
-                <MarkCanvas :mouseStatus="mouseStatus" :bgImg="ansImg" :drawImgData="drawImgData"></MarkCanvas>
+                <MarkCanvas :status="mouseStatus" :bgImg="ansImg" :drawImgData="drawImgData"></MarkCanvas>
             </div>
             <!-- 打分部分 -->
             <div class="score-wrap">
@@ -60,7 +60,7 @@
                     <InputNumber style="flex:1" :max="10" :min="1" v-model="score" @on-change="setScore"></InputNumber>
                 </div>
                 <div class="quick-score-box">
-                    <Button size="small" type="info" style="margin-right:8px" ghost @click="score = 10">满分</Button>
+                    <Button size="small" type="info" style="margin-right:8px" ghost @click="score = quScoreArr.length - 1">满分</Button>
                     <Button size="small" type="error" ghost @click="score = 0">零分</Button>
                     <Icon :type="isShowNum ? 'md-eye-off' : 'md-eye'" class="toggle-num-status" @click="isShowNum = !isShowNum" />
                     <div :class="['score-key-box', isShowNum ? '':'hind-key-box']">
@@ -114,7 +114,6 @@ export default {
             autoQu: true,//自动切换下一题
             autoStu: true,//自动获取下一学生
             toggleStatus: false,
-            activeIcon: -1,
             isShowNum: true,
             quIndex: 0,
             childIndex: -1,
@@ -134,9 +133,16 @@ export default {
             this.toggleStatus = false
         },
         drawImg(imgIndex) {
+            let curImg = new Image()
+            curImg.src = this.imgs[imgIndex]
+            curImg.onload = () => {
+                this.mouseStatus = 'img'
+                this.drawImgData = curImg
+            }
         },
         //清除所有批注
         clear() {
+
         },
         /**将答案绘制到canvas上 */
         ansToImg() {
@@ -310,11 +316,11 @@ export default {
     },
     computed: {
         //当前题目进度
-        curProg(){
-            let index = this.getScoreIndex(this.quIndex,this.childIndex)
+        curProg() {
+            let index = this.getScoreIndex(this.quIndex, this.childIndex)
             let marked = 0
-            this.stusInfo.forEach(item=>{
-                if(item.info.score[index] != -1){
+            this.stusInfo.forEach(item => {
+                if (item.info.score[index] != -1) {
                     marked++
                 }
             })
@@ -322,7 +328,8 @@ export default {
         },
         curAnswer() {
             if (this.stusInfo && this.stusInfo[this.stuIndex]) {
-                this.score = this.stusInfo[this.stuIndex].info.score[this.getScoreIndex(this.quIndex, this.childIndex)]
+                let s = this.stusInfo[this.stuIndex].info.score[this.getScoreIndex(this.quIndex, this.childIndex)]
+                this.score = s == -1 ? null : s
                 if (this.stusInfo[this.stuIndex].info.answer) {
                     return this.stusInfo[this.stuIndex].info.answer[this.getScoreIndex(this.quIndex, this.childIndex)]
                 } else {

+ 7 - 8
TEAMModelOS/ClientApp/src/view/task/mark/ByStu.vue

@@ -51,7 +51,7 @@
                 <!-- <Icon :custom="isFull ? 'iconfont icon-cancel-full' : 'iconfont icon-full-screen'" class="tool-icon" :title="isFull ? '取消全屏' : '全屏'" @click="togglefull" /> -->
             </div>
             <div class="mark-stage">
-                <MarkCanvas :mouseStatus="mouseStatus" :bgImg="ansImg" :drawImgData="drawImgData" style="padding-bottom:85px"></MarkCanvas>
+                <MarkCanvas :status="mouseStatus" :bgImg="ansImg" :drawImgData="drawImgData" style="padding-bottom:85px"></MarkCanvas>
                 <!-- 题号显示部分 -->
                 <div class="qu-index-box">
                     <div class="qu-tips-box">
@@ -156,13 +156,12 @@ export default {
     },
     methods: {
         drawImg(imgIndex) {
-            // this.activeIcon = imgIndex
-            // this.curImg = new Image()
-            // this.curImg.src = this.imgs[imgIndex]
-            // this.curImg.onload = () => {
-            //     this.mouseStatus = 'img'
-            //     this.startImg({ x: 100, y: 100 })
-            // }
+            let curImg = new Image()
+            curImg.src = this.imgs[imgIndex]
+            curImg.onload = () => {
+                this.mouseStatus = 'img'
+                this.drawImgData = curImg
+            }
         },
         //清除所有批注
         clear() {

+ 28 - 41
TEAMModelOS/ClientApp/src/view/task/mark/MarkCanvas.vue

@@ -16,7 +16,7 @@ export default {
     name: 'MarkCanvas',
     props: {
         // 当前鼠标操作类型
-        mouseStatus: {
+        status: {
             type: String,
             default: 'move',
             required: true
@@ -28,12 +28,13 @@ export default {
         },
         //canvas绘制图片的数据(eg:添加表情包)
         drawImgData: {
-            type: [String, Object],
+            // type: [String, Object],
             default: ''
         }
     },
     data() {
         return {
+            imgData:undefined,
             stage: undefined,
             orgLayer: undefined,
             markLayer: undefined,
@@ -49,7 +50,7 @@ export default {
                 x: 0,
                 y: 0
             },
-            // mouseStatus: 'move', //move:移动  rect:画矩形 resize:调整图形
+            mouseStatus: '', //move:移动  rect:画矩形 resize:调整图形
             resizeBefore: '',
             rect: undefined,
             oval: undefined,
@@ -67,18 +68,12 @@ export default {
             }
             return (S4() + S4() + '-' + S4() + '-' + S4() + '-' + S4() + '-' + S4() + S4() + S4())
         },
-        move(index) {
-            this.activeIcon = index
+        move() {
             this.mouseStatus = 'move'
         },
-        drawImg(imgIndex) {
-            // this.activeIcon = imgIndex
-            // this.curImg = new Image()
-            // this.curImg.src = this.imgs[imgIndex]
-            // this.curImg.onload = () => {
-            //     this.mouseStatus = 'img'
-            //     this.startImg({ x: 100, y: 100 })
-            // }
+        drawImg() {
+            this.mouseStatus = 'img'
+            this.startImg({ x: 100, y: 100 })
         },
         startImg(current) {
             let _this = this
@@ -86,7 +81,7 @@ export default {
                 id: this.uuid(),
                 draggable: false,
                 strokeScaleEnabled: false,
-                image: _this.curImg,
+                image: _this.imgData ,
                 width: 80,
                 height: 80,
                 x: current.x,
@@ -113,8 +108,7 @@ export default {
             this.stage.add(this.markLayer)
             this.img = null
         },
-        drawText(index) {
-            this.activeIcon = index
+        drawText() {
             this.mouseStatus = 'text'
         },
         startText(current) {
@@ -212,8 +206,7 @@ export default {
             this.markLayer.add(this.text)
             this.stage.add(this.markLayer)
         },
-        drawLine(index) {
-            this.activeIcon = index
+        drawLine() {
             this.mouseStatus = 'line'
         },
         startLine(current) {
@@ -250,8 +243,7 @@ export default {
             this.markLayer.add(this.line)
             this.stage.add(this.markLayer)
         },
-        drawArrow(index) {
-            this.activeIcon = index
+        drawArrow() {
             this.mouseStatus = 'arrow'
         },
         // 绘制箭头
@@ -294,8 +286,7 @@ export default {
             this.markLayer.add(this.arrow)
             this.stage.add(this.markLayer)
         },
-        drawOval(index) {
-            this.activeIcon = index
+        drawOval() {
             this.mouseStatus = 'oval'
         },
         startOval(current) {
@@ -346,18 +337,8 @@ export default {
             this.markLayer.add(this.oval)
             this.stage.add(this.markLayer)
         },
-        drawIcon(index) {
-            this.activeIcon = index
-        },
-        review(index) {
-            this.activeIcon = index
-        },
-        cancelFull(index) {
-            this.activeIcon = index
-        },
         //绘制矩形
-        drawRect(index) {
-            this.activeIcon = index
+        drawRect() {
             this.mouseStatus = 'rect'
         },
         startRect(current) {
@@ -444,11 +425,6 @@ export default {
                 this.myScale()
             }
         },
-        //还原比例
-        restore() {
-            this.scaleDefault = 1
-            this.myScale()
-        },
         myScale() {
             this.stage.children.forEach(item => {
                 item.scale({
@@ -582,8 +558,7 @@ export default {
         },
 
         //清除所有批注
-        clear(index) {
-            this.activeIcon = index
+        clear() {
             this.markLayer.removeChildren()
             this.stage.add(this.markLayer)
         }
@@ -640,7 +615,7 @@ export default {
         bgImg: {
             handler(n, o) {
                 this.$nextTick(() => {
-                    // this.restore()
+                    this.restore()
                     this.orgLayer.removeChildren()
                     this.markLayer.removeChildren()
                     let imageObj = new Image()
@@ -667,6 +642,18 @@ export default {
             },
             immediate: true,
             deep: true
+        },
+        drawImgData: {
+            handler(n, o) {
+                this.imgData = n
+                this.drawImg()
+            }
+        },
+        status:{
+            handler(n,o){
+                this.mouseStatus = n
+            },
+            immediate:true
         }
     }
 }

+ 0 - 1
TEAMModelOS/ClientApp/src/view/task/mark/ProgPie.vue

@@ -100,7 +100,6 @@ export default {
         count: {
             handler(n, o) {
                 this.count.forEach((item, index) => {
-                    console.log(item, index)
                     this.option.series[0].data[index].value = item
                 })
                 if (!this.techScoreGau) {

+ 2 - 2
TEAMModelOS/ClientApp/src/view/teachcontent/ResBelong.vue

@@ -10,7 +10,7 @@
                 <DropdownItem :name="item.id">{{ item.name }}</DropdownItem>
             </DropdownMenu>
             <DropdownMenu slot="list">
-                <DropdownItem name="public">{{$t('teachContent.publicRes')}}</DropdownItem>
+                <DropdownItem name="public">{{$t('teachContent.public')}}</DropdownItem>
             </DropdownMenu>
         </Dropdown>
     </div>
@@ -71,7 +71,7 @@ export default {
                 if (temp) {
                     name = temp.name
                 }else{
-                    name = this.$t('teachContent.publicRes')
+                    name = this.$t('teachContent.public')
                 }
             }
             return name

+ 9 - 3
TEAMModelOS/ClientApp/src/view/teachcontent/index.vue

@@ -84,7 +84,7 @@
                     <ResBelong class="pd-filter-wrap" v-show="routerScope == 'school'" @pd-change="(data)=>{filterPeriod = data}"></ResBelong>
                     <div class="content-filter-wrap">
                         <Input v-model="keyWord" search size="small" :placeholder="$t('teachContent.searchText')" class="key-word-search" @on-change="searchKeyWord" @on-search="searchKeyWord" />
-                        <CheckboxGroup v-model="extFilter"  @on-change="filterFileByExtension">
+                        <CheckboxGroup v-model="extFilter" @on-change="filterFileByExtension">
                             <Checkbox :label="item" v-for="(item ,index) in extensions" :key="index">
                                 <span>{{item}}</span>
                             </Checkbox>
@@ -186,7 +186,7 @@
                     {{$t('teachContent.notAudio')}}
                 </audio>
                 <img v-else-if="previewFile.type == 'image'" :src="previewFile.url" style="border-radius: 5px;max-height: 800px;max-width:870px;" />
-                <embed v-else-if="previewFile.extension == 'PDF'" :src="previewFile.url" width="870" height="720" />
+                <iframe v-else-if="previewFile.extension == 'PDF'" :src="'/web/viewer.html?file=' + escapeBlobUrl" width='870' height='700' frameborder='1'></iframe>
                 <iframe v-else :src="'https://view.officeapps.live.com/op/view.aspx?src=' + escapeBlobUrl" width='870' height='700' frameborder='1'></iframe>
             </div>
         </div>
@@ -837,16 +837,22 @@ export default {
                 xhr.send(formData);
             })
         },
+        /* 打开PDF文件进行预览 */
+        openPdf(url) {
+            window.open('/web/viewer.html?file=' + encodeURIComponent(url))
+        },
         openPreviewFile(index) {
             // if (this.fileListShow[index].extension == 'HTEX') {
             //     this.$Message.warning('暂未处理HTEX文件预览功能')
             //     return
             // }
             this.previewFile = this._.cloneDeep(this.fileListShow[index])
+            // PDF预览
             if (this.activeType == 'image' || this.activeType == 'video') {
                 this.previewFile.url = this.previewFile.url.replace('thum/', '')
             }
-            if (this.fileListShow[index].type == 'image' || this.fileListShow[index].type == 'video' || this.fileListShow[index].extension == 'pdf') {
+            if (this.fileListShow[index].extension == 'PDF') {
+                this.escapeBlobUrl = encodeURIComponent(this.previewFile.url)
             } else {
                 this.escapeBlobUrl = escape(this.previewFile.url)
             }