sbd-npm 1.3.64 → 1.3.66

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
@@ -184,7 +184,7 @@ const MenuList = [
184
184
  {'key': 'hk_hsm100', 'name': '恒生中国100指数', 'url': '/0x759fcb84a0a322125df6748dffad66d7b2b44c2d'},
185
185
  {'key': 'hk_biotechnology', 'name': '生物科技', 'url': '/0xa131be85db2beb939e93207d0966c3710c7b761a'},
186
186
  {'key': 'hk_sell_short', 'name': '沽空排行', 'url': '/0x4ecddc987891875a42d206620cd97ca382613485'},
187
- {'key': 'hk_stock_exchange', 'name': '港股通持股排行', 'url': '/0x7549960a2de98a41a1b78e63202003a175b93dbb'},
187
+ {'key': 'hk_mutual', 'name': '港股通持股排行', 'url': '/0x310a47a6abd868f19cd3fdbf2f2566813cb45d57'},
188
188
  ]
189
189
  },
190
190
  {
@@ -277,6 +277,7 @@ const IndexList = [
277
277
  {'code': 'SH000906', 'name': '中证800', 'is_industry': 1, 'is_key': 1},
278
278
  {'code': 'SH000852', 'name': '中证1000', 'is_industry': 1, 'is_key': 1},
279
279
  {'code': 'SZ399303', 'name': '国证2000', 'is_industry': 0, 'is_key': 1},
280
+ {'code': 'SZ399441', 'name': '生物医药指数', 'is_industry': 0, 'is_key': 0},
280
281
  {'code': 'SZ399959', 'name': '军工指数', 'is_industry': 0, 'is_key': 0},
281
282
  {'code': 'SH000985', 'name': '中证全指', 'is_industry': 0, 'is_key': 0},
282
283
  {'code': 'SH000922', 'name': '中证红利', 'is_industry': 0, 'is_key': 0},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.3.64",
3
+ "version": "1.3.66",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/stock_basics.js CHANGED
@@ -1199,7 +1199,7 @@ let Stock = {
1199
1199
  {"name": "持股比例", "table_sort": 1, "title": "内地港股通账户持仓股数 / 流通股本数"},
1200
1200
  ]
1201
1201
  });
1202
- Util.post("/stock/" + Stock["code"], {action: "hk_stock_exchange"}, function (j) {
1202
+ Util.post("/stock/" + Stock["code"], {action: "hk_mutual"}, function (j) {
1203
1203
  let _html = [];
1204
1204
  j["data"].forEach(function (item, index) {
1205
1205
  _html.push("<tr>");
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();
@@ -1425,21 +1431,16 @@ const Util = {
1425
1431
  let public_date = j["public_date"] > 0 ? Util.seconds_to_format(j["public_date"], "%Y-%m-%d") : "--";
1426
1432
  let issue_date = j["issue_date"] > 0 ? Util.seconds_to_format(j["issue_date"], "%Y-%m-%d") : "--";
1427
1433
  _html.push("<tr title='最后更新时间: ", Util.seconds_to_format(j["update_time"], "%Y-%m-%d"), "' class='info'><th colspan='14' text-align='center'>基金概况</th></tr>");
1428
- //_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>");
1429
1434
  _html.push("<tr><td colspan='3'>基金代码</td><td colspan='4'>", Util.pack_html_link('https://xueqiu.com/S/' + Util.code_to_fund_symbol(j["fund_code"]), 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>");
1430
1435
  _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
1436
  _html.push("<tr><td colspan='3'>单位净值</td><td colspan='4'>", net, "</td><td colspan='3'>资产规模</td><td colspan='4'>", assets, "</td></tr>");
1432
1437
  _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>");
1438
+ _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
1439
  _html.push("<tr><td colspan='5'>基金托管人</td><td colspan='9'>", (j["custodian"] ? j["custodian"] : "--"), "</td></tr>");
1435
1440
  _html.push("<tr><td colspan='5'>经办律师事务所</td><td colspan='9'>", (j["lawyer"] ? j["lawyer"] : "--"), "</td></tr>");
1436
1441
  _html.push("<tr><td colspan='5'>会计师事务所</td><td colspan='9'>", (j["accounting"] ? j["accounting"] : "--"), "</td></tr>");
1437
1442
  _html.push("<tr><td colspan='5'>注册地址</td><td colspan='9'>", Util.map_url(j["location"], j["location"]), "</td></tr>");
1438
- let fund_stock_url = "https://fund.eastmoney.com/" + j["fund_code"] + ".html";
1439
- if (j["type"] === 2) {
1440
- fund_stock_url = "http://fund.eastmoney.com/f10/ccmx_" + j["fund_code"] + ".html";
1441
- }
1442
- _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>");
1443
+ _html.push("<tr class='info'><th colspan='14' text-align='center'>", Util.pack_html_link("http://fund.eastmoney.com/f10/ccmx_" + j["fund_code"] + ".html", "持股明细"), " <span id='fund_stock_date_zone'></span></th></tr>");
1443
1444
  _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 class='info'>占比</th><th>持仓市值</th></tr>");
1444
1445
  _html.push("<tr class='" + component_id + "_tr'><td colspan='14'>暂无数据</td></tr>");
1445
1446
  Util.render_table_html(component_id + "_body_body", _html);
@@ -3114,7 +3115,7 @@ const Util = {
3114
3115
  */
3115
3116
  pack_holder_num: function (item) {
3116
3117
  let holder_info = "--";
3117
- if (item["code"] && Util.is_hk(item["code"])) {
3118
+ if (item["code"] && !Util.is_cn(item["code"])) {
3118
3119
  return holder_info;
3119
3120
  }
3120
3121
  if (item["holder_num"] && item["holder_num"] > 0) {
@@ -3135,6 +3136,9 @@ const Util = {
3135
3136
  */
3136
3137
  pack_fund_num: function (item) {
3137
3138
  let fund_num = "--";
3139
+ if (item["code"] && !Util.is_cn(item["code"])) {
3140
+ return fund_num;
3141
+ }
3138
3142
  if (item["cur_fund_num"] && item["cur_fund_num"] > 0) {
3139
3143
  fund_num = Util.digit_compare_trend(item["cur_fund_num"], item["pre_fund_num"]);
3140
3144
  }
@@ -3147,7 +3151,7 @@ const Util = {
3147
3151
  * @returns {string}
3148
3152
  */
3149
3153
  pack_fund_administrator: function (item) {
3150
- if (item["administrator"]) {
3154
+ if (item["administrator"] && item["administrator"] !== "---") {
3151
3155
  let url = "";
3152
3156
  if (item["administrator_code"]) {
3153
3157
  url = "https://fund.eastmoney.com/company/" + item["administrator_code"] + ".html";
@@ -3159,6 +3163,19 @@ const Util = {
3159
3163
  return "--";
3160
3164
  },
3161
3165
 
3166
+ /**
3167
+ * 组装基金经理数据
3168
+ * @param item
3169
+ * @returns {string}
3170
+ */
3171
+ pack_fund_manager: function (item) {
3172
+ if (item["managers"] && item["managers"] !== "---") {
3173
+ let managers = item["managers"].replace(/、/g, " ");
3174
+ return Util.pack_html_link("https://www.howbuy.com/search/quicksearch.htm?skey=" + managers, item["managers"]);
3175
+ }
3176
+ return "--";
3177
+ },
3178
+
3162
3179
  /**
3163
3180
  * 雪球人数关注排名数据
3164
3181
  * @param item