refactor: 自定义ID显示问题
This commit is contained in:
parent
621c98b792
commit
52143b1894
|
@ -20,6 +20,7 @@
|
||||||
:referenced="true"
|
:referenced="true"
|
||||||
:trash-enable="false"
|
:trash-enable="false"
|
||||||
@selection="setData"
|
@selection="setData"
|
||||||
|
:custom-num="customNum"
|
||||||
ref="apiScenarioList"/>
|
ref="apiScenarioList"/>
|
||||||
|
|
||||||
<template v-slot:footer>
|
<template v-slot:footer>
|
||||||
|
@ -57,13 +58,22 @@
|
||||||
isApiListEnable: true,
|
isApiListEnable: true,
|
||||||
currentScenario: [],
|
currentScenario: [],
|
||||||
currentScenarioIds: [],
|
currentScenarioIds: [],
|
||||||
projectId: ''
|
projectId: '',
|
||||||
|
customNum: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
projectId() {
|
projectId(val) {
|
||||||
this.$refs.apiScenarioList.search(this.projectId);
|
|
||||||
this.$refs.nodeTree.list(this.projectId);
|
this.$refs.nodeTree.list(this.projectId);
|
||||||
|
if (val) {
|
||||||
|
this.$get("/project/get/" + val, result => {
|
||||||
|
let data = result.data;
|
||||||
|
if (data) {
|
||||||
|
this.customNum = data.scenarioCustomNum;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.$refs.apiScenarioList.search(this.projectId);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
|
@ -16,7 +16,12 @@
|
||||||
|
|
||||||
<el-table ref="scenarioTable" border :data="tableData" class="adjust-table" @select-all="handleSelectAll" @select="handleSelect">
|
<el-table ref="scenarioTable" border :data="tableData" class="adjust-table" @select-all="handleSelectAll" @select="handleSelect">
|
||||||
<el-table-column type="selection"/>
|
<el-table-column type="selection"/>
|
||||||
|
<el-table-column v-if="!customNum" prop="num" label="ID"
|
||||||
|
show-overflow-tooltip>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column v-if="customNum" prop="customNum" label="ID"
|
||||||
|
show-overflow-tooltip>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="name" :label="$t('api_test.automation.scenario_name')"
|
<el-table-column prop="name" :label="$t('api_test.automation.scenario_name')"
|
||||||
show-overflow-tooltip/>
|
show-overflow-tooltip/>
|
||||||
<el-table-column prop="level" :label="$t('api_test.automation.case_level')"
|
<el-table-column prop="level" :label="$t('api_test.automation.case_level')"
|
||||||
|
@ -102,7 +107,8 @@
|
||||||
projectEnvMap: new Map(),
|
projectEnvMap: new Map(),
|
||||||
projectList: [],
|
projectList: [],
|
||||||
projectIds: new Set(),
|
projectIds: new Set(),
|
||||||
map: new Map()
|
map: new Map(),
|
||||||
|
customNum: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
@ -123,6 +129,7 @@
|
||||||
if (!this.projectId) {
|
if (!this.projectId) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
this.getProject(this.projectId);
|
||||||
this.selectRows = new Set();
|
this.selectRows = new Set();
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
||||||
|
@ -166,6 +173,16 @@
|
||||||
this.projectList = res.data;
|
this.projectList = res.data;
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
getProject(projectId) {
|
||||||
|
if (projectId) {
|
||||||
|
this.$get("/project/get/" + projectId, result => {
|
||||||
|
let data = result.data;
|
||||||
|
if (data) {
|
||||||
|
this.customNum = data.scenarioCustomNum;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
initProjectIds() {
|
initProjectIds() {
|
||||||
this.projectIds.clear();
|
this.projectIds.clear();
|
||||||
this.map.clear();
|
this.map.clear();
|
||||||
|
|
Loading…
Reference in New Issue