imm-element-ui 2.5.4 → 2.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10587,6 +10587,7 @@ class PageFormComponent extends AmComponent {
|
|
|
10587
10587
|
delRows(e) {
|
|
10588
10588
|
const gridTab = this.resolvedGridList()[this.indexValue];
|
|
10589
10589
|
const deleteFunc = gridTab.deleteFunc;
|
|
10590
|
+
console.log('delRows----', e, gridTab);
|
|
10590
10591
|
const subTable = gridTab.gridOptions.modelName;
|
|
10591
10592
|
const ids = Array.isArray(e) ? e : [e];
|
|
10592
10593
|
let prm = {
|
|
@@ -11189,10 +11190,35 @@ class PageFormComponent extends AmComponent {
|
|
|
11189
11190
|
ids = selectItem.filter((v) => v.id).map((v) => v.id);
|
|
11190
11191
|
}
|
|
11191
11192
|
if (ids.length > 0) {
|
|
11192
|
-
|
|
11193
|
+
const gridTab = this.resolvedGridList()[this.indexValue];
|
|
11194
|
+
const deleteFunc = gridTab.deleteFunc;
|
|
11195
|
+
let doneCalled = false;
|
|
11196
|
+
const done = () => {
|
|
11197
|
+
if (doneCalled) {
|
|
11198
|
+
return;
|
|
11199
|
+
}
|
|
11200
|
+
doneCalled = true;
|
|
11201
|
+
typeof this.formDetail() == 'function' ? this.formDetail()(this.id) : this.getDetail(4);
|
|
11193
11202
|
this.pageFormService.removeData(grid.subDataKey, this.pageFormService.getSelectedRows(), grid);
|
|
11194
|
-
this.
|
|
11195
|
-
}
|
|
11203
|
+
this.action.loading.set(false);
|
|
11204
|
+
};
|
|
11205
|
+
if (!deleteFunc) {
|
|
11206
|
+
this.action.loading.set(true);
|
|
11207
|
+
this.web_remove({ modelName: grid.gridOptions.modelName, ids }).subscribe((res) => {
|
|
11208
|
+
this.pageFormService.removeData(grid.subDataKey, this.pageFormService.getSelectedRows(), grid);
|
|
11209
|
+
this.pageFormService.setSelectedRows([]);
|
|
11210
|
+
});
|
|
11211
|
+
}
|
|
11212
|
+
else {
|
|
11213
|
+
this.action.loading.set(true);
|
|
11214
|
+
const result = deleteFunc(ids, gridTab, done);
|
|
11215
|
+
if (isObservable(result)) {
|
|
11216
|
+
result.subscribe(() => done());
|
|
11217
|
+
}
|
|
11218
|
+
else if (result && typeof result.subscribe === 'function') {
|
|
11219
|
+
result.subscribe(() => done());
|
|
11220
|
+
}
|
|
11221
|
+
}
|
|
11196
11222
|
}
|
|
11197
11223
|
else {
|
|
11198
11224
|
this.pageFormService.removeData(grid.subDataKey, this.pageFormService.getSelectedRows(), grid);
|