@steedos-widgets/amis-lib 1.1.12-beta.1 → 1.1.12

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.umd.js CHANGED
@@ -5489,12 +5489,12 @@ setTimeout(()=>{
5489
5489
  if(uiSchema.form){
5490
5490
  try{
5491
5491
  var objectFormConfig = JSON.parse(uiSchema.form);
5492
- initialValues = objectFormConfig.initialValues;
5493
- if(initialValues){
5494
- initialValues = new Function("return " + initialValues)();
5492
+ var formInitialValuesFun = objectFormConfig.initialValues;
5493
+ if(formInitialValuesFun){
5494
+ formInitialValuesFun = new Function("return " + formInitialValuesFun)();
5495
5495
  }
5496
- if(typeof initialValues === "function"){
5497
- initialValues = initialValues.apply({doc: defaultValues || {} })
5496
+ if(typeof formInitialValuesFun === "function"){
5497
+ initialValues = formInitialValuesFun.apply({doc: defaultValues || {} , global: api.body.global})
5498
5498
  }
5499
5499
  }
5500
5500
  catch(ex){
@@ -5511,12 +5511,15 @@ setTimeout(()=>{
5511
5511
  }
5512
5512
  // data下的变量需要在保存接口(getSaveApi)中被删除。
5513
5513
  payload.data = {
5514
- initialValues,
5515
- editFormInited: true
5514
+ ...initialValues
5516
5515
  }
5517
5516
  ${options.initApiAdaptor || ''}
5518
5517
  return payload;
5519
5518
  `,
5519
+ responseData: {
5520
+ initialValues: "$$",
5521
+ editFormInited: true
5522
+ },
5520
5523
  data: data,
5521
5524
  headers: {
5522
5525
  Authorization: "Bearer ${context.tenantId},${context.authToken}"
@@ -6643,28 +6646,8 @@ setTimeout(()=>{
6643
6646
 
6644
6647
  if(enable_tree){
6645
6648
  const records = payload.data.rows;
6646
- const treeRecords = [];
6647
- const getChildren = (records, childrenIds)=>{
6648
- if(!childrenIds){
6649
- return;
6650
- }
6651
- const children = _.filter(records, (record)=>{
6652
- return _.includes(childrenIds, record._id)
6653
- });
6654
- _.each(children, (item)=>{
6655
- if(item.children){
6656
- item.children = getChildren(records, item.children)
6657
- }
6658
- })
6659
- return children;
6660
- }
6661
-
6662
- _.each(records, (record)=>{
6663
- if(!record.parent){
6664
- treeRecords.push(Object.assign({}, record, {children: getChildren(records, record.children)}));
6665
- }
6666
- });
6667
- payload.data.rows = treeRecords;
6649
+ const getTreeOptions = SteedosUI.getTreeOptions
6650
+ payload.data.rows = getTreeOptions(records,{"valueField":"_id"});
6668
6651
  }
6669
6652
 
6670
6653
 
@@ -7357,7 +7340,7 @@ setTimeout(()=>{
7357
7340
  * @Author: baozhoutao@steedos.com
7358
7341
  * @Date: 2022-07-05 15:55:39
7359
7342
  * @LastEditors: Please set LastEditors
7360
- * @LastEditTime: 2023-04-13 09:20:21
7343
+ * @LastEditTime: 2023-04-18 19:13:30
7361
7344
  * @Description:
7362
7345
  */
7363
7346
 
@@ -7454,7 +7437,7 @@ setTimeout(()=>{
7454
7437
  mainRelated[arr[0]] = arr[1];
7455
7438
  }
7456
7439
  }else {
7457
- const details = mainObjectUiSchema.details || [];
7440
+ const details = _$1.union(mainObjectUiSchema.details,mainObjectUiSchema.lookup_details) || [];
7458
7441
  for (const detail of details) {
7459
7442
  const arr = detail.split(".");
7460
7443
  mainRelated[arr[0]] = arr[1];