1import{Q as D,as as I,a7 as T,L as G,P as a,aC as o,ar as e,aD as U,J as $,w as F,i as M,ad as b,ai as N,b as s,O as r,an as m,x as u,k as O,l as v,m as V,n as P,ac as z,o as g,p as L,av as H,aa as _}from"./index-B31J4m48.js";import{P as J}from"./PageHeader-Dq-DVp0o.js";import{l as Q,c as R,d as S}from"./groups-CsypIdTJ.js";const K=D({__name:"GroupListView",setup(h){const{t:l}=I(),w=H(),y=b([]),c=b(!1),i=b(!1),d=z({name:"",code:"",order_by:100});async function f(){c.value=!0;try{y.value=await Q()}finally{c.value=!1}}async function k(){try{await R({...d,status:10}),g.success(l("admin.common.saveOk")),i.value=!1,d.name="",d.code="",d.order_by=100,await f()}catch{g.error(l("admin.common.operationFailed"))}}async function C(p){try{await L.confirm(l("admin.common.deleteConfirm"),"",{type:"warning"})}catch{return}await S(p.id),g.success(l("admin.common.deleteOk")),await f()}function E(p){w.push({name:"admin-group-edit",params:{id:p.id}})}return T(()=>{f()}),(p,n)=>{const x=N("loading");return _(),G("div",null,[a(J,{title:e(l)("admin.groups.listTitle")},{actions:o(()=>[a(e(s),{type:"primary",onClick:n[0]||(n[0]=t=>i.value=!0)},{default:o(()=>[r(m(e(l)("admin.common.add")),1)]),_:1})]),_:1},8,["title"]),U((_(),$(e(F),{data:y.value,stripe:"",border:"",style:{width:"100%"}},{default:o(()=>[a(e(u),{prop:"id",label:"ID",width:"80"}),a(e(u),{label:e(l)("admin.groups.name"),prop:"name"},null,8,["label"]),a(e(u),{label:e(l)("admin.groups.code"),prop:"code"},null,8,["label"]),a(e(u),{label:e(l)("admin.groups.orderBy"),prop:"order_by",width:"120"},null,8,["label"]),a(e(u),{label:e(l)("admin.common.action"),width:"240",fixed:"right"},{default:o(({row:t})=>[a(e(s),{size:"small",onClick:B=>E(t)},{default:o(()=>[r(m(e(l)("admin.common.edit")),1)]),_:1},8,["onClick"]),a(e(s),{size:"small",type:"danger",disabled:t.id===1,onClick:B=>C(t)},{default:o(()=>[r(m(e(l)("admin.common.delete")),1)]),_:1},8,["disabled","onClick"])]),_:1},8,["label"])]),_:1},8,["data"])),[[x,c.value]]),a(e(M),{modelValue:i.value,"onUpdate:modelValue":n[5]||(n[5]=t=>i.value=t),title:e(l)("admin.groups.addTitle"),width:"480"},{footer:o(()=>[a(e(s),{onClick:n[4]||(n[4]=t=>i.value=!1)},{default:o(()=>[r(m(e(l)("admin.common.cancel")),1)]),_:1}),a(e(s),{type:"primary",onClick:k},{default:o(()=>[r(m(e(l)("admin.common.save")),1)]),_:1})]),default:o(()=>[a(e(O),{"label-position":"top",model:d},{default:o(()=>[a(e(v),{label:e(l)("admin.groups.name")},{default:o(()=>[a(e(V),{modelValue:d.name,"onUpdate:modelValue":n[1]||(n[1]=t=>d.name=t)},null,8,["modelValue"])]),_:1},8,["label"]),a(e(v),{label:e(l)("admin.groups.code")},{default:o(()=>[a(e(V),{modelValue:d.code,"onUpdate:modelValue":n[2]||(n[2]=t=>d.code=t)},null,8,["modelValue"])]),_:1},8,["label"]),a(e(v),{label:e(l)("admin.groups.orderBy")},{default:o(()=>[a(e(P),{modelValue:d.order_by,"onUpdate:modelValue":n[3]||(n[3]=t=>d.order_by=t)},null,8,["modelValue"])]),_:1},8,["label"])]),_:1},8,["model"])]),_:1},8,["modelValue","title"])])}}});export{K 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.