@steedos-widgets/amis-lib 1.2.1 → 1.2.3-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 +143 -74
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +143 -75
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +143 -74
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/header.d.ts +2 -2
- package/dist/types/lib/converter/amis/index.d.ts +1 -0
- package/dist/types/lib/objects.d.ts +14 -0
- package/dist/types/schema/standard_new.amis.d.ts +1 -0
- package/dist/types/standard/button.d.ts +1 -0
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -334,14 +334,19 @@ const getSteedosAuth = () => {
|
|
|
334
334
|
* @Author: baozhoutao@steedos.com
|
|
335
335
|
* @Date: 2022-08-16 17:02:08
|
|
336
336
|
* @LastEditors: baozhoutao@steedos.com
|
|
337
|
-
* @LastEditTime: 2023-04-
|
|
337
|
+
* @LastEditTime: 2023-04-17 15:24:21
|
|
338
338
|
* @Description:
|
|
339
339
|
*/
|
|
340
340
|
|
|
341
341
|
|
|
342
342
|
const Router = {
|
|
343
343
|
getTabDisplayAs(tab_id){
|
|
344
|
-
|
|
344
|
+
var urlSearch = new URLSearchParams(document.location.search);
|
|
345
|
+
if(urlSearch.has('display')){
|
|
346
|
+
return urlSearch.get('display')
|
|
347
|
+
}
|
|
348
|
+
// const key = `tab.${tab_id}.display`;
|
|
349
|
+
const key = `page.display`;
|
|
345
350
|
const value = localStorage.getItem(key);
|
|
346
351
|
return value ? value : 'grid'
|
|
347
352
|
},
|
|
@@ -1363,8 +1368,8 @@ var config = {
|
|
|
1363
1368
|
/*
|
|
1364
1369
|
* @Author: baozhoutao@steedos.com
|
|
1365
1370
|
* @Date: 2022-11-01 15:51:00
|
|
1366
|
-
* @LastEditors:
|
|
1367
|
-
* @LastEditTime: 2023-04-
|
|
1371
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
1372
|
+
* @LastEditTime: 2023-04-16 17:04:16
|
|
1368
1373
|
* @Description:
|
|
1369
1374
|
*/
|
|
1370
1375
|
|
|
@@ -1442,6 +1447,7 @@ const getSchema$4 = async (uiSchema, ctx) => {
|
|
|
1442
1447
|
"context": "${context}",
|
|
1443
1448
|
"global": "${global}",
|
|
1444
1449
|
"listViewId": "${listViewId}",
|
|
1450
|
+
"displayAs": "${displayAs}",
|
|
1445
1451
|
"uiSchema": "${uiSchema}",
|
|
1446
1452
|
"isLookup": "${isLookup}",
|
|
1447
1453
|
"listName": "${listName}"
|
|
@@ -2827,7 +2833,6 @@ async function getObjectFieldsFilterBarSchema(objectSchema, fields, ctx) {
|
|
|
2827
2833
|
function getObjectListHeaderFirstLine(objectSchema, listViewName, ctx) {
|
|
2828
2834
|
const { icon, label } = objectSchema;
|
|
2829
2835
|
const listViewButtonOptions = [];
|
|
2830
|
-
// let currentListView;
|
|
2831
2836
|
each(
|
|
2832
2837
|
objectSchema.list_views,
|
|
2833
2838
|
(listView, name) => {
|
|
@@ -2835,19 +2840,11 @@ function getObjectListHeaderFirstLine(objectSchema, listViewName, ctx) {
|
|
|
2835
2840
|
type: "button",
|
|
2836
2841
|
label: listView.label,
|
|
2837
2842
|
actionType: "link",
|
|
2838
|
-
// icon: "fa fa-plus",
|
|
2839
2843
|
link: `/app/\${appId}/${objectSchema.name}/grid/${name}`
|
|
2840
2844
|
});
|
|
2841
|
-
// if(name === listViewName){
|
|
2842
|
-
// currentListView = listView;
|
|
2843
|
-
// }
|
|
2844
2845
|
}
|
|
2845
2846
|
);
|
|
2846
2847
|
|
|
2847
|
-
// if(!currentListView){
|
|
2848
|
-
// return {};
|
|
2849
|
-
// }
|
|
2850
|
-
|
|
2851
2848
|
const buttons = getListViewButtons(objectSchema, {});
|
|
2852
2849
|
let amisButtonsSchema = map(buttons, (button) => {
|
|
2853
2850
|
return {
|
|
@@ -2858,34 +2855,7 @@ function getObjectListHeaderFirstLine(objectSchema, listViewName, ctx) {
|
|
|
2858
2855
|
className: `button_${button.name}`
|
|
2859
2856
|
}
|
|
2860
2857
|
});
|
|
2861
|
-
|
|
2862
|
-
// const bulkDeleteScript = `
|
|
2863
|
-
// const data = event.data;
|
|
2864
|
-
// const listViewId = data.listViewId;
|
|
2865
|
-
// const uiSchema = data.uiSchema;
|
|
2866
|
-
// const scopeId = data.scopeId;
|
|
2867
|
-
// BuilderAmisObject.AmisLib.standardButtonsTodo.standard_delete_many.call({
|
|
2868
|
-
// listViewId,
|
|
2869
|
-
// uiSchema,
|
|
2870
|
-
// scopeId
|
|
2871
|
-
// })
|
|
2872
|
-
// `;
|
|
2873
|
-
// amisButtonsSchema.push({
|
|
2874
|
-
// type: 'button',
|
|
2875
|
-
// label: "删除",
|
|
2876
|
-
// className: `antd-Button antd-Button--default antd-Button--size-default`,
|
|
2877
|
-
// "onEvent": {
|
|
2878
|
-
// "click": {
|
|
2879
|
-
// "actions": [
|
|
2880
|
-
// {
|
|
2881
|
-
// "actionType": "custom",
|
|
2882
|
-
// "script": bulkDeleteScript
|
|
2883
|
-
// }
|
|
2884
|
-
// ]
|
|
2885
|
-
// }
|
|
2886
|
-
// }
|
|
2887
|
-
// });
|
|
2888
|
-
// }
|
|
2858
|
+
|
|
2889
2859
|
const reg = new RegExp('_', 'g');
|
|
2890
2860
|
const standardIcon = icon && icon.replace(reg, '-');
|
|
2891
2861
|
return {
|
|
@@ -3075,27 +3045,14 @@ async function getObjectListHeaderFieldsFilterBar(objectSchema, listViewName, ct
|
|
|
3075
3045
|
* @param {*} objectSchema 对象UISchema
|
|
3076
3046
|
* @returns amisSchema
|
|
3077
3047
|
*/
|
|
3078
|
-
|
|
3048
|
+
function getObjectListHeader$1(objectSchema, listViewName, ctx) {
|
|
3079
3049
|
let firstLineSchema = getObjectListHeaderFirstLine(objectSchema);
|
|
3080
|
-
// let secordLineSchema = await getObjectListHeaderSecordLine(objectSchema, listViewName, ctx);
|
|
3081
|
-
// let body = [firstLineSchema, secordLineSchema];
|
|
3082
3050
|
let body = [firstLineSchema];
|
|
3083
|
-
// let roundedCss = "";
|
|
3084
|
-
// if (ctx.onlyFirstLine) {
|
|
3085
|
-
// body = [firstLineSchema];
|
|
3086
|
-
// }
|
|
3087
|
-
// else if (ctx.onlySecordLine) {
|
|
3088
|
-
// // 列表视图自定义amisSchema时不能加圆角
|
|
3089
|
-
// roundedCss = "";
|
|
3090
|
-
// // body = [secordLineSchema];
|
|
3091
|
-
// }
|
|
3092
3051
|
let headerSchema = [{
|
|
3093
3052
|
"type": "wrapper",
|
|
3094
3053
|
"body": body,
|
|
3095
3054
|
"className": `bg-gray-100 sm:rounded-tl sm:rounded-tr p-4 -mb-4`
|
|
3096
3055
|
}];
|
|
3097
|
-
// const fieldsFilterBarSchema = await getObjectListHeaderFieldsFilterBar(objectSchema, listViewName, ctx);
|
|
3098
|
-
// headerSchema.push(fieldsFilterBarSchema);
|
|
3099
3056
|
return headerSchema;
|
|
3100
3057
|
}
|
|
3101
3058
|
|
|
@@ -3349,6 +3306,7 @@ const getDisplayAsButton = function(objectName, showDisplayAs){
|
|
|
3349
3306
|
"icon": "fa fa-table-columns",
|
|
3350
3307
|
"btnClassName": "antd-Button--iconOnly bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
3351
3308
|
"align": "right",
|
|
3309
|
+
"visibleOn": "${formFactor !== 'SMALL'}",
|
|
3352
3310
|
"buttons": [
|
|
3353
3311
|
{
|
|
3354
3312
|
"label": "显示为",
|
|
@@ -3485,7 +3443,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3485
3443
|
}
|
|
3486
3444
|
}
|
|
3487
3445
|
} : {},
|
|
3488
|
-
|
|
3446
|
+
getDisplayAsButton(mainObject?.name)
|
|
3489
3447
|
]
|
|
3490
3448
|
}else {
|
|
3491
3449
|
return [
|
|
@@ -3740,7 +3698,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3740
3698
|
{
|
|
3741
3699
|
"type": "button",
|
|
3742
3700
|
"label": "重命名",
|
|
3743
|
-
"
|
|
3701
|
+
"disabledOn": "!((global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && !!uiSchema.list_views[listName].owner)",
|
|
3744
3702
|
"onEvent": {
|
|
3745
3703
|
"click": {
|
|
3746
3704
|
"weight": 0,
|
|
@@ -3795,7 +3753,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3795
3753
|
{
|
|
3796
3754
|
"type": "button",
|
|
3797
3755
|
"label": "共享设置",
|
|
3798
|
-
"
|
|
3756
|
+
"disabledOn": "!(global.user.is_space_admin && !!uiSchema.list_views[listName].owner)",
|
|
3799
3757
|
"onEvent": {
|
|
3800
3758
|
"click": {
|
|
3801
3759
|
"weight": 0,
|
|
@@ -3835,7 +3793,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3835
3793
|
{
|
|
3836
3794
|
"type": "button",
|
|
3837
3795
|
"label": "过滤设置",
|
|
3838
|
-
"
|
|
3796
|
+
"disabledOn": "!((global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && !!uiSchema.list_views[listName].owner)",
|
|
3839
3797
|
"onEvent": {
|
|
3840
3798
|
"click": {
|
|
3841
3799
|
"weight": 0,
|
|
@@ -3897,7 +3855,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3897
3855
|
{
|
|
3898
3856
|
"type": "button",
|
|
3899
3857
|
"label": "显示的列",
|
|
3900
|
-
"
|
|
3858
|
+
"disabledOn": "!((global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && !!uiSchema.list_views[listName].owner)",
|
|
3901
3859
|
"onEvent": {
|
|
3902
3860
|
"click": {
|
|
3903
3861
|
"weight": 0,
|
|
@@ -3956,10 +3914,74 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3956
3914
|
}
|
|
3957
3915
|
}
|
|
3958
3916
|
},
|
|
3917
|
+
{
|
|
3918
|
+
"type": "button",
|
|
3919
|
+
"label": "默认排序规则",
|
|
3920
|
+
"disabledOn": "!((global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && !!uiSchema.list_views[listName].owner)",
|
|
3921
|
+
"onEvent": {
|
|
3922
|
+
"click": {
|
|
3923
|
+
"weight": 0,
|
|
3924
|
+
"actions": [
|
|
3925
|
+
{
|
|
3926
|
+
"dialog": {
|
|
3927
|
+
"type": "dialog",
|
|
3928
|
+
"title": "弹框标题",
|
|
3929
|
+
"data": {
|
|
3930
|
+
"&": "$$",
|
|
3931
|
+
"objectName": "${objectName}",
|
|
3932
|
+
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
3933
|
+
"listName": "${listName}",
|
|
3934
|
+
"appId": "${appId}"
|
|
3935
|
+
},
|
|
3936
|
+
"body": [
|
|
3937
|
+
{
|
|
3938
|
+
"type": "steedos-object-form",
|
|
3939
|
+
"label": "对象表单",
|
|
3940
|
+
"objectApiName": "object_listviews",
|
|
3941
|
+
"recordId": "${recordId}",
|
|
3942
|
+
"className": "",
|
|
3943
|
+
"id": "u:061f158b4c5a",
|
|
3944
|
+
"mode": "edit",
|
|
3945
|
+
"fields": [
|
|
3946
|
+
"sort",
|
|
3947
|
+
"sort.$.field_name",
|
|
3948
|
+
"sort.$.order"
|
|
3949
|
+
],
|
|
3950
|
+
"onEvent": {
|
|
3951
|
+
"submitSucc": {
|
|
3952
|
+
"weight": 0,
|
|
3953
|
+
"actions": [
|
|
3954
|
+
{
|
|
3955
|
+
"args": {
|
|
3956
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/${listName}",
|
|
3957
|
+
"blank": false
|
|
3958
|
+
},
|
|
3959
|
+
"actionType": "url"
|
|
3960
|
+
}
|
|
3961
|
+
]
|
|
3962
|
+
}
|
|
3963
|
+
},
|
|
3964
|
+
"fieldsExtend": "{\n \"sort\": {\n \"amis\": {\n \"type\": \"tabs-transfer\",\n \"sortable\": true,\n \"searchable\": true,\n \"source\": {\n \"method\": \"get\",\n \"url\": \"${context.rootUrl}/service/api/amis-metadata-objects/objects/${objectName}/sortFields/options\",\n \"headers\": {\n \"Authorization\": \"Bearer ${context.tenantId},${context.authToken}\"\n }\n }\n }\n }\n}",
|
|
3965
|
+
"initApiAdaptor": "let sort;\nif (recordId) {\n sort = payload.data.initialValues.sort;\n //数据格式转换\n if (sort instanceof Array) {\n sort = lodash.map(sort, (item) => {\n return item.field_name + ':' + (item.order || 'asc')\n });\n }\n}\npayload.data.initialValues.sort = sort;\ndelete payload.extensions;",
|
|
3966
|
+
"apiRequestAdaptor": "const recordId = api.body.recordId;\n//数据格式转换\nif (typeof formData.sort == 'string') {\n formData.sort = formData.sort?.split(',');\n}\nformData.sort = lodash.map(formData.sort, (item) => {\n const arr = item.split(':');\n return { field_name: arr[0], order: arr[1] };\n});\nif (recordId) {\n query = 'mutation{record: ' + objectName + '__update(id: \"' + recordId + '\", doc: {__saveData}){_id}}';\n}\n__saveData = JSON.stringify(JSON.stringify(formData));\napi.data = { query: query.replace('{__saveData}', __saveData) };\n"
|
|
3967
|
+
}
|
|
3968
|
+
],
|
|
3969
|
+
"showCloseButton": true,
|
|
3970
|
+
"showErrorMsg": true,
|
|
3971
|
+
"showLoading": true,
|
|
3972
|
+
"id": "u:d3f6947b6acf",
|
|
3973
|
+
"size": "lg"
|
|
3974
|
+
},
|
|
3975
|
+
"actionType": "dialog"
|
|
3976
|
+
}
|
|
3977
|
+
]
|
|
3978
|
+
}
|
|
3979
|
+
}
|
|
3980
|
+
},
|
|
3959
3981
|
{
|
|
3960
3982
|
"type": "button",
|
|
3961
3983
|
"label": "删除",
|
|
3962
|
-
"
|
|
3984
|
+
"disabledOn": "!((global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && !!uiSchema.list_views[listName].owner)",
|
|
3963
3985
|
"confirmText": "如果您删除此列表视图,该视图将为所有具备访问权限的用户永久删除。是否确定要删除?",
|
|
3964
3986
|
"onEvent": {
|
|
3965
3987
|
"click": {
|
|
@@ -4014,7 +4036,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
4014
4036
|
}
|
|
4015
4037
|
]
|
|
4016
4038
|
},
|
|
4017
|
-
|
|
4039
|
+
getDisplayAsButton(showDisplayAs)
|
|
4018
4040
|
// {
|
|
4019
4041
|
// "type": "search-box",
|
|
4020
4042
|
// "align": "right",
|
|
@@ -4320,7 +4342,6 @@ function getLookupSapceUserTreeSchema(){
|
|
|
4320
4342
|
{
|
|
4321
4343
|
"actionType": "custom",
|
|
4322
4344
|
"script": `
|
|
4323
|
-
debugger;
|
|
4324
4345
|
const scope = event.context.scoped;
|
|
4325
4346
|
//TODO: 将form中的value一同加入筛选内
|
|
4326
4347
|
// var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
@@ -5804,7 +5825,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
5804
5825
|
|
|
5805
5826
|
const API_CACHE = 100;
|
|
5806
5827
|
|
|
5807
|
-
function getReadonlyFormAdaptor(fields){
|
|
5828
|
+
function getReadonlyFormAdaptor(object, fields){
|
|
5808
5829
|
let scriptStr = '';
|
|
5809
5830
|
const selectFields = _$1.filter(fields, function(field){return field.name.indexOf('.') < 0 && ((field.type == 'select' && field.options) || ((field.type == 'lookup' || field.type == 'master_detail') && !field.reference_to))});
|
|
5810
5831
|
const gridAndObjectFieldsName = _$1.map(_$1.filter(fields, function(field){return field.name.indexOf('.') < 0 && (field.type === 'object' || field.type === 'grid')}), 'name');
|
|
@@ -5863,6 +5884,7 @@ function getReadonlyFormAdaptor(fields){
|
|
|
5863
5884
|
console.error(e)
|
|
5864
5885
|
}
|
|
5865
5886
|
payload.data = data;
|
|
5887
|
+
payload.data.__objectName = "${object.name}";
|
|
5866
5888
|
payload.data.__record = record;
|
|
5867
5889
|
window.postMessage(Object.assign({type: "record.loaded"}, {record: record}), "*")
|
|
5868
5890
|
}
|
|
@@ -5880,7 +5902,7 @@ async function getReadonlyFormInitApi(object, recordId, fields, options){
|
|
|
5880
5902
|
url: getApi$2()+"&recordId=${recordId}",
|
|
5881
5903
|
cache: API_CACHE,
|
|
5882
5904
|
// requestAdaptor: "console.log('getReadonlyFormInitApi requestAdaptor', api);return api;",
|
|
5883
|
-
adaptor: getReadonlyFormAdaptor(fields),
|
|
5905
|
+
adaptor: getReadonlyFormAdaptor(object, fields),
|
|
5884
5906
|
data: await getFindOneQuery$1(object, recordId, fields, options),
|
|
5885
5907
|
headers: {
|
|
5886
5908
|
Authorization: "Bearer ${context.tenantId},${context.authToken}"
|
|
@@ -6598,6 +6620,7 @@ async function getObjectDetail(objectSchema, recordId, ctx){
|
|
|
6598
6620
|
eventName: "recordLoaded"
|
|
6599
6621
|
},
|
|
6600
6622
|
data: {
|
|
6623
|
+
objectName: "${event.data.__objectName}",
|
|
6601
6624
|
record: "${event.data.__record}"
|
|
6602
6625
|
}
|
|
6603
6626
|
},
|
|
@@ -7034,7 +7057,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
7034
7057
|
const api = await getApi(mainObject, null, fields, {count: options.queryCount, alias: 'rows', limit: top, queryOptions: `filters: {__filters}, top: {__top}, skip: {__skip}, sort: "{__sort}"`});
|
|
7035
7058
|
|
|
7036
7059
|
if(options.isRelated){
|
|
7037
|
-
api.url += "&recordId=${recordId}";
|
|
7060
|
+
api.url += "&recordId=${_master.recordId}";
|
|
7038
7061
|
}
|
|
7039
7062
|
|
|
7040
7063
|
api.data.$term = "$term";
|
|
@@ -8279,7 +8302,7 @@ async function getRelatedListSchema(
|
|
|
8279
8302
|
* @Author: baozhoutao@steedos.com
|
|
8280
8303
|
* @Date: 2022-07-05 15:55:39
|
|
8281
8304
|
* @LastEditors: baozhoutao@steedos.com
|
|
8282
|
-
* @LastEditTime: 2023-04-
|
|
8305
|
+
* @LastEditTime: 2023-04-17 15:26:17
|
|
8283
8306
|
* @Description:
|
|
8284
8307
|
*/
|
|
8285
8308
|
|
|
@@ -8492,6 +8515,7 @@ async function getListSchema(
|
|
|
8492
8515
|
return { uiSchema };
|
|
8493
8516
|
}
|
|
8494
8517
|
|
|
8518
|
+
// 直接返回自定义的列表视图schema
|
|
8495
8519
|
if(listView.enable_amis_schema && listView.amis_schema){
|
|
8496
8520
|
const amisSchema = isString(listView.amis_schema) ? JSON.parse(listView.amis_schema) : listView.amis_schema;
|
|
8497
8521
|
return {
|
|
@@ -8505,6 +8529,7 @@ async function getListSchema(
|
|
|
8505
8529
|
let sort = getListViewSort(listView);
|
|
8506
8530
|
let listviewFilter = getListViewFilter(listView);
|
|
8507
8531
|
let listview_filters = listView && listView._filters;
|
|
8532
|
+
// 返回 calendar 组件
|
|
8508
8533
|
if(listView.type === "calendar"){
|
|
8509
8534
|
const amisSchema = {
|
|
8510
8535
|
"type": "steedos-object-calendar",
|
|
@@ -8523,14 +8548,21 @@ async function getListSchema(
|
|
|
8523
8548
|
|
|
8524
8549
|
const defaults = ctx.defaults || {};
|
|
8525
8550
|
|
|
8526
|
-
|
|
8527
|
-
|
|
8528
|
-
|
|
8551
|
+
// // 未自定义header 且显示header的时候, 使用系统header
|
|
8552
|
+
// if(!defaults.headerSchema && ctx.showHeader){
|
|
8553
|
+
// defaults.headerSchema = getObjectListHeader(uiSchema, listViewName);
|
|
8554
|
+
// }
|
|
8555
|
+
|
|
8556
|
+
// // 如果不显示header,则清理掉
|
|
8557
|
+
// if(!ctx.showHeader){
|
|
8558
|
+
// defaults.headerSchema = null;
|
|
8559
|
+
// }
|
|
8529
8560
|
|
|
8530
|
-
|
|
8531
|
-
defaults.headerSchema = null;
|
|
8532
|
-
}
|
|
8561
|
+
defaults.headerSchema = null;
|
|
8533
8562
|
|
|
8563
|
+
/**
|
|
8564
|
+
* 本次存储代码段
|
|
8565
|
+
*/
|
|
8534
8566
|
try {
|
|
8535
8567
|
const listViewPropsStoreKey = location.pathname + "/crud/" + ctx.listViewId;
|
|
8536
8568
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
@@ -8645,7 +8677,7 @@ async function getTableSchema(
|
|
|
8645
8677
|
headerToolbarItems: ctx.headerToolbarItems,
|
|
8646
8678
|
buttons: await getListViewItemButtons(uiSchema, ctx)
|
|
8647
8679
|
});
|
|
8648
|
-
|
|
8680
|
+
console.log('getTableSchema====>amisSchema', amisSchema);
|
|
8649
8681
|
// console.timeEnd('getTableSchema');
|
|
8650
8682
|
return {
|
|
8651
8683
|
uiSchema,
|
|
@@ -8765,6 +8797,41 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
|
|
|
8765
8797
|
}
|
|
8766
8798
|
}
|
|
8767
8799
|
|
|
8800
|
+
async function getRecordServiceSchema(objectName, appId, props = {}) {
|
|
8801
|
+
const uiSchema = await getUISchema(objectName);
|
|
8802
|
+
return {
|
|
8803
|
+
uiSchema,
|
|
8804
|
+
amisSchema: {
|
|
8805
|
+
"type": "service",
|
|
8806
|
+
"body": [],
|
|
8807
|
+
data: {
|
|
8808
|
+
"_master.objectName": "${objectName}",
|
|
8809
|
+
"_master.recordId": "${recordId}"
|
|
8810
|
+
},
|
|
8811
|
+
"style": {
|
|
8812
|
+
"padding": "var(--Page-body-padding)",
|
|
8813
|
+
...props.style
|
|
8814
|
+
},
|
|
8815
|
+
onEvent: {
|
|
8816
|
+
"recordLoaded": {
|
|
8817
|
+
"actions": [
|
|
8818
|
+
{
|
|
8819
|
+
"actionType": "reload",
|
|
8820
|
+
"data": {
|
|
8821
|
+
"name": `\${record.${uiSchema.NAME_FIELD_KEY || 'name'}}`,
|
|
8822
|
+
"_master.record": `\${record}`,
|
|
8823
|
+
// 不清楚reload 如何给对象下的某个key复制, 所以此处重复设置_master的objectName、recordId
|
|
8824
|
+
"_master.objectName": "${objectName}",
|
|
8825
|
+
"_master.recordId": "${recordId}"
|
|
8826
|
+
}
|
|
8827
|
+
}
|
|
8828
|
+
]
|
|
8829
|
+
},
|
|
8830
|
+
...props.onEvent
|
|
8831
|
+
}
|
|
8832
|
+
}
|
|
8833
|
+
}
|
|
8834
|
+
}
|
|
8768
8835
|
|
|
8769
8836
|
// 获取单个相关表
|
|
8770
8837
|
async function getObjectRelated(
|
|
@@ -8808,6 +8875,7 @@ async function getObjectRelated(
|
|
|
8808
8875
|
if(typeof window != 'undefined'){
|
|
8809
8876
|
window.getUISchema = getUISchema;
|
|
8810
8877
|
window.getUISchemaSync = getUISchemaSync;
|
|
8878
|
+
window.getListSchema = getListSchema;
|
|
8811
8879
|
}
|
|
8812
8880
|
|
|
8813
8881
|
// import { getListSchema } from './objects';
|
|
@@ -11614,5 +11682,5 @@ const getInstanceInfo = async ({ instanceId, box }) => {
|
|
|
11614
11682
|
};
|
|
11615
11683
|
};
|
|
11616
11684
|
|
|
11617
|
-
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 };
|
|
11685
|
+
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, getRecordServiceSchema, 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 };
|
|
11618
11686
|
//# sourceMappingURL=index.esm.js.map
|