sbd-npm 1.3.64 → 1.3.65

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 +25 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.3.64",
3
+ "version": "1.3.65",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -1106,18 +1106,24 @@ const Util = {
1106
1106
  });
1107
1107
  }
1108
1108
  if ($("#public_fund_date").length === 0) {
1109
+ let fund_len = j["data"] ? j["data"].length : 0;
1109
1110
  Util.post("/stock/" + code, {action: "public_fund_date"}, function (j) {
1110
- let _html = [];
1111
- _html.push('<select id="public_fund_date">');
1111
+ let html = [], date_len = 0;
1112
+ html.push('<select id="public_fund_date">');
1112
1113
  j["data"].forEach(function (item) {
1114
+ date_len ++;
1113
1115
  let date_format = Util.seconds_to_format(item["date"], "%Y-%m-%d");
1114
- _html.push('<option value="', date_format, '">', date_format, '(', item["num"], ')</option>');
1116
+ html.push('<option value="', date_format, '">', date_format, '(', item["num"], ')</option>');
1115
1117
  });
1116
- _html.push('</select>');
1117
- $("#public_fund_date_zone").html(_html.join(""));
1118
+ html.push('</select>');
1119
+ $("#public_fund_date_zone").html(html.join(""));
1118
1120
  $("#public_fund_date").change(function () {
1119
1121
  Util.fetch_public_fund(code);
1120
1122
  });
1123
+ if (fund_len === 0 && date_len > 0) {
1124
+ Util.fetch_public_fund(code);
1125
+ }
1126
+ // 1跟上一季比新增的基金、2跟上一季比减少的基金
1121
1127
  $(".public_fund_difference").each(function() {
1122
1128
  $(this).click(function() {
1123
1129
  let public_fund_date = $("#public_fund_date").val();
@@ -1430,7 +1436,7 @@ const Util = {
1430
1436
  _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>");
1431
1437
  _html.push("<tr><td colspan='3'>单位净值</td><td colspan='4'>", net, "</td><td colspan='3'>资产规模</td><td colspan='4'>", assets, "</td></tr>");
1432
1438
  _html.push("<tr><td colspan='3'>成立日期</td><td colspan='4'>", public_date, "</td><td colspan='3'>发行日期</td><td colspan='4'>", issue_date, "</td></tr>");
1433
- _html.push("<tr><td colspan='3'>基金管理公司</td><td colspan='4'>", Util.pack_fund_administrator(j), "</td><td colspan='3'>基金经理</td><td colspan='4'>", j["managers"], "</td></tr>");
1439
+ _html.push("<tr><td colspan='3'>基金管理公司</td><td colspan='4'>", Util.pack_fund_administrator(j), "</td><td colspan='3'>基金经理</td><td colspan='4'>", Util.pack_fund_manager(j), "</td></tr>");
1434
1440
  _html.push("<tr><td colspan='5'>基金托管人</td><td colspan='9'>", (j["custodian"] ? j["custodian"] : "--"), "</td></tr>");
1435
1441
  _html.push("<tr><td colspan='5'>经办律师事务所</td><td colspan='9'>", (j["lawyer"] ? j["lawyer"] : "--"), "</td></tr>");
1436
1442
  _html.push("<tr><td colspan='5'>会计师事务所</td><td colspan='9'>", (j["accounting"] ? j["accounting"] : "--"), "</td></tr>");
@@ -3159,6 +3165,19 @@ const Util = {
3159
3165
  return "--";
3160
3166
  },
3161
3167
 
3168
+ /**
3169
+ * 组装基金经理数据
3170
+ * @param item
3171
+ * @returns {string}
3172
+ */
3173
+ pack_fund_manager: function (item) {
3174
+ if (item["managers"]) {
3175
+ let managers = item["managers"].replace(/、/g, " ");
3176
+ return Util.pack_html_link("https://www.howbuy.com/search/quicksearch.htm?skey=" + managers, item["managers"]);
3177
+ }
3178
+ return "--";
3179
+ },
3180
+
3162
3181
  /**
3163
3182
  * 雪球人数关注排名数据
3164
3183
  * @param item