优惠券 PC管理端 项目

151.139f7d31.js 11KB

1
  1. "use strict";(self["webpackChunkcoupon"]=self["webpackChunkcoupon"]||[]).push([[151],{2439:function(e,t,l){l.r(t),l.d(t,{default:function(){return R}});var a=l(212),o=(l(3163),l(5791)),n=(l(6809),l(3396)),i=l(7464),r=l(2563),c=(l(5885),l(7139)),s=(0,n.aZ)({__name:"_popconfirm",props:{popTxt:{default:"删除"},bthType:{default:"danger"}},emits:["confirm"],setup(e,{emit:t}){const l=()=>{t("confirm")};return(t,a)=>{const i=o.mi,s=r.i1;return(0,n.wg)(),(0,n.j4)(s,{title:""+("确定后,该项将被"+e.popTxt+",是否继续?"),onConfirm:l},{reference:(0,n.w5)((()=>[(0,n.Wm)(i,{link:"",type:e.bthType},{default:(0,n.w5)((()=>[(0,n.Uk)((0,c.zw)(e.popTxt),1)])),_:1},8,["type"])])),_:1},8,["title"])}}});const d=s;var u=d,p=l(2710),m=(l(9910),l(9866)),f=(l(172),l(4870)),g=l(6629),v=(l(7228),l(1423)),_=l(6573),y=l(573),w=(l(3877),l(7960),l(43));const I={class:"form-item"},b=(0,n._)("div",{class:"item-label"},[(0,n._)("i",{class:"required"}),(0,n._)("span",{class:"label-text"},"媒体ID")],-1),h={class:"form-item"},C=(0,n._)("div",{class:"item-label"},[(0,n._)("i",{class:"required"}),(0,n._)("span",{class:"label-text"},"推广位ID")],-1),k={class:"flex-row",style:{width:"100%"}};var x=(0,n.aZ)({__name:"mediaAndPromote",setup(e,{expose:t}){const l=(0,w.w)(),a=(0,f.iH)([]),o=(0,f.iH)([]),i=(0,f.qj)({siteId:"",pid:""}),r=e=>{i.siteId=e||"",o.value=[],i.pid="",i.siteId&&s()},c=async()=>{try{i.siteId="";const e={accountId:l.globalTbAccountId},{code:t,data:o,msg:n}=await v.Z.get(_.W.promoteManage_listSiteInfo,e);0===t&&Array.isArray(o)?a.value=o:(a.value=[],g.z8.error(n||"操作失败"))}catch(e){}},s=async()=>{try{const e={accountId:l.globalTbAccountId,siteId:i.siteId},{code:t,data:a,msg:n}=await v.Z.get(_.W.unbCgListPid,e);0==t?(o.value=[],o.value=a):g.z8.error(n||"操作失败")}catch(e){}},d=(e,t)=>{o.value=[],i.siteId=e,i.pid=t,e&&s()};return(0,n.bv)((()=>{c()})),t({form:i,updateFormVal:d}),(e,t)=>{const l=y.BT,c=y.km;return(0,n.wg)(),(0,n.iD)(n.HY,null,[(0,n._)("div",I,[b,(0,n.Wm)(c,{modelValue:i.siteId,"onUpdate:modelValue":t[0]||(t[0]=e=>i.siteId=e),placeholder:"请选择媒体ID",clearable:"",filterable:"",onChange:r,style:{width:"100%"}},{default:(0,n.w5)((()=>[((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(a.value,(e=>((0,n.wg)(),(0,n.j4)(l,{key:e.id,label:`${e.siteId}(${e.siteName})`,value:e.siteId},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])]),(0,n._)("div",h,[C,(0,n._)("div",k,[(0,n.Wm)(c,{modelValue:i.pid,"onUpdate:modelValue":t[1]||(t[1]=e=>i.pid=e),placeholder:"请选择推广位ID",filterable:"",clearable:"",style:{width:"100%"}},{default:(0,n.w5)((()=>[((0,n.wg)(!0),(0,n.iD)(n.HY,null,(0,n.Ko)(o.value,((e,t)=>((0,n.wg)(),(0,n.j4)(l,{key:t,label:`${e.pid_name}(${e.pid})`,value:e.pid},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])])],64)}}});const U=x;var S=U;const T=e=>((0,n.dD)("data-v-1a9153e2"),e=e(),(0,n.Cn)(),e),V={class:"header"},D={class:"title"},W={class:"content"},z={class:"form-item"},B=T((()=>(0,n._)("div",{class:"item-label"},[(0,n._)("i",{class:"required"}),(0,n._)("span",{class:"label-text"},"群名称")],-1))),j={class:"form-item"},Z=T((()=>(0,n._)("div",{class:"item-label"},[(0,n._)("span",{class:"label-text"},"负责人")],-1))),A={class:"form-item"},q=T((()=>(0,n._)("div",{class:"item-label"},[(0,n._)("i",{class:"required"}),(0,n._)("span",{class:"label-text"},"群ID")],-1)));var H=(0,n.aZ)({__name:"groupAddEditDialog",props:{dialogVisible:{type:Boolean,default:()=>!1},configInfo:{type:Object,default:()=>({})}},emits:["confirm","cancel"],setup(e,{emit:t}){const l=e,o=(0,n.Fl)((()=>""+(l.configInfo&&l.configInfo.id?"编辑群":"添加群"))),i=(0,f.iH)(!1),r=(0,f.iH)(),s=(0,f.qj)({groupName:"",inCharge:"",groupId:"",mediaId:""});(0,n.YP)((()=>l.dialogVisible),(e=>{e&&u()}));const d=e=>{e?(s.groupName=e.group_name,s.inCharge=e.group_manager,s.groupId=e.corp_group_id):(s.groupName="",s.inCharge="",s.groupId="")},u=async()=>{l.configInfo&&l.configInfo.id?(await d(l.configInfo),r.value?.updateFormVal(l.configInfo.site_id,l.configInfo.pid)):(await d(""),r.value?.updateFormVal("",""))},y=()=>{t("cancel")},w=async()=>{try{await I(),await b(),t("confirm")}catch(e){}},I=()=>new Promise(((e,t)=>{const{groupName:l,groupId:a}=s;""===l?(g.z8.warning("请输入群名称"),t("校验未通过")):""===a?(g.z8.warning("请选择群ID"),t("校验未通过")):""==r.value.form.siteId?(g.z8.warning("请选择媒体ID"),t("校验未通过")):""==r.value.form.pid?(g.z8.warning("请选择推广位ID"),t("校验未通过")):e("校验通过")})),b=async()=>{try{i.value=!0;let e=_.W.groupAdd;const t={group_name:s.groupName,corp_group_id:s.groupId,group_manager:s.inCharge,pid:r.value.form.pid,site_id:r.value.form.siteId};l.configInfo&&l.configInfo.id&&(e=_.W.groupEdit,t.id=l.configInfo.id);const{code:a,data:o,msg:n}=await v.Z.post(e,t);return 0==a?(g.z8.success(n||"操作成功"),Promise.resolve()):(g.z8.error(n||"操作失败"),Promise.reject(n||"操作失败"))}catch(e){return Promise.reject(e)}finally{i.value=!1}};return(e,t)=>{const d=m.EZ,u=p.d0,g=a.t;return(0,n.wg)(),(0,n.iD)("div",null,[(0,n.Wm)(u,{class:"dialogCommon","model-value":l.dialogVisible,"before-close":y,"show-close":!0,width:"573px","close-on-click-modal":!1},{default:(0,n.w5)((()=>[(0,n._)("div",V,[(0,n._)("span",D,(0,c.zw)((0,f.SU)(o)),1)]),(0,n.wy)(((0,n.wg)(),(0,n.iD)("div",null,[(0,n._)("div",W,[(0,n._)("div",z,[B,(0,n.Wm)(d,{modelValue:s.groupName,"onUpdate:modelValue":t[0]||(t[0]=e=>s.groupName=e),modelModifiers:{trim:!0},placeholder:"请输入群名称",clearable:""},null,8,["modelValue"])]),(0,n._)("div",j,[Z,(0,n.Wm)(d,{modelValue:s.inCharge,"onUpdate:modelValue":t[1]||(t[1]=e=>s.inCharge=e),modelModifiers:{trim:!0},placeholder:"请输入负责人",clearable:""},null,8,["modelValue"])]),(0,n._)("div",A,[q,(0,n.Wm)(d,{modelValue:s.groupId,"onUpdate:modelValue":t[2]||(t[2]=e=>s.groupId=e),modelModifiers:{trim:!0},placeholder:"请输入群ID",clearable:""},null,8,["modelValue"])]),(0,n.Wm)(S,{ref_key:"MediaAndPromoteRef",ref:r},null,512)]),(0,n._)("div",{class:"footer"},[(0,n._)("div",{class:"btn",onClick:y},"取消"),(0,n._)("div",{class:"btn btn-confirm ml-14",onClick:w},"确定")])])),[[g,i.value]])])),_:1},8,["model-value"])])}}}),N=l(89);const F=(0,N.Z)(H,[["__scopeId","data-v-1a9153e2"]]);var L=F;const P={class:"pageContent"},$={class:"text-center"},M=(0,n.Uk)("编辑");var Y=(0,n.aZ)({__name:"index",setup(e){const t=(0,f.qj)({tableList:[],descol:[{name:"群名称",column:"group_name"},{name:"负责人",column:"group_manager"},{name:"群ID",column:"id"},{name:"推广位ID",column:"pid",minWidth:"150px"},{name:"操作",column:"operate",slotFlag:!0}],page:1,pageSize:20,loading:!1,configInfo:{}}),l=async()=>{try{t.loading=!0;const e={page:t.page,pageSize:t.pageSize},{code:l,data:a,msg:o}=await v.Z.get(_.W.groupList,e);0==l&&a?t.tableList=a.data:g.z8.error(o||"操作失败")}catch(e){}finally{t.loading=!1}},r=async e=>{try{const l={id:e.id},{code:a,data:o,msg:n}=await v.Z.post(_.W.groupDel,l);if(0==a&&o){let l=t.tableList.findIndex((t=>t.id==e.id));l>=0&&t.tableList.splice(l,1)}else g.z8.error(n||"操作失败")}catch(l){}},c=(0,f.iH)(!1),s=()=>{l(),c.value=!1},d=()=>{c.value=!1},p=e=>{t.configInfo=e},m=async e=>{await p(e||{}),c.value=!0};return(0,n.bv)((()=>{(0,n.Y3)((()=>{l()}))})),(e,p)=>{const f=o.mi,g=a.t;return(0,n.wy)(((0,n.wg)(),(0,n.iD)("div",P,[(0,n._)("div",{class:"addBtn",onClick:m},"添加群"),(0,n.Wm)(i.Z,{ref:"TableRef",tableData:t.tableList,descol:t.descol,total:t.tableList.length,onInit:l},{operate:(0,n.w5)((e=>[(0,n._)("div",$,[(0,n.Wm)(f,{link:"",type:"primary",onClick:t=>m(e.row)},{default:(0,n.w5)((()=>[M])),_:2},1032,["onClick"]),(0,n.Wm)(u,{onConfirm:t=>r(e.row)},null,8,["onConfirm"])])])),_:1},8,["tableData","descol","total"]),(0,n.Wm)(L,{dialogVisible:c.value,configInfo:t.configInfo,onConfirm:s,onCancel:d},null,8,["dialogVisible","configInfo"])])),[[g,t.loading]])}}});const E=Y;var R=E},8474:function(e,t,l){l(1758)},2563:function(e,t,l){l.d(t,{i1:function(){return C}});var a=l(3396),o=l(4870),n=l(7139),i=l(5791),r=l(1015),c=l(4738),s=l(2748),d=l(5994),u=l(8953),p=l(2039),m=l(6954);const f=(0,d.o8)({title:String,confirmButtonText:String,cancelButtonText:String,confirmButtonType:{type:String,values:u.UH,default:"primary"},cancelButtonType:{type:String,values:u.UH,default:"text"},icon:{type:p.AA,default:()=>s.Ruj},iconColor:{type:String,default:"#f90"},hideIcon:{type:Boolean,default:!1},hideAfter:{type:Number,default:200},onConfirm:{type:(0,d.Cq)(Function)},onCancel:{type:(0,d.Cq)(Function)},teleported:m.sp.teleported,persistent:m.sp.persistent,width:{type:[String,Number],default:150}});var g=l(5989),v=l(3257),_=l(6734),y=l(529);const w={name:"ElPopconfirm"},I=(0,a.aZ)({...w,props:f,setup(e){const t=e,{t:l}=(0,v.bU)(),s=(0,_.s)("popconfirm"),d=(0,o.iH)(),u=()=>{var e,t;null==(t=null==(e=d.value)?void 0:e.onClose)||t.call(e)},p=(0,a.Fl)((()=>({width:(0,y.Nn)(t.width)}))),m=e=>{var l;null==(l=t.onConfirm)||l.call(t,e),u()},f=e=>{var l;null==(l=t.onCancel)||l.call(t,e),u()},g=(0,a.Fl)((()=>t.confirmButtonText||l("el.popconfirm.confirmButtonText"))),w=(0,a.Fl)((()=>t.cancelButtonText||l("el.popconfirm.cancelButtonText")));return(e,t)=>((0,a.wg)(),(0,a.j4)((0,o.SU)(c.Q0),(0,a.dG)({ref_key:"tooltipRef",ref:d,trigger:"click",effect:"light"},e.$attrs,{"popper-class":`${(0,o.SU)(s).namespace.value}-popover`,"popper-style":(0,o.SU)(p),teleported:e.teleported,"fallback-placements":["bottom","top","right","left"],"hide-after":e.hideAfter,persistent:e.persistent}),{content:(0,a.w5)((()=>[(0,a._)("div",{class:(0,n.C_)((0,o.SU)(s).b())},[(0,a._)("div",{class:(0,n.C_)((0,o.SU)(s).e("main"))},[!e.hideIcon&&e.icon?((0,a.wg)(),(0,a.j4)((0,o.SU)(r.gn),{key:0,class:(0,n.C_)((0,o.SU)(s).e("icon")),style:(0,n.j5)({color:e.iconColor})},{default:(0,a.w5)((()=>[((0,a.wg)(),(0,a.j4)((0,a.LL)(e.icon)))])),_:1},8,["class","style"])):(0,a.kq)("v-if",!0),(0,a.Uk)(" "+(0,n.zw)(e.title),1)],2),(0,a._)("div",{class:(0,n.C_)((0,o.SU)(s).e("action"))},[(0,a.Wm)((0,o.SU)(i.mi),{size:"small",type:"text"===e.cancelButtonType?"":e.cancelButtonType,text:"text"===e.cancelButtonType,onClick:f},{default:(0,a.w5)((()=>[(0,a.Uk)((0,n.zw)((0,o.SU)(w)),1)])),_:1},8,["type","text"]),(0,a.Wm)((0,o.SU)(i.mi),{size:"small",type:"text"===e.confirmButtonType?"":e.confirmButtonType,text:"text"===e.confirmButtonType,onClick:m},{default:(0,a.w5)((()=>[(0,a.Uk)((0,n.zw)((0,o.SU)(g)),1)])),_:1},8,["type","text"])],2)],2)])),default:(0,a.w5)((()=>[e.$slots.reference?(0,a.WI)(e.$slots,"reference",{key:0}):(0,a.kq)("v-if",!0)])),_:3},16,["popper-class","popper-style","teleported","hide-after","persistent"]))}});var b=(0,g.Z)(I,[["__file","/home/runner/work/element-plus/element-plus/packages/components/popconfirm/src/popconfirm.vue"]]),h=l(9015);const C=(0,h.nz)(b)},5885:function(e,t,l){l(1758),l(6467)}}]);