|
@@ -14,84 +14,6 @@
|
|
</div>
|
|
</div>
|
|
</el-col>
|
|
</el-col>
|
|
<el-col :span="6" class="userinfo">
|
|
<el-col :span="6" class="userinfo">
|
|
- <el-badge class="itemNew" :value="unreadCount[3]" :hidden="unreadCount[3] == 0">
|
|
|
|
- <i class="el-icon-message-solid" style="font-size:24px" v-popover:popover1></i>
|
|
|
|
- <!-- 消息中心 -->
|
|
|
|
- <el-popover ref="popover1" placement="bottom" width="400" trigger="hover" popper-class="popover-self">
|
|
|
|
- <!-- 消息盒子中间部分 -->
|
|
|
|
- <el-tabs v-model="activePage" @tab-click="handleClick" stretch>
|
|
|
|
- <!-- 审批的页面 -->
|
|
|
|
- <el-tab-pane name="0">
|
|
|
|
- <span slot="label">
|
|
|
|
- <span v-if="unreadCount[0] == 0">审批</span>
|
|
|
|
- <span v-else>审批({{unreadCount[0]}})</span>
|
|
|
|
- </span>
|
|
|
|
- <div class="popover-item" v-if="popoverData[0].length == 0">暂无审批消息</div>
|
|
|
|
- <div class="popover-item" v-for="item in popoverData[0]">
|
|
|
|
- <div
|
|
|
|
- style="cursor: pointer;"
|
|
|
|
- @click="locationHerf(item.id, item.refId, item.noticeType, item.belongType)"
|
|
|
|
- >
|
|
|
|
- <p class="popover-title">
|
|
|
|
- <span v-if="item.isRead == 1" class="isRead">{{item.projectName}}</span>
|
|
|
|
- <span v-else>{{item.projectName}}</span>
|
|
|
|
- </p>
|
|
|
|
- <p v-if="item.isRead == 1" class="isRead">{{item.content}}</p>
|
|
|
|
- <p v-else>{{item.content}}</p>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </el-tab-pane>
|
|
|
|
-
|
|
|
|
- <!-- 警告的页面 -->
|
|
|
|
- <el-tab-pane name="1">
|
|
|
|
- <span slot="label">
|
|
|
|
- <span v-if="unreadCount[1] == 0">警告</span>
|
|
|
|
- <span v-else>警告({{unreadCount[1]}})</span>
|
|
|
|
- </span>
|
|
|
|
- <div class="popover-item" v-if="popoverData[1].length == 0">暂无警告消息</div>
|
|
|
|
- <div class="popover-item" v-for="item in popoverData[1]">
|
|
|
|
- <div
|
|
|
|
- style="cursor: pointer;"
|
|
|
|
- @click="locationHerf(item.id, item.refId, item.noticeType, null)"
|
|
|
|
- >
|
|
|
|
- <p class="popover-title">
|
|
|
|
- <span v-if="item.isRead == 1" class="isRead">{{item.projectName}}</span>
|
|
|
|
- <span v-else>{{item.projectName}}</span>
|
|
|
|
- </p>
|
|
|
|
- <p v-if="item.isRead == 1" class="isRead">{{item.content}}</p>
|
|
|
|
- <p v-else>{{item.content}}</p>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </el-tab-pane>
|
|
|
|
-
|
|
|
|
- <!-- 保养的页面 -->
|
|
|
|
- <el-tab-pane name="2">
|
|
|
|
- <span slot="label">
|
|
|
|
- <span v-if="unreadCount[2] == 0">保养</span>
|
|
|
|
- <span v-else>保养({{unreadCount[2]}})</span>
|
|
|
|
- </span>
|
|
|
|
- <div class="popover-item" v-if="popoverData[2].length == 0">暂无保养消息</div>
|
|
|
|
- <div class="popover-item" v-for="item in popoverData[2]">
|
|
|
|
- <div
|
|
|
|
- style="cursor: pointer;"
|
|
|
|
- @click="locationHerf(item.id, item.refId, item.noticeType, null)"
|
|
|
|
- >
|
|
|
|
- <p class="popover-title">
|
|
|
|
- <span v-if="item.isRead == 1" class="isRead">{{item.projectName}}</span>
|
|
|
|
- <span v-else>{{item.projectName}}</span>
|
|
|
|
- </p>
|
|
|
|
- <p v-if="item.isRead == 1" class="isRead">{{item.content}}</p>
|
|
|
|
- <p v-else>{{item.content}}</p>
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </el-tab-pane>
|
|
|
|
- </el-tabs>
|
|
|
|
-
|
|
|
|
- <!-- 查看全部的按钮 -->
|
|
|
|
- <router-link :to="'/message'" tag="div" class="popover-button">查看全部</router-link>
|
|
|
|
- </el-popover>
|
|
|
|
- </el-badge>
|
|
|
|
-
|
|
|
|
<el-dropdown trigger="hover">
|
|
<el-dropdown trigger="hover">
|
|
<span class="el-dropdown-link userinfo-inner">
|
|
<span class="el-dropdown-link userinfo-inner">
|
|
<img src="../assets/image/userHead.png" />
|
|
<img src="../assets/image/userHead.png" />
|
|
@@ -218,10 +140,6 @@
|
|
password: [{ required: true, message: "请输入新密码", trigger: "blur" }],
|
|
password: [{ required: true, message: "请输入新密码", trigger: "blur" }],
|
|
username: [{ required: true, message: "请输入姓名", trigger: "blur" }]
|
|
username: [{ required: true, message: "请输入姓名", trigger: "blur" }]
|
|
},
|
|
},
|
|
- //消息数据
|
|
|
|
- popoverData: ["", "", ""],
|
|
|
|
- unreadCount: [],
|
|
|
|
- activePage: 0,
|
|
|
|
|
|
|
|
//时间
|
|
//时间
|
|
activeDate: new Date()
|
|
activeDate: new Date()
|
|
@@ -310,9 +228,9 @@
|
|
this.editPassWord = true;
|
|
this.editPassWord = true;
|
|
this.addForm.id = JSON.parse(sessionStorage.getItem("user")).id;
|
|
this.addForm.id = JSON.parse(sessionStorage.getItem("user")).id;
|
|
this.addForm.account = JSON.parse(sessionStorage.getItem("user")).account;
|
|
this.addForm.account = JSON.parse(sessionStorage.getItem("user")).account;
|
|
- },
|
|
|
|
|
|
+ },
|
|
|
|
|
|
- resetPwd() {
|
|
|
|
|
|
+ resetPwd() {
|
|
this.$refs.addForm.validate(valid => {
|
|
this.$refs.addForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
this.editLoading = true;
|
|
this.editLoading = true;
|
|
@@ -347,95 +265,12 @@
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- //读取消息提示
|
|
|
|
- loadNotice() {
|
|
|
|
- this.http.post(
|
|
|
|
- this.port.notice.list,
|
|
|
|
- {
|
|
|
|
- pageNum: 1,
|
|
|
|
- pageSize: 5
|
|
|
|
- },
|
|
|
|
- res => {
|
|
|
|
- if (res.code == "ok") {
|
|
|
|
- this.popoverData = [];
|
|
|
|
- this.popoverData.push(res.data[0].approvelList.list);
|
|
|
|
- this.popoverData.push(res.data[1].matainList.list);
|
|
|
|
- this.popoverData.push(res.data[2].emergencyList.list);
|
|
|
|
- this.unreadCount = [];
|
|
|
|
- this.unreadCount.push(res.data[0].isNotReadCount);
|
|
|
|
- this.unreadCount.push(res.data[1].isNotReadCount);
|
|
|
|
- this.unreadCount.push(res.data[2].isNotReadCount);
|
|
|
|
- this.unreadCount.push(
|
|
|
|
- this.unreadCount[0] + this.unreadCount[1] + this.unreadCount[2]
|
|
|
|
- );
|
|
|
|
- } else {
|
|
|
|
- this.$message({
|
|
|
|
- message: res.msg,
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- error => {
|
|
|
|
- this.$message({
|
|
|
|
- message: error,
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- },
|
|
|
|
- //点击消息的跳转
|
|
|
|
- locationHerf(id, refid, type, approval) {
|
|
|
|
- this.http.post(
|
|
|
|
- this.port.notice.read,
|
|
|
|
- {
|
|
|
|
- id: id
|
|
|
|
- },
|
|
|
|
- res => {
|
|
|
|
- if (res.code == "ok") {
|
|
|
|
- //重新读取一次消息
|
|
|
|
- this.loadNotice();
|
|
|
|
- } else {
|
|
|
|
- this.$message({
|
|
|
|
- message: res.msg,
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- error => {
|
|
|
|
- this.$message({
|
|
|
|
- message: error,
|
|
|
|
- type: "error"
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
- //本页面再点的话强制转移一下
|
|
|
|
- var currentRoute = this.$route.path.split("/");
|
|
|
|
- if (currentRoute.length == 4 && currentRoute[1] == "moldList") {
|
|
|
|
- this.$router.go(0);
|
|
|
|
- }
|
|
|
|
- if (type == 0) {
|
|
|
|
- //审批 跳转到模具详情
|
|
|
|
- this.$router.push("/moldList/" + refid + "/" + approval);
|
|
|
|
- } else if (type == 1) {
|
|
|
|
- //警告 跳转到运行监测
|
|
|
|
- this.$router.push("/detection");
|
|
|
|
- } else if (type == 2) {
|
|
|
|
- //保养 跳转到运行监测详情
|
|
|
|
- this.$router.push("/detection/" + refid);
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
-
|
|
|
|
- //标签页面切换时
|
|
|
|
- handleClick(tab, event) {
|
|
|
|
- this.activeTab = tab.name;
|
|
|
|
- }
|
|
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
if (this.user) {
|
|
if (this.user) {
|
|
var user = JSON.parse(this.user);
|
|
var user = JSON.parse(this.user);
|
|
this.user = user;
|
|
this.user = user;
|
|
- this.sysUserName = user.username || "";
|
|
|
|
- this.loadNotice();
|
|
|
|
|
|
+ this.sysUserName = user.name || "";
|
|
} else {
|
|
} else {
|
|
this.$router.push("/login");
|
|
this.$router.push("/login");
|
|
}
|
|
}
|