delete
This commit is contained in:
+20
-2
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user