import{d as w,v as S,y as b,z as C,r as N,D as E,c as s,b as t,w as a,n,P as V,U as g,e as h,o as l,Y as p,f as e,j as D,I as $,t as _,T as u,L as f,_ as A}from"./index-FX23dEwE.js";import{s as B,d as O}from"./traffic-3Lpl9nRz.js";import{S as P,a as Y}from"./SearchUtil-_PbmflM7.js";import{f as G}from"./DateUtil-Z-8-nHP2.js";import{H as F}from"./request-dCC5BMJA.js";const H={class:"routing-rule-container"},M=["onClick"],U=w({__name:"index",setup(j){S(o=>({"686ef2ee":n(V)}));const x=b(C.PROVIDE_INJECT_KEY);let I=[{title:"ruleName",key:"ruleName",dataIndex:"ruleName",width:140},{title:"ruleGranularity",key:"ruleGranularity",dataIndex:"ruleGranularity",render:(o,c)=>c.isService?"服务":"应用",width:100},{title:"createTime",key:"createTime",dataIndex:"createTime",width:120},{title:"enabled",key:"enabled",dataIndex:"enabled",width:120},{title:"operation",key:"operation",dataIndex:"operation",width:200}];const d=N(new P([{label:"serviceGovernance",param:"keywords",placeholder:"typeRoutingRules",style:{width:"200px"}}],B,I)),R=async o=>{(await O(o)).code===F.SUCCESS&&await d.onSearch()};E(()=>{x.conditionRule=null,x.addConditionRuleSate=null,d.onSearch(),d.tableStyle={scrollX:"100",scrollY:"367px"}});const v=o=>{R(o)};return g(C.SEARCH_DOMAIN,d),(o,c)=>{const m=h("a-button"),T=h("a-popconfirm");return l(),s("div",H,[t(Y,{"search-domain":d},{customOperation:a(()=>[t(m,{type:"primary",onClick:c[0]||(c[0]=y=>n(p).push("/traffic/addRoutingRule/addByFormView"))},{default:a(()=>[e("新增条件路由规则 ")]),_:1})]),bodyCell:a(({text:y,column:r,record:i})=>[r.dataIndex==="ruleName"?(l(),s("span",{key:0,class:"rule-link",onClick:k=>n(p).push(`formview/${i[r.key]}`)},[D("b",null,[t(n($),{style:{"margin-bottom":"-2px"},icon:"material-symbols:attach-file-rounded"}),e(" "+_(y),1)])],8,M)):u("",!0),r.dataIndex==="ruleGranularity"?(l(),s(f,{key:1},[e(_(i.scope==="service"?"服务":"应用"),1)],64)):u("",!0),r.dataIndex==="enabled"?(l(),s(f,{key:2},[e(_(y?"启用":"禁用"),1)],64)):u("",!0),r.dataIndex==="createTime"?(l(),s(f,{key:3},[e(_(n(G)(i.createTime)),1)],64)):u("",!0),r.dataIndex==="operation"?(l(),s(f,{key:4},[t(m,{type:"link",onClick:k=>n(p).push(`formview/${i.ruleName}`)},{default:a(()=>[e(" 查看 ")]),_:2},1032,["onClick"]),t(m,{type:"link",onClick:k=>n(p).push(`/traffic/updateRoutingRule/updateByFormView/${i.ruleName}`)},{default:a(()=>[e(" 修改 ")]),_:2},1032,["onClick"]),t(T,{title:"确认删除该条件路由规则？","ok-text":"Yes","cancel-text":"No",onConfirm:k=>v(i.ruleName)},{default:a(()=>[t(m,{type:"link"},{default:a(()=>[e(" 删除")]),_:1})]),_:2},1032,["onConfirm"])],64)):u("",!0)]),_:1},8,["search-domain"])])}}}),q=A(U,[["__scopeId","data-v-8bc5d890"]]);export{q as default};
