Forecast.vue 33 KB

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