From a3395cd0b22ee8eeab57800819dcd084784e4ef5 Mon Sep 17 00:00:00 2001 From: Fine Date: Tue, 31 Jan 2023 13:44:40 +0800 Subject: [PATCH] feat: set params and selectors --- src/router/dashboard.ts | 3 +- src/store/modules/selectors.ts | 6 +-- src/views/dashboard/Widget.vue | 74 +++++++++++++++++++++++----------- 3 files changed, 54 insertions(+), 29 deletions(-) diff --git a/src/router/dashboard.ts b/src/router/dashboard.ts index 93532b71..23414a9a 100644 --- a/src/router/dashboard.ts +++ b/src/router/dashboard.ts @@ -178,7 +178,6 @@ export const routesDashboard: Array = [ }, { path: "", - redirect: "/widget/:config", name: "Widget", component: () => import("@/views/dashboard/Widget.vue"), meta: { @@ -186,7 +185,7 @@ export const routesDashboard: Array = [ }, children: [ { - path: "/widget/:config", + path: "/page/:entity/:serviceId/:podId/:processId/:destServiceId/:destPodId/:destProcessId/:config", component: () => import("@/views/dashboard/Widget.vue"), name: "ViewWidget", }, diff --git a/src/store/modules/selectors.ts b/src/store/modules/selectors.ts index ae836099..580aba7f 100644 --- a/src/store/modules/selectors.ts +++ b/src/store/modules/selectors.ts @@ -211,12 +211,12 @@ export const selectorStore = defineStore({ return res.data; }, - async getProcess(instanceId: string, isRelation?: boolean) { - if (!instanceId) { + async getProcess(processId: string, isRelation?: boolean) { + if (!processId) { return; } const res: AxiosResponse = await graphql.query("queryProcess").params({ - instanceId, + processId, }); if (!res.data.errors) { if (isRelation) { diff --git a/src/views/dashboard/Widget.vue b/src/views/dashboard/Widget.vue index c1fad2d9..275f358f 100644 --- a/src/views/dashboard/Widget.vue +++ b/src/views/dashboard/Widget.vue @@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -->