askbot-dragon 1.7.25-beta → 1.7.28-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 +14 -14
- package/public/index.html +10 -8
- package/src/assets/js/AliyunlssUtil.js +50 -51
- package/src/assets/js/hammer.js +2 -13
- package/src/assets/less/converSationContainer/common.less +0 -7
- package/src/components/ActionAlertIframe.vue +1 -24
- package/src/components/AiGuide.vue +154 -121
- package/src/components/AnswerDocknowledge.vue +8 -8
- package/src/components/ConversationContainer.vue +211 -15
- package/src/components/MyEditor.vue +2 -12
- package/src/components/actionSatisfaction.vue +3 -3
- package/src/components/answerRadio.vue +3 -3
- package/src/components/askVideo.vue +2 -25
- package/src/components/associationIntention.vue +7 -11
- package/src/components/formTemplate.vue +54 -68
- package/src/components/intelligentSummary.vue +15 -17
- package/src/components/markDownText.vue +50 -14
- package/src/components/message/TextMessage.vue +11 -15
- package/src/components/message/swiper/ticketSwiper.vue +1 -1
- package/src/components/pdfPosition.vue +99 -271
- package/src/components/popup.vue +2 -2
- package/src/components/previewDoc.vue +2 -6
- package/src/components/previewPdf.vue +136 -166
- package/src/components/senderMessagePlatform.vue +4 -4
- package/src/components/utils/AliyunIssUtil.js +33 -12
- package/src/components/utils/ckeditor.js +59 -48
- package/src/components/welcomeKnowledgeFile.vue +2 -6
- package/src/components/welcomeLlmCard.vue +1 -5
- package/src/components/welcomeSuggest.vue +1 -1
- package/src/locales/cn.json +24 -70
- package/src/locales/en.json +24 -71
- package/src/main.js +16 -18
- package/src/components/newPdfPosition.vue +0 -878
- package/src/locales/jp.json +0 -73
|
@@ -1,16 +1,28 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
|
-
import {multipartUpload, ossFileUrl} from "
|
|
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>查看更多</span>
|
|
35
35
|
</div>
|
|
36
36
|
</div>
|
|
37
37
|
<previewPdf ref="previewPdf"
|
|
@@ -92,11 +92,7 @@ export default {
|
|
|
92
92
|
bindCode:{
|
|
93
93
|
type: String,
|
|
94
94
|
default: ''
|
|
95
|
-
}
|
|
96
|
-
language:{
|
|
97
|
-
type: String,
|
|
98
|
-
default: 'en'
|
|
99
|
-
}
|
|
95
|
+
}
|
|
100
96
|
},
|
|
101
97
|
data () {
|
|
102
98
|
return {
|
|
@@ -39,11 +39,7 @@ export default {
|
|
|
39
39
|
clickFun (item) {
|
|
40
40
|
this.$emit('llmCardClickFun', item)
|
|
41
41
|
}
|
|
42
|
-
}
|
|
43
|
-
mounted() {
|
|
44
|
-
let languageCode = sessionStorage.getItem('languageCode');
|
|
45
|
-
console.log('languageCode',languageCode,this.$i18n.locale,localStorage.getItem('languageCode'))
|
|
46
|
-
}
|
|
42
|
+
}
|
|
47
43
|
};
|
|
48
44
|
</script>
|
|
49
45
|
|
|
@@ -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>换一批</span>
|
|
8
8
|
</div>
|
|
9
9
|
</div>
|
|
10
10
|
<div class="content">
|
package/src/locales/cn.json
CHANGED
|
@@ -1,72 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"feedbackDes": "反馈描述",
|
|
27
|
-
"orderDes": "工单描述",
|
|
28
|
-
"uploadType": "只能上传图片格式",
|
|
29
|
-
"uploadImageSize": "上传图片大小不能超过 8MB!",
|
|
30
|
-
"uploadVideoType": "只能上传视频格式",
|
|
31
|
-
"uploadVideoSize": "上传视频大小不能超过100MB!",
|
|
32
|
-
"uploadFileSize": "上传附件大小不能超过100MB!",
|
|
33
|
-
"onlyUpload": "仅支持上传",
|
|
34
|
-
"number": "个",
|
|
35
|
-
"textFlag": "必须要有文字",
|
|
36
|
-
"imageOrAttachment": "必须要有图片或附件",
|
|
37
|
-
"imageFlag": "必须要有图片",
|
|
38
|
-
"attachmentFlag": "必须要有附件",
|
|
39
|
-
"image": "图片",
|
|
40
|
-
"file": "附件",
|
|
41
|
-
"and": "和",
|
|
42
|
-
"required": "是必填的",
|
|
43
|
-
"uploading": "文件正在上传,请稍后",
|
|
44
|
-
"pleaseImprove": "请完善",
|
|
45
|
-
"feedbackDesRequired": "反馈描述是必填的",
|
|
46
|
-
"orderDesRequired": "问题描述是必填的"
|
|
47
|
-
},
|
|
48
|
-
"senderMessagePlatform": {
|
|
49
|
-
"IM": "IM人工",
|
|
50
|
-
"service": "将为您服务",
|
|
51
|
-
"transfer": "将会话转接给"
|
|
52
|
-
},
|
|
53
|
-
"common": {
|
|
54
|
-
"drawerTitle": "我是标题",
|
|
55
|
-
"viewDetail": "查看详情",
|
|
56
|
-
"download": "下载",
|
|
57
|
-
"changeBatch": "换一批",
|
|
58
|
-
"lodeMore": "查看更多",
|
|
59
|
-
"previous": "上一段",
|
|
60
|
-
"next": "下一段",
|
|
61
|
-
"selectPlaceholder": "请选择",
|
|
62
|
-
"inputPlaceholder": "请输入",
|
|
63
|
-
"selectDate": "请选择日期",
|
|
64
|
-
"selectTime": "请选择时间",
|
|
65
|
-
"selectDateTime": "请选择日期时间",
|
|
66
|
-
"cancel": "取消",
|
|
67
|
-
"confirm": "确认",
|
|
68
|
-
"submit": "提交",
|
|
69
|
-
"submited": "已提交",
|
|
70
|
-
"confirmed": "已确认"
|
|
71
|
-
}
|
|
2
|
+
"dragonCommon": {
|
|
3
|
+
"download": "下载",
|
|
4
|
+
"smartSummary": "智能摘要",
|
|
5
|
+
"chat": "聊一聊",
|
|
6
|
+
"viewDetails": "查看详情",
|
|
7
|
+
"folderName": "文件夹名称",
|
|
8
|
+
"loading": "加载中...",
|
|
9
|
+
"Safaridownload": "下载地址已复制,请前往Safari浏览器访问下载",
|
|
10
|
+
"reduce": "缩小",
|
|
11
|
+
"zoom": "放大",
|
|
12
|
+
"selectScale": "请选择",
|
|
13
|
+
"previous": "上一段",
|
|
14
|
+
"next": "下一段",
|
|
15
|
+
"answersGeneratedByPre": "答案由",
|
|
16
|
+
"answersGeneratedByAfter": "段内容生成",
|
|
17
|
+
"scaleAuto": "自动缩放",
|
|
18
|
+
"scaleReality": "实际比例",
|
|
19
|
+
"firstParagraph": "当前已经是第一段了",
|
|
20
|
+
"lastParagraph": "当前已经是最后一段了",
|
|
21
|
+
"fileloadException": "文件加载异常",
|
|
22
|
+
"regenerate": "重新生成",
|
|
23
|
+
"generating": "生成中",
|
|
24
|
+
"close": "关闭"
|
|
25
|
+
}
|
|
72
26
|
}
|
package/src/locales/en.json
CHANGED
|
@@ -1,73 +1,26 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"report": "Reporter",
|
|
26
|
-
"feedbackDes": "Feedback Description",
|
|
27
|
-
"orderDes": "Work Order Description",
|
|
28
|
-
"uploadType": "Only upload image format",
|
|
29
|
-
"uploadImageSize": "Uploaded image size cannot exceed 8MB!",
|
|
30
|
-
"uploadVideoType": "Only upload video format",
|
|
31
|
-
"uploadVideoSize": "Uploaded video size cannot exceed 100MB!",
|
|
32
|
-
"uploadFileSize": "Uploaded attachment size cannot exceed 100MB!",
|
|
33
|
-
"onlyUpload": "Only support upload",
|
|
34
|
-
"number": "",
|
|
35
|
-
"textFlag": "must have text",
|
|
36
|
-
"imageOrAttachment": "must have image or attachment",
|
|
37
|
-
"imageFlag": "must have image",
|
|
38
|
-
"attachmentFlag": "must have attachment",
|
|
39
|
-
"image": "Image",
|
|
40
|
-
"file": "Attachment",
|
|
41
|
-
"and": "and",
|
|
42
|
-
"required": "is required",
|
|
43
|
-
"uploading": "File is uploading, please wait",
|
|
44
|
-
"pleaseImprove": "Please improve",
|
|
45
|
-
"feedbackDesRequired": "Feedback description is required",
|
|
46
|
-
"orderDesRequired": "Problem description is required"
|
|
47
|
-
},
|
|
48
|
-
"senderMessagePlatform": {
|
|
49
|
-
"IM": "IM (Instant Messaging) Agent",
|
|
50
|
-
"service": "will serve you",
|
|
51
|
-
"transfer": "will transfer the session to"
|
|
52
|
-
},
|
|
53
|
-
"common": {
|
|
54
|
-
"drawerTitle": "Title",
|
|
55
|
-
"viewDetail": "View Details",
|
|
56
|
-
"download": "Download",
|
|
57
|
-
"changeBatch": "Change Batch",
|
|
58
|
-
"lodeMore": "Load More",
|
|
59
|
-
"previous": "Previous",
|
|
60
|
-
"next": "Next",
|
|
61
|
-
"selectPlaceholder": "Select",
|
|
62
|
-
"inputPlaceholder": "Enter",
|
|
63
|
-
"selectDate": "Select Date",
|
|
64
|
-
"selectTime": "Select Time",
|
|
65
|
-
"selectDateTime": "Select Date and Time",
|
|
66
|
-
"cancel": "Cancel",
|
|
67
|
-
"confirm": "Confirm",
|
|
68
|
-
"submit": "Submit",
|
|
69
|
-
"submited": "Submitted",
|
|
70
|
-
"confirmed": "Confirmed"
|
|
2
|
+
"dragonCommon": {
|
|
3
|
+
"download": "Download",
|
|
4
|
+
"smartSummary": "Smart Summary",
|
|
5
|
+
"chat": "Chat",
|
|
6
|
+
"viewDetails": "View Details",
|
|
7
|
+
"folderName": "Folder Name",
|
|
8
|
+
"loading": "Loading...",
|
|
9
|
+
"Safaridownload": "The download address has been copied, please go to Safari to access the download",
|
|
10
|
+
"reduce": "Reduce",
|
|
11
|
+
"zoom": "Zoom",
|
|
12
|
+
"selectScale": "Select Scale",
|
|
13
|
+
"previous": "Previous",
|
|
14
|
+
"next": "Next",
|
|
15
|
+
"answersGeneratedByPre": "Answers generated by",
|
|
16
|
+
"answersGeneratedByAfter": "segments of content",
|
|
17
|
+
"scaleAuto": "Auto",
|
|
18
|
+
"scaleReality": "Reality",
|
|
19
|
+
"firstParagraph": "It's already the first paragraph",
|
|
20
|
+
"lastParagraph": "It's already the last paragraph",
|
|
21
|
+
"fileloadException": "File load exception",
|
|
22
|
+
"regenerate": "Regenerate",
|
|
23
|
+
"generating": "Generating",
|
|
24
|
+
"close": "Close"
|
|
71
25
|
}
|
|
72
|
-
|
|
73
|
-
|
|
26
|
+
}
|
package/src/main.js
CHANGED
|
@@ -16,23 +16,6 @@ Vue.use(vConsole);*/
|
|
|
16
16
|
import $ from 'jquery'
|
|
17
17
|
Vue.prototype._$ = $;
|
|
18
18
|
Vue.use(Vant);
|
|
19
|
-
import VueI18n from 'vue-i18n'; //多语言
|
|
20
|
-
|
|
21
|
-
// 导入多语言的 JSON 文件
|
|
22
|
-
import enLocale from './locales/en.json';
|
|
23
|
-
import cnLocale from './locales/cn.json';
|
|
24
|
-
|
|
25
|
-
Vue.use(VueI18n);
|
|
26
|
-
console.log('languageCode',sessionStorage.getItem('languageCode'))
|
|
27
|
-
// 创建 VueI18n 实例,并设置默认语言和多语言内容
|
|
28
|
-
const i18n = new VueI18n({
|
|
29
|
-
locale: sessionStorage.getItem('languageCode') || 'cn', // 默认语言
|
|
30
|
-
messages: {
|
|
31
|
-
en: enLocale, // 英文
|
|
32
|
-
cn: cnLocale, // 中文
|
|
33
|
-
// 其他语言...
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
19
|
Date.prototype.Format = function (fmt) { //author: meizz
|
|
37
20
|
var o = {
|
|
38
21
|
"M+": this.getMonth() + 1, //月份
|
|
@@ -64,12 +47,27 @@ Viewer.setDefaults({
|
|
|
64
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" }
|
|
65
48
|
})
|
|
66
49
|
|
|
50
|
+
import VueI18n from 'vue-i18n'; //多语言
|
|
67
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
|
+
});
|
|
68
66
|
|
|
69
67
|
Vue.prototype.requestUrl = requestUrl;
|
|
70
68
|
Vue.prototype.utils = utils;
|
|
71
69
|
|
|
72
70
|
new Vue({
|
|
73
|
-
i18n,
|
|
74
71
|
render: h => h(App),
|
|
72
|
+
i18n,
|
|
75
73
|
}).$mount('#app')
|