This commit is contained in:
BianLzhaoMin 2025-02-26 18:19:23 +08:00
parent bd082aac08
commit e9c58a330a
1 changed files with 19 additions and 9 deletions

View File

@ -339,19 +339,29 @@
currentRows.fileList = fileList currentRows.fileList = fileList
for (let key in formData) {
let curTd = tableView.find('tr[data-index=' + rowIndex + ']').find('td[data-key=' + key + ']')
if (curTd.length > 0) {
$(curTd).text(formData[key]);
} else {
console.log('没有找到对应的 td', key);
}
}
// 更新当前行的表格数据 // 更新当前行的表格数据
let colsNew = tableView.find('tr[data-index=' + rowIndex + ']').find('td'); // let colsNew = tableView.find('tr[data-index=' + rowIndex + ']').find('td');
// 遍历所有列,更新相应的单元格 // 遍历所有列,更新相应的单元格
colsNew.each(function (index, td) { // colsNew.each(function (index, td) {
// 获取字段名,和表格列的字段对应 // // 获取字段名,和表格列的字段对应
let fieldName = dialogLabelInfo[index]?.field; // let fieldName = dialogLabelInfo[index]?.field;
// 如果该列对应的字段存在,则更新该单元格的值 // // 如果该列对应的字段存在,则更新该单元格的值
if (fieldName && currentRows[fieldName] !== undefined) { // if (fieldName && currentRows[fieldName] !== undefined) {
$(td).text(currentRows[fieldName]); // $(td).text(formData[fieldName]);
} // }
}) // })
// let dataForm = { // let dataForm = {
// templateId: getUrlParam('templateId'), // templateId: getUrlParam('templateId'),
// evaluateId: getUrlParam('id'), // evaluateId: getUrlParam('id'),