diff --git a/frontend/src/business/components/project/template/CustomFieldRelateList.vue b/frontend/src/business/components/project/template/CustomFieldRelateList.vue index c0ab757b17..865f80ff22 100644 --- a/frontend/src/business/components/project/template/CustomFieldRelateList.vue +++ b/frontend/src/business/components/project/template/CustomFieldRelateList.vue @@ -8,7 +8,7 @@ ref="msEditDialog"> @@ -100,7 +100,11 @@ import MsTableColumn from "@/business/components/common/components/table/MsTable import {CUSTOM_FIELD_LIST} from "@/common/js/default-table-header"; import MsTableButton from "@/business/components/common/components/MsTableButton"; import MsTablePagination from "@/business/components/common/pagination/TablePagination"; -import {CUSTOM_FIELD_TYPE_OPTION, FIELD_TYPE_MAP, SYSTEM_FIELD_NAME_MAP} from "@/common/js/table-constants"; +import { + CUSTOM_FIELD_TYPE_FILTERS, + FIELD_TYPE_MAP, + SYSTEM_FIELD_NAME_MAP +} from "@/common/js/table-constants"; import MsTableHeader from "@/business/components/common/components/MsTableHeader"; import MsEditDialog from "@/business/components/common/components/MsEditDialog"; @@ -131,7 +135,7 @@ export default { return CUSTOM_FIELD_LIST; }, fieldFilters() { - return CUSTOM_FIELD_TYPE_OPTION; + return CUSTOM_FIELD_TYPE_FILTERS(this); }, fieldTypeMap() { return FIELD_TYPE_MAP; @@ -141,6 +145,12 @@ export default { } }, methods: { + search() { + if (!(this.condition.name.trim())) { + this.currentPage = 1; + } + this.initTableData(); + }, initTableData() { this.condition.projectId = getCurrentProjectID(); this.condition.templateId = this.templateId; diff --git a/frontend/src/common/js/table-constants.js b/frontend/src/common/js/table-constants.js index 740b9e6e0d..89a7dda4b9 100644 --- a/frontend/src/common/js/table-constants.js +++ b/frontend/src/common/js/table-constants.js @@ -19,6 +19,25 @@ export const CUSTOM_FIELD_TYPE_OPTION = [ {value: 'multipleInput',text: 'workspace.custom_filed.multipleInput'} ]; +export function CUSTOM_FIELD_TYPE_FILTERS(_this) { + return [ + {value: 'input', text: _this.$t('workspace.custom_filed.input')}, + {value: 'textarea', text: _this.$t('workspace.custom_filed.textarea')}, + {value: 'select', text: _this.$t('workspace.custom_filed.select')}, + {value: 'multipleSelect', text: _this.$t('workspace.custom_filed.multipleSelect')}, + {value: 'radio', text: _this.$t('workspace.custom_filed.radio')}, + {value: 'checkbox', text: _this.$t('workspace.custom_filed.checkbox')}, + {value: 'member', text: _this.$t('workspace.custom_filed.member')}, + {value: 'multipleMember', text: _this.$t('workspace.custom_filed.multipleMember')}, + {value: 'date', text: _this.$t('workspace.custom_filed.date')}, + {value: 'datetime', text: _this.$t('workspace.custom_filed.datetime')}, + {value: 'richText', text: _this.$t('workspace.custom_filed.richText')}, + {value: 'int', text: _this.$t('workspace.custom_filed.int')}, + {value: 'float', text: _this.$t('workspace.custom_filed.float')}, + {value: 'multipleInput', text: _this.$t('workspace.custom_filed.multipleInput')} + ]; +} + export const UI_ELEMENT_LOCATION_TYPE_OPTION = [ {value: 'id', text: 'id'}, {value: 'name', text: 'name'},