@steedos-widgets/amis-lib 1.2.0-beta.0 → 1.2.0-beta.2
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 +187 -189
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +187 -189
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +190 -192
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/fields/lookup.d.ts +1 -0
- package/dist/types/lib/converter/amis/header.d.ts +4 -21
- package/dist/types/lib/converter/amis/index.d.ts +0 -3
- package/dist/types/lib/objects.d.ts +2 -35
- package/dist/types/lib/objectsRelated.d.ts +4 -17
- package/dist/types/schema/standard_delete.amis.d.ts +0 -6
- package/dist/types/schema/standard_new.amis.d.ts +3 -1
- package/dist/types/standard/button.d.ts +3 -7
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'lodash', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["amis-lib"] = {}, global._$1, global.
|
|
5
|
-
})(this, (function (exports, _$1,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('lodash'), require('@steedos-widgets/amis-lib'), require('lodash/isPlainObject')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'lodash', '@steedos-widgets/amis-lib', 'lodash/isPlainObject'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["amis-lib"] = {}, global._$1, global.amisLib, global.isPlainObject));
|
|
5
|
+
})(this, (function (exports, _$1, amisLib, isPlainObject) {
|
|
6
6
|
const global = window;
|
|
7
7
|
|
|
8
8
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -360,7 +360,7 @@
|
|
|
360
360
|
* @Author: baozhoutao@steedos.com
|
|
361
361
|
* @Date: 2022-08-16 17:02:08
|
|
362
362
|
* @LastEditors: baozhoutao@steedos.com
|
|
363
|
-
* @LastEditTime: 2023-
|
|
363
|
+
* @LastEditTime: 2023-04-11 09:57:37
|
|
364
364
|
* @Description:
|
|
365
365
|
*/
|
|
366
366
|
|
|
@@ -387,10 +387,11 @@
|
|
|
387
387
|
},
|
|
388
388
|
getObjectDetailPath(props){
|
|
389
389
|
const {formFactor, appId, objectName, recordId, listViewName, _templateType} = props;
|
|
390
|
+
// var urlParams = new URLSearchParams(window.location.search);
|
|
390
391
|
// if(objectName === 'instances'){
|
|
391
392
|
// return `/workflow/space/\${context.tenantId}/\${listName}/${recordId}`;
|
|
392
393
|
// }
|
|
393
|
-
const displayAs =
|
|
394
|
+
const displayAs = Router.getTabDisplayAs(objectName); //urlParams.get("display") ||
|
|
394
395
|
if(_templateType === 'JavaScript'){
|
|
395
396
|
return `/app/${appId}/${objectName}/view/${recordId}?display=${displayAs}&side_object=<%=item.objectName%>&side_listview_id=<%=item.listName%>`;
|
|
396
397
|
}
|
|
@@ -406,7 +407,7 @@
|
|
|
406
407
|
* @Author: baozhoutao@steedos.com
|
|
407
408
|
* @Date: 2022-05-23 09:53:08
|
|
408
409
|
* @LastEditors: baozhoutao@steedos.com
|
|
409
|
-
* @LastEditTime: 2023-
|
|
410
|
+
* @LastEditTime: 2023-04-10 11:22:54
|
|
410
411
|
* @Description:
|
|
411
412
|
*/
|
|
412
413
|
|
|
@@ -601,6 +602,7 @@
|
|
|
601
602
|
case 'number':
|
|
602
603
|
case 'currency':
|
|
603
604
|
return await getNumberTpl(field);
|
|
605
|
+
case 'percent':
|
|
604
606
|
case 'formula':
|
|
605
607
|
case 'summary':
|
|
606
608
|
return getUiFieldTpl(field)
|
|
@@ -633,7 +635,7 @@
|
|
|
633
635
|
if(_$1.includes(['time','date','datetime','boolean','number','currency'], field.type)){
|
|
634
636
|
fieldsName.push(`${field.name}`);
|
|
635
637
|
}
|
|
636
|
-
if(_$1.includes(['time','filesize','date','datetime','boolean','number','currency', 'select', 'file', 'image', 'avatar', 'formula', 'summary', 'object', 'grid'], field.type)){
|
|
638
|
+
if(_$1.includes(['percent','time','filesize','date','datetime','boolean','number','currency', 'select', 'file', 'image', 'avatar', 'formula', 'summary', 'object', 'grid'], field.type)){
|
|
637
639
|
displayFields.push(`${field.name}`);
|
|
638
640
|
}
|
|
639
641
|
}
|
|
@@ -678,11 +680,7 @@
|
|
|
678
680
|
}
|
|
679
681
|
|
|
680
682
|
async function getFindOneQuery$1(object, recordId, fields, options){
|
|
681
|
-
let queryOptions = ""
|
|
682
|
-
|
|
683
|
-
if(recordId){
|
|
684
|
-
queryOptions = `(filters:["${object.idFieldName}", "=", "${recordId}"])`;
|
|
685
|
-
}
|
|
683
|
+
let queryOptions = `(filters:["${object.idFieldName}", "=", "\${recordId}"])`;
|
|
686
684
|
let alias = "data";
|
|
687
685
|
if(options){
|
|
688
686
|
if(options.alias){
|
|
@@ -1391,8 +1389,8 @@
|
|
|
1391
1389
|
/*
|
|
1392
1390
|
* @Author: baozhoutao@steedos.com
|
|
1393
1391
|
* @Date: 2022-11-01 15:51:00
|
|
1394
|
-
* @LastEditors:
|
|
1395
|
-
* @LastEditTime: 2023-
|
|
1392
|
+
* @LastEditors: Please set LastEditors
|
|
1393
|
+
* @LastEditTime: 2023-04-11 13:58:24
|
|
1396
1394
|
* @Description:
|
|
1397
1395
|
*/
|
|
1398
1396
|
|
|
@@ -1410,6 +1408,36 @@
|
|
|
1410
1408
|
if (payload && payload.schema) {
|
|
1411
1409
|
formSchema = _.isString(payload.schema) ? JSON.parse(payload.schema) : payload.schema;
|
|
1412
1410
|
}
|
|
1411
|
+
|
|
1412
|
+
const _master = api.body._master;
|
|
1413
|
+
if(_master && _master._isRelated){
|
|
1414
|
+
const relatedKey = _master.relatedKey;
|
|
1415
|
+
const masterObjectName = _master.objectName;
|
|
1416
|
+
const recordId = _master.recordId;
|
|
1417
|
+
let relatedKeySaveValue = recordId;
|
|
1418
|
+
const fields = ${JSON.stringify(uiSchema.fields)};
|
|
1419
|
+
const relatedField = fields[relatedKey];
|
|
1420
|
+
if(relatedField.reference_to_field && relatedField.reference_to_field !== '_id'){
|
|
1421
|
+
relatedKeySaveValue = _master.record[relatedField.reference_to_field];
|
|
1422
|
+
}
|
|
1423
|
+
let defaultData = {};
|
|
1424
|
+
let relatedKeyValue;
|
|
1425
|
+
if(!_.isString(relatedField.reference_to)){
|
|
1426
|
+
relatedKeyValue = { o: masterObjectName, ids: [relatedKeySaveValue] };
|
|
1427
|
+
}else if (relatedField.multiple) {
|
|
1428
|
+
relatedKeyValue = [relatedKeySaveValue];
|
|
1429
|
+
} else {
|
|
1430
|
+
relatedKeyValue = relatedKeySaveValue;
|
|
1431
|
+
}
|
|
1432
|
+
defaultData[relatedKey]=relatedKeyValue;
|
|
1433
|
+
if(payload.schema){
|
|
1434
|
+
// 表单微页面第一层要求是page
|
|
1435
|
+
formSchema.data.defaultData = defaultData;
|
|
1436
|
+
}else{
|
|
1437
|
+
formSchema.defaultData = defaultData;
|
|
1438
|
+
}
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1413
1441
|
return {
|
|
1414
1442
|
data: formSchema
|
|
1415
1443
|
};
|
|
@@ -1433,7 +1461,8 @@
|
|
|
1433
1461
|
"data": {
|
|
1434
1462
|
"$master": "$$",
|
|
1435
1463
|
"_master": "${_master}",
|
|
1436
|
-
"
|
|
1464
|
+
"_master._isRelated": "${_isRelated}",
|
|
1465
|
+
"_master.relatedKey": "${relatedKey}",
|
|
1437
1466
|
"appId": "${appId}",
|
|
1438
1467
|
"objectName": "${objectName}",
|
|
1439
1468
|
"context": "${context}",
|
|
@@ -1451,7 +1480,8 @@
|
|
|
1451
1480
|
"messages": {},
|
|
1452
1481
|
"schemaApi": {
|
|
1453
1482
|
"data": {
|
|
1454
|
-
"isLookup": "${isLookup}"
|
|
1483
|
+
"isLookup": "${isLookup}",
|
|
1484
|
+
"_master": "${_master}"
|
|
1455
1485
|
},
|
|
1456
1486
|
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}",
|
|
1457
1487
|
"method": "get",
|
|
@@ -1489,7 +1519,7 @@
|
|
|
1489
1519
|
* @Author: baozhoutao@steedos.com
|
|
1490
1520
|
* @Date: 2022-07-13 15:18:03
|
|
1491
1521
|
* @LastEditors: baozhoutao@steedos.com
|
|
1492
|
-
* @LastEditTime:
|
|
1522
|
+
* @LastEditTime: 2023-04-11 10:34:26
|
|
1493
1523
|
* @Description:
|
|
1494
1524
|
*/
|
|
1495
1525
|
|
|
@@ -1497,6 +1527,13 @@
|
|
|
1497
1527
|
const api = `/api/pageSchema/${type}?app=${appId}&objectApiName=${objectName}&recordId=${recordId}&pageId=${pageId}&formFactor=${formFactor}`;
|
|
1498
1528
|
const page = await fetchAPI(api);
|
|
1499
1529
|
if (page && page.schema) {
|
|
1530
|
+
page.schema = JSON.parse(page.schema);
|
|
1531
|
+
if(page.schema.data){
|
|
1532
|
+
delete page.schema.data.recordId;
|
|
1533
|
+
delete page.schema.data.objectName;
|
|
1534
|
+
delete page.schema.data.context;
|
|
1535
|
+
delete page.schema.data.global;
|
|
1536
|
+
}
|
|
1500
1537
|
return page;
|
|
1501
1538
|
}
|
|
1502
1539
|
}
|
|
@@ -1574,8 +1611,8 @@
|
|
|
1574
1611
|
/*
|
|
1575
1612
|
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
1576
1613
|
* @Date: 2023-03-22 09:31:21
|
|
1577
|
-
* @LastEditors:
|
|
1578
|
-
* @LastEditTime: 2023-
|
|
1614
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
1615
|
+
* @LastEditTime: 2023-04-06 16:04:20
|
|
1579
1616
|
*/
|
|
1580
1617
|
const getSchema$2 = (uiSchema)=>{
|
|
1581
1618
|
return {
|
|
@@ -1605,15 +1642,11 @@
|
|
|
1605
1642
|
},
|
|
1606
1643
|
"adaptor": `
|
|
1607
1644
|
if(payload.errors){
|
|
1608
|
-
|
|
1609
|
-
|
|
1645
|
+
payload.status = 2;
|
|
1646
|
+
payload.msg = window.t ? window.t(payload.errors[0].message) : payload.errors[0].message;
|
|
1610
1647
|
}
|
|
1611
1648
|
return payload;
|
|
1612
1649
|
`,
|
|
1613
|
-
},
|
|
1614
|
-
"messages": {
|
|
1615
|
-
"success": "删除成功",
|
|
1616
|
-
"failed": "删除失败"
|
|
1617
1650
|
}
|
|
1618
1651
|
},
|
|
1619
1652
|
"actionType": "ajax"
|
|
@@ -1976,7 +2009,7 @@
|
|
|
1976
2009
|
getStandardNew: async (uiSchema, ctx)=>{
|
|
1977
2010
|
return {
|
|
1978
2011
|
type: 'amis_button',
|
|
1979
|
-
amis_schema: await getSchema$4()
|
|
2012
|
+
amis_schema: await getSchema$4(uiSchema)
|
|
1980
2013
|
}
|
|
1981
2014
|
},
|
|
1982
2015
|
getStandardEdit: async (uiSchema, ctx)=>{
|
|
@@ -2060,7 +2093,7 @@
|
|
|
2060
2093
|
if(visible.trim().startsWith('function')){
|
|
2061
2094
|
return `${visible}.apply({
|
|
2062
2095
|
object: uiSchema
|
|
2063
|
-
}, [objectName, _id, typeof record === 'undefined' ? (typeof recordPermissions === 'undefined' ? {} : recordPermissions) : record.recordPermissions, data])`
|
|
2096
|
+
}, [objectName, typeof _id === 'undefined' ? null: _id, typeof record === 'undefined' ? (typeof recordPermissions === 'undefined' ? {} : recordPermissions) : record.recordPermissions, data])`
|
|
2064
2097
|
}
|
|
2065
2098
|
return visible;
|
|
2066
2099
|
}
|
|
@@ -3190,9 +3223,8 @@
|
|
|
3190
3223
|
|
|
3191
3224
|
let body = [
|
|
3192
3225
|
{
|
|
3193
|
-
"type": "
|
|
3194
|
-
"
|
|
3195
|
-
data: { "&":"$$", objectName: name, _id: recordId, recordPermissions: "${record.recordPermissions}", uiSchema: objectSchema},
|
|
3226
|
+
"type": "wrapper",
|
|
3227
|
+
"className": "p-0",
|
|
3196
3228
|
"body": [
|
|
3197
3229
|
{
|
|
3198
3230
|
"type": "grid",
|
|
@@ -3200,14 +3232,14 @@
|
|
|
3200
3232
|
"className": "flex justify-between"
|
|
3201
3233
|
}
|
|
3202
3234
|
],
|
|
3203
|
-
"messages": {},
|
|
3204
3235
|
"hiddenOn": "${recordLoaded != true}"
|
|
3205
3236
|
}
|
|
3206
3237
|
];
|
|
3207
3238
|
|
|
3208
3239
|
if(showRecordTitle){
|
|
3209
3240
|
body.push({
|
|
3210
|
-
"type": "
|
|
3241
|
+
"type": "wrapper",
|
|
3242
|
+
"className": "p-0",
|
|
3211
3243
|
"body": [
|
|
3212
3244
|
{
|
|
3213
3245
|
"type": "grid",
|
|
@@ -3215,16 +3247,15 @@
|
|
|
3215
3247
|
"className": "flex justify-between"
|
|
3216
3248
|
}
|
|
3217
3249
|
],
|
|
3218
|
-
"messages": {},
|
|
3219
3250
|
"hiddenOn": "${recordLoaded == true}"
|
|
3220
3251
|
});
|
|
3221
3252
|
}
|
|
3222
3253
|
|
|
3223
3254
|
return {
|
|
3224
3255
|
type: 'service',
|
|
3225
|
-
|
|
3256
|
+
id: `page_readonly_${name}_header`,
|
|
3226
3257
|
name: `page`,
|
|
3227
|
-
data: {
|
|
3258
|
+
data: { objectName: name, _id: recordId, recordPermissions: objectSchema.permissions, uiSchema: objectSchema, record: "${record}" },
|
|
3228
3259
|
body: body,
|
|
3229
3260
|
className: ''
|
|
3230
3261
|
}
|
|
@@ -3279,7 +3310,7 @@
|
|
|
3279
3310
|
"body": [
|
|
3280
3311
|
{
|
|
3281
3312
|
"type": "tpl",
|
|
3282
|
-
"tpl": `<a class="text-black text-base font-bold" href="/app/\${appId}/\${
|
|
3313
|
+
"tpl": `<a class="text-black text-base font-bold" href="/app/\${appId}/\${_master.objectName}/\${_master.recordId}/\${objectName}/grid?related_field_name=\${relatedKey}">${relatedLabel}(\${$count})</a>`,
|
|
3283
3314
|
"inline": false,
|
|
3284
3315
|
"wrapperComponent": "",
|
|
3285
3316
|
"className": "",
|
|
@@ -3320,17 +3351,22 @@
|
|
|
3320
3351
|
async function getObjectRelatedListHeader(objectSchema, recordId, relatedObjectName) {
|
|
3321
3352
|
}
|
|
3322
3353
|
|
|
3323
|
-
const getDisplayAsButton = function(showDisplayAs){
|
|
3354
|
+
const getDisplayAsButton = function(objectName, showDisplayAs){
|
|
3355
|
+
let displayAs = amisLib.Router.getTabDisplayAs(objectName);
|
|
3324
3356
|
let buttons = [
|
|
3325
3357
|
{
|
|
3326
3358
|
"type": "button",
|
|
3327
3359
|
"label": "表格",
|
|
3328
|
-
"onClick": "
|
|
3360
|
+
"onClick": "let url = document.location.pathname; var urlSearch = new URLSearchParams(document.location.search); if(urlSearch.get(\"side_object\") && urlSearch.get(\"side_listview_id\")){url=`/app/${props.data.appId}/${urlSearch.get(\"side_object\")}/grid/${urlSearch.get(\"side_listview_id\")}`;}; props.env.jumpTo(url + '?display=grid');",
|
|
3361
|
+
"rightIcon": displayAs != 'split' ? "fa fa-check" : null,
|
|
3362
|
+
"rightIconClassName": "m-l-sm"
|
|
3329
3363
|
},
|
|
3330
3364
|
{
|
|
3331
3365
|
"type": "button",
|
|
3332
3366
|
"label": "分栏视图",
|
|
3333
|
-
"onClick": "const url = document.location.pathname + '?display=split'; props.env.jumpTo(url);"
|
|
3367
|
+
"onClick": "const url = document.location.pathname + '?display=split'; props.env.jumpTo(url);",
|
|
3368
|
+
"rightIcon": displayAs === 'split' ? "fa fa-check" : null,
|
|
3369
|
+
"rightIconClassName": "m-l-sm"
|
|
3334
3370
|
}
|
|
3335
3371
|
];
|
|
3336
3372
|
return {
|
|
@@ -3472,7 +3508,7 @@ setTimeout(()=>{
|
|
|
3472
3508
|
}
|
|
3473
3509
|
}
|
|
3474
3510
|
},
|
|
3475
|
-
showDisplayAs? getDisplayAsButton() : {}
|
|
3511
|
+
showDisplayAs? getDisplayAsButton(mainObject?.name) : {}
|
|
3476
3512
|
]
|
|
3477
3513
|
}else {
|
|
3478
3514
|
return [
|
|
@@ -3553,7 +3589,7 @@ setTimeout(()=>{
|
|
|
3553
3589
|
}
|
|
3554
3590
|
}
|
|
3555
3591
|
},
|
|
3556
|
-
showDisplayAs? getDisplayAsButton() : {}
|
|
3592
|
+
showDisplayAs? getDisplayAsButton(showDisplayAs) : {}
|
|
3557
3593
|
// {
|
|
3558
3594
|
// "type": "search-box",
|
|
3559
3595
|
// "align": "right",
|
|
@@ -3843,13 +3879,14 @@ setTimeout(()=>{
|
|
|
3843
3879
|
"headers": {
|
|
3844
3880
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
3845
3881
|
},
|
|
3846
|
-
"adaptor": " const records = payload.data.options;\n const treeRecords = [];\n const getChildren = (records, childrenIds) => {\n if (!childrenIds) {\n return;\n }\n const children = _.filter(records, (record) => {\n return _.includes(childrenIds, record.value)\n });\n _.each(children, (item) => {\n if (item.children) {\n item.children = getChildren(records, item.children)\n }\n })\n return children;\n }\n\n const getRoot = (records) => {\n for (var i = 0; i < records.length; i++){\n records[i].noParent = 0;\n if (!!records[i].parent) {\n biaozhi = 1\n for (var j = 0; j < records.length; j++){\n if (records[i].parent == records[j].value)\n biaozhi = 0;\n }\n if (biaozhi == 1) records[i].noParent = 1;\n } else records[i].noParent = 1;\n }\n }\n getRoot(records);\n console.log(records)\n\n _.each(records, (record) => {\n if (record.noParent ==1) {\n treeRecords.push(Object.assign({}, record, { children: getChildren(records, record.children) }));\n }\n });\n console.log(treeRecords)\n\n payload.data.options = treeRecords;\n
|
|
3882
|
+
"adaptor": "if (payload.data.treeCache == true) {\n return payload;\n }\n const records = payload.data.options;\n const treeRecords = [];\n const getChildren = (records, childrenIds) => {\n if (!childrenIds) {\n return;\n }\n const children = _.filter(records, (record) => {\n return _.includes(childrenIds, record.value)\n });\n _.each(children, (item) => {\n if (item.children) {\n item.children = getChildren(records, item.children)\n }\n })\n return children;\n }\n\n const getRoot = (records) => {\n for (var i = 0; i < records.length; i++){\n records[i].noParent = 0;\n if (!!records[i].parent) {\n biaozhi = 1\n for (var j = 0; j < records.length; j++){\n if (records[i].parent == records[j].value)\n biaozhi = 0;\n }\n if (biaozhi == 1) records[i].noParent = 1;\n } else records[i].noParent = 1;\n }\n }\n getRoot(records);\n console.log(records)\n\n _.each(records, (record) => {\n if (record.noParent ==1) {\n treeRecords.push(Object.assign({}, record, { children: getChildren(records, record.children) }));\n }\n });\n console.log(treeRecords)\n\n payload.data.options = treeRecords;\n payload.data.treeCache = true;\n return payload;\n ",
|
|
3847
3883
|
"requestAdaptor": "\n ",
|
|
3848
3884
|
"data": {
|
|
3849
3885
|
"query": "{options:organizations(filters:[\"hidden\", \"!=\", true],sort:\"sort_no desc\"){value:_id label:name,parent,children}}"
|
|
3850
3886
|
},
|
|
3851
3887
|
"messages": {
|
|
3852
|
-
}
|
|
3888
|
+
},
|
|
3889
|
+
"cache": 300000
|
|
3853
3890
|
},
|
|
3854
3891
|
"onEvent": {
|
|
3855
3892
|
"change": {
|
|
@@ -4240,20 +4277,20 @@ setTimeout(()=>{
|
|
|
4240
4277
|
|
|
4241
4278
|
if(referenceTo){
|
|
4242
4279
|
// 字段值单独走一个请求合并到source的同一个GraphQL接口中
|
|
4243
|
-
const defaultValueOptionsQueryData = await getFindQuery({ name: referenceTo.objectName }, null,
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4280
|
+
const defaultValueOptionsQueryData = await getFindQuery({ name: referenceTo.objectName }, null, [
|
|
4281
|
+
Object.assign({}, referenceTo.labelField, {alias: 'label'}),
|
|
4282
|
+
Object.assign({}, referenceTo.valueField, {alias: 'value'})
|
|
4283
|
+
], {
|
|
4247
4284
|
alias: "defaultValueOptions",
|
|
4248
4285
|
filters: "{__options_filters}",
|
|
4249
4286
|
count: false
|
|
4250
4287
|
});
|
|
4251
4288
|
apiInfo = await getApi$1({
|
|
4252
4289
|
name: referenceTo.objectName
|
|
4253
|
-
}, null,
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
|
|
4290
|
+
}, null, [
|
|
4291
|
+
Object.assign({}, referenceTo.labelField, {alias: 'label'}),
|
|
4292
|
+
Object.assign({}, referenceTo.valueField, {alias: 'value'})
|
|
4293
|
+
], {expand: false, alias: 'options', queryOptions: `filters: {__filters}, top: {__top}, sort: "{__sort}"`, moreQueries: [defaultValueOptionsQueryData.query]});
|
|
4257
4294
|
|
|
4258
4295
|
apiInfo.adaptor = `
|
|
4259
4296
|
const data = payload.data;
|
|
@@ -5414,8 +5451,9 @@ setTimeout(()=>{
|
|
|
5414
5451
|
async function getReadonlyFormInitApi(object, recordId, fields, options){
|
|
5415
5452
|
return {
|
|
5416
5453
|
method: "post",
|
|
5417
|
-
url: getApi$2()+"
|
|
5454
|
+
url: getApi$2()+"&recordId=${recordId}",
|
|
5418
5455
|
cache: API_CACHE,
|
|
5456
|
+
// requestAdaptor: "console.log('getReadonlyFormInitApi requestAdaptor', api);return api;",
|
|
5419
5457
|
adaptor: getReadonlyFormAdaptor(fields),
|
|
5420
5458
|
data: await getFindOneQuery$1(object, recordId, fields, options),
|
|
5421
5459
|
headers: {
|
|
@@ -5522,6 +5560,7 @@ setTimeout(()=>{
|
|
|
5522
5560
|
data.global = "${global}";
|
|
5523
5561
|
data.context = "${context}";
|
|
5524
5562
|
data.defaultData = "${defaultData}";
|
|
5563
|
+
|
|
5525
5564
|
return {
|
|
5526
5565
|
method: "post",
|
|
5527
5566
|
url: getApi$2(),
|
|
@@ -5890,7 +5929,7 @@ setTimeout(()=>{
|
|
|
5890
5929
|
keepItemSelectionOnPageChange: true,
|
|
5891
5930
|
api: await getTableApi(objectSchema, fields, options),
|
|
5892
5931
|
hiddenOn: options.tableHiddenOn,
|
|
5893
|
-
autoFillHeight: true,
|
|
5932
|
+
autoFillHeight: options.isRelated ? false : true,
|
|
5894
5933
|
className: `flex-auto ${crudClassName || ""}`,
|
|
5895
5934
|
crudClassName: crudClassName,
|
|
5896
5935
|
},
|
|
@@ -5933,11 +5972,11 @@ setTimeout(()=>{
|
|
|
5933
5972
|
id: `service_${id}`,
|
|
5934
5973
|
name: `page`,
|
|
5935
5974
|
data: {
|
|
5936
|
-
objectName: objectSchema.name,
|
|
5937
|
-
_id: null,
|
|
5975
|
+
// objectName: objectSchema.name,
|
|
5976
|
+
// _id: null,
|
|
5938
5977
|
recordPermissions: objectSchema.permissions,
|
|
5939
5978
|
uiSchema: objectSchema,
|
|
5940
|
-
loaded: false //crud接收适配器中设置为true,否则就是刷新浏览器第一次加载
|
|
5979
|
+
// loaded: false //crud接收适配器中设置为true,否则就是刷新浏览器第一次加载
|
|
5941
5980
|
},
|
|
5942
5981
|
body: body
|
|
5943
5982
|
}
|
|
@@ -6050,6 +6089,10 @@ setTimeout(()=>{
|
|
|
6050
6089
|
"objectName": "${_master.objectName}"
|
|
6051
6090
|
},
|
|
6052
6091
|
"expression": `\${_master.objectName != '${objectSchema.name}' && _master.objectName}`
|
|
6092
|
+
},
|
|
6093
|
+
{
|
|
6094
|
+
"args": {},
|
|
6095
|
+
"actionType": "closeDialog"
|
|
6053
6096
|
}
|
|
6054
6097
|
]
|
|
6055
6098
|
}
|
|
@@ -6396,7 +6439,7 @@ setTimeout(()=>{
|
|
|
6396
6439
|
// return 'false';
|
|
6397
6440
|
// }
|
|
6398
6441
|
if(visible.trim().startsWith('function')){
|
|
6399
|
-
return `${visible}(objectName, _id, typeof record === 'undefined' ? (typeof recordPermissions === 'undefined' ? {} : recordPermissions) : record.recordPermissions, data)`
|
|
6442
|
+
return `${visible}(objectName, typeof _id === 'undefined' ? null: _id, typeof record === 'undefined' ? (typeof recordPermissions === 'undefined' ? {} : recordPermissions) : record.recordPermissions, data)`
|
|
6400
6443
|
}
|
|
6401
6444
|
return visible;
|
|
6402
6445
|
}
|
|
@@ -6561,6 +6604,11 @@ setTimeout(()=>{
|
|
|
6561
6604
|
|
|
6562
6605
|
let valueField = mainObject.key_field || '_id';
|
|
6563
6606
|
const api = await getApi(mainObject, null, fields, {count: options.queryCount, alias: 'rows', limit: top, queryOptions: `filters: {__filters}, top: {__top}, skip: {__skip}, sort: "{__sort}"`});
|
|
6607
|
+
|
|
6608
|
+
if(options.isRelated){
|
|
6609
|
+
api.url += "&recordId=${recordId}";
|
|
6610
|
+
}
|
|
6611
|
+
|
|
6564
6612
|
api.data.$term = "$term";
|
|
6565
6613
|
api.data.$self = "$$";
|
|
6566
6614
|
api.data.filter = "$filter";
|
|
@@ -6680,11 +6728,36 @@ setTimeout(()=>{
|
|
|
6680
6728
|
if(!_.isEmpty(systemFilters)){
|
|
6681
6729
|
filters = systemFilters;
|
|
6682
6730
|
};
|
|
6683
|
-
|
|
6684
6731
|
if(api.data.$self.additionalFilters){
|
|
6685
6732
|
userFilters.push(api.data.$self.additionalFilters)
|
|
6686
6733
|
}
|
|
6687
6734
|
|
|
6735
|
+
if(api.data.$self._isRelated){
|
|
6736
|
+
const self = api.data.$self;
|
|
6737
|
+
const relatedKey = self.relatedKey;
|
|
6738
|
+
const recordId = self.recordId;
|
|
6739
|
+
const refField = self.uiSchema.fields[relatedKey];
|
|
6740
|
+
const masterRecord = self._master.record;
|
|
6741
|
+
const masterObjectName = self._master.objectName;
|
|
6742
|
+
let relatedValue = recordId;
|
|
6743
|
+
if(refField.reference_to_field && refField.reference_to_field != '_id'){
|
|
6744
|
+
relatedValue = masterRecord[refField.reference_to_field]
|
|
6745
|
+
}
|
|
6746
|
+
let relatedFilters;
|
|
6747
|
+
if (
|
|
6748
|
+
refField._reference_to ||
|
|
6749
|
+
(refField.reference_to && !_.isString(refField.reference_to))
|
|
6750
|
+
) {
|
|
6751
|
+
relatedFilters = [
|
|
6752
|
+
[relatedKey + "/o", "=", masterObjectName],
|
|
6753
|
+
[relatedKey + "/ids", "=", relatedValue],
|
|
6754
|
+
];
|
|
6755
|
+
} else {
|
|
6756
|
+
relatedFilters = [relatedKey, "=", relatedValue];
|
|
6757
|
+
}
|
|
6758
|
+
userFilters.push(relatedFilters)
|
|
6759
|
+
}
|
|
6760
|
+
|
|
6688
6761
|
if(!_.isEmpty(userFilters)){
|
|
6689
6762
|
if(_.isEmpty(filters)){
|
|
6690
6763
|
filters = userFilters;
|
|
@@ -6807,7 +6880,7 @@ setTimeout(()=>{
|
|
|
6807
6880
|
const data = await getFindQuery(object, recordId, fields, options);
|
|
6808
6881
|
return {
|
|
6809
6882
|
method: "post",
|
|
6810
|
-
url: getApi$2(),
|
|
6883
|
+
url: getApi$2(), // + "&recordId=${recordId}"
|
|
6811
6884
|
data: data,
|
|
6812
6885
|
headers: {
|
|
6813
6886
|
Authorization: "Bearer ${context.tenantId},${context.authToken}"
|
|
@@ -7442,7 +7515,7 @@ setTimeout(()=>{
|
|
|
7442
7515
|
* @Author: baozhoutao@steedos.com
|
|
7443
7516
|
* @Date: 2022-07-05 15:55:39
|
|
7444
7517
|
* @LastEditors: Please set LastEditors
|
|
7445
|
-
* @LastEditTime: 2023-
|
|
7518
|
+
* @LastEditTime: 2023-04-11 13:13:00
|
|
7446
7519
|
* @Description:
|
|
7447
7520
|
*/
|
|
7448
7521
|
|
|
@@ -7514,7 +7587,7 @@ setTimeout(()=>{
|
|
|
7514
7587
|
|
|
7515
7588
|
// 获取单个相关表
|
|
7516
7589
|
async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObjectName, relatedKey, ctx){
|
|
7517
|
-
let { top, perPage,
|
|
7590
|
+
let { top, perPage, appId, relatedLabel, className, columns, sort, filters, visible_on } = ctx;
|
|
7518
7591
|
// console.log('getRecordDetailRelatedListSchema==>',objectName,recordId,relatedObjectName)
|
|
7519
7592
|
const relatedObjectUiSchema = await getUISchema(relatedObjectName);
|
|
7520
7593
|
if(!relatedObjectUiSchema){
|
|
@@ -7549,6 +7622,7 @@ setTimeout(()=>{
|
|
|
7549
7622
|
relatedKey = mainRelated[relatedObjectName];
|
|
7550
7623
|
}
|
|
7551
7624
|
let globalFilter = null;
|
|
7625
|
+
// TODO: refField变量去掉,写到amis运行时脚本中,uiSchema.fields[relatedKey];可以取到
|
|
7552
7626
|
const refField = await getField(relatedObjectName, relatedKey);
|
|
7553
7627
|
|
|
7554
7628
|
if(!refField){
|
|
@@ -7563,24 +7637,22 @@ setTimeout(()=>{
|
|
|
7563
7637
|
}
|
|
7564
7638
|
}
|
|
7565
7639
|
}
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7569
|
-
|
|
7570
|
-
relatedValue = masterRecord[refField.reference_to_field];
|
|
7571
|
-
}
|
|
7640
|
+
// if(refField.reference_to_field && refField.reference_to_field != '_id'){
|
|
7641
|
+
// const masterRecord = await getRecord(objectName, recordId, [refField.reference_to_field]);
|
|
7642
|
+
// relatedValue = masterRecord[refField.reference_to_field]
|
|
7643
|
+
// }
|
|
7572
7644
|
|
|
7573
|
-
if (
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
) {
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
} else {
|
|
7582
|
-
|
|
7583
|
-
}
|
|
7645
|
+
// if (
|
|
7646
|
+
// refField._reference_to ||
|
|
7647
|
+
// (refField.reference_to && !isString(refField.reference_to))
|
|
7648
|
+
// ) {
|
|
7649
|
+
// globalFilter = [
|
|
7650
|
+
// [`${relatedKey}/o`, "=", objectName],
|
|
7651
|
+
// [`${relatedKey}/ids`, "=", relatedValue],
|
|
7652
|
+
// ];
|
|
7653
|
+
// } else {
|
|
7654
|
+
// globalFilter = [`${relatedKey}`, "=", relatedValue];
|
|
7655
|
+
// }
|
|
7584
7656
|
const recordRelatedListHeader = await getObjectRecordDetailRelatedListHeader(relatedObjectUiSchema, relatedLabel);
|
|
7585
7657
|
const componentId = `steedos-record-related-list-${relatedObjectName}`;
|
|
7586
7658
|
const options = {
|
|
@@ -7605,9 +7677,9 @@ setTimeout(()=>{
|
|
|
7605
7677
|
top: top,
|
|
7606
7678
|
perPage: perPage,
|
|
7607
7679
|
setDataToComponentId: componentId,
|
|
7608
|
-
tableHiddenOn: hiddenEmptyTable ? "this.$count === 0" : null,
|
|
7680
|
+
// tableHiddenOn: hiddenEmptyTable ? "this.$count === 0" : null,
|
|
7609
7681
|
appId: appId,
|
|
7610
|
-
crudClassName: 'border-t border-slate-300',
|
|
7682
|
+
crudClassName: 'border-t border-slate-300 hidden',
|
|
7611
7683
|
...ctx
|
|
7612
7684
|
};
|
|
7613
7685
|
const amisSchema= (await getRelatedListSchema(relatedObjectName, 'all', options)).amisSchema;
|
|
@@ -7619,33 +7691,14 @@ setTimeout(()=>{
|
|
|
7619
7691
|
amisSchema: {
|
|
7620
7692
|
type: "service",
|
|
7621
7693
|
id: componentId,
|
|
7622
|
-
className: `steedos-record-related-list rounded border border-slate-300 bg-gray-100 mb-4 ${className}`,
|
|
7694
|
+
className: `steedos-record-related-list ${componentId} rounded border border-slate-300 bg-gray-100 mb-4 ${className}`,
|
|
7623
7695
|
data: {
|
|
7624
|
-
"&": "$$",
|
|
7625
|
-
appId: "${appId}",
|
|
7626
|
-
app_id: "${appId}",
|
|
7627
|
-
masterObjectName: objectName,
|
|
7628
|
-
masterRecordId: "${recordId}",
|
|
7629
7696
|
relatedKey: relatedKey,
|
|
7630
|
-
objectName: relatedObjectName,
|
|
7631
7697
|
listViewId: `amis-\${appId}-${relatedObjectName}-listview`,
|
|
7632
7698
|
_isRelated: true
|
|
7633
7699
|
},
|
|
7634
7700
|
body:[
|
|
7635
|
-
|
|
7636
|
-
...amisSchema,
|
|
7637
|
-
data: {
|
|
7638
|
-
"&": "$$",
|
|
7639
|
-
appId: "${appId}",
|
|
7640
|
-
app_id: "${appId}",
|
|
7641
|
-
relatedKey: relatedKey,
|
|
7642
|
-
objectName: "${objectName}",
|
|
7643
|
-
recordId: "${masterRecordId}",
|
|
7644
|
-
defaultData: {
|
|
7645
|
-
...{[relatedKey]: getRelatedFieldValue(objectName, relatedValue, relatedObjectUiSchema, relatedKey)}
|
|
7646
|
-
}
|
|
7647
|
-
}
|
|
7648
|
-
}
|
|
7701
|
+
amisSchema
|
|
7649
7702
|
]
|
|
7650
7703
|
}
|
|
7651
7704
|
};
|
|
@@ -7684,13 +7737,13 @@ setTimeout(()=>{
|
|
|
7684
7737
|
columns = getListViewColumns(listView, ctx.formFactor);
|
|
7685
7738
|
sort = getListViewSort(listView);
|
|
7686
7739
|
filter = getListViewFilter(listView);
|
|
7687
|
-
if(
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
}else if(ctx.globalFilter && (!filter || !filter.length)){
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
}
|
|
7740
|
+
// if(isArray(ctx.globalFilter) && ctx.globalFilter.length && isArray(filter) && filter.length){
|
|
7741
|
+
// // 都有值
|
|
7742
|
+
// filter = [ctx.globalFilter, 'and', filter]
|
|
7743
|
+
// }else if(ctx.globalFilter && (!filter || !filter.length)){
|
|
7744
|
+
// // globalFilter有值,filter无值
|
|
7745
|
+
// filter = ctx.globalFilter;
|
|
7746
|
+
// }
|
|
7694
7747
|
filtersFunction = listView && listView._filters;
|
|
7695
7748
|
}else {
|
|
7696
7749
|
const isNameField = _$1.find(
|
|
@@ -7700,9 +7753,9 @@ setTimeout(()=>{
|
|
|
7700
7753
|
}
|
|
7701
7754
|
);
|
|
7702
7755
|
columns = isNameField ? [isNameField.name] : ['name'];
|
|
7703
|
-
if(ctx.globalFilter){
|
|
7704
|
-
|
|
7705
|
-
}
|
|
7756
|
+
// if(ctx.globalFilter){
|
|
7757
|
+
// filter = ctx.globalFilter;
|
|
7758
|
+
// }
|
|
7706
7759
|
}
|
|
7707
7760
|
|
|
7708
7761
|
return {
|
|
@@ -7726,7 +7779,7 @@ setTimeout(()=>{
|
|
|
7726
7779
|
return {
|
|
7727
7780
|
columns: ctx.columns,
|
|
7728
7781
|
sort,
|
|
7729
|
-
filter: ctx.globalFilter,
|
|
7782
|
+
// filter: ctx.globalFilter,
|
|
7730
7783
|
filtersFunction: filtersFunction
|
|
7731
7784
|
}
|
|
7732
7785
|
} else {
|
|
@@ -7765,6 +7818,16 @@ setTimeout(()=>{
|
|
|
7765
7818
|
delete ctx.filters;
|
|
7766
7819
|
|
|
7767
7820
|
delete ctx.globalFilter;
|
|
7821
|
+
|
|
7822
|
+
const adaptor = `
|
|
7823
|
+
if(setDataToComponentId){
|
|
7824
|
+
if(payload.data.count){
|
|
7825
|
+
setTimeout(function(){
|
|
7826
|
+
window.$("." + setDataToComponentId + " .antd-Crud").removeClass("hidden");
|
|
7827
|
+
}, 10);
|
|
7828
|
+
}
|
|
7829
|
+
};
|
|
7830
|
+
`;
|
|
7768
7831
|
const amisSchema = {
|
|
7769
7832
|
"type": "steedos-object-table",
|
|
7770
7833
|
"objectApiName": objectName,
|
|
@@ -7773,6 +7836,8 @@ setTimeout(()=>{
|
|
|
7773
7836
|
"filters": listviewFilter,
|
|
7774
7837
|
"filtersFunction": filtersFunction,
|
|
7775
7838
|
"sort": listViewSort,
|
|
7839
|
+
"filterVisible": false,
|
|
7840
|
+
adaptor,
|
|
7776
7841
|
"ctx": ctx
|
|
7777
7842
|
};
|
|
7778
7843
|
// console.log(`getRelatedListSchema amisSchema`, amisSchema);
|
|
@@ -7785,8 +7850,8 @@ setTimeout(()=>{
|
|
|
7785
7850
|
/*
|
|
7786
7851
|
* @Author: baozhoutao@steedos.com
|
|
7787
7852
|
* @Date: 2022-07-05 15:55:39
|
|
7788
|
-
* @LastEditors:
|
|
7789
|
-
* @LastEditTime: 2023-
|
|
7853
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
7854
|
+
* @LastEditTime: 2023-04-11 11:28:11
|
|
7790
7855
|
* @Description:
|
|
7791
7856
|
*/
|
|
7792
7857
|
|
|
@@ -7958,14 +8023,14 @@ setTimeout(()=>{
|
|
|
7958
8023
|
async function getFormSchema(objectName, ctx) {
|
|
7959
8024
|
const uiSchema = await getUISchema(objectName);
|
|
7960
8025
|
const amisSchema = await getObjectForm(uiSchema, ctx);
|
|
7961
|
-
|
|
8026
|
+
console.log(`getFormSchema====>`, amisSchema);
|
|
7962
8027
|
return {
|
|
7963
8028
|
uiSchema,
|
|
7964
8029
|
amisSchema,
|
|
7965
8030
|
};
|
|
7966
8031
|
}
|
|
7967
8032
|
|
|
7968
|
-
// 获取只读页面
|
|
8033
|
+
// 获取只读页面 recordId 已废弃, 函数签名保持不变, 但recordId变量不可再使用, 请使用运行时的${recordId}
|
|
7969
8034
|
async function getViewSchema(objectName, recordId, ctx) {
|
|
7970
8035
|
const uiSchema = await getUISchema(objectName);
|
|
7971
8036
|
const amisSchema = await getObjectDetail(uiSchema, recordId, ctx);
|
|
@@ -8150,6 +8215,7 @@ setTimeout(()=>{
|
|
|
8150
8215
|
headerToolbarItems: ctx.headerToolbarItems,
|
|
8151
8216
|
buttons: await getListViewItemButtons(uiSchema, ctx)
|
|
8152
8217
|
});
|
|
8218
|
+
// console.log('getTableSchema====>amisSchema', amisSchema)
|
|
8153
8219
|
return {
|
|
8154
8220
|
uiSchema,
|
|
8155
8221
|
amisSchema,
|
|
@@ -8234,37 +8300,14 @@ setTimeout(()=>{
|
|
|
8234
8300
|
amisSchema: {
|
|
8235
8301
|
"type": "service",
|
|
8236
8302
|
"body": [
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
onEvent: {
|
|
8244
|
-
"recordLoaded": {
|
|
8245
|
-
"actions": [
|
|
8246
|
-
{
|
|
8247
|
-
"actionType": "reload",
|
|
8248
|
-
"data": {
|
|
8249
|
-
"name": `\${event.data.record.${uiSchema?.NAME_FIELD_KEY || 'name'}}`,
|
|
8250
|
-
"record": `\${event.data.record}`,
|
|
8251
|
-
"recordLoaded": true,
|
|
8252
|
-
}
|
|
8253
|
-
},
|
|
8254
|
-
{
|
|
8255
|
-
"actionType": "reload",
|
|
8256
|
-
"componentId": `page_readonly_${objectName}_header`, //刷新标题, 详细页面header service 嵌套太多, 导致仅刷新第一层service无法更新recordName
|
|
8257
|
-
"data": {
|
|
8258
|
-
"name": `\${event.data.record.${uiSchema?.NAME_FIELD_KEY || 'name'}}`,
|
|
8259
|
-
"record": `\${event.data.record}`,
|
|
8260
|
-
"recordLoaded": true,
|
|
8261
|
-
}
|
|
8262
|
-
}
|
|
8263
|
-
]
|
|
8264
|
-
}
|
|
8303
|
+
{
|
|
8304
|
+
"type": "steedos-record-detail-header",
|
|
8305
|
+
"label": "标题面板",
|
|
8306
|
+
"objectApiName": "${objectName}",
|
|
8307
|
+
"recordId": "${recordId}",
|
|
8308
|
+
"id": "u:48d2c28eb755"
|
|
8265
8309
|
},
|
|
8266
|
-
|
|
8267
|
-
content
|
|
8310
|
+
content
|
|
8268
8311
|
],
|
|
8269
8312
|
data: {
|
|
8270
8313
|
"_master.objectName": "${objectName}",
|
|
@@ -8291,51 +8334,6 @@ setTimeout(()=>{
|
|
|
8291
8334
|
}
|
|
8292
8335
|
}
|
|
8293
8336
|
|
|
8294
|
-
// export async function getRecordDetailRelatedListSchema(objectName,recordId,relatedObjectName){
|
|
8295
|
-
// // console.log('b==>',objectName,recordId,relatedObjectName)
|
|
8296
|
-
// const relatedObjectUiSchema = await getUISchema(relatedObjectName);
|
|
8297
|
-
// const { list_views, label , icon, fields } = relatedObjectUiSchema;
|
|
8298
|
-
// const firstListViewName = keys(list_views)[0];
|
|
8299
|
-
// const relatedKey = findKey(fields, function(field) {
|
|
8300
|
-
// return ["lookup","master_detail"].indexOf(field.type) > -1 && field.reference_to === objectName;
|
|
8301
|
-
// });
|
|
8302
|
-
// const globalFilter = [relatedKey,'=',recordId];
|
|
8303
|
-
// const recordRelatedListHeader = await getObjectRecordDetailRelatedListHeader(relatedObjectUiSchema);
|
|
8304
|
-
// const options = {
|
|
8305
|
-
// globalFilter,
|
|
8306
|
-
// defaults: {
|
|
8307
|
-
// listSchema: { headerToolbar:[],columnsTogglable:false },
|
|
8308
|
-
// headerSchema: recordRelatedListHeader
|
|
8309
|
-
// },
|
|
8310
|
-
// showHeader: true
|
|
8311
|
-
// }
|
|
8312
|
-
// const amisSchema= (await getListSchema(null, relatedObjectName, firstListViewName, options)).amisSchema;
|
|
8313
|
-
// return {
|
|
8314
|
-
// uiSchema: relatedObjectUiSchema,
|
|
8315
|
-
// amisSchema: {
|
|
8316
|
-
// type: "service",
|
|
8317
|
-
// data: {
|
|
8318
|
-
// masterObjectName: objectName,
|
|
8319
|
-
// masterRecordId: "${recordId}",
|
|
8320
|
-
// relatedKey: relatedKey,
|
|
8321
|
-
// objectName: relatedObjectName,
|
|
8322
|
-
// listViewId: `amis-\${appId}-${relatedObjectName}-listview`,
|
|
8323
|
-
// },
|
|
8324
|
-
// body:[
|
|
8325
|
-
// {
|
|
8326
|
-
// ...amisSchema,
|
|
8327
|
-
// data: {
|
|
8328
|
-
// filter: ["${relatedKey}", "=", "${masterRecordId}"],
|
|
8329
|
-
// objectName: "${objectName}",
|
|
8330
|
-
// recordId: "${masterRecordId}",
|
|
8331
|
-
// ...{[relatedKey]: getRelatedFieldValue(objectName, "${recordId}", relatedSchema.uiSchema, relatedKey)}
|
|
8332
|
-
// }
|
|
8333
|
-
// }
|
|
8334
|
-
// ]
|
|
8335
|
-
// }
|
|
8336
|
-
// };
|
|
8337
|
-
// }
|
|
8338
|
-
|
|
8339
8337
|
|
|
8340
8338
|
// 获取单个相关表
|
|
8341
8339
|
async function getObjectRelated(
|