From 9c587130201fecf1e29f50b791fcd178047be885 Mon Sep 17 00:00:00 2001 From: X1627315083 <1627315083@qq.com> Date: Wed, 22 May 2024 11:40:49 +0800 Subject: [PATCH 1/5] fix --- src/component/Detail/habit.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/component/Detail/habit.vue b/src/component/Detail/habit.vue index 12115505..53cf7ab0 100644 --- a/src/component/Detail/habit.vue +++ b/src/component/Detail/habit.vue @@ -255,6 +255,8 @@ export default defineComponent({ this.openType.model = false // this.getDetail(this.workspaceItem.id) this.store.commit("setWorkspace", this.workspaceItem); + }else{ + this.getworkspace() } } }, From 48210a11f3dfac7f3e93c1e18d952ecacdc715ce Mon Sep 17 00:00:00 2001 From: X1627315083 <1627315083@qq.com> Date: Wed, 22 May 2024 14:08:50 +0800 Subject: [PATCH 2/5] fix --- .env.dev | 1 + src/component/Detail/habit.vue | 81 ++++++++++++++++++---------------- src/views/HomeView/library.vue | 22 ++++++++- 3 files changed, 65 insertions(+), 39 deletions(-) diff --git a/.env.dev b/.env.dev index b6e5858c..98ab4c2c 100644 --- a/.env.dev +++ b/.env.dev @@ -5,4 +5,5 @@ VUE_APP_BASE_URL = 'https://api.aida.com.hk' # VUE_APP_BASE_URL = 'http://18.167.251.121:10086' # VUE_APP_BASE_URL = 'https://develop.api.aida.com.hk' # VUE_APP_BASE_URL = 'http://192.168.1.9:17088' +VUE_APP_BASE_URL = 'http://192.168.1.9:5567' # VUE_APP_BASE_URL = 'http://192.168.1.7:5567' diff --git a/src/component/Detail/habit.vue b/src/component/Detail/habit.vue index 53cf7ab0..68de8701 100644 --- a/src/component/Detail/habit.vue +++ b/src/component/Detail/habit.vue @@ -268,20 +268,20 @@ export default defineComponent({ } } }, - 'workspaceItem.id_':{ + 'workspace.id':{ handler(newVal:any,oldVal:any){ - this.workspace.workspaceList.forEach((v:any)=>{ - if(v.id == this.workspaceItem.id_){ - this.workspaceItem = v - this.workspaceItem.id_ = v.id - } - if(v.id == oldVal){ - delete v.isLastIndex - this.putWorkspace(v,newVal) - this.getDetail(newVal) - } - }) - this.getMannequins() + // this.workspace.workspaceList.forEach((v:any)=>{ + // if(v.id == this.workspaceItem.id_){ + // this.workspaceItem = v + // this.workspaceItem.id_ = v.id + // } + // if(v.id == oldVal){ + // delete v.isLastIndex + // this.putWorkspace(v,newVal) + // this.getDetail(newVal) + // } + // }) + this.getDetail(newVal) } }, 'openType.workspace':{ @@ -341,7 +341,7 @@ export default defineComponent({ // new Promise((resolve) => { // this.getPosition(resolve) // }) - await this.getPosition() + await this.getPosition()//获取衣服类型 this.getworkspace() this.getSex() }, @@ -469,27 +469,17 @@ export default defineComponent({ Https.axiosPost(Https.httpUrls.workspaceList,data).then((rv: any) => { if (rv) { - rv.page.content.forEach((v:any) => { - v.id_ = v.id - if(v.position == "Overall"){ - v.overallSingle = false - }else{ - v.overallSingle = true - } - v.putName = false - if(v.id == (this.workspaceItem.id == -1 ?rv.id:this.workspaceItem.id)){ - this.workspaceItem = v - this.setMannequinsSex() - this.setPosition('') - } - }); - this.total = rv.page.total + // rv.page.content.forEach((v:any) => { + // v.id_ = v.id + // if(v.position == "Overall"){ + // v.overallSingle = false + // }else{ + // v.overallSingle = true + // } + // v.putName = false + // }); this.workspace.id = rv.id - // if(this.workspace.workspaceList){ - // this.workspace.workspaceList.push(...rv.page.content) - // }else{ - // this.workspace.workspaceList = rv.page.content - // } + this.total = rv.page.total this.workspace.workspaceList = rv.page.content } }) @@ -497,6 +487,15 @@ export default defineComponent({ getDetail(id:any){// Https.axiosGet(Https.httpUrls.workspaceDetail,{params:{id:id}}).then((rv: any) => { if (rv) { + if(rv.position == "Overall"){ + rv.overallSingle = false + }else{ + rv.overallSingle = true + } + rv.putName = false + this.workspaceItem = rv + this.setMannequinsSex() + this.setPosition('') // this.getworkspace() } }) @@ -524,12 +523,16 @@ export default defineComponent({ if(this.workspaceItem.id == -1){ return } + this.openType.model = false Https.axiosPost(Https.httpUrls.workspacesaveOrUpdate,data).then((rv: any) => { if (rv) { if(index){ // this.getDetail(index) }else{ - this.getworkspace() + } + this.getworkspace() + if(index){ + this.getDetail(index) } this.workspace.workspaceList[index].workSpaceName = this.workspaceItemName this.workspace.workspaceList[index].putName = false @@ -597,6 +600,7 @@ export default defineComponent({ message.info(this.t('Habit.jsContent2')); }else{ if(index == -1){ + let data = { workSpaceName:this.workspaceItemName, } @@ -610,7 +614,7 @@ export default defineComponent({ } }) data.workSpaceName = this.workspaceItemName - this.putWorkspace(data,'') + this.putWorkspace(data,this.workspaceItem.id) } } @@ -632,8 +636,9 @@ export default defineComponent({ this.workspace.workspaceList.forEach((v:any) => { v.putName = false }); - - this.workspaceItem.id_ = num + this.putWorkspace(this.workspaceItem,'') + this.workspace.id = num + // this.workspaceItem.id_ = num this.openType.workspace = false }, //新建参数 diff --git a/src/views/HomeView/library.vue b/src/views/HomeView/library.vue index fc4836dc..8ad06ce6 100644 --- a/src/views/HomeView/library.vue +++ b/src/views/HomeView/library.vue @@ -864,7 +864,27 @@ export default defineComponent({ centered:true, onOk() { data.deleteModelConfirm = 1 - + let id = _this.store.state.Workspace.workspace.id + Https.axiosGet(Https.httpUrls.workspaceDetail,{params:{id:id}}).then((rv: any) => { + if (rv) { + if(rv.position == "Overall"){ + rv.overallSingle = false + }else{ + rv.overallSingle = true + } + if(rv.sexEnum.name == 'Female'){ + rv.mannequinUrl = rv.femalePresignedUrl + rv.mannequinType = rv.mannequinFemaleType + rv.mannequinId = rv.mannequinFemaleId + }else if(rv.sexEnum.name == 'Male'){ + rv.mannequinUrl = rv.malePresignedUrl + rv.mannequinType = rv.mannequinMaleType + rv.mannequinId = rv.mannequinMaleId + } + + _this.store.commit("setWorkspace", rv); + } + }) _this.confirmDeletePic(data,index) }, onCancel(){ From a889523f6a950aaf86b299816dba2c78c112d866 Mon Sep 17 00:00:00 2001 From: X1627315083 <1627315083@qq.com> Date: Wed, 22 May 2024 14:17:01 +0800 Subject: [PATCH 3/5] fix --- .env.dev | 2 +- src/component/Detail/habit.vue | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.env.dev b/.env.dev index 98ab4c2c..e120d43e 100644 --- a/.env.dev +++ b/.env.dev @@ -5,5 +5,5 @@ VUE_APP_BASE_URL = 'https://api.aida.com.hk' # VUE_APP_BASE_URL = 'http://18.167.251.121:10086' # VUE_APP_BASE_URL = 'https://develop.api.aida.com.hk' # VUE_APP_BASE_URL = 'http://192.168.1.9:17088' -VUE_APP_BASE_URL = 'http://192.168.1.9:5567' +# VUE_APP_BASE_URL = 'http://192.168.1.9:5567' # VUE_APP_BASE_URL = 'http://192.168.1.7:5567' diff --git a/src/component/Detail/habit.vue b/src/component/Detail/habit.vue index 68de8701..23da2c60 100644 --- a/src/component/Detail/habit.vue +++ b/src/component/Detail/habit.vue @@ -253,6 +253,7 @@ export default defineComponent({ delete data.isLastIndex this.putWorkspace(data,'') this.openType.model = false + this.getDetail(this.workspaceItem.id) // this.getDetail(this.workspaceItem.id) this.store.commit("setWorkspace", this.workspaceItem); }else{ From 7eb695029d3a4dae137d5aa12de518031c19f1da Mon Sep 17 00:00:00 2001 From: X1627315083 <1627315083@qq.com> Date: Wed, 22 May 2024 14:54:37 +0800 Subject: [PATCH 4/5] fix --- src/component/Detail/habit.vue | 8 ++++---- src/store/workspace/workspace.ts | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/component/Detail/habit.vue b/src/component/Detail/habit.vue index 23da2c60..51e03c77 100644 --- a/src/component/Detail/habit.vue +++ b/src/component/Detail/habit.vue @@ -251,9 +251,8 @@ export default defineComponent({ } let data = this.workspaceItem delete data.isLastIndex - this.putWorkspace(data,'') + this.putWorkspace(data,this.workspaceItem.id) this.openType.model = false - this.getDetail(this.workspaceItem.id) // this.getDetail(this.workspaceItem.id) this.store.commit("setWorkspace", this.workspaceItem); }else{ @@ -531,16 +530,17 @@ export default defineComponent({ // this.getDetail(index) }else{ } - this.getworkspace() if(index){ this.getDetail(index) + }else{ + this.getworkspace() } this.workspace.workspaceList[index].workSpaceName = this.workspaceItemName this.workspace.workspaceList[index].putName = false this.openType.addWorkspace = false } }).catch((res)=>{ - this.getworkspace() + // this.getworkspace() }); }, deleteWorkspace(data:any){ diff --git a/src/store/workspace/workspace.ts b/src/store/workspace/workspace.ts index 2dfff126..b019133c 100644 --- a/src/store/workspace/workspace.ts +++ b/src/store/workspace/workspace.ts @@ -16,6 +16,8 @@ const Workspace : Module = { }, mutations:{ setWorkspace(state,files){ + console.log(files); + state.workspace = files }, setWorkspaceSex(state,files){ From f98ea231288c87c868e6a15a0b8d5e7697d954cd Mon Sep 17 00:00:00 2001 From: X1627315083 <1627315083@qq.com> Date: Wed, 22 May 2024 14:55:31 +0800 Subject: [PATCH 5/5] fix --- src/store/workspace/workspace.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/store/workspace/workspace.ts b/src/store/workspace/workspace.ts index b019133c..2dfff126 100644 --- a/src/store/workspace/workspace.ts +++ b/src/store/workspace/workspace.ts @@ -16,8 +16,6 @@ const Workspace : Module = { }, mutations:{ setWorkspace(state,files){ - console.log(files); - state.workspace = files }, setWorkspaceSex(state,files){