import{n as g,r as m,_ as d}from"./index.13f93d3a.js";import{W as _}from"./index.77c2652a.js";const h={name:"me-change-cover",components:{Waterfall:_},data(){return{images:[],limit:5,page:1,totalPage:1}},mounted(){this.getImages()},methods:{goBack(){this.$router.go(-1)},onSelected(a){const e=a[0],{image:t}=e,s=this.$t("common.failure");this.$axios.post("/api/folder/edit_folder",{images:[t],id:this.id}).then(o=>{const{code:r,msg:i}=o.data;r==0?(this.$message.success(i),this.$router.push({path:"/me/docSetting",query:{id:this.id}})):this.$message.error(i||s)}).catch(()=>{this.$message.error(s)})},loadData(a){this.getImages({page:a,newload:!1})},getImages({page:a=this.page,newload:e=!0}={}){const t=this.$t("common.failure");this.$axios.get("/api/folder/image_list",{params:{page:a,limit:this.limit,folder_id:this.id,go:4}}).then(s=>{const{code:o,msg:r,data:i={}}=s.data;if(o==0){const{items:c=[],page:n,totalPage:l}=i;this.page=n,this.images=e?c:m(this.images,c),this.totalPage=l}else this.$message.error(r||t)}).catch(()=>{this.$message.error(t)})}},computed:{id(){const{id:a}=this.$route.query;return parseInt(a)}}};var u=function(){var e=this,t=e._self._c;return t("div",{staticClass:"me-change-cover"},[t("div",{staticClass:"top"},[t("div",{staticClass:"back",on:{click:e.goBack}},[t("img",{attrs:{src:d,alt:"back icon"}})]),t("b",[e._v(e._s(e.$t("me.profile.changeCover.title")))])]),t("div",{staticClass:"pictures"},[e.images.length?t("Waterfall",{attrs:{data:e.images,page:e.page,totalPage:e.totalPage},on:{loadData:e.loadData,selected:e.onSelected}}):e._e()],1)])},p=[],f=g(h,u,p,!1,null,"73048a58",null,null);const C=f.exports;export{C as default};
