"use strict";(self.webpackChunkmy_package_ext=self.webpackChunkmy_package_ext||[]).push([[1545],{11545:function(t,e,n){n.r(e),n.d(e,{default:function(){return i}}),e={name:"money",props:{value:{},prefixValue:{type:String,default:""},suffixValue:{type:String,default:""},precision:{type:[Number,String],default:null},PositiveColor:{type:String,default:"#000000"},minusColor:{type:String,default:"#000000"},formatSetting:{type:String,default:""}},data:function(){return{localValue:null,isLeave:!0}},watch:{localValue:{immediate:!0,handler:function(t){0<=t||t&&-1==t.indexOf("-")?this.$refs.number&&(this.$refs.number.$refs.input.style="color: ".concat(this.PositiveColor," !important;")):this.$refs.number&&(this.$refs.number.$refs.input.style="color: ".concat(this.minusColor," !important;")),!t||"thousand"!==this.formatSetting&&"millionn"!==this.formatSetting||(t=this.delFormatSetting(t)),this.$emit("input",t)}},value:{immediate:!0,handler:function(t){t||0==t?("number"==typeof t&&(t+=""),this.isLeave&&(t=t.replace(/[^0-9.,-]/g,""),this.dealNumber(t))):this.localValue=null}}},methods:{EditFunc:function(){this.isLeave=!this.isLeave,this.isLeave&&this.dealNumber(this.localValue)},numberPrecision:function(t,e){if(t){var n=(Math.round(t*Math.pow(10,e))/Math.pow(10,e)).toString();n.indexOf(".")<0&&(n+=".");for(var i=n.length-n.indexOf(".");i<=e;i++)n+="0";return n}return null},thousandBitSign:function(t){return t?t.toString().replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g,"$&,"):null},million:function(t){return t?t.toString().replace(/\d{1,4}(?=(\d{4})+(\.\d*)?$)/g,"$&,"):null},delFormatSetting:function(t){return""==(t+"").trim()?null:+(t=t.replace(/,/gi,""))},dealNumber:function(t){this.precision&&("thousand"!==this.formatSetting&&"millionn"!==this.formatSetting||(t=this.delFormatSetting(t)),t=this.numberPrecision(t,this.precision)),"millionn"===this.formatSetting&&(t=this.million(t)),"thousand"===this.formatSetting&&(t=this.thousandBitSign(t)),this.localValue=t}}};var i=(0,n(51900).Z)(e,(function(){var t=this,e=t._self._c;return e("van-field",t._b({ref:"number",on:{input:function(e){t.localValue=t.localValue.replace(/[^0-9.,-]/g,"")},blur:function(e){return t.EditFunc()},focus:function(e){return t.EditFunc()}},scopedSlots:t._u([{key:"button",fn:function(){return[t.suffixValue?e("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.suffixValue))]):t._e()]},proxy:!0}]),model:{value:t.localValue,callback:function(e){t.localValue=e},expression:"localValue"}},"van-field",t.$attrs,!1),[[t.prefixValue?e("span",{staticStyle:{"font-style":"italic"}},[t._v(t._s(t.prefixValue))]):t._e()]],2)}),[],!1,null,"764d3248",null).exports},51900:function(t,e,n){function i(t,e,n,i,o,r,l,a){var u,s,c="function"==typeof t?t.options:t;return e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),l?(u=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(l)},c._ssrRegister=u):o&&(u=a?function(){o.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:o),u&&(c.functional?(c._injectStyles=u,s=c.render,c.render=function(t,e){return u.call(e),s(t,e)}):(e=c.beforeCreate,c.beforeCreate=e?[].concat(e,u):[u])),{exports:t,options:c}}n.d(e,{Z:function(){return i}})}}]);