sbd-npm 1.3.22 → 1.3.24
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/constant.js +1 -1
- package/package.json +1 -1
- package/util.js +27 -26
package/constant.js
CHANGED
@@ -37,7 +37,7 @@ const MenuList = [
|
|
37
37
|
'icon': 'edit',
|
38
38
|
'menu': [
|
39
39
|
{'key': 'trend_price', 'name': '股价阶段涨跌幅度', 'url': '/0x84527c7c3487b39afd820f2b309355cd75c01653'},
|
40
|
-
{'key': 'trend_day3_stabilize', 'name': '
|
40
|
+
{'key': 'trend_day3_stabilize', 'name': '连续三日收涨', 'url': '/0x7e9df652521f334030e0be383f5fe10f01a67243'},
|
41
41
|
{'key': 'trend_macd_down', 'name': 'MACD金叉', 'url': '/0x96943c359b08b02392a168ad6cd4b5703e3e9267'},
|
42
42
|
{'key': 'trend_kdj', 'name': 'KDJ金叉', 'url': '/0x3382bdaec4e8715ce27ca2b538dce09a2f8f5e50'},
|
43
43
|
{'key': 'trend_money_inflow', 'name': '资金流入历史最高', 'url': '/0xfbfc92be1eebe9ccf5b2f14b9a2ea25f2cc941b8'},
|
package/package.json
CHANGED
package/util.js
CHANGED
@@ -26,6 +26,7 @@ const Util = {
|
|
26
26
|
load_token: "loading_div",
|
27
27
|
interval_timer: null,
|
28
28
|
stock_timer_id: 0,
|
29
|
+
countdown_timer_id: 0,
|
29
30
|
is_init: 0,
|
30
31
|
is_load: false,
|
31
32
|
// 1年的天数
|
@@ -216,7 +217,7 @@ const Util = {
|
|
216
217
|
img.src = canvas.toDataURL("image/png");
|
217
218
|
// 创建一个下载链接并模拟点击
|
218
219
|
let link = document.createElement("a");
|
219
|
-
link.download = "
|
220
|
+
link.download = "stock_big_data_" + Util.now() + ".png";
|
220
221
|
link.href = img.src;
|
221
222
|
link.click();
|
222
223
|
|
@@ -1046,19 +1047,19 @@ const Util = {
|
|
1046
1047
|
|
1047
1048
|
/**
|
1048
1049
|
* 初始分类股票的显示表格
|
1049
|
-
* @param
|
1050
|
+
* @param portfolio
|
1050
1051
|
* @param table_id
|
1051
1052
|
* @param alert_tips
|
1052
1053
|
*/
|
1053
|
-
|
1054
|
+
init_portfolio_data: function (portfolio, table_id, alert_tips = "") {
|
1054
1055
|
Util.show_loading();
|
1055
1056
|
let head_cols = [
|
1056
1057
|
{"name": "代码"},
|
1057
1058
|
{"name": "名称"},
|
1058
1059
|
{"name": "PE", "title": "市盈率(Price Earnings Ratio)", "table_sort": 1},
|
1059
1060
|
{"name": "总市值", "table_sort": 1},
|
1060
|
-
{"name": "行业", "select_id": "
|
1061
|
-
{"name": "地区", "select_id": "
|
1061
|
+
{"name": "行业", "select_id": "portfolio_industry"},
|
1062
|
+
{"name": "地区", "select_id": "portfolio_area"},
|
1062
1063
|
{"name": "当前价", "table_sort": 1},
|
1063
1064
|
{"name": "最高价", "table_sort": 1},
|
1064
1065
|
{"name": "最低价", "table_sort": 1},
|
@@ -1066,12 +1067,12 @@ const Util = {
|
|
1066
1067
|
{"name": "近5日", "table_sort": 1},
|
1067
1068
|
{"name": "52周最高", "table_sort": 1}
|
1068
1069
|
];
|
1069
|
-
if (
|
1070
|
+
if (portfolio !== "us") {
|
1070
1071
|
head_cols.push({"name": "成交额", "table_sort": 1});
|
1071
1072
|
head_cols.push({"name": "成交均价", "table_sort": 1});
|
1072
1073
|
head_cols.push({"name": "股东数", "table_sort": 1});
|
1073
1074
|
head_cols.push({"name": "基金数", "table_sort": 1});
|
1074
|
-
head_cols.push({"name": "备注", "id": "
|
1075
|
+
head_cols.push({"name": "备注", "id": "portfolio_remark_title"});
|
1075
1076
|
} else {
|
1076
1077
|
head_cols.unshift({"name": ""});
|
1077
1078
|
}
|
@@ -1084,28 +1085,28 @@ const Util = {
|
|
1084
1085
|
table_options["alert"] = alert_tips;
|
1085
1086
|
}
|
1086
1087
|
Util.init_table_skeleton(table_options);
|
1087
|
-
Util["
|
1088
|
-
Util.post(location.pathname, {active_div:
|
1089
|
-
Util["
|
1090
|
-
Util["
|
1091
|
-
Util.render_type_option($("#
|
1092
|
-
Util.render_type_option($("#
|
1093
|
-
Util.
|
1088
|
+
Util["portfolio_table_id"] = table_id;
|
1089
|
+
Util.post(location.pathname, {active_div: portfolio}, function (j) {
|
1090
|
+
Util["portfolio_data"] = j["data"] ? j["data"] : [];
|
1091
|
+
Util["portfolio_index"] = j["index_list"] ? j["index_list"] : [];
|
1092
|
+
Util.render_type_option($("#portfolio_industry"), j["data"], "industry", Util.render_portfolio_html);
|
1093
|
+
Util.render_type_option($("#portfolio_area"), j["data"], "area", Util.render_portfolio_html);
|
1094
|
+
Util.render_portfolio_html();
|
1094
1095
|
if (j["portfolio_url"]) {
|
1095
|
-
$("#
|
1096
|
+
$("#portfolio_remark_title").html(Util.pack_html_link(j["portfolio_url"], "备注<i class='glyphicon glyphicon-link'></i>"));
|
1096
1097
|
}
|
1097
1098
|
Util.hide_tips();
|
1098
1099
|
});
|
1099
1100
|
},
|
1100
1101
|
|
1101
|
-
|
1102
|
-
if (Util["
|
1102
|
+
render_portfolio_html: function () {
|
1103
|
+
if (Util["portfolio_table_id"]) {
|
1103
1104
|
let _html = [], total_num = 0;
|
1104
|
-
let is_us = $("#
|
1105
|
-
if (Util["
|
1106
|
-
let industry = $("#
|
1107
|
-
let area = $("#
|
1108
|
-
Util["
|
1105
|
+
let is_us = $("#portfolio_remark_title").length === 0 ? 1 : 0;
|
1106
|
+
if (Util["portfolio_data"]) {
|
1107
|
+
let industry = $("#portfolio_industry").val();
|
1108
|
+
let area = $("#portfolio_area").val();
|
1109
|
+
Util["portfolio_data"].forEach(function (item) {
|
1109
1110
|
if (Util.is_industry_area(item, industry, area)) {
|
1110
1111
|
total_num++;
|
1111
1112
|
_html.push("<tr>");
|
@@ -1130,7 +1131,7 @@ const Util = {
|
|
1130
1131
|
}
|
1131
1132
|
});
|
1132
1133
|
}
|
1133
|
-
let table_body_id = Util["
|
1134
|
+
let table_body_id = Util["portfolio_table_id"] + "_body";
|
1134
1135
|
Util.render_table_html(table_body_id, _html);
|
1135
1136
|
if (is_us === 1) {
|
1136
1137
|
$("img").on("error", function () {
|
@@ -1138,7 +1139,7 @@ const Util = {
|
|
1138
1139
|
});
|
1139
1140
|
}
|
1140
1141
|
$("#" + table_body_id + "_tips").html('共 <span class="label label-info">' + total_num + '</span> 家');
|
1141
|
-
let index_list = Util["
|
1142
|
+
let index_list = Util["portfolio_index"] ? Util["portfolio_index"] : [];
|
1142
1143
|
Util.init_stock_stuff(table_body_id, index_list, is_us);
|
1143
1144
|
}
|
1144
1145
|
},
|
@@ -2665,7 +2666,7 @@ const Util = {
|
|
2665
2666
|
countdown_refresh_index_price: function (interval, element_id, index_list, is_us, is_refresh) {
|
2666
2667
|
if (interval > 0) {
|
2667
2668
|
$("#" + element_id + "_tips").html("交易中, " + interval + " 秒后刷新");
|
2668
|
-
setTimeout(function () {
|
2669
|
+
Util.countdown_timer_id = setTimeout(function () {
|
2669
2670
|
Util.countdown_refresh_index_price(interval - 1, element_id, index_list, is_us, is_refresh);
|
2670
2671
|
}, 1000);
|
2671
2672
|
} else {
|
@@ -2677,7 +2678,7 @@ const Util = {
|
|
2677
2678
|
countdown_func: function (interval, tips_id, callback_func) {
|
2678
2679
|
if (interval > 0) {
|
2679
2680
|
$("#" + tips_id).html("交易中, " + interval + " 秒后刷新");
|
2680
|
-
setTimeout(function () {
|
2681
|
+
Util.countdown_timer_id = setTimeout(function () {
|
2681
2682
|
Util.countdown_func(interval - 1, tips_id, callback_func);
|
2682
2683
|
}, 1000);
|
2683
2684
|
} else {
|