官方纰漏bug修复和安全能力提升

This commit is contained in:
Weiming committed 2026-12-02 14:12:35 +08:00
1 parent 459339719d
commit ce00640ea4
148 files changed
+9524 -1701

No files matched your search

+1
View File
@@ -0,0 +1 @@
import{d as X,u as Y,o as Z,c as a,p as j,q as ee,b as t,x as y,y as z,M as A,F as T,v as V,t as o,e as i,P as U,f as R,r as d,R as te,B as h,j as n,n as le,A as P,E as q,C as se,J as ae}from"./index-DU2fjqYh.js";import{_ as ne,b as N,a as oe}from"./business-config-CDFDGnOE.js";const ie={class:"page-content route-list-page prototype-config-page"},de={class:"card fill-list-card primary-list-card prototype-config-card"},ue={class:"prototype-filter-bar"},re=["value"],ce={class:"prototype-result-count"},ve={key:0,class:"prototype-loading"},pe={key:1,class:"prototype-error"},ye={key:2,class:"table-wrap",tabindex:"0"},ge={class:"data-table prototype-table"},me={key:0},be={key:1},_e={key:2},Ce={key:3},fe={key:4},Ee={key:0},ke={key:1},Ie={key:2},Ae={key:3},Te={key:4},Ve={class:"prototype-row-actions"},he=["onClick"],Ne=["disabled","onClick"],Le={key:3,class:"prototype-empty"},Se={class:"modal-head","data-dialog-drag-handle":""},xe=["disabled"],$e={class:"modal-body"},De={key:0,class:"prototype-form-error"},Me={class:"prototype-form-grid"},Oe={class:"field full"},Ue=["disabled"],Re={class:"field"},qe=["disabled"],Be=["value"],Fe={class:"field"},we=["disabled"],je=["value"],ze={class:"modal-actions"},Pe=["disabled"],Je=["disabled"],Ge={class:"app-dialog__panel"},He={class:"modal-head","data-dialog-drag-handle":""},Ke={class:"modal-body"},Qe={key:0,class:"prototype-spec-grid"},We={class:"modal-actions"},et=X({__name:"CostCenters",setup(Xe){const C=Y(),b=d([]),L=d([]),B=d([]),S=d(""),f=d("ALL"),E=d("ALL"),x=d(!1),k=d(""),r=d(!1),m=d(""),$=d(null),I=d(null),_=d(null),g=d(null),u=te({name:"",legalEntityId:null,managerOpenId:""}),F=h(()=>C.canEdit("ui.cost-centers.create")&&["name","legalEntityId","managerName"].every(s=>C.canEdit(`dialog.cost-centers.create.${s}`))),J=h(()=>C.canEdit("ui.cost-centers.deactivate")),c=s=>C.canRead(`ui.cost-centers.column.${s}`),G=h(()=>L.value.filter(s=>s.status==="ACTIVE")),D=(s,e)=>s instanceof Error&&s.message?s.message:e,M=h(()=>{const s=S.value.toLocaleLowerCase();return b.value.filter(e=>(E.value==="ALL"||e.status===E.value)&&(f.value==="ALL"||String(e.legalEntityId)===f.value)&&(!s||[e.code,e.name,e.managerName,e.legalEntityName].some(v=>String(v||"").toLocaleLowerCase().includes(s)))).sort((e,v)=>e.code.localeCompare(v.code,"zh-CN"))}),w=async()=>{x.value=!0,k.value="";try{const[s,e]=await Promise.all([N.costCenters(),N.references()]);b.value=s,L.value=e.legalEntities||[],B.value=e.employees||[]}catch(s){k.value=D(s,"成本中心加载失败")}finally{x.value=!1}},H=async()=>{var s;Object.assign(u,{name:"",legalEntityId:null,managerOpenId:""}),m.value="",await P(),(s=I.value)==null||s.showModal()},O=()=>{var s;r.value||(s=I.value)==null||s.close()},K=async()=>{var s;if(m.value="",!u.name||!u.legalEntityId||!u.managerOpenId)return void(m.value="请完整填写成本中心名称、法人主体和负责人");r.value=!0;try{const e=await N.create("cost-centers",{...u});b.value.push(e),(s=I.value)==null||s.close(),q.success("成本中心已创建")}catch(e){m.value=D(e,"保存失败,请稍后重试")}finally{r.value=!1}},Q=async s=>{var e;g.value=s,await P(),(e=_.value)==null||e.showModal()},W=async s=>{const e=s.status==="ACTIVE"?"INACTIVE":"ACTIVE";try{await se.confirm(`确认${e==="ACTIVE"?"启用":"停用"}“${s.name}”?`,"状态确认",{type:"warning"})}catch{return}$.value=s.id;try{const v=await N.changeStatus("cost-centers",s.id,e);b.value.splice(b.value.findIndex(l=>l.id===s.id),1,v),q.success(`成本中心已${e==="ACTIVE"?"启用":"停用"}`)}catch(v){q.error(D(v,"状态更新失败"))}finally{$.value=null}};return Z(()=>{w()}),(s,e)=>{const v=ae("dialog-drag");return n(),a("div",ie,[j(ne,{eyebrow:"FINANCIAL MASTER DATA",title:"成本中心",description:"按法人主体维护费用承担组织和负责人,供申请、预算与财务处理统一引用。"},{default:ee(()=>[F.value?(n(),a("button",{key:0,class:"btn primary",type:"button",onClick:H}," + 新增成本中心 ")):i("",!0)]),_:1}),e[27]||(e[27]=t("div",{class:"prototype-governance-note"},[t("strong",null,"归属约束"),t("span",null,"每个成本中心必须归属于一个启用中的法人主体;存在有效预算台账时不能停用。")],-1)),t("section",de,[t("div",ue,[y(t("input",{"onUpdate:modelValue":e[0]||(e[0]=l=>S.value=l),type:"search",placeholder:"搜索编码、名称或负责人"},null,512),[[z,S.value,void 0,{trim:!0}]]),y(t("select",{"onUpdate:modelValue":e[1]||(e[1]=l=>f.value=l)},[e[9]||(e[9]=t("option",{value:"ALL"},"全部法人主体",-1)),(n(!0),a(T,null,V(L.value,l=>(n(),a("option",{key:l.id,value:String(l.id)},o(l.name),9,re))),128))],512),[[A,f.value]]),y(t("select",{"onUpdate:modelValue":e[2]||(e[2]=l=>E.value=l)},[...e[10]||(e[10]=[t("option",{value:"ALL"},"全部状态",-1),t("option",{value:"ACTIVE"},"启用",-1),t("option",{value:"INACTIVE"},"停用",-1)])],512),[[A,E.value]]),e[11]||(e[11]=t("span",{class:"prototype-filter-spacer"},null,-1)),t("span",ce,"共 "+o(M.value.leLine truncated
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.