Files
aiot-platform-ui/apps/web-antd/dist/js/use-vxe-grid-DphpfoAg.js

2 lines
8.7 KiB
JavaScript
Raw Normal View History

2026-03-24 09:30:39 +08:00
var Be=Object.defineProperty,Pe=Object.defineProperties;var Le=Object.getOwnPropertyDescriptors;var le=Object.getOwnPropertySymbols;var $e=Object.prototype.hasOwnProperty,Fe=Object.prototype.propertyIsEnumerable;var Z=(n,t,s)=>t in n?Be(n,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):n[t]=s,b=(n,t)=>{for(var s in t||(t={}))$e.call(t,s)&&Z(n,s,t[s]);if(le)for(var s of le(t))Fe.call(t,s)&&Z(n,s,t[s]);return n},j=(n,t)=>Pe(n,Le(t));var T=(n,t,s)=>Z(n,typeof t!="symbol"?t+"":t,s);var P=(n,t,s)=>new Promise((v,d)=>{var V=i=>{try{k(s.next(i))}catch(B){d(B)}},L=i=>{try{k(s.throw(i))}catch(B){d(B)}},k=i=>i.done?v(i.value):Promise.resolve(i.value).then(V,L);k((s=s.apply(n,t)).next())});import{cz as x,cy as Re,cn as Ee,R as O,i as Ge,cF as be,m as he,bC as ze,aa as m,bB as Ae,bZ as He,w as _e,v as Me,x as Ne,ad as Q,b2 as z,j as D,ag as ue,bJ as p,bb as ce,bc as f,ac as A,ae as de,ai as me,ab as pe,bp as X,u as r,aS as S,aw as C,bL as je,aR as fe,cd as K,aT as De,aQ as qe,br as Ie,n as Ue,aW as Je,L as We}from"../jse/index-index-CbCBcLyX.js";import{b6 as Ze,b1 as Qe,u as Xe,$ as H,bG as Ke,b3 as Ye,bH as et,aZ as tt,am as ot,b7 as st}from"./bootstrap-D-ZoMY6-.js";import{u as at,V as ge,a as rt,b as nt,e as it}from"./vxe-table-BNufXesY.js";function lt(){return{class:"",gridClass:"",gridOptions:{},gridEvents:{},formOptions:void 0,showSearchForm:!0}}class ut{constructor(t={}){T(this,"formApi",{});T(this,"grid",{});T(this,"state",null);T(this,"store");T(this,"isMounted",!1);T(this,"stateHandler");const s=b({},t),v=lt();this.store=new Ze(x(s,v),{onUpdate:()=>{this.state=this.store.state}}),this.state=this.store.state,this.stateHandler=new Re,Ee(this)}mount(t,s){!this.isMounted&&t&&(this.grid=t,this.formApi=s,this.stateHandler.setConditionTrue(),this.isMounted=!0)}query(){return P(this,arguments,function*(t={}){try{yield this.grid.commitProxy("query",O(t))}catch(s){console.error("Error occurred while querying:",s)}})}reload(){return P(this,arguments,function*(t={}){try{yield this.grid.commitProxy("reload",O(t))}catch(s){console.error("Error occurred while reloading:",s)}})}setGridOptions(t){this.setState({gridOptions:t})}setLoading(t){this.setState({gridOptions:{loading:t}})}setState(t){Ge(t)?this.store.setState(s=>x(t(s),s)):this.store.setState(s=>x(t,s))}toggleSearchForm(t){var s,v;return this.setState({showSearchForm:be(t)?t:!((s=this.state)!=null&&s.showSearchForm)}),(v=this.state)==null?void 0:v.showSearchForm}unmount(){this.isMounted=!1,this.stateHandler.reset()}}const ct={class:"mr-1 pl-1 text-[1rem]"},dt={class:"mt-2"},Y="form-",q="toolbar-actions",I="toolbar-tools",mt="table-title",pt=he({__name:"use-vxe-grid",props:{api:{},tableTitle:{},tableTitleHelp:{},class:{},gridClass:{},gridOptions:{},gridEvents:{},formOptions:{},showSearchForm:{type:Boolean},separator:{type:[Boolean,Object]}},setup(n){var M,se;const t=n,s=ze("gridRef"),v=(se=(M=t.api)==null?void 0:M.useStore)==null?void 0:se.call(M),{gridOptions:d,class:V,gridClass:L,gridEvents:k,formOptions:i,tableTitle:B,tableTitleHelp:ee,showSearchForm:$,separator:y}=Qe(t,v),{isMobile:ve}=Xe(),U=m(()=>!i.value||$.value===!1||y.value===!1?!1:y.value===!0||y.value===void 0?!0:y.value.show!==!1),te=m(()=>!y.value||be(y.value)||!y.value.backgroundColor?void 0:y.value.backgroundColor),l=Ae(),[ye,c]=at({compact:!0,handleSubmit:()=>P(null,null,function*(){const e=yield c.getValues();c.setLatestSubmissionValues(O(e)),t.api.reload(e)}),handleReset:()=>P(null,null,function*(){var a;const e=yield c.getValues();yield c.resetForm();const o=yield c.getValues();c.setLatestSubmissionValues(o),(Ke(e,o)||!((a=i.value)!=null&&a.submitOnChange))&&t.api.reload(o)}),commonConfig:{componentProps:{class:"w-full"}},showCollapseButton:!0,submitButtonOptions:{content:m(()=>H("common.search"))},wrapperClass:"grid-cols-1 md:grid-cols-2 lg:grid-cols-3"}),J=m(()=>{var e;return!!((e=l[mt])!=null&&e.call(l))||B.value}),W=m(()=>{var e,o;return!!((e=l[q])!=null&&e.call(l))||!!((o=l[I])!=null&&o.call(l))||J.value}),Se=m(()=>{var g,h,w,F,R,E,G;const e=(g=l[q])==null?void 0:g.call(l),o=(h=l[I])==null?void 0:h.c