sbd-npm 1.3.69 → 1.3.70

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/summary_daily.js +24 -12
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.3.69",
3
+ "version": "1.3.70",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/summary_daily.js CHANGED
@@ -47,10 +47,8 @@ $(function () {
47
47
  load_cache: function () {
48
48
  DailySummary["hsgt_money_flow_chart"] = Util.show_chart_loading(DailySummary["hsgt_money_flow_chart"], "hsgt_money_flow_line");
49
49
  try {
50
+ Util.set_table_loading("market_overview_zone");
50
51
  let cache = DailySummary.get_cache();
51
- if (cache.hasOwnProperty("market_overview")) {
52
- DailySummary.pack_market_overview(cache["market_overview"]);
53
- }
54
52
  if (cache.hasOwnProperty("index")) {
55
53
  DailySummary.pack_index_data(cache["index"]);
56
54
  }
@@ -310,19 +308,33 @@ $(function () {
310
308
  mo_amount += market["item"]["amount"];
311
309
  }
312
310
  _html.push("<tr>");
313
- _html.push("<td>", Util.pack_html_link(market["url"], market["name"]), "</td>");
314
- _html.push(DailySummary.pack_mo_item_html(market, "market_capital", "万亿"));
315
- _html.push(DailySummary.pack_mo_item_html(market, "pe", ""));
316
- _html.push(DailySummary.pack_mo_item_html(market, "volume", "亿股"));
317
- _html.push(DailySummary.pack_mo_item_html(market, "amount", "亿"));
311
+ _html.push("<td style='padding: 18px 0;'>", Util.pack_html_link(market["url"], market["name"]), "</td>");
312
+ _html.push("<td style='padding: 18px 0;'>", (market["item"]["market_capital"] ? (market["item"]["market_capital"] + "万亿") : "--"), "</td>");
313
+ _html.push("<td style='padding: 18px 0;'>", (market["item"]["pe"] ? market["item"]["pe"] : "--"), "</td>");
314
+ _html.push("<td style='padding: 18px 0;'>", (market["item"]["volume"] ? (market["item"]["volume"] + "亿股") : "--"), "</td>");
315
+ let amount = "--";
316
+ if (market["item"]["amount"] && market["item"]["amount"] > 0) {
317
+ if (market["item"]["prev_amount"] && market["item"]["prev_amount"] > 0) {
318
+ if (market["item"]["amount"] > market["item"]["prev_amount"]) {
319
+ amount = "<b title='前值: " + market["item"]["prev_amount"] + "亿' class='text-danger'>" + market["item"]["amount"] + "亿</b>";
320
+ } else if (market["item"]["amount"] < market["item"]["prev_amount"]) {
321
+ amount = "<b title='前值: " + market["item"]["prev_amount"] + "亿' class='text-success'>" + market["item"]["amount"] + "亿</b>";
322
+ } else {
323
+ amount = market["item"]["amount"] + "亿";
324
+ }
325
+ } else {
326
+ amount = market["item"]["amount"] + "亿";
327
+ }
328
+ }
329
+ _html.push("<td style='padding: 18px 0;'>", amount, "</td>");
318
330
  _html.push("</tr>");
319
331
  }
320
332
  }
321
333
  }
322
334
  $("#market_overview_zone").html(_html.join(""));
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)
335
+ if (market_overview_dict["total_amount_data"] && market_overview_dict["total_amount_data"].length === 2 && market_overview_dict["total_amount_data"][0] > 0 && market_overview_dict["total_amount_data"][1] > 0) {
336
+ mo_amount = Util.to_hundred_million(market_overview_dict["total_amount_data"][0], 3)
337
+ previous_mo_amount = Util.to_hundred_million(market_overview_dict["total_amount_data"][1], 3)
326
338
  }
327
339
  if (mo_amount > previous_mo_amount) {
328
340
  mo_amount_cls = "label-danger";
@@ -331,7 +343,7 @@ $(function () {
331
343
  mo_amount_cls = "label-success";
332
344
  }
333
345
  let mo_amount_obj = $("#market_overview_amount");
334
- mo_amount_obj.attr("title", Util.to_float(previous_mo_amount, 3));
346
+ mo_amount_obj.attr("title", "前值: " + Util.to_float(previous_mo_amount, 3) + "亿");
335
347
  mo_amount_obj.removeClass("label-danger");
336
348
  mo_amount_obj.removeClass("label-success");
337
349
  if (mo_amount_cls.length > 0) {