Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
xiaofang li
MeterSphere
Commits
9bba756a
Commit
9bba756a
authored
4 years ago
by
chenjianxing
Browse files
Options
Download
Email Patches
Plain Diff
refactor: 重构测试计划-场景测试
parent
3c32e61f
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
backend/src/main/resources/db/migration/V2__metersphere_ddl.sql
+1
-1
...d/src/main/resources/db/migration/V2__metersphere_ddl.sql
frontend/src/business/components/common/components/table/MsCreateTimeColumn.vue
+34
-0
...components/common/components/table/MsCreateTimeColumn.vue
frontend/src/business/components/common/components/table/MsTable.vue
+4
-0
...c/business/components/common/components/table/MsTable.vue
frontend/src/business/components/common/components/table/MsUpdateTimeColumn.vue
+34
-0
...components/common/components/table/MsUpdateTimeColumn.vue
frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue
+12
-28
...nts/track/plan/view/comonents/api/TestPlanApiCaseList.vue
frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue
+117
-195
...track/plan/view/comonents/api/TestPlanApiScenarioList.vue
frontend/src/common/js/default-table-header.js
+7
-5
frontend/src/common/js/default-table-header.js
with
209 additions
and
229 deletions
+209
-229
backend/src/main/resources/db/migration/V2__metersphere_ddl.sql
+
1
-
1
View file @
9bba756a
...
...
@@ -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
,
...
...
This diff is collapsed.
Click to expand it.
frontend/src/business/components/common/components/table/MsCreateTimeColumn.vue
0 → 100644
+
34
-
0
View file @
9bba756a
<
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
>
This diff is collapsed.
Click to expand it.
frontend/src/business/components/common/components/table/MsTable.vue
+
4
-
0
View file @
9bba756a
...
...
@@ -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
(()
=>
{
...
...
This diff is collapsed.
Click to expand it.
frontend/src/business/components/common/components/table/MsUpdateTimeColumn.vue
0 → 100644
+
34
-
0
View file @
9bba756a
<
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
>
This diff is collapsed.
Click to expand it.
frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiCaseList.vue
+
12
-
28
View file @
9bba756a
...
...
@@ -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
);
});
});
}
},
...
...
This diff is collapsed.
Click to expand it.
frontend/src/business/components/track/plan/view/comonents/api/TestPlanApiScenarioList.vue
+
117
-
195
View file @
9bba756a
This diff is collapsed.
Click to expand it.
frontend/src/common/js/default-table-header.js
+
7
-
5
View file @
9bba756a
...
...
@@ -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
:
[
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment