提交 8ccd6bef 编写于 作者: W wenyann

fix:自定义表头显示问题

上级 f0ad5278
......@@ -244,7 +244,7 @@
return {
type: API_SCENARIO_LIST,
headerItems: Api_Scenario_List,
tableLabel: Api_Scenario_List,
tableLabel: [],
loading: false,
screenHeight: document.documentElement.clientHeight - 280,//屏幕高度,
condition: {
......@@ -361,6 +361,7 @@
},
methods: {
customHeader() {
getLabel(this, API_SCENARIO_LIST);
this.$refs.headerCustom.open(this.tableLabel)
},
selectByParam() {
......@@ -369,7 +370,6 @@
},
search(projectId) {
this.selectRows = new Set();
getLabel(this, API_SCENARIO_LIST);
this.condition.moduleIds = this.selectNodeIds;
if (this.trashEnable) {
this.condition.filters = {status: ["Trash"]};
......@@ -421,6 +421,7 @@
this.unSelection = data.listObject.map(s => s.id);
});
}
getLabel(this, API_SCENARIO_LIST);
},
handleCommand(cmd) {
let table = this.$refs.scenarioTable;
......
......@@ -60,13 +60,13 @@
</el-table-column>
<el-table-column
v-if="item.id == 'custom'"
sortable="custom"
prop="path"
min-width="180px"
:label="$t('api_test.definition.api_path')"
show-overflow-tooltip
:key="index"/>
v-if="item.id == 'path'"
sortable="custom"
prop="path"
min-width="180px"
:label="$t('api_test.definition.api_path')"
show-overflow-tooltip
:key="index"/>
<el-table-column v-if="item.id=='tags'" prop="tags" min-width="120px" :label="$t('commons.tag')"
:key="index">
......@@ -83,12 +83,12 @@
:key="index"/>
<el-table-column
v-if="item.id=='custom'"
sortable="custom"
min-width="160"
:label="$t('api_test.definition.api_last_time')"
prop="updateTime"
:key="index">
v-if="item.id=='updateTime'"
sortable="updateTime"
min-width="160"
:label="$t('api_test.definition.api_last_time')"
prop="updateTime"
:key="index">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
......@@ -186,7 +186,7 @@ export default {
return {
type: API_CASE_LIST,
headerItems: Api_Case_List,
tableLabel: Api_Case_List,
tableLabel: [],
condition: {
components: API_CASE_CONFIGS
},
......@@ -286,10 +286,11 @@ export default {
},
methods: {
customHeader() {
getLabel(this, API_CASE_LIST);
this.$refs.headerCustom.open(this.tableLabel)
},
initTable() {
getLabel(this, API_CASE_LIST);
this.selectRows = new Set();
this.condition.status = "";
this.condition.moduleIds = this.selectNodeIds;
......@@ -332,6 +333,7 @@ export default {
})
});
}
getLabel(this, API_CASE_LIST);
},
open() {
this.$refs.searchBar.open();
......
......@@ -272,7 +272,7 @@ export default {
return {
type: API_LIST,
headerItems: Api_List,
tableLabel: Api_List,
tableLabel: [],
condition: {
components: API_DEFINITION_CONFIGS
},
......@@ -392,13 +392,13 @@ export default {
},
methods: {
customHeader() {
getLabel(this, API_LIST);
this.$refs.headerCustom.open(this.tableLabel)
},
handleBatchMove() {
this.$refs.testCaseBatchMove.open(this.moduleTree, [], this.moduleOptions);
},
initTable() {
getLabel(this, API_LIST);
this.selectRows = new Set();
initCondition(this.condition);
this.selectDataCounts = 0;
......@@ -444,6 +444,7 @@ export default {
})
});
}
getLabel(this, API_LIST);
},
genProtocalFilter(protocalType) {
if (protocalType === "HTTP") {
......
......@@ -46,12 +46,20 @@ export default {
return type !== 'inner';
},
open(items) {
this.defaultCheckedKeys = []
this.dialogTableVisible = true
items.forEach(i => {
this.defaultCheckedKeys.push(i.id)
}
)
/*this.optionalField = items*/
this.fieldSelected = items
if (items.size <= 0) {
this.optionalField = this.optionalFields
} else {
items.forEach(i => {
this.defaultCheckedKeys.push(i.id)
}
)
}
console.log(this.defaultCheckedKeys)
},
saveHeader() {
let param = {
......
......@@ -705,6 +705,7 @@ export default {
}
param.testId=JSON.stringify(this.form.selected)
param.tags = this.form.tags;
param.type = 'functional'
return param;
},
getOption(param) {
......
......@@ -259,7 +259,7 @@ export default {
return {
type: TEST_CASE_LIST,
headerItems: Track_Test_Case,
tableLabel: Track_Test_Case,
tableLabel: [],
result: {},
deletePath: "/test/case/delete",
condition: {
......@@ -381,6 +381,7 @@ export default {
},
methods: {
customHeader() {
getLabel(this, TEST_CASE_LIST);
this.$refs.headerCustom.open(this.tableLabel)
},
getSelectDataRange() {
......
......@@ -248,7 +248,7 @@ export default {
return {
type: TEST_PLAN_LIST,
headerItems: Test_Plan_List,
tableLabel: Test_Plan_List,
tableLabel: [],
result: {},
enableDeleteTip: false,
queryPath: "/test/plan/list",
......@@ -290,7 +290,6 @@ export default {
this.$refs.headerCustom.open(this.tableLabel)
},
initTableData() {
getLabel(this, TEST_PLAN_LIST);
if (this.planId) {
this.condition.planId = this.planId;
}
......@@ -308,9 +307,11 @@ export default {
if (item.tags && item.tags.length > 0) {
item.tags = JSON.parse(item.tags);
}
item.passRate=item.passRate+'%'
item.passRate = item.passRate + '%'
})
});
getLabel(this, TEST_PLAN_LIST);
},
copyData(status) {
return JSON.parse(JSON.stringify(this.dataMap.get(status)))
......
......@@ -192,7 +192,7 @@ export default {
return {
type: TEST_PLAN_API_CASE,
headerItems: Test_Plan_Api_Case,
tableLabel: Test_Plan_Api_Case,
tableLabel: [],
condition: {},
selectCase: {},
result: {},
......@@ -302,6 +302,8 @@ export default {
},
methods: {
customHeader() {
getLabel(this, TEST_PLAN_API_CASE);
this.$refs.headerCustom.open(this.tableLabel)
},
getMaintainerOptions() {
......@@ -317,7 +319,6 @@ export default {
this.$emit('isApiListEnableChange', data);
},
initTable() {
getLabel(this, TEST_PLAN_API_CASE);
this.selectRows = new Set();
this.condition.status = "";
this.condition.moduleIds = this.selectNodeIds;
......@@ -356,7 +357,7 @@ export default {
})
});
}
getLabel(this, TEST_PLAN_API_CASE);
},
handleSelect(selection, row) {
row.hashTree = [];
......
......@@ -148,7 +148,7 @@ export default {
return {
type: TEST_PLAN_SCENARIO_CASE,
headerItems: Test_Plan_Scenario_Case,
tableLabel: Test_Plan_Scenario_Case,
tableLabel: [],
loading: false,
condition: {},
currentScenario: {},
......@@ -196,10 +196,11 @@ export default {
},
methods: {
customHeader() {
getLabel(this, TEST_PLAN_SCENARIO_CASE);
this.$refs.headerCustom.open(this.tableLabel)
},
search() {
getLabel(this, TEST_PLAN_SCENARIO_CASE);
this.selectRows = new Set();
this.loading = true;
this.condition.moduleIds = this.selectNodeIds;
......@@ -241,6 +242,7 @@ export default {
this.loading = false;
});
}
getLabel(this, TEST_PLAN_SCENARIO_CASE);
},
reductionApi(row) {
......
......@@ -312,7 +312,7 @@ export default {
return {
type: TEST_PLAN_FUNCTION_TEST_CASE,
headerItems: Test_Plan_Function_Test_Case,
tableLabel: Test_Plan_Function_Test_Case,
tableLabel: [],
result: {},
deletePath: "/test/case/delete",
condition: {
......@@ -416,11 +416,11 @@ export default {
},
methods: {
customHeader() {
getLabel(this, TEST_PLAN_FUNCTION_TEST_CASE);
this.$refs.headerCustom.open(this.tableLabel)
},
initTableData() {
getLabel(this, TEST_PLAN_FUNCTION_TEST_CASE);
if (this.planId) {
// param.planId = this.planId;
this.condition.planId = this.planId;
......@@ -464,6 +464,7 @@ export default {
this.selectRows.clear();
});
}
getLabel(this, TEST_PLAN_FUNCTION_TEST_CASE);
},
showDetail(row, event, column) {
this.isReadOnly = true;
......
......@@ -154,7 +154,7 @@ export default {
return {
type: TEST_PLAN_LOAD_CASE,
headerItems: Test_Plan_Load_Case,
tableLabel: Test_Plan_Load_Case,
tableLabel: [],
condition: {},
result: {},
tableData: [],
......@@ -209,10 +209,10 @@ export default {
},
methods: {
customHeader() {
getLabel(this, TEST_PLAN_LOAD_CASE);
this.$refs.headerCustom.open(this.tableLabel)
},
initTable() {
getLabel(this, TEST_PLAN_LOAD_CASE);
this.selectRows = new Set();
this.condition.testPlanId = this.planId;
if (this.selectProjectId && this.selectProjectId !== 'root') {
......@@ -244,6 +244,8 @@ export default {
this.tableData = listObject;
})
}
getLabel(this, TEST_PLAN_LOAD_CASE);
},
refreshStatus() {
this.refreshScheduler = setInterval(() => {
......@@ -328,21 +330,14 @@ export default {
})
},
updateStatus(loadCase, status) {
if (this.planId) {
this.$post('/test/plan/load/case/update', {id: loadCase.id, status: status}, () => {
this.$post('/test/plan/edit/status/' + loadCase.testPlanId, {}, () => {
this.initTable();
});
});
}
if (this.reviewId) {
this.$post('/test/review/load/case/update', {id: loadCase.id, status: status}, () => {
this.$post('/test/plan/load/case/update', {id: loadCase.id, status: status}, () => {
this.$post('/test/plan/edit/status/' + loadCase.testPlanId, {}, () => {
this.initTable();
});
}
});
},
handleDelete(loadCase) {
this.result = this.$get('/test/review/load/case/delete/' + loadCase.id, () => {
this.result = this.$get('/test/plan/load/case/delete/' + loadCase.id, () => {
this.$success(this.$t('test_track.cancel_relevance_success'));
this.$emit('refresh');
this.initTable();
......
......@@ -63,30 +63,21 @@
<div class="case_container">
<el-row>
<el-col :span="4" :offset="1">
<el-col :span="9" :offset="1">
<span class="cast_label">{{ $t('test_track.case.priority') }}</span>
<span class="cast_item">{{ testCase.priority }}</span>
</el-col>
<el-col :span="5">
<span class="cast_label">{{ $t('test_track.case.case_type') }}</span>
<span class="cast_item" v-if="testCase.type === 'automation'">
场景用例
</span>
<span class="cast_item"
v-if="testCase.type === 'performance'">{{ $t('commons.performance') }}</span>
<span class="cast_item" v-if="testCase.type === 'api'">{{ $t('commons.api') }}</span>
<span class="cast_item" v-if="testCase.type === 'testcase'">接口用例</span>
<el-col :span="10" :offset="1">
<span class="cast_label">{{ $t('test_track.case.module') }}</span>
<span class="cast_item">{{ testCase.nodePath }}</span>
</el-col>
</el-row>
<el-row>
<el-col :offset="1">
<span class="cast_label">{{ $t('test_track.case.module') }}</span>
<span class="cast_item">{{ testCase.nodePath }}</span>
<span class="cast_label">{{ $t('test_track.plan_view.relevance_test_case') }}</span>
<span class="cast_item">{{ testCase.prerequisite }}</span>
</el-col>
</el-row>
<el-row>
<el-col :offset="1">
<span class="cast_label">{{ $t('test_track.case.prerequisite') }}</span>
......@@ -94,27 +85,27 @@
</el-col>
</el-row>
<el-row>
<el-col class="test-detail" :span="20" :offset="1">
<el-tabs v-model="activeTab" type="border-card">
<el-tab-pane name="detail" :label="$t('test_track.plan_view.test_detail')">
<api-test-detail :is-read-only="true" v-if="testCase.type === 'api'"
:id="testCase.testId" ref="apiTestDetail"/>
<performance-test-detail v-if="testCase.type === 'performance'"
:is-read-only="true"
:id="testCase.testId"
ref="performanceTestDetail"/>
<api-case-item :type="mark" :api="api" :api-case="apiCase" v-if="testCase.type==='testcase'"
ref="apiCaseConfig"/>
<ms-edit-api-scenario :type="mark" v-if="testCase.type==='automation'" :currentScenario="currentScenario"
ref="autoScenarioConfig"></ms-edit-api-scenario>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>
<!-- <el-row>
<el-col class="test-detail" :span="20" :offset="1">
<el-tabs v-model="activeTab" type="border-card">
<el-tab-pane name="detail" :label="$t('test_track.plan_view.test_detail')">
<api-test-detail :is-read-only="true" v-if="testCase.type === 'api'"
:id="testCase.testId" ref="apiTestDetail"/>
<performance-test-detail v-if="testCase.type === 'performance'"
:is-read-only="true"
:id="testCase.testId"
ref="performanceTestDetail"/>
<api-case-item :type="mark" :api="api" :api-case="apiCase" v-if="testCase.type==='testcase'"
ref="apiCaseConfig"/>
<ms-edit-api-scenario :type="mark" v-if="testCase.type==='automation'" :currentScenario="currentScenario"
ref="autoScenarioConfig"></ms-edit-api-scenario>
</el-tab-pane>
</el-tabs>
</el-col>
</el-row>-->
<el-row v-if="testCase.type === 'function'">
<el-row>
<el-col :span="20" :offset="1">
<div>
<span class="cast_label">{{ $t('test_track.case.steps') }}</span>
......@@ -365,7 +356,7 @@ export default {
this.testCase = item;
this.getRelatedTest();
this.getComments(item);
this.initTest();
/* this.initTest();*/
this.getFileMetaData(data);
})
......@@ -389,59 +380,22 @@ export default {
listenGoBack(this.handleClose);
this.initData(testCase);
this.getComments(testCase);
this.getApiTestCase(testCase);
this.getCurrentScenario(testCase)
},
getApiTestCase(testCase) {
let param = {}
param.projectId = getCurrentProjectID();
param.id = testCase.testId;
this.result = this.$post("/api/testcase/list", param, response => {
let apiCaseList = []
this.apiCaseList = response.data;
this.apiCaseList.forEach(apiCase => {
if (apiCase.tags && apiCase.tags.length > 0) {
apiCase.tags = JSON.parse(apiCase.tags);
this.$set(apiCase, 'selected', false);
}
if (Object.prototype.toString.call(apiCase.request).match(/\[object (\w+)\]/)[1].toLowerCase() != 'object') {
apiCase.request = JSON.parse(apiCase.request);
}
if (!apiCase.request.hashTree) {
apiCase.request.hashTree = [];
}
this.apiCase = apiCase
this.handleTestCase(apiCase)
})
});
},
getCurrentScenario(testCase) {
this.result = this.$get("/api/automation/getApiScenario/" + testCase.testId, response => {
this.currentScenario=response.data
});
},
handleTestCase(testCase) {
this.$get('/api/definition/get/' + testCase.apiDefinitionId, (response) => {
this.api = response.data;
});
},
initTest() {
this.$nextTick(() => {
if (this.testCase.testId && this.testCase.testId !== 'other') {
if (this.$refs.apiTestDetail && this.testCase.type === 'api') {
this.$refs.apiTestDetail.init();
} else if (this.testCase.type === 'performance') {
this.$refs.performanceTestDetail.init();
} else if (this.testCase.type === 'testcase') {
this.$refs.apiCaseConfig.active(this.api);
} else if (this.testCase.type === 'automation') {
this.$refs.autoScenarioConfig.showAll();
}
}
});
},
/* initTest() {
this.$nextTick(() => {
if (this.testCase.testId && this.testCase.testId !== 'other') {
if (this.$refs.apiTestDetail && this.testCase.type === 'api') {
this.$refs.apiTestDetail.init();
} else if (this.testCase.type === 'performance') {
this.$refs.performanceTestDetail.init();
} else if (this.testCase.type === 'testcase') {
this.$refs.apiCaseConfig.active(this.api);
} else if (this.testCase.type === 'automation') {
this.$refs.autoScenarioConfig.showAll();
}
}
});
},*/
getComments(testCase) {
let id = '';
if (testCase) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册