mftcc-base-npm 1.2.3 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mftcc-base-npm",
3
- "version": "1.2.3",
3
+ "version": "1.2.4",
4
4
  "description": "mftcc-base-npm",
5
5
  "author": "mftcc",
6
6
  "scripts": {
@@ -7,6 +7,7 @@
7
7
  :disabled="isEmpty(props.disabled) ? false : props.disabled"
8
8
  :readonly="isEmpty(props.readOnly) ? false : props.readOnly"
9
9
  :class="{ readonly: isEmpty(props.readOnly) ? false : props.readOnly }"
10
+ @input="handleStartInput"
10
11
  v-on="startEvent"
11
12
  ></el-input>
12
13
  <span class="separator">{{ isEmpty(props.separator) ? '至' : props.separator }}</span>
@@ -17,6 +18,7 @@
17
18
  :disabled="isEmpty(props.disabled) ? false : props.disabled"
18
19
  :readonly="isEmpty(props.readOnly) ? false : props.readOnly"
19
20
  :class="{ readonly: isEmpty(props.readOnly) ? false : props.readOnly }"
21
+ @input="handleEndInput"
20
22
  v-on="endEvent"
21
23
  ></el-input>
22
24
  </div>
@@ -38,8 +40,22 @@ export default {
38
40
  data() {
39
41
  return {
40
42
  isEmpty: formUtil.isEmpty,
43
+ tempStartValue: '',
44
+ tempEndValue: '',
41
45
  };
42
46
  },
47
+ methods: {
48
+ handleStartInput(value) {
49
+ const numValue = value.replace(/[^0-9.-]/g, '');
50
+ this.tempStartValue = numValue;
51
+ this.$emit("returnBack", [numValue, this.compValue[1]]);
52
+ },
53
+ handleEndInput(value) {
54
+ const numValue = value.replace(/[^0-9.-]/g, '');
55
+ this.tempEndValue = numValue;
56
+ this.$emit("returnBack", [this.compValue[0], numValue]);
57
+ },
58
+ },
43
59
  computed: {
44
60
  compValue: {
45
61
  get() {
@@ -54,14 +70,12 @@ export default {
54
70
  startEvent() {
55
71
  const event = { ...this.event };
56
72
  delete event.returnBack;
73
+ delete event.input;
57
74
  const newEvents = {};
58
75
  for (const key in event) {
59
76
  newEvents[key] = (e) => {
60
- if (!this.props.disabled && !this.props.readOnly) {
61
- this.$emit("returnBack", [e, this.compValue[1]]);
62
- if (event[key]) {
63
- event[key](e);
64
- }
77
+ if (event[key]) {
78
+ event[key](e);
65
79
  }
66
80
  };
67
81
  }
@@ -70,14 +84,12 @@ export default {
70
84
  endEvent() {
71
85
  const event = { ...this.event };
72
86
  delete event.returnBack;
87
+ delete event.input;
73
88
  const newEvents = {};
74
89
  for (const key in event) {
75
90
  newEvents[key] = (e) => {
76
- if (!this.props.disabled && !this.props.readOnly) {
77
- this.$emit("returnBack", [this.compValue[0], e]);
78
- if (event[key]) {
79
- event[key](e);
80
- }
91
+ if (event[key]) {
92
+ event[key](e);
81
93
  }
82
94
  };
83
95
  }