import{n,r as d,_ as u}from"./index.13f93d3a.js";import{W as m}from"./index.77c2652a.js";const _={name:"me-arrange-doc",components:{Waterfall:m},data(){return{loading:!1,page:1,limit:5,totalPage:1,go:5,products:[],images:[]}},mounted(){this.getProducts()},methods:{rebuildData(a){return a.map(t=>t.map(e=>({...e.product})))},toMovefile(){this.$router.push({path:"/me/moveFile",query:{ids:this.images.map(a=>a.id).join(","),type:this.type}})},onSelected(a){this.images=a},loadData(a){this.getProducts({page:a,newload:!1})},getProducts({page:a=this.page,newload:t=!0}={}){const e=this.$t("common.failure");this.$axios.get("/api/product/collect_list",{params:{page:a,limit:this.limit,go:this.go}}).then(r=>{const{code:o,msg:i=e,data:l={}}=r.data,{items:s=[],totalPage:c}=l;o==0?(this.products=this.rebuildData(t?s:d(this.products,s)),this.page=a,this.totalPage=c):this.$message.error(i)}).catch(()=>{this.$message.error(e)})}},computed:{type(){const{type:a}=this.$route.query;return parseInt(a)},disabled(){return this.images.length===0}}};var p=function(){var t=this,e=t._self._c;return e("div",{staticClass:"me-arrange-doc"},[e("div",{staticClass:"top"},[e("div",{staticClass:"back"},[e("router-link",{attrs:{to:"/me/profile"}},[e("img",{attrs:{src:u,alt:"back icon"}})])],1),e("b",[t._v(t._s(t.$t("me.profile.arrangeDoc.title")))])]),e("div",{staticClass:"pictures"},[t.products.length?e("Waterfall",{attrs:{page:t.page,totalPage:t.totalPage,data:t.products},on:{loadData:t.loadData,selected:t.onSelected}}):t._e()],1),e("div",{staticClass:"button"},[e("el-button",{staticClass:"complete",attrs:{disabled:t.disabled,type:"primary",round:""},on:{click:t.toMovefile}},[t._v(t._s(t.$t("common.complete")))])],1)])},g=[],h=n(_,p,g,!1,null,"502c1e2a",null,null);const y=h.exports;export{y as default};
