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