import{n as c,_ as d}from"./index.13f93d3a.js";import{_ as n}from"./edit.eaac4fbf.js";const _={name:"me-doc-setting",data(){return{data:{},form:{data:{name:"",images:[],is_private:0,is_del:0},rules:{}}}},mounted(){const a=this.$t("common.failure");this.$axios.get("/api/folder/folder_detail",{params:{id:this.id}}).then(t=>{const{code:e,msg:s,data:i={}}=t.data;if(e==0){const{name:o,images:l,is_private:r,is_del:m}=i;this.form.data.name=o,this.form.data.images=l,this.form.data.is_private=r,this.form.data.is_del=m}else this.$message.error(s||a)}).catch(()=>{this.$message.error(a)})},methods:{onSubmit(){const{name:a,images:t,is_private:e,is_del:s}=this.form.data,i=this.$t("common.failure");this.$axios.post("/api/folder/edit_folder",{id:this.id,images:t,name:a,is_private:e,is_del:s}).then(o=>{const{code:l,msg:r,data:m={}}=o.data;l==0?(this.$message.success(r),this.$router.push({path:"/me/profile"})):this.$message.error(r||i)}).catch(()=>{this.$message.error(i)})}},computed:{id(){const{id:a}=this.$route.query;return parseInt(a)},disabled(){return!this.form.data.name}}};var f=function(){var t=this,e=t._self._c;return e("div",{staticClass:"me-doc-setting"},[e("div",{staticClass:"top"},[e("div",{staticClass:"back"},[e("router-link",{attrs:{to:"/me/profile"}},[e("img",{attrs:{src:d,alt:"back icon"}})])],1),e("b",[t._v(t._s(t.$t("me.profile.docSetting.title")))])]),e("div",{staticClass:"cover"},[e("div",{staticClass:"cover-left"},[e("div",{staticClass:"cover-item-left"},[e("div",{staticClass:"cover-item"},[t.form.data.images&&t.form.data.images.length?e("img",{attrs:{src:t.form.data.images[0],alt:"edit"}}):e("i",{staticClass:"el-icon-plus"})])]),e("div",{staticClass:"cover-item-right"},[e("div",{staticClass:"cover-item"}),e("div",{staticClass:"cover-item"},[e("router-link",{attrs:{to:{path:"/me/changeCover",query:{id:t.id}}}},[e("img",{attrs:{src:n,alt:"edit"}})])],1)])]),e("div",{staticClass:"cover-right"},[t._v(" "+t._s(t.$t("me.profile.docSetting.modify"))+" ")])]),e("div",{staticClass:"form"},[e("el-form",{ref:"form",attrs:{model:t.form.data,rules:t.form.rules}},[e("el-form-item",{staticClass:"name",attrs:{prop:"name",label:t.$t("common.title")}},[e("el-input",{attrs:{clearable:""},model:{value:t.form.data.name,callback:function(s){t.$set(t.form.data,"name",s)},expression:"form.data.name"}})],1),e("el-form-item",{staticClass:"set"},[e("el-checkbox",{model:{value:t.form.data.is_private,callback:function(s){t.$set(t.form.data,"is_private",s)},expression:"form.data.is_private"}},[t._v(" "+t._s(t.$t("me.profile.createDoc.secretTip1"))+" "),e("br"),t._v(" "+t._s(t.$t("me.profile.createDoc.secretTip2"))+" ")])],1),e("el-form-item",[e("el-checkbox",{model:{value:t.form.data.is_del,callback:function(s){t.$set(t.form.data,"is_del",s)},expression:"form.data.is_del"}},[t._v(" "+t._s(t.$t("me.profile.docSetting.deleteTip1"))+" "),e("br"),t._v(" "+t._s(t.$t("me.profile.docSetting.deleteTip2"))+" "),e("br"),t._v(" "+t._s(t.$t("me.profile.docSetting.deleteTip3"))+" ")])],1)],1)],1),e("div",{staticClass:"button"},[e("router-link",{attrs:{to:"/me/profile"}},[e("el-button",{staticClass:"cancel",attrs:{type:"primary",round:""}},[t._v(t._s(t.$t("common.cancel")))])],1),e("router-link",{attrs:{to:"/me/profile"}},[e("el-button",{staticClass:"complete",attrs:{type:"primary",round:"",disabled:t.disabled},on:{click:t.onSubmit}},[t._v(t._s(t.$t("common.complete")))])],1)],1)])},p=[],v=c(_,f,p,!1,null,"30192d10",null,null);const h=v.exports;export{h as default};
