Blame view

js/index.js 5.79 KB
79843366   liuqimichale   index echarts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  var fun = {
      init:function () {
          var myChart = echarts.init(document.getElementById('echart-main'));
  
          // 指定图表的配置项和数据
          var option = {
              tooltip : {
                  trigger: 'axis',
                  formatter:'{a}: <br />{b}: {c}',
                  axisPointer: {
                      type: 'line',
                      label: {
                          backgroundColor: '#6a7985'
                      },
                      lineStyle:{
                          color:'#2abb9b'
                      }
                  },
  
              },
              grid: {
                  left: '0',
                  right: '3%',
62be6687   wb   接口平台对接
24
                  bottom: '1%',
79843366   liuqimichale   index echarts
25
26
27
28
29
30
31
32
                  top:'3%',
                  containLabel: true
              },
              xAxis : [
                  {
                      boundaryGap: false,
                      type : 'category',
                      boundaryGap : false,
62be6687   wb   接口平台对接
33
                      data : ['首页','支付','我的管理','余额','会员卡','车牌'],
79843366   liuqimichale   index echarts
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
                      axisTick:{
                          show:false,
                      },
                      axisLine:{
                          lineStyle:{
                              color:'#e5e5e5',
                          }
                      },
                      splitLine:{
                          show:false,
                      },
                      axisLabel: {
                          show: true,
                          textStyle: {
                              color: '#333'
                          }
                      }
                  }
              ],
              yAxis : [
                  {
                      boundaryGap: false,
                      type : 'value',
                      axisTick:{
                          show:false,
                      },
                      axisLine:{
                          lineStyle:{
                              color:'#e5e5e5',
                          }
                      },
                      splitLine:{
                        show:false,
                      },
                      axisLabel: {
                          show: true,
                          textStyle: {
                              color: '#333'
                          }
                      }
                  }
              ],
              series : [
                  {
                      smooth:true,
                      name:'接入接口统计',
                      // symbol:'image://./../image/symbol.png',
                      symbol:'image://image/symbol.png',
                      symbolOffset:[0,5],
                      symbolSize:26,
                      type:'line',
                      stack: '总量',
                      areaStyle: {normal: {
                          color:'rgba(38,190,150,.1)'
                      }},
                      lineStyle:{
                          normal: {
                              color:'#2abb9b',
                              width:3,
                          }
                      },
62be6687   wb   接口平台对接
95
                      data:[4, 12, 14, 9, 8, 3, 8]
79843366   liuqimichale   index echarts
96
97
98
99
                  },
  
              ]
          };
62be6687   wb   接口平台对接
100
101
   homePage();
   queryApiList();
79843366   liuqimichale   index echarts
102
103
104
105
          // 使用刚指定的配置项和数据显示图表。
          myChart.setOption(option);
      },
  };
90ba4633   liuqimichale   index api 列表
106
  fun.init();
62be6687   wb   接口平台对接
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
  
  function homePage(){
  	var req = {
  				sysCode: sysComm.sysCode,
  				apiType: 1
  			};
  			sysAjax({
  				method: "post",
  				url: dataUrl.util.queryHomePage(),
  				data: JSON.stringify(req),
  				contentType: 'application/json; charset=utf-8',
  				dataType: 'json',
  				async: false,
  				success: function(res) {
  					$('#total_api_no').text(res.apiCount);
  					$('#total_api_hy__no').text(res.apiHYCount)
  					$.each(res.apiListDTO, function (index, domEle) {
d3f71e57   wb  
124
125
  						if(index<3){
  							 var str = '<li>';
62be6687   wb   接口平台对接
126
                              str += '<div></div>';
d3f71e57   wb  
127
128
129
130
131
132
133
134
                              str += '<div title="'+domEle.uddi+'">'+domEle.uddi+'</div>';
                              str += '<div>'+domEle.apiCount+'</div>';
                              str += '</li>';
                             $('.ranking-list').append(str)
  						}else{
  							 var str = '<li>';
                              str += '<div>'+(index+1)+'</div>';
                              str += '<div title="'+domEle.uddi+'">'+domEle.uddi+'</div>';
62be6687   wb   接口平台对接
135
136
                              str += '<div>'+domEle.apiCount+'</div>';
                              str += '</li>';
d3f71e57   wb  
137
138
139
                             $('.ranking-list').append(str)
  						}
                         
62be6687   wb   接口平台对接
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
                      });
  				}
  			});
  };
  
  function queryApiList(){
  	var req = {
  				sysCode: sysComm.sysCode,
  				apiType: 1
  			};
  			sysAjax({
  				method: "post",
  				url: dataUrl.util.queryApiList(),
  				data: JSON.stringify(req),
  				contentType: 'application/json; charset=utf-8',
  				dataType: 'json',
  				async: false,
  				success: function(res) {
  					$.each(res, function (index, domEle) {
                          var str = '<li>';
                              str += '<div class="float-left">';
                              str += '<span data-id="'+domEle.url+'">'+domEle.code+'</span>';
                              str += '</div>';
                              str += '<div class="float-left">'+domEle.uddi+'</div>';
                              str += '</li>';
                          $('#list-con-wrap').append(str)
                      });
  				}
  			});
  };
  
90ba4633   liuqimichale   index api 列表
171
172
173
174
175
  $('#link-div span').on('click',function () {
     var index = $(this).index();
     $(this).addClass('linkActive').siblings('span').removeClass('linkActive');
      $('#link-con .link-con-1').addClass('display-none');
      $('#link-con .link-con-1').eq(index).removeClass('display-none');
7a96376f   liuqimichale   index api 查看详情事件
176
177
178
179
180
      $('#list-detail-wrap').addClass('display-none');
      $('#list-main-wrap').removeClass('display-none');
  });
  $(document).delegate('#list-con-wrap li span','click',function () {
     var id = $(this).attr('data-id');
62be6687   wb   接口平台对接
181
182
183
     window.open(id);   
    /* $('#list-main-wrap').addClass('display-none');
     $('#list-detail-wrap').removeClass('display-none');*/
887ce88f   Andy   loginout
184
  });