sbd-npm 1.2.35 → 1.2.36

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 +21 -19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.2.35",
3
+ "version": "1.2.36",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -487,7 +487,7 @@ const Util = {
487
487
  * @param code
488
488
  * @returns {*}
489
489
  */
490
- us_logo_html: function(code) {
490
+ us_logo_html: function (code) {
491
491
  code = code.toUpperCase();
492
492
  let logo_url = "https://storage.googleapis.com/iex/api/logos/" + code + ".png";
493
493
  return '<a rel="noopener noreferrer nofollow" href="' + logo_url + '" target="_blank"><img alt="' + code + '" width="20px" src="' + logo_url + '"/><a>';
@@ -991,23 +991,23 @@ const Util = {
991
991
  let assets = j["assets"] > 0 ? (j["assets"] + "亿") : "--";
992
992
  let public_date = j["public_date"] > 0 ? Util.seconds_to_format(j["public_date"], "%Y-%m-%d") : "--";
993
993
  let issue_date = j["issue_date"] > 0 ? Util.seconds_to_format(j["issue_date"], "%Y-%m-%d") : "--";
994
- _html.push("<tr title='最后更新时间: ", Util.seconds_to_format(j["update_time"], "%Y-%m-%d"), "' class='info'><th colspan='12' text-align='center'>基金概况</th></tr>");
995
- _html.push("<tr><td colspan='3'>基金代码</td><td colspan='3'>", Util.pack_html_link('https://fund.eastmoney.com/' + j["fund_code"] + '.html', j["fund_code"]), "</td><td colspan='2'>基金名</td><td colspan='4'>", Util.pack_html_link('https://fundf10.eastmoney.com/jbgk_' + j["fund_code"] + '.html', j["fund_name"]), "</td></tr>");
996
- _html.push("<tr><td colspan='3'>基金类型</td><td colspan='3'>", j["fund_type"], "</td><td colspan='2'>投资类型</td><td colspan='4'>", j["invest_type"], "</td></tr>");
997
- _html.push("<tr><td colspan='3'>单位净值</td><td colspan='3'>", net, "</td><td colspan='2'>资产规模</td><td colspan='4'>", assets, "</td></tr>");
998
- _html.push("<tr><td colspan='3'>成立日期</td><td colspan='3'>", public_date, "</td><td colspan='2'>发行日期</td><td colspan='4'>", issue_date, "</td></tr>");
999
- _html.push("<tr><td colspan='3'>基金管理公司</td><td colspan='3'>", j["administrator"], "</td><td colspan='2'>基金经理</td><td colspan='4'>", j["managers"], "</td></tr>");
1000
- _html.push("<tr><td colspan='4'>基金托管人</td><td colspan='8'>", (j["custodian"] ? j["custodian"] : "--"), "</td></tr>");
1001
- _html.push("<tr><td colspan='4'>经办律师事务所</td><td colspan='8'>", (j["lawyer"] ? j["lawyer"] : "--"), "</td></tr>");
1002
- _html.push("<tr><td colspan='4'>会计师事务所</td><td colspan='8'>", (j["accounting"] ? j["accounting"] : "--"), "</td></tr>");
1003
- _html.push("<tr><td colspan='4'>注册地址</td><td colspan='8'>", Util.map_url(j["location"], j["location"]), "</td></tr>");
994
+ _html.push("<tr title='最后更新时间: ", Util.seconds_to_format(j["update_time"], "%Y-%m-%d"), "' class='info'><th colspan='14' text-align='center'>基金概况</th></tr>");
995
+ _html.push("<tr><td colspan='3'>基金代码</td><td colspan='4'>", Util.pack_html_link('https://fund.eastmoney.com/' + j["fund_code"] + '.html', j["fund_code"]), "</td><td colspan='3'>基金名</td><td colspan='4'>", Util.pack_html_link('https://fundf10.eastmoney.com/jbgk_' + j["fund_code"] + '.html', j["fund_name"]), "</td></tr>");
996
+ _html.push("<tr><td colspan='3'>基金类型</td><td colspan='4'>", j["fund_type"], "</td><td colspan='3'>投资类型</td><td colspan='4'>", j["invest_type"], "</td></tr>");
997
+ _html.push("<tr><td colspan='3'>单位净值</td><td colspan='4'>", net, "</td><td colspan='3'>资产规模</td><td colspan='4'>", assets, "</td></tr>");
998
+ _html.push("<tr><td colspan='3'>成立日期</td><td colspan='4'>", public_date, "</td><td colspan='3'>发行日期</td><td colspan='4'>", issue_date, "</td></tr>");
999
+ _html.push("<tr><td colspan='3'>基金管理公司</td><td colspan='4'>", j["administrator"], "</td><td colspan='3'>基金经理</td><td colspan='4'>", j["managers"], "</td></tr>");
1000
+ _html.push("<tr><td colspan='5'>基金托管人</td><td colspan='9'>", (j["custodian"] ? j["custodian"] : "--"), "</td></tr>");
1001
+ _html.push("<tr><td colspan='5'>经办律师事务所</td><td colspan='9'>", (j["lawyer"] ? j["lawyer"] : "--"), "</td></tr>");
1002
+ _html.push("<tr><td colspan='5'>会计师事务所</td><td colspan='9'>", (j["accounting"] ? j["accounting"] : "--"), "</td></tr>");
1003
+ _html.push("<tr><td colspan='5'>注册地址</td><td colspan='9'>", Util.map_url(j["location"], j["location"]), "</td></tr>");
1004
1004
  let fund_stock_url = "https://fund.eastmoney.com/" + j["fund_code"] + ".html";
1005
1005
  if (j["type"] === 2) {
1006
1006
  fund_stock_url = "http://fund.eastmoney.com/f10/ccmx_" + j["fund_code"] + ".html";
1007
1007
  }
1008
- _html.push("<tr class='info'><th colspan='12' text-align='center'>", Util.pack_html_link(fund_stock_url, "持股明细"), " <span id='fund_stock_date_zone'></span></th></tr>");
1009
- _html.push("<tr id='" + component_id + "_head'><th>序号</th><th>股票代码</th><th>股票名</th><th>PE</th><th>总市值</th><th>行业</th><th>地区</th><th>价格</th><th>年初至今</th><th>近5日</th><th>持有量</th><th>占比</th><th>持仓市值</th></tr>");
1010
- _html.push("<tr class='" + component_id + "_tr'><td colspan='12'>暂无数据</td></tr>");
1008
+ _html.push("<tr class='info'><th colspan='14' text-align='center'>", Util.pack_html_link(fund_stock_url, "持股明细"), " <span id='fund_stock_date_zone'></span></th></tr>");
1009
+ _html.push("<tr id='" + component_id + "_head'><th>序号</th><th>股票代码</th><th>股票名</th><th>PE</th><th>总市值</th><th>行业</th><th>地区</th><th>价格</th><th>年初至今</th><th>近5日</th><th>股东数</th><th>持有量</th><th>占比</th><th>持仓市值</th></tr>");
1010
+ _html.push("<tr class='" + component_id + "_tr'><td colspan='14'>暂无数据</td></tr>");
1011
1011
  Util.render_table_html(component_id + "_body_body", _html);
1012
1012
  if (j["date_list"]) {
1013
1013
  _html = [];
@@ -1024,7 +1024,7 @@ const Util = {
1024
1024
  Util.fetch_public_fund_stock(j["fund_code"], fsd_obj.val(), component_id);
1025
1025
  }
1026
1026
  } else {
1027
- _html.push("<tr><td colspan='11'>暂无数据</td></tr>");
1027
+ _html.push("<tr><td colspan='14'>暂无数据</td></tr>");
1028
1028
  Util.render_table_html(component_id + "_body_body", _html);
1029
1029
  }
1030
1030
  });
@@ -1053,7 +1053,8 @@ const Util = {
1053
1053
  }
1054
1054
  }
1055
1055
  });
1056
- Util.post(Util.get_url("fund_public"), {action: "public_fund_stock", fund_code: fund_code, date: date, pre_date: pre_date}, function (j) {
1056
+ let payload = {action: "public_fund_stock", fund_code: fund_code, date: date, pre_date: pre_date};
1057
+ Util.post(Util.get_url("fund_public"), payload, function (j) {
1057
1058
  $("." + component_tr).each(function () {
1058
1059
  $(this).remove();
1059
1060
  });
@@ -1063,8 +1064,9 @@ const Util = {
1063
1064
  _html.push("<tr class='" + component_tr + "'>");
1064
1065
  _html.push("<td>", index + 1, "</td>");
1065
1066
  _html = Util.stock_basics_html(_html, item);
1066
- _html.push("<td class='year_price_", item["code"], "'>", (item["stock_price"] ? Util.year_price_rate(item["stock_price"], item["year_price"]) : "--"), "</td>");
1067
- _html.push("<td class='d5_price_", item["code"], "'>", (item["stock_price"] ? Util.year_price_rate(item["stock_price"], item["d5_price"]) : "--"), "</td>");
1067
+ _html.push("<td>", Util.year_price_rate(item["stock_price"], item["year_price"]), "</td>");
1068
+ _html.push("<td>", Util.year_price_rate(item["stock_price"], item["d5_price"]), "</td>");
1069
+ _html.push("<td>", Util.pack_holder_num(item), "</td>");
1068
1070
  let stock_num_tips = "";
1069
1071
  if (item["stock_num"] > 0 && item["pre_stock_num"] > 0) {
1070
1072
  let gap_stock_num = item["stock_num"] - item["pre_stock_num"];
@@ -1086,7 +1088,7 @@ const Util = {
1086
1088
  _html.push("</tr>");
1087
1089
  });
1088
1090
  } else {
1089
- _html.push("<tr class='" + component_tr + "'><td colspan='12'>暂无数据</td></tr>");
1091
+ _html.push("<tr class='" + component_tr + "'><td colspan='14'>暂无数据</td></tr>");
1090
1092
  }
1091
1093
  $(_html.join("")).insertAfter("#" + component_id + "_head");
1092
1094
  Util.hide_tips();