sbd-npm 1.4.94 → 1.4.95
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/package.json +1 -1
- package/status.js +2 -2
- package/util.js +34 -4
package/package.json
CHANGED
package/status.js
CHANGED
|
@@ -1121,7 +1121,7 @@ $(function () {
|
|
|
1121
1121
|
Status.pack_machine_component("machine_instruction_machine", j["machines"]);
|
|
1122
1122
|
let machine = $("#machines").val();
|
|
1123
1123
|
if (machine) {
|
|
1124
|
-
$("#machine_instruction_machine").
|
|
1124
|
+
$("#machine_instruction_machine").val(machine);
|
|
1125
1125
|
}
|
|
1126
1126
|
}
|
|
1127
1127
|
if (j["instructions"]) {
|
|
@@ -1210,7 +1210,7 @@ $(function () {
|
|
|
1210
1210
|
Status.pack_machine_component("machine_cookie_machine", j["machines"]);
|
|
1211
1211
|
let machine = $("#machines").val();
|
|
1212
1212
|
if (machine) {
|
|
1213
|
-
$("#machine_cookie_machine").
|
|
1213
|
+
$("#machine_cookie_machine").val(machine);
|
|
1214
1214
|
}
|
|
1215
1215
|
}
|
|
1216
1216
|
Util.hide_tips();
|
package/util.js
CHANGED
|
@@ -1028,7 +1028,7 @@ const Util = {
|
|
|
1028
1028
|
},
|
|
1029
1029
|
|
|
1030
1030
|
/**
|
|
1031
|
-
*
|
|
1031
|
+
* 渲染表格数据
|
|
1032
1032
|
* @param element_id
|
|
1033
1033
|
* @param html
|
|
1034
1034
|
*/
|
|
@@ -1042,6 +1042,36 @@ const Util = {
|
|
|
1042
1042
|
}
|
|
1043
1043
|
},
|
|
1044
1044
|
|
|
1045
|
+
/**
|
|
1046
|
+
* 渲染 industry 下拉选择框数据
|
|
1047
|
+
* @param element_id
|
|
1048
|
+
* @param industry_data
|
|
1049
|
+
*/
|
|
1050
|
+
render_industry_select_html: function (element_id, industry_data) {
|
|
1051
|
+
let html = ['<option value="0">行业</option>'];
|
|
1052
|
+
if (Array.isArray(industry_data)) {
|
|
1053
|
+
industry_data.forEach(function (i) {
|
|
1054
|
+
html.push('<option value="', i["id"], '">', i["industry"], '(', i["num"], ')</option>');
|
|
1055
|
+
});
|
|
1056
|
+
}
|
|
1057
|
+
$("#" + element_id).html(html.join(""));
|
|
1058
|
+
},
|
|
1059
|
+
|
|
1060
|
+
/**
|
|
1061
|
+
* 渲染 area 下拉选择框数据
|
|
1062
|
+
* @param element_id
|
|
1063
|
+
* @param area_data
|
|
1064
|
+
*/
|
|
1065
|
+
render_area_select_html: function (element_id, area_data) {
|
|
1066
|
+
let html = ['<option value="">地区</option>'];
|
|
1067
|
+
if (Array.isArray(area_data)) {
|
|
1068
|
+
area_data.forEach(function (a) {
|
|
1069
|
+
html.push('<option value="', a["area"], '">', a["area"], '(', a["num"], ')</option>');
|
|
1070
|
+
});
|
|
1071
|
+
}
|
|
1072
|
+
$("#" + element_id).html(html.join(""));
|
|
1073
|
+
},
|
|
1074
|
+
|
|
1045
1075
|
/**
|
|
1046
1076
|
* 表格加载状态
|
|
1047
1077
|
* @param element_id
|
|
@@ -2661,7 +2691,7 @@ const Util = {
|
|
|
2661
2691
|
let val = $(this).text();
|
|
2662
2692
|
if (unit === "") {
|
|
2663
2693
|
let match_array = val.match(/[\u4e00-\u9fa5]+/);
|
|
2664
|
-
if (
|
|
2694
|
+
if (Array.isArray(match_array) && match_array[0]) {
|
|
2665
2695
|
unit = match_array[0];
|
|
2666
2696
|
}
|
|
2667
2697
|
}
|
|
@@ -2839,7 +2869,7 @@ const Util = {
|
|
|
2839
2869
|
// 174.36(+0.79%) 括号里的数字
|
|
2840
2870
|
let bracket_re = /\(([-+]?\d*\.?\d+|[-+]?\d+|\d+)\%?\)/;
|
|
2841
2871
|
let match_array = bracket_re.exec(td_val);
|
|
2842
|
-
if (
|
|
2872
|
+
if (Array.isArray(match_array)) {
|
|
2843
2873
|
if (match_array.length >= 2) {
|
|
2844
2874
|
return match_array[1];
|
|
2845
2875
|
}
|
|
@@ -2848,7 +2878,7 @@ const Util = {
|
|
|
2848
2878
|
// 匹配数字
|
|
2849
2879
|
let digit_re = /([-+]?\d*\.?\d+|[-+]?\d+|\d+)/;
|
|
2850
2880
|
match_array = digit_re.exec(td_val);
|
|
2851
|
-
if (
|
|
2881
|
+
if (Array.isArray(match_array) && match_array[0]) {
|
|
2852
2882
|
return match_array[0];
|
|
2853
2883
|
}
|
|
2854
2884
|
return td_val.replace("%", "");
|