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