askbot-dragon 1.7.26-beta → 1.7.29-beta
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 +4 -2
- package/src/assets/js/AliyunlssUtil.js +32 -9
- package/src/components/AiGuide.vue +1 -1
- package/src/components/AnswerDocknowledge.vue +245 -257
- package/src/components/ConversationContainer.vue +6 -17
- package/src/components/MyEditor.vue +2 -11
- package/src/components/actionSatisfaction.vue +2 -2
- package/src/components/answerRadio.vue +2 -2
- package/src/components/askVideo.vue +2 -2
- package/src/components/assetDetails.vue +1 -1
- package/src/components/assetMessage.vue +10 -12
- package/src/components/fielListView.vue +1 -1
- package/src/components/formTemplate.vue +4 -14
- package/src/components/imgView.vue +32 -0
- package/src/components/intelligentSummary.vue +14 -12
- package/src/components/markDownText.vue +164 -0
- package/src/components/myPopup.vue +10 -10
- package/src/components/pdfPosition.vue +66 -58
- package/src/components/popup.vue +7 -7
- package/src/components/previewPdf.vue +16 -21
- package/src/components/receiverMessagePlatform.vue +20 -19
- package/src/components/senderMessagePlatform.vue +15 -10
- package/src/components/tree.vue +2 -2
- package/src/components/utils/AliyunIssUtil.js +33 -12
- package/src/components/utils/ckeditor.js +59 -48
- package/src/components/welcomeKnowledgeFile.vue +1 -1
- package/src/components/welcomeSuggest.vue +1 -1
- package/src/locales/cn.json +60 -0
- package/src/locales/en.json +60 -0
- package/src/main.js +16 -0
- package/src/components/QwFeedback.vue +0 -301
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import {multipartUpload, ossFileUrl} from "./AliyunIssUtil";
|
|
2
|
+
import { multipartUpload, ossFileUrl } from "./AliyunIssUtil";
|
|
3
3
|
import { v4 as uuidv4 } from "uuid";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
|
|
5
|
+
const getPrivateOssConfig = () => {
|
|
6
|
+
let mainSource = sessionStorage.getItem('_mainSource') ? sessionStorage.getItem('_mainSource') : "askbot";
|
|
7
|
+
switch (mainSource) {
|
|
8
|
+
case "askbot":
|
|
9
|
+
return {
|
|
10
|
+
region: "oss-cn-zhangjiakou",
|
|
11
|
+
accessKeyId: "LTAI4G3QtdEdwkEbihBngAsK",
|
|
12
|
+
accessKeySecret: "OwgdVfc5PeCkIgqIdug660xmiSPchn",
|
|
13
|
+
bucket: "guoranopen-zjk",
|
|
14
|
+
}
|
|
15
|
+
case "lishi":
|
|
16
|
+
return {
|
|
17
|
+
region: "oss-ap-southeast-1",
|
|
18
|
+
accessKeyId: "LTAI5tAusPLDNJJwkvUbqi2T",
|
|
19
|
+
accessKeySecret: "xqPVaunOIbvTe3g9qsXal2IZO6RftK",
|
|
20
|
+
bucket: "askbotopen-ls",
|
|
21
|
+
};
|
|
11
22
|
}
|
|
23
|
+
}
|
|
12
24
|
class MyUploadAdapter {
|
|
13
|
-
constructor(
|
|
25
|
+
constructor(loader, editor) {
|
|
14
26
|
// 要在上载期间使用的文件加载器实例
|
|
15
27
|
this.loader = loader;
|
|
16
28
|
this.editor = editor
|
|
@@ -19,7 +31,7 @@ class MyUploadAdapter {
|
|
|
19
31
|
// 启动上载过程
|
|
20
32
|
upload() {
|
|
21
33
|
return this.loader.file
|
|
22
|
-
.then(
|
|
34
|
+
.then(file => new Promise(() => {
|
|
23
35
|
/* this._initRequest();
|
|
24
36
|
this._initListeners( resolve, reject, file );
|
|
25
37
|
this._sendRequest( file );*/
|
|
@@ -37,8 +49,8 @@ class MyUploadAdapter {
|
|
|
37
49
|
options: {
|
|
38
50
|
name: file.name + '正在上传...',
|
|
39
51
|
data: uid,
|
|
40
|
-
editable:false,
|
|
41
|
-
type:'upload'
|
|
52
|
+
editable: false,
|
|
53
|
+
type: 'upload'
|
|
42
54
|
}
|
|
43
55
|
})
|
|
44
56
|
this.uploadFile(file)
|
|
@@ -47,33 +59,32 @@ class MyUploadAdapter {
|
|
|
47
59
|
|
|
48
60
|
// 中止上载过程
|
|
49
61
|
abort() {
|
|
50
|
-
if (
|
|
62
|
+
if (this.xhr) {
|
|
51
63
|
this.xhr.abort();
|
|
52
64
|
}
|
|
53
65
|
}
|
|
54
|
-
uploadFile(file){
|
|
66
|
+
uploadFile(file) {
|
|
55
67
|
let imgInfo = {
|
|
56
|
-
url:'',
|
|
68
|
+
url: '',
|
|
57
69
|
}
|
|
58
70
|
let res = multipartUpload(
|
|
59
|
-
ossConfig,
|
|
60
71
|
file,
|
|
61
72
|
null,
|
|
62
73
|
imgInfo
|
|
63
74
|
);
|
|
64
|
-
res.then(resp=>{
|
|
65
|
-
imgInfo.url = ossFileUrl(
|
|
66
|
-
let root =
|
|
75
|
+
res.then(resp => {
|
|
76
|
+
imgInfo.url = ossFileUrl(resp.name)
|
|
77
|
+
let root = this.editor.model.document.getRoot()
|
|
67
78
|
let children = root.getChildren()
|
|
68
|
-
for(let child of children){
|
|
79
|
+
for (let child of children) {
|
|
69
80
|
for (let index = 0; index < child._children._nodes.length; index++) {
|
|
70
|
-
if(child._children._nodes[index].name == 'askComponentPlaceholderContainer'){
|
|
71
|
-
if(child._children._nodes[index]._children._nodes[0]) {
|
|
81
|
+
if (child._children._nodes[index].name == 'askComponentPlaceholderContainer') {
|
|
82
|
+
if (child._children._nodes[index]._children._nodes[0]) {
|
|
72
83
|
let attrs = child._children._nodes[index]._children._nodes[0]._attrs
|
|
73
|
-
if(attrs) {
|
|
84
|
+
if (attrs) {
|
|
74
85
|
let attrsList = [...attrs.keys()]
|
|
75
86
|
for (let j = 0; j < attrsList.length; j++) {
|
|
76
|
-
if(attrsList[j] == 'data') {
|
|
87
|
+
if (attrsList[j] == 'data') {
|
|
77
88
|
// this.editor.uploadImg = this.editor.uploadImg.filter(id =>{return id != attrs.get(attrsList[j])})
|
|
78
89
|
this.editor.model.change(writer => {
|
|
79
90
|
writer.remove(child._children._nodes[index]);
|
|
@@ -89,7 +100,7 @@ class MyUploadAdapter {
|
|
|
89
100
|
command.execute({
|
|
90
101
|
tag: "img",
|
|
91
102
|
options: {
|
|
92
|
-
width:'100%',
|
|
103
|
+
width: '100%',
|
|
93
104
|
alt: resp.name + 0,
|
|
94
105
|
src: imgInfo.url
|
|
95
106
|
},
|
|
@@ -103,68 +114,68 @@ class MyUploadAdapter {
|
|
|
103
114
|
_initRequest() {
|
|
104
115
|
const xhr = this.xhr = new XMLHttpRequest();
|
|
105
116
|
console.log(xhr)
|
|
106
|
-
xhr.open(
|
|
117
|
+
xhr.open('POST', '/open-api/oss/public?token=8c98087dfd2d48f856d8c95c09115def', true);
|
|
107
118
|
xhr.responseType = '';
|
|
108
119
|
}
|
|
109
120
|
|
|
110
121
|
// 初始化 XMLHttpRequest 监听.
|
|
111
|
-
_initListeners(
|
|
122
|
+
_initListeners(resolve, reject, file) {
|
|
112
123
|
const xhr = this.xhr;
|
|
113
124
|
const loader = this.loader;
|
|
114
125
|
console.log(this.loader)
|
|
115
|
-
const genericErrorText = `无法上传文件: ${
|
|
126
|
+
const genericErrorText = `无法上传文件: ${file.name}.`;
|
|
116
127
|
|
|
117
|
-
xhr.addEventListener(
|
|
118
|
-
xhr.addEventListener(
|
|
119
|
-
xhr.addEventListener(
|
|
128
|
+
xhr.addEventListener('error', () => reject(genericErrorText));
|
|
129
|
+
xhr.addEventListener('abort', () => reject());
|
|
130
|
+
xhr.addEventListener('load', () => {
|
|
120
131
|
const response = xhr.response;
|
|
121
132
|
// 当code==200说明上传成功,可以增加弹框提示;
|
|
122
133
|
// 当上传失败时,必须调用reject()函数。
|
|
123
134
|
|
|
124
135
|
console.log('response', xhr)
|
|
125
136
|
|
|
126
|
-
if (
|
|
127
|
-
return reject(
|
|
137
|
+
if (!response || response.error) {
|
|
138
|
+
return reject(response && response.error ? response.error.message : genericErrorText);
|
|
128
139
|
}
|
|
129
140
|
//上传成功,从后台获取图片的url地址
|
|
130
|
-
resolve(
|
|
141
|
+
resolve({
|
|
131
142
|
default: response
|
|
132
|
-
}
|
|
133
|
-
}
|
|
143
|
+
});
|
|
144
|
+
});
|
|
134
145
|
|
|
135
146
|
// 支持时上传进度。文件加载器有#uploadTotal和#upload属性,用于在编辑器用户界面中显示上载进度栏。
|
|
136
|
-
if (
|
|
137
|
-
xhr.upload.addEventListener(
|
|
138
|
-
if (
|
|
147
|
+
if (xhr.upload) {
|
|
148
|
+
xhr.upload.addEventListener('progress', evt => {
|
|
149
|
+
if (evt.lengthComputable) {
|
|
139
150
|
loader.uploadTotal = evt.total;
|
|
140
151
|
loader.uploaded = evt.loaded;
|
|
141
152
|
}
|
|
142
|
-
}
|
|
153
|
+
});
|
|
143
154
|
}
|
|
144
155
|
}
|
|
145
156
|
|
|
146
157
|
// 准备数据并发送请求
|
|
147
|
-
_sendRequest(
|
|
158
|
+
_sendRequest(file) {
|
|
148
159
|
//通过FormData构造函数创建一个空对象
|
|
149
160
|
const data = new FormData();
|
|
150
161
|
//通过append()方法在末尾追加key为files值为file的数据
|
|
151
162
|
|
|
152
|
-
console.log('file',file)
|
|
153
|
-
data.append(
|
|
163
|
+
console.log('file', file)
|
|
164
|
+
data.append('file', file);//上传的参数data
|
|
154
165
|
// data.append( 'memberId', "666" );
|
|
155
166
|
/**
|
|
156
167
|
* 重要提示:这是实现诸如身份验证和CSRF保护等安全机制的正确位置。
|
|
157
168
|
* 例如,可以使用XMLHttpRequest.setRequestHeader()设置包含应用程序先前生成的CSRF令牌的请求头。
|
|
158
169
|
*/
|
|
159
|
-
this.xhr.send(
|
|
170
|
+
this.xhr.send(data);
|
|
160
171
|
}
|
|
161
172
|
}
|
|
162
173
|
|
|
163
|
-
function MyCustomUploadAdapterPlugin(
|
|
164
|
-
editor.plugins.get(
|
|
174
|
+
function MyCustomUploadAdapterPlugin(editor) {
|
|
175
|
+
editor.plugins.get('FileRepository').createUploadAdapter = (loader) => {
|
|
165
176
|
// 在这里将URL配置为后端上载脚本
|
|
166
|
-
console.log(loader,'loader');
|
|
167
|
-
return new MyUploadAdapter(
|
|
177
|
+
console.log(loader, 'loader');
|
|
178
|
+
return new MyUploadAdapter(loader, editor);
|
|
168
179
|
}
|
|
169
180
|
}
|
|
170
181
|
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
<!-- v-if="msgContent.totalCount > msgContent.knowledgeFileInfos.length" -->
|
|
32
32
|
|
|
33
33
|
<div class="load_moreKnowledge" v-if="page < msgContent.totalPages" @click="loadMore">
|
|
34
|
-
<span
|
|
34
|
+
<span>{{$t('dragonCommon.viewMore')}}</span>
|
|
35
35
|
</div>
|
|
36
36
|
</div>
|
|
37
37
|
<previewPdf ref="previewPdf"
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<div class="title_desc">{{ msg.content.problemRecommendationDesc }}</div>
|
|
5
5
|
<div class="title_change_batch" v-if="msg.content.page && msg.content.problemRecommendationValue.length > msg.content.pageCount" @click="changeBatch">
|
|
6
6
|
<i class="iconfont guoran-tongyichicun-huanyipi"></i>
|
|
7
|
-
<span
|
|
7
|
+
<span>{{$t('dragonCommon.refresh')}}</span>
|
|
8
8
|
</div>
|
|
9
9
|
</div>
|
|
10
10
|
<div class="content">
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"组件多语言使用说明": "在使用多语言配置文件时,需要在使用的项目中添加对应的配置,默认都配置在dragonCommon字段中,也可以看看有没有其他方式",
|
|
3
|
+
"dragonCommon": {
|
|
4
|
+
"download": "下载",
|
|
5
|
+
"smartSummary": "智能摘要",
|
|
6
|
+
"chat": "聊一聊",
|
|
7
|
+
"viewDetails": "查看详情",
|
|
8
|
+
"folderName": "文件夹名称",
|
|
9
|
+
"loading": "加载中...",
|
|
10
|
+
"Safaridownload": "下载地址已复制,请前往Safari浏览器访问下载",
|
|
11
|
+
"reduce": "缩小",
|
|
12
|
+
"zoom": "放大",
|
|
13
|
+
"selectScale": "请选择",
|
|
14
|
+
"previous": "上一段",
|
|
15
|
+
"next": "下一段",
|
|
16
|
+
"answersGeneratedByPre": "答案由",
|
|
17
|
+
"answersGeneratedByAfter": "段内容生成",
|
|
18
|
+
"scaleAuto": "自动缩放",
|
|
19
|
+
"scaleReality": "实际比例",
|
|
20
|
+
"firstParagraph": "当前已经是第一段了",
|
|
21
|
+
"lastParagraph": "当前已经是最后一段了",
|
|
22
|
+
"fileloadException": "文件加载异常",
|
|
23
|
+
"regenerate": "重新生成",
|
|
24
|
+
"generating": "生成中",
|
|
25
|
+
"close": "关闭",
|
|
26
|
+
"summaryGeneratedByAI": "AI为您总结生成了以下摘要",
|
|
27
|
+
"viewMore": "查看更多",
|
|
28
|
+
"from": "出自",
|
|
29
|
+
"viewOriginal": "查看原文",
|
|
30
|
+
"lastUpdateTime": "最后更新时间",
|
|
31
|
+
"owner": "所有者",
|
|
32
|
+
"enterprise": "所属企业",
|
|
33
|
+
"source": "文件来源",
|
|
34
|
+
"folder": "文件夹",
|
|
35
|
+
"personalknowledge": "个人知识",
|
|
36
|
+
"enterpriseknowledge": "企业知识",
|
|
37
|
+
"satisfaction": "满意",
|
|
38
|
+
"unsatisfied": "不满意",
|
|
39
|
+
"refresh": "换一批",
|
|
40
|
+
"AIrecommends": "AI为您推荐以下内容",
|
|
41
|
+
"youareconsulting": "您正在咨询",
|
|
42
|
+
"description": "描述",
|
|
43
|
+
"location": "位置",
|
|
44
|
+
"user": "使用者",
|
|
45
|
+
"department": "部门",
|
|
46
|
+
"manager": "管理者",
|
|
47
|
+
"uploadImgFile": "上传图片或附件",
|
|
48
|
+
"cancel": "取消",
|
|
49
|
+
"confirm": "确定",
|
|
50
|
+
"noMore": "没有更多了",
|
|
51
|
+
"establishConversationWith": "与",
|
|
52
|
+
"you": "您",
|
|
53
|
+
"bot": "机器人",
|
|
54
|
+
"transferTo": "您将会话转接给",
|
|
55
|
+
"transferFrom": "将会话转接给您",
|
|
56
|
+
"imService": "IM人工",
|
|
57
|
+
"botService": "机器人",
|
|
58
|
+
"willServeYou": "将为您服务"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"组件多语言使用说明": "在使用多语言配置文件时,需要在使用的项目中添加对应的配置,默认都配置在dragonCommon字段中,也可以看看有没有其他方式",
|
|
3
|
+
"dragonCommon": {
|
|
4
|
+
"download": "Download",
|
|
5
|
+
"smartSummary": "Smart Summary",
|
|
6
|
+
"chat": "Chat",
|
|
7
|
+
"viewDetails": "View Details",
|
|
8
|
+
"folderName": "Folder Name",
|
|
9
|
+
"loading": "Loading...",
|
|
10
|
+
"Safaridownload": "The download address has been copied, please go to Safari to access the download",
|
|
11
|
+
"reduce": "Reduce",
|
|
12
|
+
"zoom": "Zoom",
|
|
13
|
+
"selectScale": "Select Scale",
|
|
14
|
+
"previous": "Previous",
|
|
15
|
+
"next": "Next",
|
|
16
|
+
"answersGeneratedByPre": "Answers generated by",
|
|
17
|
+
"answersGeneratedByAfter": "segments of content",
|
|
18
|
+
"scaleAuto": "Auto",
|
|
19
|
+
"scaleReality": "Reality",
|
|
20
|
+
"firstParagraph": "It's already the first paragraph",
|
|
21
|
+
"lastParagraph": "It's already the last paragraph",
|
|
22
|
+
"fileloadException": "File load exception",
|
|
23
|
+
"regenerate": "Regenerate",
|
|
24
|
+
"generating": "Generating",
|
|
25
|
+
"close": "Close",
|
|
26
|
+
"summaryGeneratedByAI": "AI has generated the following summary for you",
|
|
27
|
+
"viewMore": "View More",
|
|
28
|
+
"from": "From",
|
|
29
|
+
"viewOriginal": "View Original",
|
|
30
|
+
"lastUpdateTime": "Last Update Time",
|
|
31
|
+
"owner": "Owner",
|
|
32
|
+
"enterprise": "Enterprise",
|
|
33
|
+
"source": "Source",
|
|
34
|
+
"folder": "Folder",
|
|
35
|
+
"personalknowledge": "Personal Knowledge",
|
|
36
|
+
"enterpriseknowledge": "Enterprise Knowledge",
|
|
37
|
+
"satisfaction": "Satisfaction",
|
|
38
|
+
"unsatisfied": "Unsatisfied",
|
|
39
|
+
"refresh": "Refresh",
|
|
40
|
+
"AIrecommends": "AI recommends the following for you",
|
|
41
|
+
"youareconsulting": "You are consulting",
|
|
42
|
+
"description": "Description",
|
|
43
|
+
"location": "Location",
|
|
44
|
+
"user": "User",
|
|
45
|
+
"department": "Department",
|
|
46
|
+
"manager": "Manager",
|
|
47
|
+
"uploadImgFile": "Upload",
|
|
48
|
+
"cancel": "Cancel",
|
|
49
|
+
"confirm": "Confirm",
|
|
50
|
+
"noMore": "No more",
|
|
51
|
+
"establishConversationWith": "Establish conversation with",
|
|
52
|
+
"you": "You",
|
|
53
|
+
"bot": "Bot",
|
|
54
|
+
"transferTo": "You will transfer the conversation to",
|
|
55
|
+
"transferFrom": "will transfer the conversation to you",
|
|
56
|
+
"imService": "IM agent",
|
|
57
|
+
"botService": "Bot",
|
|
58
|
+
"willServeYou": "will serve you"
|
|
59
|
+
}
|
|
60
|
+
}
|
package/src/main.js
CHANGED
|
@@ -47,11 +47,27 @@ Viewer.setDefaults({
|
|
|
47
47
|
Options: { "inline": true, "button": true, "navbar": true, "title": true, "toolbar": true, "tooltip": true, "movable": true, "zoomable": true, "rotatable": true, "scalable": true, "transition": true, "fullscreen": true, "keyboard": true, "url": "data-source" }
|
|
48
48
|
})
|
|
49
49
|
|
|
50
|
+
import VueI18n from 'vue-i18n'; //多语言
|
|
50
51
|
|
|
52
|
+
// 导入多语言的 JSON 文件
|
|
53
|
+
import enLocale from './locales/en.json';
|
|
54
|
+
import cnLocale from './locales/cn.json';
|
|
55
|
+
|
|
56
|
+
Vue.use(VueI18n);
|
|
57
|
+
// 创建 VueI18n 实例,并设置默认语言和多语言内容
|
|
58
|
+
const i18n = new VueI18n({
|
|
59
|
+
locale: 'en', // 默认语言
|
|
60
|
+
messages: {
|
|
61
|
+
en: enLocale, // 英文
|
|
62
|
+
cn: cnLocale, // 中文
|
|
63
|
+
// 其他语言...
|
|
64
|
+
}
|
|
65
|
+
});
|
|
51
66
|
|
|
52
67
|
Vue.prototype.requestUrl = requestUrl;
|
|
53
68
|
Vue.prototype.utils = utils;
|
|
54
69
|
|
|
55
70
|
new Vue({
|
|
56
71
|
render: h => h(App),
|
|
72
|
+
i18n,
|
|
57
73
|
}).$mount('#app')
|
|
@@ -1,301 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="qw-feedback">
|
|
3
|
-
<div class="qw-guide-text" v-if="msg.content.guideText">
|
|
4
|
-
<!-- 不要替换成图片地址或者字体 -->
|
|
5
|
-
<svg
|
|
6
|
-
t="1730450955692"
|
|
7
|
-
class="icon"
|
|
8
|
-
viewBox="0 0 1024 1024"
|
|
9
|
-
version="1.1"
|
|
10
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
-
p-id="8682"
|
|
12
|
-
width="22"
|
|
13
|
-
height="22"
|
|
14
|
-
>
|
|
15
|
-
<path
|
|
16
|
-
d="M565.096296 289.185185s-0.948148 0 0 0c-110.933333-20.859259-208.592593 40.77037-237.985185 148.859259-14.222222 53.096296-24.651852 101.451852 44.562963 221.866667 14.222222 25.6 11.377778 70.162963 8.533333 95.762963-1.896296 14.222222 64.474074 36.02963 89.125926 42.666667l95.762963-509.155556z"
|
|
17
|
-
fill="#FDB813"
|
|
18
|
-
p-id="8683"
|
|
19
|
-
></path>
|
|
20
|
-
<path
|
|
21
|
-
d="M732.918519 513.896296c11.377778-111.881481-56.888889-203.851852-166.874075-224.711111h-0.948148L469.333333 798.340741c25.6 2.844444 94.814815 6.637037 98.607408-7.585185 6.637037-25.6 20.859259-67.318519 42.666666-86.281482C719.644444 618.192593 727.22963 568.888889 732.918519 513.896296z"
|
|
22
|
-
fill="#FD9B13"
|
|
23
|
-
p-id="8684"
|
|
24
|
-
></path>
|
|
25
|
-
<path
|
|
26
|
-
d="M467.437037 806.874074c-7.585185-0.948148-12.325926-7.585185-14.222222-14.222222l-38.874074-256c-0.948148-5.688889 0.948148-11.377778 4.74074-15.170371 3.792593-3.792593 9.481481-5.688889 15.170371-4.74074l167.822222 31.288889c5.688889 0.948148 10.42963 4.740741 12.325926 9.481481 1.896296 4.740741 1.896296 11.377778-0.948148 16.118519L486.4 798.340741c-3.792593 6.637037-11.377778 10.42963-18.962963 8.533333z m-14.222222-251.259259l27.496296 182.992592L572.681481 578.37037l-119.466666-22.755555z"
|
|
27
|
-
fill="#F12A3F"
|
|
28
|
-
p-id="8685"
|
|
29
|
-
></path>
|
|
30
|
-
<path
|
|
31
|
-
d="M375.466667 709.214815l-25.6 137.481481c0 2.844444 1.896296 5.688889 7.585185 10.42963l65.422222 54.992593c5.688889 4.740741 15.17037 8.533333 23.703704 10.429629l36.029629-193.422222-107.14074-19.911111z"
|
|
32
|
-
fill="#2D4375"
|
|
33
|
-
p-id="8686"
|
|
34
|
-
></path>
|
|
35
|
-
<path
|
|
36
|
-
d="M482.607407 729.125926l-36.029629 193.422222c9.481481 1.896296 18.014815 1.896296 25.6-0.948148l80.592592-27.496296c6.637037-1.896296 10.42963-4.740741 11.377778-6.637037L589.748148 749.037037l-107.140741-19.911111z"
|
|
37
|
-
fill="#1E2D4F"
|
|
38
|
-
p-id="8687"
|
|
39
|
-
></path>
|
|
40
|
-
<path
|
|
41
|
-
d="M612.503704 217.125926c-3.792593 18.014815-20.859259 29.392593-38.874074 26.548148-18.014815-3.792593-30.340741-20.859259-26.548149-38.874074l18.962963-100.503704c3.792593-18.014815 20.859259-29.392593 38.874075-26.548148 18.014815 3.792593 30.340741 20.859259 26.548148 38.874074l-18.962963 100.503704z"
|
|
42
|
-
fill="#FDB813"
|
|
43
|
-
p-id="8688"
|
|
44
|
-
></path>
|
|
45
|
-
<path
|
|
46
|
-
d="M382.103704 228.503704c10.42963 15.17037 6.637037 36.02963-8.533334 46.459259-15.17037 10.42963-36.02963 6.637037-46.459259-8.533333l-57.837037-84.385186c-10.42963-15.17037-6.637037-36.02963 8.533333-46.459259 15.17037-10.42963 36.02963-6.637037 46.45926 8.533334l57.837037 84.385185zM757.57037 298.666667c-15.17037 10.42963-18.962963 31.288889-8.533333 46.459259 10.42963 15.17037 31.288889 18.962963 46.459259 8.533333l84.385185-57.837037c15.17037-10.42963 18.962963-31.288889 8.533334-46.459259-10.42963-15.17037-31.288889-18.962963-46.459259-8.533333l-84.385186 57.837037z"
|
|
47
|
-
fill="#FDB813"
|
|
48
|
-
p-id="8689"
|
|
49
|
-
></path>
|
|
50
|
-
<path
|
|
51
|
-
d="M252.207407 361.244444c18.014815 3.792593 30.340741 20.859259 26.548149 38.874075-3.792593 18.014815-20.859259 29.392593-38.874075 26.548148l-100.503703-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874074 3.792593-18.014815 20.859259-29.392593 38.874074-26.548149l100.503703 18.962963zM931.081481 488.296296c18.014815 3.792593 30.340741 20.859259 26.548149 38.874074-3.792593 18.014815-20.859259 29.392593-38.874074 26.548149l-100.503704-18.962963c-18.014815-3.792593-30.340741-20.859259-26.548148-38.874075 3.792593-18.014815 20.859259-29.392593 38.874074-26.548148l100.503703 18.962963z"
|
|
52
|
-
fill="#FDB813"
|
|
53
|
-
p-id="8690"
|
|
54
|
-
></path>
|
|
55
|
-
<path
|
|
56
|
-
d="M593.540741 807.822222c1.896296-7.585185-3.792593-15.17037-11.377778-16.118518l-107.140741-19.911111-4.740741 27.496296 107.140741 19.911111c6.637037 0.948148 14.222222-3.792593 16.118519-11.377778z"
|
|
57
|
-
fill="#CEEFF6"
|
|
58
|
-
p-id="8691"
|
|
59
|
-
></path>
|
|
60
|
-
<path
|
|
61
|
-
d="M366.933333 750.933333c-7.585185-1.896296-15.17037 3.792593-16.118518 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.14074 19.911111 4.740741-27.496297-107.140741-19.911111zM356.503704 808.77037c-7.585185-1.896296-15.17037 3.792593-16.118519 11.377778-1.896296 7.585185 3.792593 15.17037 11.377778 16.118519l107.140741 19.911111 4.74074-27.496297-107.14074-19.911111z"
|
|
62
|
-
fill="#FFFFFF"
|
|
63
|
-
p-id="8692"
|
|
64
|
-
></path>
|
|
65
|
-
<path
|
|
66
|
-
d="M570.785185 848.592593l-107.140741-19.911112-4.74074 27.496297 107.14074 19.911111c7.585185 1.896296 15.17037-3.792593 16.118519-11.377778 1.896296-7.585185-2.844444-15.17037-11.377778-16.118518z"
|
|
67
|
-
fill="#CEEFF6"
|
|
68
|
-
p-id="8693"
|
|
69
|
-
></path>
|
|
70
|
-
</svg>
|
|
71
|
-
<!-- 不要替换成图片地址或者字体 -->
|
|
72
|
-
<p class="radio-description" v-html="msg.content.guideText"></p>
|
|
73
|
-
</div>
|
|
74
|
-
|
|
75
|
-
<div class="options-list">
|
|
76
|
-
<div
|
|
77
|
-
v-for="(option, index) in showOptions"
|
|
78
|
-
class="options-item"
|
|
79
|
-
:class="
|
|
80
|
-
index !== msg.content.questionList.length - 1
|
|
81
|
-
? 'recommend-item'
|
|
82
|
-
: 'last-item'
|
|
83
|
-
"
|
|
84
|
-
:key="'qwfeedback_' + index"
|
|
85
|
-
@click="handleWelcome(option)"
|
|
86
|
-
>
|
|
87
|
-
<span> {{ getFilteredName(option) }}</span>
|
|
88
|
-
<i class="arsenal_icon arsenalangle-right-solid"></i>
|
|
89
|
-
</div>
|
|
90
|
-
</div>
|
|
91
|
-
<div v-if="showPage" class="switch-page">
|
|
92
|
-
<!-- <span @click="changeActivePage" class="switch-page-btn"
|
|
93
|
-
>换一批</span
|
|
94
|
-
> -->
|
|
95
|
-
<span @click="showMore" class="switch-page-btn">查看更多</span>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
</template>
|
|
99
|
-
|
|
100
|
-
<script>
|
|
101
|
-
export default {
|
|
102
|
-
name: "answerRadio",
|
|
103
|
-
data() {
|
|
104
|
-
return {
|
|
105
|
-
isMobile: false,
|
|
106
|
-
formatOptions: [],
|
|
107
|
-
activeIndex: 0,
|
|
108
|
-
pageSize: 5,
|
|
109
|
-
showPage: false,
|
|
110
|
-
showOptions: [],
|
|
111
|
-
};
|
|
112
|
-
},
|
|
113
|
-
props: ["msg"],
|
|
114
|
-
mounted() {
|
|
115
|
-
console.log(this.msg, "msg");
|
|
116
|
-
// 关键词推荐 前端分页
|
|
117
|
-
if (this.msg.content.questionList.length > this.pageSize) {
|
|
118
|
-
this.formatOptions = this.chunkArray(
|
|
119
|
-
this.msg.content.questionList,
|
|
120
|
-
this.pageSize
|
|
121
|
-
);
|
|
122
|
-
this.activeIndex = 0;
|
|
123
|
-
this.showPage = true;
|
|
124
|
-
} else {
|
|
125
|
-
this.formatOptions = [this.msg.content.questionList];
|
|
126
|
-
this.activeIndex = 0;
|
|
127
|
-
}
|
|
128
|
-
this.showOptions = this.formatOptions[0];
|
|
129
|
-
this.judgeIsMobile();
|
|
130
|
-
},
|
|
131
|
-
methods: {
|
|
132
|
-
getFilteredName(name) {
|
|
133
|
-
if (typeof name === "string") {
|
|
134
|
-
return name.replace(/<\/?p>/g, "");
|
|
135
|
-
} else {
|
|
136
|
-
return name;
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
|
-
showMore() {
|
|
140
|
-
if (this.activeIndex == this.formatOptions.length - 2) {
|
|
141
|
-
this.activeIndex++;
|
|
142
|
-
this.showPage = false;
|
|
143
|
-
} else {
|
|
144
|
-
this.activeIndex++;
|
|
145
|
-
}
|
|
146
|
-
this.showOptions = [
|
|
147
|
-
...this.showOptions.concat(
|
|
148
|
-
this.formatOptions[this.activeIndex]
|
|
149
|
-
),
|
|
150
|
-
];
|
|
151
|
-
},
|
|
152
|
-
changeActivePage() {
|
|
153
|
-
if (this.activeIndex >= this.formatOptions.length - 1) {
|
|
154
|
-
this.activeIndex = 0;
|
|
155
|
-
} else {
|
|
156
|
-
this.activeIndex++;
|
|
157
|
-
}
|
|
158
|
-
this.showOptions = this.formatOptions[this.activeIndex];
|
|
159
|
-
},
|
|
160
|
-
chunkArray(array, size) {
|
|
161
|
-
let chunks = [];
|
|
162
|
-
for (let i = 0; i < array.length; i += size) {
|
|
163
|
-
let chunk = array.slice(i, i + size);
|
|
164
|
-
chunks.push(chunk);
|
|
165
|
-
}
|
|
166
|
-
return chunks;
|
|
167
|
-
},
|
|
168
|
-
judgeIsMobile() {
|
|
169
|
-
let flag = navigator.userAgent.match(
|
|
170
|
-
/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
|
|
171
|
-
);
|
|
172
|
-
if (flag) {
|
|
173
|
-
this.isMobile = true;
|
|
174
|
-
} else {
|
|
175
|
-
this.isMobile = false;
|
|
176
|
-
}
|
|
177
|
-
console.log(this.isMobile, "this.isMobile");
|
|
178
|
-
},
|
|
179
|
-
handleWelcome (item) {
|
|
180
|
-
console.log(item, 'item');
|
|
181
|
-
|
|
182
|
-
this.$emit('handleWelcome', item)
|
|
183
|
-
},
|
|
184
|
-
radioClick(msg, option, index) {
|
|
185
|
-
let value = option.answerId
|
|
186
|
-
? msg.id +
|
|
187
|
-
"_" +
|
|
188
|
-
index +
|
|
189
|
-
"_" +
|
|
190
|
-
option.value +
|
|
191
|
-
"_" +
|
|
192
|
-
option.name +
|
|
193
|
-
"_" +
|
|
194
|
-
option.answerId
|
|
195
|
-
: msg.id + "_" + index + "_" + option.value + "_" + option.name;
|
|
196
|
-
this.$emit(
|
|
197
|
-
"onRadioClick",
|
|
198
|
-
value,
|
|
199
|
-
option.name,
|
|
200
|
-
msg.apiKey,
|
|
201
|
-
msg.actionCategory,
|
|
202
|
-
msg.msgId ? msg.msgId : "",
|
|
203
|
-
option.apiKey
|
|
204
|
-
);
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
};
|
|
208
|
-
</script>
|
|
209
|
-
|
|
210
|
-
<style scoped lang="less">
|
|
211
|
-
.qw-feedback {
|
|
212
|
-
background-color: white;
|
|
213
|
-
padding-bottom: 16px;
|
|
214
|
-
.qw-guide-text {
|
|
215
|
-
display: flex;
|
|
216
|
-
justify-content: flex-start;
|
|
217
|
-
align-items: center;
|
|
218
|
-
background-color: #f2f5ff;
|
|
219
|
-
padding: 16px;
|
|
220
|
-
.radio-description {
|
|
221
|
-
margin-left: 6px;
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
.switch-page {
|
|
225
|
-
margin-top: 10px;
|
|
226
|
-
display: flex;
|
|
227
|
-
flex-direction: column;
|
|
228
|
-
align-items: center;
|
|
229
|
-
.switch-page-btn {
|
|
230
|
-
width: 80px;
|
|
231
|
-
height: 24px;
|
|
232
|
-
border-radius: 15px;
|
|
233
|
-
border: solid 1px #366aff;
|
|
234
|
-
color: #366aff;
|
|
235
|
-
line-height: 24px;
|
|
236
|
-
text-align: center;
|
|
237
|
-
cursor: pointer;
|
|
238
|
-
font-size: 12px;
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
.radio-description {
|
|
242
|
-
word-wrap: break-word;
|
|
243
|
-
word-break: break-all;
|
|
244
|
-
overflow: hidden;
|
|
245
|
-
/*padding: 8px 10px 10px 0;*/
|
|
246
|
-
height: auto;
|
|
247
|
-
/* border-bottom: 1px solid #EEEEEE;*/
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.bottom-link {
|
|
251
|
-
height: 1px;
|
|
252
|
-
background-color: #eeeeee;
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
.options-list {
|
|
256
|
-
padding-top: 4px;
|
|
257
|
-
/* padding-top: 10px;*/
|
|
258
|
-
padding-left: 16px;
|
|
259
|
-
padding-right: 16px;
|
|
260
|
-
|
|
261
|
-
.options-item {
|
|
262
|
-
// height: 25px;
|
|
263
|
-
line-height: 25px;
|
|
264
|
-
background-color: #ffffff;
|
|
265
|
-
color: #366aff;
|
|
266
|
-
cursor: pointer;
|
|
267
|
-
display: flex;
|
|
268
|
-
align-items: center;
|
|
269
|
-
justify-content: space-between;
|
|
270
|
-
|
|
271
|
-
i {
|
|
272
|
-
padding-left: 10px;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
.options-item-text {
|
|
276
|
-
text-overflow: ellipsis;
|
|
277
|
-
display: -webkit-box; //使用了flex,需要加
|
|
278
|
-
overflow: hidden; //超出隐藏
|
|
279
|
-
word-break: break-all; //纯英文、数字、中文
|
|
280
|
-
text-overflow: ellipsis; //省略号
|
|
281
|
-
-webkit-box-orient: vertical; //垂直
|
|
282
|
-
-webkit-line-clamp: 1; //显示一行
|
|
283
|
-
white-space: pre-line; //
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
.recommend-item {
|
|
288
|
-
padding: 8px 0;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.last-item {
|
|
292
|
-
padding-top: 8px;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
.end {
|
|
296
|
-
border-bottom-left-radius: 25px !important;
|
|
297
|
-
border-bottom-right-radius: 25px !important;
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
</style>
|