@steedos-widgets/amis-lib 6.3.5 → 6.3.7
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/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +21 -8
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +21 -8
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +14 -14
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/fields/file.d.ts +10 -0
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1190,8 +1190,8 @@ async function getPage({type, pageId = '', appId, objectName = '', recordId = ''
|
|
|
1190
1190
|
/*
|
|
1191
1191
|
* @Author: baozhoutao@steedos.com
|
|
1192
1192
|
* @Date: 2022-10-28 14:15:09
|
|
1193
|
-
* @LastEditors:
|
|
1194
|
-
* @LastEditTime:
|
|
1193
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
1194
|
+
* @LastEditTime: 2024-08-19 16:26:58
|
|
1195
1195
|
* @Description:
|
|
1196
1196
|
*/
|
|
1197
1197
|
|
|
@@ -1214,7 +1214,7 @@ async function getLookupLinkOnClick(field, options) {
|
|
|
1214
1214
|
const recordPage = await getPage({ type: 'record', appId: options.appId, objectName: options.objectName, formFactor: options.formFactor });
|
|
1215
1215
|
|
|
1216
1216
|
const drawerRecordDetailSchema = recordPage ? Object.assign({}, recordPage.schema, {
|
|
1217
|
-
"recordId":
|
|
1217
|
+
"recordId": field.type == "file" ? "${value}":`\${${field.name}}`,
|
|
1218
1218
|
"data": {
|
|
1219
1219
|
...recordPage.schema.data,
|
|
1220
1220
|
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
@@ -1224,7 +1224,7 @@ async function getLookupLinkOnClick(field, options) {
|
|
|
1224
1224
|
}) : {
|
|
1225
1225
|
"type": "steedos-record-detail",
|
|
1226
1226
|
"objectApiName": options.objectName,
|
|
1227
|
-
"recordId":
|
|
1227
|
+
"recordId": field.type == "file" ? "${value}":`\${${field.name}}`,
|
|
1228
1228
|
"showBackButton": false,
|
|
1229
1229
|
"showButtons": true,
|
|
1230
1230
|
"data": {
|
|
@@ -1320,17 +1320,18 @@ const getAmisFileReadonlySchema = async (steedosField,ctx = {})=>{
|
|
|
1320
1320
|
// <a href='<%= item.url %>' target='_self' class='block'><%= item.name %></a>
|
|
1321
1321
|
// <% });} %>`
|
|
1322
1322
|
"type": "control",
|
|
1323
|
+
"name": "",//control若存在name,内部each组件的source则会获取不到内容
|
|
1323
1324
|
"body": {
|
|
1324
1325
|
type: 'each',
|
|
1325
1326
|
placeholder: "",
|
|
1326
|
-
|
|
1327
|
+
className: steedosField.multiple ? `flex flex-col` : '',
|
|
1327
1328
|
source: `\${_display.${steedosField.name}|asArray}`,
|
|
1328
1329
|
items: {
|
|
1329
1330
|
type: 'static',
|
|
1330
1331
|
labelClassName: "hidden",
|
|
1331
1332
|
label: false,
|
|
1332
1333
|
className: 'm-0',
|
|
1333
|
-
tpl: `<a href="/app/-/cfs_files_filerecord/view/\${
|
|
1334
|
+
tpl: `<a href="/app/-/cfs_files_filerecord/view/\${value}" ${lookupATagClick}>\${name}</a>`,
|
|
1334
1335
|
// tpl: "<%= item.name >",
|
|
1335
1336
|
// onEvent: window.innerWidth < 768 ? null : REFERENCE_VALUE_ITEM_ONCLICK
|
|
1336
1337
|
onEvent: window.innerWidth < 768 ? null : await getLookupLinkOnClick(steedosField, {
|
|
@@ -1397,6 +1398,11 @@ const getAmisFileEditSchema = (steedosField)=>{
|
|
|
1397
1398
|
convertData.multiple = true;
|
|
1398
1399
|
convertData.joinValues = false;
|
|
1399
1400
|
convertData.extractValue = true;
|
|
1401
|
+
if(steedosField.type === 'image'){
|
|
1402
|
+
if(Steedos.isCordova() && Steedos.isCordova()){
|
|
1403
|
+
convertData.accept = "";
|
|
1404
|
+
}
|
|
1405
|
+
}
|
|
1400
1406
|
}
|
|
1401
1407
|
return convertData;
|
|
1402
1408
|
};
|
|
@@ -1977,6 +1983,8 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
1977
1983
|
_display["${field.name}"].push({
|
|
1978
1984
|
"name": event.data.result.name,
|
|
1979
1985
|
"url": event.data.result.url,
|
|
1986
|
+
"value": event.data.result.value,
|
|
1987
|
+
"_id": event.data.result.value,
|
|
1980
1988
|
"type": event.data.item.type,
|
|
1981
1989
|
"size": event.data.item.size
|
|
1982
1990
|
});
|
|
@@ -1989,6 +1997,8 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
1989
1997
|
_display["${field.name}"] = {
|
|
1990
1998
|
"name": event.data.result.name,
|
|
1991
1999
|
"url": event.data.result.url,
|
|
2000
|
+
"value": event.data.result.value,
|
|
2001
|
+
"_id": event.data.result.value,
|
|
1992
2002
|
"type": event.data.item.type,
|
|
1993
2003
|
"size": event.data.item.size
|
|
1994
2004
|
};
|
|
@@ -2434,7 +2444,7 @@ async function getTableColumns(object, fields, options){
|
|
|
2434
2444
|
static: true,
|
|
2435
2445
|
className,
|
|
2436
2446
|
...await getAmisFileReadonlySchema(field)
|
|
2437
|
-
}, fieldAmis
|
|
2447
|
+
}, fieldAmis);
|
|
2438
2448
|
}
|
|
2439
2449
|
else if(field.type === 'select'){
|
|
2440
2450
|
const map = getSelectMap(field.options);
|
|
@@ -3245,7 +3255,8 @@ async function getTableApi(mainObject, fields, options){
|
|
|
3245
3255
|
// PC客户端附件子表列表点击标题预览附件功能依赖了_id,所以这里拼出来
|
|
3246
3256
|
let itemKeyValue = item[key];
|
|
3247
3257
|
item[key] = value.map(function(item, index){
|
|
3248
|
-
item._id = itemKeyValue[index];
|
|
3258
|
+
item._id = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
|
|
3259
|
+
item.value = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
|
|
3249
3260
|
return item;
|
|
3250
3261
|
});
|
|
3251
3262
|
}else{
|
|
@@ -3598,6 +3609,7 @@ function getScriptForRewriteValueForFileFields(fields){
|
|
|
3598
3609
|
if(fileFields[item].multiple){
|
|
3599
3610
|
if(fileFieldDisplayValue instanceof Array){
|
|
3600
3611
|
data[item] = fileFieldDisplayValue.map((item, index)=>{
|
|
3612
|
+
item.value = fileFieldValue[index];
|
|
3601
3613
|
return {
|
|
3602
3614
|
value: fileFieldValue[index],
|
|
3603
3615
|
name: item.name,
|
|
@@ -3607,6 +3619,7 @@ function getScriptForRewriteValueForFileFields(fields){
|
|
|
3607
3619
|
});
|
|
3608
3620
|
}
|
|
3609
3621
|
}else{
|
|
3622
|
+
fileFieldDisplayValue.value = fileFieldValue;
|
|
3610
3623
|
data[item] = [{
|
|
3611
3624
|
value: fileFieldValue,
|
|
3612
3625
|
name: fileFieldDisplayValue.name,
|