generate交互更新

This commit is contained in:
X1627315083
2024-05-28 16:00:26 +08:00
26 changed files with 1536 additions and 412 deletions

View File

@@ -264,12 +264,12 @@ 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.store.commit("setWorkspace", this.workspaceItem);
}else{
this.getworkspace()
this.getworkspace('detail')
}
}
},
@@ -281,19 +281,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.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':{
@@ -334,10 +335,8 @@ export default defineComponent({
// new Promise((resolve) => {
// this.getPosition(resolve)
// })
await this.getPosition()
if(this.workspaceItem.id == -1){
this.getworkspace()
}
await this.getPosition()//获取衣服类型
this.getworkspace('')
this.getSex()
},
directives:{
@@ -449,7 +448,7 @@ export default defineComponent({
// this.getworkspace()
// this.setPosition('')
},
getworkspace(){
getworkspace(str:any){
// Https.axiosGet(Https.httpUrls.workspaceDetail,{params:{id:3}}).then((rv: any) => {
// if (rv) {
// console.log(rv,'workspace');
@@ -464,58 +463,23 @@ export default defineComponent({
Https.axiosPost(Https.httpUrls.workspaceList,data).then((rv: any) => {
if (rv) {
this.getDetail(rv.id)
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
this.total = rv.page.total
this.workspace.workspaceList = rv.page.content
return
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.workspaceItem.keyWord = {
// Moodboard:[{
// name:'Moodboard',
// id:1,
// },{
// name:'Moodboard',
// id:2,
// },{
// name:'Moodboard',
// id:3,
// }],
// Printboard:[{
// name:'Printboard',
// id:1,
// },{
// name:'Printboard',
// id:2,
// },{
// name:'Printboard',
// id:3,
// }],
// Sketchboard:[{
// name:'Sketchboard',
// id:1,
// },{
// name:'Sketchboard',
// id:2,
// },{
// name:'Sketchboard',
// id:3,
// }],
// }
// this.setMannequinsSex()
// this.setPosition('')
}
});
// this.workspaceItem = v
// this.setMannequinsSex()
// this.setPosition('')
}
})
},
@@ -527,12 +491,43 @@ export default defineComponent({
}else{
rv.overallSingle = true
}
rv.keyWord = {
Moodboard:[{
name:'Moodboard',
id:1,
},{
name:'Moodboard',
id:2,
},{
name:'Moodboard',
id:3,
}],
Printboard:[{
name:'Printboard',
id:1,
},{
name:'Printboard',
id:2,
},{
name:'Printboard',
id:3,
}],
Sketchboard:[{
name:'Sketchboard',
id:1,
},{
name:'Sketchboard',
id:2,
},{
name:'Sketchboard',
id:3,
}],
}
rv.putName = false
this.workspaceItem = rv
console.log(rv);
this.setMannequinsSex()
this.setPosition('')
// this.getworkspace()
}
})
},
@@ -558,25 +553,30 @@ 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()
}
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){
Https.axiosDelete(Https.httpUrls.workspaceRemove,data).then((rv: any) => {
if (rv) {
this.getworkspace()
this.getworkspace('')
}
})
},
@@ -631,6 +631,7 @@ export default defineComponent({
message.info(this.t('Habit.jsContent2'));
}else{
if(index == -1){
let data = {
workSpaceName:this.workspaceItemName,
}
@@ -644,7 +645,7 @@ export default defineComponent({
}
})
data.workSpaceName = this.workspaceItemName
this.putWorkspace(data,'')
this.putWorkspace(data,this.workspaceItem.id)
}
}
@@ -666,8 +667,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
},
//新建参数