|
@@ -1,86 +1,159 @@
|
|
|
<template>
|
|
|
- <section>
|
|
|
- <!--工具条-->
|
|
|
- <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
|
|
|
- <el-form :inline="true">
|
|
|
- <el-col :span="2">
|
|
|
- <el-form-item>全部消息</el-form-item>
|
|
|
- </el-col>
|
|
|
- </el-form>
|
|
|
+ <section>
|
|
|
+ <!--工具条-->
|
|
|
+ <el-col :span="24" class="toolbar" style="padding-bottom: 0px;">
|
|
|
+ <el-form :inline="true">
|
|
|
+ <el-col :span="2">
|
|
|
+ <el-form-item>全部消息</el-form-item>
|
|
|
</el-col>
|
|
|
- <div class="message-div" v-for="item in messages">
|
|
|
- <p>
|
|
|
- <span class="message-type" v-if="item.noticeType == 0">【审批】</span>
|
|
|
- <span class="message-type" v-else-if="item.noticeType == 1">【警告】</span>
|
|
|
- <span class="message-type" v-else-if="item.noticeType == 2">【保养】</span>
|
|
|
- <span class="message-title">{{item.projectName}}</span>
|
|
|
- <span class="message-time">{{item.indate}}</span>
|
|
|
- </p>
|
|
|
- <p class="message-article">{{item.content}}</p>
|
|
|
- </div>
|
|
|
- </section>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ <div class="message-div" v-for="item in messages">
|
|
|
+ <p>
|
|
|
+ <span class="message-type" v-if="item.noticeType == 0">【审批】</span>
|
|
|
+ <span class="message-type" v-else-if="item.noticeType == 1">【警告】</span>
|
|
|
+ <span class="message-type" v-else-if="item.noticeType == 2">【保养】</span>
|
|
|
+ <span
|
|
|
+ class="message-title"
|
|
|
+ @click="locationHerf(item.refId, item.noticeType)"
|
|
|
+ >{{item.projectName}}</span>
|
|
|
+ <span class="message-time">{{item.indate}}</span>
|
|
|
+ </p>
|
|
|
+ <p class="message-article">{{item.content}}</p>
|
|
|
+ </div>
|
|
|
+ <!--工具条-->
|
|
|
+ <el-col :span="24" class="toolbar">
|
|
|
+ <el-pagination
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ :page-sizes="[20 , 50 , 80 , 100 , 200]"
|
|
|
+ :page-size="20"
|
|
|
+ layout="total, sizes, prev, pager, next"
|
|
|
+ :total="total"
|
|
|
+ style="float:right;"
|
|
|
+ ></el-pagination>
|
|
|
+ </el-col>
|
|
|
+ </section>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import util from "../common/js/util";
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- messages: []
|
|
|
- };
|
|
|
+import util from "../common/js/util";
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ messages: [],
|
|
|
+ page: 1,
|
|
|
+ size: 20,
|
|
|
+ total: 0,
|
|
|
+ tableHeight: 0
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ //分页
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.page = val;
|
|
|
+ this.loadNotice();
|
|
|
+ },
|
|
|
+ handleSizeChange(val) {
|
|
|
+ this.size = val;
|
|
|
+ this.loadNotice();
|
|
|
+ },
|
|
|
+ //读取消息提示
|
|
|
+ loadNotice() {
|
|
|
+ this.http.post(
|
|
|
+ this.port.notice.list,
|
|
|
+ {
|
|
|
+ pageNum: this.page,
|
|
|
+ pageSize: this.size
|
|
|
},
|
|
|
- methods: {
|
|
|
- //读取消息提示
|
|
|
- loadNotice() {
|
|
|
- this.http.post(
|
|
|
- this.port.notice.list,
|
|
|
- {},
|
|
|
- res => {
|
|
|
- if (res.code == "ok") {
|
|
|
- this.messages = res.data.list.list;
|
|
|
- } else {
|
|
|
- this.$message({
|
|
|
- message: res.msg,
|
|
|
- type: "error"
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
- error => {
|
|
|
- this.$message({
|
|
|
- message: error,
|
|
|
- type: "error"
|
|
|
- });
|
|
|
- }
|
|
|
- );
|
|
|
- }
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ this.messages = res.data.list.list;
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
- created() {},
|
|
|
- mounted() {
|
|
|
- this.loadNotice();
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
}
|
|
|
- };
|
|
|
+ );
|
|
|
+ },
|
|
|
+ //点击消息的跳转
|
|
|
+ locationHerf(id, type) {
|
|
|
+ this.http.post(
|
|
|
+ this.port.notice.read,
|
|
|
+ {
|
|
|
+ id: id
|
|
|
+ },
|
|
|
+ res => {
|
|
|
+ if (res.code == "ok") {
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: res.msg,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ error => {
|
|
|
+ this.$message({
|
|
|
+ message: error,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ );
|
|
|
+ if (type == 0) {
|
|
|
+ //审批 跳转到模具详情
|
|
|
+ this.$router.push("/moldList/" + id);
|
|
|
+ } else if (type == 1) {
|
|
|
+ //警告 跳转到运行监测
|
|
|
+ this.$router.push("/detection");
|
|
|
+ } else if (type == 2) {
|
|
|
+ //保养 跳转到运行监测详情
|
|
|
+ this.$router.push("/detection/" + id);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ let height = window.innerHeight;
|
|
|
+ this.tableHeight = height - 260;
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.loadNotice();
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|
|
|
- .message-div {
|
|
|
- padding: 5px 0;
|
|
|
- }
|
|
|
+.message-div {
|
|
|
+ padding: 5px 0;
|
|
|
+}
|
|
|
|
|
|
- .message-div > p {
|
|
|
- line-height: 25px;
|
|
|
- margin: 0;
|
|
|
- }
|
|
|
+.message-div > p {
|
|
|
+ line-height: 25px;
|
|
|
+ margin: 0;
|
|
|
+}
|
|
|
|
|
|
- .message-type {
|
|
|
- font-weight: 700;
|
|
|
- }
|
|
|
+.message-type {
|
|
|
+ font-weight: 700;
|
|
|
+}
|
|
|
|
|
|
- .message-time {
|
|
|
- padding-left: 30px;
|
|
|
- color: #777;
|
|
|
- }
|
|
|
+.message-time {
|
|
|
+ padding-left: 30px;
|
|
|
+ color: #777;
|
|
|
+}
|
|
|
|
|
|
- .message-article {
|
|
|
- color: #555;
|
|
|
- }
|
|
|
+.message-title {
|
|
|
+ cursor: pointer;
|
|
|
+ color: #409eff;
|
|
|
+}
|
|
|
+
|
|
|
+.message-article {
|
|
|
+ color: #555;
|
|
|
+}
|
|
|
</style>
|