|
|
@@ -48,7 +48,7 @@
|
|
|
<el-radio-group v-model="tabName" size="large">
|
|
|
<el-radio-button label="task" @click="switchTab('task')">任务</el-radio-button>
|
|
|
<el-radio-button label="notice" @click="switchTab('notice')">通知</el-radio-button>
|
|
|
-<!-- <el-radio-button label="courseware" @click="switchTab('courseware')">课件</el-radio-button>-->
|
|
|
+ <el-radio-button label="project" @click="switchTab('project')">项目</el-radio-button>
|
|
|
<el-radio-button label="comment" @click="switchTab('comment')">评论</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
<div v-if="isCreator">
|
|
|
@@ -101,6 +101,38 @@
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-popover>
|
|
|
+
|
|
|
+ <el-popover v-if="tabName==='project'"
|
|
|
+ v-model:visible="projectPopover"
|
|
|
+ :width="160"
|
|
|
+ placement="bottom">
|
|
|
+ <el-row class="sel-project-type">
|
|
|
+ <div class="project-type-txt">
|
|
|
+ <el-link href="javascript:void(0);" type="success" @click="setRule">
|
|
|
+ 开放组队
|
|
|
+ </el-link>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="sel-project-type">
|
|
|
+ <div class="project-type-txt">
|
|
|
+ <el-link href="javascript:void(0);" type="warning">
|
|
|
+ 修改组队信息
|
|
|
+ </el-link>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
+ <el-row class="sel-project-type">
|
|
|
+ <div class="project-type-txt">
|
|
|
+ <el-link href="javascript:void(0);" type="danger">
|
|
|
+ 查看队伍信息
|
|
|
+ </el-link>
|
|
|
+ </div>
|
|
|
+ </el-row>
|
|
|
+ <template #reference>
|
|
|
+ <el-button plain type="primary" @click="projectPopover = true">组队
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-popover>
|
|
|
+
|
|
|
<el-upload v-if="tabName==='courseware'" :http-request="handleFileUploading"
|
|
|
:on-success="handleFileUploadSuccess"
|
|
|
:show-file-list="false" action="">
|
|
|
@@ -272,6 +304,22 @@
|
|
|
<el-button plain type="danger" @click="beforeFormClose">我再想想</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
+
|
|
|
+ <el-dialog v-model="ruleFormDialog" :before-close="beforeFormClose" :title="ruleForm.dialogTitle">
|
|
|
+ <el-form ref="ruleFormRef" :model="ruleForm" :rules="ruleFormRule" label-position="right" label-width="150px">
|
|
|
+ <el-form-item label="小组最大人数" prop="maxSize">
|
|
|
+ <el-input v-model="ruleForm.maxSize"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="组名最大长度" prop="maxNameLen">
|
|
|
+ <el-input v-model="ruleForm.maxNameLen"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <div style="margin: auto;width: fit-content">
|
|
|
+ <el-button plain type="primary" @click="CreateRule">确认</el-button>
|
|
|
+ <el-button plain type="danger" @click="beforeRuleFormClose">我再想想</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -280,7 +328,6 @@ import NoticeItem from "./components/NoticeItem";
|
|
|
import FileEntry from "./components/FileEntry";
|
|
|
import { ElMessageBox, ElMessage } from "element-plus";
|
|
|
import variables from "@/utils/variables";
|
|
|
-import announcement from "@/api/announcement";
|
|
|
|
|
|
export default {
|
|
|
name: "CourseDetail",
|
|
|
@@ -302,6 +349,7 @@ export default {
|
|
|
themeColor,
|
|
|
tabName: "task",
|
|
|
noticePopover: false,
|
|
|
+ projectPopover: false,
|
|
|
//
|
|
|
evalExamList: [],
|
|
|
coderExamList: [],
|
|
|
@@ -324,6 +372,23 @@ export default {
|
|
|
},
|
|
|
announcementList: [],
|
|
|
//
|
|
|
+ ruleFormDialog: false,
|
|
|
+ ruleForm: {
|
|
|
+ dialogTitle: "制定组队规则",
|
|
|
+ courseVO: null,
|
|
|
+ id: null,
|
|
|
+ maxSize: null,
|
|
|
+ maxNameLen: null,
|
|
|
+ },
|
|
|
+ ruleFormRule: {
|
|
|
+ maxSize: {
|
|
|
+ required: true, message: "请输入小组最大成员人数", trigger: "blur",
|
|
|
+ },
|
|
|
+ maxNameLen: {
|
|
|
+ required: true, message: "请输入组名最大长度", trigger: "blur",
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
commentContent: "",
|
|
|
commentTree: [],
|
|
|
|
|
|
@@ -390,6 +455,10 @@ export default {
|
|
|
isCreator() {
|
|
|
return Number(this.courseInfo.teacher.id) === Number(this.$store.state.user.id);
|
|
|
},
|
|
|
+ isNotRule() {
|
|
|
+ return false;
|
|
|
+ //todo
|
|
|
+ },
|
|
|
imgUrl() {
|
|
|
return this.courseInfo.imageUrl === null ? this.noImgUrl : this.courseInfo.imageUrl;
|
|
|
},
|
|
|
@@ -529,6 +598,10 @@ export default {
|
|
|
this.announcementForm.type = type;
|
|
|
this.announcementFormDialog = true;
|
|
|
},
|
|
|
+ setRule(){
|
|
|
+ this.ruleFormDialog =true;
|
|
|
+ },
|
|
|
+
|
|
|
beforeFormClose() {
|
|
|
ElMessageBox.confirm("是否确认退出?退出后将不保存表格信息。", "提示", {
|
|
|
confirmButtonText: "确认退出",
|
|
|
@@ -541,6 +614,35 @@ export default {
|
|
|
this.$refs.announceFormRef.resetFields();
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
+ beforeRuleFormClose() {
|
|
|
+ ElMessageBox.confirm("是否确认退出?退出后将不保存组队规则信息。", "提示", {
|
|
|
+ confirmButtonText: "确认退出",
|
|
|
+ cancelButtonText: "我再想想",
|
|
|
+ type: "warning",
|
|
|
+ center: true,
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.ruleFormDialog = false;
|
|
|
+ this.$refs.ruleFormRef.resetFields();
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ CreateRule(){
|
|
|
+ let RuleVO={
|
|
|
+ courseVO: {courseId: this.courseInfo.id},
|
|
|
+ maxSize: this.ruleForm.maxSize,
|
|
|
+ maxNameLen: this.ruleForm.maxNameLen,
|
|
|
+ };
|
|
|
+ console.log(RuleVO);
|
|
|
+ this.$apis.editGroupRule(RuleVO)
|
|
|
+ .then(res => {
|
|
|
+ this.ruleFormDialog=false;
|
|
|
+ this.$refs.ruleFormRef.resetFields;
|
|
|
+ ElMessage.success("创建规则成功");
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
handlePublishAnnouncement() {
|
|
|
const _this = this;
|
|
|
if (this.announcementForm.content === "") {
|
|
|
@@ -728,6 +830,8 @@ export default {
|
|
|
case "comment":
|
|
|
this.commentTree = (await this.$apis.getCommentsByCourseId(this.$route.params.id)).data.data;
|
|
|
break;
|
|
|
+ case "project":
|
|
|
+ //todo
|
|
|
}
|
|
|
},
|
|
|
// comment相关
|