@steedos-widgets/sortable 6.3.0-beta.5 → 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.
package/dist/assets.json CHANGED
@@ -3,8 +3,8 @@
3
3
  {
4
4
  "package": "@steedos-widgets/sortable",
5
5
  "urls": [
6
- "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.5/dist/sortable.umd.js",
7
- "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.5/dist/sortable.umd.css"
6
+ "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.6/dist/sortable.umd.js",
7
+ "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.6/dist/sortable.umd.css"
8
8
  ],
9
9
  "library": "BuilderSortable"
10
10
  }
@@ -15,10 +15,10 @@
15
15
  "npm": {
16
16
  "package": "@steedos-widgets/sortable"
17
17
  },
18
- "url": "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.5/dist/meta.js",
18
+ "url": "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.6/dist/meta.js",
19
19
  "urls": {
20
- "default": "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.5/dist/meta.js",
21
- "design": "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.5/dist/meta.js"
20
+ "default": "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.6/dist/meta.js",
21
+ "design": "https://unpkg.com/@steedos-widgets/sortable@6.3.0-beta.6/dist/meta.js"
22
22
  }
23
23
  }
24
24
  ]
@@ -59570,7 +59570,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
59570
59570
  });
59571
59571
 
59572
59572
  // 把自动填充规则中依赖的字段也加到api请求中
59573
- let autoFillMapping = !field.multiple && field.auto_fill_mapping;
59573
+ let autoFillMapping = field.auto_fill_mapping;
59574
59574
  if (autoFillMapping && autoFillMapping.length) {
59575
59575
  autoFillMapping.forEach(function (item) {
59576
59576
  if(!lodash.exports.find(tableFields, function(f){
@@ -60042,7 +60042,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
60042
60042
  ];
60043
60043
 
60044
60044
  // 把自动填充规则中依赖的字段也加到api请求中
60045
- let autoFillMapping = !field.multiple && field.auto_fill_mapping;
60045
+ let autoFillMapping = field.auto_fill_mapping;
60046
60046
  if (autoFillMapping && autoFillMapping.length) {
60047
60047
  autoFillMapping.forEach(function (item) {
60048
60048
  queryFields.push(refObjectConfig.fields[item.from]);
@@ -60284,14 +60284,25 @@ async function getApi(object, recordId, fields, options){
60284
60284
  }
60285
60285
 
60286
60286
  async function getAutoFill(field, refObject) {
60287
- let autoFillMapping = !field.multiple && field.auto_fill_mapping;
60287
+ let autoFillMapping = field.auto_fill_mapping;
60288
60288
  if (autoFillMapping && autoFillMapping.length) {
60289
60289
  let fillMapping = {};
60290
+ if (field.multiple) {
60291
+ autoFillMapping.forEach(function (item) {
60292
+ //from的字段类型为lookup、master_detail、select时,需要保留数组格式;其他类型需要转变为字符串格式
60293
+ if (lodash.exports.includes(["lookup","master_detail","select"], refObject.fields[item.from].type)) {
60294
+ fillMapping[item.to] = `\${items | pick:${item.from}}`;
60295
+ } else {
60296
+ fillMapping[item.to] = `\${items | pick:${item.from} | join}`;
60297
+ }
60298
+ });
60299
+ }else {
60300
+ autoFillMapping.forEach(function (item) {
60301
+ fillMapping[item.to] = `\${${item.from}}`;
60302
+ });
60303
+ }
60290
60304
  // let fieldsForApi = [];
60291
- autoFillMapping.forEach(function (item) {
60292
- fillMapping[item.to] = `\${${item.from}}`;
60293
- // fieldsForApi.push(item.from);
60294
- });
60305
+ // fieldsForApi.push(item.from);
60295
60306
  // let api = {
60296
60307
  // // "url": "/amis/api/mock2/form/autoUpdate?browser=${browser}&version=${version}",
60297
60308
  // "url": `/api/v1/${refObject.name}/\${${field.name}}?fields=${JSON.stringify(fieldsForApi)}`,
@@ -60393,7 +60404,7 @@ async function lookupToAmis(field, readonly, ctx){
60393
60404
  amisSchema = lodash.exports.defaultsDeep({}, pageAmisSchema, amisSchema);
60394
60405
  }
60395
60406
  }
60396
- const autoFill = await getAutoFill(field);
60407
+ const autoFill = await getAutoFill(field, refObject);
60397
60408
  if(autoFill){
60398
60409
  amisSchema.autoFill = autoFill;
60399
60410
  // 这里不配置initAutoFill值,按amis规则initAutoFill默认值为fillIfNotSet处理--需要amis sdk 版本 > 3.6.3-patch.6(不包括)版本