@steedos-widgets/amis-lib 6.3.13-beta.7 → 6.3.13-beta.8
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/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +7 -4
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +7 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -12507,7 +12507,9 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
12507
12507
|
{
|
|
12508
12508
|
"actionType": "custom",
|
|
12509
12509
|
"script": `
|
|
12510
|
-
|
|
12510
|
+
// lookup字段弹出列表,点击新建按钮,新建记录成功后,触发@data.changed.xxx,
|
|
12511
|
+
// 此时context.props.data值是lookup字段所在表单数据,经测试多层lookup弹出列表新建记录成功后context.props.data始终取的是最近一层的lookup字段所在表单数据,符合预期
|
|
12512
|
+
const masterRecord = context.props.data;//event.data._master && event.data._master.record;
|
|
12511
12513
|
const fieldConfig = ${JSON.stringify(field)};
|
|
12512
12514
|
let reference_to = fieldConfig.reference_to;
|
|
12513
12515
|
let saveValue;
|
|
@@ -12517,7 +12519,6 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
12517
12519
|
}
|
|
12518
12520
|
const saveField = fieldConfig.reference_to_field || '_id';
|
|
12519
12521
|
const saveFieldValue = newRecord[saveField];
|
|
12520
|
-
|
|
12521
12522
|
if( fieldConfig._reference_to && (_.isArray(fieldConfig._reference_to) || _.isFunction(fieldConfig._reference_to) || fieldConfig._reference_to.startsWith('function') ) ){
|
|
12522
12523
|
|
|
12523
12524
|
const fieldValue = masterRecord ? masterRecord[fieldConfig.name] : {o: reference_to, ids: []};
|
|
@@ -12537,8 +12538,10 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
12537
12538
|
|
|
12538
12539
|
}else{
|
|
12539
12540
|
if(fieldConfig.multiple){
|
|
12540
|
-
//
|
|
12541
|
-
|
|
12541
|
+
// const fieldValue = (masterRecord && masterRecord[fieldConfig.name]) || [];
|
|
12542
|
+
// 连续新建多个记录时,因为masterRecord获取的主记录不是实时的,所以只会勾选最后一个新建的记录
|
|
12543
|
+
// 而下面context.context.component指向的是lookup picker组件,可以直接取到用户实时勾选的记录。
|
|
12544
|
+
const fieldValue = context.context.component.props.store.toJSON().selectedItems
|
|
12542
12545
|
saveValue = fieldValue.concat(saveFieldValue);
|
|
12543
12546
|
}else{
|
|
12544
12547
|
saveValue = saveFieldValue;
|