|
|
@@ -162,7 +162,7 @@
|
|
|
:notice-v-o="item" @update="beforeUpdateAnnouncement(item)"
|
|
|
@delete="deleteAnnouncement(item, index)"/>
|
|
|
</template>
|
|
|
- <span class="announcement-content">{{ announcementContent(item) }}</span>
|
|
|
+ <div class="announcement-content">{{ announcementContent(item) }}</div>
|
|
|
</el-collapse-item>
|
|
|
</el-collapse>
|
|
|
</div>
|
|
|
@@ -207,7 +207,7 @@
|
|
|
{{ comments.mainMessage.createdAt.substring(0, 16).replace("T", " ") }}
|
|
|
</el-row>
|
|
|
<el-row>
|
|
|
- {{ comments.mainMessage.content }}<span @click="handleReplyClick(comments.mainMessage)"
|
|
|
+ {{ comments.mainMessage.content }}<span @click="handleReplyClick(comments.mainMessage, index)"
|
|
|
class="reply-button">回复</span>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
@@ -267,22 +267,19 @@
|
|
|
<el-button plain type="danger" @click="beforeFormClose">我再想想</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
- <!-- <el-dialog v-model="announcementDialog"-->
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import NoticeItem from "./components/NoticeItem";
|
|
|
import FileEntry from "./components/FileEntry";
|
|
|
-import {ElMessageBox, ElMessage} from "element-plus";
|
|
|
+import { ElMessageBox, ElMessage } from "element-plus";
|
|
|
import variables from "@/utils/variables";
|
|
|
|
|
|
export default {
|
|
|
name: "CourseDetail",
|
|
|
components: {
|
|
|
- // eslint-disable-next-line vue/no-unused-components
|
|
|
NoticeItem,
|
|
|
- // eslint-disable-next-line vue/no-unused-components
|
|
|
FileEntry,
|
|
|
},
|
|
|
data() {
|
|
|
@@ -330,11 +327,11 @@ export default {
|
|
|
color: "",
|
|
|
},
|
|
|
noticeTypeMap: {
|
|
|
- announce: {type: "公告", title: "发布公告", color: themeColor.orange},
|
|
|
- homework: {type: "作业", title: "发布作业", color: themeColor.blue},
|
|
|
- exam: {type: "考试", title: "发布考试", color: themeColor.red},
|
|
|
+ announce: { type: "公告", title: "发布公告", color: themeColor.orange },
|
|
|
+ homework: { type: "作业", title: "发布作业", color: themeColor.blue },
|
|
|
+ exam: { type: "考试", title: "发布考试", color: themeColor.red },
|
|
|
},
|
|
|
- newNoticeInfo: {noticeDescription: "", priority: "1", fileList: []},
|
|
|
+ newNoticeInfo: { noticeDescription: "", priority: "1", fileList: [] },
|
|
|
postNoticeInfo: {},
|
|
|
fileEntryList: [{
|
|
|
id: 1,
|
|
|
@@ -554,7 +551,7 @@ export default {
|
|
|
|
|
|
function createAnnouncement() {
|
|
|
let announcementVO = {
|
|
|
- sender: {id: _this.$store.state.user.id,},
|
|
|
+ sender: { id: _this.$store.state.user.id, },
|
|
|
courseId: _this.courseInfo.id,
|
|
|
title: _this.announcementForm.title,
|
|
|
content: _this.announcementForm.content,
|
|
|
@@ -623,7 +620,7 @@ export default {
|
|
|
readAnnouncement(item) {
|
|
|
if (!item.read) {
|
|
|
this.$apis.readAnnouncement(item.id)
|
|
|
- .then(res => {
|
|
|
+ .then(() => {
|
|
|
item.read = true;
|
|
|
this.$refs["noticeItem" + item.id][0].setNoticeInfo(item);
|
|
|
});
|
|
|
@@ -642,7 +639,7 @@ export default {
|
|
|
confirmButtonText: "立即选课",
|
|
|
cancelButtonText: "我再想想",
|
|
|
})
|
|
|
- .then(({value}) => {
|
|
|
+ .then(({ value }) => {
|
|
|
if (value !== this.courseInfo.invitationCode) {
|
|
|
ElMessage.error("选课码错误");
|
|
|
} else {
|
|
|
@@ -676,7 +673,7 @@ export default {
|
|
|
userId: this.$store.state.user.id,
|
|
|
}
|
|
|
)
|
|
|
- .then(res => {
|
|
|
+ .then(() => {
|
|
|
ElMessage.success("退课成功");
|
|
|
setTimeout(function () {
|
|
|
location.reload();
|
|
|
@@ -734,17 +731,20 @@ export default {
|
|
|
createdAt: new Date(),
|
|
|
})
|
|
|
.then(res => {
|
|
|
- this.commentTree.push({mainMessage: res.data.data, children: []});
|
|
|
+ const msg = res.data.data;
|
|
|
+ msg.createdAt = this.timestampToTime(msg.createdAt);
|
|
|
+ this.commentTree.push({ mainMessage: msg, children: {} });
|
|
|
this.commentContent = "";
|
|
|
+ ElMessage.success("发送成功");
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
handleReplyClick(target, index) {
|
|
|
ElMessageBox.prompt("请输入评论内容", "回复", {
|
|
|
- confirmButtonText: "OK",
|
|
|
- cancelButtonText: "Cancel",
|
|
|
+ confirmButtonText: "发送",
|
|
|
+ cancelButtonText: "取消",
|
|
|
})
|
|
|
- .then(({value}) => {
|
|
|
+ .then(({ value }) => {
|
|
|
if (value === "") {
|
|
|
ElMessage.error("无法发表空评论");
|
|
|
} else {
|
|
|
@@ -761,8 +761,13 @@ export default {
|
|
|
})
|
|
|
.then(res => {
|
|
|
const msg = res.data.data;
|
|
|
+ msg.createdAt = this.timestampToTime(msg.createdAt);
|
|
|
+ if (msg.targetId === this.commentTree[index].mainMessage.id) {
|
|
|
+ msg.targetId = null;
|
|
|
+ }
|
|
|
this.commentTree[index].children[msg.id] = msg;
|
|
|
this.commentContent = "";
|
|
|
+ ElMessage.success("发送成功");
|
|
|
});
|
|
|
}
|
|
|
});
|