From c393e7154fd547fa7da1dc21e716bac8598985ce Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Tue, 7 Jun 2022 11:08:49 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=A1=B9=E7=9B=AE=E8=AE=BE=E7=BD=AE):=20?= =?UTF-8?q?=E6=A8=A1=E7=89=88=E7=AE=A1=E7=90=86=E6=B7=BB=E5=8A=A0=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E9=A1=B5=E9=9D=A2=E8=BF=87=E6=BB=A4=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?i18n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1013777 --user=李玉号 【项目设置】模版管理 添加字段部分问题需要优化 https://www.tapd.cn/55049933/s/1174581 --- .../template/CustomFieldRelateList.vue | 16 +++++++++++++--- frontend/src/common/js/table-constants.js | 19 +++++++++++++++++++ 2 files changed, 32 insertions(+), 3 deletions(-) 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'},