From 49ab26200d2ce91150434b05d5df01f74f141caf Mon Sep 17 00:00:00 2001 From: zhengkunwang223 <31820853+zhengkunwang223@users.noreply.github.com> Date: Sun, 9 Apr 2023 20:58:16 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=BF=90=E8=A1=8C=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E5=92=8C=E7=89=88=E6=9C=AC=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E8=81=94=E5=8A=A8=20(#545)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/website/runtime/create/index.vue | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/website/runtime/create/index.vue b/frontend/src/views/website/runtime/create/index.vue index 318e32a86..e7d56dadc 100644 --- a/frontend/src/views/website/runtime/create/index.vue +++ b/frontend/src/views/website/runtime/create/index.vue @@ -34,7 +34,11 @@ - + (); const loading = ref(false); const initParam = ref(false); const mode = ref('create'); -let appParams = ref(); -let editParams = ref(); -let appVersions = ref([]); -let appReq = reactive({ +const appParams = ref(); +const editParams = ref(); +const appVersions = ref([]); +const appReq = reactive({ type: 'php', page: 1, pageSize: 20, @@ -136,7 +140,7 @@ const runtime = ref({ type: 'php', resource: 'appstore', }); -let rules = ref({ +const rules = ref({ name: [Rules.appName], resource: [Rules.requiredInput], appId: [Rules.requiredSelect], @@ -180,6 +184,16 @@ const searchApp = (appId: number) => { } }); }; + +const changeApp = (appId: number) => { + for (const app of apps.value) { + if (app.id === appId) { + getApp(app.key, mode.value); + break; + } + } +}; + const getApp = (appkey: string, mode: string) => { GetApp(appkey).then((res) => { appVersions.value = res.data.versions || [];