@steedos-widgets/amis-lib 1.1.7 → 1.2.0-beta.1
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 +266 -155
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +266 -156
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +269 -158
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/fields/lookup.d.ts +57 -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 +6 -29
- package/dist/types/lib/objectsRelated.d.ts +4 -12
- package/dist/types/schema/standard_new.amis.d.ts +3 -0
- package/dist/types/standard/button.d.ts +3 -0
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _$1 from 'lodash';
|
|
2
2
|
import ___default, { isEmpty, isArray, each, find, endsWith, cloneDeep, includes, get, map, keys, sortBy, compact, toArray, mergeWith, isBoolean, omitBy, isNil, isString, slice, defaultsDeep as defaultsDeep$1, isObject as isObject$1, has, filter, startsWith } from 'lodash';
|
|
3
|
-
import isPlainObject from 'lodash/isPlainObject';
|
|
4
3
|
import { Router as Router$1, getSteedosAuth as getSteedosAuth$1, lookupToAmis as lookupToAmis$1, fetchAPI as fetchAPI$1 } from '@steedos-widgets/amis-lib';
|
|
4
|
+
import isPlainObject from 'lodash/isPlainObject';
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* @Author: baozhoutao@steedos.com
|
|
@@ -652,11 +652,7 @@ function getRecordPermissionsTemplate(){
|
|
|
652
652
|
}
|
|
653
653
|
|
|
654
654
|
async function getFindOneQuery$1(object, recordId, fields, options){
|
|
655
|
-
let queryOptions = ""
|
|
656
|
-
|
|
657
|
-
if(recordId){
|
|
658
|
-
queryOptions = `(filters:["${object.idFieldName}", "=", "${recordId}"])`;
|
|
659
|
-
}
|
|
655
|
+
let queryOptions = `(filters:["${object.idFieldName}", "=", "\${recordId}"])`;
|
|
660
656
|
let alias = "data";
|
|
661
657
|
if(options){
|
|
662
658
|
if(options.alias){
|
|
@@ -1365,8 +1361,8 @@ var config = {
|
|
|
1365
1361
|
/*
|
|
1366
1362
|
* @Author: baozhoutao@steedos.com
|
|
1367
1363
|
* @Date: 2022-11-01 15:51:00
|
|
1368
|
-
* @LastEditors:
|
|
1369
|
-
* @LastEditTime: 2023-
|
|
1364
|
+
* @LastEditors: Please set LastEditors
|
|
1365
|
+
* @LastEditTime: 2023-04-08 12:05:19
|
|
1370
1366
|
* @Description:
|
|
1371
1367
|
*/
|
|
1372
1368
|
|
|
@@ -1384,6 +1380,32 @@ const getSchema$4 = async (uiSchema, ctx) => {
|
|
|
1384
1380
|
if (payload && payload.schema) {
|
|
1385
1381
|
formSchema = _.isString(payload.schema) ? JSON.parse(payload.schema) : payload.schema;
|
|
1386
1382
|
}
|
|
1383
|
+
|
|
1384
|
+
const _master = api.body._master;
|
|
1385
|
+
if(_master && _master._isRelated){
|
|
1386
|
+
const relatedKey = _master.relatedKey;
|
|
1387
|
+
const masterObjectName = _master.objectName;
|
|
1388
|
+
const recordId = _master.recordId;
|
|
1389
|
+
const fields = ${JSON.stringify(uiSchema.fields)};
|
|
1390
|
+
const relatedField = fields[relatedKey];
|
|
1391
|
+
let defaultData = {};
|
|
1392
|
+
let relatedKeyValue;
|
|
1393
|
+
if(!_.isString(relatedField.reference_to)){
|
|
1394
|
+
relatedKeyValue = { o: masterObjectName, ids: [recordId] };
|
|
1395
|
+
}else if (relatedField.multiple) {
|
|
1396
|
+
relatedKeyValue = [recordId];
|
|
1397
|
+
} else {
|
|
1398
|
+
relatedKeyValue = recordId;
|
|
1399
|
+
}
|
|
1400
|
+
defaultData[relatedKey]=relatedKeyValue;
|
|
1401
|
+
if(payload.schema){
|
|
1402
|
+
// 表单微页面第一层要求是page
|
|
1403
|
+
formSchema.data.defaultData = defaultData;
|
|
1404
|
+
}else{
|
|
1405
|
+
formSchema.defaultData = defaultData;
|
|
1406
|
+
}
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1387
1409
|
return {
|
|
1388
1410
|
data: formSchema
|
|
1389
1411
|
};
|
|
@@ -1407,6 +1429,8 @@ const getSchema$4 = async (uiSchema, ctx) => {
|
|
|
1407
1429
|
"data": {
|
|
1408
1430
|
"$master": "$$",
|
|
1409
1431
|
"_master": "${_master}",
|
|
1432
|
+
"_master._isRelated": "${_isRelated}",
|
|
1433
|
+
"_master.relatedKey": "${relatedKey}",
|
|
1410
1434
|
"defaultData": "${defaultData}",
|
|
1411
1435
|
"appId": "${appId}",
|
|
1412
1436
|
"objectName": "${objectName}",
|
|
@@ -1425,7 +1449,8 @@ const getSchema$4 = async (uiSchema, ctx) => {
|
|
|
1425
1449
|
"messages": {},
|
|
1426
1450
|
"schemaApi": {
|
|
1427
1451
|
"data": {
|
|
1428
|
-
"isLookup": "${isLookup}"
|
|
1452
|
+
"isLookup": "${isLookup}",
|
|
1453
|
+
"_master": "${_master}"
|
|
1429
1454
|
},
|
|
1430
1455
|
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}",
|
|
1431
1456
|
"method": "get",
|
|
@@ -1946,7 +1971,7 @@ const StandardButtons = {
|
|
|
1946
1971
|
getStandardNew: async (uiSchema, ctx)=>{
|
|
1947
1972
|
return {
|
|
1948
1973
|
type: 'amis_button',
|
|
1949
|
-
amis_schema: await getSchema$4()
|
|
1974
|
+
amis_schema: await getSchema$4(uiSchema)
|
|
1950
1975
|
}
|
|
1951
1976
|
},
|
|
1952
1977
|
getStandardEdit: async (uiSchema, ctx)=>{
|
|
@@ -2030,7 +2055,7 @@ function getButtonVisibleOn$1(button){
|
|
|
2030
2055
|
if(visible.trim().startsWith('function')){
|
|
2031
2056
|
return `${visible}.apply({
|
|
2032
2057
|
object: uiSchema
|
|
2033
|
-
}, [objectName, _id, typeof record === 'undefined' ? (typeof recordPermissions === 'undefined' ? {} : recordPermissions) : record.recordPermissions, data])`
|
|
2058
|
+
}, [objectName, typeof _id === 'undefined' ? null: _id, typeof record === 'undefined' ? (typeof recordPermissions === 'undefined' ? {} : recordPermissions) : record.recordPermissions, data])`
|
|
2034
2059
|
}
|
|
2035
2060
|
return visible;
|
|
2036
2061
|
}
|
|
@@ -3160,9 +3185,8 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
|
3160
3185
|
|
|
3161
3186
|
let body = [
|
|
3162
3187
|
{
|
|
3163
|
-
"type": "
|
|
3164
|
-
"
|
|
3165
|
-
data: { "&":"$$", objectName: name, _id: recordId, recordPermissions: "${record.recordPermissions}", uiSchema: objectSchema},
|
|
3188
|
+
"type": "wrapper",
|
|
3189
|
+
"className": "p-0",
|
|
3166
3190
|
"body": [
|
|
3167
3191
|
{
|
|
3168
3192
|
"type": "grid",
|
|
@@ -3170,14 +3194,14 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
|
3170
3194
|
"className": "flex justify-between"
|
|
3171
3195
|
}
|
|
3172
3196
|
],
|
|
3173
|
-
"messages": {},
|
|
3174
3197
|
"hiddenOn": "${recordLoaded != true}"
|
|
3175
3198
|
}
|
|
3176
3199
|
];
|
|
3177
3200
|
|
|
3178
3201
|
if(showRecordTitle){
|
|
3179
3202
|
body.push({
|
|
3180
|
-
"type": "
|
|
3203
|
+
"type": "wrapper",
|
|
3204
|
+
"className": "p-0",
|
|
3181
3205
|
"body": [
|
|
3182
3206
|
{
|
|
3183
3207
|
"type": "grid",
|
|
@@ -3185,16 +3209,15 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
|
3185
3209
|
"className": "flex justify-between"
|
|
3186
3210
|
}
|
|
3187
3211
|
],
|
|
3188
|
-
"messages": {},
|
|
3189
3212
|
"hiddenOn": "${recordLoaded == true}"
|
|
3190
3213
|
});
|
|
3191
3214
|
}
|
|
3192
3215
|
|
|
3193
3216
|
return {
|
|
3194
3217
|
type: 'service',
|
|
3195
|
-
|
|
3218
|
+
id: `page_readonly_${name}_header`,
|
|
3196
3219
|
name: `page`,
|
|
3197
|
-
data: {
|
|
3220
|
+
data: { objectName: name, _id: recordId, recordPermissions: objectSchema.permissions, uiSchema: objectSchema, record: "${record}" },
|
|
3198
3221
|
body: body,
|
|
3199
3222
|
className: ''
|
|
3200
3223
|
}
|
|
@@ -3249,7 +3272,7 @@ async function getObjectRecordDetailRelatedListHeader(relatedObjectSchema, relat
|
|
|
3249
3272
|
"body": [
|
|
3250
3273
|
{
|
|
3251
3274
|
"type": "tpl",
|
|
3252
|
-
"tpl": `<a class="text-black text-base font-bold" href="/app/\${appId}/\${
|
|
3275
|
+
"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>`,
|
|
3253
3276
|
"inline": false,
|
|
3254
3277
|
"wrapperComponent": "",
|
|
3255
3278
|
"className": "",
|
|
@@ -3290,17 +3313,22 @@ async function getObjectRecordDetailRelatedListHeader(relatedObjectSchema, relat
|
|
|
3290
3313
|
async function getObjectRelatedListHeader(objectSchema, recordId, relatedObjectName) {
|
|
3291
3314
|
}
|
|
3292
3315
|
|
|
3293
|
-
const getDisplayAsButton = function(showDisplayAs){
|
|
3316
|
+
const getDisplayAsButton = function(objectName, showDisplayAs){
|
|
3317
|
+
let displayAs = Router$1.getTabDisplayAs(objectName);
|
|
3294
3318
|
let buttons = [
|
|
3295
3319
|
{
|
|
3296
3320
|
"type": "button",
|
|
3297
3321
|
"label": "表格",
|
|
3298
|
-
"onClick": "
|
|
3322
|
+
"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');",
|
|
3323
|
+
"rightIcon": displayAs != 'split' ? "fa fa-check" : null,
|
|
3324
|
+
"rightIconClassName": "m-l-sm"
|
|
3299
3325
|
},
|
|
3300
3326
|
{
|
|
3301
3327
|
"type": "button",
|
|
3302
3328
|
"label": "分栏视图",
|
|
3303
|
-
"onClick": "const url = document.location.pathname + '?display=split'; props.env.jumpTo(url);"
|
|
3329
|
+
"onClick": "const url = document.location.pathname + '?display=split'; props.env.jumpTo(url);",
|
|
3330
|
+
"rightIcon": displayAs === 'split' ? "fa fa-check" : null,
|
|
3331
|
+
"rightIconClassName": "m-l-sm"
|
|
3304
3332
|
}
|
|
3305
3333
|
];
|
|
3306
3334
|
return {
|
|
@@ -3442,7 +3470,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3442
3470
|
}
|
|
3443
3471
|
}
|
|
3444
3472
|
},
|
|
3445
|
-
showDisplayAs? getDisplayAsButton() : {}
|
|
3473
|
+
showDisplayAs? getDisplayAsButton(mainObject?.name) : {}
|
|
3446
3474
|
]
|
|
3447
3475
|
}else {
|
|
3448
3476
|
return [
|
|
@@ -3523,7 +3551,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3523
3551
|
}
|
|
3524
3552
|
}
|
|
3525
3553
|
},
|
|
3526
|
-
showDisplayAs? getDisplayAsButton() : {}
|
|
3554
|
+
showDisplayAs? getDisplayAsButton(showDisplayAs) : {}
|
|
3527
3555
|
// {
|
|
3528
3556
|
// "type": "search-box",
|
|
3529
3557
|
// "align": "right",
|
|
@@ -3802,6 +3830,90 @@ const getReferenceTo = async (field)=>{
|
|
|
3802
3830
|
}
|
|
3803
3831
|
};
|
|
3804
3832
|
|
|
3833
|
+
function getLookupSapceUserTreeSchema(){
|
|
3834
|
+
const tree = [{
|
|
3835
|
+
"type": "input-tree",
|
|
3836
|
+
"className": "",
|
|
3837
|
+
"id": "u:7fd77b7915b0",
|
|
3838
|
+
"source": {
|
|
3839
|
+
"method": "post",
|
|
3840
|
+
"url": "${context.rootUrl}/graphql",
|
|
3841
|
+
"headers": {
|
|
3842
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
3843
|
+
},
|
|
3844
|
+
"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 ",
|
|
3845
|
+
"requestAdaptor": "\n ",
|
|
3846
|
+
"data": {
|
|
3847
|
+
"query": "{options:organizations(filters:[\"hidden\", \"!=\", true],sort:\"sort_no desc\"){value:_id label:name,parent,children}}"
|
|
3848
|
+
},
|
|
3849
|
+
"messages": {
|
|
3850
|
+
},
|
|
3851
|
+
"cache": 300000
|
|
3852
|
+
},
|
|
3853
|
+
"onEvent": {
|
|
3854
|
+
"change": {
|
|
3855
|
+
"actions": [
|
|
3856
|
+
{
|
|
3857
|
+
"actionType": "custom",
|
|
3858
|
+
"script": `
|
|
3859
|
+
debugger;
|
|
3860
|
+
const scope = event.context.scoped;
|
|
3861
|
+
//TODO: 将form中的value一同加入筛选内
|
|
3862
|
+
// var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
3863
|
+
// return n.props.type === "form";
|
|
3864
|
+
// });
|
|
3865
|
+
// var filterFormValues = filterForm.getValues();
|
|
3866
|
+
filterFormValues={
|
|
3867
|
+
"__searchable__organizations_parents":event.data.value.value
|
|
3868
|
+
}
|
|
3869
|
+
var listView = scope.parent.getComponents().find(function(n){
|
|
3870
|
+
return n.props.type === "crud";
|
|
3871
|
+
});
|
|
3872
|
+
const removedValues = {};
|
|
3873
|
+
// for(var k in filterFormValues){
|
|
3874
|
+
// if(filterFormValues[k] === "" && !filterFormValues.hasOwnProperty(k)){
|
|
3875
|
+
// removedValues[k] = "";
|
|
3876
|
+
// }
|
|
3877
|
+
// }
|
|
3878
|
+
listView.handleFilterSubmit(Object.assign({}, removedValues, filterFormValues));
|
|
3879
|
+
`
|
|
3880
|
+
}
|
|
3881
|
+
]
|
|
3882
|
+
}
|
|
3883
|
+
},
|
|
3884
|
+
"label": "",
|
|
3885
|
+
"name": "organizations",
|
|
3886
|
+
"multiple": false,
|
|
3887
|
+
"joinValues": false,
|
|
3888
|
+
"clearValueOnHidden": false,
|
|
3889
|
+
"fieldName": "organizations",
|
|
3890
|
+
"hideRoot": true,
|
|
3891
|
+
"initiallyOpen": false,
|
|
3892
|
+
"extractValue": true,
|
|
3893
|
+
"onlyChildren": true,
|
|
3894
|
+
"treeContainerClassName": "no-border",
|
|
3895
|
+
"showIcon": false,
|
|
3896
|
+
"enableNodePath": false,
|
|
3897
|
+
"autoCheckChildren": false,
|
|
3898
|
+
"searchable": true,
|
|
3899
|
+
"searchConfig": {
|
|
3900
|
+
"sticky": true
|
|
3901
|
+
},
|
|
3902
|
+
"unfoldedLevel": 2,
|
|
3903
|
+
"style": {
|
|
3904
|
+
"max-height": "100%",
|
|
3905
|
+
"position": "absolute",
|
|
3906
|
+
"left": "-190px",
|
|
3907
|
+
"width": "190px",
|
|
3908
|
+
"bottom": 0,
|
|
3909
|
+
"top": "0",
|
|
3910
|
+
"overflow": "auto",
|
|
3911
|
+
"min-height":"300px"
|
|
3912
|
+
},
|
|
3913
|
+
"originPosition": "left-top"
|
|
3914
|
+
}];
|
|
3915
|
+
return tree;
|
|
3916
|
+
}
|
|
3805
3917
|
|
|
3806
3918
|
async function lookupToAmisPicker(field, readonly, ctx){
|
|
3807
3919
|
let referenceTo = await getReferenceTo(field);
|
|
@@ -4044,7 +4156,16 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
4044
4156
|
...ctx
|
|
4045
4157
|
});
|
|
4046
4158
|
|
|
4047
|
-
|
|
4159
|
+
var headerToolbarItems = [];
|
|
4160
|
+
const isMobile = window.innerWidth < 768;
|
|
4161
|
+
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user" && !isMobile){
|
|
4162
|
+
headerToolbarItems = getLookupSapceUserTreeSchema();
|
|
4163
|
+
pickerSchema["style"] = {
|
|
4164
|
+
"margin-left":"200px",
|
|
4165
|
+
"min-height": "300px"
|
|
4166
|
+
};
|
|
4167
|
+
}
|
|
4168
|
+
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, ctx.formFactor, { headerToolbarItems });
|
|
4048
4169
|
const isAllowCreate = refObjectConfig.permissions.allowCreate;
|
|
4049
4170
|
if (isAllowCreate) {
|
|
4050
4171
|
const new_button = await getSchema$4(refObjectConfig, { appId: ctx.appId, objectName: refObjectConfig.name, formFactor: ctx.formFactor });
|
|
@@ -4052,15 +4173,18 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
4052
4173
|
pickerSchema.headerToolbar.push(new_button);
|
|
4053
4174
|
}
|
|
4054
4175
|
pickerSchema.footerToolbar = refObjectConfig.enable_tree ? [] : getObjectFooterToolbar();
|
|
4055
|
-
if
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4176
|
+
//TODO: 等待放大镜bug修复,if会去掉,始终显示放大镜
|
|
4177
|
+
if(referenceTo.objectName != "space_users" || field.reference_to_field != "user"){
|
|
4178
|
+
if (ctx.filterVisible !== false) {
|
|
4179
|
+
let filterLoopCount = ctx.filterLoopCount || 0;
|
|
4180
|
+
filterLoopCount++;
|
|
4181
|
+
// 可以传入filterVisible为false防止死循环
|
|
4182
|
+
pickerSchema.filter = await getObjectFilter(refObjectConfig, fields, {
|
|
4183
|
+
isLookup: true,
|
|
4184
|
+
...ctx,
|
|
4185
|
+
filterLoopCount,
|
|
4186
|
+
});
|
|
4187
|
+
}
|
|
4064
4188
|
}
|
|
4065
4189
|
pickerSchema.data = Object.assign({}, pickerSchema.data, {
|
|
4066
4190
|
"&": "$$",
|
|
@@ -4308,7 +4432,7 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
4308
4432
|
if(ctx.idsDependOn || field.amis){
|
|
4309
4433
|
return await lookupToAmisIdsPicker(field, readonly, ctx);
|
|
4310
4434
|
}
|
|
4311
|
-
return await lookupToAmisSelectUser(field, readonly, ctx);
|
|
4435
|
+
// return await lookupToAmisSelectUser(field, readonly, ctx);
|
|
4312
4436
|
}
|
|
4313
4437
|
|
|
4314
4438
|
const refObject = await getUISchema(referenceTo.objectName);
|
|
@@ -5289,8 +5413,9 @@ function getReadonlyFormAdaptor(fields){
|
|
|
5289
5413
|
async function getReadonlyFormInitApi(object, recordId, fields, options){
|
|
5290
5414
|
return {
|
|
5291
5415
|
method: "post",
|
|
5292
|
-
url: getApi$2()+"
|
|
5416
|
+
url: getApi$2()+"&recordId=${recordId}",
|
|
5293
5417
|
cache: API_CACHE,
|
|
5418
|
+
// requestAdaptor: "console.log('getReadonlyFormInitApi requestAdaptor', api);return api;",
|
|
5294
5419
|
adaptor: getReadonlyFormAdaptor(fields),
|
|
5295
5420
|
data: await getFindOneQuery$1(object, recordId, fields, options),
|
|
5296
5421
|
headers: {
|
|
@@ -5397,6 +5522,7 @@ async function getEditFormInitApi(object, recordId, fields, options){
|
|
|
5397
5522
|
data.global = "${global}";
|
|
5398
5523
|
data.context = "${context}";
|
|
5399
5524
|
data.defaultData = "${defaultData}";
|
|
5525
|
+
|
|
5400
5526
|
return {
|
|
5401
5527
|
method: "post",
|
|
5402
5528
|
url: getApi$2(),
|
|
@@ -5765,7 +5891,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
5765
5891
|
keepItemSelectionOnPageChange: true,
|
|
5766
5892
|
api: await getTableApi(objectSchema, fields, options),
|
|
5767
5893
|
hiddenOn: options.tableHiddenOn,
|
|
5768
|
-
autoFillHeight: true,
|
|
5894
|
+
autoFillHeight: options.isRelated ? false : true,
|
|
5769
5895
|
className: `flex-auto ${crudClassName || ""}`,
|
|
5770
5896
|
crudClassName: crudClassName,
|
|
5771
5897
|
},
|
|
@@ -5808,11 +5934,11 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
5808
5934
|
id: `service_${id}`,
|
|
5809
5935
|
name: `page`,
|
|
5810
5936
|
data: {
|
|
5811
|
-
objectName: objectSchema.name,
|
|
5812
|
-
_id: null,
|
|
5937
|
+
// objectName: objectSchema.name,
|
|
5938
|
+
// _id: null,
|
|
5813
5939
|
recordPermissions: objectSchema.permissions,
|
|
5814
5940
|
uiSchema: objectSchema,
|
|
5815
|
-
loaded: false //crud接收适配器中设置为true,否则就是刷新浏览器第一次加载
|
|
5941
|
+
// loaded: false //crud接收适配器中设置为true,否则就是刷新浏览器第一次加载
|
|
5816
5942
|
},
|
|
5817
5943
|
body: body
|
|
5818
5944
|
}
|
|
@@ -5925,6 +6051,10 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
5925
6051
|
"objectName": "${_master.objectName}"
|
|
5926
6052
|
},
|
|
5927
6053
|
"expression": `\${_master.objectName != '${objectSchema.name}' && _master.objectName}`
|
|
6054
|
+
},
|
|
6055
|
+
{
|
|
6056
|
+
"args": {},
|
|
6057
|
+
"actionType": "closeDialog"
|
|
5928
6058
|
}
|
|
5929
6059
|
]
|
|
5930
6060
|
}
|
|
@@ -6271,7 +6401,7 @@ function getButtonVisibleOn(button){
|
|
|
6271
6401
|
// return 'false';
|
|
6272
6402
|
// }
|
|
6273
6403
|
if(visible.trim().startsWith('function')){
|
|
6274
|
-
return `${visible}(objectName, _id, typeof record === 'undefined' ? (typeof recordPermissions === 'undefined' ? {} : recordPermissions) : record.recordPermissions, data)`
|
|
6404
|
+
return `${visible}(objectName, typeof _id === 'undefined' ? null: _id, typeof record === 'undefined' ? (typeof recordPermissions === 'undefined' ? {} : recordPermissions) : record.recordPermissions, data)`
|
|
6275
6405
|
}
|
|
6276
6406
|
return visible;
|
|
6277
6407
|
}
|
|
@@ -6436,6 +6566,11 @@ async function getTableApi(mainObject, fields, options){
|
|
|
6436
6566
|
|
|
6437
6567
|
let valueField = mainObject.key_field || '_id';
|
|
6438
6568
|
const api = await getApi(mainObject, null, fields, {count: options.queryCount, alias: 'rows', limit: top, queryOptions: `filters: {__filters}, top: {__top}, skip: {__skip}, sort: "{__sort}"`});
|
|
6569
|
+
|
|
6570
|
+
if(options.isRelated){
|
|
6571
|
+
api.url += "&recordId=${recordId}";
|
|
6572
|
+
}
|
|
6573
|
+
|
|
6439
6574
|
api.data.$term = "$term";
|
|
6440
6575
|
api.data.$self = "$$";
|
|
6441
6576
|
api.data.filter = "$filter";
|
|
@@ -6555,11 +6690,36 @@ async function getTableApi(mainObject, fields, options){
|
|
|
6555
6690
|
if(!_.isEmpty(systemFilters)){
|
|
6556
6691
|
filters = systemFilters;
|
|
6557
6692
|
};
|
|
6558
|
-
|
|
6559
6693
|
if(api.data.$self.additionalFilters){
|
|
6560
6694
|
userFilters.push(api.data.$self.additionalFilters)
|
|
6561
6695
|
}
|
|
6562
6696
|
|
|
6697
|
+
if(api.data.$self._isRelated){
|
|
6698
|
+
const self = api.data.$self;
|
|
6699
|
+
const relatedKey = self.relatedKey;
|
|
6700
|
+
const recordId = self.recordId;
|
|
6701
|
+
const refField = self.uiSchema.fields[relatedKey];
|
|
6702
|
+
const masterRecord = self._master.record;
|
|
6703
|
+
const masterObjectName = self._master.objectName;
|
|
6704
|
+
let relatedValue = recordId;
|
|
6705
|
+
if(refField.reference_to_field && refField.reference_to_field != '_id'){
|
|
6706
|
+
relatedValue = masterRecord[refField.reference_to_field]
|
|
6707
|
+
}
|
|
6708
|
+
let relatedFilters;
|
|
6709
|
+
if (
|
|
6710
|
+
refField._reference_to ||
|
|
6711
|
+
(refField.reference_to && !_.isString(refField.reference_to))
|
|
6712
|
+
) {
|
|
6713
|
+
relatedFilters = [
|
|
6714
|
+
[relatedKey + "/o", "=", masterObjectName],
|
|
6715
|
+
[relatedKey + "/ids", "=", relatedValue],
|
|
6716
|
+
];
|
|
6717
|
+
} else {
|
|
6718
|
+
relatedFilters = [relatedKey, "=", relatedValue];
|
|
6719
|
+
}
|
|
6720
|
+
userFilters.push(relatedFilters)
|
|
6721
|
+
}
|
|
6722
|
+
|
|
6563
6723
|
if(!_.isEmpty(userFilters)){
|
|
6564
6724
|
if(_.isEmpty(filters)){
|
|
6565
6725
|
filters = userFilters;
|
|
@@ -6682,7 +6842,7 @@ async function getApi(object, recordId, fields, options){
|
|
|
6682
6842
|
const data = await getFindQuery(object, recordId, fields, options);
|
|
6683
6843
|
return {
|
|
6684
6844
|
method: "post",
|
|
6685
|
-
url: getApi$2(),
|
|
6845
|
+
url: getApi$2(), // + "&recordId=${recordId}"
|
|
6686
6846
|
data: data,
|
|
6687
6847
|
headers: {
|
|
6688
6848
|
Authorization: "Bearer ${context.tenantId},${context.authToken}"
|
|
@@ -7316,8 +7476,8 @@ const getRecordPermissions = async (objectName, recordId)=>{
|
|
|
7316
7476
|
/*
|
|
7317
7477
|
* @Author: baozhoutao@steedos.com
|
|
7318
7478
|
* @Date: 2022-07-05 15:55:39
|
|
7319
|
-
* @LastEditors:
|
|
7320
|
-
* @LastEditTime: 2023-
|
|
7479
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
7480
|
+
* @LastEditTime: 2023-04-08 18:14:55
|
|
7321
7481
|
* @Description:
|
|
7322
7482
|
*/
|
|
7323
7483
|
|
|
@@ -7389,7 +7549,7 @@ async function getObjectRelatedList(
|
|
|
7389
7549
|
|
|
7390
7550
|
// 获取单个相关表
|
|
7391
7551
|
async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObjectName, relatedKey, ctx){
|
|
7392
|
-
let { top, perPage,
|
|
7552
|
+
let { top, perPage, appId, relatedLabel, className, columns, sort, filters, visible_on } = ctx;
|
|
7393
7553
|
// console.log('getRecordDetailRelatedListSchema==>',objectName,recordId,relatedObjectName)
|
|
7394
7554
|
const relatedObjectUiSchema = await getUISchema(relatedObjectName);
|
|
7395
7555
|
if(!relatedObjectUiSchema){
|
|
@@ -7424,6 +7584,7 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
|
|
|
7424
7584
|
relatedKey = mainRelated[relatedObjectName];
|
|
7425
7585
|
}
|
|
7426
7586
|
let globalFilter = null;
|
|
7587
|
+
// TODO: refField变量去掉,写到amis运行时脚本中,uiSchema.fields[relatedKey];可以取到
|
|
7427
7588
|
const refField = await getField(relatedObjectName, relatedKey);
|
|
7428
7589
|
|
|
7429
7590
|
if(!refField){
|
|
@@ -7439,23 +7600,23 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
|
|
|
7439
7600
|
}
|
|
7440
7601
|
}
|
|
7441
7602
|
|
|
7442
|
-
let relatedValue = recordId;
|
|
7443
|
-
if(refField.reference_to_field && refField.reference_to_field != '_id'){
|
|
7444
|
-
|
|
7445
|
-
|
|
7446
|
-
}
|
|
7603
|
+
let relatedValue = "${recordId}";
|
|
7604
|
+
// if(refField.reference_to_field && refField.reference_to_field != '_id'){
|
|
7605
|
+
// const masterRecord = await getRecord(objectName, recordId, [refField.reference_to_field]);
|
|
7606
|
+
// relatedValue = masterRecord[refField.reference_to_field]
|
|
7607
|
+
// }
|
|
7447
7608
|
|
|
7448
|
-
if (
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
) {
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
|
|
7455
|
-
|
|
7456
|
-
} else {
|
|
7457
|
-
|
|
7458
|
-
}
|
|
7609
|
+
// if (
|
|
7610
|
+
// refField._reference_to ||
|
|
7611
|
+
// (refField.reference_to && !isString(refField.reference_to))
|
|
7612
|
+
// ) {
|
|
7613
|
+
// globalFilter = [
|
|
7614
|
+
// [`${relatedKey}/o`, "=", objectName],
|
|
7615
|
+
// [`${relatedKey}/ids`, "=", relatedValue],
|
|
7616
|
+
// ];
|
|
7617
|
+
// } else {
|
|
7618
|
+
// globalFilter = [`${relatedKey}`, "=", relatedValue];
|
|
7619
|
+
// }
|
|
7459
7620
|
const recordRelatedListHeader = await getObjectRecordDetailRelatedListHeader(relatedObjectUiSchema, relatedLabel);
|
|
7460
7621
|
const componentId = `steedos-record-related-list-${relatedObjectName}`;
|
|
7461
7622
|
const options = {
|
|
@@ -7480,9 +7641,9 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
|
|
|
7480
7641
|
top: top,
|
|
7481
7642
|
perPage: perPage,
|
|
7482
7643
|
setDataToComponentId: componentId,
|
|
7483
|
-
tableHiddenOn: hiddenEmptyTable ? "this.$count === 0" : null,
|
|
7644
|
+
// tableHiddenOn: hiddenEmptyTable ? "this.$count === 0" : null,
|
|
7484
7645
|
appId: appId,
|
|
7485
|
-
crudClassName: 'border-t border-slate-300',
|
|
7646
|
+
crudClassName: 'border-t border-slate-300 hidden',
|
|
7486
7647
|
...ctx
|
|
7487
7648
|
};
|
|
7488
7649
|
const amisSchema= (await getRelatedListSchema(relatedObjectName, 'all', options)).amisSchema;
|
|
@@ -7494,15 +7655,9 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
|
|
|
7494
7655
|
amisSchema: {
|
|
7495
7656
|
type: "service",
|
|
7496
7657
|
id: componentId,
|
|
7497
|
-
className: `steedos-record-related-list rounded border border-slate-300 bg-gray-100 mb-4 ${className}`,
|
|
7658
|
+
className: `steedos-record-related-list ${componentId} rounded border border-slate-300 bg-gray-100 mb-4 ${className}`,
|
|
7498
7659
|
data: {
|
|
7499
|
-
"&": "$$",
|
|
7500
|
-
appId: "${appId}",
|
|
7501
|
-
app_id: "${appId}",
|
|
7502
|
-
masterObjectName: objectName,
|
|
7503
|
-
masterRecordId: "${recordId}",
|
|
7504
7660
|
relatedKey: relatedKey,
|
|
7505
|
-
objectName: relatedObjectName,
|
|
7506
7661
|
listViewId: `amis-\${appId}-${relatedObjectName}-listview`,
|
|
7507
7662
|
_isRelated: true
|
|
7508
7663
|
},
|
|
@@ -7510,12 +7665,6 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
|
|
|
7510
7665
|
{
|
|
7511
7666
|
...amisSchema,
|
|
7512
7667
|
data: {
|
|
7513
|
-
"&": "$$",
|
|
7514
|
-
appId: "${appId}",
|
|
7515
|
-
app_id: "${appId}",
|
|
7516
|
-
relatedKey: relatedKey,
|
|
7517
|
-
objectName: "${objectName}",
|
|
7518
|
-
recordId: "${masterRecordId}",
|
|
7519
7668
|
defaultData: {
|
|
7520
7669
|
...{[relatedKey]: getRelatedFieldValue(objectName, relatedValue, relatedObjectUiSchema, relatedKey)}
|
|
7521
7670
|
}
|
|
@@ -7559,13 +7708,13 @@ function getDefaultRelatedListProps(uiSchema, listName, ctx) {
|
|
|
7559
7708
|
columns = getListViewColumns(listView, ctx.formFactor);
|
|
7560
7709
|
sort = getListViewSort(listView);
|
|
7561
7710
|
filter = getListViewFilter(listView);
|
|
7562
|
-
if(isArray(ctx.globalFilter) && ctx.globalFilter.length && isArray(filter) && filter.length){
|
|
7563
|
-
|
|
7564
|
-
|
|
7565
|
-
}else if(ctx.globalFilter && (!filter || !filter.length)){
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
}
|
|
7711
|
+
// if(isArray(ctx.globalFilter) && ctx.globalFilter.length && isArray(filter) && filter.length){
|
|
7712
|
+
// // 都有值
|
|
7713
|
+
// filter = [ctx.globalFilter, 'and', filter]
|
|
7714
|
+
// }else if(ctx.globalFilter && (!filter || !filter.length)){
|
|
7715
|
+
// // globalFilter有值,filter无值
|
|
7716
|
+
// filter = ctx.globalFilter;
|
|
7717
|
+
// }
|
|
7569
7718
|
filtersFunction = listView && listView._filters;
|
|
7570
7719
|
}else {
|
|
7571
7720
|
const isNameField = find(
|
|
@@ -7575,9 +7724,9 @@ function getDefaultRelatedListProps(uiSchema, listName, ctx) {
|
|
|
7575
7724
|
}
|
|
7576
7725
|
);
|
|
7577
7726
|
columns = isNameField ? [isNameField.name] : ['name'];
|
|
7578
|
-
if(ctx.globalFilter){
|
|
7579
|
-
|
|
7580
|
-
}
|
|
7727
|
+
// if(ctx.globalFilter){
|
|
7728
|
+
// filter = ctx.globalFilter;
|
|
7729
|
+
// }
|
|
7581
7730
|
}
|
|
7582
7731
|
|
|
7583
7732
|
return {
|
|
@@ -7601,7 +7750,7 @@ function getRelatedListProps(uiSchema, listViewName, ctx) {
|
|
|
7601
7750
|
return {
|
|
7602
7751
|
columns: ctx.columns,
|
|
7603
7752
|
sort,
|
|
7604
|
-
filter: ctx.globalFilter,
|
|
7753
|
+
// filter: ctx.globalFilter,
|
|
7605
7754
|
filtersFunction: filtersFunction
|
|
7606
7755
|
}
|
|
7607
7756
|
} else {
|
|
@@ -7640,6 +7789,16 @@ async function getRelatedListSchema(
|
|
|
7640
7789
|
delete ctx.filters;
|
|
7641
7790
|
|
|
7642
7791
|
delete ctx.globalFilter;
|
|
7792
|
+
|
|
7793
|
+
const adaptor = `
|
|
7794
|
+
if(setDataToComponentId){
|
|
7795
|
+
if(payload.data.count){
|
|
7796
|
+
setTimeout(function(){
|
|
7797
|
+
window.$("." + setDataToComponentId + " .antd-Crud").removeClass("hidden");
|
|
7798
|
+
}, 10);
|
|
7799
|
+
}
|
|
7800
|
+
};
|
|
7801
|
+
`;
|
|
7643
7802
|
const amisSchema = {
|
|
7644
7803
|
"type": "steedos-object-table",
|
|
7645
7804
|
"objectApiName": objectName,
|
|
@@ -7648,6 +7807,8 @@ async function getRelatedListSchema(
|
|
|
7648
7807
|
"filters": listviewFilter,
|
|
7649
7808
|
"filtersFunction": filtersFunction,
|
|
7650
7809
|
"sort": listViewSort,
|
|
7810
|
+
"filterVisible": false,
|
|
7811
|
+
adaptor,
|
|
7651
7812
|
"ctx": ctx
|
|
7652
7813
|
};
|
|
7653
7814
|
// console.log(`getRelatedListSchema amisSchema`, amisSchema);
|
|
@@ -7660,8 +7821,8 @@ async function getRelatedListSchema(
|
|
|
7660
7821
|
/*
|
|
7661
7822
|
* @Author: baozhoutao@steedos.com
|
|
7662
7823
|
* @Date: 2022-07-05 15:55:39
|
|
7663
|
-
* @LastEditors:
|
|
7664
|
-
* @LastEditTime: 2023-
|
|
7824
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
7825
|
+
* @LastEditTime: 2023-04-08 17:31:57
|
|
7665
7826
|
* @Description:
|
|
7666
7827
|
*/
|
|
7667
7828
|
|
|
@@ -7833,14 +7994,14 @@ async function getField(objectName, fieldName) {
|
|
|
7833
7994
|
async function getFormSchema(objectName, ctx) {
|
|
7834
7995
|
const uiSchema = await getUISchema(objectName);
|
|
7835
7996
|
const amisSchema = await getObjectForm(uiSchema, ctx);
|
|
7836
|
-
|
|
7997
|
+
console.log(`getFormSchema====>`, amisSchema);
|
|
7837
7998
|
return {
|
|
7838
7999
|
uiSchema,
|
|
7839
8000
|
amisSchema,
|
|
7840
8001
|
};
|
|
7841
8002
|
}
|
|
7842
8003
|
|
|
7843
|
-
// 获取只读页面
|
|
8004
|
+
// 获取只读页面 recordId 已废弃, 函数签名保持不变, 但recordId变量不可再使用, 请使用运行时的${recordId}
|
|
7844
8005
|
async function getViewSchema(objectName, recordId, ctx) {
|
|
7845
8006
|
const uiSchema = await getUISchema(objectName);
|
|
7846
8007
|
const amisSchema = await getObjectDetail(uiSchema, recordId, ctx);
|
|
@@ -8025,6 +8186,7 @@ async function getTableSchema(
|
|
|
8025
8186
|
headerToolbarItems: ctx.headerToolbarItems,
|
|
8026
8187
|
buttons: await getListViewItemButtons(uiSchema, ctx)
|
|
8027
8188
|
});
|
|
8189
|
+
// console.log('getTableSchema====>amisSchema', amisSchema)
|
|
8028
8190
|
return {
|
|
8029
8191
|
uiSchema,
|
|
8030
8192
|
amisSchema,
|
|
@@ -8123,15 +8285,8 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
|
|
|
8123
8285
|
"data": {
|
|
8124
8286
|
"name": `\${event.data.record.${uiSchema?.NAME_FIELD_KEY || 'name'}}`,
|
|
8125
8287
|
"record": `\${event.data.record}`,
|
|
8126
|
-
"
|
|
8127
|
-
|
|
8128
|
-
},
|
|
8129
|
-
{
|
|
8130
|
-
"actionType": "reload",
|
|
8131
|
-
"componentId": `page_readonly_${objectName}_header`, //刷新标题, 详细页面header service 嵌套太多, 导致仅刷新第一层service无法更新recordName
|
|
8132
|
-
"data": {
|
|
8133
|
-
"name": `\${event.data.record.${uiSchema?.NAME_FIELD_KEY || 'name'}}`,
|
|
8134
|
-
"record": `\${event.data.record}`,
|
|
8288
|
+
"_id": "\${event.data.record._id}",
|
|
8289
|
+
"recordId": "\${event.data.record._id}",
|
|
8135
8290
|
"recordLoaded": true,
|
|
8136
8291
|
}
|
|
8137
8292
|
}
|
|
@@ -8141,10 +8296,10 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
|
|
|
8141
8296
|
},
|
|
8142
8297
|
content
|
|
8143
8298
|
],
|
|
8144
|
-
data: {
|
|
8145
|
-
|
|
8146
|
-
|
|
8147
|
-
},
|
|
8299
|
+
// data: {
|
|
8300
|
+
// "_master.objectName": "${objectName}",
|
|
8301
|
+
// "_master.recordId": "${recordId}"
|
|
8302
|
+
// },
|
|
8148
8303
|
onEvent: {
|
|
8149
8304
|
"recordLoaded": {
|
|
8150
8305
|
"actions": [
|
|
@@ -8152,10 +8307,10 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
|
|
|
8152
8307
|
"actionType": "reload",
|
|
8153
8308
|
"data": {
|
|
8154
8309
|
"name": `\${record.${uiSchema.NAME_FIELD_KEY || 'name'}}`,
|
|
8155
|
-
"_master.record": `\${record}`,
|
|
8156
|
-
// 不清楚reload 如何给对象下的某个key复制, 所以此处重复设置_master的objectName、recordId
|
|
8157
|
-
"_master.objectName": "${objectName}",
|
|
8158
|
-
"_master.recordId": "${recordId}"
|
|
8310
|
+
// "_master.record": `\${record}`,
|
|
8311
|
+
// // 不清楚reload 如何给对象下的某个key复制, 所以此处重复设置_master的objectName、recordId
|
|
8312
|
+
// "_master.objectName": "${objectName}",
|
|
8313
|
+
// "_master.recordId": "${recordId}"
|
|
8159
8314
|
}
|
|
8160
8315
|
}
|
|
8161
8316
|
]
|
|
@@ -8166,51 +8321,6 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
|
|
|
8166
8321
|
}
|
|
8167
8322
|
}
|
|
8168
8323
|
|
|
8169
|
-
// export async function getRecordDetailRelatedListSchema(objectName,recordId,relatedObjectName){
|
|
8170
|
-
// // console.log('b==>',objectName,recordId,relatedObjectName)
|
|
8171
|
-
// const relatedObjectUiSchema = await getUISchema(relatedObjectName);
|
|
8172
|
-
// const { list_views, label , icon, fields } = relatedObjectUiSchema;
|
|
8173
|
-
// const firstListViewName = keys(list_views)[0];
|
|
8174
|
-
// const relatedKey = findKey(fields, function(field) {
|
|
8175
|
-
// return ["lookup","master_detail"].indexOf(field.type) > -1 && field.reference_to === objectName;
|
|
8176
|
-
// });
|
|
8177
|
-
// const globalFilter = [relatedKey,'=',recordId];
|
|
8178
|
-
// const recordRelatedListHeader = await getObjectRecordDetailRelatedListHeader(relatedObjectUiSchema);
|
|
8179
|
-
// const options = {
|
|
8180
|
-
// globalFilter,
|
|
8181
|
-
// defaults: {
|
|
8182
|
-
// listSchema: { headerToolbar:[],columnsTogglable:false },
|
|
8183
|
-
// headerSchema: recordRelatedListHeader
|
|
8184
|
-
// },
|
|
8185
|
-
// showHeader: true
|
|
8186
|
-
// }
|
|
8187
|
-
// const amisSchema= (await getListSchema(null, relatedObjectName, firstListViewName, options)).amisSchema;
|
|
8188
|
-
// return {
|
|
8189
|
-
// uiSchema: relatedObjectUiSchema,
|
|
8190
|
-
// amisSchema: {
|
|
8191
|
-
// type: "service",
|
|
8192
|
-
// data: {
|
|
8193
|
-
// masterObjectName: objectName,
|
|
8194
|
-
// masterRecordId: "${recordId}",
|
|
8195
|
-
// relatedKey: relatedKey,
|
|
8196
|
-
// objectName: relatedObjectName,
|
|
8197
|
-
// listViewId: `amis-\${appId}-${relatedObjectName}-listview`,
|
|
8198
|
-
// },
|
|
8199
|
-
// body:[
|
|
8200
|
-
// {
|
|
8201
|
-
// ...amisSchema,
|
|
8202
|
-
// data: {
|
|
8203
|
-
// filter: ["${relatedKey}", "=", "${masterRecordId}"],
|
|
8204
|
-
// objectName: "${objectName}",
|
|
8205
|
-
// recordId: "${masterRecordId}",
|
|
8206
|
-
// ...{[relatedKey]: getRelatedFieldValue(objectName, "${recordId}", relatedSchema.uiSchema, relatedKey)}
|
|
8207
|
-
// }
|
|
8208
|
-
// }
|
|
8209
|
-
// ]
|
|
8210
|
-
// }
|
|
8211
|
-
// };
|
|
8212
|
-
// }
|
|
8213
|
-
|
|
8214
8324
|
|
|
8215
8325
|
// 获取单个相关表
|
|
8216
8326
|
async function getObjectRelated(
|
|
@@ -11060,5 +11170,5 @@ const getInstanceInfo = async ({ instanceId, box }) => {
|
|
|
11060
11170
|
};
|
|
11061
11171
|
};
|
|
11062
11172
|
|
|
11063
|
-
export { index as Field, Router, absoluteUrl, amisRender, amisRootClick, cloneObject, conditionsToFilters, createObject, defaultsDeep, deleteVariable, execute, executeButton, extendObject, fetchAPI, filtersToConditions, getApp, getApps, getAuthToken, getAuthorization, getButton, getButtonVisible, getButtonVisibleOn$1 as getButtonVisibleOn, getButtons, getCalendarSchema, getDefaultRenderData, getEnv, getEnvs, getEvn, getField, getFileSrc, getFlowFormSchema, getFormPageInitSchema, getFormSchema, getIdsPickerSchema, getImageSrc, getInstanceInfo, getListPageInitSchema, getListSchema, getListViewButtons, getListViewColumns, getListViewFilter, getListViewItemButtons, getListViewSort, getListviewInitSchema, getNotifications, getObjectDetailButtons, getObjectDetailMoreButtons, getObjectFieldsFilterBarSchema, getObjectFieldsFilterButtonSchema, getObjectFieldsFilterFormSchema, getObjectListHeader$1 as getObjectListHeader, getObjectListHeaderFieldsFilterBar, getObjectListHeaderFirstLine, getObjectListHeaderSecordLine, getObjectRecordDetailHeader, getObjectRecordDetailRelatedListHeader, getObjectRelated, getObjectRelatedList, getObjectRelatedListButtons, getObjectRelatedListHeader, getPage, getRecord, getRecordDetailHeaderSchema, getRecordDetailRelatedListSchema, getRecordDetailSchema, getRecordPageInitSchema, getRecordPermissions, getRelatedFieldValue, getRelatedListSchema, getRelatedsCount, getRootUrl, getSelectUserSchema, getSpaceUsersPickerAmisSchema, getSpaceUsersPickerSchema, getSteedosAuth, getTableSchema, getTenantId, getUISchema, getUISchemaSync, getUserId, getViewSchema, isExpression, isObject, lookupToAmis, lookupToAmisIdsPicker, lookupToAmisPicker, lookupToAmisSelect, lookupToAmisSelectUser, markReadAll, parseSingleExpression, registerRemoteAssets, registerRenders, setEnv, setEnvs, setRootUrl, setSteedosAuth, setUISchemaFunction, setVariable, standardButtonsTodo };
|
|
11173
|
+
export { index as Field, Router, absoluteUrl, amisRender, amisRootClick, cloneObject, conditionsToFilters, createObject, defaultsDeep, deleteVariable, execute, executeButton, extendObject, fetchAPI, filtersToConditions, getApp, getApps, getAuthToken, getAuthorization, getButton, getButtonVisible, getButtonVisibleOn$1 as getButtonVisibleOn, getButtons, getCalendarSchema, getDefaultRenderData, getEnv, getEnvs, getEvn, getField, getFileSrc, getFlowFormSchema, getFormPageInitSchema, getFormSchema, getIdsPickerSchema, getImageSrc, getInstanceInfo, getListPageInitSchema, getListSchema, getListViewButtons, getListViewColumns, getListViewFilter, getListViewItemButtons, getListViewSort, getListviewInitSchema, getLookupSapceUserTreeSchema, getNotifications, getObjectDetailButtons, getObjectDetailMoreButtons, getObjectFieldsFilterBarSchema, getObjectFieldsFilterButtonSchema, getObjectFieldsFilterFormSchema, getObjectListHeader$1 as getObjectListHeader, getObjectListHeaderFieldsFilterBar, getObjectListHeaderFirstLine, getObjectListHeaderSecordLine, getObjectRecordDetailHeader, getObjectRecordDetailRelatedListHeader, getObjectRelated, getObjectRelatedList, getObjectRelatedListButtons, getObjectRelatedListHeader, getPage, getRecord, getRecordDetailHeaderSchema, getRecordDetailRelatedListSchema, getRecordDetailSchema, getRecordPageInitSchema, getRecordPermissions, getRelatedFieldValue, getRelatedListSchema, getRelatedsCount, getRootUrl, getSelectUserSchema, getSpaceUsersPickerAmisSchema, getSpaceUsersPickerSchema, getSteedosAuth, getTableSchema, getTenantId, getUISchema, getUISchemaSync, getUserId, getViewSchema, isExpression, isObject, lookupToAmis, lookupToAmisIdsPicker, lookupToAmisPicker, lookupToAmisSelect, lookupToAmisSelectUser, markReadAll, parseSingleExpression, registerRemoteAssets, registerRenders, setEnv, setEnvs, setRootUrl, setSteedosAuth, setUISchemaFunction, setVariable, standardButtonsTodo };
|
|
11064
11174
|
//# sourceMappingURL=index.esm.js.map
|