sbd-npm 1.3.22 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/util.js +23 -23
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.3.22",
3
+ "version": "1.3.23",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
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
  },