From 293e867a1e1df7d5dcab65cf0f47882b8a72d4e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E5=B8=85?= Date: Mon, 18 Aug 2025 18:46:36 +0800 Subject: [PATCH] =?UTF-8?q?1.bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TbMajorClassServiceImpl.java | 5 ++-- .../mapper/hezhi/TbMajorClassMapper.xml | 1 + ruoyi-ui/src/views/hezhi/notice/index.vue | 24 ++++++++++++++----- 3 files changed, 22 insertions(+), 8 deletions(-) diff --git a/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbMajorClassServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbMajorClassServiceImpl.java index 151970c..433a813 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbMajorClassServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/hezhi/service/impl/TbMajorClassServiceImpl.java @@ -231,8 +231,9 @@ public class TbMajorClassServiceImpl implements ITbMajorClassService Map majorCourseInfo = tbMajorClassMapper.getMajorCourseInfo(params); if (!majorCourseInfo.isEmpty()) { long courseId = MapUtils.getLong(majorCourseInfo, "courseId"); - majorCourseInfo.put("courseSyllabus", courseChapterService.getCourseChapterTreeList(courseId)); - + if (majorCourseInfo.get("courseSyllabus") == null) { + majorCourseInfo.put("courseSyllabus", courseChapterService.getCourseChapterTreeList(courseId)); + } HashMap map = new HashMap<>(); map.put("courseId", courseId); majorCourseInfo.put("teacherList", tbTeacherCourseService.getTeacherList(map)); diff --git a/ruoyi-system/src/main/resources/mapper/hezhi/TbMajorClassMapper.xml b/ruoyi-system/src/main/resources/mapper/hezhi/TbMajorClassMapper.xml index 1533be9..8e0be84 100644 --- a/ruoyi-system/src/main/resources/mapper/hezhi/TbMajorClassMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/hezhi/TbMajorClassMapper.xml @@ -279,6 +279,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" CONVERT(IFNULL(tc.course_details, ''), CHAR) AS courseDetails, CONVERT(IFNULL(tc.course_overview, ''), CHAR) AS courseOverview, + CONVERT(IFNULL(tc.course_syllabus, ''), CHAR) AS courseSyllabus, CONVERT(IFNULL(tc.course_knowledge, ''), CHAR) AS courseKnowledge, CONVERT(IFNULL(tc.course_certificate, ''), CHAR) AS courseCertificate, CONVERT(IFNULL(tc.course_information, ''), CHAR) AS courseInformation diff --git a/ruoyi-ui/src/views/hezhi/notice/index.vue b/ruoyi-ui/src/views/hezhi/notice/index.vue index 9d71992..18d7c27 100644 --- a/ruoyi-ui/src/views/hezhi/notice/index.vue +++ b/ruoyi-ui/src/views/hezhi/notice/index.vue @@ -303,7 +303,19 @@ export default { publicationTime: [ { required: true, message: "发布时间不能为空", trigger: "blur" }, ], - content: [{ required: true, message: "内容不能为空", trigger: "blur" }], + content: [ + { required: true, message: "内容不能为空", trigger: "blur" }, + { + validator: (rule, value, callback) => { + if (!value || value.replace(/<[^>]+>/g, '').trim() === '') { + callback(new Error('请输入有效内容')); + } else { + callback(); + } + }, + trigger: 'blur' + } + ], updateTime: [ { required: true, message: "更新时间不能为空", trigger: "blur" }, ], @@ -361,7 +373,7 @@ export default { showImg: null, publisher: this.$store.getters.name, publicationTime: null, - content: null, + content: undefined, createTime: null, createBy: null, updateTime: null, @@ -414,10 +426,10 @@ export default { if (this.form.type !== 1) { this.form.typeTwo = 0; } - if (this.form.content.length <= 11) { - this.$modal.msgError('内容不能为空') - return - } + // if (this.form.content.length <= 11) { + // this.$modal.msgError('内容不能为空') + // return + // } if (this.form.noticeId != null) { updateNotice(this.form).then((response) => { -- 2.22.0