|
@@ -50,7 +50,6 @@
|
|
|
<el-radio-button label="task" @click="switchTab('task')">任务</el-radio-button>
|
|
<el-radio-button label="task" @click="switchTab('task')">任务</el-radio-button>
|
|
|
<el-radio-button label="courseware" @click="switchTab('courseware')">课件(暂未启用)</el-radio-button>
|
|
<el-radio-button label="courseware" @click="switchTab('courseware')">课件(暂未启用)</el-radio-button>
|
|
|
<el-radio-button label="notice" @click="switchTab('notice')">通知</el-radio-button>
|
|
<el-radio-button label="notice" @click="switchTab('notice')">通知</el-radio-button>
|
|
|
- <el-radio-button label="group" @click="switchTab('group')">团队</el-radio-button>
|
|
|
|
|
<el-radio-button label="comment" @click="switchTab('comment')">评论</el-radio-button>
|
|
<el-radio-button label="comment" @click="switchTab('comment')">评论</el-radio-button>
|
|
|
</el-radio-group>
|
|
</el-radio-group>
|
|
|
<!--教师视角-->
|
|
<!--教师视角-->
|
|
@@ -104,11 +103,6 @@
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-popover>
|
|
</el-popover>
|
|
|
- <el-button v-else-if="tabName==='group'"
|
|
|
|
|
- plain type="primary" :disabled="isRuleExisted||isRuleExisted===null"
|
|
|
|
|
- @click="ruleFormDialog=true">
|
|
|
|
|
- {{ isRuleExisted === null ? null : (isRuleExisted ? '已开放组队' : '开放组队') }}
|
|
|
|
|
- </el-button>
|
|
|
|
|
<el-upload v-else-if="tabName==='courseware'" :http-request="handleFileUploading"
|
|
<el-upload v-else-if="tabName==='courseware'" :http-request="handleFileUploading"
|
|
|
:on-success="handleFileUploadSuccess"
|
|
:on-success="handleFileUploadSuccess"
|
|
|
:show-file-list="false" action="">
|
|
:show-file-list="false" action="">
|
|
@@ -267,40 +261,29 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div v-else-if="tabName==='group'">
|
|
|
|
|
- <el-table :data="groupTableData" style="width: 100%">
|
|
|
|
|
- <el-table-column label="组名">
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <span
|
|
|
|
|
- :style="isGroupExisted && scope.row['groupVO'].id===groupData['groupVO'].id ? 'color: #67C23A':''">
|
|
|
|
|
- {{ scope.row['groupVO'].name }}
|
|
|
|
|
- </span>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- <el-table-column label="组员">
|
|
|
|
|
- <template #default="scope">
|
|
|
|
|
- <div v-for="item of scope.row.members" :key="'member'+item.id">
|
|
|
|
|
- <span
|
|
|
|
|
- :style="isGroupExisted && scope.row['groupVO'].id===groupData['groupVO'].id ? 'color: #67C23A':''">
|
|
|
|
|
- {{ item.username }}
|
|
|
|
|
- </span>
|
|
|
|
|
- </div>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-table-column>
|
|
|
|
|
- </el-table>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="course-detail-tabs">
|
|
|
|
|
- <el-tabs v-model="tabName" type="card" @tab-click="handleTabsClick">
|
|
|
|
|
- <el-tab-pane label="项目" name="project">
|
|
|
|
|
- <project-tab ref="projectTab"
|
|
|
|
|
- :course-id="courseInfo.id" :teacher-id="courseInfo.teacher.id"/>
|
|
|
|
|
- </el-tab-pane>
|
|
|
|
|
- </el-tabs>
|
|
|
|
|
- <el-button class="tabs-function-button" type="primary" plain
|
|
|
|
|
- @click="handleTabButtonClick">{{ tabButtonName }}
|
|
|
|
|
- </el-button>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <el-tabs v-model="tabName" type="card" @tab-click="handleTabsClick">
|
|
|
|
|
+ <el-tab-pane label="任务" name="task">
|
|
|
|
|
+ <task-tab ref="task-tab"/>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
|
|
+ <el-tab-pane label="课件(暂未启用)" name="courseware">
|
|
|
|
|
+ <courseware-tab ref="courseware-tab"/>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
|
|
+ <el-tab-pane label="通知" name="announcement">
|
|
|
|
|
+ <announcement-tab ref="courseware-tab"/>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
|
|
+ <el-tab-pane label="评论" name="message">
|
|
|
|
|
+ <message-tab ref="courseware-tab"/>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
|
|
+ <el-tab-pane label="项目" name="project">
|
|
|
|
|
+ <project-tab ref="projectTab"
|
|
|
|
|
+ :course-id="courseInfo.id" :teacher-id="courseInfo.teacher.id"/>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
|
|
+ <el-tab-pane label="团队" name="group">
|
|
|
|
|
+ <group-tab ref="groupTab"
|
|
|
|
|
+ :course-id="courseInfo.id" :teacher-id="courseInfo.teacher.id"/>
|
|
|
|
|
+ </el-tab-pane>
|
|
|
|
|
+ </el-tabs>
|
|
|
</el-card>
|
|
</el-card>
|
|
|
</div>
|
|
</div>
|
|
|
<!--发布通知-->
|
|
<!--发布通知-->
|
|
@@ -326,44 +309,6 @@
|
|
|
<el-button plain type="danger" @click="beforeFormClose">我再想想</el-button>
|
|
<el-button plain type="danger" @click="beforeFormClose">我再想想</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
- <!--小组规则-->
|
|
|
|
|
- <el-dialog v-model="ruleFormDialog" :before-close="beforeRuleFormClose" :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" type="number" min="1" max="5" placeholder="输入小组最大人数(1~5)" maxlength="1"
|
|
|
|
|
- onkeypress='return( /[1-5]/.test(String.fromCharCode(event.keyCode)))'></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- <el-form-item label="组名最大长度" prop="maxNameLen">
|
|
|
|
|
- <el-input v-model="ruleForm.maxNameLen" type="number" min="1" max="9" placeholder="输入组名最大长度(1~9)"
|
|
|
|
|
- maxlength="1" onkeypress='return( /[1-9]/.test(String.fromCharCode(event.keyCode)))'></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-form>
|
|
|
|
|
- <div style="margin: auto;width: fit-content">
|
|
|
|
|
- <el-button plain type="primary" @click="handleCreateRuleConfirm">确认</el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-dialog>
|
|
|
|
|
- <!--组队信息-->
|
|
|
|
|
- <el-dialog v-model="createGroupDialog" :before-close="beforeGroupFormClose" :title="createGroupForm.dialogTitle">
|
|
|
|
|
- <el-form ref="createGroupFormRef" :model="createGroupForm" label-position="right">
|
|
|
|
|
- <el-form-item label="组名" prop="name">
|
|
|
|
|
- <el-input v-model="createGroupForm.name" placeholder="输入组名" maxlength="5"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-form>
|
|
|
|
|
- <div style="margin: auto;width: fit-content">
|
|
|
|
|
- <el-button plain type="primary" @click="handleCreateGroupConfirm">确认</el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-dialog>
|
|
|
|
|
- <!-- 添加组员-->
|
|
|
|
|
- <el-dialog v-model="addMemberDialog" :before-close="beforeGroupMemberFormClose" :title="addMemberForm.dialogTitle">
|
|
|
|
|
- <el-form ref="addMemberFormRef" :model="addMemberForm" label-position="right">
|
|
|
|
|
- <el-form-item label="组员手机号" prop="phone">
|
|
|
|
|
- <el-input v-model="addMemberForm.phone" placeholder="输入组员手机号" maxlength="11"></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-form>
|
|
|
|
|
- <div style="margin: auto;width: fit-content">
|
|
|
|
|
- <el-button plain type="primary" @click="handleAddMemberConfirm">确认</el-button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-dialog>
|
|
|
|
|
<!-- 创建Coder考试-->
|
|
<!-- 创建Coder考试-->
|
|
|
<el-dialog v-model="coderExamDialog" :before-close="handleExamFormCancel" :width="1200"
|
|
<el-dialog v-model="coderExamDialog" :before-close="handleExamFormCancel" :width="1200"
|
|
|
:title="coderExamForm.dialogTitle">
|
|
:title="coderExamForm.dialogTitle">
|
|
@@ -494,10 +439,20 @@ import {ElMessageBox, ElMessage} from "element-plus";
|
|
|
import variables from "@/utils/variables";
|
|
import variables from "@/utils/variables";
|
|
|
import {formatTimestamp, problemTypeOptions, problemTypeToTagContent} from "@/utils/coder-utils";
|
|
import {formatTimestamp, problemTypeOptions, problemTypeToTagContent} from "@/utils/coder-utils";
|
|
|
import ProjectTab from "@/views/CoursePage/tabs/ProjectTab";
|
|
import ProjectTab from "@/views/CoursePage/tabs/ProjectTab";
|
|
|
|
|
+import GroupTab from "@/views/CoursePage/tabs/GroupTab";
|
|
|
|
|
+import TaskTab from "@/views/CoursePage/tabs/TaskTab";
|
|
|
|
|
+import CoursewareTab from "@/views/CoursePage/tabs/CoursewareTab";
|
|
|
|
|
+import AnnouncementTab from "@/views/CoursePage/tabs/AnnouncementTab";
|
|
|
|
|
+import MessageTab from "@/views/CoursePage/tabs/MessageTab";
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: "CourseDetail",
|
|
name: "CourseDetail",
|
|
|
components: {
|
|
components: {
|
|
|
|
|
+ MessageTab,
|
|
|
|
|
+ AnnouncementTab,
|
|
|
|
|
+ CoursewareTab,
|
|
|
|
|
+ TaskTab,
|
|
|
|
|
+ GroupTab,
|
|
|
ProjectTab,
|
|
ProjectTab,
|
|
|
NoticeItem,
|
|
NoticeItem,
|
|
|
FileEntry,
|
|
FileEntry,
|
|
@@ -575,43 +530,6 @@ export default {
|
|
|
url: ""
|
|
url: ""
|
|
|
}],
|
|
}],
|
|
|
|
|
|
|
|
- // groupRule
|
|
|
|
|
- isRuleExisted: null,
|
|
|
|
|
- ruleFormDialog: false,
|
|
|
|
|
- ruleForm: {
|
|
|
|
|
- dialogTitle: "制定组队规则",
|
|
|
|
|
- courseVO: null,
|
|
|
|
|
- id: null,
|
|
|
|
|
- maxSize: null,
|
|
|
|
|
- maxNameLen: null,
|
|
|
|
|
- },
|
|
|
|
|
- ruleFormRule: {
|
|
|
|
|
- maxSize: {
|
|
|
|
|
- required: true, message: "请选择小组最大成员人数", trigger: "change",
|
|
|
|
|
- },
|
|
|
|
|
- maxNameLen: {
|
|
|
|
|
- required: true, message: "请选择组名最大长度", trigger: "change",
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- // group
|
|
|
|
|
- isGroupExisted: null,
|
|
|
|
|
- createGroupDialog: false,
|
|
|
|
|
- createGroupForm: {
|
|
|
|
|
- dialogTitle: "队伍信息",
|
|
|
|
|
- courseId: null,
|
|
|
|
|
- name: null,
|
|
|
|
|
- },
|
|
|
|
|
- groupData: null,
|
|
|
|
|
-
|
|
|
|
|
- // group member
|
|
|
|
|
- addMemberDialog: false,
|
|
|
|
|
- groupTableData: [],
|
|
|
|
|
- addMemberForm: {
|
|
|
|
|
- dialogTitle: "组员信息",
|
|
|
|
|
- phone: null,
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
//create Coder exam
|
|
//create Coder exam
|
|
|
coderExamDialog: false,
|
|
coderExamDialog: false,
|
|
|
coderExamDialogTitle: "新建Coder考试",
|
|
coderExamDialogTitle: "新建Coder考试",
|
|
@@ -700,14 +618,6 @@ export default {
|
|
|
problemTypeOptions() {
|
|
problemTypeOptions() {
|
|
|
return problemTypeOptions(true);
|
|
return problemTypeOptions(true);
|
|
|
},
|
|
},
|
|
|
- tabButtonName() {
|
|
|
|
|
- switch (this.tabName) {
|
|
|
|
|
- case "project":
|
|
|
|
|
- return "新建项目";
|
|
|
|
|
- default:
|
|
|
|
|
- return "no tab";
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
switch (this.$route.params.jump_from_message) {
|
|
switch (this.$route.params.jump_from_message) {
|
|
@@ -725,7 +635,7 @@ export default {
|
|
|
this.$apis.getCourseById(this.$route.params.id)
|
|
this.$apis.getCourseById(this.$route.params.id)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
this.courseInfo = res.data.data;
|
|
this.courseInfo = res.data.data;
|
|
|
- this.coderExamForm.course = this.courseInfo.coderId; //当前课程的coderId固定
|
|
|
|
|
|
|
+ this.coderExamForm.course = this.courseInfo.coderId;
|
|
|
this.$apis.checkCourseSelection(this.$route.params.id, this.$store.state.user.id)
|
|
this.$apis.checkCourseSelection(this.$route.params.id, this.$store.state.user.id)
|
|
|
.then(res => {
|
|
.then(res => {
|
|
|
this.isCourseSelected = res.data.data;
|
|
this.isCourseSelected = res.data.data;
|
|
@@ -822,12 +732,6 @@ export default {
|
|
|
this.commentTree = (await this.$apis.getCommentsByCourseId(this.$route.params.id)).data.data;
|
|
this.commentTree = (await this.$apis.getCommentsByCourseId(this.$route.params.id)).data.data;
|
|
|
break;
|
|
break;
|
|
|
case "project":
|
|
case "project":
|
|
|
- const projectRes = (await _this.$apis.findProjectsByCourse(_this.courseInfo.id)).data;
|
|
|
|
|
- if (projectRes.code) {
|
|
|
|
|
- ElMessage.error(projectRes.message);
|
|
|
|
|
- } else {
|
|
|
|
|
- _this.projects = projectRes.data;
|
|
|
|
|
- }
|
|
|
|
|
break;
|
|
break;
|
|
|
case "group":
|
|
case "group":
|
|
|
const ruleRes = (await _this.$apis.findGroupRule(this.courseInfo.id)).data;
|
|
const ruleRes = (await _this.$apis.findGroupRule(this.courseInfo.id)).data;
|
|
@@ -1159,116 +1063,6 @@ export default {
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- // group rule
|
|
|
|
|
-
|
|
|
|
|
- beforeRuleFormClose() {
|
|
|
|
|
- ElMessageBox.confirm("是否确认退出?退出后将不保存组队规则信息。", "提示", {
|
|
|
|
|
- confirmButtonText: "确认退出",
|
|
|
|
|
- cancelButtonText: "我再想想",
|
|
|
|
|
- type: "warning",
|
|
|
|
|
- center: true,
|
|
|
|
|
- })
|
|
|
|
|
- .then(() => {
|
|
|
|
|
- this.ruleFormDialog = false;
|
|
|
|
|
- this.$refs.ruleFormRef.resetFields();
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- handleCreateRuleConfirm() {
|
|
|
|
|
- this.$refs.ruleFormRef.validate((valid) => {
|
|
|
|
|
- if (valid) {
|
|
|
|
|
- let RuleVO = {
|
|
|
|
|
- courseVO: {id: this.courseInfo.id},
|
|
|
|
|
- maxSize: this.ruleForm.maxSize,
|
|
|
|
|
- maxNameLen: this.ruleForm.maxNameLen,
|
|
|
|
|
- };
|
|
|
|
|
- this.$apis.createGroupRule(RuleVO)
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- if (res.data.code) {
|
|
|
|
|
- ElMessage.error(res.data.message);
|
|
|
|
|
- } else {
|
|
|
|
|
- this.isRuleExisted = true;
|
|
|
|
|
- this.ruleFormDialog = false;
|
|
|
|
|
- this.$refs.ruleFormRef.resetFields();
|
|
|
|
|
- ElMessage.success("创建规则成功");
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- // group
|
|
|
|
|
-
|
|
|
|
|
- beforeGroupFormClose() {
|
|
|
|
|
- this.createGroupDialog = false;
|
|
|
|
|
- this.$refs.createGroupFormRef.resetFields();
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- handleCreateGroupConfirm() {
|
|
|
|
|
- this.$refs.createGroupFormRef.validate((valid) => {
|
|
|
|
|
- if (valid) {
|
|
|
|
|
- let GroupVO = {
|
|
|
|
|
- courseId: this.courseInfo.id,
|
|
|
|
|
- name: this.createGroupForm.name,
|
|
|
|
|
- };
|
|
|
|
|
- this.$apis.createGroup(GroupVO)
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- if (res.data.code) {
|
|
|
|
|
- ElMessage.error(res.data.message);
|
|
|
|
|
- } else {
|
|
|
|
|
- this.isGroupExisted = true;
|
|
|
|
|
- this.groupTableData.push(res.data.data);
|
|
|
|
|
- this.createGroupDialog = false;
|
|
|
|
|
- this.$refs.createGroupFormRef.resetFields();
|
|
|
|
|
- ElMessage.success("创建队伍成功");
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- // group member
|
|
|
|
|
-
|
|
|
|
|
- beforeGroupMemberFormClose() {
|
|
|
|
|
- this.addMemberDialog = false;
|
|
|
|
|
- this.$refs.addMemberFormRef.resetFields();
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
- handleAddMemberConfirm() {
|
|
|
|
|
- const _this = this;
|
|
|
|
|
- this.$refs.addMemberFormRef.validate(async (valid) => {
|
|
|
|
|
- if (valid) {
|
|
|
|
|
- const userIdRes = (await _this.$apis.findUserIdByPhone(_this.addMemberForm.phone)).data;
|
|
|
|
|
- if (userIdRes.code) {
|
|
|
|
|
- ElMessage.error(userIdRes.message);
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- let groupMemberVO = {
|
|
|
|
|
- userId: userIdRes.data,
|
|
|
|
|
- groupId: _this.groupData.groupVO.id,
|
|
|
|
|
- courseId: _this.courseInfo.id,
|
|
|
|
|
- };
|
|
|
|
|
- this.$apis.addGroupMember(groupMemberVO)
|
|
|
|
|
- .then(res => {
|
|
|
|
|
- if (res.data.code) {
|
|
|
|
|
- ElMessage.error(res.data.message);
|
|
|
|
|
- } else {
|
|
|
|
|
- const groupDTO = res.data.data;
|
|
|
|
|
- for (const row of _this.groupTableData) {
|
|
|
|
|
- if (groupDTO.groupVO.id === row.groupVO.id) {
|
|
|
|
|
- row.members = groupDTO.members;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- _this.addMemberDialog = false;
|
|
|
|
|
- _this.$refs.addMemberFormRef.resetFields();
|
|
|
|
|
- ElMessage.success("添加组员成功");
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- },
|
|
|
|
|
-
|
|
|
|
|
// 创建Coder考试的Dialog
|
|
// 创建Coder考试的Dialog
|
|
|
handleExamFormCancel(done) {
|
|
handleExamFormCancel(done) {
|
|
|
//关闭dialog的提示
|
|
//关闭dialog的提示
|
|
@@ -1373,31 +1167,10 @@ export default {
|
|
|
handleTabsClick(tab) {
|
|
handleTabsClick(tab) {
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- handleTabButtonClick() {
|
|
|
|
|
- const _this = this;
|
|
|
|
|
- switch (_this.tabName) {
|
|
|
|
|
- case "project":
|
|
|
|
|
- _this.$refs.projectTab.openProjectDialog();
|
|
|
|
|
- break;
|
|
|
|
|
- default:
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
|
@import "style/CourseDetail.css";
|
|
@import "style/CourseDetail.css";
|
|
|
-
|
|
|
|
|
-.course-detail-tabs {
|
|
|
|
|
- position: relative;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-.tabs-function-button {
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- top: 1px;
|
|
|
|
|
- right: 0;
|
|
|
|
|
-}
|
|
|
|
|
</style>
|
|
</style>
|