index-legacy-2fc346a6.js 2.1 KB

1
  1. System.register(["./index-legacy-1caf4f97.js","./index-legacy-14e0a384.js"],(function(e,t){"use strict";var n,l,o,c,a,s,i,u,r,m,d,v,h,f,g;return{setters:[e=>{n=e.c,l=e.ab,o=e.b,c=e.aa,a=e.d,s=e.r,i=e.e,u=e.w,r=e.X,m=e.a,d=e.ad,v=e.h,h=e.k},e=>{f=e.p,g=e.P}],execute:function(){const t="000000",p=["title","cancel","confirm","toolbar","columns-top","columns-bottom"],y=["title","loading","readonly","optionHeight","swipeDuration","visibleOptionNum","cancelButtonText","confirmButtonText"],b=(e="",n=t,l=void 0)=>({text:e,value:n,children:l});function O({areaList:e,columnsNum:n,columnsPlaceholder:l}){const{city_list:o={},county_list:c={},province_list:a={}}=e,s=+n>1,i=+n>2,u=new Map;Object.keys(a).forEach((e=>{u.set(e.slice(0,2),b(a[e],e,(()=>{if(s)return l.length?[b(l[0],t,i?[]:void 0)]:[]})()))}));const r=new Map;if(s){const e=()=>{if(i)return l.length?[b(l[1])]:[]};Object.keys(o).forEach((t=>{const n=b(o[t],t,e());r.set(t.slice(0,4),n);const l=u.get(t.slice(0,2));l&&l.children.push(n)}))}i&&Object.keys(c).forEach((e=>{const t=r.get(e.slice(0,4));t&&t.children.push(b(c[e],e))}));const m=Array.from(u.values());if(l.length){const e=i?[b(l[2])]:void 0,n=s?[b(l[1],t,e)]:void 0;m.unshift(b(l[0],t,n))}return m}const[V,j]=n("area"),x=l({},f,{modelValue:String,columnsNum:o(3),columnsPlaceholder:c(),areaList:{type:Object,default:()=>({})}});var k=a({name:V,props:x,emits:["change","confirm","cancel","update:modelValue"],setup(e,{emit:t,slots:n}){const l=s([]),o=s(),c=i((()=>O(e))),a=(...e)=>t("change",...e),h=(...e)=>t("cancel",...e),f=(...e)=>t("confirm",...e);return u(l,(n=>{const l=n.length?n[n.length-1]:"";l&&l!==e.modelValue&&t("update:modelValue",l)}),{deep:!0}),u((()=>e.modelValue),(t=>{t?t!==(l.value.length?l.value[l.value.length-1]:"")&&(l.value=[`${t.slice(0,2)}0000`,`${t.slice(0,4)}00`,t].slice(0,+e.columnsNum)):l.value=[]}),{immediate:!0}),r({confirm:()=>{var e;return null==(e=o.value)?void 0:e.confirm()},getSelectedOptions:()=>{var e;return(null==(e=o.value)?void 0:e.getSelectedOptions())||[]}}),()=>m(g,v({ref:o,modelValue:l.value,"onUpdate:modelValue":e=>l.value=e,class:j(),columns:c.value,onChange:a,onCancel:h,onConfirm:f},d(e,y)),d(n,p))}});e("A",h(k))}}}));