|
1
|
-define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) {
|
1
|
+
|
|
|
|
2
|
+
|
|
|
|
3
|
+
|
|
|
|
4
|
+
|
|
|
|
5
|
+
|
|
|
|
6
|
+define(['jquery', 'bootstrap', 'backend', 'form', 'table','echarts', 'echarts-theme'], function ($, undefined, Backend, Form, Table, Echarts) {
|
|
2
|
var Controller = {
|
7
|
var Controller = {
|
|
3
|
index: function () {
|
8
|
index: function () {
|
|
4
|
// 初始化表格参数配置
|
9
|
// 初始化表格参数配置
|
|
@@ -94,13 +99,266 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin |
|
@@ -94,13 +99,266 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin |
|
94
|
});
|
99
|
});
|
|
95
|
//导出功能
|
100
|
//导出功能
|
|
96
|
$(document).on("click", ".btn-export", function () {
|
101
|
$(document).on("click", ".btn-export", function () {
|
|
97
|
- console.log("导出功能");
|
|
|
|
98
|
//以后可以添加检索条件 location.search
|
102
|
//以后可以添加检索条件 location.search
|
|
99
|
top.location.href="/school/project_summary/export";
|
103
|
top.location.href="/school/project_summary/export";
|
|
100
|
});
|
104
|
});
|
|
|
|
105
|
+ //统计查看
|
|
|
|
106
|
+ $(document).on("click", "#btn-statistics", function () {
|
|
|
|
107
|
+ Fast.api.open('/school/project_summary/statistics','统计',{area: ['75%', '70%'],});
|
|
|
|
108
|
+ });
|
|
101
|
// 为表格绑定事件
|
109
|
// 为表格绑定事件
|
|
102
|
Table.api.bindevent(table);
|
110
|
Table.api.bindevent(table);
|
|
103
|
},
|
111
|
},
|
|
|
|
112
|
+ statistics: function() {
|
|
|
|
113
|
+ var vm = new Vue({
|
|
|
|
114
|
+ el:"#app",
|
|
|
|
115
|
+ data() {
|
|
|
|
116
|
+ return {
|
|
|
|
117
|
+ statistics_val:'',
|
|
|
|
118
|
+ collegeList:[],
|
|
|
|
119
|
+ match_title:'',
|
|
|
|
120
|
+ title:[],
|
|
|
|
121
|
+ }
|
|
|
|
122
|
+ },
|
|
|
|
123
|
+ mounted() {
|
|
|
|
124
|
+ this.collegeList = Config.collegeList;
|
|
|
|
125
|
+ this.statistics();
|
|
|
|
126
|
+ },
|
|
|
|
127
|
+ methods: {
|
|
|
|
128
|
+ statistics:function() {
|
|
|
|
129
|
+ var _this = this;
|
|
|
|
130
|
+ //请求数据
|
|
|
|
131
|
+ $.ajax({
|
|
|
|
132
|
+ url:'/school/project_summary/statistics',
|
|
|
|
133
|
+ type:'post',
|
|
|
|
134
|
+ dataType:'json',
|
|
|
|
135
|
+ success:function(res){
|
|
|
|
136
|
+ if(res.code != 0) {
|
|
|
|
137
|
+ _this.match_title = res.data.match_title;
|
|
|
|
138
|
+ _this.title = res.data.group.title;
|
|
|
|
139
|
+ var Group = Echarts.init(document.getElementById('group')),
|
|
|
|
140
|
+ people = Echarts.init(document.getElementById('people')),
|
|
|
|
141
|
+ college = Echarts.init(document.getElementById('college'));
|
|
|
|
142
|
+ var groupOption = {
|
|
|
|
143
|
+ title: {
|
|
|
|
144
|
+ x:'center',
|
|
|
|
145
|
+ text: res.data.match_title + '【各项目类型报名组数统计】',
|
|
|
|
146
|
+ },
|
|
|
|
147
|
+ xAxis: {
|
|
|
|
148
|
+ type: 'category',
|
|
|
|
149
|
+ data: res.data.group.title,
|
|
|
|
150
|
+ axisTick: {
|
|
|
|
151
|
+ alignWithLabel: true
|
|
|
|
152
|
+ },
|
|
|
|
153
|
+ axisLabel: {
|
|
|
|
154
|
+ interval:0,
|
|
|
|
155
|
+ rotate:40//角度顺时针计算的
|
|
|
|
156
|
+ },
|
|
|
|
157
|
+ max:function (value) {
|
|
|
|
158
|
+ if (value.max < 8 ){
|
|
|
|
159
|
+ value.max = 8;
|
|
|
|
160
|
+ } else {
|
|
|
|
161
|
+ value.max = value.max;
|
|
|
|
162
|
+ }
|
|
|
|
163
|
+ return value.max;
|
|
|
|
164
|
+ },
|
|
|
|
165
|
+ },
|
|
|
|
166
|
+ grid: { bottom: "35%" },
|
|
|
|
167
|
+ yAxis: {
|
|
|
|
168
|
+ type : 'value',
|
|
|
|
169
|
+ axisLine: {
|
|
|
|
170
|
+ lineStyle: {
|
|
|
|
171
|
+ color: "#272822"
|
|
|
|
172
|
+ }
|
|
|
|
173
|
+ }
|
|
|
|
174
|
+ },
|
|
|
|
175
|
+ series: [{
|
|
|
|
176
|
+ data:res.data.group.value,
|
|
|
|
177
|
+ type: 'bar',
|
|
|
|
178
|
+ itemStyle: {
|
|
|
|
179
|
+ normal: {
|
|
|
|
180
|
+ label: {
|
|
|
|
181
|
+ show: true, //开启显示
|
|
|
|
182
|
+ position: 'top', //在上方显示
|
|
|
|
183
|
+ textStyle: { //数值样式
|
|
|
|
184
|
+ color: '#AAAAAA',
|
|
|
|
185
|
+ fontSize: 12
|
|
|
|
186
|
+ }
|
|
|
|
187
|
+ }
|
|
|
|
188
|
+ }
|
|
|
|
189
|
+ },
|
|
|
|
190
|
+ }]
|
|
|
|
191
|
+ };
|
|
|
|
192
|
+ var peopleOption = {
|
|
|
|
193
|
+ title: {
|
|
|
|
194
|
+ x:'center',
|
|
|
|
195
|
+ text: res.data.match_title + '【各项目类型报名人数统计】',
|
|
|
|
196
|
+ },
|
|
|
|
197
|
+ xAxis: {
|
|
|
|
198
|
+ type: 'category',
|
|
|
|
199
|
+ data: res.data.people.title,
|
|
|
|
200
|
+ axisTick: {
|
|
|
|
201
|
+ alignWithLabel: true
|
|
|
|
202
|
+ },
|
|
|
|
203
|
+ axisLabel: {
|
|
|
|
204
|
+ interval:0,
|
|
|
|
205
|
+ rotate:40//角度顺时针计算的
|
|
|
|
206
|
+ },
|
|
|
|
207
|
+ max:function (value) {
|
|
|
|
208
|
+ if (value.max < 8 ){
|
|
|
|
209
|
+ value.max = 8;
|
|
|
|
210
|
+ } else {
|
|
|
|
211
|
+ value.max = value.max;
|
|
|
|
212
|
+ }
|
|
|
|
213
|
+ return value.max;
|
|
|
|
214
|
+ },
|
|
|
|
215
|
+ },
|
|
|
|
216
|
+ grid: { bottom: "35%" },
|
|
|
|
217
|
+ yAxis: {
|
|
|
|
218
|
+ type : 'value',
|
|
|
|
219
|
+ axisLine: {
|
|
|
|
220
|
+ lineStyle: {
|
|
|
|
221
|
+ color: "#272822"
|
|
|
|
222
|
+ }
|
|
|
|
223
|
+ }
|
|
|
|
224
|
+ },
|
|
|
|
225
|
+ series: [{
|
|
|
|
226
|
+ data:res.data.people.value,
|
|
|
|
227
|
+ type: 'bar',
|
|
|
|
228
|
+ itemStyle: {
|
|
|
|
229
|
+ normal: {
|
|
|
|
230
|
+ label: {
|
|
|
|
231
|
+ show: true, //开启显示
|
|
|
|
232
|
+ position: 'top', //在上方显示
|
|
|
|
233
|
+ textStyle: { //数值样式
|
|
|
|
234
|
+ color: '#AAAAAA',
|
|
|
|
235
|
+ fontSize: 12
|
|
|
|
236
|
+ }
|
|
|
|
237
|
+ }
|
|
|
|
238
|
+ }
|
|
|
|
239
|
+ },
|
|
|
|
240
|
+ }]
|
|
|
|
241
|
+ };
|
|
|
|
242
|
+ var collegeOption = {
|
|
|
|
243
|
+ title: {
|
|
|
|
244
|
+ x:'center',
|
|
|
|
245
|
+ text: res.data.match_title + '【各学院项目报名组统计】',
|
|
|
|
246
|
+ },
|
|
|
|
247
|
+ xAxis: {
|
|
|
|
248
|
+ type: 'category',
|
|
|
|
249
|
+ data: _this.title,
|
|
|
|
250
|
+ axisTick: {
|
|
|
|
251
|
+ alignWithLabel: true
|
|
|
|
252
|
+ },
|
|
|
|
253
|
+ axisLabel: {
|
|
|
|
254
|
+ interval:0,
|
|
|
|
255
|
+ rotate:40//角度顺时针计算的
|
|
|
|
256
|
+ },
|
|
|
|
257
|
+ max:function (value) {
|
|
|
|
258
|
+ if (value.max < 8 ){
|
|
|
|
259
|
+ value.max = 8;
|
|
|
|
260
|
+ } else {
|
|
|
|
261
|
+ value.max = value.max;
|
|
|
|
262
|
+ }
|
|
|
|
263
|
+ return value.max;
|
|
|
|
264
|
+ },
|
|
|
|
265
|
+ },
|
|
|
|
266
|
+ grid: { bottom: "35%" },
|
|
|
|
267
|
+ yAxis: {
|
|
|
|
268
|
+ type : 'value',
|
|
|
|
269
|
+ axisLine: {
|
|
|
|
270
|
+ lineStyle: {
|
|
|
|
271
|
+ color: "#272822"
|
|
|
|
272
|
+ }
|
|
|
|
273
|
+ }
|
|
|
|
274
|
+ },
|
|
|
|
275
|
+ series: [{
|
|
|
|
276
|
+ data:[],
|
|
|
|
277
|
+ type: 'bar',
|
|
|
|
278
|
+ itemStyle: {
|
|
|
|
279
|
+ normal: {
|
|
|
|
280
|
+ label: {
|
|
|
|
281
|
+ show: true, //开启显示
|
|
|
|
282
|
+ position: 'top', //在上方显示
|
|
|
|
283
|
+ textStyle: { //数值样式
|
|
|
|
284
|
+ color: '#AAAAAA',
|
|
|
|
285
|
+ fontSize: 12
|
|
|
|
286
|
+ }
|
|
|
|
287
|
+ }
|
|
|
|
288
|
+ }
|
|
|
|
289
|
+ },
|
|
|
|
290
|
+ }]
|
|
|
|
291
|
+ };
|
|
|
|
292
|
+ Group.setOption(groupOption);
|
|
|
|
293
|
+ people.setOption(peopleOption);
|
|
|
|
294
|
+ college.setOption(collegeOption);
|
|
|
|
295
|
+ }
|
|
|
|
296
|
+ }
|
|
|
|
297
|
+ })
|
|
|
|
298
|
+ },
|
|
|
|
299
|
+ getData:function(val) {
|
|
|
|
300
|
+ var _this = this;
|
|
|
|
301
|
+ $.ajax({
|
|
|
|
302
|
+ url:'/school/project_summary/getCollegeData',
|
|
|
|
303
|
+ type:'post',
|
|
|
|
304
|
+ data:{college_id:val},
|
|
|
|
305
|
+ dataType:'json',
|
|
|
|
306
|
+ success:function(res){
|
|
|
|
307
|
+ if(res.code != 0) {
|
|
|
|
308
|
+ var college = Echarts.init(document.getElementById('college'));
|
|
|
|
309
|
+ var collegeOption = {
|
|
|
|
310
|
+ title: {
|
|
|
|
311
|
+ x:'center',
|
|
|
|
312
|
+ text: _this.match_title + '【各学院项目报名组统计】',
|
|
|
|
313
|
+ subtext: '',
|
|
|
|
314
|
+ },
|
|
|
|
315
|
+ xAxis: {
|
|
|
|
316
|
+ type: 'category',
|
|
|
|
317
|
+ data: res.data.title,
|
|
|
|
318
|
+ axisTick: {
|
|
|
|
319
|
+ alignWithLabel: true
|
|
|
|
320
|
+ },
|
|
|
|
321
|
+ axisLabel: {
|
|
|
|
322
|
+ interval:0,
|
|
|
|
323
|
+ rotate:40//角度顺时针计算的
|
|
|
|
324
|
+ },
|
|
|
|
325
|
+ },
|
|
|
|
326
|
+ grid: { bottom: "35%" },
|
|
|
|
327
|
+ yAxis: {
|
|
|
|
328
|
+ type : 'value',
|
|
|
|
329
|
+ axisLine: {
|
|
|
|
330
|
+ lineStyle: {
|
|
|
|
331
|
+ color: "#272822"
|
|
|
|
332
|
+ }
|
|
|
|
333
|
+ }
|
|
|
|
334
|
+ },
|
|
|
|
335
|
+ series: [{
|
|
|
|
336
|
+ data:res.data.val,
|
|
|
|
337
|
+ type: 'bar',
|
|
|
|
338
|
+ itemStyle: {
|
|
|
|
339
|
+ normal: {
|
|
|
|
340
|
+ label: {
|
|
|
|
341
|
+ show: true, //开启显示
|
|
|
|
342
|
+ position: 'top', //在上方显示
|
|
|
|
343
|
+ textStyle: { //数值样式
|
|
|
|
344
|
+ color: '#AAAAAA',
|
|
|
|
345
|
+ fontSize: 12
|
|
|
|
346
|
+ }
|
|
|
|
347
|
+ }
|
|
|
|
348
|
+ }
|
|
|
|
349
|
+ },
|
|
|
|
350
|
+ }]
|
|
|
|
351
|
+ };
|
|
|
|
352
|
+ college.setOption(collegeOption);
|
|
|
|
353
|
+ }
|
|
|
|
354
|
+ }
|
|
|
|
355
|
+ });
|
|
|
|
356
|
+ },
|
|
|
|
357
|
+ },
|
|
|
|
358
|
+
|
|
|
|
359
|
+ })
|
|
|
|
360
|
+
|
|
|
|
361
|
+ },
|
|
104
|
api: {
|
362
|
api: {
|
|
105
|
bindevent: function () {
|
363
|
bindevent: function () {
|
|
106
|
Form.api.bindevent($("form[role=form]"));
|
364
|
Form.api.bindevent($("form[role=form]"));
|