代码调试
This commit is contained in:
parent
44cf4d1ef4
commit
963cf821da
|
|
@ -19,20 +19,15 @@ $.fn.serializeObject = function () {
|
|||
function getUrlParam(key) {
|
||||
var href = window.location.href;
|
||||
|
||||
console.log("key+++++", key);
|
||||
var url = href.split("?");
|
||||
console.log("url+++++", url);
|
||||
if (url.length <= 1) {
|
||||
return "";
|
||||
}
|
||||
var params = url[1].split("&");
|
||||
|
||||
console.log("params+++++", params);
|
||||
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
var param = params[i].split("=");
|
||||
|
||||
console.log("param*****+++++", param);
|
||||
if (key == param[0]) {
|
||||
return param[1];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,6 +109,10 @@
|
|||
headerRows = [];
|
||||
headerRows = JSON.parse(data);
|
||||
|
||||
// 定义弹框内需要的label
|
||||
const dialogLabelList = headerRows[1]
|
||||
const dialogLabelInfo = headerRows[2]
|
||||
|
||||
// Clear existing headers
|
||||
const thead = document.querySelector('#baseTable thead');
|
||||
if (thead) {
|
||||
|
|
@ -212,26 +216,33 @@
|
|||
event.stopPropagation(); // 阻止事件冒泡
|
||||
event.preventDefault()
|
||||
console.log('按钮被点击了');
|
||||
let rowIndex = $(this).closest('tr').data('index')
|
||||
const tableList = JSON.parse(msg)
|
||||
|
||||
|
||||
console.log('rowIndex当前行的索引', rowIndex)
|
||||
// 在这里添加按钮点击后的逻辑
|
||||
|
||||
// 组装dom
|
||||
let formHtml = ''
|
||||
dialogLabelList.forEach((e, index) => {
|
||||
formHtml += `
|
||||
<div style="padding: 11px;">
|
||||
<form id="uploadForm">
|
||||
<div style="display: flex; align-items: center;">
|
||||
<label for="numberInput" style="margin-right: 10px;">${e.title}</label>
|
||||
<input type="number" data-id="${dialogLabelInfo[index].field}" id="numberInput" name="numberInput" min="0.01" step="0.01" placeholder="请输入大于0的数字" style="width: 150px; padding: 5px;" required value="${tableList[index][dialogLabelInfo[index].field]}">
|
||||
<button type="button" id="uploadBtn" style="background-color: #4CAF50; color: white; border: none; margin-left: 10px; cursor: pointer;">
|
||||
+ 上传平分依据
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>`
|
||||
})
|
||||
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>
|
||||
`,
|
||||
area: ['auto', 'auto'], // 宽高
|
||||
content: formHtml,
|
||||
success: function (layero, index) {
|
||||
// 点击上传按钮的逻辑
|
||||
$('#uploadBtn').on('click', function (event) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue