chore: 简单查询条件在crud中设置,而不是表单项中配置 (#6636)

This commit is contained in:
sansiro 2023-04-17 21:16:29 +08:00 committed by GitHub
parent 3c30eb5e55
commit 1b7f76bf6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 0 additions and 119 deletions

View File

@ -115,7 +115,6 @@ export class ButtonGroupControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
getSchemaTpl('multiple'),
getSchemaTpl('valueFormula', {
rendererSchema: context?.schema,

View File

@ -106,7 +106,6 @@ export class ChainedSelectControlPlugin extends BasePlugin {
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
getSchemaTpl('valueFormula', {
rendererSchema: context?.schema,
mode: 'vertical', // 改成上下展示模式

View File

@ -107,7 +107,6 @@ export class CheckboxControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
getSchemaTpl('option'),
{
type: 'ae-switch-more',

View File

@ -126,7 +126,6 @@ export class CheckboxesControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
[
getSchemaTpl('switch', {
label: '可全选',

View File

@ -105,7 +105,6 @@ export class CityControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
getSchemaTpl('valueFormula', {
rendererSchema: context?.schema,
rendererWrapper: true,

View File

@ -182,7 +182,6 @@ export class ColorControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
{
type: 'select',
label: '值格式',

View File

@ -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: (

View File

@ -306,7 +306,6 @@ export class DateRangeControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
getSchemaTpl('selectDateRangeType', {
value: this.scaffold.type,
onChange: (

View File

@ -146,10 +146,6 @@ export class NumberControlPlugin extends BasePlugin {
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {
context,
type: 'number'
}),
{
type: 'switch',
label: tipedLabel(

View File

@ -127,8 +127,6 @@ export class RangeControlPlugin extends BasePlugin {
label: 'Label'
}),
getSchemaTpl('crudFilterOperator', {context}),
{
label: '方式',
name: 'multiple',

View File

@ -105,7 +105,6 @@ export class RateControlPlugin extends BasePlugin {
label: 'Label'
}),
getSchemaTpl('crudFilterOperator', {context}),
getSchemaTpl('valueFormula', {
rendererSchema: {
...context?.schema,

View File

@ -142,7 +142,6 @@ export class TagControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
getSchemaTpl('clearable'),
getSchemaTpl('optionsTip'),
getSchemaTpl('valueFormula', {

View File

@ -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: (

View File

@ -284,7 +284,6 @@ export class TreeControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
{
type: 'button-group-select',
name: 'type',

View File

@ -109,7 +109,6 @@ export class ListControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
getSchemaTpl('multiple'),
getSchemaTpl('extractValue'),
getSchemaTpl('valueFormula', {

View File

@ -120,7 +120,6 @@ export class MatrixControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
getSchemaTpl('multiple', {
value: true
}),

View File

@ -208,7 +208,6 @@ export class NestedSelectControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
getSchemaTpl('clearable'),
{
type: 'ae-Switch-More',

View File

@ -112,7 +112,6 @@ export class PickerControlPlugin extends BasePlugin {
}),
getSchemaTpl('switchDefaultValue'),
getSchemaTpl('crudFilterOperator', {context}),
{
type: 'input-text',

View File

@ -121,7 +121,6 @@ export class RadiosControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
getSchemaTpl('valueFormula', {
rendererSchema: context?.schema,
useSelectMode: true, // 改用 Select 设置模式

View File

@ -221,7 +221,6 @@ export class SelectControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
getSchemaTpl('clearable'),
getSchemaTpl('searchable'),
getSchemaTpl('multiple', {

View File

@ -89,7 +89,6 @@ export class SwitchControlPlugin extends BasePlugin {
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
{
name: 'option',
type: 'input-text',

View File

@ -123,7 +123,6 @@ export class TextareaControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
getSchemaTpl('valueFormula', {
rendererSchema: context?.schema,
mode: 'vertical' // 改成上下展示模式

View File

@ -268,7 +268,6 @@ export class TreeSelectControlPlugin extends BasePlugin {
required: true
}),
getSchemaTpl('label'),
getSchemaTpl('crudFilterOperator', {context}),
{
type: 'button-group-select',
name: 'type',

View File

@ -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
};
}
);

View File

@ -6,7 +6,6 @@ import './api';
import './options';
import './validations';
import './style';
import './crudFilterOperator';
import './layout';
export * from './style';