Browse Source

update delete

wangeditor
chenlong 2 years ago
parent
commit
5041e33ab1
  1. 27
      View/Admin/Notebook/lists.blade.php

27
View/Admin/Notebook/lists.blade.php

@ -113,7 +113,7 @@
left: 0;
width: 100%;
height: 100%;
z-index: 9999;
z-index: 99;
background-color: #f8e3c535;
}
.content-shade .logo{
@ -151,8 +151,7 @@
<div class="time">创建时间:@{{item.create_time}}</div>
<div class="time"><div>创建人:@{{ item.create_name }}</div> <div>最后更新: @{{ item.latest_name }}</div></div>
<div class="list-tool">
<div class="list-tool-item" v-if="item.id === currentNotebook.id"><el-icon @click.stop="getLatest"><Refresh/></el-icon></div>
<div class="list-tool-item delete" ><el-icon @click.stop="deleteaa"><delete/></el-icon></div>
<div class="list-tool-item delete" ><el-icon @click.stop="deleteaa(item, index)"><delete/></el-icon></div>
</div>
</div>
<el-divider v-if="notNotebook">
@ -242,8 +241,26 @@
this.getLatest();
}
VueInit.methods.deleteaa = function (){
console.log(111);
VueInit.methods.deleteaa = function (item, index){
this.$confirm("确认删除笔记吗?").then(() =>{
this.notebook.splice(index, 1);
if (index === this.active) {
this.currentNotebook = this.notebook[index] ? this.notebook[index] : {title: ''};
}
axios({
url:"destroy",
method:'post',
data:{
ids:[item.id]
}
}).then(({data:res}) => {
if(res.code === 200){
this.$message.success("删除成功");
}else{
this.$message.error(res.msg);
}
});
})
}
VueInit.methods.create = function (){

Loading…
Cancel
Save