|
@@ -54,7 +54,7 @@
|
|
|
<% } else { %>
|
|
|
<td>
|
|
|
<div class="input-group input-group-sm" style="width:90px">
|
|
|
- <input type="number" class="form-control" max="100" min="0" step="2" value="<%- s.ratio || 100 %>" status="<%- s.value %>" onchange="updateStatusRatio(this);">
|
|
|
+ <input type="number" class="form-control" max="100" min="0" step="2" value="<%- s.ratio || 0 %>" status="<%- s.value %>" onchange="updateStatusRatio(this);">
|
|
|
<div class="input-group-append">
|
|
|
<span class="input-group-text">%</span>
|
|
|
</div>
|
|
@@ -139,11 +139,11 @@
|
|
|
});
|
|
|
}
|
|
|
const updateStatusRatio = function (obj) {
|
|
|
-
|
|
|
const data = { type: 'dagl' };
|
|
|
data.status = parseInt(obj.getAttribute('status'));
|
|
|
try {
|
|
|
data.ratio = parseFloat(obj.value);
|
|
|
+ if (data.ratio > 100 || data.ratio < 0) throw '请输入0-100间的数字';
|
|
|
} catch (error) {
|
|
|
toastr.warning('请输入0-100间的数字');
|
|
|
return;
|