|
|
|
|
@ -1,11 +1,11 @@ |
|
|
|
|
<template> |
|
|
|
|
<basic-container> |
|
|
|
|
<avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel" |
|
|
|
|
v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen" |
|
|
|
|
@search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" |
|
|
|
|
@current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
|
|
|
|
<avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" v-model="form" |
|
|
|
|
:permission="permissionList" :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset" |
|
|
|
|
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" @on-load="onLoad"> |
|
|
|
|
<template slot-scope="{row}" slot="menu"> |
|
|
|
|
<el-button type="text" icon="el-icon-circle-plus-outline" size="small" @click="handleDelete">取消黑名单 |
|
|
|
|
<el-button type="text" icon="el-icon-circle-plus-outline" size="small" @click="handleCancel">取消黑名单 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template slot-scope="{row}" slot="status"> |
|
|
|
|
@ -93,44 +93,25 @@ export default { |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
//发布 |
|
|
|
|
publish(row, done, loading) { |
|
|
|
|
console.log(row, done, loading) |
|
|
|
|
}, |
|
|
|
|
rowSave(row, done, loading) { |
|
|
|
|
add(row).then(() => { |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
done(); |
|
|
|
|
}, error => { |
|
|
|
|
window.console.log(error); |
|
|
|
|
loading(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
rowUpdate(row, index, done, loading) { |
|
|
|
|
update(row).then(() => { |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
done(); |
|
|
|
|
}, error => { |
|
|
|
|
window.console.log(error); |
|
|
|
|
loading(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
rowDel(row) { |
|
|
|
|
this.$confirm("确定将选择数据删除?", { |
|
|
|
|
//取消黑名单 |
|
|
|
|
handleCancel(row) { |
|
|
|
|
this.$confirm("确认将此用户移除黑名单吗?", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning" |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
return remove(row.id); |
|
|
|
|
// update(row).then(() => { |
|
|
|
|
// this.onLoad(this.page); |
|
|
|
|
// this.$message({ |
|
|
|
|
// type: "success", |
|
|
|
|
// message: "操作成功!" |
|
|
|
|
// }); |
|
|
|
|
// done(); |
|
|
|
|
// }, error => { |
|
|
|
|
// window.console.log(error); |
|
|
|
|
// loading(); |
|
|
|
|
// }); |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
@ -157,28 +138,6 @@ export default { |
|
|
|
|
this.selectionList = []; |
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
}, |
|
|
|
|
handleDelete() { |
|
|
|
|
if (this.selectionList.length === 0) { |
|
|
|
|
this.$message.warning("请选择至少一条数据"); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
this.$confirm("确定将选择数据删除?", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
type: "warning" |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
return remove(this.ids); |
|
|
|
|
}) |
|
|
|
|
.then(() => { |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
this.$message({ |
|
|
|
|
type: "success", |
|
|
|
|
message: "操作成功!" |
|
|
|
|
}); |
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
beforeOpen(done, type) { |
|
|
|
|
if (["edit", "view"].includes(type)) { |
|
|
|
|
getNotice(this.form.id).then(res => { |
|
|
|
|
|