From 54a49ce04342c972d5e5794e510efaee1e1a2fcf Mon Sep 17 00:00:00 2001 From: weiwait Date: Mon, 2 Jan 2023 14:29:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E4=BA=9B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/assets/js/index.js | 2 +- version.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/assets/js/index.js b/resources/assets/js/index.js index aa600c6..1f0b043 100644 --- a/resources/assets/js/index.js +++ b/resources/assets/js/index.js @@ -2504,4 +2504,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho * pinia v2.0.28 * (c) 2022 Eduardo San Martin Morote * @license MIT - */let VC;const Vc=e=>VC=e,YC=Symbol();function Ap(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Ya;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Ya||(Ya={}));function cH(){const e=Ry(!0),t=e.run(()=>A({}));let n=[],r=[];const o=mo({install(i){Vc(o),o._a=i,i.provide(YC,o),i.config.globalProperties.$pinia=o,r.forEach(a=>n.push(a)),r=[]},use(i){return!this._a&&!uH?r.push(i):n.push(i),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return o}const qC=()=>{};function yy(e,t,n,r=qC){e.push(t);const o=()=>{const i=e.indexOf(t);i>-1&&(e.splice(i,1),r())};return!n&&k_()&&D_(o),o}function $i(e,...t){e.slice().forEach(n=>{n(...t)})}function Ip(e,t){e instanceof Map&&t instanceof Map&&t.forEach((n,r)=>e.set(r,n)),e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],o=e[n];Ap(o)&&Ap(r)&&e.hasOwnProperty(n)&&!Vt(r)&&!co(r)?e[n]=Ip(o,r):e[n]=r}return e}const dH=Symbol();function fH(e){return!Ap(e)||!e.hasOwnProperty(dH)}const{assign:oo}=Object;function hH(e){return!!(Vt(e)&&e.effect)}function pH(e,t,n,r){const{state:o,actions:i,getters:a}=t,l=n.state.value[e];let s;function u(){l||(n.state.value[e]=o?o():{});const c=l2(n.state.value[e]);return oo(c,i,Object.keys(a||{}).reduce((d,h)=>(d[h]=mo(D(()=>{Vc(n);const v=n._s.get(e);return a[h].call(v,v)})),d),{}))}return s=XC(e,u,t,n,r,!0),s.$reset=function(){const d=o?o():{};this.$patch(h=>{oo(h,d)})},s}function XC(e,t,n={},r,o,i){let a;const l=oo({actions:{}},n),s={deep:!0};let u,c,d=mo([]),h=mo([]),v;const p=r.state.value[e];!i&&!p&&(r.state.value[e]={}),A({});let y;function b(x){let P;u=c=!1,typeof x=="function"?(x(r.state.value[e]),P={type:Ya.patchFunction,storeId:e,events:v}):(Ip(r.state.value[e],x),P={type:Ya.patchObject,payload:x,storeId:e,events:v});const _=y=Symbol();Xt().then(()=>{y===_&&(u=!0)}),c=!0,$i(d,P,r.state.value[e])}const m=qC;function g(){a.stop(),d=[],h=[],r._s.delete(e)}function O(x,P){return function(){Vc(r);const _=Array.from(arguments),T=[],k=[];function $(U){T.push(U)}function M(U){k.push(U)}$i(h,{args:_,name:x,store:C,after:$,onError:M});let F;try{F=P.apply(this&&this.$id===e?this:C,_)}catch(U){throw $i(k,U),U}return F instanceof Promise?F.then(U=>($i(T,U),U)).catch(U=>($i(k,U),Promise.reject(U))):($i(T,F),F)}}const w={_p:r,$id:e,$onAction:yy.bind(null,h),$patch:b,$reset:m,$subscribe(x,P={}){const _=yy(d,x,P.detached,()=>T()),T=a.run(()=>tt(()=>r.state.value[e],k=>{(P.flush==="sync"?c:u)&&x({storeId:e,type:Ya.direct,events:v},k)},oo({},s,P)));return _},$dispose:g},C=vo(w);r._s.set(e,C);const S=r._e.run(()=>(a=Ry(),a.run(()=>t())));for(const x in S){const P=S[x];if(Vt(P)&&!hH(P)||co(P))i||(p&&fH(P)&&(Vt(P)?P.value=p[x]:Ip(P,p[x])),r.state.value[e][x]=P);else if(typeof P=="function"){const _=O(x,P);S[x]=_,l.actions[x]=P}}return oo(C,S),oo(ut(C),S),Object.defineProperty(C,"$state",{get:()=>r.state.value[e],set:x=>{b(P=>{oo(P,x)})}}),r._p.forEach(x=>{oo(C,a.run(()=>x({store:C,app:r._a,pinia:r,options:l})))}),p&&i&&n.hydrate&&n.hydrate(C.$state,p),u=!0,c=!0,C}function vH(e,t,n){let r,o;const i=typeof t=="function";typeof e=="string"?(r=e,o=i?n:t):(o=e,r=e.id);function a(l,s){const u=Rr();return l=l||u&&Be(YC,null),l&&Vc(l),l=VC,l._s.has(r)||(i?XC(r,t,o,l):pH(r,o,l)),l._s.get(r)}return a.$id=r,a}const KC=e=>{let t="",n=Math.floor(e/26);n>0&&(t=KC(n-1),e=e%26);let r=String.fromCharCode(65+e);return t+r},Uo=class{constructor(){Tn(this,"timeouts",{})}addMark(t,n){this.timeouts[t]=n}static debounce(t,n,r=500){const o=Uo.getInstance();o.timeouts[t]&&clearTimeout(o.timeouts[t]),o.addMark(t,setTimeout(n,r))}static getInstance(){return Uo.instance||(Uo.instance=new Uo),Uo.instance}};let Xs=Uo;Tn(Xs,"instance");const jo=class{static getPinia(){return jo.instance||(jo.instance=new jo,jo.pinia=cH()),jo.pinia}};let Ma=jo;Tn(Ma,"instance"),Tn(Ma,"pinia");const Fp=vH("form",()=>{const e=vo({}),t=vo({});function n(a,l){const s=le(a);e[le(s)]=l}function r(a,l=void 0){const s=le(a);return e[s]||n(s,A(l)),e[s]}function o(a,l){const s=le(a);l(e[s]),t[s]=tt(()=>e[s],()=>{l(e[s])},{deep:!0})}function i(a){const l=le(a);t[l]&&t[l]()}return{setField:n,getField:r,fields:e,watchField:o,cleanupWatch:i}}),mH=["name","value"],gH=["name","value"],bH={style:{display:"flex","align-items":"center",width:"100%"}},yH=["name","value"],wH=["name","value"],xH=["name","value"],CH=["required","disabled","name"],_H=["name"],SH=he({__name:"KeyValue",setup(e){const t=Be("provides"),n=A(t.name),r=A(t.value);Fp().setField(n,r);function o(a){r.value=a.map((l,s)=>{var c;let u="";return t.keys.length?u=t.keys[s]:u=KC(s),{key:u,value:(c=le(l))==null?void 0:c.value}})}function i(a){o(a)}return Ot(()=>{o(r.value)}),(a,l)=>(De(),Ue(Ve,null,[le(t).is_serial?(De(),Ue(Ve,{key:1},[He(le(Cp),{value:r.value,"onUpdate:value":l[1]||(l[1]=s=>r.value=s),"on-update:value":i,"show-sort-button":le(t).is_sortable},{default:ot(({value:s})=>[zn("div",bH,[He(le(xn),{value:s.key,"onUpdate:value":u=>s.key=u,style:{"margin-right":"12px",width:"160px","text-align":"center"},disabled:!0},null,8,["value","onUpdate:value"]),He(le(xn),{value:s.value,"onUpdate:value":u=>s.value=u,type:"text"},null,8,["value","onUpdate:value"])])]),_:1},8,["value","show-sort-button"]),le(t).is_list?(De(!0),Ue(Ve,{key:1},Vn(r.value,s=>(De(),Ue("input",{type:"hidden",name:n.value+"[values][]",value:s.value},null,8,xH))),256)):(De(!0),Ue(Ve,{key:0},Vn(r.value,s=>(De(),Ue(Ve,null,[zn("input",{type:"hidden",name:n.value+"[keys][]",value:s.key},null,8,yH),zn("input",{type:"hidden",name:n.value+"[values][]",value:s.value},null,8,wH)],64))),256))],64)):(De(),Ue(Ve,{key:0},[He(le(Cp),{value:r.value,"onUpdate:value":l[0]||(l[0]=s=>r.value=s),preset:"pair","key-placeholder":"\u8BF7\u8F93\u5165"+le(t).keyLabel,"value-placeholder":"\u8BF7\u8F93\u5165\u503C"+le(t).valueLabel,"show-sort-button":le(t).is_sortable},null,8,["value","key-placeholder","value-placeholder","show-sort-button"]),(De(!0),Ue(Ve,null,Vn(r.value,s=>(De(),Ue(Ve,null,[zn("input",{type:"hidden",name:n.value+"[keys][]",value:s.key},null,8,mH),zn("input",{type:"hidden",name:n.value+"[values][]",value:s.value},null,8,gH)],64))),256))],64)),le(t).attributes.required?(De(),Ue("input",{key:2,type:"text",required:!r.value.length,disabled:!!r.value.length,name:`${n.value}_is_required`,style:{display:"none"}},null,8,CH)):Dt("",!0),r.value.length?Dt("",!0):(De(),Ue("input",{key:3,type:"hidden",name:n.value,value:"_def_"},null,8,_H))],64))}});class OH{constructor(t,n,r,o,i,a,l){Tn(this,"Map");Tn(this,"Marker");Tn(this,"lng");Tn(this,"lat");Tn(this,"detail");Tn(this,"zoom");Tn(this,"container","");Tn(this,"urls");Tn(this,"addressUpdatedHandler");this.container=t,this.urls=n,this.addressUpdatedHandler=r,this.lat=o,this.lng=i,this.detail=a,this.zoom=l,this.lat.value||navigator.geolocation.getCurrentPosition(s=>{this.lat.value=s.coords.latitude,this.lng.value=s.coords.longitude,this.setCenter().markerPosition()},s=>{console.log(s)})}address2ll(t){return new Promise(n=>{ur.get(this.urls.address2ll,{params:{address:t}}).then(({data:r})=>{n(r.result.location)})})}ll2address(t,n){return new Promise(r=>{ur.get(this.urls.ll2address,{params:{lat:t,lng:n}}).then(({data:o})=>{r(o.result)})})}}class $H extends OH{constructor(t,n,r,o,i,a,l){super(t,n,r,o,i,a,l),this.Map=new TMap.Map(document.getElementById(this.container),{center:new TMap.LatLng(this.getLat(),this.getLng()),zoom:l.value}),this.Marker=new TMap.MultiMarker({map:this.Map,geometries:[{id:"position",position:new TMap.LatLng(this.getLat(),this.getLng())}]}),this.Map.on("click",s=>{this.markerPosition(s.latLng.lat,s.latLng.lng),this.toLatLngLocation(s.latLng.lat,s.latLng.lng)}),this.Map.on("zoom",()=>{Xs.debounce(this.container+"-zoom",()=>{l.value=this.Map.getZoom()})})}setCenter(t=null,n=null){return this.Map.setCenter(new TMap.LatLng(this.getLat(t),this.getLng(n))),this}markerPosition(t=null,n=null){let r=this.Marker.getGeometryById("position");return Object.assign(r,{position:new TMap.LatLng(this.getLat(t),this.getLng(n))}),this.Marker.updateGeometries([r]),this}getLat(t){return t||this.lat.value||39.98412}getLng(t){return t||this.lng.value||116.307484}toAddressLocation(t){return this.address2ll(t).then(({lat:n,lng:r})=>{this.setCenter(n,r).markerPosition(n,r)}),this}toLatLngLocation(t=null,n){return this.ll2address(this.getLat(t),this.getLng(n)).then(({ad_info:r,pois:o})=>{var a;this.addressUpdatedHandler(r.adcode),t&&(this.lat.value=t),n&&(this.lng.value=n);const i=o[0];i&&(this.detail.value=(a=(i.address+i.title).replace(i.ad_info.province+i.ad_info.city+i.ad_info.district,""))!=null?a:null)}),this}destroy(){this.Map.destroy()}}const PH=["id"],TH=["name","value"],RH=["name","value"],kH=["name","value"],DH=["name","value"],MH=["name","value"],EH=["name","value"],zH=["name","value"],AH=he({__name:"DistPicker",setup(e){HS($=>({aa3e063e:le(d)}));const t=Be("provides"),n={...t.value},r=A(n[t.provinceField]*1||null),o=A(n[t.cityField]*1||null),i=A(n[t.districtField]*1||null),a=A(n[t.detailField]||null),l=A(n[t.latField]||null),s=A(n[t.lngField]||null),u=A(n[t.zoomField]*1||t.zoom),c={},d=t.height;async function h($){if(c.hasOwnProperty($))return c[$];const{data:M}=await ur.get(t.urls.regions,{params:{pcode:$}});return c[$]=M.items.map(F=>(t.disables.includes(F.value)&&(F.disabled=!0),F)),M.items}const v=A();h("0").then($=>v.value=$);function p(){var $;return($=v.value.find(M=>M.value===r.value))==null?void 0:$.label}const y=A([]);r.value&&h(String(r.value)).then($=>y.value=$);function b($,M=""){h($).then(F=>y.value=F),o.value=null,g.value=[],i.value=null}function m(){var $;return($=y.value.find(M=>M.value==o.value))==null?void 0:$.label}const g=A([]);o.value&&h(String(o.value)).then($=>g.value=$);function O($,M="",F=!0){h($).then(U=>g.value=U),i.value=null,F&&(x==null||x.toAddressLocation(p()+m()+w()))}function w(){var $;return($=g.value.find(M=>M.value==i.value))==null?void 0:$.label}function C($){x==null||x.toAddressLocation(p()+m()+w())}function S($){if(!$)return 0;h($.slice(0,4)+"00").then(M=>{g.value=M;const F=M.find(U=>U.value==$);i.value=F.value,h(String(F.pcode).slice(0,2)+"0000").then(U=>{y.value=U,o.value=F.pcode;const Y=U.find(Z=>Z.value==o.value);r.value=Y.pcode})})}let x=null;function P(){x==null||x.toLatLngLocation(l.value,s.value).setCenter().markerPosition()}function _(){x==null||x.toLatLngLocation(l.value,s.value).setCenter()}function T(){x==null||x.toAddressLocation(p()+m()+w()+a.value)}function k(){x=new $H(t.areaId,t.urls,S,l,s,a,u)}return Ot(()=>{t.disableMap||(window.addEventListener("imported.map.wemap",k,{once:!0}),window.dispatchEvent(new CustomEvent("import.map.wemap")))}),yl(()=>{x==null||x.destroy()}),($,M)=>(De(),Ue(Ve,null,[He(le(fa),null,{default:ot(()=>[le(t).provinceField||le(t).cityField||le(t).districtField?(De(),Un(le(Ws),{key:0,value:r.value,"onUpdate:value":[M[0]||(M[0]=F=>r.value=F),b],filterable:"",clearable:"",placeholder:"-- \u7701 --",options:v.value,"consistent-menu-width":!1},null,8,["value","options"])):Dt("",!0),le(t).provinceField||le(t).cityField||le(t).districtField?(De(),Un(le(Ws),{key:1,value:o.value,"onUpdate:value":[M[1]||(M[1]=F=>o.value=F),O],filterable:"",clearable:"",placeholder:"-- \u5E02 --",options:y.value,"consistent-menu-width":!1},null,8,["value","options"])):Dt("",!0),le(t).provinceField||le(t).cityField||le(t).districtField?(De(),Un(le(Ws),{key:2,value:i.value,"onUpdate:value":[M[2]||(M[2]=F=>i.value=F),C],filterable:"",clearable:"",placeholder:"-- \u533A/\u53BF --",options:g.value,"consistent-menu-width":!1},null,8,["value","options"])):Dt("",!0),le(t).latField?(De(),Un(le(SI),{key:3},{default:ot(()=>[He(le(xn),{placeholder:"\u7EAC\u5EA6",value:l.value,"onUpdate:value":M[3]||(M[3]=F=>l.value=F),onKeydown:La(Ba(P,["prevent"]),["enter"])},null,8,["value","onKeydown"]),He(le(xn),{placeholder:"\u7ECF\u5EA6",value:s.value,"onUpdate:value":M[4]||(M[4]=F=>s.value=F),onKeydown:La(Ba(_,["prevent"]),["enter"])},null,8,["value","onKeydown"])]),_:1})):Dt("",!0)]),_:1}),le(t).detailField?(De(),Un(le(xn),{key:0,placeholder:"\u8BE6\u7EC6\u5730\u5740",value:a.value,"onUpdate:value":M[5]||(M[5]=F=>a.value=F),autosize:"",clearable:"",style:{"margin-top":"18px","min-width":"50%"},onKeydown:La(Ba(T,["prevent"]),["enter"])},null,8,["value","onKeydown"])):Dt("",!0),le(t).disableMap?Dt("",!0):(De(),Ue("div",{key:1,id:le(t).areaId,class:"map-container"},null,8,PH)),le(t).provinceField?(De(),Ue("input",{key:2,type:"hidden",name:le(t).provinceField,value:r.value},null,8,TH)):Dt("",!0),le(t).cityField?(De(),Ue("input",{key:3,type:"hidden",name:le(t).cityField,value:o.value},null,8,RH)):Dt("",!0),le(t).districtField?(De(),Ue("input",{key:4,type:"hidden",name:le(t).districtField,value:i.value},null,8,kH)):Dt("",!0),le(t).detailField?(De(),Ue("input",{key:5,type:"hidden",name:le(t).detailField,value:a.value},null,8,DH)):Dt("",!0),le(t).latField?(De(),Ue("input",{key:6,type:"hidden",name:le(t).latField,value:l.value},null,8,MH)):Dt("",!0),le(t).lngField?(De(),Ue("input",{key:7,type:"hidden",name:le(t).lngField,value:s.value},null,8,EH)):Dt("",!0),le(t).zoomField?(De(),Ue("input",{key:8,type:"hidden",name:le(t).zoomField,value:u.value},null,8,zH)):Dt("",!0)],64))}}),IH=["required","disabled","name"],FH=["name","value"],BH=he({__name:"Select",setup(e){const t=Be("provides"),n=A([]),r=A(t.name),o=A();return o.value=t.options.map((i,a)=>({label:t.concatSeparator?`${a}${t.concatSeparator}${i}`:i,value:a})),t.optionsFromKeyValueField&&Fp().watchField(t.optionsFromKeyValueField,i=>{o.value=i==null?void 0:i.filter(a=>!!a.value).map(a=>({label:t.concatSeparator?`${a.key}${t.concatSeparator}${a.value}`:a.value,value:a.key}))}),yl(()=>{Fp().cleanupWatch(t.optionsFromKeyValueField)}),(i,a)=>(De(),Ue(Ve,null,[He(le(Ws),{value:n.value,"onUpdate:value":a[0]||(a[0]=l=>n.value=l),filterable:"",clearable:"",placeholder:le(t).placeholder,options:o.value},null,8,["value","placeholder","options"]),le(t).attributes.required?(De(),Ue("input",{key:0,type:"text",required:!n.value.length,disabled:!!n.value.length,name:`${r.value}_is_required`,style:{display:"none"}},null,8,IH)):Dt("",!0),zn("input",{type:"hidden",name:r.value,value:n.value},null,8,FH)],64))}});function LH(e){return e.component("File",KL).component("CheckBox",ZL).component("Image",GN).component("Tag",eH).component("DateRange",oH).component("List",sH).component("KeyValue",SH).component("DistPicker",AH).component("Select",BH),e}const NH=function(){const e=nO(_9);return e.use(Ma.getPinia()),LH(e),e};export default NH; + */let VC;const Vc=e=>VC=e,YC=Symbol();function Ap(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var Ya;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(Ya||(Ya={}));function cH(){const e=Ry(!0),t=e.run(()=>A({}));let n=[],r=[];const o=mo({install(i){Vc(o),o._a=i,i.provide(YC,o),i.config.globalProperties.$pinia=o,r.forEach(a=>n.push(a)),r=[]},use(i){return!this._a&&!uH?r.push(i):n.push(i),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return o}const qC=()=>{};function yy(e,t,n,r=qC){e.push(t);const o=()=>{const i=e.indexOf(t);i>-1&&(e.splice(i,1),r())};return!n&&k_()&&D_(o),o}function $i(e,...t){e.slice().forEach(n=>{n(...t)})}function Ip(e,t){e instanceof Map&&t instanceof Map&&t.forEach((n,r)=>e.set(r,n)),e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const r=t[n],o=e[n];Ap(o)&&Ap(r)&&e.hasOwnProperty(n)&&!Vt(r)&&!co(r)?e[n]=Ip(o,r):e[n]=r}return e}const dH=Symbol();function fH(e){return!Ap(e)||!e.hasOwnProperty(dH)}const{assign:oo}=Object;function hH(e){return!!(Vt(e)&&e.effect)}function pH(e,t,n,r){const{state:o,actions:i,getters:a}=t,l=n.state.value[e];let s;function u(){l||(n.state.value[e]=o?o():{});const c=l2(n.state.value[e]);return oo(c,i,Object.keys(a||{}).reduce((d,h)=>(d[h]=mo(D(()=>{Vc(n);const v=n._s.get(e);return a[h].call(v,v)})),d),{}))}return s=XC(e,u,t,n,r,!0),s.$reset=function(){const d=o?o():{};this.$patch(h=>{oo(h,d)})},s}function XC(e,t,n={},r,o,i){let a;const l=oo({actions:{}},n),s={deep:!0};let u,c,d=mo([]),h=mo([]),v;const p=r.state.value[e];!i&&!p&&(r.state.value[e]={}),A({});let y;function b(x){let P;u=c=!1,typeof x=="function"?(x(r.state.value[e]),P={type:Ya.patchFunction,storeId:e,events:v}):(Ip(r.state.value[e],x),P={type:Ya.patchObject,payload:x,storeId:e,events:v});const _=y=Symbol();Xt().then(()=>{y===_&&(u=!0)}),c=!0,$i(d,P,r.state.value[e])}const m=qC;function g(){a.stop(),d=[],h=[],r._s.delete(e)}function O(x,P){return function(){Vc(r);const _=Array.from(arguments),T=[],k=[];function $(U){T.push(U)}function M(U){k.push(U)}$i(h,{args:_,name:x,store:C,after:$,onError:M});let F;try{F=P.apply(this&&this.$id===e?this:C,_)}catch(U){throw $i(k,U),U}return F instanceof Promise?F.then(U=>($i(T,U),U)).catch(U=>($i(k,U),Promise.reject(U))):($i(T,F),F)}}const w={_p:r,$id:e,$onAction:yy.bind(null,h),$patch:b,$reset:m,$subscribe(x,P={}){const _=yy(d,x,P.detached,()=>T()),T=a.run(()=>tt(()=>r.state.value[e],k=>{(P.flush==="sync"?c:u)&&x({storeId:e,type:Ya.direct,events:v},k)},oo({},s,P)));return _},$dispose:g},C=vo(w);r._s.set(e,C);const S=r._e.run(()=>(a=Ry(),a.run(()=>t())));for(const x in S){const P=S[x];if(Vt(P)&&!hH(P)||co(P))i||(p&&fH(P)&&(Vt(P)?P.value=p[x]:Ip(P,p[x])),r.state.value[e][x]=P);else if(typeof P=="function"){const _=O(x,P);S[x]=_,l.actions[x]=P}}return oo(C,S),oo(ut(C),S),Object.defineProperty(C,"$state",{get:()=>r.state.value[e],set:x=>{b(P=>{oo(P,x)})}}),r._p.forEach(x=>{oo(C,a.run(()=>x({store:C,app:r._a,pinia:r,options:l})))}),p&&i&&n.hydrate&&n.hydrate(C.$state,p),u=!0,c=!0,C}function vH(e,t,n){let r,o;const i=typeof t=="function";typeof e=="string"?(r=e,o=i?n:t):(o=e,r=e.id);function a(l,s){const u=Rr();return l=l||u&&Be(YC,null),l&&Vc(l),l=VC,l._s.has(r)||(i?XC(r,t,o,l):pH(r,o,l)),l._s.get(r)}return a.$id=r,a}const KC=e=>{let t="",n=Math.floor(e/26);n>0&&(t=KC(n-1),e=e%26);let r=String.fromCharCode(65+e);return t+r},Uo=class{constructor(){Tn(this,"timeouts",{})}addMark(t,n){this.timeouts[t]=n}static debounce(t,n,r=500){const o=Uo.getInstance();o.timeouts[t]&&clearTimeout(o.timeouts[t]),o.addMark(t,setTimeout(n,r))}static getInstance(){return Uo.instance||(Uo.instance=new Uo),Uo.instance}};let Xs=Uo;Tn(Xs,"instance");const jo=class{static getPinia(){return jo.instance||(jo.instance=new jo,jo.pinia=cH()),jo.pinia}};let Ma=jo;Tn(Ma,"instance"),Tn(Ma,"pinia");const Fp=vH("form",()=>{const e=vo({}),t=vo({});function n(a,l){const s=le(a);e[le(s)]=l}function r(a,l=void 0){const s=le(a);return e[s]||n(s,A(l)),e[s]}function o(a,l){const s=le(a);l(e[s]),t[s]=tt(()=>e[s],()=>{l(e[s])},{deep:!0})}function i(a){const l=le(a);t[l]&&t[l]()}return{setField:n,getField:r,fields:e,watchField:o,cleanupWatch:i}}),mH=["name","value"],gH=["name","value"],bH={style:{display:"flex","align-items":"center",width:"100%"}},yH=["name","value"],wH=["name","value"],xH=["name","value"],CH=["required","disabled","name"],_H=["name"],SH=he({__name:"KeyValue",setup(e){const t=Be("provides"),n=A(t.name),r=A(t.value);Fp().setField(n,r);function o(a){r.value=a.map((l,s)=>{var c;let u="";return t.keys.length?u=t.keys[s]:u=KC(s),{key:u,value:(c=le(l))==null?void 0:c.value}})}function i(a){o(a)}return Ot(()=>{o(r.value)}),(a,l)=>(De(),Ue(Ve,null,[le(t).is_serial?(De(),Ue(Ve,{key:1},[He(le(Cp),{value:r.value,"onUpdate:value":l[1]||(l[1]=s=>r.value=s),"on-update:value":i,"show-sort-button":le(t).is_sortable},{default:ot(({value:s})=>[zn("div",bH,[He(le(xn),{value:s.key,"onUpdate:value":u=>s.key=u,style:{"margin-right":"12px",width:"160px","text-align":"center"},disabled:!0},null,8,["value","onUpdate:value"]),He(le(xn),{value:s.value,"onUpdate:value":u=>s.value=u,type:"text"},null,8,["value","onUpdate:value"])])]),_:1},8,["value","show-sort-button"]),le(t).is_list?(De(!0),Ue(Ve,{key:1},Vn(r.value,s=>(De(),Ue("input",{type:"hidden",name:n.value+"[values][]",value:s.value},null,8,xH))),256)):(De(!0),Ue(Ve,{key:0},Vn(r.value,s=>(De(),Ue(Ve,null,[zn("input",{type:"hidden",name:n.value+"[keys][]",value:s.key},null,8,yH),zn("input",{type:"hidden",name:n.value+"[values][]",value:s.value},null,8,wH)],64))),256))],64)):(De(),Ue(Ve,{key:0},[He(le(Cp),{value:r.value,"onUpdate:value":l[0]||(l[0]=s=>r.value=s),preset:"pair","key-placeholder":"\u8BF7\u8F93\u5165"+le(t).keyLabel,"value-placeholder":"\u8BF7\u8F93\u5165\u503C"+le(t).valueLabel,"show-sort-button":le(t).is_sortable},null,8,["value","key-placeholder","value-placeholder","show-sort-button"]),(De(!0),Ue(Ve,null,Vn(r.value,s=>(De(),Ue(Ve,null,[zn("input",{type:"hidden",name:n.value+"[keys][]",value:s.key},null,8,mH),zn("input",{type:"hidden",name:n.value+"[values][]",value:s.value},null,8,gH)],64))),256))],64)),le(t).attributes.required?(De(),Ue("input",{key:2,type:"text",required:!r.value.length,disabled:!!r.value.length,name:`${n.value}_is_required`,style:{display:"none"}},null,8,CH)):Dt("",!0),r.value.length?Dt("",!0):(De(),Ue("input",{key:3,type:"hidden",name:n.value,value:"_def_"},null,8,_H))],64))}});class OH{constructor(t,n,r,o,i,a,l){Tn(this,"Map");Tn(this,"Marker");Tn(this,"lng");Tn(this,"lat");Tn(this,"detail");Tn(this,"zoom");Tn(this,"container","");Tn(this,"urls");Tn(this,"addressUpdatedHandler");this.container=t,this.urls=n,this.addressUpdatedHandler=r,this.lat=o,this.lng=i,this.detail=a,this.zoom=l,this.lat.value||navigator.geolocation.getCurrentPosition(s=>{this.lat.value=s.coords.latitude,this.lng.value=s.coords.longitude,this.setCenter().markerPosition()},s=>{console.log(s)})}address2ll(t){return new Promise(n=>{ur.get(this.urls.address2ll,{params:{address:t}}).then(({data:r})=>{n(r.result.location)})})}ll2address(t,n){return new Promise(r=>{ur.get(this.urls.ll2address,{params:{lat:t,lng:n}}).then(({data:o})=>{r(o.result)})})}}class $H extends OH{constructor(t,n,r,o,i,a,l){super(t,n,r,o,i,a,l),this.Map=new TMap.Map(document.getElementById(this.container),{center:new TMap.LatLng(this.getLat(),this.getLng()),zoom:l.value}),this.Marker=new TMap.MultiMarker({map:this.Map,geometries:[{id:"position",position:new TMap.LatLng(this.getLat(),this.getLng())}]}),this.Map.on("click",s=>{this.markerPosition(s.latLng.lat,s.latLng.lng),this.toLatLngLocation(s.latLng.lat,s.latLng.lng)}),this.Map.on("zoom",()=>{Xs.debounce(this.container+"-zoom",()=>{l.value=this.Map.getZoom()})})}setCenter(t=null,n=null){return this.Map.setCenter(new TMap.LatLng(this.getLat(t),this.getLng(n))),this}markerPosition(t=null,n=null){let r=this.Marker.getGeometryById("position");return Object.assign(r,{position:new TMap.LatLng(this.getLat(t),this.getLng(n))}),this.Marker.updateGeometries([r]),this}getLat(t){return t||this.lat.value||39.98412}getLng(t){return t||this.lng.value||116.307484}toAddressLocation(t){return this.address2ll(t).then(({lat:n,lng:r})=>{this.setCenter(n,r).markerPosition(n,r)}),this}toLatLngLocation(t=null,n){return this.ll2address(this.getLat(t),this.getLng(n)).then(({ad_info:r,pois:o})=>{var a;this.addressUpdatedHandler(r.adcode),t&&(this.lat.value=t),n&&(this.lng.value=n);const i=o[0];i&&(this.detail.value=(a=(i.address+i.title).replace(i.ad_info.province+i.ad_info.city+i.ad_info.district,""))!=null?a:null)}),this}destroy(){this.Map.destroy()}}const PH=["id"],TH=["name","value"],RH=["name","value"],kH=["name","value"],DH=["name","value"],MH=["name","value"],EH=["name","value"],zH=["name","value"],AH=he({__name:"DistPicker",setup(e){HS($=>({aa3e063e:le(d)}));const t=Be("provides"),n={...t.value},r=A(n[t.provinceField]*1||null),o=A(n[t.cityField]*1||null),i=A(n[t.districtField]*1||null),a=A(n[t.detailField]||null),l=A(n[t.latField]||null),s=A(n[t.lngField]||null),u=A(n[t.zoomField]*1||t.zoom),c={},d=t.height;async function h($){if(c.hasOwnProperty($))return c[$];const{data:M}=await ur.get(t.urls.regions,{params:{pcode:$}});return c[$]=M.items.map(F=>(t.disables.includes(F.value)&&(F.disabled=!0),F)),M.items}const v=A();h("0").then($=>v.value=$);function p(){var $;return($=v.value.find(M=>M.value===r.value))==null?void 0:$.label}const y=A([]);r.value&&h(String(r.value)).then($=>y.value=$);function b($,M=""){h($).then(F=>y.value=F),o.value=null,g.value=[],i.value=null}function m(){var $;return($=y.value.find(M=>M.value==o.value))==null?void 0:$.label}const g=A([]);o.value&&h(String(o.value)).then($=>g.value=$);function O($,M="",F=!0){h($).then(U=>g.value=U),i.value=null,F&&(x==null||x.toAddressLocation(p()+m()+w()))}function w(){var $;return($=g.value.find(M=>M.value==i.value))==null?void 0:$.label}function C($){x==null||x.toAddressLocation(p()+m()+w())}function S($){if(!$)return 0;h($.slice(0,4)+"00").then(M=>{g.value=M;const F=M.find(U=>U.value==$);i.value=F.value,h(String(F.pcode).slice(0,2)+"0000").then(U=>{y.value=U,o.value=F.pcode;const Y=U.find(Z=>Z.value==o.value);r.value=Y.pcode})})}let x=null;function P(){x==null||x.toLatLngLocation(l.value,s.value).setCenter().markerPosition()}function _(){x==null||x.toLatLngLocation(l.value,s.value).setCenter()}function T(){x==null||x.toAddressLocation(p()+m()+w()+a.value)}function k(){x=new $H(t.areaId,t.urls,S,l,s,a,u)}return Ot(()=>{t.disableMap||(window.addEventListener("imported.map.wemap",k,{once:!0}),window.dispatchEvent(new CustomEvent("import.map.wemap")))}),yl(()=>{x==null||x.destroy()}),($,M)=>(De(),Ue(Ve,null,[He(le(fa),null,{default:ot(()=>[le(t).provinceField||le(t).cityField||le(t).districtField?(De(),Un(le(Ws),{key:0,value:r.value,"onUpdate:value":[M[0]||(M[0]=F=>r.value=F),b],filterable:"",clearable:"",placeholder:"-- \u7701 --",options:v.value,"consistent-menu-width":!1},null,8,["value","options"])):Dt("",!0),le(t).provinceField||le(t).cityField||le(t).districtField?(De(),Un(le(Ws),{key:1,value:o.value,"onUpdate:value":[M[1]||(M[1]=F=>o.value=F),O],filterable:"",clearable:"",placeholder:"-- \u5E02 --",options:y.value,"consistent-menu-width":!1},null,8,["value","options"])):Dt("",!0),le(t).provinceField||le(t).cityField||le(t).districtField?(De(),Un(le(Ws),{key:2,value:i.value,"onUpdate:value":[M[2]||(M[2]=F=>i.value=F),C],filterable:"",clearable:"",placeholder:"-- \u533A/\u53BF --",options:g.value,"consistent-menu-width":!1},null,8,["value","options"])):Dt("",!0),le(t).latField?(De(),Un(le(SI),{key:3},{default:ot(()=>[He(le(xn),{placeholder:"\u7EAC\u5EA6",value:l.value,"onUpdate:value":M[3]||(M[3]=F=>l.value=F),onKeydown:La(Ba(P,["prevent"]),["enter"])},null,8,["value","onKeydown"]),He(le(xn),{placeholder:"\u7ECF\u5EA6",value:s.value,"onUpdate:value":M[4]||(M[4]=F=>s.value=F),onKeydown:La(Ba(_,["prevent"]),["enter"])},null,8,["value","onKeydown"])]),_:1})):Dt("",!0)]),_:1}),le(t).detailField?(De(),Un(le(xn),{key:0,placeholder:"\u8BE6\u7EC6\u5730\u5740",value:a.value,"onUpdate:value":M[5]||(M[5]=F=>a.value=F),autosize:"",clearable:"",style:{"margin-top":"18px","min-width":"50%"},onKeydown:La(Ba(T,["prevent"]),["enter"])},null,8,["value","onKeydown"])):Dt("",!0),le(t).disableMap?Dt("",!0):(De(),Ue("div",{key:1,id:le(t).areaId,class:"map-container"},null,8,PH)),le(t).provinceField?(De(),Ue("input",{key:2,type:"hidden",name:le(t).provinceField,value:r.value},null,8,TH)):Dt("",!0),le(t).cityField?(De(),Ue("input",{key:3,type:"hidden",name:le(t).cityField,value:o.value},null,8,RH)):Dt("",!0),le(t).districtField?(De(),Ue("input",{key:4,type:"hidden",name:le(t).districtField,value:i.value},null,8,kH)):Dt("",!0),le(t).detailField?(De(),Ue("input",{key:5,type:"hidden",name:le(t).detailField,value:a.value},null,8,DH)):Dt("",!0),le(t).latField?(De(),Ue("input",{key:6,type:"hidden",name:le(t).latField,value:l.value},null,8,MH)):Dt("",!0),le(t).lngField?(De(),Ue("input",{key:7,type:"hidden",name:le(t).lngField,value:s.value},null,8,EH)):Dt("",!0),le(t).zoomField?(De(),Ue("input",{key:8,type:"hidden",name:le(t).zoomField,value:u.value},null,8,zH)):Dt("",!0)],64))}}),IH=["required","disabled","name"],FH=["name","value"],BH=he({__name:"Select",setup(e){const t=Be("provides"),n=A(t.value),r=A(t.name),o=A();return o.value=t.options.map((i,a)=>({label:t.concatSeparator?`${a}${t.concatSeparator}${i}`:i,value:a})),t.optionsFromKeyValueField&&Fp().watchField(t.optionsFromKeyValueField,i=>{o.value=i==null?void 0:i.filter(a=>!!a.value).map(a=>({label:t.concatSeparator?`${a.key}${t.concatSeparator}${a.value}`:a.value,value:a.key}))}),yl(()=>{Fp().cleanupWatch(t.optionsFromKeyValueField)}),(i,a)=>(De(),Ue(Ve,null,[He(le(Ws),{value:n.value,"onUpdate:value":a[0]||(a[0]=l=>n.value=l),filterable:"",clearable:"",placeholder:le(t).placeholder,options:o.value},null,8,["value","placeholder","options"]),le(t).attributes.required?(De(),Ue("input",{key:0,type:"text",required:![null,void 0].includes(typeof n.value),disabled:!![null,void 0].includes(typeof n.value),name:`${r.value}_is_required`,style:{display:"none"}},null,8,IH)):Dt("",!0),zn("input",{type:"hidden",name:r.value,value:n.value},null,8,FH)],64))}});function LH(e){return e.component("File",KL).component("CheckBox",ZL).component("Image",GN).component("Tag",eH).component("DateRange",oH).component("List",sH).component("KeyValue",SH).component("DistPicker",AH).component("Select",BH),e}const NH=function(){const e=nO(_9);return e.use(Ma.getPinia()),LH(e),e};export default NH; diff --git a/version.php b/version.php index 183c489..b8efb1b 100644 --- a/version.php +++ b/version.php @@ -53,4 +53,7 @@ return [ '一些优化', '新增选择组件', ], + '2.3.1' => [ + '一些优化', + ], ];