|
@@ -17,7 +17,7 @@
|
|
|
</div>
|
|
|
<div class="chart_cont">
|
|
|
<div class="chart_left">
|
|
|
- <GraphicEchart :id="1" :texter="dataall" />
|
|
|
+ <GraphicEchart :texter="dataall" />
|
|
|
</div>
|
|
|
<div class="chart_right pt90">
|
|
|
<div class="child">
|
|
@@ -235,10 +235,12 @@
|
|
|
<script>
|
|
|
import GraphicEchart from "../components/graphicHome.vue";
|
|
|
import SecurityCheckHeader from "../components/securityCheckHeader.vue";
|
|
|
+import { agent } from "@/api/statistics/statistics.js";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
dataall: {
|
|
|
+ id: 13,
|
|
|
name: "总件数",
|
|
|
cont: "500",
|
|
|
data: [
|
|
@@ -280,10 +282,33 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
methods: {
|
|
|
change() {
|
|
|
this.$router.push("./agentTable");
|
|
|
},
|
|
|
+ async getData() {
|
|
|
+ try {
|
|
|
+ const result = await agent({});
|
|
|
+ let count = 0;
|
|
|
+ let counts = 0;
|
|
|
+ let arr = [];
|
|
|
+ //获取总件数:
|
|
|
+ result.data.forEach((item) => {
|
|
|
+ count += item.num;
|
|
|
+ let obj = { value: item.num, name: item.risk };
|
|
|
+ arr.push(obj);
|
|
|
+ });
|
|
|
+ this.dataall.cont = count;
|
|
|
+ this.dataall.data = arr;
|
|
|
+ this.dataall.color = [];
|
|
|
+ console.log(result.data);
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
components: {
|
|
|
GraphicEchart,
|