zydx-plus 1.33.412 → 1.33.414
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,8 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="tabs cl" :ref="`tabs${id}`" :style="{'text-align': heiStart? 'left': 'center'}">
|
|
3
3
|
<div class="tabs-li" :class="{'tab-active': actives === index}" @click="listTap(index)"
|
|
4
|
-
v-for="(item,index) in list" :key="index"
|
|
5
|
-
</div>
|
|
4
|
+
v-for="(item,index) in list" :key="index" v-html="item[column[0]]"></div>
|
|
6
5
|
<!-- <div v-if="addShow" @click="addTap" class="tabs-li tab-add">+</div>-->
|
|
7
6
|
</div>
|
|
8
7
|
</template>
|
|
@@ -110,6 +110,7 @@ export default {
|
|
|
110
110
|
document.getElementById('htmlText').style.width = this.$refs.tagging.offsetWidth + 'px'
|
|
111
111
|
this.annotationsData = val.annotations
|
|
112
112
|
setTimeout(() => {
|
|
113
|
+
this.page = 0
|
|
113
114
|
this.readOnlyPage() // 分页
|
|
114
115
|
},100)
|
|
115
116
|
})
|
|
@@ -160,7 +161,6 @@ export default {
|
|
|
160
161
|
let text = data[i].offsetHeight
|
|
161
162
|
if ((pHeight + text) > max) {
|
|
162
163
|
const {start, end, size} = this.rows(data[i], max - pHeight)
|
|
163
|
-
console.log(start, end, size);
|
|
164
164
|
html += `<p class="text"><span style="font-size: ${size}px">${start.data}</span></p>`
|
|
165
165
|
this.htmlArr.push(html)
|
|
166
166
|
pHeight = 0
|
|
@@ -185,6 +185,7 @@ export default {
|
|
|
185
185
|
// 批注数据整理
|
|
186
186
|
annDataArrange() {
|
|
187
187
|
this.annotationsArr = []
|
|
188
|
+
console.log(this.annotationsData);
|
|
188
189
|
this.annotationsData.forEach(item => {
|
|
189
190
|
this.annDataID().forEach(item2 => {
|
|
190
191
|
if (item.id === item2) {
|
|
@@ -199,6 +200,7 @@ export default {
|
|
|
199
200
|
// 当前页批注数据ID
|
|
200
201
|
annDataID() {
|
|
201
202
|
this.dataID = []
|
|
203
|
+
console.log('childNodes',this.$refs.tagging.childNodes);
|
|
202
204
|
this.$refs.tagging.childNodes.forEach(item => {
|
|
203
205
|
this.childNode(item)
|
|
204
206
|
})
|
|
@@ -206,7 +208,7 @@ export default {
|
|
|
206
208
|
},
|
|
207
209
|
childNode(data) {
|
|
208
210
|
data.childNodes.forEach(item => {
|
|
209
|
-
if(item.nodeName === 'I') {
|
|
211
|
+
if(item.nodeName === 'I' || item.nodeName === 'SPAN') {
|
|
210
212
|
this.childNode(item)
|
|
211
213
|
}else {
|
|
212
214
|
if(data.classList[1]) { // 判断是否有批注
|
|
@@ -218,21 +220,23 @@ export default {
|
|
|
218
220
|
rows(data,num) {
|
|
219
221
|
let line = ''
|
|
220
222
|
if(window.getComputedStyle(data, null).lineHeight === 'normal') {
|
|
221
|
-
line =
|
|
223
|
+
line = 19
|
|
222
224
|
} else {
|
|
223
225
|
line = parseInt(window.getComputedStyle(data, null).lineHeight)
|
|
224
226
|
}
|
|
225
227
|
let size = parseInt(window.getComputedStyle(data, null).fontSize)
|
|
226
228
|
let width = data.offsetWidth
|
|
227
229
|
let height = data.offsetHeight
|
|
228
|
-
let rows = Math.round(num / line)
|
|
229
|
-
|
|
230
|
+
// let rows = Math.round(num / line)// 总行数
|
|
231
|
+
// num差了多少
|
|
232
|
+
let rows = Math.floor(num / line)// 差多少行为一整页 向下取整
|
|
233
|
+
let text = data.outerHTML
|
|
230
234
|
let textLen = this.measureText(text,size,width * rows)
|
|
231
235
|
let start = text.slice(0, textLen)
|
|
232
236
|
let end = text.slice(textLen)
|
|
233
237
|
return {
|
|
234
238
|
start: {data: start, size: num},
|
|
235
|
-
end: {data: end, size: height
|
|
239
|
+
end: {data: end, size: Math.ceil((height-num)/line)*line},
|
|
236
240
|
size: size,
|
|
237
241
|
}
|
|
238
242
|
},
|
|
@@ -251,6 +255,7 @@ export default {
|
|
|
251
255
|
this.annotationsArr[index].readable = false
|
|
252
256
|
this.annotationsArr[index].more = true
|
|
253
257
|
this.annotationsArr[index].text = text
|
|
258
|
+
console.log(this.annotationsArr[index]);
|
|
254
259
|
this.linkFor()
|
|
255
260
|
this.htmlArr.forEach(item => html += item)
|
|
256
261
|
this.$emit('preservation', {
|
|
@@ -304,7 +309,7 @@ export default {
|
|
|
304
309
|
const taggingWidth = this.$refs.tagging.offsetWidth
|
|
305
310
|
const height = className.offsetHeight
|
|
306
311
|
const line = window.getComputedStyle(className, null).lineHeight // 行高
|
|
307
|
-
const lineNum = (line === 'normal')?
|
|
312
|
+
const lineNum = (line === 'normal')? 19: parseInt(line)
|
|
308
313
|
const rows = Math.round(height/lineNum) // 行数
|
|
309
314
|
// 底线条宽度
|
|
310
315
|
let linkWidth = taggingWidth - className.offsetLeft + taggingLeft - className.offsetWidth
|
|
@@ -357,13 +362,12 @@ export default {
|
|
|
357
362
|
this.linkData[index*2].border = true
|
|
358
363
|
this.linkData[index*2+1].border = true
|
|
359
364
|
},
|
|
360
|
-
measureText (text, fontSize=10, max=
|
|
361
|
-
text = String(text);
|
|
362
|
-
text = text.split('');
|
|
365
|
+
measureText (text, fontSize=10, max='') {
|
|
366
|
+
text = String(text).split('');
|
|
363
367
|
let num = 0
|
|
364
368
|
let width = 0;
|
|
365
369
|
for (let i = 0; i< text.length; i++) {
|
|
366
|
-
if(max !==
|
|
370
|
+
if(max !== '') {
|
|
367
371
|
if(width * fontSize / 10 >= max) {
|
|
368
372
|
return num
|
|
369
373
|
}
|
|
@@ -381,7 +385,8 @@ export default {
|
|
|
381
385
|
width += 3.25;
|
|
382
386
|
num += 1
|
|
383
387
|
} else if (/[\u4e00-\u9fa5]/.test(text[i])) { //中文匹配
|
|
384
|
-
width += 9.6;
|
|
388
|
+
// width += 9.6;
|
|
389
|
+
width += 10.25;
|
|
385
390
|
num += 1
|
|
386
391
|
} else if (/\(|\)/.test(text[i])) { // 括号匹配
|
|
387
392
|
width += 3.73;
|
|
@@ -389,10 +394,14 @@ export default {
|
|
|
389
394
|
} else if (/\s/.test(text[i])) { // 空格匹配
|
|
390
395
|
width += 2.5;
|
|
391
396
|
num += 1
|
|
392
|
-
} else if (/[`!@#$%^&*()_+\-=\[\]{}
|
|
397
|
+
} else if (/[`!@#$%^&*()_+\-=\[\]{}':"\\|,.<>\/?~]/.test(text[i])) { // 英文符号匹配
|
|
393
398
|
width += 8;
|
|
394
399
|
num += 1
|
|
400
|
+
} else if (/[;]/.test(text[i])) { // ;匹配
|
|
401
|
+
width += 4;
|
|
402
|
+
num += 1
|
|
395
403
|
} else {
|
|
404
|
+
// width += 10;
|
|
396
405
|
width += 10;
|
|
397
406
|
num += 1
|
|
398
407
|
}
|