import{o as e}from"./index-981be696.js";import{a}from"./index-dd579723.js";/* empty css             *//* empty css                   */import{d as l,k as s,p as t,r as u,K as r,J as o,f as m,o as i,j as d,w as p,a as n,c,F as f,q as v,e as b,b as y,t as _,O as g}from"./index-018fb6dd.js";const h={class:"flex justify-end"},x=l({__name:"create",emits:["close"],setup(l,{emit:x}){const V=s(!1),j=s();s("");const w=s({status:0}),k=s([]),q=s([{name:"本周精选",value:1},{name:"优选好剧",value:2}]);return t((()=>{e().then((e=>{k.value=e.data.miniprogramType}))})),(e,l)=>{const s=u("el-option"),t=u("el-select"),U=u("el-form-item"),J=u("el-switch"),C=u("el-button"),F=u("el-form"),I=r("loading");return o((i(),d(F,{model:m(w),"label-width":"120px",ref_key:"form",ref:j,class:"pr-4"},{default:p((()=>[n(U,{label:"小程序类型",prop:"miniprogram_type",rules:[{required:!0,message:"选择小程序类型"}],"label-width":"120px"},{default:p((()=>[n(t,{modelValue:m(w).miniprogram_type,"onUpdate:modelValue":l[0]||(l[0]=e=>m(w).miniprogram_type=e),clearable:"",filterable:"",placeholder:"请选择小程序类型"},{default:p((()=>[(i(!0),c(f,null,v(m(k),((e,a)=>(i(),d(s,{key:a,label:e.label,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),n(U,{label:"列表名称",prop:"type",rules:[{required:!0,message:"选择列表名称"}],"label-width":"120px"},{default:p((()=>[n(t,{modelValue:m(w).type,"onUpdate:modelValue":l[1]||(l[1]=e=>m(w).type=e),clearable:"",filterable:"",placeholder:"请选择列表名称"},{default:p((()=>[(i(!0),c(f,null,v(m(q),((e,a)=>(i(),d(s,{key:a,label:e.name,value:e.value},null,8,["label","value"])))),128))])),_:1},8,["modelValue"])])),_:1}),n(U,{label:"状态",prop:"status","label-width":"120px",rules:[{required:!0,message:"选择状态"}]},{default:p((()=>[n(J,{modelValue:m(w).status,"onUpdate:modelValue":l[2]||(l[2]=e=>m(w).status=e),"active-value":1,"inactive-value":0},null,8,["modelValue"])])),_:1}),b("div",h,[n(C,{type:"primary",onClick:l[3]||(l[3]=e=>{var l;(l=m(j))&&(V.value=!0,l&&l.validate((e=>{e?(a(w.value).then((e=>{g.success(e.message),x("close")})),V.value=!1):V.value=!1})).then((()=>{})))})},{default:p((()=>[y(_(e.$t("system.confirm")),1)])),_:1})])])),_:1},8,["model"])),[[I,m(V)]])}}});export{x as _};
