braceletHistoryCurve.vue 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379
  1. <template>
  2. <view>
  3. <!--导航栏-->
  4. <view @tap="closeFrame">
  5. <cu-custom bgColor="bg-gradual-sisBlack" :isBack="true">
  6. <block slot="backText">
  7. <view style="height: 80rpx;line-height: 80rpx;color: silver;" >返回</view>
  8. </block>
  9. <block slot="content">
  10. <view style="color: silver;">手环历史曲线</view>
  11. </block>
  12. </cu-custom>
  13. </view>
  14. <!-- 曲线图 -->
  15. <view class="line">
  16. <!-- 第一排 -->
  17. <view class="line_One">
  18. <!-- 心跳 -->
  19. <view class="line_One_X">
  20. <div class="font">心跳频率</div>
  21. <div class="date">{{dataInformation.XTPLTime}}</div>
  22. <view class="lineChart" @tap="common.navTo('/components/bracelet/raceletDetails/heartbeatDetails?unit=次/分钟&name=心跳频率&color=#A1B95B&braceletCurve_XTPL_Details='+braceletCurve_XTPL_Details+'&dataInformation='+dataInformation.XTPL)">
  23. <view class="qiun-charts">
  24. <canvas canvas-id="canvasLineA" id="canvasLineA" class="charts" @touchstart="touchLineA"></canvas>
  25. </view>
  26. </view>
  27. <div class="digital">{{dataInformation.XTPL}}</div>
  28. <div class="unit">次/分钟</div>
  29. </view>
  30. <!-- 步数 -->
  31. <view class="line_One_B">
  32. <view>
  33. <div class="font">步数</div>
  34. <div class="date">{{dataInformation.BSTime}}</div>
  35. <view class="lineChart" @tap="common.navTo('/components/bracelet/raceletDetails/heartbeatDetails?unit=步&name=步数&color=#DDA9B8&braceletCurve_XTPL_Details='+braceletCurve_BS_Details+'&dataInformation='+dataInformation.BS)">
  36. <view class="qiun-charts">
  37. <canvas canvas-id="canvasLineB" id="canvasLineB" class="charts" @touchstart="touchLineB"></canvas>
  38. </view>
  39. </view>
  40. <div class="digital">{{dataInformation.BS}}</div>
  41. <div class="unit">步</div>
  42. </view>
  43. </view>
  44. <!-- clear -->
  45. <view class="clear"></view>
  46. </view>
  47. <!-- 第二排 -->
  48. <view class="line_Two">
  49. <!-- 收缩血压 -->
  50. <view class="line_T_S">
  51. <div class="font">收缩血压</div>
  52. <div class="date">{{dataInformation.SSXYTime}}</div>
  53. <view class="lineChart" @tap="common.navTo('/components/bracelet/raceletDetails/heartbeatDetails?unit=BP&name=收缩血压&color=#AF8DD1&braceletCurve_XTPL_Details='+braceletCurve_SSXY_Details+'&dataInformation='+dataInformation.SSXY)"> <!-- @tap="closeFrame" -->
  54. <view class="qiun-charts">
  55. <canvas canvas-id="canvasLineC" id="canvasLineC" class="charts" @touchstart="touchLineC"></canvas>
  56. </view>
  57. </view>
  58. <div class="digital">{{dataInformation.SSXY}}</div>
  59. <div class="unit">BP</div>
  60. </view>
  61. <!-- 舒张血压 -->
  62. <view class="line_T_Z">
  63. <div class="font">舒张血压</div>
  64. <div class="date">{{dataInformation.SZXYTime}}</div>
  65. <view class="lineChart" @tap="common.navTo('/components/bracelet/raceletDetails/heartbeatDetails?unit=BP&name=舒张血压&color=#6593B6&braceletCurve_XTPL_Details='+braceletCurve_SZXY_Details+'&dataInformation='+dataInformation.SZXY)"> <!-- @tap="closeFrame" -->
  66. <view class="qiun-charts">
  67. <canvas canvas-id="canvasLineD" id="canvasLineD" class="charts" @touchstart="touchLineD"></canvas>
  68. </view>
  69. </view>
  70. <div class="digital">{{dataInformation.SZXY}}</div>
  71. <div class="unit">BP</div>
  72. </view>
  73. <view class="clear"></view>
  74. </view>
  75. <!-- 第三行 -->
  76. <view class="line_Three">
  77. <!-- 疲劳度 -->
  78. <view class="line_T_P">
  79. <div class="font">疲劳度</div>
  80. <div class="date">{{dataInformation.PLDTime}}</div>
  81. <view class="lineChart" @tap="common.navTo('/components/bracelet/raceletDetails/heartbeatDetails?unit=%&name=心跳频率&color=#8EDADD&braceletCurve_XTPL_Details='+braceletCurve_PLD_Details+'&dataInformation='+dataInformation.PLD)">
  82. <view class="qiun-charts">
  83. <canvas canvas-id="canvasLineE" id="canvasLineE" class="charts" @touchstart="touchLineE"></canvas>
  84. </view>
  85. </view>
  86. <div class="digital">{{dataInformation.PLD}}</div>
  87. <div class="unit">%</div>
  88. </view>
  89. <!-- 血氧浓度 -->
  90. <view class="line_T_X">
  91. <div class="font">血氧浓度</div>
  92. <div class="date">{{dataInformation.XYNDTime}}</div>
  93. <view class="lineChart" @tap="common.navTo('/components/bracelet/raceletDetails/heartbeatDetails?unit=ml/%&name=血氧浓度&color=#E49066&braceletCurve_XTPL_Details='+braceletCurve_XYND_Details+'&dataInformation='+dataInformation.XYND)">
  94. <view class="qiun-charts">
  95. <canvas canvas-id="canvasLineF" id="canvasLineF" class="charts" @touchstart="touchLineF"></canvas>
  96. </view>
  97. </view>
  98. <div class="digital">{{dataInformation.XYND}}</div>
  99. <div class="unit">ml/%</div>
  100. </view>
  101. </view>
  102. <!-- 清除浮动 -->
  103. <view class="clear"></view>
  104. </view>
  105. <!-- <view class="line_1">
  106. <view class="lineChart" @tap="closeFrame">
  107. <view class="qiun-charts">
  108. <view class="speedPowerDiagram">疲劳度</view>
  109. <canvas canvas-id="canvasLineA" id="canvasLineA" class="charts" @touchstart="touchLineA"></canvas>
  110. </view>
  111. </view>
  112. </view> -->
  113. </view>
  114. </template>
  115. <script>
  116. import uCharts from '../tools/u-charts/u-charts.js';
  117. var _self;
  118. var canvaLineA = null;
  119. var canvaLineB = null;
  120. var canvaLineC = null;
  121. var canvaLineD = null;
  122. var canvaLineE = null;
  123. var canvaLineF = null;
  124. var canvaColumn = null;
  125. import res from '../../common/data.json';
  126. export default {
  127. data: function(){
  128. return {
  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. braceletCurve:{},
  137. braceletCurve_SSXY:[],
  138. braceletCurve_PLD:[],
  139. braceletCurve_SZXY:[],
  140. braceletCurve_XTPL:[],
  141. braceletCurve_XTPL_Details:[],
  142. braceletCurve_SSXY_Details:[],
  143. braceletCurve_PLD_Details:[],
  144. braceletCurve_SZXY_Details:[],
  145. braceletCurve_BS_Details:[],
  146. braceletCurve_XYND_Details:[],
  147. braceletCurve_BS:[],
  148. braceletCurve_XYND:[],
  149. gl:[],
  150. fs:[],
  151. llgl:[],
  152. ycgl:[],
  153. rfdl:[],
  154. timeRound:[],
  155. windStationName: '',
  156. isFrameShow: false,
  157. count: 0,
  158. cWidth: '',
  159. cHeight: '',
  160. pixelRatio: 1,
  161. serverData: '',
  162. sanJiao: 'sanJiaoDown',
  163. XT_Num:[],
  164. XT_Data:[],
  165. dataInformation:{
  166. XYNDTime:'',
  167. XTPL:'',
  168. PLD:'',
  169. BS:'',
  170. SSXY:'',
  171. SZXY:'',
  172. XYND:'',
  173. XTPLTime:'',
  174. PLDTime:'',
  175. BSTime:'',
  176. SSXYTime:'',
  177. SZXYTime:''
  178. },
  179. }
  180. },
  181. onLoad(option) {
  182. this.braceletCurve = JSON.parse(option.braceletCurve);
  183. this.getServerData_A();
  184. this.getServerData_B();
  185. this.getServerData_C();
  186. this.getServerData_D();
  187. this.getServerData_E();
  188. this.getServerData_F();
  189. this.getDateForInformation();
  190. this.cWidth = uni.upx2px(300);
  191. this.cHeight = uni.upx2px(200);
  192. },
  193. onShow:function(){
  194. this.getServerData_A();
  195. this.getServerData_B();
  196. this.getServerData_C();
  197. this.getServerData_D();
  198. this.getServerData_E();
  199. this.getServerData_F();
  200. },
  201. computed:{
  202. /* targetName_pld:function(){
  203. return this.deviceName+"_PLD";
  204. },
  205. targetName_bs:function(){
  206. return this.deviceName+"_BS";
  207. },
  208. targetName_xtpl:function(){
  209. return this.deviceName+"_XTPL";
  210. },
  211. targetName_ssxy:function(){
  212. return this.deviceName+"_SSXY";
  213. },
  214. targetName_szxy:function(){
  215. return this.deviceName+"_SZXY";
  216. },
  217. targetName_xynd:function(){
  218. return this.deviceName+"_XYND";
  219. }, */
  220. backStageIp:function(){
  221. return this.$store.state.wholeSituationBackStageIp;
  222. }, backStagePort:function(){
  223. return this.$store.state.wholeSituationBackStagePort;
  224. },windpowerstationNameToId:function(){
  225. return this.$store.state.windpowerstationNameToId;
  226. }
  227. },
  228. mounted() {
  229. document.querySelector('body').setAttribute('style', 'background-color:#242424');
  230. },
  231. methods: {
  232. closeFrame: function() {
  233. this.count = this.count + 1;
  234. if (this.isFrameShow) {
  235. this.isFrameShow = false;
  236. this.sanJiao = 'sanJiaoDown';
  237. }
  238. },
  239. getDateForInformation(){
  240. let _this = this;
  241. Date.prototype.Format = function(fmt) {
  242. var o = {
  243. 'M+': this.getMonth() + 1, //月份
  244. 'd+': this.getDate(), //日
  245. 'h+': this.getHours(), //小时
  246. 'm+': this.getMinutes(), //分
  247. 's+': this.getSeconds(), //秒
  248. 'q+': Math.floor((this.getMonth() + 3) / 3), //季度
  249. S: this.getMilliseconds() //毫秒
  250. };
  251. if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length));
  252. for (var k in o)
  253. if (new RegExp('(' + k + ')').test(fmt)) fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[
  254. k]).substr(('' + o[k]).length));
  255. return fmt;
  256. };
  257. /* _this.braceletCurve_PLD = _this.braceletCurve[_this.deviceNamePld];
  258. _this.braceletCurve_SSXY = _this.braceletCurve[_this.deviceNameSsxy];
  259. _this.braceletCurve_SZXY = _this.braceletCurve[_this.deviceNameSzxy];
  260. _this.braceletCurve_XYND = _this.braceletCurve[_this.deviceNameXynd];
  261. _this.braceletCurve_XTPL = _this.braceletCurve[_this.deviceNameXtpl];
  262. _this.braceletCurve_BS = _this.braceletCurve[_this.deviceNameBs]; */
  263. for(let i=_this.braceletCurve_XTPL.length-1;i<_this.braceletCurve_XTPL.length;i++){
  264. if(i == _this.braceletCurve_XTPL.length-1){
  265. _this.dataInformation.XTPL = _this.braceletCurve_XTPL[i].value;
  266. _this.dataInformation.XTPLTime = new Date(_this.braceletCurve_XTPL[i].ts).Format('MM/dd');
  267. }
  268. }
  269. for(let i=_this.braceletCurve_PLD.length-1;i<_this.braceletCurve_PLD.length;i++){
  270. if(i == _this.braceletCurve_PLD.length-1){
  271. _this.dataInformation.PLD = _this.braceletCurve_PLD[i].value;
  272. _this.dataInformation.PLDTime = new Date(_this.braceletCurve_PLD[i].ts).Format('MM/dd');
  273. }
  274. }
  275. for(let i=_this.braceletCurve_BS.length-1;i<_this.braceletCurve_BS.length;i++){
  276. if(i == _this.braceletCurve_BS.length-1){
  277. _this.dataInformation.BS = Math.round(_this.braceletCurve_BS[i].value);
  278. _this.dataInformation.BSTime = new Date(_this.braceletCurve_BS[i].ts).Format('MM/dd');
  279. }
  280. }
  281. for(let i=_this.braceletCurve_SSXY.length-1;i<_this.braceletCurve_SSXY.length;i++){
  282. if(i == _this.braceletCurve_SSXY.length-1){
  283. _this.dataInformation.SSXY = Math.round(_this.braceletCurve_SSXY[i].value);
  284. _this.dataInformation.SSXYTime = new Date(_this.braceletCurve_SSXY[i].ts).Format('MM/dd');
  285. }
  286. }
  287. for(let i=_this.braceletCurve_SZXY.length-1;i<_this.braceletCurve_SZXY.length;i++){
  288. if(i == _this.braceletCurve_SZXY.length-1){
  289. _this.dataInformation.SZXY = Math.round(_this.braceletCurve_SZXY[i].value);
  290. _this.dataInformation.SZXYTime = new Date(_this.braceletCurve_SZXY[i].ts).Format('MM/dd');
  291. }
  292. }
  293. for(let i=_this.braceletCurve_XYND.length-1;i<_this.braceletCurve_XYND.length;i++){
  294. if(i == _this.braceletCurve_XYND.length-1){
  295. _this.dataInformation.XYND = _this.braceletCurve_XYND[i].value;
  296. _this.dataInformation.XYNDTime = new Date(_this.braceletCurve_XYND[i].ts).Format('MM/dd');
  297. }
  298. }
  299. },
  300. getServerData_F() {
  301. // 折线图
  302. let LineF = {
  303. categories: [
  304. ' 17:26',
  305. '18:56',
  306. '19:56',
  307. '20:56',
  308. '21:56',
  309. '22:56',
  310. '23:56',
  311. '00:56',
  312. '01:56',
  313. '02:56',
  314. '03:56',
  315. '04:56',
  316. '05:56',
  317. '06:56',
  318. '07:56',
  319. '08:56',
  320. '09:56',
  321. '10:56',
  322. '11:56',
  323. '12:56',
  324. '13:56',
  325. '14:56',
  326. '15:56',
  327. '16:56',
  328. '17:56 '
  329. ],
  330. series: [{
  331. name: '血氧浓度',
  332. data: [
  333. ],
  334. color: '#E49066',
  335. textColor: '#FFFFFF',
  336. textSize: this.seriesTextSize,
  337. /* format: val => {
  338. return val + 'kwh';
  339. }, */
  340. index: 0,/*
  341. legendShape: 'circle' */
  342. },
  343. ]
  344. };
  345. let _this = this;
  346. LineF.categories = [];
  347. LineF.series[0].data = [];
  348. _this.braceletCurve_XYND = _this.braceletCurve[_this.deviceNameXynd];
  349. _this.braceletCurve_XYND_Details = JSON.stringify(_this.braceletCurve_XYND);
  350. for(let i=_this.braceletCurve_XYND.length-7;i<_this.braceletCurve_XYND.length;i++){
  351. LineF.categories.push(i);
  352. LineF.series[0].data.push(_this.braceletCurve_XYND[i].value);
  353. }
  354. this.showLineF('canvasLineF', LineF);
  355. },
  356. getServerData_E() {
  357. // 折线图
  358. let LineE = {
  359. categories: [
  360. ' 17:26',
  361. '18:56',
  362. '19:56',
  363. '20:56',
  364. '21:56',
  365. '22:56',
  366. '23:56',
  367. '00:56',
  368. '01:56',
  369. '02:56',
  370. '03:56',
  371. '04:56',
  372. '05:56',
  373. '06:56',
  374. '07:56',
  375. '08:56',
  376. '09:56',
  377. '10:56',
  378. '11:56',
  379. '12:56',
  380. '13:56',
  381. '14:56',
  382. '15:56',
  383. '16:56',
  384. '17:56 '
  385. ],
  386. series: [{
  387. pointShape:'diamond',
  388. name: '疲劳度',
  389. data: [
  390. ],
  391. color: '#8EDADD',
  392. textColor: '#FFFFFF',
  393. textSize: this.seriesTextSize,
  394. /* format: val => {
  395. return val + 'kwh';
  396. }, */
  397. index: 0,/*
  398. legendShape: 'circle' */
  399. },
  400. ]
  401. };
  402. let _this = this;
  403. LineE.categories = [];
  404. LineE.series[0].data = [];
  405. _this.braceletCurve_PLD = _this.braceletCurve[_this.deviceNamePld];
  406. _this.braceletCurve_PLD_Details = JSON.stringify(_this.braceletCurve_PLD);
  407. for(let i=_this.braceletCurve_PLD.length-7;i<_this.braceletCurve_PLD.length;i++){
  408. LineE.categories.push(i);
  409. LineE.series[0].data.push(_this.braceletCurve_PLD[i].value);
  410. }
  411. this.showLineE('canvasLineE', LineE);
  412. },
  413. getServerData_D() {
  414. // 折线图
  415. let LineD = {
  416. categories: [
  417. ' 17:26',
  418. '18:56',
  419. '19:56',
  420. '20:56',
  421. '21:56',
  422. '22:56',
  423. '23:56',
  424. '00:56',
  425. '01:56',
  426. '02:56',
  427. '03:56',
  428. '04:56',
  429. '05:56',
  430. '06:56',
  431. '07:56',
  432. '08:56',
  433. '09:56',
  434. '10:56',
  435. '11:56',
  436. '12:56',
  437. '13:56',
  438. '14:56',
  439. '15:56',
  440. '16:56',
  441. '17:56 '
  442. ],
  443. series: [{
  444. pointShape:'rect',
  445. name: '舒张血压',
  446. data: [
  447. ],
  448. color: '#6593B6',
  449. textColor: '#FFFFFF',
  450. textSize: this.seriesTextSize,
  451. /* format: val => {
  452. return val + 'kwh';
  453. }, */
  454. index: 0,/*
  455. legendShape: 'circle' */
  456. },
  457. ]
  458. };
  459. let _this = this;
  460. LineD.categories = [];
  461. LineD.series[0].data = [];
  462. _this.braceletCurve_SZXY = _this.braceletCurve[_this.deviceNameSzxy];
  463. _this.braceletCurve_SZXY_Details = JSON.stringify(_this.braceletCurve_SZXY);
  464. for(let i=_this.braceletCurve_SZXY.length-7;i<_this.braceletCurve_SZXY.length;i++){
  465. LineD.categories.push(i);
  466. LineD.series[0].data.push(_this.braceletCurve_SZXY[i].value);
  467. }
  468. this.showLineD('canvasLineD', LineD);
  469. },
  470. getServerData_C() {
  471. // 折线图
  472. let LineC = {
  473. categories: [
  474. ' 17:26',
  475. '18:56',
  476. '19:56',
  477. '20:56',
  478. '21:56',
  479. '22:56',
  480. '23:56',
  481. '00:56',
  482. '01:56',
  483. '02:56',
  484. '03:56',
  485. '04:56',
  486. '05:56',
  487. '06:56',
  488. '07:56',
  489. '08:56',
  490. '09:56',
  491. '10:56',
  492. '11:56',
  493. '12:56',
  494. '13:56',
  495. '14:56',
  496. '15:56',
  497. '16:56',
  498. '17:56 '
  499. ],
  500. series: [{
  501. pointShape:'triangle',
  502. name: '收缩血压',
  503. data: [
  504. ],
  505. color: '#AF8DD1',
  506. textColor: '#FFFFFF',
  507. textSize: this.seriesTextSize,
  508. /* format: val => {
  509. return val + 'kwh';
  510. }, */
  511. index: 0,/*
  512. legendShape: 'circle' */
  513. },
  514. ]
  515. };
  516. let _this = this;
  517. LineC.categories = [];
  518. LineC.series[0].data = [];
  519. _this.braceletCurve_SSXY = _this.braceletCurve[_this.deviceNameSsxy];
  520. _this.braceletCurve_SSXY_Details = JSON.stringify(_this.braceletCurve_SSXY);
  521. for(let i=_this.braceletCurve_SSXY.length-7;i<_this.braceletCurve_SSXY.length;i++){
  522. LineC.categories.push(i);
  523. LineC.series[0].data.push(_this.braceletCurve_SSXY[i].value);
  524. }
  525. _this.XT_Num = LineC.categories;
  526. _this.XT_Data = LineC.series[0].data;
  527. this.showLineC('canvasLineC', LineC);
  528. },
  529. getServerData_B() {
  530. // 折线图
  531. let LineB = {
  532. categories: [
  533. ' 17:26',
  534. '18:56',
  535. '19:56',
  536. '20:56',
  537. '21:56',
  538. '22:56',
  539. '23:56',
  540. '00:56',
  541. '01:56',
  542. '02:56',
  543. '03:56',
  544. '04:56',
  545. '05:56',
  546. '06:56',
  547. '07:56',
  548. '08:56',
  549. '09:56',
  550. '10:56',
  551. '11:56',
  552. '12:56',
  553. '13:56',
  554. '14:56',
  555. '15:56',
  556. '16:56',
  557. '17:56 '
  558. ],
  559. legend:[{
  560. show:true,
  561. disableLegend:false,
  562. }],
  563. series: [{
  564. name: '步数',
  565. data: [
  566. ],
  567. color: '#DDA9B8',
  568. textColor: '#FFFFFF',
  569. textSize: this.seriesTextSize,
  570. /* format: val => {
  571. return val + 'kwh';
  572. }, */
  573. index: 0,/*
  574. legendShape: 'circle' */
  575. },
  576. ]
  577. };
  578. let _this = this;
  579. LineB.categories = [];
  580. LineB.series[0].data = [];
  581. _this.braceletCurve_BS = _this.braceletCurve[_this.deviceNameBs];
  582. _this.braceletCurve_BS_Details = JSON.stringify(_this.braceletCurve_BS);
  583. for(let i=_this.braceletCurve_BS.length-7;i<_this.braceletCurve_BS.length;i++){
  584. LineB.categories.push(i);
  585. LineB.series[0].data.push(_this.braceletCurve_BS[i].value);
  586. }
  587. this.showLineB('canvasLineB', LineB);
  588. },
  589. getServerData_A() {
  590. // 折线图
  591. let LineA = {
  592. categories: [
  593. ' 17:26',
  594. '18:56',
  595. '19:56',
  596. '20:56',
  597. '21:56',
  598. '22:56',
  599. '23:56',
  600. '00:56',
  601. '01:56',
  602. '02:56',
  603. '03:56',
  604. '04:56',
  605. '05:56',
  606. '06:56',
  607. '07:56',
  608. '08:56',
  609. '09:56',
  610. '10:56',
  611. '11:56',
  612. '12:56',
  613. '13:56',
  614. '14:56',
  615. '15:56',
  616. '16:56',
  617. '17:56 '
  618. ],
  619. legend:[{
  620. show:true,
  621. }],
  622. series: [{
  623. pointShape:'diamond',
  624. name: '心跳频率',
  625. disableLegend:false,
  626. data: [{
  627. value:6,
  628. }
  629. ],
  630. color: '#A1B95B',
  631. textColor: '#bdbdbd',
  632. textSize: this.seriesTextSize,
  633. /* format: val => {
  634. return val + 'kwh';
  635. }, */
  636. index: 0,/*
  637. legendShape: 'circle' */
  638. },
  639. ]
  640. };
  641. let _this = this;
  642. LineA.categories = [];
  643. LineA.series[0].data = [];
  644. _this.braceletCurve_XTPL = _this.braceletCurve[_this.deviceNameXtpl];
  645. _this.braceletCurve_XTPL_Details = JSON.stringify(_this.braceletCurve_XTPL);
  646. for(let i=_this.braceletCurve_XTPL.length-7;i<_this.braceletCurve_XTPL.length;i++){
  647. LineA.categories.push(i);
  648. LineA.series[0].data.push(_this.braceletCurve_XTPL[i].value);
  649. /* if(i == _this.braceletCurve_XTPL.length){
  650. _this.XTPL = _this.braceletCurve_XTPL[i].value;
  651. } */
  652. }
  653. this.showLineA('canvasLineA', LineA);
  654. },
  655. showLineF(canvasId, chartData) {
  656. var _self = this;
  657. canvaLineF = new uCharts({
  658. $this: _self,
  659. canvasId: canvasId,
  660. type: 'line',
  661. fontSize: 11,
  662. legend: {
  663. show: false,
  664. position: 'top',
  665. float: 'left',
  666. fontColor: '',
  667. itemGap: '4',
  668. itemWidth: '3',
  669. fontSize:'13'
  670. },
  671. dataLabel: false,
  672. dataPointShape: false,
  673. background: '#FFFFFF',
  674. pixelRatio: _self.pixelRatio,
  675. categories: chartData.categories,
  676. series: chartData.series,
  677. animation: false,
  678. xAxis: {
  679. disableGrid:true,
  680. axisLine:false,
  681. type: 'grid',
  682. disabled: true,
  683. gridColor: 'silver',
  684. fontColor: 'silver',
  685. gridType: 'solid',
  686. gridColor: '#ececec',
  687. axisLineColor: '#ececec',
  688. labelCount: '3',
  689. itemCount:'3',
  690. },
  691. yAxis: {
  692. disableGrid:true,
  693. data: [{
  694. type: 'value',
  695. fontColor: 'silver',
  696. disabled: true, //y轴轴线
  697. min: 0,
  698. max: 30,
  699. position: 'left',
  700. axisLineColor: '#ececec',
  701. title: '',
  702. titleFontColor: 'silver'
  703. }
  704. ],
  705. gridColor: '#ececec',
  706. splitNumber: 3,
  707. gridType: 'solid',
  708. dashLength: 8,
  709. showTitle: 'true',
  710. /* format: val => {
  711. return val.toFixed(0) + '元';
  712. } */
  713. },
  714. width: _self.cWidth * _self.pixelRatio ,
  715. height: _self.cHeight * _self.pixelRatio ,
  716. extra: {
  717. line: {
  718. type: 'line',
  719. width: '1'
  720. }
  721. }
  722. });
  723. },
  724. showLineE(canvasId, chartData) {
  725. var _self = this;
  726. canvaLineE = new uCharts({
  727. $this: _self,
  728. canvasId: canvasId,
  729. type: 'line',
  730. fontSize: 11,
  731. legend: {
  732. show: false,
  733. position: 'top',
  734. float: 'left',
  735. fontColor: 'silver',
  736. itemGap: '4',
  737. itemWidth: '3',
  738. fontSize:'13'
  739. },
  740. dataLabel: true,
  741. dataPointShape: false,
  742. dataLabel:false,
  743. background: '#FFFFFF',
  744. pixelRatio: _self.pixelRatio,
  745. categories: chartData.categories,
  746. series: chartData.series,
  747. animation: false,
  748. xAxis: {
  749. disableGrid:true,
  750. axisLine:false,
  751. type: 'grid',
  752. disabled: true,
  753. gridColor: 'silver',
  754. fontColor: 'silver',
  755. gridType: 'solid',
  756. gridColor: '#ececec',
  757. axisLineColor: '#ececec',
  758. labelCount: '3',
  759. itemCount:'3',
  760. },
  761. yAxis: {
  762. disableGrid:true,
  763. data: [{
  764. type: 'value',
  765. fontColor: 'silver',
  766. disabled: true, //y轴轴线
  767. min: 0,
  768. max: 30,
  769. position: 'left',
  770. axisLineColor: '#ececec',
  771. title: '',
  772. titleFontColor: 'silver'
  773. }
  774. ],
  775. gridColor: '#ececec',
  776. splitNumber: 3,
  777. gridType: 'solid',
  778. dashLength: 8,
  779. showTitle: 'true',
  780. /* format: val => {
  781. return val.toFixed(0) + '元';
  782. } */
  783. },
  784. width: _self.cWidth * _self.pixelRatio ,
  785. height: _self.cHeight * _self.pixelRatio ,
  786. extra: {
  787. line: {
  788. type: 'line',
  789. width: '1'
  790. }
  791. }
  792. });
  793. },
  794. showLineC(canvasId, chartData) {
  795. var _self = this;
  796. canvaLineC = new uCharts({
  797. $this: _self,
  798. canvasId: canvasId,
  799. type: 'line',
  800. fontSize: 11,
  801. legend: {
  802. show: false,
  803. position: 'top',
  804. float: 'left',
  805. fontColor: 'silver',
  806. itemGap: '4',
  807. itemWidth: '3',
  808. fontSize:'13'
  809. },
  810. dataLabel: true,
  811. dataPointShape: false,
  812. dataLabel:false,
  813. background: '#FFFFFF',
  814. pixelRatio: _self.pixelRatio,
  815. categories: chartData.categories,
  816. series: chartData.series,
  817. animation: false,
  818. xAxis: {
  819. disableGrid:true,
  820. axisLine:false,
  821. type: 'grid',
  822. disabled: true,
  823. gridColor: 'silver',
  824. fontColor: 'silver',
  825. gridType: 'solid',
  826. gridColor: '#ececec',
  827. axisLineColor: '#ececec',
  828. labelCount: '3',
  829. itemCount:'3',
  830. },
  831. yAxis: {
  832. disableGrid:true,
  833. data: [{
  834. type: 'value',
  835. fontColor: 'silver',
  836. disabled: true, //y轴轴线
  837. min: 0,
  838. max: 30,
  839. position: 'left',
  840. axisLineColor: '#ececec',
  841. title: '',
  842. titleFontColor: 'silver'
  843. }
  844. ],
  845. gridColor: '#ececec',
  846. splitNumber: 3,
  847. gridType: 'solid',
  848. dashLength: 8,
  849. showTitle: 'true',
  850. /* format: val => {
  851. return val.toFixed(0) + '元';
  852. } */
  853. },
  854. width: _self.cWidth * _self.pixelRatio ,
  855. height: _self.cHeight * _self.pixelRatio ,
  856. extra: {
  857. line: {
  858. type: 'line',
  859. width: '1'
  860. }
  861. }
  862. });
  863. },
  864. showLineD(canvasId, chartData) {
  865. var _self = this;
  866. canvaLineD = new uCharts({
  867. $this: _self,
  868. canvasId: canvasId,
  869. type: 'line',
  870. fontSize: 11,
  871. legend: {
  872. show: false,
  873. position: 'top',
  874. float: 'left',
  875. fontColor: 'silver',
  876. itemGap: '4',
  877. itemWidth: '3',
  878. fontSize:'13'
  879. },
  880. dataLabel: true,
  881. dataPointShape: false,
  882. dataLabel:false,
  883. background: '#FFFFFF',
  884. pixelRatio: _self.pixelRatio,
  885. categories: chartData.categories,
  886. series: chartData.series,
  887. animation: false,
  888. xAxis: {
  889. disableGrid:true,
  890. axisLine:false,
  891. type: 'grid',
  892. disabled: true,
  893. gridColor: 'silver',
  894. fontColor: 'silver',
  895. gridType: 'solid',
  896. gridColor: '#ececec',
  897. axisLineColor: '#ececec',
  898. labelCount: '3',
  899. itemCount:'3',
  900. },
  901. yAxis: {
  902. disableGrid:true,
  903. data: [{
  904. type: 'value',
  905. fontColor: 'silver',
  906. disabled: true, //y轴轴线
  907. min: 0,
  908. max: 30,
  909. position: 'left',
  910. axisLineColor: '#ececec',
  911. title: '',
  912. titleFontColor: 'silver'
  913. }
  914. ],
  915. gridColor: '#ececec',
  916. splitNumber: 3,
  917. gridType: 'solid',
  918. dashLength: 8,
  919. showTitle: 'true',
  920. /* format: val => {
  921. return val.toFixed(0) + '元';
  922. } */
  923. },
  924. width: _self.cWidth * _self.pixelRatio ,
  925. height: _self.cHeight * _self.pixelRatio ,
  926. extra: {
  927. line: {
  928. type: 'line',
  929. width: '1'
  930. }
  931. }
  932. });
  933. },
  934. showLineA(canvasId, chartData) {
  935. var _self = this;
  936. canvaLineA = new uCharts({
  937. $this: _self,
  938. canvasId: canvasId,
  939. type: 'line',
  940. dataPointShapeType:'hollow',
  941. fontSize: 11,
  942. legend: {
  943. show: false,
  944. position: 'top',
  945. float: 'left',
  946. fontColor: 'silver',
  947. itemGap: '4',
  948. itemWidth: '3',
  949. fontSize:'13'
  950. },
  951. dataPointShape: false,
  952. dataLabel:false,
  953. background: '#FFFFFF',
  954. pixelRatio: _self.pixelRatio,
  955. categories: chartData.categories,
  956. series: chartData.series,
  957. animation: false,
  958. xAxis: {
  959. disableGrid:true,
  960. axisLine:false,
  961. type: 'grid',
  962. disabled: true,
  963. gridColor: 'silver',
  964. fontColor: 'silver',
  965. gridType: 'solid',
  966. gridColor: '#ececec',
  967. axisLineColor: '#ececec',
  968. labelCount: '3',
  969. itemCount:'3',
  970. },
  971. yAxis: {
  972. disableGrid:true,
  973. data: [{
  974. type: 'value',
  975. fontColor: 'silver',
  976. disabled: true, //y轴轴线
  977. min: 0,
  978. max: 30,
  979. position: 'left',
  980. axisLineColor: '#ececec',
  981. title: '',
  982. titleFontColor: 'silver'
  983. }
  984. ],
  985. gridColor: '#ececec',
  986. splitNumber: 3,
  987. gridType: 'solid',
  988. dashLength: 8,
  989. showTitle: 'true',
  990. /* format: val => {
  991. return val.toFixed(0) + '元';
  992. } */
  993. },
  994. width: _self.cWidth * _self.pixelRatio ,
  995. height: _self.cHeight * _self.pixelRatio ,
  996. extra: {
  997. line: {
  998. type: 'line',
  999. width: '1'
  1000. }
  1001. }
  1002. });
  1003. },
  1004. showLineB(canvasId, chartData) {
  1005. var _self = this;
  1006. canvaLineB = new uCharts({
  1007. $this: _self,
  1008. canvasId: canvasId,
  1009. type: 'line',
  1010. fontSize: 11,
  1011. legend: {
  1012. show: false,
  1013. position: 'top',
  1014. float: 'left',
  1015. fontColor: '#4D4DFF',
  1016. itemGap: '4',
  1017. itemWidth: '3',
  1018. fontSize:'13'
  1019. },
  1020. dataLabel: true,
  1021. dataPointShape: false, /* 图例标点 */
  1022. dataLabel:false,
  1023. background: '#FFFFFF',
  1024. pixelRatio: _self.pixelRatio,
  1025. categories: chartData.categories,
  1026. series: chartData.series,
  1027. animation: false,
  1028. xAxis: {
  1029. disableGrid:true,
  1030. axisLine:false,
  1031. type: 'grid',
  1032. disabled: true,
  1033. gridColor: 'silver',
  1034. fontColor: 'silver',
  1035. gridType: 'solid',
  1036. gridColor: '#ececec',
  1037. axisLineColor: '#ececec',
  1038. labelCount: '3',
  1039. itemCount:'3',
  1040. },
  1041. yAxis: {
  1042. disableGrid:true,
  1043. data: [{
  1044. type: 'value',
  1045. fontColor: 'silver',
  1046. disabled: true, //y轴轴线
  1047. min: 0,
  1048. max: 30,
  1049. position: 'left',
  1050. axisLineColor: '#ececec',
  1051. title: '',
  1052. titleFontColor: 'silver'
  1053. }
  1054. ],
  1055. gridColor: '#ececec',
  1056. splitNumber: 3,
  1057. gridType: 'solid',
  1058. dashLength: 8,
  1059. showTitle: 'true',
  1060. /* format: val => {
  1061. return val.toFixed(0) + '元';
  1062. } */
  1063. },
  1064. width: _self.cWidth * _self.pixelRatio ,
  1065. height: _self.cHeight * _self.pixelRatio ,
  1066. extra: {
  1067. line: {
  1068. type: 'line',
  1069. width: '1'
  1070. }
  1071. }
  1072. });
  1073. },
  1074. touchLineF(e) {
  1075. canvaLineF.showToolTip(e, {
  1076. format: function(item, category) {
  1077. return category + ' ' + item.name + ':' + item.data;
  1078. }
  1079. });
  1080. },
  1081. touchLineE(e) {
  1082. canvaLineE.showToolTip(e, {
  1083. format: function(item, category) {
  1084. return category + ' ' + item.name + ':' + item.data;
  1085. }
  1086. });
  1087. },
  1088. touchLineD(e) {
  1089. canvaLineD.showToolTip(e, {
  1090. format: function(item, category) {
  1091. return category + ' ' + item.name + ':' + item.data;
  1092. }
  1093. });
  1094. },
  1095. touchLineC(e) {
  1096. canvaLineC.showToolTip(e, {
  1097. format: function(item, category) {
  1098. return category + ' ' + item.name + ':' + item.data;
  1099. }
  1100. });
  1101. },
  1102. touchLineA(e) {
  1103. canvaLineA.showToolTip(e, {
  1104. format: function(item, category) {
  1105. return category + ' ' + item.name + ':' + item.data;
  1106. }
  1107. });
  1108. },
  1109. touchLineB(e) {
  1110. canvaLineB.showToolTip(e, {
  1111. format: function(item, category) {
  1112. return category + ' ' + item.name + ':' + item.data;
  1113. }
  1114. });
  1115. },
  1116. moveLineA(e) {
  1117. canvaLineA.scroll(e);
  1118. },
  1119. moveLineB(e) {
  1120. canvaLineB.scroll(e);
  1121. },
  1122. moveLineC(e) {
  1123. canvaLineC.scroll(e);
  1124. },
  1125. moveLineD(e) {
  1126. canvaLineD.scroll(e);
  1127. },
  1128. moveLineE(e) {
  1129. canvaLineD.scroll(e);
  1130. }
  1131. }
  1132. }
  1133. </script>
  1134. <style>
  1135. body {
  1136. font-family: '方正兰亭细黑_GBK';
  1137. font-size: 20px;
  1138. color: silver;
  1139. background: #000;
  1140. }
  1141. @font-face {
  1142. font-family: '方正兰亭细黑_GBK';
  1143. src: url(../../static/fzltxh.TTF);
  1144. }
  1145. page {
  1146. background-color: #1f1f1f;
  1147. font-family: '方正兰亭细黑_GBK';
  1148. overflow-x: hidden;
  1149. }
  1150. .speedPowerDiagram {
  1151. width: 100px;
  1152. height: 30px;
  1153. user-select: text;
  1154. -webkit-user-select: text;
  1155. -moz-user-select: text;
  1156. -ms-user-select: text;
  1157. color: silver;
  1158. float: left;
  1159. margin-top: 18px;
  1160. margin-left: 9px;
  1161. font-size: 11px;
  1162. }
  1163. /* .qiun-charts {
  1164. width: 300upx;
  1165. height: 200upx;
  1166. } */
  1167. .charts {
  1168. position: absolute;
  1169. top: 13%;
  1170. left: 1.5%;
  1171. /* width: 300upx;
  1172. height: 200upx; */
  1173. height: 48%;
  1174. width: 97%;
  1175. margin-top: 13%;
  1176. }
  1177. .line{
  1178. /* background-color: #f9f9f9; */
  1179. position: absolute;
  1180. width: 100%;
  1181. height: 620px;
  1182. background-color: #242424;
  1183. padding-top: 2%;
  1184. color: #BDBDBD;
  1185. }
  1186. .line_One{/*
  1187. margin: auto; */
  1188. width: 100%;
  1189. height: 200px;
  1190. background-color: #242424;
  1191. margin-top: 10px;
  1192. float: left;
  1193. }
  1194. .line_Two,.line_Three{/*
  1195. margin: auto; */
  1196. width: 100%;
  1197. height: 200px;
  1198. background-color: #242424;
  1199. /* margin-top: 10px; */
  1200. float: left;
  1201. }
  1202. .line_One_X,.line_T_P,.line_T_S{/*
  1203. margin: auto; */
  1204. position: relative;
  1205. float: left;
  1206. width: 42%;
  1207. height: 186px;
  1208. /* background-color: #ececec; */
  1209. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  1210. border-radius: 8%;
  1211. margin-left: 6%;
  1212. margin-top: 2%;
  1213. }
  1214. .line_One_B,.line_T_Z,.line_T_X{/*
  1215. margin: auto; */
  1216. position: relative;
  1217. float: right;
  1218. width: 42%;
  1219. height: 186px;
  1220. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  1221. border-radius: 8%;
  1222. margin-right: 6%;
  1223. margin-top: 2%;
  1224. }
  1225. /* .line_T_S{
  1226. float: left;
  1227. width: 100px;
  1228. height: 150px;
  1229. background-color: #ececec;
  1230. border-radius: 20%;
  1231. margin-left: 8%;
  1232. margin-top: 5%;
  1233. } */
  1234. .clear{
  1235. clear: both;
  1236. }
  1237. .font{
  1238. position: absolute;
  1239. font-size: 16px;
  1240. font-weight: 1000;
  1241. top: 10%;
  1242. left: 8%;
  1243. }
  1244. .date{
  1245. position: absolute;
  1246. top: 22%;
  1247. left: 8%;
  1248. }
  1249. .digital{
  1250. font-size: 39px;
  1251. font-weight: 900;
  1252. position: absolute;
  1253. top: 70%;
  1254. left: 8%;
  1255. }
  1256. .unit{
  1257. font-size: 16px;
  1258. position: absolute;
  1259. top: 80%;
  1260. left: 63%;
  1261. }
  1262. </style>