import{_ as o,a as c,b as l,c as _,d as p}from"./ring.7cbf539f.js";import{H as f}from"./header.084c865c.js";import{n as u,b as d,c as m,F as h,C as v}from"./index.13f93d3a.js";const g={name:"makeup-filter-puff",components:{Header:f},data(){return{containers:[],curContainerId:""}},mounted(){const a=this.$t("common.failure");this.$axios.get("/api/upload_type_list",{params:{pid:this.id}}).then(t=>{const{code:e,msg:s=a,data:i=[]}=t.data;if(e==0){const n=i.find(r=>r.id===this.containerId);this.getContainers(n)}else this.$message.error(s||a)}).catch(()=>{this.$message.error(a)})},methods:{toBase(){sessionStorage.setItem("conf_filters",JSON.stringify([this.containers])),this.$router.push({path:"/makeup",query:{filter:`${this.curContainerId}`}})},changeContainer(a){this.curContainerId=a},fillEmpty(a){for(let t=5;t>=0;t--)if(!a[t]){a[t]={type:"empty"};continue}return a},rebuildContainers(a){let t=d[this.id];t=t[this.containerId];const e=a.map(s=>{const i=t[s.id];return{...s,type:i,image:new URL(Object.assign({"../../../../assets/images/makeup/filter/containers/puff/NBR.png":o,"../../../../assets/images/makeup/filter/containers/puff/loose.png":c,"../../../../assets/images/makeup/filter/containers/puff/multiform.png":l,"../../../../assets/images/makeup/filter/containers/puff/resistent.png":_,"../../../../assets/images/makeup/filter/containers/puff/ring.png":p})[`../../../../assets/images/makeup/filter/containers/puff/${i}.png`],self.location).href}});return this.fillEmpty(e)},getContainers({id:a}){const t=this.$t("common.failure");this.$axios.get("/api/upload_type_list",{params:{pid:a}}).then(e=>{const{code:s,msg:i=t,data:n=[]}=e.data;s==0?this.containers=this.rebuildContainers(n):this.$message.error(i||t)}).catch(()=>{this.$message.error(t)})}},computed:{id(){return m[h.mode].puff},containerId(){return v[this.id]},disabled(){return!this.curContainerId},nameKey(){return this.$store.state.nameKey}}};var C=function(){var t=this,e=t._self._c;return e("div",{staticClass:"makeup-filter-puff"},[e("div",{staticClass:"filter-content"},[e("Header",{attrs:{type:"puff"}}),e("div",{staticClass:"filter-container"},[e("div",{staticClass:"row"},[e("div",{staticClass:"all column-item"},[e("div",{staticClass:"selection"}),e("div",{staticClass:"content"},[e("div",{staticClass:"top"},[e("b",[t._v(t._s(t.$t("common.filter.all")))])]),e("div",{staticClass:"bottom"},[t._v(" "+t._s(t.$t("common.filter.container"))+" ")])])]),t._l(t.containers,function(s){return e("div",{key:s.id,class:["column-item",s.type,s.type==="other"?"vh-center":"",s.type==="empty"?"filter":"",t.curContainerId===s.id?"selected":""],on:{click:function(i){return t.changeContainer(s.id)}}},[s.type==="empty"?void 0:[t._m(0,!0),e("div",{staticClass:"content"},[e("div",{staticClass:"top"},[s.type==="other"?e("span",[t._v(t._s(s[t.nameKey]))]):e("img",{attrs:{src:s.image,alt:"plastic"}})]),s.type==="other"?e("div",{staticClass:"bottom"}):e("div",{staticClass:"bottom"},[t._v(" "+t._s(s[t.nameKey])+" ")])])]],2)})],2)]),e("div",{staticClass:"upload-makeup-footer"},[e("el-button",{attrs:{type:"primary",disabled:t.disabled,round:""},on:{click:t.toBase}},[t._v(t._s(t.$t("common.resume")))])],1)],1)])},y=[function(){var a=this,t=a._self._c;return t("div",{staticClass:"selection"},[t("i",{staticClass:"el-icon-success"})])}],b=u(g,C,y,!1,null,"7e42f770",null,null);const E=b.exports;export{E as default};
