index.CNMbDudn.js 8.0 KB

1
  1. import{O as e,k as t,m as o,a as i,x as a,q as l}from"./element-plus.DUy1TWHM.js";import{x as n,y as r,z as s,R as m}from"./index.B1CvNv-2.js";import{_ as p,a as d,P as u}from"./PageContent.v2drBSrF.js";import{P as c}from"./system.0GYJijcz.js";import{E as _}from"./xml.DHJV7eh_.js";import f from"./RuleForm.BsaIPHUV.js";import{u as h}from"./vue-router.yxIMtaxH.js";import{M as y,a_ as b,bL as j,bk as w,aL as v,u as g,I as x,bJ as k,v as C,s as R,t as z,H as I,bb as P,aU as D,q as F,aS as S}from"./@vue.DbmRtknU.js";import"./lodash-es.DaM9m3L-.js";import"./async-validator.j0i5Y79Y.js";import"./@popperjs.DxtSUbXb.js";import"./@ctrl.BEgk5vdO.js";import"./dayjs.DCWbrgJ0.js";import"./memoize-one.BAtLgO95.js";import"./normalize-wheel-es.TzhA1irr.js";import"./@floating-ui.8vigAAFV.js";import"./pinia.BlfmsheH.js";import"./@vueuse.Dnsd2JKX.js";import"./vue-i18n.DXLOBfKS.js";import"./@intlify.DPMNdUn_.js";import"./nprogress.BTjJXJ-u.js";import"./codemirror.CYSLATvI.js";import"./diff-match-patch.DkK4wJpa.js";import"./vue-web-terminal.D-rog7dz.js";import"./vue.MGxsMDTR.js";/* empty css */import"./axios.Da-QW0H8.js";import"./qs.BQjOrGHM.js";import"./side-channel.4q28KFJj.js";import"./es-errors.DTEWvbA_.js";import"./object-inspect.DvQZIv3_.js";import"./side-channel-list.Do0-XmF5.js";import"./side-channel-map.DNHQ53lO.js";import"./get-intrinsic.Bbe5x-9b.js";import"./es-object-atoms.CyiuHMUS.js";import"./math-intrinsics.pM-JTNwN.js";import"./gopd.BudZp56J.js";import"./es-define-property.F0aoeP8o.js";import"./has-symbols.BcO-SUVM.js";import"./get-proto.Cb_fpw-j.js";import"./dunder-proto.WEH3rgQR.js";import"./call-bind-apply-helpers.DJjIjCF_.js";import"./function-bind.DrnB-baK.js";import"./hasown.BXcyoiLU.js";import"./call-bound.22gFUC2Q.js";import"./side-channel-weakmap.DpSeWE6i.js";import"./pinia-plugin-persistedstate.COWkwNh5.js";import"./exceljs.DLSZe_6I.js";const T=["element-loading-text"],q={class:"data-table__toolbar--right"},L={class:"data-table__content"},A={class:"dialog-footer"},Q=y({name:"Rule",inheritAttrs:!1,__name:"index",setup(y){const Q=h(),{searchRef:V,contentRef:$,handleQueryClick:E,handleResetClick:H,refreshList:J}=r(),M=D(),{pageLoading:N,loadingText:O,execute:U}=s(),B=F(()=>Q.query.institution_id),G=S({permPrefix:"module_payment:rule",colon:!0,isExpandable:!0,showNumber:2,form:{labelWidth:"auto"},formItems:[{prop:"institution_id",label:"制度ID",type:"input",attrs:{placeholder:"请输入制度ID",clearable:!0}},{prop:"name",label:"规则名称",type:"input",attrs:{placeholder:"请输入规则名称",clearable:!0}}]}),K=S([{prop:"selection",label:"选择框",show:!1},{prop:"index",label:"序号",show:!0},{prop:"rule_id",label:"规则ID",show:!0},{prop:"institution_id",label:"制度ID",show:!0},{prop:"name",label:"规则名称",show:!0},{prop:"max_amount",label:"单笔限额",show:!0},{prop:"max_day_amount",label:"日限额",show:!0},{prop:"max_month_amount",label:"月限额",show:!0},{prop:"created_time",label:"创建时间",show:!0},{prop:"operation",label:"操作",show:!0}]),W=S({permPrefix:"module_payment:rule",pk:"rule_id",cols:K,hideColumnFilter:!1,toolbar:[],defaultToolbar:["refresh","filter"],pagination:!0,initialParams:F(()=>({institution_id:B.value})),indexAction:async e=>{var t,o;const i={page_no:e.page_no,page_size:e.page_size};e.institution_id&&(i.institution_id=e.institution_id),e.name&&(i.name=e.name);const a=await m.listRule(i);return{list:(null==(t=a.data.data)?void 0:t.items)||[],total:(null==(o=a.data.data)?void 0:o.total)||0}}}),X=S({title:"",visible:!1,type:"create"}),Y=D();function Z(e,t){X.type=e,Y.value=t,X.title="create"===e?"创建使用规则":"update"===e?"编辑使用规则":"使用规则详情",X.visible=!0}async function ee(){X.visible=!1}function te(){var e;null==(e=M.value)||e.submitForm()}function oe(){X.visible=!1,J()}return(r,s)=>{const h=a,y=o,D=i,F=t,S=b("hasPerm"),Q=e;return j((v(),g("div",{class:"app-container","element-loading-text":w(O)},[x(c,{ref_key:"searchRef",ref:V,"search-config":G,onQueryClick:w(E),onResetClick:w(H)},null,8,["search-config","onQueryClick","onResetClick"]),x(u,{ref_key:"contentRef",ref:$,"content-config":W},{toolbar:k(({toolbarRight:e,onToolbar:t,removeIds:o,cols:i})=>[x(p,{"remove-ids":o,"perm-create":["module_payment:rule:create"],onAdd:s[0]||(s[0]=e=>Z("create"))},null,8,["remove-ids"]),C("div",q,[x(d,{buttons:e,cols:i,"on-toolbar":t},null,8,["buttons","cols","on-toolbar"])])]),table:k(({data:e,loading:t,tableRef:o,onSelectionChange:i})=>[C("div",L,[j((v(),R(F,{ref:o,data:e,height:"100%",border:"",onSelectionChange:i},{empty:k(()=>[x(h,{"image-size":80,description:"暂无数据"})]),default:k(()=>{var e,t,o,i,a,n,r,p,d;return[(null==(e=K.find(e=>"selection"===e.prop))?void 0:e.show)?(v(),R(y,{key:0,type:"selection","min-width":"55",align:"center"})):z("",!0),(null==(t=K.find(e=>"rule_id"===e.prop))?void 0:t.show)?(v(),R(y,{key:"rule_id",label:"规则ID",prop:"rule_id","min-width":"150","show-overflow-tooltip":""})):z("",!0),(null==(o=K.find(e=>"institution_id"===e.prop))?void 0:o.show)?(v(),R(y,{key:"institution_id",label:"制度ID",prop:"institution_id","min-width":"150","show-overflow-tooltip":""})):z("",!0),(null==(i=K.find(e=>"name"===e.prop))?void 0:i.show)?(v(),R(y,{key:"name",label:"规则名称",prop:"name","min-width":"150","show-overflow-tooltip":""})):z("",!0),(null==(a=K.find(e=>"max_amount"===e.prop))?void 0:a.show)?(v(),R(y,{key:"max_amount",label:"单笔限额",prop:"max_amount","min-width":"100",align:"right"},{default:k(e=>[I(P(e.row.max_amount?`¥${e.row.max_amount.toFixed(2)}`:"-"),1)]),_:1})):z("",!0),(null==(n=K.find(e=>"max_day_amount"===e.prop))?void 0:n.show)?(v(),R(y,{key:"max_day_amount",label:"日限额",prop:"max_day_amount","min-width":"100",align:"right"},{default:k(e=>[I(P(e.row.max_day_amount?`¥${e.row.max_day_amount.toFixed(2)}`:"-"),1)]),_:1})):z("",!0),(null==(r=K.find(e=>"max_month_amount"===e.prop))?void 0:r.show)?(v(),R(y,{key:"max_month_amount",label:"月限额",prop:"max_month_amount","min-width":"100",align:"right"},{default:k(e=>[I(P(e.row.max_month_amount?`¥${e.row.max_month_amount.toFixed(2)}`:"-"),1)]),_:1})):z("",!0),(null==(p=K.find(e=>"created_time"===e.prop))?void 0:p.show)?(v(),R(y,{key:"created_time",label:"创建时间",prop:"created_time","min-width":"160",sortable:""})):z("",!0),(null==(d=K.find(e=>"operation"===e.prop))?void 0:d.show)?(v(),R(y,{key:8,fixed:"right",label:"操作",align:"center","min-width":"160"},{default:k(e=>[j((v(),R(D,{type:"info",size:"small",link:"",icon:"View",onClick:t=>Z("detail",e.row.rule_id)},{default:k(()=>[...s[2]||(s[2]=[I(" 详情 ",-1)])]),_:1},8,["onClick"])),[[S,["module_payment:rule:detail"]]]),j((v(),R(D,{type:"primary",size:"small",link:"",icon:"edit",onClick:t=>Z("update",e.row.rule_id)},{default:k(()=>[...s[3]||(s[3]=[I(" 编辑 ",-1)])]),_:1},8,["onClick"])),[[S,["module_payment:rule:update"]]]),j((v(),R(D,{type:"danger",size:"small",link:"",icon:"delete",onClick:t=>async function(e){e&&await U({confirmMessage:"确认删除该使用规则?",confirmTitle:"警告",confirmType:"warning",loadingText:"正在删除...",action:()=>m.deleteRule(e),onSuccess:()=>{l.success("删除成功"),J()}})}(e.row.rule_id)},{default:k(()=>[...s[4]||(s[4]=[I(" 删除 ",-1)])]),_:1},8,["onClick"])),[[S,["module_payment:rule:delete"]]])]),_:1})):z("",!0)]}),_:1},8,["data","onSelectionChange"])),[[Q,t]])])]),_:1},8,["content-config"]),x(_,{modelValue:X.visible,"onUpdate:modelValue":s[1]||(s[1]=e=>X.visible=e),title:X.title,onClose:ee},{footer:k(()=>[C("div",A,["detail"!==X.type?(v(),R(D,{key:0,type:"primary",onClick:te},{default:k(()=>[...s[5]||(s[5]=[I(" 确定 ",-1)])]),_:1})):(v(),R(D,{key:1,type:"primary",onClick:ee},{default:k(()=>[...s[6]||(s[6]=[I("确定",-1)])]),_:1})),x(D,{onClick:ee},{default:k(()=>[...s[7]||(s[7]=[I("取消",-1)])]),_:1})])]),default:k(()=>["detail"===X.type?(v(),R(n,{key:0,"rule-id":Y.value},null,8,["rule-id"])):(v(),R(f,{key:1,ref_key:"formRef",ref:M,type:X.type,"rule-id":Y.value,"institution-id":B.value,onSuccess:oe},null,8,["type","rule-id","institution-id"]))]),_:1},8,["modelValue","title"])],8,T)),[[Q,w(N)]])}}});export{Q as default};