import{p as c}from"./common.7ac8c0a9.js";import{B as K}from"./request.e6b427ef.js";import{_ as L,r as i,o as A,c as B,a,q as C,b as e,w as l,d as r,p as I,e as E}from"./index.fa63d907.js";const U={name:"MyService",data(){return{BASE_IMAGE_URL:K,tableData:[],serviceCount:0,listQuery:{isLimit:!0,page:1,limit:10,key:"",name:""},form:{},dialogVisible:!1}},created(){this.getList()},methods:{copy(t){let o=t,p=document.createElement("input");p.value=o,document.body.appendChild(p),p.select(),document.execCommand("Copy"),p.remove(),this.$message.success("\u590D\u5236\u6210\u529F")},handleSizeChange(t){this.listQuery.limit=t,this.getList()},handleCurrentChange(t){this.listQuery.page=t,this.getList()},deleteKey(t){this.$confirm("\u662F\u5426\u5220\u9664\u5F53\u524DKey?","\u63D0\u793A",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(()=>{c("/CimAuthKey/Delete",[t]).then(o=>{o.code==200&&(this.$message.success("\u5220\u9664\u6210\u529F"),this.getList())})}).catch(()=>{this.$message.info("\u5DF2\u53D6\u6D88")})},keyDetail(t){c("/CimAuthKey/GetById?Id="+t).then(o=>{o.code==200&&(this.form=o.result,this.dialogVisible=!0)})},getList(){c("/CimAuthKey/Load",this.listQuery).then(t=>{t.code==200&&(this.tableData=t.data,this.serviceCount=t.count)})},submit(){c("/CimAuthKey/AddOrUpdate",this.form).then(t=>{t.code==200&&(this.form={},this.$message.success("\u521B\u5EFA\u6210\u529F"),this.dialogVisible=!1,this.getList())})}}},b=t=>(I("data-v-6b5534d1"),t=t(),E(),t),M={class:"header"},Q=b(()=>a("span",null,"\u6211\u7684\u5BC6\u94A5",-1)),G={style:{"font-size":"12px","margin-left":"12px"}},N=r("\u5171\u6709"),P={style:{color:"#F56C6C"}},T=r("\u6761\u5E94\u7528\u5BC6\u94A5"),R={style:{float:"right"}},j=r(" \u521B\u5EFA\u5E94\u7528 "),q={class:"service-container",style:{"padding-top":"6px"}},F=r(" \u7F16\u8F91 "),O=b(()=>a("span",{style:{color:"#e1e1e1",margin:"0px 12px"}},"\xA0|\xA0",-1)),H=r(" \u5220\u9664 "),J={class:"page-nation-container"},W={class:"dialog-footer"},X=r("\u53D6\u6D88"),Y=r("\u63D0\u4EA4");function Z(t,o,p,$,s,d){const v=i("CirclePlus"),m=i("el-icon"),u=i("el-link"),_=i("el-table-column"),k=i("DocumentCopy"),x=i("Edit"),V=i("Delete"),z=i("el-table"),w=i("el-pagination"),f=i("el-input"),h=i("el-form-item"),D=i("el-form"),y=i("el-button"),S=i("el-dialog");return A(),B("div",null,[a("div",M,[Q,a("span",G,[N,a("span",P,C('"'+s.serviceCount+'"'),1),T]),a("div",R,[e(u,{type:"primary",underline:!1,onClick:o[0]||(o[0]=n=>{s.form={},s.dialogVisible=!0})},{default:l(()=>[e(m,{style:{position:"relative",top:"2px"}},{default:l(()=>[e(v)]),_:1}),j]),_:1})])]),a("div",q,[e(z,{data:s.tableData,style:{width:"100%"},size:"small"},{default:l(()=>[e(_,{prop:"name",label:"Key\u540D\u79F0",width:"180"}),e(_,{prop:"key",label:"Key"},{default:l(n=>[r(C(n.row.key),1),e(m,{style:{cursor:"pointer",position:"relative",top:"-5px",left:"3px"},onClick:g=>d.copy(n.row.key)},{default:l(()=>[e(k)]),_:2},1032,["onClick"])]),_:1}),e(_,{prop:"remark",label:"Key\u63CF\u8FF0"}),e(_,{label:"\u64CD\u4F5C",width:"150"},{default:l(n=>[e(u,{type:"primary",underline:!1,style:{"font-size":"12px"},onClick:g=>d.keyDetail(n.row.id)},{default:l(()=>[e(m,{style:{position:"relative",top:"2px"}},{default:l(()=>[e(x)]),_:1}),F]),_:2},1032,["onClick"]),O,e(u,{type:"danger",underline:!1,style:{"font-size":"12px"},onClick:g=>d.deleteKey(n.row.id)},{default:l(()=>[e(m,{style:{position:"relative",top:"2px"}},{default:l(()=>[e(V)]),_:1}),H]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),a("div",J,[e(w,{onSizeChange:d.handleSizeChange,onCurrentChange:d.handleCurrentChange,"current-page":t.currentPage4,"page-sizes":[5,10,20,30,50],"page-size":t.list,layout:"total, sizes, prev, pager, next, jumper",total:s.serviceCount},null,8,["onSizeChange","onCurrentChange","current-page","page-size","total"])]),e(S,{modelValue:s.dialogVisible,"onUpdate:modelValue":o[5]||(o[5]=n=>s.dialogVisible=n),title:"\u5E94\u7528\u4FE1\u606F",width:"30%","before-close":t.handleClose,size:"mini",top:"180px"},{footer:l(()=>[a("span",W,[e(y,{size:"mini",onClick:o[3]||(o[3]=n=>s.dialogVisible=!1)},{default:l(()=>[X]),_:1}),e(y,{size:"mini",type:"primary",onClick:o[4]||(o[4]=n=>d.submit())},{default:l(()=>[Y]),_:1})])]),default:l(()=>[e(D,{model:s.form,"label-width":"120px",size:"mini"},{default:l(()=>[e(h,{label:"\u5E94\u7528\u540D\u79F0"},{default:l(()=>[e(f,{modelValue:s.form.name,"onUpdate:modelValue":o[1]||(o[1]=n=>s.form.name=n)},null,8,["modelValue"])]),_:1}),e(h,{label:"\u5E94\u7528\u5907\u6CE8"},{default:l(()=>[e(f,{modelValue:s.form.remark,"onUpdate:modelValue":o[2]||(o[2]=n=>s.form.remark=n)},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","before-close"])])}var le=L(U,[["render",Z],["__scopeId","data-v-6b5534d1"]]);export{le as default};
