zydx-plus 1.35.504 → 1.35.506

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.35.504",
3
+ "version": "1.35.506",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -6,8 +6,8 @@
6
6
  @mouseup.stop="mouseup"
7
7
  @mouseleave.stop="mousemove" :style="{'text-align': title === ''? 'center':'left'}" v-html="title"></span>
8
8
  <div class="drag-i">
9
- <!-- <i class="minimize-cir" v-if="minimizeCir" @click.stop="minimizeTap"></i>-->
10
- <!-- <i class="minimize" v-if="minimize" @click.stop="minimizeTap"></i>-->
9
+ <i class="minimize-cir" v-if="minimizeCir" @click.stop="minimizeTap"></i>
10
+ <i class="minimize" v-if="minimize" @click.stop="minimizeTap"></i>
11
11
  <slot name="icon"></slot>
12
12
  <i class="disconnect" v-if="disconnectShow" @click.stop="disconnect"></i>
13
13
  <i class="enlarge" v-if="enlargeShow" @click.stop="enlarge"></i>
@@ -275,7 +275,7 @@ export default {
275
275
  if (this.direction === 'd') {
276
276
  this.footDownOffset = event.clientY - this.y;
277
277
  } else if (this.direction === 'in') {
278
- this.footDownOffset = event.clientY - this.y;
278
+ this.footDownOffset = event.clientX - this.x;
279
279
  this.footRightOffset = event.clientX - this.x;
280
280
  } else if (this.direction === 'r') {
281
281
  this.footRightOffset = event.clientX - this.x;
@@ -2,10 +2,10 @@
2
2
  <teleport to="body">
3
3
  <div class="drag-pop" :class="{trans: transAll, 'drag-pop-shadow': !fixedStart}" :style="position" :id="id" @mousedown.stop="dragTap">
4
4
  <div v-show="!fixedStart" class="drag-head" :style="{'background-color':titleColor}" @click="selectedDrag">
5
- <span :class="id + 'draggable'" :style="{'text-align': title === ''? 'center':'left'}" v-html="title"></span>
5
+ <span :id="'draggable' + id" :style="{'text-align': title === ''? 'center':'left'}" v-html="title"></span>
6
6
  <div class="drag-i">
7
- <!-- <i class="minimize-cir" v-if="minimizeCir" @click.stop="minimizeTap"></i>-->
8
- <!-- <i class="minimize" v-if="minimize" @click.stop="minimizeTap"></i>-->
7
+ <i class="minimize-cir" v-if="minimizeCir" @click.stop="minimizeTap"></i>
8
+ <i class="minimize" v-if="minimize" @click.stop="minimizeTap"></i>
9
9
  <slot name="icon"></slot>
10
10
  <i class="disconnect" v-if="disconnectShow" @click.stop="disconnect"></i>
11
11
  <i class="enlarge" v-if="enlargeShow" @click.stop="enlarge"></i>
@@ -155,7 +155,6 @@ export default {
155
155
  this.footDownOffset = val
156
156
  if (this.isInitShowBottomRight) {
157
157
  this.y = window.innerHeight - val
158
- console.log('this.y', this.y)
159
158
  }
160
159
  },
161
160
  immediate: true
@@ -169,33 +168,11 @@ export default {
169
168
  deep: true
170
169
  }
171
170
  },
171
+ created() {
172
+ this.id = Math.random().toString(36).substr(2)
173
+ },
172
174
  mounted() {
173
- let that = this
174
- this.id = Math.random().toString(36).substr(2);
175
175
  this.init()
176
- // 全局监听鼠标抬起事件
177
- setTimeout(() => {
178
- interact(`.${that.id}draggable`).draggable({
179
- listeners: {
180
- move (event) {
181
- that.y = event.rect.top
182
- that.x = event.rect.left
183
- if (that.x < -that.footRightOffset / 2) {
184
- that.x = -that.footRightOffset / 2
185
- }
186
- if (that.x > that.clientWidth - that.footRightOffset + that.footRightOffset / 2) {
187
- that.x = that.clientWidth - that.footRightOffset + that.footRightOffset / 2
188
- }
189
- if (that.y < 0) {
190
- that.y = 0
191
- }
192
- if (that.y > that.clientHeight - that.footDownOffset + that.footDownOffset / 2) {
193
- that.y = that.clientHeight - that.footDownOffset + that.footDownOffset / 2
194
- }
195
- }
196
- }
197
- })
198
- },100)
199
176
  document.addEventListener('mouseup', this.footUp);
200
177
  this.$nextTick(() => {
201
178
  this.$emit('updateDrag', {
@@ -267,6 +244,7 @@ export default {
267
244
  this.$emit('dragStatus')
268
245
  },
269
246
  init() {
247
+ let that = this
270
248
  if(this.fixedStart) {
271
249
  const wid = document.getElementById('app').offsetWidth
272
250
  this.x = this.left + (wid-this.initWidth)/2
@@ -277,6 +255,28 @@ export default {
277
255
  this.x = this.clientWidth / 2 - this.footRightOffset / 2;
278
256
  this.y = this.clientHeight / 2 - this.footDownOffset / 2;
279
257
  }
258
+ setTimeout(() => {
259
+ interact(`#draggable${that.id}`).draggable({
260
+ listeners: {
261
+ move (event) {
262
+ that.y = event.rect.top
263
+ that.x = event.rect.left
264
+ if (that.x < -that.footRightOffset / 2) {
265
+ that.x = -that.footRightOffset / 2
266
+ }
267
+ if (that.x > that.clientWidth - that.footRightOffset + that.footRightOffset / 2) {
268
+ that.x = that.clientWidth - that.footRightOffset + that.footRightOffset / 2
269
+ }
270
+ if (that.y < 0) {
271
+ that.y = 0
272
+ }
273
+ if (that.y > that.clientHeight - that.footDownOffset + that.footDownOffset / 2) {
274
+ that.y = that.clientHeight - that.footDownOffset + that.footDownOffset / 2
275
+ }
276
+ }
277
+ }
278
+ })
279
+ },0)
280
280
  },
281
281
  getWH(v) {
282
282
  this.transAll = true
@@ -298,7 +298,7 @@ export default {
298
298
  if (this.direction === 'd') {
299
299
  this.footDownOffset = event.clientY - this.y;
300
300
  } else if (this.direction === 'in') {
301
- this.footDownOffset = event.clientY - this.y;
301
+ this.footDownOffset = event.clientX - this.x;
302
302
  this.footRightOffset = event.clientX - this.x;
303
303
  } else if (this.direction === 'r') {
304
304
  this.footRightOffset = event.clientX - this.x;
@@ -541,9 +541,3 @@ export default {
541
541
  z-index: 10000;
542
542
  }
543
543
  </style>
544
- <script setup>
545
- </script>
546
- <script setup>
547
- </script>
548
- <script setup>
549
- </script>
@@ -1050,12 +1050,10 @@ export default {
1050
1050
  handler: function (e) {
1051
1051
  let time = setInterval(() => {
1052
1052
  if (this.editor) { // 没有时间以后 停止定时器
1053
- this.editor.setOptions({
1054
- editable: !e
1055
- })
1053
+ this.editor.setOptions({editable: !e})
1056
1054
  if (this.page) {
1057
- this.editableShow = !e
1058
1055
  setTimeout(() => {
1056
+ this.editableShow = !e
1059
1057
  if (e) {
1060
1058
  this.readOnlyPage() // 只读分页
1061
1059
  }
@@ -2164,6 +2162,11 @@ export default {
2164
2162
  this.$refs['read-only'].style.width = '900px'
2165
2163
  this.wit = 900
2166
2164
  }
2165
+ let element = document.querySelectorAll('.editor-content-show')[0]
2166
+ let witA = element.offsetWidth
2167
+ if (witA !== this.wit) {
2168
+ element.style.width = '900px'
2169
+ }
2167
2170
  let max = this.wit * 1.6 - 186
2168
2171
  let pHeight = 0
2169
2172
  let html = ''
@@ -2198,7 +2201,7 @@ export default {
2198
2201
  let mBottom = parseInt(getComputedStyle(data[i]).marginBottom)
2199
2202
  let text = data[i].offsetHeight + Bottom + top + mtop + mBottom
2200
2203
  if ((pHeight + text) > max) {
2201
- const {start, end, size} = this.rows(data[i], max - pHeight)
2204
+ const {start, middle, end, size} = this.rows(data[i], max - pHeight,max)
2202
2205
  let child = data[i].childNodes[0]
2203
2206
  let childNodes = data[i].childNodes[0].childNodes[0]
2204
2207
  let fontSize = size
@@ -2225,28 +2228,48 @@ export default {
2225
2228
  } else {
2226
2229
  label = 'span'
2227
2230
  }
2228
- if (child && child.nodeName !== '#text') {
2229
- if (childNodes && childNodes.nodeName === 'MARK') {
2230
- html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}" class="${className}"><${label} style="font-size: ${fontSize}; font-family: ${fontFamily};color:${color}"><mark class="custom-class" data-color="${childBColor}" style="background-color: ${childBColor}; color: ${childColor};">${start.data}</mark></${label}></p>`
2231
+ if(start.data!== ''){
2232
+ if (child && child.nodeName !== '#text') {
2233
+ if (childNodes && childNodes.nodeName === 'MARK') {
2234
+ html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}" class="${className}"><${label} style="font-size: ${fontSize}; font-family: ${fontFamily};color:${color}"><mark class="custom-class" data-color="${childBColor}" style="background-color: ${childBColor}; color: ${childColor};">${start.data}</mark></${label}></p>`
2235
+ } else {
2236
+ html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}" class="${className}"><${label} style="font-size: ${fontSize}; font-family: ${fontFamily};color:${color}">${start.data}</${label}></p>`
2237
+ }
2231
2238
  } else {
2232
- html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}" class="${className}"><${label} style="font-size: ${fontSize}; font-family: ${fontFamily};color:${color}">${start.data}</${label}></p>`
2239
+ html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}" class="${className}"><${label} style="font-size: ${size}px;">${start.data}</${label}></p>`
2233
2240
  }
2234
- } else {
2235
- html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}" class="${className}"><${label} style="font-size: ${size}px;">${start.data}</${label}></p>`
2241
+ this.htmlArr.push(html)
2242
+ pHeight = 0
2243
+ html = ''
2236
2244
  }
2237
- this.htmlArr.push(html)
2238
- pHeight = 0
2239
- html = ''
2240
- if (child && child.nodeName !== '#text') {
2241
- if (childNodes && childNodes.nodeName === 'MARK') {
2242
- html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}"><${label} style="font-size: ${fontSize}; font-family: ${fontFamily};color:${color}"><mark class="custom-class" data-color="${childBColor}" style="background-color: ${childBColor}; color: ${childColor};">${end.data}</mark></${label}></p>`
2245
+ if (middle.length){
2246
+ middle.forEach(item=>{
2247
+ if (child && child.nodeName !== '#text') {
2248
+ if (childNodes && childNodes.nodeName === 'MARK') {
2249
+ html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}"><${label} style="font-size: ${fontSize}; font-family: ${fontFamily};color:${color}"><mark class="custom-class" data-color="${childBColor}" style="background-color: ${childBColor}; color: ${childColor};">${item.data}</mark></${label}></p>`
2250
+ } else {
2251
+ html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}"><${label} style="font-size: ${fontSize}; font-family: ${fontFamily};color:${color}">${item.data}</${label}></p>`
2252
+ }
2253
+ } else {
2254
+ html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}"><${label} style="font-size: ${size}px;">${item.data}</${label}></p>`
2255
+ }
2256
+ this.htmlArr.push(html)
2257
+ pHeight = 0
2258
+ html = ''
2259
+ })
2260
+ }
2261
+ if(end.data!== ''){
2262
+ if (child && child.nodeName !== '#text') {
2263
+ if (childNodes && childNodes.nodeName === 'MARK') {
2264
+ html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}"><${label} style="font-size: ${fontSize}; font-family: ${fontFamily};color:${color}"><mark class="custom-class" data-color="${childBColor}" style="background-color: ${childBColor}; color: ${childColor};">${end.data}</mark></${label}></p>`
2265
+ } else {
2266
+ html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}"><${label} style="font-size: ${fontSize}; font-family: ${fontFamily};color:${color}">${end.data}</${label}></p>`
2267
+ }
2243
2268
  } else {
2244
- html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}"><${label} style="font-size: ${fontSize}; font-family: ${fontFamily};color:${color}">${end.data}</${label}></p>`
2269
+ html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}"><${label} style="font-size: ${size}px;">${end.data}</${label}></p>`
2245
2270
  }
2246
- } else {
2247
- html += `<p ${signid ? 'data-signid=' + signid : ''} style="text-align: ${textAlign}"><${label} style="font-size: ${size}px;">${end.data}</${label}></p>`
2271
+ pHeight = end.size
2248
2272
  }
2249
- pHeight = end.size
2250
2273
  } else {
2251
2274
  pHeight += text
2252
2275
  if (data[i].dataset?.signid !== 'splitLine' && data[i].dataset?.signid !== 'annotationSplitLine' && data[i].dataset?.signid !== 'referenceSplitLine') html += data[i].outerHTML
@@ -2374,18 +2397,31 @@ export default {
2374
2397
  this.menus = false
2375
2398
  this.menuOne = false
2376
2399
  },
2377
- rows(data, num) {
2400
+ rows(data, num, max) {
2378
2401
  let size = parseInt(window.getComputedStyle(data, null).fontSize)
2379
2402
  let line = parseInt(window.getComputedStyle(data, null).lineHeight)
2380
- let width = data.offsetWidth
2403
+ let width = data.offsetWidth-40
2381
2404
  let height = data.offsetHeight
2382
2405
  let rows = Math.round(num / line) // 行数
2406
+ let rowsA = Math.round( max / line) // 行数
2383
2407
  let text = data.innerText
2384
2408
  let textLen = this.measureText(text, size, width * rows)
2385
2409
  let start = text.slice(0, textLen)
2410
+ let textLenA = this.measureText(text, size, width * rowsA)
2411
+ let ON = Math.round((text.length - textLen)/textLenA)
2412
+ let middle = []
2413
+ for (let i = 0; i < ON; i++) {
2414
+ let obj = {
2415
+ data:text.slice(textLen+1, textLen+textLenA),
2416
+ size:max
2417
+ }
2418
+ middle.push(obj)
2419
+ textLen+=textLenA
2420
+ }
2386
2421
  let end = text.slice(textLen)
2387
2422
  return {
2388
2423
  start: {data: start, size: num},
2424
+ middle:middle,
2389
2425
  end: {data: end, size: height - num},
2390
2426
  size: size,
2391
2427
  // family: fontFamily.replace(/\"/g,"")
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <dragPopup2 :z-index="10002" title="手写记录" @updateDrag="updateDragInit" :width="width" :height="height" :minWidth="740" :minHeight="487" @close="cancel" :minimizeCir="false" :dragTextShow="false">
2
+ <dragPopup :z-index="10002" title="手写记录" @updateDrag="updateDragInit" :width="width" :height="height" :minWidth="740" :minHeight="487" @close="cancel" :minimizeCir="false" :dragTextShow="false">
3
3
  <template #content>
4
4
  <div class="paint" :id="ids">
5
5
  <div class="paint-title"></div>
@@ -12,8 +12,8 @@
12
12
  </div>
13
13
  </div>
14
14
  </template>
15
- </dragPopup2>
16
- <dragPopup2 :z-index="10003" :width="600" :height="417" v-if="show" :dragStatus="false" :minimizeCir="false" :enlargeShow="false" @close="close">
15
+ </dragPopup>
16
+ <dragPopup :z-index="10003" :width="600" :height="417" v-if="show" :dragStatus="false" :minimizeCir="false" :enlargeShow="false" @close="close">
17
17
  <template #content>
18
18
  <div class="can">
19
19
  <div class="can-cont" :id="ids + 'cont'">
@@ -35,7 +35,7 @@
35
35
  </div>
36
36
  </div>
37
37
  </template>
38
- </dragPopup2>
38
+ </dragPopup>
39
39
  <teleport to="body">
40
40
  <div class="tool-cont" :style="{left: left + 'px', top: top + 'px'}">
41
41
  <div class="tool"
@@ -112,14 +112,15 @@
112
112
  </template>
113
113
 
114
114
  <script>
115
+ import interact from 'interactjs'
115
116
  import Sketchpad from '../../sketchpad/src/sketchpad'
116
- import dragPopup2 from '../../dragPopup2/src/dragPopup'
117
+ import dragPopup from '../../dragPopup/src/dragPopup'
117
118
  import Mess from '../../tipBox/index'
118
119
 
119
120
  let stayTime = 0
120
121
  let timer = null
121
122
  export default {
122
- components: {Sketchpad, dragPopup2},
123
+ components: {Sketchpad, dragPopup},
123
124
  data() {
124
125
  return {
125
126
  width: 940,
@@ -115,6 +115,8 @@ export default {
115
115
  }, 500)
116
116
  },
117
117
  mousedown(event) {
118
+ const className = event.target.className;
119
+ if (className === 'pic-down') return;
118
120
  event.preventDefault()
119
121
  //鼠标按下事件
120
122
  this.leftOffset = event.offsetX;
@@ -123,12 +125,16 @@ export default {
123
125
  },
124
126
  //鼠标移动
125
127
  mousemove(event) {
128
+ const className = event.target.className;
129
+ if (className === 'pic-down') return;
126
130
  if (!this.isMove) return;
127
131
  this.x = event.clientX - this.leftOffset;
128
132
  this.y = event.clientY - this.topOffset;
129
133
  },
130
134
  //鼠标抬起
131
135
  mouseup() {
136
+ const className = event.target.className;
137
+ if (className === 'pic-down') return;
132
138
  this.isMove = false;
133
139
  },
134
140
  url(v) {
package/src/index.js CHANGED
@@ -89,7 +89,7 @@ function install(app) {
89
89
  }
90
90
 
91
91
  export default {
92
- version: '1.35.504',
92
+ version: '1.35.506',
93
93
  install,
94
94
  Calendar,
95
95
  Message,