sbd-npm 1.5.58 → 1.5.60

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.5.58",
3
+ "version": "1.5.60",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/snowball_tool.js CHANGED
@@ -374,7 +374,15 @@ $(function () {
374
374
  html.push("<td class='code_item'>", Util.snowball_url(Util.is_alphabet(item.code) ? item.code.toUpperCase() : item.code), "</td>");
375
375
  html.push("<td>", Util.stock_url(item.code, item.name ? item.name : item.code.toUpperCase()), "</td>");
376
376
  html.push("<td>", Util.map_url((item.province_city && item.province_city !== "None") ? item.province_city : item.area), "</td>");
377
- html.push("<td>", item.industry ? item.industry.slice(0, 6) : "--", "</td>");
377
+ if (item.industry) {
378
+ if (item.industry.length > 6) {
379
+ html.push("<td title='", item.industry, "'>", item.industry.slice(0, 6), "</td>");
380
+ } else {
381
+ html.push("<td>", item.industry, "</td>");
382
+ }
383
+ } else {
384
+ html.push("<td>--</td>");
385
+ }
378
386
  html.push("<td class='price_", item.code.toLowerCase(), "'>", item.stock_price, "</td>");
379
387
  html.push("<td>", Util.year_price_rate(item.stock_price, item.year_price), "</td>");
380
388
  html.push("<td>", Util.year_price_rate(item.stock_price, item.d5_price), "</td>");
package/stock_basics.js CHANGED
@@ -119,7 +119,6 @@ let Stock = {
119
119
  {"name": "成交均价"},
120
120
  {"name": "成交量", "sort_type": "volume"},
121
121
  {"name": "量比", "sort_type": "volume_ratio", "tooltip": "当日成交量与过去5日平均成交量的比"},
122
- {"name": "量比30", "sort_type": "volume_ratio30", "tooltip": "当日成交量与过去30日平均成交量的比"},
123
122
  {"name": "成交额", "sort_type": "amount"},
124
123
  {"name": "换手率", "sort_type": "turnover"},
125
124
  ]
@@ -148,10 +147,11 @@ let Stock = {
148
147
 
149
148
  let concept_object = $("#concept");
150
149
  if (concept_object.length > 0) {
151
- let concept_array = concept_object.html().split(",");
152
150
  html = [];
153
- concept_array.forEach(function (item) {
154
- html.push('<a target="_blank" rel="noopener noreferrer nofollow" href="', Util.get_url("query_list"), '?concept=', item, '" class="btn btn-xs btn-warning">', item, '</a> ');
151
+ let query_url = Util.get_url("query_list");
152
+ let concept_array = concept_object.html().split(",");
153
+ concept_array.forEach(function (concept) {
154
+ html.push('<a target="_blank" rel="noopener noreferrer nofollow" href="', query_url, '?concept=', concept, '" class="btn btn-xs btn-warning">', concept, '</a> ');
155
155
  });
156
156
  concept_object.html(html.join(""));
157
157
  }
@@ -339,7 +339,6 @@ let Stock = {
339
339
  html.push("<td>", Util.to_float(item.amount / (item.volume * 100), 2), "</td>");
340
340
  html.push("<td>", Util.to_float(item.volume / 10000, 2), "万手</td>");
341
341
  html.push("<td>", item.volume_ratio, "</td>");
342
- html.push("<td>", (item.volume_ratio30 ? item.volume_ratio30 : "--"), "</td>");
343
342
  html.push("<td>", Util.to_hundred_million(item.amount), "亿</td>");
344
343
  html.push("<td>", (item.turnover > 0 ? (item.turnover + "%") : "--"), "</td>");
345
344
  html.push("</tr>");
package/util.js CHANGED
@@ -626,7 +626,11 @@ const Util = {
626
626
  item.name = item.name.replace("有限公司", "").replace("集团", "").replace("股份", "");
627
627
  }
628
628
  html.push("<td>", Util.stock_url(item.code, item.name), "</td>");
629
- html.push("<td class='hk_industry'>", item.industry, "</td>");
629
+ if (item.industry && item.industry.length > 6) {
630
+ html.push("<td class='hk_industry' title='", item.industry, "'>", item.industry.slice(0, 6), "</td>");
631
+ } else {
632
+ html.push("<td class='hk_industry'>", item.industry, "</td>");
633
+ }
630
634
  html.push("<td>", Util.map_url(item.province_city), "</td>");
631
635
  html.push("<td>", Util.to_float((item.pe_ttm ? item.pe_ttm : item.pe), 2), "</td>");
632
636
  html.push("<td>", Util.to_float(item.market_capital, 3), "亿</td>");
@@ -635,7 +639,7 @@ const Util = {
635
639
  html.push("<td>", Util.year_price_rate(item.price, item.d5_price), "</td>");
636
640
  html.push("<td>", Util.digit_compare_trend(item.high_52week, item.price), "</td>");
637
641
  html.push("<td>", Util.digit_compare_trend(item.low_52week, item.price), "</td>");
638
- html.push("<td>", Util.pack_fund_num(item), "</td>");
642
+ html.push("<td>", Util.pack_holder_num(item), "</td>");
639
643
  return html;
640
644
  },
641
645
 
@@ -3335,6 +3339,9 @@ const Util = {
3335
3339
  * @returns {string}
3336
3340
  */
3337
3341
  pack_holder_num: function (item) {
3342
+ if (item.snowball_follower && item.code && Util.is_hk(item.code)) {
3343
+ return item.snowball_follower;
3344
+ }
3338
3345
  let holder_info = "--";
3339
3346
  if (item.holder_num && item.holder_num > 0) {
3340
3347
  if (item.pre_holder_num && item.pre_holder_num > 0) {
@@ -3356,22 +3363,16 @@ const Util = {
3356
3363
  */
3357
3364
  pack_fund_num: function (item) {
3358
3365
  let fund_info = "--";
3359
- if (item.code && Util.is_hk(item.code)) {
3360
- if (item.snowball_follower) {
3361
- return item.snowball_follower;
3362
- }
3363
- } else {
3364
- if (item.cur_fund_num && item.cur_fund_num > 0) {
3365
- if (item.pre_fund_num && item.pre_fund_num > 0) {
3366
- fund_info = Util.digit_compare_trend(item.cur_fund_num, item.pre_fund_num);
3367
- } else {
3368
- fund_info = item.cur_fund_num;
3369
- }
3370
- }
3371
- if (item.code && Util.is_cn(item.code)) {
3372
- return Util.pack_html_link("/stock/" + item.code + "?tab=public_fund", fund_info);
3366
+ if (item.cur_fund_num && item.cur_fund_num > 0) {
3367
+ if (item.pre_fund_num && item.pre_fund_num > 0) {
3368
+ fund_info = Util.digit_compare_trend(item.cur_fund_num, item.pre_fund_num);
3369
+ } else {
3370
+ fund_info = item.cur_fund_num;
3373
3371
  }
3374
3372
  }
3373
+ if (item.code && Util.is_cn(item.code)) {
3374
+ return Util.pack_html_link("/stock/" + item.code + "?tab=public_fund", fund_info);
3375
+ }
3375
3376
  return fund_info;
3376
3377
  },
3377
3378