|
@@ -202,12 +202,13 @@ export default {
|
|
|
id: id,
|
|
|
},
|
|
|
});
|
|
|
- this.dialog_haveRead = false;
|
|
|
+ // this.dialog_haveRead = false;
|
|
|
},
|
|
|
/**
|
|
|
* 获取未读数据列表
|
|
|
*/
|
|
|
getDontReadList() {
|
|
|
+ var self = this;
|
|
|
let val = {
|
|
|
receiptStatus: 0,
|
|
|
systemStatus: 1,
|
|
@@ -216,9 +217,122 @@ export default {
|
|
|
this.tableData = result.rows;
|
|
|
this.total = result.total;
|
|
|
if (this.total > 0) {
|
|
|
- this.dialog_haveRead = true;
|
|
|
+ const h = this.$createElement;
|
|
|
+ let arrays = result.rows.map((item, index) => {
|
|
|
+ return h(
|
|
|
+ "div",
|
|
|
+ {
|
|
|
+ style: {
|
|
|
+ borderBottom:
|
|
|
+ result.total === index + 1 ? "none" : "1px solid #D9D9D9",
|
|
|
+ marginTop: "26px",
|
|
|
+ paddingBottom: "26px",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ [
|
|
|
+ h(
|
|
|
+ "strong",
|
|
|
+ {
|
|
|
+ style: {
|
|
|
+ fontSize: "16px",
|
|
|
+ fontWeight: "bold",
|
|
|
+ color: "#222222",
|
|
|
+ marginBottom: "12px",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ item.remind
|
|
|
+ ),
|
|
|
+ h(
|
|
|
+ "p",
|
|
|
+ {
|
|
|
+ style: {
|
|
|
+ fontSize: "14px",
|
|
|
+ color: "#606266",
|
|
|
+ marginBottom: "12px",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ item.text
|
|
|
+ ),
|
|
|
+ h(
|
|
|
+ "p",
|
|
|
+ {
|
|
|
+ style: {
|
|
|
+ fontSize: "12px",
|
|
|
+ color: "#999999",
|
|
|
+ marginBottom: "12px",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ this.$methodsTools.onlyForma(item.sendTime)
|
|
|
+ ),
|
|
|
+ h(
|
|
|
+ "el-button",
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ size: "small",
|
|
|
+ type: "primary",
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ click: function () {
|
|
|
+ self.newSee(item.id);
|
|
|
+ self.$notify.closeAll();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ "立即查看"
|
|
|
+ ),
|
|
|
+ h(
|
|
|
+ "el-button",
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ size: "small",
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ click: async function () {
|
|
|
+ await self.changeReadStatus(item.id);
|
|
|
+ self.$notify.closeAll();
|
|
|
+ self.$nextTick(() => {
|
|
|
+ self.getDontReadList();
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ "标记为已读"
|
|
|
+ ),
|
|
|
+ ]
|
|
|
+ );
|
|
|
+ });
|
|
|
+ this.$notify({
|
|
|
+ title: `${result.total}条未读信息`,
|
|
|
+ position: "bottom-right",
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
+ duration: 0,
|
|
|
+ customClass: "notiSty",
|
|
|
+ message: h("div", [
|
|
|
+ h(
|
|
|
+ "div",
|
|
|
+ {
|
|
|
+ class: "znxStyle",
|
|
|
+ },
|
|
|
+ arrays
|
|
|
+ ),
|
|
|
+ h(
|
|
|
+ "div",
|
|
|
+ {
|
|
|
+ class: "btn_bottom_style",
|
|
|
+ on: {
|
|
|
+ click: function () {
|
|
|
+ self.seeAllRead();
|
|
|
+ self.$notify.closeAll();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ "查看所有"
|
|
|
+ ),
|
|
|
+ ]),
|
|
|
+ });
|
|
|
+ // this.dialog_haveRead = true;
|
|
|
} else {
|
|
|
- this.dialog_haveRead = false;
|
|
|
+ // this.dialog_haveRead = false;
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -226,12 +340,15 @@ export default {
|
|
|
* 更新已读状态
|
|
|
*/
|
|
|
changeReadStatus(id) {
|
|
|
- this.$api
|
|
|
- .editupdateReadStatusBatch({ ids: [id], receiptStatus: 1 })
|
|
|
- .then((res) => {
|
|
|
- this.$message.success("已读成功");
|
|
|
- this.getDontReadList();
|
|
|
- });
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ this.$api
|
|
|
+ .editupdateReadStatusBatch({ ids: [id], receiptStatus: 1 })
|
|
|
+ .then((res) => {
|
|
|
+ this.$message.success("已读成功");
|
|
|
+ resolve();
|
|
|
+ // this.getDontReadList();
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
/**
|
|
|
* 查看所有消息
|
|
@@ -240,7 +357,7 @@ export default {
|
|
|
this.$router.push({
|
|
|
name: "StationLetter",
|
|
|
});
|
|
|
- this.dialog_haveRead = false;
|
|
|
+ // this.dialog_haveRead = false;
|
|
|
},
|
|
|
openMsg() {
|
|
|
this.dialogVisible = true;
|
|
@@ -259,7 +376,59 @@ export default {
|
|
|
location.href = "/index";
|
|
|
});
|
|
|
})
|
|
|
- .catch(() => {});
|
|
|
+ .catch(() => {
|
|
|
+ // var message: h("div", [
|
|
|
+ // h("strong", null, item.text),
|
|
|
+ // h("p", null, this.$methodsTools.onlyForma(item.sendTime)),
|
|
|
+ // h(
|
|
|
+ // "el-button",
|
|
|
+ // {
|
|
|
+ // attrs: {
|
|
|
+ // size: "small",
|
|
|
+ // type: "primary",
|
|
|
+ // },
|
|
|
+ // on: {
|
|
|
+ // click: function () {
|
|
|
+ // self.newSee(item.id);
|
|
|
+ // self.$notify.closeAll();
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // "立即查看"
|
|
|
+ // ),
|
|
|
+ // h(
|
|
|
+ // "el-button",
|
|
|
+ // {
|
|
|
+ // attrs: {
|
|
|
+ // size: "small",
|
|
|
+ // },
|
|
|
+ // on: {
|
|
|
+ // click: function () {
|
|
|
+ // self.changeReadStatus(item.id);
|
|
|
+ // instance[index].close();
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // "标记已读"
|
|
|
+ // ),
|
|
|
+ // h(
|
|
|
+ // "el-button",
|
|
|
+ // {
|
|
|
+ // attrs: {
|
|
|
+ // size: "small",
|
|
|
+ // type: "success",
|
|
|
+ // },
|
|
|
+ // on: {
|
|
|
+ // click: function () {
|
|
|
+ // self.seeAllRead()
|
|
|
+ // self.$notify.closeAll();
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // },
|
|
|
+ // "查看全部"
|
|
|
+ // ),
|
|
|
+ // ]),
|
|
|
+ });
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -467,4 +636,64 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.znxStyle {
|
|
|
+ max-height: 460px;
|
|
|
+ overflow-y: auto;
|
|
|
+ padding: 0px 28px;
|
|
|
+ &::-webkit-scrollbar {
|
|
|
+ width: 4px;
|
|
|
+ }
|
|
|
+ &::-webkit-scrollbar-thumb {
|
|
|
+ border-radius: 10px;
|
|
|
+ -webkit-box-shadow: inset 0 0 5px rgba(165, 165, 165, 0.2);
|
|
|
+ background: rgba(165, 165, 165, 0.2);
|
|
|
+ }
|
|
|
+ &::-webkit-scrollbar-track {
|
|
|
+ -webkit-box-shadow: inset 0 0 5px rgba(165, 165, 165, 0.2);
|
|
|
+ border-radius: 0;
|
|
|
+ background: rgba(226, 225, 225, 0.2);
|
|
|
+ }
|
|
|
+}
|
|
|
+.btn_bottom_style {
|
|
|
+ height: 50px;
|
|
|
+ border-top: 1px solid #d9d9d9;
|
|
|
+ line-height: 50px;
|
|
|
+ text-align: center;
|
|
|
+ color: #222;
|
|
|
+ font-size: 16px;
|
|
|
+ cursor: pointer;
|
|
|
+ transition: all 0.2s;
|
|
|
+ &:hover {
|
|
|
+ background-color: #eee;
|
|
|
+ }
|
|
|
+}
|
|
|
+.btnStyle_s {
|
|
|
+ margin-top: 6px;
|
|
|
+ background-color: skyblue;
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style lang="less">
|
|
|
+.notiSty {
|
|
|
+ width: 400px !important;
|
|
|
+ padding: 0px !important;
|
|
|
+ & > .el-notification__group {
|
|
|
+ margin: 0px;
|
|
|
+ & > .el-notification__title {
|
|
|
+ text-align: center;
|
|
|
+ height: 60px;
|
|
|
+ line-height: 60px;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ background-color: #409eff;
|
|
|
+ font-family: OPPOSans-Bold, OPPOSans;
|
|
|
+ }
|
|
|
+ & > .el-notification__closeBtn {
|
|
|
+ color: #fff;
|
|
|
+ font-size: 18px;
|
|
|
+ top: 24px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|