代码调试
This commit is contained in:
parent
4209775850
commit
44cf4d1ef4
|
|
@ -213,6 +213,44 @@
|
||||||
event.preventDefault()
|
event.preventDefault()
|
||||||
console.log('按钮被点击了');
|
console.log('按钮被点击了');
|
||||||
// 在这里添加按钮点击后的逻辑
|
// 在这里添加按钮点击后的逻辑
|
||||||
|
layer.open({
|
||||||
|
type: 1,
|
||||||
|
area: ['420px', '240px'], // 宽高
|
||||||
|
content: `
|
||||||
|
<div style="padding: 11px;">
|
||||||
|
<form id="uploadForm">
|
||||||
|
<div style="display: flex; align-items: center;">
|
||||||
|
<label for="numberInput" style="margin-right: 10px;">入场人员达标率(15)</label>
|
||||||
|
<input type="number" id="numberInput" name="numberInput"
|
||||||
|
min="0.01" step="0.01" placeholder="请输入大于0的数字"
|
||||||
|
style="width: 150px; padding: 5px;" required>
|
||||||
|
<button type="button" id="uploadBtn"
|
||||||
|
style="background-color: #4CAF50; color: white; border: none; padding: 5px 10px; margin-left: 10px; cursor: pointer;">
|
||||||
|
+ 上传附件
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
`,
|
||||||
|
success: function (layero, index) {
|
||||||
|
// 点击上传按钮的逻辑
|
||||||
|
$('#uploadBtn').on('click', function (event) {
|
||||||
|
event.stopPropagation(); // 阻止事件冒泡
|
||||||
|
event.preventDefault(); // 阻止默认行为
|
||||||
|
console.log('上传附件按钮被点击了');
|
||||||
|
// 在这里可以添加附件上传的逻辑,例如打开文件选择器等
|
||||||
|
});
|
||||||
|
|
||||||
|
// 表单提交前验证输入是否大于0
|
||||||
|
$('#uploadForm').on('submit', function (event) {
|
||||||
|
var inputValue = $('#numberInput').val();
|
||||||
|
if (parseFloat(inputValue) <= 0) {
|
||||||
|
alert('请输入大于 0 的数字');
|
||||||
|
event.preventDefault(); // 阻止表单提交
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
});
|
});
|
||||||
tableLoading && layer.close(tableLoading);
|
tableLoading && layer.close(tableLoading);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue