|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<!-- 所有弹出框 -->
|
|
|
- <div class="l_Dialog">
|
|
|
+ <div class="l_Dialog tuiy">
|
|
|
<!-- 灾害类型 -->
|
|
|
<el-dialog
|
|
|
v-model="dialogVisible"
|
|
@@ -335,7 +335,7 @@ import t4 from "@/assets/img/t4.png";
|
|
|
import mitts from "@/utils/Bus"
|
|
|
import closeimg from "@/assets/img/colse.png";
|
|
|
import {timestampToTime} from '@/js/lindex.js'
|
|
|
-let emit= defineEmits(['headerclick','childfun'])
|
|
|
+let emit= defineEmits(['headerclick','childfun','moxingclick'])
|
|
|
const props= defineProps({
|
|
|
addselect: {
|
|
|
type: Function,
|
|
@@ -435,6 +435,7 @@ let tuiyanobj3=ref({
|
|
|
|
|
|
})
|
|
|
let coolactiveName=ref(["1","2"]);
|
|
|
+let newlog=ref("");
|
|
|
let rizhi=ref({
|
|
|
top:"50px",
|
|
|
logs:'',
|
|
@@ -506,8 +507,10 @@ const accident=()=>{
|
|
|
emit('headerclick',sgdata.value);
|
|
|
dialog.value.dialogVisible_fire=false;
|
|
|
emit('childfun');
|
|
|
+ emit('moxingclick',true);
|
|
|
pollute();
|
|
|
}
|
|
|
+fetchFileContent();
|
|
|
}
|
|
|
const accident2=()=>{
|
|
|
if(classradio.value=="Fire"){
|
|
@@ -645,7 +648,7 @@ const initial=()=>{
|
|
|
|
|
|
|
|
|
}
|
|
|
-//推演的开始计算
|
|
|
+
|
|
|
function zdtimechange() {
|
|
|
|
|
|
|
|
@@ -667,6 +670,7 @@ const selectchange=(val)=>{
|
|
|
tuiyanobj.value.coids= arr1.join(',');
|
|
|
tuiyanobj.value.cocodes =arr2.join(',');
|
|
|
}
|
|
|
+//推演的开始计算
|
|
|
const calculate=()=>{
|
|
|
|
|
|
const params = {
|
|
@@ -684,7 +688,7 @@ const calculate=()=>{
|
|
|
|
|
|
request(params)
|
|
|
.then((res) => {
|
|
|
- console.log(res)
|
|
|
+ initWebSocket();
|
|
|
})
|
|
|
.catch((err) => {
|
|
|
ElMessage.error(err.returnMsg)
|
|
@@ -692,14 +696,44 @@ const calculate=()=>{
|
|
|
}
|
|
|
const projectsSelectionSelect=()=>{
|
|
|
}
|
|
|
-// 日志
|
|
|
+// 日志获取
|
|
|
+function getthislog(val) {
|
|
|
|
|
|
+ if(val.includes("msg=heartCheck")){
|
|
|
+ }else{
|
|
|
+ newlog.value =newlog.value + "\n" +val ;
|
|
|
+ rizhi.value.logs = newlog.value;
|
|
|
+ }
|
|
|
+ nextTick(() => {
|
|
|
+ let textarea=document.getElementById("textarea_id");
|
|
|
+ textarea.scrollTop=textarea.scrollHeight;
|
|
|
+ })
|
|
|
+ }
|
|
|
+// 历史日志
|
|
|
+async function fetchFileContent(){
|
|
|
+const params = {
|
|
|
+ transCode:"D000015",
|
|
|
+ aid:aid.value
|
|
|
+ };
|
|
|
+ await request(params)
|
|
|
+ .then((res)=> {
|
|
|
+ if(res.returnCode=="000000000"){
|
|
|
+ initWebSocket()
|
|
|
+ }else{
|
|
|
+ ElMessage({
|
|
|
+ message: res.returnMsg,
|
|
|
+ type: "error",
|
|
|
+ });
|
|
|
+ }
|
|
|
+})
|
|
|
+.catch((err) => {});
|
|
|
+}
|
|
|
+// 日志
|
|
|
function initWebSocket() {
|
|
|
//初始化weosocket
|
|
|
-
|
|
|
// const wsuri = "ws://192.168.0.43:8087//websocket?projectId="+this.pid; ws://192.168.0.131/diswebsocket?projectId=5
|
|
|
- import.meta.env.VITE_BASE_URL
|
|
|
- const wsurl =import.meta.env.VITE_BASE_URL+aid.value
|
|
|
+ const wsurl =import.meta.env.VITE_WEBSOCKET_URL+aid.value
|
|
|
+ console.log(wsurl);
|
|
|
websock = new WebSocket(wsurl);
|
|
|
websock.onopen = websocketonopen;
|
|
|
websock.onmessage = websocketonmessage;
|
|
@@ -715,14 +749,8 @@ function initWebSocket() {
|
|
|
// Websoket接收消息事件
|
|
|
const websocketonmessage = (res) => {
|
|
|
// console.log("数据", res);
|
|
|
- logs.value=res.data;
|
|
|
- emit('getthislog',logs.value);
|
|
|
- if(res.data.includes("Simulating")){
|
|
|
- let data=res.data.replace(/\s/g, "");
|
|
|
- console.log(data);
|
|
|
- let num=data.match(/hour(\S*)minute/)[1];///hour(\S*)minut/
|
|
|
- console.log(num)
|
|
|
- }
|
|
|
+ console.log(res.data);
|
|
|
+ getthislog(res.data);
|
|
|
|
|
|
reset();
|
|
|
};
|
|
@@ -786,7 +814,7 @@ function initWebSocket() {
|
|
|
onMounted(() => {
|
|
|
});
|
|
|
|
|
|
-defineExpose({monitor,accident2,leftcoll,classradio,aid});
|
|
|
+defineExpose({monitor,accident2,leftcoll,classradio,aid,dialogVisible});
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.jc_padding{
|
|
@@ -1343,6 +1371,8 @@ border-bottom: 1px solid;
|
|
|
border-image: linear-gradient(180deg, rgba(31, 107, 255, 1), rgba(31, 107, 255, 0.48)) 1 1;
|
|
|
}
|
|
|
#textarea_id{
|
|
|
+ color: #fff;
|
|
|
+ font-size: 12px;
|
|
|
height: 226px;
|
|
|
background: rgba(104,173,255,0) !important;
|
|
|
border: 1px solid rgba(31, 107, 255, 1);
|
|
@@ -1532,5 +1562,7 @@ ul, ol {
|
|
|
padding: 0;
|
|
|
margin: 0;
|
|
|
}
|
|
|
-
|
|
|
+.tuiy .asideg .el-input__inner{
|
|
|
+ font-size: 14px !important;
|
|
|
+}
|
|
|
</style>
|