lw-cdp-ui 1.1.37 → 1.1.39
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/dist/components/lwForm/index.vue +3 -3
- package/dist/components/lwFormMini/index.vue +10 -5
- package/dist/components/lwLogin/index.vue +5 -1
- package/dist/components/lwTableForm/index.vue +41 -50
- package/dist/lw-cdp-ui.esm.js +2022 -2024
- package/dist/lw-cdp-ui.umd.js +13 -13
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -439,8 +439,8 @@ export default {
|
|
|
439
439
|
},
|
|
440
440
|
watch: {
|
|
441
441
|
modelValue(val, old) {
|
|
442
|
-
if (this.hasConfig) {
|
|
443
|
-
this.deepMerge(this.form, JSON.parse(JSON.stringify(
|
|
442
|
+
if (this.hasConfig && this.hasValue) {
|
|
443
|
+
this.deepMerge(this.form, JSON.parse(JSON.stringify(val)))
|
|
444
444
|
}
|
|
445
445
|
},
|
|
446
446
|
config() {
|
|
@@ -458,7 +458,7 @@ export default {
|
|
|
458
458
|
return Object.keys(this.config).length > 0
|
|
459
459
|
},
|
|
460
460
|
hasValue() {
|
|
461
|
-
return Object.keys(this.modelValue).length > 0
|
|
461
|
+
return this?.modelValue ? Object.keys(this.modelValue).length > 0 : false
|
|
462
462
|
},
|
|
463
463
|
|
|
464
464
|
},
|
|
@@ -307,10 +307,10 @@ export default {
|
|
|
307
307
|
},
|
|
308
308
|
form: {
|
|
309
309
|
handler(val) {
|
|
310
|
-
this.isChange = false;
|
|
311
|
-
setTimeout(() => {
|
|
312
|
-
|
|
313
|
-
},
|
|
310
|
+
// this.isChange = false;
|
|
311
|
+
// setTimeout(() => {
|
|
312
|
+
// this.isChange = true
|
|
313
|
+
// }, 20)
|
|
314
314
|
this.$emit("update:modelValue", this.unflattenObject(val))
|
|
315
315
|
},
|
|
316
316
|
deep: true
|
|
@@ -354,7 +354,12 @@ export default {
|
|
|
354
354
|
})
|
|
355
355
|
}
|
|
356
356
|
} else {
|
|
357
|
-
|
|
357
|
+
if (item.component == 'number') {
|
|
358
|
+
this.form[item.name] = item?.value ? Number(item.value) : item.options?.min || 0
|
|
359
|
+
} else {
|
|
360
|
+
this.form[item.name] = item.value
|
|
361
|
+
}
|
|
362
|
+
|
|
358
363
|
}
|
|
359
364
|
})
|
|
360
365
|
|
|
@@ -341,7 +341,11 @@ export default {
|
|
|
341
341
|
// 获取所有bu
|
|
342
342
|
let bu = await this.$api.auth.bu()
|
|
343
343
|
this.$tool.data.set('buList', bu)
|
|
344
|
-
this.$tool.data.
|
|
344
|
+
let code = this.$tool.data.get('buCode')
|
|
345
|
+
let item = bu.find(x => { return x.code == code })
|
|
346
|
+
if (!item) {
|
|
347
|
+
this.$tool.data.set('buCode', bu[0].code)
|
|
348
|
+
}
|
|
345
349
|
|
|
346
350
|
// 获取用户信息
|
|
347
351
|
let user = await this.$api.auth.user()
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
:min-width="item.minWidth"
|
|
12
12
|
:key="index"
|
|
13
13
|
:label="item.label"
|
|
14
|
-
:prop="item
|
|
14
|
+
:prop="getPropName(item)"
|
|
15
15
|
:align="item.align ?? 'left'"
|
|
16
16
|
:fixed="item.fixed"
|
|
17
17
|
:sortable="item.sortable"
|
|
@@ -39,7 +39,17 @@
|
|
|
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]"
|
|
42
|
+
<lw-upload v-model="row[_item.name]"
|
|
43
|
+
:maxSize="_item.maxSize"
|
|
44
|
+
:accept="_item.accept"
|
|
45
|
+
:title="_item.label"
|
|
46
|
+
:parseData="item.parseData"
|
|
47
|
+
:disabled="_item?.disabled"
|
|
48
|
+
:multiple="_item?.multiple"
|
|
49
|
+
:limit="_item?.limit"
|
|
50
|
+
:returnFile="_item?.returnFile"
|
|
51
|
+
:tip="_item?.tip"
|
|
52
|
+
:apiObj="item.apiObj"></lw-upload>
|
|
43
53
|
<div class="error-tips">
|
|
44
54
|
{{ row['errorMsg'][_item.name] }}
|
|
45
55
|
</div>
|
|
@@ -267,16 +277,7 @@
|
|
|
267
277
|
<!-- 错误提示 -->
|
|
268
278
|
<div v-if="row.errorMsg"
|
|
269
279
|
class="error-tips">
|
|
270
|
-
|
|
271
|
-
v-if="item.component != 'checkbox' && item.component != 'upload'">
|
|
272
|
-
<template v-if="item?.options?.name && row['errorMsg'][item.name]">
|
|
273
|
-
{{ row['errorMsg'][item.name][item.options.name] }}
|
|
274
|
-
</template>
|
|
275
|
-
<template v-else>
|
|
276
|
-
{{ row['errorMsg'][item?.name] }}
|
|
277
|
-
</template>
|
|
278
|
-
|
|
279
|
-
</template>
|
|
280
|
+
{{ row['errorMsg'][item?.name] }}
|
|
280
281
|
</div>
|
|
281
282
|
</template>
|
|
282
283
|
</el-table-column>
|
|
@@ -312,27 +313,26 @@ export default {
|
|
|
312
313
|
tableData: [],
|
|
313
314
|
tagValue: '',
|
|
314
315
|
ids: [],
|
|
315
|
-
|
|
316
|
+
internalUpdate: true,
|
|
316
317
|
tagVisible: false,
|
|
317
318
|
}
|
|
318
319
|
},
|
|
319
320
|
watch: {
|
|
320
321
|
tableData: {
|
|
321
|
-
|
|
322
|
-
this.
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
this.$emit("update:modelValue", await this.unflattenObject(val))
|
|
322
|
+
handler(val) {
|
|
323
|
+
if (!this.internalUpdate) {
|
|
324
|
+
this.$emit("update:modelValue", this.unflattenObject(val));
|
|
325
|
+
}
|
|
326
|
+
this.internalUpdate = false;
|
|
327
327
|
},
|
|
328
328
|
deep: true
|
|
329
329
|
},
|
|
330
330
|
modelValue: {
|
|
331
|
-
|
|
332
|
-
if (this.
|
|
333
|
-
this.
|
|
331
|
+
handler(val) {
|
|
332
|
+
if (!this.internalUpdate) {
|
|
333
|
+
this.internalUpdate = true; // 设置标志位,避免递归
|
|
334
|
+
this.tableData = this.flattenObject(val);
|
|
334
335
|
}
|
|
335
|
-
this.isChange = true;
|
|
336
336
|
},
|
|
337
337
|
deep: true
|
|
338
338
|
}
|
|
@@ -417,26 +417,14 @@ export default {
|
|
|
417
417
|
item.rules.forEach((rule) => {
|
|
418
418
|
let isVal = false;
|
|
419
419
|
if (item.component == 'checkbox' || item.component == 'upload') {
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
if (!data?.errorMsg) {
|
|
425
|
-
data.errorMsg = {}
|
|
426
|
-
}
|
|
427
|
-
data['errorMsg'][item.name][option.name] = rule.message
|
|
428
|
-
}
|
|
429
|
-
})
|
|
430
|
-
} else if (item?.options?.items) {
|
|
431
|
-
item.options.items.forEach((option) => {
|
|
432
|
-
if (this.isEmpty(data[item.name])) {
|
|
433
|
-
if (!data?.errorMsg) {
|
|
434
|
-
data.errorMsg = {}
|
|
435
|
-
}
|
|
436
|
-
data['errorMsg'][item.name] = rule.message
|
|
420
|
+
item.options.items.forEach((option) => {
|
|
421
|
+
if (this.isEmpty(data[option.name])) {
|
|
422
|
+
if (!data?.errorMsg) {
|
|
423
|
+
data.errorMsg = {}
|
|
437
424
|
}
|
|
438
|
-
|
|
439
|
-
|
|
425
|
+
data['errorMsg'][option.name] = rule.message
|
|
426
|
+
}
|
|
427
|
+
})
|
|
440
428
|
} else {
|
|
441
429
|
if (rule.required && this.isEmpty(data[item.name])) {
|
|
442
430
|
if (!data?.errorMsg) {
|
|
@@ -589,17 +577,20 @@ export default {
|
|
|
589
577
|
// 增加tag
|
|
590
578
|
tagInputConfirm(item, row) {
|
|
591
579
|
if (this.tagValue) {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
row[item.name][item.options.name] = row[item.name][item.options.name] || [];
|
|
595
|
-
row[item.name][item.options.name].push(this.tagValue)
|
|
596
|
-
} else {
|
|
597
|
-
row[item.name] = row[item.name] || []
|
|
598
|
-
row[item.name].push(this.tagValue)
|
|
599
|
-
}
|
|
580
|
+
row[item.name] = row[item.name] || []
|
|
581
|
+
row[item.name].push(this.tagValue)
|
|
600
582
|
}
|
|
601
583
|
row.tagVisible = false
|
|
602
584
|
this.tagValue = ''
|
|
585
|
+
},
|
|
586
|
+
// prop NAME
|
|
587
|
+
getPropName(item) {
|
|
588
|
+
if (item.component == 'checkbox' || item.component == 'upload') {
|
|
589
|
+
return item.options.items[0].name
|
|
590
|
+
|
|
591
|
+
} else {
|
|
592
|
+
return item.name
|
|
593
|
+
}
|
|
603
594
|
}
|
|
604
595
|
}
|
|
605
596
|
}
|