"use strict";(self.webpackChunkmy_package_ext=self.webpackChunkmy_package_ext||[]).push([[3029],{33029: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("el-input",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()}},model:{value:t.localValue,callback:function(e){t.localValue=e},expression:"localValue"}},"el-input",t.$attrs,!1),[t.prefixValue?e("span",{staticStyle:{"font-style":"italic"},attrs:{slot:"prefix"},slot:"prefix"},[t._v(t._s(t.prefixValue))]):t._e(),t._v(" "),t.suffixValue?e("span",{staticStyle:{"font-style":"italic"},attrs:{slot:"suffix"},slot:"suffix"},[t._v(t._s(t.suffixValue))]):t._e()])}),[],!1,null,"0dac0b7b",null).exports},51900:function(t,e,n){function i(t,e,n,i,r,o,l,a){var s,u,c="function"==typeof t?t.options:t;return e&&(c.render=e,c.staticRenderFns=n,c._compiled=!0),i&&(c.functional=!0),o&&(c._scopeId="data-v-"+o),l?(s=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__),r&&r.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(l)},c._ssrRegister=s):r&&(s=a?function(){r.call(this,(c.functional?this.parent:this).$root.$options.shadowRoot)}:r),s&&(c.functional?(c._injectStyles=s,u=c.render,c.render=function(t,e){return s.call(e),u(t,e)}):(e=c.beforeCreate,c.beforeCreate=e?[].concat(e,s):[s])),{exports:t,options:c}}n.d(e,{Z:function(){return i}})}}]);