|
|
@@ -1,554 +1,25 @@
|
|
|
<template>
|
|
|
- <div class="task-template">
|
|
|
- <div>
|
|
|
- <span class="task-template-index">1</span>
|
|
|
- <span class="task-template-taskClassify-name">{{ getTaskClassifyName(curTaskClassifyType) }}</span>
|
|
|
- </div>
|
|
|
- <div class="task-template-content">
|
|
|
- <div>任务标题</div>
|
|
|
- <el-input placeholder="点击输入" />
|
|
|
- <div class="task-time">
|
|
|
- <div class="task-time-item">
|
|
|
- <span>开始时间</span>
|
|
|
- <el-date-picker
|
|
|
- v-model="value1"
|
|
|
- :style="{ width: '186px' }"
|
|
|
- size="small"
|
|
|
- type="datetime"
|
|
|
- placeholder="选择日期时间"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div class="task-time-item">
|
|
|
- <span>持续时长</span>
|
|
|
- <el-select v-model="duration" size="small" :style="{ width: '90px' }">
|
|
|
- <el-option v-for="{ name, value } in durationList" :key="value" :label="name" :value="value" />
|
|
|
- </el-select>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div>执教教师</div>
|
|
|
- <el-select v-model="selectTeacher" multiple>
|
|
|
- <el-option
|
|
|
- v-for="{ teacher_id, teacher_name } in teacherList"
|
|
|
- :key="teacher_id"
|
|
|
- :value="teacher_id"
|
|
|
- :label="teacher_name"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- <div>参加学生</div>
|
|
|
- <el-select v-model="selectStudent" multiple>
|
|
|
- <el-option
|
|
|
- v-for="{ student_id, student_name } in studentList"
|
|
|
- :key="student_id"
|
|
|
- :value="student_id"
|
|
|
- :label="student_name"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
- <div>任务说明</div>
|
|
|
- <RichText :height="209" :is-border="true" />
|
|
|
- <hr />
|
|
|
-
|
|
|
- <!-- 课件 -->
|
|
|
- <template v-if="taskClassify[1].type === curTaskClassifyType">
|
|
|
- <div class="courseware">
|
|
|
- <el-button size="small" class="courseware-select">选择课件</el-button>
|
|
|
- <span class="tip">仅支持选择已购买的教材</span>
|
|
|
- </div>
|
|
|
- <div class="courseware-list">
|
|
|
- <div class="courseware-list-title">
|
|
|
- <div class="file-name">文件名</div>
|
|
|
- <div class="operation">操作</div>
|
|
|
- </div>
|
|
|
- <ul v-if="value1 !== ''">
|
|
|
- <li class="courseware-list-item">
|
|
|
- <span class="file-name">发了发动机考虑到非了富家大室李逵负荆as抵抗力 </span>
|
|
|
- <span class="operation">删除</span>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- <div v-else class="courseware-list-none">点击上方“选择课件”</div>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <!-- 文件 -->
|
|
|
- <template v-if="taskClassify[2].type === curTaskClassifyType">
|
|
|
- <div class="file">
|
|
|
- <el-button size="small" class="file-select">上传文件</el-button>
|
|
|
- <span class="tip">支持批量上传,上传格式支持mp3; mp4; jpg; png文件</span>
|
|
|
- </div>
|
|
|
- <div class="file-list">
|
|
|
- <div class="file-list-title">
|
|
|
- <div class="file-name">文件名</div>
|
|
|
- <div class="file-size">大小</div>
|
|
|
- <div class="file-status">状态</div>
|
|
|
- <div class="file-operation">操作</div>
|
|
|
- </div>
|
|
|
- <ul v-if="value1 !== ''">
|
|
|
- <li class="file-list-item">
|
|
|
- <span class="file-name">1</span>
|
|
|
- <span class="file-size">2</span>
|
|
|
- <span class="file-status">3</span>
|
|
|
- <span class="file-operation">4</span>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- <div v-else class="file-list-none">点击上方“上传文件”或将文件拖拽到此区域</div>
|
|
|
- </div>
|
|
|
- <div class="file-upload">
|
|
|
- <el-button size="small" class="cancel">取消</el-button>
|
|
|
- <el-button size="small" class="start-upload">开始上传</el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- <!-- 录音/录影 -->
|
|
|
- <div v-if="taskClassify[3].type === curTaskClassifyType">
|
|
|
- <template v-if="curRecord === audioAndVideo[0].type">
|
|
|
- <div class="sound-recording"></div>
|
|
|
- <el-input type="textarea" class="sound-input" resize="none" placeholder="输入" />
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <div class="video-recording"></div>
|
|
|
- </template>
|
|
|
- <div class="recording-operation">
|
|
|
- <div class="switch">
|
|
|
- <span
|
|
|
- v-for="{ type, name } in audioAndVideo"
|
|
|
- :key="type"
|
|
|
- :class="[type === curRecord ? 'active' : '']"
|
|
|
- @click="selectRecord(type)"
|
|
|
- >
|
|
|
- {{ name }}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <template v-for="{ icon, buttonName, type } in audioAndVideo">
|
|
|
- <div
|
|
|
- v-if="curRecord === type"
|
|
|
- :key="icon"
|
|
|
- :class="['press-sound', icon]"
|
|
|
- @mousedown="startRecording"
|
|
|
- @mouseup="stopAudio"
|
|
|
- >
|
|
|
- <svg-icon :icon-class="icon" class-name="button-icon" />{{ buttonName }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <!-- 直播 -->
|
|
|
- <template v-if="taskClassify[4].type === curTaskClassifyType">
|
|
|
- <div class="courseware">
|
|
|
- <el-button size="small" class="courseware-select">选择课件</el-button>
|
|
|
- <span class="tip">仅支持选择已购买的教材</span>
|
|
|
- </div>
|
|
|
- <div class="courseware-list">
|
|
|
- <div class="courseware-list-title">
|
|
|
- <div class="file-name">文件名</div>
|
|
|
- <div class="operation">操作</div>
|
|
|
- </div>
|
|
|
- <ul v-if="value1 !== ''">
|
|
|
- <li class="courseware-list-item">
|
|
|
- <span class="file-name">发了发动机考虑到非了富家大室李逵负荆as抵抗力 </span>
|
|
|
- <span class="operation">删除</span>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- <div v-else class="courseware-list-none">点击上方“选择课件”</div>
|
|
|
- </div>
|
|
|
- <hr />
|
|
|
- <div class="file">
|
|
|
- <el-button size="small" class="file-select">上传文件</el-button>
|
|
|
- <span class="tip">支持批量上传,上传格式支持mp3; mp4; jpg; png文件</span>
|
|
|
- </div>
|
|
|
- <div class="file-list">
|
|
|
- <div class="file-list-title">
|
|
|
- <div class="file-name">文件名</div>
|
|
|
- <div class="file-size">大小</div>
|
|
|
- <div class="file-status">状态</div>
|
|
|
- <div class="file-operation">操作</div>
|
|
|
- </div>
|
|
|
- <ul v-if="value1 !== ''">
|
|
|
- <li class="file-list-item">
|
|
|
- <span class="file-name">1</span>
|
|
|
- <span class="file-size">2</span>
|
|
|
- <span class="file-status">3</span>
|
|
|
- <span class="file-operation">4</span>
|
|
|
- </li>
|
|
|
- </ul>
|
|
|
- <div v-else class="file-list-none">点击上方“上传文件”或将文件拖拽到此区域</div>
|
|
|
- </div>
|
|
|
- <div class="file-upload">
|
|
|
- <el-button size="small" class="cancel">取消</el-button>
|
|
|
- <el-button size="small" class="start-upload">开始上传</el-button>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
-
|
|
|
- <hr v-if="curTaskClassifyType !== taskClassify[0].type" />
|
|
|
-
|
|
|
- <SubTask v-for="(item, i) in subtaskList" :key="i" :index="i" @deleteSubtask="deleteSubtask" />
|
|
|
-
|
|
|
- <hr v-if="isHasSubtask" />
|
|
|
-
|
|
|
- <el-button class="add-subtask" @click="selectTaskType">
|
|
|
- <svg-icon icon-class="plus" class-name="plus" />添加子任务
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
- <div class="add-task"><svg-icon icon-class="plus" class-name="task-plus" /></div>
|
|
|
-
|
|
|
- <SelectTaskClassify :visible.sync="visible" @select-task-classify="addSubtask" />
|
|
|
- <!-- TODO 改为课节id -->
|
|
|
- <SelectCourse :id="id" :dialog-visible="dialogVisible" />
|
|
|
+ <div>
|
|
|
+ <template v-if="curTaskTemplateList.length > 0">
|
|
|
+ <TaskTemplate
|
|
|
+ v-for="(item, i) in curTaskTemplateList"
|
|
|
+ :key="i"
|
|
|
+ :list-name="curTaskTypeObj.sidebarListName"
|
|
|
+ :index="i"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <CreateTask />
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
-<script>
|
|
|
-export default {
|
|
|
- name: 'TaskTemplate'
|
|
|
-};
|
|
|
-</script>
|
|
|
-
|
|
|
<script setup>
|
|
|
-import { ref, inject, watch } from 'vue';
|
|
|
-import { useTaskClassify } from '../taskType.js';
|
|
|
-import { useAudioVideo, useFormData, useSubtask, useRecording } from './data';
|
|
|
-
|
|
|
-import RichText from '@/components/common/RichText.vue';
|
|
|
-import SelectTaskClassify from '../SelectTaskClassify.vue';
|
|
|
-import SelectCourse from '@/components/select/SelectCourse.vue';
|
|
|
-import SubTask from './SubTask.vue';
|
|
|
+import { inject } from 'vue';
|
|
|
|
|
|
-defineProps({
|
|
|
- curTaskClassifyType: {
|
|
|
- type: String,
|
|
|
- required: true
|
|
|
- }
|
|
|
-});
|
|
|
+import TaskTemplate from './TaskTemplate.vue';
|
|
|
+import CreateTask from './CreateTask.vue';
|
|
|
|
|
|
-const { taskClassify, getTaskClassifyName } = useTaskClassify();
|
|
|
-
|
|
|
-const id = inject('id');
|
|
|
-
|
|
|
-let dialogVisible = ref(false);
|
|
|
-
|
|
|
-let { visible, selectTaskType, subtaskList, isHasSubtask, addSubtask, deleteSubtask } = useSubtask();
|
|
|
-
|
|
|
-let { audioAndVideo, curRecord, selectRecord } = useAudioVideo();
|
|
|
-
|
|
|
-let { value1, duration, durationList, selectStudent, selectTeacher, teacherList, studentList } = useFormData(id);
|
|
|
-
|
|
|
-let { startRecording, closeRecording, blob } = useRecording('audio');
|
|
|
-
|
|
|
-function stopAudio() {
|
|
|
- console.log('stop', closeRecording());
|
|
|
-}
|
|
|
-
|
|
|
-watch(blob, (newVal) => {
|
|
|
- console.log(newVal);
|
|
|
-});
|
|
|
-// let { startVideo } = useRecording('video');
|
|
|
+const curTaskTemplateList = inject('curTaskTemplateList');
|
|
|
+const curTaskTypeObj = inject('curTaskTypeObj');
|
|
|
</script>
|
|
|
-
|
|
|
-<style lang="scss" scoped>
|
|
|
-$tip-color: #999;
|
|
|
-
|
|
|
-.task-template {
|
|
|
- width: 828px;
|
|
|
- margin: 56px auto;
|
|
|
-
|
|
|
- &-index {
|
|
|
- display: inline-block;
|
|
|
- width: 26px;
|
|
|
- height: 26px;
|
|
|
- margin-right: 8px;
|
|
|
- line-height: 26px;
|
|
|
- color: #fff;
|
|
|
- text-align: center;
|
|
|
- background-color: #5498ff;
|
|
|
- border-radius: 50%;
|
|
|
- }
|
|
|
-
|
|
|
- &-taskClassify-name {
|
|
|
- display: inline-block;
|
|
|
- padding: 2px 12px;
|
|
|
- line-height: 22px;
|
|
|
- color: #fff;
|
|
|
- background-color: #666;
|
|
|
- border-radius: 19px;
|
|
|
- }
|
|
|
-
|
|
|
- &-content {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- row-gap: 8px;
|
|
|
- padding: 24px;
|
|
|
- margin-top: 8px;
|
|
|
- background-color: #fff;
|
|
|
- border: 1px solid $border-color;
|
|
|
- border-radius: 8px;
|
|
|
- box-shadow: 0 2px 4px $border-color;
|
|
|
-
|
|
|
- // 公用
|
|
|
- .task-time {
|
|
|
- display: flex;
|
|
|
- column-gap: 8px;
|
|
|
-
|
|
|
- &-item {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- row-gap: 8px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- :deep hr {
|
|
|
- width: 100%;
|
|
|
- margin: 23px 0;
|
|
|
- border: 1px dashed $border-color;
|
|
|
- }
|
|
|
-
|
|
|
- .add-subtask {
|
|
|
- width: 106px;
|
|
|
- padding: 4px;
|
|
|
- line-height: 22px;
|
|
|
- color: #fff;
|
|
|
- background-color: #67cfcf;
|
|
|
-
|
|
|
- .plus {
|
|
|
- width: 18px;
|
|
|
- height: 18px;
|
|
|
- margin-right: 4px;
|
|
|
- vertical-align: sub;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 课件
|
|
|
- %courseware,
|
|
|
- .courseware {
|
|
|
- display: flex;
|
|
|
- column-gap: 16px;
|
|
|
- align-items: center;
|
|
|
-
|
|
|
- &-select {
|
|
|
- width: 90px;
|
|
|
- color: #191919;
|
|
|
- }
|
|
|
-
|
|
|
- .tip {
|
|
|
- color: $tip-color;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .courseware-list {
|
|
|
- color: $tip-color;
|
|
|
- border: 1px solid $border-color;
|
|
|
-
|
|
|
- &-title {
|
|
|
- display: flex;
|
|
|
- border-bottom: 1px solid $border-color;
|
|
|
-
|
|
|
- .file-name {
|
|
|
- flex: 1;
|
|
|
- padding: 10px 24px;
|
|
|
- border-right: 1px solid $border-color;
|
|
|
- }
|
|
|
-
|
|
|
- .operation {
|
|
|
- padding: 10px 24px;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &-item {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- word-break: break-all;
|
|
|
-
|
|
|
- > span {
|
|
|
- padding: 10px 24px;
|
|
|
- }
|
|
|
-
|
|
|
- .file-name {
|
|
|
- flex: 1;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &-none {
|
|
|
- height: 210px;
|
|
|
- line-height: 210px;
|
|
|
- color: $tip-color;
|
|
|
- text-align: center;
|
|
|
- vertical-align: middle;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 文件
|
|
|
- .file {
|
|
|
- @extend %courseware;
|
|
|
- }
|
|
|
-
|
|
|
- .file-list {
|
|
|
- border: 1px solid $border-color;
|
|
|
-
|
|
|
- &-title {
|
|
|
- display: flex;
|
|
|
- color: $tip-color;
|
|
|
- border-bottom: 1px solid $border-color;
|
|
|
-
|
|
|
- > div {
|
|
|
- padding: 10px 24px;
|
|
|
- border-right: 1px solid $border-color;
|
|
|
- }
|
|
|
-
|
|
|
- .file-name {
|
|
|
- width: 310px;
|
|
|
- }
|
|
|
-
|
|
|
- .file-size {
|
|
|
- width: 78px;
|
|
|
- }
|
|
|
-
|
|
|
- .file-status {
|
|
|
- width: 310px;
|
|
|
- }
|
|
|
-
|
|
|
- .file-operation {
|
|
|
- flex: 1;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &-item {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- word-break: break-all;
|
|
|
-
|
|
|
- > span {
|
|
|
- padding: 10px 24px;
|
|
|
- }
|
|
|
-
|
|
|
- .file-name {
|
|
|
- width: 310px;
|
|
|
- }
|
|
|
-
|
|
|
- .file-size {
|
|
|
- width: 78px;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
-
|
|
|
- .file-status {
|
|
|
- width: 310px;
|
|
|
- }
|
|
|
-
|
|
|
- .file-operation {
|
|
|
- flex: 1;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &-none {
|
|
|
- height: 210px;
|
|
|
- line-height: 210px;
|
|
|
- color: $tip-color;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .file-upload {
|
|
|
- display: flex;
|
|
|
- justify-content: flex-end;
|
|
|
- margin-top: 16px;
|
|
|
-
|
|
|
- .cancel {
|
|
|
- background-color: #e7e7e7;
|
|
|
- }
|
|
|
-
|
|
|
- .start-upload {
|
|
|
- color: #fff;
|
|
|
- background-color: #d4e3fc;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 录音/录影
|
|
|
- .sound-recording {
|
|
|
- height: 230px;
|
|
|
- background-color: #f4f4f4;
|
|
|
- border: 1px solid $border-color;
|
|
|
- }
|
|
|
-
|
|
|
- .sound-input {
|
|
|
- :deep .el-textarea__inner {
|
|
|
- height: 92px;
|
|
|
- padding: 8px 12px;
|
|
|
- font-size: 16px;
|
|
|
- border: 1px solid $border-color;
|
|
|
- border-top-width: 0;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .video-recording {
|
|
|
- height: 342px;
|
|
|
- padding: 8px;
|
|
|
- border: 1px solid $border-color;
|
|
|
- }
|
|
|
-
|
|
|
- .recording-operation {
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- padding: 8px 16px;
|
|
|
- border: 1px solid $border-color;
|
|
|
- border-top-width: 0;
|
|
|
-
|
|
|
- .switch {
|
|
|
- background-color: #e7e7e7;
|
|
|
- border: 1px solid $border-color;
|
|
|
- border-radius: 4px;
|
|
|
-
|
|
|
- > span {
|
|
|
- display: inline-block;
|
|
|
- height: 28px;
|
|
|
- padding: 2px 8px;
|
|
|
- font-size: 16px;
|
|
|
- line-height: 24px;
|
|
|
- color: $tip-color;
|
|
|
- cursor: pointer;
|
|
|
- background-color: #e7e7e7;
|
|
|
- border-radius: 3px;
|
|
|
-
|
|
|
- &.active {
|
|
|
- color: #000;
|
|
|
- background-color: #fff;
|
|
|
- box-shadow: 0 2px 4px rgba(0, 0, 0, 25%);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .press-sound {
|
|
|
- padding: 4px 8px;
|
|
|
- line-height: 22px;
|
|
|
- cursor: pointer;
|
|
|
- border-radius: 40px;
|
|
|
-
|
|
|
- &.microphone {
|
|
|
- color: #fff;
|
|
|
- background-color: #de4444;
|
|
|
- }
|
|
|
-
|
|
|
- &.videocamera {
|
|
|
- color: #de4444;
|
|
|
- background-color: #fff;
|
|
|
- border: 1px solid #de4444;
|
|
|
- }
|
|
|
-
|
|
|
- .button-icon {
|
|
|
- margin-right: 4px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- .add-task {
|
|
|
- width: 32px;
|
|
|
- height: 32px;
|
|
|
- padding: 4px;
|
|
|
- margin: 24px auto 0;
|
|
|
- cursor: pointer;
|
|
|
- background-color: #5498ff;
|
|
|
- border-radius: 4px;
|
|
|
-
|
|
|
- .task-plus {
|
|
|
- width: 24px;
|
|
|
- height: 24px;
|
|
|
- text-align: center;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|