Commit 9bba756a authored by chenjianxing's avatar chenjianxing
Browse files

refactor: 重构测试计划-场景测试

parent 3c32e61f
Showing with 209 additions and 229 deletions
+209 -229
......@@ -182,7 +182,7 @@ CREATE TABLE IF NOT EXISTS `api_test` (
`create_time` bigint(13) NOT NULL COMMENT 'Create timestamp',
`update_time` bigint(13) NOT NULL COMMENT 'Update timestamp',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE utf8mb4_general_ci;
CREATE TABLE IF NOT EXISTS `api_test_file` (
`test_id` varchar(64) DEFAULT NULL,
......
<template>
<ms-table-column :field="field"
:fields-width="fieldsWidth"
prop="createTime"
min-width="140px"
sortable="custom"
:label="$t('commons.create_time')">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</ms-table-column>
</template>
<script>
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
export default {
name: "MsCreateTimeColumn",
components: {MsTableColumn},
props: {
field: Object,
fieldsWidth: Object,
sortable: {
type: Boolean,
default() {
return true;
}
}
}
}
</script>
<style scoped>
</style>
......@@ -234,6 +234,7 @@ export default {
let minWidth = column.minWidth;
if(minWidth > newWidth){
column.width = minWidth;
newWidth = minWidth;
}
}
}
......@@ -307,6 +308,9 @@ export default {
this.$emit('update:fields', getCustomTableHeader(this.fieldKey, this.customFields));
this.reloadTable();
},
toggleRowSelection() {
this.$refs.table.toggleRowSelection();
},
reloadTable() {
this.tableActive = false;
this.$nextTick(() => {
......
<template>
<ms-table-column :field="field"
:fields-width="fieldsWidth"
prop="updateTime"
min-width="140px"
sortable
:label="$t('api_test.mock.table.update_time')">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</ms-table-column>
</template>
<script>
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
export default {
name: "MsUpdateTimeColumn",
components: {MsTableColumn},
props: {
field: Object,
fieldsWidth: Object,
sortable: {
type: Boolean,
default() {
return true;
}
}
}
}
</script>
<style scoped>
</style>
......@@ -71,28 +71,8 @@
:label="$t('custom_field.case_maintainer')"
min-width="120"/>
<ms-table-column
:field="item"
:fields-width="fieldsWidth"
sortable
min-width="160"
:label="$t('api_test.definition.api_last_time')"
prop="updateTime">
<template v-slot:default="scope">
<span>{{ scope.row.updateTime | timestampFormatDate }}</span>
</template>
</ms-table-column>
<ms-table-column
:field="item"
:fields-width="fieldsWidth"
sortable
min-width="160"
:label="$t('commons.create_time')"
prop="createTime">
<template v-slot:default="scope">
<span>{{ scope.row.createTime | timestampFormatDate }}</span>
</template>
</ms-table-column>
<ms-update-time-column :field="item" :fields-width="fieldsWidth"/>
<ms-create-time-column :field="item" :fields-width="fieldsWidth"/>
<ms-table-column
:field="item"
......@@ -180,11 +160,15 @@ import MsTaskCenter from "../../../../../task/TaskCenter";
import MsTable from "@/business/components/common/components/table/MsTable";
import MsTableColumn from "@/business/components/common/components/table/MsTableColumn";
import MsPlanRunMode from "@/business/components/track/plan/common/PlanRunMode";
import MsUpdateTimeColumn from "@/business/components/common/components/table/MsUpdateTimeColumn";
import MsCreateTimeColumn from "@/business/components/common/components/table/MsCreateTimeColumn";
export default {
name: "TestPlanApiCaseList",
components: {
MsPlanRunMode,
MsCreateTimeColumn,
MsUpdateTimeColumn,
MsTableColumn,
MsTable,
BatchEdit,
......@@ -378,10 +362,10 @@ export default {
if (this.$refs.table) {
this.$refs.table.clear();
setTimeout(this.$refs.table.doLayout, 200);
this.$nextTick(() => {
checkTableRowIsSelect(this, this.condition, this.tableData, this.$refs.table, this.$refs.table.selectRows);
});
}
this.$nextTick(() => {
checkTableRowIsSelect(this, this.condition, this.tableData, this.$refs.table, this.$refs.table.selectRows);
});
});
}
if (this.planId) {
......@@ -397,10 +381,10 @@ export default {
if (this.$refs.table) {
this.$refs.table.clear();
setTimeout(this.$refs.table.doLayout, 200);
this.$nextTick(() => {
checkTableRowIsSelect(this, this.condition, this.tableData, this.$refs.table, this.$refs.table.selectRows);
});
}
this.$nextTick(() => {
checkTableRowIsSelect(this, this.condition, this.tableData, this.$refs.table, this.$refs.table.selectRows);
});
});
}
},
......
......@@ -138,8 +138,9 @@ export const CUSTOM_TABLE_HEADER = {
{id: 'custom', key: '6', label: i18n.t('api_test.definition.api_last_time')},
{id: 'tags', key: '7', label: i18n.t('commons.tag')},
{id: 'execResult', key: '8', label: '执行状态'},
{id: 'maintainer', key: '9', label: i18n.t('api_test.definition.request.responsible')}
{id: 'maintainer', key: '9', label: i18n.t('api_test.definition.request.responsible')},
{id: 'updateTime', key: 'a', label: i18n.t('api_test.automation.update_time')},
{id: 'createTime', key: 'b', label: i18n.t('commons.create_time')},
],
//测试计划-性能用例
TEST_PLAN_LOAD_CASE: [
......@@ -158,12 +159,13 @@ export const CUSTOM_TABLE_HEADER = {
{id: 'name', key: '2', label: i18n.t('api_test.automation.scenario_name')},
{id: 'level', key: '3', label: i18n.t('api_test.automation.case_level')},
{id: 'tagNames', key: '4', label: i18n.t('api_test.automation.tag')},
{id: 'userId', key: '5', label: i18n.t('api_test.automation.creator')},
{id: 'updateTime', key: '6', label: i18n.t('api_test.automation.update_time')},
{id: 'stepTotal', key: '7', label: i18n.t('api_test.automation.success')},
{id: 'lastResult', key: '8', label: i18n.t('api_test.automation.fail')},
{id: 'passRate', key: '9', label: i18n.t('api_test.automation.passing_rate')},
{id: 'maintainer', key: 'a', label: i18n.t('api_test.definition.request.responsible')}
{id: 'maintainer', key: 'a', label: i18n.t('api_test.definition.request.responsible')},
{id: 'userId', key: '5', label: i18n.t('api_test.automation.creator')},
{id: 'updateTime', key: '6', label: i18n.t('api_test.automation.update_time')},
{id: 'createTime', key: 'b', label: i18n.t('commons.create_time')},
],
//测试用例
TRACK_TEST_CASE: [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment