@steedos-widgets/amis-object 1.3.22-beta.3 → 1.3.22-beta.4

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.
@@ -1 +1,2 @@
1
+ import "./AmisSteedosField.less";
1
2
  export declare const AmisSteedosField: (props: any) => Promise<any>;
@@ -309,6 +309,11 @@ fieldset.antd-Collapse > legend{
309
309
  white-space: nowrap;
310
310
  }
311
311
 
312
+ /* amis3.6.3 .antd-Tree-itemText类中缺了flex样式 */
313
+ .antd-Tree-itemText{
314
+ flex: 1 auto;
315
+ }
316
+
312
317
  .ant-dropdown-menu {
313
318
  border: 1px solid #e5e5e5;
314
319
  border-radius: 0.25rem;
@@ -2190,6 +2195,7 @@ body.sidebar #sidebar {
2190
2195
  }
2191
2196
  }
2192
2197
 
2198
+
2193
2199
  .steedos-select-flow-service .antd-TreeControl > .antd-Tree {
2194
2200
  max-height: unset;
2195
2201
  }
@@ -108,6 +108,18 @@ function __generator(thisArg, body) {
108
108
  }
109
109
  }
110
110
 
111
+ function __values(o) {
112
+ var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
113
+ if (m) return m.call(o);
114
+ if (o && typeof o.length === "number") return {
115
+ next: function () {
116
+ if (o && i >= o.length) o = void 0;
117
+ return { value: o && o[i++], done: !o };
118
+ }
119
+ };
120
+ throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
121
+ }
122
+
111
123
  function __read(o, n) {
112
124
  var m = typeof Symbol === "function" && o[Symbol.iterator];
113
125
  if (!m) return o;
@@ -8934,6 +8946,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
8934
8946
  `;
8935
8947
  const onCancelScript = `
8936
8948
  // console.log("===onCancelScript=form==");
8949
+ let isLookup = event.data.isLookup;
8950
+ let __lookupField = event.data.__lookupField;
8937
8951
  const scope = event.context.scoped;
8938
8952
  var filterForm = scope.parent.parent.getComponents().find(function(n){
8939
8953
  return n.props.type === "form";
@@ -8981,7 +8995,20 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
8981
8995
  // });
8982
8996
 
8983
8997
  // 清除__changedFilterFormValues中的值
8984
- crud && crud.setData({__changedFilterFormValues: {}});
8998
+ // crud && crud.setData({__changedFilterFormValues: {}});
8999
+ let __changedFilterFormValuesKey = "__changedFilterFormValues";
9000
+ if(isLookup && __lookupField){
9001
+ let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
9002
+ if(__lookupField.reference_to_field){
9003
+ lookupTag += "__" + __lookupField.reference_to_field;
9004
+ }
9005
+ __changedFilterFormValuesKey += lookupTag;
9006
+ }
9007
+ if(crud){
9008
+ let crudData = crud.getData();
9009
+ crudData[__changedFilterFormValuesKey] = {};
9010
+ crud.setData(crudData);
9011
+ }
8985
9012
  filterForm.handleFormSubmit(event);
8986
9013
  // crud.handleFilterSubmit(removedValues);
8987
9014
 
@@ -10909,7 +10936,12 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
10909
10936
  __changedSearchBoxValues["${keywordsSearchBoxName}"] = event.data["${keywordsSearchBoxName}"];
10910
10937
  // crudService && crudService.setData({__changedSearchBoxValues: __changedSearchBoxValues});
10911
10938
  // 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
10912
- crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
10939
+ // crud && crud.setData({__changedSearchBoxValues: __changedSearchBoxValues});
10940
+ if(crud){
10941
+ let crudData = crud.getData();
10942
+ crudData.__changedSearchBoxValues = __changedSearchBoxValues;
10943
+ crud.setData(crudData);
10944
+ }
10913
10945
  `;
10914
10946
 
10915
10947
  // onSearchScript中加上了onChangeScript中的脚本,是因为amis 3.2不能用change事件执行onChangeScript
@@ -10922,9 +10954,19 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
10922
10954
  // const scope = event.context.scoped;
10923
10955
  // 如果点击过顶部搜索栏表单的取消按钮,会把此处event.data.__super.__super.__super中的搜索表单项的所有字段设置为null
10924
10956
  // 点击取消按钮后继续在表单项中输入过滤条件且最后没有点击回车按键或点击表单项搜索按钮的话,在快速搜索中点击回车按钮提交搜索会所顶部搜索表单中的字段值清空
10957
+ let isLookup = event.data.isLookup;
10958
+ let __lookupField = event.data.__lookupField;
10959
+ let __changedFilterFormValuesKey = "__changedFilterFormValues";
10960
+ if(isLookup && __lookupField){
10961
+ let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
10962
+ if(__lookupField.reference_to_field){
10963
+ lookupTag += "__" + __lookupField.reference_to_field;
10964
+ }
10965
+ __changedFilterFormValuesKey += lookupTag;
10966
+ }
10925
10967
  let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
10926
10968
  setTimeout(function(){
10927
- filterForm.setValues(event.data.__changedFilterFormValues);
10969
+ filterForm.setValues(event.data[__changedFilterFormValuesKey]);
10928
10970
  }, 500);
10929
10971
  `;
10930
10972
 
@@ -10945,8 +10987,8 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
10945
10987
  "name": keywordsSearchBoxName,
10946
10988
  "placeholder": "搜索此列表",
10947
10989
  "value": crudKeywords,
10948
- "clearable": true,
10949
- // "clearAndSubmit": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
10990
+ // "clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
10991
+ "clearAndSubmit": true,
10950
10992
  "searchImediately": false,
10951
10993
  "onEvent": {
10952
10994
  "search": {
@@ -11226,6 +11268,9 @@ async function getObjectFilter(objectSchema, fields, options) {
11226
11268
  crudService && crudService.setData({isFieldsFilterEmpty});
11227
11269
  `;
11228
11270
  let onChangeScript = `
11271
+ let isLookup = event.data.isLookup;
11272
+ let __lookupField = event.data.__lookupField;
11273
+ console.log("==onChangeScript=isLookup===", isLookup);
11229
11274
  const scope = event.context.scoped;
11230
11275
  // let filterFormValues = event.data;
11231
11276
  let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
@@ -11237,7 +11282,20 @@ async function getObjectFilter(objectSchema, fields, options) {
11237
11282
  // let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
11238
11283
  // crudService && crudService.setData({__changedFilterFormValues: changedFilterFormValues});
11239
11284
  // 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
11240
- crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
11285
+ // crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
11286
+ let __changedFilterFormValuesKey = "__changedFilterFormValues";
11287
+ if(isLookup && __lookupField){
11288
+ let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
11289
+ if(__lookupField.reference_to_field){
11290
+ lookupTag += "__" + __lookupField.reference_to_field;
11291
+ }
11292
+ __changedFilterFormValuesKey += lookupTag;
11293
+ }
11294
+ if(crud){
11295
+ let crudData = crud.getData();
11296
+ crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
11297
+ crud.setData(crudData);
11298
+ }
11241
11299
  `;
11242
11300
  return {
11243
11301
  "title": "",
@@ -13629,13 +13687,24 @@ async function lookupToAmisPicker(field, readonly, ctx){
13629
13687
  let keywordsSearchBoxName = `__keywords_lookup__${field.name.replace(/\./g, "_")}__to__${refObjectConfig.name}`;
13630
13688
 
13631
13689
  source.requestAdaptor = `
13632
- let __changedFilterFormValues = api.data.$self.__changedFilterFormValues || {};
13690
+ let __changedFilterFormValuesKey = "__changedFilterFormValues";
13691
+ let __lookupField = api.data.$self.__lookupField;
13692
+ if(__lookupField){
13693
+ let lookupTag = "__" + __lookupField.name + "__" + __lookupField.reference_to;
13694
+ if(__lookupField.reference_to_field){
13695
+ lookupTag += "__" + __lookupField.reference_to_field;
13696
+ }
13697
+ __changedFilterFormValuesKey += lookupTag;
13698
+ }
13699
+ let __changedFilterFormValues = api.data.$self[__changedFilterFormValuesKey] || {};
13633
13700
  let __changedSearchBoxValues = api.data.$self.__changedSearchBoxValues || {};
13634
13701
  // 把表单搜索和快速搜索中的change事件中记录的过滤条件也拼到$self中,是为解决触发搜索请求时,两边输入的过滤条件都带上,即:
13635
13702
  // 有时在搜索表单中输入过滤条件事,忘记点击回车键或搜索按钮,而是进一步修改快速搜索框中的关键字点击其中回车键触发搜索
13636
13703
  // 这种情况下,触发的搜索请求中没有带上搜索表单中输入的过滤条件。
13637
13704
  // 反过来先在快速搜索框中输入过滤条件却不点击其中回车键触发搜索,而是到搜索表单中触发搜索请求也是一样的。
13638
- Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
13705
+ if(api.data.$self.op !== 'loadOptions'){
13706
+ Object.assign(api.data.$self, __changedSearchBoxValues, __changedFilterFormValues);
13707
+ }
13639
13708
  const selfData = JSON.parse(JSON.stringify(api.data.$self));
13640
13709
  var filters = [];
13641
13710
  var pageSize = api.data.pageSize || 10;
@@ -13839,7 +13908,12 @@ async function lookupToAmisPicker(field, readonly, ctx){
13839
13908
  "objectName": refObjectConfig.name,
13840
13909
  "uiSchema": refObjectConfig,
13841
13910
  "listName": listName,// 需要按视图取可搜索项
13842
- "isLookup": true
13911
+ "isLookup": true,
13912
+ "__lookupField": {
13913
+ "name": field.name,
13914
+ "reference_to": refObjectConfig.name,
13915
+ "reference_to_field": field.reference_to_field
13916
+ }
13843
13917
  });
13844
13918
 
13845
13919
  if(!pickerSchema.onEvent){
@@ -15601,7 +15675,7 @@ async function getFormBody(permissionFields, formFields, ctx){
15601
15675
  * @Author: 殷亮辉 yinlianghui@hotoa.com
15602
15676
  * @Date: 2023-11-15 09:50:22
15603
15677
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
15604
- * @LastEditTime: 2023-12-25 13:13:56
15678
+ * @LastEditTime: 2023-12-26 11:15:04
15605
15679
  */
15606
15680
 
15607
15681
  /**
@@ -15629,20 +15703,22 @@ function getInputTableCell(field, showAsInlineEditMode) {
15629
15703
  name: field.name,
15630
15704
  quickEdit: {
15631
15705
  "type": "steedos-field",
15632
- "config": field,
15633
- hideLabel: true
15706
+ "config": Object.assign({}, field, {
15707
+ label: false
15708
+ })
15634
15709
  }
15635
15710
  }
15636
15711
  }
15637
15712
  else {
15638
15713
  return {
15639
15714
  "type": "steedos-field",
15640
- "config": field,
15715
+ "config": Object.assign({}, field, {
15716
+ label: false
15717
+ }),
15641
15718
  "static": true,
15642
15719
  "readonly": true,
15643
15720
  label: field.label,
15644
- name: field.name,
15645
- hideLabel: true
15721
+ name: field.name
15646
15722
  }
15647
15723
  }
15648
15724
  }
@@ -15888,7 +15964,9 @@ function getFormPaginationWrapper(props, form, mode) {
15888
15964
  let __wrapperServiceId = "${tableServiceId}";
15889
15965
  let wrapperService = scope.getComponentById(__wrapperServiceId);
15890
15966
  let wrapperServiceData = wrapperService.getData();
15891
- let lastestFieldValue = wrapperServiceData["${props.name}"] || [];//这里不可以用event.data["${props.name}"]因为amis input talbe有一层单独的作用域,其值会延迟一拍
15967
+ // 这里不可以用event.data["${props.name}"]因为amis input talbe有一层单独的作用域,其值会延迟一拍
15968
+ // 这里如果不.clone的话,在弹出窗口中显示的子表组件,添加行后点窗口的取消按钮关闭窗口后无法把之前的操作还原,即把之前添加的行自动移除
15969
+ let lastestFieldValue = _.clone(wrapperServiceData["${props.name}"] || []);
15892
15970
  //不可以直接像event.data.__tableItems = lastestFieldValue; 这样整个赋值,否则作用域会断
15893
15971
  let mode = "${mode}";
15894
15972
  if(mode === "new"){
@@ -21495,7 +21573,7 @@ function getAmisStaticFieldType(type, data_type, options) {
21495
21573
  return "number";
21496
21574
  }
21497
21575
  else if (type === 'autonumber') {
21498
- return "text";
21576
+ return "input-text"; //不可以用text,因为会出现字段label显示不出来的问题
21499
21577
  }
21500
21578
  else if (type === 'percent') {
21501
21579
  return "number";
@@ -21515,13 +21593,14 @@ function getAmisStaticFieldType(type, data_type, options) {
21515
21593
  return type;
21516
21594
  }
21517
21595
  var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void 0, function () {
21518
- var steedosField, field, _a, readonly, _b, ctx, config, fStatic, hideLabel, defaultSource, source, schema, schema, fieldAmis, schema, error_1;
21519
- var _c, _d, _e;
21520
- return __generator(this, function (_f) {
21521
- switch (_f.label) {
21596
+ var steedosField, field, _a, readonly, _b, ctx, config, fStatic, defaultSource, source, schema, fieldSchema, fieldValue, hasImageOrFile_1, fieldHtml_1, schema, tableFields, _c, _d, subField, subFieldName, fieldAmis, schema, error_1;
21597
+ var e_1, _e;
21598
+ var _f, _g, _h;
21599
+ return __generator(this, function (_j) {
21600
+ switch (_j.label) {
21522
21601
  case 0:
21523
21602
  steedosField = null;
21524
- field = props.field, _a = props.readonly, readonly = _a === void 0 ? false : _a, _b = props.ctx, ctx = _b === void 0 ? {} : _b, config = props.config, props.$schema, fStatic = props.static, hideLabel = props.hideLabel;
21603
+ field = props.field, _a = props.readonly, readonly = _a === void 0 ? false : _a, _b = props.ctx, ctx = _b === void 0 ? {} : _b, config = props.config, props.$schema, fStatic = props.static;
21525
21604
  // console.log(`AmisSteedosField`, props)
21526
21605
  // if($schema.config && isString($schema.config)){
21527
21606
  // $schema.config = JSON.parse($schema.config)
@@ -21538,13 +21617,20 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
21538
21617
  // 这里要clone是因为后面图片字段类型执行steedosField.amis = ...的时候会造成input-table中的图片字段在弹出编辑表单点击确认后整个input-table组件重新渲染了,从而导致其翻页功能异常
21539
21618
  steedosField = _$1.clone(steedosField);
21540
21619
  }
21620
+ // if (props.label && !steedosField.label) {
21621
+ // steedosField.label = props.label;
21622
+ // }
21623
+ if (typeof props.label === "string" || props.label === false) {
21624
+ // 始终优先取组件上配置的label,且可以通过配置组件的label属性值为false来隐藏字段label
21625
+ steedosField.label = props.label;
21626
+ }
21541
21627
  if (!fStatic && steedosField.readonly && !props.data.hasOwnProperty("_display")) {
21542
21628
  // 字段配置为只读,强制走fStatic模式,加上_display判断是为了不影响历史代码,比如直接在ObjectForm中调用steedos-field组件
21543
21629
  fStatic = true;
21544
21630
  }
21545
- _f.label = 1;
21631
+ _j.label = 1;
21546
21632
  case 1:
21547
- _f.trys.push([1, 16, , 17]);
21633
+ _j.trys.push([1, 18, , 19]);
21548
21634
  if (!(fStatic && (steedosField.type === 'lookup' || steedosField.type === 'master_detail'))) return [3 /*break*/, 2];
21549
21635
  defaultSource = {
21550
21636
  "method": "post",
@@ -21566,28 +21652,59 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
21566
21652
  defaultSource.adaptor = "\n var options = ".concat(JSON.stringify(steedosField.options), "\n if(api.body.$term){\n options = _.filter(options, function(o) {\n var label = o.label;\n return label.toLowerCase().indexOf(api.body.$term.toLowerCase()) > -1;\n });\n }\n if(!payload.data){\n payload.data = {};\n }\n payload.data.options = options;\n return payload;\n ");
21567
21653
  }
21568
21654
  }
21569
- source = ((_c = steedosField.amis) === null || _c === void 0 ? void 0 : _c.source) || ((_d = steedosField.amis) === null || _d === void 0 ? void 0 : _d.autoComplete) || defaultSource;
21655
+ source = ((_f = steedosField.amis) === null || _f === void 0 ? void 0 : _f.source) || ((_g = steedosField.amis) === null || _g === void 0 ? void 0 : _g.autoComplete) || defaultSource;
21570
21656
  schema = Object.assign({}, {
21571
21657
  type: 'select',
21572
21658
  multiple: steedosField.multiple,
21573
21659
  name: steedosField.name,
21574
21660
  label: steedosField.label,
21575
21661
  static: true,
21576
- className: (_e = steedosField.amis) === null || _e === void 0 ? void 0 : _e.className,
21662
+ className: (_h = steedosField.amis) === null || _h === void 0 ? void 0 : _h.className,
21577
21663
  source: source,
21578
21664
  }, _$1.pick(steedosField.amis || {}, ['className', 'inline', 'label', 'labelAlign', 'name', 'labelRemark', 'description', 'placeholder', 'staticClassName', 'staticLabelClassName', 'staticInputClassName', 'staticSchema']));
21579
21665
  schema.placeholder = "";
21580
- if (hideLabel) {
21581
- delete schema.label;
21582
- }
21583
21666
  return [2 /*return*/, schema];
21584
21667
  case 2:
21585
- if (!fStatic) return [3 /*break*/, 13];
21668
+ if (!fStatic) return [3 /*break*/, 15];
21586
21669
  if (!props.data.hasOwnProperty("_display")) return [3 /*break*/, 4];
21587
21670
  return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
21588
- case 3:
21589
- // 有_display时保持原来的逻辑不变,不走以下新的逻辑,审批王中会特意传入_display以跳过后面新加的代码
21590
- return [2 /*return*/, _f.sent()];
21671
+ case 3:
21672
+ fieldSchema = _j.sent();
21673
+ if (steedosField.type === 'file' && fieldSchema.disabled) {
21674
+ fieldValue = fieldSchema.value;
21675
+ if (fieldValue && fieldValue.length) {
21676
+ hasImageOrFile_1 = false;
21677
+ _$1.forEach(fieldValue, function (item) {
21678
+ var fileName = item.name;
21679
+ if ([".pdf", ".jpg", ".jpeg", ".png", ".gif"].indexOf(fileName.slice(-4)) > -1) {
21680
+ hasImageOrFile_1 = true;
21681
+ }
21682
+ });
21683
+ if (!hasImageOrFile_1) {
21684
+ return [2 /*return*/, fieldSchema];
21685
+ }
21686
+ fieldHtml_1 = "";
21687
+ _$1.forEach(fieldValue, function (item) {
21688
+ var fileName = item.name;
21689
+ var fileUrl = item.url;
21690
+ var filePreviewHtml = '';
21691
+ if ([".pdf", ".jpg", ".jpeg", ".png", ".gif"].indexOf(fileName.slice(-4)) > -1) {
21692
+ var indexOfQuestionMark = fileUrl.indexOf('?');
21693
+ if (indexOfQuestionMark > -1) {
21694
+ var filePreviewUrl = fileUrl.substring(0, indexOfQuestionMark);
21695
+ filePreviewHtml = "&ensp;<a href=\"".concat(filePreviewUrl, "\" target=\"_blank\" class=\"antd-Link\"><span class=\"antd-TplField\"><span>\u9884\u89C8</span></span></a>");
21696
+ }
21697
+ }
21698
+ var tpl = "\n <div class=\"antd-FileControl-itemInfo flex-wrap\">\n <span class=\"antd-FileControl-itemInfoIcon flex justify-center items-center\"><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 14 16\" class=\"icon icon-file\"><path d=\"M0 0v16h14V4.001L9.939 0H0Zm1 1h8v4h4v10H1V1Zm9 .464 2.575 2.537H10V1.464Z\"></path><path d=\"M4 12h6v-1H4zM4 9h6V8H4z\"></path></svg></span>\n <a class=\"antd-FileControl-itemInfoText\" target=\"_blank\" rel=\"noopener\" href=\"".concat(fileUrl, "\">").concat(fileName, "</a>\n ").concat(filePreviewHtml ? filePreviewHtml : '', "\n </div>\n ");
21699
+ fieldHtml_1 += tpl;
21700
+ });
21701
+ return [2 /*return*/, {
21702
+ "type": "tpl",
21703
+ "tpl": fieldHtml_1
21704
+ }];
21705
+ }
21706
+ }
21707
+ return [2 /*return*/, fieldSchema];
21591
21708
  case 4:
21592
21709
  schema = Object.assign({}, steedosField, {
21593
21710
  type: getAmisStaticFieldType(steedosField.type, steedosField.data_type, steedosField),
@@ -21600,33 +21717,75 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
21600
21717
  timeFormat: 'HH:mm',
21601
21718
  format: '1970-01-01THH:mm:00.000[Z]',
21602
21719
  });
21603
- return [3 /*break*/, 12];
21720
+ return [3 /*break*/, 14];
21604
21721
  case 5:
21605
21722
  if (!(steedosField.type === "percent")) return [3 /*break*/, 6];
21606
21723
  Object.assign(schema, {
21607
21724
  "percent": steedosField.scale ? steedosField.scale : true
21608
21725
  });
21609
- return [3 /*break*/, 12];
21726
+ return [3 /*break*/, 14];
21610
21727
  case 6:
21611
21728
  if (!(steedosField.type === "password")) return [3 /*break*/, 7];
21612
21729
  Object.assign(schema, {
21613
21730
  "revealPassword": false //没生效,需要用样式隐藏
21614
21731
  });
21615
- return [3 /*break*/, 12];
21732
+ return [3 /*break*/, 14];
21616
21733
  case 7:
21617
21734
  if (!(steedosField.type === "select")) return [3 /*break*/, 8];
21618
21735
  Object.assign(schema, {
21619
21736
  "placeholder": ""
21620
21737
  });
21621
- return [3 /*break*/, 12];
21738
+ return [3 /*break*/, 14];
21622
21739
  case 8:
21623
21740
  if (!(steedosField.type === "color")) return [3 /*break*/, 9];
21624
21741
  Object.assign(schema, {
21625
21742
  "defaultColor": null
21626
21743
  });
21627
- return [3 /*break*/, 12];
21744
+ return [3 /*break*/, 14];
21628
21745
  case 9:
21629
- if (!(steedosField.type === "image")) return [3 /*break*/, 10];
21746
+ if (!(steedosField.type === "number")) return [3 /*break*/, 10];
21747
+ // amis input-number和number组件中的precision表示小数位数,并不是魔方平台的精度概念,要转换下,否则小数点后会显示很多的0
21748
+ Object.assign(schema, {
21749
+ "precision": steedosField.scale || 0
21750
+ });
21751
+ return [3 /*break*/, 14];
21752
+ case 10:
21753
+ if (!(steedosField.type === "table")) return [3 /*break*/, 11];
21754
+ if (steedosField.subFields) {
21755
+ tableFields = [];
21756
+ try {
21757
+ for (_c = __values(field.subFields), _d = _c.next(); !_d.done; _d = _c.next()) {
21758
+ subField = _d.value;
21759
+ if (!subField.name.endsWith(".$")) {
21760
+ subFieldName = subField.name.replace("".concat(field._prefix || '').concat(field.name, ".$."), '').replace("".concat(field.name, "."), '');
21761
+ // const gridSub = await convertSFieldToAmisField(Object.assign({}, subField, {name: subFieldName, isTableField: true}), readonly, ctx);
21762
+ tableFields.push(Object.assign({}, subField, { name: subFieldName }));
21763
+ }
21764
+ }
21765
+ }
21766
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
21767
+ finally {
21768
+ try {
21769
+ if (_d && !_d.done && (_e = _c.return)) _e.call(_c);
21770
+ }
21771
+ finally { if (e_1) throw e_1.error; }
21772
+ }
21773
+ Object.assign(schema, {
21774
+ type: 'steedos-input-table',
21775
+ showIndex: true,
21776
+ editable: false,
21777
+ addable: false,
21778
+ removable: false,
21779
+ draggable: false,
21780
+ fields: tableFields,
21781
+ amis: {
21782
+ columnsTogglable: false
21783
+ }
21784
+ });
21785
+ }
21786
+ return [3 /*break*/, 14];
21787
+ case 11:
21788
+ if (!(steedosField.type === "image")) return [3 /*break*/, 12];
21630
21789
  Object.assign(schema, {
21631
21790
  enlargeAble: true,
21632
21791
  showToolbar: true,
@@ -21657,21 +21816,18 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
21657
21816
  return value;
21658
21817
  }
21659
21818
  });
21660
- return [3 /*break*/, 12];
21661
- case 10:
21662
- if (!(steedosField.type === "file")) return [3 /*break*/, 12];
21819
+ return [3 /*break*/, 14];
21820
+ case 12:
21821
+ if (!(steedosField.type === "file")) return [3 /*break*/, 14];
21663
21822
  return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
21664
- case 11:
21823
+ case 13:
21665
21824
  // 附件static模式先保持原来的逻辑,依赖_display,审批王中相关功能在creator中
21666
21825
  // convertSFieldToAmisField中会合并steedosField.amis,所以也不需要再次合并steedosField.amis,直接return就好
21667
- return [2 /*return*/, _f.sent()];
21668
- case 12:
21826
+ return [2 /*return*/, _j.sent()];
21827
+ case 14:
21669
21828
  Object.assign(schema, steedosField.amis || {});
21670
- if (hideLabel) {
21671
- delete schema.label;
21672
- }
21673
21829
  return [2 /*return*/, schema];
21674
- case 13:
21830
+ case 15:
21675
21831
  fieldAmis = steedosField.amis || {};
21676
21832
  if (!props.data.hasOwnProperty("_display")) {
21677
21833
  // 有_display时保持原来的逻辑不变,不走以下新的逻辑,审批王中会特意传入_display以跳过后面新加的代码
@@ -21729,19 +21885,16 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
21729
21885
  }
21730
21886
  }
21731
21887
  return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
21732
- case 14:
21733
- schema = _f.sent();
21734
- if (hideLabel) {
21735
- delete schema.label;
21736
- }
21888
+ case 16:
21889
+ schema = _j.sent();
21737
21890
  // console.log(`AmisSteedosField return schema`, schema)
21738
21891
  return [2 /*return*/, schema];
21739
- case 15: return [3 /*break*/, 17];
21740
- case 16:
21741
- error_1 = _f.sent();
21892
+ case 17: return [3 /*break*/, 19];
21893
+ case 18:
21894
+ error_1 = _j.sent();
21742
21895
  console.log("error", error_1);
21743
- return [3 /*break*/, 17];
21744
- case 17: return [2 /*return*/, null];
21896
+ return [3 /*break*/, 19];
21897
+ case 19: return [2 /*return*/, null];
21745
21898
  }
21746
21899
  });
21747
21900
  }); };