fix(测试跟踪): 自定义字段用例等级改为必填

--bug=1024382 --user=宋昌昌 [BUG]测试跟踪,首页统计功能用例数量错误,新增用例之后,统计数据不更新 #22587 https://www.tapd.cn/55049933/s/1349881
This commit is contained in:
song-cc-rock 2023-03-14 18:59:34 +08:00 committed by jianxing
parent 0cfe076fc1
commit 4ee3ce2cab
4 changed files with 17 additions and 2 deletions

View File

@ -43,7 +43,7 @@
width="80" width="80"
prop="type"> prop="type">
<template v-slot="scope"> <template v-slot="scope">
<el-checkbox v-model="scope.row.required"/> <el-checkbox :disabled="scope.row.disabled" v-model="scope.row.required"/>
</template> </template>
</ms-table-column> </ms-table-column>

View File

@ -197,6 +197,9 @@ export default {
this.loading = getCustomFieldTemplates(condition).then((response) => { this.loading = getCustomFieldTemplates(condition).then((response) => {
this.relateFields = response.data; this.relateFields = response.data;
this.relateFields.forEach(item => { this.relateFields.forEach(item => {
if (item.name === '用例等级' && item.system) {
item.disabled = true;
}
if (item.options) { if (item.options) {
item.options = JSON.parse(item.options); item.options = JSON.parse(item.options);
} }
@ -221,6 +224,10 @@ export default {
this.loading = getCustomFieldDefault(condition).then((response) => { this.loading = getCustomFieldDefault(condition).then((response) => {
let data = response.data; let data = response.data;
data.forEach(item => { data.forEach(item => {
if (item.name === '用例等级' && item.system && item.scene === 'TEST_CASE') {
item.required = true;
item.disabled = true;
}
if (item.id) { if (item.id) {
this.templateContainIds.add(item.id); this.templateContainIds.add(item.id);
} }

View File

@ -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;

View File

@ -142,7 +142,7 @@
:fields-width="fieldsWidth" :fields-width="fieldsWidth"
:label="$t('commons.tag')" :label="$t('commons.tag')"
:show-overflow-tooltip="false" :show-overflow-tooltip="false"
min-width="80"> min-width="180">
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-tooltip class="item" effect="dark" placement="top"> <el-tooltip class="item" effect="dark" placement="top">
<div v-html="getTagToolTips(scope.row.tags)" slot="content"></div> <div v-html="getTagToolTips(scope.row.tags)" slot="content"></div>