import { LightningElement, api, track } from 'lwc';
|
import BatchDelete from '@salesforce/apex/SetFrameNumManageWebService.BatchDelete';
|
import { NavigationMixin } from 'lightning/navigation';
|
import { ShowToastEvent } from "lightning/platformShowToastEvent";
|
import LightningConfirm from 'lightning/confirm';
|
|
export default class LexBatchDeleteFileAdd extends NavigationMixin(LightningElement) {
|
@api listViewIds;
|
@track isLoading = false;
|
|
// 文件地址 批量删除
|
connectedCallback() {
|
if (this.listViewIds) {
|
this.isLoading = true;
|
let keyList = (this.listViewIds + '').split(',');
|
if (confirm('确定要删除这' + keyList.length + '条数据吗?')) {
|
BatchDelete({
|
ids : keyList
|
}).then((r) => {
|
if (r == 'success') {
|
|
}else{
|
alert(r);
|
}
|
this.BatchDeleteListing();
|
})
|
}else{
|
this.BatchDeleteListing();
|
}
|
} else {
|
alert('请至少选择一条数据。');
|
this.BatchDeleteListing();
|
}
|
}
|
|
BatchDeleteListing() {
|
window.open('/lightning/o/FileAddress__c/list?filterName=Recent')
|
window.close();
|
}
|
|
showToast(type, msg) {
|
this.isLoading = false;
|
const event = new ShowToastEvent({
|
title: msg,
|
variant: type,
|
});
|
this.dispatchEvent(event);
|
}
|
}
|