|
@@ -85,7 +85,7 @@
|
|
|
>
|
|
|
<router-view />
|
|
|
</div>
|
|
|
- <!-- <alarmBadge /> -->
|
|
|
+ <alarmBadge />
|
|
|
</div>
|
|
|
<div v-else class="login"><login-page @onLogin="login" /></div>
|
|
|
</div>
|
|
@@ -180,62 +180,62 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
async created() {
|
|
|
- await this.initWebSocket();
|
|
|
- this.getAlarmConfig();
|
|
|
- this.x = 80;
|
|
|
- this.y = 80;
|
|
|
- let requestResult = [];
|
|
|
- this.requestAlarmHistoryParams.forEach(({ alarmType, deviceType }) => {
|
|
|
- requestResult.push(this.getAlarmHistory(alarmType, deviceType));
|
|
|
- });
|
|
|
+ // await this.initWebSocket();
|
|
|
+ // this.getAlarmConfig();
|
|
|
+ // this.x = 80;
|
|
|
+ // this.y = 80;
|
|
|
+ // let requestResult = [];
|
|
|
+ // this.requestAlarmHistoryParams.forEach(({ alarmType, deviceType }) => {
|
|
|
+ // requestResult.push(this.getAlarmHistory(alarmType, deviceType));
|
|
|
+ // });
|
|
|
|
|
|
- Promise.all(requestResult)
|
|
|
- .then((promiseResult) => {
|
|
|
- this.alarmList = [];
|
|
|
- promiseResult.forEach(({ data }) => {
|
|
|
- data?.ls?.forEach((ele) => {
|
|
|
- this.pushALarmItem(ele);
|
|
|
- });
|
|
|
- });
|
|
|
- this.dialogList.sort((a, b) => {
|
|
|
- return b.ts - a.ts;
|
|
|
- });
|
|
|
- this.realList.sort((a, b) => {
|
|
|
- return b.ts - a.ts;
|
|
|
- });
|
|
|
- this.$store.commit("changeAlarmlist", this.alarmList);
|
|
|
- this.$store.commit("setWarning", this.dialogList);
|
|
|
- this.$store.commit("setWarningList", this.realList);
|
|
|
- // if (!this.socketLeaveFlag) {
|
|
|
- // // 没有离开——重连
|
|
|
- // // websocket重连
|
|
|
- // this.socketReconnect1();
|
|
|
- // }
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- requestResult.forEach((ele, index) => {
|
|
|
- ele
|
|
|
- .then(({ data }) => {
|
|
|
- data?.ls?.forEach((ele) => {
|
|
|
- this.pushALarmItem(ele);
|
|
|
- });
|
|
|
- })
|
|
|
- .catch((error) => {
|
|
|
- ElNotification({
|
|
|
- type: "error",
|
|
|
- title: "查询历史未处理报警请求出错!",
|
|
|
- dangerouslyUseHTMLString: true,
|
|
|
- message: `<div class="currentRequestErrorNotification">
|
|
|
- <p><span>主要参数:</p>
|
|
|
- <p style="color:var(--el-color-primary)"><span class="errorTitle">alarmType:</span><span class="errorDesc">"${this.requestAlarmHistoryParams[index].alarmType}"</span></p>
|
|
|
- <p style="color:var(--el-color-primary)"><span class="errorTitle">deviceType:</span><span class="errorDesc">"${this.requestAlarmHistoryParams[index].deviceType}"</span></p>
|
|
|
- <p style="color:var(--el-color-danger)"><span class="errorTitle">错误正文:</span><span class="errorDesc">${error}</span></p>
|
|
|
- </div>`,
|
|
|
- });
|
|
|
- throw error;
|
|
|
- });
|
|
|
- });
|
|
|
- });
|
|
|
+ // Promise.all(requestResult)
|
|
|
+ // .then((promiseResult) => {
|
|
|
+ // this.alarmList = [];
|
|
|
+ // promiseResult.forEach(({ data }) => {
|
|
|
+ // data?.ls?.forEach((ele) => {
|
|
|
+ // this.pushALarmItem(ele);
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // this.dialogList.sort((a, b) => {
|
|
|
+ // return b.ts - a.ts;
|
|
|
+ // });
|
|
|
+ // this.realList.sort((a, b) => {
|
|
|
+ // return b.ts - a.ts;
|
|
|
+ // });
|
|
|
+ // this.$store.commit("changeAlarmlist", this.alarmList);
|
|
|
+ // this.$store.commit("setWarning", this.dialogList);
|
|
|
+ // this.$store.commit("setWarningList", this.realList);
|
|
|
+ // // if (!this.socketLeaveFlag) {
|
|
|
+ // // // 没有离开——重连
|
|
|
+ // // // websocket重连
|
|
|
+ // // this.socketReconnect1();
|
|
|
+ // // }
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // requestResult.forEach((ele, index) => {
|
|
|
+ // ele
|
|
|
+ // .then(({ data }) => {
|
|
|
+ // data?.ls?.forEach((ele) => {
|
|
|
+ // this.pushALarmItem(ele);
|
|
|
+ // });
|
|
|
+ // })
|
|
|
+ // .catch((error) => {
|
|
|
+ // ElNotification({
|
|
|
+ // type: "error",
|
|
|
+ // title: "查询历史未处理报警请求出错!",
|
|
|
+ // dangerouslyUseHTMLString: true,
|
|
|
+ // message: `<div class="currentRequestErrorNotification">
|
|
|
+ // <p><span>主要参数:</p>
|
|
|
+ // <p style="color:var(--el-color-primary)"><span class="errorTitle">alarmType:</span><span class="errorDesc">"${this.requestAlarmHistoryParams[index].alarmType}"</span></p>
|
|
|
+ // <p style="color:var(--el-color-primary)"><span class="errorTitle">deviceType:</span><span class="errorDesc">"${this.requestAlarmHistoryParams[index].deviceType}"</span></p>
|
|
|
+ // <p style="color:var(--el-color-danger)"><span class="errorTitle">错误正文:</span><span class="errorDesc">${error}</span></p>
|
|
|
+ // </div>`,
|
|
|
+ // });
|
|
|
+ // throw error;
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // });
|
|
|
},
|
|
|
mounted() {
|
|
|
let that = this;
|
|
@@ -709,12 +709,12 @@ body {
|
|
|
.header-menu-nxf{
|
|
|
height: 72px;
|
|
|
flex-grow: 1;
|
|
|
- background-image: url("./assets/nxfImg/header1.png");
|
|
|
+ background-image: url("./assets/nxfImg/header2.png");
|
|
|
background-repeat: no-repeat;
|
|
|
background-size: cover;
|
|
|
}
|
|
|
.header-menu-body {
|
|
|
- height: 39px;
|
|
|
+ height: 38px;
|
|
|
flex-grow: 1;
|
|
|
}
|
|
|
}
|