lw-cdp-ui 1.1.32 → 1.1.33

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,7 +296,8 @@ export default {
296
296
  handler(val, old) {
297
297
  if (this.hasConfig && this.isChange) {
298
298
  let form = this.flattenObject(val)
299
- this.form = Object.assign(this.form, form)
299
+ console.log(this.form, form)
300
+ // this.form = Object.assign(this.form, form)
300
301
  }
301
302
  },
302
303
  deep: true
@@ -449,11 +450,7 @@ export default {
449
450
  // prop NAME
450
451
  getPropName(item) {
451
452
  if (item.component == 'checkbox' || item.component == 'upload') {
452
- if (item.name) {
453
- return `${item.name}.${item.options.items[0].name}`
454
- } else {
455
- return item.options.items[0].name
456
- }
453
+ return item.options.items[0].name
457
454
 
458
455
  } else {
459
456
  return item.name
@@ -39,10 +39,10 @@
39
39
  <template v-else-if="item.component=='upload'">
40
40
  <el-col v-for="(_item, _index) in item.options.items"
41
41
  :key="_index">
42
- <lw-upload v-model="row[_item.name]"
43
- :title="_item.label"></lw-upload>
42
+ <lw-upload v-model="row[_item.name]"></lw-upload>
44
43
  <div class="error-tips">
45
- {{ row['errorMsg'][_item.name] }}</div>
44
+ {{ row['errorMsg'][_item.name] }}
45
+ </div>
46
46
 
47
47
  </el-col>
48
48
  </template>
@@ -130,14 +130,19 @@
130
130
  <!-- number -->
131
131
  <template v-else-if="item.component=='number'">
132
132
  <el-input-number v-model="row[item.name]"
133
+ :disabled="item.options?.disabled"
134
+ :min="item?.options?.min"
135
+ :max="item?.options?.max"
133
136
  size="small"
134
- :disabled="isDisabled(item, row)"
135
- v-bind="{
136
- min: item?.options?.min !== undefined ? item.options.min : null,
137
- max: item?.options?.max !== undefined ? item.options.max : null,
138
- placeholder: item?.options?.placeholder || ''
139
- }"
140
- controls-position="right"></el-input-number>
137
+ :step="item?.options?.step || 1"
138
+ :precision="item?.options?.precision"
139
+ :placeholder="item?.options?.placeholder || ''"
140
+ :controls-position="item?.options?.controlsPosition || 'right'">
141
+ <template v-if="item?.options?.suffix"
142
+ #suffix>
143
+ <span>{{ item.options.suffix }}</span>
144
+ </template>
145
+ </el-input-number>
141
146
 
142
147
  </template>
143
148
  <!-- radio -->
@@ -201,7 +206,7 @@
201
206
  </template>
202
207
 
203
208
  <!-- 按钮 -->
204
- <template v-else-if="item.component == 'operation' && !isView">
209
+ <template v-else-if="item.component == 'operation'">
205
210
  <!-- 默认新增/删除 -->
206
211
  <span v-for="o in item.options.addDelete"
207
212
  :key="o"
@@ -169,17 +169,15 @@ export default {
169
169
  }
170
170
  },
171
171
  handleRemove(index) {
172
- if (this.multiple) {
173
- this.fileList.splice(index, 1)
174
- }
172
+ this.fileList.splice(index, 1)
175
173
  this.clearFiles()
176
174
  },
177
175
  clearFiles() {
178
- URL.revokeObjectURL(this.file.tempFile)
176
+ URL.revokeObjectURL(this.file?.tempFile)
179
177
  this.value = ""
180
178
  this.file = null
181
179
  this.$nextTick(() => {
182
- this.$refs.uploader.clearFiles()
180
+ this.$refs.uploader?.clearFiles()
183
181
  })
184
182
  },
185
183
  change(file, files) {
@@ -241,7 +239,6 @@ export default {
241
239
  }
242
240
  var response = this.parseData(res, file)
243
241
  file.url = response.src
244
- console.log(this.fileList)
245
242
  this.fileList.push(file.url)
246
243
  if (this.multiple) {
247
244
  this.value = this.fileList
@@ -287,149 +284,140 @@ export default {
287
284
  </script>
288
285
 
289
286
  <style lang="scss" scoped>
290
- // 表单错误状态样式
291
- .el-form-item.is-error {
292
- .lw-upload {
293
- .el-upload--picture-card {
294
- border-color: var(--el-color-danger);
295
- }
296
- }
287
+ .el-form-item.is-error .lw-upload .el-upload--picture-card {
288
+ border-color: var(--el-color-danger);
297
289
  }
298
290
 
299
- // 上传组件通用样式
300
- .lw-upload {
301
- display: flex;
302
- gap: 10px;
303
- width: 100%;
304
- flex-wrap: wrap;
305
- justify-content: left;
306
- .el-upload--picture-card {
307
- border-radius: 0;
308
- }
291
+ .lw-upload .el-upload--picture-card {
292
+ border-radius: 0;
293
+ }
309
294
 
310
- .uploader,
311
- :deep(.el-upload) {
312
- width: 100%;
313
- height: 100%;
314
- }
295
+ .lw-upload .uploader,
296
+ .lw-upload:deep(.el-upload) {
297
+ width: 100%;
298
+ height: 100%;
299
+ }
315
300
 
316
- &__img {
317
- width: 100%;
318
- height: 100%;
319
- position: relative;
301
+ .lw-upload__img {
302
+ width: 100%;
303
+ height: 100%;
304
+ position: relative;
305
+ }
320
306
 
321
- .image {
322
- width: 100%;
323
- height: 100%;
324
- }
307
+ .lw-upload__img .image {
308
+ width: 100%;
309
+ height: 100%;
310
+ }
325
311
 
326
- &-actions {
327
- position: absolute;
328
- top: 0;
329
- right: 0;
330
- display: none;
312
+ .lw-upload__img-actions {
313
+ position: absolute;
314
+ top: 0;
315
+ right: 0;
316
+ display: none;
317
+ }
331
318
 
332
- span {
333
- display: flex;
334
- justify-content: center;
335
- align-items: center;
336
- width: 25px;
337
- height: 25px;
338
- cursor: pointer;
339
- color: #fff;
319
+ .lw-upload__img-actions span {
320
+ display: flex;
321
+ justify-content: center;
322
+ align-items: center;
323
+ width: 25px;
324
+ height: 25px;
325
+ cursor: pointer;
326
+ color: #fff;
327
+ }
340
328
 
341
- i {
342
- font-size: 12px;
343
- }
329
+ .lw-upload__img-actions span i {
330
+ font-size: 12px;
331
+ }
344
332
 
345
- &.del {
346
- background: #f56c6c;
347
- }
348
- }
349
- }
333
+ .lw-upload__img-actions .del {
334
+ background: #f56c6c;
335
+ }
350
336
 
351
- &:hover {
352
- &-actions {
353
- display: block;
354
- }
355
- }
356
- }
337
+ .lw-upload__img:hover .lw-upload__img-actions {
338
+ display: block;
339
+ }
357
340
 
358
- &__img-slot {
359
- display: flex;
360
- justify-content: center;
361
- align-items: center;
362
- width: 100%;
363
- height: 100%;
364
- font-size: 12px;
365
- background-color: var(--el-fill-color-lighter);
366
- }
341
+ .lw-upload__img-slot {
342
+ display: flex;
343
+ justify-content: center;
344
+ align-items: center;
345
+ width: 100%;
346
+ height: 100%;
347
+ font-size: 12px;
348
+ background-color: var(--el-fill-color-lighter);
349
+ }
367
350
 
368
- &__uploading {
369
- width: 100%;
370
- height: 100%;
371
- position: relative;
351
+ .lw-upload__uploading {
352
+ width: 100%;
353
+ height: 100%;
354
+ position: relative;
355
+ }
372
356
 
373
- .image {
374
- width: 100%;
375
- height: 100%;
376
- }
357
+ .lw-upload__progress {
358
+ position: absolute;
359
+ width: 100%;
360
+ height: 100%;
361
+ display: flex;
362
+ justify-content: center;
363
+ align-items: center;
364
+ background-color: var(--el-overlay-color-lighter);
365
+ z-index: 1;
366
+ padding: 10px;
367
+ }
377
368
 
378
- &__progress {
379
- position: absolute;
380
- width: 100%;
381
- height: 100%;
382
- display: flex;
383
- justify-content: center;
384
- align-items: center;
385
- background-color: var(--el-overlay-color-lighter);
386
- z-index: 1;
387
- padding: 10px;
369
+ .lw-upload__progress .el-progress {
370
+ width: 100%;
371
+ }
388
372
 
389
- .el-progress {
390
- width: 100%;
391
- }
392
- }
393
- }
373
+ .lw-upload__uploading .image {
374
+ width: 100%;
375
+ height: 100%;
376
+ }
394
377
 
395
- .file-empty {
396
- width: 100%;
397
- height: 100%;
398
- display: flex;
399
- justify-content: center;
400
- align-items: center;
401
- flex-direction: column;
378
+ .lw-upload .file-empty {
379
+ width: 100%;
380
+ height: 100%;
381
+ display: flex;
382
+ justify-content: center;
383
+ align-items: center;
384
+ flex-direction: column;
385
+ }
386
+ .lw-upload{
387
+ display: flex;
388
+ align-items: center;
389
+ flex-wrap: wrap;
390
+ gap: 10px;
391
+ }
402
392
 
403
- i {
404
- font-size: 28px;
405
- }
393
+ .lw-upload .file-empty i {
394
+ font-size: 28px;
395
+ }
406
396
 
407
- h4 {
408
- font-size: 12px;
409
- font-weight: normal;
410
- color: #8c939d;
411
- margin-top: 8px;
412
- }
413
- }
397
+ .lw-upload .file-empty h4 {
398
+ font-size: 12px;
399
+ font-weight: normal;
400
+ color: #8c939d;
401
+ margin-top: 8px;
402
+ }
414
403
 
415
- &.lw-upload-round {
416
- border-radius: 50%;
417
- overflow: hidden;
404
+ .lw-upload.lw-upload-round {
405
+ border-radius: 50%;
406
+ overflow: hidden;
407
+ }
418
408
 
419
- .el-upload--picture-card {
420
- border-radius: 50%;
421
- }
409
+ .lw-upload.lw-upload-round .el-upload--picture-card {
410
+ border-radius: 50%;
411
+ }
422
412
 
423
- .lw-upload__img-actions {
424
- top: auto;
425
- left: 0;
426
- right: 0;
427
- bottom: 0;
413
+ .lw-upload.lw-upload-round .lw-upload__img-actions {
414
+ top: auto;
415
+ left: 0;
416
+ right: 0;
417
+ bottom: 0;
418
+ }
428
419
 
429
- span {
430
- width: 100%;
431
- }
432
- }
433
- }
420
+ .lw-upload.lw-upload-round .lw-upload__img-actions span {
421
+ width: 100%;
434
422
  }
435
423
  </style>