sbd-npm 1.1.48 → 1.1.49

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.1.48",
3
+ "version": "1.1.49",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/summary_daily.js CHANGED
@@ -31,8 +31,7 @@ $(document).ready(function () {
31
31
  },
32
32
 
33
33
  load_cache: function () {
34
- DailySummary["hsgt_money_flow_chart"] = Util.init_chart_instance("hsgt_money_flow_line");
35
- DailySummary["hsgt_money_flow_chart"].showLoading();
34
+ DailySummary["hsgt_money_flow_chart"] = Util.show_chart_loading(DailySummary["hsgt_money_flow_chart"], "hsgt_money_flow_line");
36
35
  try {
37
36
  let cache = DailySummary.get_cache();
38
37
  if (cache.hasOwnProperty("market_overview")) {
package/util.js CHANGED
@@ -215,7 +215,7 @@ const Util = {
215
215
  * @returns {string}
216
216
  */
217
217
  industry_url: function (code, industry) {
218
- if (industry === "undefined") {
218
+ if (industry === "undefined" || industry === "None") {
219
219
  return "--";
220
220
  }
221
221
  if (industry) {
@@ -752,6 +752,74 @@ const Util = {
752
752
  });
753
753
  },
754
754
 
755
+ /**
756
+ * 初始分类股票的显示表格
757
+ * @param stock_category
758
+ * @param table_id
759
+ */
760
+ init_stock_category_data: function (stock_category, table_id) {
761
+ Util.show_tips("Loading...");
762
+ let head_cols = [
763
+ {"name": "代码"},
764
+ {"name": "名称"},
765
+ {"name": "PE", "title": "市盈率(Price Earnings Ratio)", "table_sort": 1},
766
+ {"name": "总市值", "table_sort": 1},
767
+ {"name": "行业"},
768
+ {"name": "地区"},
769
+ {"name": "当前价", "table_sort": 1},
770
+ {"name": "最高价"},
771
+ {"name": "最低价"},
772
+ {"name": "年初至今", "table_sort": 1},
773
+ {"name": "52周最高", "table_sort": 1}
774
+ ];
775
+ if (stock_category !== "us") {
776
+ head_cols.push({"name": "成交金额", "table_sort": 1});
777
+ head_cols.push({"name": "成交均价"});
778
+ head_cols.push({"name": "股东数", "table_sort": 1});
779
+ head_cols.push({"name": "备注", "id": "remark_title"});
780
+ }
781
+ Util.init_table_skeleton({
782
+ "element_id": table_id,
783
+ "caption": '<caption><span id="index_data"></span><div class="pull-right" id="' + table_id + '_body_tips"></div></caption>',
784
+ "head_cols": head_cols
785
+ });
786
+ Util.post(location.pathname, {active_div: stock_category}, function (j) {
787
+ let _html = [];
788
+ let total_num = 0;
789
+ j["data"].forEach(function (item) {
790
+ total_num++;
791
+ _html.push("<tr>");
792
+ item["code"] = item["code"].toLowerCase();
793
+ _html = Util.stock_basics_html(_html, item);
794
+ _html.push("<td id='high_", item["code"], "'>0</td>");
795
+ _html.push("<td id='low_", item["code"], "'>0</td>");
796
+ _html.push("<td data-val='", item["year_price"], "' class='year_price_", item["code"], "'>--</td>");
797
+ _html.push("<td class='high_52week_", item["code"], "'>--</td>");
798
+ if (stock_category !== "us") {
799
+ _html.push("<td id='amount_", item["code"], "'>--</td>");
800
+ _html.push("<td id='average_", item["code"], "'>--</td>");
801
+ let holder_num = "--";
802
+ if (item["holder_num"] && item["holder_num"] > 0) {
803
+ let url = Util.get_url("holder_num") + "?code=" + item["code"];
804
+ holder_num = Util.pack_html_link(url, Util.digit_compare_trend(item["holder_num"], item["pre_holder_num"]));
805
+ }
806
+ _html.push("<td id='holder_", item["code"], "'>", holder_num, "</td>");
807
+ _html.push("<td id='remark_", item["code"], "'></td>");
808
+ }
809
+ _html.push("</tr>");
810
+ });
811
+ Util.render_table_html(table_id + "_body", _html);
812
+ $("#" + table_id + "_body_tips").html('共 <span class="label label-info">' + total_num + '</span> 家');
813
+ if (j["concept_url"]) {
814
+ $("#remark_title").html(Util.pack_html_link(j["concept_url"], "备注<i class='glyphicon glyphicon-link'></i>"));
815
+ }
816
+ Util.hide_tips();
817
+ let index_list = j["index_list"] ? j["index_list"] : [];
818
+ let is_us = stock_category === "us" ? 1 : 0;
819
+ Util.init_stock_stuff(table_id + "_body", index_list, is_us);
820
+ });
821
+ },
822
+
755
823
  /**
756
824
  * 初始公募基金组件
757
825
  * @param component_id
@@ -1522,6 +1590,10 @@ const Util = {
1522
1590
  });
1523
1591
  },
1524
1592
 
1593
+ /**
1594
+ * 表格排序
1595
+ * @param element_id
1596
+ */
1525
1597
  table_sort: function (element_id = "") {
1526
1598
  let selector = element_id === "" ? ".table_sort" : ("#" + element_id + " .table_sort");
1527
1599
  $(selector).each(function () {