sbd-npm 1.4.47 → 1.4.49

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/package.json +1 -1
  2. package/stock_basics.js +10 -1
  3. package/util.js +11 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.4.47",
3
+ "version": "1.4.49",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
package/stock_basics.js CHANGED
@@ -287,9 +287,18 @@ let Stock = {
287
287
  sort_order: Stock.sort_order,
288
288
  start_date: $("#hist_start_date").val(),
289
289
  end_date: $("#hist_end_date").val(),
290
- hist_type: hist_type
290
+ hist_type: hist_type,
291
+ is_init: Stock.data.hasOwnProperty(localStorage[Stock.tab_token]) ? 1 : 0
291
292
  };
292
293
  Util.post("/stock/" + Stock["code"], payload, function (j) {
294
+ if (j["init_start_date"]) {
295
+ let init_start_date = Util.seconds_to_format(j["init_start_date"], "%Y-%m-%d");
296
+ $("#hist_start_date").val(init_start_date).data('daterangepicker').setStartDate(init_start_date);
297
+ }
298
+ if (j["init_end_date"]) {
299
+ let init_end_date = Util.seconds_to_format(j["init_end_date"], "%Y-%m-%d");
300
+ $("#hist_end_date").val(init_end_date).data('daterangepicker').setStartDate(init_end_date);
301
+ }
293
302
  Stock.hist_type = "";
294
303
  let html = [], hist_low_price = 0, hist_high_price = 0, total_amount = 0, total_volume = 0;
295
304
  j["data"].forEach(function (item) {
package/util.js CHANGED
@@ -420,8 +420,11 @@ const Util = {
420
420
  if (location_name === "") {
421
421
  location_name = location.length > 20 ? location.substring(0, 20) : location;
422
422
  }
423
- //return "<a target='_blank' class='link_cls map_link' rel='noopener noreferrer nofollow' href='https://map.baidu.com/m?fr=ps01000&word=" + location + "'>" + location_name + "</a>";
424
- return "<a target='_blank' class='link_cls map_link' rel='noopener noreferrer nofollow' href='https://www.amap.com/search?query=" + location + "'>" + location_name + "</a>";
423
+ if (Util.is_has_chinese(location)) {
424
+ //return "<a target='_blank' class='link_cls map_link' rel='noopener noreferrer nofollow' href='https://map.baidu.com/m?fr=ps01000&word=" + location + "'>" + location_name + "</a>";
425
+ return "<a target='_blank' class='link_cls map_link' rel='noopener noreferrer nofollow' href='https://www.amap.com/search?query=" + location + "'>" + location_name + "</a>";
426
+ }
427
+ return Util.google_map_url(location, location_name);
425
428
  }
426
429
  return "--";
427
430
  },
@@ -2595,8 +2598,7 @@ const Util = {
2595
2598
  * @returns {boolean}
2596
2599
  */
2597
2600
  is_has_chinese: function (str) {
2598
- let re = /[^\u4e00-\u9fa5]/;
2599
- return !re.test(str);
2601
+ return /[\u4e00-\u9fa5]/.test(str);
2600
2602
  },
2601
2603
 
2602
2604
  /**
@@ -3653,7 +3655,11 @@ const Util = {
3653
3655
  }
3654
3656
  start_obj.val(start_date);
3655
3657
  }
3656
- start_obj.daterangepicker({locale: {format: 'YYYY-MM-DD'}, singleDatePicker: true, singleClasses: "picker_2"});
3658
+ start_obj.daterangepicker({
3659
+ locale: {format: 'YYYY-MM-DD'},
3660
+ singleDatePicker: true,
3661
+ singleClasses: "picker_2"
3662
+ });
3657
3663
  if (end_id.length > 0) {
3658
3664
  let end_obj = $('#' + end_id);
3659
3665
  if (!Util.regexp_date_yyyy_mm_dd(end_obj.val())) {