|
|
|
@ -244,16 +244,34 @@ export class WaterCollectionComponent implements OnInit {
|
|
|
|
|
e.stopPropagation() |
|
|
|
|
let isDelete = window.confirm('确定要删除此条水源信息吗') |
|
|
|
|
if(isDelete){ |
|
|
|
|
this.http.delete(`/api/WaterSources/${item.id}`).subscribe(data => { |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
// this.http.delete(`/api/WaterSources/${item.id}`).subscribe(data => {
|
|
|
|
|
// const config = new MatSnackBarConfig();
|
|
|
|
|
// config.verticalPosition = 'top';
|
|
|
|
|
// config.duration = 3000
|
|
|
|
|
// this.addWaterListData.items = this.addWaterListData.items.filter(x => {
|
|
|
|
|
// return item.id != x.id
|
|
|
|
|
// })
|
|
|
|
|
// this.dataLength = this.dataLength - 1
|
|
|
|
|
// this.snackBar.open('删除成功','确定',config);
|
|
|
|
|
// })
|
|
|
|
|
|
|
|
|
|
let body = { |
|
|
|
|
title: item.name, |
|
|
|
|
operation: 2,//删除操作方式
|
|
|
|
|
contentType: 12,//水源类型
|
|
|
|
|
itemId: item.id, |
|
|
|
|
verifyState: 3, |
|
|
|
|
} |
|
|
|
|
this.http.post('/api/ContentVerifies',body).subscribe((data) => { |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.addWaterListData.items = this.addWaterListData.items.filter(x => { |
|
|
|
|
return item.id != x.id |
|
|
|
|
}) |
|
|
|
|
this.dataLength = this.dataLength - 1 |
|
|
|
|
// this.getAllWaterData()
|
|
|
|
|
this.snackBar.open('删除成功','确定',config); |
|
|
|
|
this.snackBar.open('删除审核提交成功','确定',config); |
|
|
|
|
this.addWaterListData.items.forEach(element => { |
|
|
|
|
if(element.id == item.id){ |
|
|
|
|
element.contentVerify = data |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -435,24 +453,37 @@ export class WaterCollectionComponent implements OnInit {
|
|
|
|
|
submitAudit(){ |
|
|
|
|
let isTrue = window.confirm('请确认保存后提交审核,否则将无法审核最新内容,是否继续?') |
|
|
|
|
if(isTrue){ |
|
|
|
|
console.log('提交审核的水源',this.waterData) |
|
|
|
|
// console.log('提交审核的水源',this.waterData)
|
|
|
|
|
let body = { |
|
|
|
|
title: this.waterData.name, |
|
|
|
|
operation: this.waterData.verifyState == -1 ? 0 : 1,//操作方式
|
|
|
|
|
operation: this.waterData.contentVerify ? 1 : 0,//操作方式
|
|
|
|
|
contentType: 12,//水源类型
|
|
|
|
|
itemId: this.waterData.id, |
|
|
|
|
verifyState: 3, |
|
|
|
|
} |
|
|
|
|
this.http.post('/api/ContentVerifies',body).subscribe((data) => { |
|
|
|
|
console.log('提交成功',data) |
|
|
|
|
this.waterData.verifyState = 3 |
|
|
|
|
this.waterData.contentVerify = data |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('提交成功','确定',config); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
//撤销审核
|
|
|
|
|
cancelAudit(){ |
|
|
|
|
|
|
|
|
|
let isTrue = window.confirm('您确认要撤销该审核吗?') |
|
|
|
|
if(isTrue){ |
|
|
|
|
// console.log('撤销审核的水源',this.waterData)
|
|
|
|
|
this.http.delete(`/api/ContentVerifies/${this.waterData.contentVerify.id}`).subscribe((data) => { |
|
|
|
|
this.waterData.contentVerify = null |
|
|
|
|
let config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('撤销成功','确定',config); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//关闭
|
|
|
|
|
close(){ |
|
|
|
|