| 1 |
- import{O as e,k as t,m as o,a as i,x as a,q as l}from"./element-plus.DYHj_7Hl.js";import{z as n,B as r,F as s,R as m}from"./index.KDUAIHt0.js";import{_ as p,a as d,P as u}from"./PageContent.DzqpeyM-.js";import{P as c}from"./tree.BFnI0hOR.js";import{E as _}from"./wechat.DyF79Qxe.js";import f from"./RuleForm.DnGWCEBb.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 k,bJ as x,v as C,s as R,t as z,H as I,bb as F,aU as D,q as P,aS as L}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.0G3dmZIi.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";import"./project.BVpot7IW.js";const S=["element-loading-text"],T={class:"data-table__toolbar--right"},q={class:"data-table__content"},A={class:"dialog-footer"},V=y({name:"Rule",inheritAttrs:!1,__name:"index",setup(y){const V=h(),{searchRef:$,contentRef:E,handleQueryClick:M,handleResetClick:Q,refreshList:B}=r(),H=D(),{pageLoading:J,loadingText:K,execute:N}=s(),O=P(()=>V.query.institution_id),U=L({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}}]}),G=L([{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=L({permPrefix:"module_payment:rule",pk:"rule_id",cols:G,hideColumnFilter:!1,toolbar:[],defaultToolbar:["refresh","filter"],pagination:!0,initialParams:P(()=>({institution_id:O.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=L({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=H.value)||e.submitForm()}function oe(){X.visible=!1,B()}return(r,s)=>{const h=a,y=o,D=i,P=t,L=b("hasPerm"),V=e;return j((v(),g("div",{class:"app-container","element-loading-text":w(K)},[k(c,{ref_key:"searchRef",ref:$,"search-config":U,onQueryClick:w(M),onResetClick:w(Q)},null,8,["search-config","onQueryClick","onResetClick"]),k(u,{ref_key:"contentRef",ref:E,"content-config":W},{toolbar:x(({toolbarRight:e,onToolbar:t,removeIds:o,cols:i})=>[k(p,{"remove-ids":o,"perm-create":["module_payment:rule:create"],onAdd:s[0]||(s[0]=e=>Z("create"))},null,8,["remove-ids"]),C("div",T,[k(d,{buttons:e,cols:i,"on-toolbar":t},null,8,["buttons","cols","on-toolbar"])])]),table:x(({data:e,loading:t,tableRef:o,onSelectionChange:i})=>[C("div",q,[j((v(),R(P,{ref:o,data:e,height:"100%",border:"",onSelectionChange:i},{empty:x(()=>[k(h,{"image-size":80,description:"暂无数据"})]),default:x(()=>{var e,t,o,i,a,n,r,p,d;return[(null==(e=G.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=G.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=G.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=G.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=G.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:x(e=>[I(F(e.row.max_amount?`¥${e.row.max_amount.toFixed(2)}`:"-"),1)]),_:1})):z("",!0),(null==(n=G.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:x(e=>[I(F(e.row.max_day_amount?`¥${e.row.max_day_amount.toFixed(2)}`:"-"),1)]),_:1})):z("",!0),(null==(r=G.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:x(e=>[I(F(e.row.max_month_amount?`¥${e.row.max_month_amount.toFixed(2)}`:"-"),1)]),_:1})):z("",!0),(null==(p=G.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=G.find(e=>"operation"===e.prop))?void 0:d.show)?(v(),R(y,{key:8,fixed:"right",label:"操作",align:"center","min-width":"160"},{default:x(e=>[j((v(),R(D,{type:"info",size:"small",link:"",icon:"View",onClick:t=>Z("detail",e.row.rule_id)},{default:x(()=>[...s[2]||(s[2]=[I(" 详情 ",-1)])]),_:1},8,["onClick"])),[[L,["module_payment:rule:detail"]]]),j((v(),R(D,{type:"primary",size:"small",link:"",icon:"edit",onClick:t=>Z("update",e.row.rule_id)},{default:x(()=>[...s[3]||(s[3]=[I(" 编辑 ",-1)])]),_:1},8,["onClick"])),[[L,["module_payment:rule:update"]]]),j((v(),R(D,{type:"danger",size:"small",link:"",icon:"delete",onClick:t=>async function(e){e&&await N({confirmMessage:"确认删除该使用规则?",confirmTitle:"警告",confirmType:"warning",loadingText:"正在删除...",action:()=>m.deleteRule(e),onSuccess:()=>{l.success("删除成功"),B()}})}(e.row.rule_id)},{default:x(()=>[...s[4]||(s[4]=[I(" 删除 ",-1)])]),_:1},8,["onClick"])),[[L,["module_payment:rule:delete"]]])]),_:1})):z("",!0)]}),_:1},8,["data","onSelectionChange"])),[[V,t]])])]),_:1},8,["content-config"]),k(_,{modelValue:X.visible,"onUpdate:modelValue":s[1]||(s[1]=e=>X.visible=e),title:X.title,onClose:ee},{footer:x(()=>[C("div",A,["detail"!==X.type?(v(),R(D,{key:0,type:"primary",onClick:te},{default:x(()=>[...s[5]||(s[5]=[I(" 确定 ",-1)])]),_:1})):(v(),R(D,{key:1,type:"primary",onClick:ee},{default:x(()=>[...s[6]||(s[6]=[I("确定",-1)])]),_:1})),k(D,{onClick:ee},{default:x(()=>[...s[7]||(s[7]=[I("取消",-1)])]),_:1})])]),default:x(()=>["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:H,type:X.type,"rule-id":Y.value,"institution-id":O.value,onSuccess:oe},null,8,["type","rule-id","institution-id"]))]),_:1},8,["modelValue","title"])],8,S)),[[V,w(J)]])}}});export{V as default};
|