diff --git a/packages/amis-editor/src/plugin/Form/ButtonGroupSelect.tsx b/packages/amis-editor/src/plugin/Form/ButtonGroupSelect.tsx index 7bfa655cf..5bad470ed 100644 --- a/packages/amis-editor/src/plugin/Form/ButtonGroupSelect.tsx +++ b/packages/amis-editor/src/plugin/Form/ButtonGroupSelect.tsx @@ -115,7 +115,6 @@ export class ButtonGroupControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), getSchemaTpl('multiple'), getSchemaTpl('valueFormula', { rendererSchema: context?.schema, diff --git a/packages/amis-editor/src/plugin/Form/ChainedSelect.tsx b/packages/amis-editor/src/plugin/Form/ChainedSelect.tsx index 3da52e570..8bd7b6cca 100644 --- a/packages/amis-editor/src/plugin/Form/ChainedSelect.tsx +++ b/packages/amis-editor/src/plugin/Form/ChainedSelect.tsx @@ -106,7 +106,6 @@ export class ChainedSelectControlPlugin extends BasePlugin { }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), getSchemaTpl('valueFormula', { rendererSchema: context?.schema, mode: 'vertical', // 改成上下展示模式 diff --git a/packages/amis-editor/src/plugin/Form/Checkbox.tsx b/packages/amis-editor/src/plugin/Form/Checkbox.tsx index a03b679c7..3aae41f9e 100644 --- a/packages/amis-editor/src/plugin/Form/Checkbox.tsx +++ b/packages/amis-editor/src/plugin/Form/Checkbox.tsx @@ -107,7 +107,6 @@ export class CheckboxControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), getSchemaTpl('option'), { type: 'ae-switch-more', diff --git a/packages/amis-editor/src/plugin/Form/Checkboxes.tsx b/packages/amis-editor/src/plugin/Form/Checkboxes.tsx index 11f7d8bd4..3f636b135 100644 --- a/packages/amis-editor/src/plugin/Form/Checkboxes.tsx +++ b/packages/amis-editor/src/plugin/Form/Checkboxes.tsx @@ -126,7 +126,6 @@ export class CheckboxesControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), [ getSchemaTpl('switch', { label: '可全选', diff --git a/packages/amis-editor/src/plugin/Form/InputCity.tsx b/packages/amis-editor/src/plugin/Form/InputCity.tsx index 6a29df833..410df46c2 100644 --- a/packages/amis-editor/src/plugin/Form/InputCity.tsx +++ b/packages/amis-editor/src/plugin/Form/InputCity.tsx @@ -105,7 +105,6 @@ export class CityControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), getSchemaTpl('valueFormula', { rendererSchema: context?.schema, rendererWrapper: true, diff --git a/packages/amis-editor/src/plugin/Form/InputColor.tsx b/packages/amis-editor/src/plugin/Form/InputColor.tsx index 7298729a0..6fd2d187a 100644 --- a/packages/amis-editor/src/plugin/Form/InputColor.tsx +++ b/packages/amis-editor/src/plugin/Form/InputColor.tsx @@ -182,7 +182,6 @@ export class ColorControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), { type: 'select', label: '值格式', diff --git a/packages/amis-editor/src/plugin/Form/InputDate.tsx b/packages/amis-editor/src/plugin/Form/InputDate.tsx index 98f17d58f..9f76be766 100644 --- a/packages/amis-editor/src/plugin/Form/InputDate.tsx +++ b/packages/amis-editor/src/plugin/Form/InputDate.tsx @@ -267,10 +267,6 @@ export class DateControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', { - context, - type: 'date' - }), getSchemaTpl('selectDateType', { value: this.scaffold.type, onChange: ( diff --git a/packages/amis-editor/src/plugin/Form/InputDateRange.tsx b/packages/amis-editor/src/plugin/Form/InputDateRange.tsx index 5ecce03d2..ceb84671f 100644 --- a/packages/amis-editor/src/plugin/Form/InputDateRange.tsx +++ b/packages/amis-editor/src/plugin/Form/InputDateRange.tsx @@ -306,7 +306,6 @@ export class DateRangeControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), getSchemaTpl('selectDateRangeType', { value: this.scaffold.type, onChange: ( diff --git a/packages/amis-editor/src/plugin/Form/InputNumber.tsx b/packages/amis-editor/src/plugin/Form/InputNumber.tsx index b88b30c94..704498f0d 100644 --- a/packages/amis-editor/src/plugin/Form/InputNumber.tsx +++ b/packages/amis-editor/src/plugin/Form/InputNumber.tsx @@ -146,10 +146,6 @@ export class NumberControlPlugin extends BasePlugin { }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', { - context, - type: 'number' - }), { type: 'switch', label: tipedLabel( diff --git a/packages/amis-editor/src/plugin/Form/InputRange.tsx b/packages/amis-editor/src/plugin/Form/InputRange.tsx index 918d98c01..7b1313cdd 100644 --- a/packages/amis-editor/src/plugin/Form/InputRange.tsx +++ b/packages/amis-editor/src/plugin/Form/InputRange.tsx @@ -127,8 +127,6 @@ export class RangeControlPlugin extends BasePlugin { label: 'Label' }), - getSchemaTpl('crudFilterOperator', {context}), - { label: '方式', name: 'multiple', diff --git a/packages/amis-editor/src/plugin/Form/InputRating.tsx b/packages/amis-editor/src/plugin/Form/InputRating.tsx index 4fbca03e4..99765b402 100644 --- a/packages/amis-editor/src/plugin/Form/InputRating.tsx +++ b/packages/amis-editor/src/plugin/Form/InputRating.tsx @@ -105,7 +105,6 @@ export class RateControlPlugin extends BasePlugin { label: 'Label' }), - getSchemaTpl('crudFilterOperator', {context}), getSchemaTpl('valueFormula', { rendererSchema: { ...context?.schema, diff --git a/packages/amis-editor/src/plugin/Form/InputTag.tsx b/packages/amis-editor/src/plugin/Form/InputTag.tsx index 28e005491..235a2676d 100644 --- a/packages/amis-editor/src/plugin/Form/InputTag.tsx +++ b/packages/amis-editor/src/plugin/Form/InputTag.tsx @@ -142,7 +142,6 @@ export class TagControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), getSchemaTpl('clearable'), getSchemaTpl('optionsTip'), getSchemaTpl('valueFormula', { diff --git a/packages/amis-editor/src/plugin/Form/InputText.tsx b/packages/amis-editor/src/plugin/Form/InputText.tsx index 427c93b18..f7edbb44d 100644 --- a/packages/amis-editor/src/plugin/Form/InputText.tsx +++ b/packages/amis-editor/src/plugin/Form/InputText.tsx @@ -169,7 +169,6 @@ export class TextControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context, type: 'text'}), getSchemaTpl('inputType', { value: this.scaffold.type, onChange: ( diff --git a/packages/amis-editor/src/plugin/Form/InputTree.tsx b/packages/amis-editor/src/plugin/Form/InputTree.tsx index 665c84306..2781311cd 100644 --- a/packages/amis-editor/src/plugin/Form/InputTree.tsx +++ b/packages/amis-editor/src/plugin/Form/InputTree.tsx @@ -284,7 +284,6 @@ export class TreeControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), { type: 'button-group-select', name: 'type', diff --git a/packages/amis-editor/src/plugin/Form/ListSelect.tsx b/packages/amis-editor/src/plugin/Form/ListSelect.tsx index d271d3955..d7ec4b4a8 100644 --- a/packages/amis-editor/src/plugin/Form/ListSelect.tsx +++ b/packages/amis-editor/src/plugin/Form/ListSelect.tsx @@ -109,7 +109,6 @@ export class ListControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), getSchemaTpl('multiple'), getSchemaTpl('extractValue'), getSchemaTpl('valueFormula', { diff --git a/packages/amis-editor/src/plugin/Form/MatrixCheckboxes.tsx b/packages/amis-editor/src/plugin/Form/MatrixCheckboxes.tsx index 1c1768587..98cca7001 100644 --- a/packages/amis-editor/src/plugin/Form/MatrixCheckboxes.tsx +++ b/packages/amis-editor/src/plugin/Form/MatrixCheckboxes.tsx @@ -120,7 +120,6 @@ export class MatrixControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), getSchemaTpl('multiple', { value: true }), diff --git a/packages/amis-editor/src/plugin/Form/NestedSelect.tsx b/packages/amis-editor/src/plugin/Form/NestedSelect.tsx index 022364313..26bd584dc 100644 --- a/packages/amis-editor/src/plugin/Form/NestedSelect.tsx +++ b/packages/amis-editor/src/plugin/Form/NestedSelect.tsx @@ -208,7 +208,6 @@ export class NestedSelectControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), getSchemaTpl('clearable'), { type: 'ae-Switch-More', diff --git a/packages/amis-editor/src/plugin/Form/Picker.tsx b/packages/amis-editor/src/plugin/Form/Picker.tsx index f8166bc10..b67444b88 100644 --- a/packages/amis-editor/src/plugin/Form/Picker.tsx +++ b/packages/amis-editor/src/plugin/Form/Picker.tsx @@ -112,7 +112,6 @@ export class PickerControlPlugin extends BasePlugin { }), getSchemaTpl('switchDefaultValue'), - getSchemaTpl('crudFilterOperator', {context}), { type: 'input-text', diff --git a/packages/amis-editor/src/plugin/Form/Radios.tsx b/packages/amis-editor/src/plugin/Form/Radios.tsx index 0b2c8c3cb..a87244ec6 100644 --- a/packages/amis-editor/src/plugin/Form/Radios.tsx +++ b/packages/amis-editor/src/plugin/Form/Radios.tsx @@ -121,7 +121,6 @@ export class RadiosControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), getSchemaTpl('valueFormula', { rendererSchema: context?.schema, useSelectMode: true, // 改用 Select 设置模式 diff --git a/packages/amis-editor/src/plugin/Form/Select.tsx b/packages/amis-editor/src/plugin/Form/Select.tsx index bc5001fc2..082d50823 100644 --- a/packages/amis-editor/src/plugin/Form/Select.tsx +++ b/packages/amis-editor/src/plugin/Form/Select.tsx @@ -221,7 +221,6 @@ export class SelectControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), getSchemaTpl('clearable'), getSchemaTpl('searchable'), getSchemaTpl('multiple', { diff --git a/packages/amis-editor/src/plugin/Form/Switch.tsx b/packages/amis-editor/src/plugin/Form/Switch.tsx index 351c09baa..26c35159e 100644 --- a/packages/amis-editor/src/plugin/Form/Switch.tsx +++ b/packages/amis-editor/src/plugin/Form/Switch.tsx @@ -89,7 +89,6 @@ export class SwitchControlPlugin extends BasePlugin { }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), { name: 'option', type: 'input-text', diff --git a/packages/amis-editor/src/plugin/Form/Textarea.tsx b/packages/amis-editor/src/plugin/Form/Textarea.tsx index 64b99065a..945e4eba3 100644 --- a/packages/amis-editor/src/plugin/Form/Textarea.tsx +++ b/packages/amis-editor/src/plugin/Form/Textarea.tsx @@ -123,7 +123,6 @@ export class TextareaControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), getSchemaTpl('valueFormula', { rendererSchema: context?.schema, mode: 'vertical' // 改成上下展示模式 diff --git a/packages/amis-editor/src/plugin/Form/TreeSelect.tsx b/packages/amis-editor/src/plugin/Form/TreeSelect.tsx index 4584fe418..d507f28f7 100644 --- a/packages/amis-editor/src/plugin/Form/TreeSelect.tsx +++ b/packages/amis-editor/src/plugin/Form/TreeSelect.tsx @@ -268,7 +268,6 @@ export class TreeSelectControlPlugin extends BasePlugin { required: true }), getSchemaTpl('label'), - getSchemaTpl('crudFilterOperator', {context}), { type: 'button-group-select', name: 'type', diff --git a/packages/amis-editor/src/tpl/crudFilterOperator.tsx b/packages/amis-editor/src/tpl/crudFilterOperator.tsx deleted file mode 100644 index 24b346b01..000000000 --- a/packages/amis-editor/src/tpl/crudFilterOperator.tsx +++ /dev/null @@ -1,88 +0,0 @@ -import { - setSchemaTpl, - getSchemaTpl, - tipedLabel, - BaseEventContext, - defaultValue -} from 'amis-editor-core'; - -const filters = { - text: [ - { - label: '模糊匹配', - value: 'like' - }, - { - label: '不匹配', - value: 'not_like' - }, - { - label: '匹配开头', - value: 'starts_with' - }, - { - label: '匹配结尾', - value: 'ends_with' - } - ], - number: [ - { - label: '小于', - value: 'less' - }, - { - label: '小于或等于', - value: 'less_or_equal' - }, - { - label: '大于', - value: 'greater' - }, - { - label: '大于或等于', - value: 'greater_or_equal' - } - ] - // time: [] -}; - -setSchemaTpl( - 'crudFilterOperator', - (props: {context: BaseEventContext; type: string}) => { - const {context, type = 'all'} = props; - - const isInCrudFilter = context?.node?.path?.includes('crud2/filter'); - - const addFilters = - type === 'all' - ? [...filters.number, ...filters.text] - : filters[type === 'text' ? 'text' : 'number']; - - return { - label: '匹配规则', - type: 'select', - name: 'filterOp', - options: [ - { - label: '等于', - value: 'equal' - }, - { - label: '不等于', - value: 'not_equal' - }, - ...addFilters, - { - label: '为空', - value: 'is_empty' - }, - { - label: '不为空', - value: 'is_not_empty' - } - ], - pipeIn: defaultValue('equal'), - visible: isInCrudFilter - }; - } -); diff --git a/packages/amis-editor/src/tpl/index.tsx b/packages/amis-editor/src/tpl/index.tsx index 691ea8cd5..e9b971171 100644 --- a/packages/amis-editor/src/tpl/index.tsx +++ b/packages/amis-editor/src/tpl/index.tsx @@ -6,7 +6,6 @@ import './api'; import './options'; import './validations'; import './style'; -import './crudFilterOperator'; import './layout'; export * from './style';