/*
|
* @Author: zhangchunxu
|
* @Date: 2023-07-21 11:33:34
|
* @LastEditors: zhangchunxu
|
* @LastEditTime: 2023-08-01 13:45:13
|
*
|
*/
|
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 LexBatchDelete extends NavigationMixin(LightningElement) {
|
@api listViewIds;
|
@track isLoading = false;
|
|
// 机身号管理 批量删除
|
connectedCallback() {
|
console.log('this.listViewIds = ' + this.listViewIds);
|
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/FrameNumManage__c/list?filterName=Recent')
|
window.close();
|
}
|
|
showToast(type, msg) {
|
this.isLoading = false;
|
const event = new ShowToastEvent({
|
title: msg,
|
variant: type,
|
});
|
this.dispatchEvent(event);
|
}
|
}
|