zydx-plus 1.35.487 → 1.35.489

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.487",
3
+ "version": "1.35.489",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -2946,7 +2946,7 @@ let buttonNames = {
2946
2946
  default: "demand",
2947
2947
  demand: '学习要求',
2948
2948
  actionAnalysis: '学习评析',
2949
- // qualityAnalysis: '素养评析'
2949
+ qualityAnalysis: '素养评析' // 2025.4.9 加回来bug6776
2950
2950
  }
2951
2951
  }
2952
2952
  }
@@ -43,7 +43,7 @@ export function butJson(editor, data) {
43
43
  <p data-signid="subject" style="text-align: center;margin: 80px 0 60px"><strong><span style="font-size: 24px; font-family: SimHei; color:#333333;line-height: 1;">请在此处输入标题</span></strong></p>
44
44
  <p data-signid="lookUp"><strong><span style="font-size: 16px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入抬头:</span></strong></p>
45
45
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
46
- <p data-signid="title-1" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color:#333333">一、请在此处输入一级标题</span></strong></p>
46
+ <p data-signid="title-1" style="text-align: center" class="title ${randomId()}"><strong><span style="font-size: 16px; font-family: SimHei; color:#333333">一、请在此处输入一级标题</span></strong></p>
47
47
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
48
48
  <p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color:#333333">(一)请在此处输入二级标题</span></strong></p>
49
49
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
@@ -57,7 +57,7 @@ export function butJson(editor, data) {
57
57
  html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">请在此处输入标题</span></strong></p>
58
58
  <p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者/来源</span></p>
59
59
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
60
- <p data-signid="title-1" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">一、请在此处输入一级标题</span></strong></p>
60
+ <p data-signid="title-1" style="text-align: center" class="title ${randomId()} "><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">一、请在此处输入一级标题</span></strong></p>
61
61
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
62
62
  <p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">(一)请在此处输入二级标题</span></strong></p>
63
63
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
@@ -73,7 +73,7 @@ export function butJson(editor, data) {
73
73
  <p data-signid="abstract" class="abstract"><strong><span style="font-size: 14px; font-family: SimSun; color: #333333;">摘要:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)">请在此处输入摘要文本...</span></p>
74
74
  <p data-signid="keyword" class="keyword"><strong><span contenteditable="false" style="font-size: 14px; font-family: SimSun; color: #333333">关键词:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)"> 请在此处输入关键字...</span></p>
75
75
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
76
- <p data-signid="title-1" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">一、请在此处输入一级标题</span></strong></p>
76
+ <p data-signid="title-1" style="text-align: center" class="title ${randomId()}"><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">一、请在此处输入一级标题</span></strong></p>
77
77
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
78
78
  <p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimH ei; color: #333333">(一)请在此处输入二级标题</span></strong></p>
79
79
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本(复用格式建议直接复制粘贴段落)</span></p>
@@ -190,7 +190,7 @@ export function butJson(editor, data) {
190
190
  {name: '一级标题', key: 'title-1'},
191
191
  {name: '二级标题', key: 'title-2'},
192
192
  {name: '三级标题', key: 'title-3'},
193
- {name: '四级标题', key: 'title-4'},
193
+ // {name: '四级标题', key: 'title-4'},
194
194
  {name: '正文文本', key: 'text'},
195
195
  ],
196
196
  html: {}
@@ -210,13 +210,13 @@ export function butJson(editor, data) {
210
210
  name: '一级标题',
211
211
  key: 'firstLevelHeading',
212
212
  menuKeys: [],
213
- html: `<p data-signid="title-1" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color:#333333">一、请在此处输入一级标题</span></strong></p>`
213
+ html: `<p data-signid="title-1" style="text-align: center" class="title ${randomId()}"><strong><span style="font-size: 16px; font-family: SimHei; color:#333333">一、请在此处输入一级标题</span></strong></p>`
214
214
  },
215
215
  secondaryHeading: {
216
216
  name: '二级标题',
217
217
  key: 'secondaryHeading',
218
218
  menuKeys: [],
219
- html: `<p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color:#333333">(一)请在此处输入二级标题</span></strong></p>`
219
+ html: `<p data-signid="title-2" class="title ${randomId()} indent"><span style="font-size: 16px; font-family: SimHei; color:#333333">(一)请在此处输入二级标题</span></p>`
220
220
  },
221
221
  paragraphBody: {
222
222
  name: '正文文本',
@@ -266,7 +266,7 @@ export function butJson(editor, data) {
266
266
  {name: '黑体', key: 'SimHei'},
267
267
  ],
268
268
  html: {
269
- blackCenter4: `<p data-signId="title-1" class="title ${randomId()}" style="text-align: center;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 16px;font-family: SimHei">${menusData(data, 'titleMenu').text}</span></p>`,
269
+ blackCenter4: `<p data-signId="title-1" style="text-align: center" class="title ${randomId()}" style="text-align: center;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 16px;font-family: SimHei">${menusData(data, 'titleMenu').text}</span></p>`,
270
270
  blackLeft4: `<p data-signId="title-2" class="title ${randomId()}" style="text-align: left;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 16px;font-family: SimHei">${menusData(data, 'titleMenu').text}</span></p>`,
271
271
  blackCenter5: `<p data-signId="title-3" class="title ${randomId()}" style="text-align: center;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 16px;font-family: SimHei">${menusData(data, 'titleMenu').text}</span></p>`,
272
272
  blackLeft5: `<p data-signId="title-4" class="title ${randomId()}" style="text-align: left;"><span style="font-weight: 700;color: rgb(0, 0, 0);font-size: 16px;font-family: SimHei">${menusData(data, 'titleMenu').text}</span></p>`,
@@ -640,7 +640,7 @@ export default {
640
640
  zydxDragPopup,
641
641
  zydxSelect,
642
642
  zydxChat,
643
- delSvg, editSvg, viewSvg,Paint
643
+ delSvg, editSvg, viewSvg, Paint
644
644
  },
645
645
  beforeUnmount() {
646
646
  this.editor.destroy()
@@ -759,7 +759,7 @@ export default {
759
759
  audioData: [],
760
760
  time: {},
761
761
  hex: '',
762
- toolbar: [
762
+ toolbar: [
763
763
  'switchingFormat', 'signMenu', 'pageMargin', 'paragraph',
764
764
  'outlineMenu', 'alignmentMode', 'titleMenu',
765
765
  'textMenu', 'color', 'interposition'],
@@ -816,7 +816,7 @@ export default {
816
816
  name: '公文版式',
817
817
  key: 'officialDocumentFormat',
818
818
  menuKeys: [],
819
- html: `<p style="text-align: center"><span style="font-size: 48px; color: rgb(225, 60, 57)">请在此输入红头名称</span></p>
819
+ html: `<p style="text-align: center"><span style="font-size: 48px; color: rgb(225, 60, 57)">请在此输入红头名称</span></p>
820
820
  <p data-signid="red" style="text-align: center"><span style="font-size: 16px; color: rgb(0, 0, 0)">请在此输入文件号xxx[xxx]xxxx号</span></p>
821
821
  <p contenteditable="false" class="solid"></p>
822
822
  <p data-signid="subject" style="text-align: center;margin: 80px 0 60px"><strong><span style="font-size: 24px; font-family: SimHei; color: rgb(0, 0, 0);line-height: 1;">请在此处输入标题</span></strong></p>
@@ -833,7 +833,7 @@ export default {
833
833
  name: '新闻版式',
834
834
  key: 'newsFormat',
835
835
  menuKeys: [],
836
- html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: rgb(0, 0, 0);">请在此处输入标题</span></strong></p>
836
+ html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: rgb(0, 0, 0);">请在此处输入标题</span></strong></p>
837
837
  <p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者/来源</span></p>
838
838
  <p class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
839
839
  <p data-signid="title-1" class="title indent"><strong><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">一、请在此处输入一级标题</span></strong></p>
@@ -847,7 +847,7 @@ export default {
847
847
  name: '论文版式',
848
848
  key: 'paperFormat',
849
849
  menuKeys: [],
850
- html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: rgb(0, 0, 0);">请在此处输入题目</span></strong></p>
850
+ html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: rgb(0, 0, 0);">请在此处输入题目</span></strong></p>
851
851
  <p data-signid="author" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0);">请在此处输入作者</span></p>
852
852
  <p data-signid="abstract" class="abstract"><strong><span style="font-size: 14px; font-family: SimSun; color: rgb(0, 0, 0)">摘要:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)">请在此处输入摘要文本...</span></p>
853
853
  <p data-signid="keyword" class="keyword"><strong><span contenteditable="false" style="font-size: 14px; font-family: SimSun; color: rgb(0, 0, 0)">关键词:</span></strong> <span style="font-size: 14px; font-family: FangSong; color: rgb(0, 0, 0)"> 请在此处输入关键字...</span></p>
@@ -926,7 +926,7 @@ export default {
926
926
  customInsert(res, insertFn) {
927
927
  setTimeout(() => {
928
928
  insertFn('http://192.168.5.213:8888' + res.data)
929
- },100)
929
+ }, 100)
930
930
  },
931
931
  onSuccess(file, res) {
932
932
  console.log('图片上传成功', file, res)
@@ -1014,7 +1014,7 @@ export default {
1014
1014
  html: {
1015
1015
  handler: function (e, oldVal) {
1016
1016
  this.init = false
1017
- if (e&&e.sign?.tag === 'sign') {
1017
+ if (e && e.sign?.tag === 'sign') {
1018
1018
  this.signMenuShow = true
1019
1019
  // e.shift()
1020
1020
  }
@@ -1033,6 +1033,8 @@ export default {
1033
1033
  }
1034
1034
  setTimeout(() => {
1035
1035
  this.init = true
1036
+ this.templateType = this.htmlJson.templateType
1037
+ this.changeTemplateType()
1036
1038
  }, 500)
1037
1039
  },
1038
1040
  deep: true
@@ -1047,7 +1049,7 @@ export default {
1047
1049
  if (this.page) {
1048
1050
  this.editableShow = !e
1049
1051
  setTimeout(() => {
1050
- if(e){
1052
+ if (e) {
1051
1053
  this.readOnlyPage() // 只读分页
1052
1054
  }
1053
1055
  }, 300)
@@ -1138,7 +1140,7 @@ export default {
1138
1140
  BubbleMenu.configure({ // 气泡菜单
1139
1141
  pluginKey: 'bubbleMenu',
1140
1142
  element: document.querySelector('.menu'),
1141
- tippyOptions:{
1143
+ tippyOptions: {
1142
1144
  placement: 'right',
1143
1145
  },
1144
1146
  shouldShow: ({editor, view, state, oldState, from, to}) => {
@@ -1154,7 +1156,7 @@ export default {
1154
1156
  BubbleMenu.configure({
1155
1157
  pluginKey: 'bubbleMenuOne',
1156
1158
  element: document.querySelector('.menu-one'),
1157
- tippyOptions:{
1159
+ tippyOptions: {
1158
1160
  placement: 'right',
1159
1161
  },
1160
1162
  shouldShow: ({editor, view, state, oldState, from, to}) => {
@@ -1238,6 +1240,7 @@ export default {
1238
1240
  this.limits = true
1239
1241
  },
1240
1242
  onUpdate: ({editor}) => {
1243
+ editor.commands.focus()
1241
1244
  const json = editor.getJSON()
1242
1245
  for (let i = 0; i < json.content.length; i++) {
1243
1246
  const item = json.content[i]
@@ -1264,24 +1267,24 @@ export default {
1264
1267
  }
1265
1268
  }
1266
1269
  } else {
1267
- if(/r-/.test(item.attrs.signId) || /a-/.test(item.attrs.signId)){
1268
- json.content.splice(i,1)
1270
+ if (/r-/.test(item.attrs.signId) || /a-/.test(item.attrs.signId)) {
1271
+ json.content.splice(i, 1)
1269
1272
  editor.chain().setContent(json).run()
1270
1273
  }
1271
1274
  }
1272
- let r = json.content.filter(item=>item.attrs.signId&&/r-/.test(item.attrs.signId)).length
1273
- let a = json.content.filter(item=>item.attrs.signId&&/a-/.test(item.attrs.signId)).length
1274
- for (let i = 0; i < json.content.length; i++){
1275
+ let r = json.content.filter(item => item.attrs.signId && /r-/.test(item.attrs.signId)).length
1276
+ let a = json.content.filter(item => item.attrs.signId && /a-/.test(item.attrs.signId)).length
1277
+ for (let i = 0; i < json.content.length; i++) {
1275
1278
  const item = json.content[i]
1276
- if (r===0){
1277
- if(item.attrs.signId==='reference' || item.attrs.signId==='reference-1' || item.attrs.signId==='annotationSplitLine'){
1278
- json.content.splice(i,1)
1279
+ if (r === 0) {
1280
+ if (item.attrs.signId === 'reference' || item.attrs.signId === 'reference-1' || item.attrs.signId === 'annotationSplitLine') {
1281
+ json.content.splice(i, 1)
1279
1282
  editor.chain().setContent(json).run()
1280
1283
  }
1281
1284
  }
1282
- if (a===0){
1283
- if(item.attrs.signId==='annotation' || item.attrs.signId==='annotation-1' || item.attrs.signId==='referenceSplitLine'){
1284
- json.content.splice(i,1)
1285
+ if (a === 0) {
1286
+ if (item.attrs.signId === 'annotation' || item.attrs.signId === 'annotation-1' || item.attrs.signId === 'referenceSplitLine') {
1287
+ json.content.splice(i, 1)
1285
1288
  editor.chain().setContent(json).run()
1286
1289
  }
1287
1290
  }
@@ -1357,12 +1360,14 @@ export default {
1357
1360
  this.x = event.clientX - this.left;
1358
1361
  this.y = event.clientY - this.top;
1359
1362
  })
1363
+ this.templateType = this.htmlJson.templateType
1364
+ this.changeTemplateType()
1360
1365
  // document.addEventListener('click', () => {
1361
1366
  // // if(this.limits) return
1362
1367
  // // this.close()
1363
1368
  // })
1364
1369
  },
1365
- emits: ['confirm', 'enclosure', 'enlDownload', 'enlSee', 'changeOutlineMenu'],
1370
+ emits: ['confirm', 'enclosure', 'enlDownload', 'enlSee', 'changeOutlineMenu', 'getConfirm'],
1366
1371
  methods: {
1367
1372
  showAi() {
1368
1373
  this.isShowAi = !this.isShowAi
@@ -1404,51 +1409,51 @@ export default {
1404
1409
  },
1405
1410
  //修改模板类型
1406
1411
  async changeTemplateType() {
1407
- const oldFormatWriteNewFormat = (oldJson)=>{
1412
+ const oldFormatWriteNewFormat = (oldJson) => {
1408
1413
  let newJson = this.editor.getJSON()
1409
- if(oldJson.content.length===1&&!oldJson.content[0].content){
1414
+ if (oldJson.content.length === 1 && !oldJson.content[0].content) {
1410
1415
  return
1411
1416
  }
1412
1417
  let oldContent = []
1413
- let signIdArrObj={
1414
- officialDocumentFormat: ['text','paragraph','date','subject'],
1415
- newsFormat: ['text','paragraph','date','subject','author'],
1416
- paperFormat: ['text','paragraph','date','subject','author']
1418
+ let signIdArrObj = {
1419
+ officialDocumentFormat: ['text', 'paragraph', 'date', 'subject'],
1420
+ newsFormat: ['text', 'paragraph', 'date', 'subject', 'author'],
1421
+ paperFormat: ['text', 'paragraph', 'date', 'subject', 'author']
1417
1422
  }
1418
- let signIdArr=signIdArrObj[this.templateType]
1423
+ let signIdArr = signIdArrObj[this.templateType]
1419
1424
  let newSignIdIndex = -1
1420
1425
  let remainIndex = 0
1421
- for (let i = 0; i <oldJson.content.length ; i++) {
1426
+ for (let i = 0; i < oldJson.content.length; i++) {
1422
1427
  let item = oldJson.content[i]
1423
- if(signIdArr.indexOf(item.attrs.signId)!==-1||(!!item.attrs.signId&&item.attrs.signId.indexOf('title')!==-1)){
1428
+ if (signIdArr.indexOf(item.attrs.signId) !== -1 || (!!item.attrs.signId && item.attrs.signId.indexOf('title') !== -1)) {
1424
1429
  item.reserve = true
1425
1430
  for (let j = 0; j < newJson.content.length; j++) {
1426
1431
  let newItem = newJson.content[j]
1427
- if(newItem.attrs.signId&&item.attrs.signId&&item.attrs.signId===newItem.attrs.signId&&newSignIdIndex<j){
1428
- newJson.content[j]=JSON.parse(JSON.stringify(item))
1432
+ if (newItem.attrs.signId && item.attrs.signId && item.attrs.signId === newItem.attrs.signId && newSignIdIndex < j) {
1433
+ newJson.content[j] = JSON.parse(JSON.stringify(item))
1429
1434
  delete newJson.content[j].reserve
1430
1435
  item.reserve = false
1431
- if(newJson.content[j].attrs.signId==='subject'&&this.templateType === 'officialDocumentFormat'){
1432
- newJson.content[j].attrs.margin= '80px 0 60px'
1433
- }else {
1434
- newJson.content[j].attrs.margin= null
1436
+ if (newJson.content[j].attrs.signId === 'subject' && this.templateType === 'officialDocumentFormat') {
1437
+ newJson.content[j].attrs.margin = '80px 0 60px'
1438
+ } else {
1439
+ newJson.content[j].attrs.margin = null
1435
1440
  }
1436
- newSignIdIndex=j
1441
+ newSignIdIndex = j
1437
1442
  break
1438
- }else {
1439
- let arr = ['paragraph','date']
1440
- if(newSignIdIndex>=0&&arr.indexOf(newJson.content[newSignIdIndex].attrs.signId)===-1){
1443
+ } else {
1444
+ let arr = ['paragraph', 'date']
1445
+ if (newSignIdIndex >= 0 && arr.indexOf(newJson.content[newSignIdIndex].attrs.signId) === -1) {
1441
1446
  // 内容有意义但无法替换如新样板,位置起点留存
1442
- remainIndex=newSignIdIndex
1447
+ remainIndex = newSignIdIndex
1443
1448
  }
1444
1449
  }
1445
1450
  }
1446
1451
  }
1447
1452
  }
1448
- oldContent = oldJson.content.filter(item=>item.reserve)
1449
- oldContent.forEach((item,index)=>{
1453
+ oldContent = oldJson.content.filter(item => item.reserve)
1454
+ oldContent.forEach((item, index) => {
1450
1455
  delete item.reserve
1451
- newJson.content.splice(remainIndex+index+1,0,item)
1456
+ newJson.content.splice(remainIndex + index + 1, 0, item)
1452
1457
  })
1453
1458
  this.editor.chain().setContent(newJson).run()
1454
1459
  }
@@ -1464,27 +1469,27 @@ export default {
1464
1469
  'textMenu', 'color', 'interposition']
1465
1470
  this.organizeButton()
1466
1471
  this.interpositionData = []
1467
- if(oldJson.content.length===1&&!oldJson.content[0].content){
1472
+ if (oldJson.content.length === 1 && !oldJson.content[0].content) {
1468
1473
  return
1469
1474
  }
1470
1475
  let oldContent = []
1471
- let signIdArr=['text','paragraph','date','subject','author']
1472
- oldJson.content.forEach((item)=>{
1473
- if(signIdArr.indexOf(item.attrs.signId)!==-1||(!!item.attrs.signId&&item.attrs.signId.indexOf('title')!==-1)){
1474
- if(item.attrs.signId==='subject'){
1475
- item.attrs.margin= null
1476
+ let signIdArr = ['text', 'paragraph', 'date', 'subject', 'author']
1477
+ oldJson.content.forEach((item) => {
1478
+ if (signIdArr.indexOf(item.attrs.signId) !== -1 || (!!item.attrs.signId && item.attrs.signId.indexOf('title') !== -1)) {
1479
+ if (item.attrs.signId === 'subject') {
1480
+ item.attrs.margin = null
1476
1481
  }
1477
1482
  oldContent.push(item)
1478
1483
  }
1479
1484
  })
1480
- this.editor.chain().setContent({type:'doc',content:oldContent}).run()
1485
+ this.editor.chain().setContent({type: 'doc', content: oldContent}).run()
1481
1486
  }
1482
1487
  // 公文版式
1483
1488
  if (this.templateType === 'officialDocumentFormat') {
1484
1489
  const html = htmlFormat.filter(item => item.key === this.templateType)[0].html
1485
1490
  this.editor.chain().setContent(html).run()
1486
1491
  this.toolbar = [
1487
- 'switchingFormat', 'signMenu', 'pageMargin','redMenu', 'firstLevelHeading',
1492
+ 'switchingFormat', 'signMenu', 'pageMargin', 'redMenu', 'firstLevelHeading',
1488
1493
  'secondaryHeading', 'paragraphBody', 'paragraphMenu', 'alignmentMode',
1489
1494
  'titleMenu', 'color', 'interposition']
1490
1495
  this.organizeButton()
@@ -2166,7 +2171,7 @@ export default {
2166
2171
  let mtop = parseInt(getComputedStyle(data[i]).marginTop)
2167
2172
  let Bottom = parseInt(getComputedStyle(data[i]).paddingBottom)
2168
2173
  let mBottom = parseInt(getComputedStyle(data[i]).marginBottom)
2169
- let text = data[i].offsetHeight+Bottom+top+mtop+mBottom
2174
+ let text = data[i].offsetHeight + Bottom + top + mtop + mBottom
2170
2175
  if ((pHeight + text) > max) {
2171
2176
  const {start, end, size} = this.rows(data[i], max - pHeight)
2172
2177
  let child = data[i].childNodes[0]
@@ -2410,8 +2415,9 @@ export default {
2410
2415
  let editorJson = this.editor.getJSON()
2411
2416
  let sign = {node: 'element', tag: 'sign', child: []}
2412
2417
  let popupsData = {type: 'interpositionData', data: [...this.interpositionData]}
2418
+ let templateType = this.templateType
2413
2419
  let data = {
2414
- directoryJson, editorHtml, editorJson, popupsData
2420
+ directoryJson, editorHtml, editorJson, popupsData, templateType
2415
2421
  }
2416
2422
  if (this.signMenuShow) {
2417
2423
  data.sign = sign
@@ -2434,8 +2440,9 @@ export default {
2434
2440
  let editorJson = this.editor.getJSON()
2435
2441
  let sign = {node: 'element', tag: 'sign', child: []}
2436
2442
  let popupsData = {type: 'interpositionData', data: [...this.interpositionData]}
2443
+ let templateType = this.templateType
2437
2444
  let data = {
2438
- directoryJson, editorHtml, editorJson, popupsData
2445
+ directoryJson, editorHtml, editorJson, popupsData, templateType
2439
2446
  }
2440
2447
  if (this.signMenuShow) {
2441
2448
  data.sign = sign
@@ -2455,6 +2462,21 @@ export default {
2455
2462
  // })
2456
2463
  return data
2457
2464
  },
2465
+ changeOutlineMenu() {
2466
+ let directoryJson = html2json(this.editor.getHTML()).child
2467
+ let editorHtml = this.editor.getHTML()
2468
+ let editorJson = this.editor.getJSON()
2469
+ let sign = {node: 'element', tag: 'sign', child: []}
2470
+ let popupsData = {type: 'interpositionData', data: [...this.interpositionData]}
2471
+ let templateType = this.templateType
2472
+ let data = {
2473
+ directoryJson, editorHtml, editorJson, popupsData, templateType
2474
+ }
2475
+ if (this.signMenuShow) {
2476
+ data.sign = sign
2477
+ }
2478
+ return data
2479
+ },
2458
2480
  // 上传进度
2459
2481
  progressFunction(e) {
2460
2482
  if (e.lengthComputable) {
@@ -3072,7 +3094,6 @@ export default {
3072
3094
  // }
3073
3095
  }*/
3074
3096
  }
3075
-
3076
3097
  // 标志
3077
3098
  if (data.key === 'signMenu') this.signMenuShow = !this.signMenuShow
3078
3099
  // 红头文件
@@ -3089,13 +3110,13 @@ export default {
3089
3110
  if (data.key === 'firstLevelHeading') {
3090
3111
  const html = butJson(this.editor, this.menusText)[data.key].html
3091
3112
  this.editor.chain().focus().insertContentAt(this.selection(), html).run()
3092
- this.$emit('changeOutlineMenu')
3113
+ this.$emit('changeOutlineMenu', this.changeOutlineMenu())
3093
3114
  }
3094
3115
  // 二级标题
3095
3116
  if (data.key === 'secondaryHeading') {
3096
3117
  const html = butJson(this.editor, this.menusText)[data.key].html
3097
3118
  this.editor.chain().focus().insertContentAt(this.selection(), html).run()
3098
- this.$emit('changeOutlineMenu')
3119
+ this.$emit('changeOutlineMenu', this.changeOutlineMenu())
3099
3120
  }
3100
3121
  // 正文
3101
3122
  if (data.key === 'paragraphBody') {
@@ -3198,16 +3219,31 @@ export default {
3198
3219
  // 大纲级别
3199
3220
  if (data.key === 'outlineMenu') {
3200
3221
  if (key.key === 'text') {
3222
+ this.editor.commands.setNode('paragraph', {class: 'indent'})
3201
3223
  this.editor.commands.setTitleId(key.key)
3202
3224
  this.editor.commands.unsetSignId()
3203
- this.editor.chain().focus().unsetBold().setFontSize('14px').setColor('#000000').setTextAlign('left').run()
3225
+ this.editor.chain().unsetBold().setFontSize('14px').setColor('#000000').setTextAlign('left').focus().run()
3204
3226
  } else {
3205
3227
  const t = key.key.split('-')[0]
3206
- this.editor.commands.setSignId(key.key)
3207
- this.editor.commands.setTitleId(`${t} ${this.randomId()}`)
3208
- this.editor.chain().focus().setBold().setFontSize('16px').setColor('#333333').setTextAlign('left').run()
3228
+ const level = key.key.split('-')[1]
3229
+ let size = '16px'
3230
+ if (level === '1') {
3231
+ this.editor.commands.setNode('paragraph', {class: ''})
3232
+ this.editor.commands.setTitleId(`${t} ${this.randomId()}`)
3233
+ this.editor.commands.setSignId(key.key)
3234
+ this.editor.chain().setBold().setFontSize(size).setColor('#333333').setTextAlign('center').focus().run()
3235
+ } else if (level === '2') {
3236
+ this.editor.commands.setSignId(key.key)
3237
+ this.editor.commands.setTitleId(`${t} ${this.randomId()} indent`)
3238
+ this.editor.chain().unsetBold().setFontSize(size).setColor('#333333').setTextAlign('left').focus().run()
3239
+ } else {
3240
+ size = '14px'
3241
+ this.editor.commands.setSignId(key.key)
3242
+ this.editor.commands.setTitleId(`${t} ${this.randomId()} indent`)
3243
+ this.editor.chain().setBold().setFontSize(size).setColor('#333333').setTextAlign('left').focus().run()
3244
+ }
3209
3245
  }
3210
- this.$emit('changeOutlineMenu')
3246
+ this.$emit('changeOutlineMenu', this.changeOutlineMenu())
3211
3247
  }
3212
3248
  // 对齐方式
3213
3249
  if (data.key === 'alignmentMode') {
@@ -4041,9 +4077,12 @@ export default {
4041
4077
  if (this.readOnly) {
4042
4078
  let bodys = document.querySelector(`.z-editor`)
4043
4079
  bodys.scrollTop = element.offsetTop
4044
- return
4080
+ } else {
4081
+ let bodys = document.querySelector(`.editor-content`)
4082
+ bodys.scrollTop = element.offsetTop + 70
4045
4083
  }
4046
- element.scrollIntoView({behavior: 'smooth'});
4084
+
4085
+ // element.scrollIntoView({behavior: 'smooth'});
4047
4086
  }
4048
4087
  }
4049
4088
  }
@@ -4130,8 +4169,8 @@ export default {
4130
4169
 
4131
4170
  :deep(.title) {
4132
4171
  /*padding: 10px 0 2px 0;*/
4133
- font-weight: 900;
4134
- color:#333333!important;
4172
+ /*font-weight: 900;*/
4173
+ color: #333333 !important;
4135
4174
  }
4136
4175
 
4137
4176
  .read-only-a {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="docView">
2
+ <div class="docView" @mouseleave="mouseUpTest" @mouseup="mouseUpTest">
3
3
  <div class="full-screen" v-if="false">
4
4
  <div class="full-screen-img" @click.stop="fullScreen">
5
5
  <!-- <div class="full-screen-title" style="" v-if="showText">全屏查看</div>-->
@@ -21,7 +21,7 @@
21
21
  <div>
22
22
  <div class="book" ref="book">
23
23
  <div class="pages">
24
- <div class="wrap-box" ref="wrap-box" v-if="doublePage">
24
+ <div class="wrap-box" ref="wrap-box" v-show="doublePage">
25
25
  <div class="wrap wrap-block" :ref="`wrap-${item.id}`" v-for="(item,index) in pageInfoArr" :key="index">
26
26
  <div class="wrap-can" v-show="!loading" ref="wrapCanBox">
27
27
  <canvas @click.stop="turnText" class="wrap-can-one" @mousedown.stop="mouseDown"
@@ -45,7 +45,7 @@
45
45
  </div>
46
46
  </div>
47
47
  </div>
48
- <div class="wrap" ref="wrap" v-else>
48
+ <div class="wrap" ref="wrap" v-show="!doublePage">
49
49
  <div class="wrap-can" v-show="!loading" ref="wrapCan">
50
50
  <canvas @click.stop="turnText" class="wrap-can-one" @mousedown.stop="mouseDown"
51
51
  @mousemove.stop="mouseMove" :id="`${id}`"></canvas>
@@ -105,7 +105,7 @@ import {debounce} from '../../utils'
105
105
 
106
106
  PdfJs.GlobalWorkerOptions.workerSrc = require('pdfjs-dist/build/pdf.worker.entry')
107
107
 
108
- let pdfs = null
108
+ let pdfs = null;
109
109
 
110
110
  export default {
111
111
  name: "zydx-flip",
@@ -292,15 +292,15 @@ export default {
292
292
  },
293
293
  emits: ['flip'],
294
294
  mounted() {
295
- if(!this.doublePage){
295
+ if (!this.doublePage) {
296
296
  this.id = 'canvas-wrap' + this.generateUniqueKey()
297
297
  }
298
298
  window.addEventListener('keydown', this.handleKeyEvent)
299
299
  // 在画板以外松开鼠标后冻结画笔
300
- document.onmouseup = () => {
301
- if (this.isDrawing || this.checkDrawing) this.mouseUp()
302
- this.textMoveStart = false
303
- }
300
+ // document.onmouseup = () => {
301
+ // if (this.isDrawing || this.checkDrawing) this.mouseUp()
302
+ // this.textMoveStart = false
303
+ // }
304
304
  this.setResizeObserver()
305
305
  },
306
306
  beforeDestroy() {
@@ -308,22 +308,26 @@ export default {
308
308
  this.cancelResizeObserver()
309
309
  },
310
310
  methods: {
311
+ mouseUpTest(){
312
+ if (this.isDrawing || this.checkDrawing) this.mouseUp()
313
+ this.textMoveStart = false
314
+ },
311
315
  setResizeObserver() {
312
- setTimeout(()=>{
316
+ setTimeout(() => {
313
317
  const el = this.$refs.book;
314
- let resizeTimer ;
318
+ let resizeTimer;
315
319
  this.resizeObserver = new ResizeObserver(() => {
316
320
  clearTimeout(resizeTimer);
317
321
  resizeTimer = setTimeout(() => {
318
- if(this.doublePage){
322
+ if (this.doublePage) {
319
323
  this.readDoublePdf()
320
- }else {
324
+ } else {
321
325
  this.readPdf()
322
326
  }
323
327
  }, 150); // 根据需求调整延迟时间
324
328
  });
325
329
  this.resizeObserver.observe(el);
326
- },300)
330
+ }, 300)
327
331
  },
328
332
  cancelResizeObserver() {
329
333
  const el = this.$refs.book;
@@ -333,16 +337,16 @@ export default {
333
337
  this.$emit('showPen', true)
334
338
  // this.isDraw = true
335
339
  },
336
- changeView(){
337
- this.$emit('changeViewDoublePage',!this.doublePage)
338
- setTimeout(()=>{
340
+ changeView() {
341
+ this.$emit('changeViewDoublePage', !this.doublePage)
342
+ setTimeout(() => {
339
343
  this.doublePage = !this.doublePage
340
- if(this.doublePage){
344
+ if (this.doublePage) {
341
345
  this.$emit('showPen', false)
342
346
  }
343
- },500)
347
+ }, 500)
344
348
  },
345
- fullScreen(){
349
+ fullScreen() {
346
350
  window.open(this.source)
347
351
  },
348
352
  colorTap(v) {
@@ -614,13 +618,14 @@ export default {
614
618
  }
615
619
  },
616
620
  mouseDown(e) {
617
- if(this.doublePage){
621
+ if (this.doublePage) {
618
622
  return;
619
623
  }
620
624
  this.setShow = false
621
625
  e = e || event
622
626
  e.preventDefault()
623
627
  if (this.state === null || this.state === 'del') {
628
+ this.$emit('mouseClick')
624
629
  this.checkDrawing = true
625
630
  this.checkDown(e)
626
631
  return
@@ -644,7 +649,7 @@ export default {
644
649
  },
645
650
  // 鼠标移动
646
651
  mouseMove(e) {
647
- if(this.doublePage){
652
+ if (this.doublePage) {
648
653
  return;
649
654
  }
650
655
  e = e || event
@@ -1131,9 +1136,9 @@ export default {
1131
1136
  this.pageIndex = e
1132
1137
  }
1133
1138
  this.oneIndex = 'right'
1134
- if(this.doublePage){
1139
+ if (this.doublePage) {
1135
1140
  this.readDoublePdf()
1136
- }else {
1141
+ } else {
1137
1142
  this.readPdf()
1138
1143
  }
1139
1144
  if (!v) {
@@ -1151,9 +1156,9 @@ export default {
1151
1156
  this.pageIndex = e
1152
1157
  }
1153
1158
  this.oneIndex = 'left'
1154
- if(this.doublePage){
1159
+ if (this.doublePage) {
1155
1160
  this.readDoublePdf()
1156
- }else {
1161
+ } else {
1157
1162
  this.readPdf()
1158
1163
  }
1159
1164
  if (!v) {
@@ -1176,9 +1181,9 @@ export default {
1176
1181
  pdfs = pdf
1177
1182
  that.pdfPages = pdf.numPages // 获取pdf文件的总页数
1178
1183
  that.$nextTick(() => {
1179
- if(that.doublePage){
1184
+ if (that.doublePage) {
1180
1185
  that.readDoublePdf(pdf)
1181
- }else {
1186
+ } else {
1182
1187
  that.readPdf(pdf)
1183
1188
  }
1184
1189
  })
@@ -1190,75 +1195,21 @@ export default {
1190
1195
  })
1191
1196
  })
1192
1197
  },
1193
- readPdf:debounce(function (){
1194
- let that = this
1195
- that.mouse()
1196
- pdfs.getPage(that.pageIndex).then(function (page) {
1197
- let canvas = document.getElementById(that.id)
1198
- let canvas2 = document.getElementById(`${that.id}2`)
1199
- that.ctx = canvas.getContext('2d');
1200
- let ctx2 = canvas2.getContext('2d');
1201
- that.boxWidth = that.$refs.wrap.offsetWidth
1202
- that.scales=(that.boxWidth/846)*(that.boxWidth/(that.boxWidth-(that.boxWidth*0.115*2)))
1203
- let viewport = page.getViewport({scale: that.scales})
1204
- const sc = viewport.width / viewport.height
1205
- const wid = that.$refs.wrap.offsetWidth - 10
1206
- const hei = wid / sc
1207
- canvas.width = wid * that.sratio
1208
- canvas.height = hei * that.sratio
1209
- canvas.style.width = wid + 'px'
1210
- canvas.style.height = hei + 'px'
1211
- canvas2.width = wid * that.sratio
1212
- canvas2.height = hei * that.sratio
1213
- canvas2.style.width = wid + 'px'
1214
- canvas2.style.height = hei + 'px'
1215
- that.canvasStyle = {
1216
- width: wid + 'px',
1217
- height: hei + 'px',
1218
- marginLeft: -(wid / 2) + 'px',
1219
- widthCanvas: wid * that.sratio,
1220
- heightCanvas: hei * that.sratio
1221
- }
1222
- let renderContext = {
1223
- canvasContext: ctx2,
1224
- viewport: viewport,
1225
- transform: [2, 0, 0, 2, 0, 0] //这里会进行放大,解决模糊问题
1226
- }
1227
- page.render(renderContext)
1228
- that.loading = false
1229
- if (that.oneIndex === 'right') {
1230
- that.flipRights = true
1231
- that.flipLefts = false
1232
- } else {
1233
- that.flipRights = false
1234
- that.flipLefts = true
1235
- }
1236
- // 获取canvas的base64数据
1237
- setTimeout(() => {
1238
- that.flipRights = false
1239
- that.flipLefts = false
1240
- that.oneShow = false
1241
- that.imgArr = canvas2.toDataURL('image/jpeg', 1)
1242
- that.processing()
1243
- }, 1000)
1244
- })
1245
- },200),
1246
- readDoublePdf:debounce(function (){
1247
- let that = this
1248
- that.mouse()
1249
- that.$nextTick(()=>{
1250
- that.pageInfoArr.forEach((item,index)=>{
1251
- pdfs.getPage(index+1).then(function (page) {
1252
- let canvas = document.getElementById(item.id)
1253
- let canvas2 = document.getElementById(`${item.id}2`)
1254
- item.ctx = canvas.getContext('2d');
1255
- item.ctx2 = canvas2.getContext('2d');
1256
- let wrapBoxWidth = that.$refs['wrap-box'].offsetWidth
1257
- // let newScale= wrapBoxWidth/(wrapBoxWidth-(wrapBoxWidth*0.1*2))
1258
- let newScale=(wrapBoxWidth/846)*(wrapBoxWidth/(wrapBoxWidth-(wrapBoxWidth*0.115*2)))
1259
- let viewport = page.getViewport({scale: newScale/2})//
1198
+ readPdf: debounce(function () {
1199
+ setTimeout(() => {
1200
+ let that = this
1201
+ that.mouse()
1202
+ that.$nextTick(() => {
1203
+ pdfs.getPage(that.pageIndex).then(function (page) {
1204
+ let canvas = document.getElementById(`${that.id}`)
1205
+ let canvas2 = document.getElementById(`${that.id}2`)
1206
+ that.ctx = canvas.getContext('2d');
1207
+ let ctx2 = canvas2.getContext('2d');
1208
+ that.boxWidth = that.$refs.wrap.offsetWidth
1209
+ that.scales = (that.boxWidth / 846) * (that.boxWidth / (that.boxWidth - (that.boxWidth * 0.115 * 2)))
1210
+ let viewport = page.getViewport({scale: that.scales})
1260
1211
  const sc = viewport.width / viewport.height
1261
- const wid = that.$refs[`wrap-${item.id}`][0].offsetWidth-15
1212
+ const wid = that.$refs.wrap.offsetWidth - 10
1262
1213
  const hei = wid / sc
1263
1214
  canvas.width = wid * that.sratio
1264
1215
  canvas.height = hei * that.sratio
@@ -1276,9 +1227,9 @@ export default {
1276
1227
  heightCanvas: hei * that.sratio
1277
1228
  }
1278
1229
  let renderContext = {
1279
- canvasContext: item.ctx2,
1230
+ canvasContext: ctx2,
1280
1231
  viewport: viewport,
1281
- transform: [2,0,0,2,0,0] //这里会进行放大,解决模糊问题
1232
+ transform: [2, 0, 0, 2, 0, 0] //这里会进行放大,解决模糊问题
1282
1233
  }
1283
1234
  page.render(renderContext)
1284
1235
  that.loading = false
@@ -1294,14 +1245,74 @@ export default {
1294
1245
  that.flipRights = false
1295
1246
  that.flipLefts = false
1296
1247
  that.oneShow = false
1297
- that.doubleImgArr.push(canvas2.toDataURL('image/jpeg', 1))
1248
+ that.imgArr = canvas2.toDataURL('image/jpeg', 1)
1298
1249
  that.processing()
1299
1250
  }, 1000)
1300
1251
  })
1301
1252
  })
1302
- })
1303
- },200),
1304
- generateUniqueKey (){
1253
+ }, 200)
1254
+ }, 200),
1255
+ readDoublePdf: debounce(function () {
1256
+ setTimeout(() => {
1257
+ let that = this
1258
+ that.mouse()
1259
+ that.$nextTick(() => {
1260
+ that.pageInfoArr.forEach((item, index) => {
1261
+ pdfs.getPage(index + 1).then(function (page) {
1262
+ let canvas = document.getElementById(item.id)
1263
+ let canvas2 = document.getElementById(`${item.id}2`)
1264
+ item.ctx = canvas.getContext('2d');
1265
+ item.ctx2 = canvas2.getContext('2d');
1266
+ let wrapBoxWidth = that.$refs['wrap-box'].offsetWidth
1267
+ // let newScale= wrapBoxWidth/(wrapBoxWidth-(wrapBoxWidth*0.1*2))
1268
+ let newScale = (wrapBoxWidth / 846) * (wrapBoxWidth / (wrapBoxWidth - (wrapBoxWidth * 0.115 * 2)))
1269
+ let viewport = page.getViewport({scale: newScale / 2})//
1270
+ const sc = viewport.width / viewport.height
1271
+ const wid = that.$refs[`wrap-${item.id}`][0].offsetWidth - 15
1272
+ const hei = wid / sc
1273
+ canvas.width = wid * that.sratio
1274
+ canvas.height = hei * that.sratio
1275
+ canvas.style.width = wid + 'px'
1276
+ canvas.style.height = hei + 'px'
1277
+ canvas2.width = wid * that.sratio
1278
+ canvas2.height = hei * that.sratio
1279
+ canvas2.style.width = wid + 'px'
1280
+ canvas2.style.height = hei + 'px'
1281
+ that.canvasStyle = {
1282
+ width: wid + 'px',
1283
+ height: hei + 'px',
1284
+ marginLeft: -(wid / 2) + 'px',
1285
+ widthCanvas: wid * that.sratio,
1286
+ heightCanvas: hei * that.sratio
1287
+ }
1288
+ let renderContext = {
1289
+ canvasContext: item.ctx2,
1290
+ viewport: viewport,
1291
+ transform: [2, 0, 0, 2, 0, 0] //这里会进行放大,解决模糊问题
1292
+ }
1293
+ page.render(renderContext)
1294
+ that.loading = false
1295
+ if (that.oneIndex === 'right') {
1296
+ that.flipRights = true
1297
+ that.flipLefts = false
1298
+ } else {
1299
+ that.flipRights = false
1300
+ that.flipLefts = true
1301
+ }
1302
+ // 获取canvas的base64数据
1303
+ setTimeout(() => {
1304
+ that.flipRights = false
1305
+ that.flipLefts = false
1306
+ that.oneShow = false
1307
+ that.doubleImgArr.push(canvas2.toDataURL('image/jpeg', 1))
1308
+ that.processing()
1309
+ }, 1000)
1310
+ })
1311
+ })
1312
+ })
1313
+ }, 200)
1314
+ }, 200),
1315
+ generateUniqueKey() {
1305
1316
  // Math.random().toString(36).substr(2)
1306
1317
  return `${new Date().getTime()}${Math.random().toString(36).substr(2)}`;
1307
1318
  }
@@ -1372,7 +1383,7 @@ export default {
1372
1383
  border: 1px solid #cccccc;
1373
1384
  overflow: hidden;
1374
1385
  /*box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);*/
1375
- /*cursor: none;*/
1386
+ /*cursor: none;*/
1376
1387
  }
1377
1388
 
1378
1389
  .wrap-can img {
@@ -1459,7 +1470,7 @@ export default {
1459
1470
  overflow-y: auto;*/
1460
1471
  }
1461
1472
 
1462
- .book::-webkit-scrollbar{
1473
+ .book::-webkit-scrollbar {
1463
1474
  display: none;
1464
1475
  }
1465
1476
 
@@ -1518,28 +1529,28 @@ export default {
1518
1529
  }
1519
1530
  }
1520
1531
 
1521
- .wrap-box{
1532
+ .wrap-box {
1522
1533
  display: flex;
1523
1534
  flex-flow: row wrap;
1524
1535
  justify-content: space-between;
1525
1536
  }
1526
1537
 
1527
- .wrap-box>.wrap{
1538
+ .wrap-box > .wrap {
1528
1539
  width: 50%;
1529
1540
  }
1530
1541
 
1531
- div{
1542
+ div {
1532
1543
  box-sizing: border-box;
1533
1544
  }
1534
1545
 
1535
- .full-screen{
1546
+ .full-screen {
1536
1547
  position: absolute;
1537
1548
  top: 20px;
1538
1549
  right: -20px;
1539
1550
  z-index: 100;
1540
1551
  }
1541
1552
 
1542
- .full-screen>.full-screen-img{
1553
+ .full-screen > .full-screen-img {
1543
1554
  display: flex;
1544
1555
  flex-direction: row;
1545
1556
  justify-content: flex-end;
@@ -1547,12 +1558,13 @@ div{
1547
1558
  margin-bottom: 10px;
1548
1559
  }
1549
1560
 
1550
- .full-screen-title{
1561
+ .full-screen-title {
1551
1562
  width: 100%;
1552
1563
  white-space: nowrap;
1553
1564
  overflow: hidden;
1554
- animation:span-animation 0.3s linear;
1565
+ animation: span-animation 0.3s linear;
1555
1566
  }
1567
+
1556
1568
  @keyframes span-animation {
1557
1569
  0% {
1558
1570
  width: 0;
@@ -1562,9 +1574,9 @@ div{
1562
1574
  }
1563
1575
  }
1564
1576
 
1565
- .full-screen-img>img{
1577
+ .full-screen-img > img {
1566
1578
  width: 20px;
1567
1579
  height: 20px;
1568
- /*margin-left: 5px;*/
1580
+ /*margin-left: 5px;*/
1569
1581
  }
1570
1582
  </style>
@@ -1,86 +1,84 @@
1
1
  <template>
2
- <div class="list-tree">
3
- <div class="list-cont" v-if="list.length > 0">
4
- <div :class="{'list-li':true, 'theme-text': active === index, pos: multiple}"
5
- :style="{'border-bottom': (link)? '1px solid #ccc': '0'}"
6
- v-for="(item,index) in listCopy" :key="index" @click="listTap(item,index)">
7
- <input v-if="multiple" :checked="item.box" @change="checkboxChange($event,index)" class="box-list" type="checkbox" name="boxList" />
8
- <div class="list-title">
9
- <span :style="{'font-size': 'fontSize' in column[0]?column[0].fontSize + 'px':'16px', 'font-weight': column[0].fontWeight, 'color': (active === index)? activeColor : '#333333'}" v-html="(index + 1) + '.' + (angleBrackets ? '《' : '') + item[column[0].label] + (angleBrackets ? '》' : '')"></span>
10
- <button v-if="delShow" @click="del(item)" v-html="delText"></button>
11
- </div>
12
- <div class="list-cont" v-if="open">
13
- <div class="list-li-cont" :style="{'color': (active === index)? activeColor : '#000000'}">
14
- <p v-for="(it,ind) in column.slice(1, column.length)" :key="ind">{{ it.name }}:{{ item[it.label] }}</p>
15
- </div>
16
- </div>
17
- <div class="list-cont" v-else>
18
- <div class="list-li-cont" :style="{'color': (active === index)? activeColor : '#000000'}" v-if="active === index">
19
- <p v-for="(it,ind) in column.slice(1, column.length)" :key="ind">{{ it.name }}:{{ item[it.label] }}</p>
20
- </div>
21
- </div>
2
+ <div class="list-tree">
3
+ <div class="list-cont" v-if="list.length > 0">
4
+ <div :class="{'list-li':true, 'theme-text': active === index, pos: multiple}"
5
+ :style="{'border-bottom': (link)? '1px solid #ccc': '0'}"
6
+ v-for="(item,index) in listCopy" :key="index" @click="listTap(item,index)">
7
+ <input v-if="multiple" :checked="item.box" @change="checkboxChange($event,index)" class="box-list" type="checkbox" name="boxList" />
8
+ <div class="list-title">
9
+ <span :style="{'font-size': 'fontSize' in column[0]?column[0].fontSize + 'px':'16px', 'font-weight': column[0].fontWeight, 'color': (active === index)? activeColor : '#333333'}" v-html="(index + 1) + '.' + (angleBrackets ? '《' : '') + item[column[0].label] + (angleBrackets ? '》' : '')"></span>
10
+ <button v-if="delShow" @click="del(item)" v-html="delText"></button>
11
+ </div>
12
+ <div class="list-cont">
13
+ <div class="list-li-cont" :style="{'color': (active === index)? activeColor : '#000000'}" v-if="open ? true : active === index">
14
+ <div v-for="(it,ind) in column.slice(1, column.length)" :key="ind" class="textWrap">
15
+ <div class="lable">{{ it.name }}</div>
16
+ <div class="text">:{{ item[it.label] }}</div>
22
17
  </div>
18
+ </div>
23
19
  </div>
24
- <div v-else class="wu">暂无数据</div>
20
+ </div>
25
21
  </div>
22
+ <div v-else class="wu">暂无数据</div>
23
+ </div>
26
24
  </template>
27
25
 
28
26
  <script>
29
- export default {
27
+ export default {
30
28
  name: "zydx-tree-list",
31
29
  data() {
32
- return {
33
- active: this.actives,
34
- listCopy: []
35
- }
30
+ return {
31
+ active: this.actives,
32
+ listCopy: []
33
+ }
36
34
  },
37
35
  props: {
38
- list: { // 数据列表
39
- type: Array,
40
- default: () => []
41
- },
42
- column: { // 数据列表
43
- type: Array,
44
- default: () => []
45
- },
46
- delShow: { //是否显示取消按钮
47
- type: Boolean,
48
- default: false
49
- },
50
- angleBrackets: {
51
- type: Boolean,
52
- default: false
53
- },
54
- open: {
55
- type: Boolean,
56
- default: false
57
- },
58
- link: {
59
- type: Boolean,
60
- default: false
61
- },
62
- activeColor: {
63
- type: String,
64
- default: '#e20808'
65
- },
66
- actives: {
67
- type: Number,
68
- default: 0
69
- },
70
- delText: {
71
- type: String,
72
- default: '删除'
73
- },
36
+ list: { // 数据列表
37
+ type: Array,
38
+ default: () => []
39
+ },
40
+ column: { // 数据列表
41
+ type: Array,
42
+ default: () => []
43
+ },
44
+ delShow: { //是否显示取消按钮
45
+ type: Boolean,
46
+ default: false
47
+ },
48
+ angleBrackets: {
49
+ type: Boolean,
50
+ default: false
51
+ },
52
+ open: {
53
+ type: Boolean,
54
+ default: false
55
+ },
56
+ link: {
57
+ type: Boolean,
58
+ default: false
59
+ },
60
+ activeColor: {
61
+ type: String,
62
+ default: '#e20808'
63
+ },
64
+ actives: {
65
+ type: Number,
66
+ default: 0
67
+ },
68
+ delText: {
69
+ type: String,
70
+ default: '删除'
71
+ },
74
72
  multiple: {
75
73
  type: Boolean,
76
74
  default: false
77
75
  }
78
76
  },
79
77
  watch: {
80
- actives(val) {
81
- if (val === -1) return
82
- this.active = val
83
- },
78
+ actives(val) {
79
+ if (val === -1) return
80
+ this.active = val
81
+ },
84
82
  list: {
85
83
  handler(val) {
86
84
  let list = JSON.parse(JSON.stringify(val))
@@ -106,41 +104,41 @@ export default {
106
104
  const data = this.listCopy.filter(x => x.box)
107
105
  this.$emit('multipleData', data)
108
106
  },
109
- del(data) {
110
- this.$emit('del', data)
111
- },
112
- listTap(data, index) {
113
- this.active = index
114
- this.$emit('confirm', {...data, activeIndex: index})
115
- },
107
+ del(data) {
108
+ this.$emit('del', data)
109
+ },
110
+ listTap(data, index) {
111
+ this.active = index
112
+ this.$emit('confirm', {...data, activeIndex: index})
113
+ },
116
114
  }
117
- }
115
+ }
118
116
  </script>
119
117
 
120
118
  <style scoped>
121
- .pos{
122
- position: relative;
123
- padding-left: 20px;
124
- }
125
- .box-list{
126
- position: absolute;
127
- top: 9px;
128
- left: 0;
129
- z-index: 1;
130
- }
131
- .wu {
119
+ .pos{
120
+ position: relative;
121
+ padding-left: 20px;
122
+ }
123
+ .box-list{
124
+ position: absolute;
125
+ top: 9px;
126
+ left: 0;
127
+ z-index: 1;
128
+ }
129
+ .wu {
132
130
  text-align: center;
133
131
  font-size: 18px;
134
132
  padding: 40px 0;
135
- }
133
+ }
136
134
 
137
- .list-title {
135
+ .list-title {
138
136
  display: flex;
139
137
  justify-content: center;
140
138
  line-height: 30px;
141
- }
139
+ }
142
140
 
143
- .list-title > span {
141
+ .list-title > span {
144
142
  flex: 1;
145
143
  overflow: hidden;
146
144
  white-space: nowrap;
@@ -148,9 +146,9 @@ export default {
148
146
  height: 30px;
149
147
  font-size: 14px;
150
148
  font-weight: 600;
151
- }
149
+ }
152
150
 
153
- .list-title > button {
151
+ .list-title > button {
154
152
  margin-left: 5px;
155
153
  margin-top: 4px;
156
154
  font-size: 12px;
@@ -161,31 +159,47 @@ export default {
161
159
  cursor: pointer;
162
160
  height: 22px;
163
161
  min-width: 60px;
164
- }
162
+ }
165
163
 
166
- .list-tree {
164
+ .list-tree {
167
165
  padding: 0 10px;
168
166
  cursor: pointer;
169
- }
170
- /*.list-li{*/
171
- /*padding-bottom: 10px;*/
172
- /*}*/
173
- .list-li > span {
167
+ }
168
+ /*.list-li{
169
+ /*padding-bottom: 10px;*/
170
+ /*}*/
171
+ .list-li > span {
174
172
  font-size: 16px;
175
173
  line-height: 30px;
176
- }
174
+ }
177
175
 
178
- .list-li-cont {
176
+ .list-li-cont {
179
177
  font-size: 14px;
180
178
  padding-left: 18px;
181
- }
179
+ }
182
180
 
183
- .list-li-cont > p {
181
+ .list-li-cont > .textWrap {
184
182
  height: 25px;
185
183
  line-height: 25px;
186
184
  overflow: hidden;
187
185
  white-space: nowrap;
188
186
  text-overflow: ellipsis;
189
187
  font-size: 14px;
190
- }
188
+ display: flex;
189
+ justify-content: left;
190
+ align-items: center;
191
+ }
192
+ .lable{
193
+ line-height: 25px;
194
+ width: 57px;
195
+ text-align: justify;
196
+ text-align-last: justify;
197
+ }
198
+ .text {
199
+ width: calc(100% - 57px);
200
+ overflow: hidden;
201
+ white-space: nowrap;
202
+ text-overflow: ellipsis;
203
+ line-height: 25px;
204
+ }
191
205
  </style>
package/src/index.js CHANGED
@@ -87,7 +87,7 @@ function install(app) {
87
87
  }
88
88
 
89
89
  export default {
90
- version: '1.35.487',
90
+ version: '1.35.489',
91
91
  install,
92
92
  Calendar,
93
93
  Message,