askbot-dragon 1.0.13 → 1.0.14
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/README.md +27 -27
- package/babel.config.js +6 -6
- package/dragon.iml +7 -7
- package/package.json +56 -56
- package/public/index.html +43 -43
- package/src/App.vue +31 -31
- package/src/api/index.js +1 -1
- package/src/api/mock.http +2 -2
- package/src/api/requestUrl.js +185 -185
- package/src/assets/js/AliyunlssUtil.js +92 -92
- package/src/assets/js/Base64Util.js +22 -22
- package/src/assets/js/script.js +36 -36
- package/src/assets/less/common.css +6773 -6773
- package/src/assets/less/converSationContainer/common.less +191 -191
- package/src/assets/less/converSationContainer/converSatonContainer.less +493 -493
- package/src/assets/less/iconfont.css +37 -37
- package/src/assets/less/ticketMessage.less +211 -211
- package/src/components/ActionAlertIframe.vue +112 -112
- package/src/components/AiGuide.vue +467 -467
- package/src/components/AskIFrame.vue +15 -15
- package/src/components/ConversationContainer.vue +4617 -4617
- package/src/components/FileType.vue +86 -86
- package/src/components/Message.vue +27 -27
- package/src/components/actionSatisfaction.vue +107 -107
- package/src/components/actionSendToBot.vue +62 -62
- package/src/components/answerDissatisfaction.vue +62 -62
- package/src/components/answerRadio.vue +76 -76
- package/src/components/ask-components/DissatisfactionOptions.vue +57 -57
- package/src/components/ask-components/Msgloading.vue +37 -37
- package/src/components/ask-components/SatisfactionV2.vue +15 -15
- package/src/components/askVideo.vue +138 -138
- package/src/components/assetDetails.vue +370 -370
- package/src/components/assetMessage.vue +228 -228
- package/src/components/associationIntention.vue +258 -243
- package/src/components/botActionSatisfactor.vue +68 -68
- package/src/components/chatContent.vue +513 -513
- package/src/components/feedBack.vue +136 -136
- package/src/components/fielListView.vue +346 -346
- package/src/components/file/AliyunOssComponents.vue +108 -108
- package/src/components/formTemplate.vue +3344 -3344
- package/src/components/loadingProcess.vue +164 -164
- package/src/components/message/ActionAlertIframe.vue +112 -112
- package/src/components/message/ShopMessage.vue +164 -164
- package/src/components/message/TextMessage.vue +924 -924
- package/src/components/message/TicketMessage.vue +177 -177
- package/src/components/message/swiper/index.js +4 -4
- package/src/components/message/swiper/ticketSwiper.vue +503 -503
- package/src/components/message/swiper/ticketSwiperItem.vue +61 -61
- package/src/components/msgLoading.vue +231 -231
- package/src/components/myPopup.vue +70 -70
- package/src/components/popup.vue +227 -227
- package/src/components/receiverMessagePlatform.vue +65 -65
- package/src/components/recommend.vue +89 -89
- package/src/components/selector/hOption.vue +20 -20
- package/src/components/selector/hSelector.vue +199 -199
- package/src/components/selector/hWrapper.vue +216 -216
- package/src/components/senderMessagePlatform.vue +50 -50
- package/src/components/source/BotMessage.vue +24 -24
- package/src/components/source/CustomMessage.vue +24 -24
- package/src/components/test.vue +260 -260
- package/src/components/tree.vue +247 -247
- package/src/components/utils/AliyunIssUtil.js +72 -72
- package/src/components/utils/ckeditor.js +155 -155
- package/src/components/utils/ckeditorImageUpload/command.js +109 -109
- package/src/components/utils/ckeditorImageUpload/editing.js +11 -11
- package/src/components/utils/ckeditorImageUpload/plugin-image.js +11 -11
- package/src/components/utils/ckeditorImageUpload/toolbar-ui.js +40 -40
- package/src/components/utils/ckeditorfileUpload/common.js +111 -111
- package/src/components/utils/ckeditorfileUpload/editing.js +11 -11
- package/src/components/utils/ckeditorfileUpload/plugin_file.js +11 -11
- package/src/components/utils/ckeditorfileUpload/toolbar_ui.js +34 -34
- package/src/components/utils/format_date.js +25 -25
- package/src/components/utils/index.js +6 -6
- package/src/components/utils/math_utils.js +29 -29
- package/src/components/voiceComponent.vue +119 -119
- package/src/main.js +60 -60
- package/vue.config.js +47 -47
|
@@ -1,347 +1,347 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div id="attachment-upload">
|
|
3
|
-
<div v-if="attachmentList.length != 0" class="image-list">
|
|
4
|
-
<!-- <template v-if="items.field.type === 'IMAGE'">
|
|
5
|
-
<div v-for="(item, index) in attachmentList" class="image-item" :key="item.url + index">
|
|
6
|
-
<template v-if="typeof item == 'object'">
|
|
7
|
-
<el-image style="width: 60px; height: 60px" :src="item.url" :preview-src-list="[item.url]">
|
|
8
|
-
</el-image>
|
|
9
|
-
</template>
|
|
10
|
-
<template v-else>
|
|
11
|
-
<el-image style="width: 60px; height: 60px" :src="item"
|
|
12
|
-
:preview-src-list="attachmentList">
|
|
13
|
-
</el-image>
|
|
14
|
-
</template>
|
|
15
|
-
<span class="delete" @click="deleteAttch(index)"><i
|
|
16
|
-
class="iconfont guoran-tongyichicun-16-09-shanchu2"></i></span>
|
|
17
|
-
</div>
|
|
18
|
-
</template>
|
|
19
|
-
<template v-else-if="items.field.type === 'VIDEO'">
|
|
20
|
-
<div v-for="(item, index) in attachmentList" class="video-item" :key="item.url + index">
|
|
21
|
-
<template v-if="typeof item == 'object'">
|
|
22
|
-
<img src="../assets/image/play.png"
|
|
23
|
-
@click="openDialog(item.url, item.name)">
|
|
24
|
-
</template>
|
|
25
|
-
<template v-else>
|
|
26
|
-
<img src="../assets/images/play.png"
|
|
27
|
-
@click="openDialog(item, item.name)">
|
|
28
|
-
</template>
|
|
29
|
-
<span class="delete" @click="deleteAttch(index)"><i
|
|
30
|
-
class="iconfont guoran-tongyichicun-16-09-shanchu2"></i></span>
|
|
31
|
-
</div>
|
|
32
|
-
</template> -->
|
|
33
|
-
<template>
|
|
34
|
-
<div v-for="(item, index) in attachmentList" class="attch-item" :key="item.url + index"
|
|
35
|
-
>
|
|
36
|
-
<!-- @click="openDialog(item, item.name)" -->
|
|
37
|
-
<span @click.stop="deleteAttch(index)"><i class="iconfont guoran-a-16-09"></i></span>
|
|
38
|
-
<div class="attch-item-left">
|
|
39
|
-
<i v-if="item.url == ''" class="el-icon-loading" style="color:#366AFF;margin: 5px;"></i>
|
|
40
|
-
<img src="../assets/image/video.png"
|
|
41
|
-
v-else-if="setSrc(item.name) == 'video'" />
|
|
42
|
-
<img src="../assets/image/image.png"
|
|
43
|
-
v-else-if="setSrc(item.name) == 'image'" />
|
|
44
|
-
<img src="../assets/image/txt.png"
|
|
45
|
-
v-else-if="setSrc(item.name) == 'txt'" />
|
|
46
|
-
<img src="../assets/image/word.png"
|
|
47
|
-
v-else-if="setSrc(item.name) == 'word'" />
|
|
48
|
-
<img src="../assets/image/pdf.png"
|
|
49
|
-
v-else-if="setSrc(item.name) == 'pdf'" />
|
|
50
|
-
<img src="../assets/image/ppt.png"
|
|
51
|
-
v-else-if="setSrc(item.name) == 'ppt'" />
|
|
52
|
-
<img src="../assets/image/excel.png"
|
|
53
|
-
v-else-if="setSrc(item.name) == 'excel'" />
|
|
54
|
-
<div class="fileName" v-if="item">
|
|
55
|
-
<template v-if="typeof item === 'string'">
|
|
56
|
-
<template v-if="item.indexOf('[') !== -1">
|
|
57
|
-
{{ JSON.parse(item)[index] }}
|
|
58
|
-
</template>
|
|
59
|
-
</template>
|
|
60
|
-
<template v-else>
|
|
61
|
-
{{ item.name }}
|
|
62
|
-
</template>
|
|
63
|
-
</div>
|
|
64
|
-
</div>
|
|
65
|
-
</div>
|
|
66
|
-
</template>
|
|
67
|
-
</div>
|
|
68
|
-
<!-- <el-dialog :visible.sync="dialogVisible" width="800px" :close-on-click-modal="false"
|
|
69
|
-
custom-class="look-dialog">
|
|
70
|
-
<template v-if="fieldType === 'VIDEO'">
|
|
71
|
-
<video :src="dialogUrl" controls></video>
|
|
72
|
-
</template>
|
|
73
|
-
<template v-else-if="fieldType === 'IMAGE'">
|
|
74
|
-
<img :src="dialogUrl" />
|
|
75
|
-
</template>
|
|
76
|
-
<div v-else-if="fieldType === 'txt' || fieldType === 'doc'" style="height: 60vh">
|
|
77
|
-
<embed :src="dialogUrl" width="100%" height="100%" />
|
|
78
|
-
</div>
|
|
79
|
-
</el-dialog> -->
|
|
80
|
-
</div>
|
|
81
|
-
</template>
|
|
82
|
-
|
|
83
|
-
<script>
|
|
84
|
-
|
|
85
|
-
export default {
|
|
86
|
-
name: "customUpload",
|
|
87
|
-
components: {},
|
|
88
|
-
data () {
|
|
89
|
-
return {
|
|
90
|
-
dialogUrl: "",
|
|
91
|
-
dialogVisible: false,
|
|
92
|
-
fieldType: "",
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
props: ["attachmentList"],
|
|
96
|
-
methods: {
|
|
97
|
-
//查看视频
|
|
98
|
-
openDialog (item, fileName) {
|
|
99
|
-
let url = typeof item == 'object' ? item.url : item
|
|
100
|
-
this.fieldType = ""
|
|
101
|
-
const fileType = fileName.substring(fileName.lastIndexOf('.'));
|
|
102
|
-
this.dialogUrl = url;
|
|
103
|
-
if (fileType === '.mp4' || fileType === '.MP4') {
|
|
104
|
-
this.fieldType = 'VIDEO'
|
|
105
|
-
this.dialogVisible = true;
|
|
106
|
-
}
|
|
107
|
-
else if (fileType === '.jpg' || fileType === '.png' || fileType === '.JPG' || fileType === '.PNG') {
|
|
108
|
-
this.fieldType = 'IMAGE'
|
|
109
|
-
this.dialogVisible = true;
|
|
110
|
-
}
|
|
111
|
-
else {
|
|
112
|
-
window.open(url, 'target');
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
deleteAttch (index) {
|
|
116
|
-
this.$emit('attachDeleteAttch', index)
|
|
117
|
-
},
|
|
118
|
-
//根据上传类型设置图标
|
|
119
|
-
setSrc (fileName) {
|
|
120
|
-
let file = ""
|
|
121
|
-
const fileType = fileName.substring(fileName.lastIndexOf('.'));
|
|
122
|
-
if (fileType === '.mp4' || fileType === '.MP4') {
|
|
123
|
-
file = 'video'
|
|
124
|
-
}
|
|
125
|
-
else if (fileType === '.jpg' || fileType === '.png' || fileType === '.JPG' || fileType === '.PNG') {
|
|
126
|
-
file = 'image'
|
|
127
|
-
}
|
|
128
|
-
else if (fileType == '.txt') {
|
|
129
|
-
file = 'txt'
|
|
130
|
-
}
|
|
131
|
-
else if (fileType == '.ppt' || fileType == '.pptx') {
|
|
132
|
-
file = 'ppt'
|
|
133
|
-
}
|
|
134
|
-
else if (fileType == '.doc' || fileType == '.docx') {
|
|
135
|
-
file = 'word'
|
|
136
|
-
}
|
|
137
|
-
else if (fileType == '.xls' || fileType == '.xlsx') {
|
|
138
|
-
file = 'excel'
|
|
139
|
-
}
|
|
140
|
-
else if (fileType == '.pdf') {
|
|
141
|
-
file = 'pdf'
|
|
142
|
-
}
|
|
143
|
-
return file
|
|
144
|
-
},
|
|
145
|
-
//下载文件
|
|
146
|
-
updownload () {
|
|
147
|
-
window.location.href = this.dialogUrl
|
|
148
|
-
/*window.open(this.dialogUrl,'_black')*/
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
};
|
|
152
|
-
</script>
|
|
153
|
-
|
|
154
|
-
<style scoped lang="less">
|
|
155
|
-
.custom-upload-o {
|
|
156
|
-
display: flex;
|
|
157
|
-
align-items: center;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
#attachment-upload {
|
|
161
|
-
.image-list {
|
|
162
|
-
display: flex;
|
|
163
|
-
flex-wrap: wrap;
|
|
164
|
-
padding: 0 8px;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.image-item {
|
|
168
|
-
margin: 0 6px;
|
|
169
|
-
position: relative;
|
|
170
|
-
|
|
171
|
-
.delete {
|
|
172
|
-
// width: 20px;
|
|
173
|
-
// height: 22px;
|
|
174
|
-
position: absolute;
|
|
175
|
-
top: 0px;
|
|
176
|
-
right: 0px;
|
|
177
|
-
// border-radius: 30px;
|
|
178
|
-
background: #ffffff;
|
|
179
|
-
display: flex;
|
|
180
|
-
align-items: center;
|
|
181
|
-
justify-content: flex-end;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
.guoran-tongyichicun-16-09-shanchu2 {
|
|
185
|
-
color: #366aff;
|
|
186
|
-
// position: absolute;
|
|
187
|
-
// top: 0px;
|
|
188
|
-
// right: 0px;
|
|
189
|
-
// cursor: pointer;
|
|
190
|
-
}
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
.guoran-tongyichicun-16-09-shanchu2 {
|
|
194
|
-
display: none;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.image-item:hover {
|
|
198
|
-
.delete {
|
|
199
|
-
width: 18px;
|
|
200
|
-
height: 20px;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.guoran-tongyichicun-16-09-shanchu2 {
|
|
204
|
-
display: block;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
.attch-item {
|
|
209
|
-
margin: 10px 0 0 0;
|
|
210
|
-
color: #606266;
|
|
211
|
-
font-size: 13px;
|
|
212
|
-
cursor: pointer;
|
|
213
|
-
display: flex;
|
|
214
|
-
align-items: center;
|
|
215
|
-
justify-content: space-between;
|
|
216
|
-
width: 100%;
|
|
217
|
-
|
|
218
|
-
.guoran-a-16-09 {
|
|
219
|
-
color: #366aff;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
.attch-item-left {
|
|
223
|
-
display: flex;
|
|
224
|
-
align-items: center;
|
|
225
|
-
flex: none;
|
|
226
|
-
width: 97%;
|
|
227
|
-
|
|
228
|
-
img {
|
|
229
|
-
margin-right: 4px;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
.video-item {
|
|
235
|
-
display: flex;
|
|
236
|
-
align-items: center;
|
|
237
|
-
justify-content: center;
|
|
238
|
-
background-color: #f0f4fc;
|
|
239
|
-
width: 60px;
|
|
240
|
-
height: 60px;
|
|
241
|
-
border-radius: 5px;
|
|
242
|
-
margin: 0 6px;
|
|
243
|
-
position: relative;
|
|
244
|
-
overflow: hidden;
|
|
245
|
-
|
|
246
|
-
img {
|
|
247
|
-
cursor: pointer;
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
.delete {
|
|
251
|
-
// width: 20px;
|
|
252
|
-
// height: 22px;
|
|
253
|
-
position: absolute;
|
|
254
|
-
top: 0px;
|
|
255
|
-
right: 0px;
|
|
256
|
-
// border-radius: 30px;
|
|
257
|
-
background: #ffffff;
|
|
258
|
-
display: flex;
|
|
259
|
-
align-items: center;
|
|
260
|
-
justify-content: flex-end;
|
|
261
|
-
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
.guoran-tongyichicun-16-09-shanchu2 {
|
|
265
|
-
color: #366aff;
|
|
266
|
-
cursor: pointer;
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
.video-item:hover {
|
|
271
|
-
.delete {
|
|
272
|
-
width: 20px;
|
|
273
|
-
height: 22px;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
.guoran-tongyichicun-16-09-shanchu2 {
|
|
277
|
-
display: block;
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
|
|
281
|
-
/deep/.attachment-upload {
|
|
282
|
-
.el-upload {
|
|
283
|
-
width: 100%;
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
.el-upload-dragger {
|
|
287
|
-
width: 100%;
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
.fileName {
|
|
292
|
-
max-width: 80%;
|
|
293
|
-
flex: none;
|
|
294
|
-
overflow: hidden;
|
|
295
|
-
text-overflow: ellipsis;
|
|
296
|
-
white-space: nowrap;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
/deep/ .el-upload--picture-card {
|
|
300
|
-
width: 60px;
|
|
301
|
-
height: 60px;
|
|
302
|
-
display: flex;
|
|
303
|
-
align-items: center;
|
|
304
|
-
justify-content: center;
|
|
305
|
-
flex: none;
|
|
306
|
-
}
|
|
307
|
-
|
|
308
|
-
/deep/.el-upload-dragger {
|
|
309
|
-
height: 60px;
|
|
310
|
-
display: flex;
|
|
311
|
-
align-items: center;
|
|
312
|
-
justify-content: space-around;
|
|
313
|
-
|
|
314
|
-
.el-icon-upload {
|
|
315
|
-
margin: 5px 10px 8px;
|
|
316
|
-
line-height: 30px;
|
|
317
|
-
font-size: 25px;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
.el-upload__text {
|
|
321
|
-
display: flex;
|
|
322
|
-
// flex-direction: column;
|
|
323
|
-
flex-wrap: wrap;
|
|
324
|
-
flex: 1;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
.el-upload-dragger>div {
|
|
329
|
-
display: flex;
|
|
330
|
-
align-items: center;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
.look-dialog {
|
|
335
|
-
video {
|
|
336
|
-
height: 500px;
|
|
337
|
-
object-fit: contain;
|
|
338
|
-
width: 100%;
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
img {
|
|
342
|
-
height: 500px;
|
|
343
|
-
width: 100%;
|
|
344
|
-
object-fit: contain;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<div id="attachment-upload">
|
|
3
|
+
<div v-if="attachmentList.length != 0" class="image-list">
|
|
4
|
+
<!-- <template v-if="items.field.type === 'IMAGE'">
|
|
5
|
+
<div v-for="(item, index) in attachmentList" class="image-item" :key="item.url + index">
|
|
6
|
+
<template v-if="typeof item == 'object'">
|
|
7
|
+
<el-image style="width: 60px; height: 60px" :src="item.url" :preview-src-list="[item.url]">
|
|
8
|
+
</el-image>
|
|
9
|
+
</template>
|
|
10
|
+
<template v-else>
|
|
11
|
+
<el-image style="width: 60px; height: 60px" :src="item"
|
|
12
|
+
:preview-src-list="attachmentList">
|
|
13
|
+
</el-image>
|
|
14
|
+
</template>
|
|
15
|
+
<span class="delete" @click="deleteAttch(index)"><i
|
|
16
|
+
class="iconfont guoran-tongyichicun-16-09-shanchu2"></i></span>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
<template v-else-if="items.field.type === 'VIDEO'">
|
|
20
|
+
<div v-for="(item, index) in attachmentList" class="video-item" :key="item.url + index">
|
|
21
|
+
<template v-if="typeof item == 'object'">
|
|
22
|
+
<img src="../assets/image/play.png"
|
|
23
|
+
@click="openDialog(item.url, item.name)">
|
|
24
|
+
</template>
|
|
25
|
+
<template v-else>
|
|
26
|
+
<img src="../assets/images/play.png"
|
|
27
|
+
@click="openDialog(item, item.name)">
|
|
28
|
+
</template>
|
|
29
|
+
<span class="delete" @click="deleteAttch(index)"><i
|
|
30
|
+
class="iconfont guoran-tongyichicun-16-09-shanchu2"></i></span>
|
|
31
|
+
</div>
|
|
32
|
+
</template> -->
|
|
33
|
+
<template>
|
|
34
|
+
<div v-for="(item, index) in attachmentList" class="attch-item" :key="item.url + index"
|
|
35
|
+
>
|
|
36
|
+
<!-- @click="openDialog(item, item.name)" -->
|
|
37
|
+
<span @click.stop="deleteAttch(index)"><i class="iconfont guoran-a-16-09"></i></span>
|
|
38
|
+
<div class="attch-item-left">
|
|
39
|
+
<i v-if="item.url == ''" class="el-icon-loading" style="color:#366AFF;margin: 5px;"></i>
|
|
40
|
+
<img src="../assets/image/video.png"
|
|
41
|
+
v-else-if="setSrc(item.name) == 'video'" />
|
|
42
|
+
<img src="../assets/image/image.png"
|
|
43
|
+
v-else-if="setSrc(item.name) == 'image'" />
|
|
44
|
+
<img src="../assets/image/txt.png"
|
|
45
|
+
v-else-if="setSrc(item.name) == 'txt'" />
|
|
46
|
+
<img src="../assets/image/word.png"
|
|
47
|
+
v-else-if="setSrc(item.name) == 'word'" />
|
|
48
|
+
<img src="../assets/image/pdf.png"
|
|
49
|
+
v-else-if="setSrc(item.name) == 'pdf'" />
|
|
50
|
+
<img src="../assets/image/ppt.png"
|
|
51
|
+
v-else-if="setSrc(item.name) == 'ppt'" />
|
|
52
|
+
<img src="../assets/image/excel.png"
|
|
53
|
+
v-else-if="setSrc(item.name) == 'excel'" />
|
|
54
|
+
<div class="fileName" v-if="item">
|
|
55
|
+
<template v-if="typeof item === 'string'">
|
|
56
|
+
<template v-if="item.indexOf('[') !== -1">
|
|
57
|
+
{{ JSON.parse(item)[index] }}
|
|
58
|
+
</template>
|
|
59
|
+
</template>
|
|
60
|
+
<template v-else>
|
|
61
|
+
{{ item.name }}
|
|
62
|
+
</template>
|
|
63
|
+
</div>
|
|
64
|
+
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</template>
|
|
67
|
+
</div>
|
|
68
|
+
<!-- <el-dialog :visible.sync="dialogVisible" width="800px" :close-on-click-modal="false"
|
|
69
|
+
custom-class="look-dialog">
|
|
70
|
+
<template v-if="fieldType === 'VIDEO'">
|
|
71
|
+
<video :src="dialogUrl" controls></video>
|
|
72
|
+
</template>
|
|
73
|
+
<template v-else-if="fieldType === 'IMAGE'">
|
|
74
|
+
<img :src="dialogUrl" />
|
|
75
|
+
</template>
|
|
76
|
+
<div v-else-if="fieldType === 'txt' || fieldType === 'doc'" style="height: 60vh">
|
|
77
|
+
<embed :src="dialogUrl" width="100%" height="100%" />
|
|
78
|
+
</div>
|
|
79
|
+
</el-dialog> -->
|
|
80
|
+
</div>
|
|
81
|
+
</template>
|
|
82
|
+
|
|
83
|
+
<script>
|
|
84
|
+
|
|
85
|
+
export default {
|
|
86
|
+
name: "customUpload",
|
|
87
|
+
components: {},
|
|
88
|
+
data () {
|
|
89
|
+
return {
|
|
90
|
+
dialogUrl: "",
|
|
91
|
+
dialogVisible: false,
|
|
92
|
+
fieldType: "",
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
props: ["attachmentList"],
|
|
96
|
+
methods: {
|
|
97
|
+
//查看视频
|
|
98
|
+
openDialog (item, fileName) {
|
|
99
|
+
let url = typeof item == 'object' ? item.url : item
|
|
100
|
+
this.fieldType = ""
|
|
101
|
+
const fileType = fileName.substring(fileName.lastIndexOf('.'));
|
|
102
|
+
this.dialogUrl = url;
|
|
103
|
+
if (fileType === '.mp4' || fileType === '.MP4') {
|
|
104
|
+
this.fieldType = 'VIDEO'
|
|
105
|
+
this.dialogVisible = true;
|
|
106
|
+
}
|
|
107
|
+
else if (fileType === '.jpg' || fileType === '.png' || fileType === '.JPG' || fileType === '.PNG') {
|
|
108
|
+
this.fieldType = 'IMAGE'
|
|
109
|
+
this.dialogVisible = true;
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
window.open(url, 'target');
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
deleteAttch (index) {
|
|
116
|
+
this.$emit('attachDeleteAttch', index)
|
|
117
|
+
},
|
|
118
|
+
//根据上传类型设置图标
|
|
119
|
+
setSrc (fileName) {
|
|
120
|
+
let file = ""
|
|
121
|
+
const fileType = fileName.substring(fileName.lastIndexOf('.'));
|
|
122
|
+
if (fileType === '.mp4' || fileType === '.MP4') {
|
|
123
|
+
file = 'video'
|
|
124
|
+
}
|
|
125
|
+
else if (fileType === '.jpg' || fileType === '.png' || fileType === '.JPG' || fileType === '.PNG') {
|
|
126
|
+
file = 'image'
|
|
127
|
+
}
|
|
128
|
+
else if (fileType == '.txt') {
|
|
129
|
+
file = 'txt'
|
|
130
|
+
}
|
|
131
|
+
else if (fileType == '.ppt' || fileType == '.pptx') {
|
|
132
|
+
file = 'ppt'
|
|
133
|
+
}
|
|
134
|
+
else if (fileType == '.doc' || fileType == '.docx') {
|
|
135
|
+
file = 'word'
|
|
136
|
+
}
|
|
137
|
+
else if (fileType == '.xls' || fileType == '.xlsx') {
|
|
138
|
+
file = 'excel'
|
|
139
|
+
}
|
|
140
|
+
else if (fileType == '.pdf') {
|
|
141
|
+
file = 'pdf'
|
|
142
|
+
}
|
|
143
|
+
return file
|
|
144
|
+
},
|
|
145
|
+
//下载文件
|
|
146
|
+
updownload () {
|
|
147
|
+
window.location.href = this.dialogUrl
|
|
148
|
+
/*window.open(this.dialogUrl,'_black')*/
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
</script>
|
|
153
|
+
|
|
154
|
+
<style scoped lang="less">
|
|
155
|
+
.custom-upload-o {
|
|
156
|
+
display: flex;
|
|
157
|
+
align-items: center;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
#attachment-upload {
|
|
161
|
+
.image-list {
|
|
162
|
+
display: flex;
|
|
163
|
+
flex-wrap: wrap;
|
|
164
|
+
padding: 0 8px;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.image-item {
|
|
168
|
+
margin: 0 6px;
|
|
169
|
+
position: relative;
|
|
170
|
+
|
|
171
|
+
.delete {
|
|
172
|
+
// width: 20px;
|
|
173
|
+
// height: 22px;
|
|
174
|
+
position: absolute;
|
|
175
|
+
top: 0px;
|
|
176
|
+
right: 0px;
|
|
177
|
+
// border-radius: 30px;
|
|
178
|
+
background: #ffffff;
|
|
179
|
+
display: flex;
|
|
180
|
+
align-items: center;
|
|
181
|
+
justify-content: flex-end;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.guoran-tongyichicun-16-09-shanchu2 {
|
|
185
|
+
color: #366aff;
|
|
186
|
+
// position: absolute;
|
|
187
|
+
// top: 0px;
|
|
188
|
+
// right: 0px;
|
|
189
|
+
// cursor: pointer;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.guoran-tongyichicun-16-09-shanchu2 {
|
|
194
|
+
display: none;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.image-item:hover {
|
|
198
|
+
.delete {
|
|
199
|
+
width: 18px;
|
|
200
|
+
height: 20px;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
.guoran-tongyichicun-16-09-shanchu2 {
|
|
204
|
+
display: block;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.attch-item {
|
|
209
|
+
margin: 10px 0 0 0;
|
|
210
|
+
color: #606266;
|
|
211
|
+
font-size: 13px;
|
|
212
|
+
cursor: pointer;
|
|
213
|
+
display: flex;
|
|
214
|
+
align-items: center;
|
|
215
|
+
justify-content: space-between;
|
|
216
|
+
width: 100%;
|
|
217
|
+
|
|
218
|
+
.guoran-a-16-09 {
|
|
219
|
+
color: #366aff;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.attch-item-left {
|
|
223
|
+
display: flex;
|
|
224
|
+
align-items: center;
|
|
225
|
+
flex: none;
|
|
226
|
+
width: 97%;
|
|
227
|
+
|
|
228
|
+
img {
|
|
229
|
+
margin-right: 4px;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.video-item {
|
|
235
|
+
display: flex;
|
|
236
|
+
align-items: center;
|
|
237
|
+
justify-content: center;
|
|
238
|
+
background-color: #f0f4fc;
|
|
239
|
+
width: 60px;
|
|
240
|
+
height: 60px;
|
|
241
|
+
border-radius: 5px;
|
|
242
|
+
margin: 0 6px;
|
|
243
|
+
position: relative;
|
|
244
|
+
overflow: hidden;
|
|
245
|
+
|
|
246
|
+
img {
|
|
247
|
+
cursor: pointer;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.delete {
|
|
251
|
+
// width: 20px;
|
|
252
|
+
// height: 22px;
|
|
253
|
+
position: absolute;
|
|
254
|
+
top: 0px;
|
|
255
|
+
right: 0px;
|
|
256
|
+
// border-radius: 30px;
|
|
257
|
+
background: #ffffff;
|
|
258
|
+
display: flex;
|
|
259
|
+
align-items: center;
|
|
260
|
+
justify-content: flex-end;
|
|
261
|
+
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.guoran-tongyichicun-16-09-shanchu2 {
|
|
265
|
+
color: #366aff;
|
|
266
|
+
cursor: pointer;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
.video-item:hover {
|
|
271
|
+
.delete {
|
|
272
|
+
width: 20px;
|
|
273
|
+
height: 22px;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.guoran-tongyichicun-16-09-shanchu2 {
|
|
277
|
+
display: block;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
/deep/.attachment-upload {
|
|
282
|
+
.el-upload {
|
|
283
|
+
width: 100%;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.el-upload-dragger {
|
|
287
|
+
width: 100%;
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.fileName {
|
|
292
|
+
max-width: 80%;
|
|
293
|
+
flex: none;
|
|
294
|
+
overflow: hidden;
|
|
295
|
+
text-overflow: ellipsis;
|
|
296
|
+
white-space: nowrap;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/deep/ .el-upload--picture-card {
|
|
300
|
+
width: 60px;
|
|
301
|
+
height: 60px;
|
|
302
|
+
display: flex;
|
|
303
|
+
align-items: center;
|
|
304
|
+
justify-content: center;
|
|
305
|
+
flex: none;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
/deep/.el-upload-dragger {
|
|
309
|
+
height: 60px;
|
|
310
|
+
display: flex;
|
|
311
|
+
align-items: center;
|
|
312
|
+
justify-content: space-around;
|
|
313
|
+
|
|
314
|
+
.el-icon-upload {
|
|
315
|
+
margin: 5px 10px 8px;
|
|
316
|
+
line-height: 30px;
|
|
317
|
+
font-size: 25px;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.el-upload__text {
|
|
321
|
+
display: flex;
|
|
322
|
+
// flex-direction: column;
|
|
323
|
+
flex-wrap: wrap;
|
|
324
|
+
flex: 1;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
.el-upload-dragger>div {
|
|
329
|
+
display: flex;
|
|
330
|
+
align-items: center;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.look-dialog {
|
|
335
|
+
video {
|
|
336
|
+
height: 500px;
|
|
337
|
+
object-fit: contain;
|
|
338
|
+
width: 100%;
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
img {
|
|
342
|
+
height: 500px;
|
|
343
|
+
width: 100%;
|
|
344
|
+
object-fit: contain;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
347
|
</style>
|