mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 05:29:26 +08:00
fix: field assignment to support variable value as 0 (#5663)
* fix: associationFieldMobile * fix: bug
This commit is contained in:
parent
af599493d1
commit
e7cb99ea47
@ -156,7 +156,6 @@ export function useCollectValuesToSubmit() {
|
||||
const waitList = Object.keys(originalAssignedValues).map(async (key) => {
|
||||
const value = originalAssignedValues[key];
|
||||
const collectionField = getField(key);
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (!collectionField) {
|
||||
throw new Error(`field "${key}" not found in collection "${name}"`);
|
||||
@ -165,7 +164,7 @@ export function useCollectValuesToSubmit() {
|
||||
|
||||
if (isVariable(value)) {
|
||||
const { value: parsedValue } = (await variables?.parseVariable(value, localVariables)) || {};
|
||||
if (parsedValue) {
|
||||
if (parsedValue !== null && parsedValue !== undefined) {
|
||||
assignedValues[key] = transformVariableValue(parsedValue, { targetCollectionField: collectionField });
|
||||
}
|
||||
} else if (value != null && value !== '') {
|
||||
|
@ -14,6 +14,19 @@ import { Button as MobileButton, Dialog as MobileDialog } from 'antd-mobile';
|
||||
import { MobilePicker } from './components/MobilePicker';
|
||||
import { MobileDateTimePicker } from './components/MobileDatePicker';
|
||||
|
||||
const AssociationFieldMobile = (props) => {
|
||||
return <AssociationField {...props} popupMatchSelectWidth={true} />;
|
||||
};
|
||||
|
||||
AssociationFieldMobile.SubTable = AssociationField.SubTable;
|
||||
AssociationFieldMobile.Nester = AssociationField.Nester;
|
||||
AssociationFieldMobile.AddNewer = AssociationField.Container;
|
||||
AssociationFieldMobile.Selector = AssociationField.Container;
|
||||
AssociationFieldMobile.Viewer = AssociationField.Container;
|
||||
AssociationFieldMobile.InternalSelect = AssociationField.InternalSelect;
|
||||
AssociationFieldMobile.ReadPretty = AssociationField.ReadPretty;
|
||||
AssociationFieldMobile.FileSelector = AssociationField.FileSelector;
|
||||
|
||||
const mobileComponents = {
|
||||
Button: MobileButton,
|
||||
Select: (props) => {
|
||||
@ -34,9 +47,7 @@ const mobileComponents = {
|
||||
},
|
||||
UnixTimestamp: MobileDateTimePicker,
|
||||
Modal: MobileDialog,
|
||||
AssociationField: (props) => {
|
||||
return <AssociationField {...props} popupMatchSelectWidth={true} />;
|
||||
},
|
||||
AssociationField: AssociationFieldMobile,
|
||||
};
|
||||
|
||||
export const MobilePage = () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user