This commit is contained in:
裴浩宇 2020-04-10 16:14:11 +08:00
parent 689354dff2
commit 60f36888d7
23 changed files with 1725 additions and 134 deletions

View File

@ -51,6 +51,12 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<optional>true</optional>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -51,6 +51,14 @@ public class HSController {
return result; return result;
} }
//查询某些条件数据
@RequestMapping(value = "/getListByAttribute", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody
public Map<String,Object> getListByAttribute(@RequestBody Map<String,Object> param) {
Map<String,Object> result = hsService.getListByAttribute(param);
return result;
}
//新增留言 //新增留言
@RequestMapping(value = "/addMessage", method = {RequestMethod.POST,RequestMethod.GET}) @RequestMapping(value = "/addMessage", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody @ResponseBody
@ -59,4 +67,38 @@ public class HSController {
return result; return result;
} }
//新增留言
@RequestMapping(value = "/addArticle", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody
public Map<String,Object> addArticle(@RequestBody Map<String,Object> param) {
Map<String,Object> result = hsService.addArticle(param);
return result;
}
//获取班级信息
@RequestMapping(value = "/getClassInfo", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody
public Map<String,Object> getClassInfo(@RequestBody Map<String,Object> param) {
Map<String,Object> result = hsService.getClassInfo(param);
return result;
}
//新增班级公告
@RequestMapping(value = "/addBulletin", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody
public Map<String,Object> addBulletin(@RequestBody Map<String,Object> param) {
Map<String,Object> result = hsService.addBulletin(param);
return result;
}
//修改班级公告
@RequestMapping(value = "/updateBulletin", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody
public Map<String,Object> updateBulletin(@RequestBody Map<String,Object> param) {
Map<String,Object> result = hsService.updateBulletin(param);
return result;
}
} }

View File

@ -44,8 +44,43 @@ public interface HSLinkMapper {
*/ */
List<Map<String,Object>> getOneLeaveMessage(Map<String,Object> param); List<Map<String,Object>> getOneLeaveMessage(Map<String,Object> param);
/**
* 查询某些条件数据
*/
List<Map<String,Object>> getListByAttribute(Map<String,Object> param);
/** /**
* 新增留言 * 新增留言
*/ */
int addMessage(Map<String,Object> param); int addMessage(Map<String,Object> param);
/**
* 新增文章
*/
int addArticle(Map<String,Object> param);
/**
* 获取班级公告
*/
Map<String,Object> getClassBulletin(Map<String,Object> param);
/**
* 获取班级公告
*/
List<Map<String,Object>> getClassNotice(Map<String,Object> param);
/**
* 获取班级成员
*/
List<Map<String,Object>> getStudents(Map<String,Object> param);
/**
* 新增班级公告
*/
int addBulletin(Map<String,Object> param);
/**
* 修改班级公告
*/
int updateBulletin(Map<String,Object> param);
} }

View File

@ -31,6 +31,7 @@
label, label,
title, title,
content, content,
user_id,
real_name, real_name,
release_time release_time
FROM FROM
@ -52,6 +53,7 @@
label, label,
title, title,
content, content,
user_id,
real_name, real_name,
release_time release_time
FROM FROM
@ -73,6 +75,7 @@
label, label,
title, title,
content, content,
user_id,
real_name, real_name,
release_time release_time
FROM 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 '' header_photot from hs_leave_message left join hs_user on messager_id = user_id where notice_id = #{id} ORDER BY create_time desc
</select> </select>
<!--获取某些条件的数据-->
<select id="getListByAttribute" resultType="map" parameterType="map">
SELECT
s.id,
label,
title,
content,
user_id,
real_name,
release_time,
u.real_name,
u.integral,
'' header_photo,
type
FROM
hs_notice s left join hs_user u on s.release_id = u.user_id
where 1 = 1
<if test="releaseId != null and releaseId != ''">
and release_id = #{releaseId}
</if>
<if test="release_time != null and release_time != ''">
and release_time like CONCAT('%',#{release_time},'%')
</if>
<if test="type != null and type != ''">
and type = #{type}
</if>
and (label like CONCAT('%',#{text},'%')
or title like CONCAT('%',#{text},'%')
or content like CONCAT('%',#{text},'%')
or real_name like CONCAT('%',#{text},'%'))
ORDER BY release_time desc
</select>
<!--新增留言--> <!--新增留言-->
<insert id="addMessage" parameterType="map"> <insert id="addMessage" parameterType="map">
insert into hs_leave_message(id,notice_id,messager_id,content,create_time) VALUES (uuid(),#{noticeId},#{userId},#{content},#{createTime}) insert into hs_leave_message(id,notice_id,messager_id,content,create_time) VALUES (uuid(),#{noticeId},#{userId},#{content},#{createTime})
</insert> </insert>
<!--新增文章-->
<insert id="addArticle" parameterType="map">
insert into hs_notice (id,label,title,content,release_id,release_time,type)
values
(uuid(),#{label},#{title},#{content},#{release_id},#{release_time},#{type})
</insert>
<!--获取班级公告-->
<select id="getClassBulletin" parameterType="map" resultType="map">
SELECT
DISTINCT
id,
c.class_id,
c.class_name,
title,
content,
release_time
FROM
hs_class_bulletin c
left JOIN hs_user u ON c.class_name = u.class_name
WHERE
c.class_name = ( SELECT class_name FROM hs_user WHERE user_id = #{id} )
</select>
<!--获取班级通知-->
<select id="getClassNotice" parameterType="map" resultType="map">
select * from hs_class_notice left join hs_user on release_id = user_id
where hs_class_notice.class_name = (select class_name from hs_user
where user_id = #{id})
<if test="text != null and text != ''">
and (label like CONCAT('%',#{text},'%')
or title like CONCAT('%',#{text},'%')
or content like CONCAT('%',#{text},'%')
or real_name like CONCAT('%','五一','%'))
</if>
ORDER BY release_time desc
</select>
<!--获取班级成员-->
<select id="getStudents" parameterType="map" resultType="map">
select * from hs_user where class_name = (select class_name from hs_user where user_id = #{id})
</select>
<!--新增班级公告-->
<insert id="addBulletin" parameterType="map">
insert into hs_class_bulletin (id,class_id,class_name,title,content,release_time) VALUES (uuid(),#{classId},#{className},#{title},#{content},#{releaseTime})
</insert>
<!--修改班级公告-->
<update id="updateBulletin" parameterType="map">
update hs_class_bulletin set class_id = #{classId},class_name=#{className},title=#{title},content=#{content},release_time=#{releaseTime} where id = #{id}
</update>
</mapper> </mapper>

View File

@ -28,8 +28,33 @@ public interface HSService {
*/ */
Map<String,Object> getOneContent(Map<String,Object> param); Map<String,Object> getOneContent(Map<String,Object> param);
/**
* 查询某些条件数据
*/
Map<String,Object> getListByAttribute(Map<String,Object> param);
/** /**
* 新增留言 * 新增留言
*/ */
Map<String,Object> addMessage(Map<String,Object> param); Map<String,Object> addMessage(Map<String,Object> param);
/**
* 新增留言
*/
Map<String,Object> addArticle(Map<String,Object> param);
/**
* 获取班级信息
*/
Map<String,Object> getClassInfo(Map<String,Object> param);
/**
* 新增班级公告
*/
Map<String,Object> addBulletin(Map<String,Object> param);
/**
* 修改班级公告
*/
Map<String,Object> updateBulletin(Map<String,Object> param);
} }

View File

@ -66,6 +66,15 @@ public class HSServiceImpl implements HSService {
return result; return result;
} }
@Override
public Map<String, Object> getListByAttribute(Map<String, Object> param) {
Map<String, Object> result = new HashMap<>();
List<Map<String, Object>> res = hsLinkMapper.getListByAttribute(param);
result.put("data",res);
result.put("success",true);
return result;
}
@Override @Override
public Map<String, Object> addMessage(Map<String, Object> param) { public Map<String, Object> addMessage(Map<String, Object> param) {
int res = 0; int res = 0;
@ -80,4 +89,64 @@ public class HSServiceImpl implements HSService {
result.put("success",true); result.put("success",true);
return result; return result;
} }
@Override
public Map<String, Object> addArticle(Map<String, Object> param) {
Map<String, Object> 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<String, Object> getClassInfo(Map<String, Object> param) {
Map<String, Object> result = new HashMap<>();
Map<String, Object> res = new HashMap<>();
Map<String, Object> res1 = hsLinkMapper.getClassBulletin(param);
List<Map<String, Object>> res2 = hsLinkMapper.getClassNotice(param);
List<Map<String, Object>> 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<String, Object> addBulletin(Map<String, Object> param) {
Map<String, Object> 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<String, Object> updateBulletin(Map<String, Object> param) {
Map<String, Object> 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;
}
} }

View File

@ -12,6 +12,7 @@
"dependencies": { "dependencies": {
"axios": "^0.19.2", "axios": "^0.19.2",
"element-ui": "^2.13.0", "element-ui": "^2.13.0",
"jquery": "^3.4.1",
"marked": "^0.8.2", "marked": "^0.8.2",
"vue": "^2.5.2", "vue": "^2.5.2",
"vue-router": "^3.0.1", "vue-router": "^3.0.1",

View File

@ -1,9 +1,9 @@
// 配置API接口地址 // 配置API接口地址
import de from "element-ui/src/locale/lang/de"; 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://123.57.22.91:8002'
let root = 'http://127.0.0.1:8048' // let root = 'http://127.0.0.1:8048'
// 引用axios // 引用axios
let axios = require('axios') let axios = require('axios')
// 自定义判断元素类型JS // 自定义判断元素类型JS

View File

@ -4,6 +4,9 @@ html {
.default-color{ .default-color{
color: #666!important; color: #666!important;
} }
.grey{
color: #999;
}
.pointer{ .pointer{
cursor: pointer!important; cursor: pointer!important;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

View File

@ -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 }

View File

@ -0,0 +1,174 @@
<template>
<el-container>
<el-main>
<div class="choice-plate">
<el-input v-model="label" placeholder="输入文章标签"></el-input>
</div>
<div class="title">
<el-input v-model="title" placeholder="输入文章标题"></el-input>
</div>
<div class="indexContainer">
<div class="maskContainer" v-if="dilogStatus">
<div class="contentContainer">
<div class="closeBtnContainer" @click="closeMaskFn"></div>
<textarea class="showAreaContainer" v-model="msgShow" readonly></textarea>
</div>
</div>
<div class="editorContainer">
<markdown
:mdValuesP="msg.mdValue"
:fullPageStatusP="false"
:editStatusP="true"
:previewStatusP="true"
:navStatusP="true"
:icoStatusP="true"
@childevent="childEventHandler"
ref="markdown"
></markdown>
</div>
</div>
<el-button class="" type="primary" @click="publish"> </el-button>
<div class="notes">
<ul>
<li>请遵守HSLink用户行为准则不得违反国家法律法规</li>
<li>转载文章请注明出自HSLink如是商业用途请联系原作者</li>
<li>为了维护良好的技术讨论环境请不要讨论政治 相关话题</li>
</ul>
</div>
</el-main>
</el-container>
</template>
<script>
import markdown from './components/Mdeditor'
import { getDate } from '../assets/js/public.js'
export default {
name: "Posting",
data() {
return {
label: "",
title:"",
type:'',
msgShow:'我要显示的内容',
dilogStatus:false,
msg: {
mdValue:''
},
flag:false,
}
},
mounted() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
if (userInfo.user_type == "教师") {
this.$emit("editorTitle","新增校园通知")
this.type = "校园通知"
} else if (userInfo.user_type == "家长") {
this.$emit("editorTitle","新增家长建议")
this.type = "家长建议"
} else if (userInfo.user_type == "学生") {
this.$emit("editorTitle","新增学生想法")
this.type = "学生想法"
}
},
methods: {
goBack() {
this.$router.back(-1)
},
childEventHandler:function(res){
// resdata,mdValuehtmlValue
this.msg=res;
},
closeMaskFn:function(){
this.msgShow='';
this.dilogStatus=false;
},
handleChange(value) {
console.log(value);
},
publish() {
if (this.label.length != 4) {
this.$message({
message: "文章标签只能为4个汉字",
type: "warning"
})
} else if (this.title == '') {
this.$message({
message: "文章标题不能为空",
type: "warning"
})
} else if (this.msg.mdValue == '') {
this.$message({
message: "编辑内容不能为空",
type: "warning"
})
} else {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
this.$ajax.post("/hs/addArticle",{label:this.label,title:this.title,content:this.msg.mdValue,release_id:userInfo.user_id,
release_time:getDate(),type:this.type},r=>{
if (r == "1") {
this.$message({
message: "发表成功",
type: "success"
});
this.$emit("goInfo");
this.$emit("refresh");
}
})
}
}
},
components: {
markdown
},
}
</script>
<style scoped>
.el-page-header{
padding-bottom: 1rem;
}
.page-title{
font-size: 1.5rem;
padding: 0 1rem 1rem 0;
cursor: default;
font-family: 楷体;
}
.notes{
border: 1px dashed #999;
}
.el-button--primary{
margin: 1rem;
}
.choice-plate{
padding-bottom: 1rem;
}
.editorContainer{
height: 500px;
}
.integral img{
display: inline-block;
margin: 1rem 0.5rem;
float: left;
}
.integral{
width: 12rem;
}
.integral div{
line-height: 2.4rem;
}
.title{
display: flex;
}
.indexContainer{
}
.el-container{
padding: 0;
}
.el-main{
padding: 1rem;
background: #fff;
overflow: hidden;
}
</style>

View File

@ -2,13 +2,16 @@
<el-container> <el-container>
<el-main> <el-main>
<div class="content"> <div class="content">
<el-page-header @back="goBack" content="">
</el-page-header>
<div class="header"> <div class="header">
<h1>{{all.title}}</h1> <h1>{{all.title}}</h1>
<span>作者</span> <span>作者</span>
<span class="blue pointer authorspan">{{all.author_name}}</span> <span class="blue pointer authorspan">{{all.author_name}}</span>
<span>发布时间:{{all.creat_time}}</span> <span class="margin-right">发布时间</span>
<span class="grey">{{all.create_time}}</span>
<div class="label"> <div class="label">
<span>文章标签:</span> <span>文章标签</span>
<span class="special-text-yellow blue">{{all.label}}</span> <span class="special-text-yellow blue">{{all.label}}</span>
</div> </div>
</div> </div>
@ -116,16 +119,23 @@
}) })
}, },
methods: { methods: {
goBack() {
this.$router.back(-1)
},
messages() { messages() {
this.$prompt('请输入留言', '提示', { this.$prompt('请输入留言', '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消', cancelButtonText: '取消',
inputPattern: /[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?/, inputValidator: (value) => {
inputErrorMessage: '邮箱格式不正确' if(!value) {
return '输入不能为空';
}
},
inputErrorMessage: '不能为空'
}).then(({ value }) => { }).then(({ value }) => {
let day2 = new Date(); let day2 = new Date();
day2.setTime(day2.getTime()); 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, this.$ajax.post("/hs/addMessage",{noticeId:sessionStorage.getItem("noticeId"),content:value,
createTime:date,userId:JSON.parse(sessionStorage.getItem("userInfo")).user_id},r=>{ createTime:date,userId:JSON.parse(sessionStorage.getItem("userInfo")).user_id},r=>{
if (r == "1") { if (r == "1") {
@ -135,7 +145,12 @@
}); });
this.$ajax.post("/hs/getOneContent", { this.$ajax.post("/hs/getOneContent", {
id: sessionStorage.getItem("noticeId") 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(() => { }).catch(() => {
@ -164,6 +179,9 @@
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.margin-right{
margin-left: 1rem;
}
.message{ .message{
margin: 1rem 1rem 0 0; margin: 1rem 1rem 0 0;
float: right; float: right;
@ -269,7 +287,7 @@
margin-right: 1rem; margin-right: 1rem;
} }
.header span:nth-child(-n+4){ .header span:nth-child(-n+4){
margin-right: 0.5rem; /*margin-right: 0.5rem;*/
} }
.content{ .content{
padding: 1rem; padding: 1rem;

View File

@ -1,5 +1,10 @@
<template> <template>
<el-container> <el-container>
<div class="search">
<el-input class="searchinp" v-model="condition" placeholder="请输入内容" @keydown.enter.native="search"></el-input>
<el-button type="primary" class="searchbtn" @click="search">搜索</el-button>
</div>
<el-main>
<div id="top"> <div id="top">
<div class="school-dynamic"> <div class="school-dynamic">
<div id="title"> <div id="title">
@ -31,11 +36,11 @@
</div> </div>
<div class="content"> <div class="content">
<div class="one theme-font-blue" v-for="item in newestNotice" :data-id="item.id" > <div class="one theme-font-blue" v-for="item in newestNotice" :data-id="item.id" >
<div class="type"> <div class="type" @click="searchLabel(item.label)">
[{{item.label}}] [{{item.label}}]
</div> </div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div> <div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release">{{item.real_name}}</div> <div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
<div class="release-time">{{item.release_time}}</div> <div class="release-time">{{item.release_time}}</div>
</div> </div>
</div> </div>
@ -48,11 +53,9 @@
</div> </div>
<div class="content"> <div class="content">
<div class="one theme-font-blue" v-for="item in goodAdvice" :data-id="item.id"> <div class="one theme-font-blue" v-for="item in goodAdvice" :data-id="item.id">
<div class="type"> <div class="type" @click="searchLabel(item.label)">[{{item.label}}]</div>
[{{item.label}}] <div class="text" @click="getContent(item.id)">{{item.title}}</div>
</div> <div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
<div class="text">{{item.title}}</div>
<div class="release">{{item.real_name}}</div>
<div class="release-time">{{item.release_time}}</div> <div class="release-time">{{item.release_time}}</div>
</div> </div>
</div> </div>
@ -65,11 +68,9 @@
</div> </div>
<div class="content"> <div class="content">
<div class="one theme-font-blue" v-for="item in magicalThinking" :data-id="item.id"> <div class="one theme-font-blue" v-for="item in magicalThinking" :data-id="item.id">
<div class="type"> <div class="type" @click="searchLabel(item.label)">[{{item.label}}]</div>
[{{item.label}}] <div class="text" @click="getContent(item.id)">{{item.title}}</div>
</div> <div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
<div class="text">{{item.title}}</div>
<div class="release">{{item.real_name}}</div>
<div class="release-time">{{item.release_time}}</div> <div class="release-time">{{item.release_time}}</div>
</div> </div>
</div> </div>
@ -103,7 +104,7 @@
</div> </div>
</div> </div>
</div> </div>
</el-main>
</el-container> </el-container>
</template> </template>
@ -112,6 +113,7 @@
name: "Hompage", name: "Hompage",
data() { data() {
return{ return{
condition: '',
newestNotice: '', newestNotice: '',
goodAdvice: '', goodAdvice: '',
magicalThinking: '', magicalThinking: '',
@ -180,19 +182,45 @@
}) })
}, },
methods: { methods: {
searchLabel(label) {
sessionStorage.setItem("condition",label)
this.$router.push({name: "search"})
},
search() {
sessionStorage.setItem("condition",this.condition)
this.$router.push({name: "search"})
},
getContent(id) { getContent(id) {
this.$router.push({name: 'content'}); this.$router.push({name: 'content'});
sessionStorage.setItem("noticeId",id); sessionStorage.setItem("noticeId",id);
},
goPersonalInfo(userId) {
this.$router.push({name: 'personalinfo'});
sessionStorage.setItem("userId",userId);
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.el-main{
padding: 0.5rem 0.001rem;
}
.search{
}
.searchinp{
float: left;
width: calc(100% - 6rem);
}
.searchbtn{
float: left;
width: 6rem;
}
.release-time{ .release-time{
color: #999; color: #999;
text-decoration: none; text-decoration: none!important;
cursor: default; cursor: default!important;
} }
#top{ #top{
background: #fff; background: #fff;
@ -295,7 +323,7 @@
width: 70%; width: 70%;
} }
.right{ .right{
width: 30%; width: calc(30% - 2rem);
padding: 1rem; padding: 1rem;
} }
.one div{ .one div{
@ -370,7 +398,7 @@
background: #fff; background: #fff;
} }
.el-container{ .el-container{
/*padding: 0 20%;*/ /*padding: 0;*/
background: #EEFCFE; background: #EEFCFE;
display: block; display: block;
} }

View File

@ -214,9 +214,11 @@
let flag = false; let flag = false;
this.rememberList.forEach((item)=>{ this.rememberList.forEach((item)=>{
if (item.username == one.username) { if (item.username == one.username) {
item = one;
flag = true; flag = true;
} }
}) })
sessionStorage.setItem("rememberList",JSON.stringify(this.rememberList));
if (flag == false) { if (flag == false) {
this.rememberList.push(one) this.rememberList.push(one)
sessionStorage.setItem("rememberList",JSON.stringify(this.rememberList)); sessionStorage.setItem("rememberList",JSON.stringify(this.rememberList));

View File

@ -1,19 +1,310 @@
<template> <template>
<el-container>
<el-main> <el-main>
<h1>我的班级</h1> <div class="search">
<el-input class="searchinp" v-model="condition" placeholder="请输入内容" @keydown.enter.native="search"></el-input>
<el-button type="primary" class="searchbtn" @click="search">搜索</el-button>
</div>
<div class="class-bulletin">
<div class="title">班级公告</div>
<div class="bulletin">
<div class="text">
<div class="tit">{{bulletin.title}}</div>
<p>{{bulletin.content}}</p>
</div>
<el-button class="editor" @click="editor">编辑</el-button>
</div>
</div>
<div class="list">
<div class="title">班级通知</div>
<div class="one" v-for="item in noticeList" >
<div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
<div class="release-time">{{item.release_time}}</div>
</div>
<p class="sum">{{length}}条数据</p>
</div>
</el-main> </el-main>
<el-aside>
<div class="title">班级成员</div>
<div class="students">
<div class="student" v-for="item in students">
<div class="header pointer">{{item.real_name.substring(0,1)}}</div>
<div class="name pointer special-font-blue" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
<div class="post">{{item.post}}</div>
</div>
</div>
</el-aside>
<el-dialog
title="编辑公告"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose">
<el-form>
<el-form-item label="标题">
<el-input v-model="editors.title" clearable size="small"></el-input>
</el-form-item>
</el-form>
<el-input
type="textarea"
:rows="5"
placeholder="请输入内容"
v-model="editors.content">
</el-input>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="bulletinSubmit"> </el-button>
</span>
</el-dialog>
</el-container>
</template> </template>
<script> <script>
import { getDate } from '../assets/js/public.js'
export default { export default {
name: "MyClass" name: "MyClass",
data() {
return{
condition: '',
editors: {
title: '',
content: '',
},
bulletin: {
title: '班主任和班长可编辑班级公告',
content: '',
},
noticeList: '',
length: '',
students: '',
isNull: false,
dialogVisible: false,
}
},
mounted() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
this.$ajax.post("/hs/getClassInfo",{id:userInfo.user_id},r=>{
if (r.bulletin == null) {
this.isNull = true;
} else {
this.bulletin = r.bulletin;
}
this.noticeList = r. noticeList;
this.length = r. noticeList.length;
this.students = r.students;
})
},
methods: {
bulletinSubmit() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
if (this.isNull === false) {
this.$ajax.post("/hs/updateBulletin",{classId:userInfo.class_id,
className:userInfo.class_name,title:this.editors.title,content:this.editors.content,
releaseTime:getDate(),id:this.bulletin.id},r=>{
if (r === 1) {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
this.$ajax.post("/hs/getClassInfo",{id:userInfo.user_id},r=>{
this.bulletin = r.bulletin;
})
this.$message({
type:'success',
message: '编辑公告成功'
})
}
})
} else {
this.$ajax.post("/hs/addBulletin",{classId:userInfo.class_id,
className:userInfo.class_name,title:this.editors.title,content:this.editors.content,
releaseTime:getDate()},r=>{
if (r === 1) {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
this.$ajax.post("/hs/getClassInfo",{id:userInfo.user_id},r=>{
this.bulletin = r.bulletin;
})
this.$message({
type:'success',
message: '编辑公告成功'
})
}
})
}
this.dialogVisible = false
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
},
editor() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
if (userInfo.user_type === "教师") {
this.dialogVisible = true;
this.editors.title = this.bulletin.title;
this.editors.content = this.bulletin.content;
} else {
this.$message.error("没有权限编辑公告")
}
},
search() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
sessionStorage.setItem("condition",this.condition)
this.$ajax.post("/hs/getClassInfo",{id:userInfo.user_id,text:this.condition},r=>{
this.noticeList = r. noticeList
this.length = r. noticeList.length
})
},
getContent(id) {
this.$router.push({name: 'content'});
sessionStorage.setItem("noticeId",id);
},
goPersonalInfo(userId) {
this.$router.push({name: 'personalinfo'});
sessionStorage.setItem("userId",userId);
},
}
} }
</script> </script>
<style scoped> <style scoped>
.text .tit{
text-align: center;
font-size: 1.2rem;
font-weight: bold;
}
.text p{
text-indent: 2rem;
}
.editor{
float: right;
height: 2.5rem;
}
.class-bulletin{
background: #fff;
margin-bottom: 1rem;
border-radius: 5px;
}
.class-bulletin .title{
padding: 1rem;
font-size: 1.5rem;
}
.list .title{
padding-bottom: 1rem;
font-size: 1.5rem;
}
.class-bulletin .bulletin{
padding: 1rem 1rem 3rem 1rem;
border-radius: 5px;
border: 1px solid #419EFF;
}
.sum{
color: #999;
font-size: 0.9rem;
float: right;
margin-right: 1rem;
}
.list{
background: #fff;
border-radius: 5px;
padding: 1rem 1rem 3rem 1rem;
}
.list .one{
display: flex;
height: 1.5rem;
line-height: 1.5rem;
margin-bottom: 0.5rem;
font-size: 0.9rem;
}
.one div{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
color: #1B94D4;
}
.one div:hover{
text-decoration: underline;
}
.release-time{
color: #999!important;
text-decoration: none!important;
cursor: default!important;
}
.one .type{
flex: 1;
text-decoration: none!important;
cursor: default!important;
}
.one .text{
flex: 4;
}
.one .release{
flex: 1;
}
.one .release-time{
flex: 1;
}
.search{
margin: 0 0 3rem 0;
}
.searchinp{
float: left;
width: calc(100% - 6rem);
}
.searchbtn{
float: left;
width: 6rem;
}
.el-main{ .el-main{
padding: 0; padding: 0;
background: #EEFCFE; background: #EEFCFE;
} }
.el-aside{
width: 10rem!important;
background: #fff;
}
.el-aside .title{
padding: 1rem;
font-size: 1.5rem;
text-align: center;
}
.students .student{
padding: 0 1rem;
font-size: 0.8rem;
display: flex;
height: 1.5rem;
margin-bottom: 0.5rem!important;
margin: 0 auto;
display: flex;
}
.student .header{
height: 1.5rem;
width: 1.5rem;
line-height: 1.5rem;
font-weight: bold;
border-radius: 50%;
background: #3399ea;
color: #fff;
text-align: center;
float: left;
font-size: 1rem;
}
.student .name{
line-height: 1.5rem;
margin-left: 0.5rem;
flex: 1;
}
.student .post{
line-height: 1.5rem;
margin-left: 0.5rem;
cursor: default;
flex: 1;
}
.el-aside{
margin-left: 1rem;
}
</style> </style>

View File

@ -1,19 +1,132 @@
<template> <template>
<el-container>
<el-main> <el-main>
<h1>家长意见</h1> <div class="search">
<el-input class="searchinp" v-model="condition" placeholder="请输入内容" @keydown.enter.native="search"></el-input>
<el-button type="primary" class="searchbtn" @click="search">搜索</el-button>
</div>
<div class="list">
<div class="title">家长建议</div>
<div class="one" v-for="item in adviceList" >
<div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
<div class="release-time">{{item.release_time}}</div>
</div>
<p class="sum">{{length}}条数据</p>
</div>
</el-main> </el-main>
<el-aside>
<footers></footers>
</el-aside>
</el-container>
</template> </template>
<script> <script>
import footers from '../components/components/Footer'
export default { export default {
name: "ParentsOpinion" name: "ParentsOpinion",
data() {
return{
condition: '',
adviceList: '',
length: '',
}
},
mounted() {
this.$ajax.post("/hs/getListByAttribute",{text:"",type:"家长建议"},r=>{
this.adviceList = r
this.length = r.length
})
},
methods: {
search() {
},
getContent(id) {
this.$router.push({name: 'content'});
sessionStorage.setItem("noticeId",id);
},
goPersonalInfo(userId) {
this.$router.push({name: 'personalinfo'});
sessionStorage.setItem("userId",userId);
},
},
components: {
footers
}
} }
</script> </script>
<style scoped> <style scoped>
.el-aside{
margin: -1rem 0 0 1rem;
}
.list .title{
font-size: 1.5rem;
margin-bottom: 1rem;
}
.el-main{ .el-main{
padding: 0; padding: 0;
background: #EEFCFE; background: #EEFCFE;
} }
.sum{
color: #999;
font-size: 0.9rem;
float: right;
margin-right: 1rem;
}
.list{
background: #fff;
border-radius: 5px;
padding: 1rem 1rem 3rem 1rem;
}
.list .one{
display: flex;
height: 1.5rem;
line-height: 1.5rem;
margin-bottom: 0.5rem;
font-size: 0.9rem;
}
.one div{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
color: #1B94D4;
}
.one div:hover{
text-decoration: underline;
}
.release-time{
color: #999!important;
text-decoration: none!important;
cursor: default!important;
}
.one .type{
flex: 1;
text-decoration: none!important;
cursor: default!important;
}
.one .text{
flex: 4;
}
.one .release{
flex: 1;
}
.one .release-time{
flex: 1;
}
.search{
margin: 0 0 3rem 0;
}
.searchinp{
float: left;
width: calc(100% - 6rem);
}
.searchbtn{
float: left;
width: 6rem;
}
</style> </style>

View File

@ -0,0 +1,277 @@
<template>
<el-container>
<el-main>
<el-page-header @back="goBack" :content="pageTitle"></el-page-header>
<div class="" v-if="editor">
<div class="search">
<el-input class="searchinp" v-model="condition" placeholder="请输入内容" @keydown.enter.native="search"></el-input>
<el-button type="primary" class="searchbtn" @click="search">搜索</el-button>
</div>
<div class="list">
<div class="one" v-for="item in list">
<div class="type" @click="searchLabel(item.label)">
[{{item.label}}]
</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<!-- <div class="release">{{item.real_name}}</div>-->
<div class="release-time">{{item.release_time}}</div>
</div>
<p class="sum">{{length}}条数据</p>
</div>
</div>
<addArticle
v-if="!editor"
@editorTitle="editorTitle"
@goInfo="goInfo"
@refresh="refresh"
></addArticle>
</el-main>
<el-aside>
<div class="person-info">
<div class="info">
<div class="name">
<div class="header-photo">{{all.header_photo}}</div>
<div class="username">{{all.real_name}}</div>
<div class="go-homepage pointer">TA的个人主页 ></div>
</div>
<div class="grades">
<div class="grade">
<span>等级:</span>
<div class="number">
<span>博客</span>
<span>2</span>
</div>
</div>
<div class="integral">
<span>积分: </span>
<span>{{all.integral}}</span>
</div>
</div>
</div>
<hr>
<div class="operation" v-if="!isOwn">
<el-button type="primary" plain> </el-button>
<el-button type="primary" plain> </el-button>
</div>
<div class="operation" v-if="isOwn">
<el-button type="primary" plain @click="goEditor">新增文章</el-button>
<el-button type="primary" plain>修改密码</el-button>
</div>
</div>
<footers></footers>
</el-aside>
</el-container>
</template>
<script>
import addArticle from './AddArticle'
export default {
name: "PersonalInfo",
data() {
return{
pageTitle: '个人中心',
editor: true,
condition: '',
list: '',
all: '',
isOwn: true,
}
},
mounted() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
if (userInfo.user_id == sessionStorage.getItem("userId")) {
this.isOwn = true
} else {
this.isOwn = false
}
this.$ajax.post("/hs/getListByAttribute",{text:"",releaseId: sessionStorage.getItem("userId")},r=>{
this.list = r;
this.length = r.length;
this.all = {
real_name: r[0].real_name,
header_photo: r[0].real_name.substring(0, 1),
integral: r[0].integral
}
})
},
methods: {
refresh() {
this.$ajax.post("/hs/getListByAttribute",{text:"",releaseId: sessionStorage.getItem("userId")},r=>{
this.list = r;
this.length = r.length;
this.all = {
real_name: r[0].real_name,
header_photo: r[0].real_name.substring(0, 1),
integral: r[0].integral
}
})
},
editorTitle(pageTitle) {
this.pageTitle = pageTitle
},
goBack() {
this.$router.back(-1)
},
goEditor() {
this.editor = false
},
goInfo() {
this.editor = true
},
searchLabel(label) {
sessionStorage.setItem("condition",label)
this.$router.push({name: "search"})
},
search() {
sessionStorage.setItem("condition",this.condition)
this.$ajax.post("/hs/getListByAttribute",{text:this.condition,releaseId: sessionStorage.getItem("userId")},r=>{
this.list = r
this.length = r.length
})
},
getContent(id) {
this.$router.push({name: 'content'});
sessionStorage.setItem("noticeId",id);
}
},
components: {
addArticle
}
}
</script>
<style scoped>
.el-page-header{
padding: 1rem;
}
.search{
padding: 1rem;
margin-bottom: 2rem;
}
.searchinp{
float: left;
width: calc(100% - 6rem);
}
.searchbtn{
float: left;
width: 6rem;
}
.el-aside{
margin-left: 1rem;
}
.el-main{
padding: 0;
}
.sum{
color: #999;
font-size: 0.9rem;
float: right;
margin-right: 1rem;
}
.el-main{
background: #fff;
}
.list{
background: #fff;
border-radius: 5px;
padding: 1rem 1rem 3rem 1rem;
}
.list .one{
display: flex;
height: 1.5rem;
line-height: 1.5rem;
margin-bottom: 0.5rem;
font-size: 0.9rem;
}
.one div{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
color: #1B94D4;
}
.one div:hover{
text-decoration: underline;
}
.release-time{
color: #999!important;
text-decoration: none!important;
cursor: default!important;
}
.one .type{
flex: 1;
}
.one .text{
flex: 4;
}
.one .release{
flex: 1;
}
.one .release-time{
flex: 2;
}
.operation .el-button:nth-child(1){
margin-left: 1.5rem;
}
.operation .el-button:nth-child(2){
margin-right: 1.5rem;
float: right;
}
.integral span:nth-child(2).ranking span:nth-child(2){
font-weight: bold;
}
.number{
font-size: 0.8rem;
color: #fff;
border-radius: 5px;
position: absolute;
margin-left: 2.6rem;
margin-top: -1.1rem!important;
}
.number span:nth-child(1){
background: #9DC75F;
float: left;
}
.number span:nth-child(2){
background: #2D5315;
float: left;
min-width: 1rem;
text-align: center;
}
.grades{
margin-top: 1rem;
}
.grades div{
margin-top: 0.5rem;
}
.person-info{
background: #fff;
padding: 1rem;
}
.username{
margin-left: 3.5rem;
font-size: 0.9rem;
}
.go-homepage{
font-size: 0.9rem;
color: #3399ea;
margin-left: 3.5rem;
margin-top: 0.5rem;
}
.header-photo{
height: 3rem;
width: 3rem;
line-height: 3rem;
font-weight: bold;
border-radius: 50%;
background: #3399ea;
color: #fff;
text-align: center;
float: left;
font-size: 1.5rem;
margin-right: 2rem;
}
</style>

View File

@ -1,40 +1,162 @@
<template> <template>
<el-main> <el-main>
<div class="search"> <div class="search">
<el-input class="searchinp" v-model="condition" placeholder="请输入内容"></el-input> <el-input class="searchinp" v-model="condition" placeholder="请输入内容" @keydown.enter.native="search"></el-input>
<el-button type="primary" class="searchbtn">搜索</el-button> <el-button type="primary" class="searchbtn" @click="search">搜索</el-button>
</div> </div>
<el-calendar> <el-calendar>
<!-- 这里使用的是 2.5 slot 语法对于新项目请使用 2.6 slot 语法--> <!-- 这里使用的是 2.5 slot 语法对于新项目请使用 2.6 slot 语法-->
<template <template
slot="dateCell" slot="dateCell"
slot-scope="{date, data}"> slot-scope="{date, data}">
<p :class="data.isSelected ? 'is-selected' : ''"> <div >{{ data.day.split('-').slice(1).join('-') }}</div>
{{ data.day.split('-').slice(1).join('-') }} {{ data.isSelected ? '✔️' : ''}} <br>
</p> <div class="things" v-html="dealMyDate(data.day)" @click="getDay(data)">
</div>
</template> </template>
</el-calendar> </el-calendar>
<el-dialog
title="校园通知"
:visible.sync="dialogVisible"
width="40%">
<div class="list">
<div class="one" v-for="item in list" >
<div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
<div class="release-time">{{item.release_time}}</div>
</div>
<p class="sum">{{length}}条数据</p>
</div>
<span slot="footer" class="dialog-footer">
<!-- <el-button @click="dialogVisible = false"> </el-button>-->
<el-button type="primary" @click="dialogVisible = false"> </el-button>
</span>
</el-dialog>
</el-main> </el-main>
</template> </template>
<script> <script>
import $ from 'jquery'
export default { export default {
name: "Home", name: "Home",
data() { data() {
return{ return{
dialogVisible: false,
condition: '', condition: '',
resDate: '',
list: '',
length: '',
} }
}, },
mounted() {
this.$ajax.post("/hs/getListByAttribute",{type:"校园通知",text:''},r=>{
let list = [];
for (let i = 0; i < r.length; i++) {
let one = {};
one.date = r[i].release_time.substring(0,10);
one.content = r[i].label;
list.push(one)
}
this.resDate = list
})
},
methods: {
search() {
sessionStorage.setItem("condition",this.condition)
this.$router.push({name: "search"})
},
getContent(id) {
this.$router.push({name: 'content'});
sessionStorage.setItem("noticeId",id);
},
goPersonalInfo(userId) {
this.$router.push({name: 'personalinfo'});
sessionStorage.setItem("userId",userId);
},
getDay(date) {
this.dialogVisible = true
console.log(date)
this.$ajax.post("/hs/getListByAttribute",{release_time: date.day,text: ''},
r=> {
this.list = r;
this.length = r.length;
})
},
dealMyDate(v) {
let len = this.resDate.length
let res = ""
for(let i=0; i<len; i++){
if(this.resDate[i].date == v) {
res += "<div>"+this.resDate[i].content+"</div>"
// break
}
}
return res
}
}
} }
</script> </script>
<style scoped> <style scoped>
.list{
background: #fff;
border-radius: 5px;
padding: 1rem 1rem 3rem 1rem;
}
.list .one{
display: flex;
height: 1.5rem;
line-height: 1.5rem;
margin-bottom: 0.5rem;
font-size: 0.9rem;
}
.one div{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
color: #1B94D4;
}
.one div:hover{
text-decoration: underline;
}
.one .type{
flex: 1;
text-decoration: none!important;
cursor: default!important;
}
.one .text{
flex: 4;
}
.one .release{
flex: 1;
}
.one .release-time{
flex: 1.5;
color: #999!important;
text-decoration: none!important;
cursor: default!important;
}
.sum{
color: #999;
font-size: 0.9rem;
float: right;
margin-right: 1rem;
}
.things{
margin-top: -1rem;
font-size: 0.5rem;
color: #1989FA;
max-height: 3rem;
overflow: auto;
}
.search{ .search{
margin: 0 0 3rem 0; margin: 0 0 3rem 0;
} }
.el-main{ .el-main{
padding: 0; padding: 0;
/*background: #fff;*/
} }
.searchinp{ .searchinp{
float: left; float: left;

View File

@ -0,0 +1,140 @@
<template>
<el-container>
<el-main>
<el-page-header @back="goBack" content="搜索"></el-page-header>
<div class="search">
<el-input class="searchinp" v-model="condition" placeholder="请输入内容" @keydown.enter.native="search"></el-input>
<el-button type="primary" class="searchbtn" @click="search">搜索</el-button>
</div>
<div class="list">
<div class="one" v-for="item in list" >
<div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
<div class="release-time">{{item.release_time}}</div>
</div>
<p class="sum">{{length}}条数据</p>
</div>
</el-main>
<el-aside>
<footers></footers>
</el-aside>
</el-container>
</template>
<script>
import footers from './components/Footer'
export default {
name: "Search",
data() {
return{
condition: '',
list: '',
length: '',
}
},
mounted() {
this.condition = sessionStorage.getItem("condition")
this.$ajax.post("/hs/getListByAttribute",{text:this.condition},r=>{
this.list = r
this.length = r.length
})
},
methods: {
goBack() {
this.$router.back(-1)
},
search() {
sessionStorage.setItem("condition",this.condition)
this.$ajax.post("/hs/getListByAttribute",{text:this.condition},r=>{
this.list = r
this.length = r.length
})
},
getContent(id) {
this.$router.push({name: 'content'});
sessionStorage.setItem("noticeId",id);
},
goPersonalInfo(userId) {
this.$router.push({name: 'personalinfo'});
sessionStorage.setItem("userId",userId);
}
},
components: {
footers
}
}
</script>
<style scoped>
.el-page-header{
padding: 1rem;
}
.el-main{
background: #fff;
}
.sum{
color: #999;
font-size: 0.9rem;
float: right;
margin-right: 1rem;
}
.list{
background: #fff;
border-radius: 5px;
padding: 1rem 1rem 3rem 1rem;
}
.list .one{
display: flex;
height: 1.5rem;
line-height: 1.5rem;
margin-bottom: 0.5rem;
font-size: 0.9rem;
}
.one div{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
color: #1B94D4;
}
.one div:hover{
text-decoration: underline;
}
.release-time{
color: #999!important;
text-decoration: none!important;
cursor: default!important;
}
.one .type{
flex: 1;
}
.one .text{
flex: 4;
}
.one .release{
flex: 1;
}
.one .release-time{
flex: 1;
}
.el-aside{
margin: -1rem 0 0 1rem;
}
.el-main{
padding: 0;
}
.search{
margin: 0 0 3rem 0;
}
.searchinp{
float: left;
width: calc(100% - 6rem);
}
.searchbtn{
float: left;
width: 6rem;
}
</style>

View File

@ -1,17 +1,132 @@
<template> <template>
<el-container>
<el-main> <el-main>
<h1>学生想法</h1> <div class="search">
<el-input class="searchinp" v-model="condition" placeholder="请输入内容" @keydown.enter.native="search"></el-input>
<el-button type="primary" class="searchbtn" @click="search">搜索</el-button>
</div>
<div class="list">
<div class="title">学生想法</div>
<div class="one" v-for="item in thinkingList" >
<div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div>
<div class="release" @click="goPersonalInfo(item.user_id)">{{item.real_name}}</div>
<div class="release-time">{{item.release_time}}</div>
</div>
<p class="sum">{{length}}条数据</p>
</div>
</el-main> </el-main>
<el-aside>
<footers></footers>
</el-aside>
</el-container>
</template> </template>
<script> <script>
import footers from '../components/components/Footer'
export default { export default {
name: "StudentThought" name: "StudentThought",
data() {
return{
condition: '',
thinkingList: '',
length: '',
}
},
mounted() {
this.$ajax.post("/hs/getListByAttribute",{text:"",type:"学生想法"},r=>{
this.thinkingList = r
this.length = r.length
})
},
methods: {
search() {
},
getContent(id) {
this.$router.push({name: 'content'});
sessionStorage.setItem("noticeId",id);
},
goPersonalInfo(userId) {
this.$router.push({name: 'personalinfo'});
sessionStorage.setItem("userId",userId);
},
},
components: {
footers
}
} }
</script> </script>
<style scoped> <style scoped>
.el-aside{
margin: -1rem 0 0 1rem;
}
.list .title{
font-size: 1.5rem;
margin-bottom: 1rem;
}
.el-main{ .el-main{
padding: 0; padding: 0;
background: #EEFCFE;
}
.sum{
color: #999;
font-size: 0.9rem;
float: right;
margin-right: 1rem;
}
.list{
background: #fff;
border-radius: 5px;
padding: 1rem 1rem 3rem 1rem;
}
.list .one{
display: flex;
height: 1.5rem;
line-height: 1.5rem;
margin-bottom: 0.5rem;
font-size: 0.9rem;
}
.one div{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: pointer;
color: #1B94D4;
}
.one div:hover{
text-decoration: underline;
}
.release-time{
color: #999!important;
text-decoration: none!important;
cursor: default!important;
}
.one .type{
flex: 1;
text-decoration: none!important;
cursor: default!important;
}
.one .text{
flex: 4;
}
.one .release{
flex: 1;
}
.one .release-time{
flex: 1;
}
.search{
margin: 0 0 3rem 0;
}
.searchinp{
float: left;
width: calc(100% - 6rem);
}
.searchbtn{
float: left;
width: 6rem;
} }
</style> </style>

View File

@ -43,7 +43,7 @@
import Vue from 'vue' import Vue from 'vue'
import marked from 'marked' import marked from 'marked'
import scroll from 'vue-scroll' 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' import range from '../../assets/js/rangeFn.js'
Vue.use(scroll) Vue.use(scroll)
marked.setOptions({ marked.setOptions({
@ -55,9 +55,9 @@
sanitize: false, sanitize: false,
smartLists: true, smartLists: true,
smartypants: false, smartypants: false,
highlight: function(code) { /*highlight: function(code) {
return hljs.highlightAuto(code).value return ranges.highlightAuto(code).value
} }*/
}); });
function insertContent(val, that) { function insertContent(val, that) {

View File

@ -49,7 +49,17 @@ export default new Router({
path:'content', path:'content',
name:'content', name:'content',
component:() => import('@/components/Content') component:() => import('@/components/Content')
} },
{
path:'search',
name:'search',
component:() => import('@/components/Search')
},
{
path:'personalinfo',
name:'personalinfo',
component:() => import('@/components/PersonalInfo')
},
] ]
} }