@steedos-widgets/amis-object 1.2.37 → 1.2.39-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.
@@ -254,6 +254,16 @@ fieldset.antd-Collapse > legend{
254
254
  height: unset;
255
255
  }
256
256
 
257
+ /* crud中的快速搜索框样式改成与按钮风格统一的边框 */
258
+ .antd-Crud .antd-Crud-toolbar .antd-SearchBox.is-active{
259
+ border-color: var(--button-default-default-top-border-color);
260
+ }
261
+
262
+ /* crud中的快速搜索框图标没对齐 */
263
+ .antd-Crud .antd-Crud-toolbar .antd-SearchBox.is-active svg.icon{
264
+ top: unset
265
+ }
266
+
257
267
  .ant-dropdown-menu {
258
268
  border: 1px solid #e5e5e5;
259
269
  border-radius: 0.25rem;
@@ -412,6 +422,9 @@ fieldset.antd-Collapse > legend{
412
422
  .mr-2 {
413
423
  margin-right: 0.5rem
414
424
  }
425
+ .mr-1 {
426
+ margin-right: 0.25rem
427
+ }
415
428
  .mt-0\.5 {
416
429
  margin-top: 0.125rem
417
430
  }
@@ -427,9 +440,6 @@ fieldset.antd-Collapse > legend{
427
440
  .-ml-px {
428
441
  margin-left: -1px
429
442
  }
430
- .mr-1 {
431
- margin-right: 0.25rem
432
- }
433
443
  .mb-\[-3px\] {
434
444
  margin-bottom: -3px
435
445
  }
@@ -871,6 +881,9 @@ fieldset.antd-Collapse > legend{
871
881
  .leading-5 {
872
882
  line-height: 1.25rem
873
883
  }
884
+ .leading-6 {
885
+ line-height: 1.5rem
886
+ }
874
887
  .leading-3 {
875
888
  line-height: .75rem
876
889
  }
@@ -1167,8 +1180,15 @@ fieldset.antd-Collapse > legend{
1167
1180
  display: none;
1168
1181
  }
1169
1182
  }
1170
- .steedos-select-user > .antd-Form {
1171
- margin-left: -200px;
1183
+ .steedos-select-user .antd-Table {
1184
+ margin-bottom: 0;
1185
+ position: unset;
1186
+ }
1187
+ .steedos-select-user .antd-Table .antd-Table-content {
1188
+ max-height: calc(100vh - 560px);
1189
+ }
1190
+ .steedos-select-user .antd-Table .antd-SearchBox {
1191
+ margin-top: 0;
1172
1192
  }
1173
1193
  @media (max-width: 576px) {
1174
1194
  .antd-Crud-toolbar {
@@ -1407,12 +1427,6 @@ fieldset.antd-Collapse > legend{
1407
1427
  .h-fill {
1408
1428
  height: -webkit-fill-available !important;
1409
1429
  }
1410
- .steedos-global-header-root .sidebar-wrapper .antd-Nav .antd-Nav-Menu-item-label {
1411
- white-space: normal;
1412
- line-height: 1.5;
1413
- padding-top: 6px;
1414
- padding-bottom: 6px;
1415
- }
1416
1430
  .steedos-global-header-root .sidebar-wrapper .antd-Nav .antd-Nav-Menu-item-link {
1417
1431
  min-height: var(--Nav-Item-height);
1418
1432
  height: unset;
@@ -4217,6 +4217,7 @@
4217
4217
  var frontend_objects_related_alert_start$1 = "No related table fields associated with the related list object";
4218
4218
  var frontend_objects_related_alert_end$1 = "were found.";
4219
4219
  var frontend_no_records_found$1 = "No records found.";
4220
+ var frontend_records_no_allowedit$1 = "You do not have edit permission for this record";
4220
4221
  var en_us = {
4221
4222
  frontend_field_group_generalization: frontend_field_group_generalization$1,
4222
4223
  frontend_download: frontend_download$1,
@@ -4299,7 +4300,8 @@
4299
4300
  frontend_message_modification_failed: frontend_message_modification_failed$1,
4300
4301
  frontend_objects_related_alert_start: frontend_objects_related_alert_start$1,
4301
4302
  frontend_objects_related_alert_end: frontend_objects_related_alert_end$1,
4302
- frontend_no_records_found: frontend_no_records_found$1
4303
+ frontend_no_records_found: frontend_no_records_found$1,
4304
+ frontend_records_no_allowedit: frontend_records_no_allowedit$1
4303
4305
  };
4304
4306
 
4305
4307
  var frontend_field_group_generalization = "通用";
@@ -4323,7 +4325,7 @@
4323
4325
  var frontend_display_as = "显示为";
4324
4326
  var frontend_record_sum = "个项目";
4325
4327
  var frontend_button_reload_tooltip = "刷新";
4326
- var frontend_button_search_tooltip = "搜索";
4328
+ var frontend_button_search_tooltip = "查询";
4327
4329
  var frontend_fields_filter_button_search = "搜索";
4328
4330
  var frontend_fields_filter_button_settings = "设置搜索项";
4329
4331
  var frontend_button_listview_control_tooltip = "列表视图控制";
@@ -4385,6 +4387,7 @@
4385
4387
  var frontend_objects_related_alert_start = "未找到与相关列表对象";
4386
4388
  var frontend_objects_related_alert_end = "关联的相关表字段";
4387
4389
  var frontend_no_records_found = "无法找到记录";
4390
+ var frontend_records_no_allowedit = "您对这条记录没有编辑权限";
4388
4391
  var zh_cn = {
4389
4392
  frontend_field_group_generalization: frontend_field_group_generalization,
4390
4393
  frontend_download: frontend_download,
@@ -4468,7 +4471,8 @@
4468
4471
  frontend_message_modification_failed: frontend_message_modification_failed,
4469
4472
  frontend_objects_related_alert_start: frontend_objects_related_alert_start,
4470
4473
  frontend_objects_related_alert_end: frontend_objects_related_alert_end,
4471
- frontend_no_records_found: frontend_no_records_found
4474
+ frontend_no_records_found: frontend_no_records_found,
4475
+ frontend_records_no_allowedit: frontend_records_no_allowedit
4472
4476
  };
4473
4477
 
4474
4478
  const resources = {
@@ -6522,12 +6526,14 @@
6522
6526
  if(!event.data.isLookup){
6523
6527
  // 刷新浏览器后,filterFormValues值是空的,只能从本地存储中取出并重置为空值
6524
6528
  const listName = event.data.listName;
6525
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
6529
+ const listViewPropsStoreKey = location.pathname + "/crud";
6526
6530
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
6527
6531
  if(localListViewProps){
6528
6532
  localListViewProps = JSON.parse(localListViewProps);
6529
6533
  for(var k in localListViewProps){
6530
- removedValues[k] = null;
6534
+ if(k !== "__keywords"){
6535
+ removedValues[k] = null;
6536
+ }
6531
6537
  }
6532
6538
  }
6533
6539
  }
@@ -6549,12 +6555,9 @@
6549
6555
  const objectName = data.objectName;
6550
6556
  const isLookup = data.isLookup;
6551
6557
  const listName = data.listName;
6552
- let searchableFieldsStoreKey = location.pathname + "/searchable_fields/";
6558
+ let searchableFieldsStoreKey = location.pathname + "/searchable_fields";
6553
6559
  if(isLookup){
6554
- searchableFieldsStoreKey += "lookup/" + objectName;
6555
- }
6556
- else{
6557
- searchableFieldsStoreKey += (listName || "");
6560
+ searchableFieldsStoreKey += "/lookup/" + objectName;
6558
6561
  }
6559
6562
  let defaultSearchableFields = sessionStorage.getItem(searchableFieldsStoreKey);
6560
6563
  if(defaultSearchableFields){
@@ -6581,7 +6584,7 @@
6581
6584
  setData({ showFieldsFilter: false });
6582
6585
  }
6583
6586
  else{
6584
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
6587
+ const listViewPropsStoreKey = location.pathname + "/crud";
6585
6588
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
6586
6589
  if(localListViewProps){
6587
6590
  localListViewProps = JSON.parse(localListViewProps);
@@ -6621,12 +6624,9 @@
6621
6624
  return n.props.type === "service";
6622
6625
  });
6623
6626
  filterService.setData({ filterFormSearchableFields: value });
6624
- let searchableFieldsStoreKey = location.pathname + "/searchable_fields/";
6627
+ let searchableFieldsStoreKey = location.pathname + "/searchable_fields";
6625
6628
  if(isLookup){
6626
- searchableFieldsStoreKey += "lookup/" + objectName;
6627
- }
6628
- else{
6629
- searchableFieldsStoreKey += (listName || "");
6629
+ searchableFieldsStoreKey += "/lookup/" + objectName;
6630
6630
  }
6631
6631
  sessionStorage.setItem(searchableFieldsStoreKey, value);
6632
6632
 
@@ -6684,7 +6684,7 @@
6684
6684
  }
6685
6685
 
6686
6686
  // 列表视图crud支持本地缓存,所以需要进一步清除浏览器本地缓存里面用户在可搜索项中移除的字段值
6687
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
6687
+ const listViewPropsStoreKey = location.pathname + "/crud";
6688
6688
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
6689
6689
  if(localListViewProps){
6690
6690
  localListViewProps = JSON.parse(localListViewProps);
@@ -8405,9 +8405,23 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
8405
8405
  `;
8406
8406
 
8407
8407
 
8408
- function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true} = {}){
8408
+ function getObjectHeaderToolbar(mainObject, fields, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true} = {}){
8409
8409
  // console.log(`getObjectHeaderToolbar====>`, filterVisible)
8410
- console.log(`getObjectHeaderToolbar`, mainObject);
8410
+ // console.log(`getObjectHeaderToolbar`, mainObject)
8411
+ const searchableFieldsLabel = [];
8412
+ _.each(fields, function (field) {
8413
+ if (field.searchable) {
8414
+ searchableFieldsLabel.push(field.label);
8415
+ }
8416
+ });
8417
+ const listViewPropsStoreKey = location.pathname + "/crud";
8418
+ let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
8419
+ let crudKeywords = "";
8420
+ if(localListViewProps){
8421
+ localListViewProps = JSON.parse(localListViewProps);
8422
+ crudKeywords = (localListViewProps && localListViewProps.__keywords) || "";
8423
+ }
8424
+
8411
8425
  const isMobile = window.innerWidth < 768;
8412
8426
  if(isMobile){
8413
8427
  showDisplayAs = false;
@@ -8497,21 +8511,9 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
8497
8511
  "type": "tpl",
8498
8512
  "tpl": "${count} " + instance.t('frontend_record_sum')
8499
8513
  },
8500
- {
8501
- "type": "reload",
8502
- "align": "right",
8503
- //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
8504
- // "tooltip": i18next.t('frontend_button_reload_tooltip'),
8505
- "tooltip":"",
8506
- "tooltipPlacement": "top",
8507
- "className": "bg-white p-2 rounded border-gray-300 text-gray-500"
8508
- },
8509
- // getExportExcelToolbarButtonSchema(),
8510
- mainObject?.permissions?.allowCreateListViews ? getSettingListviewToolbarButtonSchema() : {},
8511
- getDisplayAsButton(mainObject?.name),
8512
8514
  filterVisible ? {
8513
8515
  "label": instance.t('frontend_button_search_tooltip'),
8514
- "icon": "fa fa-search",
8516
+ "icon": "fa fa-filter",
8515
8517
  //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
8516
8518
  // "tooltip": i18next.t('frontend_button_search_tooltip'),
8517
8519
  // "tooltipPlacement": "top",
@@ -8537,14 +8539,39 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
8537
8539
  ]
8538
8540
  }
8539
8541
  }
8540
- } : {}
8541
- // {
8542
- // "type": "search-box",
8543
- // "align": "right",
8544
- // "name": "__keywords",
8545
- // "placeholder": "请输入关键字",
8546
- // "mini": true
8547
- // },
8542
+ } : {},
8543
+ {
8544
+ "type": "reload",
8545
+ "align": "right",
8546
+ //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
8547
+ // "tooltip": i18next.t('frontend_button_reload_tooltip'),
8548
+ "tooltip":"",
8549
+ "tooltipPlacement": "top",
8550
+ "className": "bg-white p-2 rounded border-gray-300 text-gray-500"
8551
+ },
8552
+ // getExportExcelToolbarButtonSchema(),
8553
+ mainObject?.permissions?.allowCreateListViews ? getSettingListviewToolbarButtonSchema() : {},
8554
+ getDisplayAsButton(mainObject?.name),
8555
+ {
8556
+ "type": "tooltip-wrapper",
8557
+ "align": "right",
8558
+ "title": "",
8559
+ "content": "可模糊搜索字段:" + searchableFieldsLabel.join(","),
8560
+ "placement": "bottom",
8561
+ "tooltipTheme": "dark",
8562
+ "trigger": "click",
8563
+ "className": "mr-1",
8564
+ "body": [
8565
+ {
8566
+ "type": "search-box",
8567
+ "name": "__keywords",
8568
+ "placeholder": "请输入关键字",
8569
+ "value": crudKeywords,
8570
+ "clearable": true,
8571
+ "clearAndSubmit": true
8572
+ }
8573
+ ]
8574
+ },
8548
8575
  // {
8549
8576
  // "type": "drag-toggler",
8550
8577
  // "align": "right"
@@ -8560,18 +8587,27 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
8560
8587
 
8561
8588
  }
8562
8589
 
8563
- function getObjectFooterToolbar(mainObject, formFactor) {
8590
+ function getObjectFooterToolbar(mainObject, formFactor, options) {
8564
8591
  if (formFactor === 'SMALL') {
8565
8592
  return [
8566
8593
  "load-more",
8567
8594
  ]
8568
8595
  }
8569
8596
  else {
8570
- return [
8571
- "switch-per-page",
8572
- "statistics",
8573
- "pagination"
8574
- ]
8597
+ if(options && options.isRelated){
8598
+ return [
8599
+ "statistics",
8600
+ "pagination"
8601
+ ]
8602
+
8603
+ }
8604
+ else {
8605
+ return [
8606
+ "switch-per-page",
8607
+ "statistics",
8608
+ "pagination"
8609
+ ]
8610
+ }
8575
8611
  }
8576
8612
  }
8577
8613
 
@@ -8879,16 +8915,17 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
8879
8915
  "autoCheckChildren": false,
8880
8916
  "searchable": true,
8881
8917
  "searchConfig": {
8882
- "sticky": true
8918
+ "sticky": true,
8919
+ "placeholder": "查找部门"
8883
8920
  },
8884
8921
  "unfoldedLevel": 2,
8885
8922
  "style": {
8886
8923
  "max-height": "100%",
8887
8924
  "position": "absolute",
8888
- "left": "-200px",
8889
- "width": "190px",
8925
+ "left": "-220px",
8926
+ "width": "210px",
8890
8927
  "bottom": 0,
8891
- "top": "2px",
8928
+ "top": "0",
8892
8929
  "overflow": "auto",
8893
8930
  "min-height":"300px"
8894
8931
  },
@@ -8907,7 +8944,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
8907
8944
  ctx.idFieldName = refObjectConfig.idFieldName;
8908
8945
  ctx.objectName = refObjectConfig.name;
8909
8946
 
8910
- const tableFields = [];
8947
+ let tableFields = [];
8911
8948
  let i = 0;
8912
8949
  const searchableFields = [];
8913
8950
 
@@ -9036,16 +9073,31 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
9036
9073
  }
9037
9074
  }
9038
9075
 
9039
-
9040
9076
  if(allowSearchFields){
9041
9077
  allowSearchFields.forEach(function(key){
9042
9078
  const keyValue = selfData[key];
9043
- if(keyValue){
9079
+ if(_.isString(keyValue)){
9044
9080
  filters.push([key, "contains", keyValue]);
9081
+ }else if(_.isArray(keyValue) || _.isBoolean(keyValue) || keyValue){
9082
+ filters.push([key, "=", keyValue]);
9045
9083
  }
9046
9084
  })
9047
9085
  }
9048
9086
 
9087
+ if(selfData.__keywords && allowSearchFields){
9088
+ const keywordsFilters = [];
9089
+ allowSearchFields.forEach(function(key, index){
9090
+ const keyValue = selfData.__keywords;
9091
+ if(keyValue){
9092
+ keywordsFilters.push([key, "contains", keyValue]);
9093
+ if(index < allowSearchFields.length - 1){
9094
+ keywordsFilters.push('or');
9095
+ }
9096
+ }
9097
+ })
9098
+ filters.push(keywordsFilters);
9099
+ };
9100
+
9049
9101
  var fieldFilters = ${JSON.stringify(field.filters)};
9050
9102
  if(fieldFilters && fieldFilters.length){
9051
9103
  filters.push(fieldFilters);
@@ -9134,6 +9186,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
9134
9186
  if(refObjectConfig.paging && refObjectConfig.paging.enabled === false){
9135
9187
  top = 1000;
9136
9188
  }
9189
+
9137
9190
  let pickerSchema = null;
9138
9191
  if(ctx.formFactor === 'SMALL'){
9139
9192
  pickerSchema = await getListSchema$1(tableFields, {
@@ -9155,7 +9208,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
9155
9208
  if(referenceTo.objectName === "space_users" && field.reference_to_field === "user" && !isMobile){
9156
9209
  headerToolbarItems = getLookupSapceUserTreeSchema();
9157
9210
  pickerSchema["style"] = {
9158
- "margin-left":"200px",
9211
+ "margin-left":"220px",
9159
9212
  "min-height": "300px"
9160
9213
  };
9161
9214
  pickerSchema.className = pickerSchema.className || "" + " steedos-select-user";
@@ -9166,7 +9219,8 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
9166
9219
  if (isAllowCreate) {
9167
9220
  const new_button = await getSchema$5(refObjectConfig, { appId: ctx.appId, objectName: refObjectConfig.name, formFactor: ctx.formFactor });
9168
9221
  new_button.align = "right";
9169
- pickerSchema.headerToolbar.push(new_button);
9222
+ // 保持快速搜索放在最左侧,新建按钮往里插,而不是push到最后
9223
+ pickerSchema.headerToolbar.splice(pickerSchema.headerToolbar.length - 1, 0, new_button);
9170
9224
  }
9171
9225
  pickerSchema.footerToolbar = refObjectConfig.enable_tree ? [] : getObjectFooterToolbar();
9172
9226
  if (ctx.filterVisible !== false) {
@@ -10856,7 +10910,71 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
10856
10910
  `;
10857
10911
  break;
10858
10912
  }
10859
-
10913
+ quickEditSchema.body[0].visibleOn = "${quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}";
10914
+ quickEditSchema.body.push({
10915
+ "type":"service",
10916
+ "body":[
10917
+ {
10918
+ "type": "tpl",
10919
+ "tpl": instance.t('frontend_records_no_allowedit'),
10920
+ "visibleOn": "${!quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}"
10921
+ },
10922
+ {
10923
+ "type": "spinner",
10924
+ "showOn": "${quickedit_record_permissions_loading}"
10925
+ }
10926
+ ],
10927
+ "onEvent":{
10928
+ "init":{
10929
+ "actions":[
10930
+ {
10931
+ "actionType": "setValue",
10932
+ "componentId": `service_listview_${options.objectName}`,
10933
+ "args": {
10934
+ "value":{
10935
+ "quickedit_record_permissions_loading": true
10936
+ }
10937
+ }
10938
+ },
10939
+ {
10940
+ "actionType": "ajax",
10941
+ "args": {
10942
+ "api": {
10943
+ "url": "${context.rootUrl}/service/api/@\${objectName}/recordPermissions/${_id}",
10944
+ "method": "get",
10945
+ "headers": {
10946
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
10947
+ },
10948
+ "cache": 30000,
10949
+ "messages": {
10950
+ "failed": "失败了呢。。"
10951
+ }
10952
+ }
10953
+ }
10954
+ },
10955
+ {
10956
+ "actionType": "setValue",
10957
+ "componentId": `service_listview_${options.objectName}`,
10958
+ "args": {
10959
+ "value":{
10960
+ "quickedit_record_permissions_loading": false
10961
+ }
10962
+ }
10963
+ },
10964
+ {
10965
+ "actionType": "setValue",
10966
+ "componentId": `service_listview_${options.objectName}`,
10967
+ "args": {
10968
+ "value":{
10969
+ "quickedit_record_permissions": "${event.data}"
10970
+ }
10971
+ }
10972
+ }
10973
+ ]
10974
+ }
10975
+ }
10976
+
10977
+ });
10860
10978
  } else {
10861
10979
  quickEditSchema = false;
10862
10980
  }
@@ -10889,7 +11007,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
10889
11007
 
10890
11008
  async function getTableColumns$1(fields, options){
10891
11009
  const columns = [{name: '_index',type: 'text', width: 32, placeholder: ""}];
10892
- const allowEdit = options.permissions?.allowEdit && options.permissions?.modifyAllRecords && !options.isLookup && options.enable_inline_edit != false;
11010
+ const allowEdit = options.permissions?.allowEdit && !options.isLookup && options.enable_inline_edit != false;
10893
11011
 
10894
11012
  for (const field of fields) {
10895
11013
  //增加quickEdit属性,实现快速编辑
@@ -11427,7 +11545,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
11427
11545
  try{
11428
11546
  // TODO: 不应该直接在这里取localStorage,应该从外面传入
11429
11547
  const listName = api.data.listName;
11430
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
11548
+ const listViewPropsStoreKey = location.pathname + "/crud";
11431
11549
  let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
11432
11550
  if(localListViewProps){
11433
11551
  localListViewProps = JSON.parse(localListViewProps);
@@ -11628,7 +11746,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
11628
11746
  try{
11629
11747
  // TODO: 不应该直接在这里取localStorage,应该从外面传入
11630
11748
  const listName = api.body.listName;
11631
- const listViewPropsStoreKey = location.pathname + "/crud/" + (listName || "");
11749
+ const listViewPropsStoreKey = location.pathname + "/crud";
11632
11750
  /**
11633
11751
  * localListViewProps规范来自crud请求api中api.data.$self参数值的。
11634
11752
  * 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
@@ -12793,6 +12911,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
12793
12911
  // headerToolbar: getObjectHeaderToolbar(objectSchema, options.formFactor, {showDisplayAs}),
12794
12912
  headerToolbarClassName: "px-4 py-2 border-gray-300 bg-gray-100 border-solid border-b",
12795
12913
  footerToolbar: getObjectFooterToolbar(objectSchema, options.formFactor, {
12914
+ ...options,
12796
12915
  disableStatistics: options.queryCount === false
12797
12916
  }),
12798
12917
  filter: options.filterVisible !== false && await getObjectFilter(objectSchema, fields, options),
@@ -12817,7 +12936,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
12817
12936
  }
12818
12937
  }
12819
12938
  // console.log(`getObjectHeaderToolbar====2===>`, options.filterVisible)
12820
- bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, options.formFactor, {
12939
+ bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, fields, options.formFactor, {
12821
12940
  showDisplayAs,
12822
12941
  hiddenCount: options.queryCount === false,
12823
12942
  headerToolbarItems: options.headerToolbarItems,
@@ -12942,6 +13061,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
12942
13061
  return {
12943
13062
  type: 'service',
12944
13063
  className: '',
13064
+ //目前crud的service层id不认用户自定义id,只支持默认规则id
12945
13065
  id: `service_${id}`,
12946
13066
  name: `page`,
12947
13067
  data: {
@@ -18530,7 +18650,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
18530
18650
  if (links) {
18531
18651
  return [2 /*return*/, {
18532
18652
  "type": "nav",
18533
- className: "".concat(className),
18653
+ className: "".concat(className, " text-black"),
18534
18654
  "stacked": stacked,
18535
18655
  "overflow": overflow,
18536
18656
  "indentSize": indentSize,
@@ -18542,7 +18662,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
18542
18662
  schemaApi: {
18543
18663
  "method": "get",
18544
18664
  "url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
18545
- "adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"\";\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": _.find(tab_groups, {\"group_name\": groupName})?.default_open != false,\n \"children\": _.map(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n });\n })\n }\n\n payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav\n },\n \"id\": \"appMenuService\",\n \"body\":{\n \"type\": \"nav\",\n className: \"").concat(className, "\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n }\n ]\n }\n }\n }\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n return payload;\n "),
18665
+ "adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"\";\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": _.find(tab_groups, {\"group_name\": groupName})?.default_open != false,\n \"children\": _.map(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n });\n })\n }\n\n payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav\n },\n \"id\": \"appMenuService\",\n \"body\":{\n \"type\": \"nav\",\n className: \"").concat(className, " text-black\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n }\n ]\n }\n }\n }\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n return payload;\n "),
18546
18666
  "headers": {
18547
18667
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
18548
18668
  }