braceletHistoryCurve.vue 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377
  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. margin-top: 13%;
  1174. }
  1175. .line{
  1176. /* background-color: #f9f9f9; */
  1177. position: absolute;
  1178. width: 100%;
  1179. height: 620px;
  1180. background-color: #242424;
  1181. padding-top: 2%;
  1182. color: #BDBDBD;
  1183. }
  1184. .line_One{/*
  1185. margin: auto; */
  1186. width: 100%;
  1187. height: 200px;
  1188. background-color: #242424;
  1189. margin-top: 10px;
  1190. float: left;
  1191. }
  1192. .line_Two,.line_Three{/*
  1193. margin: auto; */
  1194. width: 100%;
  1195. height: 200px;
  1196. background-color: #242424;
  1197. /* margin-top: 10px; */
  1198. float: left;
  1199. }
  1200. .line_One_X,.line_T_P,.line_T_S{/*
  1201. margin: auto; */
  1202. position: relative;
  1203. float: left;
  1204. width: 42%;
  1205. height: 186px;
  1206. /* background-color: #ececec; */
  1207. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  1208. border-radius: 8%;
  1209. margin-left: 6%;
  1210. margin-top: 2%;
  1211. }
  1212. .line_One_B,.line_T_Z,.line_T_X{/*
  1213. margin: auto; */
  1214. position: relative;
  1215. float: right;
  1216. width: 42%;
  1217. height: 186px;
  1218. background: -webkit-linear-gradient(top, rgba(159, 131, 111, 0.1) 0%, rgba(193, 94, 21, 0.2) 100%);
  1219. border-radius: 8%;
  1220. margin-right: 6%;
  1221. margin-top: 2%;
  1222. }
  1223. /* .line_T_S{
  1224. float: left;
  1225. width: 100px;
  1226. height: 150px;
  1227. background-color: #ececec;
  1228. border-radius: 20%;
  1229. margin-left: 8%;
  1230. margin-top: 5%;
  1231. } */
  1232. .clear{
  1233. clear: both;
  1234. }
  1235. .font{
  1236. position: absolute;
  1237. font-size: 16px;
  1238. font-weight: 1000;
  1239. top: 10%;
  1240. left: 8%;
  1241. }
  1242. .date{
  1243. position: absolute;
  1244. top: 22%;
  1245. left: 8%;
  1246. }
  1247. .digital{
  1248. font-size: 39px;
  1249. font-weight: 900;
  1250. position: absolute;
  1251. top: 70%;
  1252. left: 8%;
  1253. }
  1254. .unit{
  1255. font-size: 16px;
  1256. position: absolute;
  1257. top: 80%;
  1258. left: 63%;
  1259. }
  1260. </style>