zydx-plus 1.19.96 → 1.19.98
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
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
<div v-if="type === 'radio'">
|
|
16
16
|
<div class="radio-list" v-for="(item,index) in radioArr" :key="index">
|
|
17
17
|
<label>
|
|
18
|
-
<input type="radio" name="radio" :value="item.value" :checked="item.checked"
|
|
18
|
+
<input type="radio" name="radio" :value="item.value" :checked="item.checked"
|
|
19
|
+
@change="radioTao(index)"/>
|
|
19
20
|
<span>{{ item.label }}</span>
|
|
20
21
|
</label>
|
|
21
22
|
</div>
|
|
@@ -23,8 +24,15 @@
|
|
|
23
24
|
<div class="tip-img" v-if="type === 'input'">
|
|
24
25
|
<div class="tip-input" v-for="(item,index) in inputArr" :key="index">
|
|
25
26
|
<span v-if="item.name">{{ item.name }}</span>
|
|
26
|
-
<
|
|
27
|
-
|
|
27
|
+
<div style="display: inline-block;" v-if="item.type === 'input'">
|
|
28
|
+
<div v-if="item.number" class="number-input">
|
|
29
|
+
<input type="number" @keypress="isNumberKey($event,index)"
|
|
30
|
+
:placeholder="item.placeholder"
|
|
31
|
+
v-model="item.value" :disabled="item.disabled"/>
|
|
32
|
+
</div>
|
|
33
|
+
<input v-else type="text" :placeholder="item.placeholder"
|
|
34
|
+
v-model="item.value" :disabled="item.disabled"/>
|
|
35
|
+
</div>
|
|
28
36
|
<div style="display: inline-block;">
|
|
29
37
|
<Select v-if="item.type === 'select'" :options="item.option"
|
|
30
38
|
v-model:value="item.selectValue"></Select>
|
|
@@ -36,8 +44,11 @@
|
|
|
36
44
|
</div>
|
|
37
45
|
<div v-if="item.type === 'text'" class="text">{{ item.value }}</div>
|
|
38
46
|
<div v-if="item.type === 'code'" class="ph-code">
|
|
39
|
-
<input type="text" v-model="item.value" :placeholder="item.placeholder"
|
|
40
|
-
<button ref="tipID" @click="item.codeTap($refs.tipID[0],inputArr)">{{
|
|
47
|
+
<input type="text" v-model="item.value" :placeholder="item.placeholder"/>
|
|
48
|
+
<button ref="tipID" @click="item.codeTap($refs.tipID[0],inputArr)">{{
|
|
49
|
+
item.butVal
|
|
50
|
+
}}
|
|
51
|
+
</button>
|
|
41
52
|
</div>
|
|
42
53
|
</div>
|
|
43
54
|
</div>
|
|
@@ -110,7 +121,31 @@ export default {
|
|
|
110
121
|
}
|
|
111
122
|
},
|
|
112
123
|
methods: {
|
|
113
|
-
|
|
124
|
+
isNumberKey(evt,index) {
|
|
125
|
+
const charCode = (evt.which) ? evt.which : event.keyCode;
|
|
126
|
+
if(this.inputArr[index].value === undefined) return true
|
|
127
|
+
let val = this.inputArr[index].value.toString()
|
|
128
|
+
if (charCode === 46) {
|
|
129
|
+
if (val.indexOf('.') !== -1)
|
|
130
|
+
evt.preventDefault();
|
|
131
|
+
else
|
|
132
|
+
return true;
|
|
133
|
+
} else if (charCode > 31 && (charCode < 48 || charCode > 57))
|
|
134
|
+
evt.preventDefault();
|
|
135
|
+
|
|
136
|
+
if (this.valueState(this.inputArr[index].value) && String.fromCharCode(charCode) === '0')
|
|
137
|
+
evt.preventDefault();
|
|
138
|
+
// 判断是否有小数点
|
|
139
|
+
if (val.indexOf('.') !== -1) {
|
|
140
|
+
if (val[1].length >= 1) {
|
|
141
|
+
evt.preventDefault();
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
valueState(v) {
|
|
146
|
+
return v === '' || v === undefined || v === null;
|
|
147
|
+
},
|
|
148
|
+
radioTao(index) {
|
|
114
149
|
this.radioArr.forEach(item => {
|
|
115
150
|
item.checked = false
|
|
116
151
|
})
|
|
@@ -100,6 +100,7 @@ font-size: 12px;
|
|
|
100
100
|
line-height: 30px;
|
|
101
101
|
padding-right: 10px;
|
|
102
102
|
text-align: right;
|
|
103
|
+
float: left;
|
|
103
104
|
}
|
|
104
105
|
.tip-input input{
|
|
105
106
|
width: 211px;
|
|
@@ -167,4 +168,21 @@ font-size: 12px;
|
|
|
167
168
|
top: 12px;
|
|
168
169
|
left: 20px;
|
|
169
170
|
z-index: 1;
|
|
171
|
+
}
|
|
172
|
+
.number-input{
|
|
173
|
+
width: 211px;
|
|
174
|
+
height: 32px;
|
|
175
|
+
box-sizing: border-box;
|
|
176
|
+
font-size: 16px;
|
|
177
|
+
outline: none;
|
|
178
|
+
border: 1px solid #ccc;
|
|
179
|
+
border-radius: 3px;
|
|
180
|
+
box-shadow: 0 1px 0 1px rgb(0 0 0 / 4%);
|
|
181
|
+
overflow: hidden;
|
|
182
|
+
}
|
|
183
|
+
.number-input>input{
|
|
184
|
+
border: 0 !important;
|
|
185
|
+
box-shadow: none !important;
|
|
186
|
+
height: 30px !important;
|
|
187
|
+
width: 240px !important;
|
|
170
188
|
}
|