From e88e654fe1e1065532e6e8911571166d5c118df1 Mon Sep 17 00:00:00 2001
From: 13937891274 <kxc0822>
Date: 星期一, 08 八月 2022 11:41:41 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/views/facilityManagement/EquipmentStatistics/index.vue | 36 ++++++++++++++++++++++++++++++------
1 files changed, 30 insertions(+), 6 deletions(-)
diff --git a/src/views/facilityManagement/EquipmentStatistics/index.vue b/src/views/facilityManagement/EquipmentStatistics/index.vue
index 65cda52..07a359f 100644
--- a/src/views/facilityManagement/EquipmentStatistics/index.vue
+++ b/src/views/facilityManagement/EquipmentStatistics/index.vue
@@ -7,10 +7,36 @@
<script lang="ts">
import { defineComponent, onMounted, ref } from 'vue';
import * as echarts from 'echarts';
+import { ElMessage } from 'element-plus';
+import { facilityManagementApi } from '/@/api/facilityManagement';
export default defineComponent({
setup() {
+ const listApi = () => {
+ facilityManagementApi()
+ .getequipmentInfoStatistics()
+ .then((res) => {
+ if (res.data.code == 200) {
+ let arr=[]
+ arr=res.data.data
+ let date=[]
+ for (let i = 0; i < arr.length; i++) {
+ date.push(arr[i].count)
+ }
+ init(date);
+ } else {
+ ElMessage({
+ showClose: true,
+ message: res.data.msg,
+ type: 'error',
+ });
+ }
+ });
+ };
+ onMounted(() => {
+ listApi();
+ });
const main = ref();
- const init = () => {
+ const init = (data:any) => {
var myChart = echarts.init(main.value);
var option = {
tooltip: {},
@@ -35,7 +61,7 @@
color: ['#6394f9'],
series: [
{
- data: [120, 200, 150, 80, 70, 110, 130],
+ data: data,
type: 'bar',
},
],
@@ -43,13 +69,11 @@
myChart.setOption(option);
};
- onMounted(() => {
- init();
- });
return {
init,
onMounted,
main,
+ listApi,
};
},
});
@@ -57,7 +81,7 @@
<style scoped>
.box {
background-color: #fff;
- box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
+ box-shadow: 0 2px 12px 0 rgb(0 0 0 / 10%);
}
.title {
font-size: 16px;
--
Gitblit v1.9.2