From 2eec3377725ccaede46cf9377338316e4f8fab10 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Mon, 9 Jan 2023 18:37:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=9C=BA=E6=99=AF=E5=88=97=E8=A1=A8=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=8E=AF=E5=A2=83=E5=90=8D=E7=A7=B0=E8=BF=87=E9=95=BF?= =?UTF-8?q?=E6=97=B6=E7=8E=AF=E5=A2=83=E5=BC=B9=E6=A1=86=E4=B8=AD=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=8E=AF=E5=A2=83=E5=90=8D=E7=A7=B0=E7=9A=84?= =?UTF-8?q?=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1021740 --user=王孝刚 【UI测试】UI场景 和 指令,项目+环境名称过长时,环境弹框中不显示环境名称 https://www.tapd.cn/55049933/s/1324648 --- .../automation/scenario/ApiScenarioList.vue | 146 +++++++++--------- 1 file changed, 74 insertions(+), 72 deletions(-) diff --git a/api-test/frontend/src/business/automation/scenario/ApiScenarioList.vue b/api-test/frontend/src/business/automation/scenario/ApiScenarioList.vue index 73a89bd2bf..11e1d5e7da 100644 --- a/api-test/frontend/src/business/automation/scenario/ApiScenarioList.vue +++ b/api-test/frontend/src/business/automation/scenario/ApiScenarioList.vue @@ -40,7 +40,7 @@ :fields-width="fieldsWidth" v-if="this.trashEnable" :label="$t('commons.delete_user')" - min-width="120" /> + min-width="120"/> + sortable/> @@ -105,7 +105,7 @@ prop="status" min-width="120px"> @@ -125,8 +125,8 @@ :content="itemName" :show-tooltip="scope.row.tags.length === 1 && itemName.length * 12 <= 120" :showTooltip="true" - style="margin-left: 0px; margin-right: 2px" /> - + style="margin-left: 0px; margin-right: 2px"/> + @@ -148,7 +148,7 @@ :fields-width="fieldsWidth" prop="principalName" min-width="120px" - sortable /> + sortable/> + sortable="custom"/> {{ v }}: - {{ k }} + {{ k }} -
+
- {{ v }}: {{ k }}
-
+ {{ v }}: + + {{ k }} + + +
- +
@@ -217,7 +220,7 @@ :fields-width="fieldsWidth" :label="$t('api_test.automation.step')" prop="stepTotal" - min-width="80px" /> + min-width="80px"/> @@ -238,7 +241,7 @@ :fields-width="fieldsWidth" :label="$t('api_test.automation.passing_rate')" prop="passRate" - min-width="120px" /> + min-width="120px"/> - +
@@ -295,7 +298,7 @@ :scenarioId="scenarioId" :infoDb="infoDb" :report-id="reportId" - :currentProjectId="projectId" /> + :currentProjectId="projectId"/> + :currentProjectId="projectId"/> + :row="selectRows"/>
@@ -336,14 +339,14 @@ @batchEdit="batchEdit" :typeArr="typeArr" :value-arr="valueArr" - :dialog-title="$t('test_track.case.batch_edit_case')" /> - + :dialog-title="$t('test_track.case.batch_edit_case')"/> + + ref="apiBatchRun"/> - - + ref="runTest"/> + + - + + ref="apiDeleteConfirm"/> - + @@ -398,13 +401,13 @@ import { scenarioRun, updateScenarioEnv, } from '@/api/scenario'; -import { getMaintainer, getProject } from '@/api/project'; -import { getProjectVersions, versionEnableByProjectId } from '@/api/xpack'; -import { getCurrentProjectID, getCurrentUserId } from 'metersphere-frontend/src/utils/token'; -import { downloadFile, getUUID, objToStrMap, strMapToObj } from 'metersphere-frontend/src/utils'; -import { hasLicense, hasPermission } from 'metersphere-frontend/src/utils/permission'; -import { API_SCENARIO_CONFIGS } from 'metersphere-frontend/src/components/search/search-components'; -import { API_SCENARIO_LIST } from 'metersphere-frontend/src/utils/constants'; +import {getMaintainer, getProject} from '@/api/project'; +import {getProjectVersions, versionEnableByProjectId} from '@/api/xpack'; +import {getCurrentProjectID, getCurrentUserId} from 'metersphere-frontend/src/utils/token'; +import {downloadFile, getUUID, objToStrMap, strMapToObj} from 'metersphere-frontend/src/utils'; +import {hasLicense, hasPermission} from 'metersphere-frontend/src/utils/permission'; +import {API_SCENARIO_CONFIGS} from 'metersphere-frontend/src/components/search/search-components'; +import {API_SCENARIO_LIST} from 'metersphere-frontend/src/utils/constants'; import { buildBatchParam, getCustomTableHeader, @@ -412,24 +415,24 @@ import { getLastTableSortField, getSelectDataCounts, } from 'metersphere-frontend/src/utils/tableUtils'; -import { API_SCENARIO_FILTERS } from 'metersphere-frontend/src/utils/table-constants'; +import {API_SCENARIO_FILTERS} from 'metersphere-frontend/src/utils/table-constants'; import MsTable from 'metersphere-frontend/src/components/table/MsTable'; import MsTableColumn from 'metersphere-frontend/src/components/table/MsTableColumn'; import HeaderLabelOperate from 'metersphere-frontend/src/components/head/HeaderLabelOperate'; -import { getGraphByCondition } from '@/api/graph'; -import { API_SCENARIO_CONFIGS_TRASH, TYPE_TO_C } from '@/business/automation/scenario/Setting'; +import {getGraphByCondition} from '@/api/graph'; +import {API_SCENARIO_CONFIGS_TRASH, TYPE_TO_C} from '@/business/automation/scenario/Setting'; import MsTableSearchBar from 'metersphere-frontend/src/components/MsTableSearchBar'; import MsTableAdvSearchBar from 'metersphere-frontend/src/components/search/MsTableAdvSearchBar'; import ListItemDeleteConfirm from 'metersphere-frontend/src/components/ListItemDeleteConfirm'; import ScenarioDeleteConfirm from '@/business/automation/scenario/ScenarioDeleteConfirm'; -import { $error } from 'metersphere-frontend/src/plugins/message'; +import {$error} from 'metersphere-frontend/src/plugins/message'; import MsSearch from 'metersphere-frontend/src/components/search/MsSearch'; -import { buildNodePath } from 'metersphere-frontend/src/model/NodeTree'; -import { getEnvironmentByProjectId } from 'metersphere-frontend/src/api/environment'; -import { REPORT_STATUS } from '@/business/commons/js/commons'; -import { usePerformanceStore } from '@/store'; -import { request } from 'metersphere-frontend/src/plugins/request'; -import { parseEnvironment } from '@/business/environment/model/EnvironmentModel'; +import {buildNodePath} from 'metersphere-frontend/src/model/NodeTree'; +import {getEnvironmentByProjectId} from 'metersphere-frontend/src/api/environment'; +import {REPORT_STATUS} from '@/business/commons/js/commons'; +import {usePerformanceStore} from '@/store'; +import {request} from 'metersphere-frontend/src/plugins/request'; +import {parseEnvironment} from '@/business/environment/model/EnvironmentModel'; import MsApiRunMode from '@/business/automation/scenario/common/ApiRunMode'; import ApiDeleteConfirm from '@/business/definition/components/list/ApiDeleteConfirm'; import MsShowReference from '@/business/definition/components/reference/ShowReference'; @@ -652,8 +655,8 @@ export default { }, ], typeArr: [ - { id: 'level', name: this.$t('test_track.case.priority') }, - { id: 'status', name: this.$t('test_track.plan.plan_status') }, + {id: 'level', name: this.$t('test_track.case.priority')}, + {id: 'status', name: this.$t('test_track.plan.plan_status')}, { id: 'principal', name: this.$t('api_test.definition.request.responsible'), @@ -664,14 +667,14 @@ export default { id: 'projectEnv', name: this.$t('api_test.definition.request.run_env'), }, - { id: 'tags', name: this.$t('commons.tag') }, + {id: 'tags', name: this.$t('commons.tag')}, ], valueArr: { level: [ - { name: 'P0', id: 'P0' }, - { name: 'P1', id: 'P1' }, - { name: 'P2', id: 'P2' }, - { name: 'P3', id: 'P3' }, + {name: 'P0', id: 'P0'}, + {name: 'P1', id: 'P1'}, + {name: 'P2', id: 'P2'}, + {name: 'P3', id: 'P3'}, ], status: [ { @@ -712,10 +715,10 @@ export default { if (!this.projectName || this.projectName === '') { this.getProjectName(); } - this.condition.filters = { status: ['Prepare', 'Underway', 'Completed'] }; + this.condition.filters = {status: ['Prepare', 'Underway', 'Completed']}; this.initEnvironment(); if (this.trashEnable) { - this.condition.filters = { status: ['Trash'] }; + this.condition.filters = {status: ['Trash']}; this.condition.moduleIds = []; this.operators = this.trashOperators; this.buttons = this.trashButtons; @@ -730,7 +733,7 @@ export default { } if (this.trashEnable) { - this.condition.orders = [{ name: 'delete_time', type: 'desc' }]; + this.condition.orders = [{name: 'delete_time', type: 'desc'}]; } else { this.condition.orders = getLastTableSortField(this.tableHeaderKey); } @@ -763,7 +766,7 @@ export default { }, trashEnable() { if (this.trashEnable) { - this.condition.filters = { status: ['Trash'] }; + this.condition.filters = {status: ['Trash']}; this.condition.moduleIds = []; this.operators = this.trashOperators; this.buttons = this.trashButtons; @@ -792,7 +795,7 @@ export default { moduleOptionsNew() { let moduleOptions = []; this.moduleOptions.forEach((node) => { - buildNodePath(node, { path: '' }, moduleOptions); + buildNodePath(node, {path: ''}, moduleOptions); }); return moduleOptions; }, @@ -824,7 +827,7 @@ export default { parseEnvironment(environment); }); this.environmentsFilters = response.data.map((u) => { - return { text: u.name, value: u.id }; + return {text: u.name, value: u.id}; }); }); } @@ -1011,7 +1014,7 @@ export default { getMaintainer().then((response) => { option.push(...response.data); this.userFilters = response.data.map((u) => { - return { text: u.name, value: u.id }; + return {text: u.name, value: u.id}; }); }); }, @@ -1022,11 +1025,11 @@ export default { this.versionFilters = response.data .filter((u) => u.id === currentVersion) .map((u) => { - return { text: u.name, value: u.id }; + return {text: u.name, value: u.id}; }); } else { this.versionFilters = response.data.map((u) => { - return { text: u.name, value: u.id }; + return {text: u.name, value: u.id}; }); } }); @@ -1117,7 +1120,7 @@ export default { handleRunBatch(config) { this.infoDb = false; - let run = { config: config }; + let run = {config: config}; run.id = getUUID(); //按照列表排序 let ids = this.orderBySelectRows(); @@ -1413,7 +1416,7 @@ export default { this.search(); }); } else { - let param = { ids: [api.id] }; + let param = {ids: [api.id]}; removeScenarioToGcByBatch(param).then(() => { this.$success(this.$t('commons.delete_success')); this.$refs.apiDeleteConfirmVersion.close(); @@ -1452,7 +1455,7 @@ export default { method: 'post', data: param, responseType: 'blob', - headers: { 'Content-Type': 'application/json; charset=utf-8' }, + headers: {'Content-Type': 'application/json; charset=utf-8'}, }; request(config).then( (response) => { @@ -1592,13 +1595,12 @@ export default { .plan-case-env { display: inline-block; - padding: 0 0; - max-width: 350px; + max-width: 250px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; - margin-top: 2px; margin-left: 5px; + vertical-align: bottom; } .project-name {