refactor(接口测试): 导入场景过多信息提示优化

--bug=1026973 --user=王孝刚 【接口测试】场景详情-场景导入较多-提示信息优化
https://www.tapd.cn/55049933/s/1381511
This commit is contained in:
wxg0103 2023-06-13 19:48:04 +08:00 committed by fit2-zhao
parent 5802478e9b
commit 731c218386
5 changed files with 25 additions and 41 deletions

View File

@ -163,10 +163,10 @@ export default {
this.$warning(this.$t('automation.case_message'));
this.buttonIsWorking = false;
} else {
if (apis.length > 500) {
if (params.condition.selectAll) {
operationConfirm(
this,
this.$t('automation.scenario_step_ref_message', [apis.length]) + '',
this.$t('automation.scenario_step_ref_message') + '',
() => {
this.$emit('save', apis, 'API', reference);
this.$refs.baseRelevance.close();
@ -189,10 +189,10 @@ export default {
this.$warning(this.$t('automation.case_message'));
this.buttonIsWorking = false;
} else {
if (apiCases.length > 500) {
if (this.$refs.apiCaseList.condition.selectAll) {
operationConfirm(
this,
this.$t('automation.scenario_step_ref_message', [apiCases.length]) + '',
this.$t('automation.scenario_step_ref_message') + '',
() => {
this.$emit('save', apiCases, 'CASE', reference);
this.$refs.baseRelevance.close();

View File

@ -14,7 +14,7 @@
@enableTrash="false"
:is-read-only="true"
:select-project-id="projectId"
ref="nodeTree" />
ref="nodeTree"/>
</template>
<relevance-scenario-list
@ -28,9 +28,9 @@
</relevance-scenario-list>
<template v-slot:headerBtn>
<table-select-count-bar :count="selectCounts" style="float: left; margin: 5px" />
<table-select-count-bar :count="selectCounts" style="float: left; margin: 5px"/>
<el-button size="mini" icon="el-icon-refresh" @click="refresh" />
<el-button size="mini" icon="el-icon-refresh" @click="refresh"/>
<el-button type="primary" @click="copy" :loading="buttonIsWorking" @keydown.enter.native.prevent size="mini">
{{ $t('commons.copy') }}
</el-button>
@ -42,19 +42,20 @@
</template>
<script>
import { getProjectVersions, versionEnableByProjectId } from '@/api/xpack';
import { apiScenarioAll, getApiScenarios, getApiScenarioStep } from '@/api/scenario';
import {getProjectVersions, versionEnableByProjectId} from '@/api/xpack';
import {apiScenarioAll, getApiScenarios, getApiScenarioStep} from '@/api/scenario';
import MsContainer from 'metersphere-frontend/src/components/MsContainer';
import MsAsideContainer from 'metersphere-frontend/src/components/MsAsideContainer';
import MsMainContainer from 'metersphere-frontend/src/components/MsMainContainer';
import MsApiScenarioModule from '../ApiScenarioModule';
import { getUUID, operationConfirm } from 'metersphere-frontend/src/utils';
import { hasLicense } from 'metersphere-frontend/src/utils/permission';
import {getUUID, operationConfirm} from 'metersphere-frontend/src/utils';
import {hasLicense} from 'metersphere-frontend/src/utils/permission';
import RelevanceDialog from '@/business/commons/RelevanceDialog';
import RelevanceScenarioList from './RelevanceScenarioList';
import TestCaseRelevanceBase from '../../../commons/TestCaseRelevanceBase';
import TableSelectCountBar from '@/business/automation/scenario/api/TableSelectCountBar';
import { getProjectConfig } from '@/api/project';
import {getProjectConfig} from '@/api/project';
export default {
name: 'ScenarioRelevance',
props: {
@ -168,34 +169,10 @@ export default {
this.buttonIsWorking = false;
return;
}
getApiScenarioStep(this.currentScenarioIds).then((response) => {
if (response.data > 500) {
operationConfirm(
this,
this.$t('automation.scenario_step_ref_message', [response.data]) + '',
() => {
this.pushApiScenario(scenarios, referenced);
},
() => {
this.buttonIsWorking = false;
}
);
} else {
this.pushApiScenario(scenarios, referenced);
}
});
});
} else {
if (!this.currentScenarioIds || this.currentScenarioIds.length < 1) {
this.$warning(this.$t('automation.scenario_message'));
this.buttonIsWorking = false;
return;
}
getApiScenarioStep(this.currentScenarioIds).then((response) => {
if (response.data > 500) {
if (conditions.selectAll) {
operationConfirm(
this,
this.$t('automation.scenario_step_ref_message', [response.data]) + '',
this.$t('automation.scenario_step_ref_message') + '',
() => {
this.pushApiScenario(scenarios, referenced);
},
@ -207,6 +184,13 @@ export default {
this.pushApiScenario(scenarios, referenced);
}
});
} else {
if (!this.currentScenarioIds || this.currentScenarioIds.length < 1) {
this.$warning(this.$t('automation.scenario_message'));
this.buttonIsWorking = false;
return;
}
this.pushApiScenario(scenarios, referenced);
}
},
pushApiScenario(scenarios, referenced) {

View File

@ -131,7 +131,7 @@ const message = {
project_no_permission: 'The current person does not have the operation permission for this step',
document_validity_msg: 'The file has been modified, please re-upload',
scenario_step_ref_message:
'The current number of selection requests [{0}] may cause page loading exceptions, whether to continue?',
'The current may cause page loading exceptions, whether to continue?',
case_message: 'Please select a case',
scenario_message: 'Please select a scene',
},

View File

@ -126,7 +126,7 @@ const message = {
automation: {
project_no_permission: '当前操作人无此步骤的操作权限',
document_validity_msg: '文件已经被修改,请重新上传',
scenario_step_ref_message: '当前选择请求数 [{0}] 个可能导致页面加载异常,是否继续',
scenario_step_ref_message: '当前操作可能导致页面加载异常,是否继续',
case_message: '请选择案例',
scenario_message: '请选择场景',
},

View File

@ -126,7 +126,7 @@ const message = {
automation: {
project_no_permission: '當前人操作無此步驟的操作權限',
document_validity_msg: '文件已經被修改,請重新上傳',
scenario_step_ref_message: '當前選擇請求數 [{0}] 个可能導致頁面加載異常,是否繼續',
scenario_step_ref_message: '當前操作可能導致頁面加載異常,是否繼續',
case_message: '請選擇案例',
scenario_message: '請選擇場景',
},