import{a4 as i,ai as B,d as E,aj as w,al as O,r as t,o as P,a6 as z,a7 as a,a8 as n,ac as A,M as R,E as V,ak as g,af as b,a9 as I}from"./vendor.e9cda63f.js";import{v as L}from"./pagination.392a2bfd.js";import{F as M}from"./index.43d299e0.js";import{s as j}from"./server.a06a046d.js";import{_ as N,n as T}from"./index.fdd4233a.js";const v=i(!1),p=B({id:"",name:"",desc:""}),U=i(!1),$={required:!0,message:"\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879"},W=i({name:[$],desc:[$]}),q=E({name:"PlatformCfg",components:{vPagination:L,Footer:M},setup(){const e=i(),{t:o}=w(),_=B({page:1,limit:10}),F=i(),k="100px",h=i(100),d={children:"children",label:"label"},u=i(),f=i(9);O("logType",f);const r=(s,l)=>{R.confirm(o("del.tip"),o("del.warn"),{confirmButtonText:o("del.ok"),cancelButtonText:o("del.cancel"),type:"warning"}).then(()=>{j.delPlatform(l).then(c=>{c.code==200&&T(c.message),v.value=!1,m(),u.value.pgetData()})}).catch(()=>{V({type:"info",message:o("del.del_cancel_msg")})})},y=()=>{F.value.validate(s=>{if(s)try{j.platformSave(p).then(l=>{l.code==200&&T(l.message),v.value=!1,m(),u.value.pgetData()})}catch{V.warning("\u4FDD\u5B58\u5931\u8D25")}else V.warning("\u9A8C\u8BC1\u4E0D\u901A\u8FC7\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165")})},C=()=>{v.value=!1},D=(s,l)=>{console.log(l),(l==null?void 0:l.id)?Object.assign(p,l):(p.id="",p.name="",p.desc=""),v.value=!0},m=()=>{j.platformList(_).then(s=>{h.value=s.data.count,e.value=s.data.data})};return m(),{Delete:r,tableData:e,useI18n:w,input:_,save:y,defaultProps:d,itemForm:F,logType:f,RefChild:u,cancle:C,open:D,loading:U,dialogVisible:v,formObj:p,formRules:W,formLabelWidth:k,pageTotal:h,getData:m}}}),S={class:"edit"},G={class:"dialog-footer"};function H(e,o,_,F,k,h){const d=t("el-button"),u=t("el-form-item"),f=t("el-form"),r=t("el-table-column"),y=t("el-table"),C=t("el-input"),D=t("el-dialog"),m=t("vPagination"),s=t("Footer");return P(),z(A,null,[a(f,{class:"search",inline:!0},{default:n(()=>[a(u,{class:"itemAdd"},{default:n(()=>[a(d,{type:"primary",size:"small",onClick:o[0]||(o[0]=l=>e.open(null,null))},{default:n(()=>[g(b(e.useI18n().t("add")),1)]),_:1})]),_:1})]),_:1}),a(y,{data:e.tableData,"cell-style":{padding:"9px 0"},style:{width:"100%"}},{default:n(()=>[a(r,{label:"\u7F16\u53F7",prop:"id",width:"80px"}),a(r,{label:"\u540D\u79F0",align:"center",width:"180px",prop:"name"}),a(r,{label:"\u63CF\u8FF0",align:"center",width:"180px",prop:"desc"}),a(r,{align:"center",label:e.useI18n().t("option")},{default:n(l=>[I("div",S,[a(d,{size:"mini",onClick:c=>e.open(l.$index,l.row)},{default:n(()=>[g(b(e.useI18n().t("edit")),1)]),_:2},1032,["onClick"]),a(d,{size:"mini",onClick:c=>e.Delete(l.$index,l.row)},{default:n(()=>[g(b(e.useI18n().t("delete")),1)]),_:2},1032,["onClick"])])]),_:1},8,["label"])]),_:1},8,["data"]),a(D,{modelValue:e.dialogVisible,"onUpdate:modelValue":o[3]||(o[3]=l=>e.dialogVisible=l),"close-on-click-modal":!1,"close-on-press-escape":!1,title:e.formObj.id?e.useI18n().t("edit"):e.useI18n().t("add"),width:"600px"},{footer:n(()=>[I("span",G,[a(d,{onClick:e.cancle},{default:n(()=>[g(b(e.useI18n().t("cancle")),1)]),_:1},8,["onClick"]),a(d,{type:"primary",onClick:e.save,loading:e.loading},{default:n(()=>[g(b(e.useI18n().t("confirm")),1)]),_:1},8,["onClick","loading"])])]),default:n(()=>[a(f,{model:e.formObj,ref:"itemForm",rules:e.formRules},{default:n(()=>[a(u,{label:"\u540D\u79F0",prop:"name","label-width":e.formLabelWidth},{default:n(()=>[a(C,{modelValue:e.formObj.name,"onUpdate:modelValue":o[1]||(o[1]=l=>e.formObj.name=l)},null,8,["modelValue"])]),_:1},8,["label-width"]),a(u,{label:e.useI18n().t("server.desc"),prop:"desc","label-width":e.formLabelWidth},{default:n(()=>[a(C,{modelValue:e.formObj.desc,"onUpdate:modelValue":o[2]||(o[2]=l=>e.formObj.desc=l)},null,8,["modelValue"])]),_:1},8,["label","label-width"])]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"]),a(m,{pagesize:e.input.limit,total:e.pageTotal,options:e.input,render:e.getData},null,8,["pagesize","total","options","render"]),a(s,{logType:e.logType,ref:"RefChild"},null,8,["logType"])],64)}var Z=N(q,[["render",H]]);export{Z as default};
