sbd-npm 1.3.60 → 1.3.61
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/package.json +1 -1
- package/stock_basics.js +1 -57
- package/util.js +57 -0
package/package.json
CHANGED
package/stock_basics.js
CHANGED
@@ -89,7 +89,7 @@ let Stock = {
|
|
89
89
|
Util.fetch_public_fund(Stock["code"]);
|
90
90
|
break;
|
91
91
|
case "public_fund_change":
|
92
|
-
|
92
|
+
Util.fetch_public_fund_change(Stock["code"]);
|
93
93
|
break;
|
94
94
|
case "big_deal":
|
95
95
|
Stock.fetch_big_deal();
|
@@ -916,62 +916,6 @@ let Stock = {
|
|
916
916
|
});
|
917
917
|
},
|
918
918
|
|
919
|
-
/**
|
920
|
-
* 公募持股变化
|
921
|
-
*/
|
922
|
-
fetch_public_fund_change: function () {
|
923
|
-
Stock["pfc_stock_chart"] = Util.show_chart_loading(Stock["pfc_stock_chart"], "pfc_stock_line_canvas");
|
924
|
-
Util.init_table_skeleton({
|
925
|
-
"element_id": "pfc_fund_table",
|
926
|
-
"head_cols": [
|
927
|
-
{"name": "时间", "class": "info", "table_sort": 1},
|
928
|
-
{"name": "当时股价", "table_sort": 1},
|
929
|
-
{"name": "总持股数", "table_sort": 1},
|
930
|
-
{"name": "持仓家数", "table_sort": 1},
|
931
|
-
{"name": "持仓市值", "table_sort": 1, "title": "当时股价 * 总持股数"},
|
932
|
-
]
|
933
|
-
});
|
934
|
-
Util.post("/stock/" + Stock["code"], {action: "public_fund_change"}, function (j) {
|
935
|
-
Stock["pfc_stock_chart"].hideLoading();
|
936
|
-
let date_data = [], fund_num_data = [], stock_num_data = [], price_data = [], _html = [];
|
937
|
-
j["data"].forEach(function (item) {
|
938
|
-
let date_format = Util.seconds_to_format(item["date"], "%Y-%m-%d");
|
939
|
-
date_data.push(date_format);
|
940
|
-
fund_num_data.push(item["fund_num"]);
|
941
|
-
stock_num_data.push(item["stock_num"]);
|
942
|
-
price_data.push(item["price"]);
|
943
|
-
_html.push("<tr>");
|
944
|
-
_html.push("<td>", Util.pack_html_link("https://data.eastmoney.com/zlsj/detail/" + date_format + "-1-" + Stock["code"] + ".html", date_format), "</td>");
|
945
|
-
_html.push("<td>", item["price"], "</td>");
|
946
|
-
_html.push("<td data-val='", item["stock_num"], "' title='", item["stock_num"], "'>", Util.to_unit(item["stock_num"], 3), "股</td>");
|
947
|
-
_html.push("<td>", item["fund_num"], "</td>");
|
948
|
-
let market_capital = item["price"] * item["stock_num"];
|
949
|
-
_html.push("<td data-val='", market_capital, "' title='", market_capital, "'>", Util.to_unit(market_capital, 4), "</td>");
|
950
|
-
_html.push("</tr>");
|
951
|
-
});
|
952
|
-
date_data = date_data.reverse();
|
953
|
-
fund_num_data = fund_num_data.reverse();
|
954
|
-
stock_num_data = stock_num_data.reverse();
|
955
|
-
price_data = price_data.reverse();
|
956
|
-
Stock["pfc_stock_chart"] = Util.multi_axis_line(Stock["pfc_stock_chart"], "pfc_stock_line_canvas", date_data, '总持股数', stock_num_data, '股价', price_data);
|
957
|
-
Stock["pfc_fund_chart"] = Util.multi_axis_line(Stock["pfc_fund_chart"], "pfc_fund_line_canvas", date_data, '持仓家数', fund_num_data, '股价', price_data);
|
958
|
-
if (j["data"].length > 1) {
|
959
|
-
let cur_stock_num = j["data"][0]["stock_num"];
|
960
|
-
let pre_stock_num = j["data"][1]["stock_num"];
|
961
|
-
if (cur_stock_num > 0 && pre_stock_num > 0) {
|
962
|
-
$("#pfc_stock_tips").html("(当前持股数: <b class='text-info'>" + Util.to_unit(cur_stock_num, 4) + "</b>, 环比: " + Util.year_price_rate(cur_stock_num, pre_stock_num) + ")");
|
963
|
-
}
|
964
|
-
let cur_fund_num = j["data"][0]["fund_num"];
|
965
|
-
let pre_fund_num = j["data"][1]["fund_num"];
|
966
|
-
if (cur_fund_num > 0 && pre_fund_num > 0) {
|
967
|
-
$("#pfc_fund_tips").html("(当前基金数: <b class='text-info'>" + cur_fund_num + "</b>, 环比: " + Util.year_price_rate(cur_fund_num, pre_fund_num) + ")");
|
968
|
-
}
|
969
|
-
}
|
970
|
-
Util.render_table_html("pfc_fund_table_body", _html);
|
971
|
-
Util.hide_tips();
|
972
|
-
});
|
973
|
-
},
|
974
|
-
|
975
919
|
handle_metrics_statistics: function (metrics, date_type) {
|
976
920
|
Stock[metrics + "_bar_chart"] = Util.startup_metrics_statistics(Stock[metrics + "_bar_chart"], metrics, date_type);
|
977
921
|
if (metrics === "margin" || metrics === "hkex_holding") {
|
package/util.js
CHANGED
@@ -1164,6 +1164,63 @@ const Util = {
|
|
1164
1164
|
});
|
1165
1165
|
},
|
1166
1166
|
|
1167
|
+
/**
|
1168
|
+
* 公募持股变化
|
1169
|
+
* @param code
|
1170
|
+
*/
|
1171
|
+
fetch_public_fund_change: function (code) {
|
1172
|
+
Util["pfc_stock_chart"] = Util.show_chart_loading(Util["pfc_stock_chart"], "pfc_stock_line_canvas");
|
1173
|
+
Util.init_table_skeleton({
|
1174
|
+
"element_id": "pfc_fund_table",
|
1175
|
+
"head_cols": [
|
1176
|
+
{"name": "时间", "class": "info", "table_sort": 1},
|
1177
|
+
{"name": "当时股价", "table_sort": 1},
|
1178
|
+
{"name": "总持股数", "table_sort": 1},
|
1179
|
+
{"name": "持仓家数", "table_sort": 1},
|
1180
|
+
{"name": "持仓市值", "table_sort": 1, "title": "当时股价 * 总持股数"},
|
1181
|
+
]
|
1182
|
+
});
|
1183
|
+
Util.post("/stock/" + code, {action: "public_fund_change"}, function (j) {
|
1184
|
+
Util["pfc_stock_chart"].hideLoading();
|
1185
|
+
let date_data = [], fund_num_data = [], stock_num_data = [], price_data = [], _html = [];
|
1186
|
+
j["data"].forEach(function (item) {
|
1187
|
+
let date_format = Util.seconds_to_format(item["date"], "%Y-%m-%d");
|
1188
|
+
date_data.push(date_format);
|
1189
|
+
fund_num_data.push(item["fund_num"]);
|
1190
|
+
stock_num_data.push(item["stock_num"]);
|
1191
|
+
price_data.push(item["price"]);
|
1192
|
+
_html.push("<tr>");
|
1193
|
+
_html.push("<td>", Util.pack_html_link("https://data.eastmoney.com/zlsj/detail/" + date_format + "-1-" + code + ".html", date_format), "</td>");
|
1194
|
+
_html.push("<td>", item["price"], "</td>");
|
1195
|
+
_html.push("<td data-val='", item["stock_num"], "' title='", item["stock_num"], "'>", Util.to_unit(item["stock_num"], 3), "股</td>");
|
1196
|
+
_html.push("<td>", item["fund_num"], "</td>");
|
1197
|
+
let market_capital = item["price"] * item["stock_num"];
|
1198
|
+
_html.push("<td data-val='", market_capital, "' title='", market_capital, "'>", Util.to_unit(market_capital, 4), "</td>");
|
1199
|
+
_html.push("</tr>");
|
1200
|
+
});
|
1201
|
+
date_data = date_data.reverse();
|
1202
|
+
fund_num_data = fund_num_data.reverse();
|
1203
|
+
stock_num_data = stock_num_data.reverse();
|
1204
|
+
price_data = price_data.reverse();
|
1205
|
+
Util["pfc_stock_chart"] = Util.multi_axis_line(Util["pfc_stock_chart"], "pfc_stock_line_canvas", date_data, '总持股数', stock_num_data, '股价', price_data);
|
1206
|
+
Util["pfc_fund_chart"] = Util.multi_axis_line(Util["pfc_fund_chart"], "pfc_fund_line_canvas", date_data, '持仓家数', fund_num_data, '股价', price_data);
|
1207
|
+
if (j["data"].length > 1) {
|
1208
|
+
let cur_stock_num = j["data"][0]["stock_num"];
|
1209
|
+
let pre_stock_num = j["data"][1]["stock_num"];
|
1210
|
+
if (cur_stock_num > 0 && pre_stock_num > 0) {
|
1211
|
+
$("#pfc_stock_tips").html("(当前持股数: <b class='text-info'>" + Util.to_unit(cur_stock_num, 4) + "</b>, 环比: " + Util.year_price_rate(cur_stock_num, pre_stock_num) + ")");
|
1212
|
+
}
|
1213
|
+
let cur_fund_num = j["data"][0]["fund_num"];
|
1214
|
+
let pre_fund_num = j["data"][1]["fund_num"];
|
1215
|
+
if (cur_fund_num > 0 && pre_fund_num > 0) {
|
1216
|
+
$("#pfc_fund_tips").html("(当前基金数: <b class='text-info'>" + cur_fund_num + "</b>, 环比: " + Util.year_price_rate(cur_fund_num, pre_fund_num) + ")");
|
1217
|
+
}
|
1218
|
+
}
|
1219
|
+
Util.render_table_html("pfc_fund_table_body", _html);
|
1220
|
+
Util.hide_tips();
|
1221
|
+
});
|
1222
|
+
},
|
1223
|
+
|
1167
1224
|
/**
|
1168
1225
|
* 初始分类股票的显示表格
|
1169
1226
|
* @param portfolio
|