sbd-npm 1.4.48 → 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 (2) hide show
  1. package/package.json +1 -1
  2. package/util.js +11 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sbd-npm",
3
- "version": "1.4.48",
3
+ "version": "1.4.49",
4
4
  "description": "Stock Big Data",
5
5
  "author": "DHQ <dhq314@gmail.com>",
6
6
  "license": "ISC",
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())) {