@steedos-widgets/amis-lib 1.2.38 → 1.2.39

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.cjs.js CHANGED
@@ -1077,6 +1077,7 @@ var frontend_message_modification_failed$1 = "Modification failed!";
1077
1077
  var frontend_objects_related_alert_start$1 = "No related table fields associated with the related list object";
1078
1078
  var frontend_objects_related_alert_end$1 = "were found.";
1079
1079
  var frontend_no_records_found$1 = "No records found.";
1080
+ var frontend_records_no_allowedit$1 = "You do not have edit permission for this record";
1080
1081
  var en_us = {
1081
1082
  frontend_field_group_generalization: frontend_field_group_generalization$1,
1082
1083
  frontend_download: frontend_download$1,
@@ -1159,7 +1160,8 @@ var en_us = {
1159
1160
  frontend_message_modification_failed: frontend_message_modification_failed$1,
1160
1161
  frontend_objects_related_alert_start: frontend_objects_related_alert_start$1,
1161
1162
  frontend_objects_related_alert_end: frontend_objects_related_alert_end$1,
1162
- frontend_no_records_found: frontend_no_records_found$1
1163
+ frontend_no_records_found: frontend_no_records_found$1,
1164
+ frontend_records_no_allowedit: frontend_records_no_allowedit$1
1163
1165
  };
1164
1166
 
1165
1167
  var frontend_field_group_generalization = "通用";
@@ -1183,7 +1185,7 @@ var frontend_display_type_is_split = "分栏视图";
1183
1185
  var frontend_display_as = "显示为";
1184
1186
  var frontend_record_sum = "个项目";
1185
1187
  var frontend_button_reload_tooltip = "刷新";
1186
- var frontend_button_search_tooltip = "搜索";
1188
+ var frontend_button_search_tooltip = "查询";
1187
1189
  var frontend_fields_filter_button_search = "搜索";
1188
1190
  var frontend_fields_filter_button_settings = "设置搜索项";
1189
1191
  var frontend_button_listview_control_tooltip = "列表视图控制";
@@ -1245,6 +1247,7 @@ var frontend_message_modification_failed = "修改失败!";
1245
1247
  var frontend_objects_related_alert_start = "未找到与相关列表对象";
1246
1248
  var frontend_objects_related_alert_end = "关联的相关表字段";
1247
1249
  var frontend_no_records_found = "无法找到记录";
1250
+ var frontend_records_no_allowedit = "您对这条记录没有编辑权限";
1248
1251
  var zh_cn = {
1249
1252
  frontend_field_group_generalization: frontend_field_group_generalization,
1250
1253
  frontend_download: frontend_download,
@@ -1328,7 +1331,8 @@ var zh_cn = {
1328
1331
  frontend_message_modification_failed: frontend_message_modification_failed,
1329
1332
  frontend_objects_related_alert_start: frontend_objects_related_alert_start,
1330
1333
  frontend_objects_related_alert_end: frontend_objects_related_alert_end,
1331
- frontend_no_records_found: frontend_no_records_found
1334
+ frontend_no_records_found: frontend_no_records_found,
1335
+ frontend_records_no_allowedit: frontend_records_no_allowedit
1332
1336
  };
1333
1337
 
1334
1338
  const resources = {
@@ -3382,12 +3386,14 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3382
3386
  if(!event.data.isLookup){
3383
3387
  // 刷新浏览器后,filterFormValues值是空的,只能从本地存储中取出并重置为空值
3384
3388
  const listName = event.data.listName;
3385
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
3389
+ const listViewPropsStoreKey = location.pathname + "/crud";
3386
3390
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
3387
3391
  if(localListViewProps){
3388
3392
  localListViewProps = JSON.parse(localListViewProps);
3389
3393
  for(var k in localListViewProps){
3390
- removedValues[k] = null;
3394
+ if(k !== "__keywords"){
3395
+ removedValues[k] = null;
3396
+ }
3391
3397
  }
3392
3398
  }
3393
3399
  }
@@ -3409,12 +3415,9 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3409
3415
  const objectName = data.objectName;
3410
3416
  const isLookup = data.isLookup;
3411
3417
  const listName = data.listName;
3412
- let searchableFieldsStoreKey = location.pathname + "/searchable_fields/";
3418
+ let searchableFieldsStoreKey = location.pathname + "/searchable_fields";
3413
3419
  if(isLookup){
3414
- searchableFieldsStoreKey += "lookup/" + objectName;
3415
- }
3416
- else{
3417
- searchableFieldsStoreKey += (listName || "");
3420
+ searchableFieldsStoreKey += "/lookup/" + objectName;
3418
3421
  }
3419
3422
  let defaultSearchableFields = sessionStorage.getItem(searchableFieldsStoreKey);
3420
3423
  if(defaultSearchableFields){
@@ -3441,7 +3444,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3441
3444
  setData({ showFieldsFilter: false });
3442
3445
  }
3443
3446
  else{
3444
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
3447
+ const listViewPropsStoreKey = location.pathname + "/crud";
3445
3448
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
3446
3449
  if(localListViewProps){
3447
3450
  localListViewProps = JSON.parse(localListViewProps);
@@ -3481,12 +3484,9 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3481
3484
  return n.props.type === "service";
3482
3485
  });
3483
3486
  filterService.setData({ filterFormSearchableFields: value });
3484
- let searchableFieldsStoreKey = location.pathname + "/searchable_fields/";
3487
+ let searchableFieldsStoreKey = location.pathname + "/searchable_fields";
3485
3488
  if(isLookup){
3486
- searchableFieldsStoreKey += "lookup/" + objectName;
3487
- }
3488
- else{
3489
- searchableFieldsStoreKey += (listName || "");
3489
+ searchableFieldsStoreKey += "/lookup/" + objectName;
3490
3490
  }
3491
3491
  sessionStorage.setItem(searchableFieldsStoreKey, value);
3492
3492
 
@@ -3544,7 +3544,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3544
3544
  }
3545
3545
 
3546
3546
  // 列表视图crud支持本地缓存,所以需要进一步清除浏览器本地缓存里面用户在可搜索项中移除的字段值
3547
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
3547
+ const listViewPropsStoreKey = location.pathname + "/crud";
3548
3548
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
3549
3549
  if(localListViewProps){
3550
3550
  localListViewProps = JSON.parse(localListViewProps);
@@ -5265,9 +5265,23 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
5265
5265
  `;
5266
5266
 
5267
5267
 
5268
- function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true} = {}){
5268
+ function getObjectHeaderToolbar(mainObject, fields, formFactor, { showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true, isLookup = false } = {}){
5269
5269
  // console.log(`getObjectHeaderToolbar====>`, filterVisible)
5270
- console.log(`getObjectHeaderToolbar`, mainObject);
5270
+ // console.log(`getObjectHeaderToolbar`, mainObject)
5271
+ const searchableFieldsLabel = [];
5272
+ _.each(fields, function (field) {
5273
+ if (field.searchable && SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1) {
5274
+ searchableFieldsLabel.push(field.label);
5275
+ }
5276
+ });
5277
+ const listViewPropsStoreKey = location.pathname + "/crud";
5278
+ let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
5279
+ let crudKeywords = "";
5280
+ if(localListViewProps && !isLookup){
5281
+ localListViewProps = JSON.parse(localListViewProps);
5282
+ crudKeywords = (localListViewProps && localListViewProps.__keywords) || "";
5283
+ }
5284
+
5271
5285
  const isMobile = window.innerWidth < 768;
5272
5286
  if(isMobile){
5273
5287
  showDisplayAs = false;
@@ -5323,7 +5337,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
5323
5337
  ],
5324
5338
  "size":8,
5325
5339
  "animation": true,
5326
- "visibleOn": "${isFieldsFilterEmpty == false}"
5340
+ "visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
5327
5341
  },
5328
5342
  "align": "right",
5329
5343
  "className": "bg-white p-2 rounded border-gray-300 text-gray-500",
@@ -5338,7 +5352,27 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
5338
5352
  }
5339
5353
  }
5340
5354
  } : {},
5341
- getDisplayAsButton(mainObject?.name)
5355
+ getDisplayAsButton(mainObject?.name),
5356
+ {
5357
+ "type": "tooltip-wrapper",
5358
+ "align": "right",
5359
+ "title": "",
5360
+ "content": "可搜索字段:" + searchableFieldsLabel.join(","),
5361
+ "placement": "bottom",
5362
+ "tooltipTheme": "dark",
5363
+ "trigger": "click",
5364
+ // "className": "mr-1",
5365
+ "body": [
5366
+ {
5367
+ "type": "search-box",
5368
+ "name": "__keywords",
5369
+ "placeholder": "请输入关键字",
5370
+ "value": crudKeywords,
5371
+ "clearable": true,
5372
+ "clearAndSubmit": true
5373
+ }
5374
+ ]
5375
+ },
5342
5376
  ]
5343
5377
  }else {
5344
5378
  return [
@@ -5357,21 +5391,9 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
5357
5391
  "type": "tpl",
5358
5392
  "tpl": "${count} " + i18next__default["default"].t('frontend_record_sum')
5359
5393
  },
5360
- {
5361
- "type": "reload",
5362
- "align": "right",
5363
- //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
5364
- // "tooltip": i18next.t('frontend_button_reload_tooltip'),
5365
- "tooltip":"",
5366
- "tooltipPlacement": "top",
5367
- "className": "bg-white p-2 rounded border-gray-300 text-gray-500"
5368
- },
5369
- // getExportExcelToolbarButtonSchema(),
5370
- mainObject?.permissions?.allowCreateListViews ? getSettingListviewToolbarButtonSchema() : {},
5371
- getDisplayAsButton(mainObject?.name),
5372
5394
  filterVisible ? {
5373
5395
  "label": i18next__default["default"].t('frontend_button_search_tooltip'),
5374
- "icon": "fa fa-search",
5396
+ "icon": "fa fa-filter",
5375
5397
  //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
5376
5398
  // "tooltip": i18next.t('frontend_button_search_tooltip'),
5377
5399
  // "tooltipPlacement": "top",
@@ -5383,7 +5405,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
5383
5405
  ],
5384
5406
  "size":8,
5385
5407
  "animation": true,
5386
- "visibleOn": "${isFieldsFilterEmpty == false}"
5408
+ "visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
5387
5409
  },
5388
5410
  "align": "right",
5389
5411
  "className": "bg-white p-2 rounded border-gray-300 text-gray-500",
@@ -5397,14 +5419,39 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
5397
5419
  ]
5398
5420
  }
5399
5421
  }
5400
- } : {}
5401
- // {
5402
- // "type": "search-box",
5403
- // "align": "right",
5404
- // "name": "__keywords",
5405
- // "placeholder": "请输入关键字",
5406
- // "mini": true
5407
- // },
5422
+ } : {},
5423
+ {
5424
+ "type": "reload",
5425
+ "align": "right",
5426
+ //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
5427
+ // "tooltip": i18next.t('frontend_button_reload_tooltip'),
5428
+ "tooltip":"",
5429
+ "tooltipPlacement": "top",
5430
+ "className": "bg-white p-2 rounded border-gray-300 text-gray-500"
5431
+ },
5432
+ // getExportExcelToolbarButtonSchema(),
5433
+ mainObject?.permissions?.allowCreateListViews ? getSettingListviewToolbarButtonSchema() : {},
5434
+ getDisplayAsButton(mainObject?.name),
5435
+ {
5436
+ "type": "tooltip-wrapper",
5437
+ "align": "right",
5438
+ "title": "",
5439
+ "content": "可搜索字段:" + searchableFieldsLabel.join(","),
5440
+ "placement": "bottom",
5441
+ "tooltipTheme": "dark",
5442
+ "trigger": "click",
5443
+ "className": "mr-1",
5444
+ "body": [
5445
+ {
5446
+ "type": "search-box",
5447
+ "name": "__keywords",
5448
+ "placeholder": "请输入关键字",
5449
+ "value": crudKeywords,
5450
+ "clearable": true,
5451
+ "clearAndSubmit": true
5452
+ }
5453
+ ]
5454
+ },
5408
5455
  // {
5409
5456
  // "type": "drag-toggler",
5410
5457
  // "align": "right"
@@ -5748,16 +5795,17 @@ function getLookupSapceUserTreeSchema(){
5748
5795
  "autoCheckChildren": false,
5749
5796
  "searchable": true,
5750
5797
  "searchConfig": {
5751
- "sticky": true
5798
+ "sticky": true,
5799
+ "placeholder": "查找部门"
5752
5800
  },
5753
5801
  "unfoldedLevel": 2,
5754
5802
  "style": {
5755
5803
  "max-height": "100%",
5756
5804
  "position": "absolute",
5757
- "left": "-200px",
5758
- "width": "190px",
5805
+ "left": "-330px",
5806
+ "width": "320px",
5759
5807
  "bottom": 0,
5760
- "top": "2px",
5808
+ "top": "0",
5761
5809
  "overflow": "auto",
5762
5810
  "min-height":"300px"
5763
5811
  },
@@ -5776,7 +5824,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
5776
5824
  ctx.idFieldName = refObjectConfig.idFieldName;
5777
5825
  ctx.objectName = refObjectConfig.name;
5778
5826
 
5779
- const tableFields = [];
5827
+ let tableFields = [];
5780
5828
  let i = 0;
5781
5829
  const searchableFields = [];
5782
5830
 
@@ -5821,7 +5869,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
5821
5869
  })){
5822
5870
  i++;
5823
5871
  tableFields.push(field);
5824
- if(field.searchable){
5872
+ if(field.searchable && SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1){
5825
5873
  searchableFields.push(field.name);
5826
5874
  }
5827
5875
  }
@@ -5905,16 +5953,31 @@ async function lookupToAmisPicker(field, readonly, ctx){
5905
5953
  }
5906
5954
  }
5907
5955
 
5908
-
5909
5956
  if(allowSearchFields){
5910
5957
  allowSearchFields.forEach(function(key){
5911
5958
  const keyValue = selfData[key];
5912
- if(keyValue){
5959
+ if(_.isString(keyValue)){
5913
5960
  filters.push([key, "contains", keyValue]);
5961
+ }else if(_.isArray(keyValue) || _.isBoolean(keyValue) || keyValue){
5962
+ filters.push([key, "=", keyValue]);
5914
5963
  }
5915
5964
  })
5916
5965
  }
5917
5966
 
5967
+ if(selfData.__keywords && allowSearchFields){
5968
+ const keywordsFilters = [];
5969
+ allowSearchFields.forEach(function(key, index){
5970
+ const keyValue = selfData.__keywords;
5971
+ if(keyValue){
5972
+ keywordsFilters.push([key, "contains", keyValue]);
5973
+ if(index < allowSearchFields.length - 1){
5974
+ keywordsFilters.push('or');
5975
+ }
5976
+ }
5977
+ })
5978
+ filters.push(keywordsFilters);
5979
+ };
5980
+
5918
5981
  var fieldFilters = ${JSON.stringify(field.filters)};
5919
5982
  if(fieldFilters && fieldFilters.length){
5920
5983
  filters.push(fieldFilters);
@@ -6003,6 +6066,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
6003
6066
  if(refObjectConfig.paging && refObjectConfig.paging.enabled === false){
6004
6067
  top = 1000;
6005
6068
  }
6069
+
6006
6070
  let pickerSchema = null;
6007
6071
  if(ctx.formFactor === 'SMALL'){
6008
6072
  pickerSchema = await getListSchema$1(tableFields, {
@@ -6024,18 +6088,19 @@ async function lookupToAmisPicker(field, readonly, ctx){
6024
6088
  if(referenceTo.objectName === "space_users" && field.reference_to_field === "user" && !isMobile){
6025
6089
  headerToolbarItems = getLookupSapceUserTreeSchema();
6026
6090
  pickerSchema["style"] = {
6027
- "margin-left":"200px",
6091
+ "margin-left":"330px",
6028
6092
  "min-height": "300px"
6029
6093
  };
6030
6094
  pickerSchema.className = pickerSchema.className || "" + " steedos-select-user";
6031
6095
  }
6032
6096
 
6033
- pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, ctx.formFactor, { headerToolbarItems });
6097
+ pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { headerToolbarItems, isLookup: true });
6034
6098
  const isAllowCreate = refObjectConfig.permissions.allowCreate;
6035
6099
  if (isAllowCreate) {
6036
6100
  const new_button = await getSchema$5(refObjectConfig, { appId: ctx.appId, objectName: refObjectConfig.name, formFactor: ctx.formFactor });
6037
6101
  new_button.align = "right";
6038
- pickerSchema.headerToolbar.push(new_button);
6102
+ // 保持快速搜索放在最左侧,新建按钮往里插,而不是push到最后
6103
+ pickerSchema.headerToolbar.splice(pickerSchema.headerToolbar.length - 1, 0, new_button);
6039
6104
  }
6040
6105
  pickerSchema.footerToolbar = refObjectConfig.enable_tree ? [] : getObjectFooterToolbar();
6041
6106
  if (ctx.filterVisible !== false) {
@@ -6752,6 +6817,7 @@ const getAmisFileSchema = (steedosField, readonly)=>{
6752
6817
  return readonly ? getAmisFileReadonlySchema(steedosField) : getAmisFileEditSchema(steedosField);
6753
6818
  };
6754
6819
 
6820
+ const SEARCHABLE_FIELD_TYPES = ["text", "textarea", "autonumber", "url", "email"];
6755
6821
  const OMIT_FIELDS = ['created', 'created_by', 'modified', 'modified_by'];
6756
6822
  // const Lookup = require('./lookup');
6757
6823
 
@@ -7526,6 +7592,7 @@ if (typeof window != 'undefined') {
7526
7592
 
7527
7593
  var index = /*#__PURE__*/Object.freeze({
7528
7594
  __proto__: null,
7595
+ SEARCHABLE_FIELD_TYPES: SEARCHABLE_FIELD_TYPES,
7529
7596
  OMIT_FIELDS: OMIT_FIELDS,
7530
7597
  getBaseFields: getBaseFields,
7531
7598
  getAmisFieldType: getAmisFieldType,
@@ -7725,7 +7792,71 @@ async function getQuickEditSchema(field, options){
7725
7792
  `;
7726
7793
  break;
7727
7794
  }
7728
-
7795
+ quickEditSchema.body[0].visibleOn = "${quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}";
7796
+ quickEditSchema.body.push({
7797
+ "type":"service",
7798
+ "body":[
7799
+ {
7800
+ "type": "tpl",
7801
+ "tpl": i18next__default["default"].t('frontend_records_no_allowedit'),
7802
+ "visibleOn": "${!quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}"
7803
+ },
7804
+ {
7805
+ "type": "spinner",
7806
+ "showOn": "${quickedit_record_permissions_loading}"
7807
+ }
7808
+ ],
7809
+ "onEvent":{
7810
+ "init":{
7811
+ "actions":[
7812
+ {
7813
+ "actionType": "setValue",
7814
+ "componentId": `service_listview_${options.objectName}`,
7815
+ "args": {
7816
+ "value":{
7817
+ "quickedit_record_permissions_loading": true
7818
+ }
7819
+ }
7820
+ },
7821
+ {
7822
+ "actionType": "ajax",
7823
+ "args": {
7824
+ "api": {
7825
+ "url": "${context.rootUrl}/service/api/@\${objectName}/recordPermissions/${_id}",
7826
+ "method": "get",
7827
+ "headers": {
7828
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
7829
+ },
7830
+ "cache": 30000,
7831
+ "messages": {
7832
+ "failed": "失败了呢。。"
7833
+ }
7834
+ }
7835
+ }
7836
+ },
7837
+ {
7838
+ "actionType": "setValue",
7839
+ "componentId": `service_listview_${options.objectName}`,
7840
+ "args": {
7841
+ "value":{
7842
+ "quickedit_record_permissions_loading": false
7843
+ }
7844
+ }
7845
+ },
7846
+ {
7847
+ "actionType": "setValue",
7848
+ "componentId": `service_listview_${options.objectName}`,
7849
+ "args": {
7850
+ "value":{
7851
+ "quickedit_record_permissions": "${event.data}"
7852
+ }
7853
+ }
7854
+ }
7855
+ ]
7856
+ }
7857
+ }
7858
+
7859
+ });
7729
7860
  } else {
7730
7861
  quickEditSchema = false;
7731
7862
  }
@@ -7758,7 +7889,7 @@ function getFieldWidth(width){
7758
7889
 
7759
7890
  async function getTableColumns(fields, options){
7760
7891
  const columns = [{name: '_index',type: 'text', width: 32, placeholder: ""}];
7761
- const allowEdit = options.permissions?.allowEdit && options.permissions?.modifyAllRecords && !options.isLookup && options.enable_inline_edit != false;
7892
+ const allowEdit = options.permissions?.allowEdit && !options.isLookup && options.enable_inline_edit != false;
7762
7893
 
7763
7894
  for (const field of fields) {
7764
7895
  //增加quickEdit属性,实现快速编辑
@@ -8249,7 +8380,7 @@ async function getTableApi(mainObject, fields, options){
8249
8380
  baseFilters = filter;
8250
8381
  }
8251
8382
  ___namespace.each(fields,function(field){
8252
- if(field.searchable){
8383
+ if(field.searchable && SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1){
8253
8384
  searchableFields.push(field.name);
8254
8385
  }
8255
8386
  });
@@ -8296,7 +8427,7 @@ async function getTableApi(mainObject, fields, options){
8296
8427
  try{
8297
8428
  // TODO: 不应该直接在这里取localStorage,应该从外面传入
8298
8429
  const listName = api.data.listName;
8299
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
8430
+ const listViewPropsStoreKey = location.pathname + "/crud";
8300
8431
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
8301
8432
  if(localListViewProps){
8302
8433
  localListViewProps = JSON.parse(localListViewProps);
@@ -8497,7 +8628,7 @@ async function getTableApi(mainObject, fields, options){
8497
8628
  try{
8498
8629
  // TODO: 不应该直接在这里取localStorage,应该从外面传入
8499
8630
  const listName = api.body.listName;
8500
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
8631
+ const listViewPropsStoreKey = location.pathname + "/crud";
8501
8632
  /**
8502
8633
  * localListViewProps规范来自crud请求api中api.data.$self参数值的。
8503
8634
  * 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
@@ -9687,7 +9818,7 @@ async function getObjectCRUD(objectSchema, fields, options){
9687
9818
  }
9688
9819
  }
9689
9820
  // console.log(`getObjectHeaderToolbar====2===>`, options.filterVisible)
9690
- bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, options.formFactor, {
9821
+ bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, fields, options.formFactor, {
9691
9822
  showDisplayAs,
9692
9823
  hiddenCount: options.queryCount === false,
9693
9824
  headerToolbarItems: options.headerToolbarItems,
@@ -9812,6 +9943,7 @@ async function getObjectCRUD(objectSchema, fields, options){
9812
9943
  return {
9813
9944
  type: 'service',
9814
9945
  className: '',
9946
+ //目前crud的service层id不认用户自定义id,只支持默认规则id
9815
9947
  id: `service_${id}`,
9816
9948
  name: `page`,
9817
9949
  data: {