From 7ff77b7929c95321dfcea100571ba8f9643d6f55 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Tue, 14 Mar 2023 19:32:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E5=A4=84=E7=90=86=E7=BC=BA=E9=99=B7=E8=BF=9C=E7=A8=8B=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E5=AD=97=E6=AE=B5=E5=9B=9E=E6=98=BE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/template/CustomFiledComponent.vue | 8 ++++++++ framework/sdk-parent/frontend/src/utils/custom_field.js | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/framework/sdk-parent/frontend/src/components/template/CustomFiledComponent.vue b/framework/sdk-parent/frontend/src/components/template/CustomFiledComponent.vue index 1b5718de25..c75d65f225 100644 --- a/framework/sdk-parent/frontend/src/components/template/CustomFiledComponent.vue +++ b/framework/sdk-parent/frontend/src/components/template/CustomFiledComponent.vue @@ -151,6 +151,7 @@ import MsTableColumn from "../table/MsTableColumn"; import MsInputTag from "../MsInputTag"; import {getProjectMemberOption} from "../../api/user"; import MsMarkDownText from "metersphere-frontend/src/components/MsMarkDownText"; +import {OPTION_LABEL_PREFIX} from "../../utils/tableUtils"; export default { name: "CustomFiledComponent", @@ -222,6 +223,13 @@ export default { } this.$emit('change', this.data.name); this.$forceUpdate(); + if (this.data.inputSearch) { + // 处理 jira 的 sprint 字段 + let selectOption = this.data.options.find(item => item.value === this.data[this.prop]); + if (selectOption) { + this.data.optionLabel = OPTION_LABEL_PREFIX + selectOption.text; + } + } }, handleSelectInput(val) { this.loading = true; diff --git a/framework/sdk-parent/frontend/src/utils/custom_field.js b/framework/sdk-parent/frontend/src/utils/custom_field.js index 64c1247f11..d84b396484 100644 --- a/framework/sdk-parent/frontend/src/utils/custom_field.js +++ b/framework/sdk-parent/frontend/src/utils/custom_field.js @@ -138,6 +138,10 @@ export function buildCustomFields(data, param, template) { customField["value"] = item.defaultValue ? JSON.stringify(item.defaultValue) : ""; + // 处理 jira 的 sprint 字段 + if (item.optionLabel) { + customField["textValue"] = item.optionLabel; + } } if (item.isEdit) { editFields.push(customField);