|
@@ -249,9 +249,7 @@
|
|
|
// 调用常量-审核状态
|
|
// 调用常量-审核状态
|
|
|
this.audioStatus = this.$constWKS.OPTTYPE
|
|
this.audioStatus = this.$constWKS.OPTTYPE
|
|
|
// 加载【字典】
|
|
// 加载【字典】
|
|
|
- initDicts(['NATION'], this.dicts);
|
|
|
|
|
- // 同步产线警报
|
|
|
|
|
- this.synLineWarn()
|
|
|
|
|
|
|
+ initDicts(['NATION'], this.dicts);
|
|
|
// 加载列表数据
|
|
// 加载列表数据
|
|
|
this.fetch()
|
|
this.fetch()
|
|
|
},
|
|
},
|
|
@@ -261,27 +259,17 @@
|
|
|
},
|
|
},
|
|
|
nationList() {
|
|
nationList() {
|
|
|
return convertEnum(this.dicts.NATION)
|
|
return convertEnum(this.dicts.NATION)
|
|
|
- },
|
|
|
|
|
- websocketMsg() {
|
|
|
|
|
- return this.$store.getters.STAFF_UPDATE.msg
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
- websocketMsg(curVal, oldVal) {
|
|
|
|
|
- let obj = JSON.parse(curVal)
|
|
|
|
|
- this.openMessageTips(obj)
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
mounted () {
|
|
mounted () {
|
|
|
- // 判断长连接,是否已经开启
|
|
|
|
|
- if(this.$store.state.websocket.websock == null){
|
|
|
|
|
- // 页面刚进入时开启长连接
|
|
|
|
|
- this.$store.dispatch('STAFF_WEBSOCKET')
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
// 销毁
|
|
// 销毁
|
|
|
destroyed() {
|
|
destroyed() {
|
|
|
- this.websocketClose()
|
|
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
viewClose () {
|
|
viewClose () {
|
|
@@ -410,16 +398,7 @@
|
|
|
this.$refs.edit.type = "edit"
|
|
this.$refs.edit.type = "edit"
|
|
|
this.dialog.title = this.$t("common.edit")
|
|
this.dialog.title = this.$t("common.edit")
|
|
|
this.dialog.isVisible = true
|
|
this.dialog.isVisible = true
|
|
|
- },
|
|
|
|
|
- synLineWarn(){
|
|
|
|
|
- warnLogApi.synLineWarn({}).then(response => {
|
|
|
|
|
- const res = response.data
|
|
|
|
|
- if (res.isSuccess) {
|
|
|
|
|
-
|
|
|
|
|
- }
|
|
|
|
|
- }).finally(() => {})
|
|
|
|
|
-
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ },
|
|
|
fetch (params = {}) {
|
|
fetch (params = {}) {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
if (this.queryParams.timeRange) {
|
|
if (this.queryParams.timeRange) {
|
|
@@ -459,39 +438,7 @@
|
|
|
if (!flag) {
|
|
if (!flag) {
|
|
|
this.$refs.table.toggleRowSelection(row, true)
|
|
this.$refs.table.toggleRowSelection(row, true)
|
|
|
}
|
|
}
|
|
|
- },
|
|
|
|
|
- openMessageTips(data){ //排除数字大屏
|
|
|
|
|
- if(this.$route.fullPath.indexOf("/largeScreen")<0){
|
|
|
|
|
- //console.log("接收websocket的推送信息 == ", data)
|
|
|
|
|
- if(data!=null && data.type == 'PUSH_TYPE_GLOBAL_EXCEPTION'){
|
|
|
|
|
- this.$nextTick(()=> {
|
|
|
|
|
- let datas = data.data.warnMap.warnData.records
|
|
|
|
|
- datas.forEach((data)=>{
|
|
|
|
|
- let msg = data.feedback ? data.feedback : " 响应超时 ";
|
|
|
|
|
- //let url = data.taskNodeId ? "#/dispatchMgr/exception":"#/developer/warnLong";
|
|
|
|
|
- let url = "#/developer/warnLong"
|
|
|
|
|
- let content = "<a href='"+url+"'>"+(data.resourceName? "["+ data.resourceName +"] " : "" )+(data.procedureName? data.procedureName : "")
|
|
|
|
|
- + (data.instructionName? "("+data.instructionName+")" : "") + msg+"</a>";
|
|
|
|
|
- this.$notification.error(content, { messageIsHTML: true, timer:10, title:"异常警报", showCloseIcn:true});
|
|
|
|
|
- })
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- },
|
|
|
|
|
- // 组件销毁的时候,关闭websocket连接
|
|
|
|
|
- websocketClose() {
|
|
|
|
|
- this.$store.getters.STAFF_UPDATE.lockReconnect = true
|
|
|
|
|
- this.$store.getters.STAFF_UPDATE.websock.close() // 离开路由之后断开websocket连接
|
|
|
|
|
- clearTimeout(this.$store.getters.STAFF_UPDATE.reconnectData) // 离开清除 timeout
|
|
|
|
|
- clearTimeout(this.$store.getters.STAFF_UPDATE.timeoutObj) // 离开清除 timeout
|
|
|
|
|
- clearTimeout(this.$store.getters.STAFF_UPDATE.serverTimeoutObj) // 离开清除 timeout
|
|
|
|
|
- },
|
|
|
|
|
- // websocket信息变更
|
|
|
|
|
- onmessage() {
|
|
|
|
|
- this.$store.getters.STAFF_UPDATE.websock.onmessage = function(evt) {
|
|
|
|
|
- console.log("websocket获取数据==="+evt)
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|