sbd-npm 1.1.59 → 1.1.63

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 (3) hide show
  1. package/menu.js +1 -0
  2. package/package.json +1 -1
  3. package/util.js +22 -6
package/menu.js CHANGED
@@ -50,6 +50,7 @@ const MenuList = [
50
50
  {'key': 'trend_doji', 'name': '十字星', 'url': '/718eac2cccaef1c7968f2d121b5f3070'},
51
51
  {'key': 'trend_ma510', 'name': '突破5、10日均线', 'url': '/4d6d7ee173c87b1f939fa454093a63c7'},
52
52
  {'key': 'trend_holder_minimum', 'name': '股东数历史最少', 'url': '/a9e45d918bc565afd76047cafea25824'},
53
+ {'key': 'trend_fund_hold', 'name': '基金持股变化', 'url': '/067740976f85ec14ddae02b51829ce35'},
53
54
  {'key': 'trend_week_minimum', 'name': '周成交低点', 'url': '/722d94429b8e689fe78dca1cf67a4c67'},
54
55
  {'key': 'trend_margin', 'name': '融资融券余额涨幅', 'url': '/1964a6bc56dc3ce6825b23667c7fb588'},
55
56
  {'key': 'trend_price', 'name': '股价升跌幅度', 'url': '/43ef6aeb36475f8f8f44d477b1990390'},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.1.59",
3
+ "version": "1.1.63",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -366,8 +366,7 @@ const Util = {
366
366
  }
367
367
  if (item["holder_num"] && item["holder_num"] > 0 && item["pre_holder_num"]) {
368
368
  $(".holder_" + code).each(function () {
369
- let url = Util.get_url("holder_num") + "?code=" + item["code"];
370
- $(this).html(Util.pack_html_link(url, Util.digit_compare_trend(item["holder_num"], item["pre_holder_num"])));
369
+ $(this).html(Util.pack_holder_num(item));
371
370
  });
372
371
  }
373
372
  }
@@ -2077,6 +2076,19 @@ const Util = {
2077
2076
  return index_html;
2078
2077
  },
2079
2078
 
2079
+ /**
2080
+ * 组装股东数据
2081
+ * @param item
2082
+ * @returns {string}
2083
+ */
2084
+ pack_holder_num: function(item) {
2085
+ if (item["holder_num"] && item["holder_num"] > 0 && item["pre_holder_num"]) {
2086
+ let url = Util.get_url("holder_num") + "?code=" + item["code"];
2087
+ return Util.pack_html_link(url, Util.digit_compare_trend(item["holder_num"], item["pre_holder_num"]));
2088
+ }
2089
+ return "--";
2090
+ },
2091
+
2080
2092
  /**
2081
2093
  * 组装 HTML 超链接
2082
2094
  * @param url
@@ -2216,10 +2228,14 @@ const Util = {
2216
2228
  let option_data = {};
2217
2229
  data.forEach(function (item) {
2218
2230
  if (item[type]) {
2219
- if (option_data[item[type]]) {
2220
- option_data[item[type]] += 1;
2231
+ if (item["num"]) {
2232
+ option_data[item[type]] = item["num"];
2221
2233
  } else {
2222
- option_data[item[type]] = 1
2234
+ if (option_data[item[type]]) {
2235
+ option_data[item[type]] += 1;
2236
+ } else {
2237
+ option_data[item[type]] = 1;
2238
+ }
2223
2239
  }
2224
2240
  }
2225
2241
  });
@@ -2229,7 +2245,7 @@ const Util = {
2229
2245
  html.push('<option value="">', obj.children('option').eq(0).text(), '</option>');
2230
2246
  }
2231
2247
  $.each(option_data, function (val, val_num) {
2232
- html.push('<option value="', val, '">', val, '(', val_num, ')</option>');
2248
+ html.push('<option value="', val, '">', (val.substr(0, 10)), '(', val_num, ')</option>');
2233
2249
  });
2234
2250
  obj.html(html.join(""));
2235
2251
  obj.change(function () {