<template>
    <div ref="designDetailModal" class="designDetailModal" v-if="designDetailShow">
		<!-- designDetailShow -->
		<!-- :class="[driver__.driver?'hideEvents':'']" -->
        <a-modal class="Guide_1_18 generalModel fullScreen" 
            v-model:visible="designDetailShow" 
            :footer="null" 
			:get-container="() => $refs.designDetailModal"
            width="100%"
			height="100%"
            :maskClosable="false"
			:mask="false"
            :centered="true"
			:keyboard="false"
			:destroyOnClose="true"
			:closable="false"
        >
			<div class="content">
				<div class="nav" :class="{isEditPattern:isEditPattern.value}">
					<div class="back_home">
						<div class="gallery_btn" @click="closeModal()">
							<i class="fi fi-rs-house-chimney"></i>
						</div>
					</div>
					<div class="nav_list">
						<div class="nav_item" :class="{active:currentDetailType == 'sketch'}" @click="setCurrentDetail('sketch')">
							<img src="@/assets/images/icon/details_sketch.png" alt="">
							<div class="detailText">{{$t('DesignPrintOperation.Apparel')}}</div>
						</div>
						<div class="nav_item" :class="{active:currentDetailType == 'print'}" @click="setCurrentDetail('print')">
							<img src="@/assets/images/icon/details_print.png" alt="">
							<div class="detailText">{{$t('DesignPrintOperation.Print')}}</div>
						</div>
						<div class="nav_item" :class="{active:currentDetailType == 'color'}" @click="setCurrentDetail('color')">
							<img src="@/assets/images/icon/details_color.png" alt="">
							<div class="detailText">{{$t('DesignPrintOperation.Color')}}</div>
						</div>
						<div class="nav_item" :class="{active:currentDetailType == 'element'}" @click="setCurrentDetail('element')">
							<img src="@/assets/images/icon/details_elements.png" alt="">
							<div class="detailText">{{$t('DesignPrintOperation.Elements')}}</div>
						</div>
						<!-- <div class="nav_item" :class="{active:currentDetailType == 'accessory'}" @click="setCurrentDetail('accessory')">
							<img src="@/assets/images/icon/details_elements.png" alt="">
							<div class="detailText">{{$t('DesignPrintOperation.Accessory')}}</div>
						</div> -->
						<div class="nav_item" v-if="selectObject.type == 'seriesDesign'" :class="{active:currentDetailType == 'models'}" @click="setCurrentDetail('models')">
							<img src="@/assets/images/icon/details_model.svg" alt="">
							<div class="detailText">{{$t('DesignPrintOperation.Model')}}</div>
						</div>
					</div>
				</div>
				<div class="item detailLeft" :class="{isEditPattern:isEditPattern.value}">
					<detailLeft v-if="currentDetailType" ref="detailLeft"></detailLeft>
					<!-- <detailLeft v-if="selectDetail && selectDetail.id && currentDetailType"></detailLeft> -->
					 <div class="btn" style="margin: 0;" v-show="currentDetailType == 'color'">
						<div class="gallery_btn" @click="previwe">{{$t('DesignPrintOperation.Preview')}}</div>
					</div>
				</div>

				<div class="item model" >
					<model 
						ref="model" 
						:key="positionKey"
						@addDetail="addDetail"
						@canvasReload="canvasReload" 
						@detailEdit="detailEdit" 
						@addSketch="()=>isEditPattern.value = ''"
						@revocation="revocation"
						@oppositeRevocation="oppositeRevocation"
						@modelOnLoad="modelOnLoad"
						@sketchSysToLibrary="sketchSysToLibrary"
					></model>
					<div class="btn">
						<div class="gallery_btn" style="margin-right: 0;" @click="submit">{{$t('DesignPrintOperation.Submit')}}</div>
						<div v-show="isEditPattern.value" style="margin-left: 2rem;" class="gallery_btn" @click="previwe">{{$t('DesignPrintOperation.Preview')}}</div>
					</div>
				</div>
				<div class="item detailRight" :class="{canvas:isEditPattern.value}">
					<div class="submit">
					</div>
					<div class="contentRight" v-if="currentDetailType === 'sketch' && !selectDetail?.newDetail?.[currentDetailType] && !selectDetail.sketchString && !isEditPattern.value">
						<img 
							style="width: 100%; height: 100%;object-fit: contain;"
							:src="
							'/image/toolsGuide/' +
							(locale == 'ENGLISH' ? 'detailEN' : 'detailCN') +
							'.png'
						" alt="">
					</div>
					<div class="contentRight" v-else-if="currentDetailType && !isEditPattern.value">
						<detailRight ref="detailRight"></detailRight>
						<div class="btn" 
							v-show="
								currentDetailType !== 'color' &&
								(currentDetailType === 'element' ||
								currentDetailType === 'accessory' ||
								currentDetailType === 'print' ||
								(currentDetailType === 'sketch' && selectDetail?.newDetail?.[currentDetailType])|| 
								(currentDetailType === 'sketch' && selectDetail?.sketchString)|| 
								(currentDetailType === 'models' && designDetail?.newModel))
								"
						>
							<div class="gallery_btn" @click="previwe">{{$t('DesignPrintOperation.Preview')}}</div>
						</div>
					</div>
					<div class="contentRight" v-if="selectDetail && selectDetail.id && currentDetailType && isEditPattern.value">
						<canvasBox ref="canvasBox" :key="canvasKey || isEditPattern.value" :isEditPattern="isEditPattern.value"></canvasBox>
					</div>
					<!-- 画布 -->
					<!-- <div class="content" v-else-if="selectDetail && selectDetail.id">
					</div> -->
				</div>
			</div>
			<addDetails ref="addDetails" @setSloganData="setSloganData"></addDetails>
        </a-modal>
         <div class="mark_loading" v-show="loadingShow">
            <a-spin size="large" />
        </div>
    </div>
    
</template>
<script lang="ts">
import { defineComponent,computed,onBeforeUnmount,provide,nextTick,createVNode,toRefs, reactive, onMounted, watch} from 'vue'
import detailLeft from './detailLeft/index.vue'
import model from './model/index.vue'
import detailRight from './detailRight/index.vue'
import canvasBox from './canvas/index.vue'

// import setDesignItem from '@/component/Detail/setDesignItem2.vue'
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
import { Https } from "@/tool/https";
import { Modal,message } from 'ant-design-vue';
import {getUploadUrl,isMoible,setGradual} from '@/tool/util'
import { useStore } from "vuex";
import { openGuide,driverObj__ } from "@/tool/guide";
import { useI18n } from 'vue-i18n'
import addDetails from '@/component/Detail/addDetails.vue'
export default defineComponent({
    components:{
		detailLeft,model,detailRight,canvasBox,addDetails
    },
	emits:['destroy'],
    setup(props,{emit}) {
        const store = useStore();
		const {locale} = useI18n()
		const detailDom = reactive({
			model:null,
			canvasBox,
			detailRight,
			detailLeft:null as any,
			addDetails:null as any,
		})
		const userDetail = computed(()=>{
			return store.state.UserHabit.userDetail
		})
		const detailData = reactive({
			selectObject:computed(()=>store.state.Workspace.probjects) as any,//选择的项目
			designDetail:computed(()=>store.state.DesignDetail.designDetail),
			currentDetailType:computed(()=>store.state.DesignDetail.currentDetailType),
			selectDetail:computed(()=>store.state.DesignDetail.selectDetail),
			designDetailShow:false,
			loadingShow:false,
			oppositeRevocationShow:-1,
			revocationShow:-1,
			isEditPattern:{
				value:'' as any,
			},// 是否编辑图案
			canvasKey:0,
			singleOveral:{
				value:'overall'
			},
			getCanvasIfEdit:{
				fun:null,
			},
			positionKey:0,
			isUndividedLayerWithSinglePrint:false,
		})
		

		provide('getCanvasIfEdit',detailData.getCanvasIfEdit)
		provide('singleOveral',detailData.singleOveral)
		provide('isEditPattern',detailData.isEditPattern)
		const closeModal = ()=>{
			sessionStorage.removeItem('oppositeRevocation')
			sessionStorage.removeItem('revocation')
			detailData.designDetailShow = false
			emit('destroy')
		}
		
		const showDesignDetailModal = (data:any,str:any)=>{
			return new Promise<void>((resolve, reject) => {
				store.commit('DesignDetail/clearDetailData')
				// let url = Https.httpUrls.getDesignDetail + `?designItemId=${77770}&designPythonOutfitId=${77423}`
				let url = Https.httpUrls.getDesignDetail + `?designItemId=${data.design.designItemId}&designPythonOutfitId=${data.design.designOutfitId}`
				detailData.loadingShow = true
				Https.axiosGet(url).then(
					async (rv: any) => {
						store.commit('DesignDetail/setDesignDetail',rv)
						rv.clothes.forEach((item:any)=>{
							let a
							item.designType='Library'
							if(item.layersObject[0].imageCategory.indexOf("back") == -1){
								a = item.layersObject[0]
								item.layersObject[0] = item.layersObject[1]
								item.layersObject[1] = a
							}
							if(item.color){
								item.color.rgba = {
									r:item.color.r,
									g:item.color.g,
									b:item.color.b,
								}
							}else{
								item.color = {
									// rgba:{
									// 	r:undefined,
									// 	g:undefined,
									// 	b:undefined,
									// }
								}
							}
							if(item.gradient){
								item.color.gradient = item.gradient
							}
							if(item.printObject.prints == null)item.printObject.prints = []
							item.printObject.prints.forEach((element:any) => {
								if(!element.designType){
									element.designType = 'Library'
								}
							});
							if(!item.layersObject[0].undividedLayerWithSinglePrint){
								detailData.isUndividedLayerWithSinglePrint = true
							}
						})
						detailData.singleOveral.value = rv.singleOverall
						detailData.designDetailShow = true
						// this.deleteShow = false
						initialize()
						setRevocation()
						if(rv.singleOverall == "single"){
							store.commit('DesignDetail/setDesignColthes',rv.clothes[0].id)
							modelOnLoad()
						}


						if(detailData.isUndividedLayerWithSinglePrint){
						}else{
							detailData.loadingShow = false
						}
						resolve(rv)
					}
				).catch(rv=>{
					detailData.loadingShow = false
					resolve(rv)
				})
			})
			
		}
		const initialize = ()=>{//design后初始化

			
			sessionStorage.removeItem('oppositeRevocation')
			sessionStorage.removeItem('revocation')
		}
		//撤回
		const setRevocation = ()=>{//设置撤销
			let itemDetail = JSON.parse(JSON.stringify(detailData.designDetail))
			let revocation:any = JSON.parse((sessionStorage.getItem("revocation") as any))
			if(!revocation)revocation = []
			// let oppositeRevocation = JSON.parse((sessionStorage.getItem("oppositeRevocation") as any))
			// if(revocation?.[0]?.designItemId != itemDetail.designItemId || revocation?.[0]?.designItemId == undefined){
			// 	revocation = []
			// }
			revocation.push({designData:itemDetail,position:null})
			detailData.revocationShow = revocation?.length
			sessionStorage.setItem('revocation', JSON.stringify(revocation));
			sessionStorage.setItem('oppositeRevocation',JSON.stringify([]));
		}
		provide('setRevocation',setRevocation)

		const revocation = ()=>{//撤回
			let oppositeRevocation = JSON.parse((sessionStorage.getItem("oppositeRevocation") as any))
			let revocation = JSON.parse((sessionStorage.getItem("revocation") as any))
			if(revocation.length <= 1)return
			oppositeRevocation.push(revocation[revocation.length-1])
			revocation.splice(revocation.length-1,1)
			detailData.revocationShow = revocation.length
			// store.commit("DesignDetail/setDesignDetail", revocation[revocation.length-1]);
			if(revocation[revocation.length-1].designData){
				store.commit('DesignDetail/setDesignDetail',revocation[revocation.length-1].designData)
			}else{
				store.commit('DesignDetail/setFrontBack',revocation[revocation.length-1].position)
			}
			store.commit('DesignDetail/setDesignColthes',detailData.selectDetail.id)
			sessionStorage.setItem('oppositeRevocation', JSON.stringify(oppositeRevocation));
			sessionStorage.setItem('revocation', JSON.stringify(revocation));
			// clearSelect()
			detailData.positionKey++
		}
		const oppositeRevocation = ()=>{//反撤回
			let oppositeRevocation = JSON.parse((sessionStorage.getItem("oppositeRevocation") as any))
			let revocation = JSON.parse((sessionStorage.getItem("revocation") as any))
			// if(!oppositeRevocation[oppositeRevocation.length-1].designData)return
			if(oppositeRevocation.length < 1)return
			if(oppositeRevocation[oppositeRevocation.length-1]?.designData){
				store.commit('DesignDetail/setDesignDetail',oppositeRevocation[oppositeRevocation.length-1].designData)
			}else if(oppositeRevocation[oppositeRevocation.length-1]?.position){
				store.commit('DesignDetail/setFrontBack',oppositeRevocation[oppositeRevocation.length-1].position)
			}
			store.commit('DesignDetail/setDesignColthes',detailData.selectDetail.id)
			revocation.push(oppositeRevocation[oppositeRevocation.length-1])
			detailData.revocationShow = revocation.length
			oppositeRevocation.splice(oppositeRevocation.length-1,1)
			detailData.oppositeRevocationShow = oppositeRevocation.length
			sessionStorage.setItem('oppositeRevocation', JSON.stringify(oppositeRevocation));
			sessionStorage.setItem('revocation', JSON.stringify(revocation));
			// this.clearSelect()
			detailData.positionKey++
		}
		const setCurrentDetail = (str:string)=>{
			store.commit('DesignDetail/setCurrentDetailType',str)
		}
		const setClothes = async (list:any)=>{
			let clothesList:any = []
			await nextTick()
			for(let i = 0;i<list.length;i++){
				detailData.selectDetail
			    let {scale,offset,priority,maskUrl,maskMinioUrl} = await (detailDom.model as any).getSubmitData(list[i],detailData.isUndividedLayerWithSinglePrint)
				if(detailDom.canvasBox?.privewDetail)await (detailDom.canvasBox as any).privewDetail()
				if(detailDom.detailRight?.privewDetail)await (detailDom.detailRight as any).privewDetail()
				let gradient = null
				let newData = list[i]?.newDetail?.[detailData.currentDetailType]
				// newData[0].location=[
				// 	-233.13985,
				// 	406.90964
				// ]	
				// newData[0].scale=[
				// 0.5,
				// 0.35822305
				// ]	
				let isCurrent = list[i].id == detailData?.selectDetail?.id
				let color = (detailData.currentDetailType == 'color' && isCurrent && !detailData.isEditPattern.value)?
				(newData?.rgba?.r?`${newData.rgba.r} ${newData.rgba.g} ${newData.rgba.b}`:''):
				(list[i].color?.rgba?.r?
				`${list[i].color.rgba.r} ${list[i].color.rgba.g} ${list[i].color.rgba.b}`:
				'')
				if(detailData.currentDetailType == 'sketch' && newData){
					color = detailData.designDetail.clothes?.[0]?.color?.rgba?.r?`${detailData.designDetail.clothes?.[0].color.rgba.r} ${detailData.designDetail.clothes[0].color.rgba.g} ${detailData.designDetail.clothes[0].color.rgba.b}`:''
					detailData.selectDetail.maskUrl = ''
					detailData.selectDetail.maskMinioUrl = ''
				}
				let data:any = {
					changed:false,
					color,
					designType:(newData && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData.designType:list[i].designType,
					id:(newData && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData.id:list[i].id,
					maskMinioUrl:((newData && detailData.currentDetailType == 'sketch') || list[i].sketchString)?'':list[i]?.maskMinioUrl,
					// maskUrl:'',
					maskUrl:((newData && detailData.currentDetailType == 'sketch') || list[i].sketchString)?'':list[i]?.maskUrl,
					// offset:[
                    //                 -233.13985,
                    //                 406.90964
                    //             ],
					offset,
					partialDesign:list[i].partialDesign || {},
					// partialDesign:detailData.isEditPattern.value?list[i].partialDesign:{},
					path:(newData && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData.minIOPath:list[i].minIOPath,
					printObject:(newData && detailData.currentDetailType == 'print' && isCurrent && !detailData.isEditPattern.value)?{prints:newData}:list[i].printObject?list[i].printObject:{prints:[]},
					priority,
					// scale:[
                    //                 0.5,
                    //                 0.35822305
                    //             ],
					scale:[scale[0]?scale[0]:1,scale[1]?scale[1]:1],
					type:(newData && detailData.currentDetailType == 'sketch' && isCurrent && !detailData.isEditPattern.value)?newData.level2Type || newData.categoryValue:list[i].type,
					sketchString:list[i].sketchString?list[i].sketchString:'',
					trims:(newData && detailData.currentDetailType == 'element' && isCurrent && !detailData.isEditPattern.value)?{prints:newData}:list[i].trims?.prints?list[i].trims:{prints:[]},
					accessory:(newData && detailData.currentDetailType == 'accessory' && isCurrent && !detailData.isEditPattern.value)?{prints:newData}:list[i].trims?.prints?list[i].trims:{prints:[]},
				}
				if((detailData.isEditPattern.value && list[i].color?.gradient) || (!detailData.isEditPattern.value && (list[i].newDetail?.color?.gradient || list[i].color?.gradient))){
					gradient = list[i].newDetail?.color?.gradient || list[i].color.gradient
					gradient.colorImg = await setGradual(gradient,320,700)
					data.gradient = gradient
				}
				clothesList.push(data)
			}
			return clothesList
		}
		const getSubmitData = async (str:string)=>{
			// return
			let workspace = store.state.Workspace.probjects
			if(!detailData?.selectDetail?.path && !detailData?.selectDetail?.newDetail?.sketch?.minIOPath)return
			let clothes:any
			if(detailData.currentDetailType == 'models' || detailData.isUndividedLayerWithSinglePrint){
				clothes = await setClothes(detailData.designDetail.clothes)
			}else{
				clothes = await setClothes([detailData.selectDetail])
			}
			let data = {
				designItemId:detailData.designDetail.designItemId,
				designSingleItemDTOList:clothes,
				isPreview:str == 'sub'?false:true,
				// ifSubmit:designItemDetail.isPreview,
				gender:workspace?.sex,
				sketchString:'',
				modelId:(detailData.currentDetailType == 'models' && detailData.designDetail.newModel)?detailData.designDetail.newModel.id:detailData.designDetail.oldModel?detailData.designDetail.oldModel.id:'',
				modelType:(detailData.currentDetailType == 'models' && detailData.designDetail.newModel)?detailData.designDetail.newModel.type:detailData.designDetail.oldModel?detailData.designDetail.oldModel.type:'',
				timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
				processId:userDetail.value.userId,
				probjectId:store.state.Workspace.probjects.id,
			}
			detailData.loadingShow = true
			Https.axiosPost(Https.httpUrls.designSingle, data).then((rv)=>{
				let value = {
					currentType : JSON.parse(JSON.stringify(detailData.currentDetailType)),
					rv:rv,
					fun:setRevocation
				}
				if(detailData?.designDetail?.newModel)detailData.designDetail.oldModel = JSON.parse(JSON.stringify(detailData.designDetail.newModel))
				delete detailData.designDetail.newModel
				store.commit('DesignDetail/setPraeview',value)
				detailData.loadingShow = false
				detailData.isUndividedLayerWithSinglePrint = false
				canvasReload()
				// setRevocation()
			}).catch(res=>{ 
				detailData.loadingShow = false
            });
		}
		const submit = async ()=>{
			let workspace = store.state.Workspace.probjects
			let clothes:any = await setClothes(detailData.designDetail.clothes)
			let data = {
				designItemId:detailData.designDetail.designItemId,
				designSingleItemDTOList:clothes,
				isPreview:false,
				// ifSubmit:designItemDetail.isPreview,
				gender:workspace?.sex,
				sketchString:'',
				modelId:(detailData.currentDetailType == 'models' && detailData.designDetail.newModel)?detailData.designDetail.newModel.id:detailData.designDetail.oldModel?detailData.designDetail.oldModel.id:'',
				modelType:(detailData.currentDetailType == 'models' && detailData.designDetail.newModel)?detailData.designDetail.newModel.type:detailData.designDetail.oldModel?detailData.designDetail.oldModel.type:'',
				timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,
				processId:userDetail.value.userId,
				probjectId:store.state.Workspace.probjects.id,
			}
			detailData.loadingShow = true
			Https.axiosPost(Https.httpUrls.designSingle, data).then((rv)=>{
				// store.commit('DesignDetail/setPraeview',rv)
				let designCollectionList = store.state.HomeStoreModule.designCollectionList
				let likeDesignCollectionList = store.state.HomeStoreModule.likeDesignCollectionList
				designCollectionList.forEach((item:any) => {
					if(item.designItemId == rv.designItemId){
						item.designOutfitUrl = rv.designItemUrl
					}
				});
				likeDesignCollectionList.forEach((item:any) => {
					if(item.designItemId == rv.designItemId){
						item.designOutfitUrl = rv.designItemUrl
					}
				});
				store.commit('setDesignCollectionList',designCollectionList)
				store.commit('setLikeDesignCollectionList',likeDesignCollectionList)
				closeModal()
				detailData.loadingShow = false
			}).catch(res=>{ 
				detailData.loadingShow = false
            });
		}
		const previwe = ()=>{
			let data = getSubmitData('preview')
			store.dispatch('DesignDetail/setSubmit',data)
		}
		const modelOnLoad = ()=>{
			if(!detailData.isUndividedLayerWithSinglePrint)return
			setTimeout(()=>{
				let data = getSubmitData('sub')
				store.dispatch('DesignDetail/setSubmit',data)
			})
		}
		const detailEdit = async (str:any)=>{
			if(str){
				if(detailData.isEditPattern.value && detailData.isEditPattern.value == str){
					await detailDom.canvasBox.saveCanvas()
					detailData.isEditPattern.value = ''
				}else{
					if(detailData.isEditPattern.value){
						detailDom.canvasBox.editFront(str)
					}
					detailData.isEditPattern.value = str
				}
			}else{
				detailData.isEditPattern.value = ''
			}
		}
		const canvasReload = async ()=>{
			if(detailData.isEditPattern.value){
				await detailDom.canvasBox.saveCanvas()
			}
			detailData.canvasKey += 1
		}
		let time = null as any
		const handleResize = ()=>{
			clearTimeout(time)
			time = setTimeout(()=>{
				store.commit('DesignDetail/setDesignDetail',detailData.designDetail)
			},1000)
		}
		const sketchSysToLibrary = ()=>{//系统sketch添加到library更新library
			coverRevocation()
			detailDom.detailLeft.sketchSysToLibrary()
		}
		const coverRevocation = ()=>{
			let itemDetail = JSON.parse(JSON.stringify(detailData.designDetail))
			let revocation = JSON.parse((sessionStorage.getItem("revocation") as any))
			revocation.splice(revocation.length-1,1,{designData:itemDetail,position:null})
			sessionStorage.setItem('revocation', JSON.stringify(revocation));
			sessionStorage.setItem('oppositeRevocation',JSON.stringify([]));
		}

		const addDetail = () =>{
			let addDetails:any = detailDom.addDetails
			addDetails.init(detailData.selectDetail,'')
		}
		const setSloganData = (data:any)=>{
			detailData.selectDetail.sketchString = data
			if(detailData.currentDetailType == 'sketch' && detailData.selectDetail?.newDetail?.sketch){
				detailData.selectDetail.newDetail.sketch = null
			}
		}
		onMounted(()=>{
			window.addEventListener('resize', handleResize);
		})
		onBeforeUnmount(()=>{
			sessionStorage.removeItem('oppositeRevocation')
			sessionStorage.removeItem('revocation')
			store.commit('DesignDetail/clearDesignDetail')

			window.removeEventListener('resize', handleResize);
		})
		
        return{
			locale,
			...toRefs(detailDom),
			...toRefs(detailData),
            closeModal,
			showDesignDetailModal,
			setCurrentDetail,
			previwe,
			submit,
			revocation,
			oppositeRevocation,
			detailEdit,
			canvasReload,
			modelOnLoad,
			sketchSysToLibrary,
			addDetail,
			setSloganData,
        }
    },
	
	provide() {
		return {
		}
	},
	mounted(){
		let beforeunload =  () => {
			window.removeEventListener('beforeunload',beforeunload)
		}
		window.addEventListener('beforeunload',beforeunload)
		// let url = Https.httpUrls.getDesignDetail + `?designItemId=34242&designPythonOutfitId=34004`
        //     this.loadingShow = true
        //     Https.axiosGet(url).then(
		// 		async (rv: any) => {
		// 			rv.clothes.forEach((item:any)=>{
		// 				let a
		// 				if(item.layersObject[0].imageCategory.indexOf("back") == -1){
		// 					a = item.layersObject[0]
		// 					item.layersObject[0] = item.layersObject[1]
		// 					item.layersObject[1] = a
		// 				}
		// 				if(item.printObject.prints == null){
		// 					item.printObject.prints = [{}]
		// 				}
		// 			})
        //             this.store.commit('setDesignItemDetail',rv)
		// 			if(rv.others[0].printObject.path == null){
		// 				this.body = false
		// 			}else{
		// 				this.body = true
		// 			}
		// 			this.setImgSize()
        //             this.generateHighDesignImg = rv.highDesignUrl
        //             this.designShowPrview = 1
        //             this.designDetailShow = true
        //             this.loadingShow = false
        //         }
        //     ).catch(rv=>{
        //         this.loadingShow = false
        //     })
	},
		
})
</script>
<style lang="less" scoped>
	:deep(.detailText){
		font-size: 1.6rem;
		font-weight: 600;
		
	}
    .designDetailModal{
		position: absolute;
		// top: -100%;
		width: 100.5%;
		height: 100.5%;
		left: 50%;
		top: 50%;
		transform: translate(-50%,-50%);
		z-index: 2;
		:deep(>div){
			> .ant-modal-root{
				> .ant-modal-centered{
					overflow: hidden;
					> .fullScreen{
						> .ant-modal-content{
							box-shadow: none;
							> .ant-modal-body{
								padding: 0;
							}
						}
					}
				}
			}
			:deep(.ant-modal-wrap){
				.ant-modal-body{
					// padding: 0;
				}
				// position: absolute;
				// top: 0;
				// left: 0;
			}
		}
		.content{
			display: flex;
			align-items: flex-start;
			height: 100%;
			width: 100%;
			> .item{
				height: 100%;
				overflow: hidden;
				&.detailLeft{
					width: 30rem;
					// width: 34rem;
					display: flex;
					flex-direction: column;
					justify-content: space-between;
					overflow: hidden;
				}
				&.isEditPattern{width: 0px;}
				&.model{
					flex: 1;
					// width: 45rem;
					// width: 50rem;
					margin: 0 8rem;
					// margin: 0 10rem;
					display: flex;
					flex-direction: column;
				}
				&.detailRight{
					width: 30%;
					&.canvas{
						width: 60%;
					}
					display: flex;
					flex-direction: column;
					// padding-bottom: calc(6rem + 1rem);
					overflow: hidden;
					> .contentRight{
						text-align: center;
						display: flex;
						flex: 1;
						flex-direction: column;
						overflow: hidden;
					}
				}
				.btn{
					margin-top: auto;
				}
				> .submit{
					display: flex;
					justify-content: flex-end;
					margin-bottom: 1rem;
					&.bottom{
						margin-top: 1rem;
						margin-bottom: 0;
					}
				}
				> .btn{
					display: flex;
					justify-content: center;
					margin-left: 12rem;
				}
			}
			> .nav{
				margin-right: 5rem;
				overflow: hidden;
				// transition: all .3s;
				&.isEditPattern{width: 0px;margin: 0;}
				> .back_home{
					width: 9rem;
					text-align: center;
					> .gallery_btn{
						width: 6rem;
						height: 6rem;
						margin-top: 2rem;
						border-radius: 50%;
					}
				}
				> .nav_list{
					margin-top: 2.7rem;
					// height: 38rem;
					width: 9rem;
					background: #f4f4f4;
					border-radius: 1.4rem;
					padding: 1.4rem 0;
					> .nav_item{
						text-align: center;
						width: 100%;
						height: calc((38rem - 1.4rem * 2) / 4);
						cursor: pointer;
						display: flex;
						align-items: center;
						flex-direction: column;
						justify-content: center;
						> img{
							width: 4rem;
							height: 3.6rem;
							object-fit: contain;
						}
						&.active{
							background: #bdbdbd;
						}
					}
				}
			}
			
		}
		
	}
</style>