fix(接口测试): 修复场景批量操作步骤显示选中项不准确的缺陷

--bug=1024993 --user=王孝刚 【接口测试】github#23298,接口参加批量操作选中后显示选中数不正确
https://www.tapd.cn/55049933/s/1358172
This commit is contained in:
wxg0103 2023-03-31 14:59:23 +08:00 committed by wxg0103
parent e651e8ed30
commit b5c075edae
2 changed files with 12 additions and 13 deletions

View File

@ -281,7 +281,6 @@
:empty-text="$t('api_test.scenario.step_info')" :empty-text="$t('api_test.scenario.step_info')"
highlight-current highlight-current
:show-checkbox="isBatchProcess" :show-checkbox="isBatchProcess"
@check-change="chooseHeadsUp"
@node-drag-end="nodeDragEnd" @node-drag-end="nodeDragEnd"
@node-click="nodeClick" @node-click="nodeClick"
draggable draggable
@ -315,8 +314,8 @@
<show-more-btn <show-more-btn
:is-show="node.checked" :is-show="node.checked"
:buttons="batchOperators" :buttons="batchOperators"
:size="selectDataCounts"
v-show="data.checkBox" v-show="data.checkBox"
:show-size="false"
style="margin-right: 10px" /> style="margin-right: 10px" />
</span> </span>
<span style="width: calc(100% - 40px)"> <span style="width: calc(100% - 40px)">
@ -760,27 +759,27 @@ export default {
{ {
name: this.$t('api_test.automation.bulk_activation_steps'), name: this.$t('api_test.automation.bulk_activation_steps'),
handleClick: this.enableAll, handleClick: this.enableAll,
permissions: ['PROJECT_API_SCENARIO:READ+DELETE'], permissions: ['PROJECT_API_SCENARIO:READ+EDIT'],
}, },
{ {
name: this.$t('api_test.automation.batch_disable_steps'), name: this.$t('api_test.automation.batch_disable_steps'),
handleClick: this.disableAll, handleClick: this.disableAll,
permissions: ['PROJECT_API_SCENARIO:READ+DELETE'], permissions: ['PROJECT_API_SCENARIO:READ+EDIT'],
}, },
{ {
name: this.$t('api_test.automation.open_expansion'), name: this.$t('api_test.automation.open_expansion'),
handleClick: this.openExpansion, handleClick: this.openExpansion,
permissions: ['PROJECT_API_SCENARIO:READ+DELETE'], permissions: ['PROJECT_API_SCENARIO:READ+EDIT'],
}, },
{ {
name: this.$t('api_test.automation.close_expansion'), name: this.$t('api_test.automation.close_expansion'),
handleClick: this.closeExpansion, handleClick: this.closeExpansion,
permissions: ['PROJECT_API_SCENARIO:READ+DELETE'], permissions: ['PROJECT_API_SCENARIO:READ+EDIT'],
}, },
{ {
name: this.$t('api_test.definition.request.batch_delete') + '步骤', name: this.$t('api_test.definition.request.batch_delete') + '步骤',
handleClick: this.handleDeleteBatch, handleClick: this.handleDeleteBatch,
permissions: ['PROJECT_API_SCENARIO:READ+DELETE'], permissions: ['PROJECT_API_SCENARIO:READ+EDIT'],
}, },
], ],
reloadTree: '', reloadTree: '',
@ -842,11 +841,6 @@ export default {
} }
} }
}, },
chooseHeadsUp() {
if (this.$refs.stepTree) {
this.selectDataCounts = this.$refs.stepTree.getCheckedNodes().length;
}
},
checkedAll(v) { checkedAll(v) {
if (this.$refs.stepTree && this.$refs.stepTree.root && this.$refs.stepTree.root.childNodes) { if (this.$refs.stepTree && this.$refs.stepTree.root && this.$refs.stepTree.root.childNodes) {
this.recursionChecked(v, this.$refs.stepTree.root.childNodes); this.recursionChecked(v, this.$refs.stepTree.root.childNodes);
@ -1417,6 +1411,7 @@ export default {
return; return;
} }
setComponent(type, this, plugin); setComponent(type, this, plugin);
store.forceRerenderIndex = getUUID();
}, },
nodeClick(data, node) { nodeClick(data, node) {
if ( if (

View File

@ -13,7 +13,7 @@
</el-tooltip> </el-tooltip>
</div> </div>
<el-dropdown-menu slot="dropdown" class="dropdown-menu-class"> <el-dropdown-menu slot="dropdown" class="dropdown-menu-class">
<div class="show-more-btn-title"> <div class="show-more-btn-title" v-if="showSize">
{{ $t('test_track.case.batch_handle', [size]) }} {{ $t('test_track.case.batch_handle', [size]) }}
</div> </div>
<span v-for="(btn, index) in buttons" :key="index"> <span v-for="(btn, index) in buttons" :key="index">
@ -45,6 +45,10 @@ export default {
row: Object, row: Object,
size: Number, size: Number,
hasShowed: Boolean, hasShowed: Boolean,
showSize: {
type: Boolean,
default: true,
},
}, },
created() { created() {
if (this.trashEnable) { if (this.trashEnable) {