/* empty css             *//* empty css                   *//* empty css                     *//* empty css                  *//* empty css                          *//* empty css                    */import{d as e,m as a,p as l,x as s,X as t,f as i,o as u,l as o,w as r,a as n,e as d,a7 as m,aS as p,b as c,z as _,c as v,F as h,y as f,t as x,a5 as w,$ as j,aT as b,a4 as g,U as y,Z as k,a0 as V,_ as C}from"./index-0ffeeea6.js";import{a as U,b as N}from"./index-e8afbbd5.js";import{f as q,g as F}from"./index-331cd34f.js";import{w as I,a as S}from"./index-383f8f24.js";/* empty css                 *//* empty css                   */import"./http-ffb58baa.js";/* empty css                 *//* empty css                   */const $={class:"wrapper"},z={class:"wrapper-inner"},B={class:"flex justify-end"},E=C(e({__name:"configPublic",props:{primary:null|Object,typeName:String},emits:["close"],setup(e,{emit:C}){const E=e;let H=N,O=U;const P=a(),T=a(!1),X=a({wx_auth_ids:[]}),Z=a("");let A=a([]);const D=l((()=>A.value.filter((e=>e.nick_name.includes(Z.value))))),G=l((()=>{var e,a,l,s;return(null==(a=null==(e=X.value)?void 0:e.wx_auth_ids)?void 0:a.length)>0&&(null==(s=null==(l=X.value)?void 0:l.wx_auth_ids)?void 0:s.length)==A.value.length})),J=()=>{},K=e=>{X.value.wx_auth_ids=e?D.value:[],X.value.wx_auth_ids},L=e=>{};if(E.primary){const e=E.typeName;switch(E.typeName,e){case"关键字回复":H=N,O=U;break;case"关注回复":H=q,O=F;break;case"公众号菜单":H=I,O=S}O(E.primary.id).then((e=>{var a;A.value=e.data,A.value;const l=null==(a=A.value)?void 0:a.filter((e=>e.is_auth));l.length>0&&(X.value.wx_auth_ids=l)})),E.primary,X.value}return s((()=>{})),(e,a)=>{const l=j,s=b,U=g,N=y,q=k,F=V;return t((u(),o(q,{model:i(X),"label-width":"120px",ref_key:"form",ref:P,class:"pr-4"},{default:r((()=>[n(U,{label:"配置公众号",prop:"wx_auth_ids",rules:[{required:!1,message:"公众号必须选择"}],"label-width":"120px"},{default:r((()=>[d("div",$,[t(d("input",{class:"filter-input","onUpdate:modelValue":a[0]||(a[0]=e=>m(Z)?Z.value=e:null),clearable:"",placeholder:"请输入公众号名称",onChange:J},null,544),[[p,i(Z)]]),d("div",z,[i(D).length>0?(u(),o(l,{key:0,modelValue:i(G),"onUpdate:modelValue":a[1]||(a[1]=e=>m(G)?G.value=e:null),onChange:K},{default:r((()=>[c("全选")])),_:1},8,["modelValue"])):_("",!0),n(s,{modelValue:i(X).wx_auth_ids,"onUpdate:modelValue":a[2]||(a[2]=e=>i(X).wx_auth_ids=e),onChange:L,class:"flex flex-col"},{default:r((()=>[(u(!0),v(h,null,f(i(D),((e,a)=>(u(),o(l,{key:a,label:e,checked:Boolean(e.is_auth)},{default:r((()=>[c(x(e.nick_name),1)])),_:2},1032,["label","checked"])))),128))])),_:1},8,["modelValue"])])])])),_:1}),d("div",B,[n(N,{type:"primary",onClick:a[3]||(a[3]=e=>{var a;(a=i(P))&&(T.value=!0,a&&a.validate((e=>{if(e){X.value;const e=X.value.wx_auth_ids.map((e=>e.id)).join(",");H(E.primary.id,{wx_auth_ids:e}).then((e=>{w.success(e.message),C("close")})),T.value=!1}else T.value=!1})).then((()=>{})))})},{default:r((()=>[c(x(e.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model"])),[[F,i(T)]])}}}),[["__scopeId","data-v-015f73ca"]]);export{E as default};
