| 1 |
- var A=Object.defineProperty,E=Object.defineProperties;var I=Object.getOwnPropertyDescriptors;var T=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,X=Object.prototype.propertyIsEnumerable;var O=(e,o,t)=>o in e?A(e,o,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[o]=t,w=(e,o)=>{for(var t in o||(o={}))M.call(o,t)&&O(e,t,o[t]);if(T)for(var t of T(o))X.call(o,t)&&O(e,t,o[t]);return e},S=(e,o)=>E(e,I(o));var v=(e,o,t)=>new Promise((g,f)=>{var s=l=>{try{m(t.next(l))}catch(d){f(d)}},a=l=>{try{m(t.throw(l))}catch(d){f(d)}},m=l=>l.done?g(l.value):Promise.resolve(l.value).then(s,a);m((t=t.apply(e,o)).next())});import{u as k,f as j,r as K}from"./vue-vendor-Be68asQ6.js";import{v as L}from"./antd-vue-vendor-DcqS7Wvq.js";import{u as P}from"./index-D2G57Sln.js";import{E as D,u as U,F as W,n as $,G as q}from"./index-BFfnEkVs.js";import"./BasicTable-CuSLkXEu.js";import"./index-D68l__AG.js";import"./BasicForm-Cv-dsB-e.js";import"./componentMap-BUTAcOmo.js";import"./useFormItem-CtGMPcLp.js";import"./index-CETWS1o0.js";import"./BasicModal-D4gc2R81.js";import"./useTimeout-Ca5eqGu-.js";import"./vxe-table-vendor-DHF2TRpV.js";import"./useWindowSizeFn-BTSGGcie.js";import"./index-BZ_MXCtW.js";import"./index-BIPzXG41.js";import"./index-CXEQnmRq.js";import"./useIntersectionObserver-Bl62RIZ4.js";import"./download-CjoX0_mR.js";import"./base64Conver-24EVOS6V.js";import"./index-D1703ozz.js";import"./index-Bi7PIj53.js";import"./useCountdown-B7iR27pS.js";import"./useFormItemSingle-nLM0QlcI.js";import"./JSelectUser-DCwPqRxp.js";import"./props-BPxWJPuD.js";import"./JSelectBiz-Be8KsC5j.js";import"./JAddInput-BBXQvvpq.js";import"./areaDataUtil-Cik-Rc_P.js";import"./index-BOEzG86y.js";import"./index-BNFwynfr.js";import"./bem-BvvqSl-N.js";import"./props-Cw7AfxGV.js";import"./useContextMenu-BDwmjIwb.js";import"./depart.api-CDwTvdwQ.js";import"./JSelectDept-DT6g7V5M.js";import"./JPopup-DKJW27Yk.js";import"./JEllipsis-C04xKxcI.js";import"./JUpload-cB_Qj2H2.js";import"./index-iuayQczx.js";import"./index-DJQB4_Pr.js";import"./useForm-kcRIHoe0.js";import"./JAreaLinkage-BNOKwn5l.js";import"./JCodeEditor-CSivhUhT.js";import"./htmlmixed-DNSd26j0.js";import"./vue-DbzutmLn.js";/* empty css */import"./EasyCronInput-wCv2YMHn.js";import"./injectionKey-DPVn4AgL.js";const{handleExportXls:z,handleImportXls:B}=D();function qe(e){const o=U();let t={};e.designScope&&(t=W(e.designScope));const g=G(e.tableProps),[,{getForm:f,reload:s,setLoading:a},{selectedRowKeys:m}]=g;function l(){return v(this,null,function*(){var p,x;let{url:r,name:i,params:n}=(p=e==null?void 0:e.exportConfig)!=null?p:{},u=typeof r=="function"?r():r;if(u){let b=typeof i=="function"?i():i,c={};try{((x=e==null?void 0:e.tableProps)==null?void 0:x.useSearchForm)!==!1&&(c=yield f().validate())}catch(h){}if(c!=null&&c.column||Object.assign(c,{column:"createTime",order:"desc"}),n){const h=$(n)?yield n():w({},n||{});Object.keys(h).map(F=>{let R=h[F];R&&(c[F]=k(R))})}return m.value&&m.value.length>0&&(c.selections=m.value.join(",")),z(b,u,q(c))}else return o.createMessage.warn("没有传递 exportConfig.url 参数"),Promise.reject()})}function d(r){var p;let{url:i,success:n}=(p=e==null?void 0:e.importConfig)!=null?p:{},u=typeof i=="function"?i():i;return u?B(r,u,n||s):(o.createMessage.warn("没有传递 importConfig.url 参数"),Promise.reject())}function C(r,i){return new Promise((n,u)=>{var x;const p=()=>v(null,null,function*(){var b,c;try{a(!0);const h=yield r();((b=i==null?void 0:i.reload)==null||b)&&s(),((c=i==null?void 0:i.clearSelection)==null||c)&&(m.value=[]),n(h)}catch(h){u(h)}finally{a(!1)}});(x=i==null?void 0:i.confirm)==null||x?o.createConfirm({iconType:"warning",title:"删除",content:"确定要删除吗?",onOk:()=>p(),onCancel:()=>u()}):p()})}function y(r){return C(r,{confirm:!1,clearSelection:!1})}return S(w(w({},t),o),{onExportXls:l,onImportXls:d,doRequest:C,doDeleteRecord:y,tableContext:g})}function G(e){var d,C,y;const o={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:w({},o),labelCol:{xs:24,sm:8,md:6,lg:8,xl:6,xxl:6},wrapperCol:{},showAdvancedButton:!0,autoAdvancedCol:3,actionColOptions:S(w({},o),{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&&l(e.formConfig),L(t,e));function g(r){return Object.assign({column:"createTime",order:"desc"},r)}Object.assign(t,{beforeFetch:g}),typeof e.beforeFetch=="function"&&(t.beforeFetch=function(r){return r=g(r),e.beforeFetch(r),r});const f=j([]),s=j([]),a=(d=e==null?void 0:e.rowSelection)!=null?d:{},m=K(S(w({},a),{type:(C=a.type)!=null?C:"checkbox",columnWidth:(y=a.columnWidth)!=null?y:50,selectedRows:s,selectedRowKeys:f,onChange(...r){f.value=r[0],s.value=r[1],typeof a.onChange=="function"&&a.onChange(...r)}}));delete t.rowSelection;function l(r){const i=["baseColProps","labelCol"];for(let n of i)if(r&&r[n]){if(t.formConfig){let u=t.formConfig;u[n]=r[n]}r[n]={}}}return[...P(t),{selectedRows:s,selectedRowKeys:f,rowSelection:m}]}export{qe as useListPage,G as useListTable};
|