(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-08a85e76"],{"3bbe":function(e,t,n){var a=n("861d");e.exports=function(e){if(!a(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},7156:function(e,t,n){var a=n("861d"),r=n("d2bb");e.exports=function(e,t,n){var i,o;return r&&"function"==typeof(i=t.constructor)&&i!==n&&a(o=i.prototype)&&o!==n.prototype&&r(e,o),e}},"8a2b":function(e,t,n){"use strict";n.r(t);var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",[n("div",{staticClass:"outmain ba_f heighthv pad_20 bor_rad5"},[e._m(0),n("div",{staticClass:"mar_t20 flex-bet flex-y-top"},[n("div",{staticClass:"flex-g-1"},[n("el-form",{ref:"form",attrs:{model:e.form,"label-width":"180px"}},[n("el-form-item",{attrs:{label:"活动名称",required:!0,prop:"name"}},[n("el-input",{attrs:{placeholder:"请输入活动名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),n("el-form-item",{attrs:{label:"活动时间",required:!0}},[n("el-date-picker",{attrs:{type:"datetimerange",align:"right","start-placeholder":"开始日期","end-placeholder":"结束日期","default-time":["08:00:00","23:59:59"]},model:{value:e.timeData,callback:function(t){e.timeData=t},expression:"timeData"}})],1),n("el-form-item",{attrs:{label:"参与对象",required:!0}},[n("el-radio-group",{model:{value:e.form.people,callback:function(t){e.$set(e.form,"people",t)},expression:"form.people"}},[n("el-radio",{attrs:{label:"1"}},[e._v("所有人均可领取")]),n("el-radio",{attrs:{label:"2"}},[e._v("新用户")]),n("el-radio",{attrs:{label:"3"}},[e._v("会员可领")]),n("el-radio",{attrs:{label:"4"}},[e._v("指定标签用户可领")])],1),n("div",{directives:[{name:"show",rawName:"v-show",value:"4"==e.form.people,expression:"form.people=='4'"}],staticClass:"mar_t10"},[n("el-select",{attrs:{clearable:"",multiple:"",filterable:"","allow-create":"",placeholder:"请选择标签"},model:{value:e.form.userLabel,callback:function(t){e.$set(e.form,"userLabel",t)},expression:"form.userLabel"}},e._l(e.labelOptions,(function(e){return n("el-option",{key:e.id,attrs:{label:e.labelName,value:e.id}})})),1)],1)],1),n("el-form-item",{attrs:{label:"优惠活动"}},[n("div",{},[n("div",{},[n("div",{staticClass:"mar_lr10"},[n("el-checkbox-group",{model:{value:e.form.isCoupon,callback:function(t){e.$set(e.form,"isCoupon",t)},expression:"form.isCoupon"}},[n("el-checkbox",{attrs:{"true-label":"1","false-label":"2"}},[e._v("赠送优惠券")])],1)],1),n("div",{directives:[{name:"show",rawName:"v-show",value:"1"==e.form.isCoupon,expression:"form.isCoupon=='1'"}],staticClass:"flex"},[n("el-select",{attrs:{multiple:"",filterable:"",placeholder:"请选择优惠券"},model:{value:e.form.coupon,callback:function(t){e.$set(e.form,"coupon",t)},expression:"form.coupon"}},e._l(e.comgrouping,(function(e){return n("el-option",{key:e.id,attrs:{label:e.name,value:e.id}})})),1)],1)]),n("div",{staticClass:"t_l numberInput"},[n("div",{staticClass:"mar_lr10"},[n("el-checkbox-group",{model:{value:e.form.isBalance,callback:function(t){e.$set(e.form,"isBalance",t)},expression:"form.isBalance"}},[n("el-checkbox",{attrs:{"true-label":"1","false-label":"2"}},[e._v("赠送余额")])],1)],1),n("div",{directives:[{name:"show",rawName:"v-show",value:"1"==e.form.isBalance,expression:"form.isBalance=='1'"}]},[n("el-input-number",{attrs:{"controls-position":"right",min:.01,max:99999999},model:{value:e.form.balance,callback:function(t){e.$set(e.form,"balance",t)},expression:"form.balance"}}),n("span",{staticClass:"mar_l10"},[e._v("元")])],1)]),n("div",{staticClass:"mar_t10 t_l numberInput"},[n("div",{staticClass:"mar_lr10"},[n("el-checkbox-group",{model:{value:e.form.isIntegral,callback:function(t){e.$set(e.form,"isIntegral",t)},expression:"form.isIntegral"}},[n("el-checkbox",{attrs:{"true-label":"1","false-label":"2"}},[e._v("赠送积分")])],1)],1),n("div",{directives:[{name:"show",rawName:"v-show",value:"1"==e.form.isIntegral,expression:"form.isIntegral=='1'"}]},[n("el-input-number",{attrs:{"controls-position":"right",min:1,max:99999999},model:{value:e.form.integral,callback:function(t){e.$set(e.form,"integral",t)},expression:"form.integral"}}),n("span",{staticClass:"mar_l10"},[e._v("积分")])],1)])])])],1)],1),n("div",{staticClass:"flex-g-0 pad_lr_20"},[n("div",{staticClass:"fon_16"},[e._v("常见问题")]),n("el-collapse",{staticClass:"mar_tb10",staticStyle:{width:"260px"},attrs:{accordion:""},model:{value:e.collapseName,callback:function(t){e.collapseName=t},expression:"collapseName"}},[n("el-collapse-item",{attrs:{title:"什么是生日有礼活动?",name:"1"}},[n("div",[e._v("针对平台用户生日当天的一个生日礼包活动。")])]),n("el-collapse-item",{attrs:{title:"为什么要做生日有礼活动?",name:"2"}},[n("div",[e._v("提高用户粘性,让用户在平台享受一定回馈福利")])]),n("el-collapse-item",{attrs:{title:"哪些用户可以享受生日有礼活动",name:"3"}},[n("div",[e._v("在个人资料完善了生日时间的用户,没有完善的则不享受此活动")])])],1),n("div",{staticClass:"fon_16 mar_t20"},[e._v("活动规则")]),e._m(1)],1)])]),n("div",{staticClass:"mar_t20 ba_f pad_20 t_c"},[n("el-button",{attrs:{type:"primary"},on:{click:e.submitForm}},[e._v("立即创建")])],1),n("attachment-img",{ref:"img1",attrs:{type:"img"},on:{attachment:e.imgadd1}})],1)},r=[function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"shuju_title mar_b20"},[n("div",{staticClass:"shuju_title_text"},[n("span",[e._v("创建生日有礼活动")])])])},function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"color_9 mar_t10 lh30 fon_13"},[n("div",{},[n("div",[e._v("1.活动仅限完善了生日时间的用户,每个用户一年")]),n("div",[e._v("内有且只能享受一次活动;")])]),n("div",[e._v("2.活动成本由平台承担,与店铺其他活动默认同享")])])}],i=(n("c975"),n("a434"),n("96cf"),n("1da1")),o=n("7cb7"),s=n("c24f"),c=n("ed08"),l=n("fc6e"),u={created:function(){this.$route.query.id&&(this.id=this.$route.query.id,this.edit()),this.getSelectCoupon(),this.getLabel()},components:{attachmentImg:l["a"]},data:function(){return{form:{name:"",people:"1",isCoupon:"1",isBalance:"1",isIntegral:"1",isGrowth:"1",userLabel:[],coupon:[],balance:"",integral:"",growth:""},comgrouping:[],labelOptions:[],timeData:[new Date,(new Date).setMonth((new Date).getMonth()+3)],collapseName:""}},methods:{getSelectCoupon:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){var n,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(s["n"])();case 2:n=t.sent,a=n.data,e.comgrouping=a||[];case 5:case"end":return t.stop()}}),t)})))()},getLabel:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){var n,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(o["C"])();case 2:n=t.sent,a=n.data,e.labelOptions=a||[];case 5:case"end":return t.stop()}}),t)})))()},edit:function(){var e=this;return Object(i["a"])(regeneratorRuntime.mark((function t(){var n,a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(o["G"])({id:e.id});case 2:n=t.sent,a=n.data,e.form2=e.form,e.form=Object.assign(e.form2,a),a.startTime&&(e.timeData=[a.startTime,a.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,n){if(Array.prototype.remove=function(e){var t=this.indexOf(e);t>-1&&this.splice(t,1)},"multigraph"==n)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(i["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(i["a"])(regeneratorRuntime.mark((function t(n){var a,r;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!n){t.next=10;break}return e.timeData&&(e.form.startTime=Object(c["a"])(e.timeData[0]),e.form.endTime=Object(c["a"])(e.timeData[1])),t.next=4,Object(o["Ub"])(e.form);case 4:a=t.sent,r=a.msg,e.$baseMessage(r,"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)})))()}}},m=u,d=n("2877"),p=Object(d["a"])(m,a,r,!1,null,null,null);t["default"]=p.exports},a434:function(e,t,n){"use strict";var a=n("23e7"),r=n("23cb"),i=n("a691"),o=n("50c4"),s=n("7b0b"),c=n("65f0"),l=n("8418"),u=n("1dde"),m=n("ae40"),d=u("splice"),p=m("splice",{ACCESSORS:!0,0:0,1:2}),f=Math.max,g=Math.min,h=9007199254740991,b="Maximum allowed length exceeded";a({target:"Array",proto:!0,forced:!d||!p},{splice:function(e,t){var n,a,u,m,d,p,v=s(this),_=o(v.length),y=r(e,_),x=arguments.length;if(0===x?n=a=0:1===x?(n=0,a=_-y):(n=x-2,a=g(f(i(t),0),_-y)),_+n-a>h)throw TypeError(b);for(u=c(v,a),m=0;m_-a+n;m--)delete v[m-1]}else if(n>a)for(m=_-a;m>y;m--)d=m+a-1,p=m+n-1,d in v?v[p]=v[d]:delete v[p];for(m=0;m2)if(l=h(l),t=l.charCodeAt(0),43===t||45===t){if(n=l.charCodeAt(2),88===n||120===n)return NaN}else if(48===t){switch(l.charCodeAt(1)){case 66:case 98:a=2,r=49;break;case 79:case 111:a=8,r=55;break;default:return+l}for(i=l.slice(2),o=i.length,s=0;sr)return NaN;return parseInt(i,a)}return+l};if(i(b,!v(" 0o1")||!v("0b1")||v("+0x1"))){for(var w,k=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof k&&(y?m((function(){_.valueOf.call(n)})):c(n)!=b)?l(new v(x(t)),n,k):x(t)},C=a?p(v):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),O=0;C.length>O;O++)s(v,w=C[O])&&!s(k,w)&&g(k,w,f(v,w));k.prototype=_,_.constructor=k,o(r,b,k)}},bf19:function(e,t,n){"use strict";var a=n("23e7");a({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return URL.prototype.toString.call(this)}})},c24f:function(e,t,n){"use strict";n.d(t,"k",(function(){return r})),n.d(t,"E",(function(){return i})),n.d(t,"C",(function(){return o})),n.d(t,"d",(function(){return s})),n.d(t,"b",(function(){return c})),n.d(t,"s",(function(){return l})),n.d(t,"c",(function(){return u})),n.d(t,"j",(function(){return m})),n.d(t,"q",(function(){return d})),n.d(t,"i",(function(){return p})),n.d(t,"r",(function(){return f})),n.d(t,"f",(function(){return g})),n.d(t,"x",(function(){return h})),n.d(t,"h",(function(){return b})),n.d(t,"n",(function(){return v})),n.d(t,"u",(function(){return _})),n.d(t,"g",(function(){return y})),n.d(t,"l",(function(){return x})),n.d(t,"t",(function(){return w})),n.d(t,"A",(function(){return k})),n.d(t,"z",(function(){return C})),n.d(t,"w",(function(){return O})),n.d(t,"p",(function(){return j})),n.d(t,"m",(function(){return L})),n.d(t,"y",(function(){return I})),n.d(t,"a",(function(){return $})),n.d(t,"o",(function(){return S})),n.d(t,"B",(function(){return A})),n.d(t,"e",(function(){return N})),n.d(t,"F",(function(){return D})),n.d(t,"D",(function(){return E})),n.d(t,"v",(function(){return M}));var a=n("b775");function r(e){return Object(a["a"])({url:"channel/member/get-member-list",method:"get",params:e})}function i(e){return Object(a["a"])({url:"channel/member/get-member-list",method:"post",data:e})}function o(e){return Object(a["a"])({url:"channel/activity/select-user",method:"post",data:e})}function s(e){return Object(a["a"])({url:"channel/member/change-status",method:"post",data:e})}function c(e){return Object(a["a"])({url:"channel/member/change-info",method:"post",data:e})}function l(e){return Object(a["a"])({url:"channel/member/member-label-save",method:"post",data:e})}function u(e){return Object(a["a"])({url:"channel/member/change-member-label",method:"post",data:e})}function m(e){return Object(a["a"])({url:"channel/member/get-member-label",method:"get",params:e})}function d(e){return Object(a["a"])({url:"channel/member/member-excel-list",method:"get",params:e})}function p(e){return Object(a["a"])({url:"channel/member/get-member-info",method:"post",data:e})}function f(e){return Object(a["a"])({url:"channel/member/member-info-save",method:"post",data:e})}function g(e){return Object(a["a"])({url:"channel/member/get-deposit-list",method:"get",params:e})}function h(e){return Object(a["a"])({url:"channel/member/deposit-save",method:"post",data:e})}function b(e){return Object(a["a"])({url:"channel/member/deposit-save",method:"get",params:e})}function v(e){return Object(a["a"])({url:"channel/activity/select-coupon",method:"get",params:e})}function _(e){return Object(a["a"])({url:"channel/member/modify-deposit",method:"post",data:e})}function y(e){return Object(a["a"])({url:"channel/member/get-deposit-order",method:"get",params:e})}function x(e){return Object(a["a"])({url:"channel/member/get-member-set-info",method:"get",params:e})}function w(e){return Object(a["a"])({url:"channel/member/member-set",method:"post",data:e})}function k(e){return Object(a["a"])({url:"channel/vip-card/rights-list",method:"get",params:e})}function C(e){return Object(a["a"])({url:"channel/vip-card/save-rights",method:"post",data:e})}function O(e){return Object(a["a"])({url:"channel/vip-card/modify-rights",method:"post",data:e})}function j(e){return Object(a["a"])({url:"channel/vip-card/level-list",method:"get",params:e})}function L(e){return Object(a["a"])({url:"channel/vip-card/save-level",method:"get",params:e})}function I(e){return Object(a["a"])({url:"channel/vip-card/save-level",method:"post",data:e})}function $(e){return Object(a["a"])({url:"channel/vip-card/card-record",method:"get",params:e})}function S(e){return Object(a["a"])({url:"channel/good/goods-vip",method:"get",params:e})}function A(e){return Object(a["a"])({url:"channel/good/save-goods-vip",method:"post",data:e})}function N(e){return Object(a["a"])({url:"channel/member/get-coupon-list",method:"get",params:e})}function D(e){return Object(a["a"])({url:"channel/member/store-coupon-list",method:"get",params:e})}function E(e){return Object(a["a"])({url:"channel/member/send-coupon",method:"post",data:e})}function M(e){return Object(a["a"])({url:"channel/vip-card/modify-level",method:"post",data:e})}},c8f1:function(e,t,n){},d2bb:function(e,t,n){var a=n("825a"),r=n("3bbe");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,e.call(n,[]),t=n instanceof Array}catch(i){}return function(n,i){return a(n),r(i),t?e.call(n,i):n.__proto__=i,n}}():void 0)},dad0:function(e,t,n){"use strict";var a=n("c8f1"),r=n.n(a);r.a},ed08:function(e,t,n){"use strict";n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return i}));n("a9e3"),n("ac1f"),n("5319"),n("bf19");function a(e){var t=new Date(e).toJSON(),n=new Date(+new Date(t)+288e5).toISOString().replace(/T/g," ").replace(/\.[\d]{3}Z/,"");return n}function r(e){var t=new Date(e),n=t.getFullYear(),a=t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1,r=t.getDate()<10?"0"+t.getDate():t.getDate(),i=t.getHours()<10?"0"+t.getHours():t.getHours(),o=t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes(),s=t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds();return n+"-"+a+"-"+r+" "+i+":"+o+":"+s}function i(e){var t=new Date(1e3*Number(e)),n=t.getFullYear()+"-",a=(t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1)+"-",r=(t.getDate()<10?"0"+t.getDate():t.getDate())+" ",i=(t.getHours()<10?"0"+t.getHours():t.getHours())+":",o=(t.getMinutes()<10?"0"+t.getMinutes():t.getMinutes())+":",s=t.getSeconds()<10?"0"+t.getSeconds():t.getSeconds(),c=n+a+r+i+o+s;return c}},fc6e:function(e,t,n){"use strict";var a=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("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}},[n("div",{staticClass:"attachment_img_box",attrs:{flex:"box:first"}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.groupListLoading,expression:"groupListLoading"}],staticClass:"attachment_img_left"},[n("el-menu",{staticClass:"group-menu",attrs:{mode:"vertical"}},[n("el-scrollbar",{staticStyle:{height:"523px",width:"100%"}},[n("div",{staticClass:"goods-menu"},[n("el-menu-item",{class:{"is-active":"all"==e.allindex},staticStyle:{"text-align":"center"},attrs:{index:"all"},on:{click:function(t){return e.selected(0)}}},[n("span",[e._v("全部")])]),e._l(e.groupItem,(function(t){return[n("el-menu-item",{key:t.id,attrs:{index:t.id},on:{click:function(n){return e.selected(t.id)}}},[n("div",{staticClass:"fenlei",attrs:{flex:"dir:left box:last"}},[n("i",{staticClass:"el-icon-circle-close gbfenlei",staticStyle:{display:"none"},on:{click:function(n){return e.deleteType(t.id)}}}),n("div",{staticStyle:{overflow:"hidden","text-overflow":"ellipsis",width:"100%"}},[n("span",[e._v(e._s(t.name))])])])])]}))],2)]),n("el-popover",{attrs:{placement:"top",width:"160"},model:{value:e.visible,callback:function(t){e.visible=t},expression:"visible"}},[n("el-input",{attrs:{placeholder:"请输入分组名称",size:"mini"},model:{value:e.new_type_name,callback:function(t){e.new_type_name=t},expression:"new_type_name"}}),n("div",{staticStyle:{"text-align":"right",margin:"0","margin-top":"10px"}},[n("el-button",{attrs:{size:"mini",type:"text"},on:{click:function(t){e.visible=!1}}},[e._v("取消")]),n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:e.addNewAttType}},[e._v("确定")])],1),n("el-button",{staticStyle:{"margin-left":"22%","margin-top":"13px"},attrs:{slot:"reference",size:"small"},slot:"reference"},[n("i",{staticClass:"el-icon-circle-plus-outline"}),e._v(" 新建分组 ")])],1)],1)],1),n("div",{directives:[{name:"loading",rawName:"v-loading",value:e.rightLoading,expression:"rightLoading"}],staticClass:"attachment_img_right",attrs:{flex:"dir:top"}},[n("div",{staticClass:"selectBox"},[n("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"}}),n("div",{staticStyle:{float:"right",padding:"0 10px 0 0"}},[n("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}},[n("el-button",{attrs:{size:"small",type:"primary"}},[n("i",{staticClass:"el-icon-plus avatar-uploader-icon"}),e._v(" 上传图片 ")])],1)],1)],1),n("el-scrollbar",{staticClass:"scrollbar",staticStyle:{height:"460px"}},[n("div",{staticClass:"app-attachment-list"},[e._l(e.attachments,(function(t,a){return[n("el-tooltip",{key:t.id,staticClass:"item",attrs:{effect:"dark",content:t.name,placement:"top","open-delay":1}},[n("div",{staticClass:"app-attachment-item",on:{click:function(n){return e.selectedItem(a,t.url)}}},[n("div",{staticClass:"app-attachment-item-bj"},[n("div",{staticClass:"imgStyle"},[n("el-image",{staticStyle:{width:"100%",height:"143px","border-radius":"5px"},attrs:{src:t.url,fit:"cover"}}),n("div",{staticClass:"mask",style:e.getStyle2(a)},[n("i",{staticClass:"el-icon-check center-icon pos-center"}),n("p",{staticClass:"triangle"},[n("i",{staticClass:"el-icon-check"})])])],1),n("div",{staticClass:"app-attachment-name"},[e._v(e._s(t.name))]),n("i",{staticClass:"el-icon-error delete",on:{click:function(n){return e.deleteItem(t.id)}}})])])])]}))],2)]),n("div",{staticStyle:{padding:"5px","text-align":"right","margin-top":"auto"}},[n("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:e.total,"page-size":e.pagesize},on:{"current-change":e.current_change}})],1)],1)]),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{size:"small"},on:{click:function(t){e.dialogVisible=!1}}},[e._v("取 消")]),n("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.selectedItems()}}},[e._v("确 定")])],1)])},r=[],i=(n("99af"),n("365c")),o={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,n=t.currentPage,a=t.selectedArr["img"==t.type?"danxuan":"item"+e+n];return a&&a.page==n&&a.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=i["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,n=e.size/1024/1024<2;return t?n?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,n){console.log("345",n),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 n=this,a="img"==n.type,r=a?"danxuan":"item"+e+n.currentPage,i=n.selectedArr[r];i&&i.index==e?n.$delete(n.selectedArr,r):(a&&n.$delete(n.selectedArr,r),n.$set(n.selectedArr,r,{page:n.currentPage,index:e,url:t}))},selectedItems:function(){var e=this;e=this;var t=e.selectedArr,n="",a=[];for(var r in t)n+=n?","+t[r].url:t[r].url,a.push(t[r].url);e.$emit("attachment",{str:n,arr:a}),e.dialogVisible=!1}}},s=o,c=(n("dad0"),n("2877")),l=Object(c["a"])(s,a,r,!1,null,null,null);t["a"]=l.exports}}]);