1import{n as e,r as t}from"./61b66786.8BhlS34s.js";import{An as n,Ao as r,Fn as i,Gn as a,In as o,Kn as s,Ln as c,Nn as l,On as u,Ou as d,Pn as f,Rn as p,Sd as m,ap as h,kn as g,ko as _,ku as v,op as y,xd as ee}from"./027ffcfc.eLkoaQ3Q.js";import{J as te,ut as b}from"./ce65bdc9.BVjkH_eL.js";import{S as x,_ as ne,a as re,i as ie,x as S}from"./15330c0f.BoXUDCbg.js";import{mapGetters as ae}from"https://js-c.etc4.com/dxb/js/vuex.DhHkobAa.js";import{Fragment as C,createBlock as oe,createCommentVNode as w,createElementBlock as T,createElementVNode as E,createTextVNode as D,createVNode as O,normalizeStyle as k,openBlock as A,resolveComponent as j,resolveDirective as M,toDisplayString as N,withCtx as P,withDirectives as F}from"https://js-c.etc4.com/dxb/js/vue.CQKD6T8K.js";import{mapFields as I}from"https://js-c.etc4.com/dxb/js/vuex-map-fields.BoHiwyfx.js";var L=t({default:()=>Q});function se(e,t,n,r,i,a){let o=j(`BannerSearch`),s=j(`DxbTagsOrder`),c=j(`UploadShare`),l=j(`Button`),u=j(`DxbBtnBar`),d=j(`Divider`),f=j(`LazyImg`),p=j(`DxbIcon`),m=j(`Waterfall`),h=j(`DxbPage`),g=j(`LoadingWrapper`),_=M(`line-clamp`),v=M(`permission`);return A(),T(`div`,z,[F((A(),T(`div`,null,[O(o,{class:`mb20`,onSearch:t[0]||=e=>{i.moduleName=e,a.handleInit()}}),E(`div`,B,[n.actionType===`view`&&a.shopTags.list.length?(A(),oe(u,{key:0,class:`flex-center`,style:{padding:`0`}},{right:P(()=>[E(`div`,V,[O(c),O(l,{type:`primary`,onClick:a.toAddNewTemplate},{default:P(()=>[...t[7]||=[D(` æ°å»ºæ¨¡æ¿ `,-1)]]),_:1},8,[`onClick`])])]),default:P(()=>[O(s,{modelValue:a.shopTags.activeId,"onUpdate:modelValue":[t[1]||=e=>a.shopTags.activeId=e,t[2]||=t=>{e.storeId=Number(t),a.handleInit()}],label:a.shopTags.label,list:a.shopTags.list},null,8,[`modelValue`,`label`,`list`])]),_:1})):w(``,!0),O(s,{modelValue:i.moduleTypes.activeId,"onUpdate:modelValue":[t[3]||=e=>i.moduleTypes.activeId=e,t[4]||=e=>{i.moduleType=e,a.handleInit()}],label:i.moduleTypes.label,list:i.moduleTypes.list},null,8,[`modelValue`,`label`,`list`]),O(d,{style:{margin:`16px 0 0 0`}})]),O(g,{status:i.loadingStatus,style:{"min-height":`100px`}},{default:P(()=>[i.moduleType===`all`?(A(),T(C,{key:0},[O(m,{class:`new-waterfall`,width:240,imgSelector:`thumbnailImg`,breakpoints:{1200:{rowPerView:5}},list:a.viewTemplates},{default:P(({item:r,url:i,index:o})=>[(A(),T(`div`,{key:`${o}-${r.id}`,class:`templateItem`,style:k(r.style),title:r.name},[r.type===`action`?(A(),T(`div`,U,[O(l,{type:`primary`,size:`large`,onClick:a.handleCreateNewTemplate},{default:P(()=>[...t[8]||=[D(` åå»ºç©ºç½æ¨¡æ¿ `,-1)]]),_:1},8,[`onClick`]),O(l,{type:`primary`,size:`large`,class:`mt10`,onClick:a.copyOnlineDetail2Template},{default:P(()=>[...t[9]||=[D(` éé线ä¸è¯¦æ
`,-1)]]),_:1},8,[`onClick`])])):(A(),T(C,{key:1},[O(f,{url:r.thumbnailImg,class:`imageCss`},null,8,[`url`]),E(`div`,W,[n.actionType===`view`?(A(),T(C,{key:0},[E(`div`,{class:`xui-iconbtn layout__btns-remove`,onClick:e=>a.deleteItem(`templates`,r)},[O(p,{name:`iconshanchu`,size:`16`})],8,G),O(l,{type:`primary`,size:`large`,style:{width:`100px`},onClick:e=>a.editThisItem(`templates`,r)},{default:P(()=>[...t[10]||=[D(` ç¼è¾ `,-1)]]),_:1},8,[`onClick`]),O(l,{type:`primary`,size:`large`,class:`mt10`,style:{width:`100px`},onClick:t=>e.previewThisItem(`diy`,r)},{default:P(()=>[...t[11]||=[D(` é¢è§ `,-1)]]),_:1},8,[`onClick`])],64)):w(``,!0),n.actionType===`apply`?(A(),T(C,{key:1},[O(l,{type:`primary`,size:`large`,style:{width:`100px`},onClick:e=>a.applyThisItem(`templates`,r,`insert`)},{default:P(()=>[...t[12]||=[D(` æå
¥ `,-1)]]),_:1},8,[`onClick`]),O(l,{type:`primary`,size:`large`,style:{width:`100px`},class:`mt-5`,onClick:e=>a.applyThisItem(`templates`,r,`replace`)},{default:P(()=>[...t[13]||=[D(` æ¿æ¢ `,-1)]]),_:1},8,[`onClick`])],64)):w(``,!0)]),F((A(),T(`span`,{title:r.name,class:`template_title`},[D(N(r.name),1)],8,K)),[[_,1]])],64))],12,H))]),_:1},8,[`list`]),O(h,{modelValue:i.Pages,"onUpdate:modelValue":[t[5]||=e=>i.Pages=e,a.handleInit],align:`center`,style:{"text-align":`center`},"show-elevator":!1,"show-sizer":!1},null,8,[`modelValue`,`onUpdate:modelValue`])],64)):w(``,!0),i.moduleType===`one`?(A(),T(C,{key:1},[O(m,{class:`new-waterfall`,width:240,imgSelector:`thumbnailImg`,breakpoints:{1200:{rowPerView:5}},list:a.viewModules},{default:P(({item:e,url:r,index:i})=>[(A(),T(`div`,{key:`${i}-${e.id}`,class:`templateItem`,style:k(e.style),title:e.name},[e.type===`action`?(A(),T(`div`,J,[O(l,{type:`primary`,size:`large`,onClick:a.handleCreateNewTemplate},{default:P(()=>[...t[14]||=[D(` åå»ºç©ºç½æ¨¡æ¿ `,-1)]]),_:1},8,[`onClick`]),O(l,{type:`primary`,size:`large`,class:`mt10`,onClick:a.copyOnlineDetail2Template},{default:P(()=>[...t[15]||=[D(` éé线ä¸è¯¦æ
`,-1)]]),_:1},8,[`onClick`])])):(A(),T(C,{key:1},[O(f,{url:e.thumbnailImg,class:`imageCss`},null,8,[`url`]),E(`div`,Y,[n.actionType===`view`?(A(),T(C,{key:0},[E(`div`,{class:`xui-iconbtn layout__btns-remove`,onClick:t=>a.deleteItem(`modules`,e)},[O(p,{name:`iconshanchu`,size:`16`})],8,X),O(l,{type:`primary`,size:`large`,style:{width:`100px`},onClick:t=>a.editThisItem(`modules`,e)},{default:P(()=>[...t[16]||=[D(` ç¼è¾ `,-1)]]),_:1},8,[`onClick`])],64)):w(``,!0),n.actionType===`apply`?(A(),T(C,{key:1},[O(l,{type:`primary`,size:`large`,style:{width:`100px`},onClick:t=>a.applyThisItem(`modules`,e,`insert`)},{default:P(()=>[...t[17]||=[D(` æå
¥ `,-1)]]),_:1},8,[`onClick`]),O(l,{type:`primary`,size:`large`,style:{width:`100px`},class:`mt-5`,onClick:t=>a.applyThisItem(`modules`,e,`replace`)},{default:P(()=>[...t[18]||=[D(` æ¿æ¢ `,-1)]]),_:1},8,[`onClick`])],64)):w(``,!0)]),F((A(),T(`span`,{title:e.name,class:`template_title`},[D(N(e.name),1)],8,Z)),[[_,1]])],64))],12,q))]),_:1},8,[`list`]),O(h,{modelValue:i.PagesModule,"onUpdate:modelValue":[t[6]||=e=>i.PagesModule=e,a.handleInit],align:`center`,style:{"text-align":`center`},"show-elevator":!1,"show-sizer":!1},null,8,[`modelValue`,`onUpdate:modelValue`])],64)):w(``,!0)]),_:1},8,[`status`])])),[[v,e.$route.name,void 0,{page:!0}]])])}var R,z,B,V,H,U,W,G,K,q,J,Y,X,Z,Q;function $(){return($=e((()=>{c(),i(),f(),ne(),g(),r(),te(),s(),v(),h(),u(),m(),R={name:`MyTemplate`,components:{UploadShare:o,LoadingWrapper:a,Empty:d,BannerSearch:l},mixins:[n],props:{actionType:{type:[String,Number],default:`view`},isEditModule:{type:Boolean,default:!1}},data(){return{loadingStatus:`loading`,moduleName:``,moduleType:`all`,moduleTypes:{label:`ç±»å`,activeId:`all`,list:[{name:`å
¨å¥æ¨¡æ¿`,id:`all`}
1,{name:`å个模å`,id:`one`}]},templates:[],modules:[],Pages:{current:1,total:0,pageSize:20},PagesModule:{current:1,total:0,pageSize:20}}},computed:{...ae(`user_store`,[`isAdmin`,`shopList`,`getPlatform`,`currentShopId`]),...I(`renovationDetailRobot_Alibaba`,[`storeId`]),shopTags(){return{label:`åºéº`,activeId:String(this.storeId),list:this.shopList.map(e=>({name:e.storeName,id:String(e.id)}))}},viewTemplates(){return[{type:`action`,style:{height:`300px`,background:`#fff`}},...this.templates.map(e=>(e.style=e.style||{},e))]},viewModules(){return[{type:`action`,style:{height:`300px`,background:`#fff`}},...this.modules.map(e=>(e.style=e.style||{},e))]}},async created(){this.storeId=this.currentShopId,this.isEditModule&&(this.moduleTypes.list.shift(),this.moduleTypes.activeId=this.moduleType=`one`),await this.handleInit()},methods:{async handleInit(){this.loadingStatus=`loading`,this.moduleType===`all`?await x({currPage:this.Pages.current,pageSize:this.Pages.pageSize,moduleName:this.moduleName}).then(async e=>{this.templates=b(this.Pages,e),this.loadingStatus=`end`}):this.moduleType===`one`&&await S({currPage:this.PagesModule.current,pageSize:this.PagesModule.pageSize,moduleName:this.moduleName}).then(async e=>{this.modules=b(this.PagesModule,e),this.loadingStatus=`end`})},deleteItem(e,t){_(()=>{e===`templates`?re({id:t.id}).then(()=>{y.info(`模æ¿å·²å é¤ï¼`),this.handleInit()}):ie({id:t.id}).then(()=>{y.info(`模åå·²å é¤ï¼`),this.handleInit()})})},editThisItem(e,t){$$routeTo({path:`/renovation/detailsRobot/alibaba/editor`,query:{storeId:this.storeId,editType:this.isAdmin?e===`templates`?`designerEditTemplate`:`designerEditModule`:e===`templates`?`editTemplate`:`userEditModuleOfUserModule`,templateId:e===`templates`?t.id:null,templateType:`diy`,moduleType:`diy`,moduleId:e===`modules`?t.id:null}},`_blank`)},applyThisItem(e,t,n){this.$emit(`ok`,{itemType:e,item:t,applyType:n})},toAddNewTemplate(e={}){let t={editType:`newTemplate`,storeId:this.storeId,...e};$$routeTo({name:`alibaba_detailsRobotEditor`,query:t},`_blank`)},handleCreateNewTemplate(){return this.toAddNewTemplate()},copyOnlineDetail2Template(){p().then(([e])=>{this.toAddNewTemplate({templateFromGoodsLink:e})})}}},z={class:`myTemplate`},B={class:`template-filter mb20`},V={class:`flex-row-margin-small`},H=[`title`],U={key:0,class:`flex-col-center wrap h-full`,style:{"justify-content":`center`}},W={class:`template-mask flex-col-center wrap`},G=[`onClick`],K=[`title`],q=[`title`],J={key:0,class:`flex-col-center wrap h-full`,style:{"justify-content":`center`}},Y={class:`template-mask flex-col-center wrap`},X=[`onClick`],Z=[`title`],Q=ee(R,[[`render`,se],[`__scopeId`,`data-v-7a7f9713`]])})))()}export{Q as n,L as r,$ as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.