import{e as c}from"./index-cf27e902.js";import{n as m,ai as l,a9 as u,V as p}from"./index-b54f5418.js";import"./three-dc46505d.js";var f=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"containerOperation-container"},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.loading,expression:"loading"}],staticClass:"loading-mask"},[i("vis-icon",{staticClass:"ani",attrs:{code:"#iconxuanzhuan"}}),i("span",[e._v("正在加载...")])],1),!e.loading&&!e.floderChildren.length?i("div",{staticClass:"empty-tips"},[i("span",[e._v("这里暂时是空的哦")])]):e._l(e.floderChildren,function(o,n){return i("div",{directives:[{name:"tooltip",rawName:"v-tooltip.bottom",value:`${o.name}`,expression:"`${item.name}`",modifiers:{bottom:!0}}],key:n,staticClass:"file-item-box",class:{active:!1},on:{click:function(s){return e.chouseFile(o)}}},[o.dir?[i("vis-icon",{attrs:{size:e.iconSize,code:"#iconwenjianjia"}})]:[i("img",{attrs:{src:o.preview}})],i("span",{staticClass:"item-title",domProps:{textContent:e._s(o.name)}}),i("vis-icon",{directives:[{name:"tooltip",rawName:"v-tooltip.bottom",value:"删除",expression:"`删除`",modifiers:{bottom:!0}}],staticClass:"item-delete",attrs:{size:"16px",code:"#iconshanchu"},nativeOn:{click:function(s){return s.stopPropagation(),e.remove(o)}}})],2)}),i("div",{staticClass:"file-item-placeholder",style:{display:e.floderChildren.length%2!==0?"block":"none",flex:1}})],2)},g=[];const v={data(){return{iconSize:"35px",timer:"",fileIcon:{mtl:"#iconmtl"},configTemplateCache:{},configRootCache:{}}},computed:{loading(){return this.$store.getters["modelLibrary/loading"]},currentFloder(){return this.$store.getters["modelLibrary/currentFloder"]},floderChildren(){return this.currentFloder.children},currentScene(){return this.$store.getters["scene/currentScene"]},urls(){return this.$store.getters.urls}},methods:{chouseFile(e){e.dir?this.$store.commit("modelLibrary/currentFloder",e):this.modelSelected(e)},modelSelected(e){let t=this.urls[`model-${e.id}`];if(t||(t=URL.createObjectURL(e.model),this.$store.commit("cacheUrl",{module:"model",file:e,url:t})),!this.configTemplateCache[t])c.loadResourcesAsync([{url:t,ext:e.ext}]).then(i=>{this.configTemplateCache[t]=i.resourceConfig[t];const o=[t,t+".scene"];for(const n of o)if(i.configMap.has(n)){const s=i.configMap.get(n);s.name=e.name,this.configRootCache[t]=s.vid;break}if(!this.configTemplateCache[t]){this.$message.error("加载模型失败！");return}if(!this.configRootCache[t]){this.$message.error("获取模型根元素失败！");return}this.modelSelected(e)});else{const i=this.configTemplateCache[t],{config:o,detail:n}=l.clone(i,{detail:!0,fillName:!0}),s=l.handler(o,r=>u(r.type,r)),h=this.$store.getters["animationClip/list"].length;c.loadConfigAsync(p.observable(s)).then(r=>{if(this.configRootCache[t]){this.$store.commit("notifyAll");const a=this.$store.getters["animationClip/list"];this.$store.commit("animationClip/clipClassify",{object:n[this.configRootCache[t]],clips:a.slice(h,a.length)}),this.$nextTick(()=>{this.currentScene.children.push(n[this.configRootCache[t]])})}})}},remove(e){return this.$tool.devTips()}}},d={};var C=m(v,f,g,!1,_,"4139c48b",null,null);function _(e){for(let t in d)this[t]=d[t]}const y=function(){return C.exports}();export{y as default};
