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
| $(function () {
| loadEchart();
| });
|
| var vm = new Vue({
| el:'#rapp',
| data:{
| showList: true,
| title: null,
| action: {}
| },
| methods: {
| query: function () {
| vm.reload();
| },
| add: function(){
| },
| update: function () {
| },
| saveOrUpdate: function () {
| },
| del: function () {
| },
| getInfo: function(actionid){
| },
| reload: function () {
| loadEchart();
| },
| refresh: function () {
| vm.showList = true;
| window.location.reload();
| }
| }
| });
|
| function loadEchart() {
| //高度设置
| var height = window.innerHeight - 180;
| $("#echartdiv").css("height",height);
| if($("#logdatebegin").val() > $("#logdatefinish").val()){
| alert("起始年份不能小于结束年份,请重新输入!", function () {
| $("#logdatefinish").focus();
| $("#logdatefinish").focus();
| });
| return false;
| }
| $.ajax({
| url: restServerBaseURL + "log/kettlestepcount/getechartdata",
| type: "POST",
| data: {
| transname:$("#transname").val(),
| stepname:$("#stepname").val(),
| logdatebegin:$("#logdatebegin").val(),
| logdatefinish:$("#logdatefinish").val()
| },
| success: function (result) {
| var data = eval('(' + result.data + ')');
| var echartdiv = document.getElementById("echartdiv");
| var countechart = echarts.init(echartdiv);
| var option = {
| tooltip: {
| trigger: "axis",
| textStyle: {
| fontSize: 18
| }
| },
| legend:{
| bottom:'bottom',
| data:["输入行数","输出行数"]
| },
| color:["#A2DA41","#186FFD"],
| calculable: true,
| xAxis: [
| {
| axisLabel:{
| show: true
| },
| type: "category",
| data: data != "" ? data.legendData : [],
| }],
| yAxis: [
| {
| name: "输入行数",
| nameTextStyle: {
| fontSize: 15
| },
| type: "value",
| axisLabel: {
| show: true,
| textStyle: {
| fontSize: 16
| }
| },
| splitLine: {
| show: false
| },
| splitNumber: 3
| },
| {
| name: "输出行数",
| nameTextStyle: {
| fontSize: 15
| },
| type: "value",
| axisLabel: {
| show: true,
| textStyle: {
| fontSize: 16
| }
| },
| splitLine: {
| show: false
| },
| splitNumber: 2
| }
| ],
| series: [
| {
| name: "输入行数",
| type: "bar",
| data: data != "" ? data.seriesData[0] : []
| }, {
| name: "输出行数",
| type: "bar",
| yAxisIndex: 1,
| data: data != "" ? data.seriesData[1] : []
| }
| ]
| };
| countechart.setOption(option);
| },
| error: function (e) {
| console.log(e.message);
| }
| });
| }
|
|