sbd-npm 1.3.21 → 1.3.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/constant.js CHANGED
@@ -37,6 +37,7 @@ const MenuList = [
37
37
  'icon': 'edit',
38
38
  'menu': [
39
39
  {'key': 'trend_price', 'name': '股价阶段涨跌幅度', 'url': '/0x84527c7c3487b39afd820f2b309355cd75c01653'},
40
+ {'key': 'trend_day3_stabilize', 'name': '连续三日收红', 'url': '/0x7e9df652521f334030e0be383f5fe10f01a67243'},
40
41
  {'key': 'trend_macd_down', 'name': 'MACD金叉', 'url': '/0x96943c359b08b02392a168ad6cd4b5703e3e9267'},
41
42
  {'key': 'trend_kdj', 'name': 'KDJ金叉', 'url': '/0x3382bdaec4e8715ce27ca2b538dce09a2f8f5e50'},
42
43
  {'key': 'trend_money_inflow', 'name': '资金流入历史最高', 'url': '/0xfbfc92be1eebe9ccf5b2f14b9a2ea25f2cc941b8'},
@@ -46,7 +47,6 @@ const MenuList = [
46
47
  {'key': 'trend_ma20_60', 'name': '20、60日均线交叉', 'url': '/0x4f3b8625bcfcf0c4289b0a7df82d0afc1af4d026'},
47
48
  {'key': 'trend_doji', 'name': '十字星', 'url': '/0x60f986e9f89a1dfafc8ae792bf0b5fb8e0d1887c'},
48
49
  {'key': 'trend_ma510', 'name': '突破5、10日均线', 'url': '/0x46044beeaca896fe6acd86be3c94778f4c57e316'},
49
- {'key': 'trend_day3_stabilize', 'name': '连续三日收红', 'url': '/0x7e9df652521f334030e0be383f5fe10f01a67243'},
50
50
  {'key': 'trend_holder_minimum', 'name': '股东数历史最少', 'url': '/0xf0c0c360a283689c83ae216c6bbb03777d8068ca'},
51
51
  {'key': 'trend_down_maximum', 'name': '历史高位最大跌幅', 'url': '/0x8d7b8abeec94e2ebe4b25115272d9d5899355c43'},
52
52
  {'key': 'trend_fund_hold', 'name': '基金数持股变化', 'url': '/0x706c0e77ca3e314b5186c763e6ee857b744e9880'},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.3.21",
3
+ "version": "1.3.23",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/stock_basics.js CHANGED
@@ -1220,9 +1220,11 @@ let Stock = {
1220
1220
 
1221
1221
  fetch_hkex_holding_modal: function () {
1222
1222
  Util.init_modal_skeleton("hkex_holding_modal", '');
1223
- $("#hkex_holding_modal_title").html("[" + Stock["name"] + "]港股通持股明细数据<span style='color: #BDBDBD;' id='hkex_holding_modal_summary'></span>");
1224
1223
  let hhm_obj = $('#hkex_holding_modal');
1225
1224
  hhm_obj.on('shown.bs.modal', function (e) {
1225
+ let url = $("#hkex_holding_summary").find("a").first().attr("href");
1226
+ let title = Util.pack_html_link(url, "[" + Stock["name"] + "]港股通持股明细数据");
1227
+ $("#hkex_holding_modal_title").html(title + "<span style='color: #BDBDBD;' id='hkex_holding_modal_summary'></span>");
1226
1228
  Util.init_table_skeleton({
1227
1229
  "element_id": "hkex_holding_modal_body",
1228
1230
  "caption": "none",
package/util.js CHANGED
@@ -1046,19 +1046,19 @@ const Util = {
1046
1046
 
1047
1047
  /**
1048
1048
  * 初始分类股票的显示表格
1049
- * @param stock_category
1049
+ * @param portfolio
1050
1050
  * @param table_id
1051
1051
  * @param alert_tips
1052
1052
  */
1053
- init_stock_category_data: function (stock_category, table_id, alert_tips = "") {
1053
+ init_portfolio_data: function (portfolio, table_id, alert_tips = "") {
1054
1054
  Util.show_loading();
1055
1055
  let head_cols = [
1056
1056
  {"name": "代码"},
1057
1057
  {"name": "名称"},
1058
1058
  {"name": "PE", "title": "市盈率(Price Earnings Ratio)", "table_sort": 1},
1059
1059
  {"name": "总市值", "table_sort": 1},
1060
- {"name": "行业", "select_id": "stock_category_industry"},
1061
- {"name": "地区", "select_id": "stock_category_area"},
1060
+ {"name": "行业", "select_id": "portfolio_industry"},
1061
+ {"name": "地区", "select_id": "portfolio_area"},
1062
1062
  {"name": "当前价", "table_sort": 1},
1063
1063
  {"name": "最高价", "table_sort": 1},
1064
1064
  {"name": "最低价", "table_sort": 1},
@@ -1066,12 +1066,12 @@ const Util = {
1066
1066
  {"name": "近5日", "table_sort": 1},
1067
1067
  {"name": "52周最高", "table_sort": 1}
1068
1068
  ];
1069
- if (stock_category !== "us") {
1069
+ if (portfolio !== "us") {
1070
1070
  head_cols.push({"name": "成交额", "table_sort": 1});
1071
1071
  head_cols.push({"name": "成交均价", "table_sort": 1});
1072
1072
  head_cols.push({"name": "股东数", "table_sort": 1});
1073
1073
  head_cols.push({"name": "基金数", "table_sort": 1});
1074
- head_cols.push({"name": "备注", "id": "stock_category_remark_title"});
1074
+ head_cols.push({"name": "备注", "id": "portfolio_remark_title"});
1075
1075
  } else {
1076
1076
  head_cols.unshift({"name": ""});
1077
1077
  }
@@ -1084,28 +1084,28 @@ const Util = {
1084
1084
  table_options["alert"] = alert_tips;
1085
1085
  }
1086
1086
  Util.init_table_skeleton(table_options);
1087
- Util["stock_category_table_id"] = table_id;
1088
- Util.post(location.pathname, {active_div: stock_category}, function (j) {
1089
- Util["stock_category_data"] = j["data"] ? j["data"] : [];
1090
- Util["stock_category_index"] = j["index_list"] ? j["index_list"] : [];
1091
- Util.render_type_option($("#stock_category_industry"), j["data"], "industry", Util.render_stock_category_html);
1092
- Util.render_type_option($("#stock_category_area"), j["data"], "area", Util.render_stock_category_html);
1093
- Util.render_stock_category_html();
1087
+ Util["portfolio_table_id"] = table_id;
1088
+ Util.post(location.pathname, {active_div: portfolio}, function (j) {
1089
+ Util["portfolio_data"] = j["data"] ? j["data"] : [];
1090
+ Util["portfolio_index"] = j["index_list"] ? j["index_list"] : [];
1091
+ Util.render_type_option($("#portfolio_industry"), j["data"], "industry", Util.render_portfolio_html);
1092
+ Util.render_type_option($("#portfolio_area"), j["data"], "area", Util.render_portfolio_html);
1093
+ Util.render_portfolio_html();
1094
1094
  if (j["portfolio_url"]) {
1095
- $("#stock_category_remark_title").html(Util.pack_html_link(j["portfolio_url"], "备注<i class='glyphicon glyphicon-link'></i>"));
1095
+ $("#portfolio_remark_title").html(Util.pack_html_link(j["portfolio_url"], "备注<i class='glyphicon glyphicon-link'></i>"));
1096
1096
  }
1097
1097
  Util.hide_tips();
1098
1098
  });
1099
1099
  },
1100
1100
 
1101
- render_stock_category_html: function () {
1102
- if (Util["stock_category_table_id"]) {
1101
+ render_portfolio_html: function () {
1102
+ if (Util["portfolio_table_id"]) {
1103
1103
  let _html = [], total_num = 0;
1104
- let is_us = $("#stock_category_remark_title").length === 0 ? 1 : 0;
1105
- if (Util["stock_category_data"]) {
1106
- let industry = $("#stock_category_industry").val();
1107
- let area = $("#stock_category_area").val();
1108
- Util["stock_category_data"].forEach(function (item) {
1104
+ let is_us = $("#portfolio_remark_title").length === 0 ? 1 : 0;
1105
+ if (Util["portfolio_data"]) {
1106
+ let industry = $("#portfolio_industry").val();
1107
+ let area = $("#portfolio_area").val();
1108
+ Util["portfolio_data"].forEach(function (item) {
1109
1109
  if (Util.is_industry_area(item, industry, area)) {
1110
1110
  total_num++;
1111
1111
  _html.push("<tr>");
@@ -1130,7 +1130,7 @@ const Util = {
1130
1130
  }
1131
1131
  });
1132
1132
  }
1133
- let table_body_id = Util["stock_category_table_id"] + "_body";
1133
+ let table_body_id = Util["portfolio_table_id"] + "_body";
1134
1134
  Util.render_table_html(table_body_id, _html);
1135
1135
  if (is_us === 1) {
1136
1136
  $("img").on("error", function () {
@@ -1138,7 +1138,7 @@ const Util = {
1138
1138
  });
1139
1139
  }
1140
1140
  $("#" + table_body_id + "_tips").html('共 <span class="label label-info">' + total_num + '</span> 家');
1141
- let index_list = Util["stock_category_index"] ? Util["stock_category_index"] : [];
1141
+ let index_list = Util["portfolio_index"] ? Util["portfolio_index"] : [];
1142
1142
  Util.init_stock_stuff(table_body_id, index_list, is_us);
1143
1143
  }
1144
1144
  },
@@ -2835,17 +2835,16 @@ const Util = {
2835
2835
  * @returns {string}
2836
2836
  */
2837
2837
  pack_holder_num: function (item) {
2838
+ let holder_info = "--";
2838
2839
  if (item["holder_num"] && item["holder_num"] > 0) {
2839
- let holder_url = Util.get_url("holder_num") + "?code=" + item["code"];
2840
- let holder_info = "";
2841
2840
  if (item["pre_holder_num"] && item["pre_holder_num"] > 0) {
2842
2841
  holder_info = Util.digit_compare_trend(item["holder_num"], item["pre_holder_num"]);
2843
2842
  } else {
2844
2843
  holder_info = Util.digit_compare_trend(item["holder_num"], 0);
2845
2844
  }
2846
- return Util.pack_html_link(holder_url, holder_info);
2847
2845
  }
2848
- return "--";
2846
+ let holder_url = Util.get_url("holder_num") + "?code=" + item["code"];
2847
+ return Util.pack_html_link(holder_url, holder_info);
2849
2848
  },
2850
2849
 
2851
2850
  /**
@@ -2854,11 +2853,11 @@ const Util = {
2854
2853
  * @returns {string}
2855
2854
  */
2856
2855
  pack_fund_num: function (item) {
2856
+ let fund_num = "--";
2857
2857
  if (item["cur_fund_num"] && item["cur_fund_num"] > 0) {
2858
- let fund_num = Util.digit_compare_trend(item["cur_fund_num"], item["pre_fund_num"]);
2859
- return Util.pack_html_link("/stock/" + item["code"] + "?tab=public_fund", fund_num);
2858
+ fund_num = Util.digit_compare_trend(item["cur_fund_num"], item["pre_fund_num"]);
2860
2859
  }
2861
- return "--";
2860
+ return Util.pack_html_link("/stock/" + item["code"] + "?tab=public_fund", fund_num);
2862
2861
  },
2863
2862
 
2864
2863
  /**