index-legacy-8b2e440d.js 2.2 KB

1
  1. System.register(["./index-legacy-e6be1dcb.js","./index-legacy-ff570bc2.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.ad,o=e.af,c=e.b,a=e.ac,s=e.d,i=e.r,u=e.e,r=e.w,m=e.Z,d=e.a,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({},o(g,y),{modelValue:String,columnsNum:c(3),columnsPlaceholder:a(),areaList:{type:Object,default:()=>({})}});var k=s({name:V,props:x,emits:["change","confirm","cancel","update:modelValue"],setup(e,{emit:t,slots:n}){const l=i([]),c=i(),a=u((()=>O(e))),s=(...e)=>t("change",...e),h=(...e)=>t("cancel",...e),g=(...e)=>t("confirm",...e);return r(l,(n=>{const l=n.length?n[n.length-1]:"";l&&l!==e.modelValue&&t("update:modelValue",l)}),{deep:!0}),r((()=>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}),m({confirm:()=>{var e;return null==(e=c.value)?void 0:e.confirm()},getSelectedOptions:()=>{var e;return(null==(e=c.value)?void 0:e.getSelectedOptions())||[]}}),()=>d(f,v({ref:c,modelValue:l.value,"onUpdate:modelValue":e=>l.value=e,class:j(),columns:a.value,onChange:s,onCancel:h,onConfirm:g},o(e,y)),o(n,p))}});e("A",h(k))}}}));