@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.
@@ -25040,7 +25040,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
25040
25040
  * @Author: baozhoutao@steedos.com
25041
25041
  * @Date: 2022-07-05 15:55:39
25042
25042
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
25043
- * @LastEditTime: 2024-04-25 19:01:52
25043
+ * @LastEditTime: 2024-04-26 16:46:44
25044
25044
  * @Description:
25045
25045
  */
25046
25046
 
@@ -25299,10 +25299,6 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
25299
25299
  if (localListViewProps.perPage) {
25300
25300
  listSchema.perPage = localListViewProps.perPage;
25301
25301
  }
25302
- if (window.innerWidth > 768) {
25303
- // 列表视图组件PC端高度自动计算实现满屏效果,手机端不需要满屏效果,所以不用autofillheight
25304
- listSchema.autoFillHeight = true;
25305
- }
25306
25302
  defaults.listSchema = lodash.exports.defaultsDeep({}, listSchema, defaults.listSchema || {});
25307
25303
  }
25308
25304
  }
@@ -25310,6 +25306,13 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
25310
25306
  console.error("本地存储中crud参数解析异常:", ex);
25311
25307
  }
25312
25308
 
25309
+ if (window.innerWidth > 768) {
25310
+ // 列表视图组件PC端高度自动计算实现满屏效果,手机端不需要满屏效果,所以不用autofillheight,且允许重写微页面中重新组件autoFillHeight属性
25311
+ defaults.listSchema = lodash.exports.defaultsDeep({}, defaults.listSchema || {}, {
25312
+ autoFillHeight: true
25313
+ });
25314
+ }
25315
+
25313
25316
  ctx.defaults = defaults;
25314
25317
 
25315
25318
  if (listViewName == "recent") {
@@ -25868,7 +25871,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
25868
25871
  });
25869
25872
 
25870
25873
  // 把自动填充规则中依赖的字段也加到api请求中
25871
- let autoFillMapping = !field.multiple && field.auto_fill_mapping;
25874
+ let autoFillMapping = field.auto_fill_mapping;
25872
25875
  if (autoFillMapping && autoFillMapping.length) {
25873
25876
  autoFillMapping.forEach(function (item) {
25874
25877
  if(!lodash.exports.find(tableFields, function(f){
@@ -26340,7 +26343,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
26340
26343
  ];
26341
26344
 
26342
26345
  // 把自动填充规则中依赖的字段也加到api请求中
26343
- let autoFillMapping = !field.multiple && field.auto_fill_mapping;
26346
+ let autoFillMapping = field.auto_fill_mapping;
26344
26347
  if (autoFillMapping && autoFillMapping.length) {
26345
26348
  autoFillMapping.forEach(function (item) {
26346
26349
  queryFields.push(refObjectConfig.fields[item.from]);
@@ -26582,14 +26585,25 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
26582
26585
  }
26583
26586
 
26584
26587
  async function getAutoFill(field, refObject) {
26585
- let autoFillMapping = !field.multiple && field.auto_fill_mapping;
26588
+ let autoFillMapping = field.auto_fill_mapping;
26586
26589
  if (autoFillMapping && autoFillMapping.length) {
26587
26590
  let fillMapping = {};
26591
+ if (field.multiple) {
26592
+ autoFillMapping.forEach(function (item) {
26593
+ //from的字段类型为lookup、master_detail、select时,需要保留数组格式;其他类型需要转变为字符串格式
26594
+ if (lodash.exports.includes(["lookup","master_detail","select"], refObject.fields[item.from].type)) {
26595
+ fillMapping[item.to] = `\${items | pick:${item.from}}`;
26596
+ } else {
26597
+ fillMapping[item.to] = `\${items | pick:${item.from} | join}`;
26598
+ }
26599
+ });
26600
+ }else {
26601
+ autoFillMapping.forEach(function (item) {
26602
+ fillMapping[item.to] = `\${${item.from}}`;
26603
+ });
26604
+ }
26588
26605
  // let fieldsForApi = [];
26589
- autoFillMapping.forEach(function (item) {
26590
- fillMapping[item.to] = `\${${item.from}}`;
26591
- // fieldsForApi.push(item.from);
26592
- });
26606
+ // fieldsForApi.push(item.from);
26593
26607
  // let api = {
26594
26608
  // // "url": "/amis/api/mock2/form/autoUpdate?browser=${browser}&version=${version}",
26595
26609
  // "url": `/api/v1/${refObject.name}/\${${field.name}}?fields=${JSON.stringify(fieldsForApi)}`,
@@ -26691,7 +26705,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
26691
26705
  amisSchema = lodash.exports.defaultsDeep({}, pageAmisSchema, amisSchema);
26692
26706
  }
26693
26707
  }
26694
- const autoFill = await getAutoFill(field);
26708
+ const autoFill = await getAutoFill(field, refObject);
26695
26709
  if(autoFill){
26696
26710
  amisSchema.autoFill = autoFill;
26697
26711
  // 这里不配置initAutoFill值,按amis规则initAutoFill默认值为fillIfNotSet处理--需要amis sdk 版本 > 3.6.3-patch.6(不包括)版本
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos-widgets/sortable",
3
- "version": "6.3.0-beta.4",
3
+ "version": "6.3.0-beta.6",
4
4
  "main": "dist/sortable.cjs.js",
5
5
  "module": "dist/sortable.esm.js",
6
6
  "unpkg": "dist/sortable.umd.js",
@@ -45,7 +45,7 @@
45
45
  "dependencies": {
46
46
  "@dnd-kit/core": "^6.0.5",
47
47
  "@dnd-kit/sortable": "^7.0.1",
48
- "@steedos-widgets/amis-lib": "6.3.0-beta.4"
48
+ "@steedos-widgets/amis-lib": "6.3.0-beta.6"
49
49
  },
50
- "gitHead": "afb5860e5aa4887b725bcc085cf7a22016797c55"
50
+ "gitHead": "ae7344bda0a26ca52e7bd4dac6d8bd5280ec4bdb"
51
51
  }