zydx-plus 1.32.216 → 1.32.217

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.216",
3
+ "version": "1.32.217",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -210,7 +210,7 @@ export default defineComponent({
210
210
  position: absolute;
211
211
  top: 50%;
212
212
  right: 5px;
213
- transform: translateY(-30%);
213
+ transform: translateY(-40%);
214
214
  background: transparent;
215
215
  }
216
216
 
@@ -147,6 +147,9 @@
147
147
  min-width: 60px;
148
148
  height: 21px;
149
149
  }
150
+ .buts-actives{
151
+ color: #00ff00 !important;
152
+ }
150
153
  input[name='check'] {
151
154
  width: 15px;
152
155
  height: 15px;
@@ -12,7 +12,8 @@
12
12
  <button class="but" @click="del(item)">删除</button>
13
13
  </b>
14
14
  <b :style="{right: -item.right + 'px', top: item.top + 'px'}" v-if="replace" ref="b">
15
- <button class="but" @click="replaceTap(item,index)">{{ replaceText }}</button>
15
+ <button v-if="collapse" class="but" :class="{'buts-actives': !item.open}" @click="openOption(index)">{{ item.open?'收起选项':'展开选项'}}</button>
16
+ <button class="but" @click="replaceTap(item,index)" :class="{'buts-actives': item.replace}">{{ replaceText }}</button>
16
17
  </b>
17
18
  <b :style="{right: -item.right + 'px', top: item.top + 'px'}" v-if="choice" ref="b">
18
19
  <button class="but"
@@ -26,17 +27,17 @@
26
27
  </span>
27
28
  </div>
28
29
  </div>
29
- <div v-if="item.alist" class="subject-html">
30
- <div v-for="(item,index) in item.alist">
31
- <div class="subject-html-title">{{ titleText }}{{ index + 1 }}</div>
32
- <div class="subject-html-cont" v-html="item.annexContent"></div>
30
+ <div v-if="item.alist" class="subject-html" v-show="item.open">
31
+ <div v-for="(it,ind) in item.alist">
32
+ <div class="subject-html-title">{{ titleText }}{{ ind + 1 }}</div>
33
+ <div class="subject-html-cont" v-html="it.annexContent"></div>
33
34
  </div>
34
35
  </div>
35
- <div class="choice" v-if="item.testKey">
36
+ <div class="choice" v-if="item.testKey" v-show="item.open">
36
37
  <div class="choice-box" v-for="(ts,ind) in item.testKey">
37
38
  <label>
38
- <input class="choice-input" :disabled="disabled" :checked="ts.checked" @change="answerChange($event,item,index)" :type="ques(item.quesType)?'radio':'checkbox'" :name="index" />
39
- <span class="choice-span">{{ ts.index }}. {{ ts.content[0] }}</span>
39
+ <input class="choice-input" v-if="chooseAnswer" :disabled="disabled" :checked="ts.checked" @change="answerChange($event,item,index)" :type="ques(item.quesType)?'radio':'checkbox'" :name="index" />
40
+ <span :class="{'choice-span': chooseAnswer}">{{ ts.index }}. {{ ts.content[0] }}</span>
40
41
  </label>
41
42
  </div>
42
43
  </div>
@@ -54,7 +55,8 @@ export default {
54
55
  value: [],
55
56
  multipleShow: this.multiple,
56
57
  choiceState: true,
57
- replaceShow: this.replace
58
+ replaceShow: this.replace,
59
+ replaceOpen: false
58
60
  }
59
61
  },
60
62
  props: {
@@ -98,6 +100,14 @@ export default {
98
100
  type: String,
99
101
  default: '替换题目'
100
102
  },
103
+ collapse: {
104
+ type: Boolean,
105
+ default: false
106
+ },
107
+ chooseAnswer: {
108
+ type: Boolean,
109
+ default: true
110
+ }
101
111
  },
102
112
  watch: {
103
113
  data: {
@@ -107,6 +117,8 @@ export default {
107
117
  item.choice = true
108
118
  item.right = 0
109
119
  item.top = 0
120
+ item.open = true
121
+ item.replace = false
110
122
  if(item.alist) {
111
123
  item.alist.map(x => {
112
124
  x.annexContent = json2html({node: "root",child: JSON.parse(x.annexContent)})
@@ -160,6 +172,9 @@ export default {
160
172
  },
161
173
  emits: ['change','modify','del','changeAll','replaceData','choiceData','judgeAnswer'],
162
174
  methods: {
175
+ openOption(i) {
176
+ this.data[i].open = !this.data[i].open
177
+ },
163
178
  answerChange(e,v,id) {
164
179
  let answerArr = []
165
180
  const ids = document.getElementsByName(id)
@@ -203,6 +218,8 @@ export default {
203
218
  this.$emit('replaceData', {
204
219
  data: v,
205
220
  index: i
221
+ }, (e) => {
222
+ this.data[i].replace = e
206
223
  })
207
224
  },
208
225
  choiceTap(v,i) {
package/src/index.js CHANGED
@@ -79,7 +79,7 @@ function install(app) {
79
79
  }
80
80
 
81
81
  export default {
82
- version: '1.32.216',
82
+ version: '1.32.217',
83
83
  install,
84
84
  Calendar,
85
85
  Message,