Forecast.vue 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082
  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. console.log('雷霆嘎巴');
  465. }
  466. },
  467. closeDrawer: function() {
  468. this.drawerIsShow = false;
  469. },
  470. pushWindPowerStationNameToSessionStorage(windpowerstationName) {
  471. uni.setStorageSync('windpowerstationName', windpowerstationName);
  472. //sessionStorage.setItem('windpowerstationName', windpowerstationName);
  473. //alert("v"+ sessionStorage.getItem("windpowerstationName"));
  474. //this.common.goback('/pages/index/Index');
  475. },
  476. getWindPowerStationNameToSessionStorage() {
  477. uni.getStorageSync('windpowerstationName');
  478. return uni.getStorageSync('windpowerstationName');
  479. },
  480. leftbar(){
  481. this.kg=true;
  482. },
  483. onHide() {
  484. this.$refs.drawer.closeDrawer();
  485. this.hideModal();
  486. },
  487. onShow: function() {
  488. this.leftbar();
  489. this.windPowerStationId = uni.getStorageSync('windPowerStationId');
  490. this.address = this.getWindPowerStationNameToSessionStorage();
  491. this.viewUserid();
  492. this.monitoringAuthority();
  493. },
  494. showModal(e) {
  495. this.conflict = true;
  496. this.viewUserid();
  497. this.kg=false;
  498. this.modalName = e.currentTarget.dataset.target;
  499. this.$refs.plusDrawer.showModal(this.plusDrawerList, this.modalName);
  500. },
  501. hideModal() {
  502. this.conflict = false;
  503. this.leftbar();
  504. this.modalName = null;
  505. //this.$refs.plusDrawer.hideModal(this.modalName);
  506. },
  507. braceletData() {
  508. let _this = this;
  509. let ip;
  510. uni.request({
  511. url: 'http://' + _this.backStageIp + ':' + _this.backStagePort + '/bracelet/bracelet?beginDate=2020-04-20%2009:26:27&&endDate=2020-04-25%2009:26:29',
  512. success: res => {
  513. ip = res.data;
  514. }
  515. });
  516. // 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
  517. this.socketTask_bracelet = uni.connectSocket({
  518. /* 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】 */
  519. url: 'ws://' + _this.backStageIp + ':' + _this.backStagePort + '/websocket/pageNumber_9/functionNumber_1/all',
  520. success(data) {
  521. console.log('websocket连接成功');
  522. }
  523. });
  524. // 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
  525. this.socketTask_bracelet.onOpen(res => {
  526. console.log('WebSocket连接正常打开中...!');
  527. _this.is_open_socket = true;
  528. // 注:只有连接正常打开中 ,才能正常收到消息
  529. _this.socketTask_bracelet.onMessage(res => {
  530. //console.log("收到服务器内容:" + res.data);
  531. _this.bracelet = JSON.parse(res.data)[ip];
  532. _this.braceletCurve = JSON.stringify(_this.bracelet[_this.deviceName]);
  533. /* 获取起始经纬度 */
  534. _this.braceletCurve_LNG = _this.bracelet[_this.deviceName][_this.deviceNameLng];
  535. _this.braceletCurve_LAT = _this.bracelet[_this.deviceName][_this.deviceNameLat];
  536. _this.mapBegin_1 = (_this.bracelet[_this.deviceName][_this.deviceNameLng][0].value);
  537. _this.mapBegin_2 = (_this.bracelet[_this.deviceName][_this.deviceNameLat][0].value);
  538. _this.mapEnd_1 = (_this.bracelet[_this.deviceName][_this.deviceNameLng][_this.braceletCurve_LNG.length-1].value);
  539. _this.mapEnd_2 = (_this.bracelet[_this.deviceName][_this.deviceNameLat][_this.braceletCurve_LAT.length-1].value);
  540. _this.latitude = _this.mapBegin_2;
  541. _this.longitude = _this.mapBegin_1;
  542. _this.covers[0].latitude = _this.mapBegin_2;
  543. _this.covers[0].longitude = _this.mapBegin_1;
  544. _this.covers[1].latitude = _this.mapEnd_2;
  545. _this.covers[1].longitude = _this.mapEnd_1;
  546. _this.bs_computed = _this.bracelet[_this.deviceName][_this.targetName_bs][_this.targetName_bs_size].value;
  547. _this.xtpl_computed = _this.bracelet[_this.deviceName][_this.targetName_xtpl][_this.targetName_xtpl_size].value;
  548. _this.ssxy_computed = _this.bracelet[_this.deviceName][_this.targetName_ssxy][_this.targetName_ssxy_size].value;
  549. _this.szxy_computed = _this.bracelet[_this.deviceName][_this.targetName_szxy][_this.targetName_szxy_size].value;
  550. _this.pld_computed = _this.bracelet[_this.deviceName][_this.targetName_pld][_this.targetName_pld_size].value;
  551. _this.xynd_computed = _this.bracelet[_this.deviceName][_this.targetName_xynd][_this.targetName_xynd_size].value;
  552. /* this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
  553. this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
  554. this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
  555. this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
  556. this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
  557. this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value; */
  558. /* _this.mapDate(); */
  559. /* _this.polyline[0].points[0].latitude=_this.mapBegin_2;
  560. _this.polyline[0].points[0].longitude=_this.mapBegin_1;
  561. _this.polyline[0].points[1].latitude=_this.mapEnd_2;
  562. _this.polyline[0].points[1].longitude=_this.mapEnd_1; */
  563. /* _this.braceletCurve_SSXY = _this.bracelet[_this.deviceName][_this.deviceNameSsxy];
  564. _this.braceletCurve_SZXY = _this.bracelet[_this.deviceName][_this.deviceNameSzxy];
  565. _this.braceletCurve_XYND = _this.bracelet[_this.deviceName][_this.deviceNameXynd];
  566. _this.braceletCurve_XTPL = _this.bracelet[_this.deviceName][_this.deviceNameXtpl];
  567. _this.braceletCurve_BS = _this.bracelet[_this.deviceName][_this.deviceNameBs];
  568. console.log(_this.braceletCurve_BS[0].value); */
  569. });
  570. });
  571. // 这里仅是事件监听【如果socket关闭了会执行】
  572. this.socketTask_bracelet.onClose(() => {
  573. uni.request({
  574. url: 'http://' + _this.backStageIp + ':' + _this.backStagePort + '/bracelet/close_bracelet?pointKey=' + _this.pointKey,
  575. success: res => {}
  576. });
  577. });
  578. }
  579. }
  580. };
  581. </script>
  582. <style>
  583. body {
  584. font-family: '方正兰亭细黑_GBK';
  585. font-size: 15px;
  586. color: silver;
  587. background: #000;
  588. }
  589. @font-face {
  590. font-family: '方正兰亭细黑_GBK';
  591. src: url(../../static/fzltxh.TTF);
  592. }
  593. .content{
  594. //background-color: #000000;
  595. }
  596. page {
  597. background-color: #1f1f1f;
  598. font-family: '方正兰亭细黑_GBK';
  599. overflow-x: hidden;
  600. }
  601. .top {
  602. width: 100%;
  603. height: 130upx;
  604. padding-top: 5upx;
  605. background-color: #1f1f1f;
  606. position: fixed;
  607. top: 0px;
  608. left: 0px;
  609. z-index: 100;
  610. }
  611. .threeLine {
  612. width: 50px;
  613. height: 45px;
  614. float: left;
  615. }
  616. .text {
  617. width: calc(100% - 100px);
  618. height: 45px;
  619. float: left;
  620. user-select: text;
  621. -webkit-user-select: text;
  622. -moz-user-select: text;
  623. -ms-user-select: text;
  624. color: silver;
  625. line-height: 45px;
  626. margin-top: 11px;
  627. font-size: 18px;
  628. }
  629. .notice {
  630. width: 50px;
  631. height: 45px;
  632. float: left;
  633. }
  634. .plus {
  635. width: 30px;
  636. height: 45px;
  637. float: right;
  638. color: white;
  639. font-size: 35px;
  640. line-height: 45px;
  641. text-align: right;
  642. margin-right: 2.5%;
  643. }
  644. .textWindpowerstation {
  645. width: 180px;
  646. height: 45px;
  647. float: left;
  648. text-align: center;
  649. margin-left: 18px;
  650. }
  651. .InformationCard {
  652. position: absolute;
  653. top: 50px;
  654. left: 0px;
  655. margin-top: 0px;
  656. width: 50%;
  657. height: 8%;
  658. background: rgba(0, 0, 0, 0);
  659. float: left;
  660. }
  661. .informationCardAll {
  662. width: 95%;
  663. margin-left: 2.5%;
  664. margin-top: 10px;
  665. height: 60px;
  666. float: left;
  667. }
  668. .informationCardTextOne {
  669. width: 100%;
  670. height: 35px;
  671. float: left;
  672. margin-top: -10px;
  673. }
  674. .informationCardText {
  675. /* margin-left: 2%; */
  676. width: 65px;
  677. height: 35px;
  678. line-height: 35px;
  679. user-select: text;
  680. -webkit-user-select: text;
  681. -moz-user-select: text;
  682. -ms-user-select: text;
  683. color: silver;
  684. font-size: 10px;
  685. transform: scale(0.975);
  686. float: left;
  687. font-weight: 1000;
  688. }
  689. .textSilver {
  690. user-select: text;
  691. -webkit-user-select: text;
  692. -moz-user-select: text;
  693. -ms-user-select: text;
  694. color: black;
  695. float: left;
  696. }
  697. .textWhite {
  698. color: black;
  699. float: right;
  700. width: 24px;
  701. font-size: 10px;
  702. margin-right: 13%;
  703. transform: scale(0.975);
  704. /* text-align: right; */
  705. }
  706. .Personal_information_W {
  707. position: relative;
  708. /* margin-top: 3%; */
  709. width: 90%;
  710. height: 80px;/*
  711. background-color: #242424; */
  712. border-bottom: #BDBDBD solid 0.5px;
  713. transform: translateX(-50%);
  714. left: 50%;
  715. color: #B8B7B7;
  716. }
  717. .name{
  718. position: absolute;
  719. height: 30px;
  720. width: 130px;
  721. left: 3%;
  722. /* background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%); */
  723. text-align: left;
  724. line-height: 30px;
  725. margin-top: 1%;
  726. font-weight: 1000;
  727. }
  728. .history {
  729. position: absolute;
  730. margin-top: 6%;
  731. right: 3%;
  732. height: 30px;
  733. height: 20px;
  734. text-align: center;
  735. line-height: 30px;
  736. }
  737. .skills {
  738. position: absolute;
  739. top: 56%;
  740. left: 3%;
  741. height: 25px;
  742. width: 180px;/*
  743. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%); */
  744. text-align: left;
  745. line-height: 30px;
  746. }
  747. .curve{
  748. position: relative;
  749. width: 90%;
  750. transform: translateX(-50%);
  751. left: 50%;
  752. height: 30px;
  753. margin-top: 3%;
  754. color: #B8B7B7;
  755. font-weight: 1000;
  756. }
  757. .curve_l{
  758. position: absolute;
  759. left: 3%;
  760. }
  761. .curve_r{
  762. position: absolute;
  763. right: 3%;
  764. }
  765. .healthy {
  766. margin-left: 3%;
  767. height: 180px;
  768. width: 95%;
  769. margin-bottom: 100px;
  770. text-align: center;
  771. color: #B8B7B7;
  772. font-size: 12px;
  773. line-height:65px ;
  774. font-weight: 1000;
  775. }
  776. .healthy_H,
  777. .healthy_N,
  778. .healthy_W {
  779. background-color:#242424;
  780. position: relative;
  781. width: 100%;
  782. height: 42%;
  783. text-align: center;
  784. /* padding-bottom: 1%; */
  785. }
  786. .details_z {
  787. position: absolute;
  788. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  789. width: 30%;
  790. left:3%;
  791. height: 60px;
  792. top: 3%;
  793. margin-top: 2%;
  794. }
  795. .details_m {
  796. position: absolute;
  797. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  798. width: 30%;
  799. left: 35.5%;
  800. height: 60px;
  801. top: 3%;
  802. margin-top: 2%;
  803. }
  804. .details_y {
  805. position: absolute;
  806. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  807. width: 30%;
  808. left: 68%;
  809. height: 60px;
  810. top: 3%;
  811. margin-top: 2%;
  812. /* margin-bottom: 0.6%;
  813. margin-top: 0.6%;
  814. float: right;
  815. margin-left: 0.2%;
  816. margin-right: 1.2%;
  817. width: 31%;
  818. height: 100%;
  819. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  820. color: silver;
  821. text-align: center;
  822. padding-top: 10px;
  823. background-color: #ffffff;
  824. font-size: 12px;
  825. padding-bottom: 4px;
  826. line-height: 13px;
  827. border-radius: 5px;
  828. padding-top: 8px; */
  829. }
  830. .navigation::after {
  831. content: url(../../static/picture/forcast/position.png);
  832. }
  833. /* .greater {
  834. position: relative;
  835. width: 249px;
  836. height: 35px;
  837. border: 1px solid #000;
  838. } */
  839. .greater{
  840. float: right;
  841. content: "";
  842. margin-top: 0.8%;
  843. margin-right: 0.8%;
  844. /* position: absolute; */
  845. /* top: 8px;
  846. right: 15px; */
  847. width: 8px;
  848. height: 8px;
  849. border-right: 2px solid #fff;
  850. border-bottom: 2px solid #fff;
  851. transform: rotate(-45deg);
  852. }
  853. .windStationNameAndChoice {
  854. clear: both;
  855. width: 100%;
  856. height: 30px;
  857. margin-top: 1%;
  858. color: silver;
  859. /* border: 1px solid red; */
  860. }
  861. .windStationName {
  862. width: 50%;
  863. height: 100%;
  864. float: left;
  865. line-height: 30px;
  866. font-size: 14px;
  867. margin-left: 9.5%;
  868. }
  869. .windStationChoice {
  870. width: 20%;
  871. height: 100%;
  872. float: right;
  873. text-align: right;
  874. line-height: 30px;
  875. font-size: 14px;
  876. margin-right: 5%;
  877. }
  878. .s-popup-wrapper {
  879. width: 500rpx;
  880. background-color: #f0f0f0;
  881. }
  882. .s-popup-title {
  883. width: 100%;
  884. height: 50px;
  885. background-color: #211E21;
  886. }
  887. .s-popup-word {
  888. width: calc(100% - 65px);
  889. height: 50px;
  890. font-size: 14px;
  891. color: white;
  892. line-height: 50px;
  893. float: left;
  894. margin-left: 25px;
  895. }
  896. .s-popup-cha {
  897. width: 40px;
  898. height: 50px;
  899. text-align: center;
  900. line-height: 50px;
  901. float: right;
  902. font-size: 24px;
  903. }
  904. .windStationItemContainer {
  905. width: 100%;
  906. }
  907. .windStationItemContainerBlack {
  908. width: 100%;
  909. background-color: grey;
  910. color: white;
  911. }
  912. .windStationItem {
  913. width: 80%;
  914. height: 50px;
  915. border-bottom: 1px solid #c8c8c8;
  916. text-align: left;
  917. line-height: 50px;
  918. margin-left: 10%;
  919. color: #333333;
  920. }
  921. .DrawerPage {
  922. position: fixed;
  923. width: 100vw;
  924. height: 100vh;
  925. left: 0vw;
  926. background-color: #1f1f1f;
  927. transition: all 0.4s;
  928. }
  929. .DrawerPage.show {
  930. transform: scale(0.9, 0.9);
  931. left: 85vw;
  932. box-shadow: 0 0 60upx rgba(0, 0, 0, 0.2);
  933. transform-origin: 0;
  934. }
  935. .DrawerPage .cu-bar.tabbar .action button.cuIcon {
  936. width: 64upx;
  937. height: 64upx;
  938. line-height: 64upx;
  939. margin: 0;
  940. display: inline-block;
  941. }
  942. .DrawerPage .cu-bar.tabbar .action .cu-avatar {
  943. margin: 0;
  944. }
  945. .DrawerPage .nav {
  946. flex: 1;
  947. }
  948. .DrawerPage .nav .cu-item.cur {
  949. border-bottom: 0;
  950. position: relative;
  951. }
  952. .DrawerPage .nav .cu-item.cur::after {
  953. content: '';
  954. width: 10upx;
  955. height: 10upx;
  956. background-color: currentColor;
  957. position: absolute;
  958. bottom: 10upx;
  959. border-radius: 10upx;
  960. left: 0;
  961. right: 0;
  962. margin: auto;
  963. }
  964. .DrawerPage .cu-bar.tabbar .action {
  965. flex: initial;
  966. }
  967. </style>