@steedos-widgets/amis-lib 3.6.2-beta.12 → 3.6.2-beta.14

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
@@ -416,8 +416,8 @@ const Router = {
416
416
  /*
417
417
  * @Author: baozhoutao@steedos.com
418
418
  * @Date: 2022-07-20 16:29:22
419
- * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
420
- * @LastEditTime: 2023-12-28 14:59:08
419
+ * @LastEditors: liaodaxue
420
+ * @LastEditTime: 2024-01-25 14:44:17
421
421
  * @Description:
422
422
  */
423
423
 
@@ -489,6 +489,25 @@ function getComparableAmisVersion() {
489
489
  }
490
490
  }
491
491
 
492
+ /**
493
+ * 判断浏览器类型
494
+ * @returns 按需返回浏览器类型;
495
+ */
496
+ function getBowserType() {
497
+ const userAgent = navigator.userAgent;
498
+ if (userAgent.indexOf("Chrome")!== -1 && userAgent.indexOf("Safari") !== -1 && userAgent.indexOf("Edg") === -1) {
499
+ return "Chrome";
500
+ } else if (userAgent.indexOf("Firefox") !== -1) {
501
+ return "Firefox";
502
+ } else if (userAgent.indexOf("Safari") !== -1 && userAgent.indexOf("Chrome") === -1 && userAgent.indexOf("Edge") === -1) {
503
+ return "Safari";
504
+ } else if (userAgent.indexOf("Edg") !== -1) {
505
+ return "Edge";
506
+ } else {
507
+ return "Unknown browser"; // 其他浏览器...(可根据自己需要确定是否新增其他浏览器的判断)
508
+ }
509
+ }
510
+
492
511
  /*
493
512
  * @Author: baozhoutao@steedos.com
494
513
  * @Date: 2022-05-23 09:53:08
@@ -1892,7 +1911,8 @@ async function getQuickEditSchema(field, options){
1892
1911
  "failed": "失败了呢。。"
1893
1912
  }
1894
1913
  }
1895
- }
1914
+ },
1915
+ "expression": "${!recordPermissions.modifyAllRecords}"
1896
1916
  },
1897
1917
  {
1898
1918
  "actionType": "setValue",
@@ -1908,7 +1928,7 @@ async function getQuickEditSchema(field, options){
1908
1928
  "componentId": quickEditId,
1909
1929
  "args": {
1910
1930
  "value":{
1911
- "quickedit_record_permissions": "${event.data}"
1931
+ "quickedit_record_permissions": "${recordPermissions.modifyAllRecords ? {'allowEdit': true} : event.data}"
1912
1932
  }
1913
1933
  }
1914
1934
  }
@@ -1972,7 +1992,7 @@ async function getQuickEditSchema(field, options){
1972
1992
  `
1973
1993
  }
1974
1994
  },
1975
- "expression":"${event.data.value}"
1995
+ "expression":"${event.data.value && !recordPermissions.modifyAllRecords}"
1976
1996
  },
1977
1997
  {
1978
1998
  "actionType": "setValue",
@@ -2003,10 +2023,20 @@ async function getQuickEditSchema(field, options){
2003
2023
  "script": `
2004
2024
  const noPermission = event.data.noPermission;
2005
2025
  const crudComponent = event.context.scoped.getComponentById("${options.crudId}");
2006
- const selectedItems = crudComponent && crudComponent.props.store.selectedItems.concat();
2026
+ let selectedItems = crudComponent && crudComponent.props.store.selectedItems.concat();
2007
2027
  noPermission.forEach(function (item) {
2008
2028
  crudComponent && crudComponent.unSelectItem(_.find(selectedItems,{_id:item}));
2029
+ _.remove(selectedItems, (selected) => selected._id === item);
2009
2030
  })
2031
+ doAction({
2032
+ "componentId": "${quickEditId}",
2033
+ "actionType": "setValue",
2034
+ "args": {
2035
+ "value": {
2036
+ selectedItems
2037
+ }
2038
+ }
2039
+ });
2010
2040
  `
2011
2041
  },
2012
2042
  {
@@ -2097,7 +2127,8 @@ async function getTableColumns(fields, options){
2097
2127
  //增加quickEdit属性,实现快速编辑
2098
2128
  const quickEditSchema = allowEdit ? await getQuickEditSchema(field, options) : allowEdit;
2099
2129
  let className = "";
2100
- if(/Safari/.test(navigator.userAgent)){
2130
+ const bowserType = getBowserType();
2131
+ if(bowserType === "Safari"){
2101
2132
  className += " whitespace-nowrap ";
2102
2133
  }else {
2103
2134
  if(field.wrap != true){
@@ -2106,6 +2137,18 @@ async function getTableColumns(fields, options){
2106
2137
  className += " break-words ";
2107
2138
  }
2108
2139
  }
2140
+
2141
+ if (typeof field.amis?.className == "object") {
2142
+ className = {
2143
+ [className]: "true",
2144
+ ...field.amis.className
2145
+ };
2146
+ } else if (typeof field.amis?.className == "string") {
2147
+ className = `${className} ${field.amis.className} `;
2148
+ }
2149
+ let fieldAmis = ___namespace.clone(field.amis);
2150
+ delete fieldAmis?.className;
2151
+
2109
2152
  let columnItem;
2110
2153
  if((field.is_name || field.name === options.labelFieldName) && options.objectName === 'cms_files'){
2111
2154
  const previewFileScript = `
@@ -2156,7 +2199,7 @@ async function getTableColumns(fields, options){
2156
2199
  toggled: field.toggled,
2157
2200
  static: true,
2158
2201
  className,
2159
- }, field.amis, {name: field.name});
2202
+ }, fieldAmis, {name: field.name});
2160
2203
  }else if(field.type === 'avatar' || field.type === 'image' || field.type === 'file'){
2161
2204
  columnItem = Object.assign({}, {
2162
2205
  type: "switch",
@@ -2167,7 +2210,7 @@ async function getTableColumns(fields, options){
2167
2210
  static: true,
2168
2211
  className,
2169
2212
  ...getAmisFileReadonlySchema(field)
2170
- }, field.amis, {name: field.name});
2213
+ }, fieldAmis, {name: field.name});
2171
2214
  }
2172
2215
  else if(field.type === 'select'){
2173
2216
  const map = getSelectMap(field.options);
@@ -2182,7 +2225,7 @@ async function getTableColumns(fields, options){
2182
2225
  className,
2183
2226
  inputClassName: "inline",
2184
2227
  static: true,
2185
- }, field.amis, {name: field.name});
2228
+ }, fieldAmis, {name: field.name});
2186
2229
  }
2187
2230
  else {
2188
2231
  const tpl = await getFieldTpl(field, options);
@@ -2209,15 +2252,6 @@ async function getTableColumns(fields, options){
2209
2252
  // }
2210
2253
 
2211
2254
  //field上的amis属性里的clssname需要单独判断类型合并
2212
- if (typeof field.amis?.className == "object") {
2213
- className = {
2214
- [className]: "true",
2215
- ...field.amis.className
2216
- };
2217
- } else if (typeof field.amis?.className == "string") {
2218
- className = `${className} ${field.amis.className} `;
2219
- }
2220
- delete field.amis?.className;
2221
2255
 
2222
2256
  if(!field.hidden && !field.extra){
2223
2257
  columnItem = Object.assign({}, {
@@ -2234,7 +2268,7 @@ async function getTableColumns(fields, options){
2234
2268
  static: true,
2235
2269
  options: field.type === 'html' ? {html: true} : null
2236
2270
  // toggled: true
2237
- }, field.amis, {name: field.name});
2271
+ }, fieldAmis, {name: field.name});
2238
2272
 
2239
2273
  if(field.type === 'color'){
2240
2274
  columnItem.type = 'color';
@@ -2999,15 +3033,8 @@ async function getTableApi(mainObject, fields, options){
2999
3033
  }
3000
3034
  });
3001
3035
  };
3002
- let isTreeOptionsComputed = false;
3003
- if(records.length === 1 && records[0].children){
3004
- isTreeOptionsComputed = true;
3005
- }
3006
- if(!isTreeOptionsComputed){
3007
- // 如果api接口设置在缓存,缓存期间并不会重新请求接口,payload.data.rows是上次计算后的结果
3008
- payload.data.rows = getTreeOptions(records,{"valueField":"_id"});
3009
- assignIndexToTreeRecords(payload.data.rows, '');
3010
- }
3036
+ payload.data.rows = getTreeOptions(records,{"valueField":"_id"});
3037
+ assignIndexToTreeRecords(payload.data.rows, '');
3011
3038
  }
3012
3039
 
3013
3040
 
@@ -4903,9 +4930,16 @@ const getSchema$2 = (uiSchema) => {
4903
4930
  "form": {
4904
4931
  debug: false,
4905
4932
  resetAfterSubmit: false,
4933
+ data: {
4934
+ editFormInited: true,
4935
+ },
4906
4936
  initApi: {
4937
+ method: 'GET',
4907
4938
  url: '/api/v1/queue_import_history/${recordId}?fields=["state"]',
4908
4939
  sendOn: 'this.recordId',
4940
+ data: null,
4941
+ requestAdaptor: "return api;",
4942
+ adaptor: "return payload;",
4909
4943
  responseData: {
4910
4944
  importState: "${state}"
4911
4945
  }
@@ -8638,14 +8672,7 @@ async function getObjectCRUD(objectSchema, fields, options){
8638
8672
  headers: {
8639
8673
  Authorization: "Bearer ${context.tenantId},${context.authToken}",
8640
8674
  },
8641
- requestAdaptor: quickSaveApiRequestAdaptor,
8642
- adaptor: `
8643
- if(payload.errors){
8644
- payload.status = 2;
8645
- payload.msg = window.t ? window.t(payload.errors[0].message) : payload.errors[0].message;
8646
- }
8647
- return payload;
8648
- `
8675
+ requestAdaptor: quickSaveApiRequestAdaptor
8649
8676
  },
8650
8677
  // 外层data发生变化的时候, 不会重新渲染rowClassNameExpr, 所以先用css标记tr唯一标识
8651
8678
  // 使用表达式给tr添加初始选中状态
@@ -8662,6 +8689,21 @@ async function getObjectCRUD(objectSchema, fields, options){
8662
8689
  crudModeClassName = `steedos-crud-mode-${body.mode}`;
8663
8690
  }
8664
8691
 
8692
+ body.quickSaveApi.adaptor = `
8693
+ if(payload.errors){
8694
+ payload.status = 2;
8695
+ payload.msg = window.t ? window.t(payload.errors[0].message) : payload.errors[0].message;
8696
+ }
8697
+ debugger;
8698
+ var scope = SteedosUI.getRef(context.scopeId);
8699
+ var scopeParent = scope && scope.parent;
8700
+ var crudScoped = scopeParent.getComponentById('${body.id}');
8701
+ setTimeout(()=>{
8702
+ crudScoped && crudScoped.control.updateAutoFillHeight();
8703
+ }, 500);
8704
+ return payload;
8705
+ `;
8706
+
8665
8707
  if(body.columns && options.formFactor != 'SMALL'){
8666
8708
  //将_display放入crud的columns的倒数第二列中(最后一列会影响固定列),可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
8667
8709
  body.columns.splice(body.columns.length -1 , 0, {name: '_display',type: 'static', width: 1, placeholder: "",id: objectSchema.name + "_display_${_index}", tpl: "${''}"});
@@ -9027,7 +9069,7 @@ const getRecordPermissions = async (objectName, recordId)=>{
9027
9069
  * @Author: baozhoutao@steedos.com
9028
9070
  * @Date: 2022-07-05 15:55:39
9029
9071
  * @LastEditors: baozhoutao@steedos.com
9030
- * @LastEditTime: 2024-01-15 10:34:46
9072
+ * @LastEditTime: 2024-01-24 10:18:17
9031
9073
  * @Description:
9032
9074
  */
9033
9075
 
@@ -9126,7 +9168,9 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
9126
9168
  const foreign_key_value = arr[2] ? arr[1]+'.'+arr[2] : arr[1];
9127
9169
  mainRelated[arr[0]] = foreign_key_value;
9128
9170
  }
9129
- }else {
9171
+ }
9172
+ // 防止related_lists中没有相关子表,但是details中有相关子表的情况
9173
+ if(!mainRelated[relatedObjectName]){
9130
9174
  const details = _$1.union(mainObjectUiSchema.details,mainObjectUiSchema.lookup_details) || [];
9131
9175
  for (const detail of details) {
9132
9176
  const arr = detail.split(".");
@@ -10753,6 +10797,7 @@ function getLookupSapceUserTreeSchema(isMobile){
10753
10797
  }
10754
10798
  },
10755
10799
  "label": "",
10800
+ "mode": "normal",
10756
10801
  "name": "organizations",
10757
10802
  "multiple": false,
10758
10803
  "joinValues": false,
@@ -12980,10 +13025,10 @@ function uuidv4() {
12980
13025
  * @Author: 殷亮辉 yinlianghui@hotoa.com
12981
13026
  * @Date: 2023-11-15 09:50:22
12982
13027
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
12983
- * @LastEditTime: 2024-01-22 15:59:32
13028
+ * @LastEditTime: 2024-01-25 14:11:50
12984
13029
  */
12985
13030
 
12986
- function getTablePrimaryKey(props){
13031
+ function getTablePrimaryKey(props) {
12987
13032
  return props.primaryKey || "_id";
12988
13033
  }
12989
13034
 
@@ -12993,22 +13038,22 @@ function getTablePrimaryKey(props){
12993
13038
  * @param {*} primaryKey 主键字段名,一般为_id
12994
13039
  * @returns 转换后的子表组件字段值
12995
13040
  */
12996
- function getTableValueWithPrimaryKeyValue(value, primaryKey){
12997
- if(!primaryKey){
13041
+ function getTableValueWithPrimaryKeyValue(value, primaryKey) {
13042
+ if (!primaryKey) {
12998
13043
  return value;
12999
13044
  }
13000
- return (value || []).map((itemValue)=>{
13045
+ return (value || []).map((itemValue) => {
13001
13046
  //这里不clone的话,会造成在pipeIn函数执行该函数后像pipeOut一样最终输出到表单项中,即库里把primaryKey字段值保存了
13002
13047
  const newItemValue = _$1.clone(itemValue);
13003
- if(newItemValue[primaryKey]){
13004
- if(newItemValue.children){
13048
+ if (newItemValue[primaryKey]) {
13049
+ if (newItemValue.children) {
13005
13050
  newItemValue.children = getTableValueWithPrimaryKeyValue(newItemValue.children, primaryKey);
13006
13051
  }
13007
13052
  return newItemValue;
13008
13053
  }
13009
13054
  else {
13010
13055
  newItemValue[primaryKey] = uuidv4();
13011
- if(newItemValue.children){
13056
+ if (newItemValue.children) {
13012
13057
  newItemValue.children = getTableValueWithPrimaryKeyValue(newItemValue.children, primaryKey);
13013
13058
  }
13014
13059
  return newItemValue;
@@ -13022,14 +13067,14 @@ function getTableValueWithPrimaryKeyValue(value, primaryKey){
13022
13067
  * @param {*} primaryKey 主键字段名,一般为_id
13023
13068
  * @returns 转换后的子表组件字段值
13024
13069
  */
13025
- function getTableValueWithoutPrimaryKeyValue(value, primaryKey){
13026
- if(!primaryKey){
13070
+ function getTableValueWithoutPrimaryKeyValue(value, primaryKey) {
13071
+ if (!primaryKey) {
13027
13072
  return value;
13028
13073
  }
13029
- return (value || []).map((itemValue)=>{
13074
+ return (value || []).map((itemValue) => {
13030
13075
  //这里clone只是为了保险,不是必须的,每次修改子表数据是否都会生成新的primaryKey字段值是由pipeOut中识别autoGeneratePrimaryKeyValue决定的,跟这里没关系
13031
13076
  const newItemValue = _$1.clone(itemValue);
13032
- if(newItemValue.children){
13077
+ if (newItemValue.children) {
13033
13078
  newItemValue.children = getTableValueWithoutPrimaryKeyValue(newItemValue.children, primaryKey);
13034
13079
  }
13035
13080
  delete newItemValue[primaryKey];
@@ -13043,12 +13088,12 @@ function getTableValueWithoutPrimaryKeyValue(value, primaryKey){
13043
13088
  * @param {*} fieldPrefix 字段前缀
13044
13089
  * @returns 转换后的子表组件字段值
13045
13090
  */
13046
- function getTableValueWithoutFieldPrefix(value, fieldPrefix){
13091
+ function getTableValueWithoutFieldPrefix(value, fieldPrefix) {
13047
13092
  let convertedValue = [];
13048
- (value || []).forEach((itemValue)=>{
13093
+ (value || []).forEach((itemValue) => {
13049
13094
  var newItemValue = {};
13050
- for(let n in itemValue){
13051
- if(itemValue.hasOwnProperty(n)){
13095
+ for (let n in itemValue) {
13096
+ if (itemValue.hasOwnProperty(n)) {
13052
13097
  newItemValue[n.replace(new RegExp(`^${fieldPrefix}`), "")] = itemValue[n];
13053
13098
  }
13054
13099
  }
@@ -13063,16 +13108,16 @@ function getTableValueWithoutFieldPrefix(value, fieldPrefix){
13063
13108
  * @param {*} fieldPrefix 字段前缀
13064
13109
  * @returns 转换后的子表组件字段值
13065
13110
  */
13066
- function getTableValuePrependFieldPrefix(value, fieldPrefix, primaryKey){
13111
+ function getTableValuePrependFieldPrefix(value, fieldPrefix, primaryKey) {
13067
13112
  let convertedValue = [];
13068
- (value || []).forEach((itemValue)=>{
13113
+ (value || []).forEach((itemValue) => {
13069
13114
  var newItemValue = {};
13070
- for(let n in itemValue){
13071
- if(itemValue.hasOwnProperty(n) && typeof itemValue[n] !== undefined && n !== primaryKey){
13115
+ for (let n in itemValue) {
13116
+ if (itemValue.hasOwnProperty(n) && typeof itemValue[n] !== undefined && n !== primaryKey) {
13072
13117
  newItemValue[`${fieldPrefix}${n}`] = itemValue[n];
13073
13118
  }
13074
13119
  }
13075
- if(primaryKey && itemValue[primaryKey]){
13120
+ if (primaryKey && itemValue[primaryKey]) {
13076
13121
  newItemValue[primaryKey] = itemValue[primaryKey];
13077
13122
  }
13078
13123
  convertedValue.push(newItemValue);
@@ -13086,7 +13131,7 @@ function getTableValuePrependFieldPrefix(value, fieldPrefix, primaryKey){
13086
13131
  * @param {*} fieldPrefix 字段前缀
13087
13132
  * @returns 转换后的子表组件字段值
13088
13133
  */
13089
- function getTableFieldsWithoutFieldPrefix(fields, fieldPrefix){
13134
+ function getTableFieldsWithoutFieldPrefix(fields, fieldPrefix) {
13090
13135
  return (fields || []).map((item) => {
13091
13136
  const newItem = _$1.clone(item);//这里不clone的话,会造成子表组件重新render,从而审批王那边点开子表行编辑窗口时报错
13092
13137
  newItem.name = newItem.name.replace(new RegExp(`^${fieldPrefix}`), "");
@@ -13124,6 +13169,7 @@ function getInputTableCell(field, showAsInlineEditMode) {
13124
13169
  name: field.name,
13125
13170
  quickEdit: {
13126
13171
  "type": "steedos-field",
13172
+ "mode": "inline",
13127
13173
  "config": Object.assign({}, field, {
13128
13174
  label: false
13129
13175
  })
@@ -13131,16 +13177,20 @@ function getInputTableCell(field, showAsInlineEditMode) {
13131
13177
  }
13132
13178
  }
13133
13179
  else {
13180
+ // 这里加一层service是因为amis 3.6/6.0中有bug,不加的话,这里会显示为父作用域中中的同名变量值,见:https://github.com/baidu/amis/issues/9520
13134
13181
  return {
13135
- "type": "steedos-field",
13136
- "config": Object.assign({}, field, {
13137
- label: false
13138
- }),
13139
- inInputTable: true,
13140
- "static": true,
13141
- "readonly": true,
13182
+ "type": "service",
13142
13183
  label: field.label,
13143
- name: field.name
13184
+ name: field.name,
13185
+ "body":[{
13186
+ "type": "steedos-field",
13187
+ "config": Object.assign({}, field, {
13188
+ label: false
13189
+ }),
13190
+ inInputTable: true,
13191
+ "static": true,
13192
+ "readonly": true
13193
+ }]
13144
13194
  }
13145
13195
  }
13146
13196
  }
@@ -13203,7 +13253,9 @@ async function getInputTableColumns(props) {
13203
13253
  }
13204
13254
  }
13205
13255
  if (field) {
13206
- let tableCell = getInputTableCell(field, showAsInlineEditMode);
13256
+ let mode = typeof extendColumnProps.inlineEditMode === "boolean" ?
13257
+ extendColumnProps.inlineEditMode : showAsInlineEditMode;
13258
+ let tableCell = getInputTableCell(field, mode);
13207
13259
  return Object.assign({}, tableCell, extendColumnProps);
13208
13260
  }
13209
13261
  else {
@@ -13226,7 +13278,7 @@ async function getInputTableColumns(props) {
13226
13278
  */
13227
13279
  function getFormPagination(props, mode) {
13228
13280
  let showPagination = true;
13229
- if(mode === "new" && !!!props.editable){
13281
+ if (mode === "new" && !!!props.editable) {
13230
13282
  //不允许编辑只允许新建时不应该让用户操作翻页
13231
13283
  showPagination = false;
13232
13284
  }
@@ -13666,7 +13718,7 @@ async function getButtonActions(props, mode) {
13666
13718
  let formPaginationId = getComponentId("form_pagination", props.id);
13667
13719
  let parentFormData = "${__super.__super.__super.__super || {}}";
13668
13720
  let amisVersion = getComparableAmisVersion();
13669
- if(amisVersion < 3.6){
13721
+ if (amisVersion < 3.6) {
13670
13722
  parentFormData = "${__super.__super || {}}";
13671
13723
  }
13672
13724
  if (mode == "new" || mode == "edit") {
@@ -13830,13 +13882,13 @@ async function getButtonActions(props, mode) {
13830
13882
  `;
13831
13883
  let dialogButtons = [
13832
13884
  {
13833
- "type": "button",
13834
- "label": "完成",
13835
- "actionType": "confirm",
13836
- "level": "primary"
13885
+ "type": "button",
13886
+ "label": "完成",
13887
+ "actionType": "confirm",
13888
+ "level": "primary"
13837
13889
  }
13838
13890
  ];
13839
- if(props.addable){
13891
+ if (props.addable) {
13840
13892
  // 有新增行权限时额外添加新增和复制按钮
13841
13893
  dialogButtons = [
13842
13894
  {
@@ -13909,7 +13961,7 @@ async function getButtonActions(props, mode) {
13909
13961
  // 在节点嵌套情况下,当前节点正好是带children属性的节点的话,这里弹出的dialog映射到的会是children数组,这是amis目前的规则,
13910
13962
  // 所以这里加判断有children时,用__super.__super让映射到正确的作用域层,如果不加,则__tableItems取到的会是children数组,而不是整个子表组件的值
13911
13963
  "__tableItems": `\${((children ? __super.__super.${props.name} : __super.${props.name}) || [])|json|toJson}`
13912
- },
13964
+ },
13913
13965
  "actions": dialogButtons,
13914
13966
  "onEvent": {
13915
13967
  "confirm": {
@@ -14147,7 +14199,7 @@ const getAmisInputTableSchema = async (props) => {
14147
14199
  }
14148
14200
  let primaryKey = getTablePrimaryKey(props);
14149
14201
  let showOperation = props.showOperation;
14150
- if(showOperation !== false){
14202
+ if (showOperation !== false) {
14151
14203
  showOperation = true;
14152
14204
  }
14153
14205
  let fieldPrefix = props.fieldPrefix;
@@ -14159,7 +14211,7 @@ const getAmisInputTableSchema = async (props) => {
14159
14211
  let buttonsForColumnOperations = [];
14160
14212
  let inlineEditMode = props.inlineEditMode;
14161
14213
  let showAsInlineEditMode = inlineEditMode && props.editable;
14162
- if(showOperation){
14214
+ if (showOperation) {
14163
14215
  if (props.editable) {
14164
14216
  let showEditButton = true;
14165
14217
  if (showAsInlineEditMode) {
@@ -14210,31 +14262,31 @@ const getAmisInputTableSchema = async (props) => {
14210
14262
  "showFooterAddBtn": false,
14211
14263
  "className": props.tableClassName,
14212
14264
  "pipeIn": (value, data) => {
14213
- if(fieldPrefix){
14265
+ if (fieldPrefix) {
14214
14266
  value = getTableValueWithoutFieldPrefix(value, fieldPrefix);
14215
14267
  }
14216
- if(primaryKey){
14268
+ if (primaryKey) {
14217
14269
  // 这里临时给每行数据补上primaryKey字段值,如果库里不需要保存这里补上的字段值,pipeOut中会识别autoGeneratePrimaryKeyValue属性选择最终移除这里补上的字段值
14218
14270
  // 这里始终自动生成primaryKey字段值,而不是只在pipeOut输出整个子表字段值时才生成,是因为要支持当数据库里保存的子表字段行数据没有primaryKey字段值时的行嵌套模式(即节点的children属性)功能
14219
14271
  // 这里要注意,流程详细设置界面的字段设置功能中的子表组件中,数据库里保存的子表字段行数据是有primaryKey字段值的,它不依赖这里自动生成行primaryKey值功能
14220
14272
  value = getTableValueWithPrimaryKeyValue(value, primaryKey);
14221
14273
  }
14222
- if(amis.pipeIn){
14223
- if(typeof amis.pipeIn === 'function'){
14274
+ if (amis.pipeIn) {
14275
+ if (typeof amis.pipeIn === 'function') {
14224
14276
  return amis.pipeIn(value, data);
14225
14277
  }
14226
14278
  }
14227
14279
  return value;
14228
14280
  },
14229
14281
  "pipeOut": (value, data) => {
14230
- value = (value || []).map(function(item){
14282
+ value = (value || []).map(function (item) {
14231
14283
  delete item.__fix_rerender_after_children_modified_tag;
14232
14284
  return item;
14233
14285
  });
14234
- if(fieldPrefix){
14286
+ if (fieldPrefix) {
14235
14287
  value = getTableValuePrependFieldPrefix(value, fieldPrefix, primaryKey);
14236
14288
  }
14237
- if(props.autoGeneratePrimaryKeyValue === true){
14289
+ if (props.autoGeneratePrimaryKeyValue === true) {
14238
14290
  // 如果需要把自动生成的primaryKey值输出保存的库中,则补全所有行中的primaryKey值
14239
14291
  // 这里如果不全部补全的话,初始从库里返回的字段值中拿到的行没primaryKey值的话就不会自动补上
14240
14292
  value = getTableValueWithPrimaryKeyValue(value, primaryKey);
@@ -14246,8 +14298,8 @@ const getAmisInputTableSchema = async (props) => {
14246
14298
  // 只有autoGeneratePrimaryKey配置为true时,每行的primaryKey字段值才会始终保持不变
14247
14299
  value = getTableValueWithoutPrimaryKeyValue(value, primaryKey);
14248
14300
  }
14249
- if(amis.pipeOut){
14250
- if(typeof amis.pipeOut === 'function'){
14301
+ if (amis.pipeOut) {
14302
+ if (typeof amis.pipeOut === 'function') {
14251
14303
  return amis.pipeOut(value, data);
14252
14304
  }
14253
14305
  }
@@ -14262,9 +14314,10 @@ const getAmisInputTableSchema = async (props) => {
14262
14314
  "width": buttonsForColumnOperations.length > 1 ? "60px" : "20px"
14263
14315
  });
14264
14316
  }
14265
- if (showAsInlineEditMode) {
14266
- inputTableSchema.needConfirm = false;
14267
- }
14317
+ // if (showAsInlineEditMode) {
14318
+ // // 因为要支持不同的列上配置inlineEditMode属性,所有不可以把整个子表组件都设置为inlineEditMode
14319
+ // inputTableSchema.needConfirm = false;
14320
+ // }
14268
14321
  if (amis) {
14269
14322
  // 支持配置amis属性重写或添加最终生成的input-table中任何属性。
14270
14323
  delete amis.id;//如果steedos-input-table组件配置了amis.id属性,会造成新建编辑行功能不生效
@@ -14306,19 +14359,19 @@ const getAmisInputTableSchema = async (props) => {
14306
14359
  });
14307
14360
  }
14308
14361
  let schema = {
14309
- "type": "service",
14310
- "body": [
14311
- {
14312
- "type": "control",
14313
- "body": schemaBody,
14314
- "label": props.label,
14315
- "labelClassName": props.label ? props.labelClassName : "none",
14316
- "labelRemark": props.labelRemark,
14317
- "labelAlign": props.labelAlign
14318
- }
14319
- ],
14320
- "className": props.className,
14321
- "id": serviceId
14362
+ "type": "control",
14363
+ "body": {
14364
+ "type": "service",
14365
+ "body": schemaBody,
14366
+ "id": serviceId
14367
+ },
14368
+ "label": props.label,
14369
+ "labelClassName": props.label ? props.labelClassName : "none",
14370
+ "labelRemark": props.labelRemark,
14371
+ "labelAlign": props.labelAlign,
14372
+ //控制control的mode属性,https://aisuda.bce.baidu.com/amis/zh-CN/components/form/formitem#表单项展示
14373
+ "mode": props.mode || null,
14374
+ "className": props.className
14322
14375
  };
14323
14376
  // console.log("===schema===", schema);
14324
14377
  return schema;