sbd-npm 1.4.21 → 1.4.23

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/summary_daily.js CHANGED
@@ -87,7 +87,7 @@ $(function () {
87
87
  * 当前行情指数
88
88
  */
89
89
  pack_index_summary_data: function (index_data) {
90
- let _html = [], change_color_data = [];
90
+ let html = [], change_color_data = [];
91
91
  index_data.forEach(function (item) {
92
92
  let cls = "", sort = "";
93
93
  if (item["change"] > 0) {
@@ -107,14 +107,14 @@ $(function () {
107
107
  change_color_data.push({"key": item["key"], "origin": change_rate_obj.css("background-color"), "new": "#ADFFAD"});
108
108
  }
109
109
  }
110
- _html.push('<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">');
110
+ html.push('<div class="col-md-2 col-sm-4 col-xs-6 tile_stats_count">');
111
111
  let index_name = item["href"] ? Util.pack_html_link(item["href"], item["name"]) : item["name"];
112
- _html.push('<span class="count_top"><i class="fa"></i> ', index_name, '</span>');
113
- _html.push('<div class="count ', cls, '">', item["value"], '</div>');
114
- _html.push('<span class="count_bottom"><i class="', cls, '"><i class="fa ', sort, '"></i>', item["change"], '(<span id="', change_rate_id, '">', Util.to_float(item["change_rate"], 2), '</span>%)</i></span>');
115
- _html.push('</div>');
112
+ html.push('<span class="count_top"><i class="fa"></i> ', index_name, '</span>');
113
+ html.push('<div class="count ', cls, '">', item["value"], '</div>');
114
+ html.push('<span class="count_bottom"><i class="', cls, '"><i class="fa ', sort, '"></i>', item["change"], '(<span id="', change_rate_id, '">', Util.to_float(item["change_rate"], 2), '</span>%)</i></span>');
115
+ html.push('</div>');
116
116
  });
117
- $("#index_summary_data").html(_html.join(""));
117
+ $("#index_summary_data").html(html.join(""));
118
118
  change_color_data.forEach(function (item) {
119
119
  let change_rate_obj = $("#change_rate_" + item["key"]);
120
120
  change_rate_obj.css("background-color", item["new"]);
@@ -266,19 +266,19 @@ $(function () {
266
266
  */
267
267
  pack_news_data: function (news_data) {
268
268
  if (news_data.length > 0) {
269
- let _html = [];
269
+ let html = [];
270
270
  news_data.forEach(function (item) {
271
- _html.push('<li><div class="block"><div class="block_content">');
271
+ html.push('<li><div class="block"><div class="block_content">');
272
272
  let title = item["title"].replace(/\\/g, ""); // JavaScript 中斜杠和反斜杠的替换
273
273
  if (item["is_pbc"] && parseInt(item["is_pbc"]) === 1) {
274
274
  title = "<b class='text-danger'>" + title + "</b>";
275
275
  }
276
- _html.push('<h2 class="title">', Util.pack_html_link(item["url"], title), '</h2>');
277
- _html.push('<div class="byline"><span>', Util.seconds_to_format(item["ctime"]), '</span></div>');
278
- _html.push('<p class="excerpt">', item["content"], '</p>');
279
- _html.push('</div></div></li>');
276
+ html.push('<h2 class="title">', Util.pack_html_link(item["url"], title), '</h2>');
277
+ html.push('<div class="byline"><span>', Util.seconds_to_format(item["ctime"]), '</span></div>');
278
+ html.push('<p class="excerpt">', item["content"], '</p>');
279
+ html.push('</div></div></li>');
280
280
  });
281
- $("#news_list").html(_html.join(""));
281
+ $("#news_list").html(html.join(""));
282
282
  }
283
283
  },
284
284
 
@@ -286,12 +286,12 @@ $(function () {
286
286
  * 市场成交概况
287
287
  */
288
288
  pack_market_overview: function (market_overview_dict) {
289
- let _html = [], previous_mo_amount = 0, mo_amount = 0, mo_amount_cls = "", mo_amount_sign = "";
289
+ let html = [], previous_mo_amount = 0, mo_amount = 0, mo_amount_cls = "", mo_amount_sign = "";
290
290
  for (let market_type in market_overview_dict) {
291
291
  if (market_overview_dict.hasOwnProperty(market_type) && market_overview_dict[market_type]["name"]) {
292
292
  let market_capital = "--", pe = "--", volume = "--", amount = "--", market = market_overview_dict[market_type];
293
- _html.push("<tr>");
294
- _html.push("<td style='padding: 18px 0;'>", Util.pack_html_link(market["url"], market["name"]), "</td>");
293
+ html.push("<tr>");
294
+ html.push("<td style='padding: 18px 0;'>", Util.pack_html_link(market["url"], market["name"]), "</td>");
295
295
  if (market["item"]) {
296
296
  if (market_type !== 5 && market["item"]) {
297
297
  previous_mo_amount += market["item"]["prev_amount"];
@@ -322,14 +322,14 @@ $(function () {
322
322
  }
323
323
  }
324
324
  }
325
- _html.push("<td style='padding: 18px 0;'>", market_capital, "</td>");
326
- _html.push("<td style='padding: 18px 0;'>", pe, "</td>");
327
- _html.push("<td style='padding: 18px 0;'>", volume, "</td>");
328
- _html.push("<td style='padding: 18px 0;'>", amount, "</td>");
329
- _html.push("</tr>");
325
+ html.push("<td style='padding: 18px 0;'>", market_capital, "</td>");
326
+ html.push("<td style='padding: 18px 0;'>", pe, "</td>");
327
+ html.push("<td style='padding: 18px 0;'>", volume, "</td>");
328
+ html.push("<td style='padding: 18px 0;'>", amount, "</td>");
329
+ html.push("</tr>");
330
330
  }
331
331
  }
332
- $("#market_overview_zone").html(_html.join(""));
332
+ $("#market_overview_zone").html(html.join(""));
333
333
  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) {
334
334
  mo_amount = Util.to_hundred_million(market_overview_dict["total_amount_data"][0], 3)
335
335
  previous_mo_amount = Util.to_hundred_million(market_overview_dict["total_amount_data"][1], 3)
@@ -414,7 +414,7 @@ $(function () {
414
414
  }
415
415
  });
416
416
  if (new_data.length > 0) {
417
- let _html = [];
417
+ let html = [];
418
418
  new_data.sort(function (d1, d2) {
419
419
  return d1["value"] > d2["value"] ? -1 : 1;
420
420
  });
@@ -424,9 +424,9 @@ $(function () {
424
424
  let sell = "<td title='卖出金额-" + item["sell"] + "'>" + Util.to_hundred_million(item["sell"]) + "亿</td>";
425
425
  let value = "<td>" + Util.to_hundred_million(item["value"]) + "亿</td>";
426
426
  let price_change = "<td>" + Util.digit_compare_trend(item["price"], item["pre_price"]) + "</td>";
427
- _html.push("<tr>", stock_url, price_change, buy, sell, value, "</tr>");
427
+ html.push("<tr>", stock_url, price_change, buy, sell, value, "</tr>");
428
428
  });
429
- Util.render_table_html(market + "_table_body", _html);
429
+ Util.render_table_html(market + "_table_body", html);
430
430
  }
431
431
  },
432
432
 
@@ -441,23 +441,23 @@ $(function () {
441
441
  end_date: $("#index_hist_modal_end_date").val()
442
442
  };
443
443
  Util.post("/action", payload, function (j) {
444
- let _html = [], latest_date = 0;
444
+ let html = [], latest_date = 0;
445
445
  j["data"].forEach(function (item) {
446
446
  latest_date = Math.max(latest_date, item["date"]);
447
447
  });
448
448
  j["data"].forEach(function (item) {
449
449
  if (item["date"] === latest_date) {
450
- _html.push("<tr class='info'>");
450
+ html.push("<tr class='info'>");
451
451
  } else {
452
- _html.push("<tr>");
452
+ html.push("<tr>");
453
453
  }
454
- _html.push("<td>", Util.seconds_to_format(item["date"], "%Y-%m-%d"), "</td>");
455
- _html.push("<td>", item["open"], "</td>");
456
- _html.push("<td>", item["low"], "</td>");
457
- _html.push("<td>", item["high"], "</td>");
458
- _html.push("<td data-val='", item["close"], "'><b class='", Util.text_color(item["p_change_rate"]), "'>", item["close"], "</b></td>");
459
- _html.push("<td>", Util.parse_ratio(item["p_change_rate"]), "</td>");
460
- _html.push("<td data-val='", item["volume"], "'>", Util.to_unit(item["volume"]), "股</td>");
454
+ html.push("<td>", Util.seconds_to_format(item["date"], "%Y-%m-%d"), "</td>");
455
+ html.push("<td>", item["open"], "</td>");
456
+ html.push("<td>", item["low"], "</td>");
457
+ html.push("<td>", item["high"], "</td>");
458
+ html.push("<td data-val='", item["close"], "'><b class='", Util.text_color(item["p_change_rate"]), "'>", item["close"], "</b></td>");
459
+ html.push("<td>", Util.parse_ratio(item["p_change_rate"]), "</td>");
460
+ html.push("<td data-val='", item["volume"], "'>", Util.to_unit(item["volume"]), "股</td>");
461
461
  let amount = Util.to_unit(item["amount"], 3);
462
462
  if (item["pre_amount"]) {
463
463
  if (item["amount"] > item["pre_amount"]) {
@@ -466,10 +466,10 @@ $(function () {
466
466
  amount += "<b class='text-success'>(" + Util.to_unit(item["amount"] - item["pre_amount"], 3) + ")</b>";
467
467
  }
468
468
  }
469
- _html.push("<td data-val='", item["amount"], "'>", amount, "</td>");
470
- _html.push("</tr>");
469
+ html.push("<td data-val='", item["amount"], "'>", amount, "</td>");
470
+ html.push("</tr>");
471
471
  });
472
- Util.render_table_html("index_hist_modal_body_body", _html);
472
+ Util.render_table_html("index_hist_modal_body_body", html);
473
473
  Util.hide_tips();
474
474
  });
475
475
  },
@@ -606,42 +606,42 @@ $(function () {
606
606
  },
607
607
 
608
608
  render_stock_rate_html: function() {
609
- let _html = [], index = 0;
609
+ let html = [], index = 0;
610
610
  let industry = $("#p_change_industry").val();
611
611
  let area = $("#p_change_area").val();
612
612
  Modal["p_change_data"].forEach(function (item) {
613
613
  if (Util.is_industry_area(item, industry, area)) {
614
614
  index++;
615
- _html.push("<tr>");
616
- _html.push("<td>", index, "</td>");
617
- _html = Util.stock_basics_html(_html, item);
618
- _html.push("<td>", Util.year_price_rate(item["stock_price"], item["year_price"]), "</td>");
619
- _html.push("<td class='holder_", item["code"], "'>--</td>");
615
+ html.push("<tr>");
616
+ html.push("<td>", index, "</td>");
617
+ html = Util.stock_basics_html(html, item);
618
+ html.push("<td>", Util.year_price_rate(item["stock_price"], item["year_price"]), "</td>");
619
+ html.push("<td class='holder_", item["code"], "'>--</td>");
620
620
  if (item["continue_top_day"]) {
621
- _html.push("<td title='连续涨停" + item["continue_top_day"] + "天'>", Util.parse_ratio(item["p_change"]), " <span class='badge alert-danger'>" + item["continue_top_day"] + "<span></td>");
621
+ html.push("<td title='连续涨停" + item["continue_top_day"] + "天'>", Util.parse_ratio(item["p_change"]), " <span class='badge alert-danger'>" + item["continue_top_day"] + "<span></td>");
622
622
  } else {
623
- _html.push("<td>", Util.parse_ratio(item["p_change"]), "</td>");
623
+ html.push("<td>", Util.parse_ratio(item["p_change"]), "</td>");
624
624
  }
625
- _html.push("</tr>");
625
+ html.push("</tr>");
626
626
  }
627
627
  });
628
- Util.render_table_html("stock_rate_modal_body_body", _html);
628
+ Util.render_table_html("stock_rate_modal_body_body", html);
629
629
  Util.init_stock_stuff("stock_rate_modal_body_body", [], 0, 0);
630
630
  },
631
631
 
632
632
  render_news_modal: function () {
633
633
  Util.show_loading();
634
634
  Util.post(location.pathname, {action: "pbc_news"}, function (j) {
635
- let _html = [], index = 0;
635
+ let html = [], index = 0;
636
636
  j["data"].forEach(function (item) {
637
637
  index++;
638
- _html.push("<tr title='", item["content"], "'>");
639
- _html.push('<td>' + Util.pack_html_link(item["url"], item["title"].replace(/\\/g, "")) + '</td>');
640
- _html.push("<td>", Util.seconds_to_format(item["ctime"]), "</td>");
641
- _html.push("<td>", Util.substring(item["content"], 40), "</td>");
642
- _html.push("</tr>");
638
+ html.push("<tr title='", item["content"], "'>");
639
+ html.push('<td>' + Util.pack_html_link(item["url"], item["title"].replace(/\\/g, "")) + '</td>');
640
+ html.push("<td>", Util.seconds_to_format(item["ctime"]), "</td>");
641
+ html.push("<td>", Util.substring(item["content"], 40), "</td>");
642
+ html.push("</tr>");
643
643
  });
644
- Util.render_table_html("news_modal_body_body", _html);
644
+ Util.render_table_html("news_modal_body_body", html);
645
645
  Util.hide_tips();
646
646
  });
647
647
  }