sbd-npm 1.3.67 → 1.3.69
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/summary_daily.js +8 -9
- package/util.js +34 -15
package/package.json
CHANGED
package/summary_daily.js
CHANGED
@@ -300,9 +300,7 @@ $(function () {
|
|
300
300
|
* 市场成交概况
|
301
301
|
*/
|
302
302
|
pack_market_overview: function (market_overview_dict) {
|
303
|
-
let _html = [];
|
304
|
-
let previous_mo_amount = 0;
|
305
|
-
let mo_amount = 0;
|
303
|
+
let _html = [], previous_mo_amount = 0, mo_amount = 0, mo_amount_cls = "", mo_amount_sign = "";
|
306
304
|
for (let market_type in market_overview_dict) {
|
307
305
|
if (market_overview_dict.hasOwnProperty(market_type)) {
|
308
306
|
let market = market_overview_dict[market_type];
|
@@ -322,13 +320,14 @@ $(function () {
|
|
322
320
|
}
|
323
321
|
}
|
324
322
|
$("#market_overview_zone").html(_html.join(""));
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
323
|
+
if (market_overview_dict["total_amount_data"] && market_overview_dict["total_amount_data"].length === 2 && market_overview_dict["total_amount_data"][0]["amount"] > 0 && market_overview_dict["total_amount_data"][1]["amount"] > 0) {
|
324
|
+
mo_amount = Util.to_hundred_million(market_overview_dict["total_amount_data"][0]["amount"], 3)
|
325
|
+
previous_mo_amount = Util.to_hundred_million(market_overview_dict["total_amount_data"][1]["amount"], 3)
|
326
|
+
}
|
327
|
+
if (mo_amount > previous_mo_amount) {
|
329
328
|
mo_amount_cls = "label-danger";
|
330
329
|
mo_amount_sign = "+";
|
331
|
-
} else if (
|
330
|
+
} else if (mo_amount < previous_mo_amount) {
|
332
331
|
mo_amount_cls = "label-success";
|
333
332
|
}
|
334
333
|
let mo_amount_obj = $("#market_overview_amount");
|
@@ -338,7 +337,7 @@ $(function () {
|
|
338
337
|
if (mo_amount_cls.length > 0) {
|
339
338
|
mo_amount_obj.addClass(mo_amount_cls);
|
340
339
|
}
|
341
|
-
mo_amount_obj.html(Util.to_float(mo_amount, 3) + "(" + mo_amount_sign +
|
340
|
+
mo_amount_obj.html(Util.to_float(mo_amount, 3) + "(" + mo_amount_sign + Util.to_float(mo_amount - previous_mo_amount, 3) + ")");
|
342
341
|
DailySummary.set_cache("market_overview", market_overview_dict);
|
343
342
|
},
|
344
343
|
|
package/util.js
CHANGED
@@ -1224,23 +1224,38 @@ const Util = {
|
|
1224
1224
|
*/
|
1225
1225
|
fetch_public_fund_change: function (code) {
|
1226
1226
|
Util["pfc_stock_chart"] = Util.show_chart_loading(Util["pfc_stock_chart"], "pfc_stock_line_canvas");
|
1227
|
-
|
1228
|
-
|
1229
|
-
|
1230
|
-
|
1231
|
-
|
1232
|
-
|
1233
|
-
|
1234
|
-
|
1235
|
-
|
1236
|
-
|
1227
|
+
if ($("#pfc_fund_table_body").length === 0) {
|
1228
|
+
Util.init_table_skeleton({
|
1229
|
+
"element_id": "pfc_fund_table",
|
1230
|
+
"head_cols": [
|
1231
|
+
{"name": "季度时间", "class": "info", "table_sort": 1},
|
1232
|
+
{"name": "当时股价", "table_sort": 1, "title": "当季最后一个交易日的收盘价"},
|
1233
|
+
{"name": "持股总数", "table_sort": 1},
|
1234
|
+
{"name": "持仓基金数", "table_sort": 1},
|
1235
|
+
{"name": "持股进前10的基金数", "table_sort": 1, "title": "基金数以持股数占比进前10内的股票来统计"},
|
1236
|
+
{"name": "持仓市值", "table_sort": 1, "title": "当时股价 * 持股总数"},
|
1237
|
+
]
|
1238
|
+
});
|
1239
|
+
if ($("#is_fund10_num").length > 0) {
|
1240
|
+
$("#is_fund10_num").click(function() {
|
1241
|
+
Util.fetch_public_fund_change(code);
|
1242
|
+
});
|
1243
|
+
}
|
1244
|
+
}
|
1237
1245
|
Util.post("/stock/" + code, {action: "public_fund_change"}, function (j) {
|
1238
1246
|
Util["pfc_stock_chart"].hideLoading();
|
1239
|
-
let date_data = [], fund_num_data = [], stock_num_data = [], price_data = [], _html = [];
|
1247
|
+
let date_data = [], fund_num_data = [], stock_num_data = [], price_data = [], _html = [], is_fund10_num = 0;
|
1248
|
+
if ($("#is_fund10_num").length > 0) {
|
1249
|
+
is_fund10_num = $("#is_fund10_num").prop("checked") ? 1 : 0;
|
1250
|
+
}
|
1240
1251
|
j["data"].forEach(function (item) {
|
1241
1252
|
let date_format = Util.seconds_to_format(item["date"], "%Y-%m-%d");
|
1242
1253
|
date_data.push(date_format);
|
1243
|
-
|
1254
|
+
if (is_fund10_num === 1) {
|
1255
|
+
fund_num_data.push(item["fund_rank_num"]);
|
1256
|
+
} else {
|
1257
|
+
fund_num_data.push(item["fund_num"]);
|
1258
|
+
}
|
1244
1259
|
stock_num_data.push(item["stock_num"]);
|
1245
1260
|
price_data.push(item["price"]);
|
1246
1261
|
_html.push("<tr>");
|
@@ -1259,9 +1274,13 @@ const Util = {
|
|
1259
1274
|
if (item["pre_fund_num"]) {
|
1260
1275
|
fund_num_rate = "(" + Util.year_price_rate(item["fund_num"], item["pre_fund_num"], 1) + ")";
|
1261
1276
|
}
|
1262
|
-
_html.push("<td>", item["fund_num"], fund_num_rate, "</td>");
|
1263
|
-
let
|
1264
|
-
|
1277
|
+
_html.push("<td data-val='", item["fund_num"], "'>", item["fund_num"], fund_num_rate, "</td>");
|
1278
|
+
let fund_rank_num_rate = "";
|
1279
|
+
if (item["pre_fund_rank_num"]) {
|
1280
|
+
fund_rank_num_rate = "(" + Util.year_price_rate(item["fund_rank_num"], item["pre_fund_rank_num"], 1) + ")";
|
1281
|
+
}
|
1282
|
+
_html.push("<td data-val='", item["fund_rank_num"], "'>", item["fund_rank_num"], fund_rank_num_rate, "</td>");
|
1283
|
+
_html.push("<td data-val='", item["hold_value"], "' title='", item["hold_value"], "'>", Util.to_unit(item["hold_value"], 3), "</td>");
|
1265
1284
|
_html.push("</tr>");
|
1266
1285
|
});
|
1267
1286
|
date_data = date_data.reverse();
|