@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.esm.js CHANGED
@@ -1050,6 +1050,7 @@ var frontend_message_modification_failed$1 = "Modification failed!";
1050
1050
  var frontend_objects_related_alert_start$1 = "No related table fields associated with the related list object";
1051
1051
  var frontend_objects_related_alert_end$1 = "were found.";
1052
1052
  var frontend_no_records_found$1 = "No records found.";
1053
+ var frontend_records_no_allowedit$1 = "You do not have edit permission for this record";
1053
1054
  var en_us = {
1054
1055
  frontend_field_group_generalization: frontend_field_group_generalization$1,
1055
1056
  frontend_download: frontend_download$1,
@@ -1132,7 +1133,8 @@ var en_us = {
1132
1133
  frontend_message_modification_failed: frontend_message_modification_failed$1,
1133
1134
  frontend_objects_related_alert_start: frontend_objects_related_alert_start$1,
1134
1135
  frontend_objects_related_alert_end: frontend_objects_related_alert_end$1,
1135
- frontend_no_records_found: frontend_no_records_found$1
1136
+ frontend_no_records_found: frontend_no_records_found$1,
1137
+ frontend_records_no_allowedit: frontend_records_no_allowedit$1
1136
1138
  };
1137
1139
 
1138
1140
  var frontend_field_group_generalization = "通用";
@@ -1156,7 +1158,7 @@ var frontend_display_type_is_split = "分栏视图";
1156
1158
  var frontend_display_as = "显示为";
1157
1159
  var frontend_record_sum = "个项目";
1158
1160
  var frontend_button_reload_tooltip = "刷新";
1159
- var frontend_button_search_tooltip = "搜索";
1161
+ var frontend_button_search_tooltip = "查询";
1160
1162
  var frontend_fields_filter_button_search = "搜索";
1161
1163
  var frontend_fields_filter_button_settings = "设置搜索项";
1162
1164
  var frontend_button_listview_control_tooltip = "列表视图控制";
@@ -1218,6 +1220,7 @@ var frontend_message_modification_failed = "修改失败!";
1218
1220
  var frontend_objects_related_alert_start = "未找到与相关列表对象";
1219
1221
  var frontend_objects_related_alert_end = "关联的相关表字段";
1220
1222
  var frontend_no_records_found = "无法找到记录";
1223
+ var frontend_records_no_allowedit = "您对这条记录没有编辑权限";
1221
1224
  var zh_cn = {
1222
1225
  frontend_field_group_generalization: frontend_field_group_generalization,
1223
1226
  frontend_download: frontend_download,
@@ -1301,7 +1304,8 @@ var zh_cn = {
1301
1304
  frontend_message_modification_failed: frontend_message_modification_failed,
1302
1305
  frontend_objects_related_alert_start: frontend_objects_related_alert_start,
1303
1306
  frontend_objects_related_alert_end: frontend_objects_related_alert_end,
1304
- frontend_no_records_found: frontend_no_records_found
1307
+ frontend_no_records_found: frontend_no_records_found,
1308
+ frontend_records_no_allowedit: frontend_records_no_allowedit
1305
1309
  };
1306
1310
 
1307
1311
  const resources = {
@@ -3355,12 +3359,14 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3355
3359
  if(!event.data.isLookup){
3356
3360
  // 刷新浏览器后,filterFormValues值是空的,只能从本地存储中取出并重置为空值
3357
3361
  const listName = event.data.listName;
3358
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
3362
+ const listViewPropsStoreKey = location.pathname + "/crud";
3359
3363
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
3360
3364
  if(localListViewProps){
3361
3365
  localListViewProps = JSON.parse(localListViewProps);
3362
3366
  for(var k in localListViewProps){
3363
- removedValues[k] = null;
3367
+ if(k !== "__keywords"){
3368
+ removedValues[k] = null;
3369
+ }
3364
3370
  }
3365
3371
  }
3366
3372
  }
@@ -3382,12 +3388,9 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3382
3388
  const objectName = data.objectName;
3383
3389
  const isLookup = data.isLookup;
3384
3390
  const listName = data.listName;
3385
- let searchableFieldsStoreKey = location.pathname + "/searchable_fields/";
3391
+ let searchableFieldsStoreKey = location.pathname + "/searchable_fields";
3386
3392
  if(isLookup){
3387
- searchableFieldsStoreKey += "lookup/" + objectName;
3388
- }
3389
- else{
3390
- searchableFieldsStoreKey += (listName || "");
3393
+ searchableFieldsStoreKey += "/lookup/" + objectName;
3391
3394
  }
3392
3395
  let defaultSearchableFields = sessionStorage.getItem(searchableFieldsStoreKey);
3393
3396
  if(defaultSearchableFields){
@@ -3414,7 +3417,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3414
3417
  setData({ showFieldsFilter: false });
3415
3418
  }
3416
3419
  else{
3417
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
3420
+ const listViewPropsStoreKey = location.pathname + "/crud";
3418
3421
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
3419
3422
  if(localListViewProps){
3420
3423
  localListViewProps = JSON.parse(localListViewProps);
@@ -3454,12 +3457,9 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3454
3457
  return n.props.type === "service";
3455
3458
  });
3456
3459
  filterService.setData({ filterFormSearchableFields: value });
3457
- let searchableFieldsStoreKey = location.pathname + "/searchable_fields/";
3460
+ let searchableFieldsStoreKey = location.pathname + "/searchable_fields";
3458
3461
  if(isLookup){
3459
- searchableFieldsStoreKey += "lookup/" + objectName;
3460
- }
3461
- else{
3462
- searchableFieldsStoreKey += (listName || "");
3462
+ searchableFieldsStoreKey += "/lookup/" + objectName;
3463
3463
  }
3464
3464
  sessionStorage.setItem(searchableFieldsStoreKey, value);
3465
3465
 
@@ -3517,7 +3517,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
3517
3517
  }
3518
3518
 
3519
3519
  // 列表视图crud支持本地缓存,所以需要进一步清除浏览器本地缓存里面用户在可搜索项中移除的字段值
3520
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
3520
+ const listViewPropsStoreKey = location.pathname + "/crud";
3521
3521
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
3522
3522
  if(localListViewProps){
3523
3523
  localListViewProps = JSON.parse(localListViewProps);
@@ -5238,9 +5238,23 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
5238
5238
  `;
5239
5239
 
5240
5240
 
5241
- function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true} = {}){
5241
+ function getObjectHeaderToolbar(mainObject, fields, formFactor, { showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true, isLookup = false } = {}){
5242
5242
  // console.log(`getObjectHeaderToolbar====>`, filterVisible)
5243
- console.log(`getObjectHeaderToolbar`, mainObject);
5243
+ // console.log(`getObjectHeaderToolbar`, mainObject)
5244
+ const searchableFieldsLabel = [];
5245
+ _.each(fields, function (field) {
5246
+ if (field.searchable && SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1) {
5247
+ searchableFieldsLabel.push(field.label);
5248
+ }
5249
+ });
5250
+ const listViewPropsStoreKey = location.pathname + "/crud";
5251
+ let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
5252
+ let crudKeywords = "";
5253
+ if(localListViewProps && !isLookup){
5254
+ localListViewProps = JSON.parse(localListViewProps);
5255
+ crudKeywords = (localListViewProps && localListViewProps.__keywords) || "";
5256
+ }
5257
+
5244
5258
  const isMobile = window.innerWidth < 768;
5245
5259
  if(isMobile){
5246
5260
  showDisplayAs = false;
@@ -5296,7 +5310,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
5296
5310
  ],
5297
5311
  "size":8,
5298
5312
  "animation": true,
5299
- "visibleOn": "${isFieldsFilterEmpty == false}"
5313
+ "visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
5300
5314
  },
5301
5315
  "align": "right",
5302
5316
  "className": "bg-white p-2 rounded border-gray-300 text-gray-500",
@@ -5311,7 +5325,27 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
5311
5325
  }
5312
5326
  }
5313
5327
  } : {},
5314
- getDisplayAsButton(mainObject?.name)
5328
+ getDisplayAsButton(mainObject?.name),
5329
+ {
5330
+ "type": "tooltip-wrapper",
5331
+ "align": "right",
5332
+ "title": "",
5333
+ "content": "可搜索字段:" + searchableFieldsLabel.join(","),
5334
+ "placement": "bottom",
5335
+ "tooltipTheme": "dark",
5336
+ "trigger": "click",
5337
+ // "className": "mr-1",
5338
+ "body": [
5339
+ {
5340
+ "type": "search-box",
5341
+ "name": "__keywords",
5342
+ "placeholder": "请输入关键字",
5343
+ "value": crudKeywords,
5344
+ "clearable": true,
5345
+ "clearAndSubmit": true
5346
+ }
5347
+ ]
5348
+ },
5315
5349
  ]
5316
5350
  }else {
5317
5351
  return [
@@ -5330,21 +5364,9 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
5330
5364
  "type": "tpl",
5331
5365
  "tpl": "${count} " + i18next.t('frontend_record_sum')
5332
5366
  },
5333
- {
5334
- "type": "reload",
5335
- "align": "right",
5336
- //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
5337
- // "tooltip": i18next.t('frontend_button_reload_tooltip'),
5338
- "tooltip":"",
5339
- "tooltipPlacement": "top",
5340
- "className": "bg-white p-2 rounded border-gray-300 text-gray-500"
5341
- },
5342
- // getExportExcelToolbarButtonSchema(),
5343
- mainObject?.permissions?.allowCreateListViews ? getSettingListviewToolbarButtonSchema() : {},
5344
- getDisplayAsButton(mainObject?.name),
5345
5367
  filterVisible ? {
5346
5368
  "label": i18next.t('frontend_button_search_tooltip'),
5347
- "icon": "fa fa-search",
5369
+ "icon": "fa fa-filter",
5348
5370
  //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
5349
5371
  // "tooltip": i18next.t('frontend_button_search_tooltip'),
5350
5372
  // "tooltipPlacement": "top",
@@ -5356,7 +5378,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
5356
5378
  ],
5357
5379
  "size":8,
5358
5380
  "animation": true,
5359
- "visibleOn": "${isFieldsFilterEmpty == false}"
5381
+ "visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
5360
5382
  },
5361
5383
  "align": "right",
5362
5384
  "className": "bg-white p-2 rounded border-gray-300 text-gray-500",
@@ -5370,14 +5392,39 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
5370
5392
  ]
5371
5393
  }
5372
5394
  }
5373
- } : {}
5374
- // {
5375
- // "type": "search-box",
5376
- // "align": "right",
5377
- // "name": "__keywords",
5378
- // "placeholder": "请输入关键字",
5379
- // "mini": true
5380
- // },
5395
+ } : {},
5396
+ {
5397
+ "type": "reload",
5398
+ "align": "right",
5399
+ //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
5400
+ // "tooltip": i18next.t('frontend_button_reload_tooltip'),
5401
+ "tooltip":"",
5402
+ "tooltipPlacement": "top",
5403
+ "className": "bg-white p-2 rounded border-gray-300 text-gray-500"
5404
+ },
5405
+ // getExportExcelToolbarButtonSchema(),
5406
+ mainObject?.permissions?.allowCreateListViews ? getSettingListviewToolbarButtonSchema() : {},
5407
+ getDisplayAsButton(mainObject?.name),
5408
+ {
5409
+ "type": "tooltip-wrapper",
5410
+ "align": "right",
5411
+ "title": "",
5412
+ "content": "可搜索字段:" + searchableFieldsLabel.join(","),
5413
+ "placement": "bottom",
5414
+ "tooltipTheme": "dark",
5415
+ "trigger": "click",
5416
+ "className": "mr-1",
5417
+ "body": [
5418
+ {
5419
+ "type": "search-box",
5420
+ "name": "__keywords",
5421
+ "placeholder": "请输入关键字",
5422
+ "value": crudKeywords,
5423
+ "clearable": true,
5424
+ "clearAndSubmit": true
5425
+ }
5426
+ ]
5427
+ },
5381
5428
  // {
5382
5429
  // "type": "drag-toggler",
5383
5430
  // "align": "right"
@@ -5721,16 +5768,17 @@ function getLookupSapceUserTreeSchema(){
5721
5768
  "autoCheckChildren": false,
5722
5769
  "searchable": true,
5723
5770
  "searchConfig": {
5724
- "sticky": true
5771
+ "sticky": true,
5772
+ "placeholder": "查找部门"
5725
5773
  },
5726
5774
  "unfoldedLevel": 2,
5727
5775
  "style": {
5728
5776
  "max-height": "100%",
5729
5777
  "position": "absolute",
5730
- "left": "-200px",
5731
- "width": "190px",
5778
+ "left": "-330px",
5779
+ "width": "320px",
5732
5780
  "bottom": 0,
5733
- "top": "2px",
5781
+ "top": "0",
5734
5782
  "overflow": "auto",
5735
5783
  "min-height":"300px"
5736
5784
  },
@@ -5749,7 +5797,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
5749
5797
  ctx.idFieldName = refObjectConfig.idFieldName;
5750
5798
  ctx.objectName = refObjectConfig.name;
5751
5799
 
5752
- const tableFields = [];
5800
+ let tableFields = [];
5753
5801
  let i = 0;
5754
5802
  const searchableFields = [];
5755
5803
 
@@ -5794,7 +5842,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
5794
5842
  })){
5795
5843
  i++;
5796
5844
  tableFields.push(field);
5797
- if(field.searchable){
5845
+ if(field.searchable && SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1){
5798
5846
  searchableFields.push(field.name);
5799
5847
  }
5800
5848
  }
@@ -5878,16 +5926,31 @@ async function lookupToAmisPicker(field, readonly, ctx){
5878
5926
  }
5879
5927
  }
5880
5928
 
5881
-
5882
5929
  if(allowSearchFields){
5883
5930
  allowSearchFields.forEach(function(key){
5884
5931
  const keyValue = selfData[key];
5885
- if(keyValue){
5932
+ if(_.isString(keyValue)){
5886
5933
  filters.push([key, "contains", keyValue]);
5934
+ }else if(_.isArray(keyValue) || _.isBoolean(keyValue) || keyValue){
5935
+ filters.push([key, "=", keyValue]);
5887
5936
  }
5888
5937
  })
5889
5938
  }
5890
5939
 
5940
+ if(selfData.__keywords && allowSearchFields){
5941
+ const keywordsFilters = [];
5942
+ allowSearchFields.forEach(function(key, index){
5943
+ const keyValue = selfData.__keywords;
5944
+ if(keyValue){
5945
+ keywordsFilters.push([key, "contains", keyValue]);
5946
+ if(index < allowSearchFields.length - 1){
5947
+ keywordsFilters.push('or');
5948
+ }
5949
+ }
5950
+ })
5951
+ filters.push(keywordsFilters);
5952
+ };
5953
+
5891
5954
  var fieldFilters = ${JSON.stringify(field.filters)};
5892
5955
  if(fieldFilters && fieldFilters.length){
5893
5956
  filters.push(fieldFilters);
@@ -5976,6 +6039,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
5976
6039
  if(refObjectConfig.paging && refObjectConfig.paging.enabled === false){
5977
6040
  top = 1000;
5978
6041
  }
6042
+
5979
6043
  let pickerSchema = null;
5980
6044
  if(ctx.formFactor === 'SMALL'){
5981
6045
  pickerSchema = await getListSchema$1(tableFields, {
@@ -5997,18 +6061,19 @@ async function lookupToAmisPicker(field, readonly, ctx){
5997
6061
  if(referenceTo.objectName === "space_users" && field.reference_to_field === "user" && !isMobile){
5998
6062
  headerToolbarItems = getLookupSapceUserTreeSchema();
5999
6063
  pickerSchema["style"] = {
6000
- "margin-left":"200px",
6064
+ "margin-left":"330px",
6001
6065
  "min-height": "300px"
6002
6066
  };
6003
6067
  pickerSchema.className = pickerSchema.className || "" + " steedos-select-user";
6004
6068
  }
6005
6069
 
6006
- pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, ctx.formFactor, { headerToolbarItems });
6070
+ pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { headerToolbarItems, isLookup: true });
6007
6071
  const isAllowCreate = refObjectConfig.permissions.allowCreate;
6008
6072
  if (isAllowCreate) {
6009
6073
  const new_button = await getSchema$5(refObjectConfig, { appId: ctx.appId, objectName: refObjectConfig.name, formFactor: ctx.formFactor });
6010
6074
  new_button.align = "right";
6011
- pickerSchema.headerToolbar.push(new_button);
6075
+ // 保持快速搜索放在最左侧,新建按钮往里插,而不是push到最后
6076
+ pickerSchema.headerToolbar.splice(pickerSchema.headerToolbar.length - 1, 0, new_button);
6012
6077
  }
6013
6078
  pickerSchema.footerToolbar = refObjectConfig.enable_tree ? [] : getObjectFooterToolbar();
6014
6079
  if (ctx.filterVisible !== false) {
@@ -6725,6 +6790,7 @@ const getAmisFileSchema = (steedosField, readonly)=>{
6725
6790
  return readonly ? getAmisFileReadonlySchema(steedosField) : getAmisFileEditSchema(steedosField);
6726
6791
  };
6727
6792
 
6793
+ const SEARCHABLE_FIELD_TYPES = ["text", "textarea", "autonumber", "url", "email"];
6728
6794
  const OMIT_FIELDS = ['created', 'created_by', 'modified', 'modified_by'];
6729
6795
  // const Lookup = require('./lookup');
6730
6796
 
@@ -7499,6 +7565,7 @@ if (typeof window != 'undefined') {
7499
7565
 
7500
7566
  var index = /*#__PURE__*/Object.freeze({
7501
7567
  __proto__: null,
7568
+ SEARCHABLE_FIELD_TYPES: SEARCHABLE_FIELD_TYPES,
7502
7569
  OMIT_FIELDS: OMIT_FIELDS,
7503
7570
  getBaseFields: getBaseFields,
7504
7571
  getAmisFieldType: getAmisFieldType,
@@ -7698,7 +7765,71 @@ async function getQuickEditSchema(field, options){
7698
7765
  `;
7699
7766
  break;
7700
7767
  }
7701
-
7768
+ quickEditSchema.body[0].visibleOn = "${quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}";
7769
+ quickEditSchema.body.push({
7770
+ "type":"service",
7771
+ "body":[
7772
+ {
7773
+ "type": "tpl",
7774
+ "tpl": i18next.t('frontend_records_no_allowedit'),
7775
+ "visibleOn": "${!quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}"
7776
+ },
7777
+ {
7778
+ "type": "spinner",
7779
+ "showOn": "${quickedit_record_permissions_loading}"
7780
+ }
7781
+ ],
7782
+ "onEvent":{
7783
+ "init":{
7784
+ "actions":[
7785
+ {
7786
+ "actionType": "setValue",
7787
+ "componentId": `service_listview_${options.objectName}`,
7788
+ "args": {
7789
+ "value":{
7790
+ "quickedit_record_permissions_loading": true
7791
+ }
7792
+ }
7793
+ },
7794
+ {
7795
+ "actionType": "ajax",
7796
+ "args": {
7797
+ "api": {
7798
+ "url": "${context.rootUrl}/service/api/@\${objectName}/recordPermissions/${_id}",
7799
+ "method": "get",
7800
+ "headers": {
7801
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
7802
+ },
7803
+ "cache": 30000,
7804
+ "messages": {
7805
+ "failed": "失败了呢。。"
7806
+ }
7807
+ }
7808
+ }
7809
+ },
7810
+ {
7811
+ "actionType": "setValue",
7812
+ "componentId": `service_listview_${options.objectName}`,
7813
+ "args": {
7814
+ "value":{
7815
+ "quickedit_record_permissions_loading": false
7816
+ }
7817
+ }
7818
+ },
7819
+ {
7820
+ "actionType": "setValue",
7821
+ "componentId": `service_listview_${options.objectName}`,
7822
+ "args": {
7823
+ "value":{
7824
+ "quickedit_record_permissions": "${event.data}"
7825
+ }
7826
+ }
7827
+ }
7828
+ ]
7829
+ }
7830
+ }
7831
+
7832
+ });
7702
7833
  } else {
7703
7834
  quickEditSchema = false;
7704
7835
  }
@@ -7731,7 +7862,7 @@ function getFieldWidth(width){
7731
7862
 
7732
7863
  async function getTableColumns(fields, options){
7733
7864
  const columns = [{name: '_index',type: 'text', width: 32, placeholder: ""}];
7734
- const allowEdit = options.permissions?.allowEdit && options.permissions?.modifyAllRecords && !options.isLookup && options.enable_inline_edit != false;
7865
+ const allowEdit = options.permissions?.allowEdit && !options.isLookup && options.enable_inline_edit != false;
7735
7866
 
7736
7867
  for (const field of fields) {
7737
7868
  //增加quickEdit属性,实现快速编辑
@@ -8222,7 +8353,7 @@ async function getTableApi(mainObject, fields, options){
8222
8353
  baseFilters = filter;
8223
8354
  }
8224
8355
  _$1.each(fields,function(field){
8225
- if(field.searchable){
8356
+ if(field.searchable && SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1){
8226
8357
  searchableFields.push(field.name);
8227
8358
  }
8228
8359
  });
@@ -8269,7 +8400,7 @@ async function getTableApi(mainObject, fields, options){
8269
8400
  try{
8270
8401
  // TODO: 不应该直接在这里取localStorage,应该从外面传入
8271
8402
  const listName = api.data.listName;
8272
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
8403
+ const listViewPropsStoreKey = location.pathname + "/crud";
8273
8404
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
8274
8405
  if(localListViewProps){
8275
8406
  localListViewProps = JSON.parse(localListViewProps);
@@ -8470,7 +8601,7 @@ async function getTableApi(mainObject, fields, options){
8470
8601
  try{
8471
8602
  // TODO: 不应该直接在这里取localStorage,应该从外面传入
8472
8603
  const listName = api.body.listName;
8473
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
8604
+ const listViewPropsStoreKey = location.pathname + "/crud";
8474
8605
  /**
8475
8606
  * localListViewProps规范来自crud请求api中api.data.$self参数值的。
8476
8607
  * 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
@@ -9660,7 +9791,7 @@ async function getObjectCRUD(objectSchema, fields, options){
9660
9791
  }
9661
9792
  }
9662
9793
  // console.log(`getObjectHeaderToolbar====2===>`, options.filterVisible)
9663
- bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, options.formFactor, {
9794
+ bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, fields, options.formFactor, {
9664
9795
  showDisplayAs,
9665
9796
  hiddenCount: options.queryCount === false,
9666
9797
  headerToolbarItems: options.headerToolbarItems,
@@ -9785,6 +9916,7 @@ async function getObjectCRUD(objectSchema, fields, options){
9785
9916
  return {
9786
9917
  type: 'service',
9787
9918
  className: '',
9919
+ //目前crud的service层id不认用户自定义id,只支持默认规则id
9788
9920
  id: `service_${id}`,
9789
9921
  name: `page`,
9790
9922
  data: {