| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <template>
- <view class="container">
- <qiun-title-bar title="商户统计分析" />
- <view class="charts-box"><qiun-data-charts type="ring" canvasId="chart21" :canvas2d="isCanvas2d" :opts="{ legend: { position: 'bottom' }, title: { name: '商户数量', fontSize: 15, color: '#333' }, subtitle: { name: baseInfo.company.total, fontSize: 25, color: '#7cb5ec' }, extra: { ring: { ringWidth: 40, linearType: 'custom', centerColor: '#eee' } } }" :chartData="data1" /></view>
- <qiun-title-bar title="净化设施统计分析" />
- <view class="charts-box">
- <qiun-data-charts type="ring" canvasId="chart22" :canvas2d="isCanvas2d" :opts="{ legend: { position: 'bottom' }, title: { name: '净化设施数量', fontSize: 15, color: '#333' }, subtitle: { name: baseInfo.facilities.total, fontSize: 25, color: '#7cb5ec' }, extra: { ring: { ringWidth: 40, linearType: 'custom', centerColor: '#eee' } } }" :chartData="data2" />
- </view>
- <qiun-title-bar title="监控仪统计分析" />
- <view class="charts-box">
- <qiun-data-charts type="ring" canvasId="chart23" :canvas2d="isCanvas2d" :opts="{ legend: { position: 'bottom' }, title: { name: '监控仪数量', fontSize: 15, color: '#333' }, subtitle: { name: baseInfo.monitor.total, fontSize: 25, color: '#7cb5ec' }, extra: { ring: { ringWidth: 40, linearType: 'custom', centerColor: '#eee' } } }" :chartData="data3" />
- </view>
- </view>
- </view>
-
- </view>
- </template>
- <script>
- import api from "@/common/api.js";
- import { log } from "@/utils/base.js";
- export default {
- data() {
- return {
- baseInfo: {
- company: {
- operate: 0,
- rest: 0,
- outlet: 0,
- stove: 0,
- total: 0,
- },
- facilities: {
- normal: 0,
- rest: 0,
- over: 0,
- abnormal: 0,
- total: 0,
- },
- monitor: {
- normal: 0,
- abnormal: 0,
- total: 0,
- },
- },
- data1: {},
- data2: {},
- data3: {},
- //#ifndef MP-WEIXIN
- isCanvas2d: false,
- //#endif
- //#ifdef MP-WEIXIN
- isCanvas2d: true,
- //#endif
- };
- },
- computed: {},
- mounted() {
- this.getInfo();
- },
- methods: {
- getInfo() {
- api.getBaseInfo().then(data => {
- this.baseInfo = data;
- this.data1 = {
- series: [
- {
- data: [
- {
- value: this.baseInfo.company.rest,
- name: "休息",
- },
- {
- value: this.baseInfo.company.operate,
- name: "营业",
- },
- ],
- },
- ],
- };
- this.data2 = {
- series: [
- {
- data: [
- {
- value: this.baseInfo.facilities.rest,
- name: "休息",
- },
- {
- value: this.baseInfo.facilities.normal,
- name: "正常",
- },
- {
- value: this.baseInfo.facilities.over,
- name: "超标",
- },
- {
- value: this.baseInfo.facilities.abnormal,
- name: "异常",
- },
- ],
- },
- ],
- };
- this.data3 = {
- series: [
- {
- data: [
- {
- value: this.baseInfo.monitor.normal,
- name: "正常",
- },
- {
- value: this.baseInfo.monitor.abnormal,
- name: "停电",
- },
- ],
- },
- ],
- };
- log("BASE_INFO", this.baseInfo);
- });
- },
- },
- };
- </script>
- <style>
- .container {
- padding: 10px 0;
- font-size: 14px;
- line-height: 24px;
- }
- .charts-box {
- width: 100%;
- height: 300px;
- }
- </style>
|