'最后完善'

This commit is contained in:
裴浩宇 2020-04-14 17:35:18 +08:00
parent 5e979d024d
commit c8666d7ab7
33 changed files with 1376 additions and 152 deletions

View File

@ -4,9 +4,7 @@ import com.qinxx.hslink.service.HSService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
@Controller @Controller
@ -67,7 +65,7 @@ public class HSController {
return result; return result;
} }
//新增留言 //新增一条数据
@RequestMapping(value = "/addArticle", method = {RequestMethod.POST,RequestMethod.GET}) @RequestMapping(value = "/addArticle", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody @ResponseBody
public Map<String,Object> addArticle(@RequestBody Map<String,Object> param) { public Map<String,Object> addArticle(@RequestBody Map<String,Object> param) {
@ -75,6 +73,14 @@ public class HSController {
return result; return result;
} }
//新增一条班级通知
@RequestMapping(value = "/addClassNotice", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody
public Map<String,Object> addClassNotice(@RequestBody Map<String,Object> param) {
Map<String,Object> result = hsService.addClassNotice(param);
return result;
}
//获取班级信息 //获取班级信息
@RequestMapping(value = "/getClassInfo", method = {RequestMethod.POST,RequestMethod.GET}) @RequestMapping(value = "/getClassInfo", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody @ResponseBody
@ -99,6 +105,67 @@ public class HSController {
return result; return result;
} }
//修改密码
@RequestMapping(value = "/updatePassword", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody
public Map<String,Object> updatePassword(@RequestBody Map<String,Object> param) {
Map<String,Object> result = hsService.updatePassword(param);
return result;
}
//编辑一条数据具体内容
@RequestMapping(value = "/updateOneContent", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody
public Map<String,Object> updateOneContent(@RequestBody Map<String,Object> param) {
Map<String,Object> result = hsService.updateOneContent(param);
return result;
}
//删除一条数据
@RequestMapping(value = "/deleteOne", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody
public Map<String,Object> deleteOne(@RequestBody Map<String,Object> param) {
Map<String,Object> result = hsService.deleteOne(param);
return result;
}
//删除一条留言
@RequestMapping(value = "/deleteOneMessage", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody
public Map<String,Object> deleteOneMessage(@RequestBody Map<String,Object> param) {
Map<String,Object> result = hsService.deleteOneMessage(param);
return result;
}
//获取个人信息
@RequestMapping(value = "/getPersonalInfo", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody
public Map<String,Object> getPersonalInfo(@RequestBody Map<String,Object> param) {
Map<String,Object> result = hsService.getPersonalInfo(param);
return result;
}
//获取个人私信
@RequestMapping(value = "/getPersonalPrivateLetter", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody
public Map<String,Object> getPersonalPrivateLetter(@RequestBody Map<String,Object> param) {
Map<String,Object> result = hsService.getPersonalPrivateLetter(param);
return result;
}
//阅读私信
@RequestMapping(value = "/readPrivateLetter", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody
public Map<String,Object> readPrivateLetter(@RequestBody Map<String,Object> param) {
Map<String,Object> result = hsService.readPrivateLetter(param);
return result;
}
//发送私信
@RequestMapping(value = "/sendLetter", method = {RequestMethod.POST,RequestMethod.GET})
@ResponseBody
public Map<String,Object> sendLetter(@RequestBody Map<String,Object> param) {
Map<String,Object> result = hsService.sendLetter(param);
return result;
}
} }

View File

@ -55,10 +55,15 @@ public interface HSLinkMapper {
int addMessage(Map<String,Object> param); int addMessage(Map<String,Object> param);
/** /**
* 新增文章 * 新增一篇文章
*/ */
int addArticle(Map<String,Object> param); int addArticle(Map<String,Object> param);
/**
* 新增一条班级通知
*/
int addClassNotice(Map<String,Object> param);
/** /**
* 获取班级公告 * 获取班级公告
*/ */
@ -83,4 +88,45 @@ public interface HSLinkMapper {
* 修改班级公告 * 修改班级公告
*/ */
int updateBulletin(Map<String,Object> param); int updateBulletin(Map<String,Object> param);
/**
* 修改密码
*/
int updatePassword(Map<String,Object> param);
/**
* 编辑一条数据具体内容
*/
int updateOneContent(Map<String,Object> param);
/**
* 删除一条数据
*/
int deleteOne(Map<String,Object> param);
/**
* 删除一条留言
*/
int deleteOneMessage(Map<String,Object> param);
/**
* 获取个人信息
*/
Map<String,Object> getPersonalInfo(Map<String,Object> param);
/**
* 获取班级成员
*/
List<Map<String,Object>> getPersonalPrivateLetter(Map<String,Object> param);
/**
* 将未读私信置位已读
*/
int updateUnread(Map<String,Object> param);
/**
* 发送私信
*/
int sendLetter(Map<String,Object> param);
} }

View File

@ -37,6 +37,7 @@
FROM FROM
hs_notice s left join hs_user u on s.release_id = u.user_id hs_notice s left join hs_user u on s.release_id = u.user_id
where type = '校园通知' where type = '校园通知'
and status = "1"
<if test="id != null and id != ''"> <if test="id != null and id != ''">
and s.id = #{id} and s.id = #{id}
</if> </if>
@ -59,6 +60,7 @@
FROM FROM
hs_notice p left join hs_user u on p.release_id = u.user_id hs_notice p left join hs_user u on p.release_id = u.user_id
where type = '家长建议' where type = '家长建议'
and status = "1"
<if test="id != null and id != ''"> <if test="id != null and id != ''">
and p.id = #{id} and p.id = #{id}
</if> </if>
@ -81,6 +83,7 @@
FROM FROM
hs_notice s left join hs_user u on s.release_id = u.user_id hs_notice s left join hs_user u on s.release_id = u.user_id
where type = '学生想法' where type = '学生想法'
and status = "1"
<if test="id != null and id != ''"> <if test="id != null and id != ''">
and s.id = #{id} and s.id = #{id}
</if> </if>
@ -129,10 +132,12 @@
u.real_name, u.real_name,
u.integral, u.integral,
'' header_photo, '' header_photo,
signature,
type type
FROM FROM
hs_notice s left join hs_user u on s.release_id = u.user_id hs_notice s left join hs_user u on s.release_id = u.user_id
where 1 = 1 where 1 = 1
and status = "1"
<if test="releaseId != null and releaseId != ''"> <if test="releaseId != null and releaseId != ''">
and release_id = #{releaseId} and release_id = #{releaseId}
</if> </if>
@ -154,41 +159,50 @@
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 id="addArticle" parameterType="map">
insert into hs_notice (id,label,title,content,release_id,release_time,type) insert into hs_notice (id,label,title,content,release_id,release_time,type)
values values
(uuid(),#{label},#{title},#{content},#{release_id},#{release_time},#{type}) (uuid(),#{label},#{title},#{content},#{release_id},#{release_time},#{type})
</insert> </insert>
<!--新增一条班级通知-->
<insert id="addClassNotice" parameterType="map">
insert into hs_notice (id,class_id,class_name,label,title,content,release_id,release_time,type)
values
(uuid(),#{classId},#{className},#{label},#{title},#{content},#{releaseId},#{release_time},"班级通知")
</insert>
<!--获取班级公告--> <!--获取班级公告-->
<select id="getClassBulletin" parameterType="map" resultType="map"> <select id="getClassBulletin" parameterType="map" resultType="map">
SELECT SELECT
DISTINCT DISTINCT
id, id,
c.class_id, c.class_id,
c.class_name, c.class_name,
title, title,
content, content,
release_time release_time
FROM FROM
hs_class_bulletin c hs_class_bulletin c
left JOIN hs_user u ON c.class_name = u.class_name left JOIN hs_user u ON c.class_name = u.class_name
WHERE WHERE
c.class_name = ( SELECT class_name FROM hs_user WHERE user_id = #{id} ) c.class_name = ( SELECT class_name FROM hs_user WHERE user_id = #{id} )
</select> </select>
<!--获取班级通知--> <!--获取班级通知-->
<select id="getClassNotice" parameterType="map" resultType="map"> <select id="getClassNotice" parameterType="map" resultType="map">
select * from hs_class_notice left join hs_user on release_id = user_id select * from hs_notice left join hs_user on release_id = user_id
where hs_class_notice.class_name = (select class_name from hs_user where hs_notice.class_name = (select class_name from hs_user
where user_id = #{id}) where user_id = #{id})
<if test="text != null and text != ''"> <if test="text != null and text != ''">
and (label like CONCAT('%',#{text},'%') and (label like CONCAT('%',#{text},'%')
or title like CONCAT('%',#{text},'%') or title like CONCAT('%',#{text},'%')
or content like CONCAT('%',#{text},'%') or content like CONCAT('%',#{text},'%')
or real_name like CONCAT('%','五一','%')) or real_name like CONCAT('%',#{text},'%'))
</if> </if>
and type = "班级通知"
and status = "1"
ORDER BY release_time desc ORDER BY release_time desc
</select> </select>
@ -207,4 +221,48 @@ WHERE
update hs_class_bulletin set class_id = #{classId},class_name=#{className},title=#{title},content=#{content},release_time=#{releaseTime} where id = #{id} update hs_class_bulletin set class_id = #{classId},class_name=#{className},title=#{title},content=#{content},release_time=#{releaseTime} where id = #{id}
</update> </update>
<!--修改密码-->
<update id="updatePassword" parameterType="map">
update hs_user set pass_word = #{password} where user_id = #{id}
</update>
<!--修改一条数据具体内容-->
<update id="updateOneContent" parameterType="map">
update hs_notice set label = #{label},title = #{title},content = #{content} where id = #{id}
</update>
<!--删除一条数据-->
<update id="deleteOne" parameterType="map">
update hs_notice set status = "0" where id = #{id}
</update>
<!--删除一条留言-->
<delete id="deleteOneMessage" parameterType="map">
delete from hs_leave_message where id = #{id}
</delete>
<!--获取个人信息-->
<select id="getPersonalInfo" parameterType="map" resultType="map">
select * , (select count(*) from hs_private_letter where receive_id = #{releaseId} and already_read = "0") letter_number
from hs_user where user_id = #{releaseId}
</select>
<!--获取个人私信-->
<select id="getPersonalPrivateLetter" resultType="map" parameterType="map">
select * from hs_private_letter left join hs_user on send_id = user_id where receive_id = #{userId}
<if test="id != '' and id != null">
and id = #{id}
</if>
</select>
<!--将未读私信置位已读-->
<update id="updateUnread" parameterType="map">
update hs_private_letter set already_read = "1" where id = #{id}
</update>
<!--发送私信-->
<insert id="sendLetter" parameterType="map">
insert into hs_private_letter (id,send_id,receive_id,content,letter_create_time,status,already_read) values
(uuid(),#{sendId},#{receiveId},#{content},#{time},"1","0")
</insert>
</mapper> </mapper>

View File

@ -39,10 +39,15 @@ public interface HSService {
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> addArticle(Map<String,Object> param);
/**
* 新增一条班级通知
*/
Map<String,Object> addClassNotice(Map<String,Object> param);
/** /**
* 获取班级信息 * 获取班级信息
*/ */
@ -57,4 +62,44 @@ public interface HSService {
* 修改班级公告 * 修改班级公告
*/ */
Map<String,Object> updateBulletin(Map<String,Object> param); Map<String,Object> updateBulletin(Map<String,Object> param);
/**
* 修改密码
*/
Map<String,Object> updatePassword(Map<String,Object> param);
/**
* 编辑一条数据具体内容
*/
Map<String,Object> updateOneContent(Map<String,Object> param);
/**
* 删除一条数据
*/
Map<String,Object> deleteOne(Map<String,Object> param);
/**
* 删除一条留言
*/
Map<String,Object> deleteOneMessage(Map<String,Object> param);
/**
* 获取个人信息
*/
Map<String,Object> getPersonalInfo(Map<String,Object> param);
/**
* 获取个人信息
*/
Map<String,Object> getPersonalPrivateLetter(Map<String,Object> param);
/**
* 阅读私信
*/
Map<String,Object> readPrivateLetter(Map<String,Object> param);
/**
* 发送私信
*/
Map<String,Object> sendLetter(Map<String,Object> param);
} }

View File

@ -105,6 +105,21 @@ public class HSServiceImpl implements HSService {
return result; return result;
} }
@Override
public Map<String, Object> addClassNotice(Map<String, Object> param) {
Map<String, Object> result = new HashMap<>();
int res = 0;
try {
res = hsLinkMapper.addClassNotice(param);
} catch (Exception e) {
e.printStackTrace();
res = 0;
}
result.put("data",res);
result.put("success",true);
return result;
}
@Override @Override
public Map<String, Object> getClassInfo(Map<String, Object> param) { public Map<String, Object> getClassInfo(Map<String, Object> param) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
@ -149,4 +164,114 @@ public class HSServiceImpl implements HSService {
result.put("success",true); result.put("success",true);
return result; return result;
} }
@Override
public Map<String, Object> updatePassword(Map<String, Object> param) {
Map<String, Object> result = new HashMap<>();
int res = 0;
try {
res = hsLinkMapper.updatePassword(param);
} catch (Exception e) {
e.printStackTrace();
res = 0;
}
result.put("data",res);
result.put("success",true);
return result;
}
@Override
public Map<String, Object> updateOneContent(Map<String, Object> param) {
Map<String, Object> result = new HashMap<>();
int res = 0;
try {
res = hsLinkMapper.updateOneContent(param);
} catch (Exception e) {
e.printStackTrace();
res = 0;
}
result.put("data",res);
result.put("success",true);
return result;
}
@Override
public Map<String, Object> deleteOne(Map<String, Object> param) {
Map<String, Object> result = new HashMap<>();
int res = 0;
try {
res = hsLinkMapper.deleteOne(param);
} catch (Exception e) {
e.printStackTrace();
res = 0;
}
result.put("data",res);
result.put("success",true);
return result;
}
@Override
public Map<String, Object> deleteOneMessage(Map<String, Object> param) {
Map<String, Object> result = new HashMap<>();
int res = 0;
try {
res = hsLinkMapper.deleteOneMessage(param);
} catch (Exception e) {
e.printStackTrace();
res = 0;
}
result.put("data",res);
result.put("success",true);
return result;
}
@Override
public Map<String, Object> getPersonalInfo(Map<String, Object> param) {
Map<String, Object> result = new HashMap<>();
Map<String, Object> res = new HashMap<>();
List<Map<String, Object>> res1 = hsLinkMapper.getListByAttribute(param);
Map<String, Object> res2 = hsLinkMapper.getPersonalInfo(param);
res.put("personalList",res1);
res.put("personalInfo",res2);
result.put("data",res);
result.put("success",true);
return result;
}
@Override
public Map<String, Object> getPersonalPrivateLetter(Map<String, Object> param) {
Map<String, Object> result = new HashMap<>();
List<Map<String, Object>> res = hsLinkMapper.getPersonalPrivateLetter(param);
result.put("data",res);
result.put("success",true);
return result;
}
@Override
public Map<String, Object> readPrivateLetter(Map<String, Object> param) {
Map<String, Object> result = new HashMap<>();
Map<String, Object> res = new HashMap<>();
List<Map<String, Object>> res1 = hsLinkMapper.getPersonalPrivateLetter(param);
int res2 = hsLinkMapper.updateUnread(param);
res.put("onePrivateLetter",res1);
res.put("readStatus",res2);
result.put("data",res);
result.put("success",true);
return result;
}
@Override
public Map<String, Object> sendLetter(Map<String, Object> param) {
Map<String, Object> result = new HashMap<>();
int res = 0;
try {
res = hsLinkMapper.sendLetter(param);
} catch (Exception e) {
e.printStackTrace();
res = 0;
}
result.put("data",res);
result.put("success",true);
return result;
}
} }

View File

@ -10,6 +10,8 @@ export default {
} }
</script> </script>
<style> <style scoped>
.el-container{
height: 100%;
}
</style> </style>

View File

@ -2,8 +2,8 @@
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:8048' // let root = 'http://192.168.10.29:8048'
// let root = 'http://123.57.22.91:8002' let root = 'http://123.57.22.91:8048'
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

@ -1,5 +1,12 @@
html { html {
overflow-y: overlay; overflow-y: overlay;
height: 100%;
}
body{
height: 100%;
}
#app{
height: 100%;
} }
.default-color{ .default-color{
color: #666!important; color: #666!important;

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 611 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

@ -60,13 +60,14 @@
}, },
mounted() { mounted() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo")); let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
if (userInfo.user_type == "教师") { if (userInfo.user_type === "教师") {
this.$emit("editorTitle","新增校园通知") this.$emit("editorTitle","新增校园通知")
// if (sessionStorage.getItem("release") == )
this.type = "校园通知" this.type = "校园通知"
} else if (userInfo.user_type == "家长") { } else if (userInfo.user_type === "家长") {
this.$emit("editorTitle","新增家长建议") this.$emit("editorTitle","新增家长建议")
this.type = "家长建议" this.type = "家长建议"
} else if (userInfo.user_type == "学生") { } else if (userInfo.user_type === "学生") {
this.$emit("editorTitle","新增学生想法") this.$emit("editorTitle","新增学生想法")
this.type = "学生想法" this.type = "学生想法"
} }
@ -103,18 +104,36 @@
type: "warning" type: "warning"
}) })
} else { } else {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo")); if (sessionStorage.getItem("releaseType") === "classNotice") {
this.$ajax.post("/hs/addArticle",{label:this.label,title:this.title,content:this.msg.mdValue,release_id:userInfo.user_id, let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
release_time:getDate(),type:this.type},r=>{ this.$ajax.post("/hs/addClassNotice",{classId:userInfo.class_id,className:userInfo.class_name,
if (r == "1") { label:this.label,title:this.title,content:this.msg.mdValue,releaseId:userInfo.user_id,
this.$message({ release_time:getDate(),type:this.type},r=> {
message: "发表成功", if (r === 1) {
type: "success" this.$message({
}); message: "发布成功",
this.$emit("goInfo"); type: "success"
this.$emit("refresh"); });
} this.$emit("goInfo");
}) this.$emit("refresh");
}
})
sessionStorage.setItem("releaseType","")
} 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");
this.$emit("editorTitle","个人中心");
}
})
}
} }
} }
}, },

View File

@ -7,12 +7,12 @@
<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" @click="goPersonalInfo(all.author_id)">{{all.author_name}}</span>
<span class="margin-right">发布时间</span> <span class="margin-right">发布时间</span>
<span class="grey">{{all.create_time}}</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 pointer" @click="searchLabel(all.label)">{{all.label}}</span>
</div> </div>
</div> </div>
<div class="middle"> <div class="middle">
@ -31,19 +31,20 @@
</div> </div>
<div class="footer"> <div class="footer">
<el-row> <el-row>
<el-button type="primary" icon="el-icon-thumb" plain>点赞</el-button> <el-button type="primary" icon="el-icon-thumb" size="mini" plain @click="follow"> </el-button>
<el-button type="primary" icon="el-icon-share" plain>分享</el-button> <el-button type="primary" icon="el-icon-share" size="mini" plain @click="follow"> </el-button>
</el-row> </el-row>
</div> </div>
</div> </div>
<div class="comment-area"> <div class="comment-area">
<el-button class="message" type="primary" @click="messages">留言</el-button> <el-button class="message" type="primary" @click="messages">留言</el-button>
<div class="comment-list"> <div class="comment-list">
<div class="comment-one" v-for="item in message"> <div class="comment-one" v-for="(item,index) in message">
<div class="comment-header"> <div class="comment-header">
<div class="header-photo">{{item.header_photo}}</div> <div class="header-photo">{{item.header_photo}}</div>
<div class="name">{{item.real_name}}</div> <div class="name">{{item.real_name}}</div>
<div class="time">{{item.create_time}}</div> <div class="time">{{item.create_time}}</div>
<span class=" delete pointer blue delete-my" v-if="(userId == item.messager_id)" @click="deleteMy(item.id)">删除</span>
</div> </div>
<div class="comment-content">{{item.content}}</div> <div class="comment-content">{{item.content}}</div>
<hr> <hr>
@ -56,8 +57,8 @@
<div class="info"> <div class="info">
<div class="name"> <div class="name">
<div class="header-photo">{{all.header_photo}}</div> <div class="header-photo">{{all.header_photo}}</div>
<div class="username">{{all.author_name}}</div> <div class="username" >{{all.author_name}}</div>
<div class="go-homepage pointer">TA的个人主页 ></div> <div class="go-homepage pointer" @click="goPersonalInfo(all.author_id)">TA的个人主页 ></div>
</div> </div>
<div class="grades"> <div class="grades">
<div class="grade"> <div class="grade">
@ -75,8 +76,8 @@
</div> </div>
<hr> <hr>
<div class="operation"> <div class="operation">
<el-button type="primary" plain> </el-button> <el-button type="primary" plain size="mini" @click="follow"> </el-button>
<el-button type="primary" plain>私信</el-button> <el-button type="primary" plain size="mini" @click="sendLetter(all.author_id,all.author_name)"> </el-button>
</div> </div>
</div> </div>
<footers></footers> <footers></footers>
@ -85,6 +86,7 @@
</template> </template>
<script> <script>
import { getDate } from '../assets/js/public.js'
import footers from './components/Footer' import footers from './components/Footer'
import markdown from "./components/Mdeditor"; import markdown from "./components/Mdeditor";
export default { export default {
@ -100,6 +102,7 @@
mdValue:'' mdValue:''
}, },
flag:false, flag:false,
userId: JSON.parse(sessionStorage.getItem("userInfo")).user_id
} }
}, },
created() { created() {
@ -111,14 +114,82 @@
this.all = r.content; this.all = r.content;
this.message = r.message; this.message = r.message;
this.msg.mdValue = r.content.content; this.msg.mdValue = r.content.content;
this.all.header_photo = this.all.author_name.substring(0, 1) this.all.header_photo = this.all.author_name.substring(0, 1);
for (let i = 0; i < this.message.length; i++) { for (let i = 0; i < this.message.length; i++) {
this.message[i].header_photo = this.message[i].real_name.substring(0, 1) this.message[i].header_photo = this.message[i].real_name.substring(0, 1);
} }
setTimeout(()=>{this.$refs.markdown.addLine()},1) setTimeout(()=>{this.$refs.markdown.addLine()},1)
}) })
}, },
methods: { methods: {
deleteMy(id) {
this.$confirm('确定删除该条留言, 是否继续?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$ajax.post("/hs/deleteOneMessage",{id:id},r=>{
if (r === 1) {
this.$message({
type: 'success',
message: '删除成功!'
});
this.$ajax.post("/hs/getOneContent", {
id: sessionStorage.getItem("noticeId")
}, 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(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
},
sendLetter(id,name) {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
this.$prompt('接受者:'+name, '发送私信', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /\S/,
inputErrorMessage: '内容不能为空'
}).then(({ value }) => {
this.$ajax.post("/hs/sendLetter",{sendId:userInfo.user_id,receiveId:id,content:value,time:getDate()},r=>{
if (r === 1) {
this.$message({
type: 'success',
message: '发送成功'
});
} else {
this.$message.error("发送失败")
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消输入'
});
});
},
follow() {
this.$message({
type:"success",
message: "喜欢就好"
})
},
searchLabel(label) {
sessionStorage.setItem("condition",label)
this.$router.push({name: "search"})
},
goPersonalInfo(userId) {
this.$router.push({name: 'personalinfo'});
sessionStorage.setItem("userId",userId);
},
goBack() { goBack() {
this.$router.back(-1) this.$router.back(-1)
}, },
@ -133,11 +204,8 @@
}, },
inputErrorMessage: '不能为空' inputErrorMessage: '不能为空'
}).then(({ value }) => { }).then(({ value }) => {
let day2 = new Date();
day2.setTime(day2.getTime());
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:getDate(),userId:JSON.parse(sessionStorage.getItem("userInfo")).user_id},r=>{
if (r == "1") { if (r == "1") {
this.$message({ this.$message({
type: 'success', type: 'success',
@ -179,6 +247,21 @@
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.comment-one:hover .delete-my{
display: inline-block;
}
.delete{
height: 1.5rem;
line-height: 1.5rem;
margin-left: 0.2rem;
display: none;
}
.header h1{
font-size: 1.5rem;
}
.el-container{
margin: 1rem;
}
.margin-right{ .margin-right{
margin-left: 1rem; margin-left: 1rem;
} }
@ -297,10 +380,10 @@
margin-top: 0.5rem; margin-top: 0.5rem;
} }
.operation .el-button:nth-child(1){ .operation .el-button:nth-child(1){
margin-left: 2rem; /*margin-left: 2rem;*/
} }
.operation .el-button:nth-child(2){ .operation .el-button:nth-child(2){
margin-right: 2rem; /*margin-right: 2rem;*/
float: right; float: right;
} }
.integral span:nth-child(2).ranking span:nth-child(2){ .integral span:nth-child(2).ranking span:nth-child(2){
@ -369,13 +452,14 @@
text-align: center; text-align: center;
float: left; float: left;
font-size: 1.5rem; font-size: 1.5rem;
margin-right: 2rem; margin-right: 1rem;
} }
.el-container{ .el-container{
padding: 0; padding: 0;
} }
.el-aside{ .el-aside{
/*margin-top: 1rem;*/ /*margin-top: 1rem;*/
width: 14rem!important;
} }
.el-main{ .el-main{
padding: 0; padding: 0;

View File

@ -0,0 +1,182 @@
<template>
<el-container>
<el-main>
<el-page-header @back="goBack" content="编辑内容"></el-page-header>
<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-aside>
<footers></footers>
</el-aside>
</el-container>
</template>
<script>
import {getDate} from "../assets/js/public";
import markdown from "./components/Mdeditor";
import footers from "./components/Footer";
export default {
name: "EditorContent",
data() {
return{
label: "",
title:"",
type:'',
msgShow:'我要显示的内容',
dilogStatus:false,
msg: {
mdValue:''
},
flag:false,
}
},
mounted() {
this.$ajax.post("/hs/getOneContent",{id:sessionStorage.getItem("noticeId")},r=>{
this.label = r.content.label;
this.title = r.content. title;
this.msg.mdValue = r. content.content
})
},
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 {
this.$ajax.post("/hs/updateOneContent",{label:this.label,title:this.title,
content:this.msg.mdValue,id:sessionStorage.getItem("noticeId")},r=>{
if (r === 1) {
this.$message({
type: "success",
message: "编辑成功"
})
/*this.$router.push({name: 'content'});
sessionStorage.setItem("noticeId",sessionStorage.getItem("noticeId"));*/
this.$router.back(-1)
} else {
this.$message.error("编辑失败")
}
})
}
}
},
components: {
markdown,
footers
},
}
</script>
<style scoped>
.el-aside{
margin: -1rem 0 0 1rem;
width: 14rem!important;
}
.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: 1rem;
}
.el-main{
padding: 1rem;
background: #fff;
overflow: hidden;
}
</style>

View File

@ -1,37 +1,82 @@
<template> <template>
<el-main class="body-background"> <el-container>
<div class="left"> <el-main class="body-background">
<div class="top"> <el-tabs v-model="activeName" @tab-click="handleClick">
<img src="../assets/img/left-1.gif"/> <el-tab-pane label="首页" name="1">
</div> <p>首页板块展示最新校园动态并且展示校园通知家长建议学生想法三大板块的最新信息</p>
<div class="bottom"> <img style="width: 100%" src="../assets/img/help/homepage.jpg" alt="">
<el-menu </el-tab-pane>
default-active="2" <el-tab-pane label="校园通知" name="2">
class="el-menu-vertical-demo"> <p>校园通知板块通过日历的表达形式展示校园通知直接明了</p>
<el-menu-item index="1">首页</el-menu-item> <img style="width: 100%" src="../assets/img/help/schoolNotice1.jpg" alt="">
<el-menu-item index="2">校园通知</el-menu-item> <hr>
<el-menu-item index="3">家长意见</el-menu-item> <p>有校园通知的日期上会有该通知的标签点击该日期会展示该日期的全部校园通知</p>
<el-menu-item index="4">学生想法</el-menu-item> <img style="width: 100%" src="../assets/img/help/schoolNotice2.jpg" alt="">
<el-menu-item index="5">我的班级</el-menu-item> </el-tab-pane>
<el-menu-item index="6">常见问题</el-menu-item> <el-tab-pane label="我的班级" name="3">
</el-menu> <p>我的班级板块具有班级公告班级通知班级成员三大模块组成班级公告班级通知只有老师可以编辑发布</p>
</div> <img style="width: 100%" src="../assets/img/help/myClass.jpg" alt="">
</div> </el-tab-pane>
<div class="right"> <el-tab-pane label="家长意见" name="4">
<div>请联系管理员更新内容</div> <p>家长建议板块展示各位家长的建议家长建议的发布在家长的个人中心里点击发表按钮</p>
<div>管理员联系方式15006732580</div> <img style="width: 100%" src="../assets/img/help/parentAdvice.jpg" alt="">
<div>管理员QQ邮箱617594538@qq.com</div> </el-tab-pane>
</div> <el-tab-pane label="学生想法" name="5">
</el-main> <p>学生想法板块展示各位学生的想法学生想法的发布在学生的个人中心里点击发表按钮</p>
<img style="width: 100%" src="../assets/img/help/studentThinking.jpg" alt="">
</el-tab-pane>
<el-tab-pane label="常见问题" name="6">
<p>搜索</p>
<img style="width: 100%" src="../assets/img/help/search.jpg" alt="">
<img style="width: 100%" src="../assets/img/help/search1.jpg" alt="">
<hr>
<p>个人中心在头部点击姓名可进入可以查看自己发表的全部内容可以发表和修改密码</p>
<img style="width: 100%" src="../assets/img/help/personalInfo.jpg" alt="">
</el-tab-pane>
</el-tabs>
</el-main>
<el-aside>
<footers></footers>
</el-aside>
</el-container>
</template> </template>
<script> <script>
import footers from './components/Footer'
export default { export default {
name: "Help" name: "Help",
data() {
return{
activeName: '1'
}
},
methods:{
handleClick(tab, event) {
console.log(tab, event);
}
},
components: {
footers
}
} }
</script> </script>
<style scoped> <style scoped>
.el-tabs{
width: 100%;
}
.el-aside{
margin-left: 1rem;
margin-top:-1rem ;
width: 14rem!important;
}
.el-container{
margin: 1rem;
}
.el-main{
background: #fff;
}
.right{ .right{
border: 1px solid #419EFF; border: 1px solid #419EFF;
border-radius: 5px; border-radius: 5px;

View File

@ -353,7 +353,7 @@
flex: 1; flex: 1;
} }
.one .release-time{ .one .release-time{
flex: 1; flex: 1.5;
} }
.module{ .module{
border: 1px solid #419EFF; border: 1px solid #419EFF;
@ -373,9 +373,11 @@
} }
.school-dynamic{ .school-dynamic{
display: flex; display: flex;
width: calc(100% - 2rem); /*width: calc(100% - 2rem);*/
padding: 1rem; padding: 1rem;
height: 24rem; height: 24rem;
width: 80%;
margin: 0 auto;
} }
#title{ #title{
color: #419EFF; color: #419EFF;

View File

@ -5,7 +5,7 @@
<div class="date default-color">{{date}}</div> <div class="date default-color">{{date}}</div>
<div class="function"> <div class="function">
<span class="pointer special-font-blue " v-if="!isLogin" @click="login">登录</span> <span class="pointer special-font-blue " v-if="!isLogin" @click="login">登录</span>
<span class="pointer special-font-blue " v-if="isLogin">欢迎{{userInfo.real_name}}{{userInfo.user_type}}</span> <span class="pointer special-font-blue " v-if="isLogin" @click="goPersonalInfo(userInfo.user_id)">欢迎{{userInfo.real_name}}{{userInfo.user_type}}</span>
<span class="pointer special-font-blue " v-if="isLogin" @click="cancellation">注销</span> <span class="pointer special-font-blue " v-if="isLogin" @click="cancellation">注销</span>
<el-divider direction="vertical"></el-divider> <el-divider direction="vertical"></el-divider>
<span class="pointer special-font-blue" @click="service">客服中心</span> <span class="pointer special-font-blue" @click="service">客服中心</span>
@ -41,28 +41,40 @@
</template> </template>
<script> <script>
import { getDate } from '../assets/js/public.js'
export default { export default {
data() { data() {
return{ return{
isCollapse: true, isCollapse: true,
isLogin: false, isLogin: false,
date: '', date: '',
userInfo: '', userInfo: {
real_name: '',
user_type: '',
},
} }
}, },
mounted() { mounted() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo")); let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
this.userInfo = userInfo; if (userInfo == '' || userInfo === null) {
if (userInfo != '' || userInfo != null) {
} else {
this.isLogin = true; this.isLogin = true;
this.userInfo = userInfo;
} }
setInterval(()=>{ setInterval(()=>{
let day2 = new Date(); let day2 = new Date();
day2.setTime(day2.getTime()); day2.setTime(day2.getTime());
this.date = day2.getFullYear()+"年" + (day2.getMonth()+1) + "月" + day2.getDate()+'日 星期'+"日一二三四五六".charAt(new Date().getDay()) this.date = day2.getFullYear()+"年" + (day2.getMonth()+1<10? "0"+(day2.getMonth()+1):day2.getMonth()+1)
+" | "+day2.getHours()+"时"+day2.getMinutes()+"分"+day2.getSeconds()+"秒";},1000) + "月" + (day2.getDate()<10?"0"+day2.getDate():day2.getDate())+' 星期'+"日一二三四五六".charAt(new Date().getDay())
+" | "+(day2.getHours()<10?"0"+day2.getHours():day2.getHours())+""+(day2.getMinutes()<10?"0"
+day2.getMinutes():day2.getMinutes())+"分"+(day2.getSeconds()<10?"0"+day2.getSeconds():day2.getSeconds())+"";},1000)
}, },
methods:{ methods:{
goPersonalInfo(userId) {
this.$router.push({name: 'personalinfo'});
sessionStorage.setItem("userId",userId);
},
goMore() { goMore() {
this.$message({ this.$message({
message:"期待更多内容", message:"期待更多内容",
@ -70,7 +82,12 @@
}, },
goMyClass() { goMyClass() {
this.$router.push({name: "myclass"}) if (this.isLogin == true) {
this.$router.push({name: "myclass"})
} else {
this.$message.warning("请先登录")
this.$router.push({name: "login"})
}
}, },
goStudentThought() { goStudentThought() {
this.$router.push({name: "studentthought"}) this.$router.push({name: "studentthought"})
@ -134,6 +151,9 @@
</script> </script>
<style scoped> <style scoped>
.el-container{
/*height: 100%;*/
}
.el-menu{ .el-menu{
border-radius: 5px; border-radius: 5px;
} }
@ -143,6 +163,7 @@
width: 10rem!important; width: 10rem!important;
margin-top: 1rem; margin-top: 1rem;
text-align: center; text-align: center;
height: 21rem;
} }
.el-radio-group{ .el-radio-group{
margin-bottom: 0!important; margin-bottom: 0!important;

View File

@ -20,7 +20,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="账号" prop="username"> <el-form-item label="账号" prop="username">
<el-select <!--<el-select
v-if="isSelect" v-if="isSelect"
v-model="form.username" v-model="form.username"
filterable filterable
@ -36,8 +36,8 @@
<span style="float: left">{{ item.username}}</span> <span style="float: left">{{ item.username}}</span>
<span style="float: right; color: #8492a6; font-size: 13px" @click="deleteUser(item.username,index)"><i class="el-icon-circle-close"></i></span> <span style="float: right; color: #8492a6; font-size: 13px" @click="deleteUser(item.username,index)"><i class="el-icon-circle-close"></i></span>
</el-option> </el-option>
</el-select> </el-select>-->
<!-- <el-input v-model="form.username" type="text" placeholder="请输入手机号或姓名"></el-input>--> <el-input v-model="form.username" type="text" placeholder="请输入手机号或姓名"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="密码" prop="password"> <el-form-item label="密码" prop="password">
<el-input v-model="form.password" type="password" placeholder="请输入密码" @keyup.enter.native="login"></el-input> <el-input v-model="form.password" type="password" placeholder="请输入密码" @keyup.enter.native="login"></el-input>
@ -120,7 +120,7 @@
], ],
username: [ username: [
{ required: true, message: '请输入用户名', trigger: 'blur' }, { required: true, message: '请输入用户名', trigger: 'blur' },
{ min: 6, max: 11, message: '长度在 6 到 11 个字符', trigger: 'blur' } { min: 2, max: 11, message: '长度在 2 到 11 个字符', trigger: 'blur' }
], ],
password: [ password: [
{ required: true, message: '请输入密码', trigger: 'blur' }, { required: true, message: '请输入密码', trigger: 'blur' },
@ -163,7 +163,7 @@
mounted() { mounted() {
}, },
methods:{ methods:{
deleteUser(username,index) { /*deleteUser(username,index) {
if (this.rememberList != null) { if (this.rememberList != null) {
this.rememberList.forEach((item)=>{ this.rememberList.forEach((item)=>{
if (item.username == username) { if (item.username == username) {
@ -178,19 +178,19 @@
this.form.username = ''; this.form.username = '';
},10) },10)
console.log(this.form.username) console.log(this.form.username)
}, },*/
selectUsername(event) { /*selectUsername(event) {
this.rememberPassword = true
if (this.rememberList != null) { if (this.rememberList != null) {
this.rememberList.forEach((item)=>{ this.rememberList.forEach((item)=>{
if (item.username == event) { if (item.username == event) {
this.form = item this.form = item
this.rememberPassword = true
} }
}) })
} }
this.isSelect = false this.isSelect = false
this.isSelect = true this.isSelect = true
}, },*/
forget() { forget() {
this.$message("请联系管理员重置密码") this.$message("请联系管理员重置密码")
}, },
@ -205,7 +205,7 @@
message: "登录成功", message: "登录成功",
type: "success" type: "success"
}); });
if (this.rememberPassword == true) { /*if (this.rememberPassword == true) {
let one = { let one = {
role: this.form.role, role: this.form.role,
username: this.form.username, username: this.form.username,
@ -229,7 +229,7 @@
rememberList.push(one) rememberList.push(one)
sessionStorage.setItem("rememberList",JSON.stringify(rememberList)); sessionStorage.setItem("rememberList",JSON.stringify(rememberList));
} }
} }*/
this.loading = false; this.loading = false;
this.$router.push({ this.$router.push({
name: "homepage" name: "homepage"

View File

@ -1,11 +1,18 @@
<template> <template>
<el-container> <el-container>
<el-main> <el-main>
<div class="search"> <el-page-header @back="goBack" content="发布班级通知" v-if="addClassNotice"></el-page-header>
<addArticle
v-if="addClassNotice"
@editorTitle="editorTitle"
@goInfo="goInfo"
@refresh="refresh"
></addArticle>
<div class="search" v-if="!addClassNotice">
<el-input class="searchinp" v-model="condition" placeholder="请输入内容" @keydown.enter.native="search"></el-input> <el-input class="searchinp" v-model="condition" placeholder="请输入内容" @keydown.enter.native="search"></el-input>
<el-button type="primary" class="searchbtn" @click="search">搜索</el-button> <el-button type="primary" class="searchbtn" @click="search">搜索</el-button>
</div> </div>
<div class="class-bulletin"> <div class="class-bulletin" v-if="!addClassNotice">
<div class="title">班级公告</div> <div class="title">班级公告</div>
<div class="bulletin"> <div class="bulletin">
<div class="text"> <div class="text">
@ -15,15 +22,17 @@
<el-button class="editor" @click="editor">编辑</el-button> <el-button class="editor" @click="editor">编辑</el-button>
</div> </div>
</div> </div>
<div class="list"> <div class="list" v-if="!addClassNotice">
<div class="title">班级通知</div> <div class="title">班级通知</div>
<div class="one" v-for="item in noticeList" > <el-button class="releasebut" size="small" @click="release" plain>发布通知</el-button>
<nodate v-if="noDate"></nodate>
<div class="one" v-for="item in noticeList" v-if="!noDate">
<div class="type">[{{item.label}}]</div> <div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</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" @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>
<p class="sum">{{length}}条数据</p> <p class="sum" v-if="!noDate">{{length}}条数据</p>
</div> </div>
</el-main> </el-main>
<el-aside> <el-aside>
@ -63,10 +72,15 @@
<script> <script>
import { getDate } from '../assets/js/public.js' import { getDate } from '../assets/js/public.js'
export default { import nodate from './components/NoData'
import addArticle from './AddArticle'
export default {
name: "MyClass", name: "MyClass",
data() { data() {
return{ return{
addClassNotice: false,
noDate: false,
condition: '', condition: '',
editors: { editors: {
title: '', title: '',
@ -94,9 +108,46 @@
this.noticeList = r. noticeList; this.noticeList = r. noticeList;
this.length = r. noticeList.length; this.length = r. noticeList.length;
this.students = r.students; this.students = r.students;
if (r. noticeList.length === 0) {
this.noDate = true
}
}) })
}, },
methods: { methods: {
goBack() {
this.addClassNotice = false
},
refresh() {
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;
if (r. noticeList.length === 0) {
this.noDate = true
}
})
},
editorTitle(pageTitle) {
this.pageTitle = pageTitle
},
goInfo() {
this.addClassNotice = false
},
release() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
if (userInfo.user_type === "教师") {
this.addClassNotice = true
sessionStorage.setItem("releaseType","classNotice")
} else {
this.$message.error("没有权限发布通知")
}
},
bulletinSubmit() { bulletinSubmit() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo")) let userInfo = JSON.parse(sessionStorage.getItem("userInfo"))
if (this.isNull === false) { if (this.isNull === false) {
@ -160,17 +211,29 @@
getContent(id) { getContent(id) {
this.$router.push({name: 'content'}); this.$router.push({name: 'content'});
sessionStorage.setItem("noticeId",id); sessionStorage.setItem("noticeId",id);
sessionStorage.setItem("contentType","classContent");
}, },
goPersonalInfo(userId) { goPersonalInfo(userId) {
this.$router.push({name: 'personalinfo'}); this.$router.push({name: 'personalinfo'});
sessionStorage.setItem("userId",userId); sessionStorage.setItem("userId",userId);
}, },
},
components: {
nodate,
addArticle
} }
} }
</script> </script>
<style scoped> <style scoped>
.el-page-header{
padding: 1rem;
background: #fff;
}
.releasebut{
float: right;
margin: -3rem 0 0 0;
}
.text .tit{ .text .tit{
text-align: center; text-align: center;
font-size: 1.2rem; font-size: 1.2rem;
@ -246,7 +309,7 @@
flex: 1; flex: 1;
} }
.one .release-time{ .one .release-time{
flex: 1; flex: 1.5;
} }
.search{ .search{
margin: 0 0 3rem 0; margin: 0 0 3rem 0;
@ -264,7 +327,7 @@
background: #EEFCFE; background: #EEFCFE;
} }
.el-aside{ .el-aside{
width: 10rem!important; width: 14rem!important;
background: #fff; background: #fff;
} }
.el-aside .title{ .el-aside .title{
@ -274,6 +337,7 @@
} }
.students .student{ .students .student{
padding: 0 1rem; padding: 0 1rem;
width: 10rem;
font-size: 0.8rem; font-size: 0.8rem;
display: flex; display: flex;
height: 1.5rem; height: 1.5rem;

View File

@ -7,13 +7,14 @@
</div> </div>
<div class="list"> <div class="list">
<div class="title">家长建议</div> <div class="title">家长建议</div>
<div class="one" v-for="item in adviceList" > <nodate v-if="noDate"></nodate>
<div class="one" v-for="item in adviceList" v-if="!noDate">
<div class="type">[{{item.label}}]</div> <div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</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" @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>
<p class="sum">{{length}}条数据</p> <p class="sum" v-if="!noDate">{{length}}条数据</p>
</div> </div>
</el-main> </el-main>
<el-aside> <el-aside>
@ -25,6 +26,7 @@
<script> <script>
import footers from '../components/components/Footer' import footers from '../components/components/Footer'
import nodate from '../components/components/NoData'
export default { export default {
name: "ParentsOpinion", name: "ParentsOpinion",
data() { data() {
@ -32,17 +34,27 @@
condition: '', condition: '',
adviceList: '', adviceList: '',
length: '', length: '',
noDate: false,
} }
}, },
mounted() { mounted() {
this.$ajax.post("/hs/getListByAttribute",{text:"",type:"家长建议"},r=>{ this.$ajax.post("/hs/getListByAttribute",{text:"",type:"家长建议"},r=>{
this.adviceList = r this.adviceList = r
this.length = r.length this.length = r.length
if (r.length === 0) {
this.noDate = true
}
}) })
}, },
methods: { methods: {
search() { search() {
this.$ajax.post("/hs/getListByAttribute",{text:this.condition,type:"家长建议"},r=>{
this.adviceList = r
this.length = r.length
if (r.length === 0) {
this.noDate = true
}
})
}, },
getContent(id) { getContent(id) {
this.$router.push({name: 'content'}); this.$router.push({name: 'content'});
@ -54,7 +66,8 @@
}, },
}, },
components: { components: {
footers footers,
nodate
} }
} }
</script> </script>
@ -65,6 +78,8 @@
} }
.el-aside{ .el-aside{
margin: -1rem 0 0 1rem; margin: -1rem 0 0 1rem;
width: 14rem !important;
overflow: hidden;
} }
.list .title{ .list .title{
font-size: 1.5rem; font-size: 1.5rem;
@ -119,7 +134,7 @@
flex: 1; flex: 1;
} }
.one .release-time{ .one .release-time{
flex: 1; flex: 1.5;
} }
.search{ .search{
margin: 0 0 3rem 0; margin: 0 0 3rem 0;

View File

@ -15,6 +15,8 @@
<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">{{item.real_name}}</div>-->
<div class="release-time">{{item.release_time}}</div> <div class="release-time">{{item.release_time}}</div>
<div class="editorbtn" @click="editorContent(item.id)" v-if="isOwn">编辑</div>
<div class="delete" @click="deleteMy(item.id)" v-if="isOwn">删除</div>
</div> </div>
<p class="sum">{{length}}条数据</p> <p class="sum">{{length}}条数据</p>
</div> </div>
@ -32,14 +34,15 @@
<div class="name"> <div class="name">
<div class="header-photo">{{all.header_photo}}</div> <div class="header-photo">{{all.header_photo}}</div>
<div class="username">{{all.real_name}}</div> <div class="username">{{all.real_name}}</div>
<div class="go-homepage pointer">TA的个人主页 ></div> <div class="go-homepage pointer" v-if="!isOwn">HSLink</div>
<div class="privateLetter pointer" v-if="isOwn" @click="privateLetter">私信(未读:{{all.letter_number}})</div>
</div> </div>
<div class="grades"> <div class="grades">
<div class="grade"> <div class="grade">
<span>等级:</span> <span>等级:</span>
<div class="number"> <div class="number">
<span>博客</span> <span>博客</span>
<span>2</span> <span>{{Math.floor(all.integral/1000)+1}}</span>
</div> </div>
</div> </div>
<div class="integral"> <div class="integral">
@ -50,52 +53,286 @@
</div> </div>
<hr> <hr>
<div class="operation" v-if="!isOwn"> <div class="operation" v-if="!isOwn">
<el-button type="primary" plain> </el-button> <el-button type="primary" plain size="mini" @click="follow"> </el-button>
<el-button type="primary" plain> </el-button> <el-button type="primary" plain size="mini" @click="sendLetter(all.user_id,all.real_name)"> </el-button>
</div> </div>
<div class="operation" v-if="isOwn"> <div class="operation" v-if="isOwn">
<el-button type="primary" plain @click="goEditor">新增文章</el-button> <el-button type="primary" plain @click="goEditor" size="mini"> </el-button>
<el-button type="primary" plain>修改密码</el-button> <el-button type="primary" plain size="mini" @click="editorPassword">修改密码</el-button>
</div> </div>
</div> </div>
<footers></footers> <footers></footers>
</el-aside> </el-aside>
<el-dialog
title="修改密码"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose">
<el-form :model="editorPasswordForm"
:rules="editorPasswordRules"
ref="editorPasswordForm"
label-width="100px"
class="demo-ruleForm"
close-on-click-modal=false
label-position="left">
<el-form-item label="原始密码:" prop="oldPassword">
<el-input v-model="editorPasswordForm.oldPassword" placeholder="请输入原始密码" type="password"></el-input>
</el-form-item>
<el-form-item label="新密码:" prop="newPassword">
<el-input v-model="editorPasswordForm.newPassword" placeholder="请输入新密码" type="password"></el-input>
</el-form-item>
<el-form-item label="确认密码:" prop="againPassword">
<el-input v-model="editorPasswordForm.againPassword" placeholder="请确认密码" type="password"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="editorSubmit"> </el-button>
</span>
</el-dialog>
<el-drawer
:visible.sync="drawer"
:direction="direction"
:show-close = false
:before-close="handleClosePrivateLetter">
<div class="privateLetterList">
<div class="header">
<div class="content">内容</div>
<div class="name">姓名</div>
<div class="time">发送时间</div>
</div>
<div class="unread">
<p>未读</p>
<p v-if="unreadIsNull">暂无未读</p>
<div class="privateLetterOne" v-for="item in privateLetterList" v-if="(item.already_read === '0')" @click="read(item.id)">
<div class="content">{{item.content}}</div>
<div class="name">{{item.real_name}}</div>
<div class="time">{{item.letter_create_time}}</div>
</div>
</div>
<div class="already-read">
<p>已读</p>
<p v-if="alreadyReadIsNull">暂无已读</p>
<div class="privateLetterOne" v-for="item in privateLetterList" v-if="(item.already_read === '1')" @click="read(item.id)">
<div class="content">{{item.content}}</div>
<div class="name">{{item.real_name}}</div>
<div class="time">{{item.letter_create_time}}</div>
</div>
</div>
</div>
</el-drawer>
</el-container> </el-container>
</template> </template>
<script> <script>
import addArticle from './AddArticle' import addArticle from './AddArticle'
import footers from './components/Footer'
import {getDate} from "../assets/js/public";
export default { export default {
name: "PersonalInfo", name: "PersonalInfo",
data() { data() {
let againPassword = (rule, value, callback) => {
if (value === '') {
callback(new Error('请再次输入密码'));
} else if (value !== this.editorPasswordForm.newPassword) {
callback(new Error('两次输入密码不一致!'));
} else {
callback();
}
}
return{ return{
unreadIsNull: true,
alreadyReadIsNull: true,
privateLetterList: '',
editorPasswordRules: {
oldPassword: [
{ required: true, message: '请输入原始密码', trigger: 'blur' },
{ min: 6, max: 10, message: '长度在 6 到 8 个字符', trigger: 'blur' }
],
newPassword: [
{ required: true, message: '请输入新密码', trigger: 'blur' },
{ min: 6, max: 10, message: '长度在 6 到 8 个字符', trigger: 'blur' }
],
againPassword: [
{ required: true, message: '请确认密码', trigger: 'blur' },
{ validator:againPassword, trigger: 'blur' }
],
},
editorPasswordForm: {
oldPassword: '',
newPassword: '',
againPassword: ''
},
pageTitle: '个人中心', pageTitle: '个人中心',
editor: true, editor: true,
condition: '', condition: '',
list: '', list: '',
all: '', all: '',
isOwn: true, isOwn: true,
length: '',
dialogVisible: false,
drawer: false,
direction: 'rtl',
} }
}, },
mounted() { mounted() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo")); let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
if (userInfo.user_id == sessionStorage.getItem("userId")) { if (userInfo.user_id === sessionStorage.getItem("userId")) {
this.isOwn = true this.isOwn = true
} else { } else {
this.isOwn = false this.isOwn = false
} }
this.$ajax.post("/hs/getListByAttribute",{text:"",releaseId: sessionStorage.getItem("userId")},r=>{ this.$ajax.post("/hs/getPersonalInfo",{text:"",releaseId: sessionStorage.getItem("userId")},r=>{
this.list = r; this.list = r.personalList;
this.length = r.length; this.length = r.personalList.length;
this.all = { this.all = {
real_name: r[0].real_name, real_name: r.personalInfo.real_name,
header_photo: r[0].real_name.substring(0, 1), header_photo: r.personalInfo.real_name.substring(0, 1),
integral: r[0].integral integral: r.personalInfo.integral,
letter_number: r.personalInfo.letter_number,
user_id: r.personalInfo.user_id,
} }
}) })
}, },
methods: { methods: {
sendLetter(id,name) {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
this.$prompt('接受者:'+name, '发送私信', {
confirmButtonText: '确定',
cancelButtonText: '取消',
inputPattern: /\S/,
inputErrorMessage: '内容不能为空'
}).then(({ value }) => {
this.$ajax.post("/hs/sendLetter",{sendId:userInfo.user_id,receiveId:id,content:value,time:getDate()},r=>{
if (r === 1) {
this.$message({
type: 'success',
message: '发送成功'
});
} else {
this.$message.error("发送失败")
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '取消输入'
});
});
},
read(id) {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
this.$ajax.post("/hs/readPrivateLetter",{userId:userInfo.user_id,id:id},r=>{
this.$confirm(`<p style="font-size: 0.9rem">发送者:${r.onePrivateLetter[0].real_name}</p>
<p style="font-size: 0.9rem">内容${r.onePrivateLetter[0].content}</p>
<p style="font-size: 0.9rem">发送时间${r.onePrivateLetter[0].letter_create_time}</p>
`, '私信', {
cancelButtonText: '回复',
dangerouslyUseHTMLString: true
}).catch(() => {
this.sendLetter(r.onePrivateLetter[0].user_id,r.onePrivateLetter[0].real_name)
});
this.$ajax.post("/hs/getPersonalPrivateLetter",{userId:userInfo.user_id},r=>{
this.privateLetterList = r
for (let i = 0; i < r.length; i++) {
if (r[i].already_read === "0") {
this.unreadIsNull = false
} else {
this.unreadIsNull = true
}
if (r[i].already_read === "1") {
this.alreadyReadIsNull = false
} else {
this.unreadIsNull = true
}
}
})
this.$ajax.post("/hs/getPersonalInfo",{text:"",releaseId: sessionStorage.getItem("userId")},r=>{
this.list = r.personalList;
this.length = r.personalList.length;
this.all = {
real_name: r.personalInfo.real_name,
header_photo: r.personalInfo.real_name.substring(0, 1),
integral: r.personalInfo.integral,
letter_number: r.personalInfo.letter_number,
user_id: r.personalInfo.user_id,
}
})
})
},
privateLetter() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
this.drawer = true;
this.$ajax.post("/hs/getPersonalPrivateLetter",{userId:userInfo.user_id},r=>{
this.privateLetterList = r
for (let i = 0; i < r.length; i++) {
if (r[i].already_read === "0") {
this.unreadIsNull = false
}
if (r[i].already_read === "1") {
this.alreadyReadIsNull = false
}
}
})
},
/*handleClosePrivateLetter(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
},*/
editorSubmit() {
let userInfo = JSON.parse(sessionStorage.getItem("userInfo"));
if (this.editorPasswordForm.oldPassword === userInfo.pass_word) {
if (this.editorPasswordForm.againPassword === this.editorPasswordForm.newPassword) {
this.$ajax.post("/hs/updatePassword",{password:this.editorPasswordForm.againPassword,id:userInfo.user_id},r=>{
if (r === 1) {
this.$message({
type:"success",
message: "修改密码成功3秒后重新登录"
})
const loading = this.$loading({
lock: true,
text: 'Loading',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
this.dialogVisible = false
sessionStorage.setItem("userInfo","");
setTimeout(()=>{
loading.close();
this.$router.push({name:"login"})
},3000)
} else {
this.$message.error("修改密码失败")
}
})
}
} else {
this.$message.error("原始密码不正确")
this.editorPasswordForm = {};
}
},
/*handleClose(done) {
this.$confirm('放弃修改密码?')
.then(_ => {
done();
})
.catch(_ => {});
},*/
editorPassword() {
this.dialogVisible = true
},
follow() {
this.$message({
type:"success",
message: "喜欢就好"
})
},
refresh() { refresh() {
this.$ajax.post("/hs/getListByAttribute",{text:"",releaseId: sessionStorage.getItem("userId")},r=>{ this.$ajax.post("/hs/getListByAttribute",{text:"",releaseId: sessionStorage.getItem("userId")},r=>{
this.list = r; this.list = r;
@ -114,7 +351,8 @@
this.$router.back(-1) this.$router.back(-1)
}, },
goEditor() { goEditor() {
this.editor = false this.editor = false;
sessionStorage.setItem("releaseType","")
}, },
goInfo() { goInfo() {
this.editor = true this.editor = true
@ -133,15 +371,128 @@
getContent(id) { getContent(id) {
this.$router.push({name: 'content'}); this.$router.push({name: 'content'});
sessionStorage.setItem("noticeId",id); sessionStorage.setItem("noticeId",id);
},
editorContent(id) {
this.$router.push({name: 'editorcontent'});
sessionStorage.setItem("noticeId",id);
},
deleteMy(id) {
this.$confirm('确定删除该条数据, 是否继续?', '删除', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$ajax.post("/hs/deleteOne",{id:id},r=>{
if (r === 1) {
this.$message({
type: 'success',
message: '删除成功!'
});
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
}
})
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
} }
}, },
components: { components: {
addArticle addArticle,
footers
} }
} }
</script> </script>
<style scoped> <style scoped>
.privateLetterList{
padding: 1rem;
margin-top: -1rem;
}
.already-read{
margin-top: 1rem;
padding: 0 1rem;
}
.already-read p:nth-child(1){
font-size: 1.2rem;
font-weight: bold;
color: #419EFF;
margin: 0.5rem 0 0 0;
}
.already-read p:nth-child(2), .unread p:nth-child(2){
color: #419EFF;
text-align: center;
}
.unread{
color: red;
margin-top: 1rem;
padding: 0 1rem;
}
.unread p:nth-child(1){
font-size: 1.2rem;
font-weight: bold;
color: red;
margin: 0.5rem 0 0 0;
}
.header{
display: flex;
padding: 0.5rem;
margin: 0.5rem;
border: 1px solid #419EFF;
border-radius: 5px;
}
.header div{
text-align: center;
}
.header .content{
flex: 3;
}
.header .name{
flex: 1;
}
.header .time{
flex: 2;
}
.privateLetterOne{
padding: 0.5rem;
/*margin: 0.5rem;*/
display: flex;
border-bottom: 1px solid;
font-size: 0.9rem;
cursor: pointer;
}
.privateLetterOne:hover{
color: #419EFF;
}
.privateLetterOne div{
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.privateLetterOne .content{
flex: 3;
}
.privateLetterOne .name{
flex: 1;
text-align: center;
}
.privateLetterOne .time{
flex: 2;
text-align: center;
}
.el-container{
margin: 1rem;
}
.el-page-header{ .el-page-header{
padding: 1rem; padding: 1rem;
} }
@ -212,11 +563,17 @@
.one .release-time{ .one .release-time{
flex: 2; flex: 2;
} }
.one .editorbtn{
flex: 0.5;
}
.one .delete{
flex: 0.5;
}
.operation .el-button:nth-child(1){ .operation .el-button:nth-child(1){
margin-left: 1.5rem; /*margin-left: 1.5rem;*/
} }
.operation .el-button:nth-child(2){ .operation .el-button:nth-child(2){
margin-right: 1.5rem; /*margin-right: 1.5rem;*/
float: right; float: right;
} }
.integral span:nth-child(2).ranking span:nth-child(2){ .integral span:nth-child(2).ranking span:nth-child(2){
@ -255,7 +612,14 @@
margin-left: 3.5rem; margin-left: 3.5rem;
font-size: 0.9rem; font-size: 0.9rem;
} }
.privateLetter{
font-size: 0.9rem;
color: #3399ea;
margin-left: 3.5rem;
margin-top: 0.5rem;
}
.go-homepage{ .go-homepage{
height: 0.9rem;
font-size: 0.9rem; font-size: 0.9rem;
color: #3399ea; color: #3399ea;
margin-left: 3.5rem; margin-left: 3.5rem;
@ -272,6 +636,10 @@
text-align: center; text-align: center;
float: left; float: left;
font-size: 1.5rem; font-size: 1.5rem;
margin-right: 2rem; margin-right: 1rem;
}
.el-aside{
width: 14rem!important;
overflow: hidden;
} }
</style> </style>

View File

@ -77,7 +77,7 @@
getDay(date) { getDay(date) {
this.dialogVisible = true this.dialogVisible = true
console.log(date) console.log(date)
this.$ajax.post("/hs/getListByAttribute",{release_time: date.day,text: ''}, this.$ajax.post("/hs/getListByAttribute",{release_time: date.day,text: '',type:"校园通知"},
r=> { r=> {
this.list = r; this.list = r;
this.length = r.length; this.length = r.length;

View File

@ -6,7 +6,8 @@
<el-input class="searchinp" v-model="condition" placeholder="请输入内容" @keydown.enter.native="search"></el-input> <el-input class="searchinp" v-model="condition" placeholder="请输入内容" @keydown.enter.native="search"></el-input>
<el-button type="primary" class="searchbtn" @click="search">搜索</el-button> <el-button type="primary" class="searchbtn" @click="search">搜索</el-button>
</div> </div>
<div class="list"> <nodate v-if="noDate"></nodate>
<div class="list" v-if="!noDate">
<div class="one" v-for="item in list" > <div class="one" v-for="item in list" >
<div class="type">[{{item.label}}]</div> <div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</div> <div class="text" @click="getContent(item.id)">{{item.title}}</div>
@ -25,6 +26,7 @@
<script> <script>
import footers from './components/Footer' import footers from './components/Footer'
import nodate from './components/NoData'
export default { export default {
name: "Search", name: "Search",
data() { data() {
@ -32,6 +34,7 @@
condition: '', condition: '',
list: '', list: '',
length: '', length: '',
noDate: false,
} }
}, },
mounted() { mounted() {
@ -39,6 +42,9 @@
this.$ajax.post("/hs/getListByAttribute",{text:this.condition},r=>{ this.$ajax.post("/hs/getListByAttribute",{text:this.condition},r=>{
this.list = r this.list = r
this.length = r.length this.length = r.length
if (r.length === 0) {
this.noDate = true
}
}) })
}, },
methods: { methods: {
@ -62,7 +68,8 @@
} }
}, },
components: { components: {
footers footers,
nodate
} }
} }
</script> </script>
@ -71,6 +78,9 @@
.el-page-header{ .el-page-header{
padding: 1rem; padding: 1rem;
} }
.el-container{
margin: 1rem;
}
.el-main{ .el-main{
background: #fff; background: #fff;
} }
@ -109,6 +119,8 @@
} }
.one .type{ .one .type{
flex: 1; flex: 1;
cursor: default;
text-decoration: none!important;
} }
.one .text{ .one .text{
flex: 4; flex: 4;
@ -117,10 +129,12 @@
flex: 1; flex: 1;
} }
.one .release-time{ .one .release-time{
flex: 1; flex: 1.5;
} }
.el-aside{ .el-aside{
margin: -1rem 0 0 1rem; margin: -1rem 0 0 1rem;
width: 14rem!important;
overflow: hidden;
} }
.el-main{ .el-main{
padding: 0; padding: 0;

View File

@ -7,13 +7,14 @@
</div> </div>
<div class="list"> <div class="list">
<div class="title">学生想法</div> <div class="title">学生想法</div>
<div class="one" v-for="item in thinkingList" > <nodate v-if="noDate"></nodate>
<div class="one" v-for="item in thinkingList" v-if="!noDate">
<div class="type">[{{item.label}}]</div> <div class="type">[{{item.label}}]</div>
<div class="text" @click="getContent(item.id)">{{item.title}}</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" @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>
<p class="sum">{{length}}条数据</p> <p class="sum" v-if="!noDate">{{length}}条数据</p>
</div> </div>
</el-main> </el-main>
<el-aside> <el-aside>
@ -25,13 +26,16 @@
<script> <script>
import footers from '../components/components/Footer' import footers from '../components/components/Footer'
import nodate from '../components/components/NoData'
export default { export default {
name: "StudentThought", name: "StudentThought",
data() { data() {
return{ return{
noDate: '',
condition: '', condition: '',
thinkingList: '', thinkingList: '',
length: '', length: '',
noDate: false,
} }
}, },
mounted() { mounted() {
@ -42,7 +46,13 @@
}, },
methods: { methods: {
search() { search() {
this.$ajax.post("/hs/getListByAttribute",{text:this.condition,type:"学生想法"},r=>{
this.thinkingList = r
this.length = r.length
if (r.length === 0) {
this.noDate = true
}
})
}, },
getContent(id) { getContent(id) {
this.$router.push({name: 'content'}); this.$router.push({name: 'content'});
@ -54,7 +64,8 @@
}, },
}, },
components: { components: {
footers footers,
nodate
} }
} }
</script> </script>
@ -65,6 +76,8 @@
} }
.el-aside{ .el-aside{
margin: -1rem 0 0 1rem; margin: -1rem 0 0 1rem;
width: 14rem !important;
overflow: hidden;
} }
.list .title{ .list .title{
font-size: 1.5rem; font-size: 1.5rem;
@ -119,7 +132,7 @@
flex: 1; flex: 1;
} }
.one .release-time{ .one .release-time{
flex: 1; flex: 1.5;
} }
.search{ .search{
margin: 0 0 3rem 0; margin: 0 0 3rem 0;

View File

@ -2,15 +2,17 @@
<div class="container"> <div class="container">
<el-main> <el-main>
<div class="list"> <div class="list">
<div class="one"> <div class="one" @click="service">
<img src="../../assets/img/qq.png" /> <img src="../../assets/img/qq.png" />
<span>QQ客服</span> <span>QQ客服</span>
</div> </div>
<div class="one"> <div class="one" >
<i class="el-icon-s-promotion"></i> <a class="emil" rel="nofollow" href="https://mail.qq.com/" target="_blank">
<span>{{emil}}</span> <i class="el-icon-s-promotion"></i>
<span>{{emil}}</span>
</a>
</div> </div>
<div class="one"> <div class="one" @click="serviceBlog">
<i class="el-icon-s-home"></i> <i class="el-icon-s-home"></i>
<span>客服论坛</span> <span>客服论坛</span>
</div> </div>
@ -19,9 +21,21 @@
<span>150-0673-2580</span> <span>150-0673-2580</span>
</div> </div>
<p>工作时间 8:30-22:00</p> <p>工作时间 8:30-22:00</p>
<a class="beian" rel="nofollow" href="http://www.beian.miit.gov.cn" target="_blank"><p>备案号鲁ICP备19037910号-1</p></a> <a class="beian" rel="nofollow" href="http://www.beian.miit.gov.cn" target="_blank">
<p>备案号</p>
<p>鲁ICP备19037910号-1</p>
</a>
</div> </div>
</el-main> </el-main>
<el-dialog
title="QQ客服"
:visible.sync="dialogVisible"
width="30%">
<img class="QQservice" src="../../assets/img/QQservice.png" alt="" size="80%">
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="dialogVisible = false"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
@ -30,25 +44,49 @@
name: "Footer", name: "Footer",
data() { data() {
return{ return{
dialogVisible: false,
emil: "617594538@qq.com" emil: "617594538@qq.com"
} }
} },
methods:{
service() {
this.dialogVisible = true
},
serviceBlog() {
this.$alert('客服论坛建设中', '客服论坛', {
confirmButtonText: '确定',
});
},
},
} }
</script> </script>
<style scoped> <style scoped>
.QQservice{
height: 20rem;
margin: 0 auto;
display: block;
}
.emil{
color: #8590A6;
}
.container{ .container{
padding: 0; padding: 0;
margin-top: 1rem; margin-top: 1rem;
} }
.el-main{ .el-main{
background: #fff; background: #fff;
overflow: inherit!important;
}
.list{
font-size: 0.9rem;
} }
.list p{ .list p{
color: #8590A6; color: #8590A6;
margin: 0.2rem 0;
} }
.one{ .one{
height: 2rem; height: 1.5rem;
color: #8590A6; color: #8590A6;
cursor: pointer; cursor: pointer;
} }
@ -64,6 +102,10 @@
position: absolute; position: absolute;
margin-top: 0.3rem; margin-top: 0.3rem;
margin-left: 0.5rem; margin-left: 0.5rem;
width: 10rem;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
} }
.beian{ .beian{
text-decoration: none; text-decoration: none;

View File

@ -61,6 +61,11 @@ export default new Router({
name:'personalinfo', name:'personalinfo',
component:() => import('@/components/PersonalInfo') component:() => import('@/components/PersonalInfo')
}, },
{
path:'editorcontent',
name:'editorcontent',
component:() => import('@/components/EditorContent')
},
] ]
} }