| | |
| | | <template> |
| | | <div class="container"> |
| | | <div class="big-title" @click="goBack()">国泰新华智能巡检系统</div> |
| | | <div style="font-size: 14px; color: #00ffff; margin-top: 4px">{{ present }}</div> |
| | | <div style="height: 20px;font-size: 14px;line-height: 20px; color: #00ffff; margin-top: 4px">{{ present }}</div> |
| | | <div class="btns"> |
| | | <div class="fullbtn" @click="onScreenfullClick"> |
| | | <div class="toFull"> |
| | |
| | | </p> |
| | | </div> |
| | | <div class="area-head" :class="item.points.some((e) => e.reportResult == null) ? 'fadeBorder' : ''"> |
| | | <div class="indicator" :class="item.points.some((e) => e.reportResult == null) ? 'someUndone' : item.points.some((e) => e.reportResult == 1) ? 'somewarning' : ''"> |
| | | <div class="indicator" :class="item.points.every((e) => e.reportResult == null) ? 'someUndone' : (item.points.some((e) => e.reportResult == 1) ? 'somewarning' : '')"> |
| | | <div class="indi-dot"></div> |
| | | <!-- <div class="indi-pulse"></div>--> |
| | | <!-- <div class="indi-pulse1"></div>--> |
| | |
| | | <div class="pulse"></div> |
| | | <div class="pulse1"></div> |
| | | </section> |
| | | <div> |
| | | <div :class="t.reportResult == null ? 'noBorder' : t.reportResult == 1 ? 'redBorder' : ''"> |
| | | <div> |
| | | <span>巡检点:</span><span>{{ t.point }}</span> |
| | | </div> |
| | |
| | | import screenfull from 'screenfull'; |
| | | import { lineApi } from '/@/api/intelligentLine'; |
| | | import { toRefs, reactive, ref, onMounted, onUnmounted, computed } from 'vue'; |
| | | |
| | | import {useRoute} from 'vue-router'; |
| | | import { storeToRefs } from 'pinia'; |
| | | import { initBackEndControlRoutes } from '/@/router/backEnd'; |
| | | import { Session } from '/@/utils/storage'; |
| | |
| | | socket: any; |
| | | socketData: string; |
| | | data: Array<any>; |
| | | id: string |
| | | } |
| | | export default { |
| | | name: 'intelligentLine', |
| | |
| | | setup() { |
| | | const userInfo = useUserInfo(); |
| | | const { userInfos } = storeToRefs(userInfo); |
| | | const route = useRoute(); |
| | | const state = reactive<stateType>({ |
| | | present: '', |
| | | isScreenfull: false, |
| | | path: 'http://192.168.0.29:8008/ws/test/', |
| | | socketData: '', |
| | | socket: null, |
| | | data: [] |
| | | data: [], |
| | | id: '' |
| | | }); |
| | | |
| | | onMounted(() => { |
| | | setInterval(() => { |
| | | state.present = new Date().toLocaleString(); |
| | | }, 1000); |
| | | init(); |
| | | // getLine() |
| | | let curId = route.query.id |
| | | state.id = curId.toString() |
| | | console.log(state.id) |
| | | getLine(state.id) |
| | | init(state.id); |
| | | }); |
| | | |
| | | const dataList = computed(() => { |
| | |
| | | }); |
| | | |
| | | // socket获取数据 |
| | | const init = () => { |
| | | const init = (id:string) => { |
| | | if (typeof window.WebSocket === 'undefined') { |
| | | alert('您的浏览器不支持socket'); |
| | | } else { |
| | | // 实例化socket |
| | | var url = state.path + '80938081556545536'; |
| | | var url = state.path + id; |
| | | url = url.replace('https', 'ws').replace('http', 'ws'); |
| | | console.log(url, '获取地址'); |
| | | state.socket = new window.WebSocket(url); |
| | |
| | | }; |
| | | // 监听socket消息 |
| | | state.socket.onmessage = (msg) => { |
| | | // console.log(msg, 'msg'); |
| | | // console.log(typeof msg.data, 'type'); |
| | | if (msg.data === '连接成功') return; |
| | | // state.socketData = msg.data; |
| | | // console.log(JSON.parse(state.socketData), '------------------'); |
| | | // if (typeof JSON.parse(state.socketData) == Array) { |
| | | // debugger; |
| | | debugger; |
| | | userInfos.value.dataList = JSON.parse(msg.data); |
| | | console.log(state.data); |
| | | // } |
| | | // console.log(msg,'msg') |
| | | // console.log(this.data,'data-------') |
| | | }; |
| | | } |
| | | }; |
| | |
| | | }; |
| | | |
| | | // 接口获取数据 |
| | | const getLine = async () => { |
| | | let res = await lineApi().getLine({ id: '80647416891768832' }); |
| | | const getLine = async (id:string) => { |
| | | let res = await lineApi().getLine({ id: id }); |
| | | if (res.data.code === '200') { |
| | | console.log(res.data.data, '获取巡检点'); |
| | | state.data = res.data.data; |
| | | console.log(state.data, '---'); |
| | | userInfos.value.dataList = res.data.data; |
| | | } else { |
| | | ElMessage({ |
| | | type: 'warning', |
| | |
| | | padding: 20px 40px 30px; |
| | | box-sizing: border-box; |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: flex-start; |
| | | overflow: hidden; |
| | | overflow-x: scroll; |
| | | overflow-y: scroll; |
| | | overflow-x: auto; |
| | | overflow-y: auto; |
| | | |
| | | .line-map { |
| | | display: flex; |
| | |
| | | transform: translateY(-14px); |
| | | border-radius: 8px; |
| | | background-image: linear-gradient(to right, rgba(8, 109, 209, 0.4), rgba(11, 255, 255, 0.2)); |
| | | border: 1px solid rgba(54, 252, 252, 0.6); |
| | | border: 1px solid rgba(54, 252, 252, 1); |
| | | display: flex; |
| | | flex-direction: column; |
| | | justify-content: center; |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | .noBorder{ |
| | | border: 1px solid rgba(54, 252, 252, 0.1); |
| | | } |
| | | .redBorder{ |
| | | border: 1px solid #ff0000; |
| | | } |
| | | p { |
| | | width: 140px; |
| | | height: 50px; |