zydx-plus 1.32.275 → 1.32.277

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.275",
3
+ "version": "1.32.277",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -241,3 +241,25 @@ input[name='check'] {
241
241
  font-weight: 700;
242
242
  flex: 1;
243
243
  }
244
+ .choice-ico{
245
+ width: 15px;
246
+ height: 15px;
247
+ display: inline-block;
248
+ border: 1px solid #666;
249
+ border-radius: 3px;
250
+ position: absolute;
251
+ top: 4px;
252
+ left: 2em;
253
+ z-index: 1;
254
+ }
255
+ .check-active{
256
+ background-color: #007acc;
257
+ border: 1px solid #007acc;
258
+ }
259
+ .check-dis{
260
+ background-color: #d0d0d0;
261
+ border: 1px solid #d0d0d0;
262
+ }
263
+ .check-dis-bor{
264
+ border: 1px solid #d0d0d0;
265
+ }
@@ -54,6 +54,9 @@
54
54
  <button class="but" :class="{'buts-actives': item.review}"
55
55
  @click="review(index)">{{ item.review ? reasoningBut[1].startName : reasoningBut[1].endName }}</button>
56
56
  </b>
57
+ <b :style="{right: -item.right + 'px', top: item.top + 'px'}" v-if="customBut.length > 0" ref="b">
58
+ <button class="but" v-for="(it,ind) in customBut" :class="{'buts-actives': it.active}" @click="customButTap(it,item)">{{ it.name }}</button>
59
+ </b>
57
60
  </i>
58
61
  </span>
59
62
  </div>
@@ -68,15 +71,25 @@
68
71
  </div>
69
72
  <div class="choice" v-if="item.testKey" v-show="item.open">
70
73
  <div class="choice-box" v-for="(ts,ind) in item.testKey">
71
- <label>
74
+ <label v-if="ques(item.quesType)">
72
75
  <input class="choice-input" v-if="chooseAnswer" :disabled="disabled" :checked="ts.checked"
73
- @change="answerChange($event,item,`${id}${index}`)" :type="ques(item.quesType)?'radio':'checkbox'"
76
+ @change="answerChange($event,item,`${id}${index}`,null)" type="radio"
74
77
  :name="`${id}${index}`"/>
75
78
  <span
76
79
  :class="{'choice-span': chooseAnswer,'choice-color': disabled&&ts.checked&&!item.error&&!nothing,'choice-red': disabled&&ts.checked&&item.error&&!nothing}">{{
77
80
  ts.index
78
81
  }}. {{ ts.content[0] }}</span>
79
82
  </label>
83
+ <label v-else>
84
+ <input class="choice-input" style="display: none;" v-if="chooseAnswer" :disabled="disabled" :checked="ts.checked"
85
+ @change="answerChange($event,item,`${id}${index}`,ts)" type="checkbox"
86
+ :name="`${id}${index}`"/>
87
+ <i class="choice-ico" :class="{'check-active': ts.checked, 'check-dis': disabled&&ts.checked,'check-dis-bor': disabled&&!ts.checked}"></i>
88
+ <span
89
+ :class="{'choice-span': chooseAnswer,'choice-color': disabled&&ts.checked&&!item.error&&!nothing,'choice-red': disabled&&ts.checked&&item.error&&!nothing}">{{
90
+ ts.index
91
+ }}. {{ ts.content[0] }}</span>
92
+ </label>
80
93
  </div>
81
94
  </div>
82
95
  <div class="table" v-if="item.replace&&item.itemList&&collapse&&item.quesType === '102_1'">
@@ -217,6 +230,10 @@ export default {
217
230
  nothing: {
218
231
  type: Boolean,
219
232
  default: false
233
+ },
234
+ customBut:{
235
+ type: Array,
236
+ default: []
220
237
  }
221
238
  },
222
239
  watch: {
@@ -247,6 +264,10 @@ export default {
247
264
  },
248
265
  emits: ['change', 'modify', 'del', 'changeAll', 'replaceData', 'choiceData', 'judgeAnswer', 'openReasoning', 'review', 'subject'],
249
266
  methods: {
267
+ customButTap(e,d) {
268
+ if(e.key === 'option') d.open = !d.open
269
+ e.onClick(e)
270
+ },
250
271
  init() {
251
272
  this.value = JSON.parse(JSON.stringify(this.data))
252
273
  this.value.map((item, index) => { // 转换html
@@ -323,7 +344,8 @@ export default {
323
344
  statistics(i) {
324
345
  this.value[i].replace = !this.value[i].replace
325
346
  },
326
- answerChange(e, v, id) {
347
+ answerChange(e, v, id, check) {
348
+ if(check !== null) check.checked = e.target.checked
327
349
  let answerArr = []
328
350
  const ids = document.getElementsByName(id)
329
351
  ids.forEach((x, index) => {
package/src/index.js CHANGED
@@ -79,7 +79,7 @@ function install(app) {
79
79
  }
80
80
 
81
81
  export default {
82
- version: '1.32.275',
82
+ version: '1.32.277',
83
83
  install,
84
84
  Calendar,
85
85
  Message,