diff --git a/api-test/frontend/src/business/automation/version/ScenarioDiff.vue b/api-test/frontend/src/business/automation/version/ScenarioDiff.vue index 198cd737ca..890e8f4f6b 100644 --- a/api-test/frontend/src/business/automation/version/ScenarioDiff.vue +++ b/api-test/frontend/src/business/automation/version/ScenarioDiff.vue @@ -178,7 +178,16 @@ :node="node" :env-map="projectEnvMap" :project-list="projectList" - :show-version="false" /> + :show-version="false" + v-if=" + stepFilter.get('ALlSamplerStep').indexOf(data.type) === -1 || + !node.parent || + !node.parent.data || + stepFilter.get('AllSamplerProxy').indexOf(node.parent.data.type) === -1 + "/> + @@ -354,7 +363,16 @@ :node="node" :env-map="newProjectEnvMap" :project-list="projectList" - :show-version="false" /> + :show-version="false" + v-if=" + stepFilter.get('ALlSamplerStep').indexOf(data.type) === -1 || + !node.parent || + !node.parent.data || + stepFilter.get('AllSamplerProxy').indexOf(node.parent.data.type) === -1 + "/> + @@ -391,7 +409,8 @@ import MsComponentConfig from '../scenario/component/ComponentConfig'; import ScenarioChildDiff from '../version/ScenarioChildDiff'; import { objToStrMap } from 'metersphere-frontend/src/utils'; import { getScenarioWithBLOBsById } from '@/api/scenario'; -import { useApiStore } from '@/store'; +import {useApiStore} from '@/store'; +import {STEP} from "@/business/automation/scenario/Setting"; const store = useApiStore(); const { diff } = require('./v_node_diff'); @@ -501,6 +520,7 @@ export default { newOnSampleError: {}, newProjectEnvMap: new Map(), showDiff: false, + stepFilter: new STEP(), }; }, methods: { @@ -515,19 +535,56 @@ export default { } } this.oldData = response.data; - getFollowByScenarioId(this.currentScenarioId).then((response) => { - this.oldData.follows = response.data; - for (let i = 0; i < response.data.length; i++) { - if (response.data[i] === this.currentUser().id) { - this.showFollow = true; - break; - } - } - }); + this.sort(); } }); } }, + sort() { + this.recursionStep(this.oldScenarioDefinition); + }, + recursionStep(stepArray, scenarioProjectId, fullPath, isGeneric) { + for (let i in stepArray) { + let step = stepArray[i]; + step.index = !isGeneric ? Number(i) + 1 : step.index; + if (step.type === 'GenericController') { + this.pluginOrder(step); + } + step.resourceId = step.resourceId || getUUID(); + // 历史数据处理 + if (step.type === 'HTTPSamplerProxy' && !step.headers) { + step.headers = [new KeyValue()]; + } + if ( + step.type === ELEMENT_TYPE.LoopController && + step.loopType === 'LOOP_COUNT' && + step.hashTree && + step.hashTree.length > 1 + ) { + step.countController.proceed = true; + } + step.clazzName = step.clazzName || TYPE_TO_C.get(step.type); + if (step && step.authManager && !step.authManager.clazzName) { + step.authManager.clazzName = TYPE_TO_C.get(step.authManager.type); + } + // 如果自身没有ID并且场景有ID则赋值场景ID,否则赋值当前项目ID + step.projectId = step.projectId || scenarioProjectId || this.projectId; + // 添加debug结果 + step.parentIndex = fullPath ? fullPath + '_' + step.index : step.index; + if (step.hashTree && step.hashTree.length > 0) { + this.recursionStep(step.hashTree, step.projectId, step.parentIndex, step.type === 'GenericController'); + } + } + }, + pluginOrder(nodes) { + // 兼容历史数据 + if (nodes && nodes.type === 'GenericController' && nodes.hashTree) { + let data = nodes.hashTree.filter((v) => v.type !== 'Assertions'); + for (let i = 0; i < data.length; i++) { + data[i].index = i + 1; + } + } + }, getDffScenario() { getScenarioById(this.dffScenarioId + '/' + this.scenarioRefId).then((response) => { getScenarioWithBLOBsById(response.data.id).then((res) => { @@ -757,6 +814,10 @@ export default { } return size; }, + hideNode(node) { + node.isLeaf = true; + node.visible = false; + }, }, created() { this.getCurrentScenario(); @@ -774,4 +835,70 @@ export default { display: flex; justify-content: space-between; } + +:deep(.el-tree-node__content) { + height: 100%; + margin-top: 3px; + vertical-align: center; +} + +:deep(.el-card__body) { + padding: 6px 10px; +} + +:deep(.el-drawer__body) { + overflow: auto; +} + +:deep(.el-step__icon.is-text) { + border: 1px solid; +} + +:deep(.el-drawer__header) { + margin-bottom: 0px; +} + +:deep(.el-link) { + font-weight: normal; +} + +:deep(.el-checkbox) { + color: #303133; + font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', Arial, sans-serif; + font-size: 13px; + font-weight: normal; +} + +:deep(.el-checkbox__label) { + padding-left: 5px; +} + +.ms-tree :deep(.el-tree-node__expand-icon.expanded) { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); +} + +.ms-tree :deep(.el-tree-node__content > .el-tree-node__expand-icon) { + padding: 3px; +} + +.ms-tree :deep(.el-icon-caret-right:before) { + padding: 0; + content: ''; +} + +.ms-tree :deep(.el-tree-node__expand-icon.is-leaf) { + color: transparent; +} + +.ms-tree :deep(.el-tree-node__expand-icon) { + color: #7c3985; +} + +.ms-tree :deep(.el-tree-node__expand-icon.expanded.el-icon-caret-right:before) { + color: #7c3985; + /* content: "\e722";*/ + padding: 0; + content: ''; +} diff --git a/api-test/frontend/src/business/definition/components/import/ApiImport.vue b/api-test/frontend/src/business/definition/components/import/ApiImport.vue index 5695896188..db3d0e0450 100644 --- a/api-test/frontend/src/business/definition/components/import/ApiImport.vue +++ b/api-test/frontend/src/business/definition/components/import/ApiImport.vue @@ -12,7 +12,7 @@
{{ $t('api_test.api_import.data_format') }}
- {{ item.name }} + {{ item.name }} @@ -480,6 +480,7 @@ export default { if (value !== 'Swagger2') { this.clearAuthInfo(); this.authEnable = false; + this.swaggerUrlEnable = false; } }, buildParam() { @@ -519,7 +520,9 @@ export default { swaggerUrl: '', modeId: this.formData.modeId, }; + this.clearAuthInfo(); this.swaggerUrlEnable = false; + this.authEnable = false; this.selectedPlatformValue = 'Metersphere'; this.fileList = []; removeGoBackListener(this.close); diff --git a/framework/sdk-parent/frontend/src/components/table/MsTable.vue b/framework/sdk-parent/frontend/src/components/table/MsTable.vue index 3813ca0152..92a0ecbf5d 100644 --- a/framework/sdk-parent/frontend/src/components/table/MsTable.vue +++ b/framework/sdk-parent/frontend/src/components/table/MsTable.vue @@ -594,8 +594,8 @@ export default { return "padding-col"; } }, - rowStyle({ row }) { - return row.hidden ? { display: "none" } : {}; + rowStyle({row}) { + return row.hidden ? {display: "none"} : {}; }, tableRowClassName(row) { if (row.row.hidden) { @@ -603,6 +603,10 @@ export default { } return ""; }, + //清空Filter条件 + clearFilter() { + this.$refs.table.clearFilter(); + } }, }; diff --git a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanMessageService.java b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanMessageService.java index 180d67f7d0..7e5325b36d 100644 --- a/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanMessageService.java +++ b/test-track/backend/src/main/java/io/metersphere/plan/service/TestPlanMessageService.java @@ -323,6 +323,7 @@ public class TestPlanMessageService { result.put("apiScenarioFailedCount", v); break; case "unexecute": + case "pending": result.put("apiScenarioUnExecuteCount", v); break; case "errorreportresult": @@ -351,6 +352,7 @@ public class TestPlanMessageService { break; case "unexecute": case "stop": + case "pending": result.put("uiScenarioUnExecuteCount", v); break; default: diff --git a/workstation/frontend/src/business/component/ApiCaseTableList.vue b/workstation/frontend/src/business/component/ApiCaseTableList.vue index 46f677531b..e90f6a7b57 100644 --- a/workstation/frontend/src/business/component/ApiCaseTableList.vue +++ b/workstation/frontend/src/business/component/ApiCaseTableList.vue @@ -711,7 +711,10 @@ export default { this.condition.combine = {creator: {operator: "current user", value: "current user",}} } else { if (this.isFinish) { - if (!this.condition.filters || this.condition.filters.case_status === null) { + if (!this.condition.filters) { + this.condition.filters = {case_status: ["Prepare", "Underway"]}; + } + if (!this.condition.filters.case_status) { this.condition.filters.case_status = ["Prepare", "Underway"]; } if (this.condition.filters.case_status && this.condition.filters.case_status.length > 0) { @@ -868,6 +871,7 @@ export default { }, changeTabState(name) { + this.$refs.caseTable.clearFilter(); if (name === 'update') { this.isFinish = false; } else { diff --git a/workstation/frontend/src/business/component/ApiDefinitionTableList.vue b/workstation/frontend/src/business/component/ApiDefinitionTableList.vue index 21747a3ebc..730f58d0c4 100644 --- a/workstation/frontend/src/business/component/ApiDefinitionTableList.vue +++ b/workstation/frontend/src/business/component/ApiDefinitionTableList.vue @@ -677,6 +677,7 @@ export default { }, methods: { changeTabState(name) { + this.$refs.apiTable.clearFilter(); if (name === 'update') { this.isFinish = false; } else { diff --git a/workstation/frontend/src/business/detail/WorkstationDetail.vue b/workstation/frontend/src/business/detail/WorkstationDetail.vue index 777b614a18..baace10fbb 100644 --- a/workstation/frontend/src/business/detail/WorkstationDetail.vue +++ b/workstation/frontend/src/business/detail/WorkstationDetail.vue @@ -524,7 +524,7 @@ export default { this.$refs.apiCaseTableList.changeTabState('finish') } if (this.currentTodo === 'api_definition') { - this.$refs.apiCaseTableList.changeTabState('finish') + this.$refs.apiDefinitionTableList.changeTabState('finish') } } },