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