askbot-dragon 1.1.27 → 1.1.29

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.27",
3
+ "version": "1.1.29",
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">
18
+ <div class="alc-updateTime" v-if="isAskLightning == 1">
19
19
  <div v-show="docSource[item.source]" class="upload-source">
20
20
  {{docSource[item.source]}}
21
21
  </div>
@@ -50,7 +50,6 @@
50
50
 
51
51
  <script>
52
52
  import previewPdf from "./previewPdf";
53
- import { isMobile } from "../assets/js/common";
54
53
  export default {
55
54
  name: "answerDocknowledge",
56
55
  components: { previewPdf },
@@ -59,11 +58,10 @@ export default {
59
58
  isPC: true,
60
59
  previewHref: "",
61
60
  docSource: {
62
- LOCAL_FILE: "来源于本地文件",
63
- CREATED_BY_ONESELF: "来源于自建知识",
61
+ LOCAL_FILE: "上传于本地文件",
62
+ CREATED_BY_ONESELF: "来源于自建",
64
63
  WECHAT: "来源于微信",
65
- AUTO_SYN_FROM_LOCAL_FILE: "自动同步于本地",
66
- YUQUE: "来源于语雀"
64
+ AUTO_SYN_FROM_LOCAL_FILE: "自动同步与本地",
67
65
  },
68
66
  imageObj: {
69
67
  PDF: 'pdf1',
@@ -108,7 +106,6 @@ export default {
108
106
  rmvb: "video",
109
107
  wav: "audio",
110
108
  mp3: "audio",
111
- yqhtml: "yqhtml",
112
109
  }
113
110
  }
114
111
  },
@@ -140,50 +137,42 @@ export default {
140
137
  //预览图片
141
138
  lookAttach(url, item, event) {
142
139
  event.preventDefault();
143
- console.log('111111111',url,item,this.isAskLightning);
144
- if (this.isAskLightning == 1){
145
- window.parent.postMessage({
146
- data: "bot_preview",
147
- item: JSON.stringify(item),
148
- url: url
149
- },"*");
150
- } else {
151
- let index = url.lastIndexOf('?')
152
- let type = ''
153
- let httpUrl = '/knowledge-api/knowledge/getTemporaryCertificate'
154
- if (index !== -1) {
155
- url = url.substring(0, index)
156
- type = this.fileType(url)
157
- } else {
158
- type = this.fileType(url)
159
- }
160
- if (type === '' || type === 'OTHER') {
161
- httpUrl = httpUrl += '?needEncrypt=true'
162
- } else {
163
- httpUrl = httpUrl += '?needEncrypt=false'
164
- }
165
- this.$http.post(httpUrl, {
166
- "fileInOssPath":url
167
- }).then(res =>{
168
- if(res.data.code == '0') {
169
- this.previewHref = res.data.data;
170
- if (isMobile()){
171
- this.$refs.previewPdf.previewShowPopup = true;
172
- } else {
173
- this.$refs.previewPdf.drawer = true;
174
- }
175
- this.$refs.previewPdf.fileType = type
176
- this.$nextTick(() =>{
177
- if(item.source == 'CREATED_BY_ONESELF' || type === 'HTML') {
178
- this.$refs.previewPdf.getBolb(item)
179
- } else {
180
- this.$refs.previewPdf.loadIframe(item)
181
- }
182
- })
183
- }
184
- })
185
- }
186
-
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
+ // })
187
176
  },
188
177
  fileType (url) {
189
178
  const fileType = url.substring(url.lastIndexOf('.'));
@@ -14,7 +14,7 @@
14
14
  </div> -->
15
15
 
16
16
  <form-template
17
- :formList="formList2"
17
+ :formList="formList"
18
18
  @submitClick="submitClick"
19
19
  ></form-template>
20
20
  <answer-docknowledge :isAskLightning="1" :msg="answerDocknowledge"></answer-docknowledge>
@@ -8,19 +8,19 @@
8
8
  <div class="attch-item-left" @click="lookAttach(item.url)">
9
9
  <i v-if="item.url == ''" class="el-icon-loading" style="color:#366AFF;margin: 5px;"></i>
10
10
  <img src="../assets/image/video.png"
11
- v-else-if="setSrc(item.name) == 'video'"/>
11
+ v-else-if="setSrc(item) == 'video'"/>
12
12
  <img src="../assets/image/image.png"
13
- v-else-if="setSrc(item.name) == 'image'" />
13
+ v-else-if="setSrc(item) == 'image'" />
14
14
  <img src="../assets/image/txt.png"
15
- v-else-if="setSrc(item.name) == 'txt'" />
15
+ v-else-if="setSrc(item) == 'txt'" />
16
16
  <img src="../assets/image/word.png"
17
- v-else-if="setSrc(item.name) == 'word'" />
17
+ v-else-if="setSrc(item) == 'word'" />
18
18
  <img src="../assets/image/pdf.png"
19
- v-else-if="setSrc(item.name) == 'pdf'" />
19
+ v-else-if="setSrc(item) == 'pdf'" />
20
20
  <img src="../assets/image/ppt.png"
21
- v-else-if="setSrc(item.name) == 'ppt'" />
21
+ v-else-if="setSrc(item) == 'ppt'" />
22
22
  <img src="../assets/image/excel.png"
23
- v-else-if="setSrc(item.name) == 'excel'" />
23
+ v-else-if="setSrc(item) == 'excel'" />
24
24
  <div class="fileName" v-if="item">
25
25
  <template v-if="typeof item === 'string'">
26
26
  <template v-if="item.indexOf('[') !== -1">
@@ -28,7 +28,7 @@
28
28
  </template>
29
29
  </template>
30
30
  <template v-else>
31
- {{ item.name }}
31
+ {{ item.name ? item.name : (item.url ? item.url : '') }}
32
32
  </template>
33
33
  </div>
34
34
  </div>
@@ -74,8 +74,17 @@ export default {
74
74
  this.$emit('attachDeleteAttch', index)
75
75
  },
76
76
  //根据上传类型设置图标
77
- setSrc (fileName) {
78
- let file = ""
77
+ setSrc (item) {
78
+ let file = "";
79
+ let fileName = ''
80
+ if (typeof item === 'object'){
81
+ fileName = item.name ? item.name : (item.url ? item.url : '')
82
+ } else {
83
+ fileName = item
84
+ }
85
+ if (!fileName){
86
+ return file
87
+ }
79
88
  const fileType = fileName.substring(fileName.lastIndexOf('.'));
80
89
  if (fileType === '.mp4' || fileType === '.MP4' || fileType === '.mov' || fileType === '.MOV') {
81
90
  file = 'video'
@@ -106,10 +115,15 @@ export default {
106
115
  /*window.open(this.dialogUrl,'_black')*/
107
116
  },
108
117
  lookAttach(url){
109
- if(url !== '') {
110
- this.previewHref = url
111
- this.$refs.previewDoc.previewShowPopup = true
118
+ if(url !== '') {
119
+ // this.previewHref = url
120
+ // this.$refs.previewDoc.previewShowPopup = true
121
+ const fileType = url.substring(url.lastIndexOf('.'));
122
+ if (fileType === '.jpg' || fileType === '.png' || fileType === '.JPG' || fileType === '.PNG'){
123
+ this.previewHref = url
124
+ this.$refs.previewDoc.previewShowPopup = true
112
125
  }
126
+ }
113
127
  }
114
128
  }
115
129
  };
@@ -220,14 +220,13 @@
220
220
  :http-request="aliyunOssRequest"
221
221
  :on-change="handleEditChange"
222
222
  :on-success="successUpload"
223
- :show-file-list="item.formField.type === 'IMAGE' ? true : false"
224
223
  >
225
224
  <div class="upload-demo">
226
225
  <i class="el-icon-plus"></i>
227
226
  </div>
228
227
  <!-- <el-button size="small" type="primary" v-else class="uploadBtn">点击上传</el-button>-->
229
228
  </el-upload>
230
- <file-list-view :attachmentList="extInfoFieldValue[item.fieldId]" v-if="extInfoFieldValue[item.fieldId] && item.formField.type !== 'IMAGE'" @attachDeleteAttch="attachDeleteFile($event,item.fieldId)"></file-list-view>
229
+ <file-list-view :attachmentList="extInfoFieldValue[item.fieldId]" v-if="extInfoFieldValue[item.fieldId] && item.formField.type !== 'IMAGE' && false" @attachDeleteAttch="attachDeleteFile($event,item.fieldId)"></file-list-view>
231
230
  </div>
232
231
  </template>
233
232
  <div v-else-if="item.formField.type == 'REF_TEMPLATE' || item.formField.type == 'REF'">
@@ -658,13 +657,12 @@
658
657
  :after-read="afterRead"
659
658
  :accept="acceptFieldType(item.formField.type)"
660
659
  :multiple="item.formField.extInfo&&item.formField.extInfo.limitNum&&item.formField.extInfo.limitNum>1?true:false"
661
- :preview-image="item.formField.type === 'IMAGE' ? true : false"
662
660
  >
663
661
  <div class="vant-upload--picture-card">
664
662
  <i class="el-icon-plus"></i>
665
663
  </div>
666
664
  </van-uploader>
667
- <file-list-view :attachmentList="extInfoFieldValue[item.fieldId]" v-if="extInfoFieldValue[item.fieldId] && item.formField.type !== 'IMAGE' && !fileUpload" @attachDeleteAttch="attachDeleteFile($event,item.fieldId)"></file-list-view>
665
+ <file-list-view :attachmentList="extInfoFieldValue[item.fieldId]" v-if="extInfoFieldValue[item.fieldId] && item.formField.type !== 'IMAGE' && !fileUpload && false" @attachDeleteAttch="attachDeleteFile($event,item.fieldId)"></file-list-view>
668
666
  </div>
669
667
  </div>
670
668
  </div>
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <van-popup v-model="previewShowPopup" position="bottom" :style="{ height: '90%', background:'#FFFFFF'}" v-if="previewShowPopup">
2
+ <van-popup v-model="previewShowPopup" position="bottom" :style="{ height: '90%', background:'#FFFFFF'}">
3
3
  <div class="footer">
4
4
  <span>查看详情</span>
5
5
  <section @click="close">
@@ -10,7 +10,7 @@
10
10
  <video :src="url" controls width="100%;" height="98%"></video>
11
11
  </div>
12
12
  <div v-else-if="fileType == 'HTML'" style="width: 100%;height: calc(100% - 70px)">
13
- <div class="preview_iframe_html" style="text-algin:left" v-html="fileText"></div>
13
+ <div class="preview_iframe" style="text-algin:left" v-html="fileText"></div>
14
14
  </div>
15
15
  <template v-else-if="url.includes('https://www') || url.includes('http://www')">
16
16
  <iframe class="preview_iframe"
@@ -25,38 +25,6 @@
25
25
  <iframe class="preview_iframe" :src="previewUrl" style="border:none;"></iframe>
26
26
  </template>
27
27
  </van-popup>
28
- <el-drawer
29
- title="我是标题"
30
- :visible.sync="drawer"
31
- v-else
32
- :with-header="false"
33
- size="60%"
34
- >
35
- <div class="drawer-footer">
36
- <span>查看详情</span>
37
- <section @click="close">
38
- <i class="iconfont guoran-shanchu"></i>
39
- </section>
40
- </div>
41
- <div v-if="fileType == 'VIDEO'" style="width: 100%;height: 100%">
42
- <video :src="url" controls width="100%;" height="98%"></video>
43
- </div>
44
- <div v-else-if="fileType == 'HTML'" style="width: 100%;height: 100%">
45
- <div class="preview_iframe_html" style="text-algin:left" v-html="fileText"></div>
46
- </div>
47
- <template v-else-if="url.includes('https://www') || url.includes('http://www')">
48
- <iframe class="preview_iframe"
49
- :src="url"
50
- width="100%"
51
- height="100%"
52
- scrolling="100%"
53
- frameborder="no"
54
- border="0"></iframe>
55
- </template>
56
- <template v-else>
57
- <iframe class="preview_iframe" :src="previewUrl" style="border:none;"></iframe>
58
- </template>
59
- </el-drawer>
60
28
  </template>
61
29
 
62
30
  <script>
@@ -64,10 +32,7 @@ export default {
64
32
  data () {
65
33
  return {
66
34
  previewShowPopup: false,
67
- fileText:'',
68
- fileType:"",
69
- isPc:true,
70
- drawer:false
35
+ fileText:''
71
36
  }
72
37
  },
73
38
  props:{
@@ -78,6 +43,10 @@ export default {
78
43
  officePreviewType:{
79
44
  type: String,
80
45
  default: ''
46
+ },
47
+ fileType :{
48
+ type: String,
49
+ default: ''
81
50
  }
82
51
  },
83
52
  computed:{
@@ -104,13 +73,12 @@ export default {
104
73
  // } else {
105
74
  // return 'OTHER'
106
75
  // }
107
-
76
+
108
77
  // }
109
78
  },
110
79
  methods :{
111
80
  close() {
112
- this.previewShowPopup = false;
113
- this.drawer = false;
81
+ this.previewShowPopup = false
114
82
  },
115
83
  loadIframe(item) {
116
84
  let iframe = document.getElementsByClassName('preview_iframe')[0]
@@ -147,14 +115,6 @@ export default {
147
115
  width: 100%;
148
116
  height: calc(100% - 52px);
149
117
  }
150
- .preview_iframe_html{
151
- width: 100%;
152
- height: calc(100% - 52px);
153
- overflow-y: scroll;
154
- text-align: left;
155
- box-sizing: border-box;
156
- padding: 16px;
157
- }
158
118
  .footer {
159
119
  width: calc(100% - 40px);
160
120
  height: 50px;
@@ -165,17 +125,4 @@ export default {
165
125
  padding: 0 20px;
166
126
  border-bottom: 1px solid #cccccc;
167
127
  }
168
- .drawer-footer{
169
- width:100%;
170
- height: 50px;
171
- display: flex;
172
- align-items: center;
173
- justify-content: space-between;
174
- cursor: pointer;
175
- padding: 0 20px;
176
- border-bottom: 1px solid #cccccc;
177
- }
178
- /deep/.el-drawer__body{
179
- height: 100%;
180
- }
181
128
  </style>
@@ -1,12 +0,0 @@
1
- export function isMobile() {
2
- let bool = false
3
- let flag = navigator.userAgent.match(
4
- /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
5
- );
6
- if (flag) {
7
- bool = true
8
- } else {
9
- bool = false
10
- }
11
- return bool
12
- }