Files
PropertyDeployment/resources/Web/MicroCommunityMallWeb/html/js/chunk-f3dad1aa.bd152013.js
Anfioo adfd019d2d 江门
1
2026-02-01 15:37:55 +08:00

2 lines
20 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-f3dad1aa"],{"23ed":function(e,t,s){"use strict";s("5da9")},2786:function(e,t,s){"use strict";s("3fe5")},"3fe5":function(e,t,s){},"55ba":function(e,t,s){},"5da9":function(e,t,s){},"5e31":function(e,t,s){"use strict";var o=function(){var e=this,t=e._self._c;return t("div",{staticClass:"upload-image-container"},[e._l(e.photos,(function(s,o){return t("div",{key:o,staticClass:"image-item"},[t("el-image",{staticStyle:{width:"100px",height:"100px"},attrs:{src:s,fit:"cover","preview-src-list":e.photos}}),t("i",{staticClass:"el-icon-delete delete-icon",on:{click:function(t){return e.removeImage(o)}}})],1)})),e.photos.length<e.imageCount?t("div",{staticClass:"upload-button",on:{click:e.triggerUpload}},[t("i",{staticClass:"el-icon-plus"})]):e._e(),t("input",{ref:"fileInput",attrs:{type:"file",accept:"image/*",hidden:""},on:{change:e.handleFileChange}})],2)},i=[],n=s("3549"),a={name:"UploadImageUrl",props:{imageCount:{type:Number,default:1}},data(){return{photos:[],photosUrl:[]}},methods:{triggerUpload(){this.$refs.fileInput.click()},async handleFileChange(e){const t=e.target.files[0];if(!t)return;if(t.size>2097152)return void this.$message.error("图片大小不能超过2MB");const s=new FileReader;s.onload=e=>{this.photos.push(e.target.result)},s.readAsDataURL(t);try{const e=new FormData;e.append("uploadFile",t),e.append("communityId","-1");const{data:s}=await Object(n["b"])(e);this.photosUrl.push(s.url),this.$emit("notifyUploadCoverImage",this.photosUrl)}catch(o){this.$message.error(o.message||"上传失败")}e.target.value=null},removeImage(e){this.photos.splice(e,1),this.photosUrl.splice(e,1),this.$emit("notifyUploadCoverImage",this.photosUrl)},clearImages(){this.photos=[],this.photosUrl=[]},setImages(e){this.clearImages(),e.forEach(e=>{if(!(e.indexOf("base64,")>-1))return e.indexOf("http")>-1?(this.photos.push(e),void this.photosUrl.push(e)):void this.photosUrl.push(e);this.photos.push(e)})}}},l=a,p=(s("e457"),s("2877")),r=Object(p["a"])(l,o,i,!1,null,"c3e7566c",null);t["a"]=r.exports},6077:function(e,t,s){"use strict";s.r(t);var o=function(){var e=this,t=e._self._c;return t("div",[t("div",{staticClass:"ibox"},[t("div",{staticClass:"ibox-title"},[t("h5",[e._v(e._s(e.$t("housekeepingType.queryCondition")))]),t("div",{staticClass:"ibox-tools",staticStyle:{top:"10px"}})]),t("div",{staticClass:"ibox-content"},[t("el-row",{attrs:{gutter:20}},[t("el-col",{attrs:{span:6}},[t("el-form-item",[t("el-input",{attrs:{placeholder:e.$t("housekeepingType.typeNamePlaceholder"),clearable:""},model:{value:e.housekeepingTypeInfo.conditions.hktName,callback:function(t){e.$set(e.housekeepingTypeInfo.conditions,"hktName",t)},expression:"housekeepingTypeInfo.conditions.hktName"}})],1)],1),t("el-col",{attrs:{span:6}},[t("el-form-item",[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("housekeepingType.showStatusPlaceholder"),clearable:""},model:{value:e.housekeepingTypeInfo.conditions.isShow,callback:function(t){e.$set(e.housekeepingTypeInfo.conditions,"isShow",t)},expression:"housekeepingTypeInfo.conditions.isShow"}},e._l(e.housekeepingTypeInfo.isShows,(function(e){return t("el-option",{key:e.statusCd,attrs:{label:e.name,value:e.statusCd}})})),1)],1)],1),t("el-col",{attrs:{span:6}},[t("el-form-item",[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("housekeepingType.publicStatusPlaceholder"),clearable:""},model:{value:e.housekeepingTypeInfo.conditions.ispublic,callback:function(t){e.$set(e.housekeepingTypeInfo.conditions,"ispublic",t)},expression:"housekeepingTypeInfo.conditions.ispublic"}},[t("el-option",{attrs:{label:"公共类",value:"Y"}}),t("el-option",{attrs:{label:"自定义",value:"N"}})],1)],1)],1),t("el-col",{attrs:{span:6}},[t("el-button",{attrs:{type:"primary",size:"small"},on:{click:e._queryHousekeepingTypeMethod}},[t("i",{staticClass:"el-icon-search"}),e._v(" "+e._s(e.$t("common.query"))+" ")]),t("el-button",{attrs:{type:"primary",size:"small"},on:{click:e._resetHousekeepingTypeMethod}},[t("i",{staticClass:"el-icon-refresh"}),e._v(" "+e._s(e.$t("common.reset"))+" ")])],1)],1)],1)]),t("div",{staticClass:"ibox"},[t("div",{staticClass:"ibox-title"},[t("h5",[e._v(e._s(e.$t("housekeepingType.housekeepingType")))]),t("div",{staticClass:"ibox-tools",staticStyle:{top:"10px"}},[t("el-button",{attrs:{type:"primary",size:"small"},on:{click:e._openAddHousekeepingTypeModal}},[t("i",{staticClass:"el-icon-plus"}),e._v(" "+e._s(e.$t("common.add"))+" ")])],1)]),t("div",{staticClass:"ibox-content"},[t("el-table",{staticStyle:{width:"100%"},attrs:{data:e.housekeepingTypeInfo.housekeepingTypes,border:""}},[t("el-table-column",{attrs:{prop:"hktIcon",label:e.$t("housekeepingType.logo"),align:"center"},scopedSlots:e._u([{key:"default",fn:function({row:e}){return[t("img",{staticStyle:{width:"60px",height:"60px","border-radius":"5px"},attrs:{src:e.hktIcon}})]}}])}),t("el-table-column",{attrs:{prop:"hktName",label:e.$t("housekeepingType.typeName"),align:"center"}}),t("el-table-column",{attrs:{prop:"hktDesc",label:e.$t("housekeepingType.serviceDesc"),align:"center"}}),t("el-table-column",{attrs:{prop:"label",label:e.$t("housekeepingType.label"),align:"center"}}),t("el-table-column",{attrs:{prop:"seq",label:e.$t("housekeepingType.sort"),align:"center"}}),t("el-table-column",{attrs:{prop:"isShow",label:e.$t("housekeepingType.showStatus"),align:"center"},scopedSlots:e._u([{key:"default",fn:function({row:t}){return[e._v(" "+e._s("Y"===t.isShow?e.$t("common.yes"):e.$t("common.no"))+" ")]}}])}),t("el-table-column",{attrs:{label:e.$t("common.operation"),align:"center"},scopedSlots:e._u([{key:"default",fn:function({row:s}){return["9999"!==s.shopId?t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e._openEditHousekeepingTypeModel(s)}}},[e._v(" "+e._s(e.$t("common.edit"))+" ")]):e._e(),"9999"!==s.shopId?t("el-button",{attrs:{type:"text",size:"small"},on:{click:function(t){return e._openDeleteHousekeepingTypeModel(s)}}},[e._v(" "+e._s(e.$t("common.delete"))+" ")]):t("span",[e._v(e._s(e.$t("housekeepingType.publicType")))])]}}])})],1),t("el-pagination",{attrs:{"current-page":e.housekeepingTypeInfo.conditions.page,"page-size":e.housekeepingTypeInfo.conditions.row,total:e.housekeepingTypeInfo.total,layout:"total, sizes, prev, pager, next, jumper"},on:{"current-change":e.handleCurrentChange}})],1)]),t("add-housekeeping-type",{ref:"addHousekeepingType"}),t("edit-housekeeping-type",{ref:"editHousekeepingType"}),t("delete-housekeeping-type",{ref:"deleteHousekeepingType"})],1)},i=[],n=s("7323"),a=s("68e1"),l=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("housekeepingType.addTitle"),visible:e.dialogVisible,width:"70%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.handleClose}},[t("el-form",{ref:"form",attrs:{model:e.addHousekeepingTypeInfo,"label-width":"120px","label-position":"right"}},[t("el-form-item",{attrs:{label:e.$t("housekeepingType.typeName"),prop:"hktName",rules:[{required:!0,message:e.$t("housekeepingType.typeNameRequired"),trigger:"blur"},{max:30,message:e.$t("housekeepingType.typeNameMaxLength"),trigger:"blur"}]}},[t("el-input",{attrs:{placeholder:e.$t("housekeepingType.typeNamePlaceholder")},model:{value:e.addHousekeepingTypeInfo.hktName,callback:function(t){e.$set(e.addHousekeepingTypeInfo,"hktName",t)},expression:"addHousekeepingTypeInfo.hktName"}})],1),t("el-form-item",{attrs:{label:e.$t("housekeepingType.smallIcon"),prop:"hktIcon",rules:[{required:!0,message:e.$t("housekeepingType.iconRequired"),trigger:"change"}]}},[t("upload-image",{ref:"uploadImage",attrs:{"image-count":1},on:{"upload-success":e.handleUploadSuccess}})],1),t("el-form-item",{attrs:{label:e.$t("housekeepingType.serviceDesc"),prop:"hktDesc",rules:[{max:50,message:e.$t("housekeepingType.serviceDescMaxLength"),trigger:"blur"}]}},[t("el-input",{attrs:{placeholder:e.$t("housekeepingType.serviceDescPlaceholder")},model:{value:e.addHousekeepingTypeInfo.hktDesc,callback:function(t){e.$set(e.addHousekeepingTypeInfo,"hktDesc",t)},expression:"addHousekeepingTypeInfo.hktDesc"}})],1),t("el-form-item",{attrs:{label:e.$t("housekeepingType.label"),prop:"label",rules:[{max:15,message:e.$t("housekeepingType.labelMaxLength"),trigger:"blur"}]}},[t("el-input",{attrs:{placeholder:e.$t("housekeepingType.labelPlaceholder")},model:{value:e.addHousekeepingTypeInfo.label,callback:function(t){e.$set(e.addHousekeepingTypeInfo,"label",t)},expression:"addHousekeepingTypeInfo.label"}})],1),t("el-form-item",{attrs:{label:e.$t("housekeepingType.sort"),prop:"seq",rules:[{required:!0,message:e.$t("housekeepingType.sortRequired"),trigger:"blur"},{type:"number",message:e.$t("housekeepingType.sortNumber"),trigger:"blur"}]}},[t("el-input",{attrs:{placeholder:e.$t("housekeepingType.sortPlaceholder")},model:{value:e.addHousekeepingTypeInfo.seq,callback:function(t){e.$set(e.addHousekeepingTypeInfo,"seq",e._n(t))},expression:"addHousekeepingTypeInfo.seq"}})],1),t("el-form-item",{attrs:{label:e.$t("housekeepingType.showStatus"),prop:"isShow",rules:[{required:!0,message:e.$t("housekeepingType.showStatusRequired"),trigger:"change"}]}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("housekeepingType.showStatusPlaceholder")},model:{value:e.addHousekeepingTypeInfo.isShow,callback:function(t){e.$set(e.addHousekeepingTypeInfo,"isShow",t)},expression:"addHousekeepingTypeInfo.isShow"}},e._l(e.addHousekeepingTypeInfo.isShows,(function(e){return t("el-option",{key:e.statusCd,attrs:{label:e.name,value:e.statusCd}})})),1)],1)],1),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(" "+e._s(e.$t("common.cancel"))+" ")]),t("el-button",{attrs:{type:"primary"},on:{click:e.saveHousekeepingTypeInfo}},[e._v(" "+e._s(e.$t("common.save"))+" ")])],1)],1)},p=[],r=s("bdde"),u={name:"AddHousekeepingType",components:{UploadImage:r["a"]},data(){return{dialogVisible:!1,addHousekeepingTypeInfo:{hktName:"",hktIcon:"",hktDesc:"",label:"",seq:"",isShow:"",isShows:[]}}},methods:{open(){this.dialogVisible=!0,this.getDictData()},async getDictData(){try{const{data:e}=await Object(n["e"])("housekeeping_type","is_show");this.addHousekeepingTypeInfo.isShows=e}catch(e){console.error("获取字典数据失败:",e)}},handleUploadSuccess(e){e.length>0?this.addHousekeepingTypeInfo.hktIcon=e[0]:this.addHousekeepingTypeInfo.hktIcon=""},handleClose(){this.$refs.form.resetFields(),this.$refs.uploadImage.clearImages(),this.addHousekeepingTypeInfo={hktName:"",hktIcon:"",hktDesc:"",label:"",seq:"",isShow:"",isShows:[]}},async saveHousekeepingTypeInfo(){try{await this.$refs.form.validate();const e=await Object(a["c"])(this.addHousekeepingTypeInfo);0===e.code?(this.$message.success(this.$t("common.saveSuccess")),this.dialogVisible=!1,this.$emit("refresh")):this.$message.error(e.msg)}catch(e){console.error("保存失败:",e)}}}},c=u,h=s("2877"),d=Object(h["a"])(c,l,p,!1,null,null,null),g=d.exports,m=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("housekeepingType.editTitle"),visible:e.dialogVisible,width:"70%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.handleClose}},[t("el-form",{ref:"form",attrs:{model:e.editHousekeepingTypeInfo,"label-width":"120px","label-position":"right"}},[t("el-form-item",{attrs:{label:e.$t("housekeepingType.typeName"),prop:"hktName",rules:[{required:!0,message:e.$t("housekeepingType.typeNameRequired"),trigger:"blur"},{max:30,message:e.$t("housekeepingType.typeNameMaxLength"),trigger:"blur"}]}},[t("el-input",{attrs:{placeholder:e.$t("housekeepingType.typeNamePlaceholder")},model:{value:e.editHousekeepingTypeInfo.hktName,callback:function(t){e.$set(e.editHousekeepingTypeInfo,"hktName",t)},expression:"editHousekeepingTypeInfo.hktName"}})],1),t("el-form-item",{attrs:{label:e.$t("housekeepingType.smallIcon"),prop:"hktIcon",rules:[{required:!0,message:e.$t("housekeepingType.iconRequired"),trigger:"change"}]}},[t("upload-image",{ref:"uploadImage",attrs:{"image-count":1,"default-images":[e.editHousekeepingTypeInfo.hktIcon]},on:{"upload-success":e.handleUploadSuccess}})],1),t("el-form-item",{attrs:{label:e.$t("housekeepingType.serviceDesc"),prop:"hktDesc",rules:[{max:50,message:e.$t("housekeepingType.serviceDescMaxLength"),trigger:"blur"}]}},[t("el-input",{attrs:{placeholder:e.$t("housekeepingType.serviceDescPlaceholder")},model:{value:e.editHousekeepingTypeInfo.hktDesc,callback:function(t){e.$set(e.editHousekeepingTypeInfo,"hktDesc",t)},expression:"editHousekeepingTypeInfo.hktDesc"}})],1),t("el-form-item",{attrs:{label:e.$t("housekeepingType.label"),prop:"label",rules:[{max:15,message:e.$t("housekeepingType.labelMaxLength"),trigger:"blur"}]}},[t("el-input",{attrs:{placeholder:e.$t("housekeepingType.labelPlaceholder")},model:{value:e.editHousekeepingTypeInfo.label,callback:function(t){e.$set(e.editHousekeepingTypeInfo,"label",t)},expression:"editHousekeepingTypeInfo.label"}})],1),t("el-form-item",{attrs:{label:e.$t("housekeepingType.sort"),prop:"seq",rules:[{required:!0,message:e.$t("housekeepingType.sortRequired"),trigger:"blur"},{type:"number",message:e.$t("housekeepingType.sortNumber"),trigger:"blur"}]}},[t("el-input",{attrs:{placeholder:e.$t("housekeepingType.sortPlaceholder")},model:{value:e.editHousekeepingTypeInfo.seq,callback:function(t){e.$set(e.editHousekeepingTypeInfo,"seq",e._n(t))},expression:"editHousekeepingTypeInfo.seq"}})],1),t("el-form-item",{attrs:{label:e.$t("housekeepingType.showStatus"),prop:"isShow",rules:[{required:!0,message:e.$t("housekeepingType.showStatusRequired"),trigger:"change"}]}},[t("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:e.$t("housekeepingType.showStatusPlaceholder")},model:{value:e.editHousekeepingTypeInfo.isShow,callback:function(t){e.$set(e.editHousekeepingTypeInfo,"isShow",t)},expression:"editHousekeepingTypeInfo.isShow"}},e._l(e.editHousekeepingTypeInfo.isShows,(function(e){return t("el-option",{key:e.statusCd,attrs:{label:e.name,value:e.statusCd}})})),1)],1)],1),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(" "+e._s(e.$t("common.cancel"))+" ")]),t("el-button",{attrs:{type:"primary"},on:{click:e.updateHousekeepingTypeInfo}},[e._v(" "+e._s(e.$t("common.save"))+" ")])],1)],1)},k=[],y=s("5e31"),f={name:"EditHousekeepingType",components:{UploadImage:y["a"]},data(){return{dialogVisible:!1,editHousekeepingTypeInfo:{hktId:"",hktName:"",hktIcon:"",hktDesc:"",label:"",seq:"",isShow:"",isShows:[]}}},methods:{open(e){this.dialogVisible=!0,this.editHousekeepingTypeInfo={...e,isShows:[]},this.getDictData()},async getDictData(){try{const{data:e}=await Object(n["e"])("housekeeping_type","is_show");this.editHousekeepingTypeInfo.isShows=e}catch(e){console.error("获取字典数据失败:",e)}},handleUploadSuccess(e){e.length>0?this.editHousekeepingTypeInfo.hktIcon=e[0]:this.editHousekeepingTypeInfo.hktIcon=""},handleClose(){this.$refs.form.resetFields(),this.editHousekeepingTypeInfo={hktId:"",hktName:"",hktIcon:"",hktDesc:"",label:"",seq:"",isShow:"",isShows:[]}},async updateHousekeepingTypeInfo(){try{await this.$refs.form.validate();const e=await Object(a["d"])(this.editHousekeepingTypeInfo);0===e.code?(this.$message.success(this.$t("common.saveSuccess")),this.dialogVisible=!1,this.$emit("refresh")):this.$message.error(e.msg)}catch(e){console.error("更新失败:",e)}}}},b=f,T=Object(h["a"])(b,m,k,!1,null,null,null),I=T.exports,$=function(){var e=this,t=e._self._c;return t("el-dialog",{attrs:{title:e.$t("common.confirmDelete"),visible:e.dialogVisible,width:"500px"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.handleClose}},[t("div",{staticClass:"delete-content"},[t("p",[e._v(e._s(e.$t("housekeepingType.confirmDeleteContent")))])]),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{on:{click:function(t){e.dialogVisible=!1}}},[e._v(" "+e._s(e.$t("common.cancel"))+" ")]),t("el-button",{attrs:{type:"primary"},on:{click:e.confirmDelete}},[e._v(" "+e._s(e.$t("common.confirm"))+" ")])],1)])},v=[],w={name:"DeleteHousekeepingType",data(){return{dialogVisible:!1,deleteInfo:{}}},methods:{open(e){this.dialogVisible=!0,this.deleteInfo={...e}},handleClose(){this.deleteInfo={}},async confirmDelete(){try{const e=await Object(a["a"])(this.deleteInfo);0===e.code?(this.$message.success(this.$t("common.submitSuccess")),this.dialogVisible=!1,this.$emit("refresh")):this.$message.error(e.msg)}catch(e){console.error("删除失败:",e)}}}},H=w,_=(s("c1bf"),Object(h["a"])(H,$,v,!1,null,"676d2a68",null)),C=_.exports,S={name:"HousekeepingType",components:{AddHousekeepingType:g,EditHousekeepingType:I,DeleteHousekeepingType:C},data(){return{housekeepingTypeInfo:{housekeepingTypes:[],total:0,records:1,moreCondition:!1,hktId:"",isShows:[],conditions:{ispublic:"",hktName:"",isShow:"",shopId:"",typeCd:"1001",page:1,row:10}}}},created(){this._listHousekeepingTypes(1,10),this.getDictData()},methods:{async getDictData(){try{const{data:e}=await Object(n["e"])("housekeeping_type","is_show");this.housekeepingTypeInfo.isShows=e}catch(e){console.error("获取字典数据失败:",e)}},async _listHousekeepingTypes(e,t){this.housekeepingTypeInfo.conditions.page=e,this.housekeepingTypeInfo.conditions.row=t;try{const e=await Object(a["b"])(this.housekeepingTypeInfo.conditions);this.housekeepingTypeInfo.total=e.total,this.housekeepingTypeInfo.records=e.records,this.housekeepingTypeInfo.housekeepingTypes=e.data}catch(s){console.error("请求失败:",s)}},_openAddHousekeepingTypeModal(){this.$refs.addHousekeepingType.open()},_openEditHousekeepingTypeModel(e){this.$refs.editHousekeepingType.open(e)},_openDeleteHousekeepingTypeModel(e){this.$refs.deleteHousekeepingType.open(e)},_queryHousekeepingTypeMethod(){this._listHousekeepingTypes(1,10)},_resetHousekeepingTypeMethod(){this.housekeepingTypeInfo.conditions={ispublic:"",hktName:"",isShow:"",shopId:"",typeCd:"1001",page:1,row:10},this._listHousekeepingTypes(1,10)},handleCurrentChange(e){this._listHousekeepingTypes(e,this.housekeepingTypeInfo.conditions.row)}}},x=S,D=(s("23ed"),Object(h["a"])(x,o,i,!1,null,"77ad5c2e",null));t["default"]=D.exports},"68e1":function(e,t,s){"use strict";s.d(t,"b",(function(){return i})),s.d(t,"c",(function(){return n})),s.d(t,"d",(function(){return a})),s.d(t,"a",(function(){return l}));var o=s("b775");function i(e){return new Promise((t,s)=>{Object(o["a"])({url:"/housekeepingType.queryHousekeepingType",method:"get",params:e}).then(e=>{const s=e.data;t(s)}).catch(e=>{s(e)})})}function n(e){return new Promise((t,s)=>{Object(o["a"])({url:"/housekeepingType.saveHousekeepingType",method:"post",data:e}).then(e=>{const s=e.data;t(s)}).catch(e=>{s(e)})})}function a(e){return new Promise((t,s)=>{Object(o["a"])({url:"/housekeepingType.updateHousekeepingType",method:"post",data:e}).then(e=>{const s=e.data;t(s)}).catch(e=>{s(e)})})}function l(e){return new Promise((t,s)=>{Object(o["a"])({url:"/housekeepingType.deleteHousekeepingType",method:"post",data:e}).then(e=>{const s=e.data;t(s)}).catch(e=>{s(e)})})}},7793:function(e,t,s){},bdde:function(e,t,s){"use strict";var o=function(){var e=this,t=e._self._c;return t("div",{staticClass:"upload-image-container"},[e._l(e.photos,(function(s,o){return t("div",{key:o,staticClass:"image-item"},[t("img",{staticClass:"preview-image",attrs:{src:s}}),t("i",{staticClass:"el-icon-close delete-icon",on:{click:function(t){return e.removeImage(o)}}})])})),e.photos.length<e.imageCount?t("div",{staticClass:"upload-button",on:{click:e.triggerUpload}},[t("i",{staticClass:"el-icon-plus"})]):e._e(),t("input",{ref:"fileInput",staticClass:"file-input",attrs:{type:"file",accept:"image/*"},on:{change:e.handleFileChange}})],2)},i=[],n={name:"UploadImage",props:{imageCount:{type:Number,default:1},defaultImages:{type:Array,default:()=>[]}},data(){return{photos:[]}},watch:{defaultImages:{immediate:!0,handler(e){e&&e.length>0&&(this.photos=[...e])}},photos(e){this.$emit("notifyUploadCoverImage",e)}},methods:{triggerUpload(){this.$refs.fileInput.click()},handleFileChange(e){const t=e.target.files;if(!t||0===t.length)return;const s=t[0];if(s.size>2097152)return void this.$message.error(this.$t("uploadImage.sizeLimit"));const o=new FileReader;o.onload=e=>{this.photos.push(e.target.result)},o.readAsDataURL(s),e.target.value=""},removeImage(e){this.photos.splice(e,1)},clearImages(){this.photos=[]},getImages(){return this.photos},setImages(e){this.clearImages(),e.forEach(e=>{(e.indexOf("base64,")>-1||e.indexOf("http")>-1)&&this.photos.push(e)})}}},a=n,l=(s("2786"),s("2877")),p=Object(l["a"])(a,o,i,!1,null,"0ed5c4ba",null);t["a"]=p.exports},c1bf:function(e,t,s){"use strict";s("7793")},e457:function(e,t,s){"use strict";s("55ba")}}]);
//# sourceMappingURL=chunk-f3dad1aa.bd152013.js.map