finish join/mapping
This commit is contained in:
@@ -11,14 +11,12 @@ type ConditionItem = {
|
||||
value: ConditionValue;
|
||||
label: string;
|
||||
type: ComponentType;
|
||||
func: (a: string, b: string) => boolean;
|
||||
};
|
||||
|
||||
export const conditionList: ConditionItem[] = [
|
||||
{ value: '', label: '--------', type: '', func: (a: string, b: string) => true },
|
||||
{ value: 'eq', label: '=(等しい)', type: 'input', func: (a: string, b: string) => a === b },
|
||||
{ value: 'ne', label: '≠ (等しくない)', type: 'input', func: (a: string, b: string) => a !== b },
|
||||
{ value: 'test', label: 'test combobox', type: 'select', func: (a: string, b: string) => a < b },
|
||||
{ value: 'eq', label: '=(等しい)', type: 'input' },
|
||||
{ value: 'ne', label: '≠ (等しくない)', type: 'input' },
|
||||
{ value: 'test', label: 'test combobox', type: 'select' },
|
||||
];
|
||||
|
||||
// search from conditionList
|
||||
@@ -42,9 +40,9 @@ const fieldConditions: FieldConditions = {
|
||||
// fieldCode -> conditionList: ConditionItem[]
|
||||
export const getAvailableCondition = (fieldCode: string, fieldsInfo: FieldsInfo, subTableCode: string | '') => {
|
||||
if (!fieldCode || !fieldsInfo.fields) return;
|
||||
const fieldObj = getFieldObj(fieldCode, fieldsInfo, subTableCode);
|
||||
const fieldObj = getFieldObj(fieldCode, fieldsInfo, '');
|
||||
if (!fieldObj) return;
|
||||
const conditions = fieldConditions[fieldObj.type] || [];
|
||||
const conditions = fieldConditions[fieldObj.type] || ['eq']; // TODO a mock here
|
||||
return conditions.map((condition) => conditionMap[condition]);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user