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