zydx-plus 1.32.272 → 1.32.274

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.272",
3
+ "version": "1.32.274",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="drag-pop" :class="{'zin': isMove}" :style="position" :id="id">
2
+ <div class="drag-pop" :style="position" :id="id" @click.stop="dragTap">
3
3
  <div class="drag-head" :style="{'background-color':titleColor}">
4
4
  <span @mousedown.stop="mousedown"
5
5
  @mousemove.stop="mousemove"
@@ -89,6 +89,9 @@ export default {
89
89
  default: false
90
90
  },
91
91
  },
92
+ beforeUnmount() {
93
+ this.clean()
94
+ },
92
95
  watch: {
93
96
  width: {
94
97
  handler: function (val, oldVal) {
@@ -115,6 +118,11 @@ export default {
115
118
  height: this.footDownOffset - ((this.dragTextShow)?60:30)
116
119
  })
117
120
  })
121
+ let popArr = []
122
+ const pop = sessionStorage.getItem('pop')
123
+ popArr = (pop === null)? [] : JSON.parse(pop)
124
+ popArr.push(this.id)
125
+ sessionStorage.setItem('pop', JSON.stringify(popArr))
118
126
  },
119
127
  computed: {
120
128
  position() {
@@ -123,6 +131,23 @@ export default {
123
131
  },
124
132
  emits: ['dragStatus', 'close', 'enlarge','updateDrag','minimize'],
125
133
  methods: {
134
+ dragTap() {
135
+ let pop = JSON.parse(sessionStorage.getItem('pop'))
136
+ for(let i = 0; i< pop.length; i++) {
137
+ if(document.getElementById(pop[i]) === null) continue
138
+ document.getElementById(pop[i]).style.zIndex = '100'
139
+ }
140
+ document.getElementById(this.id).style.zIndex = '1000'
141
+ },
142
+ clean() {
143
+ let pop = JSON.parse(sessionStorage.getItem('pop'))
144
+ pop.forEach((x,i) => {
145
+ if(x === this.id) {
146
+ pop.splice(i, 1);
147
+ }
148
+ })
149
+ sessionStorage.setItem('pop', JSON.stringify(pop))
150
+ },
126
151
  disconnect() {
127
152
  this.$emit('dragStatus')
128
153
  },
@@ -136,6 +161,7 @@ export default {
136
161
  event.preventDefault()
137
162
  this.direction = v
138
163
  this.footIsMove = true;
164
+ this.dragTap()
139
165
  },
140
166
  footMove(event) {
141
167
  if (this.state) return;
@@ -162,6 +188,7 @@ export default {
162
188
  this.leftOffset = event.offsetX;
163
189
  this.topOffset = event.offsetY;
164
190
  this.isMove = true;
191
+ this.dragTap()
165
192
  },
166
193
  //鼠标移动
167
194
  mousemove(event) {
@@ -1,348 +1,375 @@
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>题序</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)"
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="2">合计分值</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
+ },
149
+ watch: {
150
+ readOnly: {
151
+ handler(val) {
152
+ this.readOnlys = val
153
+ },
154
+ deep: true
155
+ },
156
+ data: {
157
+ handler(val) {
158
+ if (val.length === 0) {
159
+ this.question = [{
160
+ quesType: '-',
161
+ quesName: '-',
162
+ easyScore: '-',
163
+ hardScore: '-',
164
+ midScore: '-',
165
+ easy: '-',
166
+ hard: '-',
167
+ mid: '-',
168
+ allScore: '-',
169
+ count: '-'
170
+ }]
171
+ this.empty = true
172
+ } else {
173
+ this.empty = false
174
+ this.getQuestionReadOnly(val)
108
175
  }
176
+ },
177
+ immediate: true
178
+ }
179
+ },
180
+ emits: ['cancel'],
181
+ methods: {
182
+ getQuestionReadOnly(v) {
183
+ let arr = []
184
+ v.forEach(item => {
185
+ arr.push({
186
+ ...item,
187
+ quesType: item.quesType,
188
+ quesName: item.quesName,
189
+ easyScore: item.easyScore ? item.easyScore : '',
190
+ hardScore: item.hardScore ? item.hardScore : '',
191
+ midScore: item.midScore ? item.midScore : '',
192
+ easy: item.easy ? item.easy : '',
193
+ hard: item.hard ? item.hard : '',
194
+ mid: item.mid ? item.mid : '',
195
+ allScore: item.allScore ? item.allScore : '-',
196
+ count: item.count ? item.count : '-',
197
+ })
198
+ })
199
+ this.question = arr
200
+ this.totalScore()
109
201
  },
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
202
+ getContent() {
203
+ let arr = []
204
+ let state = false
205
+ for (let i = 0; i < this.question.length; i++) {
206
+ if (this.question[i].allScore === '-' || this.question[i].count === '-') {
207
+ state = true
208
+ continue;
122
209
  }
210
+ arr.push({
211
+ ...this.question[i],
212
+ easyScore: this.question[i].easy ? this.question[i].easyScore : '',
213
+ hardScore: this.question[i].hard ? this.question[i].hardScore : '',
214
+ midScore: this.question[i].mid ? this.question[i].midScore : '',
215
+ easy: this.question[i].easyScore ? this.question[i].easy : '',
216
+ hard: this.question[i].hardScore ? this.question[i].hard : '',
217
+ mid: this.question[i].midScore ? this.question[i].mid : ''
218
+ })
219
+ }
220
+ return {
221
+ data: arr,
222
+ total: this.totalNum,
223
+ state: state
224
+ }
225
+ },
226
+ // 添加数据
227
+ addData(v, n) {
228
+ const len = this.question.length
229
+ if (n) n(len)
230
+ if (len === 6) return
231
+ if (this.empty) {
232
+ this.empty = false
233
+ this.question = []
234
+ }
235
+ this.question.push({
236
+ ...v,
237
+ quesType: v.quesType,
238
+ quesName: v.quesName,
239
+ easyScore: '',
240
+ hardScore: '',
241
+ midScore: '',
242
+ easy: '',
243
+ hard: '',
244
+ mid: '',
245
+ allScore: '-',
246
+ count: '-',
247
+ })
123
248
  },
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
249
+ cancel(i) {
250
+ this.$emit('cancel', this.question[i])
251
+ this.question.splice(i, 1)
252
+ this.totalScore()
253
+ },
254
+ totalQuestions(v, i, n) {
255
+ const value = Number(v.target.value);
256
+ if (i === 1) this.question[n].easy = value === 0 ? '' : value
257
+ if (i === 2) this.question[n].hard = value === 0 ? '' : value
258
+ if (i === 3) this.question[n].mid = value === 0 ? '' : value
259
+ if (i === 4) this.question[n].easyScore = value === 0 ? '' : value
260
+ if (i === 5) this.question[n].hardScore = value === 0 ? '' : value
261
+ if (i === 6) this.question[n].midScore = value === 0 ? '' : value
262
+ 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)
263
+ this.question[n].count = (total === 0) ? '-' : total
264
+ const num1 = this.question[n].easyScore === '' ? 0 : this.question[n].easyScore * this.question[n].easy
265
+ const num2 = this.question[n].hardScore === '' ? 0 : this.question[n].hardScore * this.question[n].hard
266
+ const num3 = this.question[n].midScore === '' ? 0 : this.question[n].midScore * this.question[n].mid
267
+ const total2 = num1 + num2 + num3
268
+ this.question[n].allScore = (total2 === 0) ? '-' : total2
269
+ this.totalScore()
270
+ },
271
+ totalScore() {
272
+ this.easyNum = 0
273
+ this.hardNum = 0
274
+ this.midNum = 0
275
+ this.question.forEach(x => {
276
+ this.easyNum += x.easyScore === '' ? 0 : Number(x.easyScore) * Number(x.easy)
277
+ this.hardNum += x.hardScore === '' ? 0 : Number(x.hardScore) * Number(x.hard)
278
+ this.midNum += x.midScore === '' ? 0 : Number(x.midScore) * Number(x.mid)
279
+ })
280
+ this.totalNum = this.easyNum + this.hardNum + this.midNum
281
+ },
282
+ // 数字转大写
283
+ toChineseNum(num) {
284
+ const chnNumChar = ["零", "一", "二", "三", "四", "五", "六", "七", "八", "九"];
285
+ if (num >= 10) {
286
+ if (num === 10) {
287
+ return "十"
288
+ } else {
289
+ return "十" + chnNumChar[num % 10]
153
290
  }
291
+ }
292
+ return chnNumChar[num];
154
293
  },
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
- }
294
+ isNumberKey(event, num) {
295
+ const charCode = (event.which) ? event.which : event.keyCode;
296
+ const val = event.target.value;
297
+ if (val.length > 2) event.preventDefault();
298
+ if (num === 1) {
299
+ if (charCode > 31 && (charCode < 48 || charCode > 57)) event.preventDefault();
300
+ } else {
301
+ if (charCode === 46) {
302
+ if (val.indexOf('.') !== -1)
303
+ event.preventDefault();
304
+ else
305
+ return true;
306
+ } else if (charCode > 31 && (charCode < 48 || charCode > 57))
307
+ event.preventDefault();
308
+ }
309
+ if (this.valueState(event.target.value) && String.fromCharCode(charCode) === '0') event.preventDefault();
310
+ },
311
+ valueState(v) {
312
+ return v === '' || v === undefined || v === null;
313
+ },
314
+ }
290
315
  }
291
316
  </script>
292
317
 
293
318
  <style scoped>
294
319
  .question {
295
- width: 100%;
320
+ width: 100%;
296
321
  }
297
322
 
298
323
  .question table {
299
- width: 100%;
300
- border-top: 1px solid #ccc;
301
- border-left: 1px solid #ccc;
324
+ width: 100%;
325
+ border-top: 1px solid #ccc;
326
+ border-left: 1px solid #ccc;
302
327
  }
303
328
 
304
329
  .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;
330
+ font-size: 14px;
331
+ text-align: center;
332
+ padding: 5px 0;
333
+ border-bottom: 1px solid #ccc;
334
+ border-right: 1px solid #ccc;
335
+ font-weight: 400;
311
336
  }
312
337
 
313
338
  .qu-input {
314
- width: 60px;
315
- display: inline-block;
316
- overflow: hidden;
339
+ width: 60px;
340
+ display: inline-block;
341
+ overflow: hidden;
317
342
  }
318
- .qu-input input{
319
- border: 0;
320
- outline: none;
321
- text-align: center;
322
- width: 80px;
343
+
344
+ .qu-input input {
345
+ border: 0;
346
+ outline: none;
347
+ text-align: center;
348
+ width: 80px;
323
349
  }
324
350
 
325
351
  .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;
352
+ margin-left: 1px;
353
+ font-size: 12px;
354
+ background-color: transparent;
355
+ border: 1px solid #000;
356
+ border-radius: 3px;
357
+ padding: 2px 5px;
358
+ cursor: pointer;
359
+ min-width: 60px;
360
+ height: 21px;
335
361
  }
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;
362
+
363
+ .buts {
364
+ margin-left: 1px;
365
+ font-size: 12px;
366
+ background-color: transparent;
367
+ border-radius: 3px;
368
+ padding: 2px 5px;
369
+ cursor: pointer;
370
+ min-width: 60px;
371
+ height: 21px;
372
+ display: inline-block;
373
+ font-weight: bold;
347
374
  }
348
375
  </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.272',
82
+ version: '1.32.274',
83
83
  install,
84
84
  Calendar,
85
85
  Message,