sbd-npm 1.1.93 → 1.1.96
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 +1 -0
- package/package.json +1 -1
- package/stock_basics.js +1320 -0
- package/util.js +22 -18
package/util.js
CHANGED
@@ -1717,27 +1717,31 @@ const Util = {
|
|
1717
1717
|
let td_index = $(this).index();
|
1718
1718
|
let get_td_value = function (row) {
|
1719
1719
|
let td_obj = $(row).children('td').eq(td_index);
|
1720
|
-
|
1721
|
-
|
1722
|
-
if (Util.regexp_date_yyyy_mm_dd(td_val)) {
|
1723
|
-
return Util.format_to_second(td_val);
|
1720
|
+
if (td_obj.attr("data-val")) {
|
1721
|
+
return td_obj.attr("data-val");
|
1724
1722
|
} else {
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
1729
|
-
if (match_arr.length >= 2) {
|
1730
|
-
return match_arr[1];
|
1731
|
-
}
|
1732
|
-
return 0;
|
1723
|
+
let td_val = td_obj.text();
|
1724
|
+
// 2017-12-7 这种时间格式
|
1725
|
+
if (Util.regexp_date_yyyy_mm_dd(td_val)) {
|
1726
|
+
return Util.format_to_second(td_val);
|
1733
1727
|
} else {
|
1734
|
-
//
|
1735
|
-
let
|
1736
|
-
match_arr =
|
1737
|
-
if ($.isArray(match_arr)
|
1738
|
-
|
1728
|
+
// 174.36(+0.79%) 括号里的数字
|
1729
|
+
let bracket_re = /\(([-+]?\d*\.?\d+|[-+]?\d+|\d+)\%?\)/;
|
1730
|
+
let match_arr = bracket_re.exec(td_val);
|
1731
|
+
if ($.isArray(match_arr)) {
|
1732
|
+
if (match_arr.length >= 2) {
|
1733
|
+
return match_arr[1];
|
1734
|
+
}
|
1735
|
+
return 0;
|
1736
|
+
} else {
|
1737
|
+
// 匹配数字
|
1738
|
+
let digit_re = /([-+]?\d*\.?\d+|[-+]?\d+|\d+)/;
|
1739
|
+
match_arr = digit_re.exec(td_val);
|
1740
|
+
if ($.isArray(match_arr) && match_arr[0]) {
|
1741
|
+
return match_arr[0];
|
1742
|
+
}
|
1743
|
+
return Util.filter_chinese(td_val).replace("%", "");
|
1739
1744
|
}
|
1740
|
-
return Util.filter_chinese(td_val).replace("%", "");
|
1741
1745
|
}
|
1742
1746
|
}
|
1743
1747
|
};
|