chunk-100b9c5a.eb51400f.js 14 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-100b9c5a"],{"0a4f3":function(e,t,a){"use strict";a("21c9")},"206d":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYAAACoPemuAAAAAXNSR0IArs4c6QAAAJ5JREFUWAnt2DEKwDAMA8Ck9Cl9e/Ko9i8uXrUIBQ8eVMhgUEW4Zggdo+jZe7+5iurGXVUUEU9VV/ZclWWVXd6Yqmkxi6kCat5nzGKqgJr3GbOYKqDm256xmbfO6kueqoP5OefXVgw3ezyvtSLXcQG82FbMG4MvRUeLUSIIWAxA6GgxSgQBiwEIHS1GiSBgMQChY1uxsn+weR2mDELgB3FmFp5YffVrAAAAAElFTkSuQmCC"},"21c9":function(e,t,a){},2963:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"ele-body"},[a("el-card",{attrs:{shadow:"never"}},[a("el-form",{staticClass:"ele-form-search",attrs:{model:e.table.where,"label-width":"77px"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.$refs.table.reload()},submit:function(e){e.preventDefault()}}},[a("el-row",{attrs:{gutter:15}},[a("el-col",{attrs:{md:6,sm:12}},[a("el-form-item",{attrs:{label:"用户:"}},[a("el-input",{attrs:{placeholder:"请输入行善用户昵称",clearable:""},model:{value:e.table.where.keyword,callback:function(t){e.$set(e.table.where,"keyword",t)},expression:"table.where.keyword"}})],1)],1),a("el-col",{attrs:{md:6,sm:12}},[a("el-form-item",{attrs:{label:"类型:"}},[a("el-select",{staticClass:"ele-fluid",attrs:{placeholder:"请选择类型",clearable:""},model:{value:e.table.where.status,callback:function(t){e.$set(e.table.where,"status",t)},expression:"table.where.status"}},[a("el-option",{attrs:{label:"全部",value:"0"}}),a("el-option",{attrs:{label:"日行一善",value:"1"}}),a("el-option",{attrs:{label:"功德三千",value:"2"}}),a("el-option",{attrs:{label:"打赏平台",value:"3"}}),a("el-option",{attrs:{label:"其他",value:"4"}})],1)],1)],1),a("el-col",{attrs:{md:6,sm:12}},[a("el-form-item",{attrs:{label:"状态:"}},[a("el-select",{staticClass:"ele-fluid",attrs:{placeholder:"请选择状态",clearable:""},model:{value:e.table.where.status,callback:function(t){e.$set(e.table.where,"status",t)},expression:"table.where.status"}},[a("el-option",{attrs:{label:"全部",value:"0"}}),a("el-option",{attrs:{label:"有效",value:"1"}}),a("el-option",{attrs:{label:"无效",value:"2"}})],1)],1)],1),a("el-col",{attrs:{md:6,sm:12}},[a("div",{staticClass:"ele-form-actions"},[a("el-button",{staticClass:"ele-btn-icon",attrs:{type:"primary",icon:"el-icon-search"},on:{click:function(t){return e.$refs.table.reload()}}},[e._v("查询 ")]),a("el-button",{on:{click:function(t){(e.table.where={status:"0",type:"0"})&&e.$refs.table.reload()}}},[e._v("重置")])],1)])],1)],1),a("div",{staticClass:"ele-table-tool ele-table-tool-default"},[e.permission.includes("sys:mecry:add")?a("el-button",{staticClass:"ele-btn-icon",attrs:{type:"primary",icon:"el-icon-plus",size:"small"},on:{click:function(t){e.showEdit=!0}}},[e._v("添加 ")]):e._e(),e.permission.includes("sys:mecry:dall")?a("el-button",{staticClass:"ele-btn-icon",attrs:{type:"danger",icon:"el-icon-delete",size:"small"},on:{click:function(t){return e.remove()}}},[e._v("批量删除 ")]):e._e()],1),a("ele-data-table",{ref:"table",attrs:{config:e.table,choose:e.choose,height:"calc(100vh - 315px)","highlight-current-row":""},on:{"update:choose":function(t){e.choose=t}},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.index;return[a("el-table-column",{attrs:{type:"selection",width:"45",align:"center",fixed:"left"}}),a("el-table-column",{attrs:{type:"index",index:s,label:"编号",width:"60",align:"center",fixed:"left","show-overflow-tooltip":""}}),a("el-table-column",{attrs:{label:"图片","min-width":"100",align:"center"},scopedSlots:e._u([{key:"default",fn:function(e){var t=e.row;return[a("el-avatar",{attrs:{shape:"square",size:35,src:t.thumb}})]}}],null,!0)}),a("el-table-column",{attrs:{prop:"nickname",label:"行善用户","show-overflow-tooltip":"",align:"center","min-width":"150"}}),a("el-table-column",{attrs:{prop:"type",label:"类型",align:"center","min-width":"100"},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[1==s.type?a("span",[e._v("日行一善")]):2==s.type?a("span",[e._v("功德三千")]):3==s.type?a("span",[e._v("打赏平台")]):4==s.type?a("span",[e._v("其他")]):e._e()]}}],null,!0)}),a("el-table-column",{attrs:{prop:"coupon",label:"数量/券","show-overflow-tooltip":"",align:"center","min-width":"150"}}),a("el-table-column",{attrs:{prop:"description",label:"心愿描述","show-overflow-tooltip":"",align:"center","min-width":"250"}}),a("el-table-column",{attrs:{prop:"status",label:"状态",resizable:!1,align:"center","min-width":"100"},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[a("el-switch",{attrs:{"active-value":1,"inactive-value":2},on:{change:function(t){return e.editStatus(s)}},model:{value:s.status,callback:function(t){e.$set(s,"status",t)},expression:"row.status"}})]}}],null,!0)}),a("el-table-column",{attrs:{label:"创建时间",sortable:"custom","show-overflow-tooltip":"",align:"center","min-width":"160"},scopedSlots:e._u([{key:"default",fn:function(t){var a=t.row;return[e._v(e._s(e._f("toDateString")(a.create_time)))]}}],null,!0)}),a("el-table-column",{attrs:{label:"操作",width:"130px",align:"center",resizable:!1,fixed:"right"},scopedSlots:e._u([{key:"default",fn:function(t){var s=t.row;return[e.permission.includes("sys:mecry:edit")?a("el-link",{attrs:{icon:"el-icon-edit",type:"primary",underline:!1},on:{click:function(t){return e.edit(s)}}},[e._v("详情")]):e._e(),a("el-popconfirm",{staticClass:"ele-action",attrs:{title:"确定要删除此行善记录信息吗?"},on:{confirm:function(t){return e.remove(s)}}},[e.permission.includes("sys:mecry:delete")?a("el-link",{attrs:{slot:"reference",icon:"el-icon-delete",type:"danger",underline:!1},slot:"reference"},[e._v("删除")]):e._e()],1)]}}],null,!0)})]}}])})],1),a("el-dialog",{attrs:{title:(e.editForm.id,"行善记录信息"),visible:e.showEdit,width:"600px","destroy-on-close":!0,"custom-class":"ele-dialog-form","lock-scroll":!1},on:{"update:visible":function(t){e.showEdit=t},closed:function(t){e.editForm={}}}},[a("el-form",{ref:"editForm",attrs:{model:e.editForm,rules:e.editRules,"label-width":"82px"}},[a("el-form-item",{attrs:{label:"图片:",visible:e.showEdit},on:{"update:visible":function(t){e.showEdit=t}}},[a("uploadImage",{attrs:{limit:1,disabled:!0},model:{value:e.editForm.thumb,callback:function(t){e.$set(e.editForm,"thumb",t)},expression:"editForm.thumb"}})],1),a("el-row",{attrs:{gutter:15}},[a("el-col",{attrs:{sm:24}},[a("el-col",{attrs:{sm:12}},[a("el-form-item",{attrs:{label:"行善人:",prop:"nickname"}},[a("span",{domProps:{textContent:e._s(e.editForm.nickname)}})]),a("el-form-item",{attrs:{label:"类型:",prop:"type"}},[1==e.editForm.type?a("span",[e._v("日行一善")]):2==e.editForm.type?a("span",[e._v("功德三千")]):3==e.editForm.type?a("span",[e._v("打赏平台")]):4==e.editForm.type?a("span",[e._v("其他")]):e._e()]),a("el-form-item",{attrs:{label:"数量:",prop:"stock"}},[a("span",{domProps:{textContent:e._s(e.editForm.stock)}}),e._v("券 ")])],1),a("el-col",{attrs:{sm:24}},[a("el-form-item",{attrs:{label:"心愿描述:",prop:"description"}},[a("span",{domProps:{textContent:e._s(e.editForm.description)}})]),a("el-form-item",{attrs:{label:"状态:"}},[a("el-radio-group",{model:{value:e.editForm.status,callback:function(t){e.$set(e.editForm,"status",t)},expression:"editForm.status"}},[a("el-radio",{attrs:{label:1}},[e._v("有效")]),a("el-radio",{attrs:{label:2}},[e._v("无效")])],1)],1)],1)],1)],1)],1),a("div",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.showEdit=!1}}},[e._v("取消")]),a("el-button",{attrs:{type:"primary"},on:{click:e.save}},[e._v("保存")])],1)],1)],1)},o=[],i=(a("d81d"),a("5530")),l=a("2f62"),n=a("cbc3"),r={name:"SysMecry",components:{uploadImage:n["a"]},data:function(){return{table:{url:"/mecry/index",where:{status:"0"}},choose:[],showEdit:!1,editForm:{id:0,status:1,form:1,thumb:{},albums:[],title:""},cates:[],editRules:{title:[{required:!0,message:"请输入行善记录名称",trigger:"blur"}],status:[{required:!0,message:"请选择发布状态",trigger:"blur"}]}}},computed:Object(i["a"])(Object(i["a"])({},Object(l["b"])(["permission"])),{},{editContent:function(){return{menubar:!1,file_picker_callback:this.file_picker_callback,skin_url:"dark"===this.$store.state.theme.theme?"/tinymce/skins/ui/oxide-dark":"/tinymce/skins/ui/oxide",content_css:"dark"===this.$store.state.theme.theme?"/tinymce/skins/content/dark/content.css":"/tinymce/skins/content/default/content.css"}}}),mounted:function(){this.getCateOPtions()},methods:{getCateOPtions:function(){var e=this,t=this.$loading({lock:!0});this.$http.post("/goodscates/options",this.editForm).then((function(a){t.close(),0===a.data.code?e.cates="undefined"!=typeof a.data.data?a.data.data:{}:e.$message.error(a.data.msg)})).catch((function(a){t.close(),e.$message.error(a.message)}))},edit:function(e){this.editForm=Object.assign({},e),this.editForm.albums||(this.editForm.albums=[]),this.showEdit=!0},save:function(){var e=this;this.$refs["editForm"].validate((function(t){if(!t)return!1;var a=e.$loading({lock:!0});e.$http.post("/mecry/edit",e.editForm).then((function(t){a.close(),0===t.data.code?(e.showEdit=!1,e.$message({type:"success",message:t.data.msg}),e.$refs.table.reload()):e.$message.error(t.data.msg)})).catch((function(t){a.close(),e.$message.error(t.message)}))}))},remove:function(e){var t=this;if(e){var a=this.$loading({lock:!0});this.$http.post("/mecry/delete",{id:e.id}).then((function(e){a.close(),0===e.data.code?(t.$message({type:"success",message:e.data.msg}),t.$refs.table.reload()):t.$message.error(e.data.msg)})).catch((function(e){a.close(),t.$message.error(e.message)}))}else{if(0===this.choose.length)return this.$message.error("请至少选择一条数据");var s=this.choose.map((function(e){return e.id}));this.$confirm("确定要删除选中的信息吗?","提示",{type:"warning"}).then((function(){var e=t.$loading({lock:!0});t.$http.post("/mecry/delete",{id:s}).then((function(a){e.close(),0===a.data.code?(t.$message({type:"success",message:a.data.msg}),t.$refs.table.reload()):t.$message.error(a.data.msg)})).catch((function(a){e.close(),t.$message.error(a.message)}))})).catch((function(){return 0}))}},editStatus:function(e){var t=this,a=this.$loading({lock:!0}),s=Object.assign({},e);this.$http.post("/mecry/status",s).then((function(s){a.close(),0===s.data.code?t.$message({type:"success",message:s.data.msg}):(e.status=e.status?1:2,t.$message.error(s.data.msg))})).catch((function(e){a.close(),t.$message.error(e.message)}))}}},c=r,u=(a("0a4f3"),a("2877")),d=Object(u["a"])(c,s,o,!1,null,"1463d110",null);t["default"]=d.exports},4091:function(e,t,a){},"5cc6":function(e,t,a){var s=a("74e8");s("Uint8",(function(e){return function(t,a,s){return e(this,t,a,s)}}))},c19f:function(e,t,a){"use strict";var s=a("23e7"),o=a("da84"),i=a("621a"),l=a("2626"),n="ArrayBuffer",r=i[n],c=o[n];s({global:!0,forced:c!==r},{ArrayBuffer:r}),l(n)},cbc3:function(e,t,a){"use strict";var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"finish_room"},[a("div",{staticClass:"finish_room2"},[a("div",{staticClass:"img-list"},e._l(e.photo,(function(t,s){return a("div",{key:s,staticClass:"room_img"},[a("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.url,expression:"item.url"}]}),a("div",{staticClass:"im-button",attrs:{disabled:!e.disabled},on:{click:function(t){return e.deleteImg(s)}}},[a("div",{staticClass:"im-close"}),a("div",{staticClass:"im-close1"})])])})),0),e.photo.length<e.limit?a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticClass:"room_add_img"},[e._m(0),a("input",{attrs:{disabled:e.disabled,type:"file"},on:{change:e.add_img}})]):e._e()])])},o=[function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("span",{staticStyle:{"margin-top":"35px"}},[s("img",{attrs:{src:a("206d")}})])}],i=(a("a434"),a("c19f"),a("a9e3"),a("d3b7"),a("ac1f"),a("1276"),a("5cc6"),a("9a8c"),a("a975"),a("735e"),a("c1ac"),a("d139"),a("3a7b"),a("d5d6"),a("82f8"),a("e91f"),a("60bd"),a("5f96"),a("3280"),a("3fcc"),a("ca91"),a("25a1"),a("cd26"),a("3c5d"),a("2954"),a("649e"),a("219c"),a("170b"),a("b39a"),a("72f7"),a("bc3a")),l=a.n(i),n={name:"uploadImage",props:{limit:{type:Number,default:function(){return 1}},disabled:{type:Boolean,default:function(){return!1}},isCompress:{type:Boolean,default:function(){return!1}},value:{}},data:function(){return{photo:[],deleteStatus:!1,loading:!1}},watch:{photo:function(){1==this.limit?this.$emit("input",this.photo.length>0?this.photo[0].url:""):this.$emit("input",this.photo)},value:function(){1==this.limit?this.value instanceof Array?this.photo=[]:this.photo=this.value?[{url:this.value}]:[]:this.photo=this.value}},mounted:function(){1==this.limit?this.value instanceof Array?this.photo=[]:this.photo=this.value?[{url:this.value}]:[]:this.value instanceof Array?this.photo=this.value:this.photo=[]},methods:{deleteImg:function(e){this.photo&&this.photo instanceof Array&&this.photo.splice(e,1)},compress:function(e){var t=null,a=document.createElement("canvas"),s=e.height/e.width;a.width=720,a.height=720*s;var o=a.getContext("2d");return o.clearRect(0,0,a.width,a.height),o.drawImage(e,0,0,a.width,a.height),t=a.toDataURL("image/jpeg"),t},dataURItoBlob:function(e){for(var t=window.atob(e.split(",")[1]),a=e.split(",")[0].split(":")[1].split(";")[0],s=new ArrayBuffer(t.length),o=new Uint8Array(s),i=0;i<t.length;i++)o[i]=t.charCodeAt(i);return new window.Blob([s],{type:a})},add_img:function(e){var t=e.target.files[0];if(/\.(gif|jpg|jpeg|png|GIF|JPG|PNG)$/.test(e.target.value)){var a=10485760,s=t.size;if(s>a)return e.target.value="",void this.$notify.error({title:"上传图片错误",message:"上传图片不能超过10M"});this.loading=!0;var o=new FileReader,i=this;o.readAsDataURL(t);var n=new Image;o.onload=function(a){n.src=this.result,n.onload=function(){var s=a.target.result,o=t;i.isCompress&&(s=i.compress(n),o=i.dataURItoBlob(s));var r=new window.FormData;r.append("file",o),l()({method:"POST",url:"/upload/uploadImage",data:r,timeout:1e6,headers:{"Content-Type":"multipart/form-data"}}).then((function(a){console.log(a.data),e.target.value="","undefined"!=typeof i.photo&&""!=i.photo||(i.photo=[]),console.log(i.photo),i.photo.push({fileName:t.fileName,url:a.data.data}),i.loading=!1})).catch((function(t){e.target.value="",i.loading=!1,console.log(t)}))}}}else e.target.value="",this.$notify.error({title:"上传图片错误",message:"请上传gif|jpg|jpeg|png|GIF|JPG|PNG格式图片"})}}},r=n,c=(a("e5ee"),a("2877")),u=Object(c["a"])(r,s,o,!1,null,"2ed5cae0",null);t["a"]=u.exports},e5ee:function(e,t,a){"use strict";a("4091")}}]);