From 60f36888d7bb2864e1c52ae715f0b1e48e002ac4 Mon Sep 17 00:00:00 2001 From: peihaoyu <617594538@qq.com> Date: Fri, 10 Apr 2020 16:14:11 +0800 Subject: [PATCH] '' --- HSLink-back/pom.xml | 6 + .../qinxx/hslink/controller/HSController.java | 42 +++ .../com/qinxx/hslink/dao/HSLinkMapper.java | 35 ++ .../qinxx/hslink/dao/mapping/HSLinkMapper.xml | 90 ++++++ .../com/qinxx/hslink/service/HSService.java | 25 ++ .../hslink/service/impl/HSServiceImpl.java | 69 ++++ HSLink-front/package.json | 1 + HSLink-front/src/api/index.js | 4 +- HSLink-front/src/assets/css/public.css | 3 + HSLink-front/src/assets/img/score.png | Bin 0 -> 181 bytes HSLink-front/src/assets/js/public.js | 30 ++ HSLink-front/src/components/AddArticle.vue | 174 ++++++++++ HSLink-front/src/components/Content.vue | 32 +- HSLink-front/src/components/Homepage.vue | 230 ++++++++------ HSLink-front/src/components/Login.vue | 2 + HSLink-front/src/components/MyClass.vue | 299 +++++++++++++++++- .../src/components/ParentsProposal.vue | 121 ++++++- HSLink-front/src/components/PersonalInfo.vue | 277 ++++++++++++++++ HSLink-front/src/components/SchoolNotice.vue | 134 +++++++- HSLink-front/src/components/Search.vue | 140 ++++++++ .../src/components/StudentThought.vue | 125 +++++++- .../src/components/components/Mdeditor.vue | 8 +- HSLink-front/src/router/index.js | 12 +- 23 files changed, 1725 insertions(+), 134 deletions(-) create mode 100644 HSLink-front/src/assets/img/score.png create mode 100644 HSLink-front/src/assets/js/public.js create mode 100644 HSLink-front/src/components/AddArticle.vue create mode 100644 HSLink-front/src/components/PersonalInfo.vue create mode 100644 HSLink-front/src/components/Search.vue 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 0000000000000000000000000000000000000000..e9a427a2f0c797ca849ac50269bfb48b0bea28e7 GIT binary patch literal 181 zcmZ?wbh9u| + + +
+ +
+
+ +
+ +
+
+
+
+ +
+
+
+ +
+
+ 发 表 +
+
    +
  • 请遵守HSLink用户行为准则,不得违反国家法律法规。
  • +
  • 转载文章请注明出自“HSLink”,如是商业用途请联系原作者。
  • +
  • 为了维护良好的技术讨论环境,请不要讨论政治 相关话题。
  • +
+
+
+
+ + + + + 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') + }, ] }