From 645834e1c3efb3a8c50dcbda98d87caba04bd421 Mon Sep 17 00:00:00 2001 From: fei.wang <wf18701153496@163.com> Date: 星期三, 13 八月 2025 14:34:02 +0800 Subject: [PATCH] v1.2.8 --- pages/index/ditu.vue | 664 +++++++++++++++++++++++++++++++++++++++--------------- 1 files changed, 477 insertions(+), 187 deletions(-) diff --git a/pages/index/ditu.vue b/pages/index/ditu.vue index b72ad61..a8183a4 100644 --- a/pages/index/ditu.vue +++ b/pages/index/ditu.vue @@ -1,5 +1,5 @@ <template> - <view> + <view class="container"> <u-search v-show="show" class="searchbg" shape="true" bg-color="rgba(255, 255, 255, 0.5)" placeholder="璇疯緭鍏ュ悕绉�" :show-action="false" v-model="keyword" @search="searchxinxi" :style="{top: topheight+'px',position: 'absolute',width: '50%',left: '25%'}"></u-search> @@ -27,7 +27,7 @@ <div class="area" style="display: inline-block;font-weight: bolder;font-size: 16px;background-color: #000000;color: #ffffff;"> <image src="../../static/img/blue.png" - style="vertical-align: middle;position: relative;top: -2px;width:20px;height:20px"> 鏂藉伐鍖�</image> + style="vertical-align: middle;position: relative;top: -2px;width:20px;height:20px"> 宸ヤ綔鍖�</image> </div> <div class="area" style="display: inline-block;font-weight: bolder;font-size: 16px;background-color: #000000;color: #ffffff;"> @@ -63,11 +63,15 @@ <view style="max-height: 600px; overflow-y: auto;"> <u--form style="" labelPosition="left" :model="model" :rules="rules2" ref="uForm"> - <u-form-item required label="缁堢缂栧彿:" borderBottom ref="item1" labelWidth="80px"> + <u-form-item required label="缁堢缂栧彿:" borderBottom ref="item1" labelWidth="80px" + @click="showtagid = true"> <u-badge v-if="tagonlie==1 && code!=''" :isDot="true" type="success"></u-badge> <u-badge v-else-if="tagonlie==0 && code!=''" :isDot="true" type="info"></u-badge> <!-- <u--input v-model="code" border="none" placeholder="璇疯緭鍏ョ粓绔紪鍙�" @blur="seachcode"></u--input> --> - <tn-input v-model="code" type="select" @click="showtagid = true" placeholder="璇烽�夋嫨缁堢缂栧彿" /> + <!-- <tn-input v-model="code" type="select" @click="showtagid = true" placeholder="璇烽�夋嫨缁堢缂栧彿" /> --> + <u-input v-model="code" disabled disabledColor="#ffffff" placeholder="璇烽�夋嫨缁堢缂栧彿" border="none" /> + <!-- <tn-action-sheet :list="bumenList" v-model="show1" @click="bymenCallback"></tn-action-sheet> --> + <u-icon slot="right" name="arrow-down"></u-icon> <tn-select v-model="showtagid" mode="single" :list="tagidlist" @confirm="confirmtagid" :searchShow="true"></tn-select> </u-form-item> @@ -101,7 +105,7 @@ <u-number-box v-model="tanum" :min="2" :max="4 " @change="valChange"></u-number-box> </u-form-item> <view v-for="i in tanum" :key="i"> - <u-form-item :label="'濉�' + (i) + '杈圭紭鍧愭爣A:'" borderBottom ref="item1" labelWidth="80px"> + <u-form-item :label="'濉�' + (i) + '瀵肩嚎杈圭紭鍧愭爣A:'" borderBottom ref="item1" labelWidth="80px"> <tn-input v-show="zuobiaolist[i-1][0]!=''" v-model="zuobiaolist[i-1][0]" inputAlign="right" style="width:400rpx"></tn-input> <!-- <tn-button v-show="zuobiaolist[i-1][0]==''" backgroundColor="#55aaff" fontColor="#ffffff" @@ -114,7 +118,7 @@ @click="acquisitionxy(i,0,'zb')">閲囬泦鍧愭爣</u-button> </uni-tooltip> </u-form-item> - <u-form-item :label="'濉�' + (i) + '杈圭紭鍧愭爣B:'" borderBottom ref="item1" labelWidth="80px"> + <u-form-item :label="'濉�' + (i) + '瀵肩嚎杈圭紭鍧愭爣B:'" borderBottom ref="item1" labelWidth="80px"> <tn-input v-show="zuobiaolist[i-1][1]!=''" v-model="zuobiaolist[i-1][1]" inputAlign="right" style="width:400rpx"></tn-input> <uni-tooltip :content="content" placement="top" style="width:100px"> @@ -175,14 +179,28 @@ </u-form-item> - <u-form-item required label="鍥存爮绫诲瀷:" prop="type" borderBottom ref="item1" :labelWidth="labelWidth"> - <tn-input :disabled="isdisabled" v-model="model.type" type="select" @click="show1 = true" - placeholder="璇疯緭鍏ラ�夋嫨鍥存爮绫诲瀷" /> - <tn-action-sheet :list="typeList" v-model="show1" @click="typeCallback"></tn-action-sheet> + <u-form-item required label="鍥存爮绫诲瀷:" prop="type" borderBottom ref="item1" :labelWidth="labelWidth" + @click="show1 = true"> + <!-- <u-input :disabled="isdisabled" v-model="model.type" type="select" + placeholder="璇疯緭鍏ラ�夋嫨鍥存爮绫诲瀷" /> --> + <u-input v-model="model.type" disabled disabledColor="#ffffff" placeholder="璇疯緭鍏ラ�夋嫨鍥存爮绫诲瀷" + border="none" /> + <!-- <tn-action-sheet :list="bumenList" v-model="show1" @click="bymenCallback"></tn-action-sheet> --> + <u-icon slot="right" name="arrow-down"></u-icon> + <!-- <tn-action-sheet :list="typeList" v-model="show1" @click="typeCallback"></tn-action-sheet> --> + <tn-select v-model="show1" mode="single" :list="typeList" @confirm="typeCallback" + :searchShow="true"></tn-select> </u-form-item> - <u-form-item required label="鍏宠仈閮ㄩ棬:" prop="department" borderBottom ref="item1" :labelWidth="labelWidth"> - <tn-input v-model="model.department" type="select" @click="show2 = true" placeholder="璇烽�夋嫨鍏宠仈閮ㄩ棬" /> - <tn-action-sheet :list="bumenList" v-model="show2" @click="bymenCallback"></tn-action-sheet> + <u-form-item required label="鍏宠仈閮ㄩ棬:" prop="department" borderBottom ref="item1" :labelWidth="labelWidth" + @click="show2 = true"> + <!-- <u-input v-model="model.department" type="select" @click="show2 = true" placeholder="璇烽�夋嫨鍏宠仈閮ㄩ棬" /> --> + <u-input v-model="model.department" disabled disabledColor="#ffffff" placeholder="璇烽�夋嫨鍏宠仈閮ㄩ棬" + border="none" /> + <!-- <tn-action-sheet :list="bumenList" v-model="show1" @click="bymenCallback"></tn-action-sheet> --> + <u-icon slot="right" name="arrow-down"></u-icon> + <!-- <tn-action-sheet :list="bumenList" v-model="show2" @click="bymenCallback"></tn-action-sheet> --> + <tn-select v-model="show2" mode="single" :list="bumenList" @confirm="bymenCallback" + :searchShow="true"></tn-select> </u-form-item> <u-form-item required label="鍥存爮楂樺害:" prop="height" borderBottom ref="item1" labelWidth="80px"> @@ -198,9 +216,17 @@ <u-form-item required label="鍛婅璇煶:" prop="warnmes" borderBottom ref="item1" labelWidth="80px"> <u--input v-model="model.warnmes" border="none" placeholder="璇疯緭鍏ュ憡璀﹁闊�"></u--input> </u-form-item> --> - <u-form-item required label="鐢靛帇绛夌骇:" prop="dianya" borderBottom ref="item1" labelWidth="80px"> - <tn-input v-model="model.juli" type="select" @click="show4 = true" placeholder="璇烽�夋嫨鐢靛帇绛夌骇" /> - <tn-action-sheet :list="rangeLevel" v-model="show4" @click="changeRangeLevel"></tn-action-sheet> + <u-form-item required label="鐢靛帇绛夌骇:" prop="dianya" borderBottom ref="item1" labelWidth="80px" + @click="show4 = true"> + <!-- <u-input v-model="model.juli" type="select" @click="show4 = true" placeholder="璇烽�夋嫨鐢靛帇绛夌骇" /> --> + + <u-input v-model="model.juli" disabled disabledColor="#ffffff" placeholder="璇烽�夋嫨鐢靛帇绛夌骇" + border="none" /> + <!-- <tn-action-sheet :list="bumenList" v-model="show1" @click="bymenCallback"></tn-action-sheet> --> + <u-icon slot="right" name="arrow-down"></u-icon> + <!-- <tn-action-sheet :list="rangeLevel" v-model="show4" @click="changeRangeLevel"></tn-action-sheet> --> + <tn-select v-model="show4" mode="single" :list="rangeLevel" @confirm="changeRangeLevel" + :searchShow="true"></tn-select> <!-- <uni-data-select v-model="model.dianya" :localdata="rangeLevel" @change="changeRangeLevel"></uni-data-select> --> <!-- <u--input v-model="model.dianya" border="none" placeholder="璇疯緭鍏ョ數鍘嬬瓑绾�"></u--input> --> @@ -244,16 +270,28 @@ <u-form-item label="鏂板鐐�:" borderBottom ref="item1" labelWidth="80px"> <u-number-box v-model="pointnum" :min="4" @change="onchange"></u-number-box> </u-form-item> - <view v-for="(item, index) in pointlist" :key="index"> + <!-- <view v-for="(item, index) in pointlist" :key="index"> <u-form-item :label="'鐐�' + (index+1) + '鍧愭爣:'" borderBottom ref="item1" labelWidth="80px"> - <tn-input v-show="pointlist[index]!=index" v-model="pointlist[index]" - style="width:400rpx"></tn-input> <uni-tooltip :content="pointcontent" placement="top" style="width:100px"> - <u-button style="width:100px" type="primary" v-if="pointlist[index]==index" + <u-button type="primary" v-if="pointlist[index]==index" :disabled="pointdisabled" size="mini" @click="acquisitionxy(index)">閲囬泦鍧愭爣</u-button> - <u-button style="width:100px" type="primary" v-else-if="pointlist[index]==''" + <u-button type="primary" v-else-if="pointlist[index]==''" :disabled="pointdisabled" size="mini" @click="acquisitionxy(index)">閲囬泦鍧愭爣</u-button> + <tn-input v-else v-model="pointlist[index]" + style="width:400rpx"></tn-input> + </uni-tooltip> + </u-form-item> + </view> --> + <view v-for="index in pointnum" :key="index"> + <u-form-item :label="'鐐�' + (index) + '鍧愭爣:'" borderBottom ref="item1" labelWidth="80px"> + <uni-tooltip :content="pointcontent" placement="top" style="width:100px"> + <!-- <u-button type="primary" v-if="pointlist[index]==index" + :disabled="pointdisabled" size="mini" @click="acquisitionxy(index)">閲囬泦鍧愭爣</u-button> --> + + <u-button type="primary" v-if="!pointlist[index-1]" :disabled="pointdisabled" + size="mini" @click="acquisitionxy(index-1)">閲囬泦鍧愭爣</u-button> + <tn-input v-else v-model="pointlist[index-1]"></tn-input> </uni-tooltip> </u-form-item> </view> @@ -283,10 +321,12 @@ :change:threeortwo="mars3d.get3wei" :amapPointData='amapPointData' :change:amapPointData="mars3d.getPointData" :amapldrawData='amapldrawData' :change:amapldrawData="mars3d.getDrwaData" :amapFencePoints='amapFencePoints' - :change:amapFencePoints="mars3d.getFenceData" :amapdeFencePoints='amapdeFencePoints' + :change:amapFencePoints="mars3d.getFenceData" :amapCranePoints='amapCranePoints' + :change:amapCranePoints="mars3d.getCraneData" :amapdeFencePoints='amapdeFencePoints' :change:amapdeFencePoints="mars3d.getFenceDatade" :amapGPSPoints='amapGPSPoints' :change:amapGPSPoints="mars3d.getgpsData" :point='point' :change:point="mars3d.getmarsPoint" - :fenceposition='fenceposition' :change:fenceposition="mars3d.getmarsfencePoint"></div> + :fenceposition='fenceposition' :change:fenceposition="mars3d.getmarsfencePoint" :ishide='ishide' + :change:ishide="mars3d.getmarshidemap" :isweimap='isweimap' :change:isweimap="mars3d.getmarsweimap"></div> <!-- #endif --> <!-- #ifndef APP-PLUS || H5 --> <!-- #endif --> @@ -308,6 +348,7 @@ } from '@/js/tools.js' import successCom from '@/components/success.vue' import { + findAllCrane, findtagid, findWarnmes, submitper, @@ -338,7 +379,7 @@ pointlock: false, //韪╃偣鑾峰彇鏁版嵁寮�鍏� pointcontent: '', pointdisabled: false, - pointlist: [0, 1, 2, 3], + pointlist: [], pointnum: 4, pointdrawshow: false, end: false, @@ -355,16 +396,20 @@ show1: false, show2: false, typeList: [{ - text: '淇濇姢鍖�' + value: '淇濇姢鍖�', + label: '淇濇姢鍖�' }, { - text: '绂佸叆鍖�' + value: '绂佸叆鍖�', + label: '绂佸叆鍖�' }, { - text: '宸ヤ綔鍖�' + value: '宸ヤ綔鍖�', + label: '宸ヤ綔鍖�' }, { - text: '瀹夊叏鍖�' + value: '瀹夊叏鍖�', + label: '瀹夊叏鍖�' }, ], warnmesList: [{ @@ -488,34 +533,34 @@ stopdatetime: '', rangeLevel: [{ value: '0.95m', - text: '10kV(0.95m)' + label: '10kV(0.95m)' }, { value: '1.05m', - text: '20kV(1.05m)' + label: '20kV(1.05m)' }, { value: '1.15m', - text: '35kV(1.15m)' + label: '35kV(1.15m)' }, { value: '1.4m', - text: '66kV(1.4m)' + label: '66kV(1.4m)' }, { value: '1.65m', - text: '110kV(1.65m)' + label: '110kV(1.65m)' }, { value: '2.55m', - text: '220kV(2.55m)' + label: '220kV(2.55m)' }, { value: '3.25m', - text: '330kV(3.25m)' + label: '330kV(3.25m)' }, { value: '4.66m', - text: '500kV(4.55m)' + label: '500kV(4.55m)' }, { value: '6.70m', - text: '750kV(6.70m)' + label: '750kV(6.70m)' }, { value: '8.25m', - text: '1000kV(8.25m)' + label: '1000kV(8.25m)' }], rules2: { @@ -642,6 +687,7 @@ amapendGuijiPoints: '', amapGuijiPoints: [], amapFencePoints: [], + amapCranePoints: [], amapdeFencePoints: {}, keyword: '', topheight: 55, @@ -670,21 +716,21 @@ type: String, // default: 60 }, - + ishide: { + type: Boolean, + }, + isweimap: { + type: Boolean, + }, }, onLoad() { }, mounted() { - console.log(this.fenceposition); tts = new AndroidTTSVoice(function(state) { - // console.log(state) - // showToast(state+"") if (state) { - tts.listenerVoiceState(function(b) { - // console.log(b) - }) + tts.listenerVoiceState(function(b) {}) } }); this.getLocation(); @@ -724,9 +770,7 @@ speaks(text) { if (this.isyuyin == true) { var tm = this.ptime; //鏍囩涓婁竴娆′笅鍙戣渹楦g殑鏃堕棿 - console.log(tm); if (tm != '') { - console.log(3333333); var a = get_time_cha_s(tm); //涓婃涓嬪彂铚傞福鏃堕棿鍜岀幇鍦ㄦ椂闂村樊 var yt = '5' // if (sign=='fg') { @@ -739,25 +783,11 @@ this.ptime = formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss') } } else { - console.log(22222); var state = tts.speak(text); this.ptime = formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss') } } - - - // tts.speak(res.data[i].tagid + res.data[i].personname + - // "杩涘叆棰勮鍖哄煙璇锋敞鎰�"); - }, - // updateButtonPosition() { - // const windowHeight = window.innerHeight; - // console.log(windowHeight); - // const windowWidth = window.innerWidth; - // this.buttonTop = windowHeight-279 ; - // this.buttonLeft = 15; - // console.log(this.buttonTop); - // }, findtagidall() { if (this.vuex_is_login) { const params = { @@ -765,7 +795,6 @@ juese: uni.getStorageSync('juese'), } findtagid(params).then((res) => { - console.log(res); if (res.code == 0) { this.tagidlist = res.data.map(item => ({ value: item.online, @@ -783,43 +812,34 @@ }, confirmtagid(e) { this.code = e[0].label - // this.tagonlie = e[0].value this.seachcode() }, changeRangeLevel(e) { - console.log(e); - // console.log(this.model.juli); - this.model.juli = this.rangeLevel[e].text; - // if (this.model.juli != '') { - this.model.dianya = this.rangeLevel[e].value.split("m")[0] - // } - // this.dianya = e; - // this.model.dianya = e.split("m")[0]; + this.model.juli = e[0].label + this.model.dianya = e[0].value.split("m")[0] }, getLocation() { uni.getLocation({ type: 'wgs84', success: function(res) { - console.log('褰撳墠浣嶇疆鐨勭粡搴︼細' + res.longitude); - console.log('褰撳墠浣嶇疆鐨勭含搴︼細' + res.latitude); } }); }, onchange(e) { - var list = [] - if (this.pointlist.length < e.value) { - for (var i = this.pointlist.length; i < e.value; i++) { + // var list = [] + // if (this.pointlist.length < e.value) { + // for (var i = this.pointlist.length; i < e.value; i++) { - list.push(i) - this.pointlist.push(i) - // e[i] - } - } else { - this.pointlist.splice(e.value, this.pointlist.length - e.value) - } + // list.push(i) + // this.pointlist.push(i) + // // e[i] + // } + // } else { + // this.pointlist.splice(e.value, this.pointlist.length - e.value) + // } }, radioChange(n) { @@ -912,11 +932,10 @@ juese: uni.getStorageSync('juese'), } findbumen(params).then((res) => { - console.log(res); if (res.code == 0) { this.bumenList = res.data.map(item => ({ value: item.name, - text: item.name + label: item.name })); } else { this.$refs.refSuccess.showBox({ @@ -928,9 +947,9 @@ } }, - typeCallback(index) { + typeCallback(e) { const params = { - type: this.typeList[index].text, + type: e[0].label, } findWarnmes(params).then((res) => { if (res.code == 0) { @@ -947,10 +966,10 @@ } }) - this.model.type = this.typeList[index].text; + this.model.type = e[0].label; }, - bymenCallback(index) { - this.model.department = this.bumenList[index].text; + bymenCallback(e) { + this.model.department = e[0].label; }, acquisitionxy(index, i, name) { @@ -959,24 +978,18 @@ company: this.company, juese: uni.getStorageSync('juese'), } - console.log(params); if (this.vuex_is_login) { acquisition(params).then((res) => { - console.log(res); if (res.code == 0) { if (this.model.fencetype == '鍙樼數浣滀笟') { // this.model.points += res.data.lat + ":" + res.data.lon + ";" this.pointlist.splice(index, 1, res.data.lat + ":" + res.data.lon); - console.log(this.pointlist); this.amapPointData.splice(index, 1, res.data); // this.amapPointData.push(res.data) // this.amapPointData = this.pointlist this.pointlock = true } else { - console.log(name); if (name == 'zb') { - console.log(index); - console.log(i); this.zuobiaolist[index - 1][i] = res.data.lat + ":" + res.data.lon + ";" this.zuobiaolist[index - 1][2] = res.data.height this.amapPointData.splice(index + i, 1, res.data); @@ -998,13 +1011,11 @@ }, - valChange(e) { - console.log('褰撳墠鍊间负: ' + e.value) - }, + valChange(e) {}, initlock() { this.fetchPersonsList(); this.fetchFenceList(); - + this.fetchCraneList }, closemodal() { this.drawshow = false @@ -1047,9 +1058,9 @@ //浠庢渶鍚庝竴鏉℃煡璇㈢偣浣岯绗竴鏉″锛岀浜屾潯寮у瀭鎷兼帴锛屾渶鍚庢妸涓ょ粍鏁版嵁鎷兼帴璧锋潵 for (let i = this.tanum - 1; i >= 0; i--) { result += this.zuobiaolist[i][1]; - // if (i >= 1) { - // result += this.saglist[i - 1][1]; - // } + if (i >= 1) { + result += this.saglist[i - 1][1]; + } // hei += this.zuobiaolist[i][2]; // if (i >= 1) { @@ -1061,16 +1072,25 @@ // hei += this.saglist[i - 1][2] + ":" + this.saglist[i - 1][3] + ';'; // } } - console.log(result); - console.log(hei); this.model.points = result this.model.lineHeight = hei } else { - let result = ''; - for (var i = 0; i < this.pointlist.length; i++) { - result += this.pointlist[i] + ";" + if (this.drawway == "杩炵画缁樺埗") { + + } else { + // this.drawway == "杩炵画缁樺埗" + let result = ''; + for (var i = 0; i < this.pointlist.length; i++) { + result += this.pointlist[i] + ";" + } + this.model.points = result } - this.model.points = result + // this.drawway == "杩炵画缁樺埗" + // let result = ''; + // for (var i = 0; i < this.pointlist.length; i++) { + // result += this.pointlist[i] + ";" + // } + // this.model.points = result } this.$refs.uForm.validate().then(res => { @@ -1081,7 +1101,66 @@ type: 'success', txt: "淇濆瓨鎴愬姛" }); + this.pointlist = [], + // list: [ + // [ + // 0, 1 + // ], + // [ + // 2, 3 + // ], + // [ + // 4, 5 + // ] + // ], + this.zuobiaolist = [ + [ + '', '', '', '' + ], + // height1:'', + [ + '', '', '', '' + ], + [ + '', '', '', '' + ], + // height1:'', + [ + '', '', '', '' + ], + // height3:'', + ], + this.saglist = [ + [ + '', '', '', '' + ], + [ + '', '', '', '' + ], + [ + '', '', '', '' + ], + + // height3:'', + ], + this.model.point = '' + this.model.fenceFloorHe = '-1' + this.model.height = '' + this.model.lineHeight = '-1' + this.model.company = this.company + this.model.perCompany = '' + this.model.addperson = this.username + this.model.name = '' + this.model.juli = '' + this.model.type = '' + this.model.department = '' + this.model.distance = '0' + this.model.dianya = '' + this.model.isplay = '0' + this.model.nowarnmes = '' + this.model.warnmes = '' + this.model.fencetype = '鍙樼數浣滀笟' this.savefence = false this.amapldrawData = [] this.amapPointData = [] @@ -1158,8 +1237,16 @@ this.pointdrawshow = false }, savepoint() { - this.pointdrawshow = false - this.savefence = true + if (this.pointlist.length < 3) { + this.$refs.refSuccess.showBox({ + type: 'error', + txt: '璇峰厛閲囬泦鐐逛綅' + }); + } else { + this.pointdrawshow = false + this.savefence = true + } + }, fenceHe() { //鑾峰彇鍥存爮搴曢珮 @@ -1197,6 +1284,7 @@ this.fetchPersonsList(); this.updateTrajectories(); this.fetchFenceList(); + this.fetchCraneList() }, searchxinxi() { const params = { @@ -1237,6 +1325,53 @@ }) // } }, + + + + + fetchCraneList() { + const params = { + company: this.company, + juese: uni.getStorageSync('juese'), + } + if (this.vuex_is_login) { + if (uni.getStorageSync('isfence') == true) { + findAllCrane(params).then((res) => { + if (res.data != null) { + // const filteredData = res.data.filter(item => item.ishide === "1"); + // if (filteredData != null) { + // this.amapdeFencePoints = filteredData + // } + + // const filteredDatap = res.data.filter(item => item.isplay === "1"); + // if (filteredDatap != null) { + // this.amapdeFencePoints = filteredDatap + // } + + // const filteredDatapt = res.data.filter(item => item.isplay === "0"); + // if (filteredDatapt != null) { + // this.amapdeFencePoints = filteredDatapt + // } + // if (this.amapFencePoints.length > res.data.length) { + // //褰撴湁鍥存爮鍒犻櫎鏃惰皟鐢ㄥ湴鍥炬妸鍥存爮鍏ㄩ儴鍒犻櫎 + // const missingData = this.amapFencePoints.filter(item1 => { + // return !res.data.some(item2 => item2.id === item1.id); + // }); + // this.amapdeFencePoints = missingData + + // } + this.amapCranePoints = res.data + } + }) + } else { + this.amapCranePoints = [] + } + } + setTimeout(() => { + //5绉掓挱鏀句竴娆� + this.fetchCraneList(); + }, 5000); + }, fetchFenceList() { const params = { company: this.company, @@ -1246,20 +1381,20 @@ if (uni.getStorageSync('isfence') == true) { findAllFence(params).then((res) => { if (res.data != null) { - const filteredData = res.data.filter(item => item.ishide === 1); + const filteredData = res.data.filter(item => item.ishide === "1"); if (filteredData != null) { this.amapdeFencePoints = filteredData } - const filteredDatap = res.data.filter(item => item.isplay === "1"); - if (filteredDatap != null) { - this.amapdeFencePoints = filteredDatap - } + // const filteredDatap = res.data.filter(item => item.isplay === "1"); + // if (filteredDatap != null) { + // this.amapdeFencePoints = filteredDatap + // } - const filteredDatapt = res.data.filter(item => item.isplay === "0"); - if (filteredDatapt != null) { - this.amapdeFencePoints = filteredDatapt - } + // const filteredDatapt = res.data.filter(item => item.isplay === "0"); + // if (filteredDatapt != null) { + // this.amapdeFencePoints = filteredDatapt + // } if (this.amapFencePoints.length > res.data.length) { //褰撴湁鍥存爮鍒犻櫎鏃惰皟鐢ㄥ湴鍥炬妸鍥存爮鍏ㄩ儴鍒犻櫎 const missingData = this.amapFencePoints.filter(item1 => { @@ -1354,7 +1489,6 @@ "瓒呴珮璇锋敞鎰�"); // this.warntype = "error" } - console.log(this.warnidlist.indexOf(res.data[i].tagid)); if (this.warnidlist.indexOf(res.data[i].tagid) < 0) { if (res.data[i].warnstatus == '1') { this.warnlist.push(res.data[i].tagid + res.data[i].personname + @@ -1463,6 +1597,7 @@ <script module="mars3d" lang="renderjs"> let graphicLayer = null; let graphicLayerFence = null; + let graphicLayerCrane = null; let graphicLayerFenceBianJie = null; let graphicLayerFencedrwa = null; var creditHtml = '' @@ -1470,6 +1605,7 @@ let addedCarIds = new Set(); let addedBaseIds = new Set(); let addedFenceIds = new Set(); + let addedCraneIds = new Set(); var LocusData; var LocuData; var countNum = 0; @@ -1513,6 +1649,8 @@ fenceids: '', graphicids: [], graphicFence: {}, + graphicCrane: {}, + labels: {}, list: {}, perlist: {}, @@ -1543,15 +1681,15 @@ // "http://123.56.113.213:8080/hxzkuwb/Home/demo/lib/mars3d/mars3d.css", // "http://123.56.113.213:8080/hxzkuwb/Home/demo/lib/mars3d/mars3d.js", // "http://123.56.113.213:8080/hxzkuwb/Home/js/3DMoXing.js", - "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/Cesium/Widgets/widgets.css", - "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/Cesium/Cesium.js", - "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.css", - "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.js", + // "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/Cesium/Widgets/widgets.css", + // "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/Cesium/Cesium.js", + // "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.css", + // "http://39.106.210.13:8888/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.js", - // "http://123.117.152.120:8088/hxzkuwb/view/Home/demo/lib/Cesium/Widgets/widgets.css", - // "http://123.117.152.120:8088/hxzkuwb/view/Home/demo/lib/Cesium/Cesium.js", - // "http://123.117.152.120:8088/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.css", - // "http://123.117.152.120:8088/hxzkuwb/view/Home/demo/lib/mars3d/mars3d.js", + "http://123.117.152.120:8088/IAFService/view/Home/demo/lib/Cesium/Widgets/widgets.css", + "http://123.117.152.120:8088/IAFService/view/Home/demo/lib/Cesium/Cesium.js", + "http://123.117.152.120:8088/IAFService/view/Home/demo/lib/mars3d/mars3d.css", + "http://123.117.152.120:8088/IAFService/view/Home/demo/lib/mars3d/mars3d.js", //鐢ㄥ湪绾垮湴鍧� // "http://mars3d.cn/lib/Cesium/Widgets/widgets.css", // "http://mars3d.cn/lib/Cesium/Cesium.js", @@ -1657,8 +1795,11 @@ // center: { lat: mapPosition[1], lng: mapPosition[0], alt: HomeSetting.alt, heading: HomeSetting.heading, pitch: HomeSetting.pitch }, showSkyAtmosphere: false, // 鍏抽棴鐞冨懆杈圭殑鐧借壊杞粨 map.scene.skyAtmosphere = false fog: true, + backgroundImage: "url(http://123.117.152.120:8088/IAFService/view/Home/gdty/background.png)", fxaa: true, + globe: { + show: true, showGroundAtmosphere: false, // 鍏抽棴澶ф皵锛堢悆琛ㄩ潰鐧借挋钂欑殑鏁堟灉锛� depthTestAgainstTerrain: false, baseColor: "#546a53" @@ -1898,16 +2039,20 @@ map.scene.morphTo2D(0); } // 鍒涘缓鐭㈤噺鏁版嵁鍥惧眰 - graphicLayer = new mars3d.layer.GraphicLayer({ - allowDrillPick: true // 濡傛灉瀛樺湪鍧愭爣瀹屽叏鐩稿悓鐨勫浘鏍囩偣锛屽彲浠ユ墦寮�璇ュ睘鎬э紝click浜嬩欢閫氳繃graphics鍒ゆ柇 - }) + // showCarList() //鍔犺浇浜哄憳鏁版嵁 graphicLayerFencedrwa = new mars3d.layer.GraphicLayer() map.addLayer(graphicLayerFencedrwa) + graphicLayerCrane = new mars3d.layer.GraphicLayer() + map.addLayer(graphicLayerCrane) + graphicLayerFenceBianJie = new mars3d.layer.GraphicLayer() map.addLayer(graphicLayerFenceBianJie) - graphicLayerFence = new mars3d.layer.GraphicLayer() - map.addLayer(graphicLayerFence) + + graphicLayer = new mars3d.layer.GraphicLayer({ + // allowDrillPick: true ,// 濡傛灉瀛樺湪鍧愭爣瀹屽叏鐩稿悓鐨勫浘鏍囩偣锛屽彲浠ユ墦寮�璇ュ睘鎬э紝click浜嬩欢閫氳繃graphics鍒ゆ柇 + + }) @@ -1931,6 +2076,9 @@ json.online = car.attr.online json.baoliu1 = car.attr.baoliu1 + json.baoliu3 = car.attr.baoliu3 + json.baoliu2 = car.attr.baoliu2 + json.baoliu4 = car.attr.baoliu4 json.type = car.attr.type json.rtcm = car.attr.rtcm json.tagid = car.attr.tagid @@ -1940,11 +2088,17 @@ json.height = car.attr.height json.department = car.attr.department json.gpsstatus = car.attr.gpsstatus + this.perlist = json this.$ownerInstance.callMethod('handleMapClick', this.perlist); }) + + // setTimeout(() => { + graphicLayerFence = new mars3d.layer.GraphicLayer(); + map.addLayer(graphicLayerFence) + //娴嬭瘯鏈湴鍥剧墖 // const graphic = new mars3d.graphic.BillboardEntity({ @@ -1977,14 +2131,20 @@ }); } }, + getmarshidemap(newValue) { + map.globe.show = !newValue; + }, + getmarsweimap(newValue) { + if (newValue == true) { + map.scene.morphTo3D(0); + } else { + map.scene.morphTo2D(0); + } + // map.globe.show = !newValue; + }, getmarsfencePoint(newValue) { - console.log(444444444444); - console.log(newValue); - console.log(newValue.split(",")[0]); - // if (this.fenceplock == false) { setTimeout(() => { - // if (this.fplock == true) { //5绉掓挱鏀句竴娆� if (Object.keys(newValue).length != 0) { map.camera.flyTo({ @@ -2006,7 +2166,7 @@ getFenceDatade(newValue) { if (Object.keys(newValue).length != 0) { graphicLayerFence.clear() - + console.log(111111111111); addedFenceIds = new Set(); // if (this.fenceid == newValue.id) { graphicLayerFenceBianJie.clear() @@ -2031,11 +2191,130 @@ return R * c; }, + + + + getCraneData(newValue) { + console.log(newValue); + if (Object.keys(newValue).length != 0) { + newValue.forEach((e, i) => { + // if (e.ishide === '0') { + // if (!addedCraneIds.has(e.id)) { + console.log("鎵撳嵃鏁版嵁====銆嬨�嬨�嬨�嬨�嬨�嬨�嬨��-----"); + // this.fenceids = e.id + "_fence" + console.log(e); + // const { + // oldgraphic, + // // label + // } = this.graphicCrane[e.id]; + console.log(this.graphicCrane[e.id]); + // 绉婚櫎鏃х殑鍥炬爣瀹炰綋 + if (this.graphicCrane[e.id]) { + graphicLayerCrane.removeGraphic(this.graphicCrane[e.id].oldgraphic); + // graphicLayer.removeGraphic(label); + } + let parts = e.pointA.split(','); + var part = [] + // var fence = [] + var positions = []; + // part = e.split(','); + // if (part.length > 1) { + var lng = parseFloat(parts[0]); + var lat = parseFloat(parts[1]); + part.push(lng) + part.push(lat) + positions.push(part); + console.log(positions); + const fenceGraphic = new mars3d.graphic.Sector({ + // pointA + positions: positions, + // [ + // [117.151322, 31.863556, 34.3] + // // positions + // // [117.18186,31.869359, 29.8], + // // [117.17505, 31.84342, 105.7], + // ], + pickable: false, + style: { + radius: e.radius, + startAngle: e.angle, // 寮�濮嬭搴�(姝d笢鏂瑰悜涓�0,椤烘椂閽堝埌360搴�) + endAngle: 0, + // closure: true, + color: "#3388ff", + opacity: 0.5, + clampToGround: true, + // outline: true, + // outlineWidth: 3, + // outlineColor: "#ffffff", + // diffHeight: e.height / 100, + // clampToGround:true, + // // addHeight:10, + // materialType: mars3d.MaterialType.LineFlow, + label: { + text: e.cranename, + font_size: 18, + outline: true, + visibleDepth: true, + // outlineColor: colorFence, + color: "#ffffff", + distanceDisplayCondition: true, + distanceDisplayCondition_far: 500000, + distanceDisplayCondition_near: 0, + } + }, + // positions: [["116.2811140","39.8318720"],["116.2817160","39.8317730"],["116.2811709","39.8322179"]], + // style: { + // color: this.parseColor("#FF0000").withAlpha(0.3), + // outlineWidth: 2, // 杈规绮楃粏锛堝儚绱狅級 + // outline: true, + // outlineColor: this.parseColor("#b40000"), + // // diffHeight: newValue[e].height || 0, + // label: { + // text: e.name, + // font_size: 18, + // outline: true, + // outlineColor: "#C70708", + // color: "#ffffff", + // distanceDisplayCondition: true, + // distanceDisplayCondition_far: 500000, + // distanceDisplayCondition_near: 0 + // } + // }, + attr: { + name: e.cranename, + // ptagid: newValue[e].id,銆� + } + }); + graphicLayerCrane.addGraphic(fenceGraphic); + addedCraneIds.add(e.id); + this.graphicCrane[e.id] = { + // graphic: graphic, + oldgraphic: fenceGraphic + }; + // } else { + // // if (addedFenceIds.has(e.id)) { + // // graphicLayer.removeGraphic(graphic); + // // delete this.graphicLabels[e.id]; // 鍒犻櫎寮曠敤 + // // // delete this.labels[e.id]; + // // addedFenceIds.delete(e.id); + // // // this.graphicLabels[e.anchorid] = { + // // // graphic: graphic1 + // // // }; + // // } + // } + // } + }) // 灏嗕紶閫掕繃鏉ョ殑鍊艰祴鍊肩粰points锛岃繖鏍峰氨鍙互鍦ㄨ鍥惧眰涓娇鐢� + } else { + addedCraneIds = new Set(); + } + }, getFenceData(newValue) { + console.log(newValue); if (Object.keys(newValue).length != 0) { newValue.forEach((e, i) => { if (e.ishide === '0') { if (!addedFenceIds.has(e.id)) { + console.log("鎵撳嵃鏁版嵁====銆嬨�嬨�嬨�嬨�嬨�嬨�嬨��"); this.fenceids = e.id + "_fence" // setTimeout(() => { //5绉掓挱鏀句竴娆� @@ -2072,7 +2351,8 @@ image: "static/img/ponit1.png", scale: 0.4, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, + visibleDepth: false } // attr: { // online: newValue[e].online, @@ -2117,6 +2397,7 @@ visibleDepth: false, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, + visibleDepth: false, //鏄惁琚伄鎸� verticalOrigin: Cesium.VerticalOrigin.CENTER } }); @@ -2149,16 +2430,20 @@ const fenceGraphic = new mars3d.graphic.PolygonPrimitive({ positions: fence, + pickable: false, style: { closure: true, color: colorFence, opacity: 0.5, diffHeight: e.height / 100, + clampToGround: true, + // addHeight:10, materialType: mars3d.MaterialType.LineFlow, label: { text: e.name + "锛�" + qt + "锛�", font_size: 18, outline: true, + visibleDepth: true, outlineColor: colorFence, color: "#ffffff", distanceDisplayCondition: true, @@ -2191,8 +2476,6 @@ }); graphicLayerFence.addGraphic(fenceGraphic); addedFenceIds.add(e.id); - console - .log(this.graphicFence); this.graphicFence[this.fenceids] = { // graphic: graphic, fence: fenceGraphic @@ -2234,9 +2517,7 @@ if (Object.keys(newValue).length != 0) { for (var e = newValue.length - 1; e < newValue.length; e++) { this.fenceid = newValue[e].id - if (newValue[e - 1].lat != undefined && newValue[e].lat == newValue[e - 1].lat) { - console.log("鏁版嵁閲嶅===========銆嬨�嬨�嬨�嬨�嬨�嬨�嬨��", newValue[e].lat); - } else { + if (newValue[e - 1].lat != undefined && newValue[e].lat == newValue[e - 1].lat) {} else { // // 3. 闂悎澶氳竟褰� this.cartesianPoints.push(newValue[e]); @@ -2285,30 +2566,7 @@ this.cartesianPoints.push(this.plist); // 鑷姩闂悎澶氳竟褰� // [["116.2811140","39.8318720"],["116.2817160","39.8317730"],["116.2811709","39.8322179"]] - const fenceGraphic = new mars3d.graphic.PolygonPrimitive({ - positions: this.cartesianPoints, - // id: newValue[e].id, - // positions: [["116.2811140","39.8318720"],["116.2817160","39.8317730"],["116.2811709","39.8322179"]], - style: { - color: this.parseColor("#FF0000").withAlpha(0.3), - outlineWidth: 2, // 杈规绮楃粏锛堝儚绱狅級 - outline: true, - outlineColor: this.parseColor("#b40000"), - diffHeight: newValue[e].height || 0, - // label: { - // text: e.name, - // font_size: 14, - // color: Cesium.Color.WHITE, - // distanceDisplayCondition: [0, 500000] - // } - } - }); - // this.graphicFence[newValue[e].id] = { - // // graphic: graphic, - // fence: fenceGraphic - // }; - graphicLayerFencedrwa.addGraphic(fenceGraphic); //娴嬭瘯鏈湴鍥剧墖 // this.graphicids.push(newValue[e].id) const graphic = new mars3d.graphic.BillboardEntity({ @@ -2322,7 +2580,7 @@ image: "static/img/ponit1.png", scale: 0.4, horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, }, attr: { online: newValue[e].online, @@ -2344,9 +2602,31 @@ // // fence: fenceGraphic // }; } - } else { - console.log("娓呯┖缁樺埗鍥存爮"); - } + const fenceGraphic = new mars3d.graphic.PolygonPrimitive({ + positions: this.cartesianPoints, + // id: newValue[e].id, + // positions: [["116.2811140","39.8318720"],["116.2817160","39.8317730"],["116.2811709","39.8322179"]], + style: { + color: this.parseColor("#FF0000").withAlpha(0.3), + outlineWidth: 2, // 杈规绮楃粏锛堝儚绱狅級 + outline: true, + outlineColor: this.parseColor("#b40000"), + diffHeight: newValue[e].height || 0, + // label: { + // text: e.name, + // font_size: 14, + // color: Cesium.Color.WHITE, + // distanceDisplayCondition: [0, 500000] + // } + } + }); + + // this.graphicFence[newValue[e].id] = { + // // graphic: graphic, + // fence: fenceGraphic + // }; + graphicLayerFencedrwa.addGraphic(fenceGraphic); + } else {} }, getData(newValue) { let modelParam = { @@ -2359,7 +2639,6 @@ newValue.forEach((e, i) => { if (e.online === '1') { if (!addedCarIds.has(e.id)) { - // console.log("鎵撳嵃鏁版嵁====銆嬨�嬨�嬨�嬨�嬨�嬨�嬨�嬨�嬨��"); //娴嬭瘯鏈湴鍥剧墖 let colorFence = "" let JuXingcolorFence = "" @@ -2411,12 +2690,15 @@ image: img, scale: "0.4", horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, }, attr: { online: e.gpsstatus, type: e.type, baoliu1: e.baoliu1, + baoliu3: e.baoliu3, + baoliu2: e.baoliu2, + baoliu4: e.baoliu4, rtcm: e.rtcm, encryption: e.encryption, power: e.power, @@ -2438,7 +2720,7 @@ style: Cesium.LabelStyle.FILL_AND_OUTLINE, // 椋庢牸锛氬~鍏呭拰鎻忚竟 verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // 鏂囧瓧鍦ㄥ瀭鐩存柟鍚戠殑鍘熺偣 pixelOffset: new Cesium.Cartesian2(0, - - 30) // 鏂囧瓧鍋忕Щ閲忥紝鍚戜笅鍋忕Щ10鍍忕礌 + 75) // 鏂囧瓧鍋忕Щ閲忥紝鍚戜笅鍋忕Щ10鍍忕礌 } }); if (this.graphicLabels[e.id]) { @@ -2486,12 +2768,15 @@ image: img, scale: "0.4", horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM + verticalOrigin: Cesium.VerticalOrigin.BOTTOM, }, attr: { online: e.gpsstatus, type: e.type, baoliu1: e.baoliu1, + baoliu3: e.baoliu3, + baoliu2: e.baoliu2, + baoliu4: e.baoliu4, rtcm: e.rtcm, encryption: e.encryption, power: e.power, @@ -2572,14 +2857,6 @@ // var img = "static/img/zuobiao2.png"; colorFence = "#ffff00" } - // console.log(22222222); - // console.log(item.baoliu2); - // console.log(item.baoliu2.split(";").indexOf("1")); - // console.log(item.baoliu2.split(";").indexOf("1")>-1); - // if (item.baoliu2.split(";").indexOf("1") < 0) { - // var img = "static/img/zuobiao7.png"; - // // var img = "static/img/zuobiao2.png"; - // } if (item.baoliu2.split(";")[0] == 1) { var img = "static/img/zuobiao6.png"; } else if (item.baoliu2.split(";")[1] == 0) { @@ -2602,7 +2879,8 @@ scale: "0.4", horizontalOrigin: Cesium.HorizontalOrigin .CENTER, - + // addHeight:1000, + visibleDepth: false, //鏄惁琚伄鎸� verticalOrigin: Cesium.VerticalOrigin.BOTTOM, // pixelOffset: new Cesium.Cartesian2(0, 10), // 鍚戜笅鍋忕Щ50鍍忕礌 }, @@ -2610,6 +2888,9 @@ online: item.online, type: item.type, baoliu1: item.baoliu1, + baoliu3: item.baoliu3, + baoliu2: item.baoliu2, + baoliu4: item.baoliu4, encryption: item.encryption, rtcm: item.rtcm, power: item.power, @@ -2630,7 +2911,7 @@ outlineWidth: 2, style: Cesium.LabelStyle.FILL_AND_OUTLINE, verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - pixelOffset: new Cesium.Cartesian2(0, -30) + pixelOffset: new Cesium.Cartesian2(0, -75) } }); // 娣诲姞鏍囩鍒板浘灞傚苟瀛樺偍寮曠敤 @@ -2730,6 +3011,15 @@ </script> <style> + .container { + display: flex; + flex-direction: column; + width: 100%; + height: 100%; + background: url("../../static/img/background.png") no-repeat; + background-size: 100% 100%; + } + .searchbg { width: '50%'; left: '25%'; -- Gitblit v1.9.3