1 line
21 KiB
JavaScript
1 line
21 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-79294a3a"],{"3bbe":function(e,t,a){var i=a("861d");e.exports=function(e){if(!i(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},"4de7":function(e,t,a){"use strict";a.r(t);var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("div",{staticClass:"outmain ba_f heighthv pad_20 bor_rad5"},[e._m(0),a("div",{staticClass:"mar_t20 flex-bet flex-y-top"},[a("div",{staticClass:"flex-g-1"},[a("el-form",{ref:"form",attrs:{model:e.form,"label-width":"180px"}},[a("el-form-item",{attrs:{label:"任务管理"}},[a("div",{},[a("div",{staticClass:"t_l numberInput"},[a("div",{staticClass:"mar_lr10"},[a("el-checkbox-group",{model:{value:e.money1,callback:function(t){e.money1=t},expression:"money1"}},[a("el-checkbox",{attrs:{label:"1"}},[e._v("完善信息")])],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:e.money1,expression:"money1"}]},[a("span",{staticClass:"mar_lr10"},[e._v("获得")]),a("el-input-number",{attrs:{"controls-position":"right",min:.01,max:99999999},model:{value:e.giveMoney,callback:function(t){e.giveMoney=t},expression:"giveMoney"}}),a("span",{staticClass:"mar_lr10"},[e._v("成长值")])],1)]),a("div",{staticClass:"mar_t10 t_l numberInput"},[a("div",{staticClass:"mar_lr10"},[a("el-checkbox-group",{model:{value:e.money2,callback:function(t){e.money2=t},expression:"money2"}},[a("el-checkbox",{attrs:{label:"1"}},[e._v("绑定手机号")])],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:e.money2,expression:"money2"}]},[a("span",{staticClass:"mar_lr10"},[e._v("获得")]),a("el-input-number",{attrs:{"controls-position":"right",min:.01,max:99999999},model:{value:e.giveMoney,callback:function(t){e.giveMoney=t},expression:"giveMoney"}}),a("span",{staticClass:"mar_lr10"},[e._v("成长值")])],1)]),a("div",{staticClass:"mar_t10 t_l numberInput"},[a("div",{staticClass:"mar_lr10"},[a("el-checkbox-group",{model:{value:e.money2,callback:function(t){e.money2=t},expression:"money2"}},[a("el-checkbox",{attrs:{label:"1"}},[e._v("收藏小程序")])],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:e.money2,expression:"money2"}]},[a("span",{staticClass:"mar_lr10"},[e._v("获得")]),a("el-input-number",{attrs:{"controls-position":"right",min:.01,max:99999999},model:{value:e.giveMoney,callback:function(t){e.giveMoney=t},expression:"giveMoney"}}),a("span",{staticClass:"mar_lr10"},[e._v("成长值")])],1)]),a("div",{staticClass:"mar_t10 t_l numberInput"},[a("div",{staticClass:"mar_lr10"},[a("el-checkbox-group",{model:{value:e.money3,callback:function(t){e.money3=t},expression:"money3"}},[a("el-checkbox",{attrs:{label:"1"}},[e._v("购买商品")])],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:e.money3,expression:"money3"}]},[a("span",{staticClass:"mar_lr10"},[e._v("每消费")]),a("el-input-number",{attrs:{"controls-position":"right",min:1,max:99999999},model:{value:e.integral,callback:function(t){e.integral=t},expression:"integral"}}),a("span",{staticClass:"mar_lr10"},[e._v("元")]),a("span",{staticClass:"mar_lr10"},[e._v("获得")]),a("el-input-number",{attrs:{"controls-position":"right",min:1,max:99999999},model:{value:e.integral,callback:function(t){e.integral=t},expression:"integral"}}),a("span",{staticClass:"mar_lr10"},[e._v("成长值")])],1)]),a("div",{staticClass:"mar_t10 t_l numberInput"},[a("div",{staticClass:"mar_lr10"},[a("el-checkbox-group",{model:{value:e.money3,callback:function(t){e.money3=t},expression:"money3"}},[a("el-checkbox",{attrs:{label:"1"}},[e._v("订单评价")])],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:e.money3,expression:"money3"}]},[a("span",{staticClass:"mar_lr10"},[e._v("获得")]),a("el-input-number",{attrs:{"controls-position":"right",min:.01,max:99999999},model:{value:e.giveMoney,callback:function(t){e.giveMoney=t},expression:"giveMoney"}}),a("span",{staticClass:"mar_lr10"},[e._v("成长值")])],1)]),a("div",{staticClass:"mar_t10 t_l numberInput"},[a("div",{staticClass:"mar_lr10"},[a("el-checkbox-group",{model:{value:e.money3,callback:function(t){e.money3=t},expression:"money3"}},[a("el-checkbox",{attrs:{label:"1"}},[e._v("每日签到")])],1)],1),a("div",{directives:[{name:"show",rawName:"v-show",value:e.money3,expression:"money3"}]},[a("span",{staticClass:"mar_lr10"},[e._v("获得")]),a("el-input-number",{attrs:{"controls-position":"right",min:.01,max:99999999},model:{value:e.giveMoney,callback:function(t){e.giveMoney=t},expression:"giveMoney"}}),a("span",{staticClass:"mar_lr10"},[e._v("成长值")])],1)])])])],1)],1),a("div",{staticClass:"flex-g-0 pad_lr_20"},[a("div",{staticClass:"fon_16"},[e._v("常见问题")]),a("el-collapse",{staticClass:"mar_tb10",staticStyle:{width:"260px"},attrs:{accordion:""},model:{value:e.collapseName,callback:function(t){e.collapseName=t},expression:"collapseName"}},[a("el-collapse-item",{attrs:{title:"什么是门店新客专享?",name:"1"}},[a("div",[e._v("针对门店新用户进行的专享活动,用户在下单时可叠加使用券、满减活动、门店新客立减。")])]),a("el-collapse-item",{attrs:{title:"为什么要做门店新客立减?",name:"2"}},[a("div",[e._v("提高新客转化:设置门店新客立减后,可提升新用户下单转化率")])]),a("el-collapse-item",{attrs:{title:"哪些用户可以享受门店新客立减",name:"3"}},[a("div",[e._v("首次在门店下单的用户将作为门店新用户享受该优惠")])])],1),a("div",{staticClass:"fon_16 mar_t20"},[e._v("活动规则")]),e._m(1)],1)])]),a("div",{staticClass:"mar_t20 ba_f pad_20 t_c"},[a("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("立即创建")])],1),a("attachment-img",{ref:"img1",attrs:{type:"img"},on:{attachment:e.imgadd1}})],1)},n=[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"shuju_title mar_b20"},[a("div",{staticClass:"shuju_title_text"},[a("span",[e._v("创建任务管理")])])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"color_9 mar_t10 lh30 fon_13"},[a("div",[e._v("1.活动仅限在线支付订单;")]),a("div",[e._v("2.活动成本由商家承担,与店铺其他活动默认同享")])])}],s=(a("c975"),a("a434"),a("96cf"),a("1da1")),r=a("7cb7"),o=a("ed08"),l=a("fc6e"),c={created:function(){this.$route.query.id&&(this.id=this.$route.query.id,this.edit())},components:{attachmentImg:l["a"]},data:function(){return{form:{name:"",money:"",useType:"1"},money1:"",money2:"",money3:"",money4:"",timeData:[new Date,(new Date).setMonth((new Date).getMonth()+3)],collapseName:""}},methods:{edit:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){var a,i;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(r["Y"])({id:e.id});case 2:a=t.sent,i=a.data,e.form2=e.form,e.form=Object.assign(e.form2,i),i.startTime&&(e.timeData=[i.startTime,i.endTime]);case 7:case"end":return t.stop()}}),t)})))()},enter:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.$refs["imgicon"+e].style.display="none"},leave:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.$refs["imgicon"+e].style.display="inline-block"},test:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;console.log(this.$refs,e),this.$refs["img"+e].dialogVisible=!0},imgadd1:function(e){this.form.icon=e.str},deleteMultiImage:function(e,t,a){if(Array.prototype.remove=function(e){var t=this.indexOf(e);t>-1&&this.splice(t,1)},"multigraph"==a)switch(t){case 2:this.form2.environment.remove(e);break}else switch(t){case 1:this.form.icon="";break}},submitForm:function(){var e=this;return Object(s["a"])(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.$refs["form"].validate(function(){var t=Object(s["a"])(regeneratorRuntime.mark((function t(a){var i,n;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!a){t.next=10;break}return e.timeData&&(e.form.startTime=Object(o["a"])(e.timeData[0]),e.form.endTime=Object(o["a"])(e.timeData[1])),t.next=4,Object(r["uc"])(e.form);case 4:i=t.sent,n=i.msg,e.$baseMessage(n,"success"),e.$router.go(-1),t.next=11;break;case 10:return t.abrupt("return",!1);case 11:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}());case 1:case"end":return t.stop()}}),t)})))()}}},u=c,m=a("2877"),d=Object(m["a"])(u,i,n,!1,null,null,null);t["default"]=d.exports},7156:function(e,t,a){var i=a("861d"),n=a("d2bb");e.exports=function(e,t,a){var s,r;return n&&"function"==typeof(s=t.constructor)&&s!==a&&i(r=s.prototype)&&r!==a.prototype&&n(e,r),e}},a434:function(e,t,a){"use strict";var i=a("23e7"),n=a("23cb"),s=a("a691"),r=a("50c4"),o=a("7b0b"),l=a("65f0"),c=a("8418"),u=a("1dde"),m=a("ae40"),d=u("splice"),p=m("splice",{ACCESSORS:!0,0:0,1:2}),g=Math.max,f=Math.min,v=9007199254740991,h="Maximum allowed length exceeded";i({target:"Array",proto:!0,forced:!d||!p},{splice:function(e,t){var a,i,u,m,d,p,y=o(this),_=r(y.length),b=n(e,_),x=arguments.length;if(0===x?a=i=0:1===x?(a=0,i=_-b):(a=x-2,i=f(g(s(t),0),_-b)),_+a-i>v)throw TypeError(h);for(u=l(y,i),m=0;m<i;m++)d=b+m,d in y&&c(u,m,y[d]);if(u.length=i,a<i){for(m=b;m<_-i;m++)d=m+i,p=m+a,d in y?y[p]=y[d]:delete y[p];for(m=_;m>_-i+a;m--)delete y[m-1]}else if(a>i)for(m=_-i;m>b;m--)d=m+i-1,p=m+a-1,d in y?y[p]=y[d]:delete y[p];for(m=0;m<a;m++)y[m+b]=arguments[m+2];return y.length=_-i+a,u}})},a9e3:function(e,t,a){"use strict";var i=a("83ab"),n=a("da84"),s=a("94ca"),r=a("6eeb"),o=a("5135"),l=a("c6b6"),c=a("7156"),u=a("c04e"),m=a("d039"),d=a("7c73"),p=a("241c").f,g=a("06cf").f,f=a("9bf2").f,v=a("58a8").trim,h="Number",y=n[h],_=y.prototype,b=l(d(_))==h,x=function(e){var t,a,i,n,s,r,o,l,c=u(e,!1);if("string"==typeof c&&c.length>2)if(c=v(c),t=c.charCodeAt(0),43===t||45===t){if(a=c.charCodeAt(2),88===a||120===a)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:i=2,n=49;break;case 79:case 111:i=8,n=55;break;default:return+c}for(s=c.slice(2),r=s.length,o=0;o<r;o++)if(l=s.charCodeAt(o),l<48||l>n)return NaN;return parseInt(s,i)}return+c};if(s(h,!y(" 0o1")||!y("0b1")||y("+0x1"))){for(var w,C=function(e){var t=arguments.length<1?0:e,a=this;return a instanceof C&&(b?m((function(){_.valueOf.call(a)})):l(a)!=h)?c(new y(x(t)),a,C):x(t)},k=i?p(y):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),I=0;k.length>I;I++)o(y,w=k[I])&&!o(C,w)&&f(C,w,g(y,w));C.prototype=_,_.constructor=C,r(n,h,C)}},bf19:function(e,t,a){"use strict";var i=a("23e7");i({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},c8f1:function(e,t,a){},d2bb:function(e,t,a){var i=a("825a"),n=a("3bbe");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,a={};try{e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,e.call(a,[]),t=a instanceof Array}catch(s){}return function(a,s){return i(a),n(s),t?e.call(a,s):a.__proto__=s,a}}():void 0)},dad0:function(e,t,a){"use strict";var i=a("c8f1"),n=a.n(i);n.a},ed08:function(e,t,a){"use strict";a.d(t,"a",(function(){return i})),a.d(t,"b",(function(){return n})),a.d(t,"c",(function(){return s}));a("a9e3"),a("ac1f"),a("5319"),a("bf19");function i(e){var t=new Date(e).toJSON(),a=new Date(+new Date(t)+288e5).toISOString().replace(/T/g," ").replace(/\.[\d]{3}Z/,"");return a}function n(e){var t=new Date(e),a=t.getFullYear(),i=t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1,n=t.getDate()<10?"0"+t.getDate():t.getDate(),s=t.getHours()<10?"0"+t.getHours():t.getHours(),r=t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes(),o=t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds();return a+"-"+i+"-"+n+" "+s+":"+r+":"+o}function s(e){var t=new Date(1e3*Number(e)),a=t.getFullYear()+"-",i=(t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1)+"-",n=(t.getDate()<10?"0"+t.getDate():t.getDate())+" ",s=(t.getHours()<10?"0"+t.getHours():t.getHours())+":",r=(t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes())+":",o=t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds(),l=a+i+n+s+r+o;return l}},fc6e:function(e,t,a){"use strict";var i=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("el-dialog",{staticClass:"attachmentImg",attrs:{title:"选择图片",visible:e.dialogVisible,"close-on-click-modal":!1,width:"55%"},on:{"update:visible":function(t){e.dialogVisible=t},close:e.modalClose,opened:e.dialogOpened}},[a("div",{staticClass:"attachment_img_box",attrs:{flex:"box:first"}},[a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.groupListLoading,expression:"groupListLoading"}],staticClass:"attachment_img_left"},[a("el-menu",{staticClass:"group-menu",attrs:{mode:"vertical"}},[a("el-scrollbar",{staticStyle:{height:"523px",width:"100%"}},[a("div",{staticClass:"goods-menu"},[a("el-menu-item",{class:{"is-active":"all"==e.allindex},staticStyle:{"text-align":"center"},attrs:{index:"all"},on:{click:function(t){return e.selected(0)}}},[a("span",[e._v("全部")])]),e._l(e.groupItem,(function(t){return[a("el-menu-item",{key:t.id,attrs:{index:t.id},on:{click:function(a){return e.selected(t.id)}}},[a("div",{staticClass:"fenlei",attrs:{flex:"dir:left box:last"}},[a("i",{staticClass:"el-icon-circle-close gbfenlei",staticStyle:{display:"none"},on:{click:function(a){return e.deleteType(t.id)}}}),a("div",{staticStyle:{overflow:"hidden","text-overflow":"ellipsis",width:"100%"}},[a("span",[e._v(e._s(t.name))])])])])]}))],2)]),a("el-popover",{attrs:{placement:"top",width:"160"},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[a("el-input",{attrs:{placeholder:"请输入分组名称",size:"mini"},model:{value:e.new_type_name,callback:function(t){e.new_type_name=t},expression:"new_type_name"}}),a("div",{staticStyle:{"text-align":"right",margin:"0","margin-top":"10px"}},[a("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(t){e.visible=!1}}},[e._v("取消")]),a("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.addNewAttType}},[e._v("确定")])],1),a("el-button",{staticStyle:{"margin-left":"22%","margin-top":"13px"},attrs:{slot:"reference",size:"small"},slot:"reference"},[a("i",{staticClass:"el-icon-circle-plus-outline"}),e._v(" 新建分组 ")])],1)],1)],1),a("div",{directives:[{name:"loading",rawName:"v-loading",value:e.rightLoading,expression:"rightLoading"}],staticClass:"attachment_img_right",attrs:{flex:"dir:top"}},[a("div",{staticClass:"selectBox"},[a("el-input",{staticStyle:{width:"30%","padding-left":"12px"},attrs:{placeholder:"请输入图片名称","suffix-icon":"el-icon-search",size:"small"},on:{input:function(t){return e.search(e.atta_name)}},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.search(e.atta_name)}},model:{value:e.atta_name,callback:function(t){e.atta_name=t},expression:"atta_name"}}),a("div",{staticStyle:{float:"right",padding:"0 10px 0 0"}},[a("el-upload",{staticClass:"upload-demo",attrs:{action:e.UploadUrl(),multiple:!0,limit:50,"on-exceed":e.handleExceed,"file-list":e.fileList,"on-success":e.handleSuccess,"on-error":e.handleError,"before-upload":e.beforeUpload,data:e.uploadData,"on-progress":e.handProgress}},[a("el-button",{attrs:{size:"small",type:"primary"}},[a("i",{staticClass:"el-icon-plus avatar-uploader-icon"}),e._v(" 上传图片 ")])],1)],1)],1),a("el-scrollbar",{staticClass:"scrollbar",staticStyle:{height:"460px"}},[a("div",{staticClass:"app-attachment-list"},[e._l(e.attachments,(function(t,i){return[a("el-tooltip",{key:t.id,staticClass:"item",attrs:{effect:"dark",content:t.name,placement:"top","open-delay":1}},[a("div",{staticClass:"app-attachment-item",on:{click:function(a){return e.selectedItem(i,t.url)}}},[a("div",{staticClass:"app-attachment-item-bj"},[a("div",{staticClass:"imgStyle"},[a("el-image",{staticStyle:{width:"100%",height:"143px","border-radius":"5px"},attrs:{src:t.url,fit:"cover"}}),a("div",{staticClass:"mask",style:e.getStyle2(i)},[a("i",{staticClass:"el-icon-check center-icon pos-center"}),a("p",{staticClass:"triangle"},[a("i",{staticClass:"el-icon-check"})])])],1),a("div",{staticClass:"app-attachment-name"},[e._v(e._s(t.name))]),a("i",{staticClass:"el-icon-error delete",on:{click:function(a){return e.deleteItem(t.id)}}})])])])]}))],2)]),a("div",{staticStyle:{padding:"5px","text-align":"right","margin-top":"auto"}},[a("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.pagesize},on:{"current-change":e.current_change}})],1)],1)]),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{attrs:{size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.selectedItems()}}},[e._v("确 定")])],1)])},n=[],s=(a("99af"),a("365c")),r={name:"attachment-img",props:{type:{type:String,default:"img"},type2:{type:String,default:""},op:{type:String}},data:function(){return{visible:!1,atta_name:"",uploadParams:{type_id:0,type:1},category:0,keywords:"",total:0,pagesize:30,currentPage:1,dialogVisible:!1,groupItem:[],attachments:[],groupListLoading:!1,rightLoading:!1,new_type_name:"",fileList:[],selectedArr:{},attachmentList:"12",uploadData:{key:"",token:""},file:{Url:"",path:"",name:"",size:0},att_type:"",allindex:"all"}},created:function(){},methods:{getStyle2:function(e){var t=this,a=t.currentPage,i=t.selectedArr["img"==t.type?"danxuan":"item"+e+a];return i&&i.page==a&&i.index==e?"display:block":""},modalClose:function(){var e=this;e.selectedArr={}},dialogOpened:function(){this.getgroupItem(),this.getAttachment_List()},handProgress:function(){var e=this;e.rightLoading=!0},getgroupItem:function(){var e=this;this.$api.get("common/file/get-category",{storeId:this.type2},(function(t){1==t.code?(e.groupItem=t.data,e.groupListLoading=!1,e.visible=!1):e.groupListLoading=!1}))},getAttachment_List:function(){var e=this;e.rightLoading=!0,this.$api.get("common/file/get-picture",{page:e.currentPage,category:e.category,keywords:e.keywords,storeId:this.type2},(function(t){1==t.code?(e.attachments=t.data,e.total=t.count,e.rightLoading=!1):e.rightLoading=!1}))},addNewAttType:function(){var e=this;e.groupListLoading=!0,this.$api.post("common/file/save-category",{storeId:this.type2,name:e.new_type_name},(function(t){1==t.code?(e.visible=!1,e.$message({message:t.msg,type:"success",duration:500,onClose:function(){e.new_type_name="",e.getgroupItem()}})):(e.visible=!1,e.$message.error(t.msg))}))},deleteType:function(e){var t=this;t.groupListLoading=!0,this.$api.post("common/file/del-picture-category",{id:e},(function(e){1==e.code?(t.visible=!1,t.$message({message:e.msg,type:"success",duration:500,onClose:function(){t.getgroupItem()}})):(t.$message.error(e.msg),t.groupListLoading=!1)}))},search:function(e){var t=this;console.log(e),this.keywords=e,t.getAttachment_List()},current_change:function(e){var t=this;t.currentPage=e,t.getAttachment_List()},deleteItem:function(e){var t=this;t.rightLoading=!0,this.$api.post("common/file/del-picture",{id:e},(function(e){1==e.code?(t.visible=!1,t.$message({message:e.msg,type:"success",duration:500,onClose:function(){t.getAttachment_List()}})):(t.$message.error(e.msg),t.groupListLoading=!1)}))},UploadUrl:function(){var e=s["a"].backendPath;return e+"common/file/get-category"},beforeUpload:function(e){console.log("上传前判断",e);var t="image/jpg"===e.type||"image/jpeg"===e.type||"image/png"===e.type||"image/gif"===e.type,a=e.size/1024/1024<2;return t?a?void 0:(this.$message.error("文件大小不能超过 2MB!"),!1):(this.$message.error("上传图片只支持jpg、jpeg、png格式!"),!1)},handleError:function(e){this.$message({message:"上传失败",duration:2e3,type:"warning"})},handleSuccess:function(e,t,a){console.log("345",a),this.file=t,this.addAttachment()},handleExceed:function(e,t){this.$message.warning("当前限制选择 50 个文件,本次选择了 ".concat(e.length," 个文件,共选择了 ").concat(e.length+t.length," 个文件"))},addAttachment:function(){var e=this,t=new FormData;t.append("file",this.file.raw),t.append("category",this.category),t.append("storeId",this.type2),this.$api.post("common/file/upload",t,(function(t){1==t.code?(e.getAttachment_List(),e.$message.success("上传成功")):(e.$message.error(t.msg),console.log(t.msg))}))},selected:function(e){var t=this;t.rightLoading=!0,t.currentPage=1,t.category=e,t.allindex="otherList",t.getAttachment_List()},selectedItem:function(e,t){var a=this,i="img"==a.type,n=i?"danxuan":"item"+e+a.currentPage,s=a.selectedArr[n];s&&s.index==e?a.$delete(a.selectedArr,n):(i&&a.$delete(a.selectedArr,n),a.$set(a.selectedArr,n,{page:a.currentPage,index:e,url:t}))},selectedItems:function(){var e=this;e=this;var t=e.selectedArr,a="",i=[];for(var n in t)a+=a?","+t[n].url:t[n].url,i.push(t[n].url);e.$emit("attachment",{str:a,arr:i}),e.dialogVisible=!1}}},o=r,l=(a("dad0"),a("2877")),c=Object(l["a"])(o,i,n,!1,null,null,null);t["a"]=c.exports}}]); |