Files
financial_system_frontend/dist/assets/Currencies-DaA9ktx3.js
T

2 lines
3.7 KiB
JavaScript

import{d as C,u as L,o as V,c as o,p as b,b as e,x as _,y as E,M as g,t as i,e as n,F as A,v as P,r as u,B as S,j as a}from"./index-DU2fjqYh.js";import{b as w,a as x,_ as N}from"./business-config-CDFDGnOE.js";const B={class:"page-content route-list-page prototype-config-page"},I={class:"card fill-list-card primary-list-card prototype-config-card"},U={class:"prototype-filter-bar"},M={class:"prototype-result-count"},R={key:0,class:"prototype-loading"},T={key:1,class:"prototype-error"},$={key:2,class:"table-wrap",tabindex:"0"},j={class:"data-table prototype-table"},D={key:0},F={key:1},q={key:2},z={key:3},G={key:4},H={key:0},J={key:1},K={key:2},O={key:3},Q={key:4},W={key:3,class:"prototype-empty"},ee=C({__name:"Currencies",setup(X){const k=L(),f=u([]),v=u(""),d=u("ALL"),c=u("code"),m=u(!1),p=u(""),l=r=>k.canRead(`ui.currencies.column.${r}`),y=S(()=>{const r=v.value.toLocaleLowerCase();return f.value.filter(t=>(d.value==="ALL"||t.status===d.value)&&(!r||[t.code,t.name].some(s=>s.toLocaleLowerCase().includes(r)))).sort((t,s)=>c.value==="decimalPlaces"?t.decimalPlaces-s.decimalPlaces:String(t[c.value]).localeCompare(String(s[c.value]),"zh-CN"))}),h=async()=>{m.value=!0,p.value="";try{f.value=await w.currencies()}catch(r){p.value=r instanceof Error&&r.message?r.message:"币种加载失败"}finally{m.value=!1}};return V(()=>{h()}),(r,t)=>(a(),o("div",B,[b(N,{eyebrow:"CURRENCIES",title:"币种",description:"系统只保存原币标识和显示信息;预算、申请及导出按币种分组。"}),t[7]||(t[7]=e("div",{class:"prototype-exchange-card"},[e("div",null,[e("strong",null,"汇率"),e("span",null,"平台保留原币,不内置汇率;需要换算时以实际业务规则和外部牌价为准。")]),e("a",{class:"btn",href:"https://www.boc.cn/sourcedb/whpj/",target:"_blank",rel:"noreferrer"},"查看中国银行牌价 ↗")],-1)),e("section",I,[e("div",U,[_(e("input",{"onUpdate:modelValue":t[0]||(t[0]=s=>v.value=s),type:"search",placeholder:"搜索币种代码或中文名称"},null,512),[[E,v.value,void 0,{trim:!0}]]),_(e("select",{"onUpdate:modelValue":t[1]||(t[1]=s=>d.value=s)},[...t[3]||(t[3]=[e("option",{value:"ALL"},"全部状态",-1),e("option",{value:"ACTIVE"},"启用",-1),e("option",{value:"INACTIVE"},"停用",-1)])],512),[[g,d.value]]),_(e("select",{"onUpdate:modelValue":t[2]||(t[2]=s=>c.value=s)},[...t[4]||(t[4]=[e("option",{value:"code"},"币种代码升序",-1),e("option",{value:"name"},"中文名称升序",-1),e("option",{value:"decimalPlaces"},"小数位升序",-1)])],512),[[g,c.value]]),t[5]||(t[5]=e("span",{class:"prototype-filter-spacer"},null,-1)),e("span",M,"共 "+i(y.value.length)+" 种币种",1)]),m.value?(a(),o("div",R,[...t[6]||(t[6]=[e("span",{class:"loader"},null,-1),e("span",null,"正在加载币种…",-1)])])):p.value?(a(),o("div",T,[e("span",null,i(p.value),1),e("button",{class:"btn small",onClick:h},"重试")])):y.value.length?(a(),o("div",$,[e("table",j,[e("thead",null,[e("tr",null,[l("code")?(a(),o("th",D,"币种代码")):n("",!0),l("name")?(a(),o("th",F,"中文名称")):n("",!0),l("symbol")?(a(),o("th",q,"货币符号")):n("",!0),l("decimalPlaces")?(a(),o("th",z,"小数位")):n("",!0),l("status")?(a(),o("th",G,"状态")):n("",!0)])]),e("tbody",null,[(a(!0),o(A,null,P(y.value,s=>(a(),o("tr",{key:s.id},[l("code")?(a(),o("td",H,[e("strong",null,i(s.code),1)])):n("",!0),l("name")?(a(),o("td",J,i(s.name),1)):n("",!0),l("symbol")?(a(),o("td",K,i(s.symbol),1)):n("",!0),l("decimalPlaces")?(a(),o("td",O,i(s.decimalPlaces),1)):n("",!0),l("status")?(a(),o("td",Q,[b(x,{active:s.status==="ACTIVE","active-label":"预置启用"},null,8,["active"])])):n("",!0)]))),128))])])])):(a(),o("div",W,"没有符合当前筛选条件的币种。"))])]))}});export{ee as default};