Merge pull request 'fix: 通过区块的类型配置动作' (#390) from fix_filterData into @hera/dev
Reviewed-on: daoyoucloud/tachycode#390 Reviewed-by: sealday <zhanglin@daoyoucloud.com>
This commit is contained in:
commit
c056eac106
@ -1,4 +1,4 @@
|
|||||||
import { Plugin } from '@nocobase/client';
|
import { Plugin, useCollection } from '@nocobase/client';
|
||||||
import { RecordSummary } from './custom-components/RecordSummary';
|
import { RecordSummary } from './custom-components/RecordSummary';
|
||||||
import { RecordTotalPrice } from './custom-components/RecordTotalPrice';
|
import { RecordTotalPrice } from './custom-components/RecordTotalPrice';
|
||||||
import { RecordItemWeight } from './custom-components/RecordItemWeight';
|
import { RecordItemWeight } from './custom-components/RecordItemWeight';
|
||||||
@ -67,11 +67,21 @@ export class PluginRentalClient extends Plugin {
|
|||||||
type: 'item',
|
type: 'item',
|
||||||
title: '{{t("Print(countable)")}}',
|
title: '{{t("Print(countable)")}}',
|
||||||
component: 'PDFViewerCountablePrintActionInitializer',
|
component: 'PDFViewerCountablePrintActionInitializer',
|
||||||
|
useVisible() {
|
||||||
|
const collection = useCollection();
|
||||||
|
const name = collection['options']['name'];
|
||||||
|
return name === 'records';
|
||||||
|
},
|
||||||
});
|
});
|
||||||
this.app.schemaInitializerManager.addItem('PDFViewActionInitializer', 'enbaleActions.columnSwitch', {
|
this.app.schemaInitializerManager.addItem('PDFViewActionInitializer', 'enbaleActions.columnSwitch', {
|
||||||
type: 'item',
|
type: 'item',
|
||||||
title: '{{t("Column switch")}}',
|
title: '{{t("Column switch")}}',
|
||||||
component: 'ColumnSwitchActionInitializer',
|
component: 'ColumnSwitchActionInitializer',
|
||||||
|
useVisible() {
|
||||||
|
const collection = useCollection();
|
||||||
|
const name = collection['options']['name'];
|
||||||
|
return name === 'records';
|
||||||
|
},
|
||||||
});
|
});
|
||||||
this.app.schemaInitializerManager.addItem('PDFViewActionInitializer', 'enbaleActions.recordPrintSetup', {
|
this.app.schemaInitializerManager.addItem('PDFViewActionInitializer', 'enbaleActions.recordPrintSetup', {
|
||||||
type: 'item',
|
type: 'item',
|
||||||
@ -82,16 +92,31 @@ export class PluginRentalClient extends Plugin {
|
|||||||
type: 'item',
|
type: 'item',
|
||||||
title: '{{t("Record print margingtop")}}',
|
title: '{{t("Record print margingtop")}}',
|
||||||
component: 'RecordPrintSetupMargingTopInitializer',
|
component: 'RecordPrintSetupMargingTopInitializer',
|
||||||
|
useVisible() {
|
||||||
|
const collection = useCollection();
|
||||||
|
const name = collection['options']['name'];
|
||||||
|
return name === 'records' || name === 'waybills';
|
||||||
|
},
|
||||||
});
|
});
|
||||||
this.app.schemaInitializerManager.addItem('PDFViewActionInitializer', 'enbaleActions.settlementExcelExport', {
|
this.app.schemaInitializerManager.addItem('PDFViewActionInitializer', 'enbaleActions.settlementExcelExport', {
|
||||||
type: 'item',
|
type: 'item',
|
||||||
title: '{{t("Settlement excel export")}}',
|
title: '{{t("Settlement excel export")}}',
|
||||||
component: 'SettlementExcelExportActionInitializer',
|
component: 'SettlementExcelExportActionInitializer',
|
||||||
|
useVisible() {
|
||||||
|
const collection = useCollection();
|
||||||
|
const name = collection['options']['name'];
|
||||||
|
return name === 'settlements';
|
||||||
|
},
|
||||||
});
|
});
|
||||||
this.app.schemaInitializerManager.addItem('PDFViewActionInitializer', 'enbaleActions.settlementStyleSwitch', {
|
this.app.schemaInitializerManager.addItem('PDFViewActionInitializer', 'enbaleActions.settlementStyleSwitch', {
|
||||||
type: 'item',
|
type: 'item',
|
||||||
title: '{{t("Settlement style switch")}}',
|
title: '{{t("Settlement style switch")}}',
|
||||||
component: 'SettlementStyleSwitchActionInitializer',
|
component: 'SettlementStyleSwitchActionInitializer',
|
||||||
|
useVisible() {
|
||||||
|
const collection = useCollection();
|
||||||
|
const name = collection['options']['name'];
|
||||||
|
return name === 'settlements';
|
||||||
|
},
|
||||||
});
|
});
|
||||||
this.app.schemaInitializerManager.addItem('RecordBlockInitializers', 'previewBlock.record', {
|
this.app.schemaInitializerManager.addItem('RecordBlockInitializers', 'previewBlock.record', {
|
||||||
key: 'record',
|
key: 'record',
|
||||||
|
Loading…
Reference in New Issue
Block a user