|
|
@@ -0,0 +1,774 @@
|
|
|
+<script>
|
|
|
+import {ElLoading, ElMessage, ElMessageBox} from "element-plus";
|
|
|
+import {Back, UploadFilled} from "@element-plus/icons-vue";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: "HomeworkPage",
|
|
|
+ components: {UploadFilled, Back},
|
|
|
+ data(){
|
|
|
+ return{
|
|
|
+ homeworkInfo:{
|
|
|
+ assignmentName:" ",
|
|
|
+ description:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
|
+ type:"写作",
|
|
|
+ descriptionFile:"",
|
|
|
+ attachments:[],
|
|
|
+ startTime:"2025-06-15 09:00:00",
|
|
|
+ endTime:"2025-06-30 09:00:00"
|
|
|
+ },
|
|
|
+ inputVisible:false,
|
|
|
+ speakingHomeworkInfo:{
|
|
|
+ assignmentName:"",
|
|
|
+ description:"",
|
|
|
+ type:"speaking",
|
|
|
+ descriptionFile:"",
|
|
|
+ attachments:[],
|
|
|
+ startTime:"2025-06-15 09:00:00",
|
|
|
+ endTime:"2025-06-30 09:00:00",
|
|
|
+ minDuration:null,
|
|
|
+ minInteraction:null,
|
|
|
+ surveyLinks:[],
|
|
|
+ surveyDuration:null,
|
|
|
+
|
|
|
+ },
|
|
|
+ speakingHomeworkForm:{
|
|
|
+ assignmentName:"",
|
|
|
+ description:"",
|
|
|
+ type:"speaking",
|
|
|
+ descriptionFile:"",
|
|
|
+ attachments:[],
|
|
|
+ timeRange:[],
|
|
|
+ minDuration:null,
|
|
|
+ minInteraction:null,
|
|
|
+ surveyLinks:[],
|
|
|
+ surveyDuration:null
|
|
|
+ },
|
|
|
+ dialog:{
|
|
|
+ delete:false,
|
|
|
+ create:false,
|
|
|
+ update:false,
|
|
|
+ },
|
|
|
+ inputValue:"",
|
|
|
+ speakingDialog:{
|
|
|
+ delete:false,
|
|
|
+ create:false,
|
|
|
+ update:false,
|
|
|
+ },
|
|
|
+ isLoading:true,
|
|
|
+ homeworkList:[],
|
|
|
+ homeworkType:"",
|
|
|
+ assignmentId:0,
|
|
|
+ homeworkForm:{
|
|
|
+ assignmentName:"作业2",
|
|
|
+ description:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
|
|
|
+ type:"写作",
|
|
|
+ descriptionFile:"",
|
|
|
+ attachments:[],
|
|
|
+ timeRange:[]
|
|
|
+ },
|
|
|
+ rules:{
|
|
|
+ assignmentName:[
|
|
|
+ { required: true, message: "请输入作业名", trigger: "blur" },
|
|
|
+ { min: 3, max: 50, message: "长度应大于3小于50", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ description:[
|
|
|
+ { required: true, message: "请输入作业描述", trigger: "blur" },
|
|
|
+ { min: 10, max: 200, message: "长度应大于10小于200", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ timeRange:[
|
|
|
+ { required: true, message: "请选择时间范围", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ speakingRules:{
|
|
|
+ assignmentName:[
|
|
|
+ { required: true, message: "请输入作业名", trigger: "blur" },
|
|
|
+ { min: 3, max: 50, message: "长度应大于3小于50", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ description:[
|
|
|
+ { required: true, message: "请输入作业描述", trigger: "blur" },
|
|
|
+ { min: 10, max: 200, message: "长度应大于10小于200", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ timeRange:[
|
|
|
+ { required: true, message: "请选择时间范围", trigger: "blur" },
|
|
|
+ ],
|
|
|
+ minDuration:[
|
|
|
+ { validator: this.checkDuration, trigger: "blur" },
|
|
|
+ ],
|
|
|
+ minInteraction:[
|
|
|
+ { validator: this.checkInteraction, trigger: "blur" },
|
|
|
+ ],
|
|
|
+ surveyDuration:[
|
|
|
+ { validator: this.checkInteraction, trigger: "blur" },
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ init() {
|
|
|
+ this.assignmentId = this.$route.params.homeworkId;
|
|
|
+ this.homeworkType = this.$route.params.type === "speaking"?"口语":"写作";
|
|
|
+ const temp = ElLoading.service();
|
|
|
+ this.$apis.getHomeworkDetail(this.assignmentId,this.homeworkType)
|
|
|
+ .then(res => {
|
|
|
+ console.log(res);
|
|
|
+ if (this.homeworkType === "写作"){
|
|
|
+ this.homeworkInfo = res.data.data;
|
|
|
+ this.homeworkForm.assignmentName = this.homeworkInfo.assignmentName;
|
|
|
+ this.homeworkForm.description = this.homeworkInfo.description;
|
|
|
+ this.homeworkForm.type = this.homeworkInfo.type;
|
|
|
+ this.homeworkForm.descriptionFile = this.homeworkInfo.descriptionFile;
|
|
|
+ this.homeworkForm.attachments = this.homeworkInfo.attachments;
|
|
|
+ this.homeworkForm.timeRange = [this.homeworkInfo.startTime,this.homeworkInfo.endTime];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.speakingHomeworkInfo = res.data.data;
|
|
|
+ this.speakingHomeworkForm.assignmentName = this.speakingHomeworkInfo.assignmentName;
|
|
|
+ this.speakingHomeworkForm.description = this.speakingHomeworkInfo.description;
|
|
|
+ this.speakingHomeworkForm.type = this.speakingHomeworkInfo.type;
|
|
|
+ this.speakingHomeworkForm.descriptionFile = this.speakingHomeworkInfo.descriptionFile;
|
|
|
+ this.speakingHomeworkForm.attachments = this.speakingHomeworkInfo.attachments;
|
|
|
+ this.speakingHomeworkForm.timeRange = [this.speakingHomeworkInfo.startTime,this.speakingHomeworkInfo.endTime];
|
|
|
+ this.speakingHomeworkForm.minDuration = this.speakingHomeworkInfo.minDuration;
|
|
|
+ this.speakingHomeworkForm.minInteraction = this.speakingHomeworkInfo.minInteraction;
|
|
|
+ this.speakingHomeworkForm.surveyLinks = [...this.speakingHomeworkInfo.surveyLinks];
|
|
|
+ this.speakingHomeworkForm.surveyDuration = this.speakingHomeworkInfo.surveyDuration;
|
|
|
+ if (this.speakingHomeworkForm.surveyLinks.length!==0&&
|
|
|
+ this.speakingHomeworkForm.surveyLinks[0] === ""){
|
|
|
+ this.speakingHomeworkForm.surveyLinks.splice(0,1);
|
|
|
+ this.speakingHomeworkInfo.surveyLinks.splice(0,1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ temp.close();
|
|
|
+ })
|
|
|
+ .catch(_err => {
|
|
|
+ ElMessage.error("获取作业信息失败");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ deleteHomework(){
|
|
|
+ this.$apis.deleteHomework(this.$route.params.teacherId,this.$route.params.homeworkId)
|
|
|
+ .then(res => {
|
|
|
+ ElMessage.success("作业已删除");
|
|
|
+
|
|
|
+ this.$router.go(-1);
|
|
|
+ })
|
|
|
+ .catch(_err => {
|
|
|
+ ElMessage.error("删除作业失败");
|
|
|
+ });
|
|
|
+ },
|
|
|
+ edithomework(){
|
|
|
+ if (this.homeworkType === "写作"){
|
|
|
+ this.dialog.update = true;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ this.speakingDialog.update = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goBack(){
|
|
|
+ this.$router.go(-1);
|
|
|
+ },
|
|
|
+ dateTimeFormatter(da){
|
|
|
+ let date = new Date(da);
|
|
|
+ return `${date.getFullYear()}-${date.getMonth()+1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
|
|
|
+ },
|
|
|
+ toEAI(){
|
|
|
+ window.location.href = "http://localhost:4000/";
|
|
|
+ },
|
|
|
+ contentToAHTML(content){
|
|
|
+ return "<a href=\""+ content +"\" target=\"_blank\">"+content+"</a>";
|
|
|
+ },
|
|
|
+ handleClose(){
|
|
|
+ ElMessageBox.confirm("确认吗?你的修改将不会保存。",{
|
|
|
+ confirmButtonText:"确认",
|
|
|
+ cancelButtonText:"取消"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.dialog.update = false;
|
|
|
+ this.speakingDialog.update = false;
|
|
|
+ this.recoverForm();
|
|
|
+ this.$refs.homeworkFormRef.resetFields();
|
|
|
+ this.$refs.speakingHomeworkFormRef.resetFields();
|
|
|
+ done();
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ done();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ recoverForm(){
|
|
|
+ this.homeworkForm.assignmentName = this.homeworkInfo.assignmentName;
|
|
|
+ this.homeworkForm.description = this.homeworkInfo.description;
|
|
|
+ this.homeworkForm.type = this.homeworkInfo.type;
|
|
|
+ this.homeworkForm.descriptionFile = this.homeworkInfo.descriptionFile;
|
|
|
+ this.homeworkForm.attachments = this.homeworkInfo.attachments;
|
|
|
+ this.homeworkForm.timeRange = [this.homeworkInfo.startTime,this.homeworkInfo.endTime];
|
|
|
+
|
|
|
+ this.speakingHomeworkForm.assignmentName = this.speakingHomeworkInfo.assignmentName;
|
|
|
+ this.speakingHomeworkForm.description = this.speakingHomeworkInfo.description;
|
|
|
+ this.speakingHomeworkForm.type = this.speakingHomeworkInfo.type;
|
|
|
+ this.speakingHomeworkForm.descriptionFile = this.speakingHomeworkInfo.descriptionFile;
|
|
|
+ this.speakingHomeworkForm.attachments = this.speakingHomeworkInfo.attachments;
|
|
|
+ this.speakingHomeworkForm.timeRange = [this.speakingHomeworkInfo.startTime,this.speakingHomeworkInfo.endTime];
|
|
|
+ this.speakingHomeworkForm.minDuration = this.speakingHomeworkInfo.minDuration;
|
|
|
+ this.speakingHomeworkForm.minInteraction = this.speakingHomeworkInfo.minInteraction;
|
|
|
+ this.speakingHomeworkForm.surveyLinks = [...this.speakingHomeworkInfo.surveyLinks];
|
|
|
+ this.speakingHomeworkForm.surveyDuration = this.speakingHomeworkInfo.surveyDuration;
|
|
|
+ },
|
|
|
+ updateHomework(){
|
|
|
+ this.$refs.homeworkFormRef.validate((valid)=>{
|
|
|
+ if (valid){
|
|
|
+ // console.log(valid);
|
|
|
+ let homeworkVO = {
|
|
|
+ assignmentName:this.homeworkForm.assignmentName,
|
|
|
+ description:this.homeworkForm.description,
|
|
|
+ type:this.homeworkForm.type,
|
|
|
+ descriptionFile:this.homeworkForm.descriptionFile,
|
|
|
+ attachments:this.homeworkForm.attachments,
|
|
|
+ startTime: this.dateTimeFormatter(this.homeworkForm.timeRange[0]),
|
|
|
+ endTime: this.dateTimeFormatter(this.homeworkForm.timeRange[1]),
|
|
|
+ };
|
|
|
+ // console.log(homeworkVO);
|
|
|
+ this.$apis.updateHomework(this.assignmentId,homeworkVO)
|
|
|
+ .then(res => {
|
|
|
+ console.log( res);
|
|
|
+ if (res && res.data.code === 200){
|
|
|
+ ElMessage.success("作业修改成功");
|
|
|
+ this.dialog.update = false;
|
|
|
+ this.init();
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ ElMessage.error("作业修改失败");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ ElMessage.error("作业修改失败");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ updateSpeakingHomework(){
|
|
|
+ this.$refs.speakingHomeworkFormRef.validate((valid)=>{
|
|
|
+ if (valid){
|
|
|
+ // console.log(valid);
|
|
|
+ let homeworkVO = {
|
|
|
+ assignmentName:this.speakingHomeworkForm.assignmentName,
|
|
|
+ description:this.speakingHomeworkForm.description,
|
|
|
+ type:this.speakingHomeworkForm.type,
|
|
|
+ descriptionFile:this.speakingHomeworkForm.descriptionFile,
|
|
|
+ attachments:this.speakingHomeworkForm.attachments,
|
|
|
+ startTime: this.dateTimeFormatter(this.speakingHomeworkForm.timeRange[0]),
|
|
|
+ endTime: this.dateTimeFormatter(this.speakingHomeworkForm.timeRange[1]),
|
|
|
+ minDuration:this.speakingHomeworkForm.minDuration,
|
|
|
+ minInteraction:this.speakingHomeworkForm.minInteraction,
|
|
|
+ surveyLinks:this.speakingHomeworkForm.surveyLinks,
|
|
|
+ surveyDuration:this.speakingHomeworkForm.surveyDuration
|
|
|
+ };
|
|
|
+ if (this.speakingHomeworkForm.surveyLinks.length===0){
|
|
|
+ homeworkVO.surveyLinks = [""];
|
|
|
+ }
|
|
|
+ // console.log(homeworkVO);
|
|
|
+ this.$apis.updateSpeakingHomework(this.assignmentId,homeworkVO)
|
|
|
+ .then(res => {
|
|
|
+ console.log( res);
|
|
|
+ if (res && res.data.code === 200){
|
|
|
+ ElMessage.success("作业修改成功");
|
|
|
+ this.speakingDialog.update = false;
|
|
|
+ this.init();
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ ElMessage.error("作业修改失败");
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ ElMessage.error("作业修改失败");
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleLinkClose(link){
|
|
|
+ this.speakingHomeworkForm.surveyLinks.splice(this.speakingHomeworkForm.surveyLinks.indexOf(link), 1);
|
|
|
+ },
|
|
|
+ handleInputConfirm(){
|
|
|
+ if (this.inputValue) {
|
|
|
+ this.speakingHomeworkForm.surveyLinks.push(this.inputValue);
|
|
|
+ }
|
|
|
+ this.inputVisible = false;
|
|
|
+ this.inputValue = "";
|
|
|
+ },
|
|
|
+ showInput(){
|
|
|
+ this.inputVisible = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.InputRef.input.focus();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ checkNumberRange(rule,value,callback,min,max){
|
|
|
+ if (!value){
|
|
|
+ callback();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (Number.isNaN(value)){
|
|
|
+ callback(new Error("请输入整数"));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (Number.isInteger(Number(value))){
|
|
|
+ if (Number(value)>=min && Number(value)<=max){
|
|
|
+ callback();
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ callback(new Error(`请输入${min}~${max}的整数`));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ callback(new Error("请输入整数"));
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkDuration(rule,value,callback){
|
|
|
+ this.checkNumberRange(rule,value,callback,1,120);
|
|
|
+ },
|
|
|
+ checkInteraction(rule,value,callback){
|
|
|
+ this.checkNumberRange(rule,value,callback,1,50);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed:{
|
|
|
+ isTeacher() {
|
|
|
+ return this.$store.getters.isTeacher;
|
|
|
+ },
|
|
|
+ isWritingType(){
|
|
|
+ return this.homeworkType === "写作";
|
|
|
+ }
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<template>
|
|
|
+ <div style="width: 100%;height: 100%;display: flex;justify-content: center;align-items: center;flex-direction: column">
|
|
|
+ <div style="width: 60%;
|
|
|
+ background-color: #FFFFFF;
|
|
|
+ margin-top: 50px;
|
|
|
+ padding: 20px;
|
|
|
+ border:1px solid var(--el-border-color-light);
|
|
|
+ border-radius: 20px;" >
|
|
|
+ <div
|
|
|
+ class="homework-page-header">
|
|
|
+ <el-icon color="#606266" style="width: 25px;height: 25px;cursor: pointer" @click="goBack">
|
|
|
+ <Back style="width: 25px;height: 25px;"/>
|
|
|
+ </el-icon>
|
|
|
+ <span id="back-title" @click="goBack">
|
|
|
+ 返回
|
|
|
+ </span>
|
|
|
+ <el-divider direction="vertical"/>
|
|
|
+ <span style="font-weight: bold">
|
|
|
+ {{isWritingType?homeworkInfo.assignmentName:speakingHomeworkInfo.assignmentName}}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <el-descriptions column="1" >
|
|
|
+ <template v-if="isWritingType">
|
|
|
+ <el-descriptions-item label="作业类型">{{homeworkInfo.type==="speaking"?"AI对话":"写作"}}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="作业描述">{{homeworkInfo.description}}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="作业描述文件">无</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="附件">无</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="作业期限">
|
|
|
+ {{(homeworkInfo.startTime.substring(0, 16) + ' ~ ' + homeworkInfo.endTime.substring(0, 16)).replaceAll("T"," ")}}
|
|
|
+ </el-descriptions-item>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <el-descriptions-item label="作业类型">{{speakingHomeworkInfo.type==="speaking"?"AI对话":"写作"}}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="作业描述">{{speakingHomeworkInfo.description}}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="作业描述文件">无</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="附件">无</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="作业期限">
|
|
|
+ {{(speakingHomeworkInfo.startTime.substring(0, 16) + ' ~ ' + speakingHomeworkInfo.endTime.substring(0, 16)).replaceAll("T"," ")}}
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="最小时长">{{speakingHomeworkInfo.minDuration+"分钟"}}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="最小交流">{{speakingHomeworkInfo.minInteraction+"分钟"}}</el-descriptions-item>
|
|
|
+ <el-descriptions-item label="问卷链接">
|
|
|
+ <span v-if="speakingHomeworkInfo.surveyLinks.length===0">无</span>
|
|
|
+ <div
|
|
|
+ style="
|
|
|
+ display: flex;
|
|
|
+ gap: 5px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ max-height: 200px;
|
|
|
+ overflow-y: auto;
|
|
|
+ flex-direction: column;">
|
|
|
+ <el-tag
|
|
|
+ id="links"
|
|
|
+ style="width: fit-content;height: auto;margin-left: 70px"
|
|
|
+ v-for="link in speakingHomeworkInfo.surveyLinks"
|
|
|
+ :key="link"
|
|
|
+ >
|
|
|
+ <el-tooltip
|
|
|
+ :content="link"
|
|
|
+ :disabled="link.length<=90"
|
|
|
+ :hide-after="150"
|
|
|
+ placement="top">
|
|
|
+ <a :href="link" target="_blank">
|
|
|
+ {{link.substring(0,90)+(link.length>90?'...':'')}}
|
|
|
+ </a>
|
|
|
+ </el-tooltip>
|
|
|
+ </el-tag>
|
|
|
+ </div>
|
|
|
+ </el-descriptions-item>
|
|
|
+ <el-descriptions-item label="投放间隔">{{speakingHomeworkInfo.surveyDuration?(speakingHomeworkInfo.surveyDuration+"分钟"):"暂未设置"}}</el-descriptions-item>
|
|
|
+ </template>
|
|
|
+ </el-descriptions>
|
|
|
+ <div style="display: flex;flex-direction: row;justify-content: end">
|
|
|
+ <el-button type="success"
|
|
|
+ title="点击跳转至EAI平台"
|
|
|
+ @click="toEAI">
|
|
|
+ <div style="height: 100%;display: flex;justify-content: center;align-items: center">
|
|
|
+ EAI平台<el-icon ><Link /></el-icon>
|
|
|
+ </div>
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" @click="edithomework" v-if="isTeacher">编辑作业</el-button>
|
|
|
+ <el-button type="danger" @click="dialog.delete = true" v-if="isTeacher">删除作业</el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-dialog
|
|
|
+ v-model="dialog.update"
|
|
|
+ title="编辑写作作业"
|
|
|
+ width="40%"
|
|
|
+ v-if="isTeacher"
|
|
|
+ :before-close="handleClose"
|
|
|
+ >
|
|
|
+ <el-form :model="homeworkForm"
|
|
|
+ label-width="130px"
|
|
|
+ ref="homeworkFormRef"
|
|
|
+ class="homework-form"
|
|
|
+ label-position="right"
|
|
|
+ :rules="rules"
|
|
|
+ >
|
|
|
+ <el-form-item label="作业名"
|
|
|
+ prop="assignmentName"
|
|
|
+ class="homework-form-item">
|
|
|
+ <div style="width: 100%;height: 100%">
|
|
|
+ <el-input class="form-input"
|
|
|
+ maxlength="50"
|
|
|
+ show-word-limit
|
|
|
+ style="width: 100%;"
|
|
|
+ v-model="homeworkForm.assignmentName" />
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="作业详细描述"
|
|
|
+ required
|
|
|
+ prop="description"
|
|
|
+ class="homework-form-item">
|
|
|
+ <el-input type="textarea"
|
|
|
+ resize="none"
|
|
|
+ style="font-size: 20px"
|
|
|
+ maxlength="200"
|
|
|
+ show-word-limit
|
|
|
+ :autosize="{ minRows: 1, maxRows: 10 }"
|
|
|
+ v-model="homeworkForm.description" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="作业类型"
|
|
|
+ prop="type"
|
|
|
+ class="homework-form-item">
|
|
|
+ <span>
|
|
|
+ 写作
|
|
|
+ </span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="作业描述文件"
|
|
|
+ prop="descriptionFile"
|
|
|
+ class="homework-form-item">
|
|
|
+ <el-upload
|
|
|
+ drag
|
|
|
+ action=""
|
|
|
+ show-file-list
|
|
|
+ :auto-upload="false"
|
|
|
+ multiple
|
|
|
+ :limit="1"
|
|
|
+ ref="attachmentUploadRef"
|
|
|
+ >
|
|
|
+ <el-icon :size="50" style="padding-top: 30px" >
|
|
|
+ <upload-filled />
|
|
|
+ </el-icon>
|
|
|
+ <div class="el-upload__text">
|
|
|
+ 拖动文件到此处或者 <em>点击上传</em>
|
|
|
+ </div>
|
|
|
+ <template #tip>
|
|
|
+ <div class="el-upload__tip">
|
|
|
+ doc/docx 文件不大于 500kb
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="作业附件"
|
|
|
+ prop="attachment"
|
|
|
+ class="homework-form-item">
|
|
|
+ <el-upload
|
|
|
+ drag
|
|
|
+ action=""
|
|
|
+ show-file-list
|
|
|
+ :auto-upload="false"
|
|
|
+ multiple
|
|
|
+ :limit="5"
|
|
|
+ ref="attachmentUploadRef"
|
|
|
+ >
|
|
|
+ <el-icon :size="50" style="padding-top: 30px" >
|
|
|
+ <upload-filled />
|
|
|
+ </el-icon>
|
|
|
+ <div class="el-upload__text">
|
|
|
+ 拖动文件到此处或者 <em>点击上传</em>
|
|
|
+ </div>
|
|
|
+ <template #tip>
|
|
|
+ <div class="el-upload__tip">
|
|
|
+ doc/docx 文件不大于 500kb
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="作业期限"
|
|
|
+ prop="timeRange"
|
|
|
+ class="homework-form-item">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="homeworkForm.timeRange"
|
|
|
+ type="datetimerange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="dialog.create = false;this.recoverForm()">取消</el-button>
|
|
|
+ <el-button type="primary" @click="updateHomework">
|
|
|
+ 保存
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ v-model="speakingDialog.update"
|
|
|
+ title="编辑口语作业"
|
|
|
+ width="40%"
|
|
|
+ v-if="isTeacher"
|
|
|
+ :before-close="handleClose"
|
|
|
+ >
|
|
|
+ <el-form :model="speakingHomeworkForm"
|
|
|
+ ref="speakingHomeworkFormRef"
|
|
|
+ class="homework-form"
|
|
|
+ label-width="130px"
|
|
|
+ label-position="right"
|
|
|
+
|
|
|
+ :rules="speakingRules"
|
|
|
+ >
|
|
|
+ <el-form-item label="作业名"
|
|
|
+ prop="assignmentName"
|
|
|
+ class="homework-form-item">
|
|
|
+ <div style="width: 100%;height: 100%">
|
|
|
+ <el-input class="form-input"
|
|
|
+ maxlength="50"
|
|
|
+ show-word-limit
|
|
|
+ style="width: 100%"
|
|
|
+ v-model="speakingHomeworkForm.assignmentName" />
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="作业详细描述"
|
|
|
+ prop="description"
|
|
|
+ class="homework-form-item">
|
|
|
+ <el-input type="textarea"
|
|
|
+ resize="none"
|
|
|
+ style="font-size: 20px"
|
|
|
+ maxlength="200"
|
|
|
+ show-word-limit
|
|
|
+ :autosize="{ minRows: 1, maxRows: 10 }"
|
|
|
+ v-model="speakingHomeworkForm.description" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="作业类型"
|
|
|
+ prop="type"
|
|
|
+ class="homework-form-item">
|
|
|
+ <span>
|
|
|
+ AI口语
|
|
|
+ </span>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="作业描述文件"
|
|
|
+ prop="descriptionFile"
|
|
|
+ class="homework-form-item">
|
|
|
+ <el-upload
|
|
|
+ drag
|
|
|
+ action=""
|
|
|
+ show-file-list
|
|
|
+ :auto-upload="false"
|
|
|
+ multiple
|
|
|
+ :limit="1"
|
|
|
+ ref="attachmentUploadRef"
|
|
|
+ >
|
|
|
+ <el-icon :size="50" style="padding-top: 30px" >
|
|
|
+ <upload-filled />
|
|
|
+ </el-icon>
|
|
|
+ <div class="el-upload__text">
|
|
|
+ 拖动文件到此处或者 <em>点击上传</em>
|
|
|
+ </div>
|
|
|
+ <template #tip>
|
|
|
+ <div class="el-upload__tip">
|
|
|
+ doc/docx 文件不大于 500kb
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="作业附件"
|
|
|
+ prop="attachment"
|
|
|
+ class="homework-form-item">
|
|
|
+ <el-upload
|
|
|
+ drag
|
|
|
+ action=""
|
|
|
+ show-file-list
|
|
|
+ :auto-upload="false"
|
|
|
+ multiple
|
|
|
+ :limit="5"
|
|
|
+ ref="attachmentUploadRef"
|
|
|
+ >
|
|
|
+ <el-icon :size="50" style="padding-top: 30px" >
|
|
|
+ <upload-filled />
|
|
|
+ </el-icon>
|
|
|
+ <div class="el-upload__text">
|
|
|
+ 拖动文件到此处或者 <em>点击上传</em>
|
|
|
+ </div>
|
|
|
+ <template #tip>
|
|
|
+ <div class="el-upload__tip">
|
|
|
+ doc/docx 文件不大于 500kb
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="作业期限"
|
|
|
+ prop="timeRange"
|
|
|
+ class="homework-form-item">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="speakingHomeworkForm.timeRange"
|
|
|
+ type="datetimerange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="最少时长"
|
|
|
+ class="homework-form-item"
|
|
|
+ prop="minDuration">
|
|
|
+ <div style="width: 100%;height: 100%;">
|
|
|
+ <el-input v-model="speakingHomeworkForm.minDuration"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="请输入最少分钟数">
|
|
|
+ <template #append>
|
|
|
+ 分钟
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="最少交流"
|
|
|
+ class="homework-form-item"
|
|
|
+ prop="minInteraction">
|
|
|
+ <el-input v-model="speakingHomeworkForm.minInteraction"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="请输入最少交流数">
|
|
|
+ <template #append>
|
|
|
+ 次
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="问卷链接"
|
|
|
+ class="homework-form-item"
|
|
|
+ prop="surveyLinks">
|
|
|
+ <div style="display: flex;flex-direction: column;">
|
|
|
+ <transition-group name="list" tag="links"
|
|
|
+ style="
|
|
|
+ display: flex;
|
|
|
+ gap: 5px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ max-height: 200px;
|
|
|
+ overflow-y: auto;
|
|
|
+ flex-direction: column;">
|
|
|
+
|
|
|
+ <el-tag
|
|
|
+ id="links"
|
|
|
+ style="width: fit-content;height: auto"
|
|
|
+ v-for="link in speakingHomeworkForm.surveyLinks"
|
|
|
+ :key="link"
|
|
|
+ closable
|
|
|
+ :disable-transitions="true"
|
|
|
+ @close="handleLinkClose(link)"
|
|
|
+ >
|
|
|
+ <el-tooltip
|
|
|
+ :content="link"
|
|
|
+ :disabled="link.length<=40"
|
|
|
+ :hide-after="150"
|
|
|
+ placement="top">
|
|
|
+ <span>{{link.substring(0,40)+(link.length>40?'...':'')}}</span>
|
|
|
+ </el-tooltip>
|
|
|
+ </el-tag>
|
|
|
+ </transition-group>
|
|
|
+ <el-input
|
|
|
+ v-if="inputVisible"
|
|
|
+ ref="InputRef"
|
|
|
+ v-model="inputValue"
|
|
|
+ class="w-20"
|
|
|
+ size="small"
|
|
|
+ @keyup.enter="handleInputConfirm"
|
|
|
+ @blur="handleInputConfirm"
|
|
|
+ />
|
|
|
+ <el-button v-else class="button-new-tag" size="small" plain type="primary" @click="showInput">
|
|
|
+ + 添加问卷链接
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="问卷投放间隔"
|
|
|
+ class="homework-form-item"
|
|
|
+ prop="surveyDuration">
|
|
|
+
|
|
|
+ <el-input v-model="speakingHomeworkForm.surveyDuration"
|
|
|
+ style="width: 100%"
|
|
|
+ placeholder="请输入问卷投放间隔">
|
|
|
+ <template #append>
|
|
|
+ 分钟
|
|
|
+ </template>
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="speakingDialog.update = false;this.recoverForm()">取消</el-button>
|
|
|
+ <el-button type="primary" @click="updateSpeakingHomework">
|
|
|
+ 保存
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog
|
|
|
+ width="400px"
|
|
|
+ title="警告"
|
|
|
+
|
|
|
+ v-model="dialog.delete">
|
|
|
+ <span style="font-size: 15px">确认删除该作业吗</span>
|
|
|
+ <template #footer>
|
|
|
+ <div class="dialog-footer">
|
|
|
+ <el-button @click="dialog.delete = false" type="danger">取消</el-button>
|
|
|
+ <el-button type="primary" @click="dialog.delete = false;deleteHomework()">
|
|
|
+ 确认
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
+</template>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.homework-page-header{
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ justify-content: start;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ gap: 5px
|
|
|
+}
|
|
|
+#back-title{
|
|
|
+ color: var(--el-text-color-regular)
|
|
|
+}
|
|
|
+#back-title:hover{
|
|
|
+ color: var(--el-color-primary);
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+</style>
|