askbot-dragon 1.1.4 → 1.1.7

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.4",
3
+ "version": "1.1.7",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -1,20 +1,37 @@
1
1
  <template>
2
2
  <div class="answer-docknowledge">
3
3
  <div v-if="msg.content.type == 0" class="answer-text">{{ msg.content.text }}<span
4
- @click="lookAttach(msg.content.list[0].url)" class="aci-view">查看原文 ></span></div>
4
+ @click="lookAttach(msg.content.list[0].url, msg.content.list[0])" class="aci-view">查看原文 ></span></div>
5
5
  <div v-if="msg.content.type == 1" class="answer-text">{{ msg.content.text }}</div>
6
6
  <div class="ad-list">
7
7
  <div v-for="(item, itemIndex) in msg.content.list" :key="itemIndex" class="ad-list-cell">
8
8
  <div class="alc-title">
9
9
  <div class="alc-box">
10
+ <div class="alc-source-left">
11
+ <span class="source-form">出自</span>
10
12
  <img class="alc-title-icon" height="24px" width="24px" :src="item.src" alt="" srcset="">
11
- <span class="alc-title-from">出自《{{ item.from }}》</span>
13
+ <span class="alc-title-from">{{ item.from }}</span>
14
+ </div>
15
+ <div class="alc-content-text" v-if="msg.content.type == 1">
16
+ <span @click="lookAttach(item.url, item)" class="aci-view">查看 ></span>
17
+ </div>
12
18
  </div>
13
- <span v-if="isPC" class="alc-title-updateTime">最后更新时间: {{ item.updateTime }}</span>
19
+ <div v-html="item.introduction" class="alc-box-introduction">
20
+ </div>
21
+ <div class="alc-updateTime" v-if="isAskLightning == 1">
22
+ <div v-show="docSource[item.source]" class="upload-source">
23
+ {{docSource[item.source]}}
24
+ </div>
25
+ <!-- <div class="time">
26
+ <span>更新时间:</span>
27
+ {{ new Date(item.updateTime).Format('MM-dd hh:mm') }}
28
+ </div> -->
29
+ </div>
30
+ <!-- <span v-if="isPC" class="alc-title-updateTime">最后更新时间: {{ item.updateTime }}</span>-->
14
31
  </div>
15
- <div class="alc-content">
32
+ <div class="alc-content" v-if="false">
16
33
  <div v-if="msg.content.type == 1" class="alc-content-text">{{ item.introduction }} <span
17
- @click="lookAttach(item.url)" class="aci-view">查看原文 ></span>
34
+ @click="lookAttach(item.url, item)" class="aci-view">查看原文 ></span>
18
35
  </div>
19
36
  <span v-if="!isPC" class="alc-title-updateTime">最后更新时间: {{ item.updateTime }}</span>
20
37
  <div v-if="false" class="alc-content-info">
@@ -27,7 +44,7 @@
27
44
  </div>
28
45
  </div>
29
46
  </div>
30
- <previewDoc ref="previewDoc" :url="previewHref"></previewDoc>
47
+ <previewDoc ref="previewDoc" :url="previewHref" officePreviewType="pdf"></previewDoc>
31
48
  </div>
32
49
  </template>
33
50
 
@@ -40,6 +57,12 @@ export default {
40
57
  return {
41
58
  isPC: true,
42
59
  previewHref: "",
60
+ docSource: {
61
+ LOCAL_FILE: "上传于本地文件",
62
+ CREATED_BY_ONESELF: "来源于自建",
63
+ WECHAT: "来源于微信",
64
+ AUTO_SYN_FROM_LOCAL_FILE: "自动同步与本地",
65
+ },
43
66
  imageObj: {
44
67
  PDF: 'pdf',
45
68
  pdf: 'pdf',
@@ -85,7 +108,7 @@ export default {
85
108
  }
86
109
  }
87
110
  },
88
- props: ['msg'],
111
+ props: ['msg','isAskLightning'],
89
112
  beforeMounted() {
90
113
 
91
114
  },
@@ -111,6 +134,9 @@ export default {
111
134
  lookAttach(url) {
112
135
  this.previewHref = url
113
136
  this.$refs.previewDoc.previewShowPopup = true;
137
+ this.$nextTick(() =>{
138
+ this.$refs.previewDoc.loadIframe(item)
139
+ })
114
140
  },
115
141
  }
116
142
  }
@@ -136,7 +162,7 @@ export default {
136
162
  .ad-list {
137
163
  .ad-list-cell {
138
164
  border-top: solid 1px #E0E6F7;
139
- padding: 6px 0 6px;
165
+ padding: 10px 0 10px;
140
166
 
141
167
  .alc-title {
142
168
  display: flex;
@@ -146,19 +172,72 @@ export default {
146
172
  line-height: 16px;
147
173
 
148
174
  .alc-box {
175
+ display: flex;
176
+ align-items: center;
177
+ justify-content: space-between;
178
+ font-size: 12px;
179
+ width: 100%;
180
+ .alc-source-left{
149
181
  display: flex;
150
182
  align-items: center;
151
- justify-content: flex-start;
152
-
183
+ .source-form{
184
+ width: 40px;
185
+ flex: none;
186
+ color: #A9B3C6;
187
+ }
188
+ }
189
+ .alc-content-text{
190
+ width: 55px;
191
+ flex: none;
192
+ .aci-view{
193
+ color: #366aff;
194
+ cursor: pointer;
195
+ }
196
+ }
153
197
  .alc-title-from {
154
198
  flex: auto;
155
199
  display: flex;
156
200
  justify-content: flex-start;
157
201
  }
158
202
  }
159
-
203
+ .alc-box-introduction{
204
+ overflow: hidden;
205
+ text-overflow: ellipsis;
206
+ display: -webkit-box;
207
+ -webkit-line-clamp:3;
208
+ -webkit-box-orient:vertical;
209
+ margin-top: 10px;
210
+ color: #616161;
211
+ font-size: 12px;
212
+ }
213
+ .alc-updateTime{
214
+ display: flex;
215
+ align-items: center;
216
+ justify-content: space-between;
217
+ font-size: 12px;
218
+ width: 100%;
219
+ margin-top: 10px;
220
+ .upload-source{
221
+ flex: none;
222
+ height: 18px;
223
+ background: #E9F9F8;
224
+ border: 1px solid #AFF2CD;
225
+ border-radius: 2px;
226
+ display: flex;
227
+ align-items: center;
228
+ justify-content: center;
229
+ padding: 0 8px;
230
+ color: #00C2BB;
231
+ }
232
+ .time{
233
+ color: #999999;
234
+ margin-left: 10px;
235
+ }
236
+ }
160
237
  .alc-title-icon {
161
- margin-right: 6px;
238
+ margin: 0 2px;
239
+ width: 18px;
240
+ height: 18px;
162
241
  }
163
242
 
164
243
  .alc-title-updateTime {
@@ -179,7 +258,8 @@ export default {
179
258
 
180
259
  .alc-content-text {
181
260
  margin-bottom: 6px;
182
-
261
+ width: 55px;
262
+ flex: none;
183
263
  .aci-view {
184
264
  display: inline-block;
185
265
  margin-left: 30px;
@@ -17,7 +17,7 @@
17
17
  :formList="formList2"
18
18
  @submitClick="submitClick"
19
19
  ></form-template>
20
- <answer-docknowledge :msg="answerDocknowledge"></answer-docknowledge>
20
+ <answer-docknowledge :isAskLightning="1" :msg="answerDocknowledge"></answer-docknowledge>
21
21
  <!-- <voice-component @closeVoice="closeVoice">
22
22
  <div slot="voiceTip">
23
23
  松开发送
@@ -127,7 +127,7 @@ export default {
127
127
  introduction: "女职工生育享受98天产假,其中产前可以休假15天,难产的或者生育多 胞胎的,可以增加产假时间。女职工在休产假期间", // 简介
128
128
  owner: "管理员", // 所有者
129
129
  enterprise: "果然智汇", // 所属企业
130
- source: "企业微信微盘", // 文件来源 例如 企业微信微盘
130
+ source: "LOCAL_FILE", // 文件来源 例如 企业微信微盘
131
131
  url: "https://www.baidu.com/",
132
132
  },{
133
133
  format: "TXT", // 格式 例如 PDF,DOC 等
@@ -136,7 +136,7 @@ export default {
136
136
  introduction: "女职工生育享受98天产假,其中产前可以休假15天,难产的或者生育多 胞胎的,可以增加产假时间。女职工在休产假期间", // 简介
137
137
  owner: "管理员", // 所有者
138
138
  enterprise: "果然智汇", // 所属企业
139
- source: "企业微信微盘", // 文件来源 例如 企业微信微盘
139
+ source: "CREATED_BY_ONESELF", // 文件来源 例如 企业微信微盘
140
140
  url: "https://www.baidu.com/",
141
141
  }
142
142
  ]
@@ -35,6 +35,10 @@ export default {
35
35
  url:{
36
36
  type: String,
37
37
  required: true,
38
+ },
39
+ officePreviewType:{
40
+ type: String,
41
+ default: ''
38
42
  }
39
43
  },
40
44
  computed:{
@@ -48,6 +52,9 @@ export default {
48
52
  url += btoa(this.url)
49
53
  }
50
54
  }
55
+ if(this.officePreviewType !== '') {
56
+ url += '&officePreviewType=pdf'
57
+ }
51
58
  return url
52
59
  },
53
60
  fileType() {
@@ -63,6 +70,22 @@ export default {
63
70
  methods :{
64
71
  close() {
65
72
  this.previewShowPopup = false
73
+ },
74
+ loadIframe(item) {
75
+ let iframe = document.getElementsByClassName('preview_iframe')[0]
76
+ iframe.onload(() =>{
77
+ iframe.contentWindow.postMessage({
78
+ type: "positionText",
79
+ data: item.text,
80
+ page: item.page
81
+ }, '*')
82
+ })
83
+ // if(preview) {
84
+ // preview.postMessage({
85
+ // type: "positionText",
86
+ // data: ``
87
+ // }, '*')
88
+ // }
66
89
  }
67
90
  }
68
91
  }