askbot-dragon 1.5.47 → 1.5.48
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 +3 -2
- package/public/index.html +7 -6
- package/src/assets/js/obsBrowser.js +63 -0
- package/src/components/MyEditor.vue +10 -8
- package/src/components/askVideo.vue +5 -2
- package/src/components/formTemplate.vue +24 -19
- package/src/components/pdfPosition.vue +10 -4
- package/src/components/utils/ckeditor.js +19 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "askbot-dragon",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.48",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"serve": "vue-cli-service serve",
|
|
6
6
|
"build": "vue-cli-service build",
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
"ali-oss": "^6.2.1",
|
|
11
11
|
"audio-loader": "^1.0.3",
|
|
12
12
|
"core-js": "^3.6.5",
|
|
13
|
+
"element-ui": "^2.15.14",
|
|
14
|
+
"esdk-obs-browserjs": "^3.23.5",
|
|
13
15
|
"install": "^0.13.0",
|
|
14
16
|
"jquery": "^3.5.1",
|
|
15
17
|
"lodash": "^4.17.21",
|
|
@@ -27,7 +29,6 @@
|
|
|
27
29
|
"@vue/cli-plugin-eslint": "~4.5.0",
|
|
28
30
|
"@vue/cli-service": "~4.5.0",
|
|
29
31
|
"babel-eslint": "^10.1.0",
|
|
30
|
-
"element-ui": "^2.15.10",
|
|
31
32
|
"eslint": "^6.7.2",
|
|
32
33
|
"eslint-plugin-vue": "^6.2.2",
|
|
33
34
|
"less": "^3.12.2",
|
package/public/index.html
CHANGED
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
</script>
|
|
26
|
+
<!-- <script src="https://askbot-uat.obs.cn-east-3.myhuaweicloud.com/npm-static/ckeditor5-build-classic/0.4.4/ckeditor.js"></script>-->
|
|
26
27
|
<!-- 项目图标 -->
|
|
27
28
|
<link rel="stylesheet" href="//at.alicdn.com/t/font_1566110_3hu6pyd938i.css"/>
|
|
28
29
|
<!-- guoran图标 -->
|
|
@@ -46,12 +47,12 @@
|
|
|
46
47
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.5.141/pdf.worker.min.js" integrity="sha512-6UHd2tcWIvg5hIYHXb3lnNO61tWfriGen6KddwGYTSUUazWGYESTHDDxJFEQkCy1cSL//yXKc1gcL+51/DTLFQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
47
48
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.5.141/pdf_viewer.min.js" integrity="sha512-tYEGuMBQkCfSlBKJ3dNgS06wbb/MNE6nO2poZ1Y5brix8NajGcDcfEvuL38wJDOTkq0j5ojASNmrzv/8/wgGHQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
|
48
49
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.5.141/pdf_viewer.min.css" integrity="sha512-Jf9DLkegLgARLR151csVkPvcVt4cOUhslrSZwiTAe9mqFL/BbYRDmxCOioCtbHifEgjsBFbrVhOMQ3mYPDLrqQ==" crossorigin="anonymous" referrerpolicy="no-referrer" /> -->
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<script src="https://
|
|
52
|
-
<script src="https://
|
|
53
|
-
<script src="https://
|
|
54
|
-
<link rel="stylesheet" href="https://
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
<script src="https://askbot-uat.obs.cn-east-3.myhuaweicloud.com/npm-static/pdfJS2.1.266/pdf.min.js" referrerpolicy="no-referrer"></script>
|
|
53
|
+
<script src="https://askbot-uat.obs.cn-east-3.myhuaweicloud.com/npm-static/pdfJS2.1.266/pdf.worker.min.js" referrerpolicy="no-referrer"></script>
|
|
54
|
+
<script src="https://askbot-uat.obs.cn-east-3.myhuaweicloud.com/npm-static/pdfJS2.1.266/pdf_viewer.js" referrerpolicy="no-referrer"></script>
|
|
55
|
+
<link rel="stylesheet" href="https://askbot-uat.obs.cn-east-3.myhuaweicloud.com/npm-static/pdfJS2.1.266/pdf_viewer_01.css" referrerpolicy="no-referrer" />
|
|
55
56
|
<!-- hammer.js -->
|
|
56
57
|
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/hammer.js/2.0.8/hammer.min.js" integrity="sha512-UXumZrZNiOwnTcZSHLOfcTs0aos2MzBWHXOHOuB0J/R44QB0dwY5JgfbvljXcklVf65Gc4El6RjZ+lnwd2az2g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> -->
|
|
57
58
|
<style>
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// 创建ObsClient实例
|
|
2
|
+
import ObsClient from 'esdk-obs-browserjs';
|
|
3
|
+
const obsClient = new ObsClient({
|
|
4
|
+
access_key_id: "EE4MAFWH4YLQSQF7NNIP",
|
|
5
|
+
secret_access_key: "Dq9giqqwZoX77dqSIzhA1Yhhe9tarA3LRBGBF4eO",
|
|
6
|
+
server : 'https://obs.cn-east-3.myhuaweicloud.com',
|
|
7
|
+
timeout : 1000
|
|
8
|
+
});
|
|
9
|
+
let mainId = sessionStorage.getItem('_mainId') ? sessionStorage.getItem('_mainId') : "";
|
|
10
|
+
let IDX = 256, HEX = [], SIZE = 256, BUFFER;
|
|
11
|
+
while (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);
|
|
12
|
+
function uid(len) {
|
|
13
|
+
let i = 0, tmp = (len || 11);
|
|
14
|
+
if (!BUFFER || ((IDX + tmp) > SIZE * 2)) {
|
|
15
|
+
for (BUFFER = '', IDX = 0; i < SIZE; i++) {
|
|
16
|
+
BUFFER += HEX[Math.random() * 256 | 0];
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return BUFFER.substring(IDX, IDX++ + tmp);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function dataFormat(fmt, date = new Date()) {
|
|
24
|
+
const o = {
|
|
25
|
+
"M+": date.getMonth() + 1, //月份
|
|
26
|
+
"d+": date.getDate(), //日
|
|
27
|
+
"h+": date.getHours(), //小时
|
|
28
|
+
"m+": date.getMinutes(), //分
|
|
29
|
+
"s+": date.getSeconds(), //秒
|
|
30
|
+
"q+": Math.floor((date.getMonth() + 3) / 3), //季度
|
|
31
|
+
"S": date.getMilliseconds() //毫秒
|
|
32
|
+
};
|
|
33
|
+
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
|
|
34
|
+
for (const k in o)
|
|
35
|
+
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
|
36
|
+
return fmt;
|
|
37
|
+
}
|
|
38
|
+
async function putObject(file,callback){
|
|
39
|
+
let fileUrl = ''
|
|
40
|
+
let objName = (process.env.VUE_APP_ENV === 'development' ? 'dev_' : 'pro_') + file.name;
|
|
41
|
+
let fileName = "front-oss/" + mainId + '/' + dataFormat("yyyy/MM/dd/hh/mm/") + uid(32) + "/" + objName;
|
|
42
|
+
await obsClient.putObject({
|
|
43
|
+
Bucket: 'askbot-uat',
|
|
44
|
+
Key : fileName,
|
|
45
|
+
SourceFile : file,
|
|
46
|
+
ACL : obsClient.enums.AclPublicRead,
|
|
47
|
+
ProgressCallback: callback
|
|
48
|
+
}).then(function(result) {
|
|
49
|
+
if(result.CommonMsg.Status < 300){
|
|
50
|
+
console.log('Create object:' + JSON.stringify(result) + ' successfully!\n',process.env.VUE_APP_ENV);
|
|
51
|
+
let domain = process.env.VUE_APP_ENV ==='development' ? 'https://askbot-uat.obs.cn-east-3.myhuaweicloud.com/' : ''
|
|
52
|
+
fileUrl = {
|
|
53
|
+
url: domain + fileName,
|
|
54
|
+
name:file.name
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return fileUrl
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export {
|
|
62
|
+
putObject
|
|
63
|
+
}
|
|
@@ -36,7 +36,8 @@
|
|
|
36
36
|
|
|
37
37
|
<script>
|
|
38
38
|
import { v4 as uuidv4 } from "uuid";
|
|
39
|
-
import { multipartUpload, ossFileUrl } from "./utils/AliyunIssUtil";
|
|
39
|
+
// import { multipartUpload, ossFileUrl } from "./utils/AliyunIssUtil";
|
|
40
|
+
import { putObject } from "../assets/js/obsBrowser";
|
|
40
41
|
|
|
41
42
|
export default {
|
|
42
43
|
props: ["value", "placeholder", "havToolbar"],
|
|
@@ -154,14 +155,15 @@ export default {
|
|
|
154
155
|
let imgInfo = {
|
|
155
156
|
url: '',
|
|
156
157
|
}
|
|
157
|
-
let res = multipartUpload(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
);
|
|
158
|
+
// let res = multipartUpload(
|
|
159
|
+
// this.ossConfig,
|
|
160
|
+
// file,
|
|
161
|
+
// null,
|
|
162
|
+
// imgInfo
|
|
163
|
+
// );
|
|
164
|
+
let res = putObject(file)
|
|
163
165
|
res.then(resp => {
|
|
164
|
-
imgInfo.url =
|
|
166
|
+
imgInfo.url = resp.url
|
|
165
167
|
resolve({
|
|
166
168
|
name: resp.name,
|
|
167
169
|
default: imgInfo.url
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
</div>
|
|
27
27
|
</template>
|
|
28
28
|
<script>
|
|
29
|
-
import {
|
|
29
|
+
import { putObject } from "../assets/js/obsBrowser";
|
|
30
30
|
|
|
31
31
|
export default {
|
|
32
32
|
name: "ask_video",
|
|
@@ -86,7 +86,10 @@
|
|
|
86
86
|
console.debug('img.src',output)
|
|
87
87
|
let base64 = canvas.toDataURL("image/png")
|
|
88
88
|
let blob = that.dataURLtoFile(base64,'name')
|
|
89
|
-
let promise = uploadImageByBase64(ossConfig,blob);
|
|
89
|
+
// let promise = uploadImageByBase64(ossConfig,blob);
|
|
90
|
+
const file = new File([blob], 'name', { type: 'text/plain', lastModified: Date.now() });
|
|
91
|
+
console.debug('file',file)
|
|
92
|
+
let promise = putObject(file);
|
|
90
93
|
promise.then((res)=>{
|
|
91
94
|
console.debug("upload base64 reslut",res);
|
|
92
95
|
if (res&&res.url){
|
|
@@ -869,6 +869,7 @@ import Tree from '../components/tree'
|
|
|
869
869
|
import selectPopup from '../components/popup'
|
|
870
870
|
import fileListView from './fielListView.vue'
|
|
871
871
|
import { uniqueData } from './utils/math_utils'
|
|
872
|
+
import { putObject } from "../assets/js/obsBrowser";
|
|
872
873
|
export default {
|
|
873
874
|
name: "formTemplate",
|
|
874
875
|
data() {
|
|
@@ -1645,21 +1646,24 @@ export default {
|
|
|
1645
1646
|
status:'',
|
|
1646
1647
|
url:''
|
|
1647
1648
|
}
|
|
1648
|
-
let res = multipartUpload(
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
);
|
|
1654
|
-
|
|
1649
|
+
// let res = multipartUpload(
|
|
1650
|
+
// this.ossConfig,
|
|
1651
|
+
// file,
|
|
1652
|
+
// null,
|
|
1653
|
+
// imageInfo
|
|
1654
|
+
// );
|
|
1655
|
+
let resp = putObject(file);
|
|
1656
|
+
resp.then((res) => {
|
|
1655
1657
|
console.log("upload result:", res);
|
|
1656
1658
|
// let filePath = res.name;
|
|
1657
|
-
|
|
1659
|
+
let obj = {
|
|
1658
1660
|
name:file.name,
|
|
1659
|
-
url:
|
|
1661
|
+
url:res.url,
|
|
1660
1662
|
status:'success'
|
|
1661
|
-
}
|
|
1662
|
-
|
|
1663
|
+
}
|
|
1664
|
+
imageData.urls.push(obj)
|
|
1665
|
+
// imageInfo.url = ossFileUrl(this.ossConfig, res.name)
|
|
1666
|
+
imageInfo.url = res.url;
|
|
1663
1667
|
imageInfo.status='success'
|
|
1664
1668
|
imageInfo.name=file.name
|
|
1665
1669
|
for (let j=0;j<this.extInfoFieldValue[this.filedId].length;j++){
|
|
@@ -2571,13 +2575,14 @@ export default {
|
|
|
2571
2575
|
progress: 0,
|
|
2572
2576
|
},
|
|
2573
2577
|
};*/
|
|
2574
|
-
let res = multipartUpload(
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
);
|
|
2580
|
-
|
|
2578
|
+
// let res = multipartUpload(
|
|
2579
|
+
// this.ossConfig,
|
|
2580
|
+
// file,
|
|
2581
|
+
// null,
|
|
2582
|
+
// imgInfo
|
|
2583
|
+
// );
|
|
2584
|
+
let ress = putObject(file)
|
|
2585
|
+
ress.then((res) => {
|
|
2581
2586
|
console.debug("upload result:", res);
|
|
2582
2587
|
// let filePath = res.name;
|
|
2583
2588
|
/* imageData.content.progress = 1;
|
|
@@ -2585,7 +2590,7 @@ export default {
|
|
|
2585
2590
|
ossFileUrl(this.ossConfig, res.name)
|
|
2586
2591
|
);
|
|
2587
2592
|
console.log('imageData',imageData)*/
|
|
2588
|
-
imgInfo.url =
|
|
2593
|
+
imgInfo.url = res.url
|
|
2589
2594
|
imgInfo.status='success'
|
|
2590
2595
|
if (data.file){
|
|
2591
2596
|
imgInfo.name = data.file.name
|
|
@@ -687,15 +687,21 @@ export default {
|
|
|
687
687
|
// this.currentPageAllLine[i].allLines.lines.push(item.extractInfo.lines)
|
|
688
688
|
this.currentPageAllLine[i].allLines.push({
|
|
689
689
|
pageCount: index,
|
|
690
|
-
lines: item.extractInfo.lines
|
|
690
|
+
lines: item.extractInfo.lines ? item.extractInfo.lines : [{
|
|
691
|
+
content:"测试内容填充,不必理会",
|
|
692
|
+
location:item.extractInfo.location
|
|
693
|
+
}]
|
|
691
694
|
})
|
|
692
695
|
} else {
|
|
693
696
|
this.currentPageAllLine.push({
|
|
694
697
|
page: item.page,
|
|
695
698
|
allLines: [{
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
+
pageCount: index,
|
|
700
|
+
lines: item.extractInfo.lines ? item.extractInfo.lines : [{
|
|
701
|
+
content:"测试内容填充,不必理会",
|
|
702
|
+
location:item.extractInfo.location
|
|
703
|
+
}]
|
|
704
|
+
}]
|
|
699
705
|
})
|
|
700
706
|
}
|
|
701
707
|
})
|
|
@@ -1,14 +1,15 @@
|
|
|
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
|
-
|
|
11
|
-
|
|
4
|
+
import { putObject } from "../../assets/js/obsBrowser";
|
|
5
|
+
// const ossConfig = {
|
|
6
|
+
// region: "oss-cn-zhangjiakou",
|
|
7
|
+
// //云账号AccessKey有所有API访问权限,建议遵循阿里云安全最佳实践,创建并使用STS方式来进行API访问
|
|
8
|
+
// accessKeyId: "LTAI4G3QtdEdwkEbihBngAsK",
|
|
9
|
+
// accessKeySecret: "OwgdVfc5PeCkIgqIdug660xmiSPchn",
|
|
10
|
+
// // stsToken: '<Your securityToken(STS)>',
|
|
11
|
+
// bucket: "guoranopen-zjk",
|
|
12
|
+
// }
|
|
12
13
|
class MyUploadAdapter {
|
|
13
14
|
constructor( loader , editor ) {
|
|
14
15
|
// 要在上载期间使用的文件加载器实例
|
|
@@ -55,14 +56,16 @@ class MyUploadAdapter {
|
|
|
55
56
|
let imgInfo = {
|
|
56
57
|
url:'',
|
|
57
58
|
}
|
|
58
|
-
let res = multipartUpload(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
);
|
|
59
|
+
// let res = multipartUpload(
|
|
60
|
+
// ossConfig,
|
|
61
|
+
// file,
|
|
62
|
+
// null,
|
|
63
|
+
// imgInfo
|
|
64
|
+
// );
|
|
65
|
+
let res = putObject(file);
|
|
64
66
|
res.then(resp=>{
|
|
65
|
-
imgInfo.url = ossFileUrl(ossConfig, resp.name)
|
|
67
|
+
// imgInfo.url = ossFileUrl(ossConfig, resp.name)
|
|
68
|
+
imgInfo.url = resp.url;
|
|
66
69
|
let root = this.editor.model.document.getRoot()
|
|
67
70
|
let children = root.getChildren()
|
|
68
71
|
for(let child of children){
|