@gingkoo/base-server 0.0.4-alpha.34 → 0.0.4-alpha.35
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.
|
@@ -494,6 +494,39 @@ class PageEngine extends BaseXML {
|
|
|
494
494
|
let fields = this.getXmlFieldsData();
|
|
495
495
|
return fields;
|
|
496
496
|
}
|
|
497
|
+
// 处理 schame
|
|
498
|
+
handleSchema(schema, { readOnly }, adaptor) {
|
|
499
|
+
let newSchema = _.cloneDeep(schema);
|
|
500
|
+
if (readOnly) {
|
|
501
|
+
let body = newSchema.body[0];
|
|
502
|
+
body.addApi = '';
|
|
503
|
+
body.editApi = '';
|
|
504
|
+
body.delApi = '';
|
|
505
|
+
if (body.filterOptions?.leftAction?.action) {
|
|
506
|
+
body.filterOptions.leftAction.action = [];
|
|
507
|
+
}
|
|
508
|
+
if (body.filterOptions?.leftAction?.actionMore) {
|
|
509
|
+
delete body.filterOptions.leftAction.actionMore;
|
|
510
|
+
}
|
|
511
|
+
body.oprBtns = body.oprBtns.filter((it) => {
|
|
512
|
+
if (it.actionType !== 'del') {
|
|
513
|
+
return false;
|
|
514
|
+
}
|
|
515
|
+
if (it.actionType !== 'edit' || it.label === '编辑') {
|
|
516
|
+
return false;
|
|
517
|
+
}
|
|
518
|
+
return true;
|
|
519
|
+
});
|
|
520
|
+
body.rowInfo.quickStatic = true;
|
|
521
|
+
body.columns = body.columns.filter((v) => !['__check'].includes(v.name));
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
if (typeof adaptor === 'function') {
|
|
525
|
+
newSchema = adaptor(newSchema);
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
return newSchema;
|
|
529
|
+
}
|
|
497
530
|
}
|
|
498
531
|
|
|
499
532
|
module.exports = PageEngine;
|