finish join/mapping

This commit is contained in:
2025-01-26 01:11:38 +08:00
parent 662b18548f
commit 62ec4b84fc
9 changed files with 178 additions and 179 deletions

View File

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