From 41195e24a7f94b42cf4cba04c26df07ccab1ac8c Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Tue, 14 Mar 2023 18:59:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E5=AD=97=E6=AE=B5=E7=94=A8=E4=BE=8B?= =?UTF-8?q?=E7=AD=89=E7=BA=A7=E6=94=B9=E4=B8=BA=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1024382 --user=宋昌昌 [BUG]测试跟踪,首页统计功能用例数量错误,新增用例之后,统计数据不更新 #22587 https://www.tapd.cn/55049933/s/1349881 --- .../src/business/menu/template/CustomFieldFormList.vue | 2 +- .../src/business/menu/template/FieldTemplateEdit.vue | 7 +++++++ ...10_1__edit_custom_field_test_case_priority_require.sql | 8 ++++++++ .../case/components/public/PublicTestCaseList.vue | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 test-track/backend/src/main/resources/db/migration/2.8.0/dml/V10_1__edit_custom_field_test_case_priority_require.sql diff --git a/project-management/frontend/src/business/menu/template/CustomFieldFormList.vue b/project-management/frontend/src/business/menu/template/CustomFieldFormList.vue index 6812253d5d..b4e8b65e6c 100644 --- a/project-management/frontend/src/business/menu/template/CustomFieldFormList.vue +++ b/project-management/frontend/src/business/menu/template/CustomFieldFormList.vue @@ -43,7 +43,7 @@ width="80" prop="type"> diff --git a/project-management/frontend/src/business/menu/template/FieldTemplateEdit.vue b/project-management/frontend/src/business/menu/template/FieldTemplateEdit.vue index fae66b2f13..68aebdadf7 100644 --- a/project-management/frontend/src/business/menu/template/FieldTemplateEdit.vue +++ b/project-management/frontend/src/business/menu/template/FieldTemplateEdit.vue @@ -197,6 +197,9 @@ export default { this.loading = getCustomFieldTemplates(condition).then((response) => { this.relateFields = response.data; this.relateFields.forEach(item => { + if (item.name === '用例等级' && item.system) { + item.disabled = true; + } if (item.options) { item.options = JSON.parse(item.options); } @@ -221,6 +224,10 @@ export default { this.loading = getCustomFieldDefault(condition).then((response) => { let data = response.data; data.forEach(item => { + if (item.name === '用例等级' && item.system && item.scene === 'TEST_CASE') { + item.required = true; + item.disabled = true; + } if (item.id) { this.templateContainIds.add(item.id); } diff --git a/test-track/backend/src/main/resources/db/migration/2.8.0/dml/V10_1__edit_custom_field_test_case_priority_require.sql b/test-track/backend/src/main/resources/db/migration/2.8.0/dml/V10_1__edit_custom_field_test_case_priority_require.sql new file mode 100644 index 0000000000..6b7b0201fb --- /dev/null +++ b/test-track/backend/src/main/resources/db/migration/2.8.0/dml/V10_1__edit_custom_field_test_case_priority_require.sql @@ -0,0 +1,8 @@ +SET SESSION innodb_lock_wait_timeout = 7200; + +-- 修改自定义字段用例等级为必填字段 +UPDATE custom_field_template SET required = 1 WHERE field_id IN ( + SELECT id FROM custom_field WHERE scene = 'TEST_CASE' AND name = '用例等级' AND `system` is true +); + +SET SESSION innodb_lock_wait_timeout = DEFAULT; diff --git a/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue b/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue index 5dcd313685..59295b6d98 100644 --- a/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue +++ b/test-track/frontend/src/business/case/components/public/PublicTestCaseList.vue @@ -142,7 +142,7 @@ :fields-width="fieldsWidth" :label="$t('commons.tag')" :show-overflow-tooltip="false" - min-width="80"> + min-width="180">