-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e36174
commit 7991be2
Showing
4 changed files
with
43 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
* @Author: [email protected] | ||
* @Date: 2022-10-28 14:15:09 | ||
* @LastEditors: [email protected] | ||
* @LastEditTime: 2024-08-19 16:26:58 | ||
* @LastEditTime: 2024-10-14 14:01:15 | ||
* @Description: | ||
*/ | ||
import { getAmisStaticFieldType } from './type'; | ||
|
@@ -104,13 +104,13 @@ export const getAmisFileReadonlySchema = async (steedosField,ctx = {})=>{ | |
if(type === 'file'){ | ||
return window.Meteor?.isCordova ? { | ||
"type": "control", | ||
"body": { | ||
"body": steedosField.multiple ? { | ||
"type": "each", | ||
"name": "_display." + steedosField.name, | ||
"items": { | ||
"type": "tpl", | ||
"tpl": "${name}", | ||
"className": "antd-Button--link inline-block", | ||
"className": "antd-Button--link inline-block mr-2", | ||
"onEvent": { | ||
"click": { | ||
"actions": [ | ||
|
@@ -125,6 +125,24 @@ export const getAmisFileReadonlySchema = async (steedosField,ctx = {})=>{ | |
} | ||
} | ||
} | ||
} : { | ||
"type": "tpl", | ||
"tpl": "${_display." + steedosField.name + ".name}", | ||
"className": "antd-Button--link inline-block", | ||
"onEvent": { | ||
"click": { | ||
"actions": [ | ||
{ | ||
"script": ` | ||
const data = event.data._display.${steedosField.name}; | ||
Steedos.cordovaDownload(encodeURI(data.url), data.name); | ||
`, | ||
"actionType": "custom" | ||
} | ||
], | ||
"weight": 0 | ||
} | ||
} | ||
} | ||
} : { | ||
// type: amisFieldType, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
/* | ||
* @Author: [email protected] | ||
* @Date: 2022-07-20 16:29:22 | ||
* @LastEditors: liaodaxue | ||
* @LastEditTime: 2024-01-25 14:44:17 | ||
* @LastEditors: [email protected] | ||
* @LastEditTime: 2024-10-14 13:33:27 | ||
* @Description: | ||
*/ | ||
import { getRootUrl } from "../../steedos.client"; | ||
|
@@ -21,13 +21,19 @@ export function getSvgUrl(source, name) { | |
return `${getRootUrl()}${url}`; | ||
} | ||
|
||
export function getImageFieldUrl(url) { | ||
if (window.Meteor && window.Meteor.isCordova != true) { | ||
// '//'的位置 | ||
const doubleSlashIndex = url.indexOf('//'); | ||
const urlIndex = url.indexOf('/', doubleSlashIndex + 2); | ||
const rootUrl = url.substring(urlIndex); | ||
return rootUrl; | ||
export function getImageFieldUrl(url, readonly) { | ||
if (window.Meteor) { | ||
if(window.Meteor.isCordova != true){ | ||
// '//'的位置 | ||
const doubleSlashIndex = url.indexOf('//'); | ||
const urlIndex = url.indexOf('/', doubleSlashIndex + 2); | ||
const rootUrl = url.substring(urlIndex); | ||
return rootUrl; | ||
}else{ | ||
if(readonly || url.startsWith('http')){ | ||
return `${url}?token=${window.btoa(JSON.stringify({ authToken : Builder.settings.context.authToken }))}` | ||
} | ||
} | ||
} | ||
return url; | ||
} | ||
|