1import{v as X,x as Y,w as Z,y as J,z as E,B as tt,A as et,F as v,G as N,H as o,K as d,I as r,N as l,M as at,T as ot,Z as st,O as p,L as rt,W as _,X as A,Y as c}from"./head-11ac15ec.js";import{_ as it}from"./ModernPagination.vue_vue_type_script_setup_true_lang-11f36d97.js";import{n as lt,d as nt,o as mt,p as dt}from"./accountDevice-ce264e45.js";import{S as ct}from"./search-64fe259d.js";import{F as pt}from"./funnel-fbbc073d.js";import{P as ut}from"./plus-5bb7a22f.js";import{P as xt}from"./pen-f6af0f57.js";import{T as ht}from"./trash-2-40a9ef08.js";import"./index-8289ed30.js";import{I as ft}from"./Search-bb8dbb20.js";import{B as _t}from"./index-f2a3b70a.js";import{F as gt}from"./index-3471ade4.js";import{M as bt}from"./index-5ac0742f.js";import{_ as vt}from"./index-9e9a6589.js";import{_ as Nt}from"./index-a6486c7e.js";import{_ as yt}from"./FormItem-9cf62bec.js";import{_ as wt}from"./_plugin-vue_export-helper-c27b6911.js";import"./cn-c4c00897.js";import"./chevron-left-66bdbb6d.js";import"./createLucideIcon-892d1df9.js";import"./chevron-right-868dce62.js";import"./base-de1e3998.js";import"./FormItemContext-a613ea63.js";import"./createContext-1de3bc8e.js";import"./index-10054500.js";import"./compact-item-b431ee7b.js";import"./TextArea-bb764457.js";import"./vnode-52d7fb07.js";import"./statusUtils-3cd7db73.js";import"./index-89161eae.js";import"./ResizeObserver.es-0f9f8adb.js";import"./raf-9455150d.js";import"./omit-5647727f.js";import"./inputProps-be9c8af4.js";import"./BaseInput-7ce63069.js";import"./css-19f43f0c.js";import"./EyeOutlined-fbc82a02.js";import"./Compact-6a65c6f0.js";import"./_getTag-8c11fcb3.js";import"./index-603b3c6c.js";import"./isVisible-497559b3.js";import"./useState-cc83b0d8.js";import"./devWarning-8733ffd3.js";import"./warning-9d898064.js";import"./initDefaultProps-0241ed85.js";import"./Trigger-b0885fc7.js";import"./motion-c7a41033.js";import"./PortalWrapper-d8c3ce9d.js";import"./hasIn-e713d379.js";import"./isSymbol-e74635b2.js";import"./_arrayIncludesWith-545a7eeb.js";import"./collapseMotion-78df4731.js";import"./class-b450cc59.js";import"./debounce-1a038fa7.js";import"./toNumber-93059667.js";import"./_flatRest-487dbc78.js";import"./index-2135bf1e.js";import"./KeyCode-5c67594e.js";import"./pickAttrs-17a8a441.js";import"./zoom-3a287a72.js";import"./styleChecker-750eb6f2.js";import"./ActionButton-f3d7aa40.js";import"./index-2020e471.js";import"./index-18403940.js";import"./firstNotUndefined-29a740f3.js";import"./colors-23b21ff3.js";import"./roundedArrow-e2771650.js";import"./useMergedState-a5e5fbd8.js";import"./eagerComputed-e67f00a7.js";import"./index-73195574.js";import"./index-caff0cd5.js";import"./index-59937939.js";import"./Overflow-87e2a63f.js";import"./List-04a4d482.js";import"./isMobile-2f3de9bc.js";import"./useMemo-c6791208.js";import"./CheckOutlined-cc885d2d.js";import"./move-de4903a8.js";import"./slide-63efd0f7.js";import"./useBreakpoint-a37e6806.js";import"./responsiveObserve-6a978c72.js";import"./index-1777e642.js";import"./index-298a226f.js";import"./index-637461c2.js";import"./Checkbox-91685287.js";import"./index-039797a1.js";import"./Dropdown-0a1cabb8.js";import"./index-ceaec0d4.js";import"./shallowequal-f43756e2.js";import"./index-99158966.js";import"./Col-d5247579.js";const Lt={class:"h-full flex flex-col space-y-4 p-6 animate-in fade-in slide-in-from-bottom-2 duration-300"},Ct={class:"px-6 pb-2 mb-2"},kt={class:"flex flex-col gap-6"},Ft={class:"flex flex-col md:flex-row md:items-center justify-between gap-4"},At={class:"flex items-center gap-3"},Mt={class:"text-xl font-bold text-slate-900 tracking-tight"},zt={class:"px-2 py-0.5 bg-slate-100 text-slate-500 text-xs font-semibold rounded-full"},St={class:"flex items-center gap-3"},It={class:"relative group"},Et={class:"p-5 bg-slate-50/50 rounded-xl animate-in slide-in-from-top-2 duration-200"},Tt={class:"flex items-center justify-end gap-3"},Ut={class:"flex-1 bg-white rounded-2xl border border-gray-100 shadow-xl shadow-gray-100/50 overflow-hidden flex flex-col relative mt-2"},jt={class:"flex-1 overflow-auto custom-scrollbar relative"},qt={class:"text-sm font-semibold uppercase tracking-wider text-slate-500"},Bt={key:0,class:"font-medium text-slate-900"},Dt={key:1,class:"text-slate-500 font-mono text-xs"},Ot={key:2,class:"text-slate-500 font-mono text-xs"},Rt={key:3,class:"flex justify-center gap-1"},$t={class:"pt-6 pb-2"},Pt={class:"flex justify-end gap-3 mt-6"},Wt=X({__name:"MatrixNameList",setup(Vt){const y=Y(),T=Z(),{t}=J(),w=_(!1),k=_([]),F=_(!1),n=A({current:1,pageSize:10,total:0}),g=A({name:"",showSizeChanger:!0}),U=E(()=>[{title:t("dashboard.matrixNameList.colName"),dataIndex:"name"},{title:t("dashboard.matrixNameList.colCreatedAt"),dataIndex:"createdAt",width:180},{title:t("dashboard.matrixNameList.colUpdatedAt"),dataIndex:"updatedAt",width:180},{title:t("dashboard.matrixNameList.colActions"),dataIndex:"action",width:120,align:"center"}]),u=_(!1),L=_(!1),C=_(null),x=A({name:""}),j=E(()=>({name:[{required:!0,message:t("dashboard.matrixNameList.ruleName"),trigger:"blur"}]})),M=_(),h=async()=>{var s;F.value=!0;try{const a={page:n.current-1,size:n.pageSize};g.name&&(a.name=g.name);const e=await lt(a);if(e.data&&(e.data.code===200||e.data.code===0))if(e.data){const m=e.data.content||[];k.value=m.map(f=>({...f,createdAt:f.createdAt?f.createdAt.replace("T"," "):"-",updatedAt:f.updatedAt?f.updatedAt.replace("T"," "):"-"})),n.total=e.data.totalElements||0}else k.value=[],n.total=0;else c.error(((s=e.data)==null?void 0:s.msg)||t("dashboard.matrixNameList.msgListFail"))}catch(a){c.error(t("dashboard.matrixNameList.msgListFailWithErr",{msg:a.message}))}finally{F.value=!1}},z=()=>{n.current=1,h()},q=()=>{g.name="",n.current=1,h()},B=()=>{q()},S=()=>{L.value=!1,C.value=null,x.name="",u.value=!0},D=s=>{L.value=!0,C.value=s.id,x.name=s.name,u.value=!0},O=()=>{var s;
1(s=M.value)==null||s.validate().then(()=>{L.value?P():$()})},I=()=>{u.value=!1},R=()=>{if(y.query.autoCreate!=="1")return;S();const s={...y.query};delete s.autoCreate,T.replace({path:y.path,query:s})},$=async()=>{var s,a;try{const e=await nt(x);e.data&&(e.data.code===200||e.data.code===0)?(c.success(((s=e.data)==null?void 0:s.msg)||t("dashboard.matrixNameList.msgCreateOk")),u.value=!1,h()):c.error(((a=e.data)==null?void 0:a.msg)||t("dashboard.matrixNameList.msgCreateFail"))}catch(e){c.error(t("dashboard.matrixNameList.msgCreateFailWithErr",{msg:e.message}))}},P=async()=>{var s,a;if(C.value)try{const e=await mt(C.value,x);e.data&&(e.data.code===200||e.data.code===0)?(c.success(((s=e.data)==null?void 0:s.msg)||t("dashboard.matrixNameList.msgUpdateOk")),u.value=!1,h()):c.error(((a=e.data)==null?void 0:a.msg)||t("dashboard.matrixNameList.msgUpdateFail"))}catch(e){c.error(t("dashboard.matrixNameList.msgUpdateFailWithErr",{msg:e.message}))}},W=async s=>{var a,e;try{const m=await dt(s);m.data&&(m.data.code===200||m.data.code===0)?(c.success(((a=m.data)==null?void 0:a.msg)||t("dashboard.matrixNameList.msgDeleteOk")),h()):c.error(((e=m.data)==null?void 0:e.msg)||t("dashboard.matrixNameList.msgDeleteFail"))}catch(m){c.error(t("dashboard.matrixNameList.msgDeleteFailWithErr",{msg:m.message}))}};return tt(()=>{h()}),et(()=>y.query.autoCreate,()=>{R()},{immediate:!0}),(s,a)=>{const e=ft,m=_t,f=vt,V=Nt,Q=yt,G=gt,H=bt;return v(),N("div",Lt,[o("div",Ct,[o("div",kt,[o("div",Ft,[o("div",At,[o("h1",Mt,d(r(t)("dashboard.matrixNameList.pageTitle")),1),o("span",zt,d(n.total),1)]),o("div",St,[o("div",It,[l(r(ct),{class:"absolute left-3 top-1/2 -translate-y-1/2 text-slate-400 group-focus-within:text-emerald-500 transition-colors z-10",size:16}),l(e,{value:g.name,"onUpdate:value":a[0]||(a[0]=i=>g.name=i),placeholder:r(t)("dashboard.matrixNameList.phSearch"),class:"pl-9 w-64 !h-9 !rounded-lg !border-slate-200 !shadow-sm focus:!border-emerald-500 focus:!ring-2 focus:!ring-emerald-500/20","allow-clear":"",onPressEnter:z},null,8,["value","placeholder"])]),o("button",{onClick:a[1]||(a[1]=i=>w.value=!w.value),class:at(["flex items-center gap-2 px-3 py-2 border rounded-lg text-sm font-medium transition-colors",w.value?"bg-emerald-50 border-emerald-200 text-emerald-600":"bg-white border-slate-200 text-slate-600 hover:bg-slate-50"])},[l(r(pt),{class:"w-4 h-4"}),o("span",null,d(r(t)("dashboard.matrixNameList.filter")),1)],2),o("button",{onClick:S,class:"flex items-center gap-2 bg-slate-900 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-slate-800 transition-all shadow-sm"},[l(r(ut),{class:"w-4 h-4"}),o("span",null,d(r(t)("dashboard.matrixNameList.add")),1)])])]),ot(o("div",Et,[o("div",Tt,[o("button",{onClick:B,class:"px-4 py-1.5 text-slate-400 hover:text-slate-600 text-sm font-medium transition-colors"},d(r(t)("dashboard.matrixNameList.resetFilter")),1),o("button",{onClick:z,class:"px-8 py-1.5 bg-emerald-500 text-white rounded-lg text-sm font-medium hover:bg-emerald-600 transition-colors shadow-sm"},d(r(t)("dashboard.matrixNameList.apply")),1)])],512),[[st,w.value]])])]),o("div",Ut,[o("div",jt,[l(V,{dataSource:k.value,columns:U.value,pagination:!1,loading:F.value,class:"modern-table"},{headerCell:p(({column:i})=>[o("span",qt,d(i.title),1)]),bodyCell:p(({column:i,record:b})=>[i.dataIndex==="name"?(v(),N("span",Bt,d(b.name),1)):i.dataIndex==="createdAt"?(v(),N("span",Dt,d(b.createdAt),1)):i.dataIndex==="updatedAt"?(v(),N("span",Ot,d(b.updatedAt),1)):i.dataIndex==="action"?(v(),N("div",Rt,[l(m,{type:"link",class:"p-1 h-8 w-8 flex items-center justify-center text-slate-400 hover:text-emerald-600 hover:bg-emerald-50 rounded-lg transition-colors",onClick:K=>D(b)},{icon:p(()=>[l(r(xt),{size:16})]),_:1},8,["onClick"]),l(f,{title:r(t)("dashboard.matrixNameList.confirmDelete"),onConfirm:K=>W(b.id),"ok-text":r(t)("dashboard.matrixNameList.delete"),"cancel-text":r(t)("dashboard.matrixNameList.cancel"),okType:"danger"},{default:p(()=>[l(m,{type:"link",class:"p-1 h-8 w-8 flex items-center justify-center text-slate-400 hover:text-red-500 hover:bg-red-50 rounded-lg transition-colors"},{icon:p(()=>[l(r(ht),{size:16})]),_:1})]),_:1},8,["title","onConfirm","ok-text","cancel-text"])])):rt("",!0)]),_:1},8,["dataSource","columns","loading"])]),l(it,{page:n.current,"onUpdate:page":a[2]||(a[2]=i=>n.current=i),size:n.pageSize,"onUpdate:size":a[3]||(a[3]=i=>
1n.pageSize=i),total:n.total,onChange:h},null,8,["page","size","total"])]),l(H,{open:u.value,"onUpdate:open":a[5]||(a[5]=i=>u.value=i),title:L.value?r(t)("dashboard.matrixNameList.modalEditTitle"):r(t)("dashboard.matrixNameList.modalAddTitle"),footer:null,width:"520px","mask-closable":!1,centered:"","destroy-on-close":"","wrap-class-name":"modern-modal-wrap",onCancel:I},{default:p(()=>[o("div",$t,[l(G,{model:x,rules:j.value,ref_key:"modalFormRef",ref:M,layout:"vertical",class:"modern-form"},{default:p(()=>[l(Q,{label:r(t)("dashboard.matrixNameList.labelName"),name:"name",required:""},{default:p(()=>[l(e,{value:x.name,"onUpdate:value":a[4]||(a[4]=i=>x.name=i),placeholder:r(t)("dashboard.matrixNameList.phName"),class:"modern-input"},null,8,["value","placeholder"])]),_:1},8,["label"]),o("div",Pt,[o("button",{class:"px-6 h-9 rounded-full text-slate-500 hover:text-slate-700 hover:bg-slate-100 transition-colors",onClick:I},d(r(t)("dashboard.matrixNameList.cancel")),1),o("button",{class:"px-6 h-9 rounded-full bg-slate-900 text-white hover:bg-slate-800 shadow-md transition-colors flex items-center justify-center gap-2 min-w-[80px] disabled:opacity-50 disabled:cursor-not-allowed",onClick:O},d(r(t)("dashboard.matrixNameList.save")),1)])]),_:1},8,["model","rules"])])]),_:1},8,["open","title"])])}}});const Ma=wt(Wt,[["__scopeId","data-v-e6554359"]]);export{Ma as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.