askbot-dragon 1.5.65-beta → 1.5.67-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
CHANGED
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
</div>
|
|
68
68
|
</div>
|
|
69
69
|
</div>
|
|
70
|
-
<previewPdf ref="previewPdf" :url="previewHref" :sourceFileType="sourceFileType" officePreviewType="pdf"></previewPdf>
|
|
70
|
+
<previewPdf ref="previewPdf" :url="previewHref" :watermark="watermark" :sourceFileType="sourceFileType" officePreviewType="pdf"></previewPdf>
|
|
71
71
|
</div>
|
|
72
72
|
</template>
|
|
73
73
|
|
|
@@ -151,6 +151,10 @@ export default {
|
|
|
151
151
|
MP3: "audio",
|
|
152
152
|
yqhtml: "yqhtml",
|
|
153
153
|
feishuhtml:"feishuhtml"
|
|
154
|
+
},
|
|
155
|
+
watermark: {
|
|
156
|
+
textWatermarkValue:'',
|
|
157
|
+
visitorWatermarkValue:''
|
|
154
158
|
}
|
|
155
159
|
}
|
|
156
160
|
},
|
|
@@ -198,6 +202,9 @@ export default {
|
|
|
198
202
|
methods: {
|
|
199
203
|
//预览图片
|
|
200
204
|
lookAttach(url, item, event) {
|
|
205
|
+
// console.log(item.knowledgeId);
|
|
206
|
+
// this.$http.get("/knowledge-api/internal/knowledgeBaseStructure/" + "642ffbccde420e2772f7787b")
|
|
207
|
+
// debugger
|
|
201
208
|
event.preventDefault();
|
|
202
209
|
if (this.isAskLightning == 1 && !this.isApp){
|
|
203
210
|
window.parent.postMessage({
|
|
@@ -230,8 +237,9 @@ export default {
|
|
|
230
237
|
}
|
|
231
238
|
this.$http.post(httpUrl, {
|
|
232
239
|
"fileInOssPath":url
|
|
233
|
-
}).then(res =>{
|
|
240
|
+
}).then(async res =>{
|
|
234
241
|
if(res.data.code == '0') {
|
|
242
|
+
this.watermark = await this.getknowledgeBaseStructure(item.knowledgeId)
|
|
235
243
|
this.previewHref = res.data.data;
|
|
236
244
|
this.sourceFileType = url.substring(url.lastIndexOf('.'))
|
|
237
245
|
let isOhmPc = sessionStorage.getItem('isOhmPc')
|
|
@@ -306,6 +314,24 @@ export default {
|
|
|
306
314
|
// return res.data
|
|
307
315
|
})
|
|
308
316
|
// return imgurl
|
|
317
|
+
},
|
|
318
|
+
async getknowledgeBaseStructure(knowledgeId) {
|
|
319
|
+
let watermark = {
|
|
320
|
+
textWatermarkValue:'',
|
|
321
|
+
visitorWatermarkValue:''
|
|
322
|
+
}
|
|
323
|
+
await this.$http.get("/knowledge-api/internal/knowledgeBaseStructure/" + knowledgeId).then( async res =>{
|
|
324
|
+
if(res.data.code && res.data.code == '0') {
|
|
325
|
+
watermark.textWatermarkValue = await res.data.data.textWatermarkValue
|
|
326
|
+
if(res.data.data.visitorWatermark) {
|
|
327
|
+
let userInfo = sessionStorage.getItem('userInfo') || localStorage.getItem('userInfo')
|
|
328
|
+
if(userInfo && userInfo !== 'null') {
|
|
329
|
+
watermark.visitorWatermarkValue = JSON.parse(userInfo).realName
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
})
|
|
334
|
+
return watermark
|
|
309
335
|
}
|
|
310
336
|
}
|
|
311
337
|
}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
</div> -->
|
|
35
35
|
|
|
36
36
|
<text-message :text="text" @submitClick="submitClick"></text-message>
|
|
37
|
-
|
|
37
|
+
<answer-docknowledge :isAskLightning="2" :msg="answerDocknowledge"></answer-docknowledge>
|
|
38
38
|
<!-- <voice-component @closeVoice="closeVoice">
|
|
39
39
|
<div slot="voiceTip">
|
|
40
40
|
松开发送
|
|
@@ -118,6 +118,9 @@ export default {
|
|
|
118
118
|
sourceFileType:{
|
|
119
119
|
type: String,
|
|
120
120
|
default: '',
|
|
121
|
+
},
|
|
122
|
+
watermark:{
|
|
123
|
+
type: Object
|
|
121
124
|
}
|
|
122
125
|
},
|
|
123
126
|
components:{
|
|
@@ -155,8 +158,10 @@ export default {
|
|
|
155
158
|
// }
|
|
156
159
|
// }
|
|
157
160
|
url = url + this.url
|
|
158
|
-
|
|
159
|
-
|
|
161
|
+
url += '&officePreviewType=pdf'
|
|
162
|
+
if(this.watermark) {
|
|
163
|
+
url = this.watermark.textWatermarkValue ? (url += this.watermark.textWatermarkValue) : url
|
|
164
|
+
url = this.watermark.visitorWatermarkValue ? (url += this.watermark.visitorWatermarkValue) : url
|
|
160
165
|
}
|
|
161
166
|
return url
|
|
162
167
|
},
|