askbot-dragon 1.2.2 → 1.2.4
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 -1
- package/src/components/AnswerDocknowledge.vue +1 -0
- package/src/components/associationIntention.vue +39 -20
- package/src/components/fielListView.vue +32 -16
- package/src/components/formTemplate.vue +10 -4
- package/src/components/previewDoc.vue +34 -34
- package/src/components/previewPdf.vue +1 -1
package/package.json
CHANGED
|
@@ -63,7 +63,17 @@
|
|
|
63
63
|
</div>
|
|
64
64
|
<Recommend v-if="msg.recommend && msg.recommend.list && msg.recommend.list.length > 0" :msg="msg" @onRadioClickReco="onRadioClickReco"></Recommend>
|
|
65
65
|
</div>
|
|
66
|
-
<
|
|
66
|
+
<van-popup v-model="previewShowPopup" position="bottom" :style="{ height: '90%', background:'#FFFFFF'}">
|
|
67
|
+
<previewDoc ref="previewDoc" :url="previewHref" @close="close"></previewDoc>
|
|
68
|
+
</van-popup>
|
|
69
|
+
<el-drawer
|
|
70
|
+
title="我是标题"
|
|
71
|
+
:visible.sync="drawer"
|
|
72
|
+
:with-header="false"
|
|
73
|
+
size="65%"
|
|
74
|
+
>
|
|
75
|
+
<previewDoc ref="previewDoc" :url="previewHref" @close="close"></previewDoc>
|
|
76
|
+
</el-drawer>
|
|
67
77
|
</div>
|
|
68
78
|
</template>
|
|
69
79
|
|
|
@@ -71,6 +81,7 @@
|
|
|
71
81
|
import askVideo from "./askVideo";
|
|
72
82
|
import Recommend from "./recommend";
|
|
73
83
|
import previewDoc from "./previewDoc";
|
|
84
|
+
import { isMobile } from "../assets/js/common";
|
|
74
85
|
export default {
|
|
75
86
|
name: "associationIntention",
|
|
76
87
|
components: {Recommend, askVideo, previewDoc},
|
|
@@ -92,7 +103,9 @@
|
|
|
92
103
|
},
|
|
93
104
|
data() {
|
|
94
105
|
return {
|
|
95
|
-
previewHref: ""
|
|
106
|
+
previewHref: "",
|
|
107
|
+
previewShowPopup:false,
|
|
108
|
+
drawer:false
|
|
96
109
|
}
|
|
97
110
|
},
|
|
98
111
|
mounted() {
|
|
@@ -228,25 +241,31 @@
|
|
|
228
241
|
|
|
229
242
|
},
|
|
230
243
|
//预览图片
|
|
231
|
-
lookAttach(){
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
244
|
+
lookAttach(e){
|
|
245
|
+
if (e.target.localName == 'a'){
|
|
246
|
+
this.previewHref = e.target.href;
|
|
247
|
+
if (isMobile()){
|
|
248
|
+
this.previewShowPopup = true
|
|
249
|
+
} else {
|
|
250
|
+
this.drawer = true;
|
|
251
|
+
}
|
|
252
|
+
// let url = ''
|
|
253
|
+
// try {
|
|
254
|
+
// url = btoa(e.target.href)
|
|
255
|
+
// }
|
|
256
|
+
// catch {
|
|
257
|
+
// url = encodeURIComponent(btoa(e.target.href))
|
|
258
|
+
// }
|
|
259
|
+
// window.open('https://test.open.askbot.cn/kkfileview/onlinePreview?url=' + url)
|
|
260
|
+
// e.stopPropagation()
|
|
261
|
+
// e.preventDefault()
|
|
262
|
+
e.returnValue = false
|
|
263
|
+
}
|
|
249
264
|
},
|
|
265
|
+
close(){
|
|
266
|
+
this.previewShowPopup = false;
|
|
267
|
+
this.drawer = false
|
|
268
|
+
}
|
|
250
269
|
},
|
|
251
270
|
watch:{
|
|
252
271
|
isOpen:{
|
|
@@ -47,19 +47,32 @@
|
|
|
47
47
|
<embed :src="dialogUrl" width="100%" height="100%" />
|
|
48
48
|
</div>
|
|
49
49
|
</el-dialog> -->
|
|
50
|
-
|
|
50
|
+
<van-popup v-model="previewShowPopup" position="bottom" :style="{ height: '90%', background:'#FFFFFF'}">
|
|
51
|
+
<previewDoc ref="previewDoc" :url="previewHref" @close="close"></previewDoc>
|
|
52
|
+
</van-popup>
|
|
53
|
+
<el-drawer
|
|
54
|
+
title="我是标题"
|
|
55
|
+
:visible.sync="drawer"
|
|
56
|
+
:with-header="false"
|
|
57
|
+
size="65%"
|
|
58
|
+
>
|
|
59
|
+
<previewDoc ref="previewDoc" :url="previewHref" @close="close"></previewDoc>
|
|
60
|
+
</el-drawer>
|
|
51
61
|
</div>
|
|
52
62
|
</template>
|
|
53
63
|
|
|
54
64
|
<script>
|
|
55
65
|
import previewDoc from './previewDoc.vue';
|
|
66
|
+
import { isMobile } from "../assets/js/common";
|
|
56
67
|
export default {
|
|
57
68
|
name: "customUpload",
|
|
58
69
|
components: {previewDoc},
|
|
59
70
|
data () {
|
|
60
71
|
return {
|
|
61
72
|
dialogVisible: false,
|
|
62
|
-
previewHref:""
|
|
73
|
+
previewHref:"",
|
|
74
|
+
previewShowPopup:false,
|
|
75
|
+
drawer:false
|
|
63
76
|
}
|
|
64
77
|
},
|
|
65
78
|
props: ["attachmentList"],
|
|
@@ -86,10 +99,10 @@ export default {
|
|
|
86
99
|
return file
|
|
87
100
|
}
|
|
88
101
|
const fileType = fileName.substring(fileName.lastIndexOf('.'));
|
|
89
|
-
if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.mov' || fileType === '.MOV') {
|
|
102
|
+
if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.mov' || fileType === '.MOV' || fileType === 'avi' || fileType === 'flv') {
|
|
90
103
|
file = 'video'
|
|
91
104
|
}
|
|
92
|
-
else if (fileType === '.jpg' || fileType === '.png' || fileType === '.JPG' || fileType === '.PNG') {
|
|
105
|
+
else if (fileType === '.jpg' || fileType === '.png' || fileType === '.JPG' || fileType === '.PNG' || fileType === '.jpeg' || fileType === '.JPEG' || fileType === 'gif') {
|
|
93
106
|
file = 'image'
|
|
94
107
|
}
|
|
95
108
|
else if (fileType == '.txt') {
|
|
@@ -109,22 +122,25 @@ export default {
|
|
|
109
122
|
}
|
|
110
123
|
return file
|
|
111
124
|
},
|
|
112
|
-
//下载文件
|
|
113
|
-
updownload () {
|
|
114
|
-
window.location.href = this.dialogUrl
|
|
115
|
-
/*window.open(this.dialogUrl,'_black')*/
|
|
116
|
-
},
|
|
117
125
|
lookAttach(url){
|
|
118
126
|
if(url !== '') {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
this.
|
|
124
|
-
this.$refs.previewDoc.previewShowPopup = true
|
|
127
|
+
this.previewHref = url;
|
|
128
|
+
if (isMobile()){
|
|
129
|
+
this.previewShowPopup = true
|
|
130
|
+
} else {
|
|
131
|
+
this.drawer = true;
|
|
125
132
|
}
|
|
133
|
+
// const fileType = url.substring(url.lastIndexOf('.'));
|
|
134
|
+
// if (fileType === '.jpg' || fileType === '.png' || fileType === '.JPG' || fileType === '.PNG'){
|
|
135
|
+
// this.previewHref = url
|
|
136
|
+
// this.$refs.previewDoc.previewShowPopup = true
|
|
137
|
+
// }
|
|
126
138
|
}
|
|
127
|
-
}
|
|
139
|
+
},
|
|
140
|
+
close(){
|
|
141
|
+
this.previewShowPopup = false;
|
|
142
|
+
this.drawer = false
|
|
143
|
+
}
|
|
128
144
|
}
|
|
129
145
|
};
|
|
130
146
|
</script>
|
|
@@ -207,7 +207,7 @@
|
|
|
207
207
|
<el-upload
|
|
208
208
|
|
|
209
209
|
ref="upload"
|
|
210
|
-
:list-type="item.formField.type === 'IMAGE' ||
|
|
210
|
+
:list-type="item.formField.type === 'IMAGE' || isBaiLi ? 'picture-card':''"
|
|
211
211
|
:accept="acceptFieldType(item.formField.type)"
|
|
212
212
|
name="file"
|
|
213
213
|
action="/open/media/file/upload"
|
|
@@ -220,13 +220,14 @@
|
|
|
220
220
|
:http-request="aliyunOssRequest"
|
|
221
221
|
:on-change="handleEditChange"
|
|
222
222
|
:on-success="successUpload"
|
|
223
|
+
:show-file-list="item.formField.type === 'IMAGE' || isBaiLi ? true : false"
|
|
223
224
|
>
|
|
224
225
|
<div class="upload-demo">
|
|
225
226
|
<i class="el-icon-plus"></i>
|
|
226
227
|
</div>
|
|
227
228
|
<!-- <el-button size="small" type="primary" v-else class="uploadBtn">点击上传</el-button>-->
|
|
228
229
|
</el-upload>
|
|
229
|
-
<file-list-view :attachmentList="extInfoFieldValue[item.fieldId]" v-if="extInfoFieldValue[item.fieldId] && item.formField.type !== 'IMAGE' &&
|
|
230
|
+
<file-list-view :attachmentList="extInfoFieldValue[item.fieldId]" v-if="extInfoFieldValue[item.fieldId] && item.formField.type !== 'IMAGE' && !isBaiLi" @attachDeleteAttch="attachDeleteFile($event,item.fieldId)"></file-list-view>
|
|
230
231
|
</div>
|
|
231
232
|
</template>
|
|
232
233
|
<div v-else-if="item.formField.type == 'REF_TEMPLATE' || item.formField.type == 'REF'">
|
|
@@ -657,12 +658,13 @@
|
|
|
657
658
|
:after-read="afterRead"
|
|
658
659
|
:accept="acceptFieldType(item.formField.type)"
|
|
659
660
|
:multiple="item.formField.extInfo&&item.formField.extInfo.limitNum&&item.formField.extInfo.limitNum>1?true:false"
|
|
661
|
+
:preview-image="item.formField.type === 'IMAGE' || isBaiLi ? true : false"
|
|
660
662
|
>
|
|
661
663
|
<div class="vant-upload--picture-card">
|
|
662
664
|
<i class="el-icon-plus"></i>
|
|
663
665
|
</div>
|
|
664
666
|
</van-uploader>
|
|
665
|
-
<file-list-view :attachmentList="extInfoFieldValue[item.fieldId]" v-if="extInfoFieldValue[item.fieldId] && item.formField.type !== 'IMAGE' && !fileUpload &&
|
|
667
|
+
<file-list-view :attachmentList="extInfoFieldValue[item.fieldId]" v-if="extInfoFieldValue[item.fieldId] && item.formField.type !== 'IMAGE' && !fileUpload && !isBaiLi" @attachDeleteAttch="attachDeleteFile($event,item.fieldId)"></file-list-view>
|
|
666
668
|
</div>
|
|
667
669
|
</div>
|
|
668
670
|
</div>
|
|
@@ -883,7 +885,8 @@ export default {
|
|
|
883
885
|
associatedControlsCopy:[],
|
|
884
886
|
attachments:[],
|
|
885
887
|
attachmentList:[],
|
|
886
|
-
uploadImgQueue:false
|
|
888
|
+
uploadImgQueue:false,
|
|
889
|
+
isBaiLi:false
|
|
887
890
|
}
|
|
888
891
|
},
|
|
889
892
|
props: {
|
|
@@ -1103,6 +1106,9 @@ export default {
|
|
|
1103
1106
|
if (this.mainId == '8b9bd566e3e64156ab764b19defc9d48' || this.mainId == '0b73521f96e4486aaf6be42932bd7b07'){
|
|
1104
1107
|
this.ckeditor.editorConfig.toolbar = []
|
|
1105
1108
|
}
|
|
1109
|
+
if (this.mainId == '90df4764122240de939331d372546c28'){
|
|
1110
|
+
this.isBaiLi = true;
|
|
1111
|
+
}
|
|
1106
1112
|
this.isMobile()
|
|
1107
1113
|
},
|
|
1108
1114
|
beforeCreate() {
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
<div class="previewDoc">
|
|
3
|
+
<div class="footer">
|
|
4
|
+
<span>查看详情</span>
|
|
5
|
+
<section @click="close">
|
|
6
|
+
<i class="iconfont guoran-shanchu"></i>
|
|
7
|
+
</section>
|
|
8
|
+
</div>
|
|
9
|
+
<div v-if="fileType == 'VIDEO'" style="width: 100%;height: calc(100% - 70px)">
|
|
10
|
+
<video :src="url" controls width="100%;" height="98%"></video>
|
|
11
|
+
</div>
|
|
12
|
+
<template v-else-if="url.includes('https://www') || url.includes('http://www')">
|
|
13
|
+
<iframe class="preview_iframe"
|
|
14
|
+
:src="url"
|
|
15
|
+
width="100%"
|
|
16
|
+
height="100%"
|
|
17
|
+
scrolling="100%"
|
|
18
|
+
frameborder="no"
|
|
19
|
+
border="0"></iframe>
|
|
20
|
+
</template>
|
|
21
|
+
<template v-else>
|
|
22
|
+
<iframe class="preview_iframe" :src="previewUrl" style="border:none;"></iframe>
|
|
23
|
+
</template>
|
|
24
|
+
</div>
|
|
25
25
|
</template>
|
|
26
26
|
|
|
27
27
|
<script>
|
|
@@ -43,17 +43,10 @@ export default {
|
|
|
43
43
|
},
|
|
44
44
|
computed:{
|
|
45
45
|
previewUrl() {
|
|
46
|
-
console.debug('VUE_APP_ENV',process.env.VUE_APP_ENV)
|
|
47
46
|
let url = process.env.VUE_APP_ENV === 'production' ? 'https://kkfileview.askbot.cn/onlinePreview?url=' : 'https://test.open.askbot.cn/kkfileview/onlinePreview?url='
|
|
48
47
|
if(this.url != '') {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} else {
|
|
52
|
-
url += btoa(this.url)
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if(this.officePreviewType !== '') {
|
|
56
|
-
url += '&officePreviewType=pdf'
|
|
48
|
+
url += btoa(encodeURIComponent(this.url))
|
|
49
|
+
url += '&encodeURIComponent=true'
|
|
57
50
|
}
|
|
58
51
|
return url
|
|
59
52
|
},
|
|
@@ -69,7 +62,7 @@ export default {
|
|
|
69
62
|
},
|
|
70
63
|
methods :{
|
|
71
64
|
close() {
|
|
72
|
-
|
|
65
|
+
this.$emit('close')
|
|
73
66
|
},
|
|
74
67
|
loadIframe(item) {
|
|
75
68
|
let iframe = document.getElementsByClassName('preview_iframe')[0]
|
|
@@ -92,9 +85,13 @@ export default {
|
|
|
92
85
|
</script>
|
|
93
86
|
|
|
94
87
|
<style lang="less" scoped>
|
|
88
|
+
.previewDoc{
|
|
89
|
+
height: 100%;
|
|
90
|
+
}
|
|
95
91
|
.preview_iframe {
|
|
96
92
|
width: 100%;
|
|
97
|
-
height: calc(100% -
|
|
93
|
+
height: calc(100% - 65px);
|
|
94
|
+
overflow-y: scroll;
|
|
98
95
|
}
|
|
99
96
|
.footer {
|
|
100
97
|
width: calc(100% - 40px);
|
|
@@ -106,4 +103,7 @@ export default {
|
|
|
106
103
|
padding: 0 20px;
|
|
107
104
|
border-bottom: 1px solid #cccccc;
|
|
108
105
|
}
|
|
106
|
+
/deep/.el-drawer__body{
|
|
107
|
+
height: 100%;
|
|
108
|
+
}
|
|
109
109
|
</style>
|