@steedos-widgets/amis-object 6.3.4 → 6.3.6

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.
@@ -4341,12 +4341,18 @@ function getAmisStaticFieldType$1(type, readonly, options){
4341
4341
  * @Author: baozhoutao@steedos.com
4342
4342
  * @Date: 2022-07-13 15:18:03
4343
4343
  * @LastEditors: baozhoutao@steedos.com
4344
- * @LastEditTime: 2023-04-11 10:34:26
4344
+ * @LastEditTime: 2024-08-15 12:12:08
4345
4345
  * @Description:
4346
4346
  */
4347
+ let pageCache = {};
4347
4348
 
4348
4349
  async function getPage({type, pageId = '', appId, objectName = '', recordId = '', formFactor = 'LARGE'}){
4349
4350
  const api = `/api/pageSchema/${type}?app=${appId}&objectApiName=${objectName}&recordId=${recordId}&pageId=${pageId}&formFactor=${formFactor}`;
4351
+
4352
+ if(_$1.has(pageCache, api)) {
4353
+ return pageCache[api];
4354
+ }
4355
+
4350
4356
  const page = await fetchAPI(api);
4351
4357
  if (page && page.schema) {
4352
4358
  page.schema = JSON.parse(page.schema);
@@ -4356,15 +4362,17 @@ async function getPage({type, pageId = '', appId, objectName = '', recordId = ''
4356
4362
  delete page.schema.data.context;
4357
4363
  delete page.schema.data.global;
4358
4364
  }
4359
- return page;
4365
+ pageCache[api] = page;
4366
+ return JSON.parse(JSON.stringify(page)); //clone page;
4360
4367
  }
4368
+ pageCache[api] = null;
4361
4369
  }
4362
4370
 
4363
4371
  /*
4364
4372
  * @Author: baozhoutao@steedos.com
4365
4373
  * @Date: 2022-10-28 14:15:09
4366
- * @LastEditors: liaodaxue
4367
- * @LastEditTime: 2023-12-29 10:46:50
4374
+ * @LastEditors: baozhoutao@steedos.com
4375
+ * @LastEditTime: 2024-08-19 16:26:58
4368
4376
  * @Description:
4369
4377
  */
4370
4378
 
@@ -4570,6 +4578,11 @@ const getAmisFileEditSchema = (steedosField)=>{
4570
4578
  convertData.multiple = true;
4571
4579
  convertData.joinValues = false;
4572
4580
  convertData.extractValue = true;
4581
+ if(steedosField.type === 'image'){
4582
+ if(Steedos.isCordova() && Steedos.isCordova()){
4583
+ convertData.accept = "";
4584
+ }
4585
+ }
4573
4586
  }
4574
4587
  return convertData;
4575
4588
  };
@@ -11908,7 +11921,7 @@ const getSettingListviewToolbarButtonSchema = ()=>{
11908
11921
  // "tooltip": i18next.t('frontend_button_listview_control_tooltip'),
11909
11922
  "btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded text-gray-500",
11910
11923
  "align": "right",
11911
- "visibleOn": "${!isLookup}",
11924
+ "visibleOn": "${!isLookup && !!isObjectListview}",
11912
11925
  "buttons": [
11913
11926
  {
11914
11927
  "label": instance.t('frontend_button_listview_control_label'),
@@ -11953,7 +11966,7 @@ const getDisplayAsButton = function(objectName, defaultEnableSplit){
11953
11966
  // "tooltip": `${i18next.t('frontend_display_as')} ${displayAsLabel}`,
11954
11967
  "btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded text-gray-500",
11955
11968
  "align": "right",
11956
- "visibleOn": "${window:innerWidth > 768 && !!!isLookup}",
11969
+ "visibleOn": "${window:innerWidth > 768 && !!!isLookup && !!isObjectListview}",
11957
11970
  "buttons": [
11958
11971
  {
11959
11972
  "label": instance.t('frontend_display_as'),
@@ -16628,9 +16641,21 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
16628
16641
  break;
16629
16642
  case 'percent':
16630
16643
  if(readonly){
16644
+ // convertData = {
16645
+ // type: 'static-tpl',
16646
+ // tpl: Tpl.getUiFieldTpl(field)
16647
+ // }
16631
16648
  convertData = {
16632
- type: 'static-tpl',
16633
- tpl: getUiFieldTpl(field)
16649
+ "type": "static-progress",
16650
+ "name": "progress",
16651
+ pipeIn: (value, data) => {
16652
+ if(value){
16653
+ // 因为例如 1.11 * 100 的值不是111,所以调整下。
16654
+ const result = value*100;
16655
+ return Number(result.toFixed(field.scale));
16656
+ }
16657
+ return value;
16658
+ }
16634
16659
  };
16635
16660
  }else {
16636
16661
  convertData = {
@@ -22370,7 +22395,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
22370
22395
  headerSchema = getObjectListHeader$1(uiSchema, listName, ctx);
22371
22396
  }
22372
22397
  headerSchema.className = "steedos-object-listview-header " + headerSchema.className || "";
22373
- serviceData = Object.assign({}, { showDisplayAs: showDisplayAs, displayAs: displayAs, recordPermissions: uiSchema.permissions, _id: null, $listviewId: listName });
22398
+ serviceData = Object.assign({}, { showDisplayAs: showDisplayAs, displayAs: displayAs, recordPermissions: uiSchema.permissions, _id: null, $listviewId: listName, isObjectListview: true });
22374
22399
  if (_$1.has(props, 'objectApiName')) {
22375
22400
  serviceData.objectName = objectApiName;
22376
22401
  }
@@ -24793,6 +24818,18 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
24793
24818
  disabled: true
24794
24819
  });
24795
24820
  }
24821
+ else if (steedosField.type === 'url' && steedosField.show_as_qr) {
24822
+ Object.assign(schema, {
24823
+ type: "control",
24824
+ body: [
24825
+ {
24826
+ "type": "qr-code",
24827
+ "codeSize": inInputTable ? 64 : 128,
24828
+ "name": steedosField.name
24829
+ }
24830
+ ]
24831
+ });
24832
+ }
24796
24833
  Object.assign(schema, steedosField.amis || {});
24797
24834
  return [2 /*return*/, schema];
24798
24835
  case 19: