瀏覽代碼

elDrawer size reset to 95%

hare8999@163.com 2 年之前
父節點
當前提交
1b24d3646a

+ 18 - 8
src/views/questioncenter/components/generate-tabs/paper-work-history-detail.vue

@@ -4,6 +4,9 @@
       <template #type="{display}">
         {{ translateType(display) }}
       </template>
+      <template #title="{row, display}">
+        {{ display }}({{ row.remark }})
+      </template>
       <template #doneTime="{row, display}">
         <span>{{ row.isDo ? row.doneTime : '' }}</span>
       </template>
@@ -11,7 +14,7 @@
         {{ row.isDo ? '已完成' : '未完成' }}
       </template>
       <template #rate="{row, display}">
-        {{ row.isDo ? display + '%' : '' }}
+        {{ row.isDo && display ? display + '%' : '' }}
       </template>
       <template #action="{row}">
         <el-button v-if="isPaperDone(row)" type="text" icon="el-icon-view"
@@ -31,19 +34,26 @@ import HomeworkPaper from '@/views/questioncenter/components/homework-paper'
 export default {
   name: 'paper-work-history-detail',
   components: { HomeworkPaper, DynamicTable },
-  props: ['workId'],
+  props: ['workId', 'type'],
   data() {
     return {
-      columns: [
+      rows: []
+    }
+  },
+  computed: {
+    useVideo() {
+      return !!consts.enum.homeworkTypes.find(t => t.value == this.type)?.useVideo
+    },
+    columns() {
+      return [
         { prop: 'id', label: 'ID', width: '80px', sortable: true },
         { prop: 'type', label: '类型', width: '120px', slotBody: 'type' },
-        { prop: 'title', label: '学生' },
+        { prop: 'title', label: '学生', slotBody: 'title' },
         { prop: 'doneTime', label: '完成时间', width: '180px', slotBody: 'doneTime' },
         { prop: 'isDo', label: '状态', width: '120px', slotBody: 'status', sortable: true },
-        { prop: 'scoreRate', label: '正确率', width: '90px', slotBody: 'rate', sortable: true },
-        { prop: 'action', label: '操作', width: '80px', slotBody: 'action' }
-      ],
-      rows: []
+        { prop: 'scoreRate', label: this.useVideo ? '观看比例' : '正确率', width: '100px', slotBody: 'rate', sortable: true },
+        { prop: 'action', label: '操作', width: '80px', slotBody: 'action', hidden: this.useVideo }
+      ]
     }
   },
   mounted() {

+ 6 - 3
src/views/questioncenter/components/generate-tabs/paper-work-history.vue

@@ -25,11 +25,12 @@
                 @pagination="getList"></pagination>
     <el-dialog v-if="detailOption.visible" :visible.sync="detailOption.visible" :title="detailOption.title"
                width="900px">
-      <paper-work-history-detail :work-id="detailOption.workId"
+      <paper-work-history-detail :work-id="detailOption.workId" :type="detailOption.type"
                                  @paperView="handlePaperView"></paper-work-history-detail>
     </el-dialog>
     <!--elDrawer不要内嵌在elDialog中,否则遮罩可能重迭-->
-    <el-drawer v-if="paperOption.visible" :visible.sync="paperOption.visible" :title="paperOption.title" size="100%">
+    <el-drawer v-if="paperOption.visible" :visible.sync="paperOption.visible" :title="paperOption.title"
+               :close-on-click-modal="false" size="95%">
       <div class="pl30 pr30 pb30">
         <homework-paper :params="paperOption.params"></homework-paper>
       </div>
@@ -68,7 +69,8 @@ export default {
       detailOption: {
         visible: false,
         title: '',
-        workId: ''
+        workId: '',
+        type: ''
       },
       paperOption: {
         visible: false,
@@ -104,6 +106,7 @@ export default {
     },
     handleViewDetail(row) {
       this.detailOption.workId = row.id
+      this.detailOption.type = row.type
       this.detailOption.title = row.title
       this.detailOption.visible = true
     },

+ 1 - 1
src/views/questioncenter/homework.vue

@@ -28,7 +28,7 @@
       </el-dialog>
       <!--elDrawer不要内嵌在elDialog中,否则遮罩可能重迭-->
       <el-drawer v-if="paperOption.visible" :visible.sync="paperOption.visible" :title="paperOption.title"
-                 :close-on-click-modal="false" size="100%" @close="handlePaperClose">
+                 :close-on-click-modal="false" size="95%" @close="handlePaperClose">
         <div class="pl30 pr30 pb30">
           <homework-paper :params="paperOption.params"></homework-paper>
         </div>