index.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881
  1. <template>
  2. <div class="app-container">
  3. <el-row>
  4. <el-col :span="8">
  5. <div class="cell cell-row1" v-loading="showTotalMoney.loading">
  6. <div class="cell-title">账户余额</div>
  7. <div class="cell-time">截止时间为 {{ showTotalMoney.time }}</div>
  8. <div class="cell-bottom">
  9. <div class="cell-bottom-amount">{{ showTotalMoney.amount.toFixed(2) }}</div>
  10. <div class="rmb1">¥</div>
  11. </div>
  12. </div>
  13. </el-col>
  14. <el-col :span="8">
  15. <div class="cell cell-row1" v-loading="showThisMonthRecharge.loading">
  16. <div class="cell-title">本月充值</div>
  17. <div class="cell-time">截止时间为 {{ showThisMonthRecharge.time }}</div>
  18. <div class="cell-bottom">
  19. <div class="cell-footer">
  20. <div class="cell-bottom-amount">{{ showThisMonthRecharge.amount.toFixed(2) }}</div>
  21. <div class="cell-footer-amount">线上:{{ showThisMonthRecharge.online_amount.toFixed(2) }}
  22. </div>
  23. <div class="cell-footer-amount">线下:{{ showThisMonthRecharge.offline_amount.toFixed(2) }}
  24. </div>
  25. </div>
  26. <div class="rmb2">¥</div>
  27. </div>
  28. </div>
  29. </el-col>
  30. <el-col :span="8">
  31. <div class="cell cell-row1" v-loading="showThisMonthConsume.loading">
  32. <div class="cell-title">本月消费</div>
  33. <div class="cell-time">截止时间为 {{ showThisMonthConsume.time }}</div>
  34. <div class="cell-bottom">
  35. <div class="cell-bottom-amount">{{ showThisMonthConsume.amount.toFixed(2) }}</div>
  36. <div class="rmb3">¥</div>
  37. </div>
  38. </div>
  39. </el-col>
  40. </el-row>
  41. <el-row>
  42. <el-col :span="8">
  43. <div class="cell">
  44. <el-card class="box-card" style="position: relative; height: 465px;">
  45. <div slot="header" class="clearfix">
  46. <img src="../../icons/images/index/zoushi.png" alt="">
  47. <span>用电消费走势图</span>
  48. </div>
  49. <el-date-picker v-model="showEchartsDate" @change="echartsDate_change" class="select-year" type="year" :picker-options="pickerOptions"
  50. :clearable="false" :editable="false" value-format="yyyy" placeholder="年份">
  51. </el-date-picker>
  52. <div id="main-echart" class="line-echart"></div>
  53. </el-card>
  54. </div>
  55. </el-col>
  56. <el-col :span="16">
  57. <div class="cell">
  58. <el-card class="box-card">
  59. <div slot="header" class="clearfix">
  60. <img src="../../icons/images/index/yujing.png" alt="">
  61. <span class="title-btn" :style="time_out_warning ? 'background-color: #3965FF;color:#ffffff' : ''"
  62. @click="time_out_warning_handle">超时预警</span>
  63. <span class="title-btn" :style="off_line_warning ? 'background-color: #3965FF;color:#ffffff' : ''"
  64. @click="off_line_warning_handle">离线预警</span>
  65. </div>
  66. <el-table :data="yujing_tableData" height="350" stripe :cell-style="cell_style" v-loading="airTimeoutWarning_loading"
  67. :header-cell-style="header_cell_style" v-if="time_out_warning" style="width: 100%">
  68. <el-table-column prop="deviceId" label="设备号" align="center"> </el-table-column>
  69. <el-table-column prop="warningTime" label="告警时间" align="center"> </el-table-column>
  70. <el-table-column prop="durationUse" label="使用时长" align="center"> </el-table-column>
  71. <el-table-column prop="contact" label="联系方式" align="center"> </el-table-column>
  72. <el-table-column prop="operator" label="操作人" align="center"> </el-table-column>
  73. </el-table>
  74. <el-table :data="yujing_tableData" height="350" stripe :cell-style="cell_style" v-loading="airTimeoutWarning_loading"
  75. :header-cell-style="header_cell_style" v-if="off_line_warning" style="width: 100%">
  76. <el-table-column prop="deviceId" label="空调设备" align="center"> </el-table-column>
  77. <el-table-column prop="room" label="房间号" align="center"> </el-table-column>
  78. <el-table-column prop="floor" label="楼层" align="center"> </el-table-column>
  79. <el-table-column prop="drom" label="楼栋" align="center"> </el-table-column>
  80. <el-table-column prop="warningTime" label="告警时间" align="center"> </el-table-column>
  81. </el-table>
  82. </el-card>
  83. </div>
  84. </el-col>
  85. </el-row>
  86. <el-row>
  87. <el-col :span="8">
  88. <div class="cell">
  89. <el-card class="box-card">
  90. <div slot="header" class="clearfix">
  91. <div class="card-header-between">
  92. <div class="card-title-left">
  93. <img src="../../icons/images/index/yewu.png" alt="">
  94. <span>办公室能耗排名top10</span>
  95. </div>
  96. <span class="card-desc pointer" @click="dialogTableVisible = true">查看更多&gt;&gt;</span>
  97. <el-dialog title="办公室能耗排名" :visible.sync="dialogTableVisible" width="530px" :close-on-click-modal="false">
  98. <el-table :data="gridData" height="540">
  99. <el-table-column property="date" label="房间号" align="center"></el-table-column>
  100. <el-table-column property="name" label="能耗KWH" align="center"></el-table-column>
  101. <el-table-column property="address" label="排名" align="center"></el-table-column>
  102. </el-table>
  103. <el-pagination class="dialog-page" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page.sync="currentPage3"
  104. :page-size="10" layout="prev, pager, next, jumper" :total="1000">
  105. </el-pagination>
  106. </el-dialog>
  107. </div>
  108. </div>
  109. <el-table :data="yewu_tableData" height="490" stripe :cell-style="handle_cell_style" :header-cell-style="header_cell_style"
  110. v-loading="realTimeBusinessInformation_loading" style="width: 100%" :show-header="true">
  111. <el-table-column prop="desc" label="房间号" align="center"></el-table-column>
  112. <el-table-column prop="desc" label="能耗KWH" align="center"></el-table-column>
  113. <el-table-column prop="desc" label="排名" align="center"></el-table-column>
  114. </el-table>
  115. </el-card>
  116. </div>
  117. </el-col>
  118. <el-col :span="16">
  119. <div class="cell">
  120. <el-card class="box-card">
  121. <div slot="header" class="clearfix">
  122. <div class="card-header-between">
  123. <div class="card-title-left">
  124. <img src="../../icons/images/index/zhuangtai.png" alt="">
  125. <span>空调实时状态</span>
  126. <div class="card-desc">设备总计:{{air_total}} 台</div>
  127. <div class="card-desc">已开机:{{air_on_total}} 台</div>
  128. </div>
  129. <div class="card-desc">A/B=已开机/总设备</div>
  130. </div>
  131. </div>
  132. <el-table :data="zhuangtai_tableData" height="490" stripe :cell-style="cell_style" :header-cell-style="header_cell_style"
  133. style="width: 100%" v-loading="airRealTimeMonitor_loading">
  134. <el-table-column v-for="col in cols" :prop="col.prop" :label="col.label" :align="col.align" :width="col.width">
  135. </el-table-column>
  136. </el-table>
  137. </el-card>
  138. </div>
  139. </el-col>
  140. </el-row>
  141. </div>
  142. </template>
  143. <script>
  144. import {
  145. totalMoney,
  146. thisMonthRecharge,
  147. thisMonthConsume,
  148. airTimeoutWarning,
  149. getChart,
  150. airRealTimeMonitor,
  151. realTimeBusinessInformation
  152. } from '@/api/index';
  153. import * as echarts from 'echarts/core';
  154. import {
  155. TitleComponent,
  156. ToolboxComponent,
  157. TooltipComponent,
  158. GridComponent,
  159. LegendComponent
  160. } from 'echarts/components';
  161. import {
  162. LineChart
  163. } from 'echarts/charts';
  164. import {
  165. CanvasRenderer
  166. } from 'echarts/renderers';
  167. import {
  168. getFormatDateTime
  169. } from '@/utils/common';
  170. echarts.use([
  171. TitleComponent, ToolboxComponent, TooltipComponent, GridComponent, LegendComponent, LineChart,
  172. CanvasRenderer
  173. ]);
  174. var getAirRealTimeMonitor, getRealTimeBusinessInformation;
  175. export default {
  176. data() {
  177. return {
  178. // 弹出框表格
  179. dialogTableVisible: false,
  180. // 弹出框表格
  181. gridData: [{
  182. date: '2016-05-02',
  183. name: '王小虎',
  184. address: '1518'
  185. }, {
  186. date: '2016-05-04',
  187. name: '王小虎',
  188. address: '1518'
  189. }, {
  190. date: '2016-05-01',
  191. name: '王小虎',
  192. address: '1518'
  193. }, {
  194. date: '2016-05-03',
  195. name: '王小虎',
  196. address: '1518'
  197. }, {
  198. date: '2016-05-02',
  199. name: '王小虎',
  200. address: '1518'
  201. }, {
  202. date: '2016-05-04',
  203. name: '王小虎',
  204. address: '1518'
  205. }, {
  206. date: '2016-05-01',
  207. name: '王小虎',
  208. address: '1518'
  209. }, {
  210. date: '2016-05-03',
  211. name: '王小虎',
  212. address: '1518'
  213. }, {
  214. date: '2016-05-02',
  215. name: '王小虎',
  216. address: '1518'
  217. }, {
  218. date: '2016-05-04',
  219. name: '王小虎',
  220. address: '1518'
  221. }, {
  222. date: '2016-05-01',
  223. name: '王小虎',
  224. address: '1518'
  225. }, {
  226. date: '2016-05-03',
  227. name: '王小虎',
  228. address: '1518'
  229. }],
  230. // 账户总余额
  231. showTotalMoney: {
  232. time: '0000/00/00 00:00:00',
  233. amount: 0.00,
  234. loading: false
  235. },
  236. // 本月充值
  237. showThisMonthRecharge: {
  238. time: '0000/00/00 00:00:00', // 时间
  239. amount: 0.00, // 总
  240. online_amount: 0.00, // 线上
  241. offline_amount: 0.00, // 线下
  242. loading: false
  243. },
  244. // 本月消费
  245. showThisMonthConsume: {
  246. time: '0000/00/00 00:00:00',
  247. amount: 0.00,
  248. loading: false
  249. },
  250. // 空调超时预警loading
  251. airTimeoutWarning_loading: false,
  252. // 空调实时监控loading
  253. airRealTimeMonitor_loading: false,
  254. // 实时业务信息,获取充值记录loading
  255. realTimeBusinessInformation_loading: true,
  256. // 选择年份范围
  257. pickerOptions: {
  258. disabledDate(time) {
  259. return (
  260. time.getFullYear() < "2022" || time.getFullYear() > new Date().getFullYear()
  261. );
  262. }
  263. },
  264. showEchartsDate: new Date().getFullYear() + '',
  265. // 表格单元格样式
  266. cell_style: {
  267. color: '#1A202B',
  268. 'font-size': '16px',
  269. 'font-family': 'Microsoft YaHei-3970(82674968)'
  270. },
  271. // 表格头部样式
  272. header_cell_style: {
  273. background: '#E6ECFE',
  274. color: '#1A202B',
  275. 'font-size': '16px',
  276. 'font-family': 'Microsoft YaHei-3970(82674968)'
  277. },
  278. // 预警表格数据
  279. yujing_tableData: [],
  280. // 业务表格数据
  281. yewu_tableData: [],
  282. // 状态表格数据
  283. zhuangtai_tableData: [],
  284. air_on_total: 0,
  285. air_total: 0,
  286. // 列
  287. cols: [],
  288. // 折线图数据
  289. option: {
  290. tooltip: {
  291. trigger: 'axis'
  292. },
  293. legend: {
  294. y: 'bottom',
  295. x: 'center',
  296. data: []
  297. },
  298. grid: {
  299. top: '10%',
  300. left: '3%',
  301. right: '3%',
  302. bottom: '8%',
  303. containLabel: true
  304. },
  305. toolbox: {
  306. feature: {
  307. saveAsImage: {
  308. show: false,
  309. title: '下载'
  310. }
  311. }
  312. },
  313. xAxis: {
  314. type: 'category',
  315. boundaryGap: false,
  316. data: []
  317. },
  318. yAxis: {
  319. name: '元',
  320. type: 'value'
  321. },
  322. series: []
  323. },
  324. time_out_warning: true,
  325. off_line_warning: false
  326. }
  327. },
  328. created() {
  329. // 获取总金额
  330. this.getTotalMoney()
  331. // 本月充值
  332. this.getThisMonthRecharge()
  333. // 本月消费
  334. this.getThisMonthConsume()
  335. // 空调超时预警
  336. this.getAirTimeoutWarning()
  337. // 用电消费走势图
  338. this.getChart()
  339. // 空调实时监控
  340. this.getAirRealTimeMonitor()
  341. getAirRealTimeMonitor = setInterval(() => {
  342. this.getAirRealTimeMonitor()
  343. }, 1000 * 60);
  344. // 实时业务信息,获取充值记录
  345. this.getRealTimeBusinessInformation()
  346. getRealTimeBusinessInformation = setInterval(() => {
  347. this.getRealTimeBusinessInformation()
  348. }, 1000 * 10);
  349. },
  350. beforeDestroy() {
  351. clearInterval(getAirRealTimeMonitor);
  352. clearInterval(getRealTimeBusinessInformation);
  353. },
  354. methods: {
  355. time_out_warning_handle() {
  356. this.time_out_warning = true;
  357. this.off_line_warning = false;
  358. },
  359. off_line_warning_handle() {
  360. this.time_out_warning = false;
  361. this.off_line_warning = true;
  362. },
  363. /**
  364. * 实时业务信息,获取充值记录
  365. */
  366. getRealTimeBusinessInformation() {
  367. this.realTimeBusinessInformation_loading = true
  368. let data = {
  369. page: 1,
  370. rows: 7
  371. }
  372. realTimeBusinessInformation(data).then((res) => {
  373. // console.log(res);
  374. if (typeof res.code == 'undefined' || res.code == '') {
  375. this.$message.error('返回数据格式问题,code未获取到!');
  376. return;
  377. }
  378. if (res.code == 200) {
  379. this.yewu_tableData = [];
  380. let tmp = []
  381. for (var i = 0; i < res.rows.length; i++) {
  382. tmp.push({
  383. desc: res.rows[i].user_name + ' 充值',
  384. dataTime: res.rows[i].time
  385. });
  386. }
  387. this.yewu_tableData = tmp;
  388. } else {
  389. // this.$message.error('空调实时监控返回的数据异常!');
  390. }
  391. }).catch((err) => {
  392. // console.log(err);
  393. this.$message.error(err.message)
  394. });
  395. this.realTimeBusinessInformation_loading = false
  396. },
  397. /**
  398. * 空调实时监控
  399. */
  400. getAirRealTimeMonitor() {
  401. this.airRealTimeMonitor_loading = true
  402. airRealTimeMonitor().then((res) => {
  403. // console.log(res);
  404. if (typeof res.code == 'undefined' || res.code == '') {
  405. this.$message.error('返回数据格式问题,code未获取到!');
  406. return;
  407. }
  408. if (res.code == 200) {
  409. // console.log(res.monthT);
  410. this.air_total = res.air_total;
  411. this.air_on_total = res.air_on_total;
  412. let data = res.monthT;
  413. let tmpData = [];
  414. let rowData = {};
  415. let columns = [{
  416. prop: 'floor', // 数据显示对应的列名
  417. label: '楼层', // 显示的标签
  418. align: "center", // 文本对齐方式
  419. width: 40 // 列宽
  420. }];
  421. for (var i = 0; i < data.length; i++) {
  422. rowData = {
  423. floor: data[i][0].floors
  424. };
  425. for (var j = 1; j < data[i].length; j++) {
  426. rowData[`Build_${j}`] = data[i][j].per
  427. if (columns.length == data[i].length) {
  428. continue;
  429. } else {
  430. // 不给宽度,自适应
  431. columns.push({
  432. prop: `Build_${j}`,
  433. label: data[i][j].build,
  434. align: "center"
  435. });
  436. }
  437. }
  438. tmpData.push(rowData);
  439. }
  440. this.cols = columns;
  441. this.zhuangtai_tableData = tmpData;
  442. } else {
  443. // this.$message.error('空调实时监控返回的数据异常!');
  444. }
  445. }).catch((err) => {
  446. // console.log(err);
  447. this.$message.error(err.message)
  448. });
  449. this.airRealTimeMonitor_loading = false
  450. },
  451. /**
  452. * 获取折线图数据
  453. */
  454. getChart() {
  455. this.echart_loading = true
  456. getChart({
  457. year: this.showEchartsDate
  458. }).then((res) => {
  459. // console.log(res);
  460. if (typeof res.code == 'undefined' || res.code == '') {
  461. this.$message.error('返回数据格式问题,code未获取到!');
  462. return;
  463. }
  464. if (res.code == 200) {
  465. // console.log(res.monthT);
  466. let tmp = res.monthT.sort((a, b) => a.month.localeCompare(b.month));
  467. let legend_data = []
  468. let xAxis_data = []
  469. let series = []
  470. for (var i = 0; i < tmp.length; i++) {
  471. if (legend_data.indexOf(tmp[i].air_config) == -1) {
  472. legend_data.push(tmp[i].air_config)
  473. series.push({
  474. name: tmp[i].air_config,
  475. type: 'line',
  476. // smooth: true,
  477. data: []
  478. });
  479. }
  480. if (xAxis_data.indexOf(tmp[i].month) == -1) {
  481. xAxis_data.push(tmp[i].month)
  482. }
  483. }
  484. // 一般方法,无法解决数据缺失
  485. // for (var i = 0; i < series.length; i++) {
  486. // for (var j = 0; j < xAxis_data.length; j++) {
  487. // for (var k = 0; k < tmp.length; k++) {
  488. // if (series[i].name == tmp[k].air_config && xAxis_data[j] == tmp[k].month) {
  489. // series[i].data.push(tmp[k].num);
  490. // }
  491. // }
  492. // }
  493. // }
  494. // 通用方法,可以解决数据缺失
  495. for (var i = 0; i < series.length; i++) {
  496. for (var j = 0; j < xAxis_data.length; j++) {
  497. let tf = false;
  498. for (var k = 0; k < tmp.length; k++) {
  499. if (series[i].name == tmp[k].air_config && xAxis_data[j] == tmp[k].month) {
  500. series[i].data.push(tmp[k].num);
  501. tf = true;
  502. }
  503. }
  504. if (tf == false) {
  505. series[i].data.push(0.00);
  506. }
  507. }
  508. }
  509. for (var i = 0; i < xAxis_data.length; i++) {
  510. xAxis_data[i] = xAxis_data[i].split('-')[1]
  511. }
  512. // 初始化图表数据
  513. this.option.legend.data = legend_data
  514. this.option.xAxis.data = xAxis_data
  515. this.option.series = series
  516. // console.log(this.option);
  517. } else {
  518. this.option.legend.data = []
  519. this.option.xAxis.data = []
  520. this.option.series = []
  521. this.$message.success('用电消费走势图 暂无数据!');
  522. }
  523. // 初始化图表
  524. this.initCharts();
  525. }).catch((err) => {
  526. // console.log(err);
  527. this.$message.error(err.message)
  528. });
  529. this.echart_loading = false
  530. },
  531. /**
  532. * 选择年份改变了
  533. */
  534. echartsDate_change() {
  535. // console.log(this.showEchartsDate);
  536. this.getChart()
  537. },
  538. /**
  539. * 空调超时预警
  540. */
  541. getAirTimeoutWarning() {
  542. this.airTimeoutWarning_loading = true
  543. airTimeoutWarning().then((res) => {
  544. // console.log(res);
  545. if (typeof res.code == 'undefined' || res.code == '') {
  546. this.$message.error('返回数据格式问题,code未获取到!');
  547. return;
  548. }
  549. if (res.code == 200) {
  550. this.yujing_tableData = [];
  551. for (var i = 0; i < res.monthT.length; i++) {
  552. this.yujing_tableData.push({
  553. deviceId: res.monthT[i].dom + ' ' + res.monthT[i].air_name + ' ' + res.monthT[i].air_config,
  554. warningTime: res.monthT[i].time,
  555. operator: res.monthT[i].user_name,
  556. durationUse: res.monthT[i].duration_use,
  557. contact: res.monthT[i].phone
  558. })
  559. }
  560. } else {
  561. // this.$message.error('空调超时预警返回的数据异常!');
  562. }
  563. }).catch((err) => {
  564. // console.log(err);
  565. this.$message.error(err.message)
  566. });
  567. this.airTimeoutWarning_loading = false
  568. },
  569. /**
  570. * 本月消费
  571. */
  572. getThisMonthConsume() {
  573. this.showThisMonthConsume.loading = true
  574. thisMonthConsume().then((res) => {
  575. // console.log(res);
  576. if (typeof res.code == 'undefined' || res.code == '') {
  577. this.$message.error('返回数据格式问题,code未获取到!')
  578. return
  579. }
  580. if (res.code == 200) {
  581. this.showThisMonthConsume.time = res.time
  582. this.showThisMonthConsume.amount = res.zongCo.tong
  583. } else {
  584. this.$message.error(res.message)
  585. }
  586. }).catch((err) => {
  587. // console.log(err);
  588. this.$message.error(err.message)
  589. });
  590. this.showThisMonthConsume.loading = false
  591. },
  592. /**
  593. * 本月充值
  594. */
  595. getThisMonthRecharge() {
  596. this.showThisMonthRecharge.loading = true
  597. thisMonthRecharge().then((res) => {
  598. // console.log(res);
  599. if (typeof res.code == 'undefined' || res.code == '') {
  600. this.$message.error('返回数据格式问题,code未获取到!')
  601. return
  602. }
  603. if (res.code == 200) {
  604. this.showThisMonthRecharge.time = res.time
  605. this.showThisMonthRecharge.online_amount = res.zongRe.tong // 线上充值
  606. this.showThisMonthRecharge.offline_amount = res.zongRo.tong // 线下充值
  607. this.showThisMonthRecharge.amount = res.zongRe.tong + res.zongRo.tong // 总充值
  608. } else if (res.code == 205) {
  609. this.showThisMonthRecharge.time = getFormatDateTime('datetime');
  610. this.$message.error('本月充值:' + res.message)
  611. } else {
  612. this.showThisMonthRecharge.time = getFormatDateTime('datetime');
  613. this.$message.error('本月充值:' + res.message)
  614. }
  615. }).catch((err) => {
  616. // console.log(err);
  617. this.$message.error(err.message)
  618. });
  619. this.showThisMonthRecharge.loading = false
  620. },
  621. /**
  622. * 获取总金额
  623. */
  624. getTotalMoney() {
  625. this.showTotalMoney.loading = true
  626. totalMoney().then((res) => {
  627. // console.log(res);
  628. if (typeof res.code == 'undefined' || res.code == '') {
  629. this.$message.error('返回数据格式问题,code未获取到!')
  630. return
  631. }
  632. if (res.code == 200) {
  633. this.showTotalMoney.time = res.time
  634. this.showTotalMoney.amount = res.zongYu.tong
  635. } else {
  636. this.$message.error(res.message)
  637. }
  638. }).catch((err) => {
  639. // console.log(err);
  640. this.$message.error(err.message)
  641. });
  642. this.showTotalMoney.loading = false
  643. },
  644. /**
  645. * 初始化折线图
  646. */
  647. initCharts() {
  648. // 基于准备好的dom,初始化echarts实例
  649. var myChart = echarts.init(document.getElementById('main-echart'));
  650. // 绘制图表
  651. myChart.setOption(this.option, true);
  652. },
  653. // 表格某些列样式改变
  654. handle_cell_style({
  655. row,
  656. column,
  657. rowIndex,
  658. columnIndex
  659. }) {
  660. if (columnIndex === 1 || columnIndex === 2) {
  661. // 指定列号
  662. return "font-size:18px; color:#808080"
  663. } else {
  664. return "font-size:18px; color:#292B34"
  665. }
  666. }
  667. }
  668. }
  669. </script>
  670. <style scoped lang="scss">
  671. .app-container {
  672. background-color: #EFF2F7;
  673. padding: 10px;
  674. .el-row {
  675. .el-col {
  676. padding: 10px;
  677. .cell {
  678. padding: 10px;
  679. border-radius: 10px;
  680. background-color: #FFFFFF;
  681. // box-shadow: 5px 5px 15px #979797;
  682. box-shadow: 0px 3px 21px 0px rgba(60, 108, 254, 0.16);
  683. .cell-title {
  684. font-size: 28px;
  685. font-family: Microsoft YaHei-3970(82674968);
  686. font-weight: 400;
  687. color: #292B34;
  688. }
  689. .cell-time {
  690. margin-top: 10px;
  691. font-size: 18px;
  692. font-family: Microsoft YaHei-3970(82674968);
  693. font-weight: 400;
  694. color: #979797;
  695. }
  696. .cell-bottom {
  697. display: flex;
  698. justify-content: space-between;
  699. align-items: center;
  700. margin: 20px 0 0;
  701. .cell-bottom-amount {
  702. font-size: 40px;
  703. font-family: Microsoft YaHei-3970(82674968);
  704. font-weight: bold;
  705. color: #292B34;
  706. }
  707. .cell-footer {
  708. display: flex;
  709. flex-direction: row;
  710. justify-content: space-between;
  711. align-items: flex-end;
  712. font-family: Microsoft YaHei-3970(82674968);
  713. font-weight: bold;
  714. color: #292B34;
  715. .cell-footer-amount {
  716. font-size: 16px;
  717. margin-left: 10px;
  718. }
  719. }
  720. .rmb1 {
  721. display: flex;
  722. justify-content: center;
  723. align-items: center;
  724. width: 60px;
  725. height: 60px;
  726. border-radius: 30px;
  727. font-size: 50px;
  728. color: #FDFDFF;
  729. background: linear-gradient(-45deg, #3965FF, #3055FE);
  730. box-shadow: 0 0 8px #3660FF;
  731. }
  732. .rmb2 {
  733. display: flex;
  734. justify-content: center;
  735. align-items: center;
  736. width: 60px;
  737. height: 60px;
  738. border-radius: 30px;
  739. font-size: 50px;
  740. color: #FDFDFF;
  741. background: linear-gradient(-45deg, #FFB977, #FF5C5C);
  742. box-shadow: 0 0 8px #3660FF;
  743. }
  744. .rmb3 {
  745. display: flex;
  746. justify-content: center;
  747. align-items: center;
  748. width: 60px;
  749. height: 60px;
  750. border-radius: 30px;
  751. font-size: 50px;
  752. color: #FDFDFF;
  753. background: linear-gradient(-45deg, #9187F0, #7760F1);
  754. box-shadow: 0 0 8px #3660FF;
  755. }
  756. }
  757. .box-card {
  758. border: none;
  759. box-shadow: none;
  760. color: #292B34;
  761. .clearfix {
  762. display: flex;
  763. align-items: center;
  764. font-size: 20px;
  765. font-family: Microsoft YaHei-3970(82674968);
  766. img {
  767. width: 24px;
  768. height: 24px;
  769. margin-right: 8px;
  770. }
  771. .card-header-between {
  772. display: flex;
  773. justify-content: space-between;
  774. align-items: center;
  775. width: 100%;
  776. .card-title-left {
  777. display: flex;
  778. align-items: center;
  779. }
  780. .card-desc {
  781. font-family: Microsoft YaHei-3970(82674968);
  782. font-size: 16px;
  783. margin-left: 20px;
  784. }
  785. .pointer {
  786. cursor: pointer;
  787. color: #3965FF;
  788. padding: 3px 5px;
  789. }
  790. .pointer:hover {
  791. color: #FFFFFF;
  792. background-color: #3965FF;
  793. }
  794. .dialog-page {
  795. margin-top: 10px;
  796. }
  797. }
  798. .title-btn {
  799. display: inline-block;
  800. padding: 8px;
  801. color: #3965FF;
  802. cursor: pointer;
  803. }
  804. .title-btn:hover {
  805. color: #FFFFFF;
  806. background-color: #3965FF;
  807. }
  808. }
  809. .select-year {
  810. position: absolute;
  811. right: 20px;
  812. top: 68px;
  813. width: 100px;
  814. z-index: 1;
  815. cursor: pointer;
  816. }
  817. .line-echart {
  818. width: 450px;
  819. height: 370px;
  820. }
  821. }
  822. }
  823. .cell-row1 {
  824. padding: 30px;
  825. }
  826. }
  827. }
  828. }
  829. </style>