@steedos-widgets/sortable 6.3.4 → 6.3.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.
@@ -54499,12 +54499,18 @@ function getAmisStaticFieldType(type, readonly, options){
54499
54499
  * @Author: baozhoutao@steedos.com
54500
54500
  * @Date: 2022-07-13 15:18:03
54501
54501
  * @LastEditors: baozhoutao@steedos.com
54502
- * @LastEditTime: 2023-04-11 10:34:26
54502
+ * @LastEditTime: 2024-08-15 12:12:08
54503
54503
  * @Description:
54504
54504
  */
54505
+ let pageCache = {};
54505
54506
 
54506
54507
  async function getPage({type, pageId = '', appId, objectName = '', recordId = '', formFactor = 'LARGE'}){
54507
54508
  const api = `/api/pageSchema/${type}?app=${appId}&objectApiName=${objectName}&recordId=${recordId}&pageId=${pageId}&formFactor=${formFactor}`;
54509
+
54510
+ if(lodash.exports.has(pageCache, api)) {
54511
+ return pageCache[api];
54512
+ }
54513
+
54508
54514
  const page = await fetchAPI(api);
54509
54515
  if (page && page.schema) {
54510
54516
  page.schema = JSON.parse(page.schema);
@@ -54514,8 +54520,10 @@ async function getPage({type, pageId = '', appId, objectName = '', recordId = ''
54514
54520
  delete page.schema.data.context;
54515
54521
  delete page.schema.data.global;
54516
54522
  }
54517
- return page;
54523
+ pageCache[api] = page;
54524
+ return JSON.parse(JSON.stringify(page)); //clone page;
54518
54525
  }
54526
+ pageCache[api] = null;
54519
54527
  }
54520
54528
 
54521
54529
  /*
@@ -58323,7 +58331,7 @@ const getSettingListviewToolbarButtonSchema = ()=>{
58323
58331
  // "tooltip": i18next.t('frontend_button_listview_control_tooltip'),
58324
58332
  "btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded text-gray-500",
58325
58333
  "align": "right",
58326
- "visibleOn": "${!isLookup}",
58334
+ "visibleOn": "${!isLookup && !!isObjectListview}",
58327
58335
  "buttons": [
58328
58336
  {
58329
58337
  "label": instance.t('frontend_button_listview_control_label'),
@@ -58368,7 +58376,7 @@ const getDisplayAsButton = function(objectName, defaultEnableSplit){
58368
58376
  // "tooltip": `${i18next.t('frontend_display_as')} ${displayAsLabel}`,
58369
58377
  "btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded text-gray-500",
58370
58378
  "align": "right",
58371
- "visibleOn": "${window:innerWidth > 768 && !!!isLookup}",
58379
+ "visibleOn": "${window:innerWidth > 768 && !!!isLookup && !!isObjectListview}",
58372
58380
  "buttons": [
58373
58381
  {
58374
58382
  "label": instance.t('frontend_display_as'),
@@ -61201,9 +61209,21 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
61201
61209
  break;
61202
61210
  case 'percent':
61203
61211
  if(readonly){
61212
+ // convertData = {
61213
+ // type: 'static-tpl',
61214
+ // tpl: Tpl.getUiFieldTpl(field)
61215
+ // }
61204
61216
  convertData = {
61205
- type: 'static-tpl',
61206
- tpl: getUiFieldTpl(field)
61217
+ "type": "static-progress",
61218
+ "name": "progress",
61219
+ pipeIn: (value, data) => {
61220
+ if(value){
61221
+ // 因为例如 1.11 * 100 的值不是111,所以调整下。
61222
+ const result = value*100;
61223
+ return Number(result.toFixed(field.scale));
61224
+ }
61225
+ return value;
61226
+ }
61207
61227
  };
61208
61228
  }else {
61209
61229
  convertData = {