@steedos-widgets/amis-object 3.6.0-beta.3 → 3.6.0-beta.5

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.
@@ -645,7 +645,6 @@ export declare const AmisInstanceDetail: (props: any) => Promise<{
645
645
  requestAdaptor: string;
646
646
  adaptor: string;
647
647
  data: {
648
- context: string;
649
648
  judge: string;
650
649
  };
651
650
  };
@@ -1,7 +1,9 @@
1
1
  :root {
2
2
  --body-bg: #f9fafb;
3
3
  --Page-main-bg: transparent;
4
+ --Form-mode-default-labelGap: 2px;
4
5
  --Form-item-fontSize: 12px;
6
+ --Form-item-fontColor: rgb(68, 68, 68);
5
7
  --Form-fontSize: 14px;
6
8
  --Form-selectValue-fontSize: 14px;
7
9
  --Form-item-gap: 0.75rem;
@@ -252,6 +254,7 @@ fieldset.antd-Collapse > legend.antd-Collapse-header > .antd-Collapse-arrow:befo
252
254
  /* TODO: amis3.2.0 fieldset.antd-Collapse > legend类中多了background属性,影响分组样式 */
253
255
  fieldset.antd-Collapse > legend{
254
256
  height: unset;
257
+ width: unset;
255
258
  }
256
259
 
257
260
  /* crud中的快速搜索框样式改成与按钮风格统一的边框 */
@@ -476,9 +479,6 @@ fieldset.antd-Collapse > legend{
476
479
  .m-0 {
477
480
  margin: 0px
478
481
  }
479
- .m-1 {
480
- margin: 0.25rem
481
- }
482
482
  .m-2 {
483
483
  margin: 0.5rem
484
484
  }
@@ -1159,13 +1159,6 @@ fieldset.antd-Collapse > legend{
1159
1159
  .sm\:p-3 {
1160
1160
  padding: 0.75rem
1161
1161
  }
1162
- .sm\:px-3 {
1163
- padding-left: 0.75rem;
1164
- padding-right: 0.75rem
1165
- }
1166
- .sm\:pt-3 {
1167
- padding-top: 0.75rem
1168
- }
1169
1162
  .sm\:shadow {
1170
1163
  --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
1171
1164
  --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);
@@ -1558,6 +1551,9 @@ fieldset.antd-Collapse > legend{
1558
1551
  overflow: hidden;
1559
1552
  text-overflow: ellipsis;
1560
1553
  }
1554
+ .antd-Crud .antd-Table tbody td > .antd-Form-static {
1555
+ display: inline;
1556
+ }
1561
1557
 
1562
1558
 
1563
1559
  .steedos-dropdown-button-overlay .ant-dropdown-menu-item {
@@ -1639,7 +1635,7 @@ body.steedos {
1639
1635
  .steedos-amis-form .antd-Form--normal .antd-Tabs .antd-Tabs-content .antd-Tabs-pane .form-content {
1640
1636
  display: grid;
1641
1637
  grid-template-columns: repeat(2, minmax(0, 1fr));
1642
- row-gap: 0rem;
1638
+ row-gap: 0.75rem;
1643
1639
  -moz-column-gap: 1rem;
1644
1640
  column-gap: 1rem;
1645
1641
  }
@@ -1696,6 +1692,11 @@ body.steedos {
1696
1692
  .steedos-object-form .steedos-input-rich-text-readonly .antd-RichTextControl {
1697
1693
  border: 0;
1698
1694
  }
1695
+ @media (max-width: 767px) {
1696
+ .steedos-object-form .antd-Form-item .antd-Form-label + .antd-Form-item-controlBox {
1697
+ max-width: unset;
1698
+ }
1699
+ }
1699
1700
 
1700
1701
  @media (max-width: 767px) {
1701
1702
  .steedos-amis-form.antd-Form {
@@ -1896,9 +1897,6 @@ body.steedos {
1896
1897
  .steedos-object-table colgroup col:nth-last-child(2) {
1897
1898
  display: none;
1898
1899
  }
1899
- .steedos-object-table tbody td.antd-Field--quickEditable > .antd-Form-static {
1900
- display: inline;
1901
- }
1902
1900
  .steedos-object-table tbody td.antd-Field--quickEditable .antd-Field-quickEditBtn {
1903
1901
  padding-right: 13px;
1904
1902
  }
@@ -3563,8 +3563,8 @@ const Router$1 = {
3563
3563
  /*
3564
3564
  * @Author: baozhoutao@steedos.com
3565
3565
  * @Date: 2022-07-20 16:29:22
3566
- * @LastEditors: liaodaxue
3567
- * @LastEditTime: 2023-09-11 17:19:53
3566
+ * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
3567
+ * @LastEditTime: 2023-12-28 14:59:08
3568
3568
  * @Description:
3569
3569
  */
3570
3570
 
@@ -3621,6 +3621,21 @@ function getLookupListView(refObjectConfig) {
3621
3621
  return listView;
3622
3622
  }
3623
3623
 
3624
+
3625
+ /**
3626
+ * 获取可比较的amis版本号
3627
+ * @returns 只返回前两位版本,第三位忽略,比如3.6.3返回3.6
3628
+ */
3629
+ function getComparableAmisVersion() {
3630
+ let amis = (window.amisRequire && window.amisRequire('amis')) || window.Amis;
3631
+ let amisVersion = amis && amis.version;
3632
+ if(amisVersion){
3633
+ let comparableVersions = amisVersion.split(".");
3634
+ let comparableVersion = parseFloat(comparableVersions[0].toString() + "." + comparableVersions[1].toString());
3635
+ return comparableVersion;
3636
+ }
3637
+ }
3638
+
3624
3639
  /*
3625
3640
  * @Author: baozhoutao@steedos.com
3626
3641
  * @Date: 2022-05-23 09:53:08
@@ -3711,7 +3726,7 @@ function getNameTpl(field, ctx){
3711
3726
  if(ctx && ctx.isLookup){
3712
3727
  linkTarget = "target='_blank'";
3713
3728
  }
3714
- return `<a href="${href}" ${linkTarget}>\${${field.name}}</a>`
3729
+ return `<a href="${href}" ${linkTarget}>\${${field.name} | raw}</a>`
3715
3730
  }
3716
3731
 
3717
3732
  function getRelatedFieldTpl(field, ctx){
@@ -4268,7 +4283,7 @@ function getAmisStaticFieldType$1(type, readonly, options){
4268
4283
  * @Author: baozhoutao@steedos.com
4269
4284
  * @Date: 2022-10-28 14:15:09
4270
4285
  * @LastEditors: liaodaxue
4271
- * @LastEditTime: 2023-10-30 17:51:54
4286
+ * @LastEditTime: 2023-12-29 10:46:50
4272
4287
  * @Description:
4273
4288
  */
4274
4289
 
@@ -4322,7 +4337,8 @@ const getAmisFileEditSchema = (steedosField)=>{
4322
4337
  dataType: "form-data",
4323
4338
  url: `\${context.rootUrl}/s3/${tableName}`,
4324
4339
  requestAdaptor: `
4325
- const { _master, global,context } = api.body;
4340
+ const superData = (typeof context != 'undefined') ? context : api.body;
4341
+ const { _master, global } = superData;
4326
4342
  // const { recordId, objectName } = _master;
4327
4343
  const { spaceId, userId, user } = global;
4328
4344
  /*
@@ -4340,8 +4356,9 @@ const getAmisFileEditSchema = (steedosField)=>{
4340
4356
  return api;
4341
4357
  `,
4342
4358
  adaptor: `
4343
- const { context } = api.body;
4344
- var rootUrl = context.rootUrl + "/api/files/${tableName}/";
4359
+ const superData = (typeof context != 'undefined') ? context : api.body;
4360
+ const { context:pageContext } = superData;
4361
+ var rootUrl = pageContext.rootUrl + "/api/files/${tableName}/";
4345
4362
  payload = {
4346
4363
  status: response.status == 200 ? 0 : response.status,
4347
4364
  msg: response.statusText,
@@ -4945,8 +4962,9 @@ async function getQuickEditSchema(field, options){
4945
4962
  case "avatar":
4946
4963
  case "image":
4947
4964
  quickEditSchema.body[0].receiver.adaptor = `
4948
- const { context } = api.body;
4949
- var rootUrl = context.rootUrl + "/api/files/${field.type}s/";
4965
+ const superData = (typeof context != 'undefined') ? context : api.body;
4966
+ const { context:pageContext } = superData;
4967
+ var rootUrl = pageContext.rootUrl + "/api/files/${field.type}s/";
4950
4968
  payload = {
4951
4969
  status: response.status == 200 ? 0 : response.status,
4952
4970
  msg: response.statusText,
@@ -5349,8 +5367,8 @@ async function getTableColumns$1(fields, options){
5349
5367
  const href = Router$1.getObjectDetailPath({
5350
5368
  ...options, formFactor: options.formFactor, appId: "${appId}", objectName: options.objectName || "${objectName}", recordId: `\${${options.idFieldName}}`
5351
5369
  });
5352
- columns[1].type = "tpl";
5353
- columns[1].tpl = `<a href="${href}">\${${columns[1].name}}</a>`;
5370
+ columns[0].type = "tpl";
5371
+ columns[0].tpl = `<a href="${href}">\${${columns[0].name}}</a>`;
5354
5372
  }
5355
5373
  return columns;
5356
5374
  }
@@ -5609,7 +5627,7 @@ async function getTableOperation(ctx){
5609
5627
  type: 'steedos-object-button',
5610
5628
  name: button.name,
5611
5629
  objectName: button.objectName,
5612
- visibleOn: getButtonVisibleOn$1(button),
5630
+ visibleOnAlias: getButtonVisibleOn$1(button),
5613
5631
  className: 'antd-Button--default'
5614
5632
  });
5615
5633
  });
@@ -5734,7 +5752,8 @@ async function getTableSchema$1(fields, options){
5734
5752
  }
5735
5753
 
5736
5754
  if(!isLookup && !hiddenColumnOperation){
5737
- columns.push(await getTableOperation(options));
5755
+ const toolbarOperation = await getTableOperation(options);
5756
+ columns.push(toolbarOperation);
5738
5757
  }
5739
5758
 
5740
5759
  }
@@ -8946,6 +8965,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
8946
8965
  `;
8947
8966
  const onCancelScript = `
8948
8967
  // console.log("===onCancelScript=form==");
8968
+ let isLookup = event.data.isLookup;
8969
+ let __lookupField = event.data.__lookupField;
8949
8970
  const scope = event.context.scoped;
8950
8971
  var filterForm = scope.parent.parent.getComponents().find(function(n){
8951
8972
  return n.props.type === "form";
@@ -8993,7 +9014,20 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
8993
9014
  // });
8994
9015
 
8995
9016
  // 清除__changedFilterFormValues中的值
8996
- crud && crud.setData({__changedFilterFormValues: {}});
9017
+ // crud && crud.setData({__changedFilterFormValues: {}});
9018
+ let __changedFilterFormValuesKey = "__changedFilterFormValues";
9019
+ if(isLookup && __lookupField){
9020
+ let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
9021
+ if(__lookupField.reference_to_field){
9022
+ lookupTag += "__" + __lookupField.reference_to_field;
9023
+ }
9024
+ __changedFilterFormValuesKey += lookupTag;
9025
+ }
9026
+ if(crud){
9027
+ let crudData = crud.getData();
9028
+ crudData[__changedFilterFormValuesKey] = {};
9029
+ crud.setData(crudData);
9030
+ }
8997
9031
  filterForm.handleFormSubmit(event);
8998
9032
  // crud.handleFilterSubmit(removedValues);
8999
9033
 
@@ -10921,7 +10955,12 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
10921
10955
  __changedSearchBoxValues["${keywordsSearchBoxName}"] = event.data["${keywordsSearchBoxName}"];
10922
10956
  // crudService && crudService.setData({__changedSearchBoxValues: __changedSearchBoxValues});
10923
10957
  // 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
10924
- crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
10958
+ // crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
10959
+ if(crud){
10960
+ let crudData = crud.getData();
10961
+ crudData.__changedSearchBoxValues = __changedSearchBoxValues;
10962
+ crud.setData(crudData);
10963
+ }
10925
10964
  `;
10926
10965
 
10927
10966
  // onSearchScript中加上了onChangeScript中的脚本,是因为amis 3.2不能用change事件执行onChangeScript
@@ -10934,9 +10973,19 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
10934
10973
  // const scope = event.context.scoped;
10935
10974
  // 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
10936
10975
  // 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
10976
+ let isLookup = event.data.isLookup;
10977
+ let __lookupField = event.data.__lookupField;
10978
+ let __changedFilterFormValuesKey = "__changedFilterFormValues";
10979
+ if(isLookup && __lookupField){
10980
+ let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
10981
+ if(__lookupField.reference_to_field){
10982
+ lookupTag += "__" + __lookupField.reference_to_field;
10983
+ }
10984
+ __changedFilterFormValuesKey += lookupTag;
10985
+ }
10937
10986
  let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
10938
10987
  setTimeout(function(){
10939
- filterForm.setValues(event.data.__changedFilterFormValues);
10988
+ filterForm.setValues(event.data[__changedFilterFormValuesKey]);
10940
10989
  }, 500);
10941
10990
  `;
10942
10991
 
@@ -10957,8 +11006,8 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
10957
11006
  "name": keywordsSearchBoxName,
10958
11007
  "placeholder": "搜索此列表",
10959
11008
  "value": crudKeywords,
10960
- "clearable": true,
10961
- // "clearAndSubmit": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
11009
+ // "clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
11010
+ "clearAndSubmit": true,
10962
11011
  "searchImediately": false,
10963
11012
  "onEvent": {
10964
11013
  "search": {
@@ -11238,6 +11287,9 @@ async function getObjectFilter(objectSchema, fields, options) {
11238
11287
  crudService && crudService.setData({isFieldsFilterEmpty});
11239
11288
  `;
11240
11289
  let onChangeScript = `
11290
+ let isLookup = event.data.isLookup;
11291
+ let __lookupField = event.data.__lookupField;
11292
+ console.log("==onChangeScript=isLookup===", isLookup);
11241
11293
  const scope = event.context.scoped;
11242
11294
  // let filterFormValues = event.data;
11243
11295
  let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
@@ -11249,7 +11301,20 @@ async function getObjectFilter(objectSchema, fields, options) {
11249
11301
  // let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
11250
11302
  // crudService && crudService.setData({__changedFilterFormValues: changedFilterFormValues});
11251
11303
  // 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
11252
- crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
11304
+ // crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
11305
+ let __changedFilterFormValuesKey = "__changedFilterFormValues";
11306
+ if(isLookup && __lookupField){
11307
+ let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
11308
+ if(__lookupField.reference_to_field){
11309
+ lookupTag += "__" + __lookupField.reference_to_field;
11310
+ }
11311
+ __changedFilterFormValuesKey += lookupTag;
11312
+ }
11313
+ if(crud){
11314
+ let crudData = crud.getData();
11315
+ crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
11316
+ crud.setData(crudData);
11317
+ }
11253
11318
  `;
11254
11319
  return {
11255
11320
  "title": "",
@@ -13647,13 +13712,24 @@ async function lookupToAmisPicker(field, readonly, ctx){
13647
13712
  let keywordsSearchBoxName = `__keywords_lookup__${field.name.replace(/\./g, "_")}__to__${refObjectConfig.name}`;
13648
13713
 
13649
13714
  source.requestAdaptor = `
13650
- let __changedFilterFormValues = api.data.$self.__changedFilterFormValues || {};
13715
+ let __changedFilterFormValuesKey = "__changedFilterFormValues";
13716
+ let __lookupField = api.data.$self.__lookupField;
13717
+ if(__lookupField){
13718
+ let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
13719
+ if(__lookupField.reference_to_field){
13720
+ lookupTag += "__" + __lookupField.reference_to_field;
13721
+ }
13722
+ __changedFilterFormValuesKey += lookupTag;
13723
+ }
13724
+ let __changedFilterFormValues = api.data.$self[__changedFilterFormValuesKey] || {};
13651
13725
  let __changedSearchBoxValues = api.data.$self.__changedSearchBoxValues || {};
13652
13726
  // 把表单搜索和快速搜索中的change事件中记录的过滤条件也拼到$self中,是为解决触发搜索请求时,两边输入的过滤条件都带上,即:
13653
13727
  // 有时在搜索表单中输入过滤条件事,忘记点击回车键或搜索按钮,而是进一步修改快速搜索框中的关键字点击其中回车键触发搜索
13654
13728
  // 这种情况下,触发的搜索请求中没有带上搜索表单中输入的过滤条件。
13655
13729
  // 反过来先在快速搜索框中输入过滤条件却不点击其中回车键触发搜索,而是到搜索表单中触发搜索请求也是一样的。
13656
- Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
13730
+ if(api.data.$self.op !== 'loadOptions'){
13731
+ Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
13732
+ }
13657
13733
  const selfData = JSON.parse(JSON.stringify(api.data.$self));
13658
13734
  var filters = [];
13659
13735
  var pageSize = api.data.pageSize || 10;
@@ -13860,7 +13936,12 @@ async function lookupToAmisPicker(field, readonly, ctx){
13860
13936
  "objectName": refObjectConfig.name,
13861
13937
  "uiSchema": refObjectConfig,
13862
13938
  "listName": listName,// 需要按视图取可搜索项
13863
- "isLookup": true
13939
+ "isLookup": true,
13940
+ "__lookupField": {
13941
+ "name": field.name,
13942
+ "reference_to": refObjectConfig.name,
13943
+ "reference_to_field": field.reference_to_field
13944
+ }
13864
13945
  });
13865
13946
 
13866
13947
  if(!pickerSchema.onEvent){
@@ -14033,7 +14114,7 @@ async function lookupToAmisSelect(field, readonly, ctx){
14033
14114
  sendOn.push(`this.${fName}`);
14034
14115
  });
14035
14116
  if(depend_on.length > 0){
14036
- apiInfo.url = `${apiInfo.url}?${depend_on.join('&')}`;
14117
+ apiInfo.url = `${apiInfo.url}&${depend_on.join('&')}`;
14037
14118
  apiInfo.sendOn = `${sendOn.join(' && ')}`;
14038
14119
  }
14039
14120
  }
@@ -14141,6 +14222,13 @@ async function lookupToAmisSelect(field, readonly, ctx){
14141
14222
  autoComplete: apiInfo,
14142
14223
  searchable: true,
14143
14224
  };
14225
+ let amisVersion = getComparableAmisVersion();
14226
+ if(amisVersion >= 3.6){
14227
+ // amis 3.6中不加source会造成子表组件中弹出行编辑窗口的lookup字段有时不请求接口(概率现象,同一个地方反复操作有时请求有时不请求)
14228
+ // 但是同时配置autoComplete和source会多请求一次接口
14229
+ // TODO:应该想办法把是否字段在子表组件内,即ctx.isInputTable,如果不在子表组件内不需要加source
14230
+ data.source = apiInfo;
14231
+ }
14144
14232
  //删除xlink:href中的rootUrl前缀,解决客户端svg为空的问题
14145
14233
  const select_menuTpl = `<span class='flex items-center mt-0.5'>
14146
14234
  <span role='img' aria-label='smile' class='anticon anticon-smile'>
@@ -14222,6 +14310,14 @@ async function lookupToAmis(field, readonly, ctx){
14222
14310
 
14223
14311
  // 优先取字段中配置的enable_enhanced_lookup,字段上没配置时,才从对象上取enable_enhanced_lookup属性
14224
14312
  let enableEnhancedLookup = _$1__namespace.isBoolean(field.enable_enhanced_lookup) ? field.enable_enhanced_lookup : refObject.enable_enhanced_lookup;
14313
+ let amisVersion = getComparableAmisVersion();
14314
+ if(amisVersion >= 3.6){
14315
+ // amis 3.6.3单选的树picker有严重bug(https://github.com/baidu/amis/issues/9279),先强制使用下拉方式显示
14316
+ // amis 3.6.3多选的树会自动把下层节点,及下下层等所有子节点自动选中,跟amis 3.2不一样,而且目前没有开关,这不适合目前的业务场景,也先强制使用下拉方式显示
14317
+ if(enableEnhancedLookup && refObject.enable_tree){
14318
+ enableEnhancedLookup = false;
14319
+ }
14320
+ }
14225
14321
  // 默认使用下拉框模式显示lookup选项,只能配置了enable_enhanced_lookup才使用弹出增强模式
14226
14322
  if(enableEnhancedLookup == true){
14227
14323
  return await lookupToAmisPicker(field, readonly, ctx);
@@ -14500,9 +14596,9 @@ const OMIT_FIELDS = ['created', 'created_by', 'modified', 'modified_by'];
14500
14596
  // const Lookup = require('./lookup');
14501
14597
 
14502
14598
  function getBaseFields(readonly){
14503
- let calssName = 'm-1';
14599
+ let className = 'm-0';
14504
14600
  if(readonly){
14505
- calssName = `${calssName}`;
14601
+ className = `${className}`;
14506
14602
  }
14507
14603
  return [
14508
14604
  {
@@ -14510,7 +14606,7 @@ function getBaseFields(readonly){
14510
14606
  label: "创建人",
14511
14607
  type: "static",
14512
14608
  labelClassName: 'text-left',
14513
- className: calssName,
14609
+ className: className,
14514
14610
  tpl: getCreatedInfoTpl()
14515
14611
  },
14516
14612
  {
@@ -14518,7 +14614,7 @@ function getBaseFields(readonly){
14518
14614
  label: "修改人",
14519
14615
  type: "static",
14520
14616
  labelClassName: 'text-left',
14521
- className: calssName,
14617
+ className: className,
14522
14618
  tpl: getModifiedInfoTpl()
14523
14619
  }
14524
14620
  ]
@@ -15214,9 +15310,9 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
15214
15310
  }
15215
15311
  if(!_$1__namespace.isEmpty(convertData)){
15216
15312
  if(field.is_wide || convertData.type === 'group'){
15217
- convertData.className = 'col-span-2 m-1';
15313
+ convertData.className = 'col-span-2 m-0';
15218
15314
  }else {
15219
- convertData.className = 'm-1';
15315
+ convertData.className = 'm-0';
15220
15316
  }
15221
15317
  if(readonly){
15222
15318
  convertData.className = `${convertData.className} border-b`;
@@ -15622,7 +15718,7 @@ async function getFormBody(permissionFields, formFields, ctx){
15622
15718
  * @Author: 殷亮辉 yinlianghui@hotoa.com
15623
15719
  * @Date: 2023-11-15 09:50:22
15624
15720
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
15625
- * @LastEditTime: 2023-12-27 13:50:26
15721
+ * @LastEditTime: 2023-12-28 15:54:36
15626
15722
  */
15627
15723
 
15628
15724
  /**
@@ -16103,6 +16199,11 @@ async function getButtonActions(props, mode) {
16103
16199
  let dialogId = getComponentId("dialog", props.id);
16104
16200
  let buttonNextId = getComponentId("button_next", props.id);
16105
16201
  let formPaginationId = getComponentId("form_pagination", props.id);
16202
+ let parentFormData = "${__super.__super.__super.__super || {}}";
16203
+ let amisVersion = getComparableAmisVersion();
16204
+ if(amisVersion < 3.6){
16205
+ parentFormData = "${__super.__super || {}}";
16206
+ }
16106
16207
  if (mode == "new" || mode == "edit") {
16107
16208
  // let actionShowNewDialog = {
16108
16209
  // "actionType": "dialog",
@@ -16244,7 +16345,8 @@ async function getButtonActions(props, mode) {
16244
16345
  // 换成从__super来映射上级表单数据是因为对象列表视图界面中每行下拉菜单中的编辑按钮弹出的表单中的子表所在作用域中没有record变量
16245
16346
  // 映射到中间变量__parentForm而不是直接用&展开映射是为了避免表单中字段名与作用域中变量重名
16246
16347
  // "__parentForm": "${__super.__super || {}}",
16247
- "__parentForm": mode == "new" ? "$$" : "${__super.__super || {}}",
16348
+ // "__parentForm": mode == "new" ? "$$" : "${__super.__super || {}}",
16349
+ "__parentForm": mode == "new" ? "$$" : parentFormData,
16248
16350
  "global": "${global}",
16249
16351
  "uiSchema": "${uiSchema}",
16250
16352
  "index": "${index}",
@@ -16337,7 +16439,7 @@ async function getButtonActions(props, mode) {
16337
16439
  // 换成从__super来映射上级表单数据是因为对象列表视图界面中每行下拉菜单中的编辑按钮弹出的表单中的子表所在作用域中没有record变量
16338
16440
  // 映射到中间变量__parentForm而不是直接用&展开映射是为了避免表单中字段名与作用域中变量重名
16339
16441
  // "__parentForm": "${__super.__super || {}}",
16340
- "__parentForm": "${__super.__super || {}}",
16442
+ "__parentForm": parentFormData,
16341
16443
  "global": "${global}",
16342
16444
  "uiSchema": "${uiSchema}",
16343
16445
  "index": "${index}",
@@ -17954,8 +18056,8 @@ const getInstanceApprovalHistory = async ()=>{
17954
18056
  /*
17955
18057
  * @Author: baozhoutao@steedos.com
17956
18058
  * @Date: 2022-09-07 16:20:45
17957
- * @LastEditors: baozhoutao@steedos.com
17958
- * @LastEditTime: 2023-03-23 16:49:44
18059
+ * @LastEditors: liaodaxue
18060
+ * @LastEditTime: 2023-12-29 16:06:35
17959
18061
  * @Description:
17960
18062
  */
17961
18063
 
@@ -18781,7 +18883,6 @@ const getFlowFormSchema = async (instance, box) => {
18781
18883
  "messages": {
18782
18884
  },
18783
18885
  "requestAdaptor": `
18784
- const { context } = api.data;
18785
18886
  api.data = {
18786
18887
  query: \`
18787
18888
  {
@@ -18804,7 +18905,7 @@ const getFlowFormSchema = async (instance, box) => {
18804
18905
  `,
18805
18906
  "data": {
18806
18907
  // "&": "$$",
18807
- "context": "${context}",
18908
+ // "context": "${context}",
18808
18909
  "judge": "${new_judge}",
18809
18910
  }
18810
18911
  },
@@ -19539,7 +19640,8 @@ var AmisObjectButton = function (props) {
19539
19640
  renderData.listViewId = data.listViewId;
19540
19641
  }
19541
19642
  if (schema) {
19542
- schema.data = _$1.defaultsDeep({}, renderData, getDefaultRenderData(), schema.data);
19643
+ //3.6版本的schema.data内多了event变量,影响了组件渲染
19644
+ schema.data = _$1.defaultsDeep({}, { event: null }, renderData, getDefaultRenderData(), schema.data);
19543
19645
  }
19544
19646
  return (React__default["default"].createElement(React__default["default"].Fragment, null, button && amisSchema ? (React__default["default"].createElement(React__default["default"].Fragment, null, render('body', schema, {
19545
19647
  // 这里的信息会作为 props 传递给子组件,一般情况下都不需要这个,
@@ -19559,6 +19661,9 @@ var getMenu = function (render, buttons, btnClassName, props) {
19559
19661
  if (btnClassName) {
19560
19662
  button.className = "".concat(button.className, " ").concat(btnClassName);
19561
19663
  }
19664
+ if (button.visibleOn) {
19665
+ button.visibleOn = button.visibleOnAlias;
19666
+ }
19562
19667
  delete button.className;
19563
19668
  return {
19564
19669
  key: button.name,
@@ -19974,7 +20079,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
19974
20079
  type: "service",
19975
20080
  data: serviceData,
19976
20081
  style: style,
19977
- className: "".concat(className, " sm:bg-gray-100 h-full border-gray-300 steedos-object-listview ").concat(displayAs === 'split' ? 'sm:border-r' : 'sm:rounded sm:border'),
20082
+ className: "".concat(className, " sm:bg-gray-100 h-full border-gray-300 steedos-object-listview ").concat(displayAs === 'split' ? 'sm:border-r' : 'sm:border-r'),
19978
20083
  body: [{
19979
20084
  "type": "wrapper",
19980
20085
  "size": "none",
@@ -21289,7 +21394,7 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
21289
21394
  body: [
21290
21395
  {
21291
21396
  "type": "wrapper",
21292
- "className": "bg-white sticky p-0 top-0 z-40 w-full flex-none backdrop-blur transition-colors duration-500 lg:z-50 border-b-[3px] border-sky-500 border-solid steedos-header-container",
21397
+ "className": "bg-white sticky p-0 top-0 z-40 w-full flex-none backdrop-blur transition-colors duration-500 lg:z-50 border-b-[3px] border-sky-500 border-solid steedos-header-container sm:shadow",
21293
21398
  body: [
21294
21399
  {
21295
21400
  "type": "wrapper",
@@ -22143,7 +22248,7 @@ var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, f
22143
22248
  type: 'service',
22144
22249
  className: {
22145
22250
  "h-full": "true",
22146
- "sm:px-3 sm:pt-3 page-list-grid": "${display != 'split'}",
22251
+ "page-list-grid": "${display != 'split'}",
22147
22252
  "page-list-split": "${display == 'split'}"
22148
22253
  },
22149
22254
  body: listSchema