1 line
27 KiB
JavaScript
1 line
27 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b9c51980"],{"0a90":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"signin"},[n("div",{staticClass:"outmain ba_f heighthv pad_20 bor_rad5"},[n("div",{staticClass:"ba_f59 pad_20 flex-bet"},[t._m(0),n("div",{},[n("el-switch",{attrs:{"active-value":"1","inactive-value":"2"},on:{change:t.switchSign},model:{value:t.open,callback:function(e){t.open=e},expression:"open"}})],1)]),n("div",{directives:[{name:"show",rawName:"v-show",value:"1"==t.open,expression:"open=='1'"}],staticClass:"mar_t20 flex-y-top"},[n("el-form",{ref:"form",attrs:{model:t.form,"label-width":"180px"}},[n("div",{staticClass:"shuju_title mar_b20"},[n("div",{staticClass:"shuju_title_text"},[n("span",[t._v("基本信息")])])]),n("el-form-item",{attrs:{label:"签到名称",required:!0,prop:"name"}},[n("el-input",{attrs:{placeholder:"请输入活动名称"},model:{value:t.form.name,callback:function(e){t.$set(t.form,"name",e)},expression:"form.name"}})],1),n("el-form-item",{attrs:{label:"签到说明"}},[n("el-input",{attrs:{placeholder:"请输入活动说明"},model:{value:t.form.introduce,callback:function(e){t.$set(t.form,"introduce",e)},expression:"form.introduce"}})],1),n("el-form-item",{attrs:{label:"背景图片",required:!0,prop:"icon"}},[t.form.icon?n("div",{staticClass:"uploadSource bor_de rel flex"},[n("label",{staticClass:"statusLabel curs",on:{mouseenter:function(e){return t.enter(1)},mouseleave:function(e){return t.leave(1)}}},[n("i",{ref:"imgicon1",staticClass:"el-icon-check"}),n("i",{staticClass:"el-icon-close",on:{click:function(e){return t.deleteMultiImage(t.form.icon,1)}}})]),n("img",{staticClass:"wid",attrs:{src:t.form.icon},on:{click:function(e){return t.test(1)}}})]):n("div",{staticClass:"uploadSource flex-center curs",on:{click:function(e){return t.test(1)}}},[n("i",{staticClass:"el-icon-plus fon_40 color_d9"})]),n("div",{staticClass:"yb_margin"},[t._v("建议尺寸:375*193")])]),n("div",{staticClass:"shuju_title mar_b20"},[n("div",{staticClass:"shuju_title_text"},[n("span",[t._v("签到规则")])])]),n("el-form-item",{attrs:{label:"日常签到",required:!0}},[n("div",{staticClass:"t_l"},[t._l(t.form.oneDay,(function(e,a){return n("div",{key:"1"},[n("el-input",{staticClass:"daySignin mar_b20",attrs:{placeholder:"第一天签到奖励",type:"number"},model:{value:e.integral,callback:function(n){t.$set(e,"integral",n)},expression:"item.integral"}},[n("template",{slot:"prepend"},[t._v("第一天")]),n("template",{slot:"append"},[t._v("积分")])],2),n("span",{staticClass:"mar_lr10"},[t._v("加")]),n("span",{staticClass:"time_item"},[n("el-input-number",{attrs:{"controls-position":"right",min:0,max:99999999},model:{value:e.growth,callback:function(n){t.$set(e,"growth",n)},expression:"item.growth"}}),n("span",{staticClass:"mar_l10"},[t._v("成长值")])],1)],1)})),t._l(t.form.twoDay,(function(e,a){return n("div",{key:"2"},[n("el-input",{staticClass:"daySignin mar_b20",attrs:{placeholder:"第二天签到奖励",type:"number"},model:{value:e.integral,callback:function(n){t.$set(e,"integral",n)},expression:"item.integral"}},[n("template",{slot:"prepend"},[t._v("第二天")]),n("template",{slot:"append"},[t._v("积分")])],2),n("span",{staticClass:"mar_lr10"},[t._v("加")]),n("span",{staticClass:"time_item"},[n("el-input-number",{attrs:{"controls-position":"right",min:0,max:99999999},model:{value:e.growth,callback:function(n){t.$set(e,"growth",n)},expression:"item.growth"}}),n("span",{staticClass:"mar_l10"},[t._v("成长值")])],1)],1)})),t._l(t.form.threeDay,(function(e,a){return n("div",{key:"3"},[n("el-input",{staticClass:"daySignin mar_b20",attrs:{placeholder:"第三天签到奖励",type:"number"},model:{value:e.integral,callback:function(n){t.$set(e,"integral",n)},expression:"item.integral"}},[n("template",{slot:"prepend"},[t._v("第三天")]),n("template",{slot:"append"},[t._v("积分")])],2),n("span",{staticClass:"mar_lr10"},[t._v("加")]),n("span",{staticClass:"time_item"},[n("el-input-number",{attrs:{"controls-position":"right",min:0,max:99999999},model:{value:e.growth,callback:function(n){t.$set(e,"growth",n)},expression:"item.growth"}}),n("span",{staticClass:"mar_l10"},[t._v("成长值")])],1)],1)})),t._l(t.form.fourDay,(function(e,a){return n("div",{key:"4"},[n("el-input",{staticClass:"daySignin mar_b20",attrs:{placeholder:"第四天签到奖励",type:"number"},model:{value:e.integral,callback:function(n){t.$set(e,"integral",n)},expression:"item.integral"}},[n("template",{slot:"prepend"},[t._v("第四天")]),n("template",{slot:"append"},[t._v("积分")])],2),n("span",{staticClass:"mar_lr10"},[t._v("加")]),n("span",{staticClass:"time_item"},[n("el-input-number",{attrs:{"controls-position":"right",min:0,max:99999999},model:{value:e.growth,callback:function(n){t.$set(e,"growth",n)},expression:"item.growth"}}),n("span",{staticClass:"mar_l10"},[t._v("成长值")])],1)],1)})),t._l(t.form.fiveDay,(function(e,a){return n("div",{key:"5"},[n("el-input",{staticClass:"daySignin mar_b20",attrs:{placeholder:"第五天签到奖励",type:"number"},model:{value:e.integral,callback:function(n){t.$set(e,"integral",n)},expression:"item.integral"}},[n("template",{slot:"prepend"},[t._v("第五天")]),n("template",{slot:"append"},[t._v("积分")])],2),n("span",{staticClass:"mar_lr10"},[t._v("加")]),n("span",{staticClass:"time_item"},[n("el-input-number",{attrs:{"controls-position":"right",min:0,max:99999999},model:{value:e.growth,callback:function(n){t.$set(e,"growth",n)},expression:"item.growth"}}),n("span",{staticClass:"mar_l10"},[t._v("成长值")])],1)],1)})),t._l(t.form.sixDay,(function(e,a){return n("div",{key:"6"},[n("el-input",{staticClass:"daySignin mar_b20",attrs:{placeholder:"第六天签到奖励",type:"number"},model:{value:e.integral,callback:function(n){t.$set(e,"integral",n)},expression:"item.integral"}},[n("template",{slot:"prepend"},[t._v("第六天")]),n("template",{slot:"append"},[t._v("积分")])],2),n("span",{staticClass:"mar_lr10"},[t._v("加")]),n("span",{staticClass:"time_item"},[n("el-input-number",{attrs:{"controls-position":"right",min:0,max:99999999},model:{value:e.growth,callback:function(n){t.$set(e,"growth",n)},expression:"item.growth"}}),n("span",{staticClass:"mar_l10"},[t._v("成长值")])],1)],1)})),t._l(t.form.sevenDay,(function(e,a){return n("div",{key:"7"},[n("el-input",{staticClass:"daySignin",attrs:{placeholder:"第七天签到奖励",type:"number"},model:{value:e.integral,callback:function(n){t.$set(e,"integral",n)},expression:"item.integral"}},[n("template",{slot:"prepend"},[t._v("第七天")]),n("template",{slot:"append"},[t._v("积分")])],2),n("span",{staticClass:"mar_lr10"},[t._v("加")]),n("span",{staticClass:"time_item"},[n("el-input-number",{attrs:{"controls-position":"right",min:0,max:99999999},model:{value:e.growth,callback:function(n){t.$set(e,"growth",n)},expression:"item.growth"}}),n("span",{staticClass:"mar_l10"},[t._v("成长值")])],1)],1)}))],2)]),n("div",{staticClass:"shuju_title mar_b20"},[n("div",{staticClass:"shuju_title_text"},[n("span",[t._v("签到奖励")])])]),n("el-form-item",{attrs:{label:"连续签到",required:!0}},[n("div",{staticClass:"t_l numberip flex"},[n("div",[t._l(t.form.continuity,(function(e,a){return n("div",{key:a,staticClass:"mar_b10"},[t._v(" 每连续签到: "),n("el-input-number",{attrs:{"controls-position":"right",min:2,max:1e6},model:{value:e.days,callback:function(n){t.$set(e,"days",n)},expression:"item.days"}}),n("span",{staticClass:"mar_l10"},[t._v("天")]),n("span",{staticClass:"mar_l20"},[t._v("赠送积分:")]),n("el-input-number",{attrs:{"controls-position":"right",min:1,max:1e6},model:{value:e.integral,callback:function(n){t.$set(e,"integral",n)},expression:"item.integral"}}),n("span",{staticClass:"mar_l10"},[t._v("分")]),n("span",{staticClass:"mar_l20"},[t._v("赠送成长值:")]),n("el-input-number",{attrs:{"controls-position":"right",min:1,max:1e6},model:{value:e.growth,callback:function(n){t.$set(e,"growth",n)},expression:"item.growth"}}),n("span",{staticClass:"mar_l10"},[t._v("个")]),n("span",{staticClass:"mar_l20"},[t._v("赠送优惠券:")]),n("el-select",{staticClass:"givecoupon",attrs:{placeholder:"无"},model:{value:e.couponId,callback:function(n){t.$set(e,"couponId",n)},expression:"item.couponId"}},t._l(t.comgrouping,(function(t){return n("el-option",{key:t.id,attrs:{label:t.name,value:t.id}})})),1),n("el-input-number",{attrs:{"controls-position":"right",min:1,max:1e6},model:{value:e.num,callback:function(n){t.$set(e,"num",n)},expression:"item.num"}}),n("span",{staticClass:"mar_l10"},[t._v("张")]),n("el-button",{staticClass:"mar_l20",attrs:{size:"mini",type:"text"},on:{click:function(e){return t.delSpecMethod(a)}}},[t._v("删除")])],1)})),n("p",{directives:[{name:"show",rawName:"v-show",value:t.form.continuity.length>0,expression:"form.continuity.length>0"}],staticClass:"yb_margin lh16"},[t._v("注意:请确保优惠券库存充足,若优惠券无库存时,则用户无法获取优惠券奖励")]),n("div",{directives:[{name:"show",rawName:"v-show",value:this.form.continuity.length<10,expression:"this.form.continuity.length<10"}],staticClass:"addgoods textbutton"},[n("i",{staticClass:"el-icon-plus"}),n("el-button",{attrs:{type:"text"},on:{click:t.addSpecMethod}},[t._v("添加连续签到")]),n("span",{staticClass:"yb_margin lh16 mar_l10"},[t._v("最多可添加10条")])],1)],2)])])],1)],1)]),n("div",{directives:[{name:"show",rawName:"v-show",value:"1"==t.open,expression:"open=='1'"}],staticClass:"mar_t20 ba_f pad_20 t_c"},[n("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("立即创建")])],1),n("attachment-img",{ref:"img1",attrs:{type:"img"},on:{attachment:t.imgadd1}})],1)},i=[function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{},[n("div",{staticClass:"wei fon_14"},[t._v("签到")]),n("div",{staticClass:"mar_t10"},[t._v("签到可领积分,并可额外赠送优惠券,留存客户")])])}],r=(n("c975"),n("a434"),n("96cf"),n("1da1")),s=n("c24f"),o=n("294d"),l=n("fc6e"),c={created:function(){this.bus.$emit("loading",!0),this.init(),this.getSelectCoupon()},components:{attachmentImg:l["a"]},data:function(){return{form:{name:"",introduce:"",icon:"",oneDay:[{integral:"1",growth:"1"}],twoDay:[{integral:"2",growth:"2"}],threeDay:[{integral:"3",growth:"3"}],fourDay:[{integral:"4",growth:"4"}],fiveDay:[{integral:"5",growth:"5"}],sixDay:[{integral:"6",growth:"6"}],sevenDay:[{integral:"7",growth:"7"}],continuity:[{days:"",integral:"",growth:"",couponId:[],num:""}]},open:"1",comgrouping:[],value:"",timeData:[new Date,(new Date).setMonth((new Date).getMonth()+3)],collapseName:""}},methods:{getSelectCoupon:function(){var t=this;return Object(r["a"])(regeneratorRuntime.mark((function e(){var n,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(s["n"])();case 2:n=e.sent,a=n.data,t.comgrouping=a||[];case 5:case"end":return e.stop()}}),e)})))()},init:function(){var t=this;return Object(r["a"])(regeneratorRuntime.mark((function e(){var n,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,Object(o["o"])({ident:"signin"});case 2:n=e.sent,a=n.data,t.form2=t.form,t.open=a.open?a.open:"1",t.form=Object.assign(t.form2,a),t.bus.$emit("loading",!1);case 8:case"end":return e.stop()}}),e)})))()},enter:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.$refs["imgicon"+t].style.display="none"},leave:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.$refs["imgicon"+t].style.display="inline-block"},test:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;console.log(this.$refs,t),this.$refs["img"+t].dialogVisible=!0},imgadd1:function(t){this.form.icon=t.str},deleteMultiImage:function(t,e,n){if(Array.prototype.remove=function(t){var e=this.indexOf(t);e>-1&&this.splice(e,1)},"multigraph"==n)switch(e){case 2:this.form2.environment.remove(t);break}else switch(e){case 1:this.form.icon="";break}},addSpecMethod:function(){var t={days:"",integral:"",growth:"",couponId:[],num:""};this.$set(this.form.continuity,this.form.continuity.length,t)},delSpecMethod:function(t){this.$delete(this.form.continuity,t)},submitForm:function(){var t=this;this.$refs["form"].validate(function(){var e=Object(r["a"])(regeneratorRuntime.mark((function e(n){var a,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(!n){e.next=12;break}return t.form.ident="signin",t.form.identName="签到规则",t.form.open=t.open,e.next=6,Object(o["S"])(t.form);case 6:a=e.sent,i=a.msg,t.$baseMessage(i,"success"),t.init(),e.next=13;break;case 12:return e.abrupt("return",!1);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())},switchSign:function(){var t=this;return Object(r["a"])(regeneratorRuntime.mark((function e(){var n,a;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t.form.ident="signin",t.form.identName="签到规则",t.form.open=t.open,e.next=5,Object(o["S"])(t.form);case 5:n=e.sent,a=n.msg,t.$baseMessage(a,"success"),t.init();case 9:case"end":return e.stop()}}),e)})))()}}},u=c,m=(n("8d56"),n("2877")),d=Object(m["a"])(u,a,i,!1,null,null,null);e["default"]=d.exports},"8d56":function(t,e,n){"use strict";var a=n("dfbd"),i=n.n(a);i.a},a434:function(t,e,n){"use strict";var a=n("23e7"),i=n("23cb"),r=n("a691"),s=n("50c4"),o=n("7b0b"),l=n("65f0"),c=n("8418"),u=n("1dde"),m=n("ae40"),d=u("splice"),p=m("splice",{ACCESSORS:!0,0:0,1:2}),g=Math.max,f=Math.min,h=9007199254740991,v="Maximum allowed length exceeded";a({target:"Array",proto:!0,forced:!d||!p},{splice:function(t,e){var n,a,u,m,d,p,b=o(this),_=s(b.length),y=i(t,_),x=arguments.length;if(0===x?n=a=0:1===x?(n=0,a=_-y):(n=x-2,a=f(g(r(e),0),_-y)),_+n-a>h)throw TypeError(v);for(u=l(b,a),m=0;m<a;m++)d=y+m,d in b&&c(u,m,b[d]);if(u.length=a,n<a){for(m=y;m<_-a;m++)d=m+a,p=m+n,d in b?b[p]=b[d]:delete b[p];for(m=_;m>_-a+n;m--)delete b[m-1]}else if(n>a)for(m=_-a;m>y;m--)d=m+a-1,p=m+n-1,d in b?b[p]=b[d]:delete b[p];for(m=0;m<n;m++)b[m+y]=arguments[m+2];return b.length=_-a+n,u}})},c24f:function(t,e,n){"use strict";n.d(e,"k",(function(){return i})),n.d(e,"E",(function(){return r})),n.d(e,"C",(function(){return s})),n.d(e,"d",(function(){return o})),n.d(e,"b",(function(){return l})),n.d(e,"s",(function(){return c})),n.d(e,"c",(function(){return u})),n.d(e,"j",(function(){return m})),n.d(e,"q",(function(){return d})),n.d(e,"i",(function(){return p})),n.d(e,"r",(function(){return g})),n.d(e,"f",(function(){return f})),n.d(e,"x",(function(){return h})),n.d(e,"h",(function(){return v})),n.d(e,"n",(function(){return b})),n.d(e,"u",(function(){return _})),n.d(e,"g",(function(){return y})),n.d(e,"l",(function(){return x})),n.d(e,"t",(function(){return w})),n.d(e,"A",(function(){return C})),n.d(e,"z",(function(){return k})),n.d(e,"w",(function(){return $})),n.d(e,"p",(function(){return j})),n.d(e,"m",(function(){return O})),n.d(e,"y",(function(){return S})),n.d(e,"a",(function(){return L})),n.d(e,"o",(function(){return I})),n.d(e,"B",(function(){return A})),n.d(e,"e",(function(){return D})),n.d(e,"F",(function(){return z})),n.d(e,"D",(function(){return M})),n.d(e,"v",(function(){return E}));var a=n("b775");function i(t){return Object(a["a"])({url:"channel/member/get-member-list",method:"get",params:t})}function r(t){return Object(a["a"])({url:"channel/member/get-member-list",method:"post",data:t})}function s(t){return Object(a["a"])({url:"channel/activity/select-user",method:"post",data:t})}function o(t){return Object(a["a"])({url:"channel/member/change-status",method:"post",data:t})}function l(t){return Object(a["a"])({url:"channel/member/change-info",method:"post",data:t})}function c(t){return Object(a["a"])({url:"channel/member/member-label-save",method:"post",data:t})}function u(t){return Object(a["a"])({url:"channel/member/change-member-label",method:"post",data:t})}function m(t){return Object(a["a"])({url:"channel/member/get-member-label",method:"get",params:t})}function d(t){return Object(a["a"])({url:"channel/member/member-excel-list",method:"get",params:t})}function p(t){return Object(a["a"])({url:"channel/member/get-member-info",method:"post",data:t})}function g(t){return Object(a["a"])({url:"channel/member/member-info-save",method:"post",data:t})}function f(t){return Object(a["a"])({url:"channel/member/get-deposit-list",method:"get",params:t})}function h(t){return Object(a["a"])({url:"channel/member/deposit-save",method:"post",data:t})}function v(t){return Object(a["a"])({url:"channel/member/deposit-save",method:"get",params:t})}function b(t){return Object(a["a"])({url:"channel/activity/select-coupon",method:"get",params:t})}function _(t){return Object(a["a"])({url:"channel/member/modify-deposit",method:"post",data:t})}function y(t){return Object(a["a"])({url:"channel/member/get-deposit-order",method:"get",params:t})}function x(t){return Object(a["a"])({url:"channel/member/get-member-set-info",method:"get",params:t})}function w(t){return Object(a["a"])({url:"channel/member/member-set",method:"post",data:t})}function C(t){return Object(a["a"])({url:"channel/vip-card/rights-list",method:"get",params:t})}function k(t){return Object(a["a"])({url:"channel/vip-card/save-rights",method:"post",data:t})}function $(t){return Object(a["a"])({url:"channel/vip-card/modify-rights",method:"post",data:t})}function j(t){return Object(a["a"])({url:"channel/vip-card/level-list",method:"get",params:t})}function O(t){return Object(a["a"])({url:"channel/vip-card/save-level",method:"get",params:t})}function S(t){return Object(a["a"])({url:"channel/vip-card/save-level",method:"post",data:t})}function L(t){return Object(a["a"])({url:"channel/vip-card/card-record",method:"get",params:t})}function I(t){return Object(a["a"])({url:"channel/good/goods-vip",method:"get",params:t})}function A(t){return Object(a["a"])({url:"channel/good/save-goods-vip",method:"post",data:t})}function D(t){return Object(a["a"])({url:"channel/member/get-coupon-list",method:"get",params:t})}function z(t){return Object(a["a"])({url:"channel/member/store-coupon-list",method:"get",params:t})}function M(t){return Object(a["a"])({url:"channel/member/send-coupon",method:"post",data:t})}function E(t){return Object(a["a"])({url:"channel/vip-card/modify-level",method:"post",data:t})}},c8f1:function(t,e,n){},dad0:function(t,e,n){"use strict";var a=n("c8f1"),i=n.n(a);i.a},dfbd:function(t,e,n){},fc6e:function(t,e,n){"use strict";var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("el-dialog",{staticClass:"attachmentImg",attrs:{title:"选择图片",visible:t.dialogVisible,"close-on-click-modal":!1,width:"55%"},on:{"update:visible":function(e){t.dialogVisible=e},close:t.modalClose,opened:t.dialogOpened}},[n("div",{staticClass:"attachment_img_box",attrs:{flex:"box:first"}},[n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.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"==t.allindex},staticStyle:{"text-align":"center"},attrs:{index:"all"},on:{click:function(e){return t.selected(0)}}},[n("span",[t._v("全部")])]),t._l(t.groupItem,(function(e){return[n("el-menu-item",{key:e.id,attrs:{index:e.id},on:{click:function(n){return t.selected(e.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 t.deleteType(e.id)}}}),n("div",{staticStyle:{overflow:"hidden","text-overflow":"ellipsis",width:"100%"}},[n("span",[t._v(t._s(e.name))])])])])]}))],2)]),n("el-popover",{attrs:{placement:"top",width:"160"},model:{value:t.visible,callback:function(e){t.visible=e},expression:"visible"}},[n("el-input",{attrs:{placeholder:"请输入分组名称",size:"mini"},model:{value:t.new_type_name,callback:function(e){t.new_type_name=e},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(e){t.visible=!1}}},[t._v("取消")]),n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.addNewAttType}},[t._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"}),t._v(" 新建分组 ")])],1)],1)],1),n("div",{directives:[{name:"loading",rawName:"v-loading",value:t.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(e){return t.search(t.atta_name)}},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.search(t.atta_name)}},model:{value:t.atta_name,callback:function(e){t.atta_name=e},expression:"atta_name"}}),n("div",{staticStyle:{float:"right",padding:"0 10px 0 0"}},[n("el-upload",{staticClass:"upload-demo",attrs:{action:t.UploadUrl(),multiple:!0,limit:50,"on-exceed":t.handleExceed,"file-list":t.fileList,"on-success":t.handleSuccess,"on-error":t.handleError,"before-upload":t.beforeUpload,data:t.uploadData,"on-progress":t.handProgress}},[n("el-button",{attrs:{size:"small",type:"primary"}},[n("i",{staticClass:"el-icon-plus avatar-uploader-icon"}),t._v(" 上传图片 ")])],1)],1)],1),n("el-scrollbar",{staticClass:"scrollbar",staticStyle:{height:"460px"}},[n("div",{staticClass:"app-attachment-list"},[t._l(t.attachments,(function(e,a){return[n("el-tooltip",{key:e.id,staticClass:"item",attrs:{effect:"dark",content:e.name,placement:"top","open-delay":1}},[n("div",{staticClass:"app-attachment-item",on:{click:function(n){return t.selectedItem(a,e.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:e.url,fit:"cover"}}),n("div",{staticClass:"mask",style:t.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"},[t._v(t._s(e.name))]),n("i",{staticClass:"el-icon-error delete",on:{click:function(n){return t.deleteItem(e.id)}}})])])])]}))],2)]),n("div",{staticStyle:{padding:"5px","text-align":"right","margin-top":"auto"}},[n("el-pagination",{attrs:{background:"",layout:"prev, pager, next",total:t.total,"page-size":t.pagesize},on:{"current-change":t.current_change}})],1)],1)]),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{size:"small"},on:{click:function(e){t.dialogVisible=!1}}},[t._v("取 消")]),n("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t.selectedItems()}}},[t._v("确 定")])],1)])},i=[],r=(n("99af"),n("365c")),s={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(t){var e=this,n=e.currentPage,a=e.selectedArr["img"==e.type?"danxuan":"item"+t+n];return a&&a.page==n&&a.index==t?"display:block":""},modalClose:function(){var t=this;t.selectedArr={}},dialogOpened:function(){this.getgroupItem(),this.getAttachment_List()},handProgress:function(){var t=this;t.rightLoading=!0},getgroupItem:function(){var t=this;this.$api.get("common/file/get-category",{storeId:this.type2},(function(e){1==e.code?(t.groupItem=e.data,t.groupListLoading=!1,t.visible=!1):t.groupListLoading=!1}))},getAttachment_List:function(){var t=this;t.rightLoading=!0,this.$api.get("common/file/get-picture",{page:t.currentPage,category:t.category,keywords:t.keywords,storeId:this.type2},(function(e){1==e.code?(t.attachments=e.data,t.total=e.count,t.rightLoading=!1):t.rightLoading=!1}))},addNewAttType:function(){var t=this;t.groupListLoading=!0,this.$api.post("common/file/save-category",{storeId:this.type2,name:t.new_type_name},(function(e){1==e.code?(t.visible=!1,t.$message({message:e.msg,type:"success",duration:500,onClose:function(){t.new_type_name="",t.getgroupItem()}})):(t.visible=!1,t.$message.error(e.msg))}))},deleteType:function(t){var e=this;e.groupListLoading=!0,this.$api.post("common/file/del-picture-category",{id:t},(function(t){1==t.code?(e.visible=!1,e.$message({message:t.msg,type:"success",duration:500,onClose:function(){e.getgroupItem()}})):(e.$message.error(t.msg),e.groupListLoading=!1)}))},search:function(t){var e=this;console.log(t),this.keywords=t,e.getAttachment_List()},current_change:function(t){var e=this;e.currentPage=t,e.getAttachment_List()},deleteItem:function(t){var e=this;e.rightLoading=!0,this.$api.post("common/file/del-picture",{id:t},(function(t){1==t.code?(e.visible=!1,e.$message({message:t.msg,type:"success",duration:500,onClose:function(){e.getAttachment_List()}})):(e.$message.error(t.msg),e.groupListLoading=!1)}))},UploadUrl:function(){var t=r["a"].backendPath;return t+"common/file/get-category"},beforeUpload:function(t){console.log("上传前判断",t);var e="image/jpg"===t.type||"image/jpeg"===t.type||"image/png"===t.type||"image/gif"===t.type,n=t.size/1024/1024<2;return e?n?void 0:(this.$message.error("文件大小不能超过 2MB!"),!1):(this.$message.error("上传图片只支持jpg、jpeg、png格式!"),!1)},handleError:function(t){this.$message({message:"上传失败",duration:2e3,type:"warning"})},handleSuccess:function(t,e,n){console.log("345",n),this.file=e,this.addAttachment()},handleExceed:function(t,e){this.$message.warning("当前限制选择 50 个文件,本次选择了 ".concat(t.length," 个文件,共选择了 ").concat(t.length+e.length," 个文件"))},addAttachment:function(){var t=this,e=new FormData;e.append("file",this.file.raw),e.append("category",this.category),e.append("storeId",this.type2),this.$api.post("common/file/upload",e,(function(e){1==e.code?(t.getAttachment_List(),t.$message.success("上传成功")):(t.$message.error(e.msg),console.log(e.msg))}))},selected:function(t){var e=this;e.rightLoading=!0,e.currentPage=1,e.category=t,e.allindex="otherList",e.getAttachment_List()},selectedItem:function(t,e){var n=this,a="img"==n.type,i=a?"danxuan":"item"+t+n.currentPage,r=n.selectedArr[i];r&&r.index==t?n.$delete(n.selectedArr,i):(a&&n.$delete(n.selectedArr,i),n.$set(n.selectedArr,i,{page:n.currentPage,index:t,url:e}))},selectedItems:function(){var t=this;t=this;var e=t.selectedArr,n="",a=[];for(var i in e)n+=n?","+e[i].url:e[i].url,a.push(e[i].url);t.$emit("attachment",{str:n,arr:a}),t.dialogVisible=!1}}},o=s,l=(n("dad0"),n("2877")),c=Object(l["a"])(o,a,i,!1,null,null,null);e["a"]=c.exports}}]); |