zydx-plus 1.35.466 → 1.35.467

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.466",
3
+ "version": "1.35.467",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -1177,9 +1177,9 @@ export default {
1177
1177
  })
1178
1178
  })
1179
1179
  },
1180
- readPdf:debounce(()=> {
1180
+ readPdf:debounce(function (){
1181
1181
  let that = this
1182
- this.mouse()
1182
+ that.mouse()
1183
1183
  pdfs.getPage(that.pageIndex).then(function (page) {
1184
1184
  let canvas = document.getElementById(that.id)
1185
1185
  let canvas2 = document.getElementById(`${that.id}2`)
@@ -1230,11 +1230,11 @@ export default {
1230
1230
  }, 1000)
1231
1231
  })
1232
1232
  },200),
1233
- readDoublePdf:debounce(()=>{
1233
+ readDoublePdf:debounce(function (){
1234
1234
  let that = this
1235
- this.mouse()
1236
- this.$nextTick(()=>{
1237
- this.pageInfoArr.forEach((item,index)=>{
1235
+ that.mouse()
1236
+ that.$nextTick(()=>{
1237
+ that.pageInfoArr.forEach((item,index)=>{
1238
1238
  pdfs.getPage(index+1).then(function (page) {
1239
1239
  let canvas = document.getElementById(item.id)
1240
1240
  let canvas2 = document.getElementById(`${item.id}2`)
@@ -16,25 +16,25 @@
16
16
  export default {
17
17
  name: "zydx-variable-box",
18
18
  props: {
19
- isShowsRight:{
19
+ isShowsRight: {
20
20
  type: Boolean,
21
21
  default: true
22
22
  },
23
- isShowsLeft:{
23
+ isShowsLeft: {
24
24
  type: Boolean,
25
25
  default: true
26
26
  },
27
27
  },
28
28
  watch: {
29
- isShowsRight:{
29
+ isShowsRight: {
30
30
  handler: function (v) {
31
31
  setTimeout(() => {
32
- if(this.isShowsRight) {
32
+ if (this.isShowsRight) {
33
33
  this.handleResize()
34
34
  } else {
35
35
  this.$refs.leftRef.style.width = '100%'
36
36
  }
37
- } , 100)
37
+ }, 200)
38
38
  },
39
39
  immediate: true,
40
40
  deep: true
@@ -47,7 +47,7 @@ export default {
47
47
  } else {
48
48
  this.$refs.rightRef.style.width = '100%'
49
49
  }
50
- }, 100)
50
+ }, 200)
51
51
  },
52
52
  immediate: true,
53
53
  deep: true
@@ -65,32 +65,36 @@ export default {
65
65
  leftDom = this.$refs.leftRef,
66
66
  resizeDom = this.$refs.resizeRef,
67
67
  rightDom = this.$refs.rightRef;
68
- resizeDom.onmousedown = e => {
69
- const startX = e.clientX; // 记录坐标起始位置
70
- leftDom.left = leftDom.offsetWidth; // 左边元素起始宽度
71
- document.onmousemove = e => {
72
- const endX = e.clientX; // 鼠标拖动的终止位置
73
- let moveLen = leftDom.left + (endX - startX); // 移动的距离 = endX - startX,左边区域最后的宽度 = resizeDom.left + 移动的距离
74
- const maxWidth = boxDom.clientWidth - resizeDom.offsetWidth; // 左右两边区域的总宽度 = 外层容器宽度 - 中间区域拖拉框的宽度
75
- // 限制左边区域的最小宽度为 leftMinWidth
76
- if (moveLen < leftMinWidth) {
77
- moveLen = leftMinWidth;
78
- }
79
- // 右边区域最小宽度为 rightMinWidth
80
- if (moveLen > maxWidth - rightMinWidth) {
81
- moveLen = maxWidth - rightMinWidth;
82
- }
83
- leftDom.style.width = (moveLen / maxWidth) * 100 + "%"; // 设置左边区域的宽度,通过换算为百分比的形式,实现窗体放大缩小自适应
84
- rightDom.style.width = ((maxWidth - moveLen) / maxWidth) * 100 + "%"; // 右边区域 = 总大小 - 左边宽度 - 拖动条宽度
68
+ if (resizeDom) {
69
+ leftDom.style.width = '50%'
70
+ rightDom.style.width = '50%'
71
+ resizeDom.onmousedown = e => {
72
+ const startX = e.clientX; // 记录坐标起始位置
73
+ leftDom.left = leftDom.offsetWidth; // 左边元素起始宽度
74
+ document.onmousemove = e => {
75
+ const endX = e.clientX; // 鼠标拖动的终止位置
76
+ let moveLen = leftDom.left + (endX - startX); // 移动的距离 = endX - startX,左边区域最后的宽度 = resizeDom.left + 移动的距离
77
+ const maxWidth = boxDom.clientWidth - resizeDom.offsetWidth; // 左右两边区域的总宽度 = 外层容器宽度 - 中间区域拖拉框的宽度
78
+ // 限制左边区域的最小宽度为 leftMinWidth
79
+ if (moveLen < leftMinWidth) {
80
+ moveLen = leftMinWidth;
81
+ }
82
+ // 右边区域最小宽度为 rightMinWidth
83
+ if (moveLen > maxWidth - rightMinWidth) {
84
+ moveLen = maxWidth - rightMinWidth;
85
+ }
86
+ leftDom.style.width = (moveLen / maxWidth) * 100 + "%"; // 设置左边区域的宽度,通过换算为百分比的形式,实现窗体放大缩小自适应
87
+ rightDom.style.width = ((maxWidth - moveLen) / maxWidth) * 100 + "%"; // 右边区域 = 总大小 - 左边宽度 - 拖动条宽度
88
+ };
89
+ document.onmouseup = () => {
90
+ document.onmousemove = null;
91
+ document.onmouseup = null;
92
+ resizeDom.releaseCapture && resizeDom.releaseCapture(); // 鼠标捕获释放
93
+ };
94
+ resizeDom.setCapture && resizeDom.setCapture(); // 启用鼠标捕获
95
+ return false;
85
96
  };
86
- document.onmouseup = () => {
87
- document.onmousemove = null;
88
- document.onmouseup = null;
89
- resizeDom.releaseCapture && resizeDom.releaseCapture(); // 鼠标捕获释放
90
- };
91
- resizeDom.setCapture && resizeDom.setCapture(); // 启用鼠标捕获
92
- return false;
93
- };
97
+ }
94
98
  }
95
99
  }
96
100
  };
@@ -104,8 +108,7 @@ export default {
104
108
  box-sizing: border-box;
105
109
  }
106
110
  .left {
107
- width: 100%;
108
- /*background-color: #f1eab3;*/
111
+ width: 50%;
109
112
  }
110
113
  .resize {
111
114
  position: relative;
@@ -120,7 +123,6 @@ export default {
120
123
  background-color: white;
121
124
  }
122
125
  .right {
123
- width: 310px;
124
- /* background-color: #b5ef8f;*/
126
+ width: 50%;
125
127
  }
126
128
  </style>
package/src/index.js CHANGED
@@ -87,7 +87,7 @@ function install(app) {
87
87
  }
88
88
 
89
89
  export default {
90
- version: '1.35.466',
90
+ version: '1.35.467',
91
91
  install,
92
92
  Calendar,
93
93
  Message,