From 784acdf4190aa36d8cf4e04b7d7cf3553042d15b Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Fri, 29 Jul 2022 17:29:47 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):?= =?UTF-8?q?=20=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AD=97=E6=AE=B5=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E9=80=89=E9=A1=B9=E8=A2=AB=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=88=99=E7=BD=AE=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1014996 --user=陈建星 修改了用例状态的选项,在用例模板已生效,但是创建用例的时候已经是旧的选项,正确的应该是草稿/非草稿 https://www.tapd.cn/55049933/s/1215779 --- .../project/template/CustomFiledComponent.vue | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/frontend/src/business/components/project/template/CustomFiledComponent.vue b/frontend/src/business/components/project/template/CustomFiledComponent.vue index e16f8214e3..efab602ad6 100644 --- a/frontend/src/business/components/project/template/CustomFiledComponent.vue +++ b/frontend/src/business/components/project/template/CustomFiledComponent.vue @@ -134,6 +134,27 @@ export default { }; }, mounted() { + if (['select', 'multipleSelect', 'checkbox', 'radio'].indexOf(this.data.type) > -1 && this.data.options) { + let values = this.data[this.prop]; + if (['multipleSelect', 'checkbox'].indexOf(this.data.type) > -1) { + if (values && values instanceof Array) { + for (let i = values.length - 1; i >= 0; i--) { + if (!this.data.options.find(item => item.value === values[i])) { + // 删除已删除的选项 + values.splice(i, 1); + } + } + } else { + // 不是数组类型,改成空数组 + this.data[this.prop] = []; + } + } else { + if (!this.data.options.find(item => item.value === values)) { + // 没有选项则清空 + this.data[this.prop] = ''; + } + } + } getProjectMemberOption((data) => { this.memberOptions = data; if (this.data.name === '责任人' && this.data.system && this.isTemplateEdit) {