From 8ee491dd8492f332b27ee1529d51031168df914a Mon Sep 17 00:00:00 2001 From: baiqi Date: Wed, 21 Jun 2023 16:45:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E5=BE=AE=E5=89=8D=E7=AB=AF=E5=AD=90=E5=BA=94=E7=94=A8=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=9B=B4=E6=96=B0=E9=80=BB=E8=BE=91=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E6=9F=A5=E7=9C=8B=E6=8A=A5=E5=91=8A=E6=97=B6=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E4=B8=8D=E5=90=8C=E7=9A=84=E6=B5=8B=E8=AF=95=E5=9C=BA?= =?UTF-8?q?=E6=99=AF=E5=B1=95=E7=A4=BA=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1027023 --user=白奇 【测试跟踪】测试计划-报告统计中查看场景报告详情显示未同步变更 https://www.tapd.cn/55049933/s/1381694 --- api-test/frontend/src/main.js | 13 +- .../frontend/src/components/MicroApp.vue | 13 +- performance-test/frontend/src/main.js | 13 +- project-management/frontend/src/main.js | 13 +- report-stat/frontend/src/main.js | 13 +- system-setting/frontend/src/main.js | 13 +- .../component/ApiScenarioFailureResult.vue | 69 ++++---- .../detail/component/UiScenarioResult.vue | 158 ++++++++++-------- test-track/frontend/src/main.js | 13 +- workstation/frontend/src/main.js | 13 +- 10 files changed, 206 insertions(+), 125 deletions(-) diff --git a/api-test/frontend/src/main.js b/api-test/frontend/src/main.js index c669dca8fe..3af11cf8c0 100644 --- a/api-test/frontend/src/main.js +++ b/api-test/frontend/src/main.js @@ -106,7 +106,16 @@ export async function unmount(props) { } /** - * 可选生命周期钩子,仅使用 loadMicroApp 方式加载微应用时生效 + * 更新钩子,目前只有routeParams更新,后续有其他属性更新再添加 */ -export async function update(props) { +export async function update (props) { + const { defaultPath, routeParams, routeName } = props; + // 微服务过来的路由 + if (defaultPath || routeName) { + microRouter.push({ + path: defaultPath, + params: routeParams, + name: routeName, + }); + } } diff --git a/framework/sdk-parent/frontend/src/components/MicroApp.vue b/framework/sdk-parent/frontend/src/components/MicroApp.vue index 5e2ac900cd..6fdfbbc240 100644 --- a/framework/sdk-parent/frontend/src/components/MicroApp.vue +++ b/framework/sdk-parent/frontend/src/components/MicroApp.vue @@ -21,7 +21,18 @@ export default { microApp: null, } }, - + watch: { + routeParams: { + handler() { + this.microApp.update({ + defaultPath: this.to, + routeParams: this.routeParams, + routeName: this.routeName, + }); + }, + deep: true, + } + }, mounted() { this.microAppInit() this.messageInit() diff --git a/performance-test/frontend/src/main.js b/performance-test/frontend/src/main.js index a1a25dce5e..a0e3223e8e 100644 --- a/performance-test/frontend/src/main.js +++ b/performance-test/frontend/src/main.js @@ -97,7 +97,16 @@ export async function unmount(props) { } /** - * 可选生命周期钩子,仅使用 loadMicroApp 方式加载微应用时生效 + * 更新钩子,目前只有routeParams更新,后续有其他属性更新再添加 */ -export async function update(props) { +export async function update (props) { + const { defaultPath, routeParams, routeName } = props; + // 微服务过来的路由 + if (defaultPath || routeName) { + microRouter.push({ + path: defaultPath, + params: routeParams, + name: routeName, + }); + } } diff --git a/project-management/frontend/src/main.js b/project-management/frontend/src/main.js index 568725a37e..ee62789b43 100644 --- a/project-management/frontend/src/main.js +++ b/project-management/frontend/src/main.js @@ -92,7 +92,16 @@ export async function unmount(props) { } /** - * 可选生命周期钩子,仅使用 loadMicroApp 方式加载微应用时生效 + * 更新钩子,目前只有routeParams更新,后续有其他属性更新再添加 */ -export async function update(props) { +export async function update (props) { + const { defaultPath, routeParams, routeName } = props; + // 微服务过来的路由 + if (defaultPath || routeName) { + microRouter.push({ + path: defaultPath, + params: routeParams, + name: routeName, + }); + } } diff --git a/report-stat/frontend/src/main.js b/report-stat/frontend/src/main.js index 478a403d12..b8712d3c3a 100644 --- a/report-stat/frontend/src/main.js +++ b/report-stat/frontend/src/main.js @@ -93,7 +93,16 @@ export async function unmount(props) { } /** - * 可选生命周期钩子,仅使用 loadMicroApp 方式加载微应用时生效 + * 更新钩子,目前只有routeParams更新,后续有其他属性更新再添加 */ -export async function update(props) { +export async function update (props) { + const { defaultPath, routeParams, routeName } = props; + // 微服务过来的路由 + if (defaultPath || routeName) { + microRouter.push({ + path: defaultPath, + params: routeParams, + name: routeName, + }); + } } diff --git a/system-setting/frontend/src/main.js b/system-setting/frontend/src/main.js index 41a6927fd7..7e543ef6a9 100644 --- a/system-setting/frontend/src/main.js +++ b/system-setting/frontend/src/main.js @@ -90,7 +90,16 @@ export async function unmount(props) { } /** - * 可选生命周期钩子,仅使用 loadMicroApp 方式加载微应用时生效 + * 更新钩子,目前只有routeParams更新,后续有其他属性更新再添加 */ -export async function update(props) { +export async function update (props) { + const { defaultPath, routeParams, routeName } = props; + // 微服务过来的路由 + if (defaultPath || routeName) { + microRouter.push({ + path: defaultPath, + params: routeParams, + name: routeName, + }); + } } diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/component/ApiScenarioFailureResult.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/component/ApiScenarioFailureResult.vue index 2074b47669..ac82eae30c 100644 --- a/test-track/frontend/src/business/plan/view/comonents/report/detail/component/ApiScenarioFailureResult.vue +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/component/ApiScenarioFailureResult.vue @@ -58,21 +58,8 @@
- +
@@ -90,6 +83,7 @@