xianniu-ui 0.8.34 → 0.8.36

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": "xianniu-ui",
3
- "version": "0.8.34",
3
+ "version": "0.8.36",
4
4
  "private": false,
5
5
  "main": "lib/xianniu-ui.umd.min.js",
6
6
  "scripts": {
@@ -212,17 +212,15 @@ export default {
212
212
  if (!this.fileList.length) {
213
213
  return this.$message.warning("请选择要上传的文件");
214
214
  }
215
- if (this.autoUpload) {
216
- this.submit();
217
- }
215
+ this.submit();
216
+ this.$emit("on-confirm", this.successFiles);
218
217
  });
219
218
  } else {
220
219
  if (!this.fileList.length) {
221
220
  return this.$message.warning("请选择要上传的文件");
222
221
  }
223
- if (this.autoUpload) {
224
- this.submit();
225
- }
222
+
223
+ this.submit();
226
224
  this.$emit("on-confirm", this.successFiles);
227
225
  }
228
226
  },
@@ -261,6 +261,7 @@ export default {
261
261
  form: {
262
262
  value: [],
263
263
  },
264
+ formValues:{},
264
265
  isColl: false,
265
266
  };
266
267
  },
@@ -312,10 +313,15 @@ export default {
312
313
  }
313
314
  }
314
315
  }
316
+ this.formValues = formValue;
315
317
  this.$emit("on-search", formValue);
316
318
  },
319
+ getFormValue(){
320
+ return this.formValues;
321
+ },
317
322
  onReset() {
318
323
  this.resetFields();
324
+ this.formValues = {}
319
325
  this.$emit("on-reset");
320
326
  this.$emit("on-search", {});
321
327
  },
@@ -1,4 +1,13 @@
1
1
  .xn-upload {
2
+ .el-upload-list__item{
3
+ &.is-success{
4
+ &:hover{
5
+ .el-upload-list__item-status-label{
6
+ display: none !important;
7
+ }
8
+ }
9
+ }
10
+ }
2
11
  &.is-hidden {
3
12
  .el-upload {
4
13
  &.el-upload--picture-card {
@@ -56,6 +65,7 @@
56
65
  -webkit-box-orient: vertical;
57
66
  }
58
67
  }
68
+
59
69
  }
60
70
  &.is-disabled {
61
71
  .el-upload.el-upload--picture-card {
@@ -15,7 +15,7 @@
15
15
  :http-request="onHttpUpload"
16
16
  :on-error="onError"
17
17
  :before-upload="onBeforeUpload"
18
- :style="{ ...styles,...idCardSizeData }"
18
+ :style="{ ...styles, ...idCardSizeData }"
19
19
  :on-exceed="onExceed"
20
20
  :on-change="onChange"
21
21
  :on-preview="onPreviewFile"
@@ -38,11 +38,55 @@
38
38
  </slot>
39
39
  </template>
40
40
 
41
+ <template
42
+ slot="file"
43
+ slot-scope="{ file }"
44
+ v-if="['list'].includes(listType)"
45
+ >
46
+ <a
47
+ class="el-upload-list__item-name"
48
+ @click="handlePictureCardPreview(file)"
49
+ v-if="$utils.isImg(file)"
50
+ ><i class="el-icon-document"></i>{{ file.name }}
51
+ </a>
52
+ <a
53
+ class="el-upload-list__item-name"
54
+ @click="handleAVPreview(file)"
55
+ v-if="$utils.isAV(file)"
56
+ ><i class="el-icon-document"></i>{{ file.name }}
57
+ </a>
58
+ <a class="el-upload-list__item-name" v-if="file.status === 'uploading'"
59
+ ><i class="el-icon-document"></i>{{ file.name }}
60
+ </a>
61
+ <el-progress
62
+ v-if="file.status === 'uploading'"
63
+ type="line"
64
+ :stroke-width="2"
65
+ :percentage="process(file.percentage || 0)"
66
+ >
67
+ </el-progress>
68
+ <label
69
+ v-if="file.status === 'success'"
70
+ class="el-upload-list__item-status-label"
71
+ >
72
+ <i
73
+ :class="{
74
+ 'el-icon-upload-success': true,
75
+ 'el-icon-circle-check': true
76
+ }"
77
+ ></i>
78
+ </label>
79
+ <i
80
+ class="el-icon-close"
81
+ @click="handleRemove(file, fileList)"
82
+ v-if="allowDelete || ($attrs.disabled==null && !preview) || hideUpload"
83
+ ></i>
84
+ </template>
41
85
  <div
42
86
  slot="file"
43
87
  slot-scope="{ file }"
44
88
  class="xn-upload--slot"
45
- v-if="['picture-card', 'idcard'].includes(listType)"
89
+ v-else-if="['picture-card', 'idcard'].includes(listType)"
46
90
  >
47
91
  <uploadPop :file="file" @on-download="handleDownload(file)"></uploadPop>
48
92
  <template v-if="$utils.isImg(file)">
@@ -55,7 +99,10 @@
55
99
  <template v-else-if="$utils.isAV(file)">
56
100
  <el-image
57
101
  class="el-upload-list__item-thumbnail"
58
- :src="file.url + '?x-oss-process=video/snapshot,t_0,f_jpg,w_0,h_0,m_fast,ar_auto'"
102
+ :src="
103
+ file.url +
104
+ '?x-oss-process=video/snapshot,t_0,f_jpg,w_0,h_0,m_fast,ar_auto'
105
+ "
59
106
  fit="cover"
60
107
  />
61
108
  </template>
@@ -84,7 +131,7 @@
84
131
  >
85
132
  <i class="fz-16 el-icon-zoom-in" />
86
133
  </span>
87
- <span
134
+ <span
88
135
  v-if="$utils.isAV(file)"
89
136
  class="el-upload-list__item-preview"
90
137
  @click="handleAVPreview(file)"
@@ -122,7 +169,7 @@ import ElImageViewer from "element-ui/packages/image/src/image-viewer";
122
169
  import Client from "@/oss";
123
170
  import uploadPop from "./upload-pop.vue";
124
171
  import idCard from "./idCard.vue";
125
- import AV from './AV'
172
+ import AV from "./AV";
126
173
  // const MAX_WARNING = 1024 * 10 * 1024;
127
174
  export default {
128
175
  name: "XnUpload",
@@ -131,14 +178,14 @@ export default {
131
178
  uploadPop,
132
179
  ElImageViewer,
133
180
  idCard,
134
- AV
181
+ AV,
135
182
  },
136
183
  props: {
137
184
  listType: {
138
185
  type: String,
139
186
  default: "picture-card",
140
187
  },
141
- allowDelete:{
188
+ allowDelete: {
142
189
  type: Boolean,
143
190
  default: false,
144
191
  },
@@ -196,8 +243,8 @@ export default {
196
243
  oss: null,
197
244
  client: null,
198
245
  idCardSizeData: {},
199
- isShowAV:false,
200
- avUrl:''
246
+ isShowAV: false,
247
+ avUrl: "",
201
248
  };
202
249
  },
203
250
  computed: {
@@ -224,7 +271,7 @@ export default {
224
271
  stsUrl: this.$XN.stsUrl || "",
225
272
  setFileIdUrl: this.$XN.setFileIdUrl || "",
226
273
  });
227
- this.idCardSize()
274
+ this.idCardSize();
228
275
  },
229
276
  beforeDestroy() {
230
277
  // this.$emit("update:fileList", []);
@@ -326,8 +373,8 @@ export default {
326
373
  this.imageView = file.url;
327
374
  });
328
375
  },
329
- handleAVPreview(file){
330
- this.isShowAV = true
376
+ handleAVPreview(file) {
377
+ this.isShowAV = true;
331
378
  this.$nextTick(() => {
332
379
  this.avUrl = file.url;
333
380
  });
@@ -357,15 +404,15 @@ export default {
357
404
  abortUpload() {
358
405
  return this.oss.oss.cancel();
359
406
  },
360
- onPreviewFile(file){
361
- if(file.isAV === 1){
362
- this.handleAVPreview(file)
363
- }else if(file.imgFlag === 1){
364
- this.handlePictureCardPreview(file)
365
- }else{
366
- this.handleDownload(file)
407
+ onPreviewFile(file) {
408
+ if (file.isAV === 1) {
409
+ this.handleAVPreview(file);
410
+ } else if (file.imgFlag === 1) {
411
+ this.handlePictureCardPreview(file);
412
+ } else {
413
+ this.handleDownload(file);
367
414
  }
368
- }
415
+ },
369
416
  },
370
417
  };
371
418
  </script>