@steedos-widgets/amis-lib 6.10.1-beta.35 → 6.10.1-beta.37

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
@@ -1573,6 +1573,7 @@ var frontend_objects_related_alert_start$1 = "No related table fields associated
1573
1573
  var frontend_objects_related_alert_end$1 = "were found.";
1574
1574
  var frontend_no_records_found$1 = "No records found.";
1575
1575
  var frontend_records_no_allowedit$1 = "You do not have edit permission for this record";
1576
+ var frontend_app_menu_save_order_group_nesting_error$1 = "Group nesting is not supported";
1576
1577
  var en_us = {
1577
1578
  frontend_field_group_generalization: frontend_field_group_generalization$1,
1578
1579
  frontend_download: frontend_download$1,
@@ -1663,7 +1664,8 @@ var en_us = {
1663
1664
  frontend_objects_related_alert_start: frontend_objects_related_alert_start$1,
1664
1665
  frontend_objects_related_alert_end: frontend_objects_related_alert_end$1,
1665
1666
  frontend_no_records_found: frontend_no_records_found$1,
1666
- frontend_records_no_allowedit: frontend_records_no_allowedit$1
1667
+ frontend_records_no_allowedit: frontend_records_no_allowedit$1,
1668
+ frontend_app_menu_save_order_group_nesting_error: frontend_app_menu_save_order_group_nesting_error$1
1667
1669
  };
1668
1670
 
1669
1671
  var frontend_field_group_generalization = "通用";
@@ -1757,6 +1759,7 @@ var frontend_objects_related_alert_start = "未找到与相关列表对象";
1757
1759
  var frontend_objects_related_alert_end = "关联的相关表字段";
1758
1760
  var frontend_no_records_found = "无法找到记录";
1759
1761
  var frontend_records_no_allowedit = "您对这条记录没有编辑权限";
1762
+ var frontend_app_menu_save_order_group_nesting_error = "不支持分组嵌套";
1760
1763
  var zh_cn = {
1761
1764
  frontend_field_group_generalization: frontend_field_group_generalization,
1762
1765
  frontend_download: frontend_download,
@@ -1848,7 +1851,8 @@ var zh_cn = {
1848
1851
  frontend_objects_related_alert_start: frontend_objects_related_alert_start,
1849
1852
  frontend_objects_related_alert_end: frontend_objects_related_alert_end,
1850
1853
  frontend_no_records_found: frontend_no_records_found,
1851
- frontend_records_no_allowedit: frontend_records_no_allowedit
1854
+ frontend_records_no_allowedit: frontend_records_no_allowedit,
1855
+ frontend_app_menu_save_order_group_nesting_error: frontend_app_menu_save_order_group_nesting_error
1852
1856
  };
1853
1857
 
1854
1858
  const resources = {
@@ -3160,7 +3164,7 @@ async function getTableApi(mainObject, fields, options){
3160
3164
  let valueField = mainObject.key_field || '_id';
3161
3165
  const api = await getApi$1(mainObject, null, fields, {count: options.queryCount, alias: 'rows', limit: top, queryOptions: `filters: {__filters}, top: {__top}, skip: {__skip}, sort: "{__sort}"`});
3162
3166
 
3163
- api.url;//设计器上对象表格组件需要切换对象重新请求列表数据
3167
+ // api.url;//设计器上对象表格组件需要切换对象重新请求列表数据
3164
3168
  // if(options.isRelated){
3165
3169
  // api.url += "&recordId=${_master.recordId}";
3166
3170
  // }
@@ -4917,7 +4921,7 @@ const parseSingleExpression = function (func, formData, dataPath, global, userSe
4917
4921
  * @Author: baozhoutao@steedos.com
4918
4922
  * @Date: 2022-11-01 15:51:00
4919
4923
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
4920
- * @LastEditTime: 2025-07-14 11:56:42
4924
+ * @LastEditTime: 2025-07-22 14:29:15
4921
4925
  * @Description:
4922
4926
  */
4923
4927
 
@@ -4991,7 +4995,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
4991
4995
  }
4992
4996
  const uiSchema = event.data.uiSchema;
4993
4997
  const objectName = event.data.objectName;
4994
- const listViewRef = event.context.scoped.getComponentById("listview_" + objectName);
4998
+ const crudId = event.data.crudId || "listview_" + objectName;
4999
+ const listViewRef = event.context.scoped.getComponentById(crudId);
4995
5000
  const selectedItems = listViewRef && listViewRef.props.store.toJSON().selectedItems || [];
4996
5001
  event.data.selectedIds = _.map(selectedItems, uiSchema.idFieldName || '_id');
4997
5002
  `;
@@ -5536,8 +5541,8 @@ const getSchema = async (uiSchema, ctx) => {
5536
5541
  /*
5537
5542
  * @Author: baozhoutao@steedos.com
5538
5543
  * @Date: 2022-11-01 15:53:07
5539
- * @LastEditors: baozhoutao@steedos.com
5540
- * @LastEditTime: 2023-02-28 17:06:22
5544
+ * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
5545
+ * @LastEditTime: 2025-07-22 14:12:01
5541
5546
  * @Description:
5542
5547
  */
5543
5548
 
@@ -5567,10 +5572,12 @@ const StandardButtons = {
5567
5572
  const {
5568
5573
  appId,
5569
5574
  objectName,
5570
- uiSchema
5575
+ uiSchema,
5576
+ record
5571
5577
  } = this;
5578
+ const crudId = record?.crudId || `listview_${uiSchema.name}`;
5572
5579
  const scope = this.scope;
5573
- const listViewRef = scope.parent?.getComponentById(`listview_${uiSchema.name}`);
5580
+ const listViewRef = scope.parent?.getComponentById(crudId);
5574
5581
  if(_.isEmpty(listViewRef.props.store.toJSON().selectedItems)){
5575
5582
  listViewRef.handleAction({}, {
5576
5583
  "actionType": "toast",
@@ -6198,19 +6205,11 @@ async function getObjectFieldsFilterFormSchema(ctx) {
6198
6205
  },
6199
6206
  "schemaApi": {
6200
6207
  method: 'post',
6201
- url: `\${context.rootUrl}/graphql?reload=\${filterFormSearchableFields|join}`,
6202
6208
  data: {
6203
6209
  $self: "$$",
6204
- query: "{\n data: objects(filters: [[\"_id\",\"=\",null]],top: 1, skip: 0){_id}\n }"
6210
+ query: ""
6205
6211
  },
6206
- requestAdaptor: `
6207
- return {
6208
- ...api,
6209
- data: {
6210
- query: api.data.query
6211
- }
6212
- };
6213
- `,
6212
+ url: `/api/amis/health_check?reload=\${filterFormSearchableFields|join}`,
6214
6213
  adaptor: `
6215
6214
  if(payload.errors){
6216
6215
  payload.status = 2;
@@ -9248,7 +9247,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
9248
9247
  //TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
9249
9248
  // "tooltip": i18next.t('frontend_button_reload_tooltip'),
9250
9249
  "tooltipPlacement": "top",
9251
- "className": "bg-white p-2 rounded text-gray-500",
9250
+ "className": "bg-white p-2 rounded text-gray-500 list-view-btn-reload",
9252
9251
  "label": "",
9253
9252
  "icon": "fa fa-sync",
9254
9253
  // "visibleOn": "${!showFieldsFilter}",
@@ -12769,11 +12768,8 @@ async function lookupToAmisSelect(field, readonly, ctx){
12769
12768
  }else {
12770
12769
  apiInfo = {
12771
12770
  method: "post",
12772
- url: getApi$2(),
12773
- data: {query: '{objects(filters: ["_id", "=", "-1"]){_id}}', $: "$$"},
12774
- "headers": {
12775
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
12776
- }
12771
+ data: {$: "$$", query: ""},
12772
+ url: "/api/amis/health_check?reload=\${additionalFilters|join}&listName=\${listName}"
12777
12773
  };
12778
12774
  }
12779
12775
 
@@ -14219,9 +14215,9 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
14219
14215
  // if(ctx.mode === 'edit'){
14220
14216
  let convertDataResult;
14221
14217
  if(convertData.type == "steedos-field"){
14222
- // 如果是steedos-field,不能把amis属性合并到steedos-field根属性中,要合并也是合并到steedos-field的config.amis中
14223
- // 而steedos-field字段的amis属性本身就在config.amis中了,所以这里不需要再合并field.amis
14224
- // 目前测试到受影响的是,把字段的amis属性配置为{"type": "checkboxes"}时,ObjectForm只读模式下,lookup字段返回的是type为steedos-field的组件,此时field.amis中的type不应该合并到steedos-field根属性中
14218
+ // 如果是steedos-field,不能把field.amis属性合并到steedos-field根属性中,要合并也是合并到steedos-field的config.amis中
14219
+ // 而steedos-field字段的config属性中的amis属性已经有了这里的field.amis,所以这里不需要再合并field.amis
14220
+ // 目前测试到受影响的是,把字段的amis属性配置为{"type": "checkboxes"}时,ObjectForm只读模式下,lookup字段返回的是type为steedos-field的组件,此时如果在这里合并field.amis,那么其type就变成了checkboxes,导致lookup字段显示为复选框
14225
14221
  convertDataResult = Object.assign({}, baseData, convertData, { labelClassName: 'text-left', clearValueOnHidden: true, fieldName: field.name}, {name: baseData.name});
14226
14222
  }
14227
14223
  else {
@@ -17056,7 +17052,7 @@ const getNextStepUsersInput = async (instance) => {
17056
17052
  "messages": {
17057
17053
  },
17058
17054
  "requestAdaptor": "\nconst { context, next_step, $scopeId } = api.data;\nconst formValues = SteedosUI.getRef($scopeId).getComponentById(\"instance_form\").getValues();\n\napi.data = {\n instanceId: context._id,\n nextStepId: next_step._id,\n values: formValues\n}\n\n\n return api;",
17059
- "adaptor": "debugger;\npayload.data = {value: payload.nextStepUsers.length === 1 ? payload.nextStepUsers[0].id : null, options: payload.nextStepUsers};\nreturn payload;",
17055
+ "adaptor": "\npayload.data = {value: payload.nextStepUsers.length === 1 ? payload.nextStepUsers[0].id : null, options: payload.nextStepUsers};\nreturn payload;",
17060
17056
  "data": {
17061
17057
  "&": "$$",
17062
17058
  "$scopeId": "$scopeId",
@@ -17249,10 +17245,10 @@ const getApprovalDrawerSchema = async (instance) => {
17249
17245
  console.log("=============getApprovalDrawerSchema=============", instance);
17250
17246
  return {
17251
17247
  type: "drawer",
17252
- overlay: true,
17248
+ overlay: false,
17253
17249
  resizable: false,
17254
17250
  closeOnEsc: true,
17255
- closeOnOutside: true,
17251
+ closeOnOutside: false,
17256
17252
  size: "sm",
17257
17253
  title: `${instance.step.name}`,
17258
17254
  className: "approval-drawer absolute",
@@ -17948,18 +17944,37 @@ const getFieldEditTpl = async (field, label)=>{
17948
17944
  tpl.type = "input-rich-text";
17949
17945
  }
17950
17946
  break;
17947
+ // case "table":
17948
+ // tpl.type = "input-table"; //TODO
17949
+ // tpl.addable = field.permission === "editable";
17950
+ // tpl.editable = tpl.addable;
17951
+ // tpl.copyable = tpl.addable;
17952
+ // tpl.removable = tpl.addable;
17953
+ // tpl.columns = [];
17954
+ // for (const sField of field.fields) {
17955
+ // if (sField.type != "hidden") {
17956
+ // sField.permission = field.permission
17957
+ // const column = await getTdInputTpl(sField, true);
17958
+ // tpl.columns.push(column);
17959
+ // }
17960
+ // }
17961
+ // break;
17951
17962
  case "table":
17952
- tpl.type = "input-table"; //TODO
17963
+ tpl.type = "steedos-input-table"; //TODO
17953
17964
  tpl.addable = field.permission === "editable";
17954
17965
  tpl.editable = tpl.addable;
17955
17966
  tpl.copyable = tpl.addable;
17956
17967
  tpl.removable = tpl.addable;
17957
- tpl.columns = [];
17968
+ tpl.fields = [];
17958
17969
  for (const sField of field.fields) {
17959
17970
  if (sField.type != "hidden") {
17960
17971
  sField.permission = field.permission;
17961
17972
  const column = await getTdInputTpl(sField, true);
17962
- tpl.columns.push(column);
17973
+ if(column.type === 'steedos-field'){
17974
+ tpl.fields.push(column.config);
17975
+ }else {
17976
+ tpl.fields.push(column);
17977
+ }
17963
17978
  }
17964
17979
  }
17965
17980
  break;
@@ -17968,7 +17983,7 @@ const getFieldEditTpl = async (field, label)=>{
17968
17983
  break;
17969
17984
  default:
17970
17985
  tpl.type = 'steedos-field';
17971
- tpl.config = field.steedos_field;
17986
+ tpl.config = field.steedos_field || field.config;
17972
17987
  break;
17973
17988
  }
17974
17989
  }
@@ -18312,7 +18327,7 @@ const getFlowFormSchema = async (instance, box) => {
18312
18327
  type: "page",
18313
18328
  name: "instancePage",
18314
18329
  className: "steedos-amis-instance-view",
18315
- bodyClassName: "overflow-y-auto h-full",
18330
+ bodyClassName: "overflow-y-auto h-full steedos-amis-instance-view-body",
18316
18331
  headerClassName: "p-0",
18317
18332
  "title": {
18318
18333
  "type": "steedos-record-detail-header",
@@ -18324,6 +18339,9 @@ const getFlowFormSchema = async (instance, box) => {
18324
18339
  "className": "p-0 m-0 p0 m0 bg-gray-50"
18325
18340
  },
18326
18341
  "css": {
18342
+ ".steedos-amis-instance-view-body": {
18343
+ "height": "calc(100% - 65px)"
18344
+ },
18327
18345
  ".instance-approve-history .antd-Table-table thead": {
18328
18346
  "display": "none"
18329
18347
  },
@@ -18345,6 +18363,9 @@ const getFlowFormSchema = async (instance, box) => {
18345
18363
  ".antd-List-placeholder": {
18346
18364
  "display": "none"
18347
18365
  },
18366
+ ".steedos-amis-instance-view .antd-Table-fixedTop":{
18367
+ "top": "-13px"
18368
+ },
18348
18369
  ".steedos-amis-instance-view .antd-Table-fixedTop:after":{
18349
18370
  "box-shadow": "none"
18350
18371
  },