sbd-npm 1.2.10 → 1.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npmignore +1 -0
- package/package.json +1 -1
- package/sbd.css +65 -1
- package/stock_basics.js +10 -10
- package/summary_daily.js +6 -6
- package/util.js +26 -12
package/.npmignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
sbd-npm.md
|
package/package.json
CHANGED
package/sbd.css
CHANGED
@@ -61,4 +61,68 @@ table a:hover, a.btn {
|
|
61
61
|
.modal-xlg {
|
62
62
|
width: 90%;
|
63
63
|
}
|
64
|
-
}
|
64
|
+
}
|
65
|
+
|
66
|
+
#loading_div {
|
67
|
+
position:absolute;
|
68
|
+
top:0;
|
69
|
+
left:0;
|
70
|
+
right:0;
|
71
|
+
bottom:0;
|
72
|
+
height: 100px;
|
73
|
+
text-align: center;
|
74
|
+
margin-top: 200px;
|
75
|
+
}
|
76
|
+
#loading_div .circle {
|
77
|
+
margin: 20px;
|
78
|
+
height: 50px;
|
79
|
+
width: 50px;
|
80
|
+
border-radius: 50%;
|
81
|
+
display: inline-block;
|
82
|
+
background-color: #4695B8;
|
83
|
+
transform: scale(0);
|
84
|
+
animation: bulge 2s infinite ease-in-out;
|
85
|
+
}
|
86
|
+
#loading_div .circle::after {
|
87
|
+
position: absolute;
|
88
|
+
display: inline-block;
|
89
|
+
content: '';
|
90
|
+
height: 100%;
|
91
|
+
width: 100%;
|
92
|
+
border-radius: 50%;
|
93
|
+
background-color: inherit;
|
94
|
+
top: 0;
|
95
|
+
left: 0;
|
96
|
+
z-index: -1;
|
97
|
+
transform: scale(1);
|
98
|
+
animation: blow 2s infinite ease-in-out;
|
99
|
+
}
|
100
|
+
#loading_div .circle:nth-child(1) {
|
101
|
+
animation-delay: 0s;
|
102
|
+
}
|
103
|
+
#loading_div .circle:nth-child(2) {
|
104
|
+
animation-delay: .25s;
|
105
|
+
}
|
106
|
+
#loading_div .circle:nth-child(3) {
|
107
|
+
animation-delay: .50s;
|
108
|
+
}
|
109
|
+
@keyframes bulge {
|
110
|
+
50% {
|
111
|
+
transform: scale(1);
|
112
|
+
}
|
113
|
+
}
|
114
|
+
@keyframes blow {
|
115
|
+
25% {
|
116
|
+
opacity: 0.5;
|
117
|
+
}
|
118
|
+
50% {
|
119
|
+
opacity: 0.5;
|
120
|
+
}
|
121
|
+
90% {
|
122
|
+
opacity: 0;
|
123
|
+
}
|
124
|
+
100% {
|
125
|
+
transform: scale(2);
|
126
|
+
opacity: 0;
|
127
|
+
}
|
128
|
+
}
|
package/stock_basics.js
CHANGED
@@ -35,7 +35,7 @@ let Stock = {
|
|
35
35
|
if (Stock.data.hasOwnProperty(active_div)) {
|
36
36
|
return false;
|
37
37
|
}
|
38
|
-
Util.
|
38
|
+
Util.show_loading();
|
39
39
|
switch (active_div) {
|
40
40
|
case "base":
|
41
41
|
Stock.fetch_base();
|
@@ -274,7 +274,7 @@ let Stock = {
|
|
274
274
|
},
|
275
275
|
|
276
276
|
fetch_hist_data: function () {
|
277
|
-
Util.
|
277
|
+
Util.show_loading();
|
278
278
|
let hist_type = $("#hist_type").val();
|
279
279
|
let payload = {
|
280
280
|
sort_type: Stock.sort_type,
|
@@ -344,7 +344,7 @@ let Stock = {
|
|
344
344
|
|
345
345
|
fetch_big_deal: function () {
|
346
346
|
if ($("#big_deal_table_body").length <= 0) {
|
347
|
-
Util.
|
347
|
+
Util.show_loading();
|
348
348
|
Util.init_table_skeleton({
|
349
349
|
"element_id": "big_deal_summary_table",
|
350
350
|
"head_cols": [
|
@@ -429,7 +429,7 @@ let Stock = {
|
|
429
429
|
},
|
430
430
|
|
431
431
|
fetch_rps_data: function () {
|
432
|
-
Util.
|
432
|
+
Util.show_loading();
|
433
433
|
Util.post("/stock/" + Stock.code, {action: "rps"}, function (j) {
|
434
434
|
let _html = [];
|
435
435
|
j["data"].forEach(function (item) {
|
@@ -460,7 +460,7 @@ let Stock = {
|
|
460
460
|
},
|
461
461
|
|
462
462
|
fetch_holder_top: function () {
|
463
|
-
Util.
|
463
|
+
Util.show_loading();
|
464
464
|
Util.init_table_skeleton({
|
465
465
|
"element_id": "circulation_holder_table",
|
466
466
|
"head_cols": [
|
@@ -571,7 +571,7 @@ let Stock = {
|
|
571
571
|
},
|
572
572
|
|
573
573
|
fetch_finance: function () {
|
574
|
-
Util.
|
574
|
+
Util.show_loading();
|
575
575
|
Util.init_table_skeleton({
|
576
576
|
"element_id": "cash_flow_table",
|
577
577
|
"head_cols": [
|
@@ -812,7 +812,7 @@ let Stock = {
|
|
812
812
|
},
|
813
813
|
|
814
814
|
fetch_notice: function () {
|
815
|
-
Util.
|
815
|
+
Util.show_loading();
|
816
816
|
Util.init_table_skeleton({
|
817
817
|
"element_id": "notice_table",
|
818
818
|
"head_cols": [
|
@@ -859,7 +859,7 @@ let Stock = {
|
|
859
859
|
|
860
860
|
// 机构研究报告数据
|
861
861
|
fetch_report_organization: function () {
|
862
|
-
Util.
|
862
|
+
Util.show_loading();
|
863
863
|
Util.init_table_skeleton({
|
864
864
|
"element_id": "report_organization_table",
|
865
865
|
"head_cols": [
|
@@ -890,7 +890,7 @@ let Stock = {
|
|
890
890
|
|
891
891
|
// 公募持股
|
892
892
|
fetch_public_fund: function () {
|
893
|
-
Util.
|
893
|
+
Util.show_loading();
|
894
894
|
Util.init_table_skeleton({
|
895
895
|
"element_id": "public_fund_table",
|
896
896
|
"head_cols": [
|
@@ -1120,7 +1120,7 @@ let Stock = {
|
|
1120
1120
|
},
|
1121
1121
|
|
1122
1122
|
fetch_bias_data: function () {
|
1123
|
-
Util.
|
1123
|
+
Util.show_loading();
|
1124
1124
|
Util.post("/stock/" + Stock["code"], {action: "bias"}, function (j) {
|
1125
1125
|
let date_data = [];
|
1126
1126
|
let bias20_data = [];
|
package/summary_daily.js
CHANGED
@@ -74,7 +74,7 @@ $(document).ready(function () {
|
|
74
74
|
return false;
|
75
75
|
}
|
76
76
|
DailySummary.is_load = true;
|
77
|
-
Util.
|
77
|
+
Util.show_loading();
|
78
78
|
Util.post(location.pathname, {date: $("#trade_date").val(), action: "market_overview"}, function (j) {
|
79
79
|
DailySummary.pack_market_overview(j["market_overview"]);
|
80
80
|
DailySummary.fetch_statistics_daily();
|
@@ -400,7 +400,7 @@ $(document).ready(function () {
|
|
400
400
|
* 沪深港股通每日十大成交活跃股数据
|
401
401
|
*/
|
402
402
|
fetch_hsgt_ten: function (hsgt_type) {
|
403
|
-
Util.
|
403
|
+
Util.show_loading();
|
404
404
|
let date = $("#trade_date").val();
|
405
405
|
Util.post(location.pathname, {date: date, action: "hsgt_stock", "hsgt_type": hsgt_type}, function (j) {
|
406
406
|
DailySummary.pack_hsgt_ten(j["data"], "hgt", j["url"]);
|
@@ -488,7 +488,7 @@ $(document).ready(function () {
|
|
488
488
|
if (Modal.mo_end_time === 0) {
|
489
489
|
Modal.init_market_overview_time(obj);
|
490
490
|
} else {
|
491
|
-
Util.
|
491
|
+
Util.show_loading();
|
492
492
|
let data_type = $(obj).attr("id");
|
493
493
|
let payload = {
|
494
494
|
date: $("#trade_date").val(),
|
@@ -531,7 +531,7 @@ $(document).ready(function () {
|
|
531
531
|
},
|
532
532
|
|
533
533
|
render_stock_rate_modal: function (obj) {
|
534
|
-
Util.
|
534
|
+
Util.show_loading();
|
535
535
|
let cp = $(obj).attr("data-cp");
|
536
536
|
let payload = {date: $("#trade_date").val(), action: "p_change", p_change_type: $("#p_change_type").val()};
|
537
537
|
if (cp) {
|
@@ -579,7 +579,7 @@ $(document).ready(function () {
|
|
579
579
|
},
|
580
580
|
|
581
581
|
render_news_modal: function () {
|
582
|
-
Util.
|
582
|
+
Util.show_loading();
|
583
583
|
Util.post(location.pathname, {action: "pbc_news"}, function (j) {
|
584
584
|
let _html = [];
|
585
585
|
let index = 0;
|
@@ -671,7 +671,7 @@ $(document).ready(function () {
|
|
671
671
|
});
|
672
672
|
|
673
673
|
$("#news_type").change(function () {
|
674
|
-
Util.
|
674
|
+
Util.show_loading();
|
675
675
|
let news_type = parseInt($("#news_type").val());
|
676
676
|
let payload = {action: "news", limit_num: DailySummary.limit_num(), news_type: news_type};
|
677
677
|
Util.post(location.pathname, payload, function (j) {
|
package/util.js
CHANGED
@@ -22,6 +22,7 @@
|
|
22
22
|
const Util = {
|
23
23
|
|
24
24
|
tips_token: "util-tips-div",
|
25
|
+
load_token: "loading_div",
|
25
26
|
interval_timer: null,
|
26
27
|
stock_timer_id: 0,
|
27
28
|
// 1年的天数
|
@@ -46,7 +47,7 @@ const Util = {
|
|
46
47
|
},
|
47
48
|
|
48
49
|
sbd_init: function () {
|
49
|
-
Util.
|
50
|
+
Util.show_loading();
|
50
51
|
|
51
52
|
Util.init_menu();
|
52
53
|
|
@@ -88,7 +89,7 @@ const Util = {
|
|
88
89
|
clearTimeout(Util.stock_timer_id);
|
89
90
|
st_obj.css("display", "none");
|
90
91
|
Util.stock_timer_id = setTimeout(function () {
|
91
|
-
Util.
|
92
|
+
Util.show_loading();
|
92
93
|
Util.post("/action", {action: "search", key_word: key_word}, function (j) {
|
93
94
|
let key_word = $("#stock").val();
|
94
95
|
if (key_word) {
|
@@ -837,7 +838,7 @@ const Util = {
|
|
837
838
|
* @param alert_tips
|
838
839
|
*/
|
839
840
|
init_stock_category_data: function (stock_category, table_id, alert_tips = "") {
|
840
|
-
Util.
|
841
|
+
Util.show_loading();
|
841
842
|
let head_cols = [
|
842
843
|
{"name": "代码"},
|
843
844
|
{"name": "名称"},
|
@@ -1008,7 +1009,7 @@ const Util = {
|
|
1008
1009
|
* @param component_id
|
1009
1010
|
*/
|
1010
1011
|
fetch_public_fund_stock: function (fund_code, date, component_id) {
|
1011
|
-
Util.
|
1012
|
+
Util.show_loading();
|
1012
1013
|
let component_tr = component_id + "_tr";
|
1013
1014
|
$("." + component_tr).each(function () {
|
1014
1015
|
$(this).remove();
|
@@ -1110,7 +1111,7 @@ const Util = {
|
|
1110
1111
|
if (!currency) {
|
1111
1112
|
return false;
|
1112
1113
|
}
|
1113
|
-
Util.
|
1114
|
+
Util.show_loading();
|
1114
1115
|
let payload = {
|
1115
1116
|
currency: currency,
|
1116
1117
|
start_date: $("#currency_modal_start_date").val(),
|
@@ -1932,9 +1933,23 @@ const Util = {
|
|
1932
1933
|
},
|
1933
1934
|
|
1934
1935
|
hide_tips: function () {
|
1935
|
-
let
|
1936
|
-
if (
|
1937
|
-
|
1936
|
+
let tips_obj = $('#' + Util.tips_token);
|
1937
|
+
if (tips_obj.length) {
|
1938
|
+
tips_obj.remove();
|
1939
|
+
}
|
1940
|
+
let load_obj = $('#' + Util.load_token);
|
1941
|
+
if (load_obj.length) {
|
1942
|
+
load_obj.remove();
|
1943
|
+
}
|
1944
|
+
},
|
1945
|
+
|
1946
|
+
show_loading: function () {
|
1947
|
+
let load_obj = document.getElementById(Util.load_token);
|
1948
|
+
if (!load_obj) {
|
1949
|
+
let load_obj = document.createElement('div');
|
1950
|
+
load_obj.id = Util.load_token;
|
1951
|
+
load_obj.innerHTML = '<div class="circle"></div><div class="circle"></div><div class="circle"></div>';
|
1952
|
+
document.getElementsByTagName('body')[0].appendChild(load_obj);
|
1938
1953
|
}
|
1939
1954
|
},
|
1940
1955
|
|
@@ -1943,7 +1958,7 @@ const Util = {
|
|
1943
1958
|
* @returns {boolean}
|
1944
1959
|
*/
|
1945
1960
|
is_loading: function () {
|
1946
|
-
return $("#" + Util.
|
1961
|
+
return $("#" + Util.load_token).length > 0;
|
1947
1962
|
},
|
1948
1963
|
|
1949
1964
|
tooltip: function (element_id, tip) {
|
@@ -1971,7 +1986,7 @@ const Util = {
|
|
1971
1986
|
init_stock_stuff: function (element_id, index_list, is_us = 0, is_refresh = 1) {
|
1972
1987
|
let code_list = Util.get_code_list(element_id);
|
1973
1988
|
if (code_list.length > 0) {
|
1974
|
-
Util.
|
1989
|
+
Util.show_loading();
|
1975
1990
|
//获取股票详情数据
|
1976
1991
|
Util.post("/action", {action: "code_detail", code_list: code_list.join("-")}, function (j) {
|
1977
1992
|
let valid_code_list = [];
|
@@ -2839,7 +2854,7 @@ const Util = {
|
|
2839
2854
|
* @returns {*|jQuery|void}
|
2840
2855
|
*/
|
2841
2856
|
show_chart_loading: function (chart_instance, element_id) {
|
2842
|
-
Util.
|
2857
|
+
Util.show_loading();
|
2843
2858
|
if (!chart_instance) {
|
2844
2859
|
chart_instance = Util.init_chart_instance(element_id);
|
2845
2860
|
}
|
@@ -3422,4 +3437,3 @@ Object.size = function (obj) {
|
|
3422
3437
|
console.log(Notification.permission);
|
3423
3438
|
break;
|
3424
3439
|
}*/
|
3425
|
-
|