This commit is contained in:
X1627315083
2023-12-11 14:30:16 +08:00
parent d851f5e87c
commit 3a4d122af0
6 changed files with 110 additions and 27 deletions

View File

@@ -32,7 +32,7 @@
<div v-for="item,index in designItemDetail?.clothes" :class="{active:item.clothesOpen}" @click="clothesOpen(index)">
<img :src="item?.path" alt="">
</div>
<div>
<div class="detail_modal_body_Set" @click="setClothesOpen()">
+
</div>
</div>
@@ -197,6 +197,8 @@ export default defineComponent({
let moible:any = isMoible()
provide('moible',moible)
let {t} = useI18n()
//创建单件衣服
let setClothes:any = ref()
return{
designItemDetail,
store,
@@ -217,6 +219,7 @@ export default defineComponent({
driver__,
moible,
t,
setClothes,
}
},
data(){
@@ -442,8 +445,6 @@ export default defineComponent({
})()
}
// console.log(this.frontBack);
this.frontBack = {
front:front,
back:back,
@@ -602,11 +603,14 @@ export default defineComponent({
//按比设置单件衣服宽高位置
async setPostition(url:any){
let img:any = await loadImage(url)
let modal_body = <HTMLImageElement>document.getElementsByClassName('detail_modal_model')[0]
let modal_body:any
await nextTick().then(()=>{
modal_body = document.getElementsByClassName('detail_modal_model')[0]
})
console.log(modal_body);
const num = modal_body?.offsetWidth / img.width;
function loadImage(url:any) {
return new Promise((resolve, reject) => {
const img = new Image();
img.onload = () => {
resolve(img)
@@ -674,7 +678,7 @@ export default defineComponent({
},
clothesOpen(index:any){
this.clothesDetail('',index)
this.clothesOpenActive(index)
},
clothesOpenActive(index:any){
this.designItemDetail.clothes.forEach((item:any)=>{
@@ -682,13 +686,47 @@ export default defineComponent({
})
this.designItemDetail.clothes[index].clothesOpen = true
},
setClothesOpen(){
this.designItemDetail.clothes.forEach((item:any)=>{
item.clothesOpen = false
})
// console.log(designItemDetail);
// this.current = {
// "id": '',
// "type": "Bottoms",
// "level1Type": null,
// "path": "",
// "minIOPath": "",
// "color": {
// "id": 1921,
// "name": "",
// "tcx": "#FFFFFF",
// "r": 255,
// "g": 255,
// "b": 255,
// "h": '',
// "s": '',
// "v": ''
// },
// "printObject": {
// "ifSingle": null,
// "prints": [
// {}
// ]
// },
// "layersObject": [
// ]
// }
// this.currentIndex = 3
},
//元素替换
clothesDetail(clothes:any, index:number){
let designItemDetail = JSON.parse(JSON.stringify(this.store.state.DesignDetailModule.designItemDetail))
this.currentIndex = index
this.designOrder = true
this.current = designItemDetail.clothes[this.currentIndex]
this.clothesOpenActive(index)
console.log(this.current);
let data:any = this.setSubmitItem('preview')
data.designSingleItemDTOList[this.currentIndex] = {
color:`${this.current.color.r} ${this.current.color.g} ${this.current.color.b}`,
@@ -837,6 +875,12 @@ export default defineComponent({
// max-width: 245px;
width: 100%;
height: 100%;
.detail_modal_body_Set{
display: flex;
align-items: center;
justify-content: center;
font-size: 3.4rem;
}
.detail_modal_body_nav{
display: flex;
position: absolute;

View File

@@ -355,7 +355,7 @@ export default defineComponent({
async getSex(){
await Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:'Sex'}}).then((rv: any) => {
if (rv) {
this.store.commit("setWorkspaceSex", rv);
this.sex = rv
}
})
@@ -370,6 +370,7 @@ export default defineComponent({
await Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:params}}).then((rv: any) => {
if (rv) {
this.singleTypeList = rv
this.store.commit("setWorkspacePosition", rv);
if(str == 'sex'){
this.workspaceItem.position = this.singleTypeList[0].name
this.workspaceItem.positionEnum = this.singleTypeList[0]

View File

@@ -281,13 +281,14 @@ export default defineComponent({
let generateCheckbox:any = ref()
let loadingShow = ref(false)
let sketchCatecoryList:any = ref({})
let sketchCatecoryList:any = computed(()=>{
return store.state.Workspace.workspacePosition
})
let workspace:any = ref({})
let inputShow = ref(false)
let inputTime = ref()
let sketchboardList:any = computed(()=>{
return store.state.UploadFilesModule.sketchboard
})
let {t} = useI18n()
let driver__:any = inject('driver__')
@@ -321,6 +322,7 @@ export default defineComponent({
upload: {
isPin: 0,
level1Type: "Sketchboard",
gender:'',
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
},
token: "",
@@ -375,7 +377,10 @@ export default defineComponent({
watch:{
workspaceCom(newVal,oldVal){
this.workspace = newVal
this.getPosition()
this.upload.gender = newVal.sexEnum.name
console.log(this.workspace);
// this.getPosition()
},
sketchboardList:{
handler(newVal:any,oldVal:any){
@@ -427,20 +432,6 @@ export default defineComponent({
})
}
},
getPosition(){
let params
if(this.workspace?.sexEnum?.name == 'Female'){
params = 'FemalePosition'
}else{
params = 'MalePosition'
}
Https.axiosGet(Https.httpUrls.workspaceenumValues,{params:{enumName:params}}).then((rv: any) => {
if (rv) {
this.sketchCatecoryList = rv
}
})
},
getgenerateCheckbox(value:any){
this.generateCheckbox = value
},
@@ -451,6 +442,7 @@ export default defineComponent({
file.imgUrl = res.data.url;
file.resData = res.data;
// file.pin = false;
//category用来数据处理
file.categoryValue = this.sketchCatecoryList?.[0]?.value;
file.category = this.sketchCatecoryList?.[0]?.name;
file.categoryShow = false;

View File

@@ -88,10 +88,14 @@ export default defineComponent({
let driver__:any = computed(()=>{
return store.state.Guide.guide
})
let workspace:any = computed(()=>{
return store.state.Workspace.workspace
})
provide('driver__',driver__)
let isShowMark = ref(false)
return {
driver__,
workspace,
t,
isShowMark,
}
@@ -171,7 +175,37 @@ export default defineComponent({
}
});
},
isPin(list:any){
this.workspace
let numTop = 0
let numBottom = 0
let top:any
let bottom:any
if(this.workspace.sexEnum.name == "Female"){
top = ['Outwear','Blouse']
bottom = ['Dress','Trousers','Skirt']
}else{
top = ['Outwear','Tops']
bottom = ['Bottoms']
}
console.log(this.workspace);
list.forEach((item:any,index:number) => {
console.log(item);
top.forEach((positionItem:any) => {
if(item.category == positionItem && item.pin){
numTop++
}else{
numBottom++
}
});
});
if(numTop >= 8 || numBottom >= 8){
// message.warning(this.t('SketchboardUpload.jsContent1'));
return
}
},
//完成
finishCollection(){
this.isShowMark = true
@@ -187,6 +221,8 @@ export default defineComponent({
arr.push(obj)
});
let data = {sketchBoards:arr}
// console.log(this.position);
this.isPin(sketchList)
let elList = document.querySelectorAll('.img_block_item_sketch img')
Https.axiosPost(Https.httpUrls.sketchBoardsBoundingBox, data)
.then((rv: any) => {

View File

@@ -272,6 +272,7 @@ export default {
jsContent1:"Since you have selected multiple images, please click 'Layout' to proceed.",
jsContent2:'The uploaded files will not be saved, being sure to continue? ',
jsContent3:'You must choose one or more colors for further process.',
jsContent4:'You must choose one or more colors for further process.',
},
DesignDetail:{
Details:'Details',

View File

@@ -3,18 +3,27 @@ import {RootState} from '../index'
interface DesignDetail{
workspace:any,
workspaceSex:any,
workspacePosition:any,
}
const Workspace : Module<DesignDetail,RootState> = {
state:{
workspace:{}
workspace:{},
workspaceSex:{},
workspacePosition:{},
},
mutations:{
setWorkspace(state,files){
state.workspace = files
},
setWorkspaceSex(state,files){
state.workspaceSex = files
},
setWorkspacePosition(state,files){
state.workspacePosition = files
},
},
actions:{