| 1 |
- import{O as e,k as t,m as o,a as i,x as a,q as l}from"./element-plus.ea_38_Np.js";import{y as n,z as r,R as s}from"./index.CAsHN19g.js";import{_ as m,a as p,P as d}from"./PageContent.BWZ1SYEB.js";import{P as u}from"./wechat.CzwKjB00.js";import{E as c}from"./sql.gdS9ilkj.js";import _ from"./RuleForm.DWGCY2Pe.js";import{a as f}from"./time.PBG2ZM_I.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 D,aU as F,q as P,aS as q}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 L=["element-loading-text"],S={class:"data-table__toolbar--right"},T={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:H}=n(),J=F(),{pageLoading:N,loadingText:O,execute:U}=r(),B=P(()=>V.query.institution_id),G=q({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=q([{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=q({permPrefix:"module_payment:rule",pk:"rule_id",cols:K,hideColumnFilter:!1,toolbar:[],defaultToolbar:["refresh","filter"],pagination:!0,initialParams:P(()=>({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 s.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=q({title:"",visible:!1,type:"create"}),Y=F();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=J.value)||e.submitForm()}function oe(){X.visible=!1,H()}return(n,r)=>{const h=a,y=o,F=i,P=t,q=b("hasPerm"),V=e;return j((v(),g("div",{class:"app-container","element-loading-text":w(O)},[k(u,{ref_key:"searchRef",ref:$,"search-config":G,onQueryClick:w(M),onResetClick:w(Q)},null,8,["search-config","onQueryClick","onResetClick"]),k(d,{ref_key:"contentRef",ref:E,"content-config":W},{toolbar:x(({toolbarRight:e,onToolbar:t,removeIds:o,cols:i})=>[k(m,{"remove-ids":o,"perm-create":["module_payment:rule:create"],onAdd:r[0]||(r[0]=e=>Z("create"))},null,8,["remove-ids"]),C("div",S,[k(p,{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",T,[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,m,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:x(e=>[I(D(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:x(e=>[I(D(e.row.max_day_amount?`¥${e.row.max_day_amount.toFixed(2)}`:"-"),1)]),_:1})):z("",!0),(null==(m=K.find(e=>"max_month_amount"===e.prop))?void 0:m.show)?(v(),R(y,{key:"max_month_amount",label:"月限额",prop:"max_month_amount","min-width":"100",align:"right"},{default:x(e=>[I(D(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:x(e=>[j((v(),R(F,{type:"info",size:"small",link:"",icon:"View",onClick:t=>Z("detail",e.row.rule_id)},{default:x(()=>[...r[2]||(r[2]=[I(" 详情 ",-1)])]),_:1},8,["onClick"])),[[q,["module_payment:rule:detail"]]]),j((v(),R(F,{type:"primary",size:"small",link:"",icon:"edit",onClick:t=>Z("update",e.row.rule_id)},{default:x(()=>[...r[3]||(r[3]=[I(" 编辑 ",-1)])]),_:1},8,["onClick"])),[[q,["module_payment:rule:update"]]]),j((v(),R(F,{type:"danger",size:"small",link:"",icon:"delete",onClick:t=>async function(e){e&&await U({confirmMessage:"确认删除该使用规则?",confirmTitle:"警告",confirmType:"warning",loadingText:"正在删除...",action:()=>s.deleteRule(e),onSuccess:()=>{l.success("删除成功"),H()}})}(e.row.rule_id)},{default:x(()=>[...r[4]||(r[4]=[I(" 删除 ",-1)])]),_:1},8,["onClick"])),[[q,["module_payment:rule:delete"]]])]),_:1})):z("",!0)]}),_:1},8,["data","onSelectionChange"])),[[V,t]])])]),_:1},8,["content-config"]),k(c,{modelValue:X.visible,"onUpdate:modelValue":r[1]||(r[1]=e=>X.visible=e),title:X.title,onClose:ee},{footer:x(()=>[C("div",A,["detail"!==X.type?(v(),R(F,{key:0,type:"primary",onClick:te},{default:x(()=>[...r[5]||(r[5]=[I(" 确定 ",-1)])]),_:1})):(v(),R(F,{key:1,type:"primary",onClick:ee},{default:x(()=>[...r[6]||(r[6]=[I("确定",-1)])]),_:1})),k(F,{onClick:ee},{default:x(()=>[...r[7]||(r[7]=[I("取消",-1)])]),_:1})])]),default:x(()=>["detail"===X.type?(v(),R(f,{key:0,"rule-id":Y.value},null,8,["rule-id"])):(v(),R(_,{key:1,ref_key:"formRef",ref:J,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,L)),[[V,w(N)]])}}});export{V as default};
|