sbd-npm 1.2.30 → 1.2.33
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 +1 -1
- package/package.json +1 -1
- package/util.js +75 -61
package/constant.js
CHANGED
@@ -138,9 +138,9 @@ const MenuList = [
|
|
138
138
|
{'key': 'concept_market_situation', 'name': '市值风云', 'url': '/02fdaf4d66cdecb092bcd65f569aa493'},
|
139
139
|
{'key': 'concept_down_top', 'name': '15-21年的超跌股', 'url': '/ae3bbf97a358392cfaa0ceb35cb3fb57'},
|
140
140
|
{'key': 'concept_cloud', 'name': '心似白云常自在', 'url': '/1d883188398a3a8c743748c5eb81fe7b'},
|
141
|
-
{'key': 'concept_cannon', 'name': '黄家礼炮', 'url': '/d6128a3ad91d545f2920fa2e324c37e1'},
|
142
141
|
{'key': 'concept_wen', 'name': '崇文不尚武', 'url': '/b6fd64a2c54250b8ac039123e74e9b7e'},
|
143
142
|
{'key': 'concept_niu', 'name': '老曾阿牛', 'url': '/0f4a2714971424024c1ddd8651c26569'},
|
143
|
+
{'key': 'concept_dao', 'name': '成长股事(大道)', 'url': '/7b7ea877f6793752e2b981d82da81e1b'},
|
144
144
|
{'key': 'concept_qian', 'name': '唐史主任司马迁', 'url': '/8b3e40fe74b4870244bc51125da7675a'},
|
145
145
|
{'key': 'concept_dan', 'name': '但斌', 'url': '/3ac0a5857b1d9a111497c0e817e647a1'},
|
146
146
|
{'key': 'concept_hill', 'name': '高瓴资本', 'url': '/9891755f194db180f1fe9a8c47a51829'},
|
package/package.json
CHANGED
package/util.js
CHANGED
@@ -1856,70 +1856,84 @@ const Util = {
|
|
1856
1856
|
}
|
1857
1857
|
}
|
1858
1858
|
$(this).click(function () {
|
1859
|
-
|
1860
|
-
|
1861
|
-
|
1862
|
-
|
1863
|
-
|
1864
|
-
|
1865
|
-
|
1866
|
-
|
1867
|
-
|
1868
|
-
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1873
|
-
|
1874
|
-
|
1875
|
-
|
1876
|
-
|
1877
|
-
|
1878
|
-
|
1879
|
-
|
1880
|
-
|
1881
|
-
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1885
|
-
|
1886
|
-
|
1887
|
-
|
1888
|
-
|
1889
|
-
|
1890
|
-
}
|
1891
|
-
};
|
1892
|
-
row_arr.sort(function (row1, row2) {
|
1893
|
-
let td1_val = get_td_value(row1);
|
1894
|
-
let td2_val = get_td_value(row2);
|
1895
|
-
return $.isNumeric(td1_val) && $.isNumeric(td2_val) ? td1_val - td2_val : td1_val.localeCompare(td2_val);
|
1896
|
-
});
|
1897
|
-
let sort_cls = "fa-sort-asc";
|
1898
|
-
this.asc = !this.asc;
|
1899
|
-
if (!this.asc) {
|
1900
|
-
row_arr = row_arr.reverse();
|
1901
|
-
sort_cls = "fa-sort-desc";
|
1859
|
+
Util.sort_table_row($(this));
|
1860
|
+
});
|
1861
|
+
});
|
1862
|
+
},
|
1863
|
+
|
1864
|
+
/**
|
1865
|
+
* 对表格每一行排序
|
1866
|
+
* @param td_obj 表格里的单元格对象
|
1867
|
+
*/
|
1868
|
+
sort_table_row: function (td_obj) {
|
1869
|
+
let table = td_obj.parents('table').eq(0);
|
1870
|
+
let row_arr = table.find('tr:gt(0)').toArray();
|
1871
|
+
let td_index = td_obj.index();
|
1872
|
+
row_arr.sort(function (row1, row2) {
|
1873
|
+
let td1_val = Util.get_table_td_value(row1, td_index);
|
1874
|
+
let td2_val = Util.get_table_td_value(row2, td_index);
|
1875
|
+
return $.isNumeric(td1_val) && $.isNumeric(td2_val) ? td1_val - td2_val : td1_val.localeCompare(td2_val);
|
1876
|
+
});
|
1877
|
+
let sort_cls = "fa-sort-asc";
|
1878
|
+
this.asc = !this.asc;
|
1879
|
+
if (!this.asc) {
|
1880
|
+
row_arr = row_arr.reverse();
|
1881
|
+
sort_cls = "fa-sort-desc";
|
1882
|
+
}
|
1883
|
+
table.children('tbody').empty().html(row_arr);
|
1884
|
+
table.find("i").each(function () {
|
1885
|
+
if ($(this).hasClass("fa")) {
|
1886
|
+
$(this).removeClass("fa-sort-asc");
|
1887
|
+
$(this).removeClass("fa-sort-desc");
|
1888
|
+
if (!$(this).hasClass("fa-sort")) {
|
1889
|
+
$(this).addClass("fa-sort");
|
1902
1890
|
}
|
1903
|
-
|
1904
|
-
|
1905
|
-
|
1906
|
-
|
1907
|
-
|
1908
|
-
|
1909
|
-
|
1910
|
-
|
1911
|
-
|
1891
|
+
$(this).parent().removeClass("info");
|
1892
|
+
}
|
1893
|
+
});
|
1894
|
+
td_obj.find("i").each(function () {
|
1895
|
+
if ($(this).hasClass("fa")) {
|
1896
|
+
$(this).removeClass("fa-sort");
|
1897
|
+
$(this).addClass(sort_cls);
|
1898
|
+
}
|
1899
|
+
});
|
1900
|
+
td_obj.addClass("info");
|
1901
|
+
},
|
1902
|
+
|
1903
|
+
/**
|
1904
|
+
* 获取表格的单元格值
|
1905
|
+
* @param row
|
1906
|
+
* @param td_index
|
1907
|
+
*/
|
1908
|
+
get_table_td_value: function (row, td_index) {
|
1909
|
+
let td_obj = $(row).children('td').eq(td_index);
|
1910
|
+
if (td_obj.attr("data-val")) {
|
1911
|
+
return td_obj.attr("data-val");
|
1912
|
+
} else {
|
1913
|
+
let td_val = td_obj.text();
|
1914
|
+
// 2017-12-7 这种时间格式
|
1915
|
+
if (Util.regexp_date_yyyy_mm_dd(td_val)) {
|
1916
|
+
return Util.format_to_second(td_val);
|
1917
|
+
} else {
|
1918
|
+
// 174.36(+0.79%) 括号里的数字
|
1919
|
+
let bracket_re = /\(([-+]?\d*\.?\d+|[-+]?\d+|\d+)\%?\)/;
|
1920
|
+
let match_arr = bracket_re.exec(td_val);
|
1921
|
+
if ($.isArray(match_arr)) {
|
1922
|
+
if (match_arr.length >= 2) {
|
1923
|
+
return match_arr[1];
|
1912
1924
|
}
|
1913
|
-
|
1914
|
-
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1925
|
+
return 0;
|
1926
|
+
} else {
|
1927
|
+
// 匹配数字
|
1928
|
+
let digit_re = /([-+]?\d*\.?\d+|[-+]?\d+|\d+)/;
|
1929
|
+
match_arr = digit_re.exec(td_val);
|
1930
|
+
if ($.isArray(match_arr) && match_arr[0]) {
|
1931
|
+
return match_arr[0];
|
1918
1932
|
}
|
1919
|
-
|
1920
|
-
|
1921
|
-
}
|
1922
|
-
}
|
1933
|
+
return Util.filter_chinese(td_val).replace("%", "");
|
1934
|
+
}
|
1935
|
+
}
|
1936
|
+
}
|
1923
1937
|
},
|
1924
1938
|
|
1925
1939
|
/**
|