"use strict";(self.webpackChunkmy_package_ext=self.webpackChunkmy_package_ext||[]).push([[1539],{21539:function(e,t,n){n.r(t),n.d(t,{default:function(){return a}});var i=[["China (中国大陆)","cn","86"],["Hong Kong (香港)","hk","852"],["Taiwan (台灣)","tw","886"],["Macau (澳門)","mo","853"]],a=(t={name:"phone-number",props:{value:{},numberType:{type:String,default:"mobile"},enableSelections:{type:String,default:"false"},entityModel:{},isInChildren:{type:Boolean,default:!1}},data:function(){return{suggestions:i,preValue:"86",mainValue:""}},computed:{isEdit:function(){return console.log(this.$attrs),"edit"===this.$attrs.mode},showContent:function(){var e=this.value;return this.value.indexOf("(")?this.value.slice(0,this.value.indexOf("(")):e}},watch:{value:{immediate:!0,handler:function(e){var t,n,i,a;e&&"mobile"===this.numberType&&"true"===this.enableSelections&&(i=e.indexOf(" "),t=e.indexOf("("),n=e.indexOf(")"),this.mainValue=e.slice(i+1,-1!==t?t:e.length),i=e.slice(1,i),console.log(i,"pre"),a="",-1!==t&&(a=e.slice(t+1,n)),this.preValue=a?i+","+a:i)}}},methods:{changeValue:function(e){var t=this.preValue&&this.preValue.split(",");this.preValue?(t="+"+t[0]+" "+e+(1<t.length?"("+t[1]+")":""),this.$emit("input",t)):this.$emit("input",e)},changeArea:function(e){var t,n;console.log(e,"===area"),e?(n="+"+(t=e&&e.split(","))[0]+" "+this.mainValue+(1<t.length?"("+t[1]+")":""),console.log(n,"changeArea",t,e),this.$emit("input",n)):this.$emit("input",this.mainValue)},blurMark:function(){this.$emit("blur")}}},(0,n(51900).Z)(t,(function(){var e=this,t=e._self._c;return t("div",{staticStyle:{width:"100%"}},[e.isInChildren?t("div",{attrs:{title:e.showContent}},[e._v(e._s(e.showContent))]):"phone"===e.numberType||"mobile"===e.numberType&&"false"===e.enableSelections?t("el-input",e._g(e._b({staticStyle:{width:"100%"},model:{value:e.value,callback:function(t){e.value=t},expression:"value"}},"el-input",e.$attrs,!1),e.$listeners)):"mobile"===e.numberType&&"true"===e.enableSelections?t("el-input",e._b({staticStyle:{width:"100%"},on:{input:e.changeValue,blur:e.blurMark},model:{value:e.mainValue,callback:function(t){e.mainValue=t},expression:"mainValue"}},"el-input",e.$attrs,!1),[t("el-select",e._b({staticStyle:{"min-width":"90px"},attrs:{slot:"prepend",clearable:!1,title:e.preValue},on:{change:e.changeArea},slot:"prepend",model:{value:e.preValue,callback:function(t){e.preValue=t},expression:"preValue"}},"el-select",e.$attrs,!1),e._l(e.suggestions,(function(n,i){return t("el-option",{key:i,attrs:{label:"".concat("+ "+n[2]),value:"".concat(n[2])}},[t("span",[e._v(e._s(n[0]+"( "+n[1]+" ) "))]),e._v(" "),t("span",{staticStyle:{color:"#999"}},[e._v(e._s(" + "+n[2]))])])})),1)],1):e._e()],1)}),[],!1,null,"6fdd5e12",null).exports)},51900:function(e,t,n){function i(e,t,n,i,a,l,s,o){var r,u,c="function"==typeof e?e.options:e;return t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),l&&(c._scopeId="data-v-"+l),s?(r=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=r):a&&(r=o?function(){a.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:a),r&&(c.functional?(c._injectStyles=r,u=c.render,c.render=function(e,t){return r.call(t),u(e,t)}):(t=c.beforeCreate,c.beforeCreate=t?[].concat(t,r):[r])),{exports:e,options:c}}n.d(t,{Z:function(){return i}})}}]);