This commit is contained in:
aqu415
2022-03-04 12:42:46 +08:00
parent 7ca02cfde3
commit 812332f79f
4 changed files with 39 additions and 16 deletions
+20 -2
View File
@@ -72,7 +72,7 @@
<td>
<i class="layui-icon layui-icon-edit" style="font-size: 15px; color: #1E9FFF;cursor: pointer;" onclick="window.open('detail?id=${item.id}')">编辑</i>
<i class="layui-icon layui-icon-share" style="font-size: 15px; color: #1E9FFF;cursor: pointer;margin-left: 10px;">复制分享</i>
<i class="layui-icon layui-icon-delete" style="font-size: 15px; color: #1E9FFF;cursor: pointer;margin-left: 10px;">删除</i>
<i class="layui-icon layui-icon-delete" style="font-size: 15px; color: #1E9FFF;cursor: pointer;margin-left: 10px;" onclick="delmind(${item.id})">删除</i>
</td>
</tr>`
$('#layui-table tbody').append(tr)
@@ -131,12 +131,26 @@
return null;
}
}
},
// 删除
del_mind: function (id) {
const me = this
$.ajax({
url: 'delete',
type: 'DELETE',
data: {'id': id},
success: function (result) {
layer.closeAll()
me.fetch_data()
}
});
}
}
let view
$(function () {
// 初始化对象
const view = new listView({'page_bar_elem': 'page_bar'})
view = new listView({'page_bar_elem': 'page_bar'})
view.init()
view.fetch_data()
@@ -233,6 +247,10 @@
//
})
function delmind(id) {
view.del_mind(id)
}
</script>
</head>
<body>