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

2 lines
8.7 KiB
JavaScript
Raw Normal View History

2025-12-28 01:40:21 +08:00
var Pe=Object.defineProperty,Be=Object.defineProperties;var Le=Object.getOwnPropertyDescriptors;var le=Object.getOwnPropertySymbols;var Re=Object.prototype.hasOwnProperty,$e=Object.prototype.propertyIsEnumerable;var Q=(n,t,a)=>t in n?Pe(n,t,{enumerable:!0,configurable:!0,writable:!0,value:a}):n[t]=a,b=(n,t)=>{for(var a in t||(t={}))Re.call(t,a)&&Q(n,a,t[a]);if(le)for(var a of le(t))$e.call(t,a)&&Q(n,a,t[a]);return n},j=(n,t)=>Be(n,Le(t));var T=(n,t,a)=>Q(n,typeof t!="symbol"?t+"":t,a);var B=(n,t,a)=>new Promise((v,d)=>{var V=i=>{try{k(a.next(i))}catch(P){d(P)}},L=i=>{try{k(a.throw(i))}catch(P){d(P)}},k=i=>i.done?v(i.value):Promise.resolve(i.value).then(V,L);k((a=a.apply(n,t)).next())});import{cy as O,cx as Ee,cm as Fe,R as x,i as Ae,cE as be,m as he,bC as Ge,aa as m,bB as ze,bY as He,w as _e,v as Me,x as Ne,ad as X,b2 as G,j as D,ag as ue,bJ as p,bb as ce,bc as f,ac as z,ae as de,ai as me,ab as pe,bp as Y,u as r,aS as S,aw as C,bL as je,aR as fe,cc as K,aT as De,aQ as qe,br as Ie,n as Ue,aW as Je,L as We}from"../jse/index-index-DaIpbNAe.js";import{aP as Qe,aQ as Xe,u as Ye,$ as H,aR as Ke,aS as Ze,aT as et,aU as tt,am as ot,aV as at}from"./bootstrap-DZnIDovD.js";import{u as st,V as ge,a as rt,b as nt,e as it}from"./vxe-table-aWWk9byK.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 a=b({},t),v=lt();this.store=new Qe(O(a,v),{onUpdate:()=>{this.state=this.store.state}}),this.state=this.store.state,this.stateHandler=new Ee,Fe(this)}mount(t,a){!this.isMounted&&t&&(this.grid=t,this.formApi=a,this.stateHandler.setConditionTrue(),this.isMounted=!0)}query(){return B(this,arguments,function*(t={}){try{yield this.grid.commitProxy("query",x(t))}catch(a){console.error("Error occurred while querying:",a)}})}reload(){return B(this,arguments,function*(t={}){try{yield this.grid.commitProxy("reload",x(t))}catch(a){console.error("Error occurred while reloading:",a)}})}setGridOptions(t){this.setState({gridOptions:t})}setLoading(t){this.setState({gridOptions:{loading:t}})}setState(t){Ae(t)?this.store.setState(a=>O(t(a),a)):this.store.setState(a=>O(t,a))}toggleSearchForm(t){var a,v;return this.setState({showSearchForm:be(t)?t:!((a=this.state)!=null&&a.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"},Z="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,ae;const t=n,a=Ge("gridRef"),v=(ae=(M=t.api)==null?void 0:M.useStore)==null?void 0:ae.call(M),{gridOptions:d,class:V,gridClass:L,gridEvents:k,formOptions:i,tableTitle:P,tableTitleHelp:ee,showSearchForm:R,separator:y}=Xe(t,v),{isMobile:ve}=Ye(),U=m(()=>!i.value||R.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=ze(),[ye,c]=st({compact:!0,handleSubmit:()=>B(null,null,function*(){const e=yield c.getValues();c.setLatestSubmissionValues(x(e)),t.api.reload(e)}),handleReset:()=>B(null,null,function*(){var s;const e=yield c.getValues();yield c.resetForm();const o=yield c.getValues();c.setLatestSubmissionValues(o),(Ke(e,o)||!((s=i.value)!=null&&s.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))||P.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,$,E,F,A;const e=(g=l[q])==null?void 0:g.call(l),o=(h=l[I])==null?void 0:h.c