Forecast.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113
  1. <template>
  2. <view class="content" @click="closeDrawer">
  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="" 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"></drawer>
  25. </div>
  26. <div class="plusDrawer" @tap="hideModal">
  27. <plusDrawer ref="plusDrawer"></plusDrawer>
  28. </div>
  29. <scroll-view scroll-y :class="modalName == 'viewModal' ? 'show' : ''">
  30. <view >
  31. <!-- <div class="plusDrawer" @tap="hideModal"><plusDrawer ref="plusDrawer"></plusDrawer></div> -->
  32. <view class="page-body">
  33. <view class="page-section page-section-gap">
  34. <map style="width: 100%; height: 300px;"
  35. :controls="controls"
  36. :circles="circles"
  37. :polyline="polyline"
  38. :scale="scale"
  39. :latitude="latitude"
  40. :longitude="longitude"
  41. :markers="covers"
  42. >
  43. <!--
  44. <cover-view style="color: #000000;" > 经度:{{ mapEnd_1 }}</cover-view>
  45. <cover-view style="color: #000000;"> 纬度:{{ mapEnd_2 }}</cover-view> -->
  46. </map>
  47. </view>
  48. </view>
  49. </view>
  50. <!--经纬度组件-->
  51. <!-- <view class="InformationCard">
  52. <view class="informationCardAll">
  53. <view class="informationCardTextOne">
  54. <view class="informationCardText">
  55. <view class="textSilver">经度:</view>
  56. <view class="textWhite">{{ mapEnd_1 }}</view>
  57. </view>
  58. </view>
  59. <view class="informationCardTextOne">
  60. <view class="informationCardText">
  61. <view class="textSilver">纬度:</view>
  62. <view class="textWhite">{{ mapEnd_2 }}</view>
  63. </view>
  64. </view>
  65. </view>
  66. </view> -->
  67. <!-- 个人信息组件 -->
  68. <view class="Personal_information_W">
  69. <view class="name">姓名:李占国</view>
  70. <view class="history" @click="mapDate"> <span class="navigation"></span> </view>
  71. <view class="skills">技能:电力类,机械类</view>
  72. </view>
  73. <!-- 历史曲线组件 -->
  74. <view class="curve">
  75. <view class="curve_l">健康情况</view>
  76. <view class="curve_r" @tap="common.navTo('/components/bracelet/braceletHistoryCurve?braceletCurve=' + braceletCurve)">历史曲线</view>
  77. <div class="greater"></div>
  78. </view>
  79. <!-- 健康详情组件 -->
  80. <view class="healthy">
  81. <view class="healthy_H">
  82. <view class="details_z">心跳频率:{{xtpl_computed}}<!-- ({{ bracelet[deviceName][targetName_xtpl][targetName_xtpl_size].value }}) --></view>
  83. <view class="details_m">步数:{{bs_computed}}</view>
  84. <view class="details_y">收缩血压:{{ssxy_computed}}</view>
  85. </view>
  86. <view class="healthy_N">
  87. <view class="details_z">舒张血压:{{szxy_computed}}<!-- ({{ bracelet[deviceName][targetName_szxy][targetName_szxy_size].value }}) --></view>
  88. <view class="details_m">疲劳度:{{pld_computed}}<!-- ({{ bracelet[deviceName][targetName_pld][targetName_pld_size].value }}) --></view>
  89. <view class="details_y">血氧浓度:{{xynd_computed}}<!-- ({{ bracelet[deviceName][targetName_xynd][targetName_xynd_size].value }}) --></view>
  90. </view>
  91. </view>
  92. </scroll-view>
  93. </view>
  94. <view v-if="toggleSwitch==true">
  95. <WeatherProphethomepage ref="r1"></WeatherProphethomepage>
  96. </view>
  97. <view class="DrawerClose" :class="modalName == 'viewModal' ? 'show' : ''" @tap="hideModal"><text class="cuIcon-pullright"></text></view>
  98. </view>
  99. </template>
  100. <script>
  101. import res from '../../common/data.json';
  102. import drawer from '../../components/drawer/forecastThreeLineDrawer.vue';
  103. import plusDrawer from '../../components/drawer/plusDrawer.vue';
  104. import WeatherProphethomepage from '../../components/weatherProphethomepage/WeatherProphethomepage.vue';
  105. var _self;
  106. export default {
  107. components: {
  108. drawer: drawer,
  109. plusDrawer: plusDrawer,
  110. WeatherProphethomepage:WeatherProphethomepage
  111. },
  112. data: function() {
  113. return {
  114. bs_computed:'',
  115. xtpl_computed:'',
  116. ssxy_computed:'',
  117. szxy_computed:'',
  118. pld_computed:'',
  119. xynd_computed:'',
  120. WeatherProphethomepagebool:true,
  121. toggleSwitch:false,
  122. menuKey:1,
  123. pointKey: 'MHSFCJSFW.NX_GD_MHSF_XX_XX_XXX_XXX_CI0087',
  124. socketTask_bracelet: '',
  125. socketTask_close_bracelet: '',
  126. deviceName: 'Y1-A0BC',
  127. deviceNamePld: 'Y1-A0BC_PLD',
  128. deviceNameBs: 'Y1-A0BC_BS',
  129. deviceNameSsxy: 'Y1-A0BC_SSXY',
  130. deviceNameXtpl: 'Y1-A0BC_XTPL',
  131. deviceNameXynd: 'Y1-A0BC_XYND',
  132. deviceNameSzxy: 'Y1-A0BC_SZXY',
  133. deviceNameLng: 'Y1-A0BC_LNG',
  134. deviceNameLat: 'Y1-A0BC_LAT',
  135. bracelet: {
  136. deviceName: '',
  137. deviceNamePld: '',
  138. deviceNameBs: '',
  139. deviceNameSsxy: '',
  140. deviceNameXtpl: '',
  141. deviceNameXynd: '',
  142. deviceNameSzxy: '',
  143. },
  144. braceletCurve: {},
  145. mapBegin_1:'',
  146. mapEnd_1:'',
  147. mapBegin_2:'',
  148. mapEnd_2:'',
  149. points:[
  150. {
  151. latitude:'',
  152. longitude:''
  153. },
  154. {
  155. latitude:'',
  156. longitude:''
  157. }
  158. ],
  159. list:{},
  160. braceletCurve_SSXY: [],
  161. braceletCurve_PLD: [],
  162. braceletCurve_SZXY: [],
  163. braceletCurve_XTPL: [],
  164. braceletCurve_BS: [],
  165. braceletCurve_XYND: [],
  166. braceletCurve_LNG: [],
  167. braceletCurve_LAT: [],
  168. /* targetdetail_visable: { targetdetail_target: true, targetdetail_curve: true, targetdetail_histogram: true},
  169. targetdetail: { targetdetail_target: '', targetdetail_curve: '', targetdetail_histogram: ''}, */
  170. targetName: '日发电量',
  171. targetUnit: '万kwh',
  172. kg:true,
  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.$refs.drawer.openDrawer(250, this.drawerList, this.inconList);
  536. },
  537. closeDrawer: function() {
  538. this.drawerIsShow = false;
  539. },
  540. pushWindPowerStationNameToSessionStorage(windpowerstationName) {
  541. uni.setStorageSync('windpowerstationName', windpowerstationName);
  542. //sessionStorage.setItem('windpowerstationName', windpowerstationName);
  543. //alert("v"+ sessionStorage.getItem("windpowerstationName"));
  544. //this.common.goback('/pages/index/Index');
  545. },
  546. getWindPowerStationNameToSessionStorage() {
  547. uni.getStorageSync('windpowerstationName');
  548. return uni.getStorageSync('windpowerstationName');
  549. },
  550. onHide() {
  551. this.$refs.drawer.closeDrawer();
  552. this.hideModal();
  553. },
  554. onShow() {
  555. this.windPowerStationId = uni.getStorageSync('windPowerStationId');
  556. this.address = this.getWindPowerStationNameToSessionStorage();
  557. },
  558. showModal(e) {
  559. this.kg=false;
  560. this.modalName = e.currentTarget.dataset.target;
  561. this.$refs.plusDrawer.showModal(this.plusDrawerList, this.modalName);
  562. },
  563. hideModal() {
  564. this.kg=true;
  565. this.modalName = null;
  566. this.$refs.plusDrawer.hideModal(this.modalName);
  567. },
  568. braceletData() {
  569. let _this = this;
  570. let ip;
  571. uni.request({
  572. url: 'http://' + _this.backStageIp + ':' + _this.backStagePort + '/bracelet/bracelet?beginDate=2020-04-20 09:26:27&&endDate=2020-04-25 09:26:29',
  573. success: res => {
  574. ip = res.data;
  575. }
  576. });
  577. // 创建一个this.socketTask对象【发送、接收、关闭socket都由这个对象操作】
  578. this.socketTask_bracelet = uni.connectSocket({
  579. /* 【非常重要】必须确保你的服务器是成功的,如果是手机测试千万别使用ws://127.0.0.1:9099【特别容易犯的错误】 */
  580. url: 'ws://' + _this.backStageIp + ':' + _this.backStagePort + '/websocket/pageNumber_9/functionNumber_1',
  581. success(data) {
  582. console.log('websocket连接成功');
  583. }
  584. });
  585. // 消息的发送和接收必须在正常连接打开中,才能发送或接收【否则会失败】
  586. this.socketTask_bracelet.onOpen(res => {
  587. console.log('WebSocket连接正常打开中...!');
  588. _this.is_open_socket = true;
  589. // 注:只有连接正常打开中 ,才能正常收到消息
  590. _this.socketTask_bracelet.onMessage(res => {
  591. //console.log("收到服务器内容:" + res.data);
  592. _this.bracelet = JSON.parse(res.data)[ip];
  593. _this.braceletCurve = JSON.stringify(_this.bracelet[_this.deviceName]);
  594. /* 获取起始经纬度 */
  595. _this.braceletCurve_LNG = _this.bracelet[_this.deviceName][_this.deviceNameLng];
  596. _this.braceletCurve_LAT = _this.bracelet[_this.deviceName][_this.deviceNameLat];
  597. _this.mapBegin_1 = (_this.bracelet[_this.deviceName][_this.deviceNameLng][0].value);
  598. _this.mapBegin_2 = (_this.bracelet[_this.deviceName][_this.deviceNameLat][0].value);
  599. _this.mapEnd_1 = (_this.bracelet[_this.deviceName][_this.deviceNameLng][_this.braceletCurve_LNG.length-1].value);
  600. _this.mapEnd_2 = (_this.bracelet[_this.deviceName][_this.deviceNameLat][_this.braceletCurve_LAT.length-1].value);
  601. _this.latitude = _this.mapBegin_2;
  602. _this.longitude = _this.mapBegin_1;
  603. _this.covers[0].latitude = _this.mapBegin_2;
  604. _this.covers[0].longitude = _this.mapBegin_1;
  605. _this.covers[1].latitude = _this.mapEnd_2;
  606. _this.covers[1].longitude = _this.mapEnd_1;
  607. _this.bs_computed = _this.bracelet[_this.deviceName][_this.targetName_bs][_this.targetName_bs_size].value;
  608. _this.xtpl_computed = _this.bracelet[_this.deviceName][_this.targetName_xtpl][_this.targetName_xtpl_size].value;
  609. _this.ssxy_computed = _this.bracelet[_this.deviceName][_this.targetName_ssxy][_this.targetName_ssxy_size].value;
  610. _this.szxy_computed = _this.bracelet[_this.deviceName][_this.targetName_szxy][_this.targetName_szxy_size].value;
  611. _this.pld_computed = _this.bracelet[_this.deviceName][_this.targetName_pld][_this.targetName_pld_size].value;
  612. _this.xynd_computed = _this.bracelet[_this.deviceName][_this.targetName_xynd][_this.targetName_xynd_size].value;
  613. /* this.braceletCurve_LNG = this.bracelet[this.deviceName][this.deviceNameLng];
  614. this.braceletCurve_LAT = this.bracelet[this.deviceName][this.deviceNameLat];
  615. this.points[0].longitude=this.bracelet[this.deviceName][this.deviceNameLng][0].value;
  616. this.points[0].latitude=this.bracelet[this.deviceName][this.deviceNameLat][0].value;
  617. this.points[1].longitude=this.bracelet[this.deviceName][this.deviceNameLng][this.braceletCurve_LNG.length-1].value;
  618. this.points[1].latitude=this.bracelet[this.deviceName][this.deviceNameLat][this.braceletCurve_LAT.length-1].value; */
  619. /* _this.mapDate(); */
  620. /* _this.polyline[0].points[0].latitude=_this.mapBegin_2;
  621. _this.polyline[0].points[0].longitude=_this.mapBegin_1;
  622. _this.polyline[0].points[1].latitude=_this.mapEnd_2;
  623. _this.polyline[0].points[1].longitude=_this.mapEnd_1; */
  624. /* _this.braceletCurve_SSXY = _this.bracelet[_this.deviceName][_this.deviceNameSsxy];
  625. _this.braceletCurve_SZXY = _this.bracelet[_this.deviceName][_this.deviceNameSzxy];
  626. _this.braceletCurve_XYND = _this.bracelet[_this.deviceName][_this.deviceNameXynd];
  627. _this.braceletCurve_XTPL = _this.bracelet[_this.deviceName][_this.deviceNameXtpl];
  628. _this.braceletCurve_BS = _this.bracelet[_this.deviceName][_this.deviceNameBs];
  629. console.log(_this.braceletCurve_BS[0].value); */
  630. });
  631. });
  632. // 这里仅是事件监听【如果socket关闭了会执行】
  633. this.socketTask_bracelet.onClose(() => {
  634. uni.request({
  635. url: 'http://' + _this.backStageIp + ':' + _this.backStagePort + '/bracelet/close_bracelet?pointKey=' + _this.pointKey,
  636. success: res => {}
  637. });
  638. });
  639. }
  640. }
  641. };
  642. </script>
  643. <style>
  644. body {
  645. font-family: '方正兰亭细黑_GBK';
  646. font-size: 15px;
  647. color: silver;
  648. background: #000;
  649. }
  650. @font-face {
  651. font-family: '方正兰亭细黑_GBK';
  652. src: url(../../static/fzltxh.TTF);
  653. }
  654. .content{
  655. //background-color: #000000;
  656. }
  657. page {
  658. background-color: #1f1f1f;
  659. font-family: '方正兰亭细黑_GBK';
  660. overflow-x: hidden;
  661. }
  662. .top {
  663. width: 100%;
  664. height: 130upx;
  665. padding-top: 5upx;
  666. background-color: #1f1f1f;
  667. position: fixed;
  668. top: 0px;
  669. left: 0px;
  670. z-index: 100;
  671. }
  672. .threeLine {
  673. width: 50px;
  674. height: 45px;
  675. float: left;
  676. }
  677. .text {
  678. width: calc(100% - 100px);
  679. height: 45px;
  680. float: left;
  681. user-select: text;
  682. -webkit-user-select: text;
  683. -moz-user-select: text;
  684. -ms-user-select: text;
  685. color: silver;
  686. line-height: 45px;
  687. margin-top: 11px;
  688. font-size: 18px;
  689. }
  690. .notice {
  691. width: 50px;
  692. height: 45px;
  693. float: left;
  694. }
  695. .plus {
  696. width: 30px;
  697. height: 45px;
  698. float: right;
  699. color: white;
  700. font-size: 35px;
  701. line-height: 45px;
  702. text-align: right;
  703. margin-right: 2.5%;
  704. }
  705. .textWindpowerstation {
  706. width: 180px;
  707. height: 45px;
  708. float: left;
  709. text-align: center;
  710. margin-left: 18px;
  711. }
  712. .InformationCard {
  713. position: absolute;
  714. top: 50px;
  715. left: 0px;
  716. margin-top: 0px;
  717. width: 50%;
  718. height: 8%;
  719. background: rgba(0, 0, 0, 0);
  720. float: left;
  721. }
  722. .informationCardAll {
  723. width: 95%;
  724. margin-left: 2.5%;
  725. margin-top: 10px;
  726. height: 60px;
  727. float: left;
  728. }
  729. .informationCardTextOne {
  730. width: 100%;
  731. height: 35px;
  732. float: left;
  733. margin-top: -10px;
  734. }
  735. .informationCardText {
  736. /* margin-left: 2%; */
  737. width: 65px;
  738. height: 35px;
  739. line-height: 35px;
  740. user-select: text;
  741. -webkit-user-select: text;
  742. -moz-user-select: text;
  743. -ms-user-select: text;
  744. color: silver;
  745. font-size: 10px;
  746. transform: scale(0.975);
  747. float: left;
  748. font-weight: 1000;
  749. }
  750. .textSilver {
  751. user-select: text;
  752. -webkit-user-select: text;
  753. -moz-user-select: text;
  754. -ms-user-select: text;
  755. color: black;
  756. float: left;
  757. }
  758. .textWhite {
  759. color: black;
  760. float: right;
  761. width: 24px;
  762. font-size: 10px;
  763. margin-right: 13%;
  764. transform: scale(0.975);
  765. /* text-align: right; */
  766. }
  767. .Personal_information_W {
  768. position: relative;
  769. margin-top: 3%;
  770. width: 90%;
  771. height: 80px;/*
  772. background-color: #242424; */
  773. border-bottom: #BDBDBD solid 0.5px;
  774. transform: translateX(-50%);
  775. left: 50%;
  776. color: #B8B7B7;
  777. }
  778. .name{
  779. position: absolute;
  780. height: 30px;
  781. width: 130px;
  782. left: 3%;
  783. /* background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%); */
  784. text-align: left;
  785. line-height: 30px;
  786. margin-top: 1%;
  787. font-weight: 1000;
  788. }
  789. .history {
  790. position: absolute;
  791. margin-top: 6%;
  792. right: 3%;
  793. height: 30px;
  794. height: 20px;
  795. text-align: center;
  796. line-height: 30px;
  797. }
  798. .skills {
  799. position: absolute;
  800. top: 56%;
  801. left: 3%;
  802. height: 25px;
  803. width: 180px;/*
  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. }
  808. .curve{
  809. position: relative;
  810. width: 90%;
  811. transform: translateX(-50%);
  812. left: 50%;
  813. height: 30px;
  814. margin-top: 3%;
  815. color: #B8B7B7;
  816. font-weight: 1000;
  817. }
  818. .curve_l{
  819. position: absolute;
  820. left: 3%;
  821. }
  822. .curve_r{
  823. position: absolute;
  824. right: 3%;
  825. }
  826. .healthy {
  827. /* margin-top: 6%; */
  828. margin-left: 3%;
  829. height: 180px;
  830. width: 95%;
  831. margin-bottom: 100px;
  832. text-align: center;
  833. color: #B8B7B7;
  834. font-size: 12px;
  835. line-height:65px ;
  836. font-weight: 1000;
  837. }
  838. .healthy_H,
  839. .healthy_N,
  840. .healthy_W {
  841. background-color:#242424;
  842. position: relative;
  843. width: 100%;
  844. height: 42%;
  845. text-align: center;
  846. /* padding-bottom: 1%; */
  847. }
  848. .details_z {
  849. position: absolute;
  850. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  851. width: 30%;
  852. left:3%;
  853. height: 60px;
  854. top: 3%;
  855. margin-top: 2%;
  856. }
  857. .details_m {
  858. position: absolute;
  859. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  860. width: 30%;
  861. left: 35.5%;
  862. height: 60px;
  863. top: 3%;
  864. margin-top: 2%;
  865. }
  866. .details_y {
  867. position: absolute;
  868. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  869. width: 30%;
  870. left: 68%;
  871. height: 60px;
  872. top: 3%;
  873. margin-top: 2%;
  874. /* margin-bottom: 0.6%;
  875. margin-top: 0.6%;
  876. float: right;
  877. margin-left: 0.2%;
  878. margin-right: 1.2%;
  879. width: 31%;
  880. height: 100%;
  881. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  882. color: silver;
  883. text-align: center;
  884. padding-top: 10px;
  885. background-color: #ffffff;
  886. font-size: 12px;
  887. padding-bottom: 4px;
  888. line-height: 13px;
  889. border-radius: 5px;
  890. padding-top: 8px; */
  891. }
  892. .navigation::after {
  893. content: url(../../static/picture/forcast/position.png);
  894. }
  895. /* .greater {
  896. position: relative;
  897. width: 249px;
  898. height: 35px;
  899. border: 1px solid #000;
  900. } */
  901. .greater{
  902. float: right;
  903. content: "";
  904. margin-top: 0.8%;
  905. margin-right: 0.8%;
  906. /* position: absolute; */
  907. /* top: 8px;
  908. right: 15px; */
  909. width: 8px;
  910. height: 8px;
  911. border-right: 2px solid #fff;
  912. border-bottom: 2px solid #fff;
  913. transform: rotate(-45deg);
  914. }
  915. .windStationNameAndChoice {
  916. clear: both;
  917. width: 100%;
  918. height: 30px;
  919. margin-top: 1%;
  920. color: silver;
  921. /* border: 1px solid red; */
  922. }
  923. .windStationName {
  924. width: 50%;
  925. height: 100%;
  926. float: left;
  927. line-height: 30px;
  928. font-size: 14px;
  929. margin-left: 9.5%;
  930. }
  931. .windStationChoice {
  932. width: 20%;
  933. height: 100%;
  934. float: right;
  935. text-align: right;
  936. line-height: 30px;
  937. font-size: 14px;
  938. margin-right: 5%;
  939. }
  940. .s-popup-wrapper {
  941. width: 500rpx;
  942. background-color: #f0f0f0;
  943. }
  944. .s-popup-title {
  945. width: 100%;
  946. height: 50px;
  947. background-color: #211E21;
  948. }
  949. .s-popup-word {
  950. width: calc(100% - 65px);
  951. height: 50px;
  952. font-size: 14px;
  953. color: white;
  954. line-height: 50px;
  955. float: left;
  956. margin-left: 25px;
  957. }
  958. .s-popup-cha {
  959. width: 40px;
  960. height: 50px;
  961. text-align: center;
  962. line-height: 50px;
  963. float: right;
  964. font-size: 24px;
  965. }
  966. .windStationItemContainer {
  967. width: 100%;
  968. }
  969. .windStationItemContainerBlack {
  970. width: 100%;
  971. background-color: grey;
  972. color: white;
  973. }
  974. .windStationItem {
  975. width: 80%;
  976. height: 50px;
  977. border-bottom: 1px solid #c8c8c8;
  978. text-align: left;
  979. line-height: 50px;
  980. margin-left: 10%;
  981. color: #333333;
  982. }
  983. .DrawerPage {
  984. position: fixed;
  985. width: 100vw;
  986. height: 100vh;
  987. left: 0vw;
  988. background-color: #1f1f1f;
  989. transition: all 0.4s;
  990. }
  991. .DrawerPage.show {
  992. transform: scale(0.9, 0.9);
  993. left: 85vw;
  994. box-shadow: 0 0 60upx rgba(0, 0, 0, 0.2);
  995. transform-origin: 0;
  996. }
  997. .DrawerPage .cu-bar.tabbar .action button.cuIcon {
  998. width: 64upx;
  999. height: 64upx;
  1000. line-height: 64upx;
  1001. margin: 0;
  1002. display: inline-block;
  1003. }
  1004. .DrawerPage .cu-bar.tabbar .action .cu-avatar {
  1005. margin: 0;
  1006. }
  1007. .DrawerPage .nav {
  1008. flex: 1;
  1009. }
  1010. .DrawerPage .nav .cu-item.cur {
  1011. border-bottom: 0;
  1012. position: relative;
  1013. }
  1014. .DrawerPage .nav .cu-item.cur::after {
  1015. content: '';
  1016. width: 10upx;
  1017. height: 10upx;
  1018. background-color: currentColor;
  1019. position: absolute;
  1020. bottom: 10upx;
  1021. border-radius: 10upx;
  1022. left: 0;
  1023. right: 0;
  1024. margin: auto;
  1025. }
  1026. .DrawerPage .cu-bar.tabbar .action {
  1027. flex: initial;
  1028. }
  1029. </style>