feat: support business fields (#877)
Reviewed-on: daoyoucloud/tachybase#877
This commit is contained in:
parent
6f625b7ad8
commit
174f1464fa
@ -26,7 +26,10 @@ import {
|
|||||||
useWaybillPdfPath,
|
useWaybillPdfPath,
|
||||||
WaybillsProvider,
|
WaybillsProvider,
|
||||||
} from './hooks/usePdfPath';
|
} from './hooks/usePdfPath';
|
||||||
import { ColumnSwitchAction, ColumnSwitchActionInitializer } from './schema-initializer/actions/ColumnSwitchActionInitializer';
|
import {
|
||||||
|
ColumnSwitchAction,
|
||||||
|
ColumnSwitchActionInitializer,
|
||||||
|
} from './schema-initializer/actions/ColumnSwitchActionInitializer';
|
||||||
import {
|
import {
|
||||||
SettlementExcelExportActionInitializer,
|
SettlementExcelExportActionInitializer,
|
||||||
useSettlementExcelExportActionProps,
|
useSettlementExcelExportActionProps,
|
||||||
@ -37,12 +40,16 @@ import {
|
|||||||
SettlementStyleSwitchActionInitializer,
|
SettlementStyleSwitchActionInitializer,
|
||||||
useSettlementStyleSwitchActionProps,
|
useSettlementStyleSwitchActionProps,
|
||||||
} from './schema-initializer/actions/SettlementStyleSwitchActionInitializer';
|
} from './schema-initializer/actions/SettlementStyleSwitchActionInitializer';
|
||||||
import { RecordPrintSetupActionInitializer, PrintSetup } from './schema-initializer/actions/RecordPrintSetupActionInitializer';
|
import {
|
||||||
|
RecordPrintSetupActionInitializer,
|
||||||
|
PrintSetup,
|
||||||
|
} from './schema-initializer/actions/RecordPrintSetupActionInitializer';
|
||||||
import {
|
import {
|
||||||
RecordPrintSetupMargingTopInitializer,
|
RecordPrintSetupMargingTopInitializer,
|
||||||
PrintSetupMargingTop,
|
PrintSetupMargingTop,
|
||||||
} from './schema-initializer/actions/RecordPrintSetupMargingTopInitializer';
|
} from './schema-initializer/actions/RecordPrintSetupMargingTopInitializer';
|
||||||
import { UnusedRecordsBlockHelper } from './schema-initializer/blocks/UnusedRecordsBlockInitializer';
|
import { UnusedRecordsBlockHelper } from './schema-initializer/blocks/UnusedRecordsBlockInitializer';
|
||||||
|
import { MovementFieldInterface } from './interfaces/movement';
|
||||||
export class PluginRentalClient extends Plugin {
|
export class PluginRentalClient extends Plugin {
|
||||||
locale: Locale;
|
locale: Locale;
|
||||||
async afterAdd() {}
|
async afterAdd() {}
|
||||||
@ -151,6 +158,12 @@ export class PluginRentalClient extends Plugin {
|
|||||||
// You can get and modify the app instance here
|
// You can get and modify the app instance here
|
||||||
async load() {
|
async load() {
|
||||||
this.locale = new Locale(this.app);
|
this.locale = new Locale(this.app);
|
||||||
|
this.app.dataSourceManager.addFieldInterfaceGroups({
|
||||||
|
bussiness: {
|
||||||
|
label: 'Bussiness',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
this.app.dataSourceManager.addFieldInterfaces([MovementFieldInterface]);
|
||||||
this.app.addComponents({
|
this.app.addComponents({
|
||||||
RecordFeeConvertedAmount,
|
RecordFeeConvertedAmount,
|
||||||
ReadFeeConvertedAmount,
|
ReadFeeConvertedAmount,
|
||||||
|
@ -0,0 +1,27 @@
|
|||||||
|
import { CollectionFieldInterface, dataSource, defaultProps, operators } from '@nocobase/client';
|
||||||
|
import { tval } from '../locale';
|
||||||
|
|
||||||
|
export class MovementFieldInterface extends CollectionFieldInterface {
|
||||||
|
name = 'movement';
|
||||||
|
type = 'object';
|
||||||
|
group = 'bussiness';
|
||||||
|
title = tval('Movement');
|
||||||
|
sortable = true;
|
||||||
|
default = {
|
||||||
|
type: 'string',
|
||||||
|
uiSchema: {
|
||||||
|
type: 'string',
|
||||||
|
'x-component': 'Radio.Group',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
availableTypes = ['string', 'integer', 'boolean', 'integer'];
|
||||||
|
hasDefaultValue = true;
|
||||||
|
properties = {
|
||||||
|
...defaultProps,
|
||||||
|
// 'uiSchema.enum': dataSource,
|
||||||
|
};
|
||||||
|
filterable = {
|
||||||
|
operators: operators.enumType,
|
||||||
|
};
|
||||||
|
titleUsable = true;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user