瀏覽代碼

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

zhouj1203@hotmail.com 4 年之前
父節點
當前提交
a996e25117

+ 1 - 1
TEAMModelOS/ClientApp/src/common/BaseLayout.less

@@ -38,7 +38,7 @@
         top: 70px;
         bottom: 0px;
         width: 100%;
-        padding-left: 225px;
+        padding-left: 191px;
         overflow-y: auto;
         background: var(--body-bg);
         transition: padding-left 0.4s;

+ 24 - 17
TEAMModelOS/ClientApp/src/common/BaseLayout.vue

@@ -11,7 +11,7 @@
             <slot name="header-content"></slot>
         </Header>
         <!-- 侧边菜单栏 -->
-        <Sider class="biz-menu" ref="side1" hide-trigger collapsible width="225" :collapsed-width="78" v-model="isCollapsed">
+        <Sider class="biz-menu" ref="side1" hide-trigger collapsible width="190" :collapsed-width="78" v-model="isCollapsed">
             <div class="collapse-icon-box" @click="changeMenuStatus">
                 <Icon :class="rotateIcon" custom="iconfont icon-arrow" style="color:var(--primary-text-color)" @click.stop="changeMenuStatus" size="12" />
             </div>
@@ -26,16 +26,16 @@
                                 <Submenu :name="item.subName" v-if="$access.ability(item.role,item.permission).validateAll && item.child.length" v-show="(index == 0 && $store.state.userInfo.hasSchool) || index > 0">
                                     <template slot="title">
                                         <Tooltip :content="item.name" placement="right" transfer v-show="isCollapsed">
-                                            <Icon :custom="item.icon" style="width:55px;text-align:left;" :class="isCollapsed ? 'collapse-icon-size':''" size="20" />
+                                            <Icon :custom="item.icon" style="width:55px;text-align:left;" :class="isCollapsed ? 'collapse-icon-size':''" size="16" />
                                         </Tooltip>
-                                        <Icon v-show="!isCollapsed" :custom="item.icon" :class="isCollapsed ? 'collapse-icon-size':''" size="20" />
+                                        <Icon v-show="!isCollapsed" :custom="item.icon" :class="isCollapsed ? 'collapse-icon-size':''" size="16" />
                                         <span>{{item.name}}</span>
                                     </template>
                                     <MenuItem class="sub-item-wrap sub-item-wrap-active" :name="menuItem.menuName" :to="menuItem.router" v-for="(menuItem,i) in item.child" :key="i" v-show="$access.ability(menuItem.role,menuItem.permission).validateAll">
                                     <Tooltip :content="menuItem.name" placement="right" transfer v-show="isCollapsed">
-                                        <Icon class="sub-menu-icon" :custom="menuItem.icon" size="18" />
+                                        <Icon class="sub-menu-icon" :custom="menuItem.icon" size="16" />
                                     </Tooltip>
-                                    <Icon v-show="!isCollapsed" class="sub-menu-icon" :custom="menuItem.icon" size="18" />
+                                    <Icon v-show="!isCollapsed" class="sub-menu-icon" :custom="menuItem.icon" size="16"/>
                                     <span>
                                         {{menuItem.name}}
                                         <span style="color: aqua;margin-left: 2px;font-size: 12px;vertical-align: text-top;">
@@ -46,9 +46,9 @@
                                 </Submenu>
                                 <MenuItem :name="item.menuName" v-else-if="$access.ability(item.role,item.permission).validateAll" :to="item.router">
                                 <Tooltip :content="item.name" placement="right" transfer v-show="isCollapsed">
-                                    <Icon :custom="item.icon" style="width:55px;text-align:left;" :class="isCollapsed ? 'collapse-icon-size':''" size="22" />
+                                    <Icon :custom="item.icon" style="width:55px;text-align:left;" :class="isCollapsed ? 'collapse-icon-size':''" size="16" />
                                 </Tooltip>
-                                <Icon v-show="!isCollapsed" :custom="item.icon" :class="isCollapsed ? 'collapse-icon-size':''" size="22" />
+                                <Icon v-show="!isCollapsed" :custom="item.icon" :class="isCollapsed ? 'collapse-icon-size':''" size="16" />
                                 <span>{{item.name}}</span>
                                 </MenuItem>
                             </div>
@@ -59,16 +59,16 @@
                             <Submenu :name="item.subName" v-if="$access.ability(item.role,item.permission).validateAll && item.child.length" v-show="(index == 0 && $store.state.userInfo.hasSchool) || index > 0">
                                 <template slot="title">
                                     <Tooltip :content="item.name" placement="right" transfer v-show="isCollapsed">
-                                        <Icon :custom="item.icon" style="width:55px;text-align:left;" :class="isCollapsed ? 'collapse-icon-size':''" size="20" />
+                                        <Icon :custom="item.icon" style="width:55px;text-align:left;" :class="isCollapsed ? 'collapse-icon-size':''" size="16" />
                                     </Tooltip>
-                                    <Icon v-show="!isCollapsed" :custom="item.icon" :class="isCollapsed ? 'collapse-icon-size':''" size="20" />
+                                    <Icon v-show="!isCollapsed" :custom="item.icon" :class="isCollapsed ? 'collapse-icon-size':''" size="16" />
                                     <span>{{item.name}}</span>
                                 </template>
                                 <MenuItem class="sub-item-wrap sub-item-wrap-active" :name="menuItem.menuName" :to="menuItem.router" v-for="(menuItem,i) in item.child" :key="i" v-show="$access.ability(menuItem.role,menuItem.permission).validateAll && menuItem.isShow">
                                 <Tooltip :content="menuItem.name" placement="right" transfer v-show="isCollapsed">
                                     <Icon class="sub-menu-icon" :custom="menuItem.icon" size="18" />
                                 </Tooltip>
-                                <Icon v-show="!isCollapsed" class="sub-menu-icon" :custom="menuItem.icon" size="18" />
+                                <Icon v-show="!isCollapsed" class="sub-menu-icon" :custom="menuItem.icon" size="16" />
                                 <span>
                                     {{menuItem.name}}
                                     <span style="color: aqua;margin-left: 2px;font-size: 12px;vertical-align: text-top;">
@@ -79,9 +79,9 @@
                             </Submenu>
                             <MenuItem :name="item.menuName" v-else-if="$access.ability(item.role,item.permission).validateAll && item.isShow" :to="item.router">
                             <Tooltip :content="item.name" placement="right" transfer v-show="isCollapsed">
-                                <Icon :custom="item.icon" style="width:55px;text-align:left;" :class="isCollapsed ? 'collapse-icon-size':''" size="22" />
+                                <Icon :custom="item.icon" style="width:55px;text-align:left;" :class="isCollapsed ? 'collapse-icon-size':''" size="16" />
                             </Tooltip>
-                            <Icon v-show="!isCollapsed" :custom="item.icon" :class="isCollapsed ? 'collapse-icon-size':''" size="22" />
+                            <Icon v-show="!isCollapsed" :custom="item.icon" :class="isCollapsed ? 'collapse-icon-size':''" size="16" />
                             <span>{{item.name}}</span>
                             </MenuItem>
                         </div>
@@ -598,7 +598,7 @@ export default {
 .menu-item i {
     transform: translateX(0px);
     transition: font-size 0.5s ease, transform 0.5s ease;
-    vertical-align: middle;
+    vertical-align: sub;
     font-size: 16px;
     /*color: var(--primary-text-color);*/
 }
@@ -607,11 +607,11 @@ export default {
     color: #cccccc;
 }
 .menu-item .ivu-menu-item {
-    color: white;
+    color: hsla(0,0%,100%,.7);
 }
 
 .menu-item .ivu-menu-submenu-title {
-    color: var(--primary-text-color);
+    color: hsla(0,0%,100%,.7);
 }
 
 .collapsed-menu i {
@@ -626,7 +626,7 @@ export default {
     top: -5px;
     font-size: 12px;
     opacity: 0.8;
-    color: #1cc0f3;
+    color: hsla(0,0%,100%,.7);
 }
 
 .collapsed-menu .ivu-icon-ios-arrow-down:before {
@@ -661,7 +661,7 @@ export default {
 
 .biz-menu .ivu-menu-vertical .ivu-menu-item,
 .biz-menu .ivu-menu-vertical .ivu-menu-submenu-title {
-    padding: 8px 24px;
+    padding: 10px 24px;
 }
 
 .biz-menu
@@ -675,4 +675,11 @@ export default {
     .ivu-menu-item-active:not(.ivu-menu-submenu):after {
     background: #1cc0f3;
 }
+
+// .ivu-menu-submenu-title:hover .ivu-menu-submenu-title-icon::before,.ivu-menu-submenu-title:hover span, .ivu-menu-submenu-title:hover .ivu-icon{
+//     color: #fff;
+// }
+.ivu-menu-submenu-title:hover .ivu-menu-submenu-title-icon::before{
+    color: rgb(45, 183, 245);
+}
 </style>

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

@@ -247,7 +247,19 @@ export const routes = [
 		{
 			path: 'ByStu',
 			name:'ByStu',
-			component: resolve => require(['@/view/task/mark/ByStu.vue'], resolve)
+			component: resolve => require(['@/view/task/mark/ByStu.vue'], resolve),
+			meta: {
+				activeName: 'taskList'
+			}
+		},
+		// 按题阅卷
+		{
+			path: 'ByQu',
+			name:'ByQu',
+			component: resolve => require(['@/view/task/mark/ByQu.vue'], resolve),
+			meta: {
+				activeName: 'taskList'
+			}
 		},
 		//校园基础数据管理
 		{

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

@@ -109,10 +109,10 @@
                     </span>
 
                     <!-- 阅卷功能0531之前完成不了,暂时隐藏 -->
-                    <!-- <span :class="curBarIndex == 2 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(2)">
+                    <span :class="curBarIndex == 2 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(2)">
                         {{$t('learnActivity.mgtScEv.markSetting')}}
                     </span>
-                    <span :class="curBarIndex == 3 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(3)">
+                    <!-- <span :class="curBarIndex == 3 ? 'evalustion-bar-item line-bottom-active line-bottom':'evalustion-bar-item line-bottom'" @click="selectBar(3)">
                         {{$t('learnActivity.mgtScEv.markData')}}
                     </span> -->
 

+ 1 - 3
TEAMModelOS/ClientApp/src/view/task/index.less

@@ -128,6 +128,7 @@
         color: @second-textColor;
     }
 }
+
 .qu-info-item{
     display: flex;
     width: 100%;
@@ -135,9 +136,6 @@
     align-items: center;
     padding: 20px 0px;
     border-bottom: 1px solid #424242;
-    &:last-child{
-        border: none;
-    }
     .qu-index{
         display: block;
         // width: 80px;

+ 173 - 115
TEAMModelOS/ClientApp/src/view/task/index.vue

@@ -38,7 +38,6 @@
                             {{$t('task.markMode1')}}
                         </span>
                     </div>
-                    <!-- 按题批阅 -->
                     <vuescroll class="mark-info-content">
                         <!-- 数据概览 -->
                         <!-- <div class="setting-block" v-show="curBarIndex == 0">
@@ -88,6 +87,7 @@
                                 {{`${$t('task.mLabel2')} ( ${marked.length} )`}}
                             </span>
                         </div>
+                        <!-- 已阅、未阅、进行中学生 -->
                         <div class="setting-block stu-name-wrap" v-show="curBarIndex == 1">
                             <div class="setting-content stu-name-content">
                                 <div class="stu-wrap">
@@ -96,13 +96,13 @@
                                             还剩
                                             <span class="no-mark-count">{{unmarked}}</span>
                                             人未阅,
-                                            <span class="continue-mark" @click="toMarkView(1)">继续阅卷</span>
+                                            <span class="continue-mark" @click="toByStuView()">继续阅卷</span>
                                         </p>
                                         <p class="no-mark-text" v-else-if="unmarked > 0">
                                             阅卷总量
                                             <span class="no-mark-count">{{unmarked}}</span>
                                             人,
-                                            <span class="continue-mark" @click="toMarkView(1)">开始阅卷</span>
+                                            <span class="continue-mark" @click="toByStuView()">开始阅卷</span>
                                         </p>
                                         <p class="no-mark-text" v-else>
                                             暂无未阅学生
@@ -110,10 +110,10 @@
 
                                     </div>
                                     <div class="stu-list-wrap" v-show="tabIndex == 1">
-                                        <span class="stu-name" v-for="(item,index) in marking" :key="index" @click="toMarkView(1,item.stuId)">{{item.stuId}}</span>
+                                        <span class="stu-name" v-for="(item,index) in marking" :key="index" @click="toByStuView(item.stuId)">{{item.stuId}}</span>
                                     </div>
                                     <div class="stu-list-wrap" v-show="tabIndex == 2">
-                                        <span class="stu-name" v-for="(item,index) in marked" :key="index" @click="toMarkView(1,item.stuId)">{{item.stuId}}</span>
+                                        <span class="stu-name" v-for="(item,index) in marked" :key="index" @click="toByStuView(item.stuId)">{{item.stuId}}</span>
                                     </div>
                                 </div>
                             </div>
@@ -126,68 +126,56 @@
                             </p>
                             <div class="setting-content" :style="{height: fullQuProg ? 'fit-content' : '300px'}">
                                 <vuescroll>
-                                    <div class="qu-info-item" v-for="(item,index) in quCount" :key="index">
-                                        <span class="qu-index" :style="{color:index < 3 ? '#606060' : '#fff'}">
-                                            {{index + 1}}
-                                        </span>
-                                        <div class="data-wrap" style="display:none">
-                                            <p>
-                                                <!-- 标准差 -->
-                                                <span class="data-item">
-                                                    <Icon custom="iconfont icon-formula" class="data-item-icon" size="16" title="标准差" />
-                                                    <span class="data-item-value" title="我的">
-                                                        5
-                                                    </span>
-                                                    <span class="total-value" title="集体">
-                                                        (8)
-                                                    </span>
+                                    <div v-for="(item,index) in fullPaper.item" :key="index">
+                                        <!-- 综合题 -->
+                                        <div v-if="item.children.length">
+                                            <div class="qu-info-item" v-for="(childItem,childIndex) in item.children" :key="childIndex">
+                                                <span class="qu-index" :style="{color:index < 3 ? '#606060' : '#fff'}">
+                                                    {{`${index + 1}-${childIndex + 1}`}}
                                                 </span>
-                                                <!-- 平均分 -->
-                                                <span class="data-item">
-                                                    <Icon custom="iconfont icon-avg" class="data-item-icon" size="16" title="平均分" />
-                                                    <span class="data-item-value" title="我的">
-                                                        5
-                                                    </span>
-                                                    <span class="total-value" title="集体">
-                                                        (5.5)
-                                                    </span>
-                                                </span>
-                                                <!-- 最高分 -->
-                                                <span class="data-item">
-                                                    <Icon custom="iconfont icon-highest" class="data-item-icon" size="16" title="最高分" />
-                                                    <span class="data-item-value" title="我的">
-                                                        10
-                                                    </span>
-                                                    <span class="total-value" title="集体">
-                                                        (9)
-                                                    </span>
-                                                </span>
-                                                <!-- 最低分 -->
-                                                <span class="data-item">
-                                                    <Icon custom="iconfont icon-lowest" class="data-item-icon" size="16" title="最低分" />
-                                                    <span class="data-item-value" title="我的">
-                                                        0
-                                                    </span>
-                                                    <span class="total-value" title="集体">
-                                                        (1)
-                                                    </span>
-                                                </span>
-                                            </p>
-                                        </div>
-                                        <div class="progress-wrap">
-                                            <Progress :percent="index < 3 ? 100 : 25" />
-                                            <p v-if="index < 3" class="prog-tips" style="color: #19be6b">
-                                                客观题已由系统自动完成评分。
-                                            </p>
-                                            <p v-else class="prog-tips">
-                                                <span>{{$t('task.mLabel2')}}:4</span>
-                                                <span>{{$t('task.mLabel3')}}:8</span>
-                                            </p>
+                                                <div class="progress-wrap">
+                                                    <Progress :percent="['single','multiple','judge'].includes(childItem.type) ? 100 : byQuPct[getScoreIndex(index,childIndex)]" />
+                                                    <!-- <Progress :percent="byQuPct[getScoreIndex(index,childIndex)]" /> -->
+                                                    <p v-if="['single','multiple','judge'].includes(childItem.type)" class="prog-tips" style="color: #19be6b">
+                                                        客观题已由系统自动完成评分。
+                                                    </p>
+                                                    <p v-else class="prog-tips">
+                                                        <span style="margin-right:10px">
+                                                            {{$t('task.mLabel2')}}:{{byQuCount[getScoreIndex(index,childIndex)]}}
+                                                        </span>
+                                                        <span>
+                                                            {{$t('task.mLabel3')}}:{{markList[curTaskIndex].count - byQuCount[getScoreIndex(index,childIndex)]}}
+                                                        </span>
+                                                    </p>
+                                                </div>
+                                                <div class="to-mark">
+                                                    <Button type="primary" shape="circle" :disabled="['single','multiple','judge'].includes(childItem.type)" size="small" style="width:120px" @click="toByQuView(index, childIndex)">
+                                                        {{$t('task.mark')}}
+                                                    </Button>
+                                                </div>
+                                            </div>
                                         </div>
-                                        <div class="to-mark">
-                                            <Button type="primary" shape="circle" :disabled="index < 3" size="small" style="width:120px" @click="toMarkView(0)">
-                                                {{$t('task.mark')}}
-                                            </Button>
+                                        <!-- 其他题 -->
+                                        <div v-else class="qu-info-item">
+                                            <span class="qu-index" :style="{color:index < 3 ? '#606060' : '#fff'}">
+                                                {{index + 1}}
+                                            </span>
+                                            <div class="progress-wrap">
+                                                <Progress :percent="['single','multiple','judge'].includes(item.type) ? 100 : byQuPct[getScoreIndex(index)]" />
+                                                <!-- <Progress :percent="byQuPct[getScoreIndex(index)]" /> -->
+                                                <p v-if="['single','multiple','judge'].includes(item.type)" class="prog-tips" style="color: #19be6b">
+                                                    客观题已由系统自动完成评分。
+                                                </p>
+                                                <p v-else class="prog-tips">
+                                                    <span>{{$t('task.mLabel2')}}:4</span>
+                                                    <span>{{$t('task.mLabel3')}}:8</span>
+                                                </p>
+                                            </div>
+                                            <div class="to-mark">
+                                                <Button type="primary" shape="circle" :disabled="['single','multiple','judge'].includes(item.type)" size="small" style="width:120px" @click="toByQuView(index, -1)">
+                                                    {{$t('task.mark')}}
+                                                </Button>
+                                            </div>
                                         </div>
                                     </div>
                                 </vuescroll>
@@ -263,11 +251,6 @@ export default {
                     quNo: 5,
                     desc: '模糊,看不清楚',
                     status: '未处理'
-                }, {
-                    id: '001',
-                    quNo: 5,
-                    desc: '模糊,看不清楚',
-                    status: '未处理'
                 }
             ],
             columns2: [
@@ -303,13 +286,6 @@ export default {
                 }
             ],
             data2: [
-                {
-                    id: '001',
-                    quNo: 5,
-                    myScore: 5,
-                    otScore: 10,
-                    status: '未处理'
-                },
                 {
                     id: '001',
                     quNo: 5,
@@ -323,12 +299,29 @@ export default {
             curBarIndex: 1,
             markList: [],
             curTaskIndex: 0,
-            quCount: [],
             fullQuProg: false,
-            markData: undefined
+            markData: undefined,
+            fullPaper: {
+                item: []
+            }
         }
     },
     methods: {
+        /**
+         * index 题目index 必传
+         * childIndex 小题index 非必传 
+         */
+        getScoreIndex(index, childIndex) {
+            let realIndex = index
+            this.fullPaper.item.forEach((item, itemIndex) => {
+                if (itemIndex < index && item.children.length) {
+                    realIndex += item.children.length
+                } else if (itemIndex == index && item.children.length) {
+                    realIndex += childIndex
+                }
+            })
+            return realIndex
+        },
         rowClassName(row, index) {
             if (index % 2 == 0) {
                 return 'stripe-row'
@@ -337,43 +330,68 @@ export default {
             }
         },
         /**
-         * mode 0:按题 1:按人
-         * stuId 学生id
+         * 按人阅卷
          */
-        async toMarkView(mode, stuId) {
+        async toByStuView(stuId) {
             sessionStorage.setItem('markFrom', this.$route.name)
             let sas = this.$store.state.user.schoolProfile.blob_sas //目前只有校本评测安排阅卷任务
             let blobUrl = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri //目前只有校本评测安排阅卷任务
-            let stuInfo = this.markData.attr.find(item => {
-                return item.stuId == stuId
-            })
-            let answer, fullPaper, score
-            if (stuInfo) {
-                answer = await this.$tools.getFile(`${blobUrl}/exam/${stuInfo.info.ans}?${sas}`)
-                answer = answer ? JSON.parse(answer) : [] 
-                score = stuInfo.info.score
-                fullPaper = await this.$evTools.getFullPaper({
-                    blob: this.markData.paper
-                }, 'school')
 
-                console.log(answer)
+            let answer, score, sId
+            if (stuId) {
+                let stuInfo = this.markData.attr.find(item => {
+                    return item.stuId == stuId
+                })
+                answer = stuInfo.info.ans ? JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${stuInfo.info.ans}?${sas}`)) : []
+                score = stuInfo.info.score
+                sId = stuId
+            } else {
+                let resData = await this.getNextStu()
+                console.log('API返回了',resData)
+                answer = resData.ans.ans ? JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${resData.ans.ans}?${sas}`)) : []
+                score = resData.ans.score
+                sId = resData.stuId
             }
-
-            // this.getNextStu(stuId)
-
+            console.log('跳转了')
             this.$router.push({
                 name: 'ByStu',
                 params: {
-                    type: mode,
                     from: this.$route.name,
-                    task:this.markList[this.curTaskIndex],
-                    stuId:stuInfo.stuId,
+                    task: this.markList[this.curTaskIndex],
+                    stuId: sId,
+                    fullPaper: this.fullPaper,
                     answer,
-                    fullPaper,
                     score
                 }
             })
         },
+        /**
+        * 按题阅卷
+        * 
+        * quIndex 必传
+        * childIndex 非必传
+        */
+        async toByQuView(quIndex, childIndex) {
+            sessionStorage.setItem('markFrom', this.$route.name)
+            let sas = this.$store.state.user.schoolProfile.blob_sas //目前只有校本评测安排阅卷任务
+            let blobUrl = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri //目前只有校本评测安排阅卷任务
+            // 获取学生作答数据
+            this.markData.attr.forEach(async item => {
+                item.info.answer = item.info.ans ? JSON.parse(await this.$tools.getFile(`${blobUrl}/exam/${item.info.ans}?${sas}`)) : []
+            })
+            console.log(this.markData)
+            this.$router.push({
+                name: 'ByQu',
+                params: {
+                    from: this.$route.name,
+                    task: this.markList[this.curTaskIndex], //阅卷任务数据
+                    stusInfo: this.markData.attr, //已阅和进行中的学生数据
+                    paperData: this.fullPaper, //试卷数据
+                    quIndex,
+                    childIndex
+                }
+            })
+        },
         /**
          * 批阅下个学生
          * @param stuId 如果传了stuid则会获取对应学生的数据,否则随机获取一个学生
@@ -383,18 +401,19 @@ export default {
                 code: this.markList[this.curTaskIndex].ecode.replace('Exam-', ''),
                 id: this.markList[this.curTaskIndex].id,
                 subjectId: this.markList[this.curTaskIndex].subject,
+                count: this.markList[this.curTaskIndex].count,
                 tmdId: this.$store.state.userInfo.TEAMModelId,
-                stuId: 'hbcn070201'
+                stuId
             }
-            this.$api.mark.FindNextStu(requestData).then(
-                res => {
-                    console.log(res)
-                },
-                err => {
-                    console.log(err)
-                }
-            )
-
+            return this.$api.mark.FindNextStu(requestData)
+            // this.$api.mark.FindNextStu(requestData).then(
+            //     res => {
+            //         console.log(res)
+            //     },
+            //     err => {
+            //         console.log(err)
+            //     }
+            // )
         },
         /**获取type对应的label */
         getTypeLabel(code) {
@@ -444,17 +463,21 @@ export default {
                 tmdId: this.$store.state.userInfo.TEAMModelId
             }
             this.$api.mark.FindTeaData(requestData).then(
-                res => {
-                    console.log(res)
+                async res => {
                     if (!res.error) {
                         this.markData = res
+                        //获取试卷详细数据
+                        //获取试卷完整信息
+                        this.fullPaper = await this.$evTools.getFullPaper({
+                            blob: this.markData.paper
+                        }, 'school')
+                        console.log('试卷数据', this.fullPaper)
                     }
                 },
                 err => {
                     console.log(err)
                 }
             )
-
         },
         selectTask(index) {
             this.curTaskIndex = index
@@ -464,7 +487,6 @@ export default {
     },
     created() {
         this.findTask()
-        this.quCount = Array.from(new Array(13).keys())
         this.curBarIndex = sessionStorage.getItem('markMode') || 0
 
     },
@@ -499,7 +521,43 @@ export default {
                 return []
             }
         },
+        //试卷题目数量,包括小题
+        quLength() {
+            if (this.fullPaper && this.fullPaper.item) {
+                let count = 0
+                this.fullPaper.item.forEach(item => {
+                    if (item.children.length) {
+                        count += item.children.length
+                    } else {
+                        count++
+                    }
+                })
+                return count
+            }
+            return 0
+        },
+        //题目进度百分比
+        byQuPct() {
+            let total = this.markList[this.curTaskIndex] ? this.markList[this.curTaskIndex].count : 1
+            return this.byQuCount.map(item => {
+                return item * 100 / total
+            })
+        },
+        //题目进度count
+        byQuCount() {
+            let res = new Array(this.quLength).fill(0)
+            if (this.markData && this.markData.attr) {
+                for (let i = 0; i < this.quLength; i++) {
+                    this.markData.attr.forEach(item => {
+                        if (item.info.score[i] > -1) {
+                            res[i]++
+                        }
+                    })
+                }
 
+            }
+            return res
+        },
     }
 }
 </script>

+ 621 - 0
TEAMModelOS/ClientApp/src/view/task/mark/ByQu.vue

@@ -0,0 +1,621 @@
+<template>
+    <!-- 未做多语言 -->
+    <div class="mark-area">
+        <!-- 头部基础信息 -->
+        <div class="mark-header">
+            <span class="quit-marking-text">
+                <Icon type="ios-arrow-back" class="quit-marking-icon" title="退出阅卷" @click="quit" />
+            </span>
+            <span class="info-label">考试名称123:</span>
+            <span class="info-value">{{taskInfo.name}}</span>
+            <span class="info-label">阅卷方式:</span>
+            <span class="info-value">按题阅卷</span>
+            <span class="info-label">当前题号:</span>
+            <span class="info-value cur-qu-index" v-if="childIndex > -1">{{`${quIndex + 1}-${childIndex + 1}`}}</span>
+            <span class="info-value cur-qu-index" v-else>{{quIndex + 1}}</span>
+            <span class="info-label">学生id:</span>
+            <span class="info-value stu-id-info">{{stusInfo[stuIndex] ? stusInfo[stuIndex].stuId : ''}}</span>
+            <div class="btn-wrap">
+                <span class="action-btn" @click="toggleStatus = !toggleStatus">
+                    <Icon type="md-shuffle" class="action-btn-icon" />
+                    切换
+                </span>
+                <span class="action-btn">
+                    <Icon type="md-refresh" class="action-btn-icon" />
+                    回评
+                </span>
+                <span class="action-btn">
+                    <Icon custom="iconfont icon-exception" class="action-btn-icon" />
+                    异常申报
+                </span>
+            </div>
+        </div>
+        <div class="mark-main">
+            <!-- 工具条 -->
+            <div class="mark-tools-wrap">
+                <Icon custom="iconfont icon-move" class="tool-icon" title="移动" @click="mouseStatus = 'move'" />
+                <Icon custom="iconfont icon-text" class="tool-icon" title="文字批注" @click="mouseStatus = 'text'" />
+                <Icon custom="iconfont icon-mark" class="tool-icon" title="画笔" @click="mouseStatus = 'line'" />
+                <Icon custom="iconfont icon-arrow-mark" class="tool-icon" title="箭头" @click="mouseStatus = 'arrow'" />
+                <Icon custom="iconfont icon-oval" class="tool-icon" title="椭圆" @click="mouseStatus = 'oval'" />
+                <Icon custom="iconfont icon-rect" class="tool-icon" title="方框" @click="mouseStatus = 'rect'" />
+                <Poptip transfer placement="right">
+                    <Icon custom="iconfont icon-smile" class="tool-icon" title="图标" />
+                    <div slot="content" class="expression-box">
+                        <img v-for="(item,index) in imgs" :key="index" :src="item" alt="" class="expression-img" @click="drawImg(index)">
+                    </div>
+                </Poptip>
+                <Icon custom="iconfont icon-fresh" class="tool-icon" title="清除批注" @click="clear" />
+                <!-- <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>
+            </div>
+            <!-- 打分部分 -->
+            <div class="score-wrap">
+                <div class="quick-score-box score-input-box">
+                    <span>分数:</span>
+                    <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="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']">
+                        <span v-for="(item,index) in quScoreArr" :key="index" class="score-key" @click="setScore(index)">
+                            {{item}}
+                        </span>
+                    </div>
+                </div>
+                <Button type="success" class="submit-score" @click="submit()">提交分数</Button>
+                <div class="score-setting-wrap">
+                    <div class="score-setting-item">
+                        <span>提交分数自动切换题目</span>
+                        <i-switch v-model="autoQu" size="small" />
+                    </div>
+                    <div class="score-setting-item">
+                        <span>完成阅卷自动获取新学生</span>
+                        <i-switch v-model="autoStu" size="small" />
+                    </div>
+                </div>
+            </div>
+        </div>
+        <!-- 用来单独渲染学生作答数据,提高tocanvas 的效率 -->
+        <iframe id="markIframe1" :srcdoc="curAnswer" v-if="curAnswer"></iframe>
+        <Modal v-model="toggleStatus" title="切换学生">
+            进行中
+        </Modal>
+    </div>
+</template>
+<script>
+import html2canvas from 'html2canvas';
+import MarkCanvas from './MarkCanvas';
+export default {
+    name: 'ByStu',
+    components: {
+        MarkCanvas
+    },
+    data() {
+        return {
+            score: null,
+            mouseStatus: 'move',
+            drawImgData: '',
+            ansImg: '',
+            imgs: [],
+            autoQu: true,//自动切换下一题
+            autoStu: true,//自动获取下一学生
+            toggleStatus: false,
+            activeIcon: -1,
+            isShowNum: true,
+            quIndex: 0,
+            childIndex: -1,
+            paperData: {
+                item: []
+            },
+            taskInfo: {},
+            stusInfo: [],
+            stuIndex: 0
+        }
+    },
+    methods: {
+        drawImg(imgIndex) {
+        },
+        //清除所有批注
+        clear() {
+        },
+        /**将答案绘制到canvas上 */
+        ansToImg() {
+            let answerIframe = document.getElementById('markIframe1')
+            answerIframe.onload = () => {
+                answerIframe.style.width = '850px'
+                answerIframe.contentWindow.document.body.style.margin = '0px 20px'
+                answerIframe.contentWindow.document.body.style.padding = '10px'
+                answerIframe.contentWindow.document.body.style.minWidth = '600px'
+                answerIframe.contentWindow.document.body.style.minHeight = '240px'
+                answerIframe.contentWindow.document.body.style.height = 'fit-content'
+                answerIframe.contentWindow.document.body.style.width = 'fit-content'
+                let bodyWidth = answerIframe.contentWindow.document.body.clientWidth
+                answerIframe.style.width = (bodyWidth + 20) + 'px'
+                answerIframe.contentWindow.document.body.style.backgroundColor = '#f5f5f5'
+                html2canvas(answerIframe.contentWindow.document.body, {}).then((canvas) => {
+                    canvas.id = "canvas"
+                    // 将转出来的答案绘制到canvas上c
+                    this.ansImg = canvas.toDataURL()
+
+                })
+            }
+        },
+        //将图片(答案)绘制到canvas
+        imgToCanvas(img) {
+            console.log('将图片(答案)绘制到canvas', img)
+        },
+        /** 打分 */
+        setScore(score) {
+            this.score = score
+            let index = this.getScoreIndex(this.quIndex, this.childIndex)
+            this.stusInfo[this.stuIndex].info.score[index] = score
+        },
+        //提交分数
+        submit() {
+            if (this.score > -1 && this.score != null) {
+                let requstData = {
+                    id: this.taskInfo.id,
+                    stuId: this.stusInfo[this.stuIndex].stuId,
+                    subjectId: this.taskInfo.subject,
+                    tmdId: this.$store.state.userInfo.TEAMModelId,
+                    score: this.stusInfo[this.stuIndex].info.score,
+                    count: this.taskInfo.count,
+                    code: this.taskInfo.ecode.replace('Exam-', ''),
+                    mark: ''
+                }
+                this.$api.mark.saveScore(requstData).then(
+                    res => {
+                        this.$Message.success('保存成功')
+                        //按题阅卷自动加载下一人
+                        this.getDefStu()
+                    },
+                    err => {
+                        this.$Message.error('保存失败')
+                    }
+                )
+            } else {
+                this.$Message.warning('请先打分')
+            }
+        },
+        quit() {
+            // 返回页面
+            this.$router.push({
+                name: sessionStorage.getItem('markFrom')
+            })
+        },
+        /**
+         * index 题目index 必传
+         * childIndex 小题index 非必传 
+         */
+        getScoreIndex(index, childIndex) {
+            let realIndex = index
+            this.paperData.item.forEach((item, itemIndex) => {
+                if (itemIndex < index && item.children.length) {
+                    realIndex += item.children.length
+                } else if (itemIndex == index && item.children.length) {
+                    realIndex += childIndex
+                }
+            })
+            return realIndex
+        },
+        //获取批阅学生数据
+        getDefStu() {
+            this.score = 0
+            let scoreIndex = this.getScoreIndex(this.quIndex, this.childIndex)
+            let has = false //当前数据是否有当前题目没有评分的学生
+            for (let i = 0; i < this.stusInfo.length; i++) {
+                if (this.stusInfo[i].info.score[scoreIndex] == -1) {
+                    this.stuIndex = i
+                    this.score = null
+                    has = true
+                }
+            }
+            //当前数据没有未评,并且人数==阅卷任务量 —> 说明这道题目已阅完
+            if (!has && this.stusInfo.length == this.taskInfo.count) {
+                // 提示当前题目已阅完,切换题目
+                this.$Message.warning('当前题目已阅完,请切换题目')
+            } else if (!has && this.stusInfo.length < this.taskInfo.count) {
+                //当前学生数据已阅,需要继续随机获取学生进行阅卷
+                this.getNextStu()
+            }
+        },
+        /**
+         * 批阅下个学生
+         * @param stuId 如果传了stuid则会获取对应学生的数据,否则随机获取一个学生
+         */
+        getNextStu(stuId) {
+            let requestData = {
+                code: this.taskInfo.ecode.replace('Exam-', ''),
+                id: this.taskInfo.id,
+                subjectId: this.taskInfo.subject,
+                tmdId: this.$store.state.userInfo.TEAMModelId,
+                count: this.taskInfo.count,
+                stuId: stuId
+            }
+            this.$api.mark.FindNextStu(requestData).then(
+                async res => {
+                    console.log(res)
+                    let sas = this.$store.state.user.schoolProfile.blob_sas //目前只有校本评测安排阅卷任务
+                    let blobUrl = JSON.parse(decodeURIComponent(localStorage.school_profile, "utf-8")).blob_uri //目前只有校本评测安排阅卷任务
+                    this.stusInfo.push({
+                        stuId: res.stuId,
+                        info: {
+                            ans: res.ans.ans,
+                            answer: res.ans.ans ? await this.$tools.getFile(`${blobUrl}/exam/${res.ans.ans}?${sas}`) : [],
+                            score: res.ans.score
+                        }
+                    })
+                    this.stuIndex = this.stusInfo.length - 1
+                    this.score = res.ans.score[this.getScoreIndex(this.quIndex,this.childIndex)] == -1 ? null : res.ans.score[this.getScoreIndex(this.quIndex,this.childIndex)]
+                },
+                err => {
+                    console.log(err)
+                }
+            )
+        }
+    },
+    mounted() {
+        this.ansToImg()
+
+    },
+    created() {
+        let routeData = this.$route.params
+        this.paperData = routeData.paperData
+        this.stusInfo = routeData.stusInfo
+        this.taskInfo = routeData.task
+        this.quIndex = routeData.quIndex
+        this.childIndex = routeData.childIndex
+        console.log('路由数据', routeData)
+        //获取一个学生数据
+        this.getDefStu()
+
+        //默认表情包
+        for (let i = 0; i < 9; i++) {
+            this.imgs.push(require('@/assets/mark/' + i + '.jpg'))
+        }
+    },
+    computed: {
+        curAnswer() {
+            if (this.stusInfo && this.stusInfo[this.stuIndex]) {
+                if (this.stusInfo[this.stuIndex].ans) {
+                    return this.stusInfo[this.stuIndex].answer[this.getScoreIndex(this.quIndex, this.childIndex)]
+                } else {
+                    return this.stusInfo[this.stuIndex].stuId + '未作答'
+                }
+            } else {
+                return '学生信息异常'
+            }
+        },
+        /**当期题目分数数组 */
+        quScoreArr() {
+            let score = 0
+            if (this.paperData.item) {
+                if (this.childIndex > -1 && this.paperData.item[this.quIndex] && this.paperData.item[this.quIndex].children) {
+                    score = this.paperData.item[this.quIndex].children[this.childIndex].score
+                } else {
+                    score = this.paperData.item[this.quIndex].score
+                }
+            }
+            return Array.from(new Array(score + 1).keys())
+        },
+    }
+}
+</script>
+<style scoped lang="less">
+.score-setting-wrap {
+    margin-top: 50px;
+    padding: 0px 5px;
+}
+.score-setting-item {
+    margin-top: 15px;
+    display: flex;
+    justify-content: space-between;
+}
+.stu-id-info {
+    color: black;
+    font-size: 16px;
+}
+.score-info {
+    background: #19be6b;
+    color: white;
+    padding: 1px 5px;
+    border-radius: 4px;
+    text-align: center;
+    font-size: 16px;
+}
+.cur-qu-index {
+    background: #2db7f5;
+    color: white;
+    padding: 1px 5px;
+    border-radius: 4px;
+    text-align: center;
+    font-size: 16px;
+}
+#markIframe1 {
+    position: fixed;
+    top: 9990px;
+    width: 850px;
+    background: #f5f5f5;
+}
+.quit-marking-icon {
+    display: inline-block;
+    font-size: 18px;
+    width: 40px;
+    text-align: center;
+    cursor: pointer;
+    color: black;
+}
+.quit-marking-text {
+    margin-right: 15px;
+}
+.expression-box {
+    max-width: 300px;
+    display: flex;
+    flex-wrap: wrap;
+    max-height: 600px;
+}
+.expression-img {
+    width: 80px;
+    margin: 10px;
+    height: auto;
+}
+.container-box {
+    display: flex;
+    justify-content: center;
+    width: 100%;
+    padding: 10px;
+}
+#container {
+    max-width: 100%;
+}
+.qu-tips-box {
+    & :nth-child(1)::before {
+        background: #19be6b;
+    }
+    & :nth-child(2)::before {
+        background: #ff9900;
+    }
+    & :nth-child(3)::before {
+        background: #ed4014;
+    }
+    & :nth-child(4)::before {
+        background: #e1e1e1;
+    }
+}
+
+.qu-tips-tag {
+    display: inline-block;
+    margin-right: 15px;
+    color: #909090;
+    font-size: 12px;
+    &::before {
+        content: "";
+        width: 15px;
+        height: 10px;
+        display: inline-block;
+        border-radius: 3px;
+        vertical-align: baseline;
+    }
+}
+.qu-index {
+    width: 30px;
+    height: 22px;
+    border-radius: 5px;
+    display: inline-block;
+    border: 1px solid #e1e1e1;
+    line-height: 22px;
+    text-align: center;
+    margin-bottom: 5px;
+    margin-top: 5px;
+    margin-right: 5px;
+    cursor: pointer;
+    background: #f1f1f1;
+    &:hover {
+        background: white;
+    }
+}
+.right-qu {
+    color: #19be6b;
+    border-color: #19be6b;
+    background: white;
+}
+.err-qu {
+    color: #ed4014;
+    border-color: #ed4014;
+    background: white;
+}
+.half-qu {
+    color: #ff9900;
+    border-color: #ff9900;
+    background: white;
+}
+.submit-score {
+    width: 236px;
+    margin-left: 2px;
+}
+.score-key-box {
+    margin-top: 10px;
+    height: 120px;
+    transition: height 0.5s;
+    -webkit-transition: height 0.5s;
+    overflow: hidden;
+}
+.hind-key-box {
+    height: 0px;
+}
+.score-key {
+    display: inline-block;
+    width: 30px;
+    height: 30px;
+    border-radius: 50%;
+    border: 1px solid #e1e1e1;
+    line-height: 30px;
+    text-align: center;
+    margin-top: 5px;
+    margin-right: 5px;
+    cursor: pointer;
+    background: #f1f1f1;
+}
+.score-key-active {
+    background: white;
+    border-color: #1cc0f3;
+    color: #1cc0f3;
+}
+.score-input-box {
+    display: flex;
+    align-items: center;
+}
+.score-wrap > :nth-child(2) {
+    background: white;
+}
+.quick-score-box {
+    padding: 10px 15px;
+    border-bottom: 1px solid #e1e1e1;
+}
+
+.toggle-num-status {
+    float: right;
+    margin-right: 5px;
+    font-size: 18px;
+    cursor: pointer;
+    margin-top: 2px;
+    user-select: none;
+}
+.btn-wrap {
+    float: right;
+    // padding-right: 15px;
+}
+.action-btn {
+    margin-left: 30px;
+    cursor: pointer;
+}
+.action-btn-icon {
+    display: inline-block;
+    margin-right: 5px;
+}
+.tmd-logo {
+    width: 35px;
+    height: 35px;
+    margin: 5px 18px 5px 13px;
+    vertical-align: bottom;
+}
+.mark-area {
+    width: 100%;
+    height: 100%;
+    user-select: none;
+    // padding: 5px;
+}
+.mark-header {
+    height: 50px;
+    width: 100%;
+    border-bottom: 1px solid #e1e1e1;
+    background: #fafafa;
+    line-height: 50px;
+    text-align: left;
+    padding: 0px 18px 0px 0px;
+    box-shadow: 0px 2px 3px 0px rgba(100, 100, 100, 0.2);
+    position: relative;
+    z-index: 99;
+    .info-label {
+        color: #909090;
+    }
+    .info-value {
+        margin-right: 30px;
+    }
+}
+.mark-main {
+    display: flex;
+    flex-direction: row;
+    height: calc(100% - 50px);
+}
+.mark-tools-wrap {
+    position: relative;
+    box-shadow: 2px 0px 5px 0px rgba(100, 100, 100, 0.2);
+    z-index: 9;
+    flex: 0 0 40px;
+    height: 100%;
+    display: flex;
+    flex-direction: column;
+    border-right: 1px solid #e1e1e1;
+    background: #fafafa;
+}
+.mark-stage {
+    flex: 1;
+    overflow: hidden;
+    background: white;
+    text-align: center;
+    position: relative;
+    height: 100%;
+}
+.qu-index-box {
+    position: absolute;
+    bottom: 0px;
+    background: #fafafa;
+    width: 100%;
+    left: 0px;
+    height: fit-content;
+    text-align: left;
+    max-height: 180px;
+    padding: 10px 10px 20px 10px;
+    box-shadow: 0 -2px 20px -12px #595959;
+    p {
+        width: fit-content;
+    }
+}
+.score-wrap {
+    position: relative;
+    box-shadow: -2px 0px 5px 0px rgba(100, 100, 100, 0.2);
+    z-index: 9;
+    flex: 0 0 241px;
+    height: 100%;
+    border-left: 1px solid #e1e1e1;
+    background: #fafafa;
+}
+.tool-icon {
+    font-size: 20px;
+    cursor: pointer;
+    height: 40px;
+    line-height: 40px;
+    // border-bottom: 1px solid #e1e1e1;
+    width: 39px;
+    &:hover {
+        color: #1cc0f3;
+        box-shadow: 0 5px 10px -8px #1cc0f3;
+        background: white;
+        border-color: transparent;
+    }
+}
+.exception-icon:hover {
+    box-shadow: 0 5px 10px -8px #ed4014;
+}
+.tool-icon-active {
+    color: #1cc0f3;
+    box-shadow: 0 5px 10px -8px #1cc0f3;
+    background: white;
+    border-color: transparent;
+    &:last-child {
+        box-shadow: 0 5px 10px -8px #ed4014;
+    }
+}
+</style>
+<style>
+.mark-tools-wrap .ivu-poptip-title::after {
+    display: none;
+}
+.textarea:focus {
+    box-shadow: none;
+    overflow: hidden;
+    outline: none !important;
+    line-height: 1.5;
+}
+.score-input-box .ivu-input-number-input {
+    font-size: 18px;
+    color: red;
+    font-weight: 800;
+}
+</style>

+ 58 - 50
TEAMModelOS/ClientApp/src/view/task/mark/ByStu.vue

@@ -9,11 +9,11 @@
             <span class="info-label">考试名称:</span>
             <span class="info-value">{{taskInfo.name}}</span>
             <span class="info-label">阅卷方式:</span>
-            <span class="info-value">{{mode == 0 ? '按题阅卷' : '按人阅卷'}}</span>
+            <span class="info-value">按人阅卷</span>
             <span class="info-label">学生id:</span>
             <span class="info-value stu-id-info">{{stuId}}</span>
-            <span class="info-label" v-show="mode == 1">分数:</span>
-            <span class="info-value score-info" v-show="mode == 1">{{totalScore}}</span>
+            <span class="info-label">分数:</span>
+            <span class="info-value score-info">{{totalScore}}</span>
             <span class="info-label">当前题号:</span>
             <span class="info-value cur-qu-index" v-if="childIndex > -1">{{`${quIndex + 1}-${childIndex + 1}`}}</span>
             <span class="info-value cur-qu-index" v-else>{{quIndex + 1}}</span>
@@ -52,16 +52,16 @@
                 <Icon custom="iconfont icon-fresh" class="tool-icon" title="清除批注" @click="clear" />
                 <!-- <Icon :custom="isFull ? 'iconfont icon-cancel-full' : 'iconfont icon-full-screen'" class="tool-icon" :title="isFull ? '取消全屏' : '全屏'" @click="togglefull" /> -->
             </div>
-            <div class="mark-stage" :style="{paddingBottom: mode == 1 ? '120px' : '0px'}">
+            <div class="mark-stage">
                 <!-- canvas部分 -->
                 <!-- <vuescroll ref="canvasScroll">
                     <div class="container-box">
                         <div id="container" @mousemove="canvasMouseMove" @mousedown="canvasMouseDown" @mouseup="canvasMouseUp"></div>
                     </div>
                 </vuescroll> -->
-                <MarkCanvas mouseStatus="move" :bgImg="ansImg" :drawImgData="drawImgData"></MarkCanvas>
+                <MarkCanvas :mouseStatus="mouseStatus" :bgImg="ansImg" :drawImgData="drawImgData"></MarkCanvas>
                 <!-- 题号显示部分 -->
-                <div class="qu-index-box" v-show="mode == 1">
+                <div class="qu-index-box">
                     <div class="qu-tips-box">
                         <span class="qu-tips-tag">
                             已阅
@@ -90,7 +90,7 @@
             <div class="score-wrap">
                 <div class="quick-score-box score-input-box">
                     <span>分数:</span>
-                    <InputNumber style="flex:1" :max="10" :min="1" v-model="stuScore[getScoreIndex(quIndex,childIndex)]"></InputNumber>
+                    <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>
@@ -116,7 +116,7 @@
             </div>
         </div>
         <!-- 用来单独渲染学生作答数据,提高tocanvas 的效率 -->
-        <iframe id="markIframe" :srcdoc="curAnswer" v-if="curAnswer"></iframe>
+        <iframe id="markIframe" :srcdoc="curAnswer"></iframe>
         <Modal v-model="toggleStatus" title="切换学生">
             进行中
         </Modal>
@@ -124,9 +124,8 @@
 </template>
 
 <script>
-import Konva from 'konva'
 import html2canvas from 'html2canvas';
-import MarkCanvas from '@/view/learnactivity/markpaper/MarkCanvas';
+import MarkCanvas from './MarkCanvas';
 export default {
     name: 'ByStu',
     components: {
@@ -134,15 +133,16 @@ export default {
     },
     data() {
         return {
-            drawImgData:'',
-            ansImg:'',
-            imgs:[],
+            score: null,
+            mouseStatus: 'move',
+            drawImgData: '',
+            ansImg: '',
+            imgs: [],
             autoQu: true,//自动切换下一题
             autoStu: true,//自动获取下一学生
             toggleStatus: false,
             activeIcon: -1,
             isShowNum: true,
-            mode: '0',//阅卷模式 1:按人阅卷 0:按题阅卷
             quIndex: 0,
             childIndex: -1,
             stuData: {
@@ -155,6 +155,7 @@ export default {
             stuAnswer: [],
             stuScore: [],
             taskInfo: {},
+            markData: {},
             stuId: ''
         }
     },
@@ -199,10 +200,11 @@ export default {
         },
         //将图片(答案)绘制到canvas
         imgToCanvas(img) {
-            console.log('将图片(答案)绘制到canvas',img)
+            console.log('将图片(答案)绘制到canvas', img)
         },
         /** 打分 */
         setScore(score) {
+            this.score = score
             this.$set(this.stuScore, this.getScoreIndex(this.quIndex, this.childIndex), score)
         },
         toQu(index, childIndex) {
@@ -226,34 +228,31 @@ export default {
         },
         //提交分数
         submit() {
-            let requstData = {
-                id: this.taskInfo.id,
-                stuId: this.stuId,
-                subjectId: this.taskInfo.subject,
-                tmdId: this.$store.state.userInfo.TEAMModelId,
-                score: this.stuScore,
-                count: this.taskInfo.count,
-                code: this.taskInfo.ecode.replace('Exam-', ''),
-                mark: ''
-            }
-            this.$api.mark.saveScore(requstData).then(
-                res => {
-                    this.$Message.success('保存成功')
-                    // 按人阅卷自动跳转下一题
-                    if (this.mode == 1 && this.autoQu) {
+            if (this.score > -1 && this.score != null) {
+                let requstData = {
+                    id: this.taskInfo.id,
+                    stuId: this.stuId,
+                    subjectId: this.taskInfo.subject,
+                    tmdId: this.$store.state.userInfo.TEAMModelId,
+                    score: this.stuScore,
+                    count: this.taskInfo.count,
+                    code: this.taskInfo.ecode.replace('Exam-', ''),
+                    mark: ''
+                }
+                this.$api.mark.saveScore(requstData).then(
+                    res => {
+                        this.$Message.success('保存成功')
+                        // 按人阅卷自动跳转下一题
                         this.nextQuestion()
                         this.ansToImg()
+                    },
+                    err => {
+                        this.$Message.error('保存失败')
                     }
-                    //按题阅卷自动加载下一人
-                    else {
-
-                    }
-                },
-                err => {
-                    this.$Message.error('保存失败')
-                }
-            )
-
+                )
+            } else {
+                this.$Message.warning('请先打分')
+            }
         },
         nextQuestion() {
             // 当前不是最后一题
@@ -341,6 +340,7 @@ export default {
 
                 }
             }
+            this.score = this.stuScore[this.getScoreIndex(this.quIndex, this.childIndex)] == -1 ? null : this.stuScore[this.getScoreIndex(this.quIndex, this.childIndex)]
         },
 
         quit() {
@@ -362,10 +362,10 @@ export default {
     },
     created() {
         let routeData = this.$route.params
+        console.log('路由数据', routeData)
         this.paperData = routeData.fullPaper
         this.stuAnswer = routeData.answer
         this.stuScore = routeData.score
-        this.mode = routeData.type
         this.taskInfo = routeData.task
         this.stuId = routeData.stuId
         //初始化题目index
@@ -393,17 +393,20 @@ export default {
         },
         /**当前题目作答数据 */
         curAnswer() {
-            let index = this.getScoreIndex(this.quIndex, this.childIndex)
-            return this.stuAnswer[index]
-        },
-        totalScore() {
-            if (this.mode == 1) {
-                return this.stuScore.reduce((a, b) => {
-                    return a + b
-                }, 0)
+            if (this.stuAnswer.length) {
+                let index = this.getScoreIndex(this.quIndex, this.childIndex)
+                return this.stuAnswer[index]
             } else {
-                return 0
+                return this.stuId + '未作答'
             }
+
+        },
+        totalScore() {
+            return this.stuScore.reduce((a, b) => {
+                a = a == -1 ? 0 : a
+                b = b == -1 ? 0 : b
+                return a + b
+            }, 0)
         }
     }
 }
@@ -715,4 +718,9 @@ export default {
     outline: none !important;
     line-height: 1.5;
 }
+.score-input-box .ivu-input-number-input {
+    font-size: 18px;
+    color: red;
+    font-weight: 800;
+}
 </style>

+ 1 - 0
TEAMModelOS/ClientApp/src/view/learnactivity/markpaper/MarkCanvas.vue

@@ -550,6 +550,7 @@ export default {
         },
         //鼠标移动事件
         canvasMouseMove(e) {
+            console.log(this.mouseStatus)
             if (this.isMouseDown) {
                 let current = this.getCanvasPoint(e.clientX, e.clientY)
                 switch (this.mouseStatus) {