1 line
25 KiB
JavaScript
1 line
25 KiB
JavaScript
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7e8690a0"],{4830:function(t,e,n){"use strict";var o=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"retrieval"},[n("input",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"},{name:"model",rawName:"v-model",value:t.result,expression:"result"}],domProps:{value:t.result},on:{input:function(e){e.target.composing||(t.result=e.target.value)}}}),n("input",{directives:[{name:"show",rawName:"v-show",value:!1,expression:"false"},{name:"model",rawName:"v-model",value:t.inputValue,expression:"inputValue"}],attrs:{type:"text"},domProps:{value:t.inputValue},on:{input:function(e){e.target.composing||(t.inputValue=e.target.value)}}}),n("div",{staticClass:"number"},[n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","7")}}},[t._v("7")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","8")}}},[t._v("8")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","9")}}},[t._v("9")]),n("div",{staticClass:"button reduce",on:{click:function(e){return t.clickKey("func","-")}}},[t._v("-")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","4")}}},[t._v("4")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","5")}}},[t._v("5")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","6")}}},[t._v("6")]),n("div",{staticClass:"button add",on:{click:function(e){return t.clickKey("func","+")}}},[t._v("+")]),n("div",{staticClass:"d-flex"},[n("div",{staticClass:"d-flex number-left"},[n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","1")}}},[t._v("1")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","2")}}},[t._v("2")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","3")}}},[t._v("3")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("point",".")}}},[t._v(".")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("num","0")}}},[t._v("0")]),n("div",{staticClass:"button",on:{click:function(e){return t.clickKey("clear")}}},[n("svg-icon",{attrs:{"icon-class":"clear"}})],1)]),n("div",{staticClass:"button confirm",on:{click:function(e){return t.clickKey("confirm")}}},[t._v("确定")])])])])},r=[],c=(n("a9e3"),n("ac1f"),n("1276"),n("fb6a"),{name:"Retrieval",data:function(){return{result:0,inputValue:""}},computed:{isFunction:function(){return-1!==this.inputValue.indexOf("-")||-1!==this.inputValue.indexOf("+")},function:function(){var t="+";return-1!==this.inputValue.indexOf("-")&&(t="-"),-1!==this.inputValue.indexOf("+")&&(t="+"),t}},watch:{inputValue:function(t){this.$emit("getInputValue",t,this.result)}},methods:{clickKey:function(t,e){switch(t){case"num":this.isFunction?(this.inputValue+=e,"+"===this.function?this.result=Number(this.inputValue.split(this.function)[0])+Number(this.inputValue.split(this.function)[1]):"-"===this.function&&(this.result=Number(this.inputValue.split(this.function)[0])-Number(this.inputValue.split(this.function)[1]))):(this.inputValue+=e,this.result=Number(this.inputValue));break;case"func":this.isFunction?(this.inputValue=this.result,this.inputValue+=e):(this.result=Number(this.inputValue),this.inputValue+=e);break;case"point":this.inputValue+=e;break;case"clear":this.inputValue=this.inputValue.slice(0,-1),this.isFunction?"+"===this.function?this.result=Number(this.inputValue.split(this.function)[0])+Number(this.inputValue.split(this.function)[1]):"-"===this.function&&(this.result=Number(this.inputValue.split(this.function)[0])-Number(this.inputValue.split(this.function)[1])):this.result=Number(this.inputValue),console.log(this.inputValue),console.log(this.result);break;case"confirm":this.$emit("confirm");break;default:break}}}}),i=c,a=(n("c85d"),n("2877")),s=Object(a["a"])(i,o,r,!1,null,"9f0e0fe4",null);e["a"]=s.exports},"51eb":function(t,e,n){"use strict";var o=n("825a"),r=n("c04e");t.exports=function(t){if("string"!==t&&"number"!==t&&"
|