@steedos-widgets/amis-lib 6.10.1-beta.26 → 6.10.1-beta.29

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
@@ -923,14 +923,20 @@ function getScriptForRemoveUrlPrefixForImgFields(fields){
923
923
  // 因为表单初始化接口的接收适配器中为image字段值添加了url前缀(为了字段编辑时正常显示图片),所以保存时移除(为了字段值保存时正常保存id,而不是url)。
924
924
  if(imgFields[item].multiple){
925
925
  if(imgFieldValue instanceof Array){
926
- formData[item] = imgFieldValue.map((value)=>{
926
+ formData[item] = imgFieldValue.map((value)=>{
927
+ if(!value || value.indexOf("/") < 0 ){
928
+ return value;
929
+ }
927
930
  let itemValue = value && value.split('/');
928
- return itemValue[itemValue.length - 1].split('?')[0];
931
+ return itemValue[itemValue.length - 2];
929
932
  });
930
933
  }
931
934
  }else{
935
+ if(!imgFieldValue || imgFieldValue.indexOf("/") < 0 ){
936
+ return imgFieldValue;
937
+ }
932
938
  let imgValue = imgFieldValue.split('/');
933
- formData[item] = imgValue[imgValue.length - 1].split('?')[0];
939
+ formData[item] = imgValue[imgValue.length - 2];
934
940
  }
935
941
  }
936
942
  })
@@ -3499,7 +3505,7 @@ function getReadonlyFormAdaptor(object, fields, options){
3499
3505
  nameLabel = `(record._display && record._display.${nameField.name}) || record.${nameField.name}`;
3500
3506
  }
3501
3507
  return `
3502
- if(payload.data.data.length === 0){
3508
+ if(!payload.data.data || payload.data.data.length === 0){
3503
3509
  var isEditor = !!${options && options.isEditor};
3504
3510
  if(isEditor){
3505
3511
  var fieldNames = ${JSON.stringify(fieldNames)};
@@ -9840,7 +9846,7 @@ async function getObjectForm(objectSchema, ctx){
9840
9846
  promptPageLeave: true,
9841
9847
  canAccessSuperData: false,
9842
9848
  name: `form_edit_${recordId}`,
9843
- debug: false,
9849
+ debug: window.amis_form_debug || false,
9844
9850
  title: "",
9845
9851
  submitText: "", // amis 表单不显示提交按钮, 表单提交由项目代码接管
9846
9852
  api: await getSaveApi(objectSchema, recordId, fields, ctx),
@@ -11018,7 +11024,8 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
11018
11024
  "label": "对象表单",
11019
11025
  "objectApiName": "${objectName}",
11020
11026
  "recordId": "${recordId}",
11021
- appId: appId
11027
+ appId: appId,
11028
+ _reloadKey: props._reloadKey
11022
11029
  }
11023
11030
  ],
11024
11031
  };
@@ -11031,7 +11038,8 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
11031
11038
  "label": "相关列表",
11032
11039
  "objectApiName": "${objectName}",
11033
11040
  "recordId": "${recordId}",
11034
- appId: appId
11041
+ appId: appId,
11042
+ _reloadKey: props._reloadKey
11035
11043
  }
11036
11044
  ],
11037
11045
  };
@@ -11063,6 +11071,7 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
11063
11071
  "id": "u:48d2c28eb755",
11064
11072
  "showButtons": props.showButtons,
11065
11073
  "showBackButton": props.showBackButton,
11074
+ _reloadKey: props._reloadKey
11066
11075
  },
11067
11076
  content
11068
11077
  ],