Merge pull request '修改bug' (#12) from zwq into master

Reviewed-on: #12
This commit is contained in:
朱文强 2022-03-18 15:18:10 +08:00
commit 4a5d2824d1
5 changed files with 67 additions and 31 deletions

View File

@ -1,8 +1,8 @@
<!--
* @Author: zwq
* @Date: 2021-11-15 15:17:30
* @LastEditors: gtz
* @LastEditTime: 2021-12-21 15:33:40
* @LastEditors: zwq
* @LastEditTime: 2022-03-18 15:00:32
* @Description:
-->
<template>
@ -36,7 +36,7 @@
<el-row :gutter="30" style="padding: 20px;">
<el-col class="footer-item-container" :span="6" v-for="count in 4" :key="count">
<el-card class="footer-item-box base-container" @click.native="selectPlat(count)">
<div class="plat" style="font-size: 24px">提升{{ count }}</div>
<div class="plat" style="font-size: 24px">液压{{ count }}</div>
</el-card>
</el-col>
</el-row>
@ -105,7 +105,7 @@ export default {
url: this.$http.adornUrl('/outStock/runOutTask'),
method: 'post',
data: this.$http.adornData({
code: count,
code: 'YYT00' + count,
localtionId: this.isActive
})
}).then(({data}) => {

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-15 08:20:28
* @LastEditors: zwq
* @LastEditTime: 2021-12-06 16:47:31
* @LastEditTime: 2022-03-18 14:48:46
* @Description:
-->
<template>
@ -39,7 +39,9 @@
},
data () {
return {
loading: false
loading: false,
websock: '',
url: ''
}
},
components: {
@ -65,7 +67,10 @@
}
},
created () {
const baseurl = window.SITE_CONFIG.baseUrl
this.url = baseurl.slice(5)
this.getUserInfo()
this.initWebSocket()
},
mounted () {
this.resetDocumentClientHeight()
@ -91,6 +96,33 @@
// this.userName = data.user.username
// }
// })
},
initWebSocket () { // weosocket
const path = `ws:${this.url}/qj/websocket/${'id'}`
this.websock = new WebSocket(path)
this.websock.onmessage = this.websocketonmessage
this.websock.onopen = this.websocketonopen
this.websock.onerror = this.websocketonerror
this.websock.onclose = this.websocketclose
},
websocketonopen () { // send
this.websocketsend(JSON.stringify())
},
websocketonerror () { //
this.initWebSocket()
},
websocketonmessage (e) { //
this.$notify.info({
title: '提示',
message: e.data,
duration: 15000
})
},
websocketsend () { //
this.websock.send()
},
websocketclose (e) { //
console.log('断开连接', e)
}
}
}

View File

@ -186,31 +186,25 @@
},
//
addOrUpdateHandle (id) {
this.$confirm(`确定对[任务id=${id}]进行删除操作?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$http({
url: this.$http.adornUrl('/currTask/runTask'),
method: 'post',
data: this.$http.adornData({ id })
this.$http({
url: this.$http.adornUrl('/currTask/runTask'),
method: 'post',
data: this.$http.adornData({ id })
// params: this.$http.adornParams({ id }, false)
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
}).catch(() => {})
}).then(({data}) => {
if (data && data.code === 0) {
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {
this.getDataList()
}
})
} else {
this.$message.error(data.msg)
}
})
},
//
deleteHandle (sheetNo) {

View File

@ -44,6 +44,11 @@
prop="equipmentName"
label="车辆名称">
</el-table-column>
<el-table-column
prop="taskCode"
label="任务编码"
>
</el-table-column>
<el-table-column
prop="createTime"
label="报警时间">

View File

@ -48,6 +48,11 @@
label="窑炉名称"
>
</el-table-column>
<el-table-column
prop="taskCode"
label="任务编码"
>
</el-table-column>
<el-table-column
prop="createTime"
label="报警时间"
@ -57,7 +62,7 @@
prop="time"
label="报警级别"
> -->
</el-table-column>
<!-- </el-table-column> -->
<el-table-column
prop="alarmInfo"
label="报警内容"