fix: field required when setting sorting rules (#1885)
This commit is contained in:
parent
2060bd4d44
commit
27cdd7b78a
@ -161,7 +161,7 @@ FormItem.Designer = function Designer() {
|
|||||||
const fieldMode = field?.componentProps?.['mode'] || (isFileField ? 'FileManager' : 'Select');
|
const fieldMode = field?.componentProps?.['mode'] || (isFileField ? 'FileManager' : 'Select');
|
||||||
const isSelectFieldMode = fieldMode === 'Select';
|
const isSelectFieldMode = fieldMode === 'Select';
|
||||||
const sort = defaultSort?.map((item: string) => {
|
const sort = defaultSort?.map((item: string) => {
|
||||||
return item.startsWith('-')
|
return item?.startsWith('-')
|
||||||
? {
|
? {
|
||||||
field: item.substring(1),
|
field: item.substring(1),
|
||||||
direction: 'desc',
|
direction: 'desc',
|
||||||
@ -494,6 +494,7 @@ FormItem.Designer = function Designer() {
|
|||||||
field: {
|
field: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
enum: sortFields,
|
enum: sortFields,
|
||||||
|
required: true,
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'Select',
|
'x-component': 'Select',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
|
@ -158,6 +158,7 @@ export const DetailsDesigner = () => {
|
|||||||
field: {
|
field: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
enum: sortFields,
|
enum: sortFields,
|
||||||
|
required: true,
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'Select',
|
'x-component': 'Select',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
|
@ -155,6 +155,7 @@ export const GridCardDesigner = () => {
|
|||||||
field: {
|
field: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
enum: sortFields,
|
enum: sortFields,
|
||||||
|
required:true,
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'Select',
|
'x-component': 'Select',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
|
@ -29,7 +29,7 @@ export const TableBlockDesigner = () => {
|
|||||||
const defaultResource = fieldSchema?.['x-decorator-props']?.resource;
|
const defaultResource = fieldSchema?.['x-decorator-props']?.resource;
|
||||||
const supportTemplate = !fieldSchema?.['x-decorator-props']?.disableTemplate;
|
const supportTemplate = !fieldSchema?.['x-decorator-props']?.disableTemplate;
|
||||||
const sort = defaultSort?.map((item: string) => {
|
const sort = defaultSort?.map((item: string) => {
|
||||||
return item.startsWith('-')
|
return item?.startsWith('-')
|
||||||
? {
|
? {
|
||||||
field: item.substring(1),
|
field: item.substring(1),
|
||||||
direction: 'desc',
|
direction: 'desc',
|
||||||
@ -151,6 +151,7 @@ export const TableBlockDesigner = () => {
|
|||||||
field: {
|
field: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
enum: sortFields,
|
enum: sortFields,
|
||||||
|
required:true,
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'Select',
|
'x-component': 'Select',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
|
@ -133,6 +133,7 @@ export const TableSelectorDesigner = () => {
|
|||||||
field: {
|
field: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
enum: sortFields,
|
enum: sortFields,
|
||||||
|
required:true,
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'Select',
|
'x-component': 'Select',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
|
@ -107,6 +107,7 @@ export const TableVoidDesigner = () => {
|
|||||||
field: {
|
field: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
enum: sortFields,
|
enum: sortFields,
|
||||||
|
required:true,
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'Select',
|
'x-component': 'Select',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
|
@ -897,6 +897,7 @@ SchemaSettings.DefaultSortingRules = function DefaultSortingRules(props) {
|
|||||||
field: {
|
field: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
enum: sortFields,
|
enum: sortFields,
|
||||||
|
required:true,
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'Select',
|
'x-component': 'Select',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
|
Loading…
Reference in New Issue
Block a user