-
Notifications
You must be signed in to change notification settings - Fork 0
/
2020.html
722 lines (634 loc) · 18 KB
/
2020.html
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>发稿明细</title>
<style type="text/css">
*{padding: 0px;margin: 0px;}
a{
color:black;
text-decoration: none;
}
.loading{
width: 100%;
height: 100%;
position:fixed;
top:0;
left: 0;
z-index: 100;
background: white;
}
.pic{
width:80px;
height:80px;
background-image:url(__img__/pro/load.gif);
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
margin:auto;
}
.container{
width: 2600px;
height: 100%;
overflow: hidden;
border: 5px solid rgba(256,256,256,1);
margin: 18px auto 0px;
position: relative;
}
#box{
width: 2600px;
height: 580px;
}
#div_logo{
width:60px;
height:60px;
position:absolute;
top:10px;
left:50px;
}
#div_intoweb{
width:60px;
height:40px;
line-height:40px;
position: absolute;
top:80px;
left:55px;
z-index: 100;
}
#div_actionsign{
width:60px;
height:40px;
line-height:40px;
position: absolute;
top:120px;
left:55px;
z-index: 100;
}
#div_pub{
width:60px;
height:40px;
line-height:40px;
position: absolute;
top:160px;
left:55px;
z-index: 100;
}
#colorful_clock{
width:60px;
height:40px;
line-height:40px;
position: absolute;
text-align: center;
top:200px;
left:55px;
z-index: 100;
font-size:14px;
font-weight: 800;
}
#colorful_clock a,#colorful_clock a:visited{
color:rgb(38,148,247);
}
#div_todaytime{
width:80px;
position: absolute;
top:474px;
left:55px;
z-index: 100;
font-size:12px;
color:rgb(255,0,0);
text-align: center;
/*background: lavender;*/
border:2px solid transparent;
border-radius: 8px;
padding:6px 0px;
box-sizing:border-box;
animation: circle 2s ease infinite;
}
@keyframes circle{
25%{
border-top:2px solid #eedd78;
border-right:2px solid transparent;
border-bottom:2px solid transparent;
border-left:2px solid transparent;
}
50%{
border-top:2px solid #eedd78;
border-right:2px solid #73b9bc;
border-bottom:2px solid transparent;
border-left:2px solid transparent;
}
75%{
border-top:2px solid #eedd78;
border-right:2px solid #73b9bc;
border-bottom:2px solid #dd6b66;
border-left:2px solid transparent;
}
85%{
border-top:2px solid #eedd78;
border-right:2px solid #73b9bc;
border-bottom:2px solid #dd6b66;
border-left:2px solid #FF0000;
}
100%{
border:2px solid transparent;
}
}
#div_todaytime p{
animation: fade 2s ease infinite;
}
@keyframes fade{
25%{
opacity: 1;
}
50%{
opacity: 1;
}
75%{
opacity: 0;
}
85%{
opacity: 0;
}
100%{
opacity: 1;
}
}
#div_pub a,#div_intoweb a,#div_actionsign a{
text-decoration: none;
font-size:14px;
cursor: pointer;
color:black;
}
#div_month{
width:100%;
height:30px;
/*background: gray;*/
position: fixed;
bottom:8px;
left:0px;
text-align: center;
z-index: 90;
box-sizing: border-box;
}
.qh{
width: auto;
height: auto;
overflow: hidden;
position: absolute;
top: 5px;
left: 62%;
transform: translateX(-50%);
}
.qh button{
width: 110px;
height:30px;
line-height: 30px;
font-size: 16px;
border-radius: 8px;
outline: none;
border:none;
cursor: pointer;
}
#div_month button{
width: 7%;
height:30px;
margin-right: 10px;
line-height: 30px;
font-size: 16px;
border-radius: 8px;
outline: none;
border:none;
cursor: pointer;
}
.qh button:hover,#div_month button:hover{
background:#005eaa;
color:white;
}
.active{
background:#005eaa;
color:white;
}
/* 手机端提示 */
p#ts{
margin-top:40px;
text-align: center;
font-size: 45px;
color:red;
display: none;
}
@media only screen and (max-width: 981px){
.container{
height: 2600px;
transform: rotate(-90deg);
margin-left: 400px;
margin-bottom:100px;
position: absolute;
left:0px;
top:0px;
font-size: 10vw;
}
p#ts{
display: block;
}
#box{
}
#div_logo{
display:none;
}
#div_intoweb,#div_pub,#div_actionsign{
display:none;
}
.qh{
top: -60px;
}
#div_month{
position: absolute;
left:20px;
top:20px;
z-index:999;
}
#div_month button{
width: 120px;
display: block;
margin-top:16px;
}
.qh button,#div_month button{
border:1px solid gray;
box-shadow: 1px 1px 3px black;
}
/*今日时间*/
#div_todaytime{
display: none;
}
#colorful_clock{
display: none;
}
}
@media (orientation: portrait) {
#div_screen{
display: none;
}
}
</style>
<link rel="stylesheet" href="__frontcss__/animate.min.css" type="text/css" />
<script src="__js__/echartsplugin/echarts.min.js"></script>
<script src="__js__/jquery-1.5.2.min.js"></script>
<script src="__js__/publicdatajs/publicnews.js"></script>
<script src="https://www.runoob.com/static/js/wonderland.js"></script>
</head>
<body>
<div class="container">
<!-- 读特logo -->
<div id="div_logo" class="animated flipInY infinite">
<img src="__img__/icon/dute.png" alt="" width="100%" height="100%">
</div>
<!-- 链接官网 -->
<div id="div_intoweb">
<a onmousemove="this.style.color='red'" onmouseout="this.style.color='black'" href="https://www.dutenews.com/" target="_blank">进入官网</a>
</div>
<!-- 动态示意 -->
<div id="div_actionsign">
<a onmousemove="this.style.color='red'" onmouseout="this.style.color='black'" href="/apply/showmovingdata" target="_blank">动态监测</a>
<!-- <a onmousemove="this.style.color='red'" onmouseout="this.style.color='black'" href="javascript:void(0)">动态监测</a> -->
</div>
<!-- 发布数据 -->
<div id="div_pub">
<a onmousemove="this.style.color='red'" onmouseout="this.style.color='black'" href="/apply/publicnewsdatalogin" target="_blank">提交数据</a>
</div>
<!-- 炫丽时钟 -->
<div id="colorful_clock">
<a onmousemove="this.style.color='red'" onmouseout="this.style.color='rgb(38,148,247)'" href="/apply/clock1" target="_blank">炫丽时钟</a>
</div>
<!-- 显示今日时间 -->
<!-- <div id="div_todaytime">
<p style="font-size:16px;color:black;font-weight: 900;">今日</p>
<p id="today" style="font-weight: 600;"></p>
</div> -->
<!--给图表准备一个容器-->
<div id="box"></div>
<div class="qh">
<button id="line">折线图</button>
<button id="bar">柱状图</button>
<!-- <button id="stack">堆叠图</button> -->
</div>
<div id="div_month">
<button class="btn" id="1" onclick="send(this.id);">1月数据</button>
<button class="btn" id="2" onclick="send(this.id)">2月数据</button>
<button class="btn" id="3" onclick="send(this.id)">3月数据</button>
<button class="btn" id="4" onclick="send(this.id)">4月数据</button>
<button class="btn" id="5" onclick="send(this.id)">5月数据</button>
<button class="btn" id="6" onclick="send(this.id)">6月数据</button>
<button class="btn" id="7" onclick="send(this.id)">7月数据</button>
<button class="btn" id="8" onclick="send(this.id)">8月数据</button>
<button class="btn" id="9" onclick="send(this.id)">9月数据</button>
<button class="btn" id="10" onclick="send(this.id)">10月数据</button>
<button class="btn" id="11" onclick="send(this.id)">11月数据</button>
<button class="btn" id="12" onclick="send(this.id)">12月数据</button>
</div>
<p id="ts">手机端支持不理想,请用pc端打开</p>
</div>
<script type="text/javascript">
$(function(){
//显示今日时间
var today=getTodaytime();
$("#div_todaytime #today").text(today);
//月份样式重置
// var winWidth = window.screen.availWidth;
// console.log(winWidth);
// $("#div_month").width(winWidth);
// $("#div_month .btn").width(Math.ceil(winWidth/13)).css({boxSizing:"border-box"});
var winHeight = window.screen.availHeight;
if(winHeight>728){
console.log("大于728");
var h=650;
$("#box").height(h);
}else{
var h1=550;
$("#box").height(h1);
}
})
//获取当年的年份和月份
var date=new Date;
var y = date.getFullYear(); //当前年份
var month;
if(y!=2020){
y=2020;
month=12;
}else{
month=date.getMonth() + 1; //当前月份
}
//month=date.getMonth() + 1; //当前月份
var secondMonth=getDaysOf2(y); //根据当前年份判断二月份的天数
// m = m < 10 ? '0' + m : m;
//只显示2020年数据
//自定义样式
var style={
//topcolor:"rgba(209,48,43,1)",
topcolor:"rgba(20,20,20,.9)",
topfontsize:13,
//柱体三种颜色
basecolor:["#eedd78","#73b9bc","#dd6b66"],
//平均数标线字体大小
averagefontsize:14,
//平均数标线颜色
averagecolor1:"#eedd78",
averagecolor2:"#73b9bc",
averagecolor3:"#dd6b66",
//平均数标线宽度大小
averagewidth:3,
//主标名称
//titname:"2020读特·区域频道月度("+month+"月)发稿曲线图",
//主标题颜色
titcolor:"#005eaa",
//主标题字体大小
titfontsize:20,
//副标题颜色
subtitcolor:"rgba(10,10,10,.9)",
//副标题字体大小
subtitfontsize:15,
//x轴字体颜色
xdatacolor:"black",
//x轴字体大小
xdatafontsize:14,
//y轴字体颜色
ydatacolor:"black",
//y轴字体大小
ydatafontsize:14,
//xy轴颜色
linecolor:"black",
//xy轴大小
linewidth:3,
//xy轴单位字体颜色
linetextcolor:"black",
//xy轴单位字体大小
linetextfontsize:14,
//标题位置
titposleft:260,
titpostop:0,
//色块提示
tipname1:"记者供稿量",
tipname2:"抓取稿件量",
tipname3:"日发稿总量"
}
//拿到所有的数据
var everydays;
getData();
function getData(){
$(function(){
$.ajax({
url:"/apply/readData",
dataType:'JSON',
type:'post',
async:true,
success:function(result){
everydays=(JSON.parse(result)).everydaynumbers;
// sixd1=everydays[5].six.d1;
// console.log(sixd1);
// sixd2=everydays[5].six.d2;
// sixd3=everydays[5].six.d3;
// alert(month);
//根据月份获取对应的数据
switch(month){
case 1:
var d1=everydays[0].one.d1;
var d2=everydays[0].one.d2;
var d3=everydays[0].one.d3;
break;
case 2:
var d1=everydays[1].two.d1;
var d2=everydays[1].two.d2;
var d3=everydays[1].two.d3;
break;
case 3:
var d1=everydays[2].three.d1;
var d2=everydays[2].three.d2;
var d3=everydays[2].three.d3;
break;
case 4:
var d1=everydays[3].four.d1;
var d2=everydays[3].four.d2;
var d3=everydays[3].four.d3;
break;
case 5:
var d1=everydays[4].five.d1;
var d2=everydays[4].five.d2;
var d3=everydays[4].five.d3;
break;
case 6:
var d1=everydays[5].six.d1;
var d2=everydays[5].six.d2;
var d3=everydays[5].six.d3;
break;
case 7:
var d1=everydays[6].seven.d1;
var d2=everydays[6].seven.d2;
var d3=everydays[6].seven.d3;
break;
case 8:
var d1=everydays[7].eight.d1;
var d2=everydays[7].eight.d2;
var d3=everydays[7].eight.d3;
break;
case 9:
var d1=everydays[8].nine.d1;
var d2=everydays[8].nine.d2;
var d3=everydays[8].nine.d3;
break;
case 10:
var d1=everydays[9].ten.d1;
var d2=everydays[9].ten.d2;
var d3=everydays[9].ten.d3;
break;
case 11:
var d1=everydays[10].eleven.d1;
var d2=everydays[10].eleven.d2;
var d3=everydays[10].eleven.d3;
break;
case 12:
var d1=everydays[11].twelve.d1;
var d2=everydays[11].twelve.d2;
var d3=everydays[11].twelve.d3;
break;
default:
}
// 根据不同的月份对应不同的数据展现出来
if(month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12 ){
diffMonth(style,31,month,d1,d2,d3);
}else if(month==4 || month==6 || month==9 || month==11){
diffMonth(style,30,month,d1,d2,d3);
}else{
if(secondMonth == 28){
diffMonth(style,28,month,d1,d2,d3);
}else if(secondMonth == 29){
diffMonth(style,29,month,d1,d2,d3);
}
}
}
});
})
}
//控制logo动画
$("#div_logo").mouseover(function(){
$("#div_logo").removeClass("animated bounceIn infinite");
});
$("#div_logo").mouseout(function(){
$("#div_logo").addClass("animated bounceIn infinite");
});
var btn = $("#div_month button"); //获取button集合
//当前月份btn样式
btn.eq(month-1).addClass("active").siblings("button").removeClass("active");
// 根据月份得出当月的数据曲线图
function send(id){
$(document).ready(function(){
btn.eq(id-1).addClass("active").siblings("button").removeClass("active");
$.ajax({
url:"/apply/ajaxMonthData",
data:{'id':id},
dataType:'JSON',
type:'post',
async:false,
success:function(result){
month=parseInt(result);
switch(month){
case 1:
var d1=everydays[0].one.d1;
var d2=everydays[0].one.d2;
var d3=everydays[0].one.d3;
break;
case 2:
var d1=everydays[1].two.d1;
var d2=everydays[1].two.d2;
var d3=everydays[1].two.d3;
break;
case 3:
var d1=everydays[2].three.d1;
var d2=everydays[2].three.d2;
var d3=everydays[2].three.d3;
break;
case 4:
var d1=everydays[3].four.d1;
var d2=everydays[3].four.d2;
var d3=everydays[3].four.d3;
break;
case 5:
var d1=everydays[4].five.d1;
var d2=everydays[4].five.d2;
var d3=everydays[4].five.d3;
break;
case 6:
var d1=everydays[5].six.d1;
var d2=everydays[5].six.d2;
var d3=everydays[5].six.d3;
break;
case 7:
var d1=everydays[6].seven.d1;
var d2=everydays[6].seven.d2;
var d3=everydays[6].seven.d3;
break;
case 8:
var d1=everydays[7].eight.d1;
var d2=everydays[7].eight.d2;
var d3=everydays[7].eight.d3;
break;
case 9:
var d1=everydays[8].nine.d1;
var d2=everydays[8].nine.d2;
var d3=everydays[8].nine.d3;
break;
case 10:
var d1=everydays[9].ten.d1;
var d2=everydays[9].ten.d2;
var d3=everydays[9].ten.d3;
break;
case 11:
var d1=everydays[10].eleven.d1;
var d2=everydays[10].eleven.d2;
var d3=everydays[10].eleven.d3;
break;
case 12:
var d1=everydays[11].twelve.d1;
var d2=everydays[11].twelve.d2;
var d3=everydays[11].twelve.d3;
break;
default:
}
if(month==1 || month==3 || month==5 || month==7 || month==8 || month==10 || month==12 ){
diffMonth(style,31,month,d1,d2,d3);
}else if(month==4 || month==6 || month==9 || month==11){
diffMonth(style,30,month,d1,d2,d3);
}else{
if(secondMonth == 28){
diffMonth(style,28,month,d1,d2,d3);
}else if(secondMonth == 29){
diffMonth(style,29,month,d1,d2,d3);
}
}
}
});
});
}
//打开网页预加载数据时显示,加载完后图标隐藏
document.onreadystatechange=function(){
var loading='<div class="loading"><div class="pic"></div></div>';
$('body').append(loading);
if(document.readyState=='complete'){
$('.loading').fadeOut();
};
}
// 计算数组之和
function sumArr(data){
var sum=0;
for(var i=0;i<data.length;i++){
sum+=data[i];
}
return sum;
}
// 判断当年是不是闰年函数,闰年返回29年 不是返回28天
function getDaysOf2(year){
return (year % 400 == 0 || (year %100 != 0 && year % 4 == 0)) ? 29 : 28;
}
</script>
</body>
</html>