zydx-plus 1.32.273 → 1.32.275

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": "zydx-plus",
3
- "version": "1.32.273",
3
+ "version": "1.32.275",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -1,348 +1,379 @@
1
1
  <template>
2
- <div class="question">
3
- <table border="0" cellspacing="0" cellpadding="0">
4
- <tr>
5
- <th>题序</th>
6
- <th>题型</th>
7
- <th>易</th>
8
- <th>中</th>
9
- <th>难</th>
10
- <th>合计题量</th>
11
- <th>合计分值</th>
12
- <th v-if="!readOnlys&&butShows">操作</th>
13
- </tr>
14
- <tbody v-for="(item,index) in question" :key="index">
15
- <tr>
16
- <td rowspan="2">{{ empty? '-':toChineseNum(index + 1) }}</td>
17
- <td rowspan="2">{{ item.quesName }}</td>
18
- <td>
19
- <div v-if="empty" class="qu-input" :style="{'margin-left': '0px'}">
20
- <span>{{ item.easy }}</span>
21
- </div>
22
- <div v-else class="qu-input" :style="{'margin-left': readOnlys?'0px':'-10px'}">
23
- <span v-if="readOnlys">{{ item.easy === ''? '-': item.easy }}</span>
24
- <input v-else type="number" placeholder="题量" :value="item.easy" @input="totalQuestions($event,1,index)" @keypress="isNumberKey($event,1)" />
25
- </div>
26
- </td>
27
- <td>
28
- <div v-if="empty" class="qu-input" :style="{'margin-left': '0px'}">
29
- <span>{{ item.mid }}</span>
30
- </div>
31
- <div v-else class="qu-input" :style="{'margin-left': readOnlys?'0px':'-10px'}">
32
- <span v-if="readOnlys">{{ item.mid === ''? '-': item.mid }}</span>
33
- <input v-else type="number" placeholder="题量" :value="item.mid" @input="totalQuestions($event,3,index)" @keypress="isNumberKey($event,1)" />
34
- </div>
35
- </td>
36
- <td>
37
- <div v-if="empty" class="qu-input" :style="{'margin-left': '0px'}">
38
- <span>{{ item.hard }}</span>
39
- </div>
40
- <div v-else class="qu-input" :style="{'margin-left': readOnlys?'0px':'-10px'}">
41
- <span v-if="readOnlys">{{ item.hard === ''? '-': item.hard }}</span>
42
- <input v-else type="number" placeholder="题量" :value="item.hard" @input="totalQuestions($event,2,index)" @keypress="isNumberKey($event,1)" />
43
- </div>
44
- </td>
45
- <td rowspan="2">{{ item.count }}</td>
46
- <td rowspan="2">{{ item.allScore }}</td>
47
- <td rowspan="2" v-if="!readOnlys&&butShows">
48
- <span class="buts" v-if="empty">-</span>
49
- <button v-else class="but" @click="cancel(index)">撤销选择</button>
50
- </td>
51
- </tr>
52
- <tr>
53
- <td>
54
- <div v-if="empty" class="qu-input" :style="{'margin-left': '0px'}">
55
- <span>{{ item.easyScore }}</span>
56
- </div>
57
- <div v-else class="qu-input" :style="{'margin-left': readOnlys?'0px':'-10px'}">
58
- <span v-if="readOnlys">{{ item.easyScore === ''? '-': item.easyScore }}</span>
59
- <input v-else type="number" placeholder="分值" :value="item.easyScore" @input="totalQuestions($event,4,index)" @keypress="isNumberKey($event,2)" />
60
- </div>
61
- </td>
62
- <td>
63
- <div v-if="empty" class="qu-input" :style="{'margin-left': '0px'}">
64
- <span>{{ item.midScore }}</span>
65
- </div>
66
- <div v-else class="qu-input" :style="{'margin-left': readOnlys?'0px':'-10px'}">
67
- <span v-if="readOnlys">{{ item.midScore === ''? '-': item.midScore }}</span>
68
- <input v-else type="number" placeholder="分值" :value="item.midScore" @input="totalQuestions($event,6,index)" @keypress="isNumberKey($event,2)" />
69
- </div>
70
- </td>
71
- <td>
72
- <div v-if="empty" class="qu-input" :style="{'margin-left': '0px'}">
73
- <span>{{ item.hardScore === ''? '-': item.hardScore }}</span>
74
- </div>
75
- <div v-else class="qu-input" :style="{'margin-left': readOnlys?'0px':'-10px'}">
76
- <span v-if="readOnlys">{{ item.hardScore === ''? '-': item.hardScore }}</span>
77
- <input v-else type="number" placeholder="分值" :value="item.hardScore" @input="totalQuestions($event,5,index)" @keypress="isNumberKey($event,2)" />
78
- </div>
79
- </td>
80
- </tr>
81
- </tbody>
82
- <tr>
83
- <td colspan="2">合计分值</td>
84
- <td>{{ easyNum === 0? '-': easyNum }}</td>
85
- <td>{{ midNum === 0? '-': midNum }}</td>
86
- <td>{{ hardNum === 0? '-': hardNum }}</td>
87
- <td>试卷总分</td>
88
- <td :colspan="readOnlys&&butShows? 1: 2">{{ totalNum === 0? '-': totalNum }}</td>
89
- </tr>
90
- </table>
91
- </div>
2
+ <div class="question">
3
+ <table border="0" cellspacing="0" cellpadding="0">
4
+ <tr>
5
+ <th v-if="serial">题序</th>
6
+ <th>题型</th>
7
+ <th>易</th>
8
+ <th>中</th>
9
+ <th>难</th>
10
+ <th>合计题量</th>
11
+ <th>合计分值</th>
12
+ <th v-if="!readOnlys&&butShows">操作</th>
13
+ </tr>
14
+ <tbody v-for="(item,index) in question" :key="index">
15
+ <tr>
16
+ <td rowspan="2" v-if="serial">{{ empty ? '-' : toChineseNum(index + 1) }}</td>
17
+ <td rowspan="2">{{ item.quesName }}</td>
18
+ <td>
19
+ <div v-if="empty" class="qu-input" :style="{'margin-left': '0px'}">
20
+ <span>{{ item.easy }}</span>
21
+ </div>
22
+ <div v-else class="qu-input" :style="{'margin-left': readOnlys?'0px':'-10px'}">
23
+ <span v-if="readOnlys">{{ item.easy === '' ? '-' : item.easy }}</span>
24
+ <input v-else type="number" placeholder="题量" :value="item.easy" @input="totalQuestions($event,1,index)"
25
+ @keypress="isNumberKey($event,1)"/>
26
+ </div>
27
+ </td>
28
+ <td>
29
+ <div v-if="empty" class="qu-input" :style="{'margin-left': '0px'}">
30
+ <span>{{ item.mid }}</span>
31
+ </div>
32
+ <div v-else class="qu-input" :style="{'margin-left': readOnlys?'0px':'-10px'}">
33
+ <span v-if="readOnlys">{{ item.mid === '' ? '-' : item.mid }}</span>
34
+ <input v-else type="number" placeholder="题量" :value="item.mid" @input="totalQuestions($event,3,index)"
35
+ @keypress="isNumberKey($event,1)"/>
36
+ </div>
37
+ </td>
38
+ <td>
39
+ <div v-if="empty" class="qu-input" :style="{'margin-left': '0px'}">
40
+ <span>{{ item.hard }}</span>
41
+ </div>
42
+ <div v-else class="qu-input" :style="{'margin-left': readOnlys?'0px':'-10px'}">
43
+ <span v-if="readOnlys">{{ item.hard === '' ? '-' : item.hard }}</span>
44
+ <input v-else type="number" placeholder="题量" :value="item.hard" @input="totalQuestions($event,2,index)"
45
+ @keypress="isNumberKey($event,1)"/>
46
+ </div>
47
+ </td>
48
+ <td rowspan="2">{{ item.count }}</td>
49
+ <td rowspan="2">{{ item.allScore }}</td>
50
+ <td rowspan="2" v-if="!readOnlys&&butShows">
51
+ <span class="buts" v-if="empty">-</span>
52
+ <button v-else class="but" @click="cancel(index)">撤销选择</button>
53
+ </td>
54
+ </tr>
55
+ <tr>
56
+ <td>
57
+ <div v-if="algorithm === 1">
58
+ <div v-if="empty" class="qu-input" :style="{'margin-left': '0px'}">
59
+ <span>{{ item.easyScore }}</span>
60
+ </div>
61
+ <div v-else class="qu-input" :style="{'margin-left': readOnlys?'0px':'-10px'}">
62
+ <span v-if="readOnlys">{{ item.easyScore === '' ? '-' : item.easyScore }}</span>
63
+ <input v-else type="number" placeholder="分值" :value="item.easyScore"
64
+ @input="totalQuestions($event,4,index)" @keypress="isNumberKey($event,2)"/>
65
+ </div>
66
+ </div>
67
+ <div v-if="algorithm === 2" class="qu-input" :style="{'margin-left': '-5px'}">
68
+ <span>{{ Number(item.easy) * Number(item.easyScore) }}</span>
69
+ </div>
70
+ </td>
71
+ <td>
72
+ <div v-if="algorithm === 1">
73
+ <div v-if="empty" class="qu-input" :style="{'margin-left': '0px'}">
74
+ <span>{{ item.midScore }}</span>
75
+ </div>
76
+ <div v-else class="qu-input" :style="{'margin-left': readOnlys?'0px':'-10px'}">
77
+ <span v-if="readOnlys">{{ item.midScore === '' ? '-' : item.midScore }}</span>
78
+ <input v-else type="number" placeholder="分值" :value="item.midScore"
79
+ @input="totalQuestions($event,6,index)" @keypress="isNumberKey($event,2)"/>
80
+ </div>
81
+ </div>
82
+ <div v-if="algorithm === 2" class="qu-input" :style="{'margin-left': '-5px'}">
83
+ <span>{{ Number(item.mid) * Number(item.midScore) }}</span>
84
+ </div>
85
+ </td>
86
+ <td>
87
+ <div v-if="algorithm === 1">
88
+ <div v-if="empty" class="qu-input" :style="{'margin-left': '0px'}">
89
+ <span>{{ item.hardScore === '' ? '-' : item.hardScore }}</span>
90
+ </div>
91
+ <div v-else class="qu-input" :style="{'margin-left': readOnlys?'0px':'-10px'}">
92
+ <span v-if="readOnlys">{{ item.hardScore === '' ? '-' : item.hardScore }}</span>
93
+ <input v-else type="number" placeholder="分值" :value="item.hardScore"
94
+ @input="totalQuestions($event,5,index)" @keypress="isNumberKey($event,2)"/>
95
+ </div>
96
+ </div>
97
+ <div v-if="algorithm === 2" class="qu-input" :style="{'margin-left': '-5px'}">
98
+ <span>{{ Number(item.hard) * Number(item.hardScore) }}</span>
99
+ </div>
100
+ </td>
101
+ </tr>
102
+ </tbody>
103
+ <tr>
104
+ <td :colspan="serial?2:1">合计分值</td>
105
+ <td>{{ easyNum === 0 ? '-' : easyNum }}</td>
106
+ <td>{{ midNum === 0 ? '-' : midNum }}</td>
107
+ <td>{{ hardNum === 0 ? '-' : hardNum }}</td>
108
+ <td>试卷总分</td>
109
+ <td :colspan="readOnlys&&butShows? 1: 2">{{ totalNum === 0 ? '-' : totalNum }}</td>
110
+ </tr>
111
+ </table>
112
+ </div>
92
113
  </template>
93
114
 
94
115
  <script>
95
116
 
96
117
  export default {
97
- name: "zydx-question",
98
- data() {
99
- return {
100
- question: [],
101
- easyNum: 0,
102
- hardNum: 0,
103
- midNum: 0,
104
- totalNum: 0,
105
- readOnlys: this.readOnly,
106
- butShows: this.butShow,
107
- empty: false
118
+ name: "zydx-question",
119
+ data() {
120
+ return {
121
+ question: [],
122
+ easyNum: 0,
123
+ hardNum: 0,
124
+ midNum: 0,
125
+ totalNum: 0,
126
+ readOnlys: this.readOnly,
127
+ butShows: this.butShow,
128
+ empty: false
129
+ }
130
+ },
131
+ props: {
132
+ data: {
133
+ type: Array,
134
+ default: []
135
+ },
136
+ readOnly: {
137
+ type: Boolean,
138
+ default: false
139
+ },
140
+ butShow: {
141
+ type: Boolean,
142
+ default: true
143
+ },
144
+ algorithm: {
145
+ type: Number,
146
+ default: 1
147
+ },
148
+ serial: {
149
+ type: Boolean,
150
+ default: true
151
+ }
152
+ },
153
+ watch: {
154
+ readOnly: {
155
+ handler(val) {
156
+ this.readOnlys = val
157
+ },
158
+ deep: true
159
+ },
160
+ data: {
161
+ handler(val) {
162
+ if (val.length === 0) {
163
+ this.question = [{
164
+ quesType: '-',
165
+ quesName: '-',
166
+ easyScore: '-',
167
+ hardScore: '-',
168
+ midScore: '-',
169
+ easy: '-',
170
+ hard: '-',
171
+ mid: '-',
172
+ allScore: '-',
173
+ count: '-'
174
+ }]
175
+ this.empty = true
176
+ } else {
177
+ this.empty = false
178
+ this.getQuestionReadOnly(val)
108
179
  }
180
+ },
181
+ immediate: true
182
+ }
183
+ },
184
+ emits: ['cancel'],
185
+ methods: {
186
+ getQuestionReadOnly(v) {
187
+ let arr = []
188
+ v.forEach(item => {
189
+ arr.push({
190
+ ...item,
191
+ quesType: item.quesType,
192
+ quesName: item.quesName,
193
+ easyScore: item.easyScore ? item.easyScore : '',
194
+ hardScore: item.hardScore ? item.hardScore : '',
195
+ midScore: item.midScore ? item.midScore : '',
196
+ easy: item.easy ? item.easy : '',
197
+ hard: item.hard ? item.hard : '',
198
+ mid: item.mid ? item.mid : '',
199
+ allScore: item.allScore ? item.allScore : '-',
200
+ count: item.count ? item.count : '-',
201
+ })
202
+ })
203
+ this.question = arr
204
+ this.totalScore()
109
205
  },
110
- props: {
111
- data: {
112
- type: Array,
113
- default: []
114
- },
115
- readOnly: {
116
- type: Boolean,
117
- default: false
118
- },
119
- butShow: {
120
- type: Boolean,
121
- default: true
206
+ getContent() {
207
+ let arr = []
208
+ let state = false
209
+ for (let i = 0; i < this.question.length; i++) {
210
+ if (this.question[i].allScore === '-' || this.question[i].count === '-') {
211
+ state = true
212
+ continue;
122
213
  }
214
+ arr.push({
215
+ ...this.question[i],
216
+ easyScore: this.question[i].easy ? this.question[i].easyScore : '',
217
+ hardScore: this.question[i].hard ? this.question[i].hardScore : '',
218
+ midScore: this.question[i].mid ? this.question[i].midScore : '',
219
+ easy: this.question[i].easyScore ? this.question[i].easy : '',
220
+ hard: this.question[i].hardScore ? this.question[i].hard : '',
221
+ mid: this.question[i].midScore ? this.question[i].mid : ''
222
+ })
223
+ }
224
+ return {
225
+ data: arr,
226
+ total: this.totalNum,
227
+ state: state
228
+ }
229
+ },
230
+ // 添加数据
231
+ addData(v, n) {
232
+ const len = this.question.length
233
+ if (n) n(len)
234
+ if (len === 6) return
235
+ if (this.empty) {
236
+ this.empty = false
237
+ this.question = []
238
+ }
239
+ this.question.push({
240
+ ...v,
241
+ quesType: v.quesType,
242
+ quesName: v.quesName,
243
+ easyScore: '',
244
+ hardScore: '',
245
+ midScore: '',
246
+ easy: '',
247
+ hard: '',
248
+ mid: '',
249
+ allScore: '-',
250
+ count: '-',
251
+ })
123
252
  },
124
- watch: {
125
- readOnly: {
126
- handler(val) {
127
- this.readOnlys = val
128
- },
129
- deep: true
130
- },
131
- data: {
132
- handler(val) {
133
- if(val.length === 0) {
134
- this.question = [{
135
- quesType: '-',
136
- quesName: '-',
137
- easyScore: '-',
138
- hardScore: '-',
139
- midScore: '-',
140
- easy: '-',
141
- hard: '-',
142
- mid: '-',
143
- allScore: '-',
144
- count: '-'
145
- }]
146
- this.empty = true
147
- }else {
148
- this.empty = false
149
- this.getQuestionReadOnly(val)
150
- }
151
- },
152
- immediate: true
253
+ cancel(i) {
254
+ this.$emit('cancel', this.question[i])
255
+ this.question.splice(i, 1)
256
+ this.totalScore()
257
+ },
258
+ totalQuestions(v, i, n) {
259
+ const value = Number(v.target.value);
260
+ if (i === 1) this.question[n].easy = value === 0 ? '' : value
261
+ if (i === 2) this.question[n].hard = value === 0 ? '' : value
262
+ if (i === 3) this.question[n].mid = value === 0 ? '' : value
263
+ if (i === 4) this.question[n].easyScore = value === 0 ? '' : value
264
+ if (i === 5) this.question[n].hardScore = value === 0 ? '' : value
265
+ if (i === 6) this.question[n].midScore = value === 0 ? '' : value
266
+ const total = (this.question[n].easy === '' ? 0 : this.question[n].easy) + (this.question[n].hard === '' ? 0 : this.question[n].hard) + (this.question[n].mid === '' ? 0 : this.question[n].mid)
267
+ this.question[n].count = (total === 0) ? '-' : total
268
+ const num1 = this.question[n].easyScore === '' ? 0 : this.question[n].easyScore * this.question[n].easy
269
+ const num2 = this.question[n].hardScore === '' ? 0 : this.question[n].hardScore * this.question[n].hard
270
+ const num3 = this.question[n].midScore === '' ? 0 : this.question[n].midScore * this.question[n].mid
271
+ const total2 = num1 + num2 + num3
272
+ this.question[n].allScore = (total2 === 0) ? '-' : total2
273
+ this.totalScore()
274
+ },
275
+ totalScore() {
276
+ this.easyNum = 0
277
+ this.hardNum = 0
278
+ this.midNum = 0
279
+ this.question.forEach(x => {
280
+ this.easyNum += x.easyScore === '' ? 0 : Number(x.easyScore) * Number(x.easy)
281
+ this.hardNum += x.hardScore === '' ? 0 : Number(x.hardScore) * Number(x.hard)
282
+ this.midNum += x.midScore === '' ? 0 : Number(x.midScore) * Number(x.mid)
283
+ })
284
+ this.totalNum = this.easyNum + this.hardNum + this.midNum
285
+ },
286
+ // 数字转大写
287
+ toChineseNum(num) {
288
+ const chnNumChar = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
289
+ if (num >= 10) {
290
+ if (num === 10) {
291
+ return "十"
292
+ } else {
293
+ return "十" + chnNumChar[num % 10]
153
294
  }
295
+ }
296
+ return chnNumChar[num];
154
297
  },
155
- emits: ['cancel'],
156
- methods: {
157
- getQuestionReadOnly(v) {
158
- let arr = []
159
- v.forEach(item => {
160
- arr.push({
161
- ...item,
162
- quesType: item.quesType,
163
- quesName: item.quesName,
164
- easyScore: item.easyScore? item.easyScore: '',
165
- hardScore: item.hardScore? item.hardScore: '',
166
- midScore: item.midScore? item.midScore: '',
167
- easy: item.easy? item.easy: '',
168
- hard: item.hard? item.hard: '',
169
- mid: item.mid? item.mid: '',
170
- allScore: item.allScore? item.allScore: '-',
171
- count: item.count? item.count: '-',
172
- })
173
- })
174
- this.question = arr
175
- this.totalScore()
176
- },
177
- getContent() {
178
- let arr = []
179
- let state = false
180
- for(let i=0; i< this.question.length; i++) {
181
- if(this.question[i].allScore === '-' || this.question[i].count === '-') {
182
- state = true
183
- continue;
184
- }
185
- arr.push({
186
- ...this.question[i],
187
- easyScore: this.question[i].easy? this.question[i].easyScore: '',
188
- hardScore: this.question[i].hard? this.question[i].hardScore: '',
189
- midScore: this.question[i].mid? this.question[i].midScore: '',
190
- easy: this.question[i].easyScore? this.question[i].easy: '',
191
- hard: this.question[i].hardScore? this.question[i].hard: '',
192
- mid: this.question[i].midScore? this.question[i].mid: ''
193
- })
194
- }
195
- return {
196
- data: arr,
197
- total: this.totalNum,
198
- state: state
199
- }
200
- },
201
- // 添加数据
202
- addData(v,n) {
203
- const len = this.question.length
204
- if(n) n(len)
205
- if(len === 6) return
206
- if(this.empty) {
207
- this.empty = false
208
- this.question = []
209
- }
210
- this.question.push({
211
- ...v,
212
- quesType: v.quesType,
213
- quesName: v.quesName,
214
- easyScore:'',
215
- hardScore:'',
216
- midScore: '',
217
- easy: '',
218
- hard: '',
219
- mid: '',
220
- allScore: '-',
221
- count: '-',
222
- })
223
- },
224
- cancel(i) {
225
- this.$emit('cancel',this.question[i])
226
- this.question.splice(i,1)
227
- this.totalScore()
228
- },
229
- totalQuestions(v,i,n) {
230
- const value = Number(v.target.value);
231
- if(i === 1) this.question[n].easy = value === 0? '' : value
232
- if(i === 2) this.question[n].hard = value === 0? '' : value
233
- if(i === 3) this.question[n].mid = value === 0? '' : value
234
- if(i === 4) this.question[n].easyScore = value === 0? '' : value
235
- if(i === 5) this.question[n].hardScore = value === 0? '' : value
236
- if(i === 6) this.question[n].midScore = value === 0? '' : value
237
- const total = (this.question[n].easy === ''? 0: this.question[n].easy) + (this.question[n].hard === ''? 0: this.question[n].hard) + (this.question[n].mid === ''? 0: this.question[n].mid)
238
- this.question[n].count = (total === 0)? '-' : total
239
- const num1 = this.question[n].easyScore === ''? 0: this.question[n].easyScore * this.question[n].easy
240
- const num2 = this.question[n].hardScore === ''? 0: this.question[n].hardScore * this.question[n].hard
241
- const num3 = this.question[n].midScore === ''? 0: this.question[n].midScore * this.question[n].mid
242
- const total2 = num1 + num2 + num3
243
- this.question[n].allScore = (total2 === 0)? '-' : total2
244
- this.totalScore()
245
- },
246
- totalScore() {
247
- this.easyNum = 0
248
- this.hardNum = 0
249
- this.midNum = 0
250
- this.question.forEach(x => {
251
- this.easyNum += x.easyScore === '' ? 0: Number(x.easyScore) * Number(x.easy)
252
- this.hardNum += x.hardScore === '' ? 0: Number(x.hardScore) * Number(x.hard)
253
- this.midNum += x.midScore === '' ? 0: Number(x.midScore) * Number(x.mid)
254
- })
255
- this.totalNum = this.easyNum + this.hardNum + this.midNum
256
- },
257
- // 数字转大写
258
- toChineseNum(num) {
259
- const chnNumChar = ["零","一","二","三","四","五","六","七","八","九"];
260
- if(num >= 10) {
261
- if(num === 10) {
262
- return "十"
263
- }else {
264
- return "十" + chnNumChar[num % 10]
265
- }
266
- }
267
- return chnNumChar[num];
268
- },
269
- isNumberKey(event,num) {
270
- const charCode = (event.which) ? event.which : event.keyCode;
271
- const val = event.target.value;
272
- if(val.length > 2) event.preventDefault();
273
- if(num === 1) {
274
- if (charCode > 31 && (charCode < 48 || charCode > 57)) event.preventDefault();
275
- }else {
276
- if (charCode === 46) {
277
- if (val.indexOf('.') !== -1)
278
- event.preventDefault();
279
- else
280
- return true;
281
- } else if (charCode > 31 && (charCode < 48 || charCode > 57))
282
- event.preventDefault();
283
- }
284
- if (this.valueState(event.target.value) && String.fromCharCode(charCode) === '0') event.preventDefault();
285
- },
286
- valueState(v) {
287
- return v === '' || v === undefined || v === null;
288
- },
289
- }
298
+ isNumberKey(event, num) {
299
+ const charCode = (event.which) ? event.which : event.keyCode;
300
+ const val = event.target.value;
301
+ if (val.length > 2) event.preventDefault();
302
+ if (num === 1) {
303
+ if (charCode > 31 && (charCode < 48 || charCode > 57)) event.preventDefault();
304
+ } else {
305
+ if (charCode === 46) {
306
+ if (val.indexOf('.') !== -1)
307
+ event.preventDefault();
308
+ else
309
+ return true;
310
+ } else if (charCode > 31 && (charCode < 48 || charCode > 57))
311
+ event.preventDefault();
312
+ }
313
+ if (this.valueState(event.target.value) && String.fromCharCode(charCode) === '0') event.preventDefault();
314
+ },
315
+ valueState(v) {
316
+ return v === '' || v === undefined || v === null;
317
+ },
318
+ }
290
319
  }
291
320
  </script>
292
321
 
293
322
  <style scoped>
294
323
  .question {
295
- width: 100%;
324
+ width: 100%;
296
325
  }
297
326
 
298
327
  .question table {
299
- width: 100%;
300
- border-top: 1px solid #ccc;
301
- border-left: 1px solid #ccc;
328
+ width: 100%;
329
+ border-top: 1px solid #ccc;
330
+ border-left: 1px solid #ccc;
302
331
  }
303
332
 
304
333
  .question table th, .question table td {
305
- font-size: 14px;
306
- text-align: center;
307
- padding: 5px 0;
308
- border-bottom: 1px solid #ccc;
309
- border-right: 1px solid #ccc;
310
- font-weight: 400;
334
+ font-size: 14px;
335
+ text-align: center;
336
+ padding: 5px 0;
337
+ border-bottom: 1px solid #ccc;
338
+ border-right: 1px solid #ccc;
339
+ font-weight: 400;
311
340
  }
312
341
 
313
342
  .qu-input {
314
- width: 60px;
315
- display: inline-block;
316
- overflow: hidden;
343
+ width: 60px;
344
+ display: inline-block;
345
+ overflow: hidden;
317
346
  }
318
- .qu-input input{
319
- border: 0;
320
- outline: none;
321
- text-align: center;
322
- width: 80px;
347
+
348
+ .qu-input input {
349
+ border: 0;
350
+ outline: none;
351
+ text-align: center;
352
+ width: 80px;
323
353
  }
324
354
 
325
355
  .but {
326
- margin-left: 1px;
327
- font-size: 12px;
328
- background-color: transparent;
329
- border: 1px solid #000;
330
- border-radius: 3px;
331
- padding: 2px 5px;
332
- cursor: pointer;
333
- min-width: 60px;
334
- height: 21px;
356
+ margin-left: 1px;
357
+ font-size: 12px;
358
+ background-color: transparent;
359
+ border: 1px solid #000;
360
+ border-radius: 3px;
361
+ padding: 2px 5px;
362
+ cursor: pointer;
363
+ min-width: 60px;
364
+ height: 21px;
335
365
  }
336
- .buts{
337
- margin-left: 1px;
338
- font-size: 12px;
339
- background-color: transparent;
340
- border-radius: 3px;
341
- padding: 2px 5px;
342
- cursor: pointer;
343
- min-width: 60px;
344
- height: 21px;
345
- display: inline-block;
346
- font-weight: bold;
366
+
367
+ .buts {
368
+ margin-left: 1px;
369
+ font-size: 12px;
370
+ background-color: transparent;
371
+ border-radius: 3px;
372
+ padding: 2px 5px;
373
+ cursor: pointer;
374
+ min-width: 60px;
375
+ height: 21px;
376
+ display: inline-block;
377
+ font-weight: bold;
347
378
  }
348
379
  </style>
package/src/index.js CHANGED
@@ -79,7 +79,7 @@ function install(app) {
79
79
  }
80
80
 
81
81
  export default {
82
- version: '1.32.273',
82
+ version: '1.32.275',
83
83
  install,
84
84
  Calendar,
85
85
  Message,