zydx-plus 1.32.217 → 1.32.219

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.217",
3
+ "version": "1.32.219",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -21,7 +21,7 @@
21
21
  <button class="but-brown" :disabled="page === 0" :class="{'but-act': page === 0}" @click="last">上一页</button>
22
22
  <button class="but-brown" :disabled="page === htmlArr.length - 1" :class="{'but-act': page === htmlArr.length - 1}" @click="next">下一页</button>
23
23
  </div>
24
- <div class="right-menu" :style="rightStyle" v-if="rightMenuShow">
24
+ <div class="right-menu" :style="rightStyle" v-if="rightMenuShow&&!readOnlys">
25
25
  <span @click="annotations">批注</span>
26
26
  </div>
27
27
  </div>
@@ -36,7 +36,7 @@
36
36
  <span>{{ teacher }}</span>
37
37
  <em>{{ item.time === '' ? '' : '(' + item.time + ')' }}</em>
38
38
  </div>
39
- <div class="list-right">
39
+ <div class="list-right" v-if="!readOnlys">
40
40
  <button v-if="item.readable" class="but" @click.stop="preservation(item.id,index)">保存批注</button>
41
41
  <button v-if="item.readable" class="but" @click.stop="cancel(item.id,index)">取消批注</button>
42
42
  <button v-if="!item.readable" class="but" @click.stop="modify(index)">修改批注</button>
@@ -81,7 +81,8 @@ export default {
81
81
  linkData: [],
82
82
  htmlArr: [],
83
83
  page: 0,
84
- dataID: []
84
+ dataID: [],
85
+ readOnlys: false
85
86
  }
86
87
  },
87
88
  props: {
@@ -95,6 +96,10 @@ export default {
95
96
  teacher: {
96
97
  type: String,
97
98
  default: ''
99
+ },
100
+ readOnly: {
101
+ type: Boolean,
102
+ default: false
98
103
  }
99
104
  },
100
105
  watch: {
@@ -110,6 +115,13 @@ export default {
110
115
  })
111
116
  },
112
117
  immediate: true
118
+ },
119
+ readOnly: {
120
+ handler(val) {
121
+ this.readOnlys = val
122
+ },
123
+ deep: true,
124
+ immediate: true
113
125
  }
114
126
  },
115
127
  emits: ["del","preservation"],
@@ -223,5 +223,6 @@ ul::-webkit-scrollbar {width: 0}
223
223
  height: 26px;
224
224
  box-sizing: border-box;
225
225
  font-size: 16px;
226
+ line-height: 18px;
226
227
  }
227
- </style>
228
+ </style>
@@ -8,7 +8,7 @@ render(divNode, document.body)
8
8
  const container = divNode.el
9
9
 
10
10
  // 导出函数可通过调用 Confirm() 函数动态创建 XtxConfirm 组件
11
- const Confirm = ({ type, url ,title,radioArr,checkboxArr,submitText, promptContent, middle, cancelShow, inputArr }) => {
11
+ const Confirm = ({ type, url ,title,radioArr,checkboxArr,submitText,cancelText, promptContent, middle, cancelShow, inputArr }) => {
12
12
  // 返回 Promise 对象
13
13
  return new Promise((resolve, reject) => {
14
14
  // 2. 点击确认按钮,触发resolve同时销毁组件
@@ -46,7 +46,7 @@ const Confirm = ({ type, url ,title,radioArr,checkboxArr,submitText, promptConte
46
46
  reject('点击取消')
47
47
  }
48
48
  // 1. 创建 XtxConfirm 组件
49
- const VNode = createVNode(XtxConfirm, { type, url ,title, submitText, promptContent,radioArr,checkboxArr, middle, cancelShow, inputArr, submit, cancel })
49
+ const VNode = createVNode(XtxConfirm, { type, url ,title, submitText, cancelText, promptContent,radioArr,checkboxArr, middle, cancelShow, inputArr, submit, cancel })
50
50
  render(VNode, container)
51
51
  })
52
52
  }
@@ -81,7 +81,7 @@
81
81
  </div>
82
82
  <div class="tip-btnBox">
83
83
  <div @click="submit" v-html="submitText"></div>
84
- <div v-if="cancelShow" @click="cancel">取&emsp;&emsp;消</div>
84
+ <div v-if="cancelShow" @click="cancel" v-html="cancelText"></div>
85
85
  </div>
86
86
  </div>
87
87
  </div>
@@ -144,6 +144,10 @@ export default {
144
144
  type: String,
145
145
  default: '确&emsp;&emsp;认'
146
146
  },
147
+ cancelText: {
148
+ type: String,
149
+ default: '取&emsp;&emsp;消'
150
+ },
147
151
  // 确认按钮
148
152
  submit: {
149
153
  type: Function,
@@ -182,3 +182,26 @@ input[name='check'] {
182
182
  line-height: 26px;
183
183
  text-indent: 2em;
184
184
  }
185
+ .table{
186
+ width: 100%;
187
+ margin: 5px 0;
188
+ }
189
+ .table table{
190
+ width: 100%;
191
+ border-left: 1px solid #ccc;
192
+ border-top: 1px solid #ccc;
193
+ }
194
+ .table table td{
195
+ line-height: 30px;
196
+ font-weight: normal;
197
+ text-align: center;
198
+ border-bottom: 1px solid #ccc;
199
+ border-right: 1px solid #ccc;
200
+ font-size: 14px;
201
+ }
202
+ .table table td:first-child{
203
+ width: 110px;
204
+ }
205
+ .tab-title{
206
+ font-weight: 700 !important;
207
+ }
@@ -12,8 +12,7 @@
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 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>
15
+ <button class="but" @click="replaceTap(item,index)">{{ replaceText }}</button>
17
16
  </b>
18
17
  <b :style="{right: -item.right + 'px', top: item.top + 'px'}" v-if="choice" ref="b">
19
18
  <button class="but"
@@ -23,6 +22,10 @@
23
22
  {{ choiceState? '选择题目' : item.choice?'撤销选择': '选择题目' }}
24
23
  </button>
25
24
  </b>
25
+ <b :style="{right: -item.right + 'px', top: item.top + 'px'}" v-if="collapse" ref="b">
26
+ <button class="but" :class="{'buts-actives': item.open}" @click="openOption(index)">{{ item.open?'收起选项':'试题选项'}}</button>
27
+ <button class="but" :class="{'buts-actives': item.replace}" @click="statistics(index)">{{ item.replace?'收统计表':'统计表'}}</button>
28
+ </b>
26
29
  </i>
27
30
  </span>
28
31
  </div>
@@ -41,6 +44,46 @@
41
44
  </label>
42
45
  </div>
43
46
  </div>
47
+ <div class="table" v-if="item.replace&&item.itemList&&collapse&&item.quesType.split('_')[1] === undefined">
48
+ <table border="0" cellspacing="0" cellpadding="0">
49
+ <tr>
50
+ <td :colspan="item.itemList.length + 1" class="tab-title">选项分布情况统计表</td>
51
+ </tr>
52
+ <tr>
53
+ <td>选&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;项</td>
54
+ <td v-for="(ts,ind) in item.itemList">{{ ts.itemName }}</td>
55
+ </tr>
56
+ <tr>
57
+ <td>选择人数</td>
58
+ <td v-for="(ts,ind) in item.itemList">{{ ts.count }}人</td>
59
+ </tr>
60
+ <tr>
61
+ <td>占&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;比</td>
62
+ <td v-for="(ts,ind) in item.itemList">{{ ts.percentage === null? 0: ts.percentage}}%</td>
63
+ </tr>
64
+ </table>
65
+ </div>
66
+ <div class="table" v-if="item.replace&&item.itemList&&collapse&&item.quesType.split('_')[1] === '1'">
67
+ <table border="0" cellspacing="0" cellpadding="0">
68
+ <tr>
69
+ <td :colspan="5" class="tab-title">答题情况统计表</td>
70
+ </tr>
71
+ <tr>
72
+ <td>难易程度</td>
73
+ <td>答题人数</td>
74
+ <td>正答人数</td>
75
+ <td>错答人数</td>
76
+ <td>正确率</td>
77
+ </tr>
78
+ <tr>
79
+ <td>{{ diffLeveNum(item.diffLeve) }}</td>
80
+ <td>{{ item.answerCount? item.answerCount: 0 }}</td>
81
+ <td>{{ item.rightCount? item.rightCount: '-' }}</td>
82
+ <td>{{ item.wrongCount? item.wrongCount: '-' }}</td>
83
+ <td>{{ item.accuracy? item.accuracy: '-' }}</td>
84
+ </tr>
85
+ </table>
86
+ </div>
44
87
  </div>
45
88
  </div>
46
89
  </div>
@@ -118,7 +161,7 @@ export default {
118
161
  item.right = 0
119
162
  item.top = 0
120
163
  item.open = true
121
- item.replace = false
164
+ item.replace = true
122
165
  if(item.alist) {
123
166
  item.alist.map(x => {
124
167
  x.annexContent = json2html({node: "root",child: JSON.parse(x.annexContent)})
@@ -172,9 +215,17 @@ export default {
172
215
  },
173
216
  emits: ['change','modify','del','changeAll','replaceData','choiceData','judgeAnswer'],
174
217
  methods: {
218
+ diffLeveNum(v) {
219
+ if(v === '1') return '简单'
220
+ if(v === '2') return '中等'
221
+ if(v === '3') return '困难'
222
+ },
175
223
  openOption(i) {
176
224
  this.data[i].open = !this.data[i].open
177
225
  },
226
+ statistics(i) {
227
+ this.data[i].replace = !this.data[i].replace
228
+ },
178
229
  answerChange(e,v,id) {
179
230
  let answerArr = []
180
231
  const ids = document.getElementsByName(id)
@@ -218,8 +269,6 @@ export default {
218
269
  this.$emit('replaceData', {
219
270
  data: v,
220
271
  index: i
221
- }, (e) => {
222
- this.data[i].replace = e
223
272
  })
224
273
  },
225
274
  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.217',
82
+ version: '1.32.219',
83
83
  install,
84
84
  Calendar,
85
85
  Message,