This commit is contained in:
王思川 2024-06-15 19:50:09 +08:00
parent 009a292694
commit e81469a625
2 changed files with 7 additions and 2 deletions

View File

@ -136,6 +136,11 @@
data-id="{{ item|get_pk_value }}"
data-bs-toggle="modal"
data-bs-target="#addEditModal">编辑</a>
<a href="#" class="delete-btn"
style="color: red;"
data-id="{{ item|get_pk_value }}"
data-bs-toggle="modal"
data-bs-target="#deleteModal">删除</a>
</td>
</tr>
{% empty %}

View File

@ -16,7 +16,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-light" data-bs-dismiss="modal">取消</button>
<button type="button" class="btn btn-primary" id="confirmDeleteBtn">删除</button>
<button type="button" class="btn btn-danger" id="confirmDeleteBtn">删除</button>
</div>
</div>
</div>
@ -24,7 +24,7 @@
<script>
$(document).ready(function () {
var targetIdToDelete = null;
var targetIdToDelete = null;
var deleteUrl = "{{ url.delete }}";
// 删除按钮点击事件,打开删除确认模态框