优化主子表单删方法

This commit is contained in:
RuoYi
2022-04-17 10:18:19 +08:00
parent 977ceb562e
commit 53bb1da7a1
4 changed files with 7 additions and 5 deletions

View File

@ -171,7 +171,8 @@
title: '操作',
align: 'center',
formatter: function(value, row, index) {
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="sub.delRowByIndex(\'' + $.table.serialNumber(index) + '\', \'' + row.index + '\')"><i class="fa fa-remove"></i>删除</a>';
var value = $.common.isNotEmpty(row.index) ? row.index : $.table.serialNumber(index);
return '<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="sub.delRowByIndex(\'' + value + '\')"><i class="fa fa-remove"></i>删除</a>';
}
}]
};