基于廊坊系统为基础,国防科技大学系统演示Demo
lixuliang
2024-04-30 7f0f5bc0be05b8a9206bcff083442379504db009
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<template>
  <div class="systemMonitoring_box">
    <div id="gauge_chart1"></div>
  </div>
</template>
 
<script>
export default {
  data() {
    //这里存放数据
    return {};
  },
  //方法集合
  methods: {
    gaugeChart1() {
      const colors = ["#91CC75", "#EE6666"];
      let option = {
        color: colors,
        tooltip: {
          trigger: "axis",
          //   axisPointer: {
          // type: "cross",
          //   },
        },
        grid: {
          top: "10%", //grid 组件离容器左侧的距离
          left: "10%", //grid 组件离容器左侧的距离
          right: "30px", //grid 组件离容器右侧的距离
          bottom: "60%", //grid 组件离容器下边距的距离
        },
        // legend: {
        //   data: ["人员", "资金"],
        // },
        xAxis: [
          {
            nameLocation: "middle",
            type: "category",
            axisLabel: {
              interval: 0,
              // rotate: 60,
              textStyle: {
                color: "#fff",
                fontSize: 10,
              },
              formatter: function (value) {
                return value.split("").join("\n");
              },
            },
            // axisTick: {
            //   alignWithLabel: false,
            // },
            data: [
              "中俄东线管道工程南段",
              "中俄东线管道工程中段",
              "广州站",
              "唐山LNG",
              "新疆连木沁站场",
              "中缅天然气管道风险排查航空摄影测量",
              "宁强至安康段天然气管道工程",
              "中缅油气管道数字化恢复测量成果",
              "QZ天然气(成品油)管道工程",
              "西气东输高后果区风险排查项目",
              "管道公司漠大线坐标转换及中心线外业测绘项目",
              "山东管网西干线项目",
              "北京燃气南港LNG应急储备项目外输管道工程",
              "西气东输三线中段管道工程",
              "中哈液化石油气跨境管道项目",
            ],
          },
        ],
        yAxis: [
          {
            type: "value",
            name: "工期(月)",
            position: "left",
            alignTicks: true,
            min: 0, // 起始
            max: 15, // 终止
            axisLine: {
              show: true,
              lineStyle: {
                color: colors[0],
              },
            },
            axisLabel: {
              formatter: "{value}",
            },
          },
          {
            type: "value",
            name: "进度",
            position: "right",
            alignTicks: true,
            min: 0, // 起始
            max: 1, // 终止
            axisLine: {
              show: true,
              lineStyle: {
                color: colors[1],
              },
            },
            axisLabel: {
              formatter: "{value} ",
            },
          },
        ],
        series: [
          {
            name: "工期",
            type: "bar",
            data: [12, 12, 8, 6, 5, 12, 8, 18, 6, 8, 4, 5, 6, 12, 12],
          },
          {
            name: "进度",
            type: "bar",
            yAxisIndex: 1,
            data: [
              0.8, 0.6, 0.4, 0.7, 0.2, 0.6, 0.9, 0.5, 0.3, 0.4, 0.8, 0.1, 0.7,
              0.9, 1,
            ],
          },
        ],
      };
      let myChart = this.$echarts.init(document.getElementById("gauge_chart1"));
      myChart.setOption(option);
      window.addEventListener("resize", function () {
        myChart.resize();
      });
    },
  },
  mounted() {
    this.gaugeChart1();
  },
};
</script>
<style lang="less" scoped>
//@import url(); 引入公共css类
.systemMonitoring_box {
  padding: 5px;
  background: rgba(0, 0, 0, 0.6);
  #gauge_chart1 {
    width: 100%;
    height: 100%;
  }
}
</style>