官方纰漏bug修复和安全能力提升
This commit is contained in:
1 parent
459339719d
commit
ce00640ea4
148 files changed
+9524
-1701
No files matched your search
+1
@@ -0,0 +1 @@
|
||||
import{d as w,u as O,o as R,c as a,p as S,q as j,b as e,x as y,y as A,M as z,t as p,e as n,F,v as H,P as $,f as D,r,R as Y,B as M,j as o,n as J,A as G,E as I,C as K,J as Q}from"./index-DU2fjqYh.js";import{_ as W,b as x,a as X}from"./business-config-CDFDGnOE.js";const Z={class:"page-content route-list-page prototype-config-page"},ee={class:"card fill-list-card primary-list-card prototype-config-card"},te={class:"prototype-filter-bar"},se={class:"prototype-result-count"},ae={key:0,class:"prototype-loading"},oe={key:1,class:"prototype-error"},le={key:2,class:"table-wrap"},ne={class:"data-table prototype-table"},ie={key:0},de={key:1},re={key:2},ue={key:3},ce={key:0},pe={key:1},ve={key:2},me={key:3},ye=["disabled","onClick"],_e={key:1},ge={key:3,class:"prototype-empty"},be={class:"modal-head","data-dialog-drag-handle":""},fe=["disabled"],he={class:"modal-body"},ke={key:0,class:"prototype-form-error"},Ce={class:"prototype-form-grid"},Ee={class:"field full"},Te=["disabled"],Ve={class:"field full"},Ae=["disabled"],Me={class:"modal-actions"},Ie=["disabled"],xe=["disabled"],De=w({__name:"PaymentMethods",setup(Le){const _=O(),m=r([]),h=r(""),g=r("ALL"),k=r(!1),b=r(""),i=r(!1),v=r(""),C=r(null),f=r(null),u=Y({name:"",description:""}),L=M(()=>_.canEdit("ui.payment-methods.create")&&["name","description"].every(s=>_.canEdit(`dialog.payment-methods.create.${s}`))),B=M(()=>_.canEdit("ui.payment-methods.deactivate")),c=s=>_.canRead(`ui.payment-methods.column.${s}`),E=(s,t)=>s instanceof Error&&s.message?s.message:t,T=M(()=>{const s=h.value.toLocaleLowerCase();return m.value.filter(t=>(g.value==="ALL"||t.status===g.value)&&(!s||[t.code,t.name,t.description].some(d=>String(d||"").toLocaleLowerCase().includes(s)))).sort((t,d)=>t.code.localeCompare(d.code,"zh-CN"))}),N=async()=>{k.value=!0,b.value="";try{m.value=await x.paymentMethods()}catch(s){b.value=E(s,"付款方式加载失败")}finally{k.value=!1}},P=async()=>{var s;Object.assign(u,{name:"",description:""}),v.value="",await G(),(s=f.value)==null||s.showModal()},V=()=>{var s;i.value||(s=f.value)==null||s.close()},U=async()=>{var s;if(!u.name||!u.description)return void(v.value="请完整填写付款方式和适用说明");i.value=!0,v.value="";try{const t=await x.create("payment-methods",{...u});m.value.push(t),(s=f.value)==null||s.close(),I.success("付款方式已新增")}catch(t){v.value=E(t,"保存失败,请稍后重试")}finally{i.value=!1}},q=async s=>{const t=s.status==="ACTIVE"?"INACTIVE":"ACTIVE";try{await K.confirm(`确认${t==="ACTIVE"?"启用":"停用"}“${s.name}”?`,"状态确认",{type:"warning"})}catch{return}C.value=s.id;try{const d=await x.changeStatus("payment-methods",s.id,t);m.value.splice(m.value.findIndex(l=>l.id===s.id),1,d),I.success(`付款方式已${t==="ACTIVE"?"启用":"停用"}`)}catch(d){I.error(E(d,"状态更新失败"))}finally{C.value=null}};return R(()=>{N()}),(s,t)=>{const d=Q("dialog-drag");return o(),a("div",Z,[S(W,{eyebrow:"PAYMENT METHODS",title:"付款方式",description:"维护登记付款时允许选择的方式;停用后不再出现在登记付款表单中。"},{default:j(()=>[L.value?(o(),a("button",{key:0,class:"btn primary",onClick:P}," + 新增付款方式 ")):n("",!0)]),_:1}),t[12]||(t[12]=e("div",{class:"prototype-governance-note"},[e("strong",null,"编码规则"),e("span",null,"付款方式编码由系统在保存时统一生成,无需手工填写。")],-1)),e("section",ee,[e("div",te,[y(e("input",{"onUpdate:modelValue":t[0]||(t[0]=l=>h.value=l),type:"search",placeholder:"搜索付款方式或适用说明"},null,512),[[A,h.value,void 0,{trim:!0}]]),y(e("select",{"onUpdate:modelValue":t[1]||(t[1]=l=>g.value=l)},[...t[4]||(t[4]=[e("option",{value:"ALL"},"全部状态",-1),e("option",{value:"ACTIVE"},"启用",-1),e("option",{value:"INACTIVE"},"停用",-1)])],512),[[z,g.value]]),t[5]||(t[5]=e("span",{class:"prototype-filter-spacer"},null,-1)),e("span",se,"共 "+p(T.value.length)+" 种",1)]),k.value?(o(),a("div",ae,[...t[6]||(t[6]=[e("span",{class:"loader"},null,-1),e("span",null,"正在加载付款方式…",-1)])])):b.value?(o(),a("div",oe,[e("span",null,p(b.value),1),e("button",{class:"btn small",onClick:N},"重试")])):T.value.length?(o(),a("div",le,[e("table",ne,[e("thead",null,[e("tr",null,[c("code")?(o(),a("th",ie,"方式编码")):n("",!0),c("name")?(o(),a("th",de,"付款方式")):n("",!0),c("description")?(o(),a("th",re,"适用说明")):n("",!0),c("status")?(o(),a("th",ue,"状态")):n("",!0),t[7]||(t[7]=e("th",null,"操作",-1))])]),e("tbody",null,[(o(!0),a(F,null,H(T.value,l=>(o(),a("tr",{key:l.id},[c("code")?(o(),a("td",ce,[e("strong",null,p(l.code),1)])):n("",!0),c("name")?(o(),a("td",pe,p(l.name),1)):n("",!0),c("description")?(o(),a("td",ve,p(l.description),1)):n("",!0),c("status")?(o(),a("td",me,[S(X,{active:l.status==="ACTIVE"},null,8,["active"])])):n("",!0),e("td",null,[B.value?(o(),a("button",{key:0,class:J(["prototype-table-action",{danger:l.status==="ACTIVE"}]),disabled:C.value===l.id,onClick:Ne=Line truncated
|
||||