猎羽广告

index.iZz5BBHp.js 14KB

12
  1. import{E as e,v as a,r as t,B as l,C as o,A as s,D as i,j as r,i as n,o as u,k as p,l as d}from"../element-plus/element-plus.DqqeXZzT.js";import{I as c}from"../_input/_input.DPT4C86A.js";import{_ as m}from"../_popconfirm/_popconfirm.C2WlUwAw.js";import{S as v}from"../_select/_select.DVQW4rAo.js";import{T as g,p as f}from"../tableInfo/tableInfo.DCb2GEsc.js";import{A as _}from"../api/api.BtQEnbVN.js";import{D as y}from"../_dialog/_dialog.ium6sOk7.js";import{_ as h,h as x}from"../../assets/index-DYMYfyXS.js";import{d as w,Y as b,r as j,i as I,n as k,o as M,J as C,K as R,L as T,c as z,T as D,h as L,E as V,w as S,a as E,u as N,S as U,Q as $,R as B,ba as F,b8 as P,U as O,a9 as W,M as q,ae as A}from"../@vue/@vue.lccsL1Mu.js";import{t as G}from"../await-to-js/await-to-js.BuwTFY8y.js";import{t as H}from"../eventModel/eventModel.ekFf8kiN.js";import{_ as J}from"../lodash/lodash.S3QqMfIB.js";import{s as K}from"../@element-plus/@element-plus.BWbqilIf.js";import"../lodash-es/lodash-es.LxYfApIs.js";import"../async-validator/async-validator.DSgsWN2H.js";import"../@vueuse/@vueuse.D2YafqsA.js";import"../dayjs/dayjs.D4rZQhfm.js";import"../axios/axios.CUN3se9v.js";import"../@ctrl/@ctrl.D2oWfImC.js";import"../@popperjs/@popperjs.D3lHDW-0.js";import"../escape-html/escape-html.J6B7JOz4.js";import"../normalize-wheel-es/normalize-wheel-es.Erkn7R64.js";import"../caret-top/caret-top.BxG-YGIs.js";import"../question-filled/question-filled.CpBGPdbF.js";import"../vue-router/vue-router.D86bYXwF.js";import"../pinia/pinia.DodrAXQg.js";import"../vue-demi/vue-demi.Dq6ymT-8.js";import"../pinia-plugin-persist/pinia-plugin-persist.Cjrd7Wf_.js";import"../echarts/echarts.C_nC9ACL.js";import"../tslib/tslib.DduEQve-.js";import"../zrender/zrender.XYf_pgl8.js";const Q={class:"dialogBox"},Y=h(w({__name:"addGroup",emits:["init"],setup(t,{expose:l,emit:o}){const{proxy:s}=L();s.$NumberHandle;const i=b({editId:"",title:"新增账号分组",userList:[]}),r=j(),n=j(),u=j(!1),p=async()=>{if(""==r.value.value)return void e.error("分组名称为必填项");if(""==n.value.value)return void e.error("所属投手为必选项");u.value=!0;let a=_.ad_account_group_edit;const t=b({name:r.value.value,promoter_id:n.value.value});i.editId&&(t.group_id=i.editId);let l=await s.$http.post(a,t);u.value=!1,l&&"0"==l.errNo?(l.rst,d.value=!1,o("init")):e.error(l.errMsg)},d=j(!1);return l({switchShow:(a,t)=>{d.value=a,a&&k((async()=>{r.value.value="",n.value.value="",i.editId="",i.title="新增账号组",u.value=!0,await(async()=>{let a=await s.$http.get(_.user_list);if(a&&"0"==a.errNo){let e=a.rst;i.userList=e}else e.error(a.errMsg)})(),u.value=!1,t?.id&&(async a=>{u.value=!0;let t=await s.$http.get(_.ad_account_group_detail,{group_id:a});if(u.value=!1,t&&"0"==t.errNo){let e=t?.rst;i.editId=e?.id,r.value.value=e.name,n.value.value=e.promoter_id,i.title="编辑账号组"}else e.error(t.errMsg)})(t?.id)}))}}),I((()=>{k((()=>{}))})),(e,t)=>{const l=a;return M(),C(y,{ref:"DialogRef_editType",dialogVisible:d.value,onConfirm:p,onClose:t[0]||(t[0]=e=>d.value=!1),width:"800px",height:"calc(100vh - 220px)",top:"20px","dialog-title":i.title},{content:R((()=>[T((M(),z("div",Q,[D(c,{ref_key:"nameRef",ref:r,spanTitleWidth:"80px",inputWidth:"80%",title:"分组名称",haveTag:!0,haverMar15:!1},null,512),D(v,{ref_key:"promoterRef",ref:n,class:"tMar20",clearFlag:!0,haveTag:!0,title:"所属投手",selectWidth:"190px",optObj:{k:"id",la:"username",val:"id"},options:i.userList},null,8,["options"])])),[[l,u.value]])])),_:1},8,["dialogVisible","dialog-title"])}}}),[["__scopeId","data-v-64f090fb"]]);const X={class:"tMar15"},Z={class:"flex"},ee={key:0,class:"flex_1 flex"},ae={class:"f12 c-555"},te={class:"flex_center tMar10 bMar10"},le=w({__name:"childList",props:{agencyItem:{type:Object,default:()=>{}},importType:{type:String,default:""},handType:{type:Number,default:0}},emits:["total"],setup(i,{expose:r,emit:n}){const u=i,p=j(!1),d=j(""),c=j([]),m=j([]),v=j([]),g=j([]),f=j(!1),_=j(),y=j(0),h=b({page:1,pageSize:20,total:0}),w=(e,a)=>{g.value=e},I=()=>{g.value=[],_.value?.clearSelection()},k=()=>{let e=J.cloneDeep(c.value);isNaN(Number(d.value))?m.value=e.filter((e=>-1!=e.corporation_name?.indexOf(d.value))):m.value=e.filter((e=>-1!=e.account_id?.indexOf(d.value))),h.total=m.value.length,h.page=1,L()},L=()=>{const e=J.cloneDeep(m.value);v.value=e.slice((h.page-1)*h.pageSize,h.page*h.pageSize)},F=e=>{h.page=1,h.pageSize=e,L()},P=e=>{h.page=e,L()},O=()=>{var a;u.agencyItem?.agency_account_id&&(p.value=!0,(a={agency_account_id:u.agencyItem?.agency_account_id,keyword:d.value},new Promise((async(t,l)=>{const o=await x.get("/api/account/agentChildList",a);0==o.errNo?t(o.rst):(e.error(o.errMsg),l())}))).then((e=>{p.value=!1,c.value=e.list,m.value=J.cloneDeep(c.value),h.total=e.total,y.value=e.total,n("total",y.value),L()})).catch((()=>{p.value=!1})))};V((()=>{O()}));return r({getMultipleList:()=>new Promise(((e,a)=>{f.value?e(g.value):e(c.value)}))}),S([()=>u.importType,()=>u.handType],((e,a)=>{"part"==e[0]&&2==e[1]?(f.value=!0,g.value=[]):f.value=!1}),{immediate:!0}),(e,i)=>{const r=t,n=l,u=o,c=s,m=a;return T((M(),z("div",X,[E("div",Z,[D(r,{modelValue:d.value,"onUpdate:modelValue":i[0]||(i[0]=e=>d.value=e),style:{width:"300px"},placeholder:"请输入搜索关键词","prefix-icon":N(K),size:"default",clearable:"",onInput:i[1]||(i[1]=e=>k()),onClear:i[2]||(i[2]=e=>k())},null,8,["modelValue","prefix-icon"]),f.value?(M(),z("div",ee,[E("p",ae,"(已选 "+U(g.value.length)+" 个媒体账户)",1),E("span",{class:"f13 pointer c-theme",onClick:I},"清空选择")])):$("",!0)]),D(u,{ref_key:"multipleTableRef",ref:_,data:v.value,style:{width:"100%"},"row-key":"account_id",class:"tMar15",height:"36vh","header-cell-style":N(H),onSelectionChange:w,border:""},{default:R((()=>[f.value?(M(),C(n,{key:0,"reserve-selection":"",type:"selection",width:"55",align:"center"})):(M(),C(n,{key:1,label:"序号",width:"80",align:"center"},{default:R((e=>[B(U(e.$index+1+(h.page-1)*h.pageSize),1)])),_:1})),D(n,{prop:"corporation_name",label:"账户名称"}),D(n,{prop:"account_id",label:"账户ID"})])),_:1},8,["data","header-cell-style"]),E("div",te,[D(c,{"current-page":h.page,"onUpdate:current-page":i[3]||(i[3]=e=>h.page=e),"page-size":h.pageSize,"onUpdate:page-size":i[4]||(i[4]=e=>h.pageSize=e),"page-sizes":[10,20,50,100],small:!0,layout:"total, sizes, prev, pager, next, jumper",total:h.total,onSizeChange:F,onCurrentChange:P},null,8,["current-page","page-size","total"])])])),[[m,p.value]])}}}),oe={class:"tMar20 textBox"},se={class:"flex_between titleBox"},ie=(e=>(F("data-v-625b0762"),e=e(),P(),e))((()=>E("div",{class:"tips"},"请输入广告主账户ID,多账户请换行(即每个账户ID一行)",-1))),re=h(w({__name:"manualInput",props:{maxRow:{type:Number,default:300}},emits:["mInput"],setup(e,{emit:a}){const l=e,o=j(""),s=()=>{let e=0;return o.value?.split("\n").forEach((a=>{""!==a&&e++})),e};return S((()=>o.value),((e,a)=>{s()>l.maxRow&&(o.value=a)}),{immediate:!0}),(l,i)=>{const r=t;return M(),z("div",oe,[E("div",se,[E("div",null,"请输入广告主账户ID("+U(s())+" / "+U(e.maxRow)+" )",1),E("div",{class:"c-theme pointer",onClick:i[0]||(i[0]=e=>o.value="")},"清空")]),ie,D(r,{id:"emojiInput",modelValue:o.value,"onUpdate:modelValue":i[1]||(i[1]=e=>o.value=e),resize:"none",rows:12,type:"textarea",style:{width:"100%"},onInput:i[2]||(i[2]=e=>a("mInput",o.value))},null,8,["modelValue"])])}}}),[["__scopeId","data-v-625b0762"]]),ne={class:"dialogBox"},ue={class:"tMar20"},pe=w({__name:"addResult",props:{title:{default:"添加文案"},data:{default:null}},emits:["initType"],setup(e,{expose:t,emit:l}){const o=b([{name:"广告账户id",column:"advertiser_id"},{name:"广告账户名",column:"advertiser_name"},{name:"状态",column:"note"}]),s=j(!1),i=j(!1),r=()=>{s.value=!1,l("initType")};return t({switchShow:e=>{s.value=e}}),(t,l)=>{const n=g,u=a;return M(),C(y,{ref:"DialogRef",dialogVisible:s.value,onClose:r,width:"800px",height:"420px",minheight:"400px","dialog-title":e.title,class:"addEditText"},{content:R((()=>[T((M(),z("div",ne,[E("div",ue,[D(n,{tableHeight:"100vh",tableData:e.data,descol:o},null,8,["tableData","descol"])])])),[[u,i.value]])])),_:1},8,["dialogVisible","dialog-title"])}}}),de={class:"container"},ce={class:"flex_start c-aaa line18 tMar10"},me={key:0,class:"flex_1"},ve={key:1,class:"flex_1"},ge={key:2,class:"flex_1"},fe={class:"dialog-footer",style:{"text-align":"right",padding:"10px","padding-top":"0"}},_e=B(" 取 消 "),ye=B(" 确 认 "),he=h(w({__name:"importDialog",emits:["close"],setup(t,{expose:l,emit:o}){const s=j(!1),c=j(""),m=j(""),v=j(!1),g=j(0),f=j(),y=j({}),h=j(""),w=j(),{importType:I,handType:L,getUserList:S,getProjectList:F}=(()=>{const a=j(),t=j(),l=b({list:[{id:"part",name:"部分导入"}],type:"part"}),o=b({list:[{id:1,name:"手动输入"}],type:1}),s=b({list:[],active:""}),i=b({list:[],active:""});return{projectIdRef:t,ownerIdRef:a,importType:l,handType:o,userList:s,projectList:i,getProjectList:async()=>{const a=_.project_list,[t,l]=await G(x.get(a,{}));if(t||"0"!==l?.errNo)return e.error(t?.message||l?.errMsg||"操作失败");i.list=[...l?.rst]},getUserList:async()=>{const a=_.user_list,[t,l]=await G(x.get(a,{}));if(t||"0"!==l?.errNo)return e.error(t?.message||l?.errMsg||"操作失败");s.list=[...l?.rst]}}})();V((()=>{S(),F()}));const P=()=>{v.value=!1},H=e=>{g.value=e},J=e=>{m.value=e},K=async()=>{let a="";var t;("part"==I.type&&1==L.type&&(a=m.value),""!=a)?(s.value=!0,(t={group_id:c.value.id,import_method:I.type,type:L.type,data_str:a},new Promise((async(a,l)=>{const o=await x.post(_.oe_account_add_to_group,t);0==o.errNo?a(o.rst):(e.error(o.errMsg),l())}))).then((a=>{s.value=!1,a&&(console.log(a),e.warning("导入完成"),y.value=a,h.value="广告账户导入结果",k((()=>{w.value.switchShow(!0)})))})).catch((()=>{s.value=!1}))):e.warning("请输入账户ID或手动选择广告账户!")};return l({initFun:async(e,a)=>{v.value=e,e&&(c.value=a)}}),(e,t)=>{const l=i,o=r,m=n,_=A("WarningFilled"),x=u,b=p,j=d,k=a;return M(),C(j,{class:"gdt-dialog","close-on-click-modal":!1,"destroy-on-close":!0,modelValue:v.value,"onUpdate:modelValue":t[2]||(t[2]=e=>v.value=e),title:"导入广告账户",width:"800px",top:"40px","before-close":P},{footer:R((()=>[E("div",fe,[D(b,{size:"default",onClick:P},{default:R((()=>[_e])),_:1}),D(b,{size:"default",type:"primary",onClick:K},{default:R((()=>[ye])),_:1})])])),default:R((()=>[T((M(),z("div",de,[D(o,{modelValue:N(I).type,"onUpdate:modelValue":t[0]||(t[0]=e=>N(I).type=e),size:"default",class:"block tMar20"},{default:R((()=>[(M(!0),z(O,null,W(N(I).list,(e=>(M(),C(l,{label:e.id},{default:R((()=>[B(U(e.name),1)])),_:2},1032,["label"])))),256))])),_:1},8,["modelValue"]),"part"==N(I).type?(M(),C(o,{key:0,modelValue:N(L).type,"onUpdate:modelValue":t[1]||(t[1]=e=>N(L).type=e),size:"default",class:"block tMar10"},{default:R((()=>[(M(!0),z(O,null,W(N(L).list,(e=>(M(),C(m,{label:e.id},{default:R((()=>[B(U(e.name),1)])),_:2},1032,["label"])))),256))])),_:1},8,["modelValue"])):$("",!0),E("div",ce,[D(x,{class:"rMar7 tMar2",color:"#ff9b48"},{default:R((()=>[D(_)])),_:1}),"part"==N(I).type&&1==N(L).type?(M(),z("span",me,"请确保输入的广告主账户已属于对应的代理商,否则会导致失败;单次授权账户上限"+U(300)+"个,如账户数量较多,请分批次输入")):$("",!0),"part"==N(I).type&&2==N(L).type?(M(),z("span",ve,"该代理商账户下共"+U(g.value)+"个媒体账户,请选择想要导入的账户名称",1)):$("",!0),"all"==N(I).type?(M(),z("span",ge,"该代理商账户下共"+U(g.value)+"个媒体账户",1)):$("",!0)]),T(D(re,{maxRow:300,onMInput:J},null,512),[[q,"part"==N(I).type&&1==N(L).type]]),T(D(le,{ref_key:"ChildListRef",ref:f,groupItem:c.value,importType:N(I).type,handType:N(L).type,onTotal:H},null,8,["groupItem","importType","handType"]),[[q,"part"==N(I).type&&2==N(L).type||"all"==N(I).type]])])),[[k,s.value]]),D(pe,{title:h.value,data:y.value,ref_key:"TextDialogRef",ref:w},null,8,["title","data"])])),_:1},8,["modelValue"])}}}),[["__scopeId","data-v-f7b4af9c"]]),xe={class:"screenBox flex"},we=B("新增账号组"),be={class:"text-center"},je=["onClick"],Ie=["onClick"],ke=h(w({__name:"index",setup(a){const{proxy:t}=L(),l=b([{name:"账号组名称",column:"name"},{name:"操作人",column:"admin"},{name:"所属投手",column:"promoter"},{name:"创建时间",column:"created_at"},{name:"更新时间",column:"updated_at"},{name:"操作",column:"operate",slotFlag:!0}]),{tableInfo:o,tableListRef:s,total:i}=f(l),r=e=>{k((()=>{h.value.switchShow(!0,e||"")}))},{EditDialogRef:n,ImpoartDialogRef:u,agencyEvent:d,agencyEditEvent:y}=(()=>{const a=j(),t=j();return{EditDialogRef:a,ImpoartDialogRef:t,agencyEvent:a=>{a?.id?t.value&&t.value.initFun(!0,a):e.error("账户组获取失败,无法导入账户!")},agencyEditEvent:t=>{t?.account_id?a.value&&a.value.initFun(!0,t):e.error("账户获取失败,无法进行编辑!")}}})(),h=j(),x=j(),w=j(),C=b({list:[{value:0,label:"已禁用"},{value:1,label:"正常"}]}),T=async(a,l)=>{s.value.loading=!0;const r=b({keyword:x.value.value,status:w.value.value,page:a||1,page_size:l||20});let n=await t.$http.get(_.ad_account_group_list,r);s.value.loading=!1,n&&"0"==n.errNo?(o.tableList=n.rst.data,i.value=n.rst.pageInfo.total):e.error(n.errMsg)};return I((async()=>{await T()})),(a,l)=>{const n=p;return M(),z(O,null,[E("div",xe,[D(c,{ref_key:"InputRef_text",ref:x,title:"分组名称",placeholderTxt:"分组名称",onChangeEvent:l[0]||(l[0]=e=>T()),onClearEvent:l[1]||(l[1]=e=>T())},null,512),D(v,{ref_key:"statusRef",ref:w,title:"状态",onChangeEvent:l[2]||(l[2]=e=>T()),onClearEvent:l[3]||(l[3]=e=>T()),options:C.list},null,8,["options"]),D(n,{type:"primary",class:"lMarauto",onClick:l[4]||(l[4]=e=>r())},{default:R((()=>[we])),_:1})]),D(g,{ref_key:"tableListRef",ref:s,tableData:N(o).tableList,descol:N(o).descolList,total:N(i),onInit:T},{operate:R((a=>[E("div",be,[E("span",{class:"c-theme pointer f13 rMar7",onClick:e=>N(d)(a.row)},"导入账户",8,je),E("span",{class:"operate_text lMar8 pointer",onClick:e=>r(a.row)},"编辑",8,Ie),D(m,{onConfirm:l=>(async a=>{s.value.loading=!0;const l=b({group_id:a.id,status:1-a.status});let o=await t.$http.get(_.ad_account_group_convert,l);s.value.loading=!1,e.info(o.errMsg),o&&"0"==o.errNo&&await T()})(a.row)},null,8,["onConfirm"])])])),_:1},8,["tableData","descol","total"]),D(he,{ref_key:"ImpoartDialogRef",ref:u,onClose:l[5]||(l[5]=e=>T())},null,512),D(Y,{ref_key:"AddGroupRef",ref:h,onInit:T},null,512)],64)}}}),[["__scopeId","data-v-af04a818"]]);export{ke as default};