askbot-dragon 1.1.23 → 1.1.25

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "askbot-dragon",
3
- "version": "1.1.23",
3
+ "version": "1.1.25",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -15,7 +15,7 @@
15
15
  </div>
16
16
  <div v-html="item.introduction" class="alc-box-introduction">
17
17
  </div>
18
- <div class="alc-updateTime" v-if="isAskLightning == 1">
18
+ <div class="alc-updateTime">
19
19
  <div v-show="docSource[item.source]" class="upload-source">
20
20
  {{docSource[item.source]}}
21
21
  </div>
@@ -137,42 +137,46 @@ export default {
137
137
  //预览图片
138
138
  lookAttach(url, item, event) {
139
139
  event.preventDefault();
140
- console.log('111111111');
141
- window.parent.postMessage({
142
- data: "bot_preview",
143
- item: JSON.stringify(item),
144
- url: url
145
- },"*");
146
- // let index = url.lastIndexOf('?')
147
- // let type = ''
148
- // let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate'
149
- // if (index !== -1) {
150
- // url = url.substring(0, index)
151
- // type = this.fileType(url)
152
- // } else {
153
- // type = this.fileType(url)
154
- // }
155
- // if (type === '' || type === 'OTHER') {
156
- // httpUrl = httpUrl += '?needEncrypt=true'
157
- // } else {
158
- // httpUrl = httpUrl += '?needEncrypt=false'
159
- // }
160
- // this.$http.post(httpUrl, {
161
- // "fileInOssPath":url
162
- // }).then(res =>{
163
- // if(res.data.code == '0') {
164
- // this.previewHref = res.data.data
165
- // this.$refs.previewPdf.previewShowPopup = true;
166
- // this.$refs.previewPdf.fileType = type
167
- // this.$nextTick(() =>{
168
- // if(item.source == 'CREATED_BY_ONESELF') {
169
- // this.$refs.previewPdf.getBolb(item)
170
- // } else {
171
- // this.$refs.previewPdf.loadIframe(item)
172
- // }
173
- // })
174
- // }
175
- // })
140
+ console.log('111111111',url,item,this.isAskLightning);
141
+ if (this.isAskLightning == 1){
142
+ window.parent.postMessage({
143
+ data: "bot_preview",
144
+ item: JSON.stringify(item),
145
+ url: url
146
+ },"*");
147
+ } else {
148
+ let index = url.lastIndexOf('?')
149
+ let type = ''
150
+ let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate'
151
+ if (index !== -1) {
152
+ url = url.substring(0, index)
153
+ type = this.fileType(url)
154
+ } else {
155
+ type = this.fileType(url)
156
+ }
157
+ if (type === '' || type === 'OTHER') {
158
+ httpUrl = httpUrl += '?needEncrypt=true'
159
+ } else {
160
+ httpUrl = httpUrl += '?needEncrypt=false'
161
+ }
162
+ this.$http.post(httpUrl, {
163
+ "fileInOssPath":url
164
+ }).then(res =>{
165
+ if(res.data.code == '0') {
166
+ this.previewHref = res.data.data
167
+ this.$refs.previewPdf.previewShowPopup = true;
168
+ this.$refs.previewPdf.fileType = type
169
+ this.$nextTick(() =>{
170
+ if(item.source == 'CREATED_BY_ONESELF') {
171
+ this.$refs.previewPdf.getBolb(item)
172
+ } else {
173
+ this.$refs.previewPdf.loadIframe(item)
174
+ }
175
+ })
176
+ }
177
+ })
178
+ }
179
+
176
180
  },
177
181
  fileType (url) {
178
182
  const fileType = url.substring(url.lastIndexOf('.'));
@@ -228,23 +228,24 @@
228
228
 
229
229
  },
230
230
  //预览图片
231
- lookAttach(e){
232
- if (e.target.localName == 'a'){
233
- console.debug('lookImage',e.target.href)
234
- this.previewHref = e.target.href
235
- this.$refs.previewDoc.previewShowPopup = true
236
- // let url = ''
237
- // try {
238
- // url = btoa(e.target.href)
239
- // }
240
- // catch {
241
- // url = encodeURIComponent(btoa(e.target.href))
242
- // }
243
- // window.open('https://test.open.askbot.cn/kkfileview/onlinePreview?url=' + url)
244
- // e.stopPropagation()
245
- // e.preventDefault()
246
- e.returnValue = false
247
- }
231
+ lookAttach(){
232
+ return
233
+ // if (e.target.localName == 'a'){
234
+ // console.debug('lookImage',e.target.href)
235
+ // this.previewHref = e.target.href
236
+ // this.$refs.previewDoc.previewShowPopup = true
237
+ // // let url = ''
238
+ // // try {
239
+ // // url = btoa(e.target.href)
240
+ // // }
241
+ // // catch {
242
+ // // url = encodeURIComponent(btoa(e.target.href))
243
+ // // }
244
+ // // window.open('https://test.open.askbot.cn/kkfileview/onlinePreview?url=' + url)
245
+ // // e.stopPropagation()
246
+ // // e.preventDefault()
247
+ // e.returnValue = false
248
+ // }
248
249
  },
249
250
  },
250
251
  watch:{
@@ -291,10 +292,10 @@
291
292
  /*padding-bottom: 10px;
292
293
  border-bottom: 1px solid #EEEEEE;*/
293
294
  }
294
- /deep/a{
295
- disabled:true
296
- //pointer-events: none;
297
- }
295
+ ///deep/a{
296
+ // disabled:true
297
+ // //pointer-events: none;
298
+ //}
298
299
  }
299
300
 
300
301
  </style>
@@ -32,7 +32,8 @@ export default {
32
32
  data () {
33
33
  return {
34
34
  previewShowPopup: false,
35
- fileText:''
35
+ fileText:'',
36
+ fileType:""
36
37
  }
37
38
  },
38
39
  props:{
@@ -43,10 +44,6 @@ export default {
43
44
  officePreviewType:{
44
45
  type: String,
45
46
  default: ''
46
- },
47
- fileType :{
48
- type: String,
49
- default: ''
50
47
  }
51
48
  },
52
49
  computed:{
@@ -73,7 +70,7 @@ export default {
73
70
  // } else {
74
71
  // return 'OTHER'
75
72
  // }
76
-
73
+
77
74
  // }
78
75
  },
79
76
  methods :{