Forecast.vue 32 KB

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