@steedos-widgets/amis-lib 6.3.13-beta.10 → 6.3.13-beta.11

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
@@ -2347,7 +2347,7 @@ async function getColumnItemOnClick(field, options){
2347
2347
  "_inDrawer": true, // 用于判断是否在抽屉中
2348
2348
  "recordLoaded": false, // 重置数据加载状态
2349
2349
  "recordId": `\${${options.idFieldName}}`,//审批微页面依赖了作用域中的recordId
2350
- "_tableObjectName": options.objectName
2350
+ "_lookupObjectName": options.objectName
2351
2351
  }
2352
2352
  }) : {
2353
2353
  "type": "steedos-record-detail",
@@ -2358,7 +2358,7 @@ async function getColumnItemOnClick(field, options){
2358
2358
  "data": {
2359
2359
  "_inDrawer": true, // 用于判断是否在抽屉中
2360
2360
  "recordLoaded": false, // 重置数据加载状态
2361
- "_tableObjectName": options.objectName
2361
+ "_lookupObjectName": options.objectName
2362
2362
  }
2363
2363
  };
2364
2364
 
@@ -2531,7 +2531,7 @@ async function getTableColumns(object, fields, options){
2531
2531
  body: {
2532
2532
  type: "steedos-field",
2533
2533
  static: true,
2534
- tableObjectName: options.objectName,
2534
+ isLookupInTable: true,
2535
2535
  config: {
2536
2536
  type: "lookup",
2537
2537
  reference_to: field.reference_to,
@@ -3357,10 +3357,13 @@ async function getTableApi(mainObject, fields, options){
3357
3357
  // item[key] = value
3358
3358
  // PC客户端附件子表列表点击标题预览附件功能依赖了_id,所以这里拼出来
3359
3359
  let itemKeyValue = item[key];
3360
- item[key] = value.map(function(item, index){
3361
- item._id = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
3362
- item.value = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
3363
- return item;
3360
+ item[key] = value.map(function(curValue, index){
3361
+ let fileId = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
3362
+ // 克隆一份对象,避免下方value递归污染curValue
3363
+ let result = _.clone(curValue);
3364
+ result._id = fileId;
3365
+ result.value = fileId;
3366
+ return result;
3364
3367
  });
3365
3368
  }else{
3366
3369
  item[key] = _.map(value, (item)=>{
@@ -4879,8 +4882,8 @@ const parseSingleExpression = function (func, formData, dataPath, global, userSe
4879
4882
  /*
4880
4883
  * @Author: baozhoutao@steedos.com
4881
4884
  * @Date: 2022-11-01 15:51:00
4882
- * @LastEditors: baozhoutao@steedos.com
4883
- * @LastEditTime: 2024-12-26 20:28:43
4885
+ * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
4886
+ * @LastEditTime: 2025-07-14 15:52:36
4884
4887
  * @Description:
4885
4888
  */
4886
4889
 
@@ -5077,8 +5080,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
5077
5080
  /*
5078
5081
  * @Author: baozhoutao@steedos.com
5079
5082
  * @Date: 2022-11-01 15:49:58
5080
- * @LastEditors: yinlianghui@hotoa.com yinlianghui@hotoa.com
5081
- * @LastEditTime: 2024-05-19 10:01:07
5083
+ * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
5084
+ * @LastEditTime: 2025-07-14 15:52:24
5082
5085
  * @Description:
5083
5086
  */
5084
5087
 
@@ -5234,12 +5237,12 @@ const getSchema$3 = (uiSchema)=>{
5234
5237
  {
5235
5238
  "actionType": "broadcast",
5236
5239
  "args": {
5237
- "eventName": "@data.changed.${_tableObjectName}"
5240
+ "eventName": "@data.changed.${_lookupObjectName}"
5238
5241
  },
5239
5242
  "data": {
5240
- "objectName": "${_tableObjectName}"
5243
+ "objectName": "${_lookupObjectName}"
5241
5244
  },
5242
- "expression": `\${_tableObjectName != '${uiSchema.name}' && _tableObjectName}`
5245
+ "expression": `\${_lookupObjectName != '${uiSchema.name}' && _lookupObjectName}`
5243
5246
  }
5244
5247
  ]
5245
5248
  }
@@ -9974,16 +9977,16 @@ async function getObjectForm(objectSchema, ctx){
9974
9977
  },
9975
9978
  "expression": `\${_master.objectName != '${objectSchema.name}' && _master.objectName}`
9976
9979
  },
9977
- // 列表视图、对象表格组件上的lookup字段,点开右侧弹出drawer窗口,修改记录后刷新列表
9980
+ // 列表视图、对象表格、对象表单组件上的lookup字段,点开右侧弹出drawer窗口,修改记录后刷新列表
9978
9981
  {
9979
9982
  "actionType": "broadcast",
9980
9983
  "args": {
9981
- "eventName": "@data.changed.${_tableObjectName}"
9984
+ "eventName": "@data.changed.${_lookupObjectName}"
9982
9985
  },
9983
9986
  "data": {
9984
- "objectName": "${_tableObjectName}"
9987
+ "objectName": "${_lookupObjectName}"
9985
9988
  },
9986
- "expression": `\${_tableObjectName != '${objectSchema.name}' && _tableObjectName}`
9989
+ "expression": `\${_lookupObjectName != '${objectSchema.name}' && _lookupObjectName}`
9987
9990
  },
9988
9991
  ...submitSuccActions,
9989
9992
  // {
@@ -14184,7 +14187,8 @@ async function getFieldSearchable(perField, permissionFields, ctx){
14184
14187
  _field.removable = false;
14185
14188
  _field.value = [null,null];
14186
14189
  _field.items = {
14187
- type: "input-number"
14190
+ type: "input-number",
14191
+ clearValueOnEmpty: true
14188
14192
  };
14189
14193
  _field.is_wide = true;
14190
14194
  fieldNamePrefix = `${fieldNamePrefix}between__`;
@@ -14232,6 +14236,10 @@ async function getFieldSearchable(perField, permissionFields, ctx){
14232
14236
  delete _field.amis.hidden;
14233
14237
  delete _field.amis.hiddenOn;
14234
14238
  delete _field.amis.autoFill;
14239
+ if(_field.type.indexOf("-range") > -1 || _field.type === 'input-array'){
14240
+ // 范围类型不允许变更type,否则会因为某些属性兼容性问题报错页面奔溃,比如input-date-range类型有shortcuts属性,改为input-date后其shortcuts属性有兼容性问题
14241
+ delete _field.amis.type;
14242
+ }
14235
14243
  }
14236
14244
 
14237
14245
  const amisField = await convertSFieldToAmisField(_field, false, Object.assign({}, ctx, {fieldNamePrefix: fieldNamePrefix, required: false, showSystemFields: true, inFilterForm: true}));