[Update] 修改更新资产的协议组,不能删除协议的问题 (#3228)

* [Update] 修改更新资产的协议组,不能删除协议的问题

* [Update] 修改前端属性名,避免冲突
pull/3236/head
八千流 5 years ago committed by 老广
parent 1457281b73
commit 82b00008d9

@ -28,7 +28,7 @@
<div class="col-md-2 col-md-offset-2" style="text-align: right">{{ fm.name }}</div> <div class="col-md-2 col-md-offset-2" style="text-align: right">{{ fm.name }}</div>
<div class="col-md-6">{{ fm.port }}</div> <div class="col-md-6">{{ fm.port }}</div>
<div class="col-md-1" style="padding: 6px 0"> <div class="col-md-1" style="padding: 6px 0">
<a class="btn btn-danger btn-xs btn-protocol btn-del"><span class="fa fa-minus"></span> </a> <a class="btn btn-danger btn-xs btn-protocol btn-delete"><span class="fa fa-minus"></span> </a>
<a class="btn btn-primary btn-xs btn-protocol btn-add" style="display: none"><span class="fa fa-plus"></span></a> <a class="btn btn-primary btn-xs btn-protocol btn-add" style="display: none"><span class="fa fa-plus"></span></a>
</div> </div>
</div> </div>
@ -97,7 +97,7 @@ function format(item) {
function protocolBtnShow() { function protocolBtnShow() {
$(".btn-protocol.btn-add").hide(); $(".btn-protocol.btn-add").hide();
$(".btn-protocol.btn-add:last").show(); $(".btn-protocol.btn-add:last").show();
var btnDel = $(".btn-protocol.btn-del"); var btnDel = $(".btn-protocol.btn-delete");
if (btnDel.length === 1) { if (btnDel.length === 1) {
btnDel.addClass("disabled") btnDel.addClass("disabled")
} else { } else {
@ -140,7 +140,7 @@ $(document).ready(function () {
protocolRef.trigger("change") protocolRef.trigger("change")
} }
}) })
.on("click", ".btn-protocol.btn-del", function () { .on("click", ".btn-protocol.btn-delete", function () {
$(this).parent().parent().remove(); $(this).parent().parent().remove();
protocolBtnShow() protocolBtnShow()
}) })

Loading…
Cancel
Save