askbot-dragon 88.1.4 → 88.1.6

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": "askbot-dragon",
3
- "version": "88.1.4",
3
+ "version": "88.1.6",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -215,7 +215,7 @@ export default {
215
215
  answerDocknowledge: {"actionCategory":null,"apiKey":null,"content":{"searchResult":null,"images":null,"llmBotPluginId":null,"srcContentId":null,"list":[{"owner":"15901107866","tagId":"67492d69c3fc616496d7708e","enterprise":null,"tagIds":["67492d69c3fc616496d7708e","67492d69c3fc616496d7708d"],"format":"pdf","srcContentId":"8ae8631d27d5fc9e0d6429c32ce02463","updateTime":"2024-11-29 10:56:41","avatar":"https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/ab0f90737c8b4f2d85ba2157e4473110/2024/10/22/15/29/2d00b3ee264f6b588bc39c87cd71ff86/zrx651dojth.jpeg","source":"LOCAL_FILE","srcContent":"\"\",,,,,,,,,,,,,,,, \"\",境内出差标准(人民币),,,,,,,,,,,,,,, \"\",,,,,,,,,,,,,,,, \"\",,职称,,住宿标准,,出差补贴,,,,,,,,,, \"\",,,,,,,,,,,出差补贴,,,,, \"\",,,(实报实销),,,,,,,,,,,,, \"\",职级,职称,,,,,,,,,,,,,, \"\",,甲类地,,,乙类地,,,丙类地,,,甲类,,,乙丙类,, \"\",,,,,,,,,,,,,,,, \"\",,,区,区,区,地区,地区,,,,,,,,, \"\",24-20,\"总裁/高级副总裁/副总裁/总经理/首 席技术专家/首席幕僚长/总裁资深特 别助理/总监/副总经理/资深技术专家 /专业总监\",无固定限额,无,,,,,,,,,,,, \"\",19-18,\"副总监/资深研究员/专业副总监/高级 经理/高级研究员/专业高级经理\",700,600,500,100/天,80/天,,,,,,,,, \"\",17,\"经理/副经理/专业经理/资深专员/研 究员/资深化学师/资深工程师/经理级 销售/资深销售\",500,400,350,,,,,,,,,,, \"\",16,\"高级主任/高级专员/高级销售/高级工 程师/主任/专员/销售专员/工程师\",400,300,250,,,,,,,,,,, \"\",15 以下,\"初级专员/初级销售专员/助理工程师/ 文员\",300,250,200,,,,,,,,,,, ","url":"https://guoranwisdom.oss-cn-zhangjiakou.aliyuncs.com/ab0f90737c8b4f2d85ba2157e4473110/2024/11/29/10/56/bb94d33df583b246fd77034eaafe52cd/753yywz8dh.pdf","knowledgeId":"67492d62ff865b253159dd5d","folderUrl":null,"reRankShowScore":"69.53","knowledgePartId":"6MnZdZMB5ZPhLd1ZZb9J","from":"立邦中国差旅管理办法2023.pdf","folderName":null,"introduction":"\"\",,,,,,,,,,,,,,,, \"\",境内出差标准(人民币),,,,,,,,,,,,,,, \"\",,,,,,,,,,,,,,,, \"\",,职称,,住宿标准,,出差补贴,,,,,,,,,, \"\",,,,,,,,,,,出差补贴,,,,, \"\",,,(实报实销),,,,,,,,,,,,, \"\",职级,职称,,,,,,,,,,,,,, \"\",,甲类地,,,乙类地,,,丙类地,,,甲类,,,乙丙类,, \"\",,,,,,,,,,,,,,,, \"\",,,区,区,区,地区,地区,,,,,,,,, \"\",24-20,\"总裁/高级副总裁/副总裁/总经理/首 席技术专家/首席幕僚长/总裁资深特 别助理/总监/副总经理/资深技术专家 /专业总监\",无固定限额,无,,,,,,,,,,,, \"\",19-18,\"副总监/资深研究员/专业副总监/高级 经理/高级研究员/专业高级经理\",700,600,500,100/天,80/天,,,,,,,,, \"\",17,\"经理/副经理/专业经理/资深专员/研 究员/资深化学师/资深工程师/经理级 销售/资深销售\",500,400,350,,,,,,,,,,, \"\",16,\"高级主任/高级专员/高级销售/高级工 程师/主任/专员/销售专员/工程师\",400,300,250,,,,,,,,,,, \"\",15 以下,\"初级专员/初级销售专员/助理工程师/ 文员\",300,250,200,,,,,,,,,,, ","previewImage":null}],"type":0,"srcContent":null,"whetherRequestStream":null,"knowledgeId":null,"actionType":"answer_doc_knowledge","async":null,"stream":null,"knowledgePartId":null,"recommendItems":["离境出差的标准是什么?","出差审批流程是怎样的?","差旅费报销标准有哪些?"],"text":"### 境内出差标准\n\n| 职级 | 职称 | 甲类地住宿标准 | 乙类地住宿标准 | 丙类地住宿标准 | 出差补贴 |\n| --- | --- | --- | --- | --- | --- |\n| 24-20 | 总裁/高级副总裁/副总裁/总经理/首席技术专家/首席幕僚长/总裁资深特别助理/总监/副总经理/资深技术专家/专业总监 | 无固定限额 | 无固定限额 | 无固定限额 | 无 |\n| 19-18 | 副总监/资深研究员/专业副总监/高级经理/高级研究员/专业高级经理 | 700 | 600 | 500 | 100/天 |\n| 17 | 经理/副经理/专业经理/资深专员/研究员/资深化学师/资深工程师/经理级销售/资深销售 | 500 | 400 | 350 | 无 |\n| 16 | 高级主任/高级专员/高级销售/高级工程师/主任/专员/销售专员/工程师 | 400 | 300 | 250 | 无 |\n| 15 以下 | 初级专员/初级销售专员/助理工程师/文员 | 300 | 250 | 200 | 无 |\n\n**备注**:\n- 甲类地区:指北京、上海、广州、深圳。\n- 乙类地区:地级以上城市。\n- 丙类地区:指甲、乙类地区以外的地区。","renderType":2,"streamRequestUrl":null},"id":null,"intentId":null,"msgId":"67492de6524fbe07a2190b90","nodeId":null,"recordId":24190,"type":"answer_doc_knowledge"},
216
216
  answerDocknowledge4: {
217
217
  "content":{"images":[
218
- {"url":"https://guoranwisdom.oss-cn-zhangjiakou.aliyuncs.com/ab0f90737c8b4f2d85ba2157e4473110/2024/12/25/12/38/58/676b8b26643e014bc160fb76/image1.jpeg"},
218
+ {"url":"https://guoranwisdom.oss-cn-zhangjiakou.aliyuncs.com/ab0f90737c8b4f2d85ba2157e4473110/2024/12/25/12/38/58/676b8b26643e014bc160fb76/image1.jpeg"},
219
219
  {"url":"https://itsm.mengniu.cn/o/bk_itsm/api/misc/download_rich_file/?file_path=/data/app/code/USERRES/richText/56389331cd62b3c1a47e22d499cd565e"},
220
220
  {"url":"https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/front-oss/31623ccfe9dd4957bbd59c5823878bbe/2025/01/07/17/39/3fccf81e21cbcfaf7c0e1a69a848b5c0/1eeb31f8-1d9b-4d70-8cfd-4750f48c95ee.png"},
221
221
  {"url":"https://guoranwisdom.oss-cn-zhangjiakou.aliyuncs.com/ab0f90737c8b4f2d85ba2157e4473110/2024/12/25/12/38/58/676b8b26643e014bc160fb76/image1.jpeg"},
@@ -2,7 +2,8 @@
2
2
  <div
3
3
  v-loading="loading"
4
4
  :element-loading-text="showProgress"
5
- id="dragon-video"
5
+ class="dragon-video"
6
+ :id="'dragon-video' + msg.msgId"
6
7
  >
7
8
  <!-- <video-player
8
9
  class="video-player vjs-custom-skin"
@@ -12,16 +13,19 @@
12
13
  /> -->
13
14
  <video
14
15
  controls="controls"
15
- :controlslist="nodownload&&'nodownload'"
16
+ :controlslist="controlAttributes"
16
17
  :raw-controls="true"
17
18
  x5-video-player-type="h5-page"
18
19
  style="object-fit: contain;width: calc(100vw - 139px);height: 160px;background-color: black;border-radius: 10px;max-width: 230px;padding-left: 10px"
19
20
  preload
20
21
  :poster="videoSrc+'?spm=qipa250&x-oss-process=video/snapshot,t_1000,f_jpg,w_0,h_0,m_fast'"
21
22
  class="video-player vjs-custom-skin"
22
- :id="msg.id+'key'">
23
+ :id="msg.msgId+'key'">
23
24
  <source :src="videoSrc"/>
24
25
  </video>
26
+ <div v-if="isFullscreen" class="close-fullscreen" @click="closeFullScreen">
27
+ <i class="iconfont guoran-tongyichicun-guanbi2"></i>
28
+ </div>
25
29
  <div id="output"></div>
26
30
  </div>
27
31
  </template>
@@ -34,7 +38,9 @@
34
38
  data() {
35
39
  return {
36
40
  videoSrc:'',
37
- poster:''
41
+ poster:'',
42
+ isFullscreen:false,
43
+ isAndroid:false
38
44
  }
39
45
  },
40
46
  watch: {
@@ -48,6 +54,13 @@
48
54
  },
49
55
  src() {
50
56
  return this.url ? this.url : this.localUrl;
57
+ },
58
+ controlAttributes(){
59
+ /* 安卓手机自定义了全屏样式,所以禁掉原生的全屏 */
60
+ const attributes = []
61
+ if (this.isAndroid) attributes.push('nofullscreen')
62
+ if (this.nodownload&&'nodownload') attributes.push('nodownload')
63
+ return attributes.join(' ')
51
64
  }
52
65
  },
53
66
  mounted() {
@@ -58,6 +71,29 @@
58
71
  console.debug('newVideoSrc',this.videoSrc,videoSrc)
59
72
  this.poster = this.videoSrc+'?spm=qipa250&x-oss-process=video/snapshot,t_1000,f_jpg,w_0,h_0,m_fast'
60
73
  console.debug('poster',this.poster)
74
+ /* 安卓手机播放视频默认全屏设置 ios默认就是全屏 */
75
+ let id = this.msg.msgId + 'key'
76
+ const video = document.getElementById(id);
77
+ let containerId = 'dragon-video' + this.msg.msgId
78
+ const videoContainer = document.getElementById(containerId);
79
+ // 仅在 Android 设备尝试自动全屏
80
+ const isAndroid = /Android/i.test(navigator.userAgent);
81
+ this.isAndroid = isAndroid;
82
+ if (isAndroid){
83
+ video.addEventListener('play', () => {
84
+ // 仅在全屏请求由用户触发时有效(如点击播放按钮后)
85
+ videoContainer.classList.add('force-fullscreen'); // 降级方案
86
+ this.isFullscreen = true;
87
+ });
88
+ // 点击关闭按钮或按 ESC 退出
89
+ document.addEventListener('fullscreenchange', () => {
90
+ if (!document.fullscreenElement) {
91
+ videoContainer.classList.remove('force-fullscreen');
92
+ this.isFullscreen = false;
93
+ }
94
+ });
95
+ }
96
+
61
97
  })
62
98
 
63
99
  },
@@ -117,6 +153,12 @@
117
153
  return new File([u8arr], filename, {type:mime});
118
154
  //转换成成blob对象
119
155
  /*return new Blob([u8arr],{type:'image/png'});*/
156
+ },
157
+ closeFullScreen(){
158
+ this.isFullscreen = false;
159
+ let containerId = 'dragon-video' + this.msg.msgId
160
+ const videoContainer = document.getElementById(containerId);
161
+ videoContainer.classList.remove('force-fullscreen');
120
162
  }
121
163
  }
122
164
 
@@ -124,8 +166,10 @@
124
166
  </script>
125
167
  <style scoped lang="less">
126
168
  video::-webkit-media-controls-mute-button { display: none !important;}
127
- #dragon-video{
169
+ .dragon-video{
128
170
  position: relative;
171
+ width: calc(100vw - 109px);
172
+ max-width: 260px;
129
173
  #outputVideo{
130
174
  position: absolute;
131
175
  top: 0px;
@@ -138,5 +182,34 @@ video::-webkit-media-controls-mute-button { display: none !important;}
138
182
 
139
183
  }
140
184
  }
185
+ /* 强制竖屏全屏样式 */
186
+ .force-fullscreen {
187
+ position: fixed !important;
188
+ top: 0 !important;
189
+ left: 0 !important;
190
+ width: 100vw !important;
191
+ height: 100vh !important;
192
+ object-fit: contain !important;
193
+ background: black !important;
194
+ z-index: 9999 !important;
195
+ max-width: 100vw!important;
196
+ display: flex;
197
+ align-items: center;
198
+ justify-content: center;
199
+ video{
200
+ max-width: 100% !important;
201
+ width: 100% !important;
202
+ height: 100% !important;
203
+ }
204
+ .close-fullscreen{
205
+ position: absolute;
206
+ top: 10px;
207
+ right: 10px;
208
+ i{
209
+ color: #ffffff;
210
+ font-size: 20px;
211
+ }
212
+ }
213
+ }
141
214
 
142
215
  </style>
@@ -254,20 +254,33 @@
254
254
  var reg = /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\*\+,;=.]+$/;
255
255
  /* eslint-enable*/
256
256
  if (e.target.localName == 'a'){
257
- console.log(252);
258
- this.previewHref = e.target.href;
259
- console.log(254, this.previewHref);
260
- if (this.previewHref.includes('https://www') || this.previewHref.includes('http://www') || (this.previewHref.indexOf('https://static.guoranbot.com') == -1 && this.previewHref.indexOf('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com'))){
261
- return
262
- } else {
263
- if (isMobile()){
264
- this.previewShowPopup = true
265
- e.returnValue = false
257
+ console.log(252);
258
+ this.previewHref = e.target.href;
259
+ console.log(254, this.previewHref);
260
+ if (this.previewHref.includes('https://www') || this.previewHref.includes('http://www') || (!this.previewHref.includes('https://static.guoranbot.com') && this.previewHref.includes('https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com'))){
261
+ return
262
+ } else if(this.previewHref.includes('/pages/opportunity/index') ||
263
+ this.previewHref.includes('/pages/webViewTransit/index')
264
+ ) {
265
+ uni && uni.postMessage({
266
+ data: {
267
+ path: this.previewHref,
268
+ }
269
+ })
270
+ // 很不理解为什么要这样做
271
+ setTimeout(()=> {
272
+ uni && uni.navigateBack()
273
+ }, 100)
274
+ e.returnValue = false
266
275
  } else {
267
- this.drawer = true;
268
- e.returnValue = false
276
+ if (isMobile()){
277
+ this.previewShowPopup = true
278
+ e.returnValue = false
279
+ } else {
280
+ this.drawer = true;
281
+ e.returnValue = false
282
+ }
269
283
  }
270
- }
271
284
  // let url = ''
272
285
  // try {
273
286
  // url = btoa(e.target.href)
@@ -0,0 +1,201 @@
1
+ <template>
2
+ <div class="imageSelectionAnswer">
3
+ <div class="imageSelectionText" v-if="msg.content.prompt">
4
+ {{msg.content.prompt}}
5
+ </div>
6
+ <div class="imageList">
7
+ <div class="imageItem"
8
+ v-for="(item,index) in msg.content.options"
9
+ :key="index"
10
+ :class="disabled || isDisabled ? 'disabledItem' : ''"
11
+ >
12
+ <el-image
13
+ style="width: 120px!important; height: 120px!important;"
14
+ :src="item.url"
15
+ @click="onImageClick(item.url)"
16
+ fit="cover">
17
+ <template #placeholder>
18
+ <div class="custom-loading">
19
+ <i class="el-icon-loading"></i>
20
+ </div>
21
+ </template>
22
+ <template #error>
23
+ <div class="custom-error">
24
+ <i class="el-icon-picture-outline"></i>
25
+ </div>
26
+ </template>
27
+ </el-image>
28
+ <div class="checkIcon"
29
+ :class="checkImage && checkImage.url === item.url ? 'activeCheckIcon' : 'noCheckIcon'"
30
+ @click="selectImage(item)"
31
+ >
32
+ <div class="centerIcon" v-if="checkImage && checkImage.url === item.url">
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ <div class="answerButton" v-if="msg.content.handleSettings && msg.content.handleSettings.length > 0" :class="disabled || isDisabled || !checkImage ? 'disabledButton' : ''">
38
+ <div class="buttonText"
39
+ v-for="(item,index) in msg.content.handleSettings"
40
+ :key="index"
41
+ @click="imageSelectionConfirm(item)"
42
+ >
43
+ {{ item }}
44
+ </div>
45
+ </div>
46
+ </div>
47
+ </template>
48
+
49
+ <script>
50
+ export default {
51
+ name: "imageSelectionAnswer",
52
+ data(){
53
+ return{
54
+ checkImage:"",
55
+ isDisabled:false
56
+ }
57
+ },
58
+ props:{
59
+ answer:{
60
+ type:Object,
61
+ default(){
62
+ return{}
63
+ }
64
+ },
65
+ disabled:{
66
+ type:Boolean,
67
+ default:false
68
+ },
69
+ msg:{
70
+ type:Object,
71
+ default(){
72
+ return{}
73
+ }
74
+ },
75
+ },
76
+ methods:{
77
+ previewList(options){
78
+ let arr = [];
79
+ arr = options.map(item => item.url)
80
+ return arr
81
+ },
82
+ selectImage(item){
83
+ if (this.disabled || this.isDisabled){
84
+ return
85
+ }
86
+ this.checkImage = item;
87
+ },
88
+ imageSelectionConfirm(item){
89
+ if (this.disabled || this.isDisabled || !this.checkImage){
90
+ return
91
+ }
92
+ this.isDisabled = true;
93
+ this.$emit('imageSelectionConfirm',item,this.checkImage,this.msg)
94
+ },
95
+ onImageClick(url){
96
+ this.$emit('onImageClick',url)
97
+ },
98
+ }
99
+ };
100
+ </script>
101
+
102
+ <style scoped lang="less">
103
+ .imageSelectionAnswer{
104
+ .imageSelectionText{
105
+ padding-bottom: 10px;
106
+ }
107
+ .imageList{
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: flex-start;
111
+ flex-wrap: wrap;
112
+ background-color: #ffffff;
113
+ .imageItem{
114
+ position: relative;
115
+ margin-right: 10px;
116
+ margin-bottom: 5px;
117
+ margin-top: 5px;
118
+ .checkIcon{
119
+ position: absolute;
120
+ top: 0;
121
+ right: 0;
122
+ width: 15px;
123
+ height: 15px;
124
+ border-radius: 8px;
125
+ display: flex;
126
+ align-items: center;
127
+ justify-content: center;
128
+ flex: none;
129
+ }
130
+ .activeCheckIcon{
131
+ background: #366AFF;
132
+ border: 1px solid #366AFF;
133
+ .centerIcon{
134
+ width: 6px;
135
+ height: 6px;
136
+ background: #FFFFFF;
137
+ border-radius: 50%;
138
+ flex: none;
139
+ }
140
+ }
141
+ .noCheckIcon{
142
+ background: #FFFFFF;
143
+ border: 1px solid #EBEDF4;
144
+ }
145
+ }
146
+ }
147
+ .answerButton{
148
+ padding-top: 10px;
149
+ width: 100%;
150
+ display: flex;
151
+ align-items: center;
152
+ justify-content: center;
153
+ border-top: 1px solid #EEEEEE;
154
+ .buttonText{
155
+ padding: 0 4px;
156
+ cursor: pointer;
157
+ color: #366aff;
158
+ }
159
+ }
160
+ .disabledItem{
161
+ .checkIcon{
162
+ background-color: #edf2fc!important;
163
+ }
164
+ .centerIcon{
165
+ background: #366aff!important;
166
+ }
167
+ }
168
+ .custom-loading,
169
+ .custom-error {
170
+ width: 100%;
171
+ height: 100%;
172
+ display: flex;
173
+ align-items: center;
174
+ justify-content: center;
175
+ background: #f5f7fa;
176
+ }
177
+
178
+ .custom-loading {
179
+ color: #366aff;
180
+ }
181
+
182
+ .custom-error {
183
+ color: red;
184
+ }
185
+
186
+ .el-icon-loading {
187
+ font-size: 24px;
188
+ animation: rotating 2s linear infinite;
189
+ }
190
+
191
+ @keyframes rotating {
192
+ from { transform: rotate(0deg); }
193
+ to { transform: rotate(360deg); }
194
+ }
195
+ }
196
+ .disabledButton{
197
+ .buttonText{
198
+ color: #A9B3C6!important;
199
+ }
200
+ }
201
+ </style>
@@ -0,0 +1,132 @@
1
+ <template>
2
+ <div class="multipleChoiceAnswer">
3
+ <div class="multipleText" v-if="msg.content.prompt">
4
+ {{msg.content.prompt}}
5
+ </div>
6
+ <div class="multipleList" :class="msg.content.options && msg.content.options.length == 0 ? 'disabledMultiple' : ''">
7
+ <el-checkbox-group v-model="checkList">
8
+ <el-checkbox
9
+ :label="item._metadata.id"
10
+ v-for="item in msg.content.options"
11
+ :key="item._metadata.id"
12
+ :disabled="disabled || isDisabled"
13
+ >
14
+ <el-image
15
+ style="width: 32px!important; height: 32px!important;margin-right: 4px;flex: none"
16
+ :src="item.url"
17
+ v-if="item.url"
18
+ @click.stop="onImageClick(item.url)"
19
+ fit="cover"></el-image>
20
+ {{ item.text }}
21
+ </el-checkbox>
22
+ </el-checkbox-group>
23
+ </div>
24
+ <div class="answerButton" v-if="msg.content.handleSettings && msg.content.handleSettings.length > 0" :class="disabled || isDisabled || checkList.length === 0 ? 'disabledButton' : ''">
25
+ <div class="buttonText"
26
+ v-for="(item,index) in msg.content.handleSettings"
27
+ :key="index"
28
+ @click="multipleChoiceConfirm(item)"
29
+ >
30
+ {{ item }}
31
+ </div>
32
+ </div>
33
+ </div>
34
+ </template>
35
+
36
+ <script>
37
+ export default {
38
+ name: "multipleChoiceAnswer",
39
+ data(){
40
+ return{
41
+ checkList:[],
42
+ isDisabled:false
43
+ }
44
+ },
45
+ props:{
46
+ disabled:{
47
+ type:Boolean,
48
+ default:false
49
+ },
50
+ msg:{
51
+ type:Object,
52
+ default(){
53
+ return{}
54
+ }
55
+ },
56
+ },
57
+ methods:{
58
+ previewList(options){
59
+ let arr = [];
60
+ arr = options.map(item => item.url)
61
+ return arr
62
+ },
63
+ multipleChoiceConfirm(item){
64
+ if (this.disabled || this.isDisabled || this.checkList.length === 0){
65
+ return
66
+ }
67
+ this.isDisabled = true;
68
+ this.$emit('multipleChoiceConfirm',item,this.checkList,this.msg)
69
+ },
70
+ onImageClick(url){
71
+ this.$emit('onImageClick',url)
72
+ },
73
+ }
74
+ };
75
+ </script>
76
+
77
+ <style scoped lang="less">
78
+ .multipleChoiceAnswer{
79
+ .multipleText{
80
+ //margin-bottom: 10px;
81
+ }
82
+ .multipleList{
83
+ display: flex;
84
+ justify-items: flex-start;
85
+ padding: 8px 0;
86
+ background-color: #ffffff;
87
+ /deep/.el-checkbox-group{
88
+ //display: flex;
89
+ //align-items: center;
90
+ //flex-direction: column;
91
+ .el-checkbox{
92
+ margin-right: 0!important;
93
+ margin-bottom: 10px;
94
+ display: flex;
95
+ align-items: center;
96
+ .el-checkbox__label{
97
+ display: flex;
98
+ align-items: center;
99
+ color: #000000;
100
+ white-space: pre-line;
101
+ }
102
+ }
103
+ }
104
+ }
105
+ .answerButton{
106
+ padding-top: 10px;
107
+ width: 100%;
108
+ display: flex;
109
+ align-items: center;
110
+ justify-content: center;
111
+ border-top: 1px solid #EEEEEE;
112
+ .buttonText{
113
+ padding: 0 4px;
114
+ cursor: pointer;
115
+ color: #366aff;
116
+ }
117
+ }
118
+ }
119
+ .disabledMultiple{
120
+ /deep/.el-checkbox__input{
121
+ display: none;
122
+ }
123
+ /deep/.el-checkbox__label{
124
+ padding-left: 0;
125
+ }
126
+ }
127
+ .disabledButton{
128
+ .buttonText{
129
+ color: #A9B3C6!important;
130
+ }
131
+ }
132
+ </style>
@@ -0,0 +1,81 @@
1
+ <template>
2
+ <div class="singleChoiceAnswer">
3
+ <div class="singleChoiceText" v-if="msg.content.prompt">
4
+ {{msg.content.prompt}}
5
+ </div>
6
+ <div class="optionsList" :class="isDisabled || disabled ? 'disabledOption' : ''">
7
+ <div
8
+ v-for="(option, index) in msg.content.options"
9
+ class="optionsItem"
10
+ :key="index"
11
+ @click="handleClick(option)"
12
+ >
13
+ <span> {{ option.text }}</span>
14
+ <i class="arsenal_icon arsenalangle-right-solid"></i>
15
+ </div>
16
+ </div>
17
+ </div>
18
+ </template>
19
+
20
+ <script>
21
+ export default {
22
+ name: "singleChoiceAnswer",
23
+ data(){
24
+ return{
25
+ isDisabled:false
26
+ }
27
+ },
28
+ props:{
29
+ msg:{
30
+ type:Object,
31
+ default(){
32
+ return{}
33
+ }
34
+ },
35
+ disabled:{
36
+ type:Boolean,
37
+ default:false
38
+ }
39
+ },
40
+ methods:{
41
+ handleClick(item){
42
+ if (this.disabled || this.isDisabled){
43
+ return
44
+ }
45
+ this.isDisabled = true;
46
+ this.$emit('singleChoice',item,this.msg)
47
+ }
48
+ }
49
+ };
50
+ </script>
51
+
52
+ <style scoped lang="less">
53
+ .singleChoiceAnswer{
54
+
55
+ .singleChoiceText{
56
+ //padding-bottom: 10px;
57
+ }
58
+ .optionsList {
59
+ padding-top: 4px;
60
+
61
+ .optionsItem {
62
+ line-height: 25px;
63
+ background-color: #ffffff;
64
+ color: #366aff;
65
+ cursor: pointer;
66
+ display: flex;
67
+ align-items: center;
68
+ justify-content: space-between;
69
+ padding: 8px 0;
70
+ i {
71
+ padding-left: 10px;
72
+ }
73
+ }
74
+ }
75
+ .disabledOption{
76
+ .optionsItem{
77
+ color: #A9B3C6!important;
78
+ }
79
+ }
80
+ }
81
+ </style>
@@ -14,16 +14,16 @@
14
14
  <div class="think_content" :class="showThink ? '' : 'hide_think'" v-html="parseThinkVal">
15
15
  </div>
16
16
  </div>
17
- <!-- <vue-markdown
18
- class="mark_down"
19
- :source="typedContent"
20
- :ref="'markdown' + msgId"
17
+ <!-- <vue-markdown
18
+ class="mark_down"
19
+ :source="typedContent"
20
+ :ref="'markdown' + msgId"
21
21
  @click.native="clickMarkDown"
22
22
  :plugins="plugins"
23
23
  >
24
24
  </vue-markdown> -->
25
25
  <!-- v-show="hasContent" -->
26
- <div
26
+ <div
27
27
  class="mark_down"
28
28
  v-html="markParseText"
29
29
  ref="markDown"
@@ -39,8 +39,8 @@
39
39
 
40
40
  <script>
41
41
  /* eslint-disable */
42
- import VueMarkdown from 'vue-markdown';
43
- import ImgView from "./imgView";
42
+ // import VueMarkdown from 'vue-markdown';
43
+ import ImgView from "./imgView.vue";
44
44
  // import Typed from "typed.js";
45
45
  import hljs from 'highlight.js';
46
46
  import 'highlight.js/styles/default.css';
@@ -128,8 +128,7 @@ export default {
128
128
  }
129
129
  },
130
130
  components: {
131
- ImgView,
132
- VueMarkdown
131
+ ImgView
133
132
  },
134
133
  mounted() {
135
134
  this.$nextTick(() => {
@@ -182,7 +181,9 @@ export default {
182
181
  clearInterval(this.thinkTimer)
183
182
  this.thinkTimer = null
184
183
  this.thinkEnd = true
185
- this.removeLoadingNode()
184
+ setTimeout(() => {
185
+ this.removeLoadingNode()
186
+ }, 200)
186
187
  this.$emit("streamCallback", this.typedContent)
187
188
  this.$emit("sseOtherInfo", this.msgId, "start", "");
188
189
  }, 200);
@@ -282,7 +283,7 @@ export default {
282
283
  this.$emit("answerDocKnowledgeFn");
283
284
  this.eventSource = new EventSource(url);
284
285
  this.$emit("streamStatus", true, this.msgId);
285
- this.$set(this, 'showThink', true);
286
+ // this.$set(this, 'showThink', true);
286
287
  this.signSetFlag = false;
287
288
  this.thinkEnd = false
288
289
  let tempString = "";
@@ -343,7 +344,9 @@ export default {
343
344
  this.$emit("streamCallback", this.typedContent)
344
345
  this.$emit("streamStatus", false, this.msgId);
345
346
  this.appendCopyBtn()
346
- this.removeLoadingNode()
347
+ setTimeout(() => {
348
+ this.removeLoadingNode()
349
+ }, 200);
347
350
  this.$emit("sseOtherInfo", this.msgId, "start", "");
348
351
  }
349
352
 
@@ -366,6 +369,22 @@ export default {
366
369
  recommendItems = data;
367
370
  } else if (event.lastEventId === 'retry') {
368
371
  this.retryUrl = data.content;
372
+ } else if (event.lastEventId === 'generated_image') {
373
+ let imgs = JSON.parse(data.content);
374
+ let imgsStr = "";
375
+ for (let i = 0; i < imgs.length; i++) {
376
+ imgsStr += `![](${imgs[i].oss_url})`;
377
+ }
378
+ this.$set(this, "typedContent", this.typedContent + imgsStr);
379
+
380
+ // 模拟图片推送
381
+ // let imgs = JSON.parse('[{"oss_url":"https://guoranopen-zjk.oss-cn-zhangjiakou.aliyuncs.com/generated-img/generated_img_865652a94b374337b2ac703466cdea94.png"}]');
382
+ // let imgsStr = "";
383
+ // for (let i = 0; i < imgs.length; i++) {
384
+ // imgsStr += `![](${imgs[i].oss_url})`;
385
+ // }
386
+ // this.$set(this, "typedContent", this.typedContent + imgsStr);
387
+
369
388
  } else if (event.lastEventId === 'source') {
370
389
  this.$emit("changedHeadStatusValue", this.msgId, data);
371
390
  } else {
@@ -534,7 +553,7 @@ export default {
534
553
  this.imgList.splice(index, 1);
535
554
  this.imgList.unshift(previewImageUrl);
536
555
  }
537
-
556
+
538
557
  },
539
558
  closeViewer() {
540
559
  this.showPreview = false;
@@ -591,7 +610,7 @@ export default {
591
610
  let codeList = doc.querySelectorAll('pre code')
592
611
  codeList.forEach(ele =>{
593
612
  let list = ele.getElementsByClassName("code_copy_btn")
594
- if(list.length == 0 && ele.classList.contains("hljs")) {
613
+ if(list.length == 0 && ele.classList.contains("hljs") && !ele.classList.contains("hljs-undefined")) {
595
614
  let text = ele.innerText
596
615
  let btnId = uuidv4();
597
616
  let copy = document.createElement('div')
@@ -0,0 +1,149 @@
1
+ <template>
2
+ <div class="outputComponents">
3
+ <div class="outputText" v-if="msg.content.prompt">
4
+ {{ msg.content.prompt }}
5
+ </div>
6
+ <el-table
7
+ :data="tableData"
8
+ style="width: 100%"
9
+ height="250"
10
+ @selection-change="handleSelectionChange"
11
+ v-if="msg.content.tableTemplate &&
12
+ (msg.content.tableTemplate == 1 || msg.content.tableTemplate == 2 || msg.content.tableTemplate == 3)"
13
+ :header-cell-style="{ backgroundColor: '#F6F8FD', height: '40px', color: '#000000', fontWeight: 400 }"
14
+ :row-style="{ height: '40px', color: '#000000' }"
15
+ >
16
+ <el-table-column
17
+ type="selection"
18
+ v-if="msg.content.tableTemplate == 2 || msg.content.tableTemplate == 3"
19
+ align="center"
20
+ :selectable="checkSelectable"
21
+ width="55">
22
+ </el-table-column>
23
+ <el-table-column
24
+ fixed
25
+ prop="name"
26
+ label="产品名称"
27
+ width="150">
28
+ </el-table-column>
29
+ <el-table-column
30
+ prop="number"
31
+ label="产品编号"
32
+ align="center"
33
+ width="120"
34
+ >
35
+ </el-table-column>
36
+ <el-table-column
37
+ prop="inventory"
38
+ label="产品库存"
39
+ align="center"
40
+ width="80">
41
+ </el-table-column>
42
+ <el-table-column
43
+ prop="consumption"
44
+ label="今日平均消耗量"
45
+ align="center"
46
+ width="120">
47
+ </el-table-column>
48
+ </el-table>
49
+ <div class="handleButton" v-if="msg.content.handleSettings && msg.content.handleSettings.length > 0" :class="disabled || isDisabled || selection.length === 0 ? 'disabledButton' : ''">
50
+ <div class="buttonText"
51
+ v-for="(item,index) in msg.content.handleSettings"
52
+ :key="index"
53
+ @click="confirmFun(item)"
54
+ >
55
+ {{ item }}
56
+ </div>
57
+ </div>
58
+ </div>
59
+ </template>
60
+
61
+ <script>
62
+ export default {
63
+ name: "outputCom",
64
+ data(){
65
+ return{
66
+ isDisabled:false,
67
+ selection:[],
68
+ tableData:[
69
+ {
70
+ name:"正新香辣大鸡排",
71
+ number:"ZX78OIJ867",
72
+ inventory:"88",
73
+ consumption:"24"
74
+ },
75
+ {
76
+ name:"正新香辣大鸡排",
77
+ number:"ZX78OIJ867",
78
+ inventory:"88",
79
+ consumption:"24"
80
+ },{
81
+ name:"正新香辣大鸡排",
82
+ number:"ZX78OIJ867",
83
+ inventory:"88",
84
+ consumption:"24"
85
+ }
86
+ ,{
87
+ name:"正新香辣大鸡排",
88
+ number:"ZX78OIJ867",
89
+ inventory:"88",
90
+ consumption:"24"
91
+ }
92
+ ]
93
+ }
94
+ },
95
+ props:{
96
+ msg:{
97
+ type:Object,
98
+ default(){
99
+ return {}
100
+ }
101
+ },
102
+ disabled:{
103
+ type:Boolean,
104
+ default:false
105
+ }
106
+ },
107
+ methods:{
108
+ checkSelectable(){
109
+ return !this.disabled && !this.isDisabled
110
+ },
111
+ handleSelectionChange(val){
112
+ this.selection = val;
113
+ },
114
+ confirmFun(item){
115
+ if (this.disabled || this.isDisabled || this.selection.length == 0){
116
+ return
117
+ }
118
+ this.isDisabled = true;
119
+ this.$emit('confirmFun',item,this.selection,this.msg)
120
+ }
121
+ }
122
+ };
123
+ </script>
124
+
125
+ <style scoped lang="less">
126
+ .outputComponents{
127
+ .outputText{
128
+ padding-bottom: 10px;
129
+ }
130
+ .handleButton{
131
+ padding-top: 10px;
132
+ width: 100%;
133
+ display: flex;
134
+ align-items: center;
135
+ justify-content: center;
136
+ border-top: 1px solid #EEEEEE;
137
+ .buttonText{
138
+ padding: 0 4px;
139
+ cursor: pointer;
140
+ color: #366aff;
141
+ }
142
+ }
143
+ .disabledButton {
144
+ .buttonText {
145
+ color: #A9B3C6 !important;
146
+ }
147
+ }
148
+ }
149
+ </style>