From 620ffba7062ffcd436cc4e816f699533ddb2a1b3 Mon Sep 17 00:00:00 2001 From: X1627315083 <1627315083@qq.com> Date: Tue, 2 Jan 2024 16:42:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dsketchboard=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9B=BE=E7=89=87=E4=B8=8D=E6=98=BE=E7=A4=BA=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/Detail/habit.vue | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/component/Detail/habit.vue b/src/component/Detail/habit.vue index c2449abc..5ff7dbcc 100644 --- a/src/component/Detail/habit.vue +++ b/src/component/Detail/habit.vue @@ -329,6 +329,9 @@ export default defineComponent({ }; }, async mounted() { + // new Promise((resolve) => { + // this.getPosition(resolve) + // }) await this.getPosition() this.getworkspace() this.getSex() @@ -405,9 +408,8 @@ export default defineComponent({ }else{ num = 1 } + this.singleTypeList = this.position[num].value - console.log(this.position[num],this.singleTypeList); - this.store.commit("setWorkspacePosition", this.position[num].value); if(str == 'sex'){ @@ -416,16 +418,20 @@ export default defineComponent({ } }, async getPosition(){ - await Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:'FemalePosition'}}).then((rv: any) => { - if (rv) { - this.position[0].value = rv - } - }) - await Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:'MalePosition'}}).then((rv: any) => { - if (rv) { - this.position[1].value = rv - } + await new Promise(async (resolve) => { + await Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:'FemalePosition'}}).then((rv: any) => { + if (rv) { + this.position[0].value = rv + } + }) + await Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:'MalePosition'}}).then((rv: any) => { + if (rv) { + this.position[1].value = rv + } + }) + resolve('') }) + // this.getworkspace() // this.setPosition('') }, getworkspace(){