import{b as e,a,c as l,d as r}from"./index-937329f9.js";import{b as u}from"./index-1e83f7c7.js";/* empty css             *//* empty css                   */import{d as s,k as t,H as m,p,r as d,K as o,J as i,o as n,j as c,w as v,e as g,a as b,c as y,F as f,q as _,s as V,b as h,t as x,f as P,O as k}from"./index-018fb6dd.js";const q={class:"flex flex-row justify-between"},U={class:"w-full"},j=g("br",null,null,-1),w={class:"flex justify-end"},A=s({__name:"create",props:{primary:String|Number},emits:["close"],setup(s,{emit:A}){const I=s,z=t(),D=t({status:2,miniProgramIds:[]}),C=m({type:[{required:!0,message:"请选择类型"}],pay_merchant_id:[{required:!0,message:"请选择绑定支付信息"}],appid:[{required:!0,message:"请输入APP ID",trigger:"blur"},{max:32,message:"至多输入32个字符",trigger:"blur"}],remark:[{required:!1,message:"请输入备注",trigger:"blur"}],appsecret:[{required:!0,message:"请输入APP 密钥",trigger:"blur"},{max:64,message:"至多输入64个字符",trigger:"blur"}],name:[{required:!0,message:"请输入小程序名称",trigger:"blur"},{max:15,message:"至多输入15个字符",trigger:"blur"}],company:[{required:!0,message:"请输入所属公司",trigger:"blur"},{max:30,message:"至多输入30个字符",trigger:"blur"}],play_name:[{required:!0,message:"请输入对应剧场名称",trigger:"blur"},{max:15,message:"至多输入15个字符",trigger:"blur"}]}),F=t(!1),J=t([]),H=t([]),K=e=>{N({limit:1e5})},N=e=>{u({miniprogram_type:D.value.type,...e}).then((e=>{H.value=e.data}))};return I.primary&&e(I.primary).then((e=>{D.value=e.data,N({limit:1e5})})),p((()=>{a().then((e=>{J.value=e.data}))})),(e,a)=>{const u=d("el-input"),s=d("el-form-item"),t=d("el-option"),m=d("el-select"),p=d("el-switch"),N=d("el-tooltip"),O=d("el-button"),S=d("el-form"),$=o("loading");return i((n(),c(S,{model:D.value,"label-width":"120px",ref_key:"ruleForm",ref:z,rules:P(C),class:"pr-4"},{default:v((()=>[g("div",q,[g("div",U,[b(s,{label:"小程序名称",prop:"name"},{default:v((()=>[b(u,{modelValue:D.value.name,"onUpdate:modelValue":a[0]||(a[0]=e=>D.value.name=e),placeholder:"请输入小程序名称"},null,8,["modelValue"])])),_:1}),b(s,{label:"所属公司",prop:"company"},{default:v((()=>[b(u,{modelValue:D.value.company,"onUpdate:modelValue":a[1]||(a[1]=e=>D.value.company=e),placeholder:"请输入所属公司"},null,8,["modelValue"])])),_:1}),b(s,{label:"对应剧场名称",prop:"play_name"},{default:v((()=>[b(u,{modelValue:D.value.play_name,"onUpdate:modelValue":a[2]||(a[2]=e=>D.value.play_name=e),clearable:"",size:"large",placeholder:"请输入对应剧场名称"},null,8,["modelValue"])])),_:1}),b(s,{label:"类型",prop:"type"},{default:v((()=>[b(m,{class:"w-full",modelValue:D.value.type,"onUpdate:modelValue":a[3]||(a[3]=e=>D.value.type=e),onChange:K,filterable:"",clearable:"",placeholder:"选择类型"},{default:v((()=>[(n(!0),y(f,null,_(J.value,(e=>(n(),c(t,{key:e.value,label:e.name,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),D.value.type?(n(),c(s,{key:0,label:"绑定支付信息",prop:"pay_merchant_id"},{default:v((()=>[b(m,{class:"w-full",modelValue:D.value.pay_merchant_id,"onUpdate:modelValue":a[4]||(a[4]=e=>D.value.pay_merchant_id=e),filterable:"",clearable:"",placeholder:"选择绑定支付信息"},{default:v((()=>[(n(!0),y(f,null,_(H.value,(e=>(n(),c(t,{key:e.id,label:e.name,value:e.id},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1})):V("",!0),b(s,{label:"APP ID",prop:"appid"},{default:v((()=>[b(u,{modelValue:D.value.appid,"onUpdate:modelValue":a[5]||(a[5]=e=>D.value.appid=e),clearable:"",size:"large",placeholder:"请输入APP ID"},null,8,["modelValue"])])),_:1}),b(s,{label:"APP 密钥",prop:"appsecret"},{default:v((()=>[b(u,{modelValue:D.value.appsecret,"onUpdate:modelValue":a[6]||(a[6]=e=>D.value.appsecret=e),clearable:"",size:"large",placeholder:"请输入APP 密钥"},null,8,["modelValue"])])),_:1}),b(s,{label:"状态",prop:"status"},{default:v((()=>[b(p,{modelValue:D.value.status,"onUpdate:modelValue":a[7]||(a[7]=e=>D.value.status=e),"active-value":1,"inactive-value":0},null,8,["modelValue"])])),_:1}),b(s,{label:"备注",prop:"remark"},{default:v((()=>[b(N,{placement:"top"},{content:v((()=>[h(" 鼠标移到账号上面显示备注内容"),j])),default:v((()=>[b(u,{modelValue:D.value.remark,"onUpdate:modelValue":a[8]||(a[8]=e=>D.value.remark=e),placeholder:"请填写备注",type:"textarea"},null,8,["modelValue"])])),_:1})])),_:1})])]),g("div",w,[b(O,{type:"primary",onClick:a[9]||(a[9]=e=>{return a=z.value,D.value,void(a&&a.validate((e=>{e?I.primary?l(I.primary,{...D.value}).then((e=>{k.success(e.message),A("close")})):r({...D.value}).then((e=>{k.success(e.message),A("close")})):F.value=!1})).then((()=>{})));var a})},{default:v((()=>[h(x(e.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model","rules"])),[[$,F.value]])}}});export{A as _};
