diff --git a/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql b/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql index facbb21e3f..d400cae649 100644 --- a/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql +++ b/backend/src/main/resources/db/migration/V2__metersphere_ddl.sql @@ -319,4 +319,29 @@ CREATE TABLE IF NOT EXISTS `test_plan_test_case` ( DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin; +CREATE TABLE IF NOT EXISTS `test_case_report_template` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(64) NOT NULL COMMENT 'Test case report template name', + `workspace_id` varchar(50) DEFAULT NULL COMMENT 'Workspace ID this project belongs to', + `content` longtext COMMENT 'Template content (JSON format)', + PRIMARY KEY (`id`) +) + ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_bin; + +CREATE TABLE IF NOT EXISTS `test_case_report` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `name` varchar(64) NOT NULL COMMENT 'Test case report name', + `plan_id` bigint(50) DEFAULT NULL COMMENT 'Plan ID relation to', + `content` longtext COMMENT 'Report content (JSON format)', + PRIMARY KEY (`id`) +) + ENGINE=InnoDB + DEFAULT CHARSET=utf8mb4 + COLLATE=utf8mb4_bin; + -- track end + + + diff --git a/backend/src/main/resources/db/migration/V3__init_data.sql b/backend/src/main/resources/db/migration/V3__init_data.sql index 9cce9258e1..a66cc043ec 100644 --- a/backend/src/main/resources/db/migration/V3__init_data.sql +++ b/backend/src/main/resources/db/migration/V3__init_data.sql @@ -10,3 +10,4 @@ INSERT INTO role (id, name, description, type, create_time, update_time) VALUES INSERT INTO role (id, name, description, type, create_time, update_time) VALUES ('test_user', '测试人员', null, null, 1581576575948, 1581576575948); INSERT INTO role (id, name, description, type, create_time, update_time) VALUES ('test_viewer', 'Viewer', null, null, 1581576575948, 1581576575948); +INSERT INTO test_case_report_template (name,content) VALUES ("默认模版","{\"components\":[1,2,3,4,5],\"contentMap\":{\"richTextComponentTitleSet\":{},\"richTextComponentContentSet\":{}}}"); diff --git a/frontend/package.json b/frontend/package.json index a21e6a8489..5fdab05896 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -8,6 +8,8 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "@ckeditor/ckeditor5-build-classic": "^18.0.0", + "@ckeditor/ckeditor5-vue": "^1.0.1", "@fortawesome/fontawesome-svg-core": "^1.2.26", "@fortawesome/free-regular-svg-icons": "^5.12.0", "@fortawesome/free-solid-svg-icons": "^5.12.0", diff --git a/frontend/src/assets/template.png b/frontend/src/assets/template.png new file mode 100644 index 0000000000..1edb6c8bf7 Binary files /dev/null and b/frontend/src/assets/template.png differ diff --git a/frontend/src/business/components/common/router/router.js b/frontend/src/business/components/common/router/router.js index 54525e8e35..8fe42dc524 100644 --- a/frontend/src/business/components/common/router/router.js +++ b/frontend/src/business/components/common/router/router.js @@ -8,6 +8,7 @@ import PerformanceTestPlan from "../../performance/test/PerformanceTestPlan"; import Organization from "../../settings/system/Organization"; import OrganizationMember from "../../settings/organization/OrganizationMember"; import Member from "../../settings/workspace/WorkspaceMember"; +import TestCaseReportTemplate from "../../settings/workspace/TestCaseReportTemplate"; import TestResourcePool from "../../settings/system/TestResourcePool"; import MsProject from "../../project/MsProject"; import OrganizationWorkspace from "../../settings/organization/OrganizationWorkspace"; @@ -78,6 +79,10 @@ const router = new VueRouter({ { path: 'testresourcepool', component: TestResourcePool + }, + { + path: 'testcase/report/template', + component: TestCaseReportTemplate } ] }, diff --git a/frontend/src/business/components/performance/report/components/RequestStatistics.vue b/frontend/src/business/components/performance/report/components/RequestStatistics.vue index ec51bb9e81..419f4e372b 100644 --- a/frontend/src/business/components/performance/report/components/RequestStatistics.vue +++ b/frontend/src/business/components/performance/report/components/RequestStatistics.vue @@ -5,7 +5,8 @@ stripe border style="width: 100%" - :default-sort = "{prop: 'samples', order: 'descending'}" + show-summary + :summary-method="getSummaries" > diff --git a/frontend/src/business/components/settings/SettingMenu.vue b/frontend/src/business/components/settings/SettingMenu.vue index 57bce97947..803f3bab74 100644 --- a/frontend/src/business/components/settings/SettingMenu.vue +++ b/frontend/src/business/components/settings/SettingMenu.vue @@ -28,6 +28,7 @@ {{$t('commons.workspace')}} {{$t('commons.member')}} + 测试报告模版 diff --git a/frontend/src/business/components/settings/workspace/TestCaseReportTemplate.vue b/frontend/src/business/components/settings/workspace/TestCaseReportTemplate.vue new file mode 100644 index 0000000000..af856ff6ea --- /dev/null +++ b/frontend/src/business/components/settings/workspace/TestCaseReportTemplate.vue @@ -0,0 +1,116 @@ + + + + + diff --git a/frontend/src/business/components/settings/workspace/components/TestCaseReportTemplateEdit.vue b/frontend/src/business/components/settings/workspace/components/TestCaseReportTemplateEdit.vue new file mode 100644 index 0000000000..c7d32cefff --- /dev/null +++ b/frontend/src/business/components/settings/workspace/components/TestCaseReportTemplateEdit.vue @@ -0,0 +1,256 @@ + + + + + diff --git a/frontend/src/business/main.js b/frontend/src/business/main.js index bbd6603b53..5f3587b8c3 100644 --- a/frontend/src/business/main.js +++ b/frontend/src/business/main.js @@ -14,6 +14,7 @@ import {permission} from './permission' import chart from "../common/js/chart"; import '../common/css/menu-header.css'; import '../common/css/main.css'; +import CKEditor from '@ckeditor/ckeditor5-vue'; Vue.config.productionTip = false; Vue.use(icon); @@ -23,7 +24,8 @@ Vue.use(ElementUI, { Vue.use(filters); Vue.use(ajax); Vue.use(chart); -Vue.use(message) +Vue.use(message); +Vue.use(CKEditor); // v-permission Vue.directive('permission', permission); diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 48e341a095..0000000000 --- a/package-lock.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "lockfileVersion": 1 -}