zydx-plus 1.35.474 → 1.35.476

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.474",
3
+ "version": "1.35.476",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -161,7 +161,7 @@ export default {
161
161
  },
162
162
  methods: {
163
163
  getShow(item) {
164
- if (this.headerType === 2 && (this.actionId == 'action_notes' || this.actionId == 'action_lesson013' || this.actionId == 'action_lesson055' || this.actionId == 'action_lesson056')) {
164
+ if (this.headerType === 2 && (this.actionId == 'action_notes' || this.actionId == 'action_lesson013' || this.actionId == 'action_lesson055' || this.actionId == 'action_lesson056') || this.actionId === 'resource_lesson_knowledge' || this.actionId === 'resource_lesson_rhyme') {
165
165
  if (!item.children || item.children.length == 0) {
166
166
  return false
167
167
  }
@@ -2983,9 +2983,9 @@ let buttonNames = {
2983
2983
  btnIndex2: this.getPrefix(item) + '图谱'
2984
2984
  },
2985
2985
  lowLevel: {
2986
- default: "viewResource",
2987
- createResource: '创建图谱',
2988
- viewResource: '图谱列表',
2986
+ // default: "viewResource",
2987
+ // createResource: '创建图谱',
2988
+ // viewResource: '图谱列表',
2989
2989
  // selectResource: '查找资源',
2990
2990
  }
2991
2991
  },
@@ -3001,8 +3001,8 @@ let buttonNames = {
3001
3001
  btnIndex2: this.getPrefix(item) + '图谱'
3002
3002
  },
3003
3003
  lowLevel: {
3004
- default: "viewResource",
3005
- viewResource: '图谱列表',
3004
+ // default: "viewResource",
3005
+ // viewResource: '图谱列表',
3006
3006
  // selectResource: '查找资源',
3007
3007
  }
3008
3008
  }
@@ -3263,9 +3263,9 @@ let buttonNames = {
3263
3263
  btnIndex2: this.getPrefix(item) + '歌诀'
3264
3264
  },
3265
3265
  lowLevel: {
3266
- default: "viewResource",
3267
- createResource: '创建歌诀',
3268
- viewResource: '歌诀列表',
3266
+ // default: "viewResource",
3267
+ // createResource: '创建歌诀',
3268
+ // viewResource: '歌诀列表',
3269
3269
  // selectResource: '查找资源',
3270
3270
  }
3271
3271
  },
@@ -3281,8 +3281,8 @@ let buttonNames = {
3281
3281
  btnIndex2: this.getPrefix(item) + '歌诀'
3282
3282
  },
3283
3283
  lowLevel: {
3284
- default: "viewResource",
3285
- viewResource: '歌诀列表',
3284
+ // default: "viewResource",
3285
+ // viewResource: '歌诀列表',
3286
3286
  // selectResource: '查找资源',
3287
3287
  }
3288
3288
  }
@@ -3471,6 +3471,126 @@ let buttonNames = {
3471
3471
  }
3472
3472
  }
3473
3473
  },
3474
+ resource_lesson024: {
3475
+ actionName: '思想宝库',
3476
+ buttonList: {
3477
+ 0: {
3478
+ headLevel: {
3479
+ default: "btnIndex1",
3480
+ btnIndex1: this.getCurrentPrefix(item) + '文章',
3481
+ btnIndex2: this.getPrefix(item) + '文章'
3482
+ },
3483
+ otherLevel: {
3484
+ default: "btnIndex1",
3485
+ btnIndex1: this.getCurrentPrefix(item) + '文章',
3486
+ btnIndex2: this.getPrefix(item) + '文章'
3487
+ },
3488
+ lowLevel: {
3489
+ default: "viewResource",
3490
+ createResource: '创建文章',
3491
+ viewResource: '文章列表',
3492
+ // selectResource: '查找资源',
3493
+ }
3494
+ },
3495
+ 2: {
3496
+ headLevel: {
3497
+ default: "btnIndex1",
3498
+ btnIndex1: this.getCurrentPrefix(item) + '文章',
3499
+ btnIndex2: this.getPrefix(item) + '文章'
3500
+ },
3501
+ otherLevel: {
3502
+ default: "btnIndex1",
3503
+ btnIndex1: this.getCurrentPrefix(item) + '文章',
3504
+ btnIndex2: this.getPrefix(item) + '文章'
3505
+ },
3506
+ lowLevel: {
3507
+ default: "viewResource",
3508
+ viewResource: '文章列表',
3509
+ // selectResource: '查找资源',
3510
+ }
3511
+ }
3512
+ }
3513
+ },
3514
+ resource_lesson025: {
3515
+ actionName: '前沿热点',
3516
+ buttonList: {
3517
+ 0: {
3518
+ headLevel: {
3519
+ default: "btnIndex1",
3520
+ btnIndex1: this.getCurrentPrefix(item) + '文章',
3521
+ btnIndex2: this.getPrefix(item) + '文章'
3522
+ },
3523
+ otherLevel: {
3524
+ default: "btnIndex1",
3525
+ btnIndex1: this.getCurrentPrefix(item) + '文章',
3526
+ btnIndex2: this.getPrefix(item) + '文章'
3527
+ },
3528
+ lowLevel: {
3529
+ default: "viewResource",
3530
+ createResource: '创建文章',
3531
+ viewResource: '文章列表',
3532
+ // selectResource: '查找资源',
3533
+ }
3534
+ },
3535
+ 2: {
3536
+ headLevel: {
3537
+ default: "btnIndex1",
3538
+ btnIndex1: this.getCurrentPrefix(item) + '文章',
3539
+ btnIndex2: this.getPrefix(item) + '文章'
3540
+ },
3541
+ otherLevel: {
3542
+ default: "btnIndex1",
3543
+ btnIndex1: this.getCurrentPrefix(item) + '文章',
3544
+ btnIndex2: this.getPrefix(item) + '文章'
3545
+ },
3546
+ lowLevel: {
3547
+ default: "viewResource",
3548
+ viewResource: '文章列表',
3549
+ // selectResource: '查找资源',
3550
+ }
3551
+ }
3552
+ }
3553
+ },
3554
+ resource_lesson026: {
3555
+ actionName: '社会需求',
3556
+ buttonList: {
3557
+ 0: {
3558
+ headLevel: {
3559
+ default: "btnIndex1",
3560
+ btnIndex1: this.getCurrentPrefix(item) + '文章',
3561
+ btnIndex2: this.getPrefix(item) + '文章'
3562
+ },
3563
+ otherLevel: {
3564
+ default: "btnIndex1",
3565
+ btnIndex1: this.getCurrentPrefix(item) + '文章',
3566
+ btnIndex2: this.getPrefix(item) + '文章'
3567
+ },
3568
+ lowLevel: {
3569
+ default: "viewResource",
3570
+ createResource: '创建文章',
3571
+ viewResource: '文章列表',
3572
+ // selectResource: '查找资源',
3573
+ }
3574
+ },
3575
+ 2: {
3576
+ headLevel: {
3577
+ default: "btnIndex1",
3578
+ btnIndex1: this.getCurrentPrefix(item) + '文章',
3579
+ btnIndex2: this.getPrefix(item) + '文章'
3580
+ },
3581
+ otherLevel: {
3582
+ default: "btnIndex1",
3583
+ btnIndex1: this.getCurrentPrefix(item) + '文章',
3584
+ btnIndex2: this.getPrefix(item) + '文章'
3585
+ },
3586
+ lowLevel: {
3587
+ default: "viewResource",
3588
+ viewResource: '文章列表',
3589
+ // selectResource: '查找资源',
3590
+ }
3591
+ }
3592
+ }
3593
+ },
3474
3594
  }[this.actionId];
3475
3595
  },
3476
3596
  // 获取前缀内容
@@ -199,6 +199,7 @@ export default {
199
199
  this.x = this.left + (wid-this.initWidth)/2
200
200
  }
201
201
  });
202
+ this.dragTap()
202
203
  },
203
204
  computed: {
204
205
  position() {
@@ -215,10 +216,15 @@ export default {
215
216
  let pop = JSON.parse(sessionStorage.getItem('pop'))
216
217
  for(let i = 0; i< pop.length; i++) {
217
218
  if(document.getElementById(pop[i]) === null) continue
218
- document.getElementById(pop[i]).style.zIndex = '9999'
219
+ document.getElementById(pop[i]).classList.remove('zIndex10000')
220
+ // document.getElementById(pop[i]).style.zIndex = '9999'
221
+ document.getElementById(pop[i]).classList.add('zIndex9999')
222
+ // 获取所有具有指定class的元素并删除它们
219
223
  }
220
224
  if(document.getElementById(this.id)){
221
- document.getElementById(this.id).style.zIndex = '10000'
225
+ // document.getElementById(this.id).style.zIndex = '10000'
226
+ document.getElementById(this.id).classList.remove('zIndex9999')
227
+ document.getElementById(this.id).classList.add('zIndex10000')
222
228
  }
223
229
  },
224
230
  clean() {
@@ -520,4 +526,10 @@ export default {
520
526
  height: 100% !important;
521
527
  position: relative;
522
528
  }
529
+ .zIndex9999{
530
+ z-index: 9999;
531
+ }
532
+ .zIndex10000{
533
+ z-index: 10000;
534
+ }
523
535
  </style>
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <div class="read" ref="read">
2
+ <div class="read" :ref="refSrc">
3
3
  <vue-office-docx v-if="fileType === 'docx'" :src="url" style="height: 100%;" @rendered="renderedHandler" @error="errorHandler" />
4
4
  <vue-office-excel v-if="fileType === 'xlsx' && xlsx" :src="url" style="height: 100%;" @rendered="renderedHandler" @error="errorHandler" />
5
5
  <div class="view-pdf" @scroll="scroll" ref="view-pdf" v-if="fileType === 'pdf'">
6
- <div class="pageContainer" v-for="(item,index) in idArr">
6
+ <div class="pageContainer" v-for="(item,index) in idArr[`${refSrc}`]" :key="index">
7
7
  <canvas :id="item"></canvas>
8
8
  <div class="pdfPage">{{ index + 1 }}/{{ pdfPages }}</div>
9
9
  </div>
@@ -36,27 +36,31 @@ import '@vue-office/excel/lib/index.css'
36
36
 
37
37
  import Mess from '../../tipBox/index'
38
38
  import {debounce} from "../../utils";
39
- let pdfs = null
39
+ let pdfs = {}
40
40
  export default {
41
41
  name: "zydx-read",
42
42
  components: {VueOfficeDocx,VueOfficeExcel},
43
43
  data() {
44
44
  return {
45
- fileType: null,
46
- PdfJs: null,
47
- svgArr: [],
48
- container: null,
49
- pdfPages: 0,
50
- loading: false,
51
- repeat: false,
52
- idArr: [],
53
- scales: 1.35,
45
+ fileType: null,
46
+ PdfJs: null,
47
+ svgArr: [],
48
+ container: null,
49
+ pdfPages: 0,
50
+ loading: false,
51
+ repeat: false,
52
+ idArr: {},
53
+ scales: 1.35,
54
54
  timer: null,
55
55
  pdf: null,
56
56
  page: 0,
57
57
  xlsx: true,
58
- canvasArr: [],
59
- pageIndex: 0
58
+ canvasArr: {},
59
+ pageIndex: 0,
60
+ refSrc:'',
61
+ resizeObserver:{},
62
+ loadingTask:{},
63
+ // pdfs:null
60
64
  }
61
65
  },
62
66
  props: {
@@ -75,8 +79,9 @@ export default {
75
79
  },
76
80
  watch: {
77
81
  url: {
78
- handler: function (val, oldVal) {
79
- this.idArr = []
82
+ handler: function () {
83
+ this.refSrc=this.randomId()
84
+ this.idArr[`${this.refSrc}`] = []
80
85
  this.repeatInit()
81
86
  },
82
87
  deep: true,
@@ -96,7 +101,7 @@ export default {
96
101
  }
97
102
  if(this.fileType === 'pdf') {
98
103
  if(val.width >= 800) return
99
- this.canvasArr.map(item => {
104
+ this.canvasArr[`${this.refSrc}`].map(item => {
100
105
  item.style.width = val.width + 'px'
101
106
  item.style.height = val.width*1.35 + 'px'
102
107
  })
@@ -113,7 +118,7 @@ export default {
113
118
  }
114
119
  },
115
120
  methods: {
116
- errorHandler() {
121
+ errorHandler() {
117
122
  Mess({
118
123
  promptContent: '文件加载错误',
119
124
  cancelShow: false
@@ -131,11 +136,11 @@ export default {
131
136
  if (this.fileType === 'pdf') {
132
137
  this.init()
133
138
  setTimeout(()=>{
134
- const el = this.$refs.read;
135
- const resizeObserver = new ResizeObserver(() => {
136
- this.refreshCanvas()
139
+ const el = this.$refs[`${this.refSrc}`];
140
+ this.resizeObserver[`${this.refSrc}`] = new ResizeObserver(() => {
141
+ this.refreshCanvas()
137
142
  });
138
- resizeObserver.observe(el);
143
+ this.resizeObserver[`${this.refSrc}`].observe(el);
139
144
  },300)
140
145
  }
141
146
  setTimeout(() => {
@@ -152,15 +157,14 @@ export default {
152
157
  });
153
158
  },
154
159
  init() {
155
- let that = this
156
- const loadingTask = PdfJs.getDocument({
160
+ let that = this
161
+ this.loadingTask[`${this.refSrc}`] = PdfJs.getDocument({
157
162
  url: this.url,
158
163
  cMapUrl: "/zydx/static/cmaps/",
159
164
  cMapPacked: true
160
165
  })
161
- loadingTask.promise.then((pdf) => {
162
- pdfs = pdf
163
- console.log('pdfs',pdfs)
166
+ this.loadingTask[`${this.refSrc}`].promise.then((pdf) => {
167
+ pdfs[`${that.refSrc}`] = pdf
164
168
  that.pdfPages = pdf.numPages // 获取pdf文件的总页数
165
169
  that.page = pdf.numPages
166
170
  that.pageIndex = that.page > 1? 2:1
@@ -183,22 +187,23 @@ export default {
183
187
  if(this.pageIndex >= this.page) return
184
188
  if((this.page - this.pageIndex) >= 2) {
185
189
  this.pageIndex += 2
186
- this.getPDF(pdfs,2)
190
+ this.getPDF(pdfs[`${this.refSrc}`],2)
187
191
  }else {
188
192
  this.pageIndex += 1
189
- this.getPDF(pdfs,1)
193
+ this.getPDF(pdfs[`${this.refSrc}`],1)
190
194
  }
191
195
  }
192
196
  },
193
197
  getPDF(pdf,page) {
194
- console.log('getPDF=====page',page)
195
198
  let that = this
196
199
  for (let i = 0; i < page; i++) {
197
200
  const id = 'canvas' + Math.random().toString(36).substr(2)
198
- that.idArr.push(id)
201
+ that.idArr[`${that.refSrc}`].push(id)
199
202
  pdf.getPage(this.pageIndex === 1? 1:this.pageIndex + i - 1).then(function (page) {
203
+ // let canvas = document.createElement('canvas')
200
204
  let canvas = document.getElementById(id)
201
- that.canvasArr.push(canvas)
205
+ that.canvasArr[`${that.refSrc}`]=[]
206
+ that.canvasArr[`${that.refSrc}`].push(canvas)
202
207
  let ctx = canvas.getContext('2d');
203
208
  // let viewport = page.getViewport({scale: that.scales})
204
209
  // canvas.width = viewport.width * 2
@@ -228,10 +233,12 @@ export default {
228
233
  },
229
234
  refreshCanvas:debounce(function (){
230
235
  let that = this
231
- that.idArr.forEach((item,index)=>{
232
- pdfs.getPage( index + 1).then(function (page) {
236
+ that.idArr[`${that.refSrc}`].forEach((item,index)=>{
237
+ pdfs[`${this.refSrc}`].getPage( index + 1).then(function (page) {
238
+ // let canvas = document.createElement('canvas')
233
239
  let canvas = document.getElementById(item)
234
- that.canvasArr.push(canvas)
240
+ that.canvasArr[`${that.refSrc}`]=[]
241
+ that.canvasArr[`${that.refSrc}`].push(canvas)
235
242
  let ctx = canvas.getContext('2d');
236
243
  let boxWidth = that.$refs['view-pdf'].offsetWidth
237
244
  let scales=(boxWidth/846)*(boxWidth/(boxWidth-(boxWidth*0.115*2)))
@@ -251,7 +258,11 @@ export default {
251
258
  page.render(renderContext)
252
259
  })
253
260
  })
254
- },50)
261
+ },50),
262
+ randomId() {
263
+ const id = Math.random().toString(36).substr(2)
264
+ return id.replace(/[0-9]/g, '')
265
+ }
255
266
  }
256
267
  }
257
268
  </script>
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="tabs cl" :ref="`tabs${id}`" :style="{'text-align': heiStart? 'left': 'center'}">
3
- <div class="tabs-li" :class="{'tab-active theme-text': actives === index}" @click="listTap(index)"
3
+ <div class="tabs-li" :class="{'tab-active theme-text': actives === index, 'defaultDisableButton': isDisableTab && !isOtherModule(item) && !item.alive}" @click="listTap(index)"
4
4
  v-for="(item,index) in list" :key="index" v-html="item[column[0]]"></div>
5
5
  <!-- <div v-if="addShow" @click="addTap" class="tabs-li tab-add">+</div>-->
6
6
  </div>
@@ -38,6 +38,10 @@ export default {
38
38
  type: Array,
39
39
  default: () => ['name']
40
40
  },
41
+ isDisableTab: { // 是否禁用Tab
42
+ type: Boolean,
43
+ default: false
44
+ }
41
45
  },
42
46
  watch: {
43
47
  active: {
@@ -63,6 +67,10 @@ export default {
63
67
  this.id = this.randomId()
64
68
  },
65
69
  methods: {
70
+ isOtherModule (item) { // 笔记、检测、提问求解、生问生答、讲给他人
71
+ let bol = ['action_notes', 'action_lesson013', 'action_lesson055', 'action_lesson056'].includes(item.actionId)
72
+ return bol
73
+ },
66
74
  randomId() { // 生成随机id
67
75
  const id = Math.random().toString(36).substr(2)
68
76
  return id.replace(/[0-9]/g, '')
@@ -90,6 +98,24 @@ export default {
90
98
  </script>
91
99
 
92
100
  <style scoped>
101
+ .defaultDisableButton {
102
+ width: auto;
103
+ min-width: 60px;
104
+ height: 20px;
105
+ font-size: 12px;
106
+ line-height: 20px;
107
+ color: #717171 !important;
108
+ border: #717171 1px solid !important;
109
+ border-radius: 3px;
110
+ text-align: center;
111
+ cursor: pointer;
112
+ background-color: #fff;
113
+ user-select: none;
114
+ margin: 1px;
115
+ box-sizing: border-box;
116
+ pointer-events: none !important;
117
+ /*禁止点击*/
118
+ }
93
119
  .tab-add {
94
120
  font-size: 18px !important;
95
121
  line-height: 24px !important;
@@ -135,9 +135,12 @@ export default {
135
135
 
136
136
  .num {
137
137
  position: absolute;
138
- bottom: 10px;
139
- right: 10px;
138
+ bottom: 0;
139
+ right: 5px;
140
140
  z-index: 1;
141
+ font-size: 12px;
142
+ transform: scale(0.8);
143
+ color: #666;
141
144
  }
142
145
 
143
146
  .text {
package/src/index.js CHANGED
@@ -87,7 +87,7 @@ function install(app) {
87
87
  }
88
88
 
89
89
  export default {
90
- version: '1.35.474',
90
+ version: '1.35.476',
91
91
  install,
92
92
  Calendar,
93
93
  Message,