sbd-npm 1.4.87 → 1.4.89

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
@@ -1,3 +1,18 @@
1
+ /**
2
+ * Copyright (C) 2015-present dhq <dhq314@gmail.com>
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
1
16
  const MenuList = [
2
17
  {
3
18
  'name': '概要',
@@ -278,7 +293,7 @@ const IndexList = [
278
293
  {'code': 'SH000300', 'name': '沪深300', 'is_industry': 1, 'is_key': 1},
279
294
  {'code': 'SH000016', 'name': '上证50', 'is_industry': 0, 'is_key': 1},
280
295
  {'code': 'SZ399850', 'name': '深证50', 'is_industry': 0, 'is_key': 0},
281
- {'code': 'SZ399673', 'name': '创业板50', 'is_industry': 0, 'is_key': 0},
296
+ {'code': 'SZ399673', 'name': '创业板50', 'is_industry': 0, 'is_key': 1},
282
297
  {'code': 'SH000688', 'name': '科创50', 'is_industry': 0, 'is_key': 1},
283
298
  {'code': 'BJ899050', 'name': '北证50', 'is_industry': 0, 'is_key': 0},
284
299
  {'code': 'SH000698', 'name': '科创100', 'is_industry': 0, 'is_key': 0},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.4.87",
3
+ "version": "1.4.89",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/status.js CHANGED
@@ -1,3 +1,18 @@
1
+ /**
2
+ * Copyright (C) 2015-present dhq <dhq314@gmail.com>
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
1
16
  $(function () {
2
17
 
3
18
  let Status = {
@@ -596,7 +611,7 @@ $(function () {
596
611
  $("#task_add").click(function() {
597
612
  let task_content = $("#task_content").val();
598
613
  task_content = task_content.replace(/ü/g, 'u').replace(/ö/g, 'o'); // München、Köln
599
- task_content = task_content.replace(/[^\w\u4e00-\u9fff-]/g, ''); // 去掉除字母、数字、下划线(_)、汉字、横杠(-)外的其他字符(䒚 /[^\w\u3400-\u9fff\u{20000}-\u{2EBEF}]/gu)
614
+ task_content = task_content.replace(/[^\w\u4e00-\u9fff-]/g, ''); // 去掉除字母、数字、下划线(_)、汉字、横杠(-)之外的其他字符(䒚 /[^\w\u3400-\u9fff\u{20000}-\u{2EBEF}]/gu)
600
615
  if (Status.check_task_content(task_content)) {
601
616
  $("#task_content").prop('disabled', true);
602
617
  $("#task_add").prop('disabled', true);
@@ -1373,7 +1388,10 @@ $(function () {
1373
1388
  let ip_address = Status.convert_ip_address(j);
1374
1389
  if (ip_address.length > 0) {
1375
1390
  let map_url = Status.map_url(ip_address, "<i class='glyphicon glyphicon-map-marker'></i>");
1376
- let ip_result = Util.pack_html_link(Status.ip_url(j["ip"]), "<b class='text-success'>" + ip_address + "</b>") + "&nbsp;&nbsp;" + map_url;
1391
+ let ip_result = Util.pack_html_link(Status.ip_url(j["ip"]), "<b class='text-success'>" + ip_address + "</b>") + "&nbsp;&nbsp;&nbsp;" + map_url;
1392
+ ip_result += "&nbsp;&nbsp;&nbsp;" + Util.pack_html_link("https://apis.map.qq.com/ws/location/v1/ip?output=jsonp&key=SGVBZ-4RO34-NB2US-DQKYK-ZEUVJ-4KFZF&ip=" + j["ip"] + "&callback=Callback&_=" + Util.now(), "1");
1393
+ ip_result += "&nbsp;&nbsp;&nbsp;" + Util.pack_html_link("https://whois.pconline.com.cn/ipJson.jsp?ip=" + j["ip"] + "&json=true", "2");
1394
+ ip_result += "&nbsp;&nbsp;&nbsp;" + Util.pack_html_link("http://ip-api.com/json/" + j["ip"] + "?lang=zh-CN", "3");
1377
1395
  if (j["domain"]) {
1378
1396
  ip_result += "<br><br>" + Util.pack_html_link(j["domain"], "<b>" + j["domain"] + "</b>");
1379
1397
  }
@@ -1555,12 +1573,12 @@ $(function () {
1555
1573
 
1556
1574
  map_url: function (location, location_name = "") {
1557
1575
  location_name = location_name === "" ? location : location_name;
1558
- let location_arr = location.split(' ');
1576
+ let location_array = location.split(' ');
1559
1577
  if (/中国|省|市/.test(location)) {
1560
- let url = Util.map_url(location_arr[0]);
1561
- return url.replace('>' + location_arr[0] + '</a>', '>' + location_name + '</a>');
1578
+ let url = Util.map_url(location_array[0]);
1579
+ return url.replace('>' + location_array[0] + '</a>', '>' + location_name + '</a>');
1562
1580
  }
1563
- return Util.google_map_url(location_arr[0], location_name);
1581
+ return Util.google_map_url(location_array[0], location_name);
1564
1582
  }
1565
1583
 
1566
1584
  };
package/stock_basics.js CHANGED
@@ -148,9 +148,9 @@ let Stock = {
148
148
 
149
149
  let concept_obj = $("#concept");
150
150
  if (concept_obj.length > 0) {
151
- let concept_arr = concept_obj.html().split(",");
151
+ let concept_array = concept_obj.html().split(",");
152
152
  html = [];
153
- concept_arr.forEach(function (item) {
153
+ concept_array.forEach(function (item) {
154
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> ');
155
155
  });
156
156
  concept_obj.html(html.join(""));
@@ -158,9 +158,9 @@ let Stock = {
158
158
 
159
159
  let location_obj = $("#location");
160
160
  if (location_obj.length > 0) {
161
- let location_arr = location_obj.text().split(/[;;,]/);
161
+ let location_array = location_obj.text().split(/[;;,,]/);
162
162
  html = [];
163
- location_arr.forEach(function (location) {
163
+ location_array.forEach(function (location) {
164
164
  html.push(Util.map_url(location, location) + '&nbsp;&nbsp;');
165
165
  });
166
166
  location_obj.html(html.join(""));
@@ -985,9 +985,9 @@ let Stock = {
985
985
  Stock.hist_end_date = Util.seconds_to_format(date - 1 + 7 * Util.one_day_second, "%Y-%m-%d");
986
986
  } else if (date_type === "month") {
987
987
  Stock.hist_start_date = date;
988
- let d_arr = date.split("-");
989
- let year = parseInt(d_arr[0]);
990
- let month = parseInt(d_arr[1]);
988
+ let d_array = date.split("-");
989
+ let year = parseInt(d_array[0]);
990
+ let month = parseInt(d_array[1]);
991
991
  if (month === 12) {
992
992
  month = 1;
993
993
  year += 1;
@@ -997,9 +997,9 @@ let Stock = {
997
997
  date = Util.format_to_second(year + "-" + month + "-01");
998
998
  Stock.hist_end_date = Util.seconds_to_format(date - 1, "%Y-%m-%d");
999
999
  } else if (date_type === "quarter") {
1000
- let d_arr = date.split("-");
1001
- let year = parseInt(d_arr[0]);
1002
- let quarter = d_arr[1];
1000
+ let d_array = date.split("-");
1001
+ let year = parseInt(d_array[0]);
1002
+ let quarter = d_array[1];
1003
1003
  if (quarter === "S1") {
1004
1004
  Stock.hist_start_date = year + "-01-01";
1005
1005
  date = year + "-04-01";
package/summary_daily.js CHANGED
@@ -197,11 +197,11 @@ $(function () {
197
197
  pack_hsgt_money_flow: function (hsgt_money_flow_data) {
198
198
  if ($("#hsgt_money_flow_line").length) {
199
199
  DailySummary["hsgt_money_flow_chart"].hideLoading();
200
- let time_arr = [], hsmf_data = [], hmf_arr = [], smf_arr = [], tmf_val = 0, hmf_val = 0, smf_val = 0;
200
+ let time_array = [], hsmf_data = [], hmf_array = [], smf_array = [], tmf_val = 0, hmf_val = 0, smf_val = 0;
201
201
  hsgt_money_flow_data.forEach(function (d) {
202
- time_arr.push(d[0]);
203
- hmf_arr.push(d[1]);
204
- smf_arr.push(d[2]);
202
+ time_array.push(d[0]);
203
+ hmf_array.push(d[1]);
204
+ smf_array.push(d[2]);
205
205
  let total_mf_val = Util.to_float(parseFloat(d[1]) + parseFloat(d[2]), 2);
206
206
  hsmf_data.push(total_mf_val);
207
207
  if (total_mf_val) {
@@ -231,7 +231,7 @@ $(function () {
231
231
  legend: {x: 20, y: 20, data: ["总流向", "沪股通", "深股通"]},
232
232
  "grid": {"x": 30, "y": 50, "x2": 5, "y2": 20},
233
233
  calculable: !0,
234
- xAxis: [{type: "category", boundaryGap: !1, data: time_arr}],
234
+ xAxis: [{type: "category", boundaryGap: !1, data: time_array}],
235
235
  yAxis: [{type: "value"}],
236
236
  series: [
237
237
  {
@@ -246,14 +246,14 @@ $(function () {
246
246
  type: "line",
247
247
  smooth: !0,
248
248
  itemStyle: {normal: {color: "#34495E", areaStyle: {type: "default"}}},
249
- data: hmf_arr
249
+ data: hmf_array
250
250
  },
251
251
  {
252
252
  name: "深股通",
253
253
  type: "line",
254
254
  smooth: !0,
255
255
  itemStyle: {normal: {color: "#BDC3C7", areaStyle: {type: "default"}}},
256
- data: smf_arr
256
+ data: smf_array
257
257
  }
258
258
  ]
259
259
  })
package/util.js CHANGED
@@ -112,7 +112,7 @@ const Util = {
112
112
  });
113
113
 
114
114
  $("#stock").on("focus keyup", function () {
115
- let key_word = $(this).val();
115
+ let key_word = $(this).val().trim();
116
116
  if (key_word) {
117
117
  if (Util.is_has_chinese(key_word) || (Util.is_alphabet(key_word) && key_word.length >= 2) || ($.isNumeric(key_word) && key_word.length >= 3)) {
118
118
  if (window.location.pathname === "/status" && $("#word").hasClass('active')) {
@@ -184,7 +184,7 @@ const Util = {
184
184
  request_search: function() {
185
185
  Util.show_loading();
186
186
  Util.post("/action", {action: "search", key_word: $("#stock").val()}, function (j) {
187
- let key_word = $("#stock").val();
187
+ let key_word = $("#stock").val().trim();
188
188
  if (key_word) {
189
189
  if (key_word === j["key_word"]) {
190
190
  let html = [];
@@ -397,8 +397,8 @@ const Util = {
397
397
  name = item["name"];
398
398
  if (Util.is_us(item["code"])) {
399
399
  if (name.indexOf(' ') !== -1) {
400
- let name_arr = name.split(' ');
401
- name = name_arr[0] ? name_arr[0] : name;
400
+ let name_array = name.split(' ');
401
+ name = name_array[0] ? name_array[0] : name;
402
402
  } else {
403
403
  name = name.replace("公司", "").replace("•", "").replace("&#8226;", "");
404
404
  }
@@ -2078,9 +2078,9 @@ const Util = {
2078
2078
  show_profile += "&nbsp;&nbsp;&nbsp;<a class='unfold text-info' data-toggle='modal' data-target='." + modal_id + "' href='#'>展开</a>";
2079
2079
  $("#" + element_id).html(show_profile);
2080
2080
  $('#' + modal_id).on('shown.bs.modal', function () {
2081
- let p_arr = profile.split("。");
2081
+ let p_array = profile.split("。");
2082
2082
  let html = [];
2083
- p_arr.forEach(function (p) {
2083
+ p_array.forEach(function (p) {
2084
2084
  if (p.length > 0) {
2085
2085
  html.push("<p>", p.replace(/,/g, ","), "。</p>");
2086
2086
  }
@@ -2260,8 +2260,8 @@ const Util = {
2260
2260
  * @returns {undefined}
2261
2261
  */
2262
2262
  get_cookie: function getCookie(name) {
2263
- let m_arr = document.cookie.match("\\b" + name + "=([^;]*)\\b");
2264
- return m_arr ? m_arr[1] : undefined;
2263
+ let match_array = document.cookie.match("\\b" + name + "=([^;]*)\\b");
2264
+ return match_array ? match_array[1] : undefined;
2265
2265
  },
2266
2266
 
2267
2267
  /**
@@ -2656,24 +2656,24 @@ const Util = {
2656
2656
  * @param obj_token
2657
2657
  */
2658
2658
  parse_value_trend: function (obj_token) {
2659
- let data_arr = [], unit = "";
2659
+ let data_array = [], unit = "";
2660
2660
  $("." + obj_token).each(function () {
2661
2661
  let val = $(this).text();
2662
2662
  if (unit === "") {
2663
- let match_arr = val.match(/[\u4e00-\u9fa5]+/);
2664
- if ($.isArray(match_arr) && match_arr[0]) {
2665
- unit = match_arr[0];
2663
+ let match_array = val.match(/[\u4e00-\u9fa5]+/);
2664
+ if ($.isArray(match_array) && match_array[0]) {
2665
+ unit = match_array[0];
2666
2666
  }
2667
2667
  }
2668
- data_arr.push({"obj": $(this), "digit": Util.filter_chinese(val)});
2668
+ data_array.push({"obj": $(this), "digit": Util.filter_chinese(val)});
2669
2669
  });
2670
- let data_arr_len = data_arr.length;
2670
+ let data_arr_len = data_array.length;
2671
2671
  if (data_arr_len > 0) {
2672
2672
  for (let i = 0; i < data_arr_len; i++) {
2673
- if (data_arr[i + 1]) {
2674
- let digit = data_arr[i]["digit"];
2675
- let next_digit = data_arr[i + 1]["digit"];
2676
- let obj = data_arr[i]["obj"];
2673
+ if (data_array[i + 1]) {
2674
+ let digit = data_array[i]["digit"];
2675
+ let next_digit = data_array[i + 1]["digit"];
2676
+ let obj = data_array[i]["obj"];
2677
2677
  if (digit > next_digit) {
2678
2678
  $(obj).html("<b class='text-danger'>" + digit + unit + " ↑</b>");
2679
2679
  } else if (digit < next_digit) {
@@ -2788,9 +2788,9 @@ const Util = {
2788
2788
  */
2789
2789
  sort_table_row: function (td_obj) {
2790
2790
  let table = td_obj.parents('table').eq(0);
2791
- let row_arr = table.find('tr:gt(0)').toArray();
2791
+ let row_array = table.find('tr:gt(0)').toArray();
2792
2792
  let td_index = td_obj.index();
2793
- row_arr.sort(function (row1, row2) {
2793
+ row_array.sort(function (row1, row2) {
2794
2794
  let td1_val = Util.get_table_td_value(row1, td_index);
2795
2795
  let td2_val = Util.get_table_td_value(row2, td_index);
2796
2796
  return $.isNumeric(td1_val) && $.isNumeric(td2_val) ? td1_val - td2_val : td1_val.localeCompare(td2_val);
@@ -2798,10 +2798,10 @@ const Util = {
2798
2798
  let sort_cls = "fa-sort-asc";
2799
2799
  this.asc = !this.asc;
2800
2800
  if (!this.asc) {
2801
- row_arr = row_arr.reverse();
2801
+ row_array = row_array.reverse();
2802
2802
  sort_cls = "fa-sort-desc";
2803
2803
  }
2804
- table.children('tbody').empty().html(row_arr);
2804
+ table.children('tbody').empty().html(row_array);
2805
2805
  table.children('thead').find("i").each(function () {
2806
2806
  if ($(this).hasClass("fa")) {
2807
2807
  $(this).removeClass("fa-sort-asc");
@@ -2838,18 +2838,18 @@ const Util = {
2838
2838
  } else {
2839
2839
  // 174.36(+0.79%) 括号里的数字
2840
2840
  let bracket_re = /\(([-+]?\d*\.?\d+|[-+]?\d+|\d+)\%?\)/;
2841
- let match_arr = bracket_re.exec(td_val);
2842
- if ($.isArray(match_arr)) {
2843
- if (match_arr.length >= 2) {
2844
- return match_arr[1];
2841
+ let match_array = bracket_re.exec(td_val);
2842
+ if ($.isArray(match_array)) {
2843
+ if (match_array.length >= 2) {
2844
+ return match_array[1];
2845
2845
  }
2846
2846
  return 0;
2847
2847
  } else {
2848
2848
  // 匹配数字
2849
2849
  let digit_re = /([-+]?\d*\.?\d+|[-+]?\d+|\d+)/;
2850
- match_arr = digit_re.exec(td_val);
2851
- if ($.isArray(match_arr) && match_arr[0]) {
2852
- return match_arr[0];
2850
+ match_array = digit_re.exec(td_val);
2851
+ if ($.isArray(match_array) && match_array[0]) {
2852
+ return match_array[0];
2853
2853
  }
2854
2854
  return td_val.replace("%", "");
2855
2855
  }
@@ -2884,9 +2884,9 @@ const Util = {
2884
2884
  let url = location.search; //获取url中"?"符后的字串
2885
2885
  let obj = {};
2886
2886
  if (url.indexOf("?") !== -1) {
2887
- let query_arr = url.substring(1).split("&");
2888
- for (let i = 0; i < query_arr.length; i++) {
2889
- let query = query_arr[i].split("=");
2887
+ let query_array = url.substring(1).split("&");
2888
+ for (let i = 0; i < query_array.length; i++) {
2889
+ let query = query_array[i].split("=");
2890
2890
  obj[query[0]] = query[1];
2891
2891
  }
2892
2892
  }
@@ -3626,8 +3626,8 @@ const Util = {
3626
3626
  */
3627
3627
  init_date_range_picker: function (element_id, Obj, callback_func, start_date = 0, end_date = 0) {
3628
3628
  let separator = element_id.indexOf("_start_end") > -1 ? "_start_end" : "_";
3629
- let element_arr = element_id.split(separator);
3630
- let prefix = element_arr[0];
3629
+ let element_array = element_id.split(separator);
3630
+ let prefix = element_array[0];
3631
3631
  let select_id = prefix + "_time_select";
3632
3632
  let start_id = prefix + "_start_date";
3633
3633
  let end_id = prefix + "_end_date";
@@ -3864,9 +3864,9 @@ const Util = {
3864
3864
  fraction = Math.pow(10, fraction);
3865
3865
  digit = Math.round(digit * fraction) / fraction;
3866
3866
  if (fraction === 100) {
3867
- let digit_arr = digit.toString().split(".");
3868
- if (digit_arr.length > 1) {
3869
- if (digit_arr[1].length === 1) {
3867
+ let digit_array = digit.toString().split(".");
3868
+ if (digit_array.length > 1) {
3869
+ if (digit_array[1].length === 1) {
3870
3870
  return (digit + "0");
3871
3871
  }
3872
3872
  } else {
@@ -4016,21 +4016,21 @@ const Util = {
4016
4016
  init_time_drop_down: function (metrics, metrics_drop_down_id, date_type, callback_func) {
4017
4017
  let metrics_drop_down_type_id = metrics_drop_down_id + "_date_" + date_type;
4018
4018
  let metrics_drop_down_btn_id = metrics + "_btn_" + date_type;
4019
- let time_arr = ["30周", "52周", "100周", "150周", "200周", "300周"];
4019
+ let time_array = ["30周", "52周", "100周", "150周", "200周", "300周"];
4020
4020
  if (date_type === "month") {
4021
- time_arr = ["30月", "40月", "50月", "60月", "100月", "120月"];
4021
+ time_array = ["30月", "40月", "50月", "60月", "100月", "120月"];
4022
4022
  } else if (date_type === "quarter") {
4023
- time_arr = ["30季", "40季", "50季"];
4023
+ time_array = ["30季", "40季", "50季"];
4024
4024
  } else if (date_type === "daily") {
4025
- time_arr = ["20日", "60日", "120日", "200日"];
4025
+ time_array = ["20日", "60日", "120日", "200日"];
4026
4026
  }
4027
- let default_time = (date_type === "daily" || date_type === "week") ? time_arr[1] : time_arr[0];
4027
+ let default_time = (date_type === "daily" || date_type === "week") ? time_array[1] : time_array[0];
4028
4028
  let html = [];
4029
4029
  html.push('<div class="btn-group">');
4030
4030
  html.push('<button id="' + metrics_drop_down_btn_id + '" data-val="' + date_type + '" type="button" class="btn btn-default ' + metrics + '_bar_btn">' + default_time + '</button>');
4031
4031
  html.push('<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"><span class="caret"></span></button>');
4032
4032
  html.push('<ul style="margin-top: 5px;" class="dropdown-menu" id="' + metrics_drop_down_type_id + '">');
4033
- time_arr.forEach(function (t) {
4033
+ time_array.forEach(function (t) {
4034
4034
  html.push('<li><a href="javacript:void(0);">', t, '</a></li>');
4035
4035
  });
4036
4036
  html.push('</ul></div>&nbsp;');