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

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,15 @@ 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
+ /* amis3.6.3 .antd-Picker-input类中多了 overflow: auto; 样式 */
317
+ .antd-Picker-input{
318
+ overflow: hidden;
319
+ }
320
+
312
321
  .ant-dropdown-menu {
313
322
  border: 1px solid #e5e5e5;
314
323
  border-radius: 0.25rem;
@@ -1864,43 +1873,42 @@ body.steedos {
1864
1873
 
1865
1874
  @media (min-width: 767px) {
1866
1875
  /* 列表快速编辑功能样式 */
1867
- .steedos-object-table thead tr th:nth-child(2) {
1868
- display: none;
1869
- }
1870
- .steedos-object-table.is-steedos-tree-table thead tr th:nth-child(3) {
1871
- display: none;
1872
- }
1873
- .steedos-object-table.is-steedos-tree-table thead tr th:nth-child(2) {
1874
- display: table-cell;
1876
+ /* amis3.2版本快速编辑单元格样式:start */
1877
+ body.amis-3-2 .steedos-object-table tbody td.antd-Field--quickEditable > div {
1878
+ display: flex;
1879
+ align-items: center;
1880
+ justify-content: space-between;
1875
1881
  }
1876
- .steedos-object-table.is-steedos-tree-table .is-steedos-crud-data-empty thead tr th:nth-child(2),
1877
- .steedos-object-table.is-steedos-tree-table .is-steedos-crud-data-empty thead tr th:nth-child(3) {
1878
- display: table-cell;
1882
+ body.amis-3-2 .steedos-object-table tbody td.antd-Field--quickEditable > div .antd-Field-quickEditBtn {
1883
+ padding-right: 13px;
1879
1884
  }
1880
- .steedos-object-table.is-steedos-tree-table .is-steedos-crud-data-empty thead tr th:nth-child(1) {
1885
+ body.amis-3-2 .steedos-object-table tbody td.antd-Field--quickEditable > div .antd-Field-quickEditBtn svg {
1881
1886
  display: none;
1882
1887
  }
1883
- .steedos-object-table .is-steedos-crud-data-empty thead tr th:nth-child(3) {
1884
- display: table-cell;
1888
+ body.amis-3-2 .steedos-object-table tbody td.antd-Field--quickEditable:hover div .antd-Field-quickEditBtn {
1889
+ padding-right: 0;
1890
+ }
1891
+ body.amis-3-2 .steedos-object-table tbody td.antd-Field--quickEditable:hover div .antd-Field-quickEditBtn svg {
1892
+ display: inline-block;
1885
1893
  }
1886
- .steedos-object-table .is-steedos-crud-data-empty thead tr th:nth-child(2) {
1894
+ /* amis3.2版本快速编辑单元格样式:end */
1895
+ .steedos-object-table thead tr th:nth-last-child(2),
1896
+ .steedos-object-table colgroup col:nth-last-child(2) {
1887
1897
  display: none;
1888
1898
  }
1889
- .steedos-object-table tbody td.antd-Field--quickEditable > div {
1890
- display: flex;
1891
- align-items: center;
1892
- justify-content: space-between;
1899
+ .steedos-object-table tbody td.antd-Field--quickEditable > .antd-Form-static {
1900
+ display: inline;
1893
1901
  }
1894
- .steedos-object-table tbody td.antd-Field--quickEditable > div .antd-Field-quickEditBtn {
1902
+ .steedos-object-table tbody td.antd-Field--quickEditable .antd-Field-quickEditBtn {
1895
1903
  padding-right: 13px;
1896
1904
  }
1897
- .steedos-object-table tbody td.antd-Field--quickEditable > div .antd-Field-quickEditBtn svg {
1905
+ .steedos-object-table tbody td.antd-Field--quickEditable .antd-Field-quickEditBtn svg {
1898
1906
  display: none;
1899
1907
  }
1900
- .steedos-object-table tbody td.antd-Field--quickEditable:hover div .antd-Field-quickEditBtn {
1908
+ .steedos-object-table tbody td.antd-Field--quickEditable:hover .antd-Field-quickEditBtn {
1901
1909
  padding-right: 0;
1902
1910
  }
1903
- .steedos-object-table tbody td.antd-Field--quickEditable:hover div .antd-Field-quickEditBtn svg {
1911
+ .steedos-object-table tbody td.antd-Field--quickEditable:hover .antd-Field-quickEditBtn svg {
1904
1912
  display: inline-block;
1905
1913
  }
1906
1914
  .steedos-object-table .date-min-w {
@@ -1919,6 +1927,11 @@ body.steedos {
1919
1927
  height: var(--Table-placeholder-height);
1920
1928
  }
1921
1929
  }
1930
+ @media (max-width: 768px) {
1931
+ .steedos-object-table .antd-Table-table > tbody > tr + tr {
1932
+ border-top: none;
1933
+ }
1934
+ }
1922
1935
  .steedos-object-table.steedos-crud-mode-cards .antd-Crud {
1923
1936
  height: 100%;
1924
1937
  }
@@ -2190,6 +2203,7 @@ body.sidebar #sidebar {
2190
2203
  }
2191
2204
  }
2192
2205
 
2206
+
2193
2207
  .steedos-select-flow-service .antd-TreeControl > .antd-Tree {
2194
2208
  max-height: unset;
2195
2209
  }
@@ -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;
@@ -4967,7 +4979,7 @@ async function getQuickEditSchema(field, options){
4967
4979
  "actions":[
4968
4980
  {
4969
4981
  "actionType": "setValue",
4970
- "componentId": `service_listview_${options.objectName}`,
4982
+ "componentId": quickEditId,
4971
4983
  "args": {
4972
4984
  "value":{
4973
4985
  "quickedit_record_permissions_loading": true
@@ -4992,7 +5004,7 @@ async function getQuickEditSchema(field, options){
4992
5004
  },
4993
5005
  {
4994
5006
  "actionType": "setValue",
4995
- "componentId": `service_listview_${options.objectName}`,
5007
+ "componentId": quickEditId,
4996
5008
  "args": {
4997
5009
  "value":{
4998
5010
  "quickedit_record_permissions_loading": false
@@ -5001,7 +5013,7 @@ async function getQuickEditSchema(field, options){
5001
5013
  },
5002
5014
  {
5003
5015
  "actionType": "setValue",
5004
- "componentId": `service_listview_${options.objectName}`,
5016
+ "componentId": quickEditId,
5005
5017
  "args": {
5006
5018
  "value":{
5007
5019
  "quickedit_record_permissions": "${event.data}"
@@ -5180,8 +5192,6 @@ function getFieldWidth(width){
5180
5192
  async function getTableColumns$1(fields, options){
5181
5193
  const columns = [];
5182
5194
  if(!options.isLookup && !options.isInputTable){
5183
- //将_display放入crud的columns中,可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
5184
- columns.push({name: '_display',type: 'static', width: 32, placeholder: "",id: "_display_${_index}", className: "hidden"});
5185
5195
  if(!options.enable_tree){
5186
5196
  columns.push({name: '_index',type: 'text', width: 32, placeholder: ""});
5187
5197
  }
@@ -5726,6 +5736,7 @@ async function getTableSchema$1(fields, options){
5726
5736
  if(!isLookup && !hiddenColumnOperation){
5727
5737
  columns.push(await getTableOperation(options));
5728
5738
  }
5739
+
5729
5740
  }
5730
5741
 
5731
5742
  return {
@@ -6834,6 +6845,7 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
6834
6845
  "dialog": {
6835
6846
  "type": "dialog",
6836
6847
  "title": title,
6848
+ data,
6837
6849
  "body": [
6838
6850
  {
6839
6851
  "type": "steedos-object-form",
@@ -11506,6 +11518,11 @@ async function getObjectCRUD(objectSchema, fields, options){
11506
11518
  crudModeClassName = `steedos-crud-mode-${body.mode}`;
11507
11519
  }
11508
11520
 
11521
+ if(body.columns && options.formFactor != 'SMALL'){
11522
+ //将_display放入crud的columns的倒数第二列中(最后一列会影响固定列),可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
11523
+ body.columns.splice(body.columns.length - 1, 0, {name: '_display',type: 'static', width: 32, placeholder: "",id: "_display_${_index}", className: "hidden"});
11524
+ }
11525
+
11509
11526
  if (defaults) {
11510
11527
  const headerSchema = defaults.headerSchema;
11511
11528
  const footerSchema = defaults.footerSchema;
@@ -11530,6 +11547,7 @@ async function getObjectCRUD(objectSchema, fields, options){
11530
11547
  body = wrappedBody;
11531
11548
  }
11532
11549
  }
11550
+
11533
11551
  // console.timeEnd('getObjectCRUD');
11534
11552
  // TODO: data应该只留loaded,其他属性都改为从上层传递下来
11535
11553
  return {
@@ -13732,6 +13750,9 @@ async function lookupToAmisPicker(field, readonly, ctx){
13732
13750
  */
13733
13751
  return payload;
13734
13752
  }
13753
+ if(!payload.data.rows){
13754
+ payload.data.rows = [];
13755
+ }
13735
13756
  if(enable_tree){
13736
13757
  const records = payload.data.rows;
13737
13758
  const treeRecords = [];
@@ -15601,7 +15622,7 @@ async function getFormBody(permissionFields, formFields, ctx){
15601
15622
  * @Author: 殷亮辉 yinlianghui@hotoa.com
15602
15623
  * @Date: 2023-11-15 09:50:22
15603
15624
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
15604
- * @LastEditTime: 2023-12-25 13:13:56
15625
+ * @LastEditTime: 2023-12-27 13:50:26
15605
15626
  */
15606
15627
 
15607
15628
  /**
@@ -15629,20 +15650,22 @@ function getInputTableCell(field, showAsInlineEditMode) {
15629
15650
  name: field.name,
15630
15651
  quickEdit: {
15631
15652
  "type": "steedos-field",
15632
- "config": field,
15633
- hideLabel: true
15653
+ "config": Object.assign({}, field, {
15654
+ label: false
15655
+ })
15634
15656
  }
15635
15657
  }
15636
15658
  }
15637
15659
  else {
15638
15660
  return {
15639
15661
  "type": "steedos-field",
15640
- "config": field,
15662
+ "config": Object.assign({}, field, {
15663
+ label: false
15664
+ }),
15641
15665
  "static": true,
15642
15666
  "readonly": true,
15643
15667
  label: field.label,
15644
- name: field.name,
15645
- hideLabel: true
15668
+ name: field.name
15646
15669
  }
15647
15670
  }
15648
15671
  }
@@ -15888,7 +15911,9 @@ function getFormPaginationWrapper(props, form, mode) {
15888
15911
  let __wrapperServiceId = "${tableServiceId}";
15889
15912
  let wrapperService = scope.getComponentById(__wrapperServiceId);
15890
15913
  let wrapperServiceData = wrapperService.getData();
15891
- let lastestFieldValue = wrapperServiceData["${props.name}"] || [];//这里不可以用event.data["${props.name}"]因为amis input talbe有一层单独的作用域,其值会延迟一拍
15914
+ // 这里不可以用event.data["${props.name}"]因为amis input talbe有一层单独的作用域,其值会延迟一拍
15915
+ // 这里如果不.clone的话,在弹出窗口中显示的子表组件,添加行后点窗口的取消按钮关闭窗口后无法把之前的操作还原,即把之前添加的行自动移除
15916
+ let lastestFieldValue = _.clone(wrapperServiceData["${props.name}"] || []);
15892
15917
  //不可以直接像event.data.__tableItems = lastestFieldValue; 这样整个赋值,否则作用域会断
15893
15918
  let mode = "${mode}";
15894
15919
  if(mode === "new"){
@@ -16480,7 +16505,7 @@ const getAmisInputTableSchema = async (props) => {
16480
16505
  "name": "__op__",
16481
16506
  "type": "operation",
16482
16507
  "buttons": buttonsForColumnOperations,
16483
- "width": buttonsForColumnOperations.length > 1 ? "46px" : "20px"
16508
+ "width": buttonsForColumnOperations.length > 1 ? "60px" : "20px"
16484
16509
  });
16485
16510
  }
16486
16511
  if (showAsInlineEditMode) {
@@ -19899,6 +19924,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
19899
19924
  },
19900
19925
  {
19901
19926
  "actionType": "reload",
19927
+ "componentId": "listview_" + objectApiName,
19902
19928
  "expression": "${(event.data.recordId || event.data.__deletedRecord === true || event.data.displayAs === 'split') && event.data._isRelated != true}" //不是新建, 或分栏模式下新建主对象记录, 则刷新列表
19903
19929
  }
19904
19930
  ]
@@ -21495,7 +21521,7 @@ function getAmisStaticFieldType(type, data_type, options) {
21495
21521
  return "number";
21496
21522
  }
21497
21523
  else if (type === 'autonumber') {
21498
- return "text";
21524
+ return "input-text"; //不可以用text,因为会出现字段label显示不出来的问题
21499
21525
  }
21500
21526
  else if (type === 'percent') {
21501
21527
  return "number";
@@ -21515,13 +21541,14 @@ function getAmisStaticFieldType(type, data_type, options) {
21515
21541
  return type;
21516
21542
  }
21517
21543
  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) {
21544
+ 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;
21545
+ var e_1, _e;
21546
+ var _f, _g, _h;
21547
+ return __generator(this, function (_j) {
21548
+ switch (_j.label) {
21522
21549
  case 0:
21523
21550
  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;
21551
+ 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
21552
  // console.log(`AmisSteedosField`, props)
21526
21553
  // if($schema.config && isString($schema.config)){
21527
21554
  // $schema.config = JSON.parse($schema.config)
@@ -21538,13 +21565,20 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
21538
21565
  // 这里要clone是因为后面图片字段类型执行steedosField.amis = ...的时候会造成input-table中的图片字段在弹出编辑表单点击确认后整个input-table组件重新渲染了,从而导致其翻页功能异常
21539
21566
  steedosField = _$1.clone(steedosField);
21540
21567
  }
21568
+ // if (props.label && !steedosField.label) {
21569
+ // steedosField.label = props.label;
21570
+ // }
21571
+ if (typeof props.label === "string" || props.label === false) {
21572
+ // 始终优先取组件上配置的label,且可以通过配置组件的label属性值为false来隐藏字段label
21573
+ steedosField.label = props.label;
21574
+ }
21541
21575
  if (!fStatic && steedosField.readonly && !props.data.hasOwnProperty("_display")) {
21542
21576
  // 字段配置为只读,强制走fStatic模式,加上_display判断是为了不影响历史代码,比如直接在ObjectForm中调用steedos-field组件
21543
21577
  fStatic = true;
21544
21578
  }
21545
- _f.label = 1;
21579
+ _j.label = 1;
21546
21580
  case 1:
21547
- _f.trys.push([1, 16, , 17]);
21581
+ _j.trys.push([1, 18, , 19]);
21548
21582
  if (!(fStatic && (steedosField.type === 'lookup' || steedosField.type === 'master_detail'))) return [3 /*break*/, 2];
21549
21583
  defaultSource = {
21550
21584
  "method": "post",
@@ -21566,28 +21600,59 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
21566
21600
  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
21601
  }
21568
21602
  }
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;
21603
+ 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
21604
  schema = Object.assign({}, {
21571
21605
  type: 'select',
21572
21606
  multiple: steedosField.multiple,
21573
21607
  name: steedosField.name,
21574
21608
  label: steedosField.label,
21575
21609
  static: true,
21576
- className: (_e = steedosField.amis) === null || _e === void 0 ? void 0 : _e.className,
21610
+ className: (_h = steedosField.amis) === null || _h === void 0 ? void 0 : _h.className,
21577
21611
  source: source,
21578
21612
  }, _$1.pick(steedosField.amis || {}, ['className', 'inline', 'label', 'labelAlign', 'name', 'labelRemark', 'description', 'placeholder', 'staticClassName', 'staticLabelClassName', 'staticInputClassName', 'staticSchema']));
21579
21613
  schema.placeholder = "";
21580
- if (hideLabel) {
21581
- delete schema.label;
21582
- }
21583
21614
  return [2 /*return*/, schema];
21584
21615
  case 2:
21585
- if (!fStatic) return [3 /*break*/, 13];
21616
+ if (!fStatic) return [3 /*break*/, 15];
21586
21617
  if (!props.data.hasOwnProperty("_display")) return [3 /*break*/, 4];
21587
21618
  return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
21588
- case 3:
21589
- // 有_display时保持原来的逻辑不变,不走以下新的逻辑,审批王中会特意传入_display以跳过后面新加的代码
21590
- return [2 /*return*/, _f.sent()];
21619
+ case 3:
21620
+ fieldSchema = _j.sent();
21621
+ if (steedosField.type === 'file' && fieldSchema.disabled) {
21622
+ fieldValue = fieldSchema.value;
21623
+ if (fieldValue && fieldValue.length) {
21624
+ hasImageOrFile_1 = false;
21625
+ _$1.forEach(fieldValue, function (item) {
21626
+ var fileName = item.name;
21627
+ if ([".pdf", ".jpg", ".jpeg", ".png", ".gif"].indexOf(fileName.slice(-4)) > -1) {
21628
+ hasImageOrFile_1 = true;
21629
+ }
21630
+ });
21631
+ if (!hasImageOrFile_1) {
21632
+ return [2 /*return*/, fieldSchema];
21633
+ }
21634
+ fieldHtml_1 = "";
21635
+ _$1.forEach(fieldValue, function (item) {
21636
+ var fileName = item.name;
21637
+ var fileUrl = item.url;
21638
+ var filePreviewHtml = '';
21639
+ if ([".pdf", ".jpg", ".jpeg", ".png", ".gif"].indexOf(fileName.slice(-4)) > -1) {
21640
+ var indexOfQuestionMark = fileUrl.indexOf('?');
21641
+ if (indexOfQuestionMark > -1) {
21642
+ var filePreviewUrl = fileUrl.substring(0, indexOfQuestionMark);
21643
+ filePreviewHtml = "&ensp;<a href=\"".concat(filePreviewUrl, "\" target=\"_blank\" class=\"antd-Link\"><span class=\"antd-TplField\"><span>\u9884\u89C8</span></span></a>");
21644
+ }
21645
+ }
21646
+ 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 ");
21647
+ fieldHtml_1 += tpl;
21648
+ });
21649
+ return [2 /*return*/, {
21650
+ "type": "tpl",
21651
+ "tpl": fieldHtml_1
21652
+ }];
21653
+ }
21654
+ }
21655
+ return [2 /*return*/, fieldSchema];
21591
21656
  case 4:
21592
21657
  schema = Object.assign({}, steedosField, {
21593
21658
  type: getAmisStaticFieldType(steedosField.type, steedosField.data_type, steedosField),
@@ -21600,33 +21665,75 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
21600
21665
  timeFormat: 'HH:mm',
21601
21666
  format: '1970-01-01THH:mm:00.000[Z]',
21602
21667
  });
21603
- return [3 /*break*/, 12];
21668
+ return [3 /*break*/, 14];
21604
21669
  case 5:
21605
21670
  if (!(steedosField.type === "percent")) return [3 /*break*/, 6];
21606
21671
  Object.assign(schema, {
21607
21672
  "percent": steedosField.scale ? steedosField.scale : true
21608
21673
  });
21609
- return [3 /*break*/, 12];
21674
+ return [3 /*break*/, 14];
21610
21675
  case 6:
21611
21676
  if (!(steedosField.type === "password")) return [3 /*break*/, 7];
21612
21677
  Object.assign(schema, {
21613
21678
  "revealPassword": false //没生效,需要用样式隐藏
21614
21679
  });
21615
- return [3 /*break*/, 12];
21680
+ return [3 /*break*/, 14];
21616
21681
  case 7:
21617
21682
  if (!(steedosField.type === "select")) return [3 /*break*/, 8];
21618
21683
  Object.assign(schema, {
21619
21684
  "placeholder": ""
21620
21685
  });
21621
- return [3 /*break*/, 12];
21686
+ return [3 /*break*/, 14];
21622
21687
  case 8:
21623
21688
  if (!(steedosField.type === "color")) return [3 /*break*/, 9];
21624
21689
  Object.assign(schema, {
21625
21690
  "defaultColor": null
21626
21691
  });
21627
- return [3 /*break*/, 12];
21692
+ return [3 /*break*/, 14];
21628
21693
  case 9:
21629
- if (!(steedosField.type === "image")) return [3 /*break*/, 10];
21694
+ if (!(steedosField.type === "number")) return [3 /*break*/, 10];
21695
+ // amis input-number和number组件中的precision表示小数位数,并不是魔方平台的精度概念,要转换下,否则小数点后会显示很多的0
21696
+ Object.assign(schema, {
21697
+ "precision": steedosField.scale || 0
21698
+ });
21699
+ return [3 /*break*/, 14];
21700
+ case 10:
21701
+ if (!(steedosField.type === "table")) return [3 /*break*/, 11];
21702
+ if (steedosField.subFields) {
21703
+ tableFields = [];
21704
+ try {
21705
+ for (_c = __values(field.subFields), _d = _c.next(); !_d.done; _d = _c.next()) {
21706
+ subField = _d.value;
21707
+ if (!subField.name.endsWith(".$")) {
21708
+ subFieldName = subField.name.replace("".concat(field._prefix || '').concat(field.name, ".$."), '').replace("".concat(field.name, "."), '');
21709
+ // const gridSub = await convertSFieldToAmisField(Object.assign({}, subField, {name: subFieldName, isTableField: true}), readonly, ctx);
21710
+ tableFields.push(Object.assign({}, subField, { name: subFieldName }));
21711
+ }
21712
+ }
21713
+ }
21714
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
21715
+ finally {
21716
+ try {
21717
+ if (_d && !_d.done && (_e = _c.return)) _e.call(_c);
21718
+ }
21719
+ finally { if (e_1) throw e_1.error; }
21720
+ }
21721
+ Object.assign(schema, {
21722
+ type: 'steedos-input-table',
21723
+ showIndex: true,
21724
+ editable: false,
21725
+ addable: false,
21726
+ removable: false,
21727
+ draggable: false,
21728
+ fields: tableFields,
21729
+ amis: {
21730
+ columnsTogglable: false
21731
+ }
21732
+ });
21733
+ }
21734
+ return [3 /*break*/, 14];
21735
+ case 11:
21736
+ if (!(steedosField.type === "image")) return [3 /*break*/, 12];
21630
21737
  Object.assign(schema, {
21631
21738
  enlargeAble: true,
21632
21739
  showToolbar: true,
@@ -21657,21 +21764,18 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
21657
21764
  return value;
21658
21765
  }
21659
21766
  });
21660
- return [3 /*break*/, 12];
21661
- case 10:
21662
- if (!(steedosField.type === "file")) return [3 /*break*/, 12];
21767
+ return [3 /*break*/, 14];
21768
+ case 12:
21769
+ if (!(steedosField.type === "file")) return [3 /*break*/, 14];
21663
21770
  return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
21664
- case 11:
21771
+ case 13:
21665
21772
  // 附件static模式先保持原来的逻辑,依赖_display,审批王中相关功能在creator中
21666
21773
  // convertSFieldToAmisField中会合并steedosField.amis,所以也不需要再次合并steedosField.amis,直接return就好
21667
- return [2 /*return*/, _f.sent()];
21668
- case 12:
21774
+ return [2 /*return*/, _j.sent()];
21775
+ case 14:
21669
21776
  Object.assign(schema, steedosField.amis || {});
21670
- if (hideLabel) {
21671
- delete schema.label;
21672
- }
21673
21777
  return [2 /*return*/, schema];
21674
- case 13:
21778
+ case 15:
21675
21779
  fieldAmis = steedosField.amis || {};
21676
21780
  if (!props.data.hasOwnProperty("_display")) {
21677
21781
  // 有_display时保持原来的逻辑不变,不走以下新的逻辑,审批王中会特意传入_display以跳过后面新加的代码
@@ -21729,19 +21833,16 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
21729
21833
  }
21730
21834
  }
21731
21835
  return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
21732
- case 14:
21733
- schema = _f.sent();
21734
- if (hideLabel) {
21735
- delete schema.label;
21736
- }
21836
+ case 16:
21837
+ schema = _j.sent();
21737
21838
  // console.log(`AmisSteedosField return schema`, schema)
21738
21839
  return [2 /*return*/, schema];
21739
- case 15: return [3 /*break*/, 17];
21740
- case 16:
21741
- error_1 = _f.sent();
21840
+ case 17: return [3 /*break*/, 19];
21841
+ case 18:
21842
+ error_1 = _j.sent();
21742
21843
  console.log("error", error_1);
21743
- return [3 /*break*/, 17];
21744
- case 17: return [2 /*return*/, null];
21844
+ return [3 /*break*/, 19];
21845
+ case 19: return [2 /*return*/, null];
21745
21846
  }
21746
21847
  });
21747
21848
  }); };