1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
| <script setup lang="ts">
| import {ref, reactive, onMounted} from "vue";
| import CapsuleChart from "@/components/datav/capsule-chart";
| import { currentGET } from "@/api";
|
| const config = ref({
| showValue: true,
| unit: "次",
| });
| const data= ref([])
| const getData = () => {
| currentGET("rightCenter").then((res) => {
| console.log("报警排名", res);
| if (res.success) {
| data.value =res.data;
| console.log("data", res.data)
| } else {
| window["$message"]({
| text: res.msg,
| type: "warning",
| });
| }
| });
| };
|
| onMounted(() =>{
| // getData();
| let obj=[
| {
| "value": 942,
| "name": "常德市"
| },
| {
| "value": 889,
| "name": "张家口市"
| },
| {
| "value": 691,
| "name": "周口市"
| },
| {
| "value": 621,
| "name": "澳门半岛"
| },
| {
| "value": 520,
| "name": "包头市"
| },
| {
| "value": 207,
| "name": "乌海市"
| },
| {
| "value": 157,
| "name": "青岛市"
| },
| {
| "value": 86,
| "name": "营口市"
| }
| ]
| data.value = obj
| })
| </script>
|
| <template>
| <div class="right_bottom">
| <CapsuleChart :config="config" style="width: 100%; height: 260px" :data="data"/>
| </div>
| </template>
|
| <style scoped lang="scss">
|
| .right_bottom {
| box-sizing: border-box;
| padding: 0 16px;
| height: 100%;
| }
| </style>
|
|