@steedos-widgets/amis-lib 6.3.6 → 6.3.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.
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +14 -6
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +14 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +11 -11
- 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
|
@@ -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, {
|
|
@@ -1982,6 +1983,8 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
1982
1983
|
_display["${field.name}"].push({
|
|
1983
1984
|
"name": event.data.result.name,
|
|
1984
1985
|
"url": event.data.result.url,
|
|
1986
|
+
"value": event.data.result.value,
|
|
1987
|
+
"_id": event.data.result.value,
|
|
1985
1988
|
"type": event.data.item.type,
|
|
1986
1989
|
"size": event.data.item.size
|
|
1987
1990
|
});
|
|
@@ -1994,6 +1997,8 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
1994
1997
|
_display["${field.name}"] = {
|
|
1995
1998
|
"name": event.data.result.name,
|
|
1996
1999
|
"url": event.data.result.url,
|
|
2000
|
+
"value": event.data.result.value,
|
|
2001
|
+
"_id": event.data.result.value,
|
|
1997
2002
|
"type": event.data.item.type,
|
|
1998
2003
|
"size": event.data.item.size
|
|
1999
2004
|
};
|
|
@@ -2439,7 +2444,7 @@ async function getTableColumns(object, fields, options){
|
|
|
2439
2444
|
static: true,
|
|
2440
2445
|
className,
|
|
2441
2446
|
...await getAmisFileReadonlySchema(field)
|
|
2442
|
-
}, fieldAmis
|
|
2447
|
+
}, fieldAmis);
|
|
2443
2448
|
}
|
|
2444
2449
|
else if(field.type === 'select'){
|
|
2445
2450
|
const map = getSelectMap(field.options);
|
|
@@ -3250,7 +3255,8 @@ async function getTableApi(mainObject, fields, options){
|
|
|
3250
3255
|
// PC客户端附件子表列表点击标题预览附件功能依赖了_id,所以这里拼出来
|
|
3251
3256
|
let itemKeyValue = item[key];
|
|
3252
3257
|
item[key] = value.map(function(item, index){
|
|
3253
|
-
item._id = itemKeyValue[index];
|
|
3258
|
+
item._id = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
|
|
3259
|
+
item.value = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
|
|
3254
3260
|
return item;
|
|
3255
3261
|
});
|
|
3256
3262
|
}else{
|
|
@@ -3603,6 +3609,7 @@ function getScriptForRewriteValueForFileFields(fields){
|
|
|
3603
3609
|
if(fileFields[item].multiple){
|
|
3604
3610
|
if(fileFieldDisplayValue instanceof Array){
|
|
3605
3611
|
data[item] = fileFieldDisplayValue.map((item, index)=>{
|
|
3612
|
+
item.value = fileFieldValue[index];
|
|
3606
3613
|
return {
|
|
3607
3614
|
value: fileFieldValue[index],
|
|
3608
3615
|
name: item.name,
|
|
@@ -3612,6 +3619,7 @@ function getScriptForRewriteValueForFileFields(fields){
|
|
|
3612
3619
|
});
|
|
3613
3620
|
}
|
|
3614
3621
|
}else{
|
|
3622
|
+
fileFieldDisplayValue.value = fileFieldValue;
|
|
3615
3623
|
data[item] = [{
|
|
3616
3624
|
value: fileFieldValue,
|
|
3617
3625
|
name: fileFieldDisplayValue.name,
|