@steedos-widgets/amis-lib 1.1.1 → 1.1.2

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/index.esm.js CHANGED
@@ -1475,8 +1475,8 @@ async function getPage({type, pageId = '', appId, objectName = '', recordId = ''
1475
1475
  /*
1476
1476
  * @Author: baozhoutao@steedos.com
1477
1477
  * @Date: 2022-11-01 15:49:58
1478
- * @LastEditors: baozhoutao@steedos.com
1479
- * @LastEditTime: 2022-11-08 16:39:40
1478
+ * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
1479
+ * @LastEditTime: 2023-03-25 17:22:00
1480
1480
  * @Description:
1481
1481
  */
1482
1482
 
@@ -1520,6 +1520,10 @@ const getSchema$3 = async (uiSchema, ctx) => {
1520
1520
  actionType: "dialog",
1521
1521
  dialog: {
1522
1522
  type: "dialog",
1523
+ "data": {
1524
+ "&": "$$",
1525
+ "$master": "$$"
1526
+ },
1523
1527
  title: title,
1524
1528
  bodyClassName: "",
1525
1529
  body: [formSchema],
@@ -1542,6 +1546,12 @@ const getSchema$3 = async (uiSchema, ctx) => {
1542
1546
  };
1543
1547
  };
1544
1548
 
1549
+ /*
1550
+ * @Author: 殷亮辉 yinlianghui@hotoa.com
1551
+ * @Date: 2023-03-22 09:31:21
1552
+ * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
1553
+ * @LastEditTime: 2023-03-25 22:41:27
1554
+ */
1545
1555
  const getSchema$2 = (uiSchema)=>{
1546
1556
  return {
1547
1557
  "type": "service",
@@ -1592,6 +1602,16 @@ const getSchema$2 = (uiSchema)=>{
1592
1602
  "objectName": `${uiSchema.name}`,
1593
1603
  "__deletedRecord": true
1594
1604
  }
1605
+ },
1606
+ {
1607
+ "actionType": "broadcast",
1608
+ "args": {
1609
+ "eventName": "@data.changed.${masterObjectName}"
1610
+ },
1611
+ "data": {
1612
+ "objectName": "${masterObjectName}"
1613
+ },
1614
+ "expression": "${masterObjectName}"
1595
1615
  }
1596
1616
  ]
1597
1617
  }
@@ -3941,9 +3961,13 @@ async function lookupToAmisPicker(field, readonly, ctx){
3941
3961
  `;
3942
3962
  source.adaptor = `
3943
3963
  const enable_tree = ${refObjectConfig.enable_tree};
3944
- const value = api.data.$self.value;
3945
- if(!_.isEmpty(value)){
3946
- // value 不为空值,表示返回当前选中节点信息
3964
+ const op = api.data.$self.op;
3965
+ if(!_.isEmpty(op)){
3966
+ // op不为空,表示处于字段初始编辑状态,不是点击后出现弹窗状态。
3967
+ const rows = _.map(payload.data.rows, (item)=>{
3968
+ return _.pick(item, ["${referenceTo.labelField.name}", "${referenceTo.valueField.name}"]);
3969
+ })
3970
+ payload.data.rows = rows;
3947
3971
  return payload;
3948
3972
  }
3949
3973
  if(enable_tree){
@@ -5822,6 +5846,16 @@ async function getObjectForm(objectSchema, ctx){
5822
5846
  "data": {
5823
5847
  "objectName": `${objectSchema.name}`
5824
5848
  }
5849
+ },
5850
+ {
5851
+ "actionType": "broadcast",
5852
+ "args": {
5853
+ "eventName": "@data.changed.${$master.masterObjectName}"
5854
+ },
5855
+ "data": {
5856
+ "objectName": "${$master.masterObjectName}"
5857
+ },
5858
+ "expression": "${$master.masterObjectName}"
5825
5859
  }
5826
5860
  ]
5827
5861
  }