mftcc-base-npm 1.2.3 → 1.2.5
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
|
@@ -3,20 +3,26 @@
|
|
|
3
3
|
<el-input
|
|
4
4
|
:ref="props.fieldName + '_start'"
|
|
5
5
|
v-model="compValue[0]"
|
|
6
|
-
:placeholder="isEmpty(props.
|
|
6
|
+
:placeholder="isEmpty(props.placeholder) ? '起始值' : props.placeholder"
|
|
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
|
-
<span class="separator">{{
|
|
13
|
+
<span class="separator">{{
|
|
14
|
+
isEmpty(props.separator) ? "至" : props.separator
|
|
15
|
+
}}</span>
|
|
13
16
|
<el-input
|
|
14
17
|
:ref="props.fieldName + '_end'"
|
|
15
18
|
v-model="compValue[1]"
|
|
16
|
-
:placeholder="
|
|
19
|
+
:placeholder="
|
|
20
|
+
isEmpty(props.endPlaceholder) ? '结束值' : props.endPlaceholder
|
|
21
|
+
"
|
|
17
22
|
:disabled="isEmpty(props.disabled) ? false : props.disabled"
|
|
18
23
|
:readonly="isEmpty(props.readOnly) ? false : props.readOnly"
|
|
19
24
|
:class="{ readonly: isEmpty(props.readOnly) ? false : props.readOnly }"
|
|
25
|
+
@input="handleEndInput"
|
|
20
26
|
v-on="endEvent"
|
|
21
27
|
></el-input>
|
|
22
28
|
</div>
|
|
@@ -38,8 +44,22 @@ export default {
|
|
|
38
44
|
data() {
|
|
39
45
|
return {
|
|
40
46
|
isEmpty: formUtil.isEmpty,
|
|
47
|
+
tempStartValue: "",
|
|
48
|
+
tempEndValue: "",
|
|
41
49
|
};
|
|
42
50
|
},
|
|
51
|
+
methods: {
|
|
52
|
+
handleStartInput(value) {
|
|
53
|
+
const numValue = value.replace(/[^0-9.-]/g, "");
|
|
54
|
+
this.tempStartValue = numValue;
|
|
55
|
+
this.$emit("returnBack", [numValue, this.compValue[1]]);
|
|
56
|
+
},
|
|
57
|
+
handleEndInput(value) {
|
|
58
|
+
const numValue = value.replace(/[^0-9.-]/g, "");
|
|
59
|
+
this.tempEndValue = numValue;
|
|
60
|
+
this.$emit("returnBack", [this.compValue[0], numValue]);
|
|
61
|
+
},
|
|
62
|
+
},
|
|
43
63
|
computed: {
|
|
44
64
|
compValue: {
|
|
45
65
|
get() {
|
|
@@ -54,14 +74,12 @@ export default {
|
|
|
54
74
|
startEvent() {
|
|
55
75
|
const event = { ...this.event };
|
|
56
76
|
delete event.returnBack;
|
|
77
|
+
delete event.input;
|
|
57
78
|
const newEvents = {};
|
|
58
79
|
for (const key in event) {
|
|
59
80
|
newEvents[key] = (e) => {
|
|
60
|
-
if (
|
|
61
|
-
|
|
62
|
-
if (event[key]) {
|
|
63
|
-
event[key](e);
|
|
64
|
-
}
|
|
81
|
+
if (event[key]) {
|
|
82
|
+
event[key](e);
|
|
65
83
|
}
|
|
66
84
|
};
|
|
67
85
|
}
|
|
@@ -70,14 +88,12 @@ export default {
|
|
|
70
88
|
endEvent() {
|
|
71
89
|
const event = { ...this.event };
|
|
72
90
|
delete event.returnBack;
|
|
91
|
+
delete event.input;
|
|
73
92
|
const newEvents = {};
|
|
74
93
|
for (const key in event) {
|
|
75
94
|
newEvents[key] = (e) => {
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
if (event[key]) {
|
|
79
|
-
event[key](e);
|
|
80
|
-
}
|
|
95
|
+
if (event[key]) {
|
|
96
|
+
event[key](e);
|
|
81
97
|
}
|
|
82
98
|
};
|
|
83
99
|
}
|