sbd-npm 1.2.91 → 1.2.92
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/util.js +10 -3
package/package.json
CHANGED
package/util.js
CHANGED
@@ -1489,19 +1489,26 @@ const Util = {
|
|
1489
1489
|
/**
|
1490
1490
|
* 数量限制组件
|
1491
1491
|
* @param component_id
|
1492
|
+
* @param select_val
|
1493
|
+
* @param max_val
|
1492
1494
|
*/
|
1493
|
-
init_limit_num_component: function (component_id) {
|
1495
|
+
init_limit_num_component: function (component_id, select_val = 0, max_val = 0) {
|
1494
1496
|
let element_id = component_id.replace("_div", "");
|
1495
1497
|
let html = [];
|
1496
1498
|
html.push('<label for="', element_id, '"></label>');
|
1497
1499
|
html.push('<select id="', element_id, '" class="form-control">');
|
1498
1500
|
html.push('<option value="50">50</option>');
|
1499
|
-
html.push('<option value="100"
|
1501
|
+
html.push('<option value="100">100</option>');
|
1500
1502
|
html.push('<option value="200">200</option>');
|
1501
1503
|
html.push('<option value="500">500</option>');
|
1502
1504
|
html.push('<option value="1000">1000</option>');
|
1505
|
+
if (max_val > 0) {
|
1506
|
+
html.push('<option value="', max_val, '">', max_val, '</option>');
|
1507
|
+
}
|
1503
1508
|
html.push('</select>');
|
1504
|
-
$("#" + component_id)
|
1509
|
+
let obj = $("#" + component_id);
|
1510
|
+
obj.html(html.join(""));
|
1511
|
+
obj.find("option[value='" + (select_val > 0 ? select_val : 100) + "']").attr("selected", true);
|
1505
1512
|
},
|
1506
1513
|
|
1507
1514
|
/**
|