@steedos-widgets/sortable 6.3.0-beta.4 → 6.3.0-beta.6

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.
@@ -58735,7 +58735,7 @@ async function getObjectFilter(objectSchema, fields, options) {
58735
58735
  * @Author: baozhoutao@steedos.com
58736
58736
  * @Date: 2022-07-05 15:55:39
58737
58737
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
58738
- * @LastEditTime: 2024-04-25 19:01:52
58738
+ * @LastEditTime: 2024-04-26 16:46:44
58739
58739
  * @Description:
58740
58740
  */
58741
58741
 
@@ -58994,10 +58994,6 @@ async function getListSchema(
58994
58994
  if (localListViewProps.perPage) {
58995
58995
  listSchema.perPage = localListViewProps.perPage;
58996
58996
  }
58997
- if (window.innerWidth > 768) {
58998
- // 列表视图组件PC端高度自动计算实现满屏效果,手机端不需要满屏效果,所以不用autofillheight
58999
- listSchema.autoFillHeight = true;
59000
- }
59001
58997
  defaults.listSchema = lodash.exports.defaultsDeep({}, listSchema, defaults.listSchema || {});
59002
58998
  }
59003
58999
  }
@@ -59005,6 +59001,13 @@ async function getListSchema(
59005
59001
  console.error("本地存储中crud参数解析异常:", ex);
59006
59002
  }
59007
59003
 
59004
+ if (window.innerWidth > 768) {
59005
+ // 列表视图组件PC端高度自动计算实现满屏效果,手机端不需要满屏效果,所以不用autofillheight,且允许重写微页面中重新组件autoFillHeight属性
59006
+ defaults.listSchema = lodash.exports.defaultsDeep({}, defaults.listSchema || {}, {
59007
+ autoFillHeight: true
59008
+ });
59009
+ }
59010
+
59008
59011
  ctx.defaults = defaults;
59009
59012
 
59010
59013
  if (listViewName == "recent") {
@@ -59563,7 +59566,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
59563
59566
  });
59564
59567
 
59565
59568
  // 把自动填充规则中依赖的字段也加到api请求中
59566
- let autoFillMapping = !field.multiple && field.auto_fill_mapping;
59569
+ let autoFillMapping = field.auto_fill_mapping;
59567
59570
  if (autoFillMapping && autoFillMapping.length) {
59568
59571
  autoFillMapping.forEach(function (item) {
59569
59572
  if(!lodash.exports.find(tableFields, function(f){
@@ -60035,7 +60038,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
60035
60038
  ];
60036
60039
 
60037
60040
  // 把自动填充规则中依赖的字段也加到api请求中
60038
- let autoFillMapping = !field.multiple && field.auto_fill_mapping;
60041
+ let autoFillMapping = field.auto_fill_mapping;
60039
60042
  if (autoFillMapping && autoFillMapping.length) {
60040
60043
  autoFillMapping.forEach(function (item) {
60041
60044
  queryFields.push(refObjectConfig.fields[item.from]);
@@ -60277,14 +60280,25 @@ async function getApi(object, recordId, fields, options){
60277
60280
  }
60278
60281
 
60279
60282
  async function getAutoFill(field, refObject) {
60280
- let autoFillMapping = !field.multiple && field.auto_fill_mapping;
60283
+ let autoFillMapping = field.auto_fill_mapping;
60281
60284
  if (autoFillMapping && autoFillMapping.length) {
60282
60285
  let fillMapping = {};
60286
+ if (field.multiple) {
60287
+ autoFillMapping.forEach(function (item) {
60288
+ //from的字段类型为lookup、master_detail、select时,需要保留数组格式;其他类型需要转变为字符串格式
60289
+ if (lodash.exports.includes(["lookup","master_detail","select"], refObject.fields[item.from].type)) {
60290
+ fillMapping[item.to] = `\${items | pick:${item.from}}`;
60291
+ } else {
60292
+ fillMapping[item.to] = `\${items | pick:${item.from} | join}`;
60293
+ }
60294
+ });
60295
+ }else {
60296
+ autoFillMapping.forEach(function (item) {
60297
+ fillMapping[item.to] = `\${${item.from}}`;
60298
+ });
60299
+ }
60283
60300
  // let fieldsForApi = [];
60284
- autoFillMapping.forEach(function (item) {
60285
- fillMapping[item.to] = `\${${item.from}}`;
60286
- // fieldsForApi.push(item.from);
60287
- });
60301
+ // fieldsForApi.push(item.from);
60288
60302
  // let api = {
60289
60303
  // // "url": "/amis/api/mock2/form/autoUpdate?browser=${browser}&version=${version}",
60290
60304
  // "url": `/api/v1/${refObject.name}/\${${field.name}}?fields=${JSON.stringify(fieldsForApi)}`,
@@ -60386,7 +60400,7 @@ async function lookupToAmis(field, readonly, ctx){
60386
60400
  amisSchema = lodash.exports.defaultsDeep({}, pageAmisSchema, amisSchema);
60387
60401
  }
60388
60402
  }
60389
- const autoFill = await getAutoFill(field);
60403
+ const autoFill = await getAutoFill(field, refObject);
60390
60404
  if(autoFill){
60391
60405
  amisSchema.autoFill = autoFill;
60392
60406
  // 这里不配置initAutoFill值,按amis规则initAutoFill默认值为fillIfNotSet处理--需要amis sdk 版本 > 3.6.3-patch.6(不包括)版本