应急管理指挥调度实时更新功能

liujun0703-新项目开发
liujun 2024-08-09 14:48:10 +08:00
parent eb8928f37f
commit 79772b5eda
2 changed files with 23 additions and 11 deletions

View File

@ -14,7 +14,7 @@
</div> </div>
<!-- 右侧面板 --> <!-- 右侧面板 -->
<div class="right"> <div class="right">
<sysChat :chat-data="chatData" @orderMessage="handlerOrderMessage"/> <sysChat :chat-data="chatData" @orderMessage="handlerOrderMessage" @reFlush="initInfo()"/>
</div> </div>
</div> </div>
<div class="top_search"> <div class="top_search">
@ -276,7 +276,7 @@ export default {
heartbeat: null, heartbeat: null,
REPORT_ID: null, REPORT_ID: null,
FIRERESERVEPLAN_ID: null, FIRERESERVEPLAN_ID: null,
CORPIFNO_ID: sessionStorage.getItem('user').CORPIFNO_ID CORPIFNO_ID: JSON.parse(sessionStorage.getItem('user')).CORPIFNO_ID
} }
}, },
mounted() { mounted() {
@ -288,7 +288,6 @@ export default {
this.currSubControlPoint = this.subControlPoint['0'] this.currSubControlPoint = this.subControlPoint['0']
}, },
created() { created() {
console.log(this.$route.query)
this.REPORT_ID = this.$route.query.REPORT_ID this.REPORT_ID = this.$route.query.REPORT_ID
this.FIRERESERVEPLAN_ID = this.$route.query.FIRERESERVEPLAN_ID this.FIRERESERVEPLAN_ID = this.$route.query.FIRERESERVEPLAN_ID
this.initInfo() this.initInfo()
@ -458,8 +457,7 @@ export default {
'/bi/emergency/getYjBiInformation', '/bi/emergency/getYjBiInformation',
{ {
FIRERESERVEPLAN_ID: this.FIRERESERVEPLAN_ID, FIRERESERVEPLAN_ID: this.FIRERESERVEPLAN_ID,
REPORT_ID: this.REPORT_ID, REPORT_ID: this.REPORT_ID
CORP_ID: this.CORPIFNO_ID
} }
).then((data) => { ).then((data) => {
if (data.result === 'success') { if (data.result === 'success') {
@ -496,10 +494,9 @@ export default {
} }
// //
this.heartbeat = setInterval(() => { this.heartbeat = setInterval(() => {
console.log('发送心跳')
try { try {
if (this.webSocket) { if (this.webSocket) {
this.webSocket.send('心跳') this.webSocket.send('企业端' + this.REPORT_ID)
} }
} catch (e) { } catch (e) {
console.log('链接已断开') console.log('链接已断开')

View File

@ -3,11 +3,13 @@
<div v-for="(item, ind) in chatData" :key="ind" class="chat_body"> <div v-for="(item, ind) in chatData" :key="ind" class="chat_body">
<p class="chat_title">{{ item.info.MESS }}</p> <p class="chat_title">{{ item.info.MESS }}</p>
<p v-for="(answer, indx) in item.list" :key="indx" :class="{ 'ready': answer.READ_STATUS === '1'}" class="chat_item"> <p v-for="(answer, indx) in item.list" :key="indx" :class="{ 'ready': answer.READ_STATUS === '1'}" class="chat_item">
<span v-if="answer.IDENT_SIGN === '1'" class="chat_item_head">{{ answer.RECEIVED_MEN_NAME + ' :' }} </span> <span v-if="answer.IDENT_SIGN === '1'" class="chat_item_head">{{ answer.SEND_MEN_NAME + ' :' }} </span>
<span v-if="answer.IDENT_SIGN === '1'" class="chat_item_content">{{ answer.MESS }}</span> <span v-if="answer.IDENT_SIGN === '1'" class="chat_item_content">{{ answer.MESS }}</span>
<span v-if="answer.IDENT_SIGN === '2'" class="chat_item_head">{{ answer.RECEIVED_MEN_NAME + ' :' }}</span> <span v-if="answer.IDENT_SIGN === '2'" class="chat_item_head">{{ answer.RECEIVED_MEN_NAME + ' :' }}</span>
<span v-if="answer.READ_STATUS === '1'" class="chat_ready"></span> <span v-if="answer.READ_STATUS === '1' && answer.IDENT_SIGN !== '1'" class="chat_ready"></span>
<span v-if="answer.READ_STATUS === '0'" class="chat_ready"></span> <span v-if="answer.READ_STATUS === '0' && answer.IDENT_SIGN !== '1'" class="chat_ready"></span>
<span v-if="answer.READ_STATUS === '1' && answer.IDENT_SIGN === '1'" class="chat_ready"></span>
<span v-if="answer.READ_STATUS === '0' && answer.IDENT_SIGN === '1'" class="chat_ready" @click="confirmReceipt(answer)"></span>
</p> </p>
</div> </div>
<div class="order"> <div class="order">
@ -17,6 +19,7 @@
</template> </template>
<script> <script>
import { requestFN } from '@/utils/request'
export default { export default {
props: { props: {
@ -34,6 +37,18 @@ export default {
methods: { methods: {
sendOrderBtn() { sendOrderBtn() {
this.$emit('orderMessage') this.$emit('orderMessage')
},
confirmReceipt(answer) {
requestFN('/bi/emergency/readInstruct', { ID: answer.ID })
.then((data) => {
this.$message({
message: '确认已收到指令',
type: 'success'
})
this.$emit('reFlush', '')
}).catch((error) => {
console.log(error)
})
} }
} }
} }
@ -114,7 +129,7 @@ export default {
} }
.chat_item_head { .chat_item_head {
color: #1b6fae; color: #ffffff;
} }
.chat_item_content { .chat_item_content {