askbot-dragon 1.5.78-beta → 1.5.78
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 +1 -4
- package/public/index.html +1 -3
- package/src/assets/image/default_avt_ui.png +0 -0
- package/src/assets/image/filtType/audio.png +0 -0
- package/src/assets/image/filtType/excel1.png +0 -0
- package/src/assets/image/filtType/general.png +0 -0
- package/src/assets/image/filtType/image1.png +0 -0
- package/src/assets/image/filtType/link.png +0 -0
- package/src/assets/image/filtType/md2.png +0 -0
- package/src/assets/image/filtType/mode.png +0 -0
- package/src/assets/image/filtType/news.png +0 -0
- package/src/assets/image/filtType/pdf1.png +0 -0
- package/src/assets/image/filtType/ppt1.png +0 -0
- package/src/assets/image/filtType/selfadd1.png +0 -0
- package/src/assets/image/filtType/txt1.png +0 -0
- package/src/assets/image/filtType/video.png +0 -0
- package/src/assets/image/filtType/wechat.png +0 -0
- package/src/assets/image/filtType/word1.png +0 -0
- package/src/assets/image/loading.gif +0 -0
- package/src/assets/js/common.js +241 -0
- package/src/components/ActionAlertIframe.vue +43 -1
- package/src/components/AnswerDocknowledge.vue +849 -275
- package/src/components/ConversationContainer.vue +354 -27
- package/src/components/MyEditor.vue +351 -0
- package/src/components/answerRadio.vue +115 -61
- package/src/components/assetDetails.vue +13 -5
- package/src/components/associationIntention.vue +2 -2
- package/src/components/chatContent.vue +1 -1
- package/src/components/formTemplate.vue +77 -111
- package/src/components/intelligentSummary.vue +228 -0
- package/src/components/pdfPosition.vue +23 -12
- package/src/components/previewDoc.vue +5 -0
- package/src/components/previewPdf.vue +675 -199
- package/src/components/welcomeKnowledgeFile.vue +341 -0
- package/src/components/welcomeLlmCard.vue +141 -0
- package/src/components/welcomeSuggest.vue +98 -0
- package/src/main.js +0 -3
- package/vue.config.js +0 -1
- package/src/components/utils/ckeditorImageUpload/command.js +0 -110
- package/src/components/utils/ckeditorImageUpload/editing.js +0 -12
- package/src/components/utils/ckeditorImageUpload/plugin-image.js +0 -12
- package/src/components/utils/ckeditorImageUpload/toolbar-ui.js +0 -41
- package/src/components/utils/ckeditorfileUpload/common.js +0 -182
- package/src/components/utils/ckeditorfileUpload/editing.js +0 -12
- package/src/components/utils/ckeditorfileUpload/plugin_file.js +0 -12
- package/src/components/utils/ckeditorfileUpload/toolbar_ui.js +0 -34
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="my_editor">
|
|
3
|
+
<div class="editor_head" v-if="havToolbar">
|
|
4
|
+
<button class="button" @click="handleUpdate">
|
|
5
|
+
<svg
|
|
6
|
+
t="1703581982515"
|
|
7
|
+
class="icon"
|
|
8
|
+
viewBox="0 0 1024 1024"
|
|
9
|
+
version="1.1"
|
|
10
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
+
p-id="74840"
|
|
12
|
+
width="200"
|
|
13
|
+
height="200"
|
|
14
|
+
>
|
|
15
|
+
<path
|
|
16
|
+
d="M566.839921 866.857572V983.050833c0 22.522042-7.677969 33.271198-29.688146 37.877979-18.427125 4.094917-37.366115 3.583052-55.281375-2.047458-17.403396-5.63051-24.057636-15.867802-24.057636-33.271198v-410.003534c0-7.166104-1.535594-9.213563-9.213562-9.213562-80.36274 0.511865-330.152658 0-410.515399 0-19.450854 0-29.688146-7.166104-34.294927-26.105094-5.118646-19.450854-5.118646-39.925438 0.511865-58.864427 5.118646-16.891531 15.355938-23.545771 32.759333-23.545771h412.562857c7.166104 0 8.189833-1.535594 8.189833-8.189834V41.219994c0-25.081365 7.166104-34.806792 32.247469-38.901708 18.93899-3.583052 38.389844-3.583052 56.305105 4.094917 13.820344 5.63051 20.474583 15.867802 20.474583 30.711875v412.562856c0 6.65424 1.535594 8.189833 8.189833 8.189834h406.932346c23.545771 0 33.783063 7.677969 38.901709 30.711875 4.094917 18.427125 4.094917 37.366115-2.047458 55.281375-5.118646 16.379667-15.355938 23.033906-32.247469 23.033907h-410.515398c-7.166104 0-10.237292 1.023729-9.725428 9.725427 0.511865 40.437302 0.511865 249.789918 0.511865 290.22722z"
|
|
17
|
+
p-id="74841"
|
|
18
|
+
/>
|
|
19
|
+
</svg>
|
|
20
|
+
上传图片或附件
|
|
21
|
+
</button>
|
|
22
|
+
</div>
|
|
23
|
+
<div
|
|
24
|
+
class="editor_content"
|
|
25
|
+
id="my_editor_content"
|
|
26
|
+
v-html="text"
|
|
27
|
+
contenteditable
|
|
28
|
+
ref="editorContent"
|
|
29
|
+
@focus="ischecked = true"
|
|
30
|
+
@blur="blurFn"
|
|
31
|
+
@input="changeInput"
|
|
32
|
+
:data-placeholder="placeholder"
|
|
33
|
+
></div>
|
|
34
|
+
</div>
|
|
35
|
+
</template>
|
|
36
|
+
|
|
37
|
+
<script>
|
|
38
|
+
import { v4 as uuidv4 } from "uuid";
|
|
39
|
+
import { multipartUpload, ossFileUrl } from "./utils/AliyunIssUtil";
|
|
40
|
+
|
|
41
|
+
export default {
|
|
42
|
+
props: ["value", "placeholder", "havToolbar"],
|
|
43
|
+
data () {
|
|
44
|
+
return {
|
|
45
|
+
ossConfig: {
|
|
46
|
+
region: "oss-cn-zhangjiakou",
|
|
47
|
+
//云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,创建并使用STS方式来进行API访问
|
|
48
|
+
accessKeyId: "LTAI4G3QtdEdwkEbihBngAsK",
|
|
49
|
+
accessKeySecret: "OwgdVfc5PeCkIgqIdug660xmiSPchn",
|
|
50
|
+
// stsToken: '<Your securityToken(STS)>',
|
|
51
|
+
bucket: "guoranopen-zjk",
|
|
52
|
+
},
|
|
53
|
+
ischecked: false,
|
|
54
|
+
text: ''
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
watch: {
|
|
58
|
+
value: {
|
|
59
|
+
handler () {
|
|
60
|
+
// 解决光标跳动BUG
|
|
61
|
+
if (!this.ischecked) {
|
|
62
|
+
this.text = this.value
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
deep: true,
|
|
66
|
+
immediate: true
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
methods: {
|
|
70
|
+
blurFn (e) {
|
|
71
|
+
this.ischecked = false
|
|
72
|
+
this.text = this.value
|
|
73
|
+
e.view.blur()
|
|
74
|
+
},
|
|
75
|
+
changeInput (e) {
|
|
76
|
+
this.$emit("input", e.target.innerHTML)
|
|
77
|
+
},
|
|
78
|
+
handleUpdate () {
|
|
79
|
+
let inputObj = document.createElement('input')
|
|
80
|
+
inputObj.setAttribute('id', '_ef');
|
|
81
|
+
inputObj.setAttribute('type', 'file');
|
|
82
|
+
inputObj.setAttribute('accept', '*')
|
|
83
|
+
inputObj.setAttribute('multiple', true)
|
|
84
|
+
inputObj.setAttribute("style", 'visibility:hidden');
|
|
85
|
+
document.body.appendChild(inputObj);
|
|
86
|
+
inputObj.click();
|
|
87
|
+
inputObj.onchange = () => {
|
|
88
|
+
// 循环上传文件
|
|
89
|
+
let files = inputObj.files;
|
|
90
|
+
for (let index = 0; index < files.length; index++) {
|
|
91
|
+
const file = files[index];
|
|
92
|
+
let uid = uuidv4()
|
|
93
|
+
// let command = this.editor.commands.get("insertAskComponent");
|
|
94
|
+
// const listeners = this.editor.config.get('askPluginListener');
|
|
95
|
+
// let beforeButtonInsert = findListener(listeners, "UPLOAD");
|
|
96
|
+
if (file.type.includes('image')) {
|
|
97
|
+
// if (this.editor.uploadImg) {
|
|
98
|
+
// this.editor.uploadImg.push(uid)
|
|
99
|
+
// } else {
|
|
100
|
+
// this.editor.uploadImg = []
|
|
101
|
+
// this.editor.uploadImg.push(uid)
|
|
102
|
+
// }
|
|
103
|
+
this.imgUploadCallback(file, uid, index)
|
|
104
|
+
} else {
|
|
105
|
+
this.fileUploadCallback(file, uid)
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
appenNode (type, uid, value) {
|
|
111
|
+
let node = document.createElement(type)
|
|
112
|
+
node.setAttribute("uid", uid)
|
|
113
|
+
if (type == 'img') {
|
|
114
|
+
node.setAttribute("src", value)
|
|
115
|
+
node.setAttribute("class", 'image')
|
|
116
|
+
setTimeout(() => {
|
|
117
|
+
this.appenNode('div', '', '')
|
|
118
|
+
})
|
|
119
|
+
}
|
|
120
|
+
if (type == 'div' && uid) {
|
|
121
|
+
node.innerText = value
|
|
122
|
+
node.setAttribute("class", 'loading')
|
|
123
|
+
setTimeout(() => {
|
|
124
|
+
this.appenNode('div', '', '')
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
if (type == 'div' && !uid) {
|
|
128
|
+
node.setAttribute("class", 'wrap')
|
|
129
|
+
}
|
|
130
|
+
this.$refs.editorContent.appendChild(node)
|
|
131
|
+
},
|
|
132
|
+
deleteNode (uid) {
|
|
133
|
+
console.log(uid);
|
|
134
|
+
try {
|
|
135
|
+
let node = document.querySelector("[uid=" + uid + ']')
|
|
136
|
+
if (node) {
|
|
137
|
+
this.$refs.editorContent.removeChild(node)
|
|
138
|
+
}
|
|
139
|
+
} catch {
|
|
140
|
+
console.error("未找到该节点");
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
imgUploadCallback (file, uid, index) {
|
|
144
|
+
console.log(file, uid, index);
|
|
145
|
+
this.appenNode("div", "div" + index + uid, file.name + "正在上传,请稍后...")
|
|
146
|
+
this.upload(file).then(res => {
|
|
147
|
+
this.appenNode('img', "img" + index + uid, res.default)
|
|
148
|
+
this.deleteNode("div" + index + uid)
|
|
149
|
+
this.$emit("input", this.$refs.editorContent.innerHTML)
|
|
150
|
+
})
|
|
151
|
+
},
|
|
152
|
+
upload (file) {
|
|
153
|
+
return new Promise((resolve) => {
|
|
154
|
+
this.uploadFile(file, resolve)
|
|
155
|
+
})
|
|
156
|
+
},
|
|
157
|
+
uploadFile (file, resolve) {
|
|
158
|
+
let imgInfo = {
|
|
159
|
+
url: '',
|
|
160
|
+
}
|
|
161
|
+
let res = multipartUpload(
|
|
162
|
+
this.ossConfig,
|
|
163
|
+
file,
|
|
164
|
+
null,
|
|
165
|
+
imgInfo
|
|
166
|
+
);
|
|
167
|
+
res.then(resp => {
|
|
168
|
+
imgInfo.url = ossFileUrl(this.ossConfig, resp.name)
|
|
169
|
+
resolve({
|
|
170
|
+
name: resp.name,
|
|
171
|
+
default: imgInfo.url
|
|
172
|
+
})
|
|
173
|
+
})
|
|
174
|
+
},
|
|
175
|
+
fileUploadCallback (file, uid) {
|
|
176
|
+
this.$emit("fileUploadCallback", {
|
|
177
|
+
param: {
|
|
178
|
+
uid: uid,
|
|
179
|
+
type: 'pending',
|
|
180
|
+
name: file.name
|
|
181
|
+
}
|
|
182
|
+
})
|
|
183
|
+
this.upload(file).then(res => {
|
|
184
|
+
this.$emit("fileUploadCallback", {
|
|
185
|
+
param: {
|
|
186
|
+
uid: uid,
|
|
187
|
+
name: file.name,
|
|
188
|
+
type: 'success',
|
|
189
|
+
url: res.default
|
|
190
|
+
}
|
|
191
|
+
})
|
|
192
|
+
this.$emit("input", this.$refs.editorContent.innerHTML)
|
|
193
|
+
})
|
|
194
|
+
},
|
|
195
|
+
|
|
196
|
+
},
|
|
197
|
+
mounted () {
|
|
198
|
+
this.$nextTick(() => {
|
|
199
|
+
let myEditorContent = this.$refs.editorContent
|
|
200
|
+
console.log(myEditorContent, 'myEditorContent');
|
|
201
|
+
myEditorContent.addEventListener("paste", (e) => {
|
|
202
|
+
let { files } = e.clipboardData
|
|
203
|
+
console.log(files, e.clipboardData, 'filesfilesfilesfiles');
|
|
204
|
+
if (files.length > 0) {
|
|
205
|
+
for (let index = 0; index < files.length; index++) {
|
|
206
|
+
let uid = uuidv4()
|
|
207
|
+
if (files[index].type.indexOf('image') != -1) {
|
|
208
|
+
this.imgUploadCallback(files[index], uid, index)
|
|
209
|
+
e.preventDefault();
|
|
210
|
+
} else {
|
|
211
|
+
this.fileUploadCallback(files[index], uid)
|
|
212
|
+
e.preventDefault();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
})
|
|
217
|
+
myEditorContent.addEventListener("dragenter", function () {
|
|
218
|
+
});
|
|
219
|
+
myEditorContent.addEventListener("dragover", function (e) {
|
|
220
|
+
e.preventDefault();
|
|
221
|
+
});
|
|
222
|
+
myEditorContent.addEventListener("drop", (e) => {
|
|
223
|
+
e.preventDefault();
|
|
224
|
+
let files = e.dataTransfer.files; // 这个就相当于文件上传组件
|
|
225
|
+
if (files.length > 0) {
|
|
226
|
+
for (let index = 0; index < files.length; index++) {
|
|
227
|
+
let uid = uuidv4()
|
|
228
|
+
if (files[index].type.indexOf('image') != -1) {
|
|
229
|
+
this.imgUploadCallback(files[index], uid, index)
|
|
230
|
+
e.preventDefault();
|
|
231
|
+
} else {
|
|
232
|
+
this.fileUploadCallback(files[index], uid)
|
|
233
|
+
e.preventDefault();
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
}, false);
|
|
238
|
+
})
|
|
239
|
+
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
</script>
|
|
243
|
+
|
|
244
|
+
<style lang="less" scoped>
|
|
245
|
+
.my_editor {
|
|
246
|
+
width: 100%;
|
|
247
|
+
border: 1px solid #e0e6f7;
|
|
248
|
+
border-radius: 9px !important;
|
|
249
|
+
background: #ffffff;
|
|
250
|
+
/deep/.editor_content {
|
|
251
|
+
border-bottom-left-radius: 9px !important;
|
|
252
|
+
border-bottom-right-radius: 9px !important;
|
|
253
|
+
padding: 10px;
|
|
254
|
+
box-sizing: border-box;
|
|
255
|
+
min-height: 150px !important;
|
|
256
|
+
font-size: 14px !important;
|
|
257
|
+
outline: none;
|
|
258
|
+
div {
|
|
259
|
+
margin-bottom: 8px;
|
|
260
|
+
white-space: pre-wrap;
|
|
261
|
+
}
|
|
262
|
+
.image {
|
|
263
|
+
height: 140px;
|
|
264
|
+
object-fit: contain;
|
|
265
|
+
}
|
|
266
|
+
// .image{
|
|
267
|
+
// outline: 3px solid #366aff;
|
|
268
|
+
// }
|
|
269
|
+
.loading {
|
|
270
|
+
background: rgba(0, 89, 255, 0.2);
|
|
271
|
+
display: inline-block;
|
|
272
|
+
padding: 2px 5px;
|
|
273
|
+
border-radius: 3px;
|
|
274
|
+
padding-left: 20px;
|
|
275
|
+
position: relative;
|
|
276
|
+
font-size: 12px;
|
|
277
|
+
-webkit-user-modify: read-only;
|
|
278
|
+
-moz-user-modify: read-only;
|
|
279
|
+
}
|
|
280
|
+
.loading::after {
|
|
281
|
+
content: '';
|
|
282
|
+
background-image: url(../assets/image/building.png);
|
|
283
|
+
background-size: 100%;
|
|
284
|
+
width: 15px;
|
|
285
|
+
height: 15px;
|
|
286
|
+
position: absolute;
|
|
287
|
+
top: 3px;
|
|
288
|
+
left: 2px;
|
|
289
|
+
color: #366aff;
|
|
290
|
+
-webkit-animation: rotate 1.5s linear infinite;
|
|
291
|
+
animation: rotate 1.5s linear infinite;
|
|
292
|
+
}
|
|
293
|
+
.wrap {
|
|
294
|
+
height: 1px;
|
|
295
|
+
width: 100%;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
.editor_content:focus {
|
|
299
|
+
box-shadow: 2px 2px 3px rgba(0, 0, 0, 0.1) inset, 0, 0;
|
|
300
|
+
}
|
|
301
|
+
.editor_content:empty::before {
|
|
302
|
+
content: attr(data-placeholder);
|
|
303
|
+
color: #b3b3b3;
|
|
304
|
+
font-size: 14px;
|
|
305
|
+
}
|
|
306
|
+
.editor_head {
|
|
307
|
+
display: flex;
|
|
308
|
+
align-items: center;
|
|
309
|
+
width: 100%;
|
|
310
|
+
height: 38px;
|
|
311
|
+
padding: 0 10px;
|
|
312
|
+
padding-left: 3px;
|
|
313
|
+
box-sizing: border-box;
|
|
314
|
+
color: #366aff;
|
|
315
|
+
font-size: 14px;
|
|
316
|
+
border-bottom: 1px solid #e0e6f7;
|
|
317
|
+
|
|
318
|
+
.button {
|
|
319
|
+
padding: 5px 8px;
|
|
320
|
+
background: #ffffff;
|
|
321
|
+
border: none;
|
|
322
|
+
border-radius: 2px;
|
|
323
|
+
svg {
|
|
324
|
+
fill: #366aff;
|
|
325
|
+
width: 12px !important;
|
|
326
|
+
height: 12px !important;
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
.button:focus {
|
|
330
|
+
// box-shadow: var(--ck-focus-outer-shadow),0 0;
|
|
331
|
+
outline: none;
|
|
332
|
+
background: #f0f0f0;
|
|
333
|
+
transition: box-shadow 0.2s ease-in-out, border 0.2s ease-in-ou;
|
|
334
|
+
}
|
|
335
|
+
.button:active {
|
|
336
|
+
border: 1px solid #366aff;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
@keyframes rotate {
|
|
341
|
+
0% {
|
|
342
|
+
-webkit-transform: rotate(0deg);
|
|
343
|
+
transform: rotate(0deg);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
100% {
|
|
347
|
+
-webkit-transform: rotate(360deg);
|
|
348
|
+
transform: rotate(360deg);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
</style>
|
|
@@ -1,62 +1,107 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div id="answer-radio">
|
|
3
|
-
<p class="radio-description" v-html="msg.content.description"
|
|
3
|
+
<p class="radio-description" v-html="msg.content.description"
|
|
4
|
+
v-if="msg.content.description && !msg.content.isKnowledgeSummary"></p>
|
|
4
5
|
<div class="bottom-link" v-if="msg.content.description && !msg.content.isKnowledgeSummary"></div>
|
|
5
|
-
<div :class="['options-list',msg.content.isKnowledgeSummary ? 'isKnowledgeSummary' : '']">
|
|
6
|
+
<div :class="['options-list', msg.content.isKnowledgeSummary ? 'isKnowledgeSummary' : '']">
|
|
6
7
|
<div v-if="msg.content.isKnowledgeSummary" class="tips">AI为您推荐了以下内容</div>
|
|
7
|
-
<div
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
@click="radioClick(msg,option,index)">
|
|
13
|
-
|
|
14
|
-
<!-- <el-tooltip class="item" effect="dark" :content="option.name" placement="bottom-start" v-if="!isMobile">
|
|
8
|
+
<div v-for="(option, index) in formatOptions[activeIndex]" class="options-item"
|
|
9
|
+
:class="index !== msg.content.options.length - 1 ? 'recommend-item' : 'last-item'" :key="msg.nodeId + '_' + index"
|
|
10
|
+
@click="radioClick(msg, option, index)">
|
|
11
|
+
|
|
12
|
+
<!-- <el-tooltip class="item" effect="dark" :content="option.name" placement="bottom-start" v-if="!isMobile">
|
|
15
13
|
<span > {{ option.name }}</span>
|
|
16
14
|
</el-tooltip> -->
|
|
17
|
-
|
|
15
|
+
<span> {{ option.name }}</span>
|
|
18
16
|
<i class="arsenal_icon arsenalangle-right-solid"></i>
|
|
19
17
|
</div>
|
|
20
18
|
</div>
|
|
19
|
+
<div v-if="showPage" class="switch-page">
|
|
20
|
+
<span @click="changeActivePage" class="switch-page-btn">换一批</span>
|
|
21
|
+
</div>
|
|
21
22
|
</div>
|
|
22
23
|
</template>
|
|
23
24
|
|
|
24
25
|
<script>
|
|
25
26
|
export default {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
27
|
+
name: "answerRadio",
|
|
28
|
+
data() {
|
|
29
|
+
return {
|
|
30
|
+
isMobile: false,
|
|
31
|
+
formatOptions: [],
|
|
32
|
+
activeIndex: 0,
|
|
33
|
+
pageSize: 5,
|
|
34
|
+
showPage: false,
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
props: ['msg'],
|
|
38
|
+
mounted() {
|
|
39
|
+
console.log(this.msg, 'msg');
|
|
40
|
+
// 关键词推荐 前端分页
|
|
41
|
+
if (this.msg.id == "recdNodeId" && this.msg.content.options.length > this.pageSize) {
|
|
42
|
+
this.formatOptions = this.chunkArray(this.msg.content.options, this.pageSize);
|
|
43
|
+
this.activeIndex = 0;
|
|
44
|
+
this.showPage = true;
|
|
45
|
+
} else {
|
|
46
|
+
this.formatOptions = [this.msg.content.options];
|
|
47
|
+
this.activeIndex = 0;
|
|
48
|
+
}
|
|
49
|
+
this.judgeIsMobile();
|
|
50
|
+
},
|
|
51
|
+
methods: {
|
|
52
|
+
changeActivePage(){
|
|
53
|
+
if (this.activeIndex >= this.formatOptions.length - 1) {
|
|
54
|
+
this.activeIndex = 0;
|
|
55
|
+
} else {
|
|
56
|
+
this.activeIndex++;
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
chunkArray(array, size) {
|
|
60
|
+
let chunks = [];
|
|
61
|
+
for (let i = 0; i < array.length; i += size) {
|
|
62
|
+
let chunk = array.slice(i, i + size);
|
|
63
|
+
chunks.push(chunk);
|
|
64
|
+
}
|
|
65
|
+
return chunks;
|
|
66
|
+
},
|
|
67
|
+
judgeIsMobile() {
|
|
68
|
+
let flag = navigator.userAgent.match(
|
|
69
|
+
/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
|
|
70
|
+
);
|
|
71
|
+
if (flag) {
|
|
72
|
+
this.isMobile = true;
|
|
73
|
+
} else {
|
|
74
|
+
this.isMobile = false;
|
|
75
|
+
}
|
|
76
|
+
console.log(this.isMobile, 'this.isMobile');
|
|
77
|
+
},
|
|
78
|
+
radioClick(msg, option, index) {
|
|
79
|
+
let value = option.answerId ? msg.id + '_' + index + '_' + option.value + '_' + option.name + '_' + option.answerId : msg.id + '_' + index + '_' + option.value + '_' + option.name
|
|
80
|
+
this.$emit('onRadioClick', value, option.name, msg.apiKey, msg.actionCategory, msg.msgId ? msg.msgId : '', option.apiKey)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
54
83
|
|
|
55
84
|
}
|
|
56
85
|
</script>
|
|
57
86
|
|
|
58
87
|
<style scoped lang="less">
|
|
59
|
-
#answer-radio{
|
|
88
|
+
#answer-radio {
|
|
89
|
+
.switch-page {
|
|
90
|
+
margin-top: 10px;
|
|
91
|
+
display: flex;
|
|
92
|
+
flex-direction: column;
|
|
93
|
+
align-items: center;
|
|
94
|
+
.switch-page-btn {
|
|
95
|
+
width: 80px;
|
|
96
|
+
height: 30px;
|
|
97
|
+
border-radius: 15px;
|
|
98
|
+
border: solid 1px #366AFF;
|
|
99
|
+
color: #366AFF;
|
|
100
|
+
line-height: 30px;
|
|
101
|
+
text-align: center;
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
60
105
|
.radio-description {
|
|
61
106
|
word-wrap: break-word;
|
|
62
107
|
word-break: break-all;
|
|
@@ -64,51 +109,57 @@ export default {
|
|
|
64
109
|
/*padding: 8px 10px 10px 0;*/
|
|
65
110
|
padding-bottom: 10px;
|
|
66
111
|
height: auto;
|
|
67
|
-
|
|
112
|
+
/* border-bottom: 1px solid #EEEEEE;*/
|
|
68
113
|
}
|
|
69
|
-
|
|
114
|
+
|
|
115
|
+
.bottom-link {
|
|
70
116
|
height: 1px;
|
|
71
|
-
background-color
|
|
117
|
+
background-color: #EEEEEE;
|
|
72
118
|
}
|
|
73
|
-
|
|
119
|
+
|
|
120
|
+
.options-list {
|
|
74
121
|
padding-top: 4px;
|
|
75
|
-
|
|
122
|
+
/* padding-top: 10px;*/
|
|
76
123
|
/*padding-right: 10px;*/
|
|
77
|
-
|
|
78
|
-
.options-item{
|
|
124
|
+
|
|
125
|
+
.options-item {
|
|
79
126
|
// height: 25px;
|
|
80
127
|
line-height: 25px;
|
|
81
128
|
background-color: #ffffff;
|
|
82
129
|
color: #366aff;
|
|
83
|
-
cursor:pointer;
|
|
130
|
+
cursor: pointer;
|
|
84
131
|
display: flex;
|
|
85
132
|
align-items: center;
|
|
86
133
|
justify-content: space-between;
|
|
87
|
-
|
|
88
134
|
|
|
89
|
-
|
|
135
|
+
|
|
136
|
+
i {
|
|
90
137
|
padding-left: 10px;
|
|
91
138
|
}
|
|
92
|
-
|
|
139
|
+
|
|
140
|
+
.options-item-text {
|
|
93
141
|
text-overflow: ellipsis;
|
|
94
142
|
display: -webkit-box; //使用了flex,需要加
|
|
95
|
-
overflow: hidden;
|
|
143
|
+
overflow: hidden; //超出隐藏
|
|
96
144
|
word-break: break-all; //纯英文、数字、中文
|
|
97
|
-
text-overflow: ellipsis;
|
|
145
|
+
text-overflow: ellipsis; //省略号
|
|
98
146
|
-webkit-box-orient: vertical; //垂直
|
|
99
|
-
-webkit-line-clamp: 1;
|
|
100
|
-
white-space:pre-line;
|
|
147
|
+
-webkit-line-clamp: 1; //显示一行
|
|
148
|
+
white-space: pre-line; //
|
|
101
149
|
}
|
|
102
150
|
}
|
|
103
|
-
|
|
151
|
+
|
|
152
|
+
&.isKnowledgeSummary {
|
|
104
153
|
background: #EEF1FF;
|
|
105
154
|
border-radius: 10px;
|
|
106
155
|
padding: 10px;
|
|
107
|
-
|
|
156
|
+
|
|
157
|
+
.options-item {
|
|
108
158
|
background: #EEF1FF;
|
|
109
159
|
}
|
|
110
160
|
}
|
|
111
|
-
|
|
161
|
+
|
|
162
|
+
.tips {
|
|
112
163
|
width: 131px;
|
|
113
164
|
height: 22px;
|
|
114
165
|
background: #366AFF;
|
|
@@ -118,13 +169,16 @@ export default {
|
|
|
118
169
|
color: #fff;
|
|
119
170
|
font-size: 12px;
|
|
120
171
|
}
|
|
121
|
-
|
|
172
|
+
|
|
173
|
+
.recommend-item {
|
|
122
174
|
padding: 8px 0;
|
|
123
175
|
}
|
|
124
|
-
|
|
176
|
+
|
|
177
|
+
.last-item {
|
|
125
178
|
padding-top: 8px;
|
|
126
179
|
}
|
|
127
|
-
|
|
180
|
+
|
|
181
|
+
.end {
|
|
128
182
|
border-bottom-left-radius: 25px !important;
|
|
129
183
|
border-bottom-right-radius: 25px !important;
|
|
130
184
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div class="asset-details">
|
|
4
4
|
<section class="details-title">
|
|
5
5
|
<p>您正在咨询</p>
|
|
6
|
-
<span
|
|
6
|
+
<span @click="rotateClick" class="rotate">
|
|
7
7
|
<i class="arsenal_icon arsenalangle-up-solid"></i>
|
|
8
8
|
</span>
|
|
9
9
|
</section>
|
|
@@ -68,12 +68,12 @@
|
|
|
68
68
|
</p>
|
|
69
69
|
<p class="text-SN">
|
|
70
70
|
<i class="iconfont guoran-tongyichicun-mingcheng"></i>
|
|
71
|
-
<span>{{ dataDetails.thirdAssetsCode ? dataDetails.thirdAssetsCode : "--" }}</span>
|
|
71
|
+
<span>{{ dataDetails.thirdAssetsCode ? dataDetails.thirdAssetsCode : "--12312" }}</span>
|
|
72
72
|
</p>
|
|
73
73
|
</section>
|
|
74
74
|
</div>
|
|
75
75
|
</div>
|
|
76
|
-
<div class="details-content-hide" v-if="
|
|
76
|
+
<div class="details-content-hide" v-if="false && !isThirdParty">
|
|
77
77
|
<p>
|
|
78
78
|
<i class="iconfont guoran-miaoshu"></i>
|
|
79
79
|
<section class="description">
|
|
@@ -155,6 +155,7 @@
|
|
|
155
155
|
</template>
|
|
156
156
|
|
|
157
157
|
<script>
|
|
158
|
+
/*eslint-disable*/
|
|
158
159
|
export default {
|
|
159
160
|
props: {
|
|
160
161
|
data: {
|
|
@@ -213,7 +214,8 @@ export default {
|
|
|
213
214
|
},
|
|
214
215
|
methods: {
|
|
215
216
|
rotateClick() {
|
|
216
|
-
this.rotateFlag = !this.rotateFlag;
|
|
217
|
+
// this.rotateFlag = !this.rotateFlag;
|
|
218
|
+
this.$emit('assetClick', this.data.assets)
|
|
217
219
|
},
|
|
218
220
|
},
|
|
219
221
|
};
|
|
@@ -258,7 +260,7 @@ export default {
|
|
|
258
260
|
}
|
|
259
261
|
}
|
|
260
262
|
.rotate {
|
|
261
|
-
transform: rotate(
|
|
263
|
+
transform: rotate(90deg);
|
|
262
264
|
}
|
|
263
265
|
}
|
|
264
266
|
.details-content {
|
|
@@ -296,6 +298,7 @@ export default {
|
|
|
296
298
|
color: #000000;
|
|
297
299
|
font-size: 15px;
|
|
298
300
|
text-overflow: hidden;
|
|
301
|
+
margin-bottom: 5px;
|
|
299
302
|
// overflow-wrap: each();
|
|
300
303
|
}
|
|
301
304
|
.text-label {
|
|
@@ -314,6 +317,8 @@ export default {
|
|
|
314
317
|
background: #e1faf9;
|
|
315
318
|
box-sizing: border-box;
|
|
316
319
|
padding: 3px 5px;
|
|
320
|
+
margin-bottom: 5px;
|
|
321
|
+
border-radius: 5px;
|
|
317
322
|
i {
|
|
318
323
|
color: #00c2bb;
|
|
319
324
|
}
|
|
@@ -325,11 +330,14 @@ export default {
|
|
|
325
330
|
background: #edf2ff;
|
|
326
331
|
box-sizing: border-box;
|
|
327
332
|
padding: 3px 5px;
|
|
333
|
+
margin-bottom: 5px;
|
|
334
|
+
border-radius: 5px;
|
|
328
335
|
i {
|
|
329
336
|
color: #366aff;
|
|
330
337
|
}
|
|
331
338
|
span {
|
|
332
339
|
color: #366aff;
|
|
340
|
+
margin-bottom: 0 !important;
|
|
333
341
|
}
|
|
334
342
|
}
|
|
335
343
|
}
|
|
@@ -22,10 +22,10 @@
|
|
|
22
22
|
</template>
|
|
23
23
|
<Recommend :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
|
|
24
24
|
</div>
|
|
25
|
-
<div v-if="msg.type === 'answer_rich_text' && !(msg.content.recommend && msg.content.recommend.status)">
|
|
25
|
+
<div v-if="(msg.type === 'answer_rich_text' || msg.type === 'answer_rich_text_pro') && !(msg.content.recommend && msg.content.recommend.status)">
|
|
26
26
|
<p :class="[msg.content.vertion == 1?'new-version-rich':'']" v-html="$options.filters.imageStyle(msg.content.html)" @click="lookAttach($event)"></p>
|
|
27
27
|
</div>
|
|
28
|
-
<div v-else-if="msg.type == 'answer_rich_text' && (msg.content.recommend && msg.content.recommend.status)">
|
|
28
|
+
<div v-else-if="(msg.type == 'answer_rich_text' || msg.type === 'answer_rich_text_pro') && (msg.content.recommend && msg.content.recommend.status)">
|
|
29
29
|
<p :class="['answer-rich-text', msg.content.vertion == 1?'new-version-rich':'']" v-html="$options.filters.imageStyle(msg.content.html)" @click="lookAttach($event)"></p>
|
|
30
30
|
<Recommend :msg="msg.content" @onRadioClickReco="onRadioClickReco"></Recommend>
|
|
31
31
|
</div>
|