@steedos-widgets/amis-lib 1.2.36 → 1.2.38

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.umd.js CHANGED
@@ -709,7 +709,7 @@
709
709
  if(displayFields.length > 0){
710
710
  return `${fieldsName.join(',')},${expandFieldsQuery},_display:_ui{${displayFields.join(',')}}`;
711
711
  }
712
- return `${fieldsName.join(' ')},${expandFieldsQuery}`
712
+ return _$1.trimEnd(`${fieldsName.join(' ')},${expandFieldsQuery}`, ",")
713
713
  }
714
714
 
715
715
  function getRecordPermissionsTemplate(){
@@ -3378,8 +3378,8 @@
3378
3378
  }
3379
3379
  if(!event.data.isLookup){
3380
3380
  // 刷新浏览器后,filterFormValues值是空的,只能从本地存储中取出并重置为空值
3381
- const listViewId = event.data.listViewId;
3382
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listViewId || "");
3381
+ const listName = event.data.listName;
3382
+ const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
3383
3383
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
3384
3384
  if(localListViewProps){
3385
3385
  localListViewProps = JSON.parse(localListViewProps);
@@ -3405,13 +3405,13 @@
3405
3405
  const dataProviderInited = `
3406
3406
  const objectName = data.objectName;
3407
3407
  const isLookup = data.isLookup;
3408
- const listViewId = data.listViewId;
3408
+ const listName = data.listName;
3409
3409
  let searchableFieldsStoreKey = location.pathname + "/searchable_fields/";
3410
3410
  if(isLookup){
3411
3411
  searchableFieldsStoreKey += "lookup/" + objectName;
3412
3412
  }
3413
3413
  else{
3414
- searchableFieldsStoreKey += (listViewId || "");
3414
+ searchableFieldsStoreKey += (listName || "");
3415
3415
  }
3416
3416
  let defaultSearchableFields = sessionStorage.getItem(searchableFieldsStoreKey);
3417
3417
  if(defaultSearchableFields){
@@ -3438,7 +3438,7 @@
3438
3438
  setData({ showFieldsFilter: false });
3439
3439
  }
3440
3440
  else{
3441
- const listViewPropsStoreKey = location.pathname + "/crud/" + (data.listViewId || "");
3441
+ const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
3442
3442
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
3443
3443
  if(localListViewProps){
3444
3444
  localListViewProps = JSON.parse(localListViewProps);
@@ -3468,7 +3468,6 @@
3468
3468
  const listName = data.listName;
3469
3469
  const objectName = data.objectName;
3470
3470
  const isLookup = data.isLookup;
3471
- const listViewId = data.listViewId;
3472
3471
  const value = data.fields;
3473
3472
  const scope = event.context.scoped;
3474
3473
  // 这里的filterForm不是name为"listview-filter-form"的内部form,而是crud自带的filter form
@@ -3484,7 +3483,7 @@
3484
3483
  searchableFieldsStoreKey += "lookup/" + objectName;
3485
3484
  }
3486
3485
  else{
3487
- searchableFieldsStoreKey += (listViewId || "");
3486
+ searchableFieldsStoreKey += (listName || "");
3488
3487
  }
3489
3488
  sessionStorage.setItem(searchableFieldsStoreKey, value);
3490
3489
 
@@ -3542,7 +3541,7 @@
3542
3541
  }
3543
3542
 
3544
3543
  // 列表视图crud支持本地缓存,所以需要进一步清除浏览器本地缓存里面用户在可搜索项中移除的字段值
3545
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listViewId || "");
3544
+ const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
3546
3545
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
3547
3546
  if(localListViewProps){
3548
3547
  localListViewProps = JSON.parse(localListViewProps);
@@ -5418,18 +5417,27 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
5418
5417
 
5419
5418
  }
5420
5419
 
5421
- function getObjectFooterToolbar(mainObject, formFactor) {
5420
+ function getObjectFooterToolbar(mainObject, formFactor, options) {
5422
5421
  if (formFactor === 'SMALL') {
5423
5422
  return [
5424
5423
  "load-more",
5425
5424
  ]
5426
5425
  }
5427
5426
  else {
5428
- return [
5429
- "switch-per-page",
5430
- "statistics",
5431
- "pagination"
5432
- ]
5427
+ if(options && options.isRelated){
5428
+ return [
5429
+ "statistics",
5430
+ "pagination"
5431
+ ]
5432
+
5433
+ }
5434
+ else {
5435
+ return [
5436
+ "switch-per-page",
5437
+ "statistics",
5438
+ "pagination"
5439
+ ]
5440
+ }
5433
5441
  }
5434
5442
  }
5435
5443
 
@@ -8284,8 +8292,8 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
8284
8292
  const data = _.cloneDeep(api.data);
8285
8293
  try{
8286
8294
  // TODO: 不应该直接在这里取localStorage,应该从外面传入
8287
- const listViewId = api.data.listViewId;
8288
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listViewId || "");
8295
+ const listName = api.data.listName;
8296
+ const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
8289
8297
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
8290
8298
  if(localListViewProps){
8291
8299
  localListViewProps = JSON.parse(localListViewProps);
@@ -8485,8 +8493,8 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
8485
8493
 
8486
8494
  try{
8487
8495
  // TODO: 不应该直接在这里取localStorage,应该从外面传入
8488
- const listViewId = api.body.listViewId;
8489
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listViewId || "");
8496
+ const listName = api.body.listName;
8497
+ const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
8490
8498
  /**
8491
8499
  * localListViewProps规范来自crud请求api中api.data.$self参数值的。
8492
8500
  * 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
@@ -9651,6 +9659,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
9651
9659
  // headerToolbar: getObjectHeaderToolbar(objectSchema, options.formFactor, {showDisplayAs}),
9652
9660
  headerToolbarClassName: "px-4 py-2 border-gray-300 bg-gray-100 border-solid border-b",
9653
9661
  footerToolbar: getObjectFooterToolbar(objectSchema, options.formFactor, {
9662
+ ...options,
9654
9663
  disableStatistics: options.queryCount === false
9655
9664
  }),
9656
9665
  filter: options.filterVisible !== false && await getObjectFilter(objectSchema, fields, options),
@@ -10455,7 +10464,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
10455
10464
  * @Author: baozhoutao@steedos.com
10456
10465
  * @Date: 2022-07-05 15:55:39
10457
10466
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
10458
- * @LastEditTime: 2023-08-01 14:50:23
10467
+ * @LastEditTime: 2023-08-04 12:27:48
10459
10468
  * @Description:
10460
10469
  */
10461
10470
 
@@ -10720,7 +10729,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
10720
10729
  * 本次存储代码段
10721
10730
  */
10722
10731
  try {
10723
- const listViewPropsStoreKey = location.pathname + "/crud/" + (ctx.listViewId || "");
10732
+ const listViewPropsStoreKey = location.pathname + "/crud/" + (listViewName || "");
10724
10733
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
10725
10734
  /**
10726
10735
  * localListViewProps规范来自crud请求api中api.data.$self参数值的。