zydx-plus 1.19.92 → 1.19.93

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.19.92",
3
+ "version": "1.19.93",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -24,7 +24,7 @@
24
24
  <p v-if="editorShow">附件列表:</p>
25
25
  <div class="enclosure-list" v-for="(item,index) in uploadAttData">
26
26
  <div class="enclosure-item">
27
- <span>{{ index + 1 }}. {{ (item.name)? item.name : item.fileName }}</span>
27
+ <span>{{ index + 1 }}. {{ (item.name)? item.name : item.annexName }}</span>
28
28
  </div>
29
29
  <div class="enclosure-item en-but">
30
30
  <div style="display: inline-block; height: 21px;">
@@ -73,6 +73,7 @@
73
73
  </div>
74
74
  </template>
75
75
  <script>
76
+
76
77
  import { html2json, json2html } from 'html2json'
77
78
  import { Editor, EditorContent } from '@tiptap/vue-3'
78
79
  import StarterKit from '@tiptap/starter-kit'
@@ -191,8 +192,16 @@ export default {
191
192
  del(index) {
192
193
  if(this.uploadAttData[index].name === undefined) {
193
194
  this.uploadAttData[index].active = false
194
- this.$emit('del', this.uploadAttData[index], () => {
195
- this.uploadAttData.splice(index, 1)
195
+ this.$emit('del', this.uploadAttData[index], (e) => {
196
+ if(e === undefined) {
197
+ this.uploadAttData.splice(index, 1)
198
+ }else {
199
+ if(e) {
200
+ this.uploadAttData.splice(index, 1)
201
+ }else {
202
+ this.uploadAttData[index].active = true
203
+ }
204
+ }
196
205
  })
197
206
  }else {
198
207
  this.uploadAttData.splice(index, 1)
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="read">
3
- <vue-office-docx v-if="fileType === 'docx'" :src="url" style="height: 100%;" />
4
- <vue-office-excel v-if="fileType === 'xlsx' || fileType === 'xls'" :src="url" style="height: 100%;" />
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" />
5
5
  <div class="view-pdf" v-if="fileType === 'pdf'" id="canvas-wrap"></div>
6
6
  <div class="mp4" v-if="fileType === 'mp4'">
7
7
  <video :src="url" controls></video>
@@ -9,6 +9,11 @@
9
9
  <div class="mp3" v-if="fileType === 'mp3'">
10
10
  <audio :src="url" controls></audio>
11
11
  </div>
12
+ <div v-if="loading" class="loading-back">
13
+ <div class="loading-cont">
14
+ <div class="loading">Loading</div>
15
+ </div>
16
+ </div>
12
17
  </div>
13
18
  </template>
14
19
 
@@ -32,7 +37,9 @@ export default {
32
37
  PdfJs: null,
33
38
  svgArr: [],
34
39
  container: null,
35
- pdfPages: 0
40
+ pdfPages: 0,
41
+ loading: true,
42
+ repeat: false,
36
43
  }
37
44
  },
38
45
  props: {
@@ -44,17 +51,28 @@ export default {
44
51
  watch: {
45
52
  url: {
46
53
  handler: function (val, oldVal) {
47
- this.fileType = val.split('.').pop()
48
- if(this.fileType === 'pdf') this.init()
54
+ this.repeatInit()
49
55
  },
50
56
  immediate: true
51
57
  }
52
58
  },
53
59
  mounted() {
54
- this.fileType = this.url.split('.').pop()
55
- if(this.fileType === 'pdf') this.init()
60
+ this.repeatInit()
56
61
  },
57
62
  methods: {
63
+ repeatInit() {
64
+ if(this.repeat) return // 防止重复加载
65
+ this.repeat = true
66
+ this.loading = true
67
+ this.fileType = this.url.split('.').pop()
68
+ if(this.fileType === 'pdf') this.init()
69
+ setTimeout(() => {
70
+ this.repeat = false
71
+ },1000)
72
+ },
73
+ renderedHandler() {
74
+ this.loading = false
75
+ },
58
76
  init() {
59
77
  let that = this
60
78
  const loadingTask = PdfJs.getDocument(this.url)
@@ -106,6 +124,7 @@ export default {
106
124
  document.getElementById('canvas-wrap').appendChild(container)
107
125
  container.appendChild(x.data)
108
126
  })
127
+ this.renderedHandler()
109
128
  },
110
129
  }
111
130
  }
@@ -130,6 +149,7 @@ export default {
130
149
  .read{
131
150
  width: 100%;
132
151
  height: 100%;
152
+ position: relative;
133
153
  }
134
154
  :deep(.vue-office-docx)::-webkit-scrollbar {
135
155
  width: 0
@@ -137,4 +157,50 @@ export default {
137
157
  :deep(.docx-wrapper) {
138
158
  background-color: #fff;
139
159
  }
160
+ .loading-back{
161
+ position: absolute;
162
+ top: 0;
163
+ left: 0;
164
+ right: 0;
165
+ bottom: 0;
166
+ z-index: 100;
167
+ display: flex;
168
+ align-items: center;
169
+ }
170
+ .loading-cont{
171
+ display: inline-block;
172
+ margin: 0 auto;
173
+ }
174
+ .loading {
175
+ display: inline-block;
176
+ font-size: 28px;
177
+ font-family: Arial, Helvetica, sans-serif;
178
+ font-weight: bold;
179
+ color: #fff;
180
+ text-shadow: 0 0 2px #ff3d00, 0 0 1px #ff3d00, 0 0 1px #ff3d00;
181
+ letter-spacing: 2px;
182
+ position: relative;
183
+ }
184
+
185
+ .loading::after {
186
+ content: "Loading";
187
+ position: absolute;
188
+ left: 0;
189
+ top: 0;
190
+ color: #ff3d00;
191
+ width: 0%;
192
+ height: 100%;
193
+ overflow: hidden;
194
+ animation: loading-animation 6s linear infinite;
195
+ }
196
+
197
+ @keyframes loading-animation {
198
+ 0% {
199
+ width: 0%;
200
+ }
201
+
202
+ 100% {
203
+ width: 100%;
204
+ }
205
+ }
140
206
  </style>
package/src/index.js CHANGED
@@ -57,7 +57,7 @@ function install(app) {
57
57
  }
58
58
 
59
59
  export default {
60
- version: '1.19.92',
60
+ version: '1.19.93',
61
61
  install,
62
62
  Calendar,
63
63
  Message,