@steedos-widgets/amis-object 1.2.0 → 1.2.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/amis-object.cjs.css +6 -0
- package/dist/amis-object.cjs.js +524 -38
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +6 -0
- package/dist/amis-object.esm.js +525 -40
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +6 -0
- package/dist/amis-object.umd.js +524 -38
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +11 -11
- package/dist/components/SteedosSkeleton.d.ts +2 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/meta.js +407 -313
- package/dist/metas/SteedosSkeleton.d.ts +2 -0
- package/dist/pages/PageListView.d.ts +1 -1
- package/package.json +3 -3
package/dist/amis-object.cjs.js
CHANGED
|
@@ -1972,8 +1972,8 @@ const getSchema$3 = async (uiSchema, ctx) => {
|
|
|
1972
1972
|
/*
|
|
1973
1973
|
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
1974
1974
|
* @Date: 2023-03-22 09:31:21
|
|
1975
|
-
* @LastEditors:
|
|
1976
|
-
* @LastEditTime: 2023-04-
|
|
1975
|
+
* @LastEditors: Please set LastEditors
|
|
1976
|
+
* @LastEditTime: 2023-04-12 10:35:36
|
|
1977
1977
|
*/
|
|
1978
1978
|
const getSchema$2 = (uiSchema)=>{
|
|
1979
1979
|
return {
|
|
@@ -2028,7 +2028,8 @@ const getSchema$2 = (uiSchema)=>{
|
|
|
2028
2028
|
"eventName": "@data.changed.${_master.objectName}"
|
|
2029
2029
|
},
|
|
2030
2030
|
"data": {
|
|
2031
|
-
"objectName": "${_master.objectName}"
|
|
2031
|
+
"objectName": "${_master.objectName}",
|
|
2032
|
+
"_isRelated": "${_isRelated}"
|
|
2032
2033
|
},
|
|
2033
2034
|
"expression": `\${_master.objectName != '${uiSchema.name}' && _master.objectName}`
|
|
2034
2035
|
}
|
|
@@ -3744,6 +3745,9 @@ const getDisplayAsButton = function(objectName, showDisplayAs){
|
|
|
3744
3745
|
};
|
|
3745
3746
|
};
|
|
3746
3747
|
|
|
3748
|
+
|
|
3749
|
+
|
|
3750
|
+
|
|
3747
3751
|
const onFieldsFilterToggleScript = `
|
|
3748
3752
|
const scope = event.context.scoped;
|
|
3749
3753
|
const filterForm = scope.getComponents().find(function(n){
|
|
@@ -3761,7 +3765,6 @@ setTimeout(()=>{
|
|
|
3761
3765
|
|
|
3762
3766
|
function getExportApiRequestAdaptorScript(){
|
|
3763
3767
|
return `
|
|
3764
|
-
console.log(api.url);
|
|
3765
3768
|
// 获取列表视图的属性
|
|
3766
3769
|
let uiSchema = api.body.uiSchema;
|
|
3767
3770
|
let list_views = uiSchema.list_views;
|
|
@@ -3810,12 +3813,12 @@ function getExportApiRequestAdaptorScript(){
|
|
|
3810
3813
|
if (filters && filters.length > 0) {
|
|
3811
3814
|
api.url = api.url + "&filters=" + JSON.stringify(filters);
|
|
3812
3815
|
}
|
|
3813
|
-
console.log(api.url);
|
|
3814
3816
|
return api;
|
|
3815
3817
|
`
|
|
3816
3818
|
}
|
|
3817
3819
|
|
|
3818
|
-
function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems} = {}){
|
|
3820
|
+
function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true} = {}){
|
|
3821
|
+
// console.log(`getObjectHeaderToolbar====>`, filterVisible)
|
|
3819
3822
|
const isMobile = window.innerWidth < 768;
|
|
3820
3823
|
if(isMobile){
|
|
3821
3824
|
showDisplayAs = false;
|
|
@@ -3852,7 +3855,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3852
3855
|
}
|
|
3853
3856
|
},
|
|
3854
3857
|
},
|
|
3855
|
-
{
|
|
3858
|
+
filterVisible ? {
|
|
3856
3859
|
"label": "",
|
|
3857
3860
|
"icon": "fa fa-search",
|
|
3858
3861
|
"type": "button",
|
|
@@ -3868,7 +3871,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3868
3871
|
]
|
|
3869
3872
|
}
|
|
3870
3873
|
}
|
|
3871
|
-
},
|
|
3874
|
+
} : {},
|
|
3872
3875
|
showDisplayAs? getDisplayAsButton(mainObject?.name) : {}
|
|
3873
3876
|
]
|
|
3874
3877
|
}else {
|
|
@@ -3884,10 +3887,6 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3884
3887
|
// "type": "columns-toggler",
|
|
3885
3888
|
// "className": "mr-2"
|
|
3886
3889
|
// },
|
|
3887
|
-
// {
|
|
3888
|
-
// "type": "export-excel",
|
|
3889
|
-
// "align": "right"
|
|
3890
|
-
// },
|
|
3891
3890
|
hiddenCount ? {} : {
|
|
3892
3891
|
"type": "tpl",
|
|
3893
3892
|
"tpl": "${count} 个项目"
|
|
@@ -3933,7 +3932,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3933
3932
|
}
|
|
3934
3933
|
}
|
|
3935
3934
|
},
|
|
3936
|
-
{
|
|
3935
|
+
filterVisible ? {
|
|
3937
3936
|
"label": "",
|
|
3938
3937
|
"icon": "fa fa-search",
|
|
3939
3938
|
"type": "button",
|
|
@@ -3949,8 +3948,460 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3949
3948
|
]
|
|
3950
3949
|
}
|
|
3951
3950
|
}
|
|
3951
|
+
} : {},
|
|
3952
|
+
{
|
|
3953
|
+
"type": "dropdown-button",
|
|
3954
|
+
"trigger": "click",
|
|
3955
|
+
"icon": "fa fa-cog",
|
|
3956
|
+
"btnClassName": "antd-Button--iconOnly bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
3957
|
+
"align": "right",
|
|
3958
|
+
"visibleOn": "${!isLookup}",
|
|
3959
|
+
"buttons": [
|
|
3960
|
+
{
|
|
3961
|
+
"label": "列表视图操作",
|
|
3962
|
+
"children": [
|
|
3963
|
+
{
|
|
3964
|
+
"type": "button",
|
|
3965
|
+
"label": "新建",
|
|
3966
|
+
"onEvent": {
|
|
3967
|
+
"click": {
|
|
3968
|
+
"weight": 0,
|
|
3969
|
+
"actions": [
|
|
3970
|
+
{
|
|
3971
|
+
"dialog": {
|
|
3972
|
+
"type": "dialog",
|
|
3973
|
+
"title": "新建 列表视图",
|
|
3974
|
+
"data": {
|
|
3975
|
+
"&": "$$",
|
|
3976
|
+
"all": "${uiSchema.list_views.all}",
|
|
3977
|
+
"list_view": "${uiSchema.list_views[listName]}",
|
|
3978
|
+
"appId": "${appId}",
|
|
3979
|
+
"global": "${global}",
|
|
3980
|
+
"objectName": "${objectName}",
|
|
3981
|
+
},
|
|
3982
|
+
"body": [
|
|
3983
|
+
{
|
|
3984
|
+
"type": "steedos-object-form",
|
|
3985
|
+
"label": "对象表单",
|
|
3986
|
+
"objectApiName": "object_listviews",
|
|
3987
|
+
"recordId": "",
|
|
3988
|
+
"mode": "edit",
|
|
3989
|
+
"defaultData": {
|
|
3990
|
+
"&": "${list_view}",
|
|
3991
|
+
"name":"",
|
|
3992
|
+
"label":"",
|
|
3993
|
+
"filters":"",
|
|
3994
|
+
"shared":false
|
|
3995
|
+
},
|
|
3996
|
+
"fieldsExtend": "{\n \"label\": {\n \"is_wide\": true\n },\n \"name\": {\n \"is_wide\": true,\n \"amis\": {\n \"hidden\": true\n }\n },\n \"object_name\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"filter_scope\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"columns\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"filter_fields\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"scrolling_mode\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"sort\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"show_count\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"type\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"shared\":{\n \"amis\":{\n \"visibleOn\":\"${global.user.is_space_admin}\"\n }\n}\n}",
|
|
3997
|
+
"fields": [
|
|
3998
|
+
"label",
|
|
3999
|
+
"name",
|
|
4000
|
+
"object_name",
|
|
4001
|
+
"filter_scope",
|
|
4002
|
+
"show_count",
|
|
4003
|
+
"columns.$.field",
|
|
4004
|
+
"columns.$.width",
|
|
4005
|
+
"sort.$.field_name",
|
|
4006
|
+
"sort.$.order",
|
|
4007
|
+
"filters",
|
|
4008
|
+
"mobile_columns.$.field",
|
|
4009
|
+
"searchable_fields.$.field",
|
|
4010
|
+
"is_system",
|
|
4011
|
+
"shared"
|
|
4012
|
+
],
|
|
4013
|
+
"onEvent": {
|
|
4014
|
+
"submitSucc": {
|
|
4015
|
+
"weight": 0,
|
|
4016
|
+
"actions": [
|
|
4017
|
+
{
|
|
4018
|
+
"args": {
|
|
4019
|
+
// 直接使用recordId不能拿到数据,只能通过result里面拿数据
|
|
4020
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/listview_${result.data.recordId|lowerCase}",
|
|
4021
|
+
"blank": false
|
|
4022
|
+
},
|
|
4023
|
+
"actionType": "url",
|
|
4024
|
+
}
|
|
4025
|
+
]
|
|
4026
|
+
}
|
|
4027
|
+
},
|
|
4028
|
+
"messages": {
|
|
4029
|
+
"success": "成功",
|
|
4030
|
+
"failed": "失败"
|
|
4031
|
+
},
|
|
4032
|
+
}
|
|
4033
|
+
],
|
|
4034
|
+
"showCloseButton": true,
|
|
4035
|
+
"showErrorMsg": true,
|
|
4036
|
+
"showLoading": true,
|
|
4037
|
+
"closeOnEsc": false,
|
|
4038
|
+
"dataMapSwitch": false,
|
|
4039
|
+
"size": "lg"
|
|
4040
|
+
},
|
|
4041
|
+
"actionType": "dialog"
|
|
4042
|
+
}
|
|
4043
|
+
]
|
|
4044
|
+
}
|
|
4045
|
+
}
|
|
4046
|
+
},
|
|
4047
|
+
{
|
|
4048
|
+
"type": "button",
|
|
4049
|
+
"label": "复制",
|
|
4050
|
+
"onEvent": {
|
|
4051
|
+
"click": {
|
|
4052
|
+
"weight": 0,
|
|
4053
|
+
"actions": [
|
|
4054
|
+
{
|
|
4055
|
+
"dialog": {
|
|
4056
|
+
"type": "dialog",
|
|
4057
|
+
"title": "复制 列表视图",
|
|
4058
|
+
"data": {
|
|
4059
|
+
"&": "$$",
|
|
4060
|
+
"listName": "${listName}",
|
|
4061
|
+
"objectName": "${objectName}",
|
|
4062
|
+
"list_view": "${uiSchema.list_views[listName]}",
|
|
4063
|
+
"appId": "${appId}",
|
|
4064
|
+
"global": "${global}"
|
|
4065
|
+
},
|
|
4066
|
+
"body": [
|
|
4067
|
+
{
|
|
4068
|
+
"type": "steedos-object-form",
|
|
4069
|
+
"label": "对象表单",
|
|
4070
|
+
"objectApiName": "object_listviews",
|
|
4071
|
+
"recordId": "",
|
|
4072
|
+
"mode": "edit",
|
|
4073
|
+
"fields": [
|
|
4074
|
+
],
|
|
4075
|
+
"defaultData": {
|
|
4076
|
+
"&": "${list_view}",
|
|
4077
|
+
"name":"",
|
|
4078
|
+
"label": "${list_view.label}的副本",
|
|
4079
|
+
"shared":false
|
|
4080
|
+
},
|
|
4081
|
+
"fieldsExtend": "{\n \"label\": {\n \"is_wide\": true\n },\n \"name\": {\n \"is_wide\": true,\n \"amis\": {\n \"hidden\": true\n }\n },\n \"object_name\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"filter_scope\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"columns\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"filter_fields\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"scrolling_mode\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"sort\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"show_count\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"type\": {\n \"amis\": {\n \"hidden\": true\n }\n },\n \"shared\":{\n \"amis\":{\n \"visibleOn\":\"${global.user.is_space_admin}\"\n }\n}\n}",
|
|
4082
|
+
"fields": [
|
|
4083
|
+
"label",
|
|
4084
|
+
"name",
|
|
4085
|
+
"object_name",
|
|
4086
|
+
"filter_scope",
|
|
4087
|
+
"show_count",
|
|
4088
|
+
"columns.$.field",
|
|
4089
|
+
"columns.$.width",
|
|
4090
|
+
"sort.$.field_name",
|
|
4091
|
+
"sort.$.order",
|
|
4092
|
+
"filters",
|
|
4093
|
+
"mobile_columns.$.field",
|
|
4094
|
+
"searchable_fields.$.field",
|
|
4095
|
+
"is_system",
|
|
4096
|
+
"shared"
|
|
4097
|
+
],
|
|
4098
|
+
"onEvent": {
|
|
4099
|
+
"submitSucc": {
|
|
4100
|
+
"weight": 0,
|
|
4101
|
+
"actions": [
|
|
4102
|
+
{
|
|
4103
|
+
"args": {
|
|
4104
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/listview_${result.data.recordId|lowerCase}",
|
|
4105
|
+
"blank": false
|
|
4106
|
+
},
|
|
4107
|
+
"actionType": "url",
|
|
4108
|
+
}
|
|
4109
|
+
]
|
|
4110
|
+
}
|
|
4111
|
+
}
|
|
4112
|
+
}
|
|
4113
|
+
],
|
|
4114
|
+
"showCloseButton": true,
|
|
4115
|
+
"showErrorMsg": true,
|
|
4116
|
+
"showLoading": true,
|
|
4117
|
+
"closeOnEsc": false,
|
|
4118
|
+
"dataMapSwitch": false,
|
|
4119
|
+
"size": "lg"
|
|
4120
|
+
},
|
|
4121
|
+
"actionType": "dialog"
|
|
4122
|
+
}
|
|
4123
|
+
]
|
|
4124
|
+
}
|
|
4125
|
+
}
|
|
4126
|
+
},
|
|
4127
|
+
{
|
|
4128
|
+
"type": "button",
|
|
4129
|
+
"label": "重命名",
|
|
4130
|
+
"visibleOn": "(global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && ['all', 'recent', 'my'].indexOf(listName) == -1",
|
|
4131
|
+
"onEvent": {
|
|
4132
|
+
"click": {
|
|
4133
|
+
"weight": 0,
|
|
4134
|
+
"actions": [
|
|
4135
|
+
{
|
|
4136
|
+
"dialog": {
|
|
4137
|
+
"type": "dialog",
|
|
4138
|
+
"title": "重命名 列表视图",
|
|
4139
|
+
"data": {
|
|
4140
|
+
"objectName": "${objectName}",
|
|
4141
|
+
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4142
|
+
"appId": "${appId}"
|
|
4143
|
+
},
|
|
4144
|
+
"body": [
|
|
4145
|
+
{
|
|
4146
|
+
"type": "steedos-object-form",
|
|
4147
|
+
"label": "对象表单",
|
|
4148
|
+
"objectApiName": "object_listviews",
|
|
4149
|
+
"recordId": "${recordId}",
|
|
4150
|
+
"mode": "edit",
|
|
4151
|
+
"fields": [
|
|
4152
|
+
"label"
|
|
4153
|
+
],
|
|
4154
|
+
"fieldsExtend": "{\n \"label\":{\n \"is_wide\": true\n }\n}",
|
|
4155
|
+
"onEvent": {
|
|
4156
|
+
"submitSucc": {
|
|
4157
|
+
"weight": 0,
|
|
4158
|
+
"actions": [
|
|
4159
|
+
{
|
|
4160
|
+
"args": {
|
|
4161
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/${name}",
|
|
4162
|
+
"blank": false
|
|
4163
|
+
},
|
|
4164
|
+
"actionType": "url",
|
|
4165
|
+
},
|
|
4166
|
+
]
|
|
4167
|
+
}
|
|
4168
|
+
}
|
|
4169
|
+
}
|
|
4170
|
+
],
|
|
4171
|
+
"showCloseButton": true,
|
|
4172
|
+
"showErrorMsg": true,
|
|
4173
|
+
"showLoading": true,
|
|
4174
|
+
"size": "lg"
|
|
4175
|
+
},
|
|
4176
|
+
"actionType": "dialog"
|
|
4177
|
+
}
|
|
4178
|
+
]
|
|
4179
|
+
}
|
|
4180
|
+
}
|
|
4181
|
+
},
|
|
4182
|
+
{
|
|
4183
|
+
"type": "button",
|
|
4184
|
+
"label": "共享设置",
|
|
4185
|
+
"visibleOn": "global.user.is_space_admin && ['all', 'recent', 'my'].indexOf(listName) == -1",
|
|
4186
|
+
"onEvent": {
|
|
4187
|
+
"click": {
|
|
4188
|
+
"weight": 0,
|
|
4189
|
+
"actions": [
|
|
4190
|
+
{
|
|
4191
|
+
"dialog": {
|
|
4192
|
+
"type": "dialog",
|
|
4193
|
+
"title": "共享设置",
|
|
4194
|
+
"data": {
|
|
4195
|
+
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4196
|
+
},
|
|
4197
|
+
"body": [
|
|
4198
|
+
{
|
|
4199
|
+
"type": "steedos-object-form",
|
|
4200
|
+
"label": "对象表单",
|
|
4201
|
+
"objectApiName": "object_listviews",
|
|
4202
|
+
"recordId": "${recordId}",
|
|
4203
|
+
"mode": "edit",
|
|
4204
|
+
"fields": [
|
|
4205
|
+
"shared"
|
|
4206
|
+
]
|
|
4207
|
+
}
|
|
4208
|
+
],
|
|
4209
|
+
"showCloseButton": true,
|
|
4210
|
+
"showErrorMsg": true,
|
|
4211
|
+
"showLoading": true,
|
|
4212
|
+
"closeOnEsc": false,
|
|
4213
|
+
"dataMapSwitch": false,
|
|
4214
|
+
"size": "md"
|
|
4215
|
+
},
|
|
4216
|
+
"actionType": "dialog"
|
|
4217
|
+
}
|
|
4218
|
+
]
|
|
4219
|
+
}
|
|
4220
|
+
}
|
|
4221
|
+
},
|
|
4222
|
+
{
|
|
4223
|
+
"type": "button",
|
|
4224
|
+
"label": "过滤设置",
|
|
4225
|
+
"visibleOn": "(global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && ['all', 'recent', 'my'].indexOf(listName) == -1",
|
|
4226
|
+
"onEvent": {
|
|
4227
|
+
"click": {
|
|
4228
|
+
"weight": 0,
|
|
4229
|
+
"actions": [
|
|
4230
|
+
{
|
|
4231
|
+
"dialog": {
|
|
4232
|
+
"type": "dialog",
|
|
4233
|
+
"title": "过滤设置",
|
|
4234
|
+
"data": {
|
|
4235
|
+
"objectName": "${objectName}",
|
|
4236
|
+
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4237
|
+
"listName": "${listName}",
|
|
4238
|
+
"appId": "${appId}"
|
|
4239
|
+
},
|
|
4240
|
+
"body": [
|
|
4241
|
+
{
|
|
4242
|
+
"type": "steedos-object-form",
|
|
4243
|
+
"label": "对象表单",
|
|
4244
|
+
"objectApiName": "object_listviews",
|
|
4245
|
+
"recordId": "${recordId}",
|
|
4246
|
+
"mode": "edit",
|
|
4247
|
+
"initApiAdaptor": "",
|
|
4248
|
+
"fields": [
|
|
4249
|
+
"filters"
|
|
4250
|
+
],
|
|
4251
|
+
"initApiRequestAdaptor": "",
|
|
4252
|
+
"initApiAdaptor": "const recordId_tmp = api.body.recordId;\nlet data_tmp;\nif (recordId_tmp) {\n data_tmp = payload.data.initialValues;\n // 数据格式转换\n if (data_tmp) {\n if (data_tmp.filters && lodash.isString(data_tmp.filters)) {\n try {\n data_tmp.filters = JSON.parse(data_tmp.filters);\n } catch (e) { }\n }\n\n if (data_tmp.filters && lodash.isString(data_tmp.filters)) {\n data_tmp._filters_type_controller = 'function';\n } else {\n data_tmp._filters_type_controller = 'conditions'\n }\n\n if (data_tmp._filters_type_controller === 'conditions') {\n data_tmp._filters_conditions = window.amisConvert.filtersToConditions(data_tmp.filters || []);\n data_tmp.filters = data_tmp._filters_conditions;\n } else {\n data_tmp._filters_function = data_tmp.filters;\n }\n }\n}\nfor (key in data_tmp) {\n if (data_tmp[key] === null) {\n delete data_tmp[key];\n }\n}\npayload.data.initialValues = Object.assign(payload.data.initialValues, data_tmp);\ndelete payload.extensions;",
|
|
4253
|
+
"apiRequestAdaptor": "const recordId = api.body.recordId;\nif (formData._filters_type_controller === 'conditions' && formData._filters_conditions) {\n formData.filters = window.amisConvert.conditionsToFilters(formData.filters);\n} else {\n formData.filters = formData._filters_function || null;\n}\n\ndelete formData._filters_type_controller;\ndelete formData._filters_conditions;\ndelete formData._filters_function;\n// 字符串拼接(不支持ES6``语法)\nquery = 'mutation{record: ' + objectName + '__insert(doc: {__saveData}){_id}}';\nif (api.body.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",
|
|
4254
|
+
"fieldsExtend": "{\"filters\": {\n \"visible_on\": \"true\",\n \"amis\": {\n \"type\": \"condition-builder\",\n \"label\": \"条件组件\",\n \"source\": {\n \"method\": \"get\",\n \"url\": \"${context.rootUrl}/service/api/amis-metadata-listviews/getFilterFields?objectName=${objectName}\",\n \"dataType\": \"json\",\n \"headers\": {\n \"Authorization\": \"Bearer ${context.tenantId},${context.authToken}\"\n }\n }\n }\n }\n}",
|
|
4255
|
+
"onEvent": {
|
|
4256
|
+
"submitSucc": {
|
|
4257
|
+
"weight": 0,
|
|
4258
|
+
"actions": [
|
|
4259
|
+
{
|
|
4260
|
+
"args": {
|
|
4261
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/${listName}",
|
|
4262
|
+
"blank": false
|
|
4263
|
+
},
|
|
4264
|
+
"actionType": "url",
|
|
4265
|
+
}
|
|
4266
|
+
]
|
|
4267
|
+
}
|
|
4268
|
+
}
|
|
4269
|
+
}
|
|
4270
|
+
],
|
|
4271
|
+
"showCloseButton": true,
|
|
4272
|
+
"showErrorMsg": true,
|
|
4273
|
+
"showLoading": true,
|
|
4274
|
+
"closeOnEsc": false,
|
|
4275
|
+
"dataMapSwitch": false,
|
|
4276
|
+
"size": "lg"
|
|
4277
|
+
},
|
|
4278
|
+
"actionType": "dialog"
|
|
4279
|
+
}
|
|
4280
|
+
]
|
|
4281
|
+
}
|
|
4282
|
+
}
|
|
4283
|
+
},
|
|
4284
|
+
{
|
|
4285
|
+
"type": "button",
|
|
4286
|
+
"label": "显示的列",
|
|
4287
|
+
"visibleOn": "(global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && ['all', 'recent', 'my'].indexOf(listName) == -1",
|
|
4288
|
+
"onEvent": {
|
|
4289
|
+
"click": {
|
|
4290
|
+
"weight": 0,
|
|
4291
|
+
"actions": [
|
|
4292
|
+
{
|
|
4293
|
+
"args": {},
|
|
4294
|
+
"dialog": {
|
|
4295
|
+
"type": "dialog",
|
|
4296
|
+
"title": "显示的列",
|
|
4297
|
+
"data": {
|
|
4298
|
+
"&": "$$",
|
|
4299
|
+
"objectName": "${objectName}",
|
|
4300
|
+
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4301
|
+
"listName": "${listName}",
|
|
4302
|
+
"appId": "${appId}"
|
|
4303
|
+
},
|
|
4304
|
+
"body": [
|
|
4305
|
+
{
|
|
4306
|
+
"type": "steedos-object-form",
|
|
4307
|
+
"label": "对象表单",
|
|
4308
|
+
"objectApiName": "object_listviews",
|
|
4309
|
+
"recordId": "${recordId}",
|
|
4310
|
+
"mode": "edit",
|
|
4311
|
+
"fieldsExtend": "{\n \"columns\": {\n \"amis\": {\n \"type\": \"transfer\",\n \"sortable\": true,\n \"searchable\": true,\n \"source\": {\n \"method\": \"get\",\n \"url\": \"${context.rootUrl}/service/api/amis-metadata-objects/objects/${objectName}/fields/options\",\n \"headers\": {\n \"Authorization\": \"Bearer ${context.tenantId},${context.authToken}\"\n }\n }\n }\n },\n \"mobile_columns\": {\n \"group\": \"手机端\",\n \"amis\": {\n \"type\": \"transfer\",\n \"sortable\": true,\n \"searchable\": true,\n \"source\": {\n \"method\": \"get\",\n \"url\": \"${context.rootUrl}/service/api/amis-metadata-objects/objects/${objectName}/fields/options\",\n \"headers\": {\n \"Authorization\": \"Bearer ${context.tenantId},${context.authToken}\"\n }\n }\n }\n }\n}",
|
|
4312
|
+
"initApiAdaptor": "const recordId_tmp = api.body.recordId;\nlet columns_tmp = {}, mobile_columns_tmp = {};\nif (recordId_tmp) {\n columns_tmp = payload.data.initialValues.columns;\n mobile_columns_tmp = payload.data.initialValues.mobile_columns;\n if (columns_tmp) {\n columns_tmp = lodash.map(columns_tmp, 'field');\n }\n if (mobile_columns_tmp) {\n mobile_columns_tmp = lodash.map(mobile_columns_tmp, 'field');\n }\n}\npayload.data.initialValues.columns = columns_tmp;\npayload.data.initialValues.mobile_columns = mobile_columns_tmp;\n\ndelete payload.extensions;\nreturn payload;",
|
|
4313
|
+
"apiRequestAdaptor": "const formData_tmp = api.body.$;\nconst objectName_tmp = api.body.objectName;\nconst recordId_tmp = api.body.recordId;\n\nif (typeof formData_tmp.columns == 'string') {\n formData_tmp.columns = formData_tmp.columns?.split(',');\n}\nif (typeof formData_tmp.mobile_columns == 'string') {\n formData_tmp.mobile_columns = formData_tmp.mobile_columns?.split(',');\n}\n\n// 数据格式转换\nformData_tmp.columns = lodash.map(formData_tmp.columns, (item) => {\n return { field: item };\n});\nformData.mobile_columns = lodash.map(formData.mobile_columns, (item) => {\n return { field: item };\n});\n\n// 字符串拼接(不支持ES6语法)\nlet query_tmp = 'mutation{record: ' + objectName_tmp + '__insert(doc: {__saveData}){_id}}';\nif (api.body.recordId) {\n query_tmp = 'mutation{record: ' + objectName_tmp + '__update(id: \"' + recordId_tmp +'\", doc: {__saveData}){_id}}';\n};\ndelete formData_tmp._id;\nlet __saveData_tmp = JSON.stringify(JSON.stringify(formData_tmp));\napi.data = { query: query_tmp.replace('{__saveData}', __saveData_tmp) };\n\nreturn api;",
|
|
4314
|
+
"fields": [
|
|
4315
|
+
"columns",
|
|
4316
|
+
"mobile_columns"
|
|
4317
|
+
],
|
|
4318
|
+
"onEvent": {
|
|
4319
|
+
"submitSucc": {
|
|
4320
|
+
"weight": 0,
|
|
4321
|
+
"actions": [
|
|
4322
|
+
{
|
|
4323
|
+
"args": {
|
|
4324
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/${listName}",
|
|
4325
|
+
"blank": false
|
|
4326
|
+
},
|
|
4327
|
+
"actionType": "url"
|
|
4328
|
+
}
|
|
4329
|
+
]
|
|
4330
|
+
}
|
|
4331
|
+
}
|
|
4332
|
+
}
|
|
4333
|
+
],
|
|
4334
|
+
"searchable": true,
|
|
4335
|
+
"showCloseButton": true,
|
|
4336
|
+
"showErrorMsg": true,
|
|
4337
|
+
"showLoading": true,
|
|
4338
|
+
"size": "lg"
|
|
4339
|
+
},
|
|
4340
|
+
"actionType": "dialog"
|
|
4341
|
+
}
|
|
4342
|
+
]
|
|
4343
|
+
}
|
|
4344
|
+
}
|
|
4345
|
+
},
|
|
4346
|
+
{
|
|
4347
|
+
"type": "button",
|
|
4348
|
+
"label": "删除",
|
|
4349
|
+
"visibleOn": "(global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && ['all', 'recent', 'my'].indexOf(listName) == -1",
|
|
4350
|
+
"confirmText": "如果您删除此列表视图,该视图将为所有具备访问权限的用户永久删除。是否确定要删除?",
|
|
4351
|
+
"onEvent": {
|
|
4352
|
+
"click": {
|
|
4353
|
+
"actions": [
|
|
4354
|
+
{
|
|
4355
|
+
"actionType": "ajax",
|
|
4356
|
+
"args": {
|
|
4357
|
+
"api": {
|
|
4358
|
+
"url": "${context.rootUrl}/graphql",
|
|
4359
|
+
"method": "post",
|
|
4360
|
+
"headers": {
|
|
4361
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
4362
|
+
},
|
|
4363
|
+
"data": {
|
|
4364
|
+
"&": "$$",
|
|
4365
|
+
"uiSchema": "${uiSchema}",
|
|
4366
|
+
"recordId": "${uiSchema.list_views[listName]._id}"
|
|
4367
|
+
},
|
|
4368
|
+
"messages": {
|
|
4369
|
+
"success": "删除成功"
|
|
4370
|
+
},
|
|
4371
|
+
"requestAdaptor": "const { recordId } = api.body;\nvar deleteArray = [];\nif (recordId) { deleteArray.push(`delete:object_listviews__delete(id: \"${recordId}\")`); }\napi.data = { query: `mutation{${deleteArray.join(',')}}` };\n return api;\n",
|
|
4372
|
+
"adaptor": "if (payload.errors) {\n payload.status = 2;\n payload.msg = payload.errors[0].message;\n}\nreturn payload;",
|
|
4373
|
+
}
|
|
4374
|
+
}
|
|
4375
|
+
},
|
|
4376
|
+
{
|
|
4377
|
+
"actionType": "url",
|
|
4378
|
+
"args": {
|
|
4379
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/all",
|
|
4380
|
+
"blank": false
|
|
4381
|
+
},
|
|
4382
|
+
"expression": "data.delete == 1"
|
|
4383
|
+
}
|
|
4384
|
+
]
|
|
4385
|
+
}
|
|
4386
|
+
}
|
|
4387
|
+
},
|
|
4388
|
+
{
|
|
4389
|
+
"type": "button",
|
|
4390
|
+
"visibleOn": "${false}",
|
|
4391
|
+
"label": "保存宽度(todo)"
|
|
4392
|
+
},
|
|
4393
|
+
// {
|
|
4394
|
+
// type: 'steedos-object-button',
|
|
4395
|
+
// name: 'standard_delete',
|
|
4396
|
+
// objectName: 'test0321__c',
|
|
4397
|
+
// // visibleOn: getButtonVisibleOn(button),
|
|
4398
|
+
// className: 'antd-Button--default'
|
|
4399
|
+
// }
|
|
4400
|
+
]
|
|
4401
|
+
}
|
|
4402
|
+
]
|
|
3952
4403
|
},
|
|
3953
|
-
showDisplayAs? getDisplayAsButton(showDisplayAs) : {}
|
|
4404
|
+
showDisplayAs ? getDisplayAsButton(showDisplayAs) : {}
|
|
3954
4405
|
// {
|
|
3955
4406
|
// "type": "search-box",
|
|
3956
4407
|
// "align": "right",
|
|
@@ -4233,6 +4684,7 @@ function getLookupSapceUserTreeSchema(){
|
|
|
4233
4684
|
const tree = [{
|
|
4234
4685
|
"type": "input-tree",
|
|
4235
4686
|
"className": "",
|
|
4687
|
+
"inputClassName": "pl-0",
|
|
4236
4688
|
"id": "u:7fd77b7915b0",
|
|
4237
4689
|
"source": {
|
|
4238
4690
|
"method": "post",
|
|
@@ -4302,10 +4754,10 @@ function getLookupSapceUserTreeSchema(){
|
|
|
4302
4754
|
"style": {
|
|
4303
4755
|
"max-height": "100%",
|
|
4304
4756
|
"position": "absolute",
|
|
4305
|
-
"left": "-
|
|
4757
|
+
"left": "-200px",
|
|
4306
4758
|
"width": "190px",
|
|
4307
4759
|
"bottom": 0,
|
|
4308
|
-
"top": "
|
|
4760
|
+
"top": "-14px",
|
|
4309
4761
|
"overflow": "auto",
|
|
4310
4762
|
"min-height":"300px"
|
|
4311
4763
|
},
|
|
@@ -6213,11 +6665,11 @@ function getBulkActions(objectSchema){
|
|
|
6213
6665
|
}
|
|
6214
6666
|
|
|
6215
6667
|
async function getObjectCRUD(objectSchema, fields, options){
|
|
6668
|
+
// console.time('getObjectCRUD');
|
|
6216
6669
|
const { top, perPage, showDisplayAs = false, displayAs, crudClassName = "" } = options;
|
|
6217
6670
|
const nonpaged = objectSchema.paging && objectSchema.paging.enabled === false;
|
|
6218
6671
|
const isTreeObject = objectSchema.enable_tree;
|
|
6219
6672
|
const bulkActions = getBulkActions(objectSchema);
|
|
6220
|
-
|
|
6221
6673
|
const bodyProps = {
|
|
6222
6674
|
// toolbar: getToolbar(),
|
|
6223
6675
|
// headerToolbar: getObjectHeaderToolbar(objectSchema, options.formFactor, {showDisplayAs}),
|
|
@@ -6246,11 +6698,12 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
6246
6698
|
options.queryCount = false;
|
|
6247
6699
|
}
|
|
6248
6700
|
}
|
|
6249
|
-
|
|
6701
|
+
// console.log(`getObjectHeaderToolbar====2===>`, options.filterVisible)
|
|
6250
6702
|
bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, options.formFactor, {
|
|
6251
6703
|
showDisplayAs,
|
|
6252
6704
|
hiddenCount: options.queryCount === false,
|
|
6253
|
-
headerToolbarItems: options.headerToolbarItems
|
|
6705
|
+
headerToolbarItems: options.headerToolbarItems,
|
|
6706
|
+
filterVisible: options.filterVisible
|
|
6254
6707
|
});
|
|
6255
6708
|
|
|
6256
6709
|
|
|
@@ -6325,7 +6778,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
6325
6778
|
body = wrappedBody;
|
|
6326
6779
|
}
|
|
6327
6780
|
}
|
|
6328
|
-
|
|
6781
|
+
// console.timeEnd('getObjectCRUD');
|
|
6329
6782
|
// TODO: data应该只留loaded,其他属性都改为从上层传递下来
|
|
6330
6783
|
return {
|
|
6331
6784
|
type: 'service',
|
|
@@ -6447,7 +6900,8 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
6447
6900
|
"eventName": "@data.changed.${_master.objectName}"
|
|
6448
6901
|
},
|
|
6449
6902
|
"data": {
|
|
6450
|
-
"objectName": "${_master.objectName}"
|
|
6903
|
+
"objectName": "${_master.objectName}",
|
|
6904
|
+
"_isRelated": "${_isRelated || _master._isRelated}"
|
|
6451
6905
|
},
|
|
6452
6906
|
"expression": `\${_master.objectName != '${objectSchema.name}' && _master.objectName}`
|
|
6453
6907
|
},
|
|
@@ -8211,8 +8665,8 @@ async function getRelatedListSchema(
|
|
|
8211
8665
|
/*
|
|
8212
8666
|
* @Author: baozhoutao@steedos.com
|
|
8213
8667
|
* @Date: 2022-07-05 15:55:39
|
|
8214
|
-
* @LastEditors:
|
|
8215
|
-
* @LastEditTime: 2023-04-
|
|
8668
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
8669
|
+
* @LastEditTime: 2023-04-12 14:24:09
|
|
8216
8670
|
* @Description:
|
|
8217
8671
|
*/
|
|
8218
8672
|
|
|
@@ -8512,7 +8966,8 @@ async function getListSchema(
|
|
|
8512
8966
|
"ctx": ctx,
|
|
8513
8967
|
"requestAdaptor": listView.requestAdaptor,
|
|
8514
8968
|
"adaptor": listView.adaptor,
|
|
8515
|
-
"headerToolbarItems": ctx.headerToolbarItems
|
|
8969
|
+
"headerToolbarItems": ctx.headerToolbarItems,
|
|
8970
|
+
"filterVisible": ctx.filterVisible
|
|
8516
8971
|
};
|
|
8517
8972
|
return {
|
|
8518
8973
|
uiSchema,
|
|
@@ -8527,6 +8982,7 @@ async function getTableSchema(
|
|
|
8527
8982
|
columns,
|
|
8528
8983
|
ctx = {}
|
|
8529
8984
|
) {
|
|
8985
|
+
// console.time('getTableSchema');
|
|
8530
8986
|
const uiSchema = await getUISchema(objectName);
|
|
8531
8987
|
|
|
8532
8988
|
let sort = ctx.sort;
|
|
@@ -8577,6 +9033,7 @@ async function getTableSchema(
|
|
|
8577
9033
|
buttons: await getListViewItemButtons(uiSchema, ctx)
|
|
8578
9034
|
});
|
|
8579
9035
|
// console.log('getTableSchema====>amisSchema', amisSchema)
|
|
9036
|
+
// console.timeEnd('getTableSchema');
|
|
8580
9037
|
return {
|
|
8581
9038
|
uiSchema,
|
|
8582
9039
|
amisSchema,
|
|
@@ -12030,6 +12487,28 @@ var SteedosLoading = function (props) {
|
|
|
12030
12487
|
React__default["default"].createElement("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" }))));
|
|
12031
12488
|
};
|
|
12032
12489
|
|
|
12490
|
+
/*
|
|
12491
|
+
* @Author: baozhoutao@steedos.com
|
|
12492
|
+
* @Date: 2023-04-07 18:31:31
|
|
12493
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
12494
|
+
* @LastEditTime: 2023-04-12 14:25:02
|
|
12495
|
+
* @Description:
|
|
12496
|
+
*/
|
|
12497
|
+
var SteedosSkeleton = function (props) {
|
|
12498
|
+
var body = props.body, render = props.render, _a = props.bodyClassName, bodyClassName = _a === void 0 ? "" : _a, _b = props.config, config = _b === void 0 ? {} : _b;
|
|
12499
|
+
if (___default.isString(config)) {
|
|
12500
|
+
config = JSON.parse(config);
|
|
12501
|
+
}
|
|
12502
|
+
var active = config.active, avatar = config.avatar, loading = config.loading, paragraph = config.paragraph, round = config.round, title = config.title;
|
|
12503
|
+
loading = ___default.isBoolean(loading) ? loading : loading === 'true';
|
|
12504
|
+
// console.log("SteedosSkeleton====>", loading, config, typeof loading)
|
|
12505
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
12506
|
+
React__default["default"].createElement(antd.Skeleton, { active: active, avatar: avatar, loading: loading, paragraph: paragraph, round: round, title: title }),
|
|
12507
|
+
React__default["default"].createElement("div", { className: loading ? 'hidden w-full h-full' : 'w-full h-full' }, body ? (React__default["default"].createElement("div", { className: "steedos-skeleton-body ".concat(bodyClassName) }, render('body', body, {
|
|
12508
|
+
// 这里的信息会作为 props 传递给子组件,一般情况下都不需要这个
|
|
12509
|
+
}))) : null));
|
|
12510
|
+
};
|
|
12511
|
+
|
|
12033
12512
|
var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
12034
12513
|
var $schema, recordId, defaultData, mode, layout, labelAlign, appId, fieldsExtend, _a, excludedFields, _b, fields, _c, className, initApiRequestAdaptor, initApiAdaptor, apiRequestAdaptor, apiAdaptor, objectApiName, schemaKeys, formSchema, defaults, options, globalData, amisSchema, uiSchema, schema, schema, formData;
|
|
12035
12514
|
return __generator(this, function (_d) {
|
|
@@ -12087,6 +12566,9 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
12087
12566
|
// if(objectApiName){
|
|
12088
12567
|
// formData.objectName = objectApiName;
|
|
12089
12568
|
// }
|
|
12569
|
+
if (___default.has(props, "recordId") && $schema.recordId !== "${recordId}") {
|
|
12570
|
+
formData.recordId = props.recordId;
|
|
12571
|
+
}
|
|
12090
12572
|
amisSchema.className = "steedos-object-form ".concat(className);
|
|
12091
12573
|
amisSchema.data = Object.assign(amisSchema.data, formData, { global: globalData, uiSchema: uiSchema });
|
|
12092
12574
|
// console.log(`===AmisObjectForm=amisSchema==`, amisSchema)
|
|
@@ -12096,11 +12578,11 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
12096
12578
|
}); };
|
|
12097
12579
|
|
|
12098
12580
|
var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
12099
|
-
var $schema, top, perPage, _a, showHeader, headerSchema, data, defaultData, _b, className, crudClassName, _c, showDisplayAs, sideSchema, headerToolbarItems, ctx, listName, defaults, objectApiName, displayAs, formFactor, isMobile, objectUiSchema, listView, schemaKeys, listSchema, setDataToComponentId, amisSchemaData, listViewId, schema, amisSchema, uiSchema, body, firstLineSchema, serviceData;
|
|
12100
|
-
return __generator(this, function (
|
|
12101
|
-
switch (
|
|
12581
|
+
var $schema, top, perPage, _a, showHeader, headerSchema, data, defaultData, _b, className, crudClassName, _c, showDisplayAs, sideSchema, _e, filterVisible, headerToolbarItems, ctx, listName, defaults, objectApiName, displayAs, formFactor, isMobile, objectUiSchema, listView, schemaKeys, listSchema, setDataToComponentId, amisSchemaData, listViewId, schema, amisSchema, uiSchema, body, firstLineSchema, serviceData;
|
|
12582
|
+
return __generator(this, function (_f) {
|
|
12583
|
+
switch (_f.label) {
|
|
12102
12584
|
case 0:
|
|
12103
|
-
$schema = props.$schema, top = props.top, perPage = props.perPage, _a = props.showHeader, showHeader = _a === void 0 ? true : _a, headerSchema = props.headerSchema, data = props.data, defaultData = props.defaultData, _b = props.className, className = _b === void 0 ? "" : _b, crudClassName = props.crudClassName, _c = props.showDisplayAs, showDisplayAs = _c === void 0 ? false : _c, sideSchema = props.sideSchema, props.columnsTogglable, headerToolbarItems = props.headerToolbarItems;
|
|
12585
|
+
$schema = props.$schema, top = props.top, perPage = props.perPage, _a = props.showHeader, showHeader = _a === void 0 ? true : _a, headerSchema = props.headerSchema, data = props.data, defaultData = props.defaultData, _b = props.className, className = _b === void 0 ? "" : _b, crudClassName = props.crudClassName, _c = props.showDisplayAs, showDisplayAs = _c === void 0 ? false : _c, sideSchema = props.sideSchema, props.columnsTogglable, _e = props.filterVisible, filterVisible = _e === void 0 ? true : _e, headerToolbarItems = props.headerToolbarItems;
|
|
12104
12586
|
ctx = props.ctx;
|
|
12105
12587
|
listName = (defaultData === null || defaultData === void 0 ? void 0 : defaultData.listName) || (data === null || data === void 0 ? void 0 : data.listName) || (props === null || props === void 0 ? void 0 : props.listName);
|
|
12106
12588
|
defaults = {};
|
|
@@ -12127,7 +12609,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
12127
12609
|
}
|
|
12128
12610
|
return [4 /*yield*/, getUISchema(objectApiName, false)];
|
|
12129
12611
|
case 1:
|
|
12130
|
-
objectUiSchema =
|
|
12612
|
+
objectUiSchema = _f.sent();
|
|
12131
12613
|
listView = ___default.find(objectUiSchema.list_views, function (listView, name) {
|
|
12132
12614
|
// 传入listViewName空值则取第一个
|
|
12133
12615
|
if (!listName) {
|
|
@@ -12159,11 +12641,11 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
12159
12641
|
"blank": false
|
|
12160
12642
|
},
|
|
12161
12643
|
"actionType": "link",
|
|
12162
|
-
"expression": "${!!!event.data.recordId && event.data.__deletedRecord != true}" //是新建, 则进入详细页面.
|
|
12644
|
+
"expression": "${!!!event.data.recordId && event.data.__deletedRecord != true && event.data._isRelated != true}" //是新建, 则进入详细页面.
|
|
12163
12645
|
},
|
|
12164
12646
|
{
|
|
12165
12647
|
"actionType": "reload",
|
|
12166
|
-
"expression": "${event.data.recordId || event.data.__deletedRecord === true}" //不是新建, 则刷新列表
|
|
12648
|
+
"expression": "${(event.data.recordId || event.data.__deletedRecord === true) && event.data._isRelated != true}" //不是新建, 则刷新列表
|
|
12167
12649
|
}
|
|
12168
12650
|
]
|
|
12169
12651
|
};
|
|
@@ -12181,9 +12663,9 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
12181
12663
|
}
|
|
12182
12664
|
amisSchemaData = Object.assign({}, data, defaultData);
|
|
12183
12665
|
listViewId = (ctx === null || ctx === void 0 ? void 0 : ctx.listViewId) || amisSchemaData.listViewId;
|
|
12184
|
-
return [4 /*yield*/, getListSchema(amisSchemaData.appId, objectApiName, listName, __assign$2(__assign$2({ top: top, perPage: perPage, showHeader: showHeader, defaults: defaults }, ctx), { listViewId: listViewId, setDataToComponentId: setDataToComponentId, filterVisible:
|
|
12666
|
+
return [4 /*yield*/, getListSchema(amisSchemaData.appId, objectApiName, listName, __assign$2(__assign$2({ top: top, perPage: perPage, showHeader: showHeader, defaults: defaults }, ctx), { listViewId: listViewId, setDataToComponentId: setDataToComponentId, filterVisible: filterVisible, showDisplayAs: showDisplayAs, displayAs: displayAs, headerToolbarItems: headerToolbarItems }))];
|
|
12185
12667
|
case 2:
|
|
12186
|
-
schema = (
|
|
12668
|
+
schema = (_f.sent());
|
|
12187
12669
|
amisSchema = schema.amisSchema;
|
|
12188
12670
|
uiSchema = schema.uiSchema;
|
|
12189
12671
|
body = [amisSchema];
|
|
@@ -12204,19 +12686,20 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
12204
12686
|
{
|
|
12205
12687
|
"type": "wrapper",
|
|
12206
12688
|
"size": "none",
|
|
12207
|
-
"className": "flex-shrink-0 min-w-[200px]
|
|
12689
|
+
"className": "flex-shrink-0 min-w-[200px] h-full border-r border-gray-200 lg:order-first lg:flex lg:flex-col",
|
|
12208
12690
|
"body": sideSchema
|
|
12209
12691
|
},
|
|
12210
12692
|
{
|
|
12211
12693
|
"type": "wrapper",
|
|
12212
12694
|
"size": "none",
|
|
12213
|
-
"className": "flex-1
|
|
12695
|
+
"className": "flex-1 focus:outline-none lg:order-last w-96 h-full",
|
|
12214
12696
|
"body": body
|
|
12215
12697
|
},
|
|
12216
12698
|
]
|
|
12217
12699
|
}];
|
|
12218
12700
|
}
|
|
12219
12701
|
serviceData = Object.assign({}, { listName: listName, uiSchema: uiSchema, showDisplayAs: showDisplayAs, displayAs: displayAs, recordPermissions: uiSchema.permissions, _id: null, $listviewId: listName });
|
|
12702
|
+
// console.timeEnd('AmisObjectListView')
|
|
12220
12703
|
return [2 /*return*/, {
|
|
12221
12704
|
"type": "service",
|
|
12222
12705
|
"body": body,
|
|
@@ -12298,6 +12781,7 @@ var AmisObjectTable = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
12298
12781
|
amisSchema.data = Object.assign({}, amisSchema.data, amisSchemaData);
|
|
12299
12782
|
amisSchema.className = "steedos-object-table h-full flex flex-col ".concat(className);
|
|
12300
12783
|
// console.log(`AmisObjectTable===>amisSchema`, amisSchema)
|
|
12784
|
+
// console.timeEnd('AmisObjectTable')
|
|
12301
12785
|
return [2 /*return*/, amisSchema];
|
|
12302
12786
|
}
|
|
12303
12787
|
});
|
|
@@ -13396,7 +13880,7 @@ var AmisInstanceDetail = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
13396
13880
|
}); };
|
|
13397
13881
|
|
|
13398
13882
|
var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
13399
|
-
var defaultFormFactor, appId, objectApiName, listviewId, display, _a, $schema, listName, displayAs, formFactor, page, listViewId, listSchema, defData;
|
|
13883
|
+
var defaultFormFactor, appId, objectApiName, listviewId, display, _a, $schema, listName, displayAs, formFactor, page, listViewId, listSchema, defData, pageGridClassName, pageSplitClassName;
|
|
13400
13884
|
return __generator(this, function (_b) {
|
|
13401
13885
|
switch (_b.label) {
|
|
13402
13886
|
case 0:
|
|
@@ -13434,11 +13918,12 @@ var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, f
|
|
|
13434
13918
|
if (listName) {
|
|
13435
13919
|
defData.listName = listName || listviewId;
|
|
13436
13920
|
}
|
|
13437
|
-
|
|
13921
|
+
pageGridClassName = listSchema.pageGridClassName || 'h-full sm:p-3';
|
|
13922
|
+
pageSplitClassName = listSchema.pageSplitClassName || 'p-0 flex flex-1 overflow-hidden h-full';
|
|
13438
13923
|
return [2 /*return*/, {
|
|
13439
13924
|
type: 'service',
|
|
13440
13925
|
data: defData,
|
|
13441
|
-
"className": (displayAs === 'grid') ?
|
|
13926
|
+
"className": (displayAs === 'grid') ? pageGridClassName : pageSplitClassName,
|
|
13442
13927
|
body: (displayAs === 'grid') ? ___default.defaultsDeep({ data: defData }, listSchema) : [
|
|
13443
13928
|
{
|
|
13444
13929
|
"type": "wrapper",
|
|
@@ -13561,4 +14046,5 @@ exports.SteedosDropdownButton = SteedosDropdownButton;
|
|
|
13561
14046
|
exports.SteedosIcon = SteedosIcon;
|
|
13562
14047
|
exports.SteedosLib = index_esm;
|
|
13563
14048
|
exports.SteedosLoading = SteedosLoading;
|
|
14049
|
+
exports.SteedosSkeleton = SteedosSkeleton;
|
|
13564
14050
|
//# sourceMappingURL=amis-object.cjs.js.map
|