diff --git a/frontend/src/assets/style/arco-reset.less b/frontend/src/assets/style/arco-reset.less index 99019f32e4..27facda512 100644 --- a/frontend/src/assets/style/arco-reset.less +++ b/frontend/src/assets/style/arco-reset.less @@ -248,6 +248,8 @@ .btn-outline-sec-hover(); .btn-outline-sec-active(); .btn-outline-sec-disabled(); + + border-color: var(--color-text-n8) !important; } .arco-btn-outline--danger { .btn-outline-danger-default(); diff --git a/frontend/src/components/pure/ms-advance-filter/FilterForm.vue b/frontend/src/components/pure/ms-advance-filter/FilterForm.vue deleted file mode 100644 index 27baae4f90..0000000000 --- a/frontend/src/components/pure/ms-advance-filter/FilterForm.vue +++ /dev/null @@ -1,415 +0,0 @@ - - - - - diff --git a/frontend/src/components/pure/ms-advance-filter/filterDrawer.vue b/frontend/src/components/pure/ms-advance-filter/filterDrawer.vue new file mode 100644 index 0000000000..c01a955abf --- /dev/null +++ b/frontend/src/components/pure/ms-advance-filter/filterDrawer.vue @@ -0,0 +1,315 @@ + + + + + diff --git a/frontend/src/components/pure/ms-advance-filter/index.ts b/frontend/src/components/pure/ms-advance-filter/index.ts index 041c1854dd..01cb5f8b01 100644 --- a/frontend/src/components/pure/ms-advance-filter/index.ts +++ b/frontend/src/components/pure/ms-advance-filter/index.ts @@ -1,35 +1,43 @@ -export { default as FilterForm } from './FilterForm.vue'; +import { BackEndEnum, FilterType } from './type'; + export { default as MsAdvanceFilter } from './index.vue'; -// const IN = { label: 'advanceFilter.operator.in', value: 'in' }; -// const NOT_IN = { label: 'advanceFilter.operator.not_in', value: 'not_in' }; -export const LIKE = { label: 'advanceFilter.operator.like', value: 'like' }; -export const NOT_LIKE = { label: 'advanceFilter.operator.not_like', value: 'not_like' }; -export const GT = { label: 'advanceFilter.operator.gt', value: 'GT' }; -export const GE = { label: 'advanceFilter.operator.ge', value: 'GT_OR_EQUALS' }; -export const LT = { label: 'advanceFilter.operator.lt', value: 'LT' }; -export const LE = { label: 'advanceFilter.operator.le', value: 'LT_OR_EQUALS' }; -export const EQUAL = { label: 'advanceFilter.operator.equal', value: 'EQUALS' }; -export const NOT_EQUAL = { label: 'advanceFilter.operator.notEqual', value: 'NOT_EQUALS' }; -export const BETWEEN = { label: 'advanceFilter.operator.between', value: 'between' }; -export const NO_CHECK = { label: 'advanceFilter.operator.no_check', value: 'UNCHECK' }; -export const CONTAINS = { label: 'advanceFilter.operator.contains', value: 'CONTAINS' }; -export const NO_CONTAINS = { label: 'advanceFilter.operator.not_contains', value: 'NOT_CONTAINS' }; -export const START_WITH = { label: 'advanceFilter.operator.start_with', value: 'START_WITH' }; -export const END_WITH = { label: 'advanceFilter.operator.end_with', value: 'END_WITH' }; -export const EMPTY = { label: 'advanceFilter.operator.empty', value: 'EMPTY' }; -export const NOT_EMPTY = { label: 'advanceFilter.operator.not_empty', value: 'NOT_EMPTY' }; -export const REGEX = { label: 'advanceFilter.operator.regexp', value: 'REGEX' }; -export const LENGTH_EQUAL = { label: 'advanceFilter.operator.length.equal', value: 'LENGTH_EQUALS' }; -export const LENGTH_GT = { label: 'advanceFilter.operator.length.gt', value: 'LENGTH_GT' }; -export const LENGTH_GE = { label: 'advanceFilter.operator.length.ge', value: 'LENGTH_GT_OR_EQUALS' }; -export const LENGTH_LT = { label: 'advanceFilter.operator.length.lt', value: 'LENGTH_LT' }; -export const LENGTH_LE = { label: 'advanceFilter.operator.length.le', value: 'LENGTH_LT_OR_EQUALS' }; -export const OPERATOR_MAP = { - string: [LIKE, NOT_LIKE, EQUAL, NOT_EQUAL], - number: [GT, GE, LT, LE, EQUAL, NOT_EQUAL, BETWEEN], - date: [GT, GE, LT, LE, EQUAL, NOT_EQUAL, BETWEEN], - array: [BETWEEN], +export const LIKE = { label: 'advanceFilter.operator.contains', value: 'like' }; // 包含 +export const NOT_LIKE = { label: 'advanceFilter.operator.not_contains', value: 'not_like' }; // 不包含 +export const GT = { label: 'advanceFilter.operator.gt', value: 'GT' }; // 大于 +export const GE = { label: 'advanceFilter.operator.ge', value: 'GT_OR_EQUALS' }; // 大于等于 +export const LT = { label: 'advanceFilter.operator.lt', value: 'LT' }; // 小于 +export const LE = { label: 'advanceFilter.operator.le', value: 'LT_OR_EQUALS' }; // 小于等于 +export const EQUAL = { label: 'advanceFilter.operator.equal', value: 'EQUALS' }; // 等于 +export const NOT_EQUAL = { label: 'advanceFilter.operator.notEqual', value: 'NOT_EQUALS' }; // 不等于 +export const BETWEEN = { label: 'advanceFilter.operator.between', value: 'between' }; // 介于 +export const NO_CHECK = { label: 'advanceFilter.operator.no_check', value: 'UNCHECK' }; // 不校验 +export const CONTAINS = { label: 'advanceFilter.operator.contains', value: 'CONTAINS' }; // 包含 +export const NO_CONTAINS = { label: 'advanceFilter.operator.not_contains', value: 'NOT_CONTAINS' }; // 不包含 +export const START_WITH = { label: 'advanceFilter.operator.start_with', value: 'START_WITH' }; // 以...开始 +export const END_WITH = { label: 'advanceFilter.operator.end_with', value: 'END_WITH' }; // 以...结束 +export const EMPTY = { label: 'advanceFilter.operator.empty', value: 'EMPTY' }; // 为空 +export const NOT_EMPTY = { label: 'advanceFilter.operator.not_empty', value: 'NOT_EMPTY' }; // 不为空 +export const REGEX = { label: 'advanceFilter.operator.regexp', value: 'REGEX' }; // 正则匹配 +export const LENGTH_EQUAL = { label: 'advanceFilter.operator.length.equal', value: 'LENGTH_EQUALS' }; // 长度等于 +export const LENGTH_GT = { label: 'advanceFilter.operator.length.gt', value: 'LENGTH_GT' }; // 长度大于 +export const LENGTH_GE = { label: 'advanceFilter.operator.length.ge', value: 'LENGTH_GT_OR_EQUALS' }; // 长度大于等于 +export const LENGTH_LT = { label: 'advanceFilter.operator.length.lt', value: 'LENGTH_LT' }; // 长度小于 +export const LENGTH_LE = { label: 'advanceFilter.operator.length.le', value: 'LENGTH_LT_OR_EQUALS' }; // 长度小于等于 + +const COMMON_TEXT_OPERATORS = [LIKE, NOT_LIKE, EMPTY, NOT_EMPTY, EQUAL, NOT_EQUAL]; +const COMMON_SELECTION_OPERATORS = [LIKE, NOT_LIKE, EMPTY, NOT_EMPTY]; + +export const operatorOptionsMap: Record = { + [FilterType.INPUT]: COMMON_TEXT_OPERATORS, + [FilterType.TEXTAREA]: COMMON_TEXT_OPERATORS, + [FilterType.NUMBER]: [GT, LT, EQUAL, EMPTY, NOT_EMPTY], + [FilterType.RADIO]: COMMON_SELECTION_OPERATORS, + [FilterType.CHECKBOX]: COMMON_SELECTION_OPERATORS, + [FilterType.SELECT]: COMMON_SELECTION_OPERATORS, + [FilterType.TAGS_INPUT]: [EMPTY, LIKE, NOT_LIKE, LENGTH_LT, LENGTH_GT], + [FilterType.TREE_SELECT]: [LIKE, NOT_LIKE], + [FilterType.DATE_PICKER]: [BETWEEN, EQUAL, EMPTY, NOT_EMPTY], }; export const timeSelectOptions = [GE, LE]; @@ -155,8 +163,29 @@ export const CustomTypeMaps: Record = { }, }; -export const MULTIPLE_OPERATOR_LIST = ['between']; - -export function isMutipleOperator(operator: string) { - return MULTIPLE_OPERATOR_LIST.includes(operator); -} +export const defaultFormModelList = [ + { + dataIndex: 'id', + title: 'caseManagement.featureCase.tableColumnID', + type: FilterType.INPUT, + operator: '', + value: '', + backendType: BackEndEnum.STRING, + }, + { + dataIndex: 'name', + label: 'common.name', + type: FilterType.INPUT, + operator: '', + value: '', + backendType: BackEndEnum.STRING, + }, + { + dataIndex: 'moduleId', + label: 'common.belongModule', + type: FilterType.TREE_SELECT, + operator: '', + value: '', + backendType: BackEndEnum.STRING, + }, +]; diff --git a/frontend/src/components/pure/ms-advance-filter/index.vue b/frontend/src/components/pure/ms-advance-filter/index.vue index 510317cfa5..fec961c27f 100644 --- a/frontend/src/components/pure/ms-advance-filter/index.vue +++ b/frontend/src/components/pure/ms-advance-filter/index.vue @@ -31,22 +31,20 @@ @search="emit('keywordSearch', keyword, filterResult)" @clear="handleClear" > - + + {{ t('common.filter') }} + -