askbot-dragon 1.6.21-beta → 1.6.21
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 +8 -11
- package/public/index.html +9 -8
- 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/AliyunlssUtil.js +35 -10
- package/src/assets/js/common.js +241 -0
- package/src/components/ActionAlertIframe.vue +1 -0
- package/src/components/AiGuide.vue +7 -4
- package/src/components/AnswerDocknowledge.vue +930 -389
- package/src/components/ConversationContainer.vue +7111 -1058
- package/src/components/MyEditor.vue +342 -0
- package/src/components/QwFeedback.vue +303 -0
- package/src/components/actionSatisfaction.vue +2 -2
- package/src/components/actionSendToBot.vue +2 -2
- package/src/components/answerRadio.vue +145 -64
- package/src/components/askVideo.vue +3 -6
- package/src/components/assetDetails.vue +14 -6
- package/src/components/assetMessage.vue +14 -13
- package/src/components/associationIntention.vue +31 -6
- package/src/components/fielListView.vue +1 -1
- package/src/components/file/AliyunOssComponents.vue +1 -1
- package/src/components/formTemplate.vue +1590 -1674
- package/src/components/imgView.vue +32 -0
- package/src/components/intelligentSummary.vue +231 -0
- package/src/components/markDownText.vue +198 -0
- package/src/components/myPopup.vue +14 -11
- package/src/components/pagination.vue +129 -0
- package/src/components/pdfPosition.vue +112 -90
- package/src/components/popup.vue +8 -7
- package/src/components/preview/docView.vue +114 -0
- package/src/components/preview/excelView.vue +187 -0
- package/src/components/preview/newPositionPreview.vue +370 -0
- package/src/components/preview/pdfView.vue +824 -0
- package/src/components/previewDoc.vue +6 -0
- package/src/components/previewPdf.vue +963 -200
- package/src/components/receiverMessagePlatform.vue +25 -21
- package/src/components/recommend.vue +2 -2
- package/src/components/senderMessagePlatform.vue +21 -13
- package/src/components/tree.vue +116 -103
- package/src/components/utils/AliyunIssUtil.js +35 -13
- package/src/components/utils/ckeditor.js +64 -56
- package/src/components/welcomeKnowledgeFile.vue +344 -0
- package/src/components/welcomeLlmCard.vue +141 -0
- package/src/components/welcomeSuggest.vue +98 -0
- package/src/locales/cn.json +62 -0
- package/src/locales/en.json +62 -0
- package/src/main.js +19 -3
- package/vue.config.js +0 -1
- package/src/assets/js/obsBrowser.js +0 -63
- package/src/components/utils/ckeditorImageUpload/command.js +0 -112
- 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 -175
- 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 -35
|
@@ -1,17 +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
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
+
};
|
|
12
22
|
}
|
|
23
|
+
}
|
|
13
24
|
class MyUploadAdapter {
|
|
14
|
-
constructor(
|
|
25
|
+
constructor(loader, editor) {
|
|
15
26
|
// 要在上载期间使用的文件加载器实例
|
|
16
27
|
this.loader = loader;
|
|
17
28
|
this.editor = editor
|
|
@@ -20,7 +31,7 @@ class MyUploadAdapter {
|
|
|
20
31
|
// 启动上载过程
|
|
21
32
|
upload() {
|
|
22
33
|
return this.loader.file
|
|
23
|
-
.then(
|
|
34
|
+
.then(file => new Promise(() => {
|
|
24
35
|
/* this._initRequest();
|
|
25
36
|
this._initListeners( resolve, reject, file );
|
|
26
37
|
this._sendRequest( file );*/
|
|
@@ -38,8 +49,8 @@ class MyUploadAdapter {
|
|
|
38
49
|
options: {
|
|
39
50
|
name: file.name + '正在上传...',
|
|
40
51
|
data: uid,
|
|
41
|
-
editable:false,
|
|
42
|
-
type:'upload'
|
|
52
|
+
editable: false,
|
|
53
|
+
type: 'upload'
|
|
43
54
|
}
|
|
44
55
|
})
|
|
45
56
|
this.uploadFile(file)
|
|
@@ -48,35 +59,32 @@ class MyUploadAdapter {
|
|
|
48
59
|
|
|
49
60
|
// 中止上载过程
|
|
50
61
|
abort() {
|
|
51
|
-
if (
|
|
62
|
+
if (this.xhr) {
|
|
52
63
|
this.xhr.abort();
|
|
53
64
|
}
|
|
54
65
|
}
|
|
55
|
-
uploadFile(file){
|
|
66
|
+
uploadFile(file) {
|
|
56
67
|
let imgInfo = {
|
|
57
|
-
url:'',
|
|
68
|
+
url: '',
|
|
58
69
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
// imgInfo.url = ossFileUrl(ossConfig, resp.name)
|
|
68
|
-
imgInfo.url = resp.url;
|
|
69
|
-
let root = this.editor.model.document.getRoot()
|
|
70
|
+
let res = multipartUpload(
|
|
71
|
+
file,
|
|
72
|
+
null,
|
|
73
|
+
imgInfo
|
|
74
|
+
);
|
|
75
|
+
res.then(resp => {
|
|
76
|
+
imgInfo.url = ossFileUrl(resp.name)
|
|
77
|
+
let root = this.editor.model.document.getRoot()
|
|
70
78
|
let children = root.getChildren()
|
|
71
|
-
for(let child of children){
|
|
79
|
+
for (let child of children) {
|
|
72
80
|
for (let index = 0; index < child._children._nodes.length; index++) {
|
|
73
|
-
if(child._children._nodes[index].name == 'askComponentPlaceholderContainer'){
|
|
74
|
-
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]) {
|
|
75
83
|
let attrs = child._children._nodes[index]._children._nodes[0]._attrs
|
|
76
|
-
if(attrs) {
|
|
84
|
+
if (attrs) {
|
|
77
85
|
let attrsList = [...attrs.keys()]
|
|
78
86
|
for (let j = 0; j < attrsList.length; j++) {
|
|
79
|
-
if(attrsList[j] == 'data') {
|
|
87
|
+
if (attrsList[j] == 'data') {
|
|
80
88
|
// this.editor.uploadImg = this.editor.uploadImg.filter(id =>{return id != attrs.get(attrsList[j])})
|
|
81
89
|
this.editor.model.change(writer => {
|
|
82
90
|
writer.remove(child._children._nodes[index]);
|
|
@@ -92,7 +100,7 @@ class MyUploadAdapter {
|
|
|
92
100
|
command.execute({
|
|
93
101
|
tag: "img",
|
|
94
102
|
options: {
|
|
95
|
-
width:'100%',
|
|
103
|
+
width: '100%',
|
|
96
104
|
alt: resp.name + 0,
|
|
97
105
|
src: imgInfo.url
|
|
98
106
|
},
|
|
@@ -106,68 +114,68 @@ class MyUploadAdapter {
|
|
|
106
114
|
_initRequest() {
|
|
107
115
|
const xhr = this.xhr = new XMLHttpRequest();
|
|
108
116
|
console.log(xhr)
|
|
109
|
-
xhr.open(
|
|
117
|
+
xhr.open('POST', '/open-api/oss/public?token=8c98087dfd2d48f856d8c95c09115def', true);
|
|
110
118
|
xhr.responseType = '';
|
|
111
119
|
}
|
|
112
120
|
|
|
113
121
|
// 初始化 XMLHttpRequest 监听.
|
|
114
|
-
_initListeners(
|
|
122
|
+
_initListeners(resolve, reject, file) {
|
|
115
123
|
const xhr = this.xhr;
|
|
116
124
|
const loader = this.loader;
|
|
117
125
|
console.log(this.loader)
|
|
118
|
-
const genericErrorText = `无法上传文件: ${
|
|
126
|
+
const genericErrorText = `无法上传文件: ${file.name}.`;
|
|
119
127
|
|
|
120
|
-
xhr.addEventListener(
|
|
121
|
-
xhr.addEventListener(
|
|
122
|
-
xhr.addEventListener(
|
|
128
|
+
xhr.addEventListener('error', () => reject(genericErrorText));
|
|
129
|
+
xhr.addEventListener('abort', () => reject());
|
|
130
|
+
xhr.addEventListener('load', () => {
|
|
123
131
|
const response = xhr.response;
|
|
124
132
|
// 当code==200说明上传成功,可以增加弹框提示;
|
|
125
133
|
// 当上传失败时,必须调用reject()函数。
|
|
126
134
|
|
|
127
135
|
console.log('response', xhr)
|
|
128
136
|
|
|
129
|
-
if (
|
|
130
|
-
return reject(
|
|
137
|
+
if (!response || response.error) {
|
|
138
|
+
return reject(response && response.error ? response.error.message : genericErrorText);
|
|
131
139
|
}
|
|
132
140
|
//上传成功,从后台获取图片的url地址
|
|
133
|
-
resolve(
|
|
141
|
+
resolve({
|
|
134
142
|
default: response
|
|
135
|
-
}
|
|
136
|
-
}
|
|
143
|
+
});
|
|
144
|
+
});
|
|
137
145
|
|
|
138
146
|
// 支持时上传进度。文件加载器有#uploadTotal和#upload属性,用于在编辑器用户界面中显示上载进度栏。
|
|
139
|
-
if (
|
|
140
|
-
xhr.upload.addEventListener(
|
|
141
|
-
if (
|
|
147
|
+
if (xhr.upload) {
|
|
148
|
+
xhr.upload.addEventListener('progress', evt => {
|
|
149
|
+
if (evt.lengthComputable) {
|
|
142
150
|
loader.uploadTotal = evt.total;
|
|
143
151
|
loader.uploaded = evt.loaded;
|
|
144
152
|
}
|
|
145
|
-
}
|
|
153
|
+
});
|
|
146
154
|
}
|
|
147
155
|
}
|
|
148
156
|
|
|
149
157
|
// 准备数据并发送请求
|
|
150
|
-
_sendRequest(
|
|
158
|
+
_sendRequest(file) {
|
|
151
159
|
//通过FormData构造函数创建一个空对象
|
|
152
160
|
const data = new FormData();
|
|
153
161
|
//通过append()方法在末尾追加key为files值为file的数据
|
|
154
162
|
|
|
155
|
-
console.log('file',file)
|
|
156
|
-
data.append(
|
|
163
|
+
console.log('file', file)
|
|
164
|
+
data.append('file', file);//上传的参数data
|
|
157
165
|
// data.append( 'memberId', "666" );
|
|
158
166
|
/**
|
|
159
167
|
* 重要提示:这是实现诸如身份验证和CSRF保护等安全机制的正确位置。
|
|
160
168
|
* 例如,可以使用XMLHttpRequest.setRequestHeader()设置包含应用程序先前生成的CSRF令牌的请求头。
|
|
161
169
|
*/
|
|
162
|
-
this.xhr.send(
|
|
170
|
+
this.xhr.send(data);
|
|
163
171
|
}
|
|
164
172
|
}
|
|
165
173
|
|
|
166
|
-
function MyCustomUploadAdapterPlugin(
|
|
167
|
-
editor.plugins.get(
|
|
174
|
+
function MyCustomUploadAdapterPlugin(editor) {
|
|
175
|
+
editor.plugins.get('FileRepository').createUploadAdapter = (loader) => {
|
|
168
176
|
// 在这里将URL配置为后端上载脚本
|
|
169
|
-
console.log(loader,'loader');
|
|
170
|
-
return new MyUploadAdapter(
|
|
177
|
+
console.log(loader, 'loader');
|
|
178
|
+
return new MyUploadAdapter(loader, editor);
|
|
171
179
|
}
|
|
172
180
|
}
|
|
173
181
|
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="message_list_welcome_knowledge_file">
|
|
3
|
+
<div class="mlwm-title" v-if="msgContent.enableTitle">{{ msgContent.title }}</div>
|
|
4
|
+
<div class="mlwm-des" v-if="msgContent.enableDescription">
|
|
5
|
+
<span class="mlwm-des-pre">{{ msgContent.description }}</span>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="mlwm-msg-type">
|
|
8
|
+
<div
|
|
9
|
+
v-for="(item, itemIndex) in msgContent.knowledgeFileInfos"
|
|
10
|
+
:key="item.id"
|
|
11
|
+
:class="['mmt-cell', 'mmt-cell-' + itemIndex]"
|
|
12
|
+
@click="clickFun(item)"
|
|
13
|
+
>
|
|
14
|
+
<div class="mmt-cell-img">
|
|
15
|
+
<img :src="fileIcon(item.type)" alt srcset />
|
|
16
|
+
</div>
|
|
17
|
+
<div class="mmt-cell-des">
|
|
18
|
+
<span class="mmt-cell-des-title">{{item.name}}</span>
|
|
19
|
+
<span class="mmt-cell-des-detail">
|
|
20
|
+
<div class="mmt-cell-avatar">
|
|
21
|
+
<img v-if="item.creatorAvatar" :src="item.creatorAvatar" alt srcset />
|
|
22
|
+
<img v-else src="../assets/image/default_avt_ui.png" alt srcset />
|
|
23
|
+
</div>
|
|
24
|
+
<div class="mmt-creator-name">{{ item.creatorName }}</div>
|
|
25
|
+
<div class="mmt-border"></div>
|
|
26
|
+
<div class="mmt-update-time">{{ new Date(item.updateTime).Format('yyyy-MM-dd hh:mm') }}</div>
|
|
27
|
+
</span>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
<div v-if="msgContent.knowledgeFileInfos.length % 2 != 0" class="mmt-cell booth_elements"></div>
|
|
31
|
+
<!-- v-if="msgContent.totalCount > msgContent.knowledgeFileInfos.length" -->
|
|
32
|
+
|
|
33
|
+
<div class="load_moreKnowledge" v-if="page < msgContent.totalPages" @click="loadMore">
|
|
34
|
+
<span>{{$t('dragonCommon.viewMore')}}</span>
|
|
35
|
+
</div>
|
|
36
|
+
</div>
|
|
37
|
+
<previewPdf ref="previewPdf"
|
|
38
|
+
:url="previewHref"
|
|
39
|
+
:previewOssPath="previewOssPath"
|
|
40
|
+
:sourceFileType="sourceFileType"
|
|
41
|
+
officePreviewType="pdf"
|
|
42
|
+
@previewToDialog="previewToDialog"
|
|
43
|
+
@recommendQues="recommendQues"
|
|
44
|
+
@close="close"
|
|
45
|
+
@open="open"
|
|
46
|
+
:isHasChat="isHasChat"
|
|
47
|
+
:knowledgeId="previewKnowledgeId"
|
|
48
|
+
></previewPdf>
|
|
49
|
+
</div>
|
|
50
|
+
</template>
|
|
51
|
+
|
|
52
|
+
<script>
|
|
53
|
+
import { imageTypeObj, isMobile } from "../assets/js/common";
|
|
54
|
+
import previewPdf from "./previewPdf";
|
|
55
|
+
export default {
|
|
56
|
+
name: "welcomeKnowledgeFile",
|
|
57
|
+
props: {
|
|
58
|
+
msgContent: {
|
|
59
|
+
type: Object,
|
|
60
|
+
default () {
|
|
61
|
+
return {}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
mainId: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: ''
|
|
67
|
+
},
|
|
68
|
+
corpId: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: ''
|
|
71
|
+
},
|
|
72
|
+
userId: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: ''
|
|
75
|
+
},
|
|
76
|
+
externalPreview: {
|
|
77
|
+
type: Boolean,
|
|
78
|
+
default: false
|
|
79
|
+
},
|
|
80
|
+
isHasChat:{
|
|
81
|
+
type: Boolean,
|
|
82
|
+
default: false
|
|
83
|
+
},
|
|
84
|
+
askKnowledgeId:{
|
|
85
|
+
type: String,
|
|
86
|
+
default: ''
|
|
87
|
+
},
|
|
88
|
+
activeKnowledgeId:{
|
|
89
|
+
type: String,
|
|
90
|
+
default: ''
|
|
91
|
+
},
|
|
92
|
+
bindCode:{
|
|
93
|
+
type: String,
|
|
94
|
+
default: ''
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
data () {
|
|
98
|
+
return {
|
|
99
|
+
previewHref: "",
|
|
100
|
+
sourceFileType: '',
|
|
101
|
+
page: 1,
|
|
102
|
+
previewKnowledgeId:"",
|
|
103
|
+
previewKnowledge:{},
|
|
104
|
+
previewOssPath:""
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
components: {
|
|
108
|
+
previewPdf
|
|
109
|
+
},
|
|
110
|
+
methods: {
|
|
111
|
+
fileIcon (type) {
|
|
112
|
+
return require('../assets/image/filtType/' + imageTypeObj[type] + '.png')
|
|
113
|
+
},
|
|
114
|
+
clickFun (item) {
|
|
115
|
+
if(this.externalPreview) {
|
|
116
|
+
this.$emit('knowledgeClickFun', item);
|
|
117
|
+
return
|
|
118
|
+
}
|
|
119
|
+
this.previewKnowledge = item;
|
|
120
|
+
this.previewKnowledgeId = item.knowledgeId
|
|
121
|
+
this.$refs.previewPdf.previewShowPopup = false;
|
|
122
|
+
this.$refs.previewPdf.drawer = false;
|
|
123
|
+
this.previewOssPath = item.url;
|
|
124
|
+
let index = item.url.lastIndexOf('?')
|
|
125
|
+
let type = ''
|
|
126
|
+
let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate'
|
|
127
|
+
if (index !== -1) {
|
|
128
|
+
item.url = item.url.substring(0, index)
|
|
129
|
+
type = this.fileType(item.url)
|
|
130
|
+
} else {
|
|
131
|
+
type = this.fileType(item.url)
|
|
132
|
+
}
|
|
133
|
+
if (type === '' || type === 'OTHER') {
|
|
134
|
+
httpUrl = httpUrl += '?needEncrypt=true'
|
|
135
|
+
} else {
|
|
136
|
+
httpUrl = httpUrl += '?needEncrypt=false'
|
|
137
|
+
}
|
|
138
|
+
this.$http.post(httpUrl, {
|
|
139
|
+
"fileInOssPath": item.url
|
|
140
|
+
}).then(res => {
|
|
141
|
+
if (res.data.code == '0') {
|
|
142
|
+
this.previewHref = res.data.data;
|
|
143
|
+
this.sourceFileType = item.url.substring(item.url.lastIndexOf('.'))
|
|
144
|
+
let isOhmPc = sessionStorage.getItem('isOhmPc')
|
|
145
|
+
if (isMobile() || isOhmPc == 'true') {
|
|
146
|
+
this.$refs.previewPdf.drawer = true;
|
|
147
|
+
this.$refs.previewPdf.previewShowPopup = true;
|
|
148
|
+
} else {
|
|
149
|
+
this.$refs.previewPdf.previewShowPopup = false;
|
|
150
|
+
this.$refs.previewPdf.drawer = true;
|
|
151
|
+
}
|
|
152
|
+
//聊一聊按钮的选中状态
|
|
153
|
+
if (this.activeKnowledgeId == item.knowledgeId){
|
|
154
|
+
this.$refs.previewPdf.previewKnowledgeId = this.activeKnowledgeId
|
|
155
|
+
} else {
|
|
156
|
+
this.$refs.previewPdf.previewKnowledgeId = ""
|
|
157
|
+
}
|
|
158
|
+
this.$refs.previewPdf.fileType = type
|
|
159
|
+
this.$refs.previewPdf.tagIds = item.tagIds
|
|
160
|
+
this.$refs.previewPdf.isMessageRecord = this.isMessageRecord ? true : false
|
|
161
|
+
if (item.tagIds && item.tagIds.length != 0) {
|
|
162
|
+
this.$refs.previewPdf.loading = false
|
|
163
|
+
return
|
|
164
|
+
}
|
|
165
|
+
this.$nextTick(() => {
|
|
166
|
+
if (item.source == 'CREATED_BY_ONESELF' || type === 'HTML') {
|
|
167
|
+
this.$refs.previewPdf.getBolb(item)
|
|
168
|
+
}
|
|
169
|
+
this.$refs.previewPdf.loadIframe(item)
|
|
170
|
+
this.$refs.previewPdf.showSummary = true;
|
|
171
|
+
})
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
},
|
|
175
|
+
fileType (url) {
|
|
176
|
+
const fileType = url.substring(url.lastIndexOf('.'));
|
|
177
|
+
if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.MOV' || fileType === '.MOVC' || fileType === '.mov' || fileType === '.movc' || fileType === '.mav' || fileType === '.MAV' || fileType == '.mp3' || fileType == '.MP3' || fileType === '.wav') {
|
|
178
|
+
return 'VIDEO'
|
|
179
|
+
} else if (fileType === '.html') {
|
|
180
|
+
return 'HTML'
|
|
181
|
+
} else {
|
|
182
|
+
return 'OTHER'
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
loadMore () {
|
|
186
|
+
this.page = this.page + 1
|
|
187
|
+
let params = {
|
|
188
|
+
mainId: this.mainId,
|
|
189
|
+
corpId: this.corpId,
|
|
190
|
+
userId: this.userId,
|
|
191
|
+
page: this.page,
|
|
192
|
+
lastDays: this.msgContent.lastDays,
|
|
193
|
+
pageSize: this.msgContent.pageSize,
|
|
194
|
+
limitCount: this.msgContent.limitCount,
|
|
195
|
+
bindCode:this.bindCode
|
|
196
|
+
}
|
|
197
|
+
this.$http.post('/knowledge-api/knowledge/search/page', params).then(res => {
|
|
198
|
+
if (res.data && res.data.list && res.data.list.length != 0) {
|
|
199
|
+
this.msgContent.knowledgeFileInfos = this.msgContent.knowledgeFileInfos.concat(res.data.list)
|
|
200
|
+
}
|
|
201
|
+
})
|
|
202
|
+
},
|
|
203
|
+
previewToDialog(flag){
|
|
204
|
+
if (!flag){
|
|
205
|
+
this.$refs.previewPdf.previewKnowledgeId = ""
|
|
206
|
+
} else {
|
|
207
|
+
this.$refs.previewPdf.previewKnowledgeId = this.previewKnowledgeId
|
|
208
|
+
}
|
|
209
|
+
this.$emit('previewToDialog',flag,this.previewKnowledgeId,this.previewKnowledge)
|
|
210
|
+
},
|
|
211
|
+
clearKnowledgeId(){
|
|
212
|
+
this.previewKnowledgeId = "";
|
|
213
|
+
},
|
|
214
|
+
recommendQues(item,knowledgeId){
|
|
215
|
+
this.$emit('recommendQues',item,knowledgeId)
|
|
216
|
+
},
|
|
217
|
+
open() {
|
|
218
|
+
this.$emit('openPreviewDialog')
|
|
219
|
+
},
|
|
220
|
+
close() {
|
|
221
|
+
this.$emit('closePreviewDialog')
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
mounted() {
|
|
225
|
+
this.$i18n.locale = sessionStorage.getItem("systemLanguage") || 'cn';
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
</script>
|
|
229
|
+
|
|
230
|
+
<style scoped lang="less">
|
|
231
|
+
.message_list_welcome_knowledge_file {
|
|
232
|
+
.mlwm-title {
|
|
233
|
+
font-size: 18px;
|
|
234
|
+
font-weight: 600;
|
|
235
|
+
color: #333333;
|
|
236
|
+
}
|
|
237
|
+
.mlwm-des {
|
|
238
|
+
color: #666666;
|
|
239
|
+
margin-top: 9px;
|
|
240
|
+
font-size: 14px;
|
|
241
|
+
font-weight: 500;
|
|
242
|
+
.mlwm-des-after {
|
|
243
|
+
display: flex;
|
|
244
|
+
align-items: center;
|
|
245
|
+
height: 28px;
|
|
246
|
+
line-height: 28px;
|
|
247
|
+
.mlwm-des-after-cir {
|
|
248
|
+
flex: none;
|
|
249
|
+
width: 6px;
|
|
250
|
+
height: 6px;
|
|
251
|
+
background: #366aff;
|
|
252
|
+
border-radius: 50%;
|
|
253
|
+
margin-right: 6px;
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
.mlwm-msg-type {
|
|
259
|
+
margin-top: 9px;
|
|
260
|
+
.mmt-cell {
|
|
261
|
+
flex: 1;
|
|
262
|
+
padding: 10px;
|
|
263
|
+
background: #f0f4ff;
|
|
264
|
+
border-radius: 8px;
|
|
265
|
+
margin: 8px 0;
|
|
266
|
+
display: flex;
|
|
267
|
+
justify-content: space-between;
|
|
268
|
+
align-items: center;
|
|
269
|
+
cursor: pointer;
|
|
270
|
+
.mmt-cell-img {
|
|
271
|
+
flex: none;
|
|
272
|
+
width: 20px;
|
|
273
|
+
margin-right: 8px;
|
|
274
|
+
img {
|
|
275
|
+
height: 20px;
|
|
276
|
+
width: 20px;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
.mmt-cell-des {
|
|
280
|
+
flex: auto;
|
|
281
|
+
text-align: left;
|
|
282
|
+
display: flex;
|
|
283
|
+
flex-direction: column;
|
|
284
|
+
padding-right: 12px;
|
|
285
|
+
.mmt-cell-des-title {
|
|
286
|
+
font-size: 14px;
|
|
287
|
+
color: #333333;
|
|
288
|
+
font-weight: 600;
|
|
289
|
+
margin-bottom: 6px;
|
|
290
|
+
}
|
|
291
|
+
.mmt-cell-des-detail {
|
|
292
|
+
font-size: 12px;
|
|
293
|
+
display: flex;
|
|
294
|
+
align-items: center;
|
|
295
|
+
.mmt-cell-avatar {
|
|
296
|
+
flex: none;
|
|
297
|
+
width: 16px;
|
|
298
|
+
margin-right: 8px;
|
|
299
|
+
display: flex;
|
|
300
|
+
align-items: center;
|
|
301
|
+
img {
|
|
302
|
+
height: 16px;
|
|
303
|
+
width: 16px;
|
|
304
|
+
border-radius: 50%;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
.mmt-creator-name {
|
|
308
|
+
padding-right: 6px;
|
|
309
|
+
color: #666666;
|
|
310
|
+
}
|
|
311
|
+
.mmt-update-time {
|
|
312
|
+
color: #666666;
|
|
313
|
+
padding-left: 6px;
|
|
314
|
+
}
|
|
315
|
+
.mmt-border {
|
|
316
|
+
height: 12px;
|
|
317
|
+
width: 1px;
|
|
318
|
+
background-color: #666666;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
.booth_elements {
|
|
324
|
+
padding: 0 10px;
|
|
325
|
+
margin-top: 0px;
|
|
326
|
+
margin-bottom: 0px;
|
|
327
|
+
background: #FFFFFF;
|
|
328
|
+
cursor: default !important;
|
|
329
|
+
}
|
|
330
|
+
.load_moreKnowledge {
|
|
331
|
+
width: 100%;
|
|
332
|
+
height: 40px;
|
|
333
|
+
display: flex;
|
|
334
|
+
align-items: center;
|
|
335
|
+
justify-content: center;
|
|
336
|
+
// background: #FFFFFF;
|
|
337
|
+
color: #366aff;
|
|
338
|
+
font-size: 14px;
|
|
339
|
+
margin-top: 8px;
|
|
340
|
+
cursor: pointer;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
</style>
|