sbd-npm 1.1.88 → 1.1.91

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/menu.js CHANGED
@@ -32,15 +32,6 @@ const MenuList = [
32
32
  {'key': 'daily_block', 'name': '大宗交易', 'url': '/3eec763b6402d5327a2f1d8964f78c93'},
33
33
  ]
34
34
  },
35
- {
36
- 'name': '沪深港股通',
37
- 'icon': 'cogs',
38
- 'menu': [
39
- {'key': 'hsgt_flow', 'name': '资金流向', 'url': '/e0c6105a6de37e91aa886c70d2227948'},
40
- {'key': 'hsgt_trade_stock', 'name': '成交股统计', 'url': '/521e408d5c995460426beba4d039df06'},
41
- {'key': 'hsgt_hkex_holding', 'name': '港资持股比例', 'url': '/4cb33e167aca1978b304af3bbe6ea2dd'},
42
- ]
43
- },
44
35
  {
45
36
  'name': '趋势分析',
46
37
  'icon': 'edit',
@@ -62,6 +53,15 @@ const MenuList = [
62
53
  {'key': 'trend_query', 'name': '趋势查询', 'url': '/7a7cec0124836383ad76faa457d19403'},
63
54
  ]
64
55
  },
56
+ {
57
+ 'name': '沪深港股通',
58
+ 'icon': 'cogs',
59
+ 'menu': [
60
+ {'key': 'hsgt_flow', 'name': '资金流向', 'url': '/e0c6105a6de37e91aa886c70d2227948'},
61
+ {'key': 'hsgt_trade_stock', 'name': '成交股统计', 'url': '/521e408d5c995460426beba4d039df06'},
62
+ {'key': 'hsgt_hkex_holding', 'name': '港资持股比例', 'url': '/4cb33e167aca1978b304af3bbe6ea2dd'},
63
+ ]
64
+ },
65
65
  {
66
66
  'name': '宏观数据',
67
67
  'icon': 'globe',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.1.88",
3
+ "version": "1.1.91",
4
4
  "description": "Stock Big Data",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/util.js CHANGED
@@ -368,6 +368,16 @@ const Util = {
368
368
  }
369
369
  }
370
370
  });
371
+ $(".d5_price_" + code).each(function () {
372
+ if (item["d5_price"]) {
373
+ $(this).html(Util.year_price_rate(item["price"], item["d5_price"]));
374
+ } else {
375
+ let d5_price = $(this).attr("data-val");
376
+ if (d5_price) {
377
+ $(this).html(Util.year_price_rate(item["price"], Util.to_float(d5_price)));
378
+ }
379
+ }
380
+ });
371
381
  if (item["high_52week"]) {
372
382
  $(".high_52week_" + code).each(function () {
373
383
  $(this).html(Util.year_price_rate(item["price"], item["high_52week"]));
@@ -687,6 +697,9 @@ const Util = {
687
697
  if (col["class"]) {
688
698
  td_class.push(col["class"]);
689
699
  }
700
+ if (col["colspan"]) {
701
+ td_attr += ' colspan="' + col["colspan"] + '"';
702
+ }
690
703
  if (col["table_sort"]) {
691
704
  is_table_sort = 1;
692
705
  td_class.push("table_sort");
@@ -1940,9 +1953,9 @@ const Util = {
1940
1953
  } else {
1941
1954
  Util.refresh_index_price(element_id, index_list.join("-"), is_us, 0);
1942
1955
  }
1943
- if (valid_code_list.length > 0) { // 涨跌统计
1956
+ let total_num = valid_code_list.length;
1957
+ if (total_num > 0 && total_num < 100) { // 涨跌统计
1944
1958
  if ($("#" + element_id + "_tips").length) {
1945
- let total_num = valid_code_list.length;
1946
1959
  let average_change_percent = Math.round((total_change_percent / total_num) * 10000) / 100;
1947
1960
  let average_year_change_percent = Math.round((total_year_change_percent / total_num) * 10000) / 100;
1948
1961
  let week_tips_id = element_id + "week_tips";
@@ -2448,6 +2461,16 @@ const Util = {
2448
2461
  return Util.to_float(digit / 100000000, fraction);
2449
2462
  },
2450
2463
 
2464
+ /**
2465
+ * 转为以万为单位的数值
2466
+ * @param digit
2467
+ * @param fraction
2468
+ * @returns {*|number}
2469
+ */
2470
+ to_ten_thousand: function (digit, fraction = 2) {
2471
+ return Util.to_float(digit / 10000, fraction);
2472
+ },
2473
+
2451
2474
  /**
2452
2475
  * 转为相应单位的数值
2453
2476
  * @param digit
package/.npmignore DELETED
@@ -1 +0,0 @@
1
- sbd-npm.md