|
@@ -230,6 +230,34 @@ Vue.directive("input-limit", {
|
|
|
e.target.dispatchEvent(new Event("input"))
|
|
|
}
|
|
|
}
|
|
|
+ if (binding.value == 3) {
|
|
|
+ if (wins_0.test(e.target.value.toString().replace(/\d+\.(\d*)/, '$1'))) {
|
|
|
+ remainder = true
|
|
|
+ }
|
|
|
+ if ((e.target.value.split('.')).length - 1 > 1) {
|
|
|
+ points = true
|
|
|
+ }
|
|
|
+ if (e.target.value.toString().split(".")[1] != undefined) {
|
|
|
+ if (e.target.value.toString().split(".")[1].length > 3) {
|
|
|
+ lengths = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (e.target.value.toString().indexOf(".") != -1) {
|
|
|
+ no_int = false
|
|
|
+ } else {
|
|
|
+ no_int = true
|
|
|
+ }
|
|
|
+ if (wins_1.test(e.target.value) || lengths || points || remainder) {
|
|
|
+ if (!no_int) {
|
|
|
+ e.target.value = e.target.value.replace(wins_1, "").replace('.', '$#$').replace(/\./g, '').replace(
|
|
|
+ '$#$', '.').replace(/^(\-)*(\d+)\.(\d\d\d).*$/, '$1$2.$3').substring(0, e.target.value.indexOf(
|
|
|
+ ".") + 4)
|
|
|
+ } else {
|
|
|
+ e.target.value = e.target.value.replace(wins_0, "")
|
|
|
+ }
|
|
|
+ e.target.dispatchEvent(new Event("input"))
|
|
|
+ }
|
|
|
+ }
|
|
|
if (binding.value == 4) {
|
|
|
if (wins_0.test(e.target.value.toString().replace(/\d+\.(\d*)/, '$1'))) {
|
|
|
remainder = true
|