zydx-plus 1.33.347 → 1.33.349

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.33.347",
3
+ "version": "1.33.349",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -11,7 +11,7 @@
11
11
  <slot name="icon"></slot>
12
12
  <i class="disconnect" v-if="disconnectShow" @click.stop="disconnect"></i>
13
13
  <i class="enlarge" v-if="enlargeShow" @click.stop="enlarge"></i>
14
- <i @click.stop="close"></i>
14
+ <i v-if="closeShow" @click.stop="close"></i>
15
15
  </div>
16
16
  </div>
17
17
  <div :class="{'drag-cont': dragStatus || dragTextShow,'drag-conts': !dragStatus || !dragTextShow}"
@@ -86,7 +86,7 @@ export default {
86
86
  },
87
87
  dragTextShow: {
88
88
  type: Boolean,
89
- default: false
89
+ default: true
90
90
  },
91
91
  minimize: {
92
92
  type: Boolean,
@@ -104,6 +104,10 @@ export default {
104
104
  type: Number,
105
105
  default: 200
106
106
  },
107
+ closeShow: {
108
+ type: Boolean,
109
+ default: true
110
+ }
107
111
  },
108
112
  beforeUnmount() {
109
113
  this.clean()
@@ -298,6 +302,8 @@ export default {
298
302
 
299
303
  .down-text-cont {
300
304
  display: inline-block;
305
+ position: relative;
306
+ z-index: 10000;
301
307
  }
302
308
 
303
309
  .down-text-cont img {
@@ -312,8 +318,8 @@ export default {
312
318
  line-height: 30px;
313
319
  font-size: 14px;
314
320
  color: #999;
315
- padding: 0 10px;
316
321
  text-align: center;
322
+ box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
317
323
  }
318
324
 
319
325
  .drag-down {
@@ -45,12 +45,12 @@ export function butJson(editor, data) {
45
45
  name: '摘 要',
46
46
  key: 'abstractMenu',
47
47
  menuKeys: [],
48
- html: `<p class="abstract" data-signId="abstract"><span style="color: rgb(0, 0, 0);font-size: 14px;font-weight: 700;font-family: SimSun;">摘要:</span><span style="color: rgb(0, 0, 0);font-size: 12px;font-family: KaiTi">摘要内容...</span></p>`
48
+ html: `<p class="abstract" data-signId="abstract"><span style="color: rgb(0, 0, 0);font-size: 14px;font-weight: 700;font-family: SimSun;">摘要:</span> <span style="color: rgb(0, 0, 0);font-size: 12px;font-family: KaiTi"> 摘要内容...</span></p>`
49
49
  }, {
50
50
  name: '关键词',
51
51
  key: 'keywordMenu',
52
52
  menuKeys: [],
53
- html: `<p class="keyword" data-signId="keyword"><span style="color: rgb(0, 0, 0);font-size: 14px;font-weight: 700;font-family: SimSun;">关键词:</span><span style="color: rgb(0, 0, 0);font-size: 12px;font-family: KaiTi">关键词内容...</span></p>`
53
+ html: `<p class="keyword" data-signId="keyword"><span contenteditable="false" style="color: rgb(0, 0, 0);font-size: 14px;font-weight: 700;font-family: SimSun;">关键词:</span> <span style="color: rgb(0, 0, 0);font-size: 12px;font-family: KaiTi"> 关键词内容...</span></p>`
54
54
  }, {
55
55
  name: '落 款',
56
56
  key: 'paragraphMenu',
@@ -349,7 +349,8 @@ export default {
349
349
  'shortcut', 'pageMargin', 'paragraph',
350
350
  'outlineMenu', 'alignmentMode', 'titleMenu',
351
351
  'textMenu', 'color', 'interposition'],
352
- bubbleData: {}
352
+ bubbleData: {},
353
+ htmlJson: []
353
354
  }
354
355
  },
355
356
  props: {
@@ -378,10 +379,9 @@ export default {
378
379
  default: () => {
379
380
  return {
380
381
  meta: {
381
- bizId: 'b5063ffdac7047f6ba27d198ffb5b847',
382
382
  },
383
383
  headers: {
384
- Authorization:localStorage.getItem("remember") === "1"? localStorage.getItem('sessionId'): sessionStorage.getItem('sessionId')
384
+ Authorization: localStorage.getItem("remember") === "1" ? localStorage.getItem('sessionId') : sessionStorage.getItem('sessionId')
385
385
  },
386
386
  server: '/zydx/lessonResource/editOfficeFile',
387
387
  }
@@ -393,7 +393,7 @@ export default {
393
393
  return {
394
394
  server: '/zydx/lessonResource/upload/img',
395
395
  headers: {
396
- Authorization: localStorage.getItem("remember") === "1"? localStorage.getItem('sessionId'): sessionStorage.getItem('sessionId')
396
+ Authorization: localStorage.getItem("remember") === "1" ? localStorage.getItem('sessionId') : sessionStorage.getItem('sessionId')
397
397
  },
398
398
  customInsert(res, insertFn) {
399
399
  insertFn('http://192.168.5.213:8888' + res.data)
@@ -407,15 +407,14 @@ export default {
407
407
  uploadAttachment: {
408
408
  type: Object,
409
409
  default: () => {
410
- return {
410
+ return {
411
411
  server: '/zydx/fileanex/uploadfile',
412
412
  fieldName: 'file',
413
413
  maxFileSize: 100 * 1024 * 1024,
414
414
  meta: {
415
- bizId: 'b5063ffdac7047f6ba27d198ffb5b847',
416
415
  },
417
416
  headers: {
418
- Authorization: localStorage.getItem("remember") === "1"? localStorage.getItem('sessionId'): sessionStorage.getItem('sessionId')
417
+ Authorization: localStorage.getItem("remember") === "1" ? localStorage.getItem('sessionId') : sessionStorage.getItem('sessionId')
419
418
  },
420
419
  // 在上传之前
421
420
  onBeforeUpload(file) {
@@ -535,8 +534,10 @@ export default {
535
534
  },
536
535
  mounted() {
537
536
  const _this = this
538
- if (_this.html[_this.html.length - 1]?.type === 'interpositionData') {
539
- this.interpositionData = _this.html[_this.html.length - 1].data
537
+ _this.htmlJson = _this.html ? JSON.parse(JSON.stringify(_this.html)) : []
538
+ if (_this.htmlJson[_this.htmlJson.length - 1]?.type === 'interpositionData') {
539
+ this.interpositionData = _this.htmlJson[_this.htmlJson.length - 1].data
540
+ _this.htmlJson.splice(_this.htmlJson.length - 1, 1)
540
541
  }
541
542
  let dataHtml = json2html({node: "root", child: (_this.html === undefined || _this.html === null) ? [] : _this.html})
542
543
  if (dataHtml[0]?.tag === 'sign') {
@@ -598,8 +599,14 @@ export default {
598
599
  shouldShow: ({editor, view, state, oldState, from, to}) => {
599
600
  let encIndex = state.selection.$from.nodeBefore?.marks
600
601
  if (encIndex && encIndex.length) {
601
- let name = encIndex[encIndex.length - 1].type.name
602
- return name === "superscript" || name === "underline"
602
+ let name = ''
603
+ let nameArr = ["superscript", "underline"]
604
+ encIndex.forEach(item => {
605
+ if (nameArr.indexOf(item.type.name) !== -1) {
606
+ name = item.type.name
607
+ }
608
+ })
609
+ return nameArr.indexOf(name) !== -1
603
610
  } else {
604
611
  return false
605
612
  }
@@ -1292,7 +1299,7 @@ export default {
1292
1299
  const data = document.querySelectorAll('.editing-cont')[0].childNodes[0].childNodes
1293
1300
  this.wit = document.getElementsByClassName('editor-content')[0].offsetWidth + 20
1294
1301
  if (this.wit > 900) this.wit = 900
1295
- let max = this.wit * 1.6 - 246
1302
+ let max = this.wit * 1.6 - 46
1296
1303
  let pHeight = 0
1297
1304
  let html = ''
1298
1305
  for (let i = 0; i < data.length; i++) {
@@ -1380,7 +1387,7 @@ export default {
1380
1387
  let styleKey = 'left'
1381
1388
  let positionNum = `-${bubbleMenu.width / 2}px`
1382
1389
  let menusStyle = {
1383
- 'max-width':`${width-20}px`,
1390
+ 'max-width': `${width - 20}px`,
1384
1391
  position: 'absolute',
1385
1392
  'text-indent': bubbleMenu.width === width ? '2em' : '0em',
1386
1393
  top: this.readOnly ? `${e.clientY - only.top + 10}px` : `${30}px`,
@@ -1401,7 +1408,7 @@ export default {
1401
1408
  if (only.left + (only.width / 2) < e.clientX) {
1402
1409
  styleKey = 'right'
1403
1410
  if ((e.clientX + (bubbleMenu.width / 2)) > (only.left + only.width - marginRight - 10)) {
1404
- let difference = Math.floor((e.clientX + (bubbleMenu.width / 2)) - (only.left + only.width- marginRight - 10))
1411
+ let difference = Math.floor((e.clientX + (bubbleMenu.width / 2)) - (only.left + only.width - marginRight - 10))
1405
1412
  positionNum = `-${(bubbleMenu.width / 2) - difference - 10}px`
1406
1413
  }
1407
1414
  } else {
@@ -1511,6 +1518,10 @@ export default {
1511
1518
  child: []
1512
1519
  })
1513
1520
  }
1521
+ data.push({
1522
+ type:'interpositionData',
1523
+ data:this.interpositionData
1524
+ })
1514
1525
  return data
1515
1526
  },
1516
1527
  // 上传进度
@@ -1551,7 +1562,7 @@ export default {
1551
1562
  this.uploadFile(file, up).then(res => {
1552
1563
  if (res.code === '200') {
1553
1564
  const {from, to} = this.editor.state.selection
1554
- this.tipTitle = this.editor.getText().substring(from - 1, to - 1)
1565
+ this.tipTitle = window.getSelection().toString()
1555
1566
  let typeArr = ['importArticles', 'importWorks', 'interposition', 'videoLink', 'linkCourseware']
1556
1567
  if (typeArr.indexOf(v) !== -1) {
1557
1568
  up.customInsert(res, file, async (name, url) => {
@@ -1580,10 +1591,7 @@ export default {
1580
1591
  url: officeRes.data
1581
1592
  }
1582
1593
  }
1583
- this.editor.chain()
1584
- .setLink({href: `${dataInfo.id}`})
1585
- .setUnderline().insertContentAt(to, ` `)
1586
- .setTextSelection({from: to, to: to + 1})
1594
+ this.editor.chain().setLink({href: `${dataInfo.id}`}).setUnderline().insertContentAt(to, ` `).setTextSelection({from: to, to: to + 1})
1587
1595
  .unsetUnderline().unsetLink().focus('end').run()
1588
1596
  this.interpositionData.push(dataInfo)
1589
1597
  this.documentClick()
@@ -2025,7 +2033,7 @@ export default {
2025
2033
  }
2026
2034
  // 插入
2027
2035
  if (data.key === 'interposition') {
2028
- const menusHtml = butJson(this.editor, this.menusText)[data.key].menuKeys
2036
+ // const menusHtml = butJson(this.editor, this.menusText)[data.key].menuKeys
2029
2037
  // 添加图片
2030
2038
  if (key.key === 'group-image') {
2031
2039
  if (childKey.key === 'insertImage') {
@@ -2037,8 +2045,8 @@ export default {
2037
2045
  }
2038
2046
  // 添加标注
2039
2047
  if (key.key === 'taggingMenu') {
2040
- const {from, to} = this.editor.state.selection
2041
- this.tipTitle = this.editor.getText().substring(from - 1, to - 1)
2048
+ // const {from, to} = this.editor.state.selection
2049
+ this.tipTitle = window.getSelection().toString()// this.editor.getText().substring(from - 1, to - 1)
2042
2050
  if (this.tipTitle.length === 0) {
2043
2051
  await Message({type: 'text', promptContent: '请选中需要注释的文字'})
2044
2052
  return
@@ -2408,10 +2416,7 @@ export default {
2408
2416
  }
2409
2417
  })
2410
2418
  } else {
2411
- this.editor.chain().setLink({href: `${dataInfo.id}`}).setUnderline().insertContentAt(to, ` `).setTextSelection({
2412
- from: to,
2413
- to: to + 1
2414
- }).unsetUnderline().unsetLink().focus('end').run()
2419
+ this.editor.chain().setLink({href: `${dataInfo.id}`}).setUnderline().insertContentAt(to, ` `).setTextSelection({ from: to, to: to + 1 }).unsetUnderline().unsetLink().focus('end').run()
2415
2420
  this.interpositionData.push(dataInfo)
2416
2421
  }
2417
2422
  this.isShowExegesis = false
@@ -2613,7 +2618,6 @@ export default {
2613
2618
  </script>
2614
2619
 
2615
2620
  <style scoped>
2616
- @import "../../tipBox/src/zydxStyle.css";
2617
2621
 
2618
2622
  :deep(.ProseMirror-separator) {
2619
2623
  display: none !important;
@@ -2647,6 +2651,9 @@ export default {
2647
2651
  .read-only {
2648
2652
  position: relative;
2649
2653
  margin: 0 auto;
2654
+ display: flex;
2655
+ flex-direction: column;
2656
+ align-items: center;
2650
2657
  }
2651
2658
 
2652
2659
  .read-only-page {
@@ -2922,12 +2929,14 @@ li {
2922
2929
  min-height: 700px;
2923
2930
  margin: 0 auto;
2924
2931
  position: relative;
2932
+ display: flex;
2933
+ align-items: center;
2925
2934
  }
2926
2935
 
2927
2936
  .editing-cont {
2928
2937
  padding: 8% 0;
2929
2938
  box-sizing: border-box;
2930
- max-width: 770px;
2939
+ width: 100%;
2931
2940
  min-height: 700px;
2932
2941
  margin: 0 15%;
2933
2942
  }
@@ -3048,13 +3057,11 @@ li {
3048
3057
  }
3049
3058
 
3050
3059
  .menu-one {
3051
- //max-width: 557px;
3052
- min-width: 300px;
3060
+ //max-width: 557px; min-width: 300px;
3053
3061
  width: max-content;
3054
3062
  padding: 10px;
3055
3063
  border-radius: 7px;
3056
- //margin:0 100px; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.58); background: #FFFFFF; display: flex; flex-direction: column;
3057
- justify-content: space-between;
3064
+ //margin:0 100px; box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.58); background: #FFFFFF; display: flex; flex-direction: column; justify-content: space-between;
3058
3065
  z-index: 10 !important;
3059
3066
  }
3060
3067
 
@@ -3090,6 +3097,15 @@ li {
3090
3097
  color: #CCCCCC;
3091
3098
  }
3092
3099
 
3100
+ @keyframes linkDown {
3101
+ 0% {
3102
+ opacity: 0;
3103
+ }
3104
+ 100% {
3105
+ opacity: 1;
3106
+ }
3107
+ }
3108
+
3093
3109
  .tip-box {
3094
3110
  width: 744px;
3095
3111
  padding: 20px;
@@ -3111,7 +3127,6 @@ li {
3111
3127
 
3112
3128
  :deep(.text) {
3113
3129
  font-size: 14px;
3114
- padding: 0 10px;
3115
3130
  font-family: FangSong;
3116
3131
  }
3117
3132
 
@@ -3122,4 +3137,52 @@ li {
3122
3137
  .tip-boxContent {
3123
3138
  overflow-y: auto;
3124
3139
  }
3140
+
3141
+ .tip-title {
3142
+ margin-bottom: 20px;
3143
+ font-size: 18px;
3144
+ font-weight: 700;
3145
+ flex-shrink: 0;
3146
+ display: flex;
3147
+ align-items: flex-end;
3148
+ justify-content: center;
3149
+ flex-wrap: wrap;
3150
+ overflow: hidden;
3151
+ }
3152
+
3153
+ .tip-boxContent {
3154
+ max-height: 600px;
3155
+ }
3156
+
3157
+ .tip-btnBox {
3158
+ margin-top: 20px;
3159
+ flex-shrink: 0;
3160
+ display: flex;
3161
+ justify-content: center;
3162
+ align-items: flex-start;
3163
+ font-size: 12px;
3164
+ }
3165
+
3166
+ .tip-btnBox > div {
3167
+ width: 60px;
3168
+ line-height: 20px;
3169
+ margin-right: 10px;
3170
+ border-radius: 3px;
3171
+ border: 1px solid #000000;
3172
+ cursor: pointer;
3173
+ text-align: center;
3174
+ }
3175
+
3176
+ .tip-popupWindowSearch {
3177
+ position: fixed;
3178
+ top: 0;
3179
+ left: 0;
3180
+ right: 0;
3181
+ bottom: 0;
3182
+ background-color: rgba(0, 0, 0, 0.2);
3183
+ z-index: 20000;
3184
+ display: flex;
3185
+ align-items: center;
3186
+ }
3187
+
3125
3188
  </style>
package/src/index.js CHANGED
@@ -83,7 +83,7 @@ function install(app) {
83
83
  }
84
84
 
85
85
  export default {
86
- version: '1.33.347',
86
+ version: '1.33.349',
87
87
  install,
88
88
  Calendar,
89
89
  Message,