@steedos-widgets/amis-lib 1.2.6-beta.18 → 1.2.6-beta.19

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.
package/dist/index.esm.js CHANGED
@@ -4976,11 +4976,12 @@ async function lookupToAmisSelect(field, readonly, ctx){
4976
4976
  autoComplete: apiInfo,
4977
4977
  searchable: true,
4978
4978
  };
4979
+ //删除xlink:href中的rootUrl前缀,解决客户端svg为空的问题
4979
4980
  const select_menuTpl = `<span class='flex items-center mt-0.5'>
4980
4981
  <span role='img' aria-label='smile' class='anticon anticon-smile'>
4981
4982
  <span class='slds-icon_container slds-icon-standard-\${REPLACE(icon,'_','-')}'>
4982
4983
  <svg class='slds-icon slds-icon_x-small' aria-hidden='true'>
4983
- <use xlink:href='\${context.rootUrl}/assets/icons/standard-sprite/svg/symbols.svg#\${icon}'></use>
4984
+ <use xlink:href='/assets/icons/standard-sprite/svg/symbols.svg#\${icon}'></use>
4984
4985
  </svg>
4985
4986
  </span>
4986
4987
  </span>
@@ -7025,8 +7026,9 @@ async function getMobileTableColumns(fields, options){
7025
7026
  const url = getNameTplUrl(nameField, options);
7026
7027
 
7027
7028
  const columnLines = getMobileLines(tpls);
7028
-
7029
- columns.push({
7029
+
7030
+
7031
+ let column = {
7030
7032
  name: nameField.name,
7031
7033
  label: nameField.label,
7032
7034
  sortable: nameField.sortable,
@@ -7035,13 +7037,66 @@ async function getMobileTableColumns(fields, options){
7035
7037
  actionType: "link",
7036
7038
  link: url,
7037
7039
  innerClassName: "steedos-listview-item block text-gray-500",
7038
- body:{
7040
+ body: {
7039
7041
  "type": "wrapper",
7040
7042
  "body": columnLines,
7041
7043
  "size": "none",
7042
7044
  "className": "p-1"
7043
7045
  }
7044
- });
7046
+ };
7047
+
7048
+ if(options.objectName === 'cms_files'){
7049
+ if(window.Meteor?.isCordova){
7050
+ column = {
7051
+ ...column,
7052
+ actionType: "",
7053
+ link: "",
7054
+ onEvent: {
7055
+ "click": {
7056
+ "actions": [
7057
+ {
7058
+ "script": `
7059
+ let cms_url = "/api/files/files/"+event.data.versions[0]+"?download=true"
7060
+ Steedos.cordovaDownload(encodeURI(Steedos.absoluteUrl(cms_url)), event.data.name);
7061
+ `,
7062
+ "actionType": "custom"
7063
+ }
7064
+ ],
7065
+ "weight": 0
7066
+ }
7067
+ }
7068
+ };
7069
+ }else {
7070
+ column = {
7071
+ ...column,
7072
+ actionType: "",
7073
+ link: "",
7074
+ onEvent: {
7075
+ "click": {
7076
+ "actions": [
7077
+ {
7078
+ "args": {
7079
+ "api": {
7080
+ "url": url,
7081
+ "method": "get",
7082
+ "headers": {
7083
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
7084
+ }
7085
+ }
7086
+ },
7087
+ "actionType": "download"
7088
+ }
7089
+ ],
7090
+ "weight": 0
7091
+ }
7092
+ }
7093
+ };
7094
+ }
7095
+
7096
+ }
7097
+
7098
+ columns.push(column);
7099
+
7045
7100
 
7046
7101
  return columns;
7047
7102
  }
@@ -8132,7 +8187,7 @@ const getRecordPermissions = async (objectName, recordId)=>{
8132
8187
  * @Author: baozhoutao@steedos.com
8133
8188
  * @Date: 2022-07-05 15:55:39
8134
8189
  * @LastEditors: Please set LastEditors
8135
- * @LastEditTime: 2023-04-20 11:43:14
8190
+ * @LastEditTime: 2023-05-08 16:34:25
8136
8191
  * @Description:
8137
8192
  */
8138
8193
 
@@ -8386,7 +8441,7 @@ function getDefaultRelatedListProps(uiSchema, listName, ctx) {
8386
8441
  }
8387
8442
  function getRelatedListProps(uiSchema, listViewName, ctx) {
8388
8443
  if (ctx.columns) {
8389
- const sort = getListViewSort(ctx.sort);
8444
+ const sort = getListViewSort({sort: ctx.sort});
8390
8445
  let { filters , filtersFunction} = ctx;
8391
8446
  if(!filtersFunction && filters){
8392
8447
  filtersFunction = str2function(