1 |
- import{n as u,r,_ as p}from"./index.4fdc1c7a.js";import{W as _}from"./index.c54dae8c.js";const m={name:"me-arrange-doc",components:{Waterfall:_},data(){return{loading:!1,page:1,limit:10,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={1:"/api/product/collect_list",2:"/api/product/user_product_list"},o=this.$t("common.failure");this.$axios.get(`${e[this.type]}`,{params:{page:a,limit:this.limit,go:this.go}}).then(i=>{const{code:l,msg:c=o,data:n={}}=i.data,{items:s=[],totalPage:d}=n;l==0?(this.products=this.type===1?this.rebuildData(t?s:r(this.products,s)):t?s:r(this.products,s),this.page=a,this.totalPage=d):this.$message.error(c)})}},computed:{type(){const{type:a}=this.$route.query;return parseInt(a)},disabled(){return this.images.length===0}}};var g=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:p,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)])},h=[],f=u(m,g,h,!1,null,"b76931c7",null,null);const b=f.exports;export{b as default};
|