Forecast.vue 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085
  1. <template>
  2. <view class="content">
  3. <!-- <third-comp :key="menuKey"></third-comp> -->
  4. <view v-if="toggleSwitch==false">
  5. <view>
  6. <cu-custom bgColor="bg-blacks" :isBack="false">
  7. <block slot="right"><image src="../../static/picture/fourLine.png" style="width: 30px;height: 30px;margin-left: 2%;" @tap="openDrawer"></image></block>
  8. <block slot="right">
  9. <view class="icon cuIcon-notice text-white" v-if="badge != 0" style="margin-left: -70%;">
  10. <view class="cu-tag looknumber" style="margin-top: -2%;">
  11. <block v-if="badge != 1">{{ badge > 99 ? '99+' : badge }}</block>
  12. </view>
  13. </view>
  14. </block>
  15. <block slot="right"></block>
  16. <block slot="content">{{ address }}</block>
  17. <block slot="right"><view class="plus" @tap="showModal" data-target="viewModal">+</view></block>
  18. <!-- <block slot="right"><view class="plus" @tap="showModal" data-target="viewModal">+</view></block> -->
  19. </cu-custom>
  20. </view>
  21. <!-- 抽屉组件 -->
  22. <!-- 地图组件 -->
  23. <div v-if="conflict==false">
  24. <drawer ref="drawer" @tap="closeDrawer" ></drawer>
  25. </div>
  26. <div class="plusDrawer" @tap="hideModal">
  27. <plusDrawer ref="plusDrawer"></plusDrawer>
  28. </div>
  29. <view v-if="kg==true">
  30. <!-- <div class="plusDrawer" @tap="hideModal"><plusDrawer ref="plusDrawer"></plusDrawer></div> -->
  31. <view class="page-body">
  32. <view class="page-section page-section-gap">
  33. <map style="width: 100%; height: 300px;"
  34. :controls="controls"
  35. :circles="circles"
  36. :polyline="polyline"
  37. :scale="scale"
  38. :latitude="latitude"
  39. :longitude="longitude"
  40. :markers="covers"
  41. >
  42. <cover-view style="color: #000000;" > 经度:{{ mapEnd_1 }}</cover-view>
  43. <cover-view style="color: #000000;"> 纬度:{{ mapEnd_2 }}</cover-view>
  44. </map>
  45. </view>
  46. </view>
  47. </view>
  48. <!--经纬度组件-->
  49. <!-- <view class="InformationCard">
  50. <view class="informationCardAll">
  51. <view class="informationCardTextOne">
  52. <view class="informationCardText">
  53. <view class="textSilver">经度:</view>
  54. <view class="textWhite">{{ mapEnd_1 }}</view>
  55. </view>
  56. </view>
  57. <view class="informationCardTextOne">
  58. <view class="informationCardText">
  59. <view class="textSilver">纬度:</view>
  60. <view class="textWhite">{{ mapEnd_2 }}</view>
  61. </view>
  62. </view>
  63. </view>
  64. </view> -->
  65. <scroll-view @tap="hideModal" scroll-y class="DrawerPage" :class="modalName == 'viewModal' ? 'show' : ''">
  66. <!-- 个人信息组件 -->
  67. <view class="Personal_information_W">
  68. <view class="name">姓名:李占国</view>
  69. <view class="history" @click="mapDate;mapdelete();"> <span class="navigation"></span> </view>
  70. <view class="skills">技能:电力类,机械类</view>
  71. </view>
  72. <!-- 历史曲线组件 -->
  73. <view class="curve" >
  74. <view class="curve_l">健康情况</view>
  75. <view class="curve_r" @tap="common.navTo('/components/bracelet/braceletHistoryCurve?braceletCurve=' + braceletCurve)">历史曲线</view>
  76. <div class="greater"></div>
  77. </view>
  78. <!-- 健康详情组件 -->
  79. <view class="healthy" >
  80. <view class="healthy_H">
  81. <view class="details_z">心跳频率:{{xtpl_computed}}<!-- ({{ bracelet[deviceName][targetName_xtpl][targetName_xtpl_size].value }}) --></view>
  82. <view class="details_m">步数:{{bs_computed}}</view>
  83. <view class="details_y">收缩血压:{{ssxy_computed}}</view>
  84. </view>
  85. <view class="healthy_N">
  86. <view class="details_z">舒张血压:{{szxy_computed}}<!-- ({{ bracelet[deviceName][targetName_szxy][targetName_szxy_size].value }}) --></view>
  87. <view class="details_m">疲劳度:{{pld_computed}}<!-- ({{ bracelet[deviceName][targetName_pld][targetName_pld_size].value }}) --></view>
  88. <view class="details_y">血氧浓度:{{xynd_computed}}<!-- ({{ bracelet[deviceName][targetName_xynd][targetName_xynd_size].value }}) --></view>
  89. </view>
  90. </view>
  91. </scroll-view>
  92. </view>
  93. <view v-if="toggleSwitch==true">
  94. <WeatherProphethomepage ref="r1"></WeatherProphethomepage>
  95. </view>
  96. <!-- <view class="DrawerClose" :class="modalName == 'viewModal' ? 'show' : ''" @tap="hideModal"><text class="cuIcon-pullright"></text></view> -->
  97. </view>
  98. </template>
  99. <script>
  100. import res from '../../common/data.json';
  101. import drawer from '../../components/drawer/threeLineDrawer.vue';
  102. import plusDrawer from '../../components/drawer/plusDrawer.vue';
  103. import WeatherProphethomepage from '../../components/weatherProphethomepage/WeatherProphethomepage.vue';
  104. var _self;
  105. export default {
  106. components: {
  107. drawer: drawer,
  108. plusDrawer: plusDrawer,
  109. WeatherProphethomepage:WeatherProphethomepage
  110. },
  111. data: function() {
  112. return {
  113. conflict:false,
  114. kg:true,
  115. leftNavigationtitle:'预测功能分组',
  116. leftbarkg:false,
  117. bs_computed:'',
  118. xtpl_computed:'',
  119. ssxy_computed:'',
  120. szxy_computed:'',
  121. pld_computed:'',
  122. xynd_computed:'',
  123. WeatherProphethomepagebool:true,
  124. toggleSwitch:false,
  125. menuKey:1,
  126. pointKey: 'MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0087',
  127. socketTask_bracelet: '',
  128. socketTask_close_bracelet: '',
  129. deviceName: 'Y1-A0BC',
  130. deviceNamePld: 'Y1-A0BC_PLD',
  131. deviceNameBs: 'Y1-A0BC_BS',
  132. deviceNameSsxy: 'Y1-A0BC_SSXY',
  133. deviceNameXtpl: 'Y1-A0BC_XTPL',
  134. deviceNameXynd: 'Y1-A0BC_XYND',
  135. deviceNameSzxy: 'Y1-A0BC_SZXY',
  136. deviceNameLng: 'Y1-A0BC_LNG',
  137. deviceNameLat: 'Y1-A0BC_LAT',
  138. bracelet: {
  139. deviceName: '',
  140. deviceNamePld: '',
  141. deviceNameBs: '',
  142. deviceNameSsxy: '',
  143. deviceNameXtpl: '',
  144. deviceNameXynd: '',
  145. deviceNameSzxy: '',
  146. },
  147. braceletCurve: {},
  148. mapBegin_1:'',
  149. mapEnd_1:'',
  150. mapBegin_2:'',
  151. mapEnd_2:'',
  152. points:[
  153. {
  154. latitude:'',
  155. longitude:''
  156. },
  157. {
  158. latitude:'',
  159. longitude:''
  160. }
  161. ],
  162. list:{},
  163. braceletCurve_SSXY: [],
  164. braceletCurve_PLD: [],
  165. braceletCurve_SZXY: [],
  166. braceletCurve_XTPL: [],
  167. braceletCurve_BS: [],
  168. braceletCurve_XYND: [],
  169. braceletCurve_LNG: [],
  170. braceletCurve_LAT: [],
  171. /* targetdetail_visable: { targetdetail_target: true, targetdetail_curve: true, targetdetail_histogram: true},
  172. targetdetail: { targetdetail_target: '', targetdetail_curve: '', targetdetail_histogram: ''}, */
  173. targetName: '日发电量',
  174. targetUnit: '万kwh',
  175. bool:true,
  176. pld: '',
  177. ssxy: '',
  178. lng: '',
  179. szxy: '',
  180. lat: '',
  181. xtpl: '',
  182. bs: '',
  183. xynd: '',
  184. device_nam: '',
  185. title: 'map',
  186. latitude: 39.907,//定位中心
  187. longitude: 116.39742,//
  188. covers: [
  189. {
  190. latitude:39.909 , //纬度坐标点
  191. longitude:116.39742 , //经度
  192. iconPath: '../../static/picture/forcast/DingWei.png', //显示的图标
  193. title: '阿打算', //标注点名
  194. label: {
  195. //为标记点旁边增加标签
  196. content: '', //文本1
  197. color: '#F76350', //文本颜色
  198. anchorX: 0, //label的坐标,原点是 marker 对应的经纬度
  199. anchorY: -80, //label的坐标,原点是 marker 对应的经纬度
  200. // x:39.909,//这个组件微信在1.2.0以后就废弃了
  201. // y:116.39742,
  202. bgColor: '#fff', //背景色
  203. padding: 5, //文本边缘留白
  204. borderWidth: 1, //边框宽度
  205. borderColor: '#D84C29', //边框颜色
  206. textAlign: 'right' //文本对齐方式。
  207. },
  208. callout: {
  209. //自定义标记点上方的气泡窗口 点击有效
  210. content: '地点1',
  211. color: '#F76350',
  212. fontSize: 12,
  213. borderRadius: 5
  214. }
  215. // anchor:{//经纬度在标注图标的锚点,默认底边中点
  216. // x:5,
  217. // y:1,
  218. // }
  219. } , {
  220. latitude:39.90 ,//最后点
  221. longitude: 116.399,//
  222. iconPath: '../../static/picture/forcast/DingWei.png',
  223. title:'阿迪达斯',
  224. x:'',//
  225. y: '',//116.399
  226. label:{
  227. content:'',
  228. color:'#F76350',
  229. bgColor:'#fff',
  230. padding:5,
  231. borderRadius:4,
  232. },
  233. callout:{
  234. content:'地点2',
  235. color:'#F76350',
  236. fontSize:12
  237. }
  238. }
  239. ],
  240. scale: 15, //地图层级
  241. controls: [
  242. {
  243. //在地图上显示控件,控件不随着地图移动
  244. id: 1, //控件id
  245. /* iconPath: '../../static/picture/forcast/DingWei.png', *///显示的图标
  246. position: {
  247. //控件在地图的位置
  248. left: 15,
  249. top: 15,
  250. width: 40,
  251. height: 40
  252. }
  253. }
  254. ],
  255. circles: [
  256. {
  257. //在地图上显示圆
  258. latitude: 39.9,
  259. longitude: 116.39,
  260. fillColor: '#FFC41F', //填充颜色
  261. color: '#12A1DD', //描边的颜色
  262. radius: 0, //半径
  263. strokeWidth: 2 //描边的宽度
  264. }
  265. ],
  266. polyline: [
  267. { /* .polyline[0].points */
  268. points:[{}],
  269. //指定一系列坐标点,从数组第一项连线至最后一项
  270. /* points: [{ latitude:this.mapBegin_1, longitude:this.mapBegin_2 }, { latitude: this.mapEnd_1, longitude:this.mapEnd_2 }], */
  271. /* points: [{ latitude: 0, longitude: 0 }, { latitude: 0, longitude: 0 }], */
  272. color: '#0000AA', //线的颜色
  273. width: 2, //线的宽度
  274. dottedLine: true, //是否虚线
  275. arrowLine: true //带箭头的线 开发者工具暂不支持该属性
  276. }
  277. ],
  278. badge: 22,
  279. inconList: ['form', 'favor', 'question', 'edit'],
  280. modalName: null,
  281. address: '',
  282. drawerList: [],
  283. plusDrawerList: [],
  284. permissionsInformation:[]
  285. };
  286. },
  287. mounted() {
  288. //document.querySelector('body').setAttribute('style', 'background-color:#000000');
  289. },created: function() {
  290. // this.pushWindPowerStationNameToSessionStorage("麻黄山");
  291. this.viewUserid();
  292. this.monitoringAuthority();
  293. this.address = this.dataprocessing.getWindPowerStationName();
  294. this.FDC=this.dataprocessing.getWindPowerStationId();
  295. this.windPowerStationId =this.dataprocessing.getWindPowerStationId();
  296. this.$nextTick(function() {
  297. //this.getWeatherDataToday();
  298. //this.getWeatherData7();
  299. });
  300. this.cWidth = uni.upx2px(2000);
  301. this.cHeight = uni.upx2px(350);
  302. this.cWidth40 = uni.upx2px(5000);
  303. this.cHeight40 = uni.upx2px(350);
  304. this.windStation =this.dataprocessing.getWindPowerStationNameByNames(this.address);
  305. this.windStationName = this.windStation[0].replace('风电场', '');
  306. },
  307. onLoad(pointKey) {
  308. let _this = this;
  309. this.pointKey = pointKey.pointKey;
  310. this.targetName = pointKey.callTargetName;
  311. this.targetUnit = pointKey.callTargetUnit;
  312. this.braceletData();
  313. /* console.log(_this.bracelet[_this.deviceName]);
  314. console.log(_this.bracelet[_this.deviceName][_this.targetName_pld][0]); */
  315. /* uni.getLocation({//获取当前的位置坐标
  316. type: 'wgs84',
  317. success: function (res) {
  318. console.log('当前位置的经度:' + res.longitude);
  319. console.log('当前位置的纬度:' + res.latitude);
  320. }
  321. }); */
  322. },
  323. onReady() {},
  324. computed: {
  325. targetName_xtpl: function() {
  326. return this.deviceName + '_XTPL';
  327. },
  328. targetName_xtpl_size: function() {
  329. return this.bracelet[this.deviceName][this.targetName_xtpl].length - 1;
  330. },
  331. targetName_pld: function() {
  332. return this.deviceName + '_PLD';
  333. },
  334. targetName_pld_size: function() {
  335. return this.bracelet[this.deviceName][this.targetName_pld].length - 1;
  336. },
  337. targetName_bs: function() {
  338. return this.deviceName + '_BS';
  339. },
  340. targetName_bs_size: function() {
  341. return this.bracelet[this.deviceName][this.targetName_bs].length - 1;
  342. },
  343. targetName_ssxy: function() {
  344. return this.deviceName + '_SSXY';
  345. },
  346. targetName_ssxy_size: function() {
  347. return this.bracelet[this.deviceName][this.targetName_ssxy].length - 1;
  348. },
  349. targetName_szxy: function() {
  350. return this.deviceName + '_SZXY';
  351. },
  352. targetName_szxy_size: function() {
  353. return this.bracelet[this.deviceName][this.targetName_szxy].length - 1;
  354. },
  355. targetName_xynd: function() {
  356. return this.deviceName + '_XYND';
  357. },
  358. targetName_xynd_size: function() {
  359. return this.bracelet[this.deviceName][this.targetName_xynd].length - 1;
  360. },
  361. backStageIp: function() {
  362. return this.$store.state.wholeSituationBackStageIp;
  363. },
  364. backStagePort: function() {
  365. return this.$store.state.wholeSituationBackStagePort;
  366. },
  367. windpowerstationNameToId: function() {
  368. return this.$store.state.windpowerstationNameToId;
  369. }
  370. },
  371. methods: {
  372. viewUserid: function() {
  373. this.plusDrawerList=uni.getStorageSync('plusList');
  374. },
  375. monitoringAuthority: function() {
  376. this.drawerList=uni.getStorageSync('leftlist3');
  377. },
  378. mapdelete(){
  379. //#ifdef H5
  380. if(this.bool){
  381. this.$delete(this.polyline[0],'points');
  382. this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
  383. this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
  384. this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
  385. this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
  386. this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
  387. this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
  388. for(let val of this.polyline){
  389. this.$set(val,'points',this.points);
  390. this.bool = false;
  391. console.log("true");
  392. }
  393. /* 定义地图经纬度中心 */
  394. var lat= parseFloat(this.mapBegin_2)+parseFloat(this.mapEnd_2);
  395. var lng= parseFloat(this.mapBegin_1)+parseFloat(this.mapEnd_1);
  396. this.latitude = lat/2;
  397. this.longitude = lng/2;
  398. }else{
  399. /* this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
  400. this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
  401. this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
  402. this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
  403. this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
  404. this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
  405. */
  406. /* this.$replace(this.polyline[0],'points'); */
  407. /* this.latitude = this.mapBegin_2+this.mapEnd_2/2;
  408. this.longitude = this.mapBegin_1+this.mapEnd_1/2; */
  409. console.log("false");
  410. /* 还原定位中心位置 */
  411. this.latitude = this.mapBegin_2;
  412. this.longitude = this.mapBegin_1;
  413. this.bool = true;
  414. }
  415. this.$forceUpdate();
  416. //#endif
  417. //#ifdef APP-PLUS
  418. if(this.bool){
  419. this.$delete(this.polyline[0],'points');
  420. this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
  421. this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
  422. this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
  423. this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
  424. this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
  425. this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
  426. for(let val of this.polyline){
  427. this.$set(val,'points',this.points);
  428. this.bool = false;
  429. console.log("true");
  430. }
  431. /* 定义地图经纬度中心 */
  432. var lat= parseFloat(this.mapBegin_2)+parseFloat(this.mapEnd_2);
  433. var lng= parseFloat(this.mapBegin_1)+parseFloat(this.mapEnd_1);
  434. this.latitude = lat/2;
  435. this.longitude = lng/2;
  436. }else{
  437. /* this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
  438. this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
  439. this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
  440. this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
  441. this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
  442. this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value;
  443. */
  444. this.$delete(this.polyline[0],'points');
  445. /* this.latitude = this.mapBegin_2+this.mapEnd_2/2;
  446. this.longitude = this.mapBegin_1+this.mapEnd_1/2; */
  447. console.log("false");
  448. /* 还原定位中心位置 */
  449. this.latitude = this.mapBegin_2;
  450. this.longitude = this.mapBegin_1;
  451. this.bool = true;
  452. }
  453. this.$forceUpdate();
  454. //#endif
  455. },
  456. mapDate(){
  457. },
  458. openDrawer: function() {
  459. this.monitoringAuthority();
  460. this.kg=false;
  461. if(this.$refs.drawer != undefined){
  462. this.$refs.drawer.openDrawer(250, this.drawerList, this.inconList,this.leftNavigationtitle);
  463. }else{
  464. }
  465. },
  466. closeDrawer: function() {
  467. this.drawerIsShow = false;
  468. },
  469. pushWindPowerStationNameToSessionStorage(windpowerstationName) {
  470. uni.setStorageSync('windpowerstationName', windpowerstationName);
  471. //sessionStorage.setItem('windpowerstationName', windpowerstationName);
  472. //alert("v"+ sessionStorage.getItem("windpowerstationName"));
  473. //this.common.goback('/pages/index/Index');
  474. },
  475. getWindPowerStationNameToSessionStorage() {
  476. uni.getStorageSync('windpowerstationName');
  477. return uni.getStorageSync('windpowerstationName');
  478. },
  479. leftbar(){
  480. this.kg=true;
  481. },
  482. onHide() {
  483. this.$refs.drawer.closeDrawer();
  484. this.hideModal();
  485. },
  486. onShow: function() {
  487. this.leftbar();
  488. this.windPowerStationId = uni.getStorageSync('windPowerStationId');
  489. this.address = this.getWindPowerStationNameToSessionStorage();
  490. this.viewUserid();
  491. this.monitoringAuthority();
  492. },
  493. showModal(e) {
  494. this.conflict = true;
  495. this.viewUserid();
  496. this.kg=false;
  497. this.modalName = e.currentTarget.dataset.target;
  498. this.$refs.plusDrawer.showModal(this.plusDrawerList, this.modalName);
  499. },
  500. hideModal() {
  501. this.conflict = false;
  502. this.leftbar();
  503. this.modalName = null;
  504. //this.$refs.plusDrawer.hideModal(this.modalName);
  505. },
  506. braceletData() {
  507. let _this = this;
  508. let ip;
  509. uni.request({
  510. url: 'http://' + _this.backStageIp + ':' + _this.backStagePort + '/bracelet/bracelet?beginDate=2020-04-20%2009:26:27&&endDate=2020-04-25%2009:26:29',
  511. success: res => {
  512. ip = res.data;
  513. }
  514. });
  515. // 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
  516. this.socketTask_bracelet = uni.connectSocket({
  517. /* 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】 */
  518. url: 'ws://' + _this.backStageIp + ':' + _this.backStagePort + '/websocket/pageNumber_9/functionNumber_1/all',
  519. success(data) {
  520. console.log('websocket连接成功');
  521. }
  522. });
  523. // 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
  524. this.socketTask_bracelet.onOpen(res => {
  525. console.log('WebSocket连接正常打开中...!');
  526. _this.is_open_socket = true;
  527. // 注:只有连接正常打开中 ,才能正常收到消息
  528. _this.socketTask_bracelet.onMessage(res => {
  529. //console.log("收到服务器内容:" + res.data);
  530. _this.bracelet = JSON.parse(res.data)[ip];
  531. _this.braceletCurve = JSON.stringify(_this.bracelet[_this.deviceName]);
  532. /* 获取起始经纬度 */
  533. _this.braceletCurve_LNG = _this.bracelet[_this.deviceName][_this.deviceNameLng];
  534. _this.braceletCurve_LAT = _this.bracelet[_this.deviceName][_this.deviceNameLat];
  535. _this.mapBegin_1 = (_this.bracelet[_this.deviceName][_this.deviceNameLng][0].value);
  536. _this.mapBegin_2 = (_this.bracelet[_this.deviceName][_this.deviceNameLat][0].value);
  537. _this.mapEnd_1 = (_this.bracelet[_this.deviceName][_this.deviceNameLng][_this.braceletCurve_LNG.length-1].value);
  538. _this.mapEnd_2 = (_this.bracelet[_this.deviceName][_this.deviceNameLat][_this.braceletCurve_LAT.length-1].value);
  539. _this.latitude = _this.mapBegin_2;
  540. _this.longitude = _this.mapBegin_1;
  541. _this.covers[0].latitude = _this.mapBegin_2;
  542. _this.covers[0].longitude = _this.mapBegin_1;
  543. _this.covers[1].latitude = _this.mapEnd_2;
  544. _this.covers[1].longitude = _this.mapEnd_1;
  545. _this.bs_computed = _this.bracelet[_this.deviceName][_this.targetName_bs][_this.targetName_bs_size].value;
  546. _this.xtpl_computed = _this.bracelet[_this.deviceName][_this.targetName_xtpl][_this.targetName_xtpl_size].value;
  547. _this.ssxy_computed = _this.bracelet[_this.deviceName][_this.targetName_ssxy][_this.targetName_ssxy_size].value;
  548. _this.szxy_computed = _this.bracelet[_this.deviceName][_this.targetName_szxy][_this.targetName_szxy_size].value;
  549. _this.pld_computed = _this.bracelet[_this.deviceName][_this.targetName_pld][_this.targetName_pld_size].value;
  550. _this.xynd_computed = _this.bracelet[_this.deviceName][_this.targetName_xynd][_this.targetName_xynd_size].value;
  551. /* this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
  552. this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
  553. this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
  554. this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
  555. this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
  556. this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value; */
  557. /* _this.mapDate(); */
  558. /* _this.polyline[0].points[0].latitude=_this.mapBegin_2;
  559. _this.polyline[0].points[0].longitude=_this.mapBegin_1;
  560. _this.polyline[0].points[1].latitude=_this.mapEnd_2;
  561. _this.polyline[0].points[1].longitude=_this.mapEnd_1; */
  562. /* _this.braceletCurve_SSXY = _this.bracelet[_this.deviceName][_this.deviceNameSsxy];
  563. _this.braceletCurve_SZXY = _this.bracelet[_this.deviceName][_this.deviceNameSzxy];
  564. _this.braceletCurve_XYND = _this.bracelet[_this.deviceName][_this.deviceNameXynd];
  565. _this.braceletCurve_XTPL = _this.bracelet[_this.deviceName][_this.deviceNameXtpl];
  566. _this.braceletCurve_BS = _this.bracelet[_this.deviceName][_this.deviceNameBs];
  567. console.log(_this.braceletCurve_BS[0].value); */
  568. });
  569. });
  570. // 这里仅是事件监听【如果socket关闭了会执行】
  571. this.socketTask_bracelet.onClose(() => {
  572. uni.request({
  573. url: 'http://' + _this.backStageIp + ':' + _this.backStagePort + '/bracelet/close_bracelet?pointKey=' + _this.pointKey,
  574. success: res => {}
  575. });
  576. });
  577. }
  578. }
  579. };
  580. </script>
  581. <style>
  582. body {
  583. font-family: '方正兰亭细黑_GBK';
  584. font-size: 15px;
  585. color: silver;
  586. background: #000;
  587. }
  588. @font-face {
  589. font-family: '方正兰亭细黑_GBK';
  590. src: url(../../static/fzltxh.TTF);
  591. }
  592. .content{
  593. //background-color: #000000;
  594. }
  595. page {
  596. background-color: #1f1f1f;
  597. font-family: '方正兰亭细黑_GBK';
  598. overflow-x: hidden;
  599. }
  600. .top {
  601. width: 100%;
  602. height: 130upx;
  603. padding-top: 5upx;
  604. background-color: #1f1f1f;
  605. position: fixed;
  606. top: 0px;
  607. left: 0px;
  608. z-index: 100;
  609. }
  610. .threeLine {
  611. width: 50px;
  612. height: 45px;
  613. float: left;
  614. }
  615. .text {
  616. width: calc(100% - 100px);
  617. height: 45px;
  618. float: left;
  619. user-select: text;
  620. -webkit-user-select: text;
  621. -moz-user-select: text;
  622. -ms-user-select: text;
  623. color: silver;
  624. line-height: 45px;
  625. margin-top: 11px;
  626. font-size: 18px;
  627. }
  628. .notice {
  629. width: 50px;
  630. height: 45px;
  631. float: left;
  632. }
  633. .plus {
  634. width: 30px;
  635. height: 45px;
  636. float: right;
  637. color: white;
  638. font-size: 35px;
  639. line-height: 45px;
  640. text-align: right;
  641. margin-right: 2.5%;
  642. }
  643. .textWindpowerstation {
  644. width: 180px;
  645. height: 45px;
  646. float: left;
  647. text-align: center;
  648. margin-left: 18px;
  649. }
  650. .InformationCard {
  651. position: absolute;
  652. top: 50px;
  653. left: 0px;
  654. margin-top: 0px;
  655. width: 50%;
  656. height: 8%;
  657. background: rgba(0, 0, 0, 0);
  658. float: left;
  659. }
  660. .informationCardAll {
  661. width: 95%;
  662. margin-left: 2.5%;
  663. margin-top: 10px;
  664. height: 60px;
  665. float: left;
  666. }
  667. .informationCardTextOne {
  668. width: 100%;
  669. height: 35px;
  670. float: left;
  671. margin-top: -10px;
  672. }
  673. .informationCardText {
  674. /* margin-left: 2%; */
  675. width: 65px;
  676. height: 35px;
  677. line-height: 35px;
  678. user-select: text;
  679. -webkit-user-select: text;
  680. -moz-user-select: text;
  681. -ms-user-select: text;
  682. color: silver;
  683. font-size: 10px;
  684. transform: scale(0.975);
  685. float: left;
  686. font-weight: 1000;
  687. }
  688. .textSilver {
  689. user-select: text;
  690. -webkit-user-select: text;
  691. -moz-user-select: text;
  692. -ms-user-select: text;
  693. color: black;
  694. float: left;
  695. }
  696. .textWhite {
  697. color: black;
  698. float: right;
  699. width: 24px;
  700. font-size: 10px;
  701. margin-right: 13%;
  702. transform: scale(0.975);
  703. /* text-align: right; */
  704. }
  705. .Personal_information_W {
  706. position: relative;
  707. /* margin-top: 3%; */
  708. width: 90%;
  709. height: 80px;/*
  710. background-color: #242424; */
  711. border-bottom: #BDBDBD solid 0.5px;
  712. transform: translateX(-50%);
  713. left: 50%;
  714. color: #B8B7B7;
  715. }
  716. .name{
  717. position: absolute;
  718. height: 30px;
  719. width: 130px;
  720. left: 3%;
  721. /* background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%); */
  722. text-align: left;
  723. line-height: 30px;
  724. margin-top: 1%;
  725. font-weight: 1000;
  726. }
  727. .history {
  728. position: absolute;
  729. margin-top: 6%;
  730. right: 3%;
  731. height: 30px;
  732. height: 20px;
  733. text-align: center;
  734. line-height: 30px;
  735. }
  736. .skills {
  737. position: absolute;
  738. top: 56%;
  739. left: 3%;
  740. height: 25px;
  741. width: 180px;/*
  742. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%); */
  743. text-align: left;
  744. line-height: 30px;
  745. }
  746. .curve{
  747. position: relative;
  748. width: 90%;
  749. transform: translateX(-50%);
  750. left: 50%;
  751. height: 30px;
  752. margin-top: 3%;
  753. color: #B8B7B7;
  754. font-weight: 1000;
  755. }
  756. .curve_l{
  757. position: absolute;
  758. left: 3%;
  759. }
  760. .curve_r{
  761. position: absolute;
  762. right: 3%;
  763. }
  764. .healthy {
  765. margin-left: 3%;
  766. height: 180px;
  767. width: 95%;
  768. margin-bottom: 100px;
  769. text-align: center;
  770. color: #B8B7B7;
  771. font-size: 12px;
  772. line-height:65px ;
  773. font-weight: 1000;
  774. }
  775. .healthy_H,
  776. .healthy_N,
  777. .healthy_W {
  778. background-color:#242424;
  779. position: relative;
  780. width: 100%;
  781. height: 42%;
  782. text-align: center;
  783. /* padding-bottom: 1%; */
  784. }
  785. .details_z {
  786. position: absolute;
  787. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  788. width: 30%;
  789. left:3%;
  790. height: 60px;
  791. top: 3%;
  792. margin-top: 2%;
  793. }
  794. .details_m {
  795. position: absolute;
  796. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  797. width: 30%;
  798. left: 35.5%;
  799. height: 60px;
  800. top: 3%;
  801. margin-top: 2%;
  802. }
  803. .details_y {
  804. position: absolute;
  805. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  806. width: 30%;
  807. left: 68%;
  808. height: 60px;
  809. top: 3%;
  810. margin-top: 2%;
  811. /* margin-bottom: 0.6%;
  812. margin-top: 0.6%;
  813. float: right;
  814. margin-left: 0.2%;
  815. margin-right: 1.2%;
  816. width: 31%;
  817. height: 100%;
  818. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  819. color: silver;
  820. text-align: center;
  821. padding-top: 10px;
  822. background-color: #ffffff;
  823. font-size: 12px;
  824. padding-bottom: 4px;
  825. line-height: 13px;
  826. border-radius: 5px;
  827. padding-top: 8px; */
  828. }
  829. .navigation::after {
  830. content: url(../../static/picture/forcast/position.png);
  831. }
  832. /* .greater {
  833. position: relative;
  834. width: 249px;
  835. height: 35px;
  836. border: 1px solid #000;
  837. } */
  838. .greater{
  839. float: right;
  840. content: "";
  841. margin-top: 0.8%;
  842. margin-right: 0.8%;
  843. /* position: absolute; */
  844. /* top: 8px;
  845. right: 15px; */
  846. width: 8px;
  847. height: 8px;
  848. border-right: 2px solid #fff;
  849. border-bottom: 2px solid #fff;
  850. transform: rotate(-45deg);
  851. }
  852. .windStationNameAndChoice {
  853. clear: both;
  854. width: 100%;
  855. height: 30px;
  856. margin-top: 1%;
  857. color: silver;
  858. /* border: 1px solid red; */
  859. }
  860. .windStationName {
  861. width: 50%;
  862. height: 100%;
  863. float: left;
  864. line-height: 30px;
  865. font-size: 14px;
  866. margin-left: 9.5%;
  867. }
  868. .windStationChoice {
  869. width: 20%;
  870. height: 100%;
  871. float: right;
  872. text-align: right;
  873. line-height: 30px;
  874. font-size: 14px;
  875. margin-right: 5%;
  876. }
  877. .s-popup-wrapper {
  878. width: 500rpx;
  879. background-color: #f0f0f0;
  880. }
  881. .s-popup-title {
  882. width: 100%;
  883. height: 50px;
  884. background-color: #211E21;
  885. }
  886. .s-popup-word {
  887. width: calc(100% - 65px);
  888. height: 50px;
  889. font-size: 14px;
  890. color: white;
  891. line-height: 50px;
  892. float: left;
  893. margin-left: 25px;
  894. }
  895. .s-popup-cha {
  896. width: 40px;
  897. height: 50px;
  898. text-align: center;
  899. line-height: 50px;
  900. float: right;
  901. font-size: 24px;
  902. }
  903. .windStationItemContainer {
  904. width: 100%;
  905. }
  906. .windStationItemContainerBlack {
  907. width: 100%;
  908. background-color: grey;
  909. color: white;
  910. }
  911. .windStationItem {
  912. width: 80%;
  913. height: 50px;
  914. border-bottom: 1px solid #c8c8c8;
  915. text-align: left;
  916. line-height: 50px;
  917. margin-left: 10%;
  918. color: #333333;
  919. }
  920. .DrawerPage {
  921. position: fixed;
  922. width: 100vw;
  923. height: 100vh;
  924. left: 0vw;
  925. background-color: #1f1f1f;
  926. transition: all 0.4s;
  927. }
  928. .DrawerPage.show {
  929. transform: scale(0.9, 0.9);
  930. left: 85vw;
  931. box-shadow: 0 0 60upx rgba(0, 0, 0, 0.2);
  932. transform-origin: 0;
  933. }
  934. .DrawerPage .cu-bar.tabbar .action button.cuIcon {
  935. width: 64upx;
  936. height: 64upx;
  937. line-height: 64upx;
  938. margin: 0;
  939. display: inline-block;
  940. }
  941. .DrawerPage .cu-bar.tabbar .action .cu-avatar {
  942. margin: 0;
  943. }
  944. .DrawerPage .nav {
  945. flex: 1;
  946. }
  947. .DrawerPage .nav .cu-item.cur {
  948. border-bottom: 0;
  949. position: relative;
  950. }
  951. .DrawerPage .nav .cu-item.cur::after {
  952. content: '';
  953. width: 10upx;
  954. height: 10upx;
  955. background-color: currentColor;
  956. position: absolute;
  957. bottom: 10upx;
  958. border-radius: 10upx;
  959. left: 0;
  960. right: 0;
  961. margin: auto;
  962. }
  963. .DrawerPage .cu-bar.tabbar .action {
  964. flex: initial;
  965. }
  966. </style>