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