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