zydx-plus 1.32.303 → 1.32.305

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.303",
3
+ "version": "1.32.305",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -2565,7 +2565,7 @@ let buttonNames = {
2565
2565
  default: "btnIndex1",
2566
2566
  btnIndex1: '演示阅读',
2567
2567
  btnIndex2: '互动操作',
2568
- btnIndex3: '深度拓展'
2568
+ btnIndex3: '拓展资源'
2569
2569
  },
2570
2570
  otherLevel: {
2571
2571
  default: "btnIndex1",
@@ -127,9 +127,9 @@
127
127
  </template>
128
128
 
129
129
  <script>
130
- import * as PdfJs from 'pdfjs-dist/legacy/build/pdf.js' // 注意导入的写法d
130
+ import * as PdfJs from 'pdfjs-dist/legacy/build/pdf.js'
131
+ import Mess from '../../tipBox/index'
131
132
  PdfJs.GlobalWorkerOptions.workerSrc = require('pdfjs-dist/build/pdf.worker.entry')
132
- const jsdelivr = '/zydx/static/cmaps/'
133
133
 
134
134
  let pdfs = null
135
135
 
@@ -977,13 +977,19 @@ export default {
977
977
  that.loading = true
978
978
  const loadingTask = PdfJs.getDocument({
979
979
  url: that.source,
980
- cMapUrl: jsdelivr,
980
+ cMapUrl: "/zydx/static/cmaps/",
981
981
  cMapPacked: true
982
982
  })
983
983
  loadingTask.promise.then((pdf) => {
984
984
  pdfs = pdf
985
985
  that.pdfPages = pdf.numPages // 获取pdf文件的总页数
986
986
  that.readPdf(pdf)
987
+ }).catch(() => {
988
+ that.loading = false
989
+ Mess({
990
+ promptContent: '文件加载错误',
991
+ cancelShow: false
992
+ })
987
993
  })
988
994
  },
989
995
  readPdf() {
@@ -121,7 +121,7 @@ export default {
121
121
  }
122
122
  // 如果显示复选。 怎不显示高亮
123
123
  if (!this.menuConfig.isCheckBox) {
124
- if (this.selectItem.catalogId === this.menuInfo.catalogId) {
124
+ if (this.selectItem && (this.selectItem.catalogId === this.menuInfo.catalogId)) {
125
125
  ar.push("active");
126
126
  }
127
127
  }
@@ -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%;" @rendered="renderedHandler" />
4
- <vue-office-excel v-if="fileType === 'xlsx' && xlsx" :src="url" style="height: 100%;" @rendered="renderedHandler" />
3
+ <vue-office-docx v-if="fileType === 'docx'" :src="url" style="height: 100%;" @rendered="renderedHandler" @error="errorHandler" />
4
+ <vue-office-excel v-if="fileType === 'xlsx' && xlsx" :src="url" style="height: 100%;" @rendered="renderedHandler" @error="errorHandler" />
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>
@@ -33,6 +33,9 @@ import VueOfficeExcel from '@vue-office/excel'
33
33
  import '@vue-office/docx/lib/index.css'
34
34
  //引入相关样式
35
35
  import '@vue-office/excel/lib/index.css'
36
+
37
+ import Mess from '../../tipBox/index'
38
+
36
39
  export default {
37
40
  name: "zydx-read",
38
41
  components: {VueOfficeDocx,VueOfficeExcel},
@@ -108,6 +111,13 @@ export default {
108
111
  }
109
112
  },
110
113
  methods: {
114
+ errorHandler() {
115
+ Mess({
116
+ promptContent: '文件加载错误',
117
+ cancelShow: false
118
+ })
119
+ this.loading = false
120
+ },
111
121
  repeatInit() {
112
122
  if (this.repeat) return // 防止重复加载
113
123
  this.repeat = true
@@ -142,6 +152,12 @@ export default {
142
152
  that.pdfPages = pdf.numPages // 获取pdf文件的总页数
143
153
  that.page = pdf.numPages
144
154
  that.getPDF(pdf,that.page)
155
+ }).catch(() => {
156
+ that.loading = false
157
+ Mess({
158
+ promptContent: '文件加载错误',
159
+ cancelShow: false
160
+ })
145
161
  })
146
162
  },
147
163
  getPDF(pdf,page) {
package/src/index.js CHANGED
@@ -81,7 +81,7 @@ function install(app) {
81
81
  }
82
82
 
83
83
  export default {
84
- version: '1.32.303',
84
+ version: '1.32.305',
85
85
  install,
86
86
  Calendar,
87
87
  Message,