2 lines
6.1 KiB
Java
2 lines
6.1 KiB
Java
var K=Object.defineProperty,L=Object.defineProperties;var U=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable;var X=(e,i,t)=>i in e?K(e,i,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[i]=t,y=(e,i)=>{for(var t in i||(i={}))D.call(i,t)&&X(e,t,i[t]);if(M)for(var t of M(i))H.call(i,t)&&X(e,t,i[t]);return e},v=(e,i)=>L(e,U(i));var T=(e,i,t)=>new Promise((C,g)=>{var p=c=>{try{b(t.next(c))}catch(h){g(h)}},s=c=>{try{b(t.throw(c))}catch(h){g(h)}},b=c=>c.done?C(c.value):Promise.resolve(c.value).then(p,s);b((t=t.apply(e,i)).next())});import{u as W,f as k,r as _}from"./vue-vendor-C7Zq48Yl.js";import{v as $}from"./antd-vue-vendor-BPnV8VqP.js";import{u as q}from"./index-BgJbdjPf.js";import{u as z,n as B,F as G,U as J}from"./index-BI6CMai0.js";import{useMethods as N}from"./useMethods-DVip17X8.js";import"./BasicTable-DfLkrEeh.js";import"./index-Di-j2gt4.js";import"./BasicForm-BJnSRkIE.js";import"./componentMap-BBZeqR-K.js";import"./useFormItem-BdW6EoZe.js";import"./index-Du0A3ksf.js";import"./BasicModal-0sAdFEk_.js";import"./ModalHeader-keHdAHWH.js";import"./useTimeout-DDl4l82I.js";import"./vxe-table-vendor-B88kchpX.js";import"./index-DeEq83Ov.js";import"./useWindowSizeFn-PRZSD86C.js";import"./index-pxs5MULf.js";import"./index-BgYCgfME.js";import"./index-f8O7TghW.js";import"./useIntersectionObserver-BMxdTqP3.js";import"./download-UE0L9Rfp.js";import"./base64Conver-24EVOS6V.js";import"./index-CIBZG4nR.js";import"./index-BhQEwnQQ.js";import"./useCountdown-DqnNWBp6.js";import"./useFormItemSingle-BbRhswfn.js";import"./JSelectUser-B71zikzw.js";import"./props-DAezUTeZ.js";import"./JSelectBiz-CnEaVMUF.js";import"./JAddInput-D6qcyZjQ.js";import"./areaDataUtil-CbYCy3Ig.js";import"./index-CNkz_PUv.js";import"./index-CUdllngZ.js";import"./bem-EhXRi4nW.js";import"./props-D4vdsy3J.js";import"./useContextMenu-Cwx1lIOK.js";import"./depart.api-DeMNV8zW.js";import"./TreeIcon-DE4jdeZV.js";import"./JSelectDept-DRDVeruW.js";import"./JPopup-Bva6u6tk.js";import"./usePopBiz-CG0vVpgI.js";import"./index-Dg4HCEvo.js";import"./JEllipsis-DqRFTSm0.js";import"./JUpload-Cz9HN61B.js";import"./index-MGIrEF-A.js";import"./index-MREkPhsT.js";import"./useForm-BZtHZyx2.js";import"./JAreaLinkage-BeRUFHSB.js";import"./JCodeEditor-CLVZA7Uj.js";import"./htmlmixed-NhwyF9-q.js";import"./vue-CgbRSACy.js";/* empty css */import"./EasyCronInput-7xfJ3nBh.js";import"./injectionKey-DPVn4AgL.js";const{handleExportXls:Q,handleImportXls:V}=N();function tt(e){const i=z();let t={};e.designScope&&(t=B(e.designScope));const C=Y(e.tableProps),[,{getForm:g,reload:p,setLoading:s,getColumns:b},{selectedRowKeys:c}]=C;function h(){return T(this,null,function*(){var m,x,w,a,d,j,I;let{url:o,name:r,params:n}=(m=e==null?void 0:e.exportConfig)!=null?m:{},f=typeof o=="function"?o():o;if(f){let E=typeof r=="function"?r():r,u={};try{((x=e==null?void 0:e.tableProps)==null?void 0:x.useSearchForm)!==!1&&(u=yield g().validate(),(w=e==null?void 0:e.tableProps)!=null&&w.beforeFetch&&(u=yield(a=e==null?void 0:e.tableProps)==null?void 0:a.beforeFetch(u)))}catch(R){}if(u!=null&&u.column||Object.assign(u,{column:"createTime",order:"desc"}),n){const R=G(n)?yield n():y({},n||{});Object.keys(R).map(P=>{let A=R[P];A&&(u[P]=W(A))})}return c.value&&c.value.length>0&&(u.selections=c.value.join(",")),((d=e==null?void 0:e.tableProps)==null?void 0:d.showTableSetting)!==!1&&((I=(j=e==null?void 0:e.tableProps)==null?void 0:j.tableSetting)==null?void 0:I.setting)!==!1&&(yield S(u)),Q(E,f,J(u))}else return i.createMessage.warn("没有传递 exportConfig.url 参数"),Promise.reject()})}function S(o){return T(this,null,function*(){var n,f,m;let r=b();if(r&&r.length>0){let x=[],w=!1;for(const a of r)if(a.defaultHidden)w=!0;else{let d=a==null?void 0:a.dataIndex;((f=(n=a==null?void 0:a.dataIndex)==null?void 0:n.toString())==null?void 0:f.indexOf("_dictText"))!==-1&&(d=(m=a==null?void 0:a.dataIndex)==null?void 0:m.toString().replace("_dictText","")),x.push(d)}w&&(o.exportFields=x.join(","))}})}function F(o){var m;let{url:r,success:n}=(m=e==null?void 0:e.importConfig)!=null?m:{},f=typeof r=="function"?r():r;return f?V(o,f,n||p):(i.createMessage.warn("没有传递 importConfig.url 参数"),Promise.reject())}function l(o,r){return new Promise((n,f)=>{var x;const m=()=>T(null,null,function*(){var w,a;try{s(!0);const d=yield o();((w=r==null?void 0:r.reload)==null||w)&&p(),((a=r==null?void 0:r.clearSelection)==null||a)&&(c.value=[]),n(d)}catch(d){f(d)}finally{s(!1)}});(x=r==null?void 0:r.confirm)==null||x?i.createConfirm({iconType:"warning",title:"删除",content:"确定要删除吗?",onOk:()=>m(),onCancel:()=>f()}):m()})}function O(o){return l(o,{confirm:!1,clearSelection:!1})}return v(y(y({},t),i),{onExportXls:h,onImportXls:F,doRequest:l,doDeleteRecord:O,tableContext:C})}function Y(e){var h,S,F;const i={xs:24,sm:12,md:12,lg:8,xl:8,xxl:6},t={rowKey:"id",useSearchForm:!0,formConfig:{compact:!0,autoSubmitOnEnter:!0,rowProps:{gutter:8},baseColProps:y({},i),labelCol:{xs:24,sm:8,md:6,lg:8,xl:6,xxl:6},wrapperCol:{},showAdvancedButton:!0,autoAdvancedCol:3,actionColOptions:v(y({},i),{style:{textAlign:"left"}})},striped:!1,canResize:!0,minHeight:300,clickToRowSelect:!1,bordered:!0,showIndexColumn:!1,showTableSetting:!0,tableSetting:{fullScreen:!1},showActionColumn:!0,actionColumn:{width:120,title:"操作",fixed:!1,dataIndex:"action",slots:{customRender:"action"}}};e&&(e.formConfig&&c(e.formConfig),$(t,e));function C(l){return Object.assign({column:"createTime",order:"desc"},l)}Object.assign(t,{beforeFetch:C}),typeof e.beforeFetch=="function"&&(t.beforeFetch=function(l){return l=C(l),e.beforeFetch(l),l});const g=k([]),p=k([]),s=(h=e==null?void 0:e.rowSelection)!=null?h:{},b=_(v(y({},s),{type:(S=s.type)!=null?S:"checkbox",columnWidth:(F=s.columnWidth)!=null?F:50,selectedRows:p,selectedRowKeys:g,onChange(...l){g.value=l[0],p.value=l[1],typeof s.onChange=="function"&&s.onChange(...l)}}));delete t.rowSelection;function c(l){const O=["baseColProps","labelCol"];for(let o of O)if(l&&l[o]){if(t.formConfig){let r=t.formConfig;r[o]=l[o]}l[o]={}}}return[...q(t),{selectedRows:p,selectedRowKeys:g,rowSelection:b}]}export{tt as useListPage,Y as useListTable};
|