diff --git a/HSLink-back/pom.xml b/HSLink-back/pom.xml index 321b0fd..d5f17a5 100644 --- a/HSLink-back/pom.xml +++ b/HSLink-back/pom.xml @@ -51,6 +51,12 @@ + + org.projectlombok + lombok + true + + diff --git a/HSLink-back/src/main/java/com/qinxx/hslink/controller/HSController.java b/HSLink-back/src/main/java/com/qinxx/hslink/controller/HSController.java index de250c1..94c7db3 100644 --- a/HSLink-back/src/main/java/com/qinxx/hslink/controller/HSController.java +++ b/HSLink-back/src/main/java/com/qinxx/hslink/controller/HSController.java @@ -51,6 +51,14 @@ public class HSController { return result; } + //查询某些条件数据 + @RequestMapping(value = "/getListByAttribute", method = {RequestMethod.POST,RequestMethod.GET}) + @ResponseBody + public Map getListByAttribute(@RequestBody Map param) { + Map result = hsService.getListByAttribute(param); + return result; + } + //新增留言 @RequestMapping(value = "/addMessage", method = {RequestMethod.POST,RequestMethod.GET}) @ResponseBody @@ -59,4 +67,38 @@ public class HSController { return result; } + //新增留言 + @RequestMapping(value = "/addArticle", method = {RequestMethod.POST,RequestMethod.GET}) + @ResponseBody + public Map addArticle(@RequestBody Map param) { + Map result = hsService.addArticle(param); + return result; + } + + //获取班级信息 + @RequestMapping(value = "/getClassInfo", method = {RequestMethod.POST,RequestMethod.GET}) + @ResponseBody + public Map getClassInfo(@RequestBody Map param) { + Map result = hsService.getClassInfo(param); + return result; + } + + //新增班级公告 + @RequestMapping(value = "/addBulletin", method = {RequestMethod.POST,RequestMethod.GET}) + @ResponseBody + public Map addBulletin(@RequestBody Map param) { + Map result = hsService.addBulletin(param); + return result; + } + + //修改班级公告 + @RequestMapping(value = "/updateBulletin", method = {RequestMethod.POST,RequestMethod.GET}) + @ResponseBody + public Map updateBulletin(@RequestBody Map param) { + Map result = hsService.updateBulletin(param); + return result; + } + + + } diff --git a/HSLink-back/src/main/java/com/qinxx/hslink/dao/HSLinkMapper.java b/HSLink-back/src/main/java/com/qinxx/hslink/dao/HSLinkMapper.java index e1259fc..5017067 100644 --- a/HSLink-back/src/main/java/com/qinxx/hslink/dao/HSLinkMapper.java +++ b/HSLink-back/src/main/java/com/qinxx/hslink/dao/HSLinkMapper.java @@ -44,8 +44,43 @@ public interface HSLinkMapper { */ List> getOneLeaveMessage(Map param); + /** + * 查询某些条件数据 + */ + List> getListByAttribute(Map param); + /** * 新增留言 */ int addMessage(Map param); + + /** + * 新增文章 + */ + int addArticle(Map param); + + /** + * 获取班级公告 + */ + Map getClassBulletin(Map param); + + /** + * 获取班级公告 + */ + List> getClassNotice(Map param); + + /** + * 获取班级成员 + */ + List> getStudents(Map param); + + /** + * 新增班级公告 + */ + int addBulletin(Map param); + + /** + * 修改班级公告 + */ + int updateBulletin(Map param); } diff --git a/HSLink-back/src/main/java/com/qinxx/hslink/dao/mapping/HSLinkMapper.xml b/HSLink-back/src/main/java/com/qinxx/hslink/dao/mapping/HSLinkMapper.xml index c7ccaf2..f254706 100644 --- a/HSLink-back/src/main/java/com/qinxx/hslink/dao/mapping/HSLinkMapper.xml +++ b/HSLink-back/src/main/java/com/qinxx/hslink/dao/mapping/HSLinkMapper.xml @@ -31,6 +31,7 @@ label, title, content, + user_id, real_name, release_time FROM @@ -52,6 +53,7 @@ label, title, content, + user_id, real_name, release_time FROM @@ -73,6 +75,7 @@ label, title, content, + user_id, real_name, release_time FROM @@ -113,8 +116,95 @@ '' header_photot from hs_leave_message left join hs_user on messager_id = user_id where notice_id = #{id} ORDER BY create_time desc + + + insert into hs_leave_message(id,notice_id,messager_id,content,create_time) VALUES (uuid(),#{noticeId},#{userId},#{content},#{createTime}) + + + + insert into hs_notice (id,label,title,content,release_id,release_time,type) + values + (uuid(),#{label},#{title},#{content},#{release_id},#{release_time},#{type}) + + + + + + + + + + + + + + insert into hs_class_bulletin (id,class_id,class_name,title,content,release_time) VALUES (uuid(),#{classId},#{className},#{title},#{content},#{releaseTime}) + + + + + update hs_class_bulletin set class_id = #{classId},class_name=#{className},title=#{title},content=#{content},release_time=#{releaseTime} where id = #{id} + + \ No newline at end of file diff --git a/HSLink-back/src/main/java/com/qinxx/hslink/service/HSService.java b/HSLink-back/src/main/java/com/qinxx/hslink/service/HSService.java index bda35dc..34b6c74 100644 --- a/HSLink-back/src/main/java/com/qinxx/hslink/service/HSService.java +++ b/HSLink-back/src/main/java/com/qinxx/hslink/service/HSService.java @@ -28,8 +28,33 @@ public interface HSService { */ Map getOneContent(Map param); + /** + * 查询某些条件数据 + */ + Map getListByAttribute(Map param); + /** * 新增留言 */ Map addMessage(Map param); + + /** + * 新增留言 + */ + Map addArticle(Map param); + + /** + * 获取班级信息 + */ + Map getClassInfo(Map param); + + /** + * 新增班级公告 + */ + Map addBulletin(Map param); + + /** + * 修改班级公告 + */ + Map updateBulletin(Map param); } \ No newline at end of file diff --git a/HSLink-back/src/main/java/com/qinxx/hslink/service/impl/HSServiceImpl.java b/HSLink-back/src/main/java/com/qinxx/hslink/service/impl/HSServiceImpl.java index 1850f3e..bf4ed7e 100644 --- a/HSLink-back/src/main/java/com/qinxx/hslink/service/impl/HSServiceImpl.java +++ b/HSLink-back/src/main/java/com/qinxx/hslink/service/impl/HSServiceImpl.java @@ -66,6 +66,15 @@ public class HSServiceImpl implements HSService { return result; } + @Override + public Map getListByAttribute(Map param) { + Map result = new HashMap<>(); + List> res = hsLinkMapper.getListByAttribute(param); + result.put("data",res); + result.put("success",true); + return result; + } + @Override public Map addMessage(Map param) { int res = 0; @@ -80,4 +89,64 @@ public class HSServiceImpl implements HSService { result.put("success",true); return result; } + + @Override + public Map addArticle(Map param) { + Map result = new HashMap<>(); + int res = 0; + try { + res = hsLinkMapper.addArticle(param); + } catch (Exception e) { + e.printStackTrace(); + res = 0; + } + result.put("data",res); + result.put("success",true); + return result; + } + + @Override + public Map getClassInfo(Map param) { + Map result = new HashMap<>(); + Map res = new HashMap<>(); + Map res1 = hsLinkMapper.getClassBulletin(param); + List> res2 = hsLinkMapper.getClassNotice(param); + List> res3 = hsLinkMapper.getStudents(param); + res.put("bulletin",res1); + res.put("noticeList",res2); + res.put("students",res3); + result.put("data",res); + result.put("success",true); + return result; + } + + @Override + public Map addBulletin(Map param) { + Map result = new HashMap<>(); + int res = 0; + try { + res = hsLinkMapper.addBulletin(param); + } catch (Exception e) { + e.printStackTrace(); + res = 0; + } + result.put("data",res); + result.put("success",true); + return result; + } + + @Override + public Map updateBulletin(Map param) { + Map result = new HashMap<>(); + int res = 0; + try { + res = hsLinkMapper.updateBulletin(param); + } catch (Exception e) { + e.printStackTrace(); + res = 0; + } + result.put("data",res); + result.put("success",true); + return result; + } } diff --git a/HSLink-front/package.json b/HSLink-front/package.json index 220fd06..0dfcac9 100644 --- a/HSLink-front/package.json +++ b/HSLink-front/package.json @@ -12,6 +12,7 @@ "dependencies": { "axios": "^0.19.2", "element-ui": "^2.13.0", + "jquery": "^3.4.1", "marked": "^0.8.2", "vue": "^2.5.2", "vue-router": "^3.0.1", diff --git a/HSLink-front/src/api/index.js b/HSLink-front/src/api/index.js index edc4ca3..02ba068 100644 --- a/HSLink-front/src/api/index.js +++ b/HSLink-front/src/api/index.js @@ -1,9 +1,9 @@ // 配置API接口地址 import de from "element-ui/src/locale/lang/de"; -// let root = 'http://192.168.10.29:8008' +let root = 'http://192.168.10.29:8048' // let root = 'http://123.57.22.91:8002' -let root = 'http://127.0.0.1:8048' +// let root = 'http://127.0.0.1:8048' // 引用axios let axios = require('axios') // 自定义判断元素类型JS diff --git a/HSLink-front/src/assets/css/public.css b/HSLink-front/src/assets/css/public.css index efbf205..6a96236 100644 --- a/HSLink-front/src/assets/css/public.css +++ b/HSLink-front/src/assets/css/public.css @@ -4,6 +4,9 @@ html { .default-color{ color: #666!important; } +.grey{ + color: #999; +} .pointer{ cursor: pointer!important; } diff --git a/HSLink-front/src/assets/img/score.png b/HSLink-front/src/assets/img/score.png new file mode 100644 index 0000000..e9a427a Binary files /dev/null and b/HSLink-front/src/assets/img/score.png differ diff --git a/HSLink-front/src/assets/js/public.js b/HSLink-front/src/assets/js/public.js new file mode 100644 index 0000000..85fa449 --- /dev/null +++ b/HSLink-front/src/assets/js/public.js @@ -0,0 +1,30 @@ +const getDate = function() { + let day2 = new Date(); + day2.setTime(day2.getTime()); + let month; + let day; + let hours; + let minutes; + if(day2.getMonth() < 9 ) { + month = "0"+(day2.getMonth()+1) + } else { + month = (day2.getMonth()+1) + } + if (day2.getDate() < 10) { + day = "0"+day2.getDate(); + } else { + day = day2.getDate(); + } + if (day2.getHours() < 10) { + hours = "0"+day2.getHours(); + } else { + hours = day2.getHours(); + } + if (day2.getMinutes() < 10) { + minutes = "0"+day2.getMinutes(); + } else { + minutes = day2.getMinutes(); + } + return day2.getFullYear()+"-" + month + "-" + day+" "+hours+":"+minutes +} + export { getDate } diff --git a/HSLink-front/src/components/AddArticle.vue b/HSLink-front/src/components/AddArticle.vue new file mode 100644 index 0000000..6f7a8e1 --- /dev/null +++ b/HSLink-front/src/components/AddArticle.vue @@ -0,0 +1,174 @@ + + + + + diff --git a/HSLink-front/src/components/Content.vue b/HSLink-front/src/components/Content.vue index 62468a1..2bc1dfd 100644 --- a/HSLink-front/src/components/Content.vue +++ b/HSLink-front/src/components/Content.vue @@ -2,13 +2,16 @@
+ +

{{all.title}}

作者: {{all.author_name}} - 发布时间:{{all.creat_time}} + 发布时间: + {{all.create_time}}
- 文章标签: + 文章标签: {{all.label}}
@@ -116,16 +119,23 @@ }) }, methods: { + goBack() { + this.$router.back(-1) + }, messages() { this.$prompt('请输入留言', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', - inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/, - inputErrorMessage: '邮箱格式不正确' + inputValidator: (value) => { + if(!value) { + return '输入不能为空'; + } + }, + inputErrorMessage: '不能为空' }).then(({ value }) => { let day2 = new Date(); day2.setTime(day2.getTime()); - let date = day2.getFullYear()+"-" + (day2.getMonth()+1) + "-" + day2.getDate()+" "+day2.getHours()+"-"+day2.getMinutes() + let date = day2.getFullYear()+"-" + (day2.getMonth()+1) + "-" + day2.getDate()+" "+day2.getHours()+":"+day2.getMinutes() this.$ajax.post("/hs/addMessage",{noticeId:sessionStorage.getItem("noticeId"),content:value, createTime:date,userId:JSON.parse(sessionStorage.getItem("userInfo")).user_id},r=>{ if (r == "1") { @@ -135,7 +145,12 @@ }); this.$ajax.post("/hs/getOneContent", { id: sessionStorage.getItem("noticeId") - }, r => {this.message = r.message;}) + }, r => { + this.message = r.message; + for (let i = 0; i < this.message.length; i++) { + this.message[i].header_photo = this.message[i].real_name.substring(0, 1) + } + }) } }) }).catch(() => { @@ -164,6 +179,9 @@ } diff --git a/HSLink-front/src/components/ParentsProposal.vue b/HSLink-front/src/components/ParentsProposal.vue index 1d1cc9e..6cf1582 100644 --- a/HSLink-front/src/components/ParentsProposal.vue +++ b/HSLink-front/src/components/ParentsProposal.vue @@ -1,19 +1,132 @@ diff --git a/HSLink-front/src/components/PersonalInfo.vue b/HSLink-front/src/components/PersonalInfo.vue new file mode 100644 index 0000000..705b702 --- /dev/null +++ b/HSLink-front/src/components/PersonalInfo.vue @@ -0,0 +1,277 @@ + + + + + diff --git a/HSLink-front/src/components/SchoolNotice.vue b/HSLink-front/src/components/SchoolNotice.vue index 4faede6..e76199d 100644 --- a/HSLink-front/src/components/SchoolNotice.vue +++ b/HSLink-front/src/components/SchoolNotice.vue @@ -1,40 +1,162 @@ - diff --git a/HSLink-front/src/components/StudentThought.vue b/HSLink-front/src/components/StudentThought.vue index 3e7872d..1ba0737 100644 --- a/HSLink-front/src/components/StudentThought.vue +++ b/HSLink-front/src/components/StudentThought.vue @@ -1,17 +1,132 @@ diff --git a/HSLink-front/src/components/components/Mdeditor.vue b/HSLink-front/src/components/components/Mdeditor.vue index 8a019e0..2923652 100644 --- a/HSLink-front/src/components/components/Mdeditor.vue +++ b/HSLink-front/src/components/components/Mdeditor.vue @@ -43,7 +43,7 @@ import Vue from 'vue' import marked from 'marked' import scroll from 'vue-scroll' - import hljs from '../../assets/js/highlight.min.js' + // import ranges from '../../assets/js/highlight.min.js' import range from '../../assets/js/rangeFn.js' Vue.use(scroll) marked.setOptions({ @@ -55,9 +55,9 @@ sanitize: false, smartLists: true, smartypants: false, - highlight: function(code) { - return hljs.highlightAuto(code).value - } + /*highlight: function(code) { + return ranges.highlightAuto(code).value + }*/ }); function insertContent(val, that) { diff --git a/HSLink-front/src/router/index.js b/HSLink-front/src/router/index.js index 0d4c1b4..b437454 100644 --- a/HSLink-front/src/router/index.js +++ b/HSLink-front/src/router/index.js @@ -49,7 +49,17 @@ export default new Router({ path:'content', name:'content', component:() => import('@/components/Content') - } + }, + { + path:'search', + name:'search', + component:() => import('@/components/Search') + }, + { + path:'personalinfo', + name:'personalinfo', + component:() => import('@/components/PersonalInfo') + }, ] }