优惠券 PC管理端 项目

30.39a8ec0b.js 14KB

1
  1. "use strict";(self["webpackChunkcoupon"]=self["webpackChunkcoupon"]||[]).push([[30],{3218:function(e,a,l){l.d(a,{Z:function(){return r}});var o=l(1423),t=l(6573);function r(){const e=()=>new Promise((async(e,a)=>{try{const l=await o.Z.post(t.W.login_verifyToken,{});0==l?.code?e(l?.data?.msg||"验证成功"):a("请重新登录")}catch(l){a(l)}}));return{getIsLogin:e}}},9383:function(e,a,l){l.r(a),l.d(a,{default:function(){return Y}});var o=l(212),t=(l(3163),l(6355)),r=(l(3069),l(8061)),i=(l(6905),l(5791)),n=(l(6809),l(9007),l(3396)),s=l(4870),c=l(7139),u=l(2710),d=(l(9910),l(573)),p=(l(3877),l(7960),l(9866)),g=(l(172),l(6629)),m=(l(7228),l(1423)),v=l(6573),b=l(43);const f=e=>((0,n.dD)("data-v-0061b272"),e=e(),(0,n.Cn)(),e),y={class:"header"},w={class:"title"},_={class:"content"},h={class:"form-item"},k=f((()=>(0,n._)("div",{class:"item-label"},[(0,n._)("i",{class:"required"}),(0,n._)("span",{class:"label-text"},"分组名称")],-1))),S={class:"form-item"},U=f((()=>(0,n._)("div",{class:"item-label"},[(0,n._)("i",{class:"required"}),(0,n._)("span",{class:"label-text"},"负责人")],-1))),I={class:"form-item"},V=f((()=>(0,n._)("div",{class:"item-label"},[(0,n._)("i",{class:"required"}),(0,n._)("span",{class:"label-text"},"推广位ID")],-1)));var x=(0,n.aZ)({__name:"groupDialog",props:{dialogVisible:{type:Boolean,default:()=>!1},groupInfo:{type:Object,default:()=>({})}},emits:["confirm","cancel"],setup(e,{emit:a}){const l=e,t=(0,b.w)(),r=(0,n.Fl)((()=>!!l.groupInfo?.id)),i=(0,n.Fl)((()=>""+(r.value?"编辑分组":"添加分组"))),f=(0,s.iH)(!1),x=(0,s.iH)([]),z=(0,s.qj)({groupName:"",user:"",pids:[]});(0,n.YP)((()=>l.dialogVisible),(e=>{e&&(B(),W())}));const B=()=>{if(r.value){const{groupName:e,groupManager:a,id:o}=l.groupInfo;z.groupName=e??"",z.user=a??"",z.pids=[],o&&N(o)}else z.groupName="",z.user="",z.pids=[]},N=async e=>{try{f.value=!0;const a=v.W.promoteGroup_listPidByGroup,l={groupId:e},{code:o,data:t,msg:r}=await m.Z.get(a,l);0===o&&Array.isArray(t)?z.pids=t.map((e=>e.pid)):(z.pids=[],g.z8.error(r||"操作失败"))}catch(a){}finally{f.value=!1}},W=async()=>{try{const e={accountId:t.globalTbAccountId},{code:a,data:l,msg:o}=await m.Z.get(v.W.promoteManage_listAllPid,e);0===a&&Array.isArray(l)?x.value=l:(x.value=[],g.z8.error(o||"操作失败"))}catch(e){}},C=e=>{Array.isArray(e)?z.pids=e:z.pids=[]},A=()=>{a("cancel")},Z=async()=>{try{await $(),await D(),a("confirm",{isEdit:r.value})}catch(e){}},$=()=>new Promise(((e,a)=>{const{groupName:l,user:o,pids:t}=z;""===l?(g.z8.warning("请输入分组名称"),a("校验未通过")):""===o?(g.z8.warning("请输入负责人"),a("校验未通过")):t&&t.length?e("校验通过"):(g.z8.warning("请选择推广位ID"),a("校验未通过"))})),D=async()=>{try{f.value=!0;let e=v.W.promoteGroup_addGroup;const a={groupName:z.groupName,pids:Array.isArray(z.pids)?z.pids:[],user:z.user};r.value&&(e=v.W.promoteGroup_updateGroup,a.groupId=l.groupInfo.id);const{code:o,data:t,msg:i}=await m.Z.post(e,a);return 0===o?(g.z8.success(i||"操作成功"),Promise.resolve()):(g.z8.error(i||"操作失败"),Promise.reject(i||"操作失败"))}catch(e){return Promise.reject(e)}finally{f.value=!1}};return(e,a)=>{const t=p.EZ,r=d.BT,g=d.km,m=u.d0,v=o.t;return(0,n.wg)(),(0,n.iD)("div",null,[(0,n.Wm)(m,{"model-value":l.dialogVisible,"before-close":A,"show-close":!0,width:"573px"},{default:(0,n.w5)((()=>[(0,n._)("div",y,[(0,n._)("span",w,(0,c.zw)((0,s.SU)(i)),1)]),(0,n.wy)(((0,n.wg)(),(0,n.iD)("div",null,[(0,n._)("div",_,[(0,n._)("div",h,[k,(0,n.Wm)(t,{modelValue:z.groupName,"onUpdate:modelValue":a[0]||(a[0]=e=>z.groupName=e),modelModifiers:{trim:!0},placeholder:"请输入分组名称"},null,8,["modelValue"])]),(0,n._)("div",S,[U,(0,n.Wm)(t,{modelValue:z.user,"onUpdate:modelValue":a[1]||(a[1]=e=>z.user=e),modelModifiers:{trim:!0},placeholder:"请输入负责人"},null,8,["modelValue"])]),(0,n._)("div",I,[V,(0,n.Wm)(g,{modelValue:z.pids,"onUpdate:modelValue":a[2]||(a[2]=e=>z.pids=e),multiple:"",filterable:"",placeholder:"请选择推广位ID",clearable:"",onChange:C},{default:(0,n.w5)((()=>[((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(x.value,((e,a)=>((0,n.wg)(),(0,n.j4)(r,{key:a,label:`${e.pidName}(${e.pid})`,value:e.pid},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])]),(0,n._)("div",{class:"footer"},[(0,n._)("div",{class:"btn",onClick:A},"取消"),(0,n._)("div",{class:"btn btn-confirm ml-14",onClick:Z},"确定")])])),[[v,f.value]])])),_:1},8,["model-value"])])}}}),z=l(89);const B=(0,z.Z)(x,[["__scopeId","data-v-0061b272"]]);var N=B,W=l(864);const C={class:"header"},A={class:"title"},Z={class:"content"};var $=(0,n.aZ)({__name:"pidListDialog",props:{dialogVisible:{type:Boolean,default:()=>!1},groupId:{type:[String,Number],default:()=>""}},emits:["close"],setup(e,{emit:a}){const l=e,t=(0,n.Fl)((()=>"")),i=(0,s.iH)(!1),d=(0,s.qj)({groupId:""}),p=(0,s.iH)([]);(0,n.YP)((()=>l.dialogVisible),(e=>{e&&(b(),f())}));const b=()=>{p.value=[],d.groupId=l.groupId},f=async()=>{try{i.value=!0;const e=v.W.promoteGroup_listPidByGroup,a={groupId:d.groupId},{code:l,data:o,msg:t}=await m.Z.get(e,a);0===l&&Array.isArray(o)?p.value=o:(p.value=[],g.z8.error(t||"操作失败"))}catch(e){}finally{i.value=!1}},y=()=>{a("close")};return(e,a)=>{const d=r.$Y,g=r.eI,m=u.d0,v=o.t;return(0,n.wg)(),(0,n.iD)("div",null,[(0,n.Wm)(m,{"model-value":l.dialogVisible,"before-close":y,"show-close":!0,width:"573px","close-on-click-modal":!1},{default:(0,n.w5)((()=>[(0,n._)("div",C,[(0,n._)("span",A,(0,c.zw)((0,s.SU)(t)),1)]),(0,n.wy)(((0,n.wg)(),(0,n.iD)("div",null,[(0,n._)("div",Z,[(0,n.Wm)(g,{data:p.value,"max-height":450,"header-cell-style":(0,s.SU)(W.gw),"cell-style":(0,s.SU)(W.HE),"row-style":(0,s.SU)(W.T)},{default:(0,n.w5)((()=>[(0,n.Wm)(d,{prop:"pidName",label:"推广位名称",align:"center"}),(0,n.Wm)(d,{prop:"pid",label:"推广位ID",align:"center"})])),_:1},8,["data","header-cell-style","cell-style","row-style"])])])),[[v,i.value]])])),_:1},8,["model-value"])])}}});const D=(0,z.Z)($,[["__scopeId","data-v-48f03612"]]);var H=D,j=l(3218);const P={class:"page-wrap"},G={class:"content-wrap"},q={class:"pid-count"},E=["onClick"],F=(0,n.Uk)("编辑"),T={class:"pagination-wrap"};var L=(0,n.aZ)({__name:"index",setup(e){const a=(0,s.qj)({page:1,pageSize:20}),l=(0,s.qj)({list:[],totalNum:0,loading:!1,height:300}),u=(0,s.iH)(null),d=()=>{l.height=document.documentElement.clientHeight-160},p=async()=>{try{l.loading=!0;const e={page:a.page,pageSize:a.pageSize},{code:o,data:t,msg:r}=await m.Z.get(v.W.promoteGroup_listGroup,e);0===o&&t?(l.list=Array.isArray(t.data)?t.data:[],l.totalNum=t.pageInfo?.totalNum||0,u.value.setScrollTop(0)):(l.list=[],l.totalNum=0,g.z8.error(r||"操作失败"))}catch(e){}finally{l.loading=!1}},b=e=>{a.page=e,p()},f=(0,s.iH)(!1),y=(0,s.iH)(""),w=e=>{y.value=e.id,f.value=!0},_=()=>{y.value="",f.value=!1},h=(0,s.iH)(!1),k=(0,s.iH)({}),S=()=>{k.value={},h.value=!0},U=e=>{k.value={...e},h.value=!0},I=({isEdit:e})=>{h.value=!1,e||(a.page=1),p()},V=()=>{h.value=!1},{getIsLogin:x}=(0,j.Z)();return(0,n.bv)((async()=>{try{await x(),p(),d()}catch(e){}})),(e,d)=>{const p=r.$Y,g=i.mi,m=r.eI,v=t.R,x=o.t;return(0,n.wy)(((0,n.wg)(),(0,n.iD)("div",P,[(0,n._)("div",{class:"header-wrap"},[(0,n._)("div",{class:"btn",onClick:S},"添加分组")]),(0,n._)("div",G,[(0,n.Wm)(m,{ref_key:"$tableEl",ref:u,data:l.list,"max-height":l.height,"header-cell-style":(0,s.SU)(W.gw),"cell-style":(0,s.SU)(W.HE),"row-style":(0,s.SU)(W.T)},{default:(0,n.w5)((()=>[(0,n.Wm)(p,{prop:"groupName",label:"分组名称",align:"center"}),(0,n.Wm)(p,{prop:"groupManager",label:"负责人",align:"center"}),(0,n.Wm)(p,{label:"推广位数量",align:"center"},{default:(0,n.w5)((({row:e})=>[(0,n._)("span",q,[(0,n.Uk)((0,c.zw)(e.pidCount),1),(0,n._)("span",{onClick:a=>w(e)},"查看",8,E)])])),_:1}),(0,n.Wm)(p,{label:"操作",width:"120",fixed:"right",align:"center"},{default:(0,n.w5)((({row:e})=>[(0,n.Wm)(g,{link:"",type:"primary",onClick:a=>U(e)},{default:(0,n.w5)((()=>[F])),_:2},1032,["onClick"])])),_:1})])),_:1},8,["data","max-height","header-cell-style","cell-style","row-style"])]),(0,n._)("div",T,[(0,n.Wm)(v,{"hide-on-single-page":"",background:"",layout:"prev, pager, next",total:l.totalNum,currentPage:a.page,"onUpdate:currentPage":d[0]||(d[0]=e=>a.page=e),"page-size":a.pageSize,"onUpdate:page-size":d[1]||(d[1]=e=>a.pageSize=e),onCurrentChange:b},null,8,["total","currentPage","page-size"])]),(0,n.Wm)(N,{dialogVisible:h.value,groupInfo:k.value,onConfirm:I,onCancel:V},null,8,["dialogVisible","groupInfo"]),(0,n.Wm)(H,{dialogVisible:f.value,groupId:y.value,onClose:_},null,8,["dialogVisible","groupId"])])),[[x,l.loading]])}}});const M=(0,z.Z)(L,[["__scopeId","data-v-567ac5f5"]]);var Y=M},5791:function(e,a,l){l.d(a,{mi:function(){return x}});var o=l(3396),t=l(4870),r=l(7139),i=l(1015),n=l(8953),s=l(9414),c=l(6174),u=l(6734);function d(e,a=20){return e.mix("#141414",a).toString()}function p(e){const a=(0,c.B4)(),l=(0,u.s)("button");return(0,o.Fl)((()=>{let o={};const t=e.color;if(t){const r=new s.C(t),i=e.dark?r.tint(20).toString():d(r,20);if(e.plain)o=l.cssVarBlock({"bg-color":e.dark?d(r,90):r.tint(90).toString(),"text-color":t,"border-color":e.dark?d(r,50):r.tint(50).toString(),"hover-text-color":`var(${l.cssVarName("color-white")})`,"hover-bg-color":t,"hover-border-color":t,"active-bg-color":i,"active-text-color":`var(${l.cssVarName("color-white")})`,"active-border-color":i}),a.value&&(o[l.cssVarBlockName("disabled-bg-color")]=e.dark?d(r,90):r.tint(90).toString(),o[l.cssVarBlockName("disabled-text-color")]=e.dark?d(r,50):r.tint(50).toString(),o[l.cssVarBlockName("disabled-border-color")]=e.dark?d(r,80):r.tint(80).toString());else{const n=e.dark?d(r,30):r.tint(30).toString(),s=r.isDark()?`var(${l.cssVarName("color-white")})`:`var(${l.cssVarName("color-black")})`;if(o=l.cssVarBlock({"bg-color":t,"text-color":s,"border-color":t,"hover-bg-color":n,"hover-text-color":s,"hover-border-color":n,"active-bg-color":i,"active-border-color":i}),a.value){const a=e.dark?d(r,50):r.tint(50).toString();o[l.cssVarBlockName("disabled-bg-color")]=a,o[l.cssVarBlockName("disabled-text-color")]=e.dark?"rgba(255, 255, 255, 0.5)":`var(${l.cssVarName("color-white")})`,o[l.cssVarBlockName("disabled-border-color")]=a}}}return o}))}var g=l(5989),m=l(7643);const v=Symbol("buttonGroupContextKey");var b=l(67),f=l(95);const y=["aria-disabled","disabled","autofocus","type"],w={name:"ElButton"},_=(0,o.aZ)({...w,props:n.lS,emits:n.et,setup(e,{expose:a,emit:l}){const n=e,s=(0,o.Rr)();(0,m.A)({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},(0,o.Fl)((()=>"text"===n.type)));const d=(0,o.f3)(v,void 0),g=(0,b.W)("button"),w=(0,u.s)("button"),{form:_}=(0,f.A)(),h=(0,c.tH)((0,o.Fl)((()=>null==d?void 0:d.size))),k=(0,c.B4)(),S=(0,t.iH)(),U=(0,o.Fl)((()=>n.type||(null==d?void 0:d.type)||"")),I=(0,o.Fl)((()=>{var e,a,l;return null!=(l=null!=(a=n.autoInsertSpace)?a:null==(e=g.value)?void 0:e.autoInsertSpace)&&l})),V=(0,o.Fl)((()=>{var e;const a=null==(e=s.default)?void 0:e.call(s);if(I.value&&1===(null==a?void 0:a.length)){const e=a[0];if((null==e?void 0:e.type)===o.xv){const a=e.children;return/^\p{Unified_Ideograph}{2}$/u.test(a.trim())}}return!1})),x=p(n),z=e=>{"reset"===n.nativeType&&(null==_||_.resetFields()),l("click",e)};return a({ref:S,size:h,type:U,disabled:k,shouldAddSpace:V}),(e,a)=>((0,o.wg)(),(0,o.iD)("button",{ref_key:"_ref",ref:S,class:(0,r.C_)([(0,t.SU)(w).b(),(0,t.SU)(w).m((0,t.SU)(U)),(0,t.SU)(w).m((0,t.SU)(h)),(0,t.SU)(w).is("disabled",(0,t.SU)(k)),(0,t.SU)(w).is("loading",e.loading),(0,t.SU)(w).is("plain",e.plain),(0,t.SU)(w).is("round",e.round),(0,t.SU)(w).is("circle",e.circle),(0,t.SU)(w).is("text",e.text),(0,t.SU)(w).is("link",e.link),(0,t.SU)(w).is("has-bg",e.bg)]),"aria-disabled":(0,t.SU)(k)||e.loading,disabled:(0,t.SU)(k)||e.loading,autofocus:e.autofocus,type:e.nativeType,style:(0,r.j5)((0,t.SU)(x)),onClick:z},[e.loading?((0,o.wg)(),(0,o.iD)(o.HY,{key:0},[e.$slots.loading?(0,o.WI)(e.$slots,"loading",{key:0}):((0,o.wg)(),(0,o.j4)((0,t.SU)(i.gn),{key:1,class:(0,r.C_)((0,t.SU)(w).is("loading"))},{default:(0,o.w5)((()=>[((0,o.wg)(),(0,o.j4)((0,o.LL)(e.loadingIcon)))])),_:1},8,["class"]))],64)):e.icon||e.$slots.icon?((0,o.wg)(),(0,o.j4)((0,t.SU)(i.gn),{key:1},{default:(0,o.w5)((()=>[e.icon?((0,o.wg)(),(0,o.j4)((0,o.LL)(e.icon),{key:0})):(0,o.WI)(e.$slots,"icon",{key:1})])),_:3})):(0,o.kq)("v-if",!0),e.$slots.default?((0,o.wg)(),(0,o.iD)("span",{key:2,class:(0,r.C_)({[(0,t.SU)(w).em("text","expand")]:(0,t.SU)(V)})},[(0,o.WI)(e.$slots,"default")],2)):(0,o.kq)("v-if",!0)],14,y))}});var h=(0,g.Z)(_,[["__file","/home/runner/work/element-plus/element-plus/packages/components/button/src/button.vue"]]);const k={size:n.lS.size,type:n.lS.type},S={name:"ElButtonGroup"},U=(0,o.aZ)({...S,props:k,setup(e){const a=e;(0,o.JJ)(v,(0,t.qj)({size:(0,t.Vh)(a,"size"),type:(0,t.Vh)(a,"type")}));const l=(0,u.s)("button");return(e,a)=>((0,o.wg)(),(0,o.iD)("div",{class:(0,r.C_)(`${(0,t.SU)(l).b("group")}`)},[(0,o.WI)(e.$slots,"default")],2))}});var I=(0,g.Z)(U,[["__file","/home/runner/work/element-plus/element-plus/packages/components/button/src/button-group.vue"]]),V=l(9015);const x=(0,V.nz)(h,{ButtonGroup:I});(0,V.dp)(I)},8953:function(e,a,l){l.d(a,{UH:function(){return n},et:function(){return u},lS:function(){return c}});var o=l(2748),t=l(5994),r=l(6174),i=l(2039);const n=["default","primary","success","warning","info","danger","text",""],s=["button","submit","reset"],c=(0,t.o8)({size:r.Pp,disabled:Boolean,type:{type:String,values:n,default:""},icon:{type:i.AA},nativeType:{type:String,values:s,default:"button"},loading:Boolean,loadingIcon:{type:i.AA,default:()=>o.gbz},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0}}),u={click:e=>e instanceof MouseEvent}},6809:function(e,a,l){l(1758)}}]);