1 line
59 KiB
JavaScript
1 line
59 KiB
JavaScript
"use strict";(self["webpackChunkaida"]=self["webpackChunkaida"]||[]).push([[844],{9818:function(e,t,i){i.r(t),i.d(t,{default:function(){return Ii}});var s=i(6252),o=i(3577),l=i(9963),n=i.p+"img/null_img.cdd90213.png";const a={class:"library_page"},c={class:"page_content"},r={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,s._)("span",{class:"icon iconfont icon-xiala",style:{color:"#343579"}},null,-1),w=(0,s._)("span",{class:"icon iconfont icon-xiala",style:{color:"#343579"}},null,-1),L={class:"libray_right_content"},k={class:"right_content_body"},C={class:"content_body_header"},S={class:"content_body_header_left"},x={class:"content_body_header_right"},M={class:"content_search_block"},P=["placeholder"],O=(0,s._)("span",{class:"icon iconfont icon-sousuo"},null,-1),T=[O],I={class:"check_block"},N={class:"check_block_body"},F={class:"content_body_table scroll_style"},U=["onClick"],j={class:"img_item_hover"},H={class:"img_operate_content"},D=["onClick"],R=(0,s._)("span",{class:"icon iconfont icon-tianxie operate_icon"},null,-1),V=[R],B=["onClick"],z=(0,s._)("span",{class:"icon iconfont icon-zhongmingming operate_icon"},null,-1),E=[z],$=["onClick"],Z=(0,s._)("span",{class:"icon iconfont icon-shanchu operate_icon"},null,-1),A=[Z],G={class:"content_img_name"},W={class:"no_data_block"},Y=(0,s._)("img",{src:n},null,-1),J=[Y],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"},se=["maxlength","readonly","placeholder"],oe={class:"printModel"},le={class:"upload_item"},ne={class:"upload_file_item_content"},ae=["onClick"],ce=["src"],re=["onClick"],de=(0,s._)("span",{class:"icon iconfont icon-shanchu"},null,-1),he=[de],pe={class:"upload_component upload_file_item"},me=(0,s._)("div",{class:"upload_tip_block"},[(0,s._)("i",{class:"fi fi-br-upload"})],-1),ue={class:"content_body_table scroll_style"},ge=["onClick"],_e={class:"img_item_hover"},be={class:"img_operate_content"},fe=["onClick"],ye=["onClick"],ve=["onClick"],we=(0,s._)("div",{class:"content_img_name"},null,-1),Le={class:"no_data_block"},ke=(0,s._)("img",{src:n},null,-1),Ce=[ke],Se={class:"table_pagination"},xe={class:"collection_rename_content"},Me={class:"rename_form_content"},Pe=["placeholder"],Oe={class:"rename_button_list"},Te={class:"mark_loading"};function Ie(e,t,i,n,O,R){const z=(0,s.up)("HeaderComponent"),Z=(0,s.up)("a-upload"),Y=(0,s.up)("a-select"),de=(0,s.up)("a-cascader"),ke=(0,s.up)("a-pagination"),Ie=(0,s.up)("a-spin"),Ne=(0,s.up)("a-modal"),Fe=(0,s.up)("ModelPlacement"),Ue=(0,s.up)("ModelPlacementMobile"),je=(0,s.up)("setLabel"),He=(0,s.up)("RobotAssist"),De=(0,s.Q2)("lazy");return(0,s.wg)(),(0,s.iD)("div",a,[(0,s._)("div",c,[(0,s._)("div",r,[(0,s.Wm)(z),(0,s._)("div",d,[(0,s._)("div",h,[(0,s._)("div",null,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(e.menuList,((t,i)=>((0,s.wg)(),(0,s.iD)("div",{class:"library_menu_list",key:t.title},[(0,s._)("div",{class:(0,o.C_)(["menu_item",e.selectCode==t.code?"select_menu_item":""]),onClick:s=>e.selectMenuItem(t,i)},[(0,s._)("div",m,[(0,s._)("i",{class:(0,o.C_)([t.icon])},null,2),(0,s._)("div",null,(0,o.zw)(t.title),1)]),(0,s.wy)((0,s._)("div",{class:(0,o.C_)(["icon","iconfont","icon-xiala",t.showChildren?"icon_rotate":""])},null,2),[[l.F8,t.children.length]])],10,p),(0,s.wy)((0,s._)("div",null,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(t.children,(t=>((0,s.wg)(),(0,s.iD)("div",{class:(0,o.C_)(["menu_item","child_menu_item",e.selectCode==t.code?"select_menu_item":""]),key:t.title,onClick:s=>e.selectMenuItem(t,i)},(0,o.zw)(t.title),11,u)))),128))],512),[[l.F8,t.showChildren&&t.children.length]])])))),128))])]),(0,s._)("div",g,[(0,s._)("div",_,[(0,s._)("div",b,[(0,s._)("div",{class:(0,o.C_)(["header_operate_item pointer",{operate_select:"Upload"==e.uploadGenerate}]),onClick:t[0]||(t[0]=t=>e.uploadGenerateOpen("Upload"))},[(0,s.wy)((0,s.Wm)(Z,{"before-upload":e.beforeUpload,customRequest:e.customRequest,multiple:"Models"!=e.selectCode,maxCount:15,accept:".jpg,.png,.jpeg,.bmp",onChange:e.fileUploadChange},{default:(0,s.w5)((()=>[(0,s._)("div",null,(0,o.zw)(e.$t("LibraryPage.Upload")),1)])),_:1},8,["before-upload","customRequest","multiple","onChange"]),[[l.F8,"Upload"==e.uploadGenerate]]),(0,s.wy)((0,s._)("div",null,(0,o.zw)(e.$t("LibraryPage.Upload")),513),[[l.F8,"Upload"!=e.uploadGenerate]])],2),(0,s.wy)((0,s._)("div",{class:(0,o.C_)(["header_operate_item pointer",{operate_select:"Generate"==e.uploadGenerate}]),onClick:t[1]||(t[1]=t=>e.uploadGenerateOpen("Generate"))},(0,o.zw)(e.$t("LibraryPage.Generate")),3),[[l.F8,"Models"!=e.selectCode]])]),(0,s._)("div",f,[(0,s.wy)((0,s._)("div",y,[(0,s.Wm)(Y,{ref:"select",value:e.sex,"onUpdate:value":t[2]||(t[2]=t=>e.sex=t),options:e.sexList,onChange:e.sexChange},{suffixIcon:(0,s.w5)((()=>[v])),_:1},8,["value","options","onChange"]),(0,s.Wm)(Y,{ref:"select",value:e.designType,"onUpdate:value":t[3]||(t[3]=t=>e.designType=t),options:e.disignTypeList,onChange:e.handleChange},{suffixIcon:(0,s.w5)((()=>[w])),_:1},8,["value","options","onChange"])],512),[[l.F8,"Sketchboard"==e.selectCode||"MarketingSketch"==e.selectCode]])])]),(0,s._)("div",L,[(0,s.wy)((0,s._)("div",k,[(0,s._)("div",C,[(0,s._)("div",S,[(0,s._)("div",x,[(0,s._)("div",{class:(0,o.C_)(["header_operate_item","fontSize",e.selectImgList.length>0?"active":""]),onClick:t[4]||(t[4]=t=>e.deleteBatchPic())},(0,o.zw)(e.$t("LibraryPage.Delete")),3),(0,s._)("div",{class:(0,o.C_)(["header_operate_item","fontSize",e.selectImgList.length>0?"active":""]),onClick:t[5]||(t[5]=t=>e.showRenameModal("","batch"))},(0,o.zw)(e.$t("LibraryPage.Rename")),3)]),(0,s._)("div",M,[(0,s.wy)((0,s._)("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,l.D2)((t=>e.getLibraryList()),["enter"]))},null,40,P),[[l.nr,e.searchPictureName]]),(0,s.Wm)(de,{onClick:(0,l.iM)(e.dropdownVisibleChange,["stop"]),ref:"cascader",value:e.value.labelValue,"onUpdate:value":t[8]||(t[8]=t=>e.value.labelValue=t),style:{width:"60%"},"field-names":{label:"classificationName",value:"id",children:"childList"},multiple:"",onChange:e.setLabel1,"max-tag-count":"responsive",options:e.options,placeholder:"Please select","show-search":{filter:e.filter},open:e.labelOpen.labelOpen,dropdownClassName:"libraryPageCascader"},null,8,["onClick","value","onChange","options","show-search","open"]),(0,s._)("div",{class:"generage_btn search_icon_block",onClick:t[9]||(t[9]=t=>e.getLibraryList())},T)])]),(0,s.wy)((0,s._)("div",{class:(0,o.C_)(["check_all_block",e.selectImgList.length==e.imgList.length?"check_all":""]),onClick:t[10]||(t[10]=t=>e.selectAllImg())},[(0,s._)("div",I,[(0,s.wy)((0,s._)("div",N,null,512),[[l.F8,e.selectImgList.length==e.imgList.length&&e.imgList.length]])]),(0,s._)("div",null,(0,o.zw)(e.$t("LibraryPage.all")),1)],2),[[l.F8,e.imgList.length]])]),(0,s._)("div",F,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(e.imgList,((t,i)=>((0,s.wg)(),(0,s.iD)("div",{class:"content_img_item",key:t.id,onClick:i=>e.selectImgItem(t),draggable:!0},[(0,s._)("div",{class:(0,o.C_)(["content_img_item_block",e.selectImgList.indexOf(t.id)>-1?"select_item_img":""])},[(0,s.wy)(((0,s.wg)(),(0,s.iD)("img",{key:t.url,class:(0,o.C_)(["content_img",["Moodboard","Printboard"].indexOf(e.selectCode)>-1?"board_content_img":""])},null,2)),[[De,t.url]]),(0,s._)("div",j,[(0,s._)("div",H,[(0,s.wy)((0,s._)("div",{class:"img_operate_block",onClick:(0,l.iM)((i=>e.editPlacementClick(t)),["stop"])},V,8,D),[[l.F8,"Models"===e.selectCode]]),(0,s._)("div",{class:"img_operate_block",onClick:(0,l.iM)((i=>e.showRenameModal(t,"single")),["stop"])},E,8,B),(0,s._)("div",{class:"img_operate_block",onClick:(0,l.iM)((s=>e.deleteSinglePic(t,i)),["stop"])},A,8,$)])])],2),(0,s._)("div",G,(0,o.zw)(t.name),1)],8,U)))),128)),(0,s.wy)((0,s._)("div",W,J,512),[[l.F8,!e.imgList.length&&!e.isShowMark]])]),(0,s.wy)((0,s._)("div",q,[(0,s.Wm)(ke,{current:e.currentPage,"onUpdate:current":t[11]||(t[11]=t=>e.currentPage=t),pageSize:e.pageSize,"onUpdate:pageSize":t[12]||(t[12]=t=>e.pageSize=t),total:e.total,showQuickJumper:!0,showSizeChanger:!1,onChange:e.changePage},null,8,["current","pageSize","total","onChange"])],512),[[l.F8,e.imgList.length]])],512),[[l.F8,"Upload"==e.uploadGenerate]]),(0,s.wy)((0,s._)("div",K,[(0,s._)("div",X,[(0,s._)("div",Q,[(0,s._)("div",ee,[(0,s._)("label",null,[(0,s.wy)((0,s._)("input",{type:"checkbox","onUpdate:modelValue":t[13]||(t[13]=t=>e.checkbox[0].type=t),onClick:t[14]||(t[14]=t=>e.setKeyword(0))},null,512),[[l.e8,e.checkbox[0].type]]),(0,s._)("span",null,(0,o.zw)(e.$t("LibraryPage.ImageOnly")),1)])]),(0,s._)("div",te,[(0,s._)("label",null,[(0,s.wy)((0,s._)("input",{type:"checkbox","onUpdate:modelValue":t[15]||(t[15]=t=>e.checkbox[1].type=t),onClick:t[16]||(t[16]=t=>e.setKeyword(1))},null,512),[[l.e8,e.checkbox[1].type]]),(0,s._)("span",null,(0,o.zw)(e.$t("LibraryPage.TextOnly")),1)])]),(0,s._)("div",ie,[(0,s._)("label",null,[(0,s.wy)((0,s._)("input",{type:"checkbox","onUpdate:modelValue":t[17]||(t[17]=t=>e.checkbox[2].type=t),onClick:t[18]||(t[18]=t=>e.setKeyword(2))},null,512),[[l.e8,e.checkbox[2].type]]),(0,s._)("span",null,(0,o.zw)(e.$t("LibraryPage.TextImage")),1)])])]),(0,s._)("div",{class:(0,o.C_)(["input_box",{active:e.inputShow}])},[(0,s.wy)((0,s._)("input",{class:(0,o.C_)(["search_input",{active:e.checkbox[0].type}]),onInput:t[19]||(t[19]=(...t)=>e.ifMaximumLength&&e.ifMaximumLength(...t)),maxlength:e.inputShow?0:9999,readonly:e.checkbox[0].type,placeholder:e.$t("LibraryPage.inputContent2"),"onUpdate:modelValue":t[20]||(t[20]=t=>e.captionGeneration=t)},null,42,se),[[l.nr,e.captionGeneration]]),(0,s._)("div",{class:"generage_btn started_btn",onClick:t[21]||(t[21]=(0,l.iM)(((...t)=>e.getgenerate&&e.getgenerate(...t)),["stop"]))},(0,o.zw)(e.$t("LibraryPage.Generate")),1),(0,s._)("span",null,(0,o.zw)(e.$t("LibraryPage.maximumLength")),1)],2),(0,s.wy)((0,s._)("div",oe,[(0,s._)("div",{onClick:t[22]||(t[22]=(0,l.iM)(((...t)=>e.PrintModel&&e.PrintModel(...t)),["stop"]))},(0,o.zw)(e.printModel.name),1),(0,s.wy)((0,s._)("ul",null,[(0,s._)("li",{class:"printModel_item",onClick:t[23]||(t[23]=t=>e.setprintModel(1))},(0,o.zw)(e.$t("LibraryPage.Model1")),1),(0,s._)("li",{class:"printModel_item",onClick:t[24]||(t[24]=t=>e.setprintModel(2))},(0,o.zw)(e.$t("LibraryPage.Model2")),1)],512),[[l.F8,e.printModel.optype]])],512),[[l.F8,"Printboard"==e.selectCode]]),(0,s._)("div",le,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(e.selectGenerateList,((t,i)=>((0,s.wg)(),(0,s.iD)("div",{class:(0,o.C_)(["upload_file_item",[t?.checked?"active":""]]),key:t},[(0,s.wy)((0,s._)("div",ne,[(0,s.Wm)(Ie,{indicator:e.indicator,tip:"Uploading..."},null,8,["indicator"])],512),[[l.F8,"uploading"===t?.status]]),(0,s.wy)((0,s._)("div",{class:"upload_file_item_content",onClick:(0,l.iM)((i=>e.setSketchboardItem(t)),["stop"])},[(0,s._)("img",{src:t?.imgUrl,class:"upload_img"},null,8,ce),(0,s._)("div",{class:"delete_file_block rightTop",onClick:t=>e.deleteFile(i)},he,8,re)],8,ae),[[l.F8,"done"===t?.status]])],2)))),128)),(0,s.wy)((0,s._)("div",pe,[(0,s.Wm)(Z,{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[25]||(t[25]=t=>e.selectGenerateList=t),multiple:"",accept:".jpg,.png,.jpeg,.bmp",onChange:e.generateFileUploadChange},{default:(0,s.w5)((()=>[me])),_:1},8,["action","before-upload","disabled","data","headers","file-list","onChange"])],512),[[l.F8,e.selectGenerateList.length<=3]])])]),(0,s._)("div",ue,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(e.generateList,((t,i)=>((0,s.wg)(),(0,s.iD)("div",{class:"content_img_item",key:t.id,onClick:i=>e.selectImgItem(t)},[(0,s._)("div",{class:(0,o.C_)(["content_img_item_block",e.selectImgList.indexOf(t.id)>-1?"select_item_img":""])},[(0,s.wy)(((0,s.wg)(),(0,s.iD)("img",{key:t.imgUrl,class:(0,o.C_)(["content_img",["Moodboard","Printboard"].indexOf(e.selectCode)>-1?"board_content_img":""])},null,2)),[[De,t.imgUrl]]),(0,s._)("div",_e,[(0,s._)("div",be,[(0,s._)("div",{class:"img_operate_block",onClick:(0,l.iM)((i=>e.editPlacementClick(t)),["stop"])},[t.like?((0,s.wg)(),(0,s.iD)("i",{key:1,class:"fi fi-sr-heart operate_icon",onClick:(0,l.iM)((i=>e.likeFile(t,"noLike")),["stop"])},null,8,ve)):((0,s.wg)(),(0,s.iD)("i",{key:0,class:"fi fi-rr-heart operate_icon",onClick:(0,l.iM)((i=>e.likeFile(t,"like")),["stop"])},null,8,ye))],8,fe)])])],2),we],8,ge)))),128)),(0,s.wy)((0,s._)("div",Le,Ce,512),[[l.F8,!e.imgList.length&&!e.isShowMark]])]),(0,s.wy)((0,s._)("div",Se,null,512),[[l.F8,e.generateList.length]])],512),[[l.F8,"Upload"!=e.uploadGenerate]])])])])])]),(0,s.Wm)(Ne,{class:"library_rename_modal_component",visible:e.renameVisivle,"onUpdate:visible":t[31]||(t[31]=t=>e.renameVisivle=t),footer:null,title:"Rename Pic",width:"65%",maskClosable:!1,centered:!0,onOnCancel:e.closeRenameModal},{default:(0,s.w5)((()=>[(0,s._)("div",xe,[(0,s._)("div",Me,[(0,s.wy)((0,s._)("input",{class:"rename_form_input",placeholder:e.$t("LibraryPage.inputContent3"),"onUpdate:modelValue":t[26]||(t[26]=t=>e.newPicName=t),onKeydown:t[27]||(t[27]=(0,l.D2)((t=>e.confrimRename()),["enter"]))},null,40,Pe),[[l.nr,e.newPicName]])]),(0,s.Wm)(de,{onClick:(0,l.iM)(e.labelSearch,["stop"]),ref:"cascader",value:e.value.editLabelValue,"onUpdate:value":t[28]||(t[28]=t=>e.value.editLabelValue=t),style:{width:"100%"},"field-names":{label:"classificationName",value:"id",children:"childList"},multiple:"",onChange:e.setLabel1,"max-tag-count":"responsive",options:e.options,placeholder:"Please select","show-search":{filter:e.filter},open:e.labelOpen.editLabelOpen,dropdownClassName:"editLabel"},null,8,["onClick","value","onChange","options","show-search","open"]),(0,s._)("div",Oe,[(0,s._)("div",{class:"rename_button_item rename_cancel_button",onClick:t[29]||(t[29]=t=>e.closeRenameModal())},(0,o.zw)(e.$t("LibraryPage.Cancel")),1),(0,s._)("div",{class:"rename_button_item rename_submit_button",onClick:t[30]||(t[30]=t=>e.confrimRename())},(0,o.zw)(e.$t("LibraryPage.Sure")),1)])])])),_:1},8,["visible","onOnCancel"]),(0,s.Wm)(Fe,{ref:"ModelPlacement",onSubmitModelPlacement:e.getLibraryList},null,8,["onSubmitModelPlacement"]),(0,s.Wm)(Ue,{ref:"ModelPlacementMobile"},null,512),(0,s.Wm)(je,{ref:"setLabel"},null,512),(0,s.wy)((0,s._)("div",Te,[(0,s.Wm)(Ie,{size:"large"})],512),[[l.F8,e.isShowMark]]),(0,s.Wm)(He)])}var Ne=i(320),Fe=i(2262),Ue=i(2166);const je=(0,s._)("span",{class:"icon iconfont icon-guanbi"},null,-1),He=[je],De={class:"models_placement_body"},Re={class:"palcement_modal_header"},Ve={class:"models_placement_title"},Be={class:"placement_operate_list"},ze=(0,s._)("div",{class:"icon iconfont icon-baocun1 operate_icon"},null,-1),Ee={class:"operate_item_des"},$e=(0,s._)("div",{class:"icon iconfont icon-shengchengyulan operate_icon"},null,-1),Ze={class:"operate_item_des"},Ae=(0,s._)("div",{class:"icon iconfont icon-fanhui1 operate_icon"},null,-1),Ge={class:"operate_item_des"},We=(0,s._)("div",{class:"icon iconfont icon-huifu operate_icon"},null,-1),Ye={class:"operate_item_des"},Je={key:0,class:"plcaement_point_content"},qe={style:{display:"flex","align-items":"center"}},Ke={style:{display:"flex","align-items":"center"}},Xe={style:{display:"flex","align-items":"center"}},Qe={class:"models_placement_content"},et={class:"plcaement_point_content"},tt={class:"select_block"},it=(0,s._)("span",{class:"icon iconfont icon-xiala",style:{color:"#343579"}},null,-1),st={class:"ponit_title"},ot={class:"point_list"},lt=["onMousedown"],nt={class:"placement_point_item placement_point_item_btn"},at={class:"placement_content_operate_list"},ct=(0,s._)("div",{class:"placement_remove_point_block"},null,-1),rt={class:"placement_content_operate_des"},dt={class:"placement_tip_content"},ht={class:"img_preview_block"},pt={class:"perview_mark_loading"},mt={class:"img_content_block",ref:"imgbox"},ut=["onMousedown"],gt={class:"icon iconfont icon-guanbi"};function _t(e,t,i,n,a,c){const r=(0,s.up)("a-select"),d=(0,s.up)("a-spin"),h=(0,s.up)("vue-cropper"),p=(0,s.up)("a-modal");return(0,s.wy)(((0,s.wg)(),(0,s.iD)("div",null,[(0,s.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,s.w5)((()=>[(0,s._)("div",{class:"close_icon",onClick:t[0]||(t[0]=(0,l.iM)((t=>e.closeModal()),["stop"]))},He)])),default:(0,s.w5)((()=>[(0,s._)("div",De,[(0,s._)("div",Re,[(0,s._)("div",Ve,(0,o.zw)(e.$t("ModelPlacement.Registration")),1),(0,s._)("div",Be,[(0,s.wy)((0,s._)("div",{class:"operate_item",onClick:t[1]||(t[1]=(...t)=>e.submitPlacement&&e.submitPlacement(...t))},[ze,(0,s._)("div",Ee,(0,o.zw)(e.$t("ModelPlacement.Submit")),1)],512),[[l.F8,6==e.locationList.length]]),(0,s.wy)((0,s._)("div",{class:"operate_item",onClick:t[2]||(t[2]=(...t)=>e.printPreview&&e.printPreview(...t))},[$e,(0,s._)("div",Ze,(0,o.zw)(e.$t("ModelPlacement.Preview")),1)],512),[[l.F8,6==e.locationList.length]]),(0,s.wy)((0,s._)("div",{class:"operate_item",onClick:t[3]||(t[3]=(...t)=>e.backPreview&&e.backPreview(...t))},[Ae,(0,s._)("div",Ge,(0,o.zw)(e.$t("ModelPlacement.Back")),1)],512),[[l.F8,e.perviewUrl]]),(0,s._)("div",{class:"operate_item",onClick:t[4]||(t[4]=(...t)=>e.restoreLocationList&&e.restoreLocationList(...t))},[We,(0,s._)("div",Ye,(0,o.zw)(e.$t("ModelPlacement.Restore")),1)])])]),88==e.userInfo.userId||83==e.userInfo.userId?((0,s.wg)(),(0,s.iD)("div",Je,[(0,s._)("div",qe,[(0,s._)("div",Ke,[(0,s._)("input",{type:"checkbox",model:"false",onClick:t[5]||(t[5]=()=>{e.modelType="System"})}),(0,s.Uk)(" "+(0,o.zw)(e.$t("ModelPlacement.System")),1)]),(0,s._)("div",Xe,[(0,s._)("input",{type:"checkbox",model:"false",onClick:t[6]||(t[6]=()=>{e.modelType="Library"})}),(0,s.Uk)(" "+(0,o.zw)(e.$t("ModelPlacement.Library")),1)])])])):(0,s.kq)("",!0),(0,s._)("div",Qe,[(0,s._)("div",et,[(0,s._)("div",tt,[(0,s.Wm)(r,{ref:"select",value:e.sex,"onUpdate:value":t[7]||(t[7]=t=>e.sex=t),options:e.sexList},{suffixIcon:(0,s.w5)((()=>[it])),_:1},8,["value","options"])]),((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(e.pointList,((t,i)=>((0,s.wg)(),(0,s.iD)("div",{class:"placement_point_item",key:i},[(0,s._)("div",st,(0,o.zw)(t.title),1),(0,s._)("div",ot,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(t.pointList,(t=>((0,s.wg)(),(0,s.iD)("div",{class:"point_item",key:t.color,style:(0,o.j5)({borderColor:t.color,visibility:t.show?"inherit":"hidden"}),onMousedown:i=>e.AddDian(t)},[(0,s._)("div",{class:"point_block",style:(0,o.j5)({background:t.color})},null,4)],44,lt)))),128))])])))),128)),(0,s._)("div",nt,[(0,s._)("span",{class:"started_btn",onClick:t[8]||(t[8]=(...t)=>e.setPoint&&e.setPoint(...t))},(0,o.zw)(e.$t("ModelPlacement.Point")),1)])]),(0,s._)("div",at,[(0,s._)("div",{class:"placement_content_operate_item",onClick:t[9]||(t[9]=(...t)=>e.changeRemoveStatus&&e.changeRemoveStatus(...t))},[ct,(0,s._)("div",rt,(0,o.zw)(e.$t("ModelPlacement.RemovePoint")),1)])]),(0,s._)("div",dt,(0,o.zw)(e.$t("ModelPlacement.mannequinHint")),1),(0,s._)("div",ht,[(0,s.wy)((0,s._)("div",pt,[(0,s.Wm)(d,{size:"large"})],512),[[l.F8,e.isShowMark]]),(0,s._)("div",mt,[(0,s._)("div",{style:(0,o.j5)({width:e.imgBox.width+"px",height:e.imgBox.height+"px",top:e.imgBox.y+"px",left:e.imgBox.x+"px",position:"absolute"})},[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(e.locationList,((i,n)=>(0,s.wy)(((0,s.wg)(),(0,s.iD)("div",{class:(0,o.C_)(["ponit_click",e.isRemoveStatus?"remove_point_click":""]),key:i,style:(0,o.j5)({left:i.left+"px",top:i.top+"px",borderColor:i.color}),onMousedown:t=>e.getMouseDown(t,i,n),onMousemove:t[10]||(t[10]=t=>e.startMove(t))},[(0,s.wy)((0,s._)("div",{class:"placement_add_point_content",style:(0,o.j5)({background:i.color})},null,4),[[l.F8,!e.isRemoveStatus]]),(0,s.wy)((0,s._)("div",gt,null,512),[[l.F8,e.isRemoveStatus]])],46,ut)),[[l.F8,!e.perviewUrl]]))),128))],4),(0,s.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)),[[l.F8,e.placementShow]])}var bt=i(9185),ft=i(7064),yt=i(3699),vt=i(2323),wt=i(3907),Lt=i(327),kt=i(8302),Ct=i(8552),St=(0,s.aZ)({components:{VueCropper:vt.AK},setup(){const e=(0,wt.oR)();let t=(0,Fe.iH)([]),i=(0,Fe.iH)([]),s=(0,Fe.iH)({}),o=(0,Fe.iH)({}),l=(0,Fe.iH)(null),n=(0,Fe.iH)({}),a=(0,Fe.iH)([]),c=(0,Fe.iH)([]),r=(0,Fe.iH)(!1),d=(0,Fe.iH)(!1),h=(0,Fe.iH)(),p=(0,Fe.iH)(),{t:m}=(0,Ct.QT)();return{store:e,oldLocationList:t,locationList:i,printObject:s,imgBox:o,intObj:l,currentSign:n,oldPointList:a,pointList:c,isSubmit:r,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,yt.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((()=>{(0,s.Y3)().then((()=>{let e=new Image;e.src=this.option.img;let t=this.$refs.imgbox;console.log(t);let i=t.getElementsByClassName("cropper-crop-box")[0],s=t.getElementsByClassName("cropper-view-box")[0],o=document.createElement("div"),l=document.createElement("div"),n=document.createElement("div");t.getElementsByClassName("cropper-view-box-Bg").length>=1||(o.classList.add("cropper-view-box-Bg"),l.classList.add("cropper-view-box-Bg"),n.classList.add("cropper-view-box-Bg"),o.classList.add("cropper-view-box-Top"),l.classList.add("cropper-view-box-Bottom"),n.classList.add("cropper-view-box-Center"),s.appendChild(o),s.appendChild(l),s.appendChild(n));let a=this.$refs.cropper;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),a.cropOffsertY=a.getImgAxis().y1,i.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(),e.getBoundingClientRect()),s=this.$refs.cropper;this.imgBox={width:s.cropW,height:s.cropH,left:i.left,top:i.top,scrollTop:t.scrollTop||0,x:s.getCropAxis().x1,y:s.getCropAxis().y1}},getSex(){bt.V.axiosGet(bt.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(){let e=this.printObject.file,t=this.printObject.url;this.printObject={shoulderLeft:[.3338,.1858],shoulderRight:[.6644,.1858],waistbandLeft:[.3758,.364],waistbandRight:[.6103,.364],handLeft:[.3277,.4687],handRight:[.6764,.4715],file:e,url:t},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],s=i.scrollTop;this.intObj?(this.currentSign.left=e.clientX-this.imgBox.left,this.currentSign.top=e.clientY+s-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+s-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,s=this.$refs.cropper.getCropAxis().x1,o=t.offsetHeight,l=o-24,n=t.clientWidth-24;this.currentSign.top+i<=0?this.currentSign.top=0:this.currentSign.top>=l+i&&(this.currentSign.top=l+i),this.currentSign.left+s<=0?this.currentSign.left=0:this.currentSign.left>=n+s&&(this.currentSign.left=n+s)},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,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=""):Lt.Z.confirm({title:this.t("ModelPlacement.jsContent1"),icon:(0,s.Wm)(kt.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=[],this.pointList=JSON.parse(JSON.stringify(this.oldPointList)),this.locationList=JSON.parse(JSON.stringify(this.oldLocationList))},submitPlacement(){let e=this.$refs.cropper;"System"==this.modelType&&88==this.userInfo.userId||83==this.userInfo.userId?this.printObject.templateId?(this.printObject.id=this.printObject.relationId,this.confrimSubmit()):this.customRequest().then((e=>{this.isShowMark=!1,this.printObject.id=e.id,this.confrimSubmit()})).catch((e=>{this.isShowMark=!1})):e.getCropData((async e=>{if(this.printObject.templateId)this.printObject.id=this.printObject.relationId,this.confrimSubmit();else{let t=(0,ft._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,bt.V.axiosPost(bt.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)=>{bt.V.axiosPost(bt.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,o)=>{Lt.Z.confirm({title:this.t("ModelPlacement.jsContent2"),icon:(0,s.Wm)(kt.Z),okText:"Yes",cancelText:"No",mask:!1,onOk(){e.checkMd5=0,bt.V.axiosPost(bt.V.httpUrls.libraryUpload,e,{headers:{"Content-Type":"multipart/form-data"}}).then((e=>{t.isShowMark=!1,i(e)})).catch((e=>{o(e)}))},onCancel(){t.isShowMark=!1}})}))},getPrintLocation(){let{width:e,height:t}=this.imgBox,i={},s={},o=JSON.parse(JSON.stringify(this.locationList));for(let l of o)i[l.field]=i[l.field]||[],i[l.field].push(l);for(let l in i)i[l].sort(this.sortBy("left")),i[l].forEach(((i,o)=>{i.type=o?i.field+"Right":i.field+"Left",i.left=((i.left+12)/e).toFixed(4),i.top=((i.top+12)/t).toFixed(4),s[i.type]=[i.left,i.top]}));return s},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,bt.V.axiosPost(bt.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=""}}}),xt=i(3744);const Mt=(0,xt.Z)(St,[["render",_t]]);var Pt=Mt;const Ot={class:"setLabel_centent"},Tt={class:"optionsItem"},It={class:"setLabel_text"},Nt=["title"],Ft=["onClick"],Ut=["onClick"],jt={class:"childrenItem active"},Ht=["title"],Dt=["onClick"],Rt=["onClick"],Vt={class:"newLabel setLabel_text"},Bt=["onClick"],zt=["onClick"],Et={class:"newLabel setLabel_text optionsItem_title"};function $t(e,t,i,n,a,c){const r=(0,s.up)("a-checkbox"),d=(0,s.up)("a-modal"),h=(0,s.Q2)("mousewheel");return(0,s.wg)(),(0,s.j4)(d,{class:"library_setLabel",visible:e.setLabelShow,"onUpdate:visible":t[7]||(t[7]=t=>e.setLabelShow=t),footer:null,title:"Edit tag",width:"65%",maskClosable:!1,centered:!0,onCancel:e.clearSetLabel},{default:(0,s.w5)((()=>[(0,s._)("div",Ot,[(0,s._)("ul",Tt,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(e.options,((i,n)=>((0,s.wg)(),(0,s.iD)("li",{class:"optionsItem_title",key:i.id},[(0,s._)("div",It,[(0,s.Wm)(r,{checked:i.checkAll,"onUpdate:checked":e=>i.checkAll=e,onChange:t=>e.onCheckAllChange(i)},null,8,["checked","onUpdate:checked","onChange"]),(0,s.wy)((0,s._)("span",{title:i.classificationName},(0,o.zw)(i.classificationName),9,Nt),[[l.F8,!i.openType]]),(0,s.wy)((0,s._)("input",{type:"text","onUpdate:modelValue":t[0]||(t[0]=t=>e.itemName=t)},null,512),[[l.F8,i.openType],[l.nr,e.itemName]]),(0,s.wy)((0,s._)("i",{onClick:(0,l.iM)((t=>e.putName(n,"affirm",i)),["stop"]),class:"fi fi-br-check"},null,8,Ft),[[l.F8,i.openType]]),(0,s.wy)((0,s._)("i",{onClick:(0,l.iM)((t=>e.putName(n,"put",i)),["stop"]),class:"fi fi-rr-edit"},null,8,Ut),[[l.F8,!i.openType]])]),(0,s.wy)(((0,s.wg)(),(0,s.iD)("ul",jt,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(i.childList,((n,a)=>((0,s.wg)(),(0,s.iD)("li",{class:"childrenItem_title setLabel_text",key:n.id},[(0,s.Wm)(r,{checked:n.checkAll,"onUpdate:checked":e=>n.checkAll=e,onChange:t=>e.onCheckAllchildrenItem(i)},null,8,["checked","onUpdate:checked","onChange"]),(0,s.wy)((0,s._)("span",{title:n.classificationName},(0,o.zw)(n.classificationName),9,Ht),[[l.F8,!n.openType]]),(0,s.wy)((0,s._)("input",{type:"text","onUpdate:modelValue":t[1]||(t[1]=t=>e.itemName=t)},null,512),[[l.F8,n.openType],[l.nr,e.itemName]]),(0,s.wy)((0,s._)("i",{onClick:(0,l.iM)((t=>e.putName(a,"affirm",n)),["stop"]),class:"fi fi-br-check"},null,8,Dt),[[l.F8,n.openType]]),(0,s.wy)((0,s._)("i",{onClick:(0,l.iM)((t=>e.putName(a,"put",n)),["stop"]),class:"fi fi-rr-edit"},null,8,Rt),[[l.F8,!n.openType]])])))),128)),(0,s._)("li",Vt,[(0,s.wy)((0,s._)("input",{type:"text","onUpdate:modelValue":t[2]||(t[2]=t=>e.itemName=t)},null,512),[[l.F8,i.addOpenType],[l.nr,e.itemName]]),(0,s.wy)((0,s._)("i",{onClick:(0,l.iM)((t=>e.putName(-1,"affirm",i)),["stop"]),class:"fi fi-br-check"},null,8,Bt),[[l.F8,i.addOpenType]]),(0,s.wy)((0,s._)("div",{class:"addLabel",onClick:t=>e.newLabel(i,i.id)},"+",8,zt),[[l.F8,!i.addOpenType]])])])),[[h]])])))),128)),(0,s._)("li",Et,[(0,s._)("div",null,[(0,s.wy)((0,s._)("input",{type:"text","onUpdate:modelValue":t[3]||(t[3]=t=>e.itemName=t)},null,512),[[l.F8,e.openType],[l.nr,e.itemName]]),(0,s.wy)((0,s._)("i",{onClick:t[4]||(t[4]=(0,l.iM)((t=>e.putName(-1,"affirm","")),["stop"])),class:"fi fi-br-check"},null,512),[[l.F8,e.openType]]),(0,s.wy)((0,s._)("div",{class:"addLabel",onClick:t[5]||(t[5]=t=>e.newLabel("",""))},"+",512),[[l.F8,!e.openType]])]),(0,s._)("div",{class:"started_btn",onClick:t[6]||(t[6]=t=>e.removeLabel(e.options))},"删除")])])])])),_:1},8,["visible","onCancel"])}var Zt=i(1446),At=(0,s.aZ)({components:{VueCropper:vt.AK},setup(){let e=(0,Fe.iH)(!1),t=(0,Fe.iH)(!0),i=(0,Fe.iH)([]),o=(0,s.f3)("type"),l=(0,Fe.iH)([]),n=(0,Fe.iH)(!1),a=(0,Fe.iH)(""),{t:c}=(0,Ct.QT)();return{multiple:e,indeterminate:t,value:(0,Fe.iH)([]),options:i,checkedList:l,openType:n,type:o,itemName:a,t:c}},data(){return{setLabelShow:!1}},mounted(){},watch:{},directives:{mousewheel:{mounted(e){let t=document.getElementsByClassName("setLabel_centent")[0];(0,s.Y3)().then((()=>{let i=document.getElementsByClassName("childrenItem"),s=e=>{e.stopPropagation(),t.classList.add("active")},o=e=>{e.stopPropagation(),t.classList.remove("active")};for(let e=0;e<i.length;e++)i[e].addEventListener("mouseover",s,!1),i[e].addEventListener("mouseleave",o,!1);e.addEventListener("wheel",(t=>{let i=0;i=t.deltaY>0?25:-25,e.scrollBy(i,0)}),!0)}))}}},methods:{init(e,t){this.setLabelShow=!0,this.multiple="add"!==e,this.clearOpenType(),this.options=t},clearSetLabel(){this.clearOpenType();let e=this.$parent;e.getClass()},onCheckAllChange(e){e?.childList&&e?.childList.forEach((t=>{t.checkAll=e.checkAll}))},onCheckAllchildrenItem(e){let t=e?.childList.every((e=>e.checkAll));e.checkAll=!!t},clearOpenType(){this.options.forEach((e=>{e.openType=!1,e.addOpenType=!1,e?.children&&e?.children?.forEach((e=>{e.openType=!1}))})),this.openType=!1},putName(e,t,i){let s;"put"==t?(this.clearOpenType(),i.openType=!0,this.itemName=i.classificationName):"affirm"==t&&(-1==e?""==this.itemName?Zt.ZP.warning(this.t("Habit.jsContent2")):i?(i.addOpenType=!1,s={classificationName:this.itemName,parentId:i.id}):(this.openType=!1,s={classificationName:this.itemName,parentId:""}):(s={id:i.id,classificationName:this.itemName},i.classificationName=this.itemName,i.openType=!1),this.addLabel(s))},newLabel(e,t){this.itemName="",this.clearOpenType(),e?e.addOpenType=!0:this.openType=!0},removeLabel(e){let t={classificationIdList:[],deleteConfirm:0},i=[];this.clearOpenType(),e.forEach((e=>{e.checkAll?i.push(e.id):e.childList&&e.childList.forEach((e=>{e.checkAll&&i.push(e.id)}))})),t.classificationIdList=i,this.deleteClass(t)},addLabel(e){let t=this.setLabelData();e.parentId&&(t.parentId=e.parentId),e.id&&(t.id=e.id),t.classificationName=e.classificationName,bt.V.axiosPost(bt.V.httpUrls.saveOrUpdate,t).then((e=>{this.getClass()})).catch((e=>{}))},deleteClass(e){bt.V.axiosPost(bt.V.httpUrls.classificationDelete,e).then((e=>{this.getClass()})).catch((e=>{}))},getClass(){let e=this.setLabelData();bt.V.axiosPost(bt.V.httpUrls.queryClassification,e).then((e=>{this.options=e})).catch((e=>{}))},setLabelData(){let e={classificationIdList:[],classificationName:"123221",createTime:"",deleteConfirm:"",id:"",libraryId:"",parentId:"",type:this.type?.selectCode._value,updateTime:"",userId:""};return e}}});const Gt=(0,xt.Z)(At,[["render",$t]]);var Wt=Gt;const Yt=(0,s._)("span",{class:"icon iconfont icon-guanbi"},null,-1),Jt=[Yt],qt={class:"models_placement_body"},Kt={class:"palcement_modal_header"},Xt={class:"models_placement_title"},Qt={class:"placement_operate_list"},ei=(0,s._)("div",{class:"icon iconfont icon-baocun1 operate_icon"},null,-1),ti={class:"operate_item_des"},ii=(0,s._)("div",{class:"icon iconfont icon-shengchengyulan operate_icon"},null,-1),si={class:"operate_item_des"},oi=(0,s._)("div",{class:"icon iconfont icon-fanhui1 operate_icon"},null,-1),li={class:"operate_item_des"},ni=(0,s._)("div",{class:"icon iconfont icon-huifu operate_icon"},null,-1),ai={class:"operate_item_des"},ci={key:0,class:"plcaement_point_content"},ri={class:"ponit_title"},di={class:"point_list"},hi=["onTouchstart"],pi={class:"placement_content_operate_list"},mi=(0,s._)("div",{class:"placement_remove_point_block"},null,-1),ui=(0,s._)("div",{class:"placement_content_operate_des"},"Remove Point",-1),gi=[mi,ui],_i=(0,s._)("div",{class:"placement_tip_content"},"Please change the pure white inside the mannequin for another color to enhance your experience",-1),bi={class:"img_preview_block"},fi={class:"perview_mark_loading"},yi={class:"img_content_block",ref:"imgbox"},vi=["src"],wi=["onTouchstart"],Li={class:"icon iconfont icon-guanbi"};function ki(e,t,i,n,a,c){const r=(0,s.up)("a-spin"),d=(0,s.up)("a-modal");return(0,s.wy)(((0,s.wg)(),(0,s.iD)("div",null,[(0,s.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,s.w5)((()=>[(0,s._)("div",{class:"close_icon",onClick:t[0]||(t[0]=(0,l.iM)((t=>e.closeModal()),["stop"]))},Jt)])),default:(0,s.w5)((()=>[(0,s._)("div",qt,[(0,s._)("div",Kt,[(0,s._)("div",Xt,(0,o.zw)(e.$t("ModelPlacementMobile.Registration")),1),(0,s._)("div",Qt,[(0,s.wy)((0,s._)("div",{class:"operate_item",onClick:t[1]||(t[1]=(...t)=>e.submitPlacement&&e.submitPlacement(...t))},[ei,(0,s._)("div",ti,(0,o.zw)(e.$t("ModelPlacementMobile.Submit")),1)],512),[[l.F8,6==e.locationList.length]]),(0,s.wy)((0,s._)("div",{class:"operate_item",onClick:t[2]||(t[2]=(...t)=>e.printPreview&&e.printPreview(...t))},[ii,(0,s._)("div",si,(0,o.zw)(e.$t("ModelPlacementMobile.Preview")),1)],512),[[l.F8,6==e.locationList.length]]),(0,s.wy)((0,s._)("div",{class:"operate_item",onClick:t[3]||(t[3]=(...t)=>e.backPreview&&e.backPreview(...t))},[oi,(0,s._)("div",li,(0,o.zw)(e.$t("ModelPlacementMobile.Back")),1)],512),[[l.F8,e.perviewUrl]]),(0,s._)("div",{class:"operate_item",onClick:t[4]||(t[4]=(...t)=>e.restoreLocationList&&e.restoreLocationList(...t))},[ni,(0,s._)("div",ai,(0,o.zw)(e.$t("ModelPlacementMobile.Restore")),1)])])]),(0,s._)("div",{class:"models_placement_content",onTouchmove:t[7]||(t[7]=t=>e.startMove(t))},[88==e.userInfo.userId||83==e.userInfo.userId?((0,s.wg)(),(0,s.iD)("div",ci,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(e.pointList,((t,i)=>((0,s.wg)(),(0,s.iD)("div",{class:"placement_point_item",key:i},[(0,s._)("div",ri,(0,o.zw)(t.title),1),(0,s._)("div",di,[((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(t.pointList,(t=>((0,s.wg)(),(0,s.iD)("div",{class:"point_item",key:t.color,style:(0,o.j5)({borderColor:t.color,visibility:t.show?"inherit":"hidden"}),onTouchstart:i=>e.AddDian(t)},[(0,s._)("div",{class:"point_block",style:(0,o.j5)({background:t.color})},null,4)],44,hi)))),128))])])))),128))])):(0,s.kq)("",!0),(0,s._)("div",pi,[(0,s._)("div",{class:"placement_content_operate_item",onClick:t[5]||(t[5]=(...t)=>e.changeRemoveStatus&&e.changeRemoveStatus(...t))},gi)]),_i,(0,s._)("div",bi,[(0,s.wy)((0,s._)("div",fi,[(0,s.Wm)(r,{size:"large"})],512),[[l.F8,e.isShowMark]]),(0,s._)("div",yi,[(0,s._)("img",{class:"placement_img",src:e.perviewUrl||e.printObject?.url},null,8,vi),((0,s.wg)(!0),(0,s.iD)(s.HY,null,(0,s.Ko)(e.locationList,((i,n)=>((0,s.wg)(),(0,s.iD)("div",{class:(0,o.C_)(["ponit_click",e.isRemoveStatus?"remove_point_click":""]),key:i,style:(0,o.j5)({left:i.left+"px",top:i.top+"px",borderColor:i.color}),onTouchstart:t=>e.getMouseDown(t,i,n),onTouchmove:t[6]||(t[6]=t=>e.startMove(t))},[(0,s.wy)((0,s._)("div",{class:"placement_add_point_content",style:(0,o.j5)({background:i.color})},null,4),[[l.F8,!e.isRemoveStatus]]),(0,s.wy)((0,s._)("div",Li,null,512),[[l.F8,e.isRemoveStatus]])],46,wi)))),128))],512)])],32)])])),_:1},8,["visible"])],512)),[[l.F8,e.placementShow]])}var Ci=(0,s.aZ)({setup(){const e=(0,wt.oR)();let t=(0,Fe.iH)([]),i=(0,Fe.iH)([]),s=(0,Fe.iH)({}),o=(0,Fe.iH)({}),l=(0,Fe.iH)(null),n=(0,Fe.iH)({}),a=(0,Fe.iH)([]),c=(0,Fe.iH)([]),r=(0,Fe.iH)(!1),d=(0,Fe.iH)(!1),h=(0,Fe.iH)();return{store:e,oldLocationList:t,locationList:i,printObject:s,imgBox:o,intObj:l,currentSign:n,oldPointList:a,pointList:c,isSubmit:r,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,yt.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(){bt.V.axiosGet(bt.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,s=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>=s&&(this.currentSign.left=s)},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):Lt.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,s.Wm)(kt.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,bt.V.axiosPost(bt.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)=>{bt.V.axiosPost(bt.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,o)=>{Lt.Z.confirm({title:"This picture has been uploaded whether to continue uploading? ",icon:(0,s.Wm)(kt.Z),okText:"Yes",cancelText:"No",mask:!1,onOk(){e.checkMd5=0,bt.V.axiosPost(bt.V.httpUrls.libraryUpload,e,{headers:{"Content-Type":"multipart/form-data"}}).then((e=>{t.isShowMark=!1,i(e)})).catch((e=>{o(e)}))},onCancel(){t.isShowMark=!1}})}))},getPrintLocation(){let{width:e,height:t}=this.imgBox,i={},s={},o=JSON.parse(JSON.stringify(this.locationList));for(let l of o)i[l.field]=i[l.field]||[],i[l.field].push(l);for(let l in i)i[l].sort(this.sortBy("left")),i[l].forEach(((i,o)=>{i.type=o?i.field+"Right":i.field+"Left",i.left=((i.left+12)/e).toFixed(4),i.top=((i.top+12)/t).toFixed(4),s[i.type]=[i.left,i.top]}));return s},sortBy(e){return function(t,i){return t[e]-i[e]}},printPreview(){},backPreview(){this.perviewUrl=""}}});const Si=(0,xt.Z)(Ci,[["render",ki]]);var xi=Si,Mi=i(8818),Pi=i(4873),Oi=(0,s.aZ)({components:{HeaderComponent:Ue.Z,ModelPlacement:Pt,setLabel:Wt,ModelPlacementMobile:xi,RobotAssist:Mi.Z},setup(){let e=(0,Fe.iH)([{title:(0,Ct.QT)().t("LibraryPage.Moodboard"),code:"Moodboard",icon:"fi fi-rr-grid",showChildren:!1,children:[]},{title:(0,Ct.QT)().t("LibraryPage.Prints"),code:"Printboard",icon:"fi fi-rs-objects-column",showChildren:!1,children:[]},{title:(0,Ct.QT)().t("LibraryPage.Sketches"),code:"Sketchboard",icon:"fi icon iconfont icon-a-waitao_changkuanwaitao11x",showChildren:!1,children:[]},{title:(0,Ct.QT)().t("LibraryPage.Mannequins"),code:"Models",icon:"fi fi-rs-people",showChildren:!1,children:[]}]),t=(0,Fe.iH)([]),i=(0,Fe.iH)("Moodboard"),o=(0,Fe.iH)(""),l=(0,Fe.iH)("Outwear"),n=(0,Fe.iH)("Meal"),a=[],c=[],r=(0,Fe.iH)([]),d=(0,Fe.iH)(1),h=(0,Fe.iH)(18),p=(0,Fe.iH)(20),m=(0,Fe.iH)(!1),u=(0,Fe.iH)("single"),g=(0,Fe.iH)(""),_=(0,Fe.iH)(""),b=(0,Fe.iH)(0),f=(0,Fe.iH)(!1),y=(0,Fe.iH)({}),v=(0,wt.oR)(),w=(0,Fe.iH)("Upload"),L=(0,Fe.iH)([{name:"image",type:!1},{name:"text",type:!0},{name:"text-image",type:!1}]),k=(0,Fe.iH)(!1),C=(0,Fe.iH)(),S=(0,Fe.iH)(),x=(0,Fe.iH)(),M=(0,Fe.iH)([]),P=(0,Fe.iH)([]),O=(0,Fe.iH)({num:1,optype:!1,name:(0,Ct.QT)().t("LibraryPage.model")+"1"}),{t:T}=(0,Ct.QT)();const I=(0,Fe.iH)([]);let N={selectCode:i,designType:l};(0,s.JJ)("type",N);let F=(0,Fe.iH)({labelValue:[],editLabelValue:[]});const U=(e,t)=>t.some((t=>t.label.toLowerCase().indexOf(e.toLowerCase())>-1));let j=(0,Fe.iH)({labelOpen:!1,editLabelOpen:!1});return{menuList:e,selectImgList:t,selectCode:i,searchPictureName:o,sexList:a,sex:n,disignTypeList:c,designType:l,imgList:r,currentPage:d,pageSize:h,total:p,renameVisivle:m,renameType:u,newPicName:g,uploadUrl:_,currentUploadFileNum:b,isShowMark:f,selectSingleImg:y,store:v,uploadGenerate:w,checkbox:L,inputShow:k,generateCheckbox:C,captionGeneration:S,inputTime:x,generateList:M,selectGenerateList:P,printModel:O,value:F,options:I,filter:U,t:T,labelOpen:j}},data(e){return{userInfo:{},indicator:(0,s.h)(Ne.Z,{style:{fontSize:"2.4rem"},spin:!0}),upload:{isPin:0,level1Type:e.selectCode,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone},token:""}},async mounted(){let e=(0,yt.ej)("userInfo");this.userInfo=JSON.parse(e),this.uploadUrl=(0,ft.M$)(),this.getLibraryList(),this.getClass(),this.getSex(),this.token=(0,yt.ej)("token")||""},methods:{getSex(){bt.V.axiosGet(bt.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 bt.V.axiosGet(bt.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}}))},likeFile(e,t){console.log(e)},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.getClass(),this.uploadGenerate="Upload",this.captionGeneration="",this.selectGenerateList=[],this.generateList=[])},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="",this.value.editLabelValue=[],this.value.labelValue=[]},confrimRename(){"single"===this.renameType?this.selectSingleImg.id:this.selectImgList,this.newPicName,Intl.DateTimeFormat().resolvedOptions().timeZone;let e=[];this.value.editLabelValue.forEach((t=>{e.push(t[t.length-1])}));("Sketchboard"==this.selectCode||"MarketingSketch"==this.selectCode)&&this.designType;let t={classificationIdList:e,classificationName:"",createTime:"",id:0,libraryIdList:"single"===this.renameType?[this.selectSingleImg.id]:this.selectImgList,type:this.selectCode,updateTime:"",userId:0};bt.V.axiosPost(bt.V.httpUrls.relationLibrary,t).then((e=>{console.log(e),this.getLibraryList(),this.closeRenameModal()})).catch((e=>{this.closeRenameModal()}))},showRenameModal(e,t){if(this.newPicName="","batch"==t&&!this.selectImgList.length)return this.value.labelValue=[],void(this.newPicName="");"single"===t&&(this.selectSingleImg=e,this.newPicName=e.name),this.renameType=t,this.labelOpen.labelOpen=!1,this.renameVisivle=!0},upLoad(){},uploadGenerateOpen(e){this.uploadGenerate,this.uploadGenerate=e},deleteSinglePic(e,t){this.labelOpen.labelOpen=!1;let i=this;Lt.Z.confirm({title:this.t("LibraryPage.jsContent1"),icon:(0,s.Wm)(kt.Z),okText:"Yes",cancelText:"No",mask:!1,onOk(){i.confirmDeletePic(e,t)}})},deleteBatchPic(){if(!this.selectImgList.length)return;let e=this;Lt.Z.confirm({title:this.t("LibraryPage.jsContent2"),icon:(0,s.Wm)(kt.Z),okText:"Yes",cancelText:"No",onOk(){e.confirmDeletePic("",0)}})},confirmDeletePic(e,t){let i=e?[e.id]:this.selectImgList,s={libraryIds:i};bt.V.axiosPost(bt.V.httpUrls.batchDeleteLibrary,s).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||Zt.ZP.warning(this.t("LibraryPage.jsContent3"));const s=e.size/1024/1024<2;if(s||Zt.ZP.warning(this.t("LibraryPage.jsContent4")),!i||!s)return i&&s||Pi.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:"Sketchboard"==this.selectCode?this.sex:"",modelType:"",checkMd5:1,timeZone:Intl.DateTimeFormat().resolvedOptions().timeZone};this.isShowMark=!0,bt.V.axiosPost(bt.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;Lt.Z.confirm({title:this.t("LibraryPage.jsContent5"),icon:(0,s.Wm)(kt.Z),okText:"Yes",cancelText:"No",mask:!1,zIndex:99999,onOk(){e.checkMd5=0,bt.V.axiosPost(bt.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=[];this.value.labelValue.forEach((t=>{e.push(t[t.length-1])})),console.log(e);let t="Sketchboard"==this.selectCode||"MarketingSketch"==this.selectCode?this.designType:"",i={classificationIdList:e,level1Type:this.selectCode,level2Type:t,page:this.currentPage,modelSex:this.sex?this.sex:"",pictureName:this.searchPictureName,size:this.pageSize};this.isShowMark=!0,bt.V.axiosPost(bt.V.httpUrls.queryLibraryPage,i).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.labelOpen.labelOpen=!1,this.placementClick(t)},placementClick(e){let t=(0,ft.S0)()?this.$refs.ModelPlacementMobile:this.$refs.ModelPlacement;t.showPlacementModal(e)},setKeyword(e){this.checkbox.forEach((e=>{e.type=!1})),(0,s.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,s)=>{t.uid===i.uid&&(e=s)})),e>-1&&this.selectGenerateList.splice(e,1),Zt.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 Zt.ZP.warning(this.t("LibraryPage.jsContent9"))}else if("text"==e){if(i.collectionElementId="",i.level2Type="",!this.captionGeneration)return void Zt.ZP.warning(this.t("LibraryPage.jsContent7"));{let e=this.captionGeneration.split(/\s+/).length;if(e>75)return void Zt.ZP.warning(this.t("LibraryPage.jsContent6"))}}this.isShowMark=!0,bt.V.axiosPost(bt.V.httpUrls.sketchAndPrintGenerate,i).then((e=>{if(e){let t;e.generatedCollectionItems.forEach(((e,i)=>{t={id:e.generateItemId,imgUrl:e.generateItemUrl},this.generateList.push(t)})),this.isShowMark=!1}})).catch((e=>{this.isShowMark=!1}))},dropdownVisibleChange(){this.labelOpen.labelOpen=!0,document.addEventListener("click",this.setClick),(0,s.Y3)().then((()=>{let e=document.getElementsByClassName("libraryPageCascader")[0],t=e.children[0].children[0];if(e.addEventListener("click",(e=>{e.stopPropagation()})),e.children[0].children[0].children.length>1);else{let e=document.createElement("span");e.classList.add("started_btn","cascader_btn1");let i=document.createElement("span");i.classList.add("started_btn","cascader_btn2");let s=document.createElement("div");s.classList.add("cascader_btn_max"),e.textContent="redact",e.addEventListener("click",this.addLabel,!1),s.appendChild(e),t?.insertAdjacentElement("afterbegin",s)}}))},setLabel1(e,t){this.$refs.cascader},setClick(){this.labelOpen.labelOpen=!1,this.labelOpen.editLabelOpen=!1,document.removeEventListener("click",this.setClick)},removeClick(){},addLabel(){let e=this.$refs.setLabel;this.labelOpen.labelOpen=!1,e.init("add",this.options)},labelSearch(){this.labelOpen.editLabelOpen=!0,document.addEventListener("click",this.setClick),(0,s.Y3)().then((()=>{let e=document.getElementsByClassName("editLabel")[0];e.addEventListener("click",(e=>{e.stopPropagation()})),console.log(this.value.editLabelValue)}))},getClass(){("Sketchboard"==this.selectCode||"MarketingSketch"==this.selectCode)&&this.designType;let e={classificationIdList:[],classificationName:"",createTime:"",deleteConfirm:"",id:"",libraryId:"",parentId:"",type:this.selectCode,updateTime:"",userId:""};bt.V.axiosPost(bt.V.httpUrls.queryClassification,e).then((e=>{console.log(e),this.options=e})).catch((e=>{}))}}});const Ti=(0,xt.Z)(Oi,[["render",Ie]]);var Ii=Ti}}]); |