@steedos-widgets/sortable 6.3.11-beta.7 → 6.3.11-beta.8

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.
@@ -53981,18 +53981,24 @@ const Router = {
53981
53981
  /*
53982
53982
  * @Author: baozhoutao@steedos.com
53983
53983
  * @Date: 2022-07-20 16:29:22
53984
- * @LastEditors: liaodaxue
53985
- * @LastEditTime: 2024-01-25 14:44:17
53984
+ * @LastEditors: baozhoutao@steedos.com
53985
+ * @LastEditTime: 2024-10-14 13:33:27
53986
53986
  * @Description:
53987
53987
  */
53988
53988
 
53989
- function getImageFieldUrl(url) {
53990
- if (window.Meteor && window.Meteor.isCordova != true) {
53991
- // '//'的位置
53992
- const doubleSlashIndex = url.indexOf('//');
53993
- const urlIndex = url.indexOf('/', doubleSlashIndex + 2);
53994
- const rootUrl = url.substring(urlIndex);
53995
- return rootUrl;
53989
+ function getImageFieldUrl(url, readonly) {
53990
+ if (window.Meteor) {
53991
+ if(window.Meteor.isCordova != true){
53992
+ // '//'的位置
53993
+ const doubleSlashIndex = url.indexOf('//');
53994
+ const urlIndex = url.indexOf('/', doubleSlashIndex + 2);
53995
+ const rootUrl = url.substring(urlIndex);
53996
+ return rootUrl;
53997
+ }else {
53998
+ if(readonly || url.startsWith('http')){
53999
+ return `${url}?token=${window.btoa(JSON.stringify({ authToken : Builder.settings.context.authToken }))}`
54000
+ }
54001
+ }
53996
54002
  }
53997
54003
  return url;
53998
54004
  }
@@ -54530,7 +54536,7 @@ async function getPage({type, pageId = '', appId, objectName = '', recordId = ''
54530
54536
  * @Author: baozhoutao@steedos.com
54531
54537
  * @Date: 2022-10-28 14:15:09
54532
54538
  * @LastEditors: baozhoutao@steedos.com
54533
- * @LastEditTime: 2024-08-19 16:26:58
54539
+ * @LastEditTime: 2024-10-14 14:01:15
54534
54540
  * @Description:
54535
54541
  */
54536
54542
 
@@ -54628,13 +54634,13 @@ const getAmisFileReadonlySchema = async (steedosField,ctx = {})=>{
54628
54634
  if(type === 'file'){
54629
54635
  return window.Meteor?.isCordova ? {
54630
54636
  "type": "control",
54631
- "body": {
54637
+ "body": steedosField.multiple ? {
54632
54638
  "type": "each",
54633
54639
  "name": "_display." + steedosField.name,
54634
54640
  "items": {
54635
54641
  "type": "tpl",
54636
54642
  "tpl": "${name}",
54637
- "className": "antd-Button--link inline-block",
54643
+ "className": "antd-Button--link inline-block mr-2",
54638
54644
  "onEvent": {
54639
54645
  "click": {
54640
54646
  "actions": [
@@ -54649,6 +54655,24 @@ const getAmisFileReadonlySchema = async (steedosField,ctx = {})=>{
54649
54655
  }
54650
54656
  }
54651
54657
  }
54658
+ } : {
54659
+ "type": "tpl",
54660
+ "tpl": "${_display." + steedosField.name + ".name}",
54661
+ "className": "antd-Button--link inline-block",
54662
+ "onEvent": {
54663
+ "click": {
54664
+ "actions": [
54665
+ {
54666
+ "script": `
54667
+ const data = event.data._display.${steedosField.name};
54668
+ Steedos.cordovaDownload(encodeURI(data.url), data.name);
54669
+ `,
54670
+ "actionType": "custom"
54671
+ }
54672
+ ],
54673
+ "weight": 0
54674
+ }
54675
+ }
54652
54676
  }
54653
54677
  } : {
54654
54678
  // type: amisFieldType,
@@ -56316,7 +56340,7 @@ async function getTableSchema$1(object, fields, options){
56316
56340
  /*
56317
56341
  img/avatar字段值添加URL前缀使其在amis中正常显示图片。
56318
56342
  */
56319
- function getScriptForAddUrlPrefixForImgFields(fields){
56343
+ function getScriptForAddUrlPrefixForImgFields(fields, readonly){
56320
56344
  let imgFieldsKeys = [];
56321
56345
  let imgFields = {};
56322
56346
  fields.forEach((item)=>{
@@ -56344,12 +56368,12 @@ function getScriptForAddUrlPrefixForImgFields(fields){
56344
56368
  if(fieldProps.multiple){
56345
56369
  if(imgFieldDisplayValue instanceof Array){
56346
56370
  data[item] = imgFieldDisplayValue.map((i)=>{
56347
- const url = window.getImageFieldUrl(i.url);
56371
+ const url = window.getImageFieldUrl(i.url, ${readonly});
56348
56372
  return url;
56349
56373
  });
56350
56374
  }
56351
56375
  }else{
56352
- const url = imgFieldDisplayValue && window.getImageFieldUrl(imgFieldDisplayValue.url);
56376
+ const url = imgFieldDisplayValue && window.getImageFieldUrl(imgFieldDisplayValue.url, ${readonly});
56353
56377
  data[item] = url;
56354
56378
  }
56355
56379
  }