zydx-plus 1.32.288 → 1.32.289

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.288",
3
+ "version": "1.32.289",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -294,7 +294,7 @@ export default {
294
294
  font-style: normal;
295
295
  }
296
296
  .but{
297
- margin-left: 5px;
297
+ margin-left: 1px;
298
298
  font-size: 12px;
299
299
  background-color: transparent;
300
300
  border: 1px solid #000;
@@ -104,24 +104,30 @@ export default {
104
104
  font-size: 14px;
105
105
  color: #000;
106
106
  font-weight: 700;
107
- line-height: 30px;
107
+ line-height: 15px;
108
108
  }
109
109
  .preface-input{
110
110
  width: 40px;
111
- height: 30px;
111
+ height: 15px;
112
112
  border: 1px solid rgba(204, 204, 204, 1);
113
113
  display: inline-block;
114
114
  overflow: hidden;
115
+ position: relative;
116
+ box-sizing: border-box;
115
117
  }
116
118
  .preface-input>input{
117
119
  width: 55px;
118
- height: 29px;
120
+ height: 13px;
119
121
  border: none;
120
122
  padding-left: 5px;
123
+ position: absolute;
124
+ top: 0;
125
+ left: 0;
126
+ font-size: 12px;
121
127
  }
122
128
  .preface-right{
123
129
  display: flex;
124
- line-height: 30px;
130
+ line-height: 15px;
125
131
  }
126
132
  .preface-list>label{
127
133
  display: inline-block;
@@ -141,4 +147,4 @@ export default {
141
147
  line-height: 30px;
142
148
  padding: 0 10px 0 25px;
143
149
  }
144
- </style>
150
+ </style>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="read">
3
3
  <vue-office-docx v-if="fileType === 'docx'" :src="url" style="height: 100%;" @rendered="renderedHandler" />
4
- <vue-office-excel v-if="fileType === 'xlsx'" :src="url" style="height: 100%;" @rendered="renderedHandler" />
4
+ <vue-office-excel v-if="fileType === 'xlsx' && xlsx" :src="url" style="height: 100%;" @rendered="renderedHandler" />
5
5
  <div class="view-pdf" v-if="fileType === 'pdf'">
6
6
  <div class="pageContainer" v-for="(item,index) in idArr">
7
7
  <canvas :id="item"></canvas>
@@ -45,7 +45,13 @@ export default {
45
45
  pdfPages: 0,
46
46
  loading: false,
47
47
  repeat: false,
48
- idArr: []
48
+ idArr: [],
49
+ scales: 1.35,
50
+ timer: null,
51
+ pdf: null,
52
+ page: 0,
53
+ xlsx: true,
54
+ canvasArr: []
49
55
  }
50
56
  },
51
57
  props: {
@@ -57,6 +63,10 @@ export default {
57
63
  type: Number,
58
64
  default: 1.35
59
65
  },
66
+ scaleStyle: {
67
+ type: Object,
68
+ default: () => {}
69
+ },
60
70
  },
61
71
  watch: {
62
72
  url: {
@@ -66,7 +76,36 @@ export default {
66
76
  },
67
77
  deep: true,
68
78
  immediate: true
69
- }
79
+ },
80
+ scaleStyle: {
81
+ handler: function (val) {
82
+ if(!val) return
83
+ if (this.repeat) return
84
+ if (this.timer) {
85
+ clearTimeout(this.timer)
86
+ }
87
+ this.timer = setTimeout(() => {
88
+ this.scales = val.width / 550
89
+ if(this.scales >= this.scale) {
90
+ this.scales = this.scale
91
+ }
92
+ if(this.fileType === 'pdf') {
93
+ if(val.width >= 800) return
94
+ this.canvasArr.map(item => {
95
+ item.style.width = val.width + 'px'
96
+ item.style.height = val.width*1.35 + 'px'
97
+ })
98
+ }
99
+ if(this.fileType === 'xlsx') {
100
+ this.xlsx = false
101
+ setTimeout(() => {
102
+ this.xlsx = true
103
+ },0)
104
+ }
105
+ }, 200)
106
+ },
107
+ deep: true
108
+ }
70
109
  },
71
110
  methods: {
72
111
  repeatInit() {
@@ -99,9 +138,10 @@ export default {
99
138
  cMapPacked: true
100
139
  })
101
140
  loadingTask.promise.then((pdf) => {
141
+ that.pdf = pdf
102
142
  that.pdfPages = pdf.numPages // 获取pdf文件的总页数
103
- let page = pdf.numPages
104
- that.getPDF(pdf,page)
143
+ that.page = pdf.numPages
144
+ that.getPDF(pdf,that.page)
105
145
  })
106
146
  },
107
147
  getPDF(pdf,page) {
@@ -111,8 +151,9 @@ export default {
111
151
  that.idArr.push(id)
112
152
  pdf.getPage(that.idArr.length).then(function (page) {
113
153
  let canvas = document.getElementById(id)
154
+ that.canvasArr.push(canvas)
114
155
  let ctx = canvas.getContext('2d');
115
- let viewport = page.getViewport({scale: that.scale})
156
+ let viewport = page.getViewport({scale: that.scales})
116
157
  canvas.width = viewport.width * 2
117
158
  canvas.height = viewport.height * 2
118
159
  canvas.style.width = viewport.width + 'px'
@@ -137,7 +137,7 @@
137
137
  width: 50%;
138
138
  }
139
139
  .but{
140
- margin-left: 5px;
140
+ margin-left: 1px;
141
141
  font-size: 12px;
142
142
  background-color: transparent;
143
143
  border: 1px solid #000;
package/src/index.js CHANGED
@@ -81,7 +81,7 @@ function install(app) {
81
81
  }
82
82
 
83
83
  export default {
84
- version: '1.32.288',
84
+ version: '1.32.289',
85
85
  install,
86
86
  Calendar,
87
87
  Message,