zydx-plus 1.35.523 → 1.35.525

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.523",
3
+ "version": "1.35.525",
4
4
  "description": "Vue.js",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -1,94 +1,82 @@
1
1
  <template>
2
2
  <teleport to="body">
3
- <div class="chat-content"
4
- :style="{
5
- top: `${y !== '' ? `${y}px` : '50%'}`,
6
- left: `${x !== '' ? `${x}px` : '50%'}`,
7
- marginTop: `${y === ''? '-80px' : '0'}`,
8
- marginLeft: `${x === ''? '-300px' : '0'}`,
9
- }">
10
- <div class="chat-header theme-background">
11
- <span class="chat-header-title"
12
- @mousedown.stop="chatMousedown"
13
- @mouseup.stop="chatMouseup">
14
- AI助手
15
- </span>
16
- <i class="iconfont zydx-guanbi" @click.stop="aiClose"></i>
17
- </div>
18
- <div class="chat-input">
19
- <div class="chat-text">
20
- <textarea :disabled="disabled" @keydown="handleKeydown" @input="autoResize" v-model="userText" placeholder="问AI试试..."></textarea>
21
- </div>
22
- <div class="chat-operate">
23
- <div class="chat-send">
24
- <div @click="clearTextarea">
25
- <i class= "theme-text iconfont zydx-a-qingchuAizhushou"></i>
26
- <span class="theme-text">清空</span>
27
- </div>
28
- <div class="line"></div>
29
- <div @click="speak">
30
- <i :class="{'speak': microphone, 'theme-text': true}" class="iconfont zydx-a-yuyinshuruAi"></i>
31
- <span class="theme-text">语音输入</span>
32
- </div>
33
- <div class="line"></div>
34
- <div @click="send">
35
- <i class="theme-text iconfont zydx-a-sousuoAizhushou" :class="{'disabled': disabled}"></i>
36
- <button :disabled="disabled" :class="{'disabled': disabled, 'theme-text': true}">搜索</button>
3
+ <drag-popup ref="dragPopup" v-if='isShow' @close="aiClose" title="AI助手" :width="960" :height="400" :minWidth="300" :minHeight="400">
4
+ <template v-slot:content>
5
+ <div class="chat-input">
6
+ <div class="chat-text">
7
+ <textarea :disabled="disabled" @keydown="handleKeydown" @input="autoResize" v-model="userText" placeholder="问AI试试..."></textarea>
8
+ </div>
9
+ <div class="chat-operate">
10
+ <div class="chat-send">
11
+ <div :class="{'disabled': disabled}" @click="clearTextarea">
12
+ <i class= "theme-text iconfont zydx-a-qingchuAizhushou"></i>
13
+ <span class="theme-text">清空</span>
14
+ </div>
15
+ <div class="line"></div>
16
+ <div :class="{'disabled': disabled}" @click="speak">
17
+ <i :class="{'speak': microphone, 'theme-text': true}" class="iconfont zydx-a-yuyinshuruAi"></i>
18
+ <span class="theme-text">语音输入</span>
19
+ </div>
20
+ <div class="line"></div>
21
+ <div @click="send">
22
+ <i class="theme-text iconfont zydx-a-sousuoAizhushou" :class="{'disabled': disabled}"></i>
23
+ <button :disabled="disabled" :class="{'disabled': disabled, 'theme-text': true}">搜索</button>
24
+ </div>
37
25
  </div>
38
26
  </div>
39
27
  </div>
40
- </div>
41
- <div class="chat-in" v-if="currentMessage" ref="content">
42
- <div class="AI-tips-line">
43
- <div class="tips">
44
- <span>AI回答</span>
45
- <span>(以下内容为AI生成,请注意辨别信息真伪)</span>
46
- </div>
47
- <div class="operate">
48
- <div @click="send" :class="{'disabled': disabled}">
49
- <i class="theme-text iconfont zydx-a-zhongzhiAi"></i>
50
- <span class="theme-text">重新生成</span>
28
+ <div class="chat-in" ref="content">
29
+ <div class="AI-tips-line">
30
+ <div class="tips">
31
+ <span>AI回答</span>
32
+ <span>(以下内容为AI生成,请注意辨别信息真伪)</span>
51
33
  </div>
52
- <div class="line"></div>
53
- <div @click="copy">
54
- <i class="theme-text iconfont zydx-a-fuzhiAI"></i>
55
- <span class="theme-text">复制</span>
34
+ <div class="operate" v-if="currentMessage">
35
+ <div @click="send" :class="{'disabled': disabled}">
36
+ <i class="theme-text iconfont zydx-a-zhongzhiAi"></i>
37
+ <span class="theme-text">重新生成</span>
38
+ </div>
39
+ <div class="line"></div>
40
+ <div @click="copy">
41
+ <i class="theme-text iconfont zydx-a-fuzhiAI"></i>
42
+ <span class="theme-text">复制</span>
43
+ </div>
56
44
  </div>
57
45
  </div>
58
- </div>
59
- <div class="chat-in-cont" ref="contentLi">
60
- <!-- <div class="chat-in-li" :class="{'left': item.role === 'assistant', 'right': item.role === 'user'}" v-for="(item,index) in messages"> -->
61
- <!-- <template v-if="item.role === 'assistant'">
62
- <div class="ai-avatar" v-if="item.role === 'assistant'">
63
- <img src="./ai.png" alt="" />
46
+ <div class="chat-in-cont" ref="contentLi">
47
+ <!-- <div class="chat-in-li" :class="{'left': item.role === 'assistant', 'right': item.role === 'user'}" v-for="(item,index) in messages"> -->
48
+ <!-- <template v-if="item.role === 'assistant'">
49
+ <div class="ai-avatar" v-if="item.role === 'assistant'">
50
+ <img src="./ai.png" alt="" />
51
+ </div>
52
+ <div class="text-cont">{{ item.content }}</div>
53
+ </template> -->
54
+ <div class="chat-in-li left">
55
+ <div class="text-cont">{{currentMessage}}</div>
64
56
  </div>
65
- <div class="text-cont">{{ item.content }}</div>
66
- </template> -->
67
- <div class="chat-in-li left">
68
- <div class="text-cont">{{currentMessage}}</div>
69
57
  </div>
70
58
  </div>
71
- </div>
72
- <div class="microphone" v-if="microphone">
73
- <div class="microphone-cont mic-anim">
74
- <div class="microphone1">
75
- <div class="microphone2">
76
- <div class="microphone3" @click="stopRecording">
77
- <div>
78
- <svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 68" width="26" height="48">
79
- <path id="并集_轮廓_" data-name="并集 (轮廓)" fill="#ccc"
80
- d="M10,44a3,3,0,0,1-3-3V3a3,3,0,0,1,3-3H28a3,3,0,0,1,3,3V41a3,3,0,0,1-3,3Zm17-4V4H11V40ZM0,47V24a2,2,0,0,1,4,0V45a2,2,0,0,0,2,2H32a2,2,0,0,0,2-2V24a2,2,0,0,1,4,0V47a4,4,0,0,1-4,4H21v9c7.34.26,13,1.93,13,4,0,2.21-6.72,4-15,4S4,66.21,4,64c0-2,5.66-3.7,13-4V51H4A4,4,0,0,1,0,47ZM19,64h.79L19,64l-.79,0Z"/>
81
- <rect fill="#fff" x="11" y="4" width="16" height="36"/>
82
- <rect class="volume" :height="volume(vol)" width="12" :y="volume2(vol)" x="13" fill="#43cf7c"/>
83
- </svg>
59
+ <div class="microphone" v-if="microphone">
60
+ <div class="microphone-cont mic-anim">
61
+ <div class="microphone1">
62
+ <div class="microphone2">
63
+ <div class="microphone3" @click="stopRecording">
64
+ <div>
65
+ <svg id="图层_1" data-name="图层 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 38 68" width="26" height="48">
66
+ <path id="并集_轮廓_" data-name="并集 (轮廓)" fill="#ccc"
67
+ d="M10,44a3,3,0,0,1-3-3V3a3,3,0,0,1,3-3H28a3,3,0,0,1,3,3V41a3,3,0,0,1-3,3Zm17-4V4H11V40ZM0,47V24a2,2,0,0,1,4,0V45a2,2,0,0,0,2,2H32a2,2,0,0,0,2-2V24a2,2,0,0,1,4,0V47a4,4,0,0,1-4,4H21v9c7.34.26,13,1.93,13,4,0,2.21-6.72,4-15,4S4,66.21,4,64c0-2,5.66-3.7,13-4V51H4A4,4,0,0,1,0,47ZM19,64h.79L19,64l-.79,0Z"/>
68
+ <rect fill="#fff" x="11" y="4" width="16" height="36"/>
69
+ <rect class="volume" :height="volume(vol)" width="12" :y="volume2(vol)" x="13" fill="#43cf7c"/>
70
+ </svg>
71
+ </div>
72
+ <p>{{ voiceLoading? '语音转换中...': `正在说话:${countdown}s` }}</p>
84
73
  </div>
85
- <p>{{ voiceLoading? '语音转换中...': `正在说话:${countdown}s` }}</p>
86
74
  </div>
87
75
  </div>
88
76
  </div>
89
77
  </div>
90
- </div>
91
- </div>
78
+ </template>
79
+ </drag-popup>
92
80
  </teleport>
93
81
  </template>
94
82
 
@@ -96,8 +84,10 @@
96
84
  import Recorder from 'js-audio-recorder'
97
85
  import axios from 'axios'
98
86
  import Message from '../../../components/tipBox/index';
87
+ import dragPopup from '../../dragPopup/src/dragPopup.vue'
99
88
  export default {
100
89
  name: 'zydx-chat',
90
+ components: { dragPopup },
101
91
  data() {
102
92
  return {
103
93
  token: '',
@@ -116,7 +106,14 @@ export default {
116
106
  fileSize: 0,
117
107
  vol: 0,
118
108
  base64: '',
119
- voiceLoading: false
109
+ voiceLoading: false,
110
+ isSearched: false,
111
+ }
112
+ },
113
+ props: {
114
+ isShow: {
115
+ type: Boolean,
116
+ default: false
120
117
  }
121
118
  },
122
119
  beforeUnmount() {
@@ -173,6 +170,7 @@ export default {
173
170
  e.target.style.height = `${e.target.scrollHeight }px`
174
171
  },
175
172
  clearTextarea() {
173
+ if(this.disabled) return
176
174
  this.userText = ''
177
175
  },
178
176
  copy() {
@@ -292,10 +290,11 @@ export default {
292
290
  let text = _this.userText.replace(/[\r\n]/g, '').replace(/\s*/g, '')
293
291
  if(!text) return
294
292
  // _this.messages.push({
295
- // role: 'user',
296
- // content: text
297
- // })
298
- _this.disabled = true
293
+ // role: 'user',
294
+ // content: text
295
+ // })
296
+ _this.disabled = true
297
+ _this.isSearched = true
299
298
  // _this.messages.push({
300
299
  // role: 'assistant',
301
300
  // content: '努力思考中...'
@@ -364,7 +363,7 @@ export default {
364
363
  },
365
364
  // 关闭
366
365
  aiClose() {
367
- this.$emit('close')
366
+ this.$emit('update:isShow', false)
368
367
  }
369
368
  }
370
369
  }
@@ -410,6 +409,7 @@ export default {
410
409
  }
411
410
 
412
411
  .chat-in {
412
+ height: calc(65% - 10px);
413
413
  /* max-height: 500px;
414
414
  overflow-y: auto;
415
415
  transition: all 0.5s;
@@ -463,38 +463,48 @@ export default {
463
463
  height: 12px;
464
464
  }
465
465
  .chat-in-cont{
466
- max-height: 300px;
466
+ height: calc(100% - 30px);
467
+ box-sizing: border-box;
467
468
  overflow-y: auto;
468
469
  transition: all 0.5s;
469
470
  margin: 5px;
470
471
  border-radius: 5px;
471
472
  border: 1px solid #CCC;
472
473
  }
474
+ .chat-in-cont::-webkit-scrollbar{
475
+ width: 12px;
476
+ height: 100%;
477
+ border-radius: 0 5px 5px 0;
478
+ }
473
479
 
474
480
  .chat-input {
475
481
  margin: 5px;
476
482
  padding: 10px 10px 3px;
483
+ min-height: 121px;
484
+ height: 35%;
477
485
  border-radius: 5px;
478
486
  border: 1px solid #CCC;
479
487
  overflow: hidden;
480
- background: #fff
488
+ background: #fff;
489
+ box-sizing: border-box;
481
490
  }
482
491
 
483
492
  .chat-text {
484
493
  width: 100%;
485
494
  min-height: 82px;
495
+ height: calc(100% - 24px);
486
496
  background: #fff;
487
497
  box-sizing: border-box;
488
498
  }
489
499
 
490
500
  .chat-text textarea {
491
501
  width: 100%;
492
- height: auto;
502
+ height: 100% !important;
493
503
  font-family: Helvetica, sans-serif;
494
504
  border: none;
495
505
  outline: none;
496
506
  resize: none;
497
- overflow-y: hidden;
507
+ overflow-y: auto;
498
508
  font-size: 14px;
499
509
  }
500
510
  .chat-operate{
@@ -28,7 +28,7 @@ export function butJson(editor, data) {
28
28
  key: 'switchingFormat',
29
29
  menuKeys: [
30
30
  {
31
- name: '自由排版',
31
+ name: '自由版式',
32
32
  key: 'freeTypesetting',
33
33
  menuKeys: [],
34
34
  html: ''
@@ -37,22 +37,22 @@ export function butJson(editor, data) {
37
37
  name: '图书版式',
38
38
  key: 'bookLayout',
39
39
  menuKeys: [],
40
- html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color:#000;line-height: 1;">请在此处输入一级标题</span></strong></p>
40
+ html: `<p data-signid="title-1" class="title bookLayout1" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color:#333333;line-height: 1;">请在此处输入一级标题</span></strong></p>
41
41
  <p data-signid="text" class="text"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
42
- <p data-signid="title-1" style="text-align: center;" class="title ${randomId()}"><strong><span style="font-size: 20px; font-family: SimHei; color:#000">一、请在此处输入一级标题</span></strong></p>
42
+ <p data-signid="title-2" style="text-align: center;" class="title ${randomId()} bookLayout2"><strong><span style="font-size: 20px; font-family: SimHei; color:#000">一、请在此处输入二级标题</span></strong></p>
43
43
  <p data-signid="text" class="text"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
44
- <p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color:#000">(一)请在此处输入二级标题</span></strong></p>
44
+ <p data-signid="title-3" class="title ${randomId()}"><strong><span style="font-size: 16px; font-family: SimHei; color:#000">(一)请在此处输入三级标题</span></strong></p>
45
45
  <p data-signid="text" class="text"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>`
46
46
  },
47
47
  {
48
48
  name: '公文版式',
49
49
  key: 'officialDocumentFormat',
50
50
  menuKeys: [],
51
- html: `<p style="text-align: center"><span style="font-size: 36px; color: rgb(225, 60, 57)">请在此输入红头名称</span></p>
51
+ html: `<p style="text-align: center"><span style="font-size: 48px; color: rgb(225, 60, 57)">请在此输入红头名称</span></p>
52
52
  <p data-signid="red" style="text-align: center"><span style="font-size: 16px; color: rgb(0, 0, 0)">请在此输入文件号xxx[xxx]xxxx号</span></p>
53
53
  <p contenteditable="false" class="solid"></p>
54
54
  <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>
55
- <p data-signid="lookUp"><strong><span style="font-size: 16px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入抬头:</span></strong></p>
55
+ <p data-signid="lookUp"><strong><span style="font-size: 18px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入抬头:</span></strong></p>
56
56
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
57
57
  <p data-signid="title-1" style="text-align: center;" class="title ${randomId()}"><strong><span style="font-size: 18px; font-family: SimHei; color:#333333">一、请在此处输入一级标题</span></strong></p>
58
58
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
@@ -86,7 +86,7 @@ export function butJson(editor, data) {
86
86
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
87
87
  <p data-signid="title-1" style="text-align: center" class="title ${randomId()}"><strong><span style="font-size: 18px; font-family: SimHei; color: #333333">一、请在此处输入一级标题</span></strong></p>
88
88
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
89
- <p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimH ei; color: #333333">(一)请在此处输入二级标题</span></strong></p>
89
+ <p data-signid="title-2" class="title ${randomId()} indent"><strong><span style="font-size: 16px; font-family: SimHei; color: #333333">(一)请在此处输入二级标题</span></strong></p>
90
90
  <p data-signid="text" class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本(复用格式建议直接复制粘贴段落)</span></p>
91
91
  <p data-signid="splitLine" contenteditable="false" class="paging-line">分 页 线(保存文档时线下内容另起一页)</p>
92
92
  <p data-signid="annotation" contenteditable="false" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">注释</span></strong></p>
@@ -135,7 +135,7 @@ export function butJson(editor, data) {
135
135
  name: '抬&nbsp;&nbsp;&nbsp;头',
136
136
  key: 'lookUp',
137
137
  menuKeys: [],
138
- html: `<p data-signId="lookUp"><span style="color: rgb(0, 0, 0);font-size: 16px; font-family:SimHei;font-weight: 700;">请在此处输入抬头:</span><span> </span></p>`
138
+ html: `<p data-signId="lookUp"><span style="color: rgb(0, 0, 0);font-size: 18px; font-family:SimHei;font-weight: 700;">请在此处输入抬头:</span><span> </span></p>`
139
139
  },
140
140
  {
141
141
  name: '摘&nbsp;&nbsp;&nbsp;要',
@@ -231,7 +231,7 @@ export function butJson(editor, data) {
231
231
  name: '红&nbsp;&nbsp;&nbsp;头',
232
232
  key: 'redMenu',
233
233
  menuKeys: [],
234
- html: `<p style="text-align: center"><span style="font-size: 36px; color: rgb(225, 60, 57)">请在此输入红头名称</span></p><p data-signid="red" style="text-align: center"><span style="font-size: 16px; color: rgb(0, 0, 0)">请在此输入文件号xxx[xxx]xxxx号</span></p>`
234
+ html: `<p style="text-align: center"><span style="font-size: 48px; color: rgb(225, 60, 57)">请在此输入红头名称</span></p><p data-signid="red" style="text-align: center"><span style="font-size: 16px; color: rgb(0, 0, 0)">请在此输入文件号xxx[xxx]xxxx号</span></p>`
235
235
  },
236
236
  firstLevelHeading: {
237
237
  name: '一级标题',
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div ref="only" class="z-editor" :style="!readOnly?'border: 1px solid rgba(204, 204, 204, 1);':''">
2
+ <div ref="only" class="z-editor" :style="!readOnly&&showBorder?'border: 1px solid rgba(204, 204, 204, 1);':''">
3
3
  <div v-show="!readOnly" class="editor-header">
4
4
  <div v-for="(item,index) in butData" :key="index" class="editor-but">
5
5
  <div v-if="uploadTypeArr.indexOf(item.key) !== -1" class="editor-but-name">
@@ -72,7 +72,7 @@
72
72
  </div>
73
73
  </div>-->
74
74
  </div>
75
- <zydx-chat v-if="isShowAi" @close='isShowAi = false'></zydx-chat>
75
+ <zydx-chat :isShow='isShowAi' @update:isShow='(val) => isShowAi = val'></zydx-chat>
76
76
  <div :class="{'editor-content-show': !editableShow}" class="editor-content">
77
77
  <div class="editing">
78
78
  <div v-if="signMenuShow" class="editing-header">
@@ -783,10 +783,6 @@ export default {
783
783
  'switchingFormat', 'signMenu', 'pageMargin', 'paragraph',
784
784
  'outlineMenu', 'alignmentMode', 'titleMenu',
785
785
  'textMenu', 'color', 'interposition'],
786
- // toolbar: [
787
- // 'switchingFormat', 'shortcut', 'pageMargin', 'paragraph',
788
- // 'outlineMenu', 'alignmentMode', 'titleMenu',
789
- // 'textMenu', 'color', 'interposition'],
790
786
  bubbleData: {},
791
787
  htmlJson: [],
792
788
  showRetractionPopup: false,
@@ -825,77 +821,6 @@ export default {
825
821
  isShowAi: false,
826
822
  isShowSwitchingFormat: false,
827
823
  templateType: 'freeTypesetting',
828
- switchingFormat: [
829
- {
830
- name: '自由排版',
831
- key: 'freeTypesetting',
832
- menuKeys: [],
833
- html: ''
834
- },
835
- {
836
- name: '公文版式',
837
- key: 'officialDocumentFormat',
838
- menuKeys: [],
839
- html: `<p style="text-align: center"><span style="font-size: 48px; color: rgb(225, 60, 57)">请在此输入红头名称</span></p>
840
- <p data-signid="red" style="text-align: center"><span style="font-size: 16px; color: rgb(0, 0, 0)">请在此输入文件号xxx[xxx]xxxx号</span></p>
841
- <p contenteditable="false" class="solid"></p>
842
- <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>
843
- <p data-signid="lookUp"><strong><span style="font-size: 16px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入抬头:</span></strong></p>
844
- <p class="indent"><span style="font-size: 16px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
845
- <p data-signid="title-1" class="title indent"><strong><span style="font-size: 16px; font-family: SimHei; color: rgb(0, 0, 0)">一、请在此处输入一级标题</span></strong></p>
846
- <p class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
847
- <p data-signid="title-2" class="title indent"><strong><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">(一)请在此处输入二级标题</span></strong></p>
848
- <p class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
849
- <p data-signid="paragraph" style="margin: 30px 0px 0px; text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入落款</span></strong></p>
850
- <p style="text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入日期</span></strong></p>`
851
- },
852
- {
853
- name: '新闻版式',
854
- key: 'newsFormat',
855
- menuKeys: [],
856
- 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>
857
- <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>
858
- <p class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
859
- <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>
860
- <p class="indent "><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
861
- <p data-signid="title-2" class="title indent"><strong><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">(一)请在此处输入二级标题</span></strong></p>
862
- <p class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
863
- <p data-signid="paragraph" style="margin: 30px 0px 0px; text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入落款</span></strong></p>
864
- <p style="text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入日期</span></strong></p>`
865
- },
866
- {
867
- name: '论文版式',
868
- key: 'paperFormat',
869
- menuKeys: [],
870
- 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>
871
- <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>
872
- <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>
873
- <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>
874
- <p></p>
875
- <p class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
876
- <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>
877
- <p class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本</span></p>
878
- <p data-signid="title-2" class="title indent"><strong><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">(一)请在此处输入二级标题</span></strong></p>
879
- <p class="indent"><span style="font-size: 14px; font-family: SimHei; color: rgb(0, 0, 0)">请在此处输入正文文本(复用格式建议直接复制粘贴段落)</span></p>
880
- <p data-signid="splitLine" contenteditable="false" class="paging-line">分 页 线(保存文档时线下内容另起一页)</p>
881
- <p></p>
882
- <p data-signid="annotation" contenteditable="false" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: rgb(0, 0, 0);">注释</span></strong></p>
883
- <p data-signid="author" contenteditable="false" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 14px;font-weight: 700; color: rgba(0, 0, 0, 0.5);">(请在文中标识要注释的内容,此处将生成注释的序号而后需要作者填写注释内容)</span></p>
884
- <p data-signid="a-l" class="text" contenteditable="false"><span style="font-size: 12px; font-family: FangSong;text-indent: 2em;">① 注释:是指解释字句的文字,也指用文字解释字句,可以是文字符号图片等多种形式。(当前文本只是示例展示,不会出现在保存的文本中。)</span></p>
885
- <p data-signid="annotationSplitLine" contenteditable="false" class="paging-line">分 页 线(保存文档时线下内容另起一页)</p>
886
- <p></p>
887
- <p contenteditable="false" data-signId="reference" style="text-align: center;margin-bottom: 30px;"><span font-family: SimHei; style="font-weight: 700;font-size: 24px;">参考文献</span></p>
888
- <p data-signid="author" contenteditable="false" class="author" style="text-align: center;padding-bottom: 30px;"><span style="font-size: 14px;font-weight: 700; color: rgba(0, 0, 0, 0.5);">(请在文中标识要注释的内容,此处将生成注释的序号而后需要作者填写注释内容)</span></p>
889
- <p data-signid="r-l" class="text" contenteditable="false"><span style="font-size: 12px; font-family: FangSong;text-indent: 2em;"> [1] 孙品一.高校学报编辑工作现代化特征[C].中国高等学校自然科学学报研究会.科技编辑学论文集(2).北京:北京师范大学出版社,1998:10-22. (当前文本只是示例展示,不会出现在保存的文本中。)</span></p>
890
- <p data-signid="r-l" class="text" contenteditable="false"><span style="font-size: 12px; font-family: FangSong;text-indent: 2em;"> [2] 张和生.地质力学系统理论[D].太原:太原理工大学,1998. (当前文本只是示例展示,不会出现在保存的文本中。)</span></p>
891
- <p data-signid="referenceSplitLine" contenteditable="false" class="paging-line">分 页 线(保存文档时线下内容另起一页)</p>
892
- <p></p>
893
- <p data-signid="ack" style="text-align: center"><strong><span style="font-size: 16px; color: rgb(0, 0, 0)">致谢</span></strong></p>
894
- <p><span style="font-size: 14px; font-family: KaiTi; color: rgb(0, 0, 0)">致谢内容...</span></p>
895
- <p data-signid="paragraph" style="margin: 30px 0px 0px; text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入落款</span></strong></p>
896
- <p style="text-align: right"><strong><span style="font-size: 14px; color: rgb(0, 0, 0)">请在此处输入日期</span></strong></p>`
897
- }
898
- ],
899
824
  menusText: [
900
825
  {
901
826
  key: 'signMenu',
@@ -917,6 +842,10 @@ export default {
917
842
  type: Boolean,
918
843
  default: false
919
844
  },
845
+ showBorder: {
846
+ type: Boolean,
847
+ default: false
848
+ },
920
849
  butShow: {
921
850
  type: Boolean,
922
851
  default: true
@@ -1544,8 +1473,8 @@ export default {
1544
1473
  const html = htmlFormat.filter(item => item.key === this.templateType)[0].html
1545
1474
  this.editor.chain().setContent(html).run()
1546
1475
  this.toolbar = [
1547
- 'switchingFormat', 'signMenu', 'pageMargin', 'firstLevelHeading',
1548
- 'secondaryHeading', 'paragraphBody', 'paragraphMenu', 'alignmentMode',
1476
+ 'switchingFormat', 'signMenu', 'pageMargin', 'outlineMenu',
1477
+ 'paragraphMenu', 'alignmentMode',
1549
1478
  'titleMenu', 'color', 'interposition']
1550
1479
  this.organizeButton()
1551
1480
  this.interpositionData = []
@@ -1556,8 +1485,8 @@ export default {
1556
1485
  const html = htmlFormat.filter(item => item.key === this.templateType)[0].html
1557
1486
  this.editor.chain().setContent(html).run()
1558
1487
  this.toolbar = [
1559
- 'switchingFormat', 'signMenu', 'pageMargin', 'firstLevelHeading',
1560
- 'secondaryHeading', 'paragraphBody', 'ackMenu', 'paragraphMenu', 'alignmentMode',
1488
+ 'switchingFormat', 'signMenu', 'pageMargin', 'outlineMenu',
1489
+ 'ackMenu', 'paragraphMenu', 'alignmentMode',
1561
1490
  'titleMenu', 'color', 'interposition']
1562
1491
  this.organizeButton()
1563
1492
  this.interpositionData = []
@@ -2947,13 +2876,35 @@ export default {
2947
2876
  this.toolbar.forEach(item => {
2948
2877
  let obj = butJson(this.editor, this.menusText)[item.key === undefined ? item : item.key]
2949
2878
  if (obj) {
2950
- if (this.templateType === 'bookLayout' && obj.key === 'outlineMenu') {
2951
- obj.menuKeys = [
2952
- {name: '一级标题', key: 'title-1'},
2953
- {name: '二级标题', key: 'title-2'},
2954
- {name: '三级标题', key: 'title-3'},
2955
- // {name: '四级标题', key: 'title-4'},
2956
- {name: '正文文本', key: 'text'},]
2879
+ if (obj.key === 'outlineMenu') {
2880
+ if(this.templateType === 'bookLayout'||this.templateType === 'freeTypesetting'){
2881
+ obj.menuKeys = [
2882
+ {name: '一级标题', key: 'title-1'},
2883
+ {name: '二级标题', key: 'title-2'},
2884
+ {name: '三级标题', key: 'title-3'},
2885
+ // {name: '四级标题', key: 'title-4'},
2886
+ {name: '正文文本', key: 'text'},]
2887
+ }
2888
+ if(this.templateType === 'newsFormat'||this.templateType === 'paperFormat'){
2889
+ obj.menuKeys = [
2890
+ {
2891
+ name: '文章标题',
2892
+ key: 'subjectMenu',
2893
+ menuKeys: [],
2894
+ html: `<p data-signid="subject" style="text-align: center;"><strong><span style="font-size: 24px; font-family: SimHei; color: #333333;">请在此处输入标题</span></strong></p>`
2895
+ },
2896
+ {
2897
+ name: '作者',
2898
+ key: 'authorMenu',
2899
+ menuKeys: [],
2900
+ html: `<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>`
2901
+ },
2902
+ {name: '一级标题', key: 'title-1'},
2903
+ {name: '二级标题', key: 'title-2'},
2904
+ // {name: '三级标题', key: 'title-3'},
2905
+ // {name: '四级标题', key: 'title-4'},
2906
+ {name: '正文文本', key: 'text'},]
2907
+ }
2957
2908
  this.butData.push(obj)
2958
2909
  return
2959
2910
  }
@@ -3351,6 +3302,28 @@ export default {
3351
3302
  // 大纲级别
3352
3303
  if (data.key === 'outlineMenu') {
3353
3304
  const menusHtml = butJson(this.editor, this.menusText)[data.key].menuKeys
3305
+ if (this.templateType === 'newsFormat'||this.templateType === 'paperFormat'){
3306
+ const level = key.key.split('-')[1]
3307
+ // 一级标题
3308
+ if (level === '1') {
3309
+ const html = butJson(this.editor, this.menusText)['firstLevelHeading'].html
3310
+ this.editor.chain().focus().insertContentAt(this.selection(), html).run()
3311
+ this.$emit('changeOutlineMenu', this.changeOutlineMenu())
3312
+ }
3313
+ // 二级标题
3314
+ if (level === '2') {
3315
+ const html = butJson(this.editor, this.menusText)['secondaryHeading'].html
3316
+ this.editor.chain().focus().insertContentAt(this.selection(), html).run()
3317
+ this.$emit('changeOutlineMenu', this.changeOutlineMenu())
3318
+ }
3319
+ // 正文
3320
+ if (key.key === 'text') {
3321
+ const html = butJson(this.editor, this.menusText)['paragraphBody'].html
3322
+ this.editor.chain().focus().insertContentAt(this.selection(), html).run()
3323
+ }
3324
+ return
3325
+ }
3326
+
3354
3327
  // 题目
3355
3328
  if (key.key === 'subjectMenu') {
3356
3329
  const html = menusHtml.filter(item => item.key == key.key)[0].html
@@ -3381,39 +3354,81 @@ export default {
3381
3354
  if (r === -1) this.editor.chain().focus().insertContentAt(this.selectionPath('subject'), html).run()
3382
3355
  return
3383
3356
  }
3357
+ let sizeObj1 = {
3358
+ freeTypesetting:{size:'18px',color:'#000000',margin:'0 0 20px 0',textAlign:'left',bold:true},
3359
+ bookLayout:{size:'24px',color:'#333333',margin:'0 0 40px 0',textAlign:'center',bold:true},
3360
+ paperFormat:{size:'20px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
3361
+ officialDocumentFormat:{size:'18px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
3362
+ newsFormat:{size:'18px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
3363
+ }
3364
+ let sizeObj2 = {
3365
+ freeTypesetting:{size:'16px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
3366
+ bookLayout:{size:'20px',color:'#000000',margin:'0 0 20px 0',textAlign:'center',bold:true},
3367
+ paperFormat:{size:'18px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
3368
+ officialDocumentFormat:{size:'16px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
3369
+ newsFormat:{size:'16px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
3370
+ }
3371
+ let sizeObj3 = {
3372
+ freeTypesetting:{size:'14px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
3373
+ bookLayout:{size:'16px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
3374
+ paperFormat:{size:'16px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
3375
+ officialDocumentFormat:{size:'14px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
3376
+ newsFormat:{size:'14px',color:'#000000',margin:'0px',textAlign:'left',bold:true},
3377
+ }
3384
3378
  if (key.key === 'text') {
3379
+ this.tipTitle = window.getSelection().toString()
3380
+ if (this.tipTitle.length === 0) {
3381
+ await Message({type: 'text', promptContent: '请选中需要修改为正文的文字'})
3382
+ return
3383
+ }
3385
3384
  this.editor.commands.setNode('paragraph', {class: 'indent'})
3386
3385
  this.editor.commands.setTitleId(key.key)
3387
3386
  this.editor.commands.unsetSignId()
3388
3387
  this.editor.chain().unsetBold().setFontSize('14px').setColor('#000000').setTextAlign('left').focus().run()
3389
3388
  } else {
3389
+ this.tipTitle = window.getSelection().toString()
3390
+ if (this.tipTitle.length === 0) {
3391
+ await Message({type: 'text', promptContent: '请选中需要修改为标题的文字'})
3392
+ return
3393
+ }
3390
3394
  const t = key.key.split('-')[0]
3391
3395
  const level = key.key.split('-')[1]
3392
- let size = this.templateType === 'bookLayout' ? '24px' : '18px'
3393
- let color = this.templateType === 'bookLayout' ? '#000000' : '#333333'
3394
3396
  if (level === '1') {
3395
- this.editor.commands.setNode('paragraph', {class: ''})
3397
+ // this.editor.commands.setNode('paragraph', {class:''})
3398
+ // this.editor.commands.setTitleId(``)
3399
+ let obj1 = sizeObj1[this.templateType]
3396
3400
  this.editor.commands.setTitleId(`${t} ${this.randomId()}`)
3397
3401
  this.editor.commands.setSignId(key.key)
3398
- this.editor.chain().setBold().setFontSize(size).setColor(color).setTextAlign('center').focus().run()
3402
+ if(this.templateType==='bookLayout'){
3403
+ this.editor.commands.setTitleId(`${t} ${this.randomId()} bookLayout1`)
3404
+ this.editor.chain().setBold().setFontSize(obj1.size).setColor(obj1.color).setTextAlign(obj1.textAlign).focus().run()
3405
+ return
3406
+ }
3407
+ if (obj1.margin==='0px'){
3408
+ this.editor.chain().setBold().setFontSize(obj1.size).setColor(obj1.color).setTextAlign(obj1.textAlign).focus().run()
3409
+ return
3410
+ }
3411
+ this.editor.chain().setBold().setFontSize(obj1.size).setColor(obj1.color).setTextAlign(obj1.textAlign).setMargin(obj1.margin).focus().run()
3399
3412
  } else if (level === '2') {
3400
- size = this.templateType === 'bookLayout' ? '20px' : '16px'
3401
- color = this.templateType === 'bookLayout' ? '#000000' : '#333333'
3402
- let align = this.templateType === 'bookLayout' ? 'center' : 'left'
3413
+ this.editor.commands.setNode('paragraph', {class: ''})
3414
+ let obj2 = sizeObj2[this.templateType]
3403
3415
  this.editor.commands.setSignId(key.key)
3404
3416
  if (this.templateType === 'bookLayout') {
3405
- this.editor.commands.setNode('paragraph', {class: ''})
3406
- this.editor.commands.setTitleId(`${t} ${this.randomId()}`)
3417
+ this.editor.commands.setTitleId(`${t} ${this.randomId()} bookLayout2`)
3407
3418
  } else {
3408
- this.editor.commands.setTitleId(`${t} ${this.randomId()} indent`)
3419
+ this.editor.commands.setTitleId(`${t} ${this.randomId()}`)
3409
3420
  }
3410
- this.editor.chain().setBold().setFontSize(size).setColor(color).setTextAlign(align).focus().run()
3421
+ this.editor.chain().setBold().setFontSize(obj2.size).setColor(obj2.color).setTextAlign(obj2.textAlign).focus().run()
3411
3422
  } else {
3412
- size = this.templateType === 'bookLayout' ? '16px' : '14px'
3413
- color = this.templateType === 'bookLayout' ? '#000000' : '#333333'
3423
+ this.editor.commands.setNode('paragraph', {class: ''})
3424
+ let obj3 = sizeObj3[this.templateType]
3414
3425
  this.editor.commands.setSignId(key.key)
3415
- this.editor.commands.setTitleId(`${t} ${this.randomId()} indent`)
3416
- this.editor.chain().setBold().setFontSize(size).setColor(color).setTextAlign('left').focus().run()
3426
+ if (this.templateType === 'bookLayout') {
3427
+ this.editor.commands.setTitleId(`${t} ${this.randomId()} bookLayout3`)
3428
+ } else {
3429
+ this.editor.commands.setTitleId(`${t} ${this.randomId()}`)
3430
+ }
3431
+ this.editor.chain().setBold().setFontSize(obj3.size).setColor(obj3.color).setTextAlign(obj3.textAlign).focus().run()
3417
3432
  }
3418
3433
  }
3419
3434
  this.$emit('changeOutlineMenu', this.changeOutlineMenu())
@@ -4329,7 +4344,7 @@ export default {
4329
4344
  }
4330
4345
 
4331
4346
  :deep(p[data-signid="subject"]) {
4332
- padding-bottom: 5px;
4347
+ padding-bottom: 2px;
4333
4348
  }
4334
4349
 
4335
4350
  :deep(.author) {
@@ -4342,8 +4357,8 @@ export default {
4342
4357
 
4343
4358
  :deep(.title) {
4344
4359
  /*padding: 10px 0 2px 0;*/
4345
- /*font-weight: 900;*/
4346
- color: #333333 !important;
4360
+ font-weight: 900;
4361
+ /*color: #333333 !important;*/
4347
4362
  }
4348
4363
 
4349
4364
  .read-only-a {
@@ -4559,6 +4574,7 @@ li {
4559
4574
  margin: 10px;
4560
4575
  max-height: 900px;
4561
4576
  overflow: auto;
4577
+ border: 1px solid #ccc;
4562
4578
  }
4563
4579
 
4564
4580
  .editor-content::-webkit-scrollbar {
@@ -4591,7 +4607,7 @@ li {
4591
4607
  position: relative;
4592
4608
  display: flex;
4593
4609
  align-items: center;
4594
- border: 1px solid #CCCCCC;
4610
+ /*border: 1px solid #CCCCCC;*/
4595
4611
  }
4596
4612
 
4597
4613
  .editing-cont {
@@ -5146,4 +5162,34 @@ li {
5146
5162
  :deep(.drag-down2){
5147
5163
  height: 20px;
5148
5164
  }
5165
+ :deep(.bookLayout1){
5166
+ margin-bottom: 40px;
5167
+ font-size: 24px !important;
5168
+ color: #333333 !important;
5169
+ font-weight: bold;
5170
+ font-family: SimHei;
5171
+ }
5172
+ :deep(.bookLayout2){
5173
+ margin-bottom: 20px;
5174
+ font-weight: bold;
5175
+ font-size: 20px !important;
5176
+ font-family: SimHei;
5177
+ }
5178
+ :deep(.bookLayout3){
5179
+ font-weight: bold;
5180
+ font-size: 16px !important;
5181
+ font-family: SimHei;
5182
+ }
5183
+ :deep(.title[data-signid="title-1"]){
5184
+ font-size: 18px;
5185
+ color: #000000;
5186
+ }
5187
+ :deep(.title[data-signid="title-2"]){
5188
+ font-size: 16px;
5189
+ color: #000000;
5190
+ }
5191
+ :deep(.title[data-signid="title-3"]){
5192
+ font-size: 14px;
5193
+ color: #000000;
5194
+ }
5149
5195
  </style>
@@ -22,7 +22,7 @@
22
22
  <button v-if='isShowAiTool' class="buts" @click="showAi">AI助手</button>
23
23
  </div>
24
24
  </div>
25
- <zydx-chat v-if="isShowAi" @close='isShowAi = false'></zydx-chat>
25
+ <zydx-chat :isShow='isShowAi' @update:isShow='(val) => isShowAi = val'></zydx-chat>
26
26
  <div class="ed-cont" :style="heightStyleCont">
27
27
  <div :style="{'border': (borderShow)? '1px solid #ccc': '0'}" v-if="editorShow">
28
28
  <editor-content @paste.native.capture.prevent="preventPaste" ref="editorRef" class="editor" :editor="editor"
@@ -18,7 +18,8 @@ const Modal = () => {
18
18
  instance = VNode
19
19
  }
20
20
  return {
21
- open: function () {
21
+ open: function (hasPrompt) {
22
+ VNode = createVNode(spinner, {hasPrompt})
22
23
  render(VNode, container)
23
24
  },
24
25
  close: () => destory()
@@ -13,6 +13,7 @@
13
13
  <div></div>
14
14
  <div></div>
15
15
  </div>
16
+ <div v-if="hasPrompt" class="prompt-text">文件上传中,请稍候...</div>
16
17
  </div>
17
18
  </div>
18
19
  </transition>
@@ -23,6 +24,12 @@
23
24
  import { defineComponent } from 'vue';
24
25
  export default defineComponent({
25
26
  name: 'zydx-spinner',
27
+ props: {
28
+ hasPrompt: {
29
+ type: Boolean,
30
+ default: false
31
+ }
32
+ },
26
33
  mounted() {
27
34
  document.querySelector('body').style.overflow = 'hidden'
28
35
  },
@@ -56,12 +63,14 @@ export default defineComponent({
56
63
  border: none;
57
64
  padding: 0;
58
65
  margin: 0;
66
+ pointer-events: none;
59
67
  }
60
68
 
61
69
  .spinner_wrapper {
62
70
  width: 100%;
63
71
  height: 100%;
64
72
  display: flex;
73
+ flex-direction: column;
65
74
  align-items: center;
66
75
  justify-content: center;
67
76
  }
@@ -170,4 +179,9 @@ export default defineComponent({
170
179
  transform: rotate(360deg);
171
180
  }
172
181
  }
182
+ .prompt-text {
183
+ color: rgba(166, 166, 166, 1);
184
+ font-size: 14px;
185
+ margin-top: 15px;
186
+ }
173
187
  </style>
@@ -88,12 +88,18 @@
88
88
  <div class="cal" v-if="item.type === 'calender'">
89
89
  <input type="text" :placeholder="item.placeholder" @focus="focus" :maxlength="item.maxlength"
90
90
  v-model="item.value" :disabled="item.disabled"/>
91
- <Calendar v-if="tip" style="top: 35px;" @confirm="confirm($event,item)"></Calendar>
91
+ <div class="dateEmpty" @click="emptyCal($event,item)">
92
+ <svg t="1747276919145" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4844" width="15" height="15"><path d="M511.333 127.333c51.868 0 102.15 10.144 149.451 30.15 45.719 19.337 86.792 47.034 122.078 82.321 35.287 35.286 62.983 76.359 82.321 122.078 20.006 47.3 30.15 97.583 30.15 149.451s-10.144 102.15-30.15 149.451c-19.337 45.719-47.034 86.792-82.321 122.078-35.286 35.287-76.359 62.983-122.078 82.321-47.3 20.006-97.583 30.15-149.451 30.15s-102.15-10.144-149.451-30.15c-45.719-19.337-86.792-47.034-122.078-82.321-35.287-35.286-62.983-76.359-82.321-122.078-20.006-47.3-30.15-97.583-30.15-149.451s10.144-102.15 30.15-149.451c19.337-45.719 47.034-86.792 82.321-122.078 35.286-35.287 76.359-62.983 122.078-82.321 47.301-20.006 97.583-30.15 149.451-30.15m0-64c-247.424 0-448 200.576-448 448s200.576 448 448 448 448-200.576 448-448-200.576-448-448-448z" fill="#999999" p-id="4845"></path><path d="M557.254 512l147.373-147.373c12.497-12.497 12.497-32.758 0-45.255-12.496-12.497-32.758-12.497-45.254 0L512 466.746 364.627 319.373c-12.497-12.497-32.758-12.497-45.255 0s-12.497 32.758 0 45.255L466.746 512 319.373 659.373c-12.497 12.496-12.497 32.758 0 45.254C325.621 710.876 333.811 714 342 714s16.379-3.124 22.627-9.373L512 557.254l147.373 147.373C665.621 710.876 673.811 714 682 714s16.379-3.124 22.627-9.373c12.497-12.496 12.497-32.758 0-45.254L557.254 512z" fill="#999999" p-id="4846"></path></svg>
93
+ </div>
94
+ <Calendar v-if="tip" style="top: 35px;" @cancel="cancelCal" @confirm="confirm($event,item)"></Calendar>
92
95
  </div>
93
96
  <div class="cal" v-if="item.type === 'calenderYear'">
94
97
  <input type="text" :placeholder="item.placeholder" @focus="focusYear" :maxlength="item.maxlength"
95
98
  v-model="item.value" :disabled="item.disabled"/>
96
- <Year v-if="tipYear" style="top: 35px;" @confirm="confirmYear($event,item)"></Year>
99
+ <div class="empty" @click="emptyYear($event,item)">
100
+ <svg t="1747276919145" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4844" width="15" height="15"><path d="M511.333 127.333c51.868 0 102.15 10.144 149.451 30.15 45.719 19.337 86.792 47.034 122.078 82.321 35.287 35.286 62.983 76.359 82.321 122.078 20.006 47.3 30.15 97.583 30.15 149.451s-10.144 102.15-30.15 149.451c-19.337 45.719-47.034 86.792-82.321 122.078-35.286 35.287-76.359 62.983-122.078 82.321-47.3 20.006-97.583 30.15-149.451 30.15s-102.15-10.144-149.451-30.15c-45.719-19.337-86.792-47.034-122.078-82.321-35.287-35.286-62.983-76.359-82.321-122.078-20.006-47.3-30.15-97.583-30.15-149.451s10.144-102.15 30.15-149.451c19.337-45.719 47.034-86.792 82.321-122.078 35.286-35.287 76.359-62.983 122.078-82.321 47.301-20.006 97.583-30.15 149.451-30.15m0-64c-247.424 0-448 200.576-448 448s200.576 448 448 448 448-200.576 448-448-200.576-448-448-448z" fill="#999999" p-id="4845"></path><path d="M557.254 512l147.373-147.373c12.497-12.497 12.497-32.758 0-45.255-12.496-12.497-32.758-12.497-45.254 0L512 466.746 364.627 319.373c-12.497-12.497-32.758-12.497-45.255 0s-12.497 32.758 0 45.255L466.746 512 319.373 659.373c-12.497 12.496-12.497 32.758 0 45.254C325.621 710.876 333.811 714 342 714s16.379-3.124 22.627-9.373L512 557.254l147.373 147.373C665.621 710.876 673.811 714 682 714s16.379-3.124 22.627-9.373c12.497-12.496 12.497-32.758 0-45.254L557.254 512z" fill="#999999" p-id="4846"></path></svg>
101
+ </div>
102
+ <Year v-if="tipYear" style="top: 35px;" @cancel="cancelYear" @confirm="confirmYear($event,item)"></Year>
97
103
  </div>
98
104
  <div v-if="item.type === 'text'" class="text" v-html="item.value"></div>
99
105
  <div v-if="item.type === 'code'" class="ph-code">
@@ -335,18 +341,44 @@ export default {
335
341
  data.value = e
336
342
  this.tipYear = false
337
343
  },
344
+ cancelYear() {
345
+ this.tipYear = false
346
+ },
338
347
  focus() {
339
348
  this.tip = true
340
349
  },
341
350
  confirm(e, data) {
342
351
  data.value = e.start
343
352
  this.tip = false
344
- }
353
+ },
354
+ emptyCal(e,data) {
355
+ data.value = ''
356
+ this.tip = true
357
+ this.tip = false
358
+ },
359
+ emptyYear(e,data) {
360
+ data.value = ''
361
+ this.tip = true
362
+ this.tip = false
363
+ },
364
+ cancelCal() {
365
+ this.tip = false
366
+ },
345
367
  }
346
368
  }
347
369
  </script>
348
370
 
349
371
  <style scoped>
372
+ .cal{
373
+ position: relative;
374
+ }
375
+ .dateEmpty{
376
+ position: absolute;
377
+ top: 8px;
378
+ right: 5px;
379
+ z-index: 1;
380
+ cursor: pointer;
381
+ }
350
382
  :deep(.text) {
351
383
  padding:0 10px;
352
384
  }
package/src/index.js CHANGED
@@ -89,7 +89,7 @@ function install(app) {
89
89
  }
90
90
 
91
91
  export default {
92
- version: '1.35.523',
92
+ version: '1.35.525',
93
93
  install,
94
94
  Calendar,
95
95
  Message,