lw-cdp-ui 1.1.33 → 1.1.34

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.
@@ -296,8 +296,7 @@ export default {
296
296
  handler(val, old) {
297
297
  if (this.hasConfig && this.isChange) {
298
298
  let form = this.flattenObject(val)
299
- console.log(this.form, form)
300
- // this.form = Object.assign(this.form, form)
299
+ this.form = Object.assign(this.form, form)
301
300
  }
302
301
  },
303
302
  deep: true
@@ -21,7 +21,9 @@
21
21
  <div class="lw-upload__img-actions"
22
22
  v-if="!disabled">
23
23
  <span class="del"
24
- @click="handleRemove(index)"><el-icon><el-icon-delete /></el-icon></span>
24
+ @click="handleRemove(index)">
25
+ <el-icon><el-icon-delete /></el-icon>
26
+ </span>
25
27
  </div>
26
28
  </div>
27
29
  </template>
@@ -159,6 +161,11 @@ export default {
159
161
  },
160
162
  methods: {
161
163
  newFile(url) {
164
+ if (this.multiple) {
165
+ this.fileList = url
166
+ } else {
167
+ this.fileList = [url]
168
+ }
162
169
  if (url) {
163
170
  this.file = {
164
171
  status: "success",
@@ -174,7 +181,12 @@ export default {
174
181
  },
175
182
  clearFiles() {
176
183
  URL.revokeObjectURL(this.file?.tempFile)
177
- this.value = ""
184
+ if (this.multiple) {
185
+ this.value = this.fileList
186
+ } else {
187
+ this.value = ""
188
+ }
189
+
178
190
  this.file = null
179
191
  this.$nextTick(() => {
180
192
  this.$refs.uploader?.clearFiles()
@@ -204,11 +216,12 @@ export default {
204
216
  }
205
217
  },
206
218
  before(file) {
219
+ console.log(file.type)
207
220
  const acceptIncludes = this.accept.replace(/\s/g, "").split(",").includes(file.type)
208
221
  if (!acceptIncludes) {
209
222
  this.$notify.warning({
210
- title: '上传文件警告',
211
- message: '选择的文件非图像类文件'
223
+ title: '上传文件错误',
224
+ message: '选择的文件类型不对'
212
225
  })
213
226
  this.clearFiles()
214
227
  return false
@@ -383,7 +396,7 @@ export default {
383
396
  align-items: center;
384
397
  flex-direction: column;
385
398
  }
386
- .lw-upload{
399
+ .lw-upload {
387
400
  display: flex;
388
401
  align-items: center;
389
402
  flex-wrap: wrap;
@@ -5349,7 +5349,7 @@ const lwTable = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render
5349
5349
  },
5350
5350
  methods: {
5351
5351
  newFile(e) {
5352
- e ? this.file = {
5352
+ this.multiple ? this.fileList = e : this.fileList = [e], e ? this.file = {
5353
5353
  status: "success",
5354
5354
  url: e
5355
5355
  } : this.file = null;
@@ -5359,7 +5359,7 @@ const lwTable = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render
5359
5359
  },
5360
5360
  clearFiles() {
5361
5361
  var e;
5362
- URL.revokeObjectURL((e = this.file) == null ? void 0 : e.tempFile), this.value = "", this.file = null, this.$nextTick(() => {
5362
+ URL.revokeObjectURL((e = this.file) == null ? void 0 : e.tempFile), this.multiple ? this.value = this.fileList : this.value = "", this.file = null, this.$nextTick(() => {
5363
5363
  var t;
5364
5364
  (t = this.$refs.uploader) == null || t.clearFiles();
5365
5365
  });
@@ -5373,10 +5373,10 @@ const lwTable = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["render", _sfc_render
5373
5373
  this.file = e, e.status == "ready" && (e.tempFile = URL.createObjectURL(e.raw));
5374
5374
  },
5375
5375
  before(e) {
5376
- if (!this.accept.replace(/\s/g, "").split(",").includes(e.type))
5376
+ if (console.log(e.type), !this.accept.replace(/\s/g, "").split(",").includes(e.type))
5377
5377
  return this.$notify.warning({
5378
- title: "上传文件警告",
5379
- message: "选择的文件非图像类文件"
5378
+ title: "上传文件错误",
5379
+ message: "选择的文件类型不对"
5380
5380
  }), this.clearFiles(), !1;
5381
5381
  if (!(e.size / 1024 / 1024 < this.maxSize))
5382
5382
  return this.$message.warning(`上传文件大小不能超过 ${this.maxSize}MB!`), this.clearFiles(), !1;
@@ -5522,7 +5522,7 @@ function _sfc_render$h(e, t, n, c, a, p) {
5522
5522
  }, 8, ["style", "auto-upload", "disabled", "show-file-list", "action", "name", "data", "accept", "limit", "http-request", "on-change", "before-upload", "on-success", "on-error", "on-exceed"])) : createCommentVNode("", !0)
5523
5523
  ], 2);
5524
5524
  }
5525
- const lwUpload = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-3acad1cb"]]), _sfc_main$g = {
5525
+ const lwUpload = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["render", _sfc_render$h], ["__scopeId", "data-v-b47fd3b5"]]), _sfc_main$g = {
5526
5526
  components: {
5527
5527
  lwUpload
5528
5528
  },
@@ -6254,7 +6254,7 @@ const lwForm = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["render", _sfc_render$
6254
6254
  handler(e, t) {
6255
6255
  if (this.hasConfig && this.isChange) {
6256
6256
  let n = this.flattenObject(e);
6257
- console.log(this.form, n);
6257
+ this.form = Object.assign(this.form, n);
6258
6258
  }
6259
6259
  },
6260
6260
  deep: !0
@@ -6701,7 +6701,7 @@ function _sfc_render$f(e, t, n, c, a, p) {
6701
6701
  [u, n.loading]
6702
6702
  ]);
6703
6703
  }
6704
- const lwFormMini = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$f], ["__scopeId", "data-v-5946a29a"]]), config$1 = {
6704
+ const lwFormMini = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["render", _sfc_render$f], ["__scopeId", "data-v-b5d200ce"]]), config$1 = {
6705
6705
  icons: [
6706
6706
  {
6707
6707
  name: "默认",