import{a4 as m,ai as D,d as w,aj as F,r as i,o as $,a6 as S,a7 as l,a8 as t,ac as T,M as z,E as k,ak as c,af as h,a9 as A}from"./vendor.e9cda63f.js";import{X as _}from"./xhprof.113d2562.js";import{v as L}from"./pagination.392a2bfd.js";import{_ as M,n as E}from"./index.fdd4233a.js";const v=m(!1),p=D({id:"",name:"",ip:"",db_tab:""}),P=m(!1),B={required:!0,message:"\u8BE5\u9879\u4E3A\u5FC5\u586B\u9879"},U=m({name:[B],ip:[B],db_tab:[B]}),W=w({name:"Setting",components:{vPagination:L},setup(){const e=D({search:"",page:1,limit:10}),n=m(),{t:u}=F(),y="100px",C=m(),V=m(100),I={children:"children",label:"label"},s=()=>{_.getSetInfo(e).then(d=>{V.value=d.message.total,n.value=d.message.list})},r=(d,o)=>{z.confirm(u("del.tip"),u("del.warn"),{confirmButtonText:u("del.ok"),cancelButtonText:u("del.cancel"),type:"warning"}).then(()=>{_.del(o).then(g=>{g.code==200&&E(g.message),v.value=!1,s()})}).catch(()=>{k({type:"info",message:u("del.del_cancel_msg")})})},j=()=>{C.value.validate(d=>{if(d)try{_.save(p).then(o=>{o.code==200&&E(o.message),v.value=!1,s()})}catch{k.warning("\u4FDD\u5B58\u5931\u8D25")}else k.warning("\u9A8C\u8BC1\u4E0D\u901A\u8FC7\uFF0C\u8BF7\u68C0\u67E5\u8F93\u5165")})},f=()=>{v.value=!1},b=(d,o)=>{(o==null?void 0:o.id)?(Object.assign(p,o),_.detail(o.id).then(a=>{a.code==200})):(p.id="",p.name="",p.ip="",p.db_tab=""),v.value=!0};return s(),{useI18n:F,input:e,getData:s,tableData:n,pageTotal:V,defaultProps:I,xhprofForm:C,dialogVisible:v,formObj:p,loading:P,formRules:U,formLabelWidth:y,t:u,Delete:r,save:j,cancle:f,open:b}}}),N={class:"dialog-footer"};function R(e,n,u,y,C,V){const I=i("el-alert"),s=i("el-button"),r=i("el-table-column"),j=i("el-table"),f=i("el-input"),b=i("el-form-item"),d=i("el-form"),o=i("el-dialog"),g=i("vPagination");return $(),S(T,null,[l(I,{class:"info",title:"xhprof \u8BBE\u7F6E\u754C\u9762",type:"info",closable:!1}),l(s,{class:"add",type:"primary",onClick:n[0]||(n[0]=a=>e.open(null,null))},{default:t(()=>[c(h(e.useI18n().t("add")),1)]),_:1}),l(j,{data:e.tableData,style:{width:"100%"}},{default:t(()=>[l(r,{label:"id",prop:"id"}),l(r,{label:e.useI18n().t("xhprof.set_name"),prop:"name"},null,8,["label"]),l(r,{label:e.useI18n().t("xhprof.set_ip"),prop:"ip"},null,8,["label"]),l(r,{label:e.useI18n().t("xhprof.db_tab"),prop:"db_tab"},null,8,["label"]),l(r,{align:"center",label:e.useI18n().t("option")},{default:t(a=>[l(s,{size:"mini",onClick:O=>e.open(a.$index,a.row)},{default:t(()=>[c(h(e.useI18n().t("edit")),1)]),_:2},1032,["onClick"]),l(s,{size:"mini",onClick:O=>e.Delete(a.$index,a.row)},{default:t(()=>[c(h(e.useI18n().t("delete")),1)]),_:2},1032,["onClick"])]),_:1},8,["label"])]),_:1},8,["data"]),l(o,{modelValue:e.dialogVisible,"onUpdate:modelValue":n[4]||(n[4]=a=>e.dialogVisible=a),"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:t(()=>[A("span",N,[l(s,{onClick:e.cancle},{default:t(()=>[c(h(e.useI18n().t("cancle")),1)]),_:1},8,["onClick"]),l(s,{type:"primary",onClick:e.save,loading:e.loading},{default:t(()=>[c(h(e.useI18n().t("confirm")),1)]),_:1},8,["onClick","loading"])])]),default:t(()=>[l(d,{model:e.formObj,ref:"xhprofForm",rules:e.formRules},{default:t(()=>[l(b,{label:e.useI18n().t("xhprof.set_name"),prop:"name","label-width":e.formLabelWidth},{default:t(()=>[l(f,{modelValue:e.formObj.name,"onUpdate:modelValue":n[1]||(n[1]=a=>e.formObj.name=a)},null,8,["modelValue"])]),_:1},8,["label","label-width"]),l(b,{label:e.useI18n().t("xhprof.set_ip"),prop:"ip","label-width":e.formLabelWidth},{default:t(()=>[l(f,{modelValue:e.formObj.ip,"onUpdate:modelValue":n[2]||(n[2]=a=>e.formObj.ip=a)},null,8,["modelValue"])]),_:1},8,["label","label-width"]),l(b,{label:e.useI18n().t("xhprof.db_tab"),prop:"db_tab","label-width":e.formLabelWidth},{default:t(()=>[l(f,{modelValue:e.formObj.db_tab,"onUpdate:modelValue":n[3]||(n[3]=a=>e.formObj.db_tab=a)},null,8,["modelValue"])]),_:1},8,["label","label-width"])]),_:1},8,["model","rules"])]),_:1},8,["modelValue","title"]),l(g,{pagesize:e.input.limit,total:e.pageTotal,options:e.input,render:e.getData},null,8,["pagesize","total","options","render"])],64)}var J=M(W,[["render",R]]);export{J as default};
