|
@@ -1,17 +1,191 @@
|
|
|
<template>
|
|
|
- <div></div>
|
|
|
+ <div class="task-view">
|
|
|
+ <div class="task-view-top">
|
|
|
+ <div class="back" @click="$router.push('/main')">
|
|
|
+ <svg-icon icon-class="back-black" class-name="back-black" />返回
|
|
|
+ </div>
|
|
|
+ <div class="csitem-name">
|
|
|
+ <svg-icon icon-class="class" class-name="class" />
|
|
|
+ <span class="class-item-name nowrap-ellipsis">{{ taskData.cs_item_name }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="title">
|
|
|
+ <div class="csitem-name">{{ taskData.cs_item_name }}</div>
|
|
|
+ <div class="title-button primary" @click="saveCSItem(cs_item_id)">
|
|
|
+ <svg-icon icon-class="preserve" /><span class="button-name">{{ isTeacher ? '保存' : '提交任务' }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="task-view-wrap">
|
|
|
+ <LeftSidebar :cur-task-type="curTaskType" :task-type="taskType" :change-task-type="changeTaskType" />
|
|
|
+ <main ref="center" class="task-view-main" :style="centerStyle">
|
|
|
+ <span class="zoom-display" :style="{ right: isTeacher ? '216px' : '20px' }">
|
|
|
+ <svg-icon icon-class="minus" class-name="zoom-display-minus" @click="changeScale(false)" />
|
|
|
+ <span>{{ (scale * 100).toFixed(0) }}%</span>
|
|
|
+ <svg-icon icon-class="add" class-name="zoom-display-add" @click="changeScale(true)" />
|
|
|
+ </span>
|
|
|
+ <div class="task-view-main-container" :style="{ transform: `scale(${scale})` }">
|
|
|
+ <TaskExplain v-if="curTaskType === TASK_EXPLAIN" />
|
|
|
+ <TeacherView v-else-if="isTeacher" />
|
|
|
+ <StudentView v-else />
|
|
|
+ </div>
|
|
|
+ </main>
|
|
|
+ <RightSidebar v-if="isTeacher" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ name: 'TaskView'
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
<script setup>
|
|
|
-import { useRoute } from 'vue-router/composables';
|
|
|
+import { ref } from 'vue';
|
|
|
+import store from '@/store';
|
|
|
+import { useTask } from './index';
|
|
|
+import { useTaskType, TASK_EXPLAIN } from './components/data/TaskType';
|
|
|
+import { useScale, useWheel, scale } from '@/views/teacher/create_course/step_table/create_task/components/utils/wheel';
|
|
|
+import { useMouseEvent } from '@/views/teacher/create_course/step_table/create_task/components/utils/mouseEvent';
|
|
|
+
|
|
|
+import StudentView from './components/student/index.vue';
|
|
|
+import TeacherView from './components/teacher/index.vue';
|
|
|
+import LeftSidebar from './components/layouts/LeftSidebar.vue';
|
|
|
+import RightSidebar from './components/layouts/RightSidebar.vue';
|
|
|
+import TaskExplain from './components/TaskExplain.vue';
|
|
|
+
|
|
|
+const isTeacher = store.getters.isTeacher;
|
|
|
+let center = ref();
|
|
|
|
|
|
-import { GetCSItemTaskList } from '@/api/course';
|
|
|
-import { isTeacher } from '@/common/data';
|
|
|
+let { taskData } = useTask();
|
|
|
+let { curTaskType, taskType, curTaskTypeObj, changeTaskType } = useTaskType();
|
|
|
|
|
|
-const route = useRoute();
|
|
|
-const id = route.params.id;
|
|
|
+const { centerStyle } = useMouseEvent(center);
|
|
|
|
|
|
-GetCSItemTaskList().then(() => {});
|
|
|
+useWheel(center);
|
|
|
+const { changeScale } = useScale();
|
|
|
</script>
|
|
|
|
|
|
-<style lang="scss" scoped></style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+$basic-background-color: #f7f7f7;
|
|
|
+
|
|
|
+.task-view {
|
|
|
+ height: 100%;
|
|
|
+
|
|
|
+ &-top {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ align-items: center;
|
|
|
+ height: 48px;
|
|
|
+ font-size: 14px;
|
|
|
+ background-color: #fff;
|
|
|
+ border-bottom: 1px solid $border-color;
|
|
|
+
|
|
|
+ .back {
|
|
|
+ width: 74px;
|
|
|
+ padding: 12px;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ .svg-icon.back-black {
|
|
|
+ margin-right: 6px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .csitem-name {
|
|
|
+ display: flex;
|
|
|
+ column-gap: 8px;
|
|
|
+ align-items: center;
|
|
|
+ min-width: 40px;
|
|
|
+ max-width: 144px;
|
|
|
+ padding: 12px;
|
|
|
+ line-height: 24px;
|
|
|
+ color: #000;
|
|
|
+ background-color: $basic-background-color;
|
|
|
+ border-right: 1px solid $border-color;
|
|
|
+ border-bottom: 1px solid $border-color;
|
|
|
+ border-bottom-width: 0;
|
|
|
+ border-left: 1px solid $border-color;
|
|
|
+ box-shadow: 0 1px $basic-background-color;
|
|
|
+
|
|
|
+ .svg-icon.class {
|
|
|
+ width: 20px;
|
|
|
+ height: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .title {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ height: 40px;
|
|
|
+ padding: 0 8px;
|
|
|
+ border-bottom: 1px solid $border-color;
|
|
|
+
|
|
|
+ .csitem-name {
|
|
|
+ flex: 1;
|
|
|
+ text-align: center;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-button {
|
|
|
+ display: flex;
|
|
|
+ column-gap: 6px;
|
|
|
+ align-items: center;
|
|
|
+ min-width: 69px;
|
|
|
+ height: 32px;
|
|
|
+ padding: 4px 8px;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ line-height: 1.5;
|
|
|
+ white-space: nowrap;
|
|
|
+ cursor: pointer;
|
|
|
+ background-color: #fff;
|
|
|
+ border: 1px solid $border-color;
|
|
|
+ border-radius: 4px;
|
|
|
+
|
|
|
+ &.primary {
|
|
|
+ color: #fff;
|
|
|
+ background-color: #5498ff;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &-wrap {
|
|
|
+ display: flex;
|
|
|
+ height: calc(100% - 88px);
|
|
|
+ background-color: #fff;
|
|
|
+
|
|
|
+ .task-view-main {
|
|
|
+ flex: 1;
|
|
|
+ overflow: auto;
|
|
|
+ background-color: v-bind('curTaskTypeObj.background_color');
|
|
|
+
|
|
|
+ &-container {
|
|
|
+ padding: 24px;
|
|
|
+ transform-origin: 0 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ .zoom-display {
|
|
|
+ position: fixed;
|
|
|
+ bottom: 16px;
|
|
|
+ padding: 8px;
|
|
|
+ line-height: 22px;
|
|
|
+ user-select: none;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 20px;
|
|
|
+
|
|
|
+ &-minus {
|
|
|
+ margin-right: 12px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+
|
|
|
+ &-add {
|
|
|
+ margin-left: 12px;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|