中建四(质量管理-时间查询、安全巡检字段修改)

This commit is contained in:
yjl 2023-02-28 17:26:12 +08:00
parent 78c2663e98
commit 74beb354ae
4 changed files with 333 additions and 281 deletions

View File

@ -36,7 +36,7 @@ export const getSecurityDataByProjectSnApi = params => get('xmgl/workerSafeEduca
// 安全巡检-班前喊话 // 安全巡检-班前喊话
export const getTodayInfoByProjectSnApi = params => get('xmgl/shoutInfo/getTodayInfoByProjectSn', params); export const getTodayInfoByProjectSnApi = params => get('xmgl/shoutInfo/getTodayInfoByProjectSn', params);
// 安全巡检-安全巡检 // 安全巡检-安全巡检
export const getAllTodayDataHdirApi = params => get('xmgl/hiddenDangerInspectRecord/getAllTodayDataHdir', params); export const getAllTodayDataHdirApi = params => get('xmgl/hiddenDangerInspectRecord/getTotalAndWeekHiddenDanger', params);
// 安全巡检-设备监控 // 安全巡检-设备监控
export const getAllDevApi = params => get('xmgl/dev/getAllDev', params); export const getAllDevApi = params => get('xmgl/dev/getAllDev', params);

View File

@ -1,7 +1,7 @@
<template> <template>
<Card title="现场验收"> <Card title="现场验收">
<div class="list"> <div class="list">
<el-date-picker <!-- <el-date-picker
@change="checkTypes" @change="checkTypes"
v-model="acceptanceDateTime" v-model="acceptanceDateTime"
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
@ -9,6 +9,18 @@
placeholder="选择日期时间" placeholder="选择日期时间"
:clearable="true" :clearable="true"
> >
</el-date-picker> -->
<el-date-picker
v-model="timeValue"
type="daterange"
size="small"
range-separator="至"
start-placeholder="开始日期"
value-format="yyyy-MM-dd"
end-placeholder="结束日期"
unlink-panels
@change="getTime"
>
</el-date-picker> </el-date-picker>
<div class="thead"> <div class="thead">
<div class="row"> <div class="row">
@ -67,7 +79,9 @@ export default {
time1: '', time1: '',
sn: '', sn: '',
list: [], list: [],
acceptanceDateTime: '' // beginActualAcceptanceDate: '', //
endActualAcceptanceDate: '', //
timeValue: []
} }
}, },
created() { created() {
@ -76,15 +90,24 @@ export default {
this.credad() this.credad()
}, },
methods: { methods: {
checkTypes(val) { //
console.log('类型或者时间修改事件值 ', val) getTime(val) {
this.credad(val) if (val) {
this.beginActualAcceptanceDate = val[0]
this.endActualAcceptanceDate = val[1]
} else {
this.beginActualAcceptanceDate = ''
this.endActualAcceptanceDate = ''
}
this.credad()
}, },
credad(val) {
credad() {
// //
getLimitOrderByAcceptanceDateApi({ getLimitOrderByAcceptanceDateApi({
projectSn: this.sn, projectSn: this.sn,
acceptanceDate: val ? val : null beginActualAcceptanceDate: this.beginActualAcceptanceDate,
endActualAcceptanceDate: this.endActualAcceptanceDate
}).then((res) => { }).then((res) => {
res.result.map((item) => { res.result.map((item) => {
item.imageUrl = JSON.parse(item.imageUrl) item.imageUrl = JSON.parse(item.imageUrl)
@ -177,8 +200,8 @@ export default {
::v-deep .el-date-editor.el-input, ::v-deep .el-date-editor.el-input,
.el-date-editor.el-input__inner { .el-date-editor.el-input__inner {
width: 180px; width: 219px;
margin-left: 80%; margin-left: 76%;
margin-top: 10px; margin-top: 10px;
color: #fff !important; color: #fff !important;
} }
@ -192,5 +215,18 @@ export default {
line-height: 36px; line-height: 36px;
color: #66d3d8; color: #66d3d8;
} }
::v-deep .el-range-editor--small .el-range-input {
background: transparent;
color: #fff;
}
::v-deep .el-range-editor--small .el-range-separator {
line-height: 30px;
font-size: 13px;
color: #ccc;
}
::v-deep .el-input__icon {
line-height: 28px;
color: #66d3d8;
}
} }
</style> </style>

View File

@ -59,17 +59,17 @@
<JRingChart <JRingChart
:title="{ :title="{
text: '本周巡检', text: '本周巡检',
subTitle: `${safetyPatrolInspection.todayTotalNum}`, subTitle: `${safetyPatrolInspection.weekTotalNum}`,
fontSize: 18 fontSize: 18
}" }"
:color="['#6EE4F0', '#E7622A']" :color="['#6EE4F0', '#E7622A']"
:data="[ :data="[
{ {
value: safetyPatrolInspection.todayRectificationNum, value: safetyPatrolInspection.weekRectificationNum,
name: '已闭合' name: '已闭合'
}, },
{ {
value: safetyPatrolInspection.todayNoRectificationNum, value: safetyPatrolInspection.weekNoRectificationNum,
name: '未闭合' name: '未闭合'
} }
]" ]"
@ -83,9 +83,9 @@
<span>占比</span> <span>占比</span>
</div> </div>
<div class="row"> <div class="row">
<span>{{ safetyPatrolInspection.todayRectificationNum || 0 }}</span> <span>{{ safetyPatrolInspection.weekRectificationNum || 0 }}</span>
<span <span
>{{ safetyPatrolInspection.todayRectificationRatio || 0 }}%</span >{{ safetyPatrolInspection.weekRectificationRatio || 0 }}%</span
> >
</div> </div>
</div> </div>
@ -96,12 +96,10 @@
</div> </div>
<div class="row"> <div class="row">
<span>{{ <span>{{
safetyPatrolInspection.todayNoRectificationNum || 0 safetyPatrolInspection.weekNoRectificationNum || 0
}}</span> }}</span>
<span <span
>{{ >{{ safetyPatrolInspection.weekNoRectificationRatio || 0 }}%</span
safetyPatrolInspection.todayNoRectificationRatio || 0
}}%</span
> >
</div> </div>
</div> </div>

View File

@ -8,8 +8,8 @@
<div class="flex2"> <div class="flex2">
<div class="state_title pageTitle"> <div class="state_title pageTitle">
{{ {{
$t("message.lifter.realTime") + $t('message.lifter.realTime') +
$t("message.lifter.movingTrajectory") $t('message.lifter.movingTrajectory')
}} }}
<span class="warningText">{{ warningText }}</span> <span class="warningText">{{ warningText }}</span>
</div> </div>
@ -46,7 +46,7 @@
:style="{ :style="{
left: coordData.coordX + 8 + 'px', left: coordData.coordX + 8 + 'px',
height: coordData.lineLength + 'px', height: coordData.lineLength + 'px',
top: '78px', top: '78px'
}" }"
/> />
<div <div
@ -55,7 +55,7 @@
v-show="hideGoods" v-show="hideGoods"
:style="{ :style="{
top: coordData.coordY + 'px', top: coordData.coordY + 'px',
left: coordData.coordX - 6 + 'px', left: coordData.coordX - 6 + 'px'
}" }"
> >
<img src="@/assets/images/towericon/hock.png" alt="" /> <img src="@/assets/images/towericon/hock.png" alt="" />
@ -90,7 +90,11 @@
</div> </div>
<div class="T_H_wrap whiteBlock"> <div class="T_H_wrap whiteBlock">
<div class="load"> <div class="load">
<div class="state_title pageTitle">实时视频<span class="tower-time">最后一条数据上传时间{{towerData.realTime}}</span></div> <div class="state_title pageTitle">
实时视频<span class="tower-time"
>最后一条数据上传时间{{ towerData.realTime }}</span
>
</div>
<div style="margin-bottom: 15px"> <div style="margin-bottom: 15px">
<el-select <el-select
size="medium" size="medium"
@ -132,7 +136,7 @@
<div class="direction_data_wrap flex"> <div class="direction_data_wrap flex">
<div class="data_wrap whiteBlock"> <div class="data_wrap whiteBlock">
<div class="state_title pageTitle"> <div class="state_title pageTitle">
{{ $t("message.lifter.realTimeData") }} {{ $t('message.lifter.realTimeData') }}
</div> </div>
<div class="flex"> <div class="flex">
<div class="data_type"> <div class="data_type">
@ -141,7 +145,7 @@
<img <img
src="@/assets/images/towericon/towercurrentdata1.png" src="@/assets/images/towericon/towercurrentdata1.png"
/> />
<div>{{ $t("message.lifter.slingLoad") }}</div> <div>{{ $t('message.lifter.slingLoad') }}</div>
</div> </div>
<div class="value">{{ realTimeDevData.loading }} kg</div> <div class="value">{{ realTimeDevData.loading }} kg</div>
</div> </div>
@ -150,7 +154,7 @@
<img <img
src="@/assets/images/towericon/towercurrentdata6.png" src="@/assets/images/towericon/towercurrentdata6.png"
/> />
<div>{{ $t("message.lifter.airSpeed") }}</div> <div>{{ $t('message.lifter.airSpeed') }}</div>
</div> </div>
<div class="value">{{ realTimeDevData.windspeed }} m/s</div> <div class="value">{{ realTimeDevData.windspeed }} m/s</div>
</div> </div>
@ -161,7 +165,7 @@
<img <img
src="@/assets/images/towericon/towercurrentdata2.png" src="@/assets/images/towericon/towercurrentdata2.png"
/> />
<div>{{ $t("message.lifter.altitude") }}</div> <div>{{ $t('message.lifter.altitude') }}</div>
</div> </div>
<div class="value">{{ realTimeDevData.height }} m</div> <div class="value">{{ realTimeDevData.height }} m</div>
</div> </div>
@ -170,7 +174,7 @@
<img <img
src="@/assets/images/towericon/towercurrentdata7.png" src="@/assets/images/towericon/towercurrentdata7.png"
/> />
<div>{{ $t("message.lifter.airSpeedOfPercentage") }}</div> <div>{{ $t('message.lifter.airSpeedOfPercentage') }}</div>
</div> </div>
<div class="value"> <div class="value">
{{ {{
@ -185,7 +189,7 @@
<img <img
src="@/assets/images/towericon/towercurrentdata3.png" src="@/assets/images/towericon/towercurrentdata3.png"
/> />
<div>{{ $t("message.lifter.percentageOfMoments") }}</div> <div>{{ $t('message.lifter.percentageOfMoments') }}</div>
</div> </div>
<div class="value">{{ realTimeDevData.torqueRatio }} %</div> <div class="value">{{ realTimeDevData.torqueRatio }} %</div>
</div> </div>
@ -194,7 +198,7 @@
<img <img
src="@/assets/images/towericon/towercurrentdata8.png" src="@/assets/images/towericon/towercurrentdata8.png"
/> />
<div>{{ $t("message.lifter.rotationAngle") }}</div> <div>{{ $t('message.lifter.rotationAngle') }}</div>
</div> </div>
<div class="value">{{ realTimeDevData.angle }}°</div> <div class="value">{{ realTimeDevData.angle }}°</div>
</div> </div>
@ -205,7 +209,7 @@
<img <img
src="@/assets/images/towericon/towercurrentdata4.png" src="@/assets/images/towericon/towercurrentdata4.png"
/> />
<div>{{ $t("message.lifter.dip") }}</div> <div>{{ $t('message.lifter.dip') }}</div>
</div> </div>
<div class="value"> <div class="value">
{{ {{
@ -218,7 +222,7 @@
<img <img
src="@/assets/images/towericon/towercurrentdata9.png" src="@/assets/images/towericon/towercurrentdata9.png"
/> />
<div>{{ $t("message.lifter.range") }}</div> <div>{{ $t('message.lifter.range') }}</div>
</div> </div>
<div class="value">{{ realTimeDevData.ranger }} m</div> <div class="value">{{ realTimeDevData.ranger }} m</div>
</div> </div>
@ -229,7 +233,7 @@
<img <img
src="@/assets/images/towericon/towercurrentdata5.png" src="@/assets/images/towericon/towercurrentdata5.png"
/> />
<div>{{ $t("message.lifter.percentageOfDip") }}</div> <div>{{ $t('message.lifter.percentageOfDip') }}</div>
</div> </div>
<div class="value">{{ realTimeDevData.biasAngleRatio }}%</div> <div class="value">{{ realTimeDevData.biasAngleRatio }}%</div>
</div> </div>
@ -238,13 +242,13 @@
<img <img
src="@/assets/images/towericon/towercurrentdata10.png" src="@/assets/images/towericon/towercurrentdata10.png"
/> />
<div>{{ $t("message.lifter.earlyWarning") }}</div> <div>{{ $t('message.lifter.earlyWarning') }}</div>
</div> </div>
<div class="value"> <div class="value">
{{ {{
realTimeDevData.alarmName realTimeDevData.alarmName
? realTimeDevData.alarmName ? realTimeDevData.alarmName
: "无" : '无'
}} }}
</div> </div>
</div> </div>
@ -278,7 +282,7 @@
<div>姓名{{ realTimeDevData.driverName }}</div> <div>姓名{{ realTimeDevData.driverName }}</div>
<div> <div>
上岗时间{{ 上岗时间{{
realTimeDevData.driverName ? realTimeDevData.reciveTime : "" realTimeDevData.driverName ? realTimeDevData.reciveTime : ''
}} }}
</div> </div>
</div> </div>
@ -327,7 +331,12 @@
</div> </div>
</div> </div>
<!-- 查看司机信息 --> <!-- 查看司机信息 -->
<el-dialog :modal-append-to-body="false" title="司机信息" :visible.sync="showDriver" width="667px"> <el-dialog
:modal-append-to-body="false"
title="司机信息"
:visible.sync="showDriver"
width="667px"
>
<div class="dialog_content"> <div class="dialog_content">
<el-table :data="driverList" class="tables" style="width: 100%"> <el-table :data="driverList" class="tables" style="width: 100%">
<el-table-column prop="workerName" label="姓名"> </el-table-column> <el-table-column prop="workerName" label="姓名"> </el-table-column>
@ -383,7 +392,10 @@
<el-input v-model="towerData.registNo" :disabled="true"></el-input> <el-input v-model="towerData.registNo" :disabled="true"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="设备状态"> <el-form-item label="设备状态">
<div class="dev-leave" :class="{'dev-line': towerData.devOnline == 1}"> <div
class="dev-leave"
:class="{ 'dev-line': towerData.devOnline == 1 }"
>
<!-- <span></span> --> <!-- <span></span> -->
{{ towerData.devOnlineName }} {{ towerData.devOnlineName }}
</div> </div>
@ -394,97 +406,97 @@
</vue-scroll> </vue-scroll>
</template> </template>
<script> <script>
import echarts from 'echarts4';; import echarts from 'echarts4'
import videoModule from "@/components/videoModule/videoModule.vue"; import videoModule from '@/components/videoModule/videoModule.vue'
import { import {
getTowerListApi, getTowerListApi,
getSelectTowerBySnApi, getSelectTowerBySnApi,
getRecentWorkListApi, getRecentWorkListApi,
getTowerCurrentDataApi, getTowerCurrentDataApi,
getTodayTowerDataApi, getTodayTowerDataApi
} from "@/assets/js/api/towerCrane"; } from '@/assets/js/api/towerCrane'
import { import {
hidePluginWindow, hidePluginWindow,
showPluginWindow, showPluginWindow
} from "@/components/videoModule/isc_plugin/video_isc_plugin.js"; } from '@/components/videoModule/isc_plugin/video_isc_plugin.js'
var frontArmLength = 496; //px var frontArmLength = 496 //px
var height = 484; //px var height = 484 //px
var imgLeftWidth = 115; //px var imgLeftWidth = 115 //px
var imgLeftHeight = 70; //px var imgLeftHeight = 70 //px
var realWidth = 0; //m var realWidth = 0 //m
var realHeight = 0; //m var realHeight = 0 //m
var $moveBox; var $moveBox
var $xMove; var $xMove
var $line; var $line
export default { export default {
components: { videoModule }, components: { videoModule },
data() { data() {
return { return {
projectSn: "", projectSn: '',
towerList: [], // towerList: [], //
checkedIndex: 0, // checkedIndex: 0, //
devSn: "", //sn devSn: '', //sn
selectList: [], // selectList: [], //
videoList: [], videoList: [],
videoId: "", videoId: '',
driverList: [], driverList: [],
showDriver: false, // showDriver: false, //
towerCraneDialog: false, // towerCraneDialog: false, //
towerData: {}, towerData: {},
fileUrl: "", fileUrl: '',
timeValue: [], timeValue: [],
endTime: "", endTime: '',
startTime: "", startTime: '',
workList: [], workList: [],
interval: null, interval: null,
realTimeDevData: { realTimeDevData: {
loading: "", loading: '',
windspeed: "", windspeed: '',
height: "", height: '',
windRatio: "", windRatio: '',
torqueRatio: "", torqueRatio: '',
angle: "", angle: '',
biasAngle: "", biasAngle: '',
ranger: "", ranger: '',
biasAngleRatio: "", biasAngleRatio: '',
alarmName: "", alarmName: ''
}, },
echartsData: [], echartsData: [],
angle: 0, angle: 0,
coordData: { coordData: {
coordX: 0, coordX: 0,
coordY: 0, coordY: 0,
lineLength: 0, lineLength: 0
}, },
hideGoods: false, // hideGoods: false, //
workingPlan: "", workingPlan: '',
imgWidth: 0, imgWidth: 0,
imgHeight: 0, imgHeight: 0,
warningText: "", warningText: '',
interval2: null interval2: null
}; }
}, },
created() { created() {
this.projectSn = this.$store.state.projectSn; this.projectSn = this.$store.state.projectSn
this.fileUrl = this.$store.state.FILEURL; this.fileUrl = this.$store.state.FILEURL
this.workingPlan = this.workingPlan =
this.$store.state.currentProDetail.constructionMapUrl && this.$store.state.currentProDetail.constructionMapUrl &&
this.$store.state.currentProDetail.constructionMapUrl; this.$store.state.currentProDetail.constructionMapUrl
// this.workingPlan = require('@/assets/images/3.jpg') // this.workingPlan = require('@/assets/images/3.jpg')
}, },
mounted() { mounted() {
this.getTowerList(); this.getTowerList()
this.$nextTick(() => { this.$nextTick(() => {
$moveBox = document.getElementById("moveBox"); $moveBox = document.getElementById('moveBox')
$xMove = document.getElementById("xMove"); $xMove = document.getElementById('xMove')
$line = document.getElementById("line"); $line = document.getElementById('line')
}); })
}, },
beforeDestroy() { beforeDestroy() {
clearTimeout(this.interval); clearTimeout(this.interval)
clearInterval(this.interval2); clearInterval(this.interval2)
}, },
methods: { methods: {
@ -492,128 +504,127 @@ export default {
visibleChange(val) { visibleChange(val) {
if (this.videoList.length > 0 && this.videoList[0].videoType == 3) { if (this.videoList.length > 0 && this.videoList[0].videoType == 3) {
if (val) { if (val) {
hidePluginWindow(); hidePluginWindow()
} else { } else {
showPluginWindow(); showPluginWindow()
} }
} }
}, },
// //
calculate() { calculate() {
if (this.workingPlan) { if (this.workingPlan) {
let url = this.workingPlan + "?" + Date.parse(new Date()); let url = this.workingPlan + '?' + Date.parse(new Date())
// //
var img = new Image(); var img = new Image()
// src // src
img.src = url; img.src = url
let that = this; let that = this
img.onload = function () { img.onload = function () {
let pack = that.$refs.allTowerTrack; // let pack = that.$refs.allTowerTrack //
let clientWidth = pack.clientWidth; // let clientWidth = pack.clientWidth //
let clientHeight = pack.clientHeight; // let clientHeight = pack.clientHeight //
console.log(clientWidth, clientHeight) console.log(clientWidth, clientHeight)
let imgWidth = img.width; // let imgWidth = img.width //
let imgHeight = img.height; // let imgHeight = img.height //
console.log(imgWidth, imgHeight) console.log(imgWidth, imgHeight)
let ratioX = clientWidth / imgWidth; // let ratioX = clientWidth / imgWidth //
let ratioY = clientHeight / imgHeight; // let ratioY = clientHeight / imgHeight //
console.log(ratioX, ratioY); console.log(ratioX, ratioY)
let w = imgWidth * ratioX; // let w = imgWidth * ratioX //
let h = imgHeight * ratioX; // let h = imgHeight * ratioX //
that.imgWidth = w; that.imgWidth = w
console.log(w, h); console.log(w, h)
that.imgHeight = h; that.imgHeight = h
let dataList = JSON.parse(JSON.stringify(that.towerList)); let dataList = JSON.parse(JSON.stringify(that.towerList))
for (let i = 0; i < dataList.length; i++) { for (let i = 0; i < dataList.length; i++) {
dataList[i].mapX = String(Number(dataList[i].mapX) * ratioX - 37); dataList[i].mapX = String(Number(dataList[i].mapX) * ratioX - 37)
dataList[i].mapY = String(Number(dataList[i].mapY) * ratioX - 37); dataList[i].mapY = String(Number(dataList[i].mapY) * ratioX - 37)
}
that.towerList = dataList
} }
that.towerList = dataList;
};
} }
}, },
// //
getTowerList() { getTowerList() {
let data = { let data = {
projectSn: this.projectSn, projectSn: this.projectSn
}; }
getTowerListApi(data).then((res) => { getTowerListApi(data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (res.result.length > 0) { if (res.result.length > 0) {
this.towerList = res.result; this.towerList = res.result
this.checkedIndex = res.result[0].id; this.checkedIndex = res.result[0].id
this.devSn = res.result[0].devSn; this.devSn = res.result[0].devSn
this.getDevData(res.result[0]); this.getDevData(res.result[0])
this.calculate(); this.calculate()
} }
} }
}); })
}, },
// //
getDevData(val) { getDevData(val) {
this.checkedIndex = val.id; this.checkedIndex = val.id
this.devSn = val.devSn; this.devSn = val.devSn
clearTimeout(this.interval); clearTimeout(this.interval)
clearInterval(this.interval2); clearInterval(this.interval2)
this.getTowerPageData(); this.getTowerPageData()
this.getRecentWorkList(); this.getRecentWorkList()
this.createdEcharts(); this.createdEcharts()
this.interval2 = setInterval(() => { this.interval2 = setInterval(() => {
this.createdEcharts(); this.createdEcharts()
}, 5000); }, 5000)
}, },
// //
getTowerPageData() { getTowerPageData() {
let data = { let data = {
devSn: this.devSn, devSn: this.devSn
}; }
getSelectTowerBySnApi(data).then((res) => { getSelectTowerBySnApi(data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.driverList = res.result.driverList
this.driverList = res.result.driverList; this.towerData = res.result.tower
this.towerData = res.result.tower;
if (this.towerData.devOnline == 1) { if (this.towerData.devOnline == 1) {
this.towerData.devOnlineName = "在线" this.towerData.devOnlineName = '在线'
} else { } else {
this.towerData.devOnlineName = "离线" this.towerData.devOnlineName = '离线'
} }
console.log(this.towerData) console.log(this.towerData)
if (res.result.tower.enableVideoUrl == 1) { if (res.result.tower.enableVideoUrl == 1) {
this.videoList = res.result.videoList; this.videoList = res.result.videoList
} else { } else {
if(res.result.tower.videoUrl&&res.result.tower.videoUrl!='null'){ if (
this.videoList = JSON.parse(res.result.tower.videoUrl); res.result.tower.videoUrl &&
res.result.tower.videoUrl != 'null'
) {
this.videoList = JSON.parse(res.result.tower.videoUrl)
} else { } else {
this.videoList = [] this.videoList = []
} }
} }
if (this.videoList.length > 0) { if (this.videoList.length > 0) {
this.videoId = this.videoList[0].id; this.videoId = this.videoList[0].id
this.getVideo(this.videoList[0].id); this.getVideo(this.videoList[0].id)
} else { } else {
this.videoId = '' this.videoId = ''
this.selectList = [] this.selectList = []
} }
realWidth = this.towerData.forearmLength; realWidth = this.towerData.forearmLength
realHeight = this.towerData.towerHeight; realHeight = this.towerData.towerHeight
// //
this.getRealTimeData(); this.getRealTimeData()
} }
}); })
}, },
// //
getVideo(val) { getVideo(val) {
for (let i = 0; i < this.videoList.length; i++) { for (let i = 0; i < this.videoList.length; i++) {
if (val == this.videoList[i].id) { if (val == this.videoList[i].id) {
this.selectList = [this.videoList[i]]; this.selectList = [this.videoList[i]]
} }
} }
}, },
@ -621,11 +632,11 @@ export default {
// //
getTime(val) { getTime(val) {
if (val) { if (val) {
this.startTime = val[0]; this.startTime = val[0]
this.endTime = val[1]; this.endTime = val[1]
} else { } else {
this.startTime = ""; this.startTime = ''
this.endTime = ""; this.endTime = ''
} }
}, },
@ -634,61 +645,61 @@ export default {
let data = { let data = {
endTime: this.endTime, endTime: this.endTime,
startTime: this.startTime, startTime: this.startTime,
devSn: this.devSn, devSn: this.devSn
}; }
getRecentWorkListApi(data).then((res) => { getRecentWorkListApi(data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.workList = res.result; this.workList = res.result
} }
}); })
}, },
// //
getRealTimeData(devSn, index) { getRealTimeData(devSn, index) {
let data = { let data = {
devSn: devSn ? devSn : this.devSn, devSn: devSn ? devSn : this.devSn
}; }
getTowerCurrentDataApi(data).then((res) => { getTowerCurrentDataApi(data).then((res) => {
console.log(index) console.log(index)
if (res.code == 200) { if (res.code == 200) {
if (res.result) { if (res.result) {
if (devSn) { if (devSn) {
this.towerList[index].angle = res.result ? res.result.angle : 0; this.towerList[index].angle = res.result ? res.result.angle : 0
return; return
} else { } else {
console.log('000') console.log('000')
this.realTimeDevData = res.result; this.realTimeDevData = res.result
this.interval = setTimeout(() => { this.interval = setTimeout(() => {
this.getRealTimeData(devSn, index); this.getRealTimeData(devSn, index)
}, 5000); }, 5000)
} }
var y = parseFloat(res.result.height); var y = parseFloat(res.result.height)
var x = parseFloat(res.result.ranger); var x = parseFloat(res.result.ranger)
this.move(x, y); this.move(x, y)
// this.move(150,250) // this.move(150,250)
this.hideGoods = true; this.hideGoods = true
} else { } else {
this.realTimeDevData = { this.realTimeDevData = {
loading: "", loading: '',
windspeed: "", windspeed: '',
height: "", height: '',
windRatio: "", windRatio: '',
torqueRatio: "", torqueRatio: '',
angle: "", angle: '',
biasAngle: "", biasAngle: '',
ranger: "", ranger: '',
biasAngleRatio: "", biasAngleRatio: '',
alarmName: "", alarmName: ''
} }
} }
} }
}); })
}, },
move(x, y) { move(x, y) {
// ; // ;
// var x = randomNum(0,realWidth) // var x = randomNum(0,realWidth)
// var y = randomNum(0,realHeight) // var y = randomNum(0,realHeight)
var xImg, yImg; var xImg, yImg
// if (x <= realWidth) { // if (x <= realWidth) {
// xImg = (x / realWidth) * frontArmLength + imgLeftWidth // xImg = (x / realWidth) * frontArmLength + imgLeftWidth
@ -711,19 +722,26 @@ export default {
// } // }
// } // }
if (x <= realWidth) { if (x <= realWidth) {
xImg = (x / realWidth) * (frontArmLength - imgLeftWidth) + imgLeftWidth; xImg = (x / realWidth) * (frontArmLength - imgLeftWidth) + imgLeftWidth
this.warningText = ""; this.warningText = ''
} else { } else {
xImg = frontArmLength-imgLeftWidth; xImg = frontArmLength - imgLeftWidth
this.warningText = "当前设备前臂长参数错误"; this.warningText = '当前设备前臂长参数错误'
} }
console.log(realHeight, y, realHeight, height, imgLeftHeight, imgLeftHeight); console.log(
realHeight,
y,
realHeight,
height,
imgLeftHeight,
imgLeftHeight
)
if (y <= realHeight) { if (y <= realHeight) {
yImg = ((y) / realHeight) * (height-imgLeftHeight) + imgLeftHeight; yImg = (y / realHeight) * (height - imgLeftHeight) + imgLeftHeight
// this.warningText = ""; // this.warningText = "";
} else { } else {
yImg = height-imgLeftHeight; yImg = height - imgLeftHeight
this.warningText = "当前设备高度参数错误"; this.warningText = '当前设备高度参数错误'
} }
if (xImg < 90) { if (xImg < 90) {
xImg = 90 xImg = 90
@ -731,47 +749,47 @@ export default {
if (yImg > 380) { if (yImg > 380) {
yImg = 380 yImg = 380
} }
$moveBox.style.left = xImg - 6 + "px"; $moveBox.style.left = xImg - 6 + 'px'
$moveBox.style.top = yImg + "px"; $moveBox.style.top = yImg + 'px'
$xMove.style.left = xImg + "px"; $xMove.style.left = xImg + 'px'
$line.style.left = xImg + 8 + "px"; $line.style.left = xImg + 8 + 'px'
$line.style.height = yImg-74 + "px"; $line.style.height = yImg - 74 + 'px'
}, },
// //
createdEcharts() { createdEcharts() {
let data = { let data = {
devSn: this.devSn, devSn: this.devSn
}; }
getTodayTowerDataApi(data).then((res) => { getTodayTowerDataApi(data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.echartsData = res.result; this.echartsData = res.result
// loading // loading
var chart1 = echarts.init(this.$refs.load); var chart1 = echarts.init(this.$refs.load)
chart1.clear(); chart1.clear()
chart1.setOption(this.getOption()); chart1.setOption(this.getOption())
} }
}); })
}, },
// //
getOption() { getOption() {
let xData = []; let xData = []
let loadingData = []; // let loadingData = [] //
let rangerData = []; // let rangerData = [] //
if (this.echartsData.length > 0) { if (this.echartsData.length > 0) {
for (let i = 0; i < this.echartsData.length; i++) { for (let i = 0; i < this.echartsData.length; i++) {
let time = this.echartsData[i].reciveTime.substring(11); let time = this.echartsData[i].reciveTime.substring(11)
xData.push(time); xData.push(time)
loadingData.push(this.echartsData[i].loading); loadingData.push(this.echartsData[i].loading)
rangerData.push(this.echartsData[i].ranger); rangerData.push(this.echartsData[i].ranger)
} }
} }
let opt = { let opt = {
color: ["#FD3A88", "#47F9FD"], color: ['#FD3A88', '#47F9FD'],
tooltip: { tooltip: {
trigger: "axis", trigger: 'axis'
}, },
legend: { legend: {
data: ["吊重", "幅度"], data: ['吊重', '幅度']
}, },
dataZoom: [ dataZoom: [
{ {
@ -780,78 +798,78 @@ export default {
start: 0, start: 0,
end: 80, end: 80,
height: 8, height: 8,
borderColor: "transparent", borderColor: 'transparent',
backgroundColor: "#e8e8e8", backgroundColor: '#e8e8e8',
filterColor: "#999999", filterColor: '#999999',
bottom: 0, bottom: 0
}, }
], ],
grid: { grid: {
top: 30, top: 30,
bottom: 25, bottom: 25,
left: 35, left: 35,
right: 0, right: 0,
containLabel: true, containLabel: true
}, },
xAxis: { xAxis: {
type: "category", type: 'category',
axisTick: { axisTick: {
show: false, show: false
}, },
axisLine: { axisLine: {
show: false, show: false
}, },
data: xData, data: xData,
axisLabel: { axisLabel: {
//X //X
interval: "auto", //0auto: interval: 'auto' //0auto:
}, }
}, },
yAxis: { yAxis: {
name: "", name: '',
axisTick: { axisTick: {
show: false, show: false
}, },
axisLine: { axisLine: {
show: false, show: false
}, },
splitLine: { splitLine: {
lineStyle: { lineStyle: {
color: "#eee", color: '#eee'
}, }
}, }
}, },
series: [ series: [
{ {
name: "吊重", name: '吊重',
type: "line", type: 'line',
data: loadingData, data: loadingData,
smooth: true, smooth: true
}, },
{ {
name: "幅度", name: '幅度',
type: "line", type: 'line',
data: rangerData, data: rangerData,
// symbol: "none", // symbol: "none",
smooth: true, smooth: true,
itemStyle: { itemStyle: {
normal: { normal: {
lineStyle: { lineStyle: {
color: "#47F9FD", color: '#47F9FD'
}, },
areaStyle: { areaStyle: {
color: "#47F9FD", color: '#47F9FD',
opacity: 0.3, opacity: 0.3
}, }
}, }
}, }
}, }
], ]
}; }
return opt; return opt
}, }
}, }
}; }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@ -1087,12 +1105,12 @@ export default {
} }
.dev-line { .dev-line {
margin-left: 8px; margin-left: 8px;
color: #67C23A; color: #67c23a;
span { span {
display: inline-block; display: inline-block;
width: 12px; width: 12px;
height: 12px; height: 12px;
background: #67C23A; background: #67c23a;
border-radius: 50%; border-radius: 50%;
margin-right: 10px; margin-right: 10px;
} }