@steedos-widgets/amis-lib 3.6.0-beta.9 → 3.6.1

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
@@ -1609,11 +1609,11 @@ async function getQuickEditSchema(field, options){
1609
1609
  if(event.data.isBatchEdit){
1610
1610
  selectedItems.forEach(function(selectedItem){
1611
1611
  selectedItem._display.${field.name} = event.data._display.${field.name};
1612
- doAction({actionType: 'setValue', "args": {"value": selectedItem._display},componentId: "_display_" + selectedItem._index});
1612
+ doAction({actionType: 'setValue', "args": {"value": selectedItem._display},componentId: ${options.objectName} + "_display_" + selectedItem._index});
1613
1613
  doAction({actionType: 'setValue', "args": {"value": event.data.${field.name}},componentId: "${options.objectName + "_" + field.name + "_"}" + selectedItem._index});
1614
1614
  })
1615
1615
  }else{
1616
- doAction({actionType: 'setValue', "args": {"value": event.data._display},componentId: "_display_" + event.data._index});
1616
+ doAction({actionType: 'setValue', "args": {"value": event.data._display},componentId: ${options.objectName} + "_display_" + event.data._index});
1617
1617
  doAction({actionType: 'setValue', "args": {"value": event.data.${field.name}},componentId: "${options.objectName + "_" + field.name + "_"}" + event.data._index});
1618
1618
  }
1619
1619
  `
@@ -8445,7 +8445,7 @@ async function getObjectCRUD(objectSchema, fields, options){
8445
8445
 
8446
8446
  if(body.columns && options.formFactor != 'SMALL'){
8447
8447
  //将_display放入crud的columns的倒数第二列中(最后一列会影响固定列),可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
8448
- body.columns.splice(body.columns.length - 1, 0, {name: '_display',type: 'static', width: 32, placeholder: "",id: "_display_${_index}", className: "hidden"});
8448
+ body.columns.splice(body.columns.length - 1, 0, {name: '_display',type: 'static', width: 32, placeholder: "",id: objectSchema.name + "_display_${_index}", className: "hidden"});
8449
8449
  }
8450
8450
 
8451
8451
  if (defaults) {
@@ -10398,6 +10398,8 @@ function getLookupSapceUserTreeSchema(isMobile){
10398
10398
  _.each(children, (item) => {
10399
10399
  if (item.children) {
10400
10400
  item.children = getChildren(records, item.children)
10401
+ }else{
10402
+ item.children = [];
10401
10403
  }
10402
10404
  })
10403
10405
  return children;
@@ -10752,6 +10754,14 @@ async function lookupToAmisPicker(field, readonly, ctx){
10752
10754
  })
10753
10755
  payload.data.rows = rows;
10754
10756
  */
10757
+ if(enable_tree){
10758
+ const rows = _.map(payload.data.rows, (item)=>{
10759
+ delete item.children;
10760
+ delete item.parent;
10761
+ return item;
10762
+ })
10763
+ payload.data.rows = rows;
10764
+ }
10755
10765
  return payload;
10756
10766
  }
10757
10767
  if(!payload.data.rows){
@@ -10783,6 +10793,8 @@ async function lookupToAmisPicker(field, readonly, ctx){
10783
10793
  _.each(children, (item)=>{
10784
10794
  if(item.children){
10785
10795
  item.children = getChildren(records, item.children)
10796
+ }else{
10797
+ item.children = [];
10786
10798
  }
10787
10799
  })
10788
10800
  return children;
@@ -10837,7 +10849,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
10837
10849
  const isAllowCreate = refObjectConfig.permissions.allowCreate;
10838
10850
  const isCreate = _$1.isBoolean(field.create) ? field.create : true;
10839
10851
  // lookup字段配置过滤条件就强制不显示新建按钮
10840
- let isHasFilters = (field.filters || field._filtersFunction) ? true : false;
10852
+ let isHasFilters = (field.filters || field.filtersFunction || field._filtersFunction) ? true : false;
10841
10853
  if (isAllowCreate && isCreate && !isHasFilters) {
10842
10854
  const new_button = await getSchema$5(refObjectConfig, { appId: ctx.appId, objectName: refObjectConfig.name, formFactor: ctx.formFactor });
10843
10855
  new_button.align = "right";
@@ -11255,11 +11267,13 @@ async function lookupToAmis(field, readonly, ctx){
11255
11267
  }
11256
11268
  let refLookupPage = refObject.pages && refObject.pages.lookup;
11257
11269
  if(refLookupPage){
11258
- if(typeof refLookupPage == 'string'){
11259
- refLookupPage = JSON.parse(refLookupPage);
11270
+ if(refLookupPage.is_enable){
11271
+ let pageAmisSchema = refLookupPage.amis_schema;
11272
+ if(typeof pageAmisSchema == 'string'){
11273
+ pageAmisSchema = JSON.parse(pageAmisSchema);
11274
+ }
11275
+ amisSchema = _$1.defaultsDeep({}, pageAmisSchema, amisSchema);
11260
11276
  }
11261
- // Object.assign(amisSchema, refLookupPage);
11262
- // amisSchema = _.defaultsDeep({}, refLookupPage, amisSchema);
11263
11277
  }
11264
11278
  return amisSchema;
11265
11279
  }
@@ -12010,7 +12024,8 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
12010
12024
  },
12011
12025
  pipeOut: (value, oldValue, data) => {
12012
12026
  if(value){
12013
- return value/100;
12027
+ const result = value/100;
12028
+ return Number(result.toFixed(field.scale+2));
12014
12029
  }
12015
12030
  return value;
12016
12031
  },
@@ -12244,7 +12259,7 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
12244
12259
  if(field.is_wide || convertData.type === 'group'){
12245
12260
  convertData.className = 'col-span-2 m-0';
12246
12261
  }else {
12247
- convertData.className = 'm-0';
12262
+ convertData.className = 'm-1';
12248
12263
  }
12249
12264
  if(readonly){
12250
12265
  convertData.className = `${convertData.className} border-b`;
@@ -12649,8 +12664,8 @@ async function getFormBody(permissionFields, formFields, ctx){
12649
12664
  /*
12650
12665
  * @Author: 殷亮辉 yinlianghui@hotoa.com
12651
12666
  * @Date: 2023-11-15 09:50:22
12652
- * @LastEditors: baozhoutao@steedos.com
12653
- * @LastEditTime: 2024-01-02 15:43:50
12667
+ * @LastEditors: liaodaxue
12668
+ * @LastEditTime: 2024-01-09 18:12:28
12654
12669
  */
12655
12670
 
12656
12671
  /**
@@ -12690,6 +12705,7 @@ function getInputTableCell(field, showAsInlineEditMode) {
12690
12705
  "config": Object.assign({}, field, {
12691
12706
  label: false
12692
12707
  }),
12708
+ inInputTable: true,
12693
12709
  "static": true,
12694
12710
  "readonly": true,
12695
12711
  label: field.label,