1 line
48 KiB
JavaScript
1 line
48 KiB
JavaScript
"use strict";(self["webpackChunkaida"]=self["webpackChunkaida"]||[]).push([[869],{6525:function(e,t,i){i.r(t),i.d(t,{default:function(){return ri}});var o=i(6252),s=i(3577),n=i(9963),l=i.p+"img/null_img.cdd90213.png";const a={class:"library_page"},r={class:"page_content"},c={class:"page_content_body"},d={class:"library_page_body"},h={class:"library_body_left"},p=["onClick"],m={class:"menu_item_left"},u=["onClick"],g={class:"library_body_right"},_={class:"library_right_header"},b={class:"library_header_left"},f={class:"librart_headr_right"},y={class:"select_block"},v=(0,o._)("span",{class:"icon iconfont icon-xiala",style:{color:"#343579"}},null,-1),w=(0,o._)("span",{class:"icon iconfont icon-xiala",style:{color:"#343579"}},null,-1),L={class:"libray_right_content"},k={class:"right_content_body"},x={class:"content_body_header"},S={class:"content_body_header_left"},C={class:"content_body_header_right"},M={class:"content_search_block"},P=["placeholder"],O=(0,o._)("span",{class:"icon iconfont icon-sousuo"},null,-1),T=[O],I={class:"check_block"},F={class:"check_block_body"},U={class:"content_body_table scroll_style"},j=["onClick"],R={class:"img_item_hover"},D={class:"img_operate_content"},H=["onClick"],N=(0,o._)("span",{class:"icon iconfont icon-tianxie operate_icon"},null,-1),B=[N],z=["onClick"],$=(0,o._)("span",{class:"icon iconfont icon-zhongmingming operate_icon"},null,-1),V=[$],Z=["onClick"],G=(0,o._)("span",{class:"icon iconfont icon-shanchu operate_icon"},null,-1),E=[G],W={class:"content_img_name"},Y={class:"no_data_block"},A=(0,o._)("img",{src:l},null,-1),J=[A],q={class:"table_pagination"},K={class:"right_content_body"},X={class:"content_body_header content_body_header_generate"},Q={class:"content_body_header_right"},ee={class:"checkboxItem"},te={class:"checkboxItem"},ie={class:"checkboxItem"},oe=["maxlength","readonly","placeholder"],se={class:"printModel"},ne={class:"upload_item"},le={class:"upload_file_item_content"},ae=["onClick"],re=["src"],ce=["onClick"],de=(0,o._)("span",{class:"icon iconfont icon-shanchu"},null,-1),he=[de],pe={class:"upload_component upload_file_item"},me=(0,o._)("div",{class:"upload_tip_block"},[(0,o._)("i",{class:"fi fi-br-upload"})],-1),ue={class:"content_body_table scroll_style"},ge=["onClick"],_e=(0,o._)("div",{class:"content_img_name"},null,-1),be={class:"no_data_block"},fe=(0,o._)("img",{src:l},null,-1),ye=[fe],ve={class:"table_pagination"},we={class:"collection_rename_content"},Le={class:"rename_form_content"},ke=["placeholder"],xe={class:"rename_button_list"},Se={class:"mark_loading"};function Ce(e,t,i,l,O,N){const $=(0,o.up)("HeaderComponent"),G=(0,o.up)("a-upload"),A=(0,o.up)("a-select"),de=(0,o.up)("a-pagination"),fe=(0,o.up)("a-spin"),Ce=(0,o.up)("a-modal"),Me=(0,o.up)("ModelPlacement"),Pe=(0,o.up)("ModelPlacementMobile"),Oe=(0,o.up)("RobotAssist"),Te=(0,o.Q2)("lazy");return(0,o.wg)(),(0,o.iD)("div",a,[(0,o._)("div",r,[(0,o._)("div",c,[(0,o.Wm)($),(0,o._)("div",d,[(0,o._)("div",h,[(0,o._)("div",null,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(e.menuList,((t,i)=>((0,o.wg)(),(0,o.iD)("div",{class:"library_menu_list",key:t.title},[(0,o._)("div",{class:(0,s.C_)(["menu_item",e.selectCode==t.code?"select_menu_item":""]),onClick:o=>e.selectMenuItem(t,i)},[(0,o._)("div",m,[(0,o._)("i",{class:(0,s.C_)([t.icon])},null,2),(0,o._)("div",null,(0,s.zw)(t.title),1)]),(0,o.wy)((0,o._)("div",{class:(0,s.C_)(["icon","iconfont","icon-xiala",t.showChildren?"icon_rotate":""])},null,2),[[n.F8,t.children.length]])],10,p),(0,o.wy)((0,o._)("div",null,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(t.children,(t=>((0,o.wg)(),(0,o.iD)("div",{class:(0,s.C_)(["menu_item","child_menu_item",e.selectCode==t.code?"select_menu_item":""]),key:t.title,onClick:o=>e.selectMenuItem(t,i)},(0,s.zw)(t.title),11,u)))),128))],512),[[n.F8,t.showChildren&&t.children.length]])])))),128))])]),(0,o._)("div",g,[(0,o._)("div",_,[(0,o._)("div",b,[(0,o._)("div",{class:(0,s.C_)(["header_operate_item pointer",{operate_select:"Upload"==e.uploadGenerate}]),onClick:t[0]||(t[0]=t=>e.uploadGenerateOpen("Upload"))},[(0,o.wy)((0,o.Wm)(G,{"before-upload":e.beforeUpload,customRequest:e.customRequest,multiple:"Models"!=e.selectCode,maxCount:15,accept:".jpg,.png,.jpeg,.bmp",onChange:e.fileUploadChange},{default:(0,o.w5)((()=>[(0,o._)("div",null,(0,s.zw)(e.$t("LibraryPage.Upload")),1)])),_:1},8,["before-upload","customRequest","multiple","onChange"]),[[n.F8,"Upload"==e.uploadGenerate]]),(0,o.wy)((0,o._)("div",null,(0,s.zw)(e.$t("LibraryPage.Upload")),513),[[n.F8,"Upload"!=e.uploadGenerate]])],2),(0,o.wy)((0,o._)("div",{class:(0,s.C_)(["header_operate_item pointer",{operate_select:"Generate"==e.uploadGenerate}]),onClick:t[1]||(t[1]=t=>e.uploadGenerateOpen("Generate"))},(0,s.zw)(e.$t("LibraryPage.Generate")),3),[[n.F8,"Models"!=e.selectCode]])]),(0,o._)("div",f,[(0,o.wy)((0,o._)("div",y,[(0,o.Wm)(A,{ref:"select",value:e.sex,"onUpdate:value":t[2]||(t[2]=t=>e.sex=t),options:e.sexList,onChange:e.sexChange},{suffixIcon:(0,o.w5)((()=>[v])),_:1},8,["value","options","onChange"]),(0,o.Wm)(A,{ref:"select",value:e.designType,"onUpdate:value":t[3]||(t[3]=t=>e.designType=t),options:e.disignTypeList,onChange:e.handleChange},{suffixIcon:(0,o.w5)((()=>[w])),_:1},8,["value","options","onChange"])],512),[[n.F8,"Sketchboard"==e.selectCode||"MarketingSketch"==e.selectCode]])])]),(0,o._)("div",L,[(0,o.wy)((0,o._)("div",k,[(0,o._)("div",x,[(0,o._)("div",S,[(0,o._)("div",C,[(0,o._)("div",{class:(0,s.C_)(["header_operate_item","fontSize",e.selectImgList.length>0?"active":""]),onClick:t[4]||(t[4]=t=>e.deleteBatchPic())},(0,s.zw)(e.$t("LibraryPage.Delete")),3),(0,o._)("div",{class:(0,s.C_)(["header_operate_item","fontSize",e.selectImgList.length>0?"active":""]),onClick:t[5]||(t[5]=t=>e.showRenameModal("","batch"))},(0,s.zw)(e.$t("LibraryPage.Rename")),3)]),(0,o._)("div",M,[(0,o.wy)((0,o._)("input",{class:"search_input",placeholder:e.$t("LibraryPage.inputContent1"),"onUpdate:modelValue":t[6]||(t[6]=t=>e.searchPictureName=t),onKeydown:t[7]||(t[7]=(0,n.D2)((t=>e.getLibraryList()),["enter"]))},null,40,P),[[n.nr,e.searchPictureName]]),(0,o._)("div",{class:"generage_btn search_icon_block",onClick:t[8]||(t[8]=t=>e.getLibraryList())},T)])]),(0,o.wy)((0,o._)("div",{class:(0,s.C_)(["check_all_block",e.selectImgList.length==e.imgList.length?"check_all":""]),onClick:t[9]||(t[9]=t=>e.selectAllImg())},[(0,o._)("div",I,[(0,o.wy)((0,o._)("div",F,null,512),[[n.F8,e.selectImgList.length==e.imgList.length&&e.imgList.length]])]),(0,o._)("div",null,(0,s.zw)(e.$t("LibraryPage.all")),1)],2),[[n.F8,e.imgList.length]])]),(0,o._)("div",U,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(e.imgList,((t,i)=>((0,o.wg)(),(0,o.iD)("div",{class:"content_img_item",key:t.id,onClick:i=>e.selectImgItem(t)},[(0,o._)("div",{class:(0,s.C_)(["content_img_item_block",e.selectImgList.indexOf(t.id)>-1?"select_item_img":""])},[(0,o.wy)(((0,o.wg)(),(0,o.iD)("img",{key:t.url,class:(0,s.C_)(["content_img",["Moodboard","Printboard"].indexOf(e.selectCode)>-1?"board_content_img":""])},null,2)),[[Te,t.url]]),(0,o._)("div",R,[(0,o._)("div",D,[(0,o.wy)((0,o._)("div",{class:"img_operate_block",onClick:(0,n.iM)((i=>e.editPlacementClick(t)),["stop"])},B,8,H),[[n.F8,"Models"===e.selectCode]]),(0,o._)("div",{class:"img_operate_block",onClick:(0,n.iM)((i=>e.showRenameModal(t,"single")),["stop"])},V,8,z),(0,o._)("div",{class:"img_operate_block",onClick:(0,n.iM)((o=>e.deleteSinglePic(t,i)),["stop"])},E,8,Z)])])],2),(0,o._)("div",W,(0,s.zw)(t.name),1)],8,j)))),128)),(0,o.wy)((0,o._)("div",Y,J,512),[[n.F8,!e.imgList.length&&!e.isShowMark]])]),(0,o.wy)((0,o._)("div",q,[(0,o.Wm)(de,{current:e.currentPage,"onUpdate:current":t[10]||(t[10]=t=>e.currentPage=t),pageSize:e.pageSize,"onUpdate:pageSize":t[11]||(t[11]=t=>e.pageSize=t),total:e.total,showQuickJumper:!0,showSizeChanger:!1,onChange:e.changePage},null,8,["current","pageSize","total","onChange"])],512),[[n.F8,e.imgList.length]])],512),[[n.F8,"Upload"==e.uploadGenerate]]),(0,o.wy)((0,o._)("div",K,[(0,o._)("div",X,[(0,o._)("div",Q,[(0,o._)("div",ee,[(0,o._)("label",null,[(0,o.wy)((0,o._)("input",{type:"checkbox","onUpdate:modelValue":t[12]||(t[12]=t=>e.checkbox[0].type=t),onClick:t[13]||(t[13]=t=>e.setKeyword(0))},null,512),[[n.e8,e.checkbox[0].type]]),(0,o._)("span",null,(0,s.zw)(e.$t("LibraryPage.ImageOnly")),1)])]),(0,o._)("div",te,[(0,o._)("label",null,[(0,o.wy)((0,o._)("input",{type:"checkbox","onUpdate:modelValue":t[14]||(t[14]=t=>e.checkbox[1].type=t),onClick:t[15]||(t[15]=t=>e.setKeyword(1))},null,512),[[n.e8,e.checkbox[1].type]]),(0,o._)("span",null,(0,s.zw)(e.$t("LibraryPage.TextOnly")),1)])]),(0,o._)("div",ie,[(0,o._)("label",null,[(0,o.wy)((0,o._)("input",{type:"checkbox","onUpdate:modelValue":t[16]||(t[16]=t=>e.checkbox[2].type=t),onClick:t[17]||(t[17]=t=>e.setKeyword(2))},null,512),[[n.e8,e.checkbox[2].type]]),(0,o._)("span",null,(0,s.zw)(e.$t("LibraryPage.TextImage")),1)])])]),(0,o._)("div",{class:(0,s.C_)(["input_box",{active:e.inputShow}])},[(0,o.wy)((0,o._)("input",{class:(0,s.C_)(["search_input",{active:e.checkbox[0].type}]),onInput:t[18]||(t[18]=(...t)=>e.ifMaximumLength&&e.ifMaximumLength(...t)),maxlength:e.inputShow?0:9999,readonly:e.checkbox[0].type,placeholder:e.$t("LibraryPage.inputContent2"),"onUpdate:modelValue":t[19]||(t[19]=t=>e.captionGeneration=t)},null,42,oe),[[n.nr,e.captionGeneration]]),(0,o._)("div",{class:"generage_btn started_btn",onClick:t[20]||(t[20]=(0,n.iM)(((...t)=>e.getgenerate&&e.getgenerate(...t)),["stop"]))},(0,s.zw)(e.$t("LibraryPage.Generate")),1),(0,o._)("span",null,(0,s.zw)(e.$t("LibraryPage.maximumLength")),1)],2),(0,o.wy)((0,o._)("div",se,[(0,o._)("div",{onClick:t[21]||(t[21]=(0,n.iM)(((...t)=>e.PrintModel&&e.PrintModel(...t)),["stop"]))},(0,s.zw)(e.printModel.name),1),(0,o.wy)((0,o._)("ul",null,[(0,o._)("li",{class:"printModel_item",onClick:t[22]||(t[22]=t=>e.setprintModel(1))},(0,s.zw)(e.$t("LibraryPage.Model1")),1),(0,o._)("li",{class:"printModel_item",onClick:t[23]||(t[23]=t=>e.setprintModel(2))},(0,s.zw)(e.$t("LibraryPage.Model2")),1)],512),[[n.F8,e.printModel.optype]])],512),[[n.F8,"Printboard"==e.selectCode]]),(0,o._)("div",ne,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(e.selectGenerateList,((t,i)=>((0,o.wg)(),(0,o.iD)("div",{class:(0,s.C_)(["upload_file_item",[t?.checked?"active":""]]),key:t},[(0,o.wy)((0,o._)("div",le,[(0,o.Wm)(fe,{indicator:e.indicator,tip:"Uploading..."},null,8,["indicator"])],512),[[n.F8,"uploading"===t?.status]]),(0,o.wy)((0,o._)("div",{class:"upload_file_item_content",onClick:(0,n.iM)((i=>e.setSketchboardItem(t)),["stop"])},[(0,o._)("img",{src:t?.imgUrl,class:"upload_img"},null,8,re),(0,o._)("div",{class:"delete_file_block rightTop",onClick:t=>e.deleteFile(i)},he,8,ce)],8,ae),[[n.F8,"done"===t?.status]])],2)))),128)),(0,o.wy)((0,o._)("div",pe,[(0,o.Wm)(G,{action:e.uploadUrl+"/api/element/upload","list-type":"picture-card","before-upload":e.beforeUpload,disabled:e.checkbox[1].type,data:{...e.upload},headers:{Authorization:e.token},"file-list":e.selectGenerateList,"onUpdate:file-list":t[24]||(t[24]=t=>e.selectGenerateList=t),multiple:"",accept:".jpg,.png,.jpeg,.bmp",onChange:e.generateFileUploadChange},{default:(0,o.w5)((()=>[me])),_:1},8,["action","before-upload","disabled","data","headers","file-list","onChange"])],512),[[n.F8,e.selectGenerateList.length<=3]])])]),(0,o._)("div",ue,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(e.generateList,((t,i)=>((0,o.wg)(),(0,o.iD)("div",{class:"content_img_item",key:t.id,onClick:i=>e.selectImgItem(t)},[(0,o._)("div",{class:(0,s.C_)(["content_img_item_block",e.selectImgList.indexOf(t.id)>-1?"select_item_img":""])},[(0,o.wy)(((0,o.wg)(),(0,o.iD)("img",{key:t.imgUrl,class:(0,s.C_)(["content_img",["Moodboard","Printboard"].indexOf(e.selectCode)>-1?"board_content_img":""])},null,2)),[[Te,t.imgUrl]])],2),_e],8,ge)))),128)),(0,o.wy)((0,o._)("div",be,ye,512),[[n.F8,!e.imgList.length&&!e.isShowMark]])]),(0,o.wy)((0,o._)("div",ve,null,512),[[n.F8,e.generateList.length]])],512),[[n.F8,"Upload"!=e.uploadGenerate]])])])])])]),(0,o.Wm)(Ce,{class:"library_rename_modal_component",visible:e.renameVisivle,"onUpdate:visible":t[29]||(t[29]=t=>e.renameVisivle=t),footer:null,title:"Rename Pic",width:"56rem",maskClosable:!1,centered:!0,onOnCancel:e.closeRenameModal},{default:(0,o.w5)((()=>[(0,o._)("div",we,[(0,o._)("div",Le,[(0,o.wy)((0,o._)("input",{class:"rename_form_input",placeholder:e.$t("LibraryPage.inputContent3"),"onUpdate:modelValue":t[25]||(t[25]=t=>e.newPicName=t),onKeydown:t[26]||(t[26]=(0,n.D2)((t=>e.confrimRename()),["enter"]))},null,40,ke),[[n.nr,e.newPicName]])]),(0,o._)("div",xe,[(0,o._)("div",{class:"rename_button_item rename_cancel_button",onClick:t[27]||(t[27]=t=>e.closeRenameModal())},(0,s.zw)(e.$t("LibraryPage.Cancel")),1),(0,o._)("div",{class:"rename_button_item rename_submit_button",onClick:t[28]||(t[28]=t=>e.confrimRename())},(0,s.zw)(e.$t("LibraryPage.Sure")),1)])])])),_:1},8,["visible","onOnCancel"]),(0,o.Wm)(Me,{ref:"ModelPlacement",onSubmitModelPlacement:e.getLibraryList},null,8,["onSubmitModelPlacement"]),(0,o.Wm)(Pe,{ref:"ModelPlacementMobile"},null,512),(0,o.wy)((0,o._)("div",Se,[(0,o.Wm)(fe,{size:"large"})],512),[[n.F8,e.isShowMark]]),(0,o.Wm)(Oe)])}var Me=i(320),Pe=i(2262),Oe=i(1209);const Te=(0,o._)("span",{class:"icon iconfont icon-guanbi"},null,-1),Ie=[Te],Fe={class:"models_placement_body"},Ue={class:"palcement_modal_header"},je={class:"models_placement_title"},Re={class:"placement_operate_list"},De=(0,o._)("div",{class:"icon iconfont icon-baocun1 operate_icon"},null,-1),He={class:"operate_item_des"},Ne=(0,o._)("div",{class:"icon iconfont icon-shengchengyulan operate_icon"},null,-1),Be={class:"operate_item_des"},ze=(0,o._)("div",{class:"icon iconfont icon-fanhui1 operate_icon"},null,-1),$e={class:"operate_item_des"},Ve=(0,o._)("div",{class:"icon iconfont icon-huifu operate_icon"},null,-1),Ze={class:"operate_item_des"},Ge={key:0,class:"plcaement_point_content"},Ee={style:{display:"flex","align-items":"center"}},We={style:{display:"flex","align-items":"center"}},Ye={style:{display:"flex","align-items":"center"}},Ae={class:"models_placement_content"},Je={class:"plcaement_point_content"},qe={class:"select_block"},Ke=(0,o._)("span",{class:"icon iconfont icon-xiala",style:{color:"#343579"}},null,-1),Xe={class:"ponit_title"},Qe={class:"point_list"},et=["onMousedown"],tt={class:"placement_point_item placement_point_item_btn"},it={class:"placement_content_operate_list"},ot=(0,o._)("div",{class:"placement_remove_point_block"},null,-1),st={class:"placement_content_operate_des"},nt={class:"placement_tip_content"},lt={class:"img_preview_block"},at={class:"perview_mark_loading"},rt={class:"img_content_block",ref:"imgbox"},ct=["onMousedown"],dt={class:"icon iconfont icon-guanbi"};function ht(e,t,i,l,a,r){const c=(0,o.up)("a-select"),d=(0,o.up)("a-spin"),h=(0,o.up)("vue-cropper"),p=(0,o.up)("a-modal");return(0,o.wy)(((0,o.wg)(),(0,o.iD)("div",null,[(0,o.Wm)(p,{class:"models_placement_component",visible:e.placementShow,"onUpdate:visible":t[11]||(t[11]=t=>e.placementShow=t),footer:null,width:"111.5rem",maskClosable:!1,centered:!0},{closeIcon:(0,o.w5)((()=>[(0,o._)("div",{class:"close_icon",onClick:t[0]||(t[0]=(0,n.iM)((t=>e.closeModal()),["stop"]))},Ie)])),default:(0,o.w5)((()=>[(0,o._)("div",Fe,[(0,o._)("div",Ue,[(0,o._)("div",je,(0,s.zw)(e.$t("ModelPlacement.Registration")),1),(0,o._)("div",Re,[(0,o.wy)((0,o._)("div",{class:"operate_item",onClick:t[1]||(t[1]=(...t)=>e.submitPlacement&&e.submitPlacement(...t))},[De,(0,o._)("div",He,(0,s.zw)(e.$t("ModelPlacement.Submit")),1)],512),[[n.F8,6==e.locationList.length]]),(0,o.wy)((0,o._)("div",{class:"operate_item",onClick:t[2]||(t[2]=(...t)=>e.printPreview&&e.printPreview(...t))},[Ne,(0,o._)("div",Be,(0,s.zw)(e.$t("ModelPlacement.Preview")),1)],512),[[n.F8,6==e.locationList.length]]),(0,o.wy)((0,o._)("div",{class:"operate_item",onClick:t[3]||(t[3]=(...t)=>e.backPreview&&e.backPreview(...t))},[ze,(0,o._)("div",$e,(0,s.zw)(e.$t("ModelPlacement.Back")),1)],512),[[n.F8,e.perviewUrl]]),(0,o._)("div",{class:"operate_item",onClick:t[4]||(t[4]=(...t)=>e.restoreLocationList&&e.restoreLocationList(...t))},[Ve,(0,o._)("div",Ze,(0,s.zw)(e.$t("ModelPlacement.Restore")),1)])])]),88==e.userInfo.userId||83==e.userInfo.userId?((0,o.wg)(),(0,o.iD)("div",Ge,[(0,o._)("div",Ee,[(0,o._)("div",We,[(0,o._)("input",{type:"checkbox",model:"false",onClick:t[5]||(t[5]=()=>{e.modelType="System"})}),(0,o.Uk)(" "+(0,s.zw)(e.$t("ModelPlacement.System")),1)]),(0,o._)("div",Ye,[(0,o._)("input",{type:"checkbox",model:"false",onClick:t[6]||(t[6]=()=>{e.modelType="Library"})}),(0,o.Uk)(" "+(0,s.zw)(e.$t("ModelPlacement.Library")),1)])])])):(0,o.kq)("",!0),(0,o._)("div",Ae,[(0,o._)("div",Je,[(0,o._)("div",qe,[(0,o.Wm)(c,{ref:"select",value:e.sex,"onUpdate:value":t[7]||(t[7]=t=>e.sex=t),options:e.sexList},{suffixIcon:(0,o.w5)((()=>[Ke])),_:1},8,["value","options"])]),((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(e.pointList,((t,i)=>((0,o.wg)(),(0,o.iD)("div",{class:"placement_point_item",key:i},[(0,o._)("div",Xe,(0,s.zw)(t.title),1),(0,o._)("div",Qe,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(t.pointList,(t=>((0,o.wg)(),(0,o.iD)("div",{class:"point_item",key:t.color,style:(0,s.j5)({borderColor:t.color,visibility:t.show?"inherit":"hidden"}),onMousedown:i=>e.AddDian(t)},[(0,o._)("div",{class:"point_block",style:(0,s.j5)({background:t.color})},null,4)],44,et)))),128))])])))),128)),(0,o._)("div",tt,[(0,o._)("span",{class:"started_btn",onClick:t[8]||(t[8]=(...t)=>e.setPoint&&e.setPoint(...t))},(0,s.zw)(e.$t("ModelPlacement.Point")),1)])]),(0,o._)("div",it,[(0,o._)("div",{class:"placement_content_operate_item",onClick:t[9]||(t[9]=(...t)=>e.changeRemoveStatus&&e.changeRemoveStatus(...t))},[ot,(0,o._)("div",st,(0,s.zw)(e.$t("ModelPlacement.RemovePoint")),1)])]),(0,o._)("div",nt,(0,s.zw)(e.$t("ModelPlacement.mannequinHint")),1),(0,o._)("div",lt,[(0,o.wy)((0,o._)("div",at,[(0,o.Wm)(d,{size:"large"})],512),[[n.F8,e.isShowMark]]),(0,o._)("div",rt,[(0,o._)("div",{style:(0,s.j5)({width:e.imgBox.width+"px",height:e.imgBox.height+"px",top:e.imgBox.y+"px",left:e.imgBox.x+"px",position:"absolute"})},[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(e.locationList,((i,l)=>(0,o.wy)(((0,o.wg)(),(0,o.iD)("div",{class:(0,s.C_)(["ponit_click",e.isRemoveStatus?"remove_point_click":""]),key:i,style:(0,s.j5)({left:i.left+"px",top:i.top+"px",borderColor:i.color}),onMousedown:t=>e.getMouseDown(t,i,l),onMousemove:t[10]||(t[10]=t=>e.startMove(t))},[(0,o.wy)((0,o._)("div",{class:"placement_add_point_content",style:(0,s.j5)({background:i.color})},null,4),[[n.F8,!e.isRemoveStatus]]),(0,o.wy)((0,o._)("div",dt,null,512),[[n.F8,e.isRemoveStatus]])],46,ct)),[[n.F8,!e.perviewUrl]]))),128))],4),(0,o.Wm)(h,{ref:"cropper",img:e.option.img,outputSize:e.option.outputSize,outputType:e.option.outputType,info:e.option.info,canScale:e.option.canScale,autoCrop:e.option.autoCrop,fixed:e.option.fixed,fixedNumber:e.option.fixedNumber,full:e.option.full,fixedBox:e.option.fixedBox,canMove:e.option.canMove,canMoveBox:e.option.canMoveBox,original:e.option.original,centerBox:e.option.centerBox,height:e.option.height,infoTrue:e.option.infoTrue,limitMinSize:e.option.limitMinSize,enlarge:e.option.enlarge,onRealTime:e.realTime,autoCropArea:1,autoCropHeight:e.option.autoCropHeight,autoCropWidth:e.option.autoCropWidth,mode:e.option.mode},null,8,["img","outputSize","outputType","info","canScale","autoCrop","fixed","fixedNumber","full","fixedBox","canMove","canMoveBox","original","centerBox","height","infoTrue","limitMinSize","enlarge","onRealTime","autoCropHeight","autoCropWidth","mode"])],512)])])])])),_:1},8,["visible"])],512)),[[n.F8,e.placementShow]])}var pt=i(9185),mt=i(7064),ut=i(3699),gt=i(2323),_t=i(3907),bt=i(327),ft=i(8302),yt=i(8552),vt=(0,o.aZ)({components:{VueCropper:gt.AK},setup(){const e=(0,_t.oR)();let t=(0,Pe.iH)([]),i=(0,Pe.iH)([]),o=(0,Pe.iH)({}),s=(0,Pe.iH)({}),n=(0,Pe.iH)(null),l=(0,Pe.iH)({}),a=(0,Pe.iH)([]),r=(0,Pe.iH)([]),c=(0,Pe.iH)(!1),d=(0,Pe.iH)(!1),h=(0,Pe.iH)(),p=(0,Pe.iH)(),{t:m}=(0,yt.QT)();return{store:e,oldLocationList:t,locationList:i,printObject:o,imgBox:s,intObj:n,currentSign:l,oldPointList:a,pointList:r,isSubmit:c,manager:d,userInfo:h,cropperTime:p,t:m}},data(){return{placementShow:!1,collectionIndex:0,startDian:!1,moveOriginal:{posX:0,posY:0},isRemoveStatus:!1,placement_sacle:30,perviewUrl:"",isShowMark:!1,modelType:"Library",sex:"Male",sexList:[],option:{img:"",outputSize:1,outputType:"png",info:!1,canScale:!0,autoCrop:!0,autoCropWidth:"0",autoCropHeight:"0",fixed:!0,fixedBox:!0,fixedNumber:[1,2.125],full:!1,canMove:!0,canMoveBox:!1,original:!1,centerBox:!1,height:!0,infoTrue:!0,maxImgSize:"2000",enlarge:7,mode:"auto 90%",limitMinSize:"100%"}}},mounted(){let e=(0,ut.ej)("userInfo");this.userInfo=JSON.parse(e),this.getSex()},watch:{sex:{handler(e,t){}}},methods:{formatter(e){return`${e}%`},showPlacementModal(e){this.placementShow=!0,this.printObject={...e},this.option.img=this.printObject.url,setTimeout((()=>{let e=this.$refs.imgbox,t=e.getElementsByClassName("cropper-crop-box")[0],i=e.getElementsByClassName("cropper-view-box")[0],o=document.createElement("div"),s=document.createElement("div"),n=document.createElement("div"),l=document.createElement("div");e.getElementsByClassName("cropper-view-box-Bg").length>=1||(l.classList.add("cropper-view-box-Bg"),o.classList.add("cropper-view-box-Bg"),s.classList.add("cropper-view-box-Bg"),n.classList.add("cropper-view-box-Bg"),l.classList.add("cropper-view-box-Mask"),o.classList.add("cropper-view-box-Top"),s.classList.add("cropper-view-box-Bottom"),n.classList.add("cropper-view-box-Center"),l.style.background="url(./image/femaleBG.png) no-repeat 0 0 / 100% 100%",i.appendChild(o),i.appendChild(s),i.appendChild(n));let a=this.$refs.cropper;console.log(a),a.cropH=a.scale*a.trueHeight,a.cropW=a.cropH/2.125,a.cropOffsertX=a.getImgAxis().x1+(a.scale*a.trueWidth/2-a.cropW/2),console.log(a.getImgAxis().x1,a.scale*a.trueWidth/2,a.cropW/2),a.cropOffsertY=a.getImgAxis().y1,t.addEventListener("mousemove",this.startMove),this.setImageSize(),this.getDefaultPointList(this.imgBox," ")}),300)},realTime(e){clearTimeout(this.cropperTime),this.cropperTime=setTimeout((()=>{this.setImageSize()}),1e3)},setImageSize(){let e=this.$refs.imgbox,t=e.getElementsByClassName("cropper-crop-box")[0],i=t.getBoundingClientRect(),o=e.getBoundingClientRect(),s=this.$refs.cropper;console.log(o,i),this.imgBox={width:s.cropW,height:s.cropH,left:o.left,top:o.top,scrollTop:t.scrollTop||0,x:s.getCropAxis().x1,y:s.getCropAxis().y1}},getSex(){pt.V.axiosGet(pt.V.httpUrls.workspaceenumValues,{params:{enumName:"Sex"}}).then((e=>{if(e){let t=[];e.forEach((e=>{let i={value:e.name,label:e.name};t.push(i)})),this.sex=t[0].value,this.sexList=t}}))},setMove(){},getDefaultPointList(e,t){this.isSubmit=!1,this.locationList=[],this.pointList=[{title:this.t("ModelPlacement.SHOULDER"),pointList:[{type:"shoulderLeft",color:"#6E70FF",show:!0,field:"shoulder"},{type:"shoulderRight",color:"#6E70FF",show:!0,field:"shoulder"}]},{title:this.t("ModelPlacement.WAISTBAND"),pointList:[{type:"waistbandLeft",color:"#6FCEFF",show:!0,field:"waistband"},{type:"waistbandRight",color:"#6FCEFF",show:!0,field:"waistband"}]},{title:this.t("ModelPlacement.HAND"),pointList:[{type:"handLeft",color:"#d88e8e",show:!0,field:"hand"},{type:"handRight",color:"#d88e8e",show:!0,field:"hand"}]}];for(let i of this.pointList)for(let t of i.pointList)if(this.printObject[t.type]?.length){t.show=!1;let i={left:this.printObject[t.type][0]*e.width-12,top:this.printObject[t.type][1]*e.height-12,color:t.color,type:t.type,field:t.field};this.locationList.push(i)}"setPoint"!=t?(this.isSubmit=!0,this.oldLocationList=JSON.parse(JSON.stringify(this.locationList)),this.oldPointList=JSON.parse(JSON.stringify(this.pointList))):(this.option.canScale=!0,this.option.canMove=!0)},setPoint(){console.log();let e=JSON.parse(JSON.stringify(this.printObject));this.printObject={shoulderLeft:[.3338,.1858],shoulderRight:[.6644,.1858],waistbandLeft:[.3758,.364],waistbandRight:[.6103,.364],handLeft:[.3277,.4687],handRight:[.6764,.4715],file:e.file,url:e.url},this.getDefaultPointList(this.imgBox,"setPoint")},AddDian(e){e.show&&(this.startDian=!0,this.isRemoveStatus=!1,this.intObj=e)},changeRemoveStatus(){this.isRemoveStatus=!0},startMove(e){if(this.isRemoveStatus)return;let t=this.$refs.imgbox,i=t.getElementsByClassName("cropper-crop-box")[0],o=i.scrollTop;this.intObj?(this.currentSign.left=e.clientX-this.imgBox.left,this.currentSign.top=e.clientY+o-this.imgBox.top,this.currentSign.color=this.intObj.color,this.currentSign.type=this.intObj.type,this.currentSign.field=this.intObj.field,this.locationList.push(this.currentSign),this.intObj.show=!1,this.intObj=null):this.startDian&&(this.currentSign.left=e.clientX-this.imgBox.left-this.imgBox.x-this.moveOriginal.posX-12,this.currentSign.top=e.clientY+o-this.imgBox.top-this.imgBox.y-this.moveOriginal.posY-12,document.addEventListener("mouseup",this.getMouseOver),this.$forceUpdate(),this.setBoundarySign())},setBoundarySign(){let e=this.$refs.imgbox,t=e.getElementsByClassName("cropper-crop-box")[0],i=this.$refs.cropper.getCropAxis().y1,o=this.$refs.cropper.getCropAxis().x1,s=t.offsetHeight,n=s-24,l=t.clientWidth-24;this.currentSign.top+i<=0?this.currentSign.top=0:this.currentSign.top>=n+i&&(this.currentSign.top=n+i),this.currentSign.left+o<=0?this.currentSign.left=0:this.currentSign.left>=l+o&&(this.currentSign.left=l+o)},getMouseDown(e,t,i){if(this.isRemoveStatus){for(let e of this.pointList)for(let i of e.pointList)if(t.type==i.type){i.show=!0;break}this.locationList.splice(i,1)}else this.currentSign=t,this.moveOriginal.posX=0,this.moveOriginal.posY=0,console.log(this.moveOriginal),this.startDian=!0},getMouseOver(){this.startDian=!1,this.currentSign={},document.removeEventListener("mouseup",this.getMouseOver)},closeModal(){let e=this;this.isSubmit?(e.oldLocationList=[],e.locationList=[],e.intObj=null,e.currentSign={},e.isRemoveStatus=!1,e.placementShow=!1,e.perviewUrl=""):bt.Z.confirm({title:this.t("ModelPlacement.jsContent1"),icon:(0,o.Wm)(ft.Z),okText:"Yes",cancelText:"No",mask:!1,onOk(){e.oldLocationList=[],e.locationList=[],e.intObj=null,e.currentSign={},e.isRemoveStatus=!1,e.placementShow=!1,e.perviewUrl=""}})},restoreLocationList(){this.locationList=[],console.log(this.locationList),this.pointList=JSON.parse(JSON.stringify(this.oldPointList)),this.locationList=JSON.parse(JSON.stringify(this.oldLocationList))},submitPlacement(){let e=this.$refs.cropper;e.getCropData((async e=>{if(this.printObject.templateId)this.printObject.id=this.printObject.libraryId,this.confrimSubmit();else{let t=(0,mt._x)(e,this.printObject.file.name);t.uid=this.printObject.file.uid,this.printObject.file=t,this.customRequest().then((e=>{this.isShowMark=!1,this.printObject.id=e.id,this.confrimSubmit()})).catch((e=>{this.isShowMark=!1}))}}))},confrimSubmit(){let e={libraryId:this.printObject.id,templateId:this.printObject.templateId||null,modelType:"Library",checkMd5:1,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,...this.getPrintLocation()};88!=this.userInfo.userId&&83!=this.userInfo.userId||(e.modelType=this.modelType),this.isShowMark=!0,pt.V.axiosPost(pt.V.httpUrls.saveOrEditTemplatePoint,e).then((e=>{this.isShowMark=!1,this.isSubmit=!0,this.$emit("submitModelPlacement"),this.closeModal()})).catch((e=>{this.isShowMark=!1}))},customRequest(){let e={file:this.printObject.file,level1Type:"Models",level2Type:"",checkMd5:1,sex:this.sex,modelType:"Library",timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone};return 88!=this.userInfo.userId&&83!=this.userInfo.userId||(e.modelType=this.modelType,e.sex=this.sex),this.isShowMark=!0,new Promise(((t,i)=>{pt.V.axiosPost(pt.V.httpUrls.libraryUpload,e,{headers:{"Content-Type":"multipart/form-data"}}).then((i=>{i.checkMd5?t(i):t(this.affirmCstomRequest(e))})).catch((e=>{i(e)}))}))},affirmCstomRequest(e){let t=this;return new Promise(((i,s)=>{bt.Z.confirm({title:this.t("ModelPlacement.jsContent2"),icon:(0,o.Wm)(ft.Z),okText:"Yes",cancelText:"No",mask:!1,onOk(){e.checkMd5=0,pt.V.axiosPost(pt.V.httpUrls.libraryUpload,e,{headers:{"Content-Type":"multipart/form-data"}}).then((e=>{t.isShowMark=!1,i(e)})).catch((e=>{s(e)}))},onCancel(){t.isShowMark=!1}})}))},getPrintLocation(){let{width:e,height:t}=this.imgBox,i={},o={},s=JSON.parse(JSON.stringify(this.locationList));for(let n of s)i[n.field]=i[n.field]||[],i[n.field].push(n);for(let n in i)i[n].sort(this.sortBy("left")),i[n].forEach(((i,s)=>{i.type=s?i.field+"Right":i.field+"Left",i.left=((i.left+12)/e).toFixed(4),i.top=((i.top+12)/t).toFixed(4),o[i.type]=[i.left,i.top]}));return o},sortBy(e){return function(t,i){return t[e]-i[e]}},printPreview(){let e=this.printObject.templateId?null:this.printObject.file,t={libraryId:this.printObject.libraryId||null,templateId:this.printObject.templateId||null,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,...this.getPrintLocation()},i=new FormData;i.append("file",e),i.append("models",new Blob([JSON.stringify(t)],{type:"application/json"})),this.isShowMark||(this.isShowMark=!0,pt.V.axiosPost(pt.V.httpUrls.libraryModelsDot,i,{headers:{"Content-Type":"multipart/form-data"}}).then((e=>{this.perviewUrl=e,this.isShowMark=!1})).catch((e=>{this.isShowMark=!1})))},backPreview(){this.perviewUrl=""}}}),wt=i(3744);const Lt=(0,wt.Z)(vt,[["render",ht]]);var kt=Lt;const xt=(0,o._)("span",{class:"icon iconfont icon-guanbi"},null,-1),St=[xt],Ct={class:"models_placement_body"},Mt={class:"palcement_modal_header"},Pt={class:"models_placement_title"},Ot={class:"placement_operate_list"},Tt=(0,o._)("div",{class:"icon iconfont icon-baocun1 operate_icon"},null,-1),It={class:"operate_item_des"},Ft=(0,o._)("div",{class:"icon iconfont icon-shengchengyulan operate_icon"},null,-1),Ut={class:"operate_item_des"},jt=(0,o._)("div",{class:"icon iconfont icon-fanhui1 operate_icon"},null,-1),Rt={class:"operate_item_des"},Dt=(0,o._)("div",{class:"icon iconfont icon-huifu operate_icon"},null,-1),Ht={class:"operate_item_des"},Nt={key:0,class:"plcaement_point_content"},Bt={class:"ponit_title"},zt={class:"point_list"},$t=["onTouchstart"],Vt={class:"placement_content_operate_list"},Zt=(0,o._)("div",{class:"placement_remove_point_block"},null,-1),Gt=(0,o._)("div",{class:"placement_content_operate_des"},"Remove Point",-1),Et=[Zt,Gt],Wt=(0,o._)("div",{class:"placement_tip_content"},"Please change the pure white inside the mannequin for another color to enhance your experience",-1),Yt={class:"img_preview_block"},At={class:"perview_mark_loading"},Jt={class:"img_content_block",ref:"imgbox"},qt=["src"],Kt=["onTouchstart"],Xt={class:"icon iconfont icon-guanbi"};function Qt(e,t,i,l,a,r){const c=(0,o.up)("a-spin"),d=(0,o.up)("a-modal");return(0,o.wy)(((0,o.wg)(),(0,o.iD)("div",null,[(0,o.Wm)(d,{class:"models_placement_mobile_component",visible:e.placementShow,"onUpdate:visible":t[8]||(t[8]=t=>e.placementShow=t),footer:null,width:"111.5rem",maskClosable:!1,centered:!0},{closeIcon:(0,o.w5)((()=>[(0,o._)("div",{class:"close_icon",onClick:t[0]||(t[0]=(0,n.iM)((t=>e.closeModal()),["stop"]))},St)])),default:(0,o.w5)((()=>[(0,o._)("div",Ct,[(0,o._)("div",Mt,[(0,o._)("div",Pt,(0,s.zw)(e.$t("ModelPlacementMobile.Registration")),1),(0,o._)("div",Ot,[(0,o.wy)((0,o._)("div",{class:"operate_item",onClick:t[1]||(t[1]=(...t)=>e.submitPlacement&&e.submitPlacement(...t))},[Tt,(0,o._)("div",It,(0,s.zw)(e.$t("ModelPlacementMobile.Submit")),1)],512),[[n.F8,6==e.locationList.length]]),(0,o.wy)((0,o._)("div",{class:"operate_item",onClick:t[2]||(t[2]=(...t)=>e.printPreview&&e.printPreview(...t))},[Ft,(0,o._)("div",Ut,(0,s.zw)(e.$t("ModelPlacementMobile.Preview")),1)],512),[[n.F8,6==e.locationList.length]]),(0,o.wy)((0,o._)("div",{class:"operate_item",onClick:t[3]||(t[3]=(...t)=>e.backPreview&&e.backPreview(...t))},[jt,(0,o._)("div",Rt,(0,s.zw)(e.$t("ModelPlacementMobile.Back")),1)],512),[[n.F8,e.perviewUrl]]),(0,o._)("div",{class:"operate_item",onClick:t[4]||(t[4]=(...t)=>e.restoreLocationList&&e.restoreLocationList(...t))},[Dt,(0,o._)("div",Ht,(0,s.zw)(e.$t("ModelPlacementMobile.Restore")),1)])])]),(0,o._)("div",{class:"models_placement_content",onTouchmove:t[7]||(t[7]=t=>e.startMove(t))},[88==e.userInfo.userId||83==e.userInfo.userId?((0,o.wg)(),(0,o.iD)("div",Nt,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(e.pointList,((t,i)=>((0,o.wg)(),(0,o.iD)("div",{class:"placement_point_item",key:i},[(0,o._)("div",Bt,(0,s.zw)(t.title),1),(0,o._)("div",zt,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(t.pointList,(t=>((0,o.wg)(),(0,o.iD)("div",{class:"point_item",key:t.color,style:(0,s.j5)({borderColor:t.color,visibility:t.show?"inherit":"hidden"}),onTouchstart:i=>e.AddDian(t)},[(0,o._)("div",{class:"point_block",style:(0,s.j5)({background:t.color})},null,4)],44,$t)))),128))])])))),128))])):(0,o.kq)("",!0),(0,o._)("div",Vt,[(0,o._)("div",{class:"placement_content_operate_item",onClick:t[5]||(t[5]=(...t)=>e.changeRemoveStatus&&e.changeRemoveStatus(...t))},Et)]),Wt,(0,o._)("div",Yt,[(0,o.wy)((0,o._)("div",At,[(0,o.Wm)(c,{size:"large"})],512),[[n.F8,e.isShowMark]]),(0,o._)("div",Jt,[(0,o._)("img",{class:"placement_img",src:e.perviewUrl||e.printObject?.url},null,8,qt),((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(e.locationList,((i,l)=>((0,o.wg)(),(0,o.iD)("div",{class:(0,s.C_)(["ponit_click",e.isRemoveStatus?"remove_point_click":""]),key:i,style:(0,s.j5)({left:i.left+"px",top:i.top+"px",borderColor:i.color}),onTouchstart:t=>e.getMouseDown(t,i,l),onTouchmove:t[6]||(t[6]=t=>e.startMove(t))},[(0,o.wy)((0,o._)("div",{class:"placement_add_point_content",style:(0,s.j5)({background:i.color})},null,4),[[n.F8,!e.isRemoveStatus]]),(0,o.wy)((0,o._)("div",Xt,null,512),[[n.F8,e.isRemoveStatus]])],46,Kt)))),128))],512)])],32)])])),_:1},8,["visible"])],512)),[[n.F8,e.placementShow]])}var ei=(0,o.aZ)({setup(){const e=(0,_t.oR)();let t=(0,Pe.iH)([]),i=(0,Pe.iH)([]),o=(0,Pe.iH)({}),s=(0,Pe.iH)({}),n=(0,Pe.iH)(null),l=(0,Pe.iH)({}),a=(0,Pe.iH)([]),r=(0,Pe.iH)([]),c=(0,Pe.iH)(!1),d=(0,Pe.iH)(!1),h=(0,Pe.iH)();return{store:e,oldLocationList:t,locationList:i,printObject:o,imgBox:s,intObj:n,currentSign:l,oldPointList:a,pointList:r,isSubmit:c,manager:d,userInfo:h}},data(){return{placementShow:!1,collectionIndex:0,startDian:!1,moveOriginal:{posX:0,posY:0},isRemoveStatus:!1,placement_sacle:30,perviewUrl:"",isShowMark:!1,modelType:"Library",sex:"Male",sexList:[]}},mounted(){let e=(0,ut.ej)("userInfo");this.userInfo=JSON.parse(e),this.getSex()},methods:{formatter(e){return`${e}%`},showPlacementModal(e){this.placementShow=!0,this.printObject={...e},setTimeout((()=>{let e=this.$refs.imgbox,t=e.getBoundingClientRect();this.imgBox={width:e.clientWidth,height:e.scrollHeight,left:t.left,top:t.top,scrollTop:e.scrollTop||0},this.getDefaultPointList(this.imgBox)}),400)},getSex(){pt.V.axiosGet(pt.V.httpUrls.workspaceenumValues,{params:{enumName:"Sex"}}).then((e=>{if(e){let t=[];e.forEach((e=>{let i={value:e.name,label:e.name};t.push(i)})),this.sex=t[0].value,this.sexList=t}}))},getDefaultPointList(e){if(this.isSubmit=!1,this.pointList=[{title:"SHOULDER",pointList:[{type:"shoulderLeft",color:"#6E70FF",show:!0,field:"shoulder"},{type:"shoulderRight",color:"#6E70FF",show:!0,field:"shoulder"}]},{title:"WAISTBAND",pointList:[{type:"waistbandLeft",color:"#6FCEFF",show:!0,field:"waistband"},{type:"waistbandRight",color:"#6FCEFF",show:!0,field:"waistband"}]},{title:"HAND",pointList:[{type:"handLeft",color:"#CCFF7B",show:!0,field:"hand"},{type:"handRight",color:"#CCFF7B",show:!0,field:"hand"}]}],this.printObject.templateId){this.isSubmit=!0;for(let t of this.pointList)for(let i of t.pointList)if(this.printObject[i.type]?.length){i.show=!1;let t={left:this.printObject[i.type][0]*e.width-12,top:this.printObject[i.type][1]*e.height-12,color:i.color,type:i.type,field:i.field};this.locationList.push(t)}this.oldLocationList=JSON.parse(JSON.stringify(this.locationList))}this.oldPointList=JSON.parse(JSON.stringify(this.pointList))},AddDian(e){e.show&&(this.startDian=!0,this.isRemoveStatus=!1,this.intObj=e)},changeRemoveStatus(){this.isRemoveStatus=!0},startMove(e){if(this.isRemoveStatus)return;let t=this.$refs.imgbox,i=t.scrollTop;e.targetTouches[0].pageX>this.imgBox.left&&(this.intObj?(this.currentSign.left=e.targetTouches[0].pageX-this.imgBox.left,this.currentSign.top=e.targetTouches[0].pageY+i-this.imgBox.top,this.currentSign.color=this.intObj.color,this.currentSign.type=this.intObj.type,this.currentSign.field=this.intObj.field,this.locationList.push(this.currentSign),this.intObj.show=!1,this.intObj=null):this.startDian&&(this.currentSign.left=e.targetTouches[0].pageX-this.imgBox.left-this.moveOriginal.posX,this.currentSign.top=e.targetTouches[0].pageY+i-this.imgBox.top-this.moveOriginal.posY,document.addEventListener("touchend",this.getMouseOver),this.$forceUpdate(),this.setBoundarySign()))},setBoundarySign(){let e=this.$refs.imgbox,t=e.offsetHeight+e.scrollTop,i=t-24,o=e.clientWidth-24;this.currentSign.top<=0?this.currentSign.top=0:this.currentSign.top>=i&&(this.currentSign.top=i),this.currentSign.left<=0?this.currentSign.left=0:this.currentSign.left>=o&&(this.currentSign.left=o)},getMouseDown(e,t,i){if(this.isRemoveStatus){for(let e of this.pointList)for(let i of e.pointList)if(t.id==i.id){i.show=!0;break}this.locationList.splice(i,1)}else this.currentSign=t,this.moveOriginal.posX=e.targetTouches[0].pageX-this.imgBox.left-this.currentSign.left,this.moveOriginal.posY=e.targetTouches[0].pageY-this.imgBox.top-this.currentSign.top,this.startDian=!0},getMouseOver(){this.startDian=!1,this.currentSign={},document.removeEventListener("touchend",this.getMouseOver)},closeModal(){let e=this;this.isSubmit?(e.oldLocationList=[],e.locationList=[],e.intObj=null,e.currentSign={},e.isRemoveStatus=!1,e.placementShow=!1):bt.Z.confirm({title:"You haven't marked the image yet, and the model will not be uploaded. Are you sure you want to close it?",icon:(0,o.Wm)(ft.Z),okText:"Yes",cancelText:"No",mask:!1,onOk(){e.oldLocationList=[],e.locationList=[],e.intObj=null,e.currentSign={},e.isRemoveStatus=!1,e.placementShow=!1}})},restoreLocationList(){this.pointList=JSON.parse(JSON.stringify(this.oldPointList)),this.locationList=JSON.parse(JSON.stringify(this.oldLocationList))},submitPlacement(){this.printObject.templateId?(this.printObject.id=this.printObject.libraryId,this.confrimSubmit()):this.customRequest().then((e=>{this.isShowMark=!1,this.printObject.id=e.id,this.confrimSubmit()})).catch((e=>{this.isShowMark=!1}))},confrimSubmit(){let e={libraryId:this.printObject.id,templateId:this.printObject.templateId||null,modelType:"Library",checkMd5:1,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,...this.getPrintLocation()};88!=this.userInfo.userId&&83!=this.userInfo.userId||(e.modelType=this.modelType),this.isShowMark=!0,pt.V.axiosPost(pt.V.httpUrls.saveOrEditTemplatePoint,e).then((e=>{this.isShowMark=!1,this.isSubmit=!0,this.$emit("submitModelPlacement"),this.closeModal()})).catch((e=>{this.isShowMark=!1}))},customRequest(){let e={file:this.printObject.file,checkMd5:1,level1Type:"Models",sex:this.sex,modelType:"",level2Type:"",timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone};return this.isShowMark=!0,88!=this.userInfo.userId&&83!=this.userInfo.userId||(e.modelType=this.modelType,e.sex=this.sex),new Promise(((t,i)=>{pt.V.axiosPost(pt.V.httpUrls.libraryUpload,e,{headers:{"Content-Type":"multipart/form-data"}}).then((i=>{i.checkMd5?t(i):t(this.affirmCstomRequest(e))})).catch((e=>{i(e)}))}))},affirmCstomRequest(e){let t=this;return new Promise(((i,s)=>{bt.Z.confirm({title:"This picture has been uploaded whether to continue uploading? ",icon:(0,o.Wm)(ft.Z),okText:"Yes",cancelText:"No",mask:!1,onOk(){e.checkMd5=0,pt.V.axiosPost(pt.V.httpUrls.libraryUpload,e,{headers:{"Content-Type":"multipart/form-data"}}).then((e=>{t.isShowMark=!1,i(e)})).catch((e=>{s(e)}))},onCancel(){t.isShowMark=!1}})}))},getPrintLocation(){let{width:e,height:t}=this.imgBox,i={},o={},s=JSON.parse(JSON.stringify(this.locationList));for(let n of s)i[n.field]=i[n.field]||[],i[n.field].push(n);for(let n in i)i[n].sort(this.sortBy("left")),i[n].forEach(((i,s)=>{i.type=s?i.field+"Right":i.field+"Left",i.left=((i.left+12)/e).toFixed(4),i.top=((i.top+12)/t).toFixed(4),o[i.type]=[i.left,i.top]}));return o},sortBy(e){return function(t,i){return t[e]-i[e]}},printPreview(){},backPreview(){this.perviewUrl=""}}});const ti=(0,wt.Z)(ei,[["render",Qt]]);var ii=ti,oi=i(8818),si=i(1446),ni=i(4873),li=(0,o.aZ)({components:{HeaderComponent:Oe.Z,ModelPlacement:kt,ModelPlacementMobile:ii,RobotAssist:oi.Z},setup(){let e=(0,Pe.iH)([{title:(0,yt.QT)().t("LibraryPage.Moodboard"),code:"Moodboard",icon:"fi fi-rr-grid",showChildren:!1,children:[]},{title:(0,yt.QT)().t("LibraryPage.Prints"),code:"Printboard",icon:"fi fi-rs-objects-column",showChildren:!1,children:[]},{title:(0,yt.QT)().t("LibraryPage.Sketches"),code:"Sketchboard",icon:"fi icon iconfont icon-a-waitao_changkuanwaitao11x",showChildren:!1,children:[]},{title:(0,yt.QT)().t("LibraryPage.Mannequins"),code:"Models",icon:"fi fi-rs-people",showChildren:!1,children:[]}]),t=(0,Pe.iH)([]),i=(0,Pe.iH)("Moodboard"),o=(0,Pe.iH)(""),s=(0,Pe.iH)("Outwear"),n=(0,Pe.iH)("Meal"),l=[],a=[],r=(0,Pe.iH)([]),c=(0,Pe.iH)(1),d=(0,Pe.iH)(18),h=(0,Pe.iH)(20),p=(0,Pe.iH)(!1),m=(0,Pe.iH)("single"),u=(0,Pe.iH)(""),g=(0,Pe.iH)(""),_=(0,Pe.iH)(0),b=(0,Pe.iH)(!1),f=(0,Pe.iH)({}),y=(0,_t.oR)(),v=(0,Pe.iH)("Upload"),w=(0,Pe.iH)([{name:"image",type:!1},{name:"text",type:!0},{name:"text-image",type:!1}]),L=(0,Pe.iH)(!1),k=(0,Pe.iH)(),x=(0,Pe.iH)(),S=(0,Pe.iH)(),C=(0,Pe.iH)([]),M=(0,Pe.iH)([]),P=(0,Pe.iH)({num:1,optype:!1,name:(0,yt.QT)().t("LibraryPage.model")+"1"}),{t:O}=(0,yt.QT)();return{menuList:e,selectImgList:t,selectCode:i,searchPictureName:o,sexList:l,sex:n,disignTypeList:a,designType:s,imgList:r,currentPage:c,pageSize:d,total:h,renameVisivle:p,renameType:m,newPicName:u,uploadUrl:g,currentUploadFileNum:_,isShowMark:b,selectSingleImg:f,store:y,uploadGenerate:v,checkbox:w,inputShow:L,generateCheckbox:k,captionGeneration:x,inputTime:S,generateList:C,selectGenerateList:M,printModel:P,t:O}},data(e){return console.log(e),{indicator:(0,o.h)(Me.Z,{style:{fontSize:"2.4rem"},spin:!0}),upload:{isPin:0,level1Type:e.selectCode,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},token:""}},async mounted(){this.uploadUrl=(0,mt.M$)(),this.getLibraryList(),this.getSex(),this.token=(0,ut.ej)("token")||""},methods:{getSex(){pt.V.axiosGet(pt.V.httpUrls.workspaceenumValues,{params:{enumName:"Sex"}}).then((e=>{if(e){let t=[];e.forEach((e=>{let i={value:e.name,label:e.name};t.push(i)})),this.sex=t[0].value,this.sexList=t,this.getPosition()}}))},async getPosition(){let e;e="Female"==this.sex?"FemalePosition":"MalePosition",await pt.V.axiosGet(pt.V.httpUrls.workspaceenumValues,{params:{enumName:e}}).then((e=>{if(e){let t=[];e.forEach((e=>{let i={value:e.name,label:e.name};t.push(i)})),this.designType=t[0].value,this.disignTypeList=t}}))},selectMenuItem(e,t){e.children?.length?e.showChildren=!e.showChildren:(this.selectCode=e.code,this.upload.level1Type=e.code,this.currentPage=1,this.total=0,this.searchPictureName="",this.imgList=[],this.sex="Female",this.designType="Outwear",this.selectImgList=[],this.selectSingleImg={},this.getLibraryList(),this.uploadGenerate="Upload",this.captionGeneration="",this.selectGenerateList=[])},async sexChange(){await this.getPosition(),this.getLibraryList()},handleChange(){this.getLibraryList()},fileUploadChange(e){let t=e.file;if("Models"==this.selectCode){let e=new FileReader;e.onload=e=>{let i;i="object"===typeof e.target.result?window.URL.createObjectURL(new Blob([e.target.result])):e.target.result,this.placementClick({url:i,file:t.originFileObj})},e.readAsArrayBuffer(t.originFileObj)}},changePage(e,t){this.currentPage=e,this.pageSize=t,this.getLibraryList()},selectImgItem(e){if(-1===this.selectImgList.indexOf(e.id))this.selectImgList.push(e.id);else{let t=this.selectImgList.indexOf(e.id);this.selectImgList.splice(t,1)}},selectAllImg(){this.selectImgList.length==this.imgList.length?this.selectImgList=[]:this.selectImgList=this.imgList.map((e=>e.id))},closeRenameModal(){this.renameVisivle=!1,this.newPicName=""},confrimRename(){let e={libraryIds:"single"===this.renameType?[this.selectSingleImg.id]:this.selectImgList,libraryName:this.newPicName,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone};pt.V.axiosPost(pt.V.httpUrls.batchUpdateLibraryName,e).then((e=>{"batch"===this.renameType&&(this.selectImgList=[]),this.getLibraryList(),this.closeRenameModal()})).catch((e=>{this.closeRenameModal()}))},showRenameModal(e,t){("batch"!=t||this.selectImgList.length)&&("single"===t&&(this.selectSingleImg=e),this.renameType=t,this.renameVisivle=!0)},upLoad(){},uploadGenerateOpen(e){this.uploadGenerate,this.uploadGenerate=e},deleteSinglePic(e,t){let i=this;bt.Z.confirm({title:this.t("LibraryPage.jsContent1"),icon:(0,o.Wm)(ft.Z),okText:"Yes",cancelText:"No",mask:!1,onOk(){i.confirmDeletePic(e,t)}})},deleteBatchPic(){if(!this.selectImgList.length)return;let e=this;bt.Z.confirm({title:this.t("LibraryPage.jsContent2"),icon:(0,o.Wm)(ft.Z),okText:"Yes",cancelText:"No",onOk(){e.confirmDeletePic("",0)}})},confirmDeletePic(e,t){let i=e?[e.id]:this.selectImgList,o={libraryIds:i};pt.V.axiosPost(pt.V.httpUrls.batchDeleteLibrary,o).then((i=>{e&&e.id?this.imgList.splice(t,1):(this.selectImgList=[],this.getLibraryList())})).catch((e=>{}))},beforeUpload(e,t){const i="image/jpeg"===e.type||"image/png"===e.type||"image/jpg"===e.type||"image/bmp"===e.type;i||si.ZP.warning(this.t("LibraryPage.jsContent3"));const o=e.size/1024/1024<2;if(o||si.ZP.warning(this.t("LibraryPage.jsContent4")),!i||!o)return i&&o||ni.Z.LIST_IGNORE;this.currentUploadFileNum=t.length},customRequest(e){if("Models"==this.selectCode)return;let t="Sketchboard"==this.selectCode||"MarketingSketch"==this.selectCode?this.designType:"",i={file:e.file,level1Type:this.selectCode,level2Type:t,sex:"Models"==this.selectCode?this.sex:"",modelType:"",checkMd5:1,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone};this.isShowMark=!0,pt.V.axiosPost(pt.V.httpUrls.libraryUpload,i,{headers:{"Content-Type":"multipart/form-data"}}).then((e=>{e.checkMd5?(this.currentUploadFileNum--,this.currentUploadFileNum||this.getLibraryList()):this.affirmCstomRequest(i)})).catch((e=>{this.currentUploadFileNum--,this.currentUploadFileNum||this.getLibraryList()}))},affirmCstomRequest(e){let t=this;bt.Z.confirm({title:this.t("LibraryPage.jsContent5"),icon:(0,o.Wm)(ft.Z),okText:"Yes",cancelText:"No",mask:!1,zIndex:99999,onOk(){e.checkMd5=0,pt.V.axiosPost(pt.V.httpUrls.libraryUpload,e,{headers:{"Content-Type":"multipart/form-data"}}).then((e=>{t.currentUploadFileNum--,t.currentUploadFileNum||t.getLibraryList()})).catch((e=>{t.currentUploadFileNum--,t.currentUploadFileNum||t.getLibraryList()}))},onCancel(){t.currentUploadFileNum--,t.currentUploadFileNum||t.getLibraryList()}})},getLibraryList(){let e="Sketchboard"==this.selectCode||"MarketingSketch"==this.selectCode?this.designType:"",t={level1Type:this.selectCode,level2Type:e,page:this.currentPage,modelSex:this.sex?this.sex:"",pictureName:this.searchPictureName,size:this.pageSize};this.isShowMark=!0,pt.V.axiosPost(pt.V.httpUrls.queryLibraryPage,t).then((e=>{this.imgList=e.content,this.total=e.total,this.isShowMark=!1})).catch((e=>{this.isShowMark=!1}))},editPlacementClick(e){let t={...e.libraryModelPoint,url:e.url};this.placementClick(t)},placementClick(e){let t=(0,mt.S0)()?this.$refs.ModelPlacementMobile:this.$refs.ModelPlacement;t.showPlacementModal(e)},setKeyword(e){this.checkbox.forEach((e=>{e.type=!1})),(0,o.Y3)().then((()=>{this.checkbox[e].type=!0,this.checkbox[1].type&&this.selectGenerateList.forEach((e=>{e.checked=!1}))}))},ifMaximumLength(){clearTimeout(this.inputTime),this.inputTime=setTimeout((()=>{this.captionGeneration.split(/\s+/).length>75?this.inputShow=!0:this.inputShow=!1}),500)},generateFileUploadChange(e){let t=e.file;if("done"===t.status){let e=JSON.parse(t.xhr.response);t.id=e.data.id,t.imgUrl=e.data.url,t.resData=e.data,t.type_="upload"}else if("error"===t.status){let e=-1;this.selectGenerateList.forEach(((i,o)=>{t.uid===i.uid&&(e=o)})),e>-1&&this.selectGenerateList.splice(e,1),si.ZP.error(t.name+this.t("LibraryPage.jsContent8"))}},deleteFile(e){this.selectGenerateList.splice(e,1)},setSketchboardItem(e){this.checkbox[1].type||(e.checked?e.checked=!1:(this.selectGenerateList.forEach((e=>{e.checked&&(e.checked=!1)})),e.checked=!0))},PrintModel(){this.printModel.optype||document.addEventListener("click",this.removePrintModel),this.printModel.optype=!this.printModel.optype},removePrintModel(){this.printModel.optype=!1,document.removeEventListener("click",this.removePrintModel)},setprintModel(e){this.printModel={num:e,optype:!1,name:this.t("LibraryPage.model")+e}},getgenerate(){let e=this.checkbox.filter((e=>e.type))[0].name,t=this.selectGenerateList.filter((e=>e.checked))[0],i={generateType:e,designType:"",collectionElementId:t?.id,level1Type:this.selectCode,level2Type:"Sketchboard"==this.selectCode?this.designType:"",text:this.captionGeneration,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone,version:"Printboard"==this.selectCode?this.printModel.num:1,gender:"Sketchboard"==this.selectCode?this.sex:""};if("image"==e||"text-image"==e){if(!t?.id)return void si.ZP.warning(this.t("LibraryPage.jsContent9"))}else if("text"==e){if(i.collectionElementId="",i.level2Type="",!this.captionGeneration)return void si.ZP.warning(this.t("LibraryPage.jsContent7"));{let e=this.captionGeneration.split(/\s+/).length;if(e>75)return void si.ZP.warning(this.t("LibraryPage.jsContent6"))}}}}});const ai=(0,wt.Z)(li,[["render",Ce]]);var ri=ai}}]); |