@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.umd.js
CHANGED
|
@@ -1970,8 +1970,8 @@
|
|
|
1970
1970
|
/*
|
|
1971
1971
|
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
1972
1972
|
* @Date: 2023-03-22 09:31:21
|
|
1973
|
-
* @LastEditors:
|
|
1974
|
-
* @LastEditTime: 2023-04-
|
|
1973
|
+
* @LastEditors: Please set LastEditors
|
|
1974
|
+
* @LastEditTime: 2023-04-12 10:35:36
|
|
1975
1975
|
*/
|
|
1976
1976
|
const getSchema$2 = (uiSchema)=>{
|
|
1977
1977
|
return {
|
|
@@ -2026,7 +2026,8 @@
|
|
|
2026
2026
|
"eventName": "@data.changed.${_master.objectName}"
|
|
2027
2027
|
},
|
|
2028
2028
|
"data": {
|
|
2029
|
-
"objectName": "${_master.objectName}"
|
|
2029
|
+
"objectName": "${_master.objectName}",
|
|
2030
|
+
"_isRelated": "${_isRelated}"
|
|
2030
2031
|
},
|
|
2031
2032
|
"expression": `\${_master.objectName != '${uiSchema.name}' && _master.objectName}`
|
|
2032
2033
|
}
|
|
@@ -3742,6 +3743,9 @@
|
|
|
3742
3743
|
};
|
|
3743
3744
|
};
|
|
3744
3745
|
|
|
3746
|
+
|
|
3747
|
+
|
|
3748
|
+
|
|
3745
3749
|
const onFieldsFilterToggleScript = `
|
|
3746
3750
|
const scope = event.context.scoped;
|
|
3747
3751
|
const filterForm = scope.getComponents().find(function(n){
|
|
@@ -3759,7 +3763,6 @@ setTimeout(()=>{
|
|
|
3759
3763
|
|
|
3760
3764
|
function getExportApiRequestAdaptorScript(){
|
|
3761
3765
|
return `
|
|
3762
|
-
console.log(api.url);
|
|
3763
3766
|
// 获取列表视图的属性
|
|
3764
3767
|
let uiSchema = api.body.uiSchema;
|
|
3765
3768
|
let list_views = uiSchema.list_views;
|
|
@@ -3808,12 +3811,12 @@ setTimeout(()=>{
|
|
|
3808
3811
|
if (filters && filters.length > 0) {
|
|
3809
3812
|
api.url = api.url + "&filters=" + JSON.stringify(filters);
|
|
3810
3813
|
}
|
|
3811
|
-
console.log(api.url);
|
|
3812
3814
|
return api;
|
|
3813
3815
|
`
|
|
3814
3816
|
}
|
|
3815
3817
|
|
|
3816
|
-
function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems} = {}){
|
|
3818
|
+
function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true} = {}){
|
|
3819
|
+
// console.log(`getObjectHeaderToolbar====>`, filterVisible)
|
|
3817
3820
|
const isMobile = window.innerWidth < 768;
|
|
3818
3821
|
if(isMobile){
|
|
3819
3822
|
showDisplayAs = false;
|
|
@@ -3850,7 +3853,7 @@ setTimeout(()=>{
|
|
|
3850
3853
|
}
|
|
3851
3854
|
},
|
|
3852
3855
|
},
|
|
3853
|
-
{
|
|
3856
|
+
filterVisible ? {
|
|
3854
3857
|
"label": "",
|
|
3855
3858
|
"icon": "fa fa-search",
|
|
3856
3859
|
"type": "button",
|
|
@@ -3866,7 +3869,7 @@ setTimeout(()=>{
|
|
|
3866
3869
|
]
|
|
3867
3870
|
}
|
|
3868
3871
|
}
|
|
3869
|
-
},
|
|
3872
|
+
} : {},
|
|
3870
3873
|
showDisplayAs? getDisplayAsButton(mainObject?.name) : {}
|
|
3871
3874
|
]
|
|
3872
3875
|
}else {
|
|
@@ -3882,10 +3885,6 @@ setTimeout(()=>{
|
|
|
3882
3885
|
// "type": "columns-toggler",
|
|
3883
3886
|
// "className": "mr-2"
|
|
3884
3887
|
// },
|
|
3885
|
-
// {
|
|
3886
|
-
// "type": "export-excel",
|
|
3887
|
-
// "align": "right"
|
|
3888
|
-
// },
|
|
3889
3888
|
hiddenCount ? {} : {
|
|
3890
3889
|
"type": "tpl",
|
|
3891
3890
|
"tpl": "${count} 个项目"
|
|
@@ -3931,7 +3930,7 @@ setTimeout(()=>{
|
|
|
3931
3930
|
}
|
|
3932
3931
|
}
|
|
3933
3932
|
},
|
|
3934
|
-
{
|
|
3933
|
+
filterVisible ? {
|
|
3935
3934
|
"label": "",
|
|
3936
3935
|
"icon": "fa fa-search",
|
|
3937
3936
|
"type": "button",
|
|
@@ -3947,8 +3946,460 @@ setTimeout(()=>{
|
|
|
3947
3946
|
]
|
|
3948
3947
|
}
|
|
3949
3948
|
}
|
|
3949
|
+
} : {},
|
|
3950
|
+
{
|
|
3951
|
+
"type": "dropdown-button",
|
|
3952
|
+
"trigger": "click",
|
|
3953
|
+
"icon": "fa fa-cog",
|
|
3954
|
+
"btnClassName": "antd-Button--iconOnly bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
3955
|
+
"align": "right",
|
|
3956
|
+
"visibleOn": "${!isLookup}",
|
|
3957
|
+
"buttons": [
|
|
3958
|
+
{
|
|
3959
|
+
"label": "列表视图操作",
|
|
3960
|
+
"children": [
|
|
3961
|
+
{
|
|
3962
|
+
"type": "button",
|
|
3963
|
+
"label": "新建",
|
|
3964
|
+
"onEvent": {
|
|
3965
|
+
"click": {
|
|
3966
|
+
"weight": 0,
|
|
3967
|
+
"actions": [
|
|
3968
|
+
{
|
|
3969
|
+
"dialog": {
|
|
3970
|
+
"type": "dialog",
|
|
3971
|
+
"title": "新建 列表视图",
|
|
3972
|
+
"data": {
|
|
3973
|
+
"&": "$$",
|
|
3974
|
+
"all": "${uiSchema.list_views.all}",
|
|
3975
|
+
"list_view": "${uiSchema.list_views[listName]}",
|
|
3976
|
+
"appId": "${appId}",
|
|
3977
|
+
"global": "${global}",
|
|
3978
|
+
"objectName": "${objectName}",
|
|
3979
|
+
},
|
|
3980
|
+
"body": [
|
|
3981
|
+
{
|
|
3982
|
+
"type": "steedos-object-form",
|
|
3983
|
+
"label": "对象表单",
|
|
3984
|
+
"objectApiName": "object_listviews",
|
|
3985
|
+
"recordId": "",
|
|
3986
|
+
"mode": "edit",
|
|
3987
|
+
"defaultData": {
|
|
3988
|
+
"&": "${list_view}",
|
|
3989
|
+
"name":"",
|
|
3990
|
+
"label":"",
|
|
3991
|
+
"filters":"",
|
|
3992
|
+
"shared":false
|
|
3993
|
+
},
|
|
3994
|
+
"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}",
|
|
3995
|
+
"fields": [
|
|
3996
|
+
"label",
|
|
3997
|
+
"name",
|
|
3998
|
+
"object_name",
|
|
3999
|
+
"filter_scope",
|
|
4000
|
+
"show_count",
|
|
4001
|
+
"columns.$.field",
|
|
4002
|
+
"columns.$.width",
|
|
4003
|
+
"sort.$.field_name",
|
|
4004
|
+
"sort.$.order",
|
|
4005
|
+
"filters",
|
|
4006
|
+
"mobile_columns.$.field",
|
|
4007
|
+
"searchable_fields.$.field",
|
|
4008
|
+
"is_system",
|
|
4009
|
+
"shared"
|
|
4010
|
+
],
|
|
4011
|
+
"onEvent": {
|
|
4012
|
+
"submitSucc": {
|
|
4013
|
+
"weight": 0,
|
|
4014
|
+
"actions": [
|
|
4015
|
+
{
|
|
4016
|
+
"args": {
|
|
4017
|
+
// 直接使用recordId不能拿到数据,只能通过result里面拿数据
|
|
4018
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/listview_${result.data.recordId|lowerCase}",
|
|
4019
|
+
"blank": false
|
|
4020
|
+
},
|
|
4021
|
+
"actionType": "url",
|
|
4022
|
+
}
|
|
4023
|
+
]
|
|
4024
|
+
}
|
|
4025
|
+
},
|
|
4026
|
+
"messages": {
|
|
4027
|
+
"success": "成功",
|
|
4028
|
+
"failed": "失败"
|
|
4029
|
+
},
|
|
4030
|
+
}
|
|
4031
|
+
],
|
|
4032
|
+
"showCloseButton": true,
|
|
4033
|
+
"showErrorMsg": true,
|
|
4034
|
+
"showLoading": true,
|
|
4035
|
+
"closeOnEsc": false,
|
|
4036
|
+
"dataMapSwitch": false,
|
|
4037
|
+
"size": "lg"
|
|
4038
|
+
},
|
|
4039
|
+
"actionType": "dialog"
|
|
4040
|
+
}
|
|
4041
|
+
]
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
4044
|
+
},
|
|
4045
|
+
{
|
|
4046
|
+
"type": "button",
|
|
4047
|
+
"label": "复制",
|
|
4048
|
+
"onEvent": {
|
|
4049
|
+
"click": {
|
|
4050
|
+
"weight": 0,
|
|
4051
|
+
"actions": [
|
|
4052
|
+
{
|
|
4053
|
+
"dialog": {
|
|
4054
|
+
"type": "dialog",
|
|
4055
|
+
"title": "复制 列表视图",
|
|
4056
|
+
"data": {
|
|
4057
|
+
"&": "$$",
|
|
4058
|
+
"listName": "${listName}",
|
|
4059
|
+
"objectName": "${objectName}",
|
|
4060
|
+
"list_view": "${uiSchema.list_views[listName]}",
|
|
4061
|
+
"appId": "${appId}",
|
|
4062
|
+
"global": "${global}"
|
|
4063
|
+
},
|
|
4064
|
+
"body": [
|
|
4065
|
+
{
|
|
4066
|
+
"type": "steedos-object-form",
|
|
4067
|
+
"label": "对象表单",
|
|
4068
|
+
"objectApiName": "object_listviews",
|
|
4069
|
+
"recordId": "",
|
|
4070
|
+
"mode": "edit",
|
|
4071
|
+
"fields": [
|
|
4072
|
+
],
|
|
4073
|
+
"defaultData": {
|
|
4074
|
+
"&": "${list_view}",
|
|
4075
|
+
"name":"",
|
|
4076
|
+
"label": "${list_view.label}的副本",
|
|
4077
|
+
"shared":false
|
|
4078
|
+
},
|
|
4079
|
+
"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}",
|
|
4080
|
+
"fields": [
|
|
4081
|
+
"label",
|
|
4082
|
+
"name",
|
|
4083
|
+
"object_name",
|
|
4084
|
+
"filter_scope",
|
|
4085
|
+
"show_count",
|
|
4086
|
+
"columns.$.field",
|
|
4087
|
+
"columns.$.width",
|
|
4088
|
+
"sort.$.field_name",
|
|
4089
|
+
"sort.$.order",
|
|
4090
|
+
"filters",
|
|
4091
|
+
"mobile_columns.$.field",
|
|
4092
|
+
"searchable_fields.$.field",
|
|
4093
|
+
"is_system",
|
|
4094
|
+
"shared"
|
|
4095
|
+
],
|
|
4096
|
+
"onEvent": {
|
|
4097
|
+
"submitSucc": {
|
|
4098
|
+
"weight": 0,
|
|
4099
|
+
"actions": [
|
|
4100
|
+
{
|
|
4101
|
+
"args": {
|
|
4102
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/listview_${result.data.recordId|lowerCase}",
|
|
4103
|
+
"blank": false
|
|
4104
|
+
},
|
|
4105
|
+
"actionType": "url",
|
|
4106
|
+
}
|
|
4107
|
+
]
|
|
4108
|
+
}
|
|
4109
|
+
}
|
|
4110
|
+
}
|
|
4111
|
+
],
|
|
4112
|
+
"showCloseButton": true,
|
|
4113
|
+
"showErrorMsg": true,
|
|
4114
|
+
"showLoading": true,
|
|
4115
|
+
"closeOnEsc": false,
|
|
4116
|
+
"dataMapSwitch": false,
|
|
4117
|
+
"size": "lg"
|
|
4118
|
+
},
|
|
4119
|
+
"actionType": "dialog"
|
|
4120
|
+
}
|
|
4121
|
+
]
|
|
4122
|
+
}
|
|
4123
|
+
}
|
|
4124
|
+
},
|
|
4125
|
+
{
|
|
4126
|
+
"type": "button",
|
|
4127
|
+
"label": "重命名",
|
|
4128
|
+
"visibleOn": "(global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && ['all', 'recent', 'my'].indexOf(listName) == -1",
|
|
4129
|
+
"onEvent": {
|
|
4130
|
+
"click": {
|
|
4131
|
+
"weight": 0,
|
|
4132
|
+
"actions": [
|
|
4133
|
+
{
|
|
4134
|
+
"dialog": {
|
|
4135
|
+
"type": "dialog",
|
|
4136
|
+
"title": "重命名 列表视图",
|
|
4137
|
+
"data": {
|
|
4138
|
+
"objectName": "${objectName}",
|
|
4139
|
+
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4140
|
+
"appId": "${appId}"
|
|
4141
|
+
},
|
|
4142
|
+
"body": [
|
|
4143
|
+
{
|
|
4144
|
+
"type": "steedos-object-form",
|
|
4145
|
+
"label": "对象表单",
|
|
4146
|
+
"objectApiName": "object_listviews",
|
|
4147
|
+
"recordId": "${recordId}",
|
|
4148
|
+
"mode": "edit",
|
|
4149
|
+
"fields": [
|
|
4150
|
+
"label"
|
|
4151
|
+
],
|
|
4152
|
+
"fieldsExtend": "{\n \"label\":{\n \"is_wide\": true\n }\n}",
|
|
4153
|
+
"onEvent": {
|
|
4154
|
+
"submitSucc": {
|
|
4155
|
+
"weight": 0,
|
|
4156
|
+
"actions": [
|
|
4157
|
+
{
|
|
4158
|
+
"args": {
|
|
4159
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/${name}",
|
|
4160
|
+
"blank": false
|
|
4161
|
+
},
|
|
4162
|
+
"actionType": "url",
|
|
4163
|
+
},
|
|
4164
|
+
]
|
|
4165
|
+
}
|
|
4166
|
+
}
|
|
4167
|
+
}
|
|
4168
|
+
],
|
|
4169
|
+
"showCloseButton": true,
|
|
4170
|
+
"showErrorMsg": true,
|
|
4171
|
+
"showLoading": true,
|
|
4172
|
+
"size": "lg"
|
|
4173
|
+
},
|
|
4174
|
+
"actionType": "dialog"
|
|
4175
|
+
}
|
|
4176
|
+
]
|
|
4177
|
+
}
|
|
4178
|
+
}
|
|
4179
|
+
},
|
|
4180
|
+
{
|
|
4181
|
+
"type": "button",
|
|
4182
|
+
"label": "共享设置",
|
|
4183
|
+
"visibleOn": "global.user.is_space_admin && ['all', 'recent', 'my'].indexOf(listName) == -1",
|
|
4184
|
+
"onEvent": {
|
|
4185
|
+
"click": {
|
|
4186
|
+
"weight": 0,
|
|
4187
|
+
"actions": [
|
|
4188
|
+
{
|
|
4189
|
+
"dialog": {
|
|
4190
|
+
"type": "dialog",
|
|
4191
|
+
"title": "共享设置",
|
|
4192
|
+
"data": {
|
|
4193
|
+
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4194
|
+
},
|
|
4195
|
+
"body": [
|
|
4196
|
+
{
|
|
4197
|
+
"type": "steedos-object-form",
|
|
4198
|
+
"label": "对象表单",
|
|
4199
|
+
"objectApiName": "object_listviews",
|
|
4200
|
+
"recordId": "${recordId}",
|
|
4201
|
+
"mode": "edit",
|
|
4202
|
+
"fields": [
|
|
4203
|
+
"shared"
|
|
4204
|
+
]
|
|
4205
|
+
}
|
|
4206
|
+
],
|
|
4207
|
+
"showCloseButton": true,
|
|
4208
|
+
"showErrorMsg": true,
|
|
4209
|
+
"showLoading": true,
|
|
4210
|
+
"closeOnEsc": false,
|
|
4211
|
+
"dataMapSwitch": false,
|
|
4212
|
+
"size": "md"
|
|
4213
|
+
},
|
|
4214
|
+
"actionType": "dialog"
|
|
4215
|
+
}
|
|
4216
|
+
]
|
|
4217
|
+
}
|
|
4218
|
+
}
|
|
4219
|
+
},
|
|
4220
|
+
{
|
|
4221
|
+
"type": "button",
|
|
4222
|
+
"label": "过滤设置",
|
|
4223
|
+
"visibleOn": "(global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && ['all', 'recent', 'my'].indexOf(listName) == -1",
|
|
4224
|
+
"onEvent": {
|
|
4225
|
+
"click": {
|
|
4226
|
+
"weight": 0,
|
|
4227
|
+
"actions": [
|
|
4228
|
+
{
|
|
4229
|
+
"dialog": {
|
|
4230
|
+
"type": "dialog",
|
|
4231
|
+
"title": "过滤设置",
|
|
4232
|
+
"data": {
|
|
4233
|
+
"objectName": "${objectName}",
|
|
4234
|
+
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4235
|
+
"listName": "${listName}",
|
|
4236
|
+
"appId": "${appId}"
|
|
4237
|
+
},
|
|
4238
|
+
"body": [
|
|
4239
|
+
{
|
|
4240
|
+
"type": "steedos-object-form",
|
|
4241
|
+
"label": "对象表单",
|
|
4242
|
+
"objectApiName": "object_listviews",
|
|
4243
|
+
"recordId": "${recordId}",
|
|
4244
|
+
"mode": "edit",
|
|
4245
|
+
"initApiAdaptor": "",
|
|
4246
|
+
"fields": [
|
|
4247
|
+
"filters"
|
|
4248
|
+
],
|
|
4249
|
+
"initApiRequestAdaptor": "",
|
|
4250
|
+
"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;",
|
|
4251
|
+
"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",
|
|
4252
|
+
"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}",
|
|
4253
|
+
"onEvent": {
|
|
4254
|
+
"submitSucc": {
|
|
4255
|
+
"weight": 0,
|
|
4256
|
+
"actions": [
|
|
4257
|
+
{
|
|
4258
|
+
"args": {
|
|
4259
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/${listName}",
|
|
4260
|
+
"blank": false
|
|
4261
|
+
},
|
|
4262
|
+
"actionType": "url",
|
|
4263
|
+
}
|
|
4264
|
+
]
|
|
4265
|
+
}
|
|
4266
|
+
}
|
|
4267
|
+
}
|
|
4268
|
+
],
|
|
4269
|
+
"showCloseButton": true,
|
|
4270
|
+
"showErrorMsg": true,
|
|
4271
|
+
"showLoading": true,
|
|
4272
|
+
"closeOnEsc": false,
|
|
4273
|
+
"dataMapSwitch": false,
|
|
4274
|
+
"size": "lg"
|
|
4275
|
+
},
|
|
4276
|
+
"actionType": "dialog"
|
|
4277
|
+
}
|
|
4278
|
+
]
|
|
4279
|
+
}
|
|
4280
|
+
}
|
|
4281
|
+
},
|
|
4282
|
+
{
|
|
4283
|
+
"type": "button",
|
|
4284
|
+
"label": "显示的列",
|
|
4285
|
+
"visibleOn": "(global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && ['all', 'recent', 'my'].indexOf(listName) == -1",
|
|
4286
|
+
"onEvent": {
|
|
4287
|
+
"click": {
|
|
4288
|
+
"weight": 0,
|
|
4289
|
+
"actions": [
|
|
4290
|
+
{
|
|
4291
|
+
"args": {},
|
|
4292
|
+
"dialog": {
|
|
4293
|
+
"type": "dialog",
|
|
4294
|
+
"title": "显示的列",
|
|
4295
|
+
"data": {
|
|
4296
|
+
"&": "$$",
|
|
4297
|
+
"objectName": "${objectName}",
|
|
4298
|
+
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4299
|
+
"listName": "${listName}",
|
|
4300
|
+
"appId": "${appId}"
|
|
4301
|
+
},
|
|
4302
|
+
"body": [
|
|
4303
|
+
{
|
|
4304
|
+
"type": "steedos-object-form",
|
|
4305
|
+
"label": "对象表单",
|
|
4306
|
+
"objectApiName": "object_listviews",
|
|
4307
|
+
"recordId": "${recordId}",
|
|
4308
|
+
"mode": "edit",
|
|
4309
|
+
"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}",
|
|
4310
|
+
"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;",
|
|
4311
|
+
"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;",
|
|
4312
|
+
"fields": [
|
|
4313
|
+
"columns",
|
|
4314
|
+
"mobile_columns"
|
|
4315
|
+
],
|
|
4316
|
+
"onEvent": {
|
|
4317
|
+
"submitSucc": {
|
|
4318
|
+
"weight": 0,
|
|
4319
|
+
"actions": [
|
|
4320
|
+
{
|
|
4321
|
+
"args": {
|
|
4322
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/${listName}",
|
|
4323
|
+
"blank": false
|
|
4324
|
+
},
|
|
4325
|
+
"actionType": "url"
|
|
4326
|
+
}
|
|
4327
|
+
]
|
|
4328
|
+
}
|
|
4329
|
+
}
|
|
4330
|
+
}
|
|
4331
|
+
],
|
|
4332
|
+
"searchable": true,
|
|
4333
|
+
"showCloseButton": true,
|
|
4334
|
+
"showErrorMsg": true,
|
|
4335
|
+
"showLoading": true,
|
|
4336
|
+
"size": "lg"
|
|
4337
|
+
},
|
|
4338
|
+
"actionType": "dialog"
|
|
4339
|
+
}
|
|
4340
|
+
]
|
|
4341
|
+
}
|
|
4342
|
+
}
|
|
4343
|
+
},
|
|
4344
|
+
{
|
|
4345
|
+
"type": "button",
|
|
4346
|
+
"label": "删除",
|
|
4347
|
+
"visibleOn": "(global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && ['all', 'recent', 'my'].indexOf(listName) == -1",
|
|
4348
|
+
"confirmText": "如果您删除此列表视图,该视图将为所有具备访问权限的用户永久删除。是否确定要删除?",
|
|
4349
|
+
"onEvent": {
|
|
4350
|
+
"click": {
|
|
4351
|
+
"actions": [
|
|
4352
|
+
{
|
|
4353
|
+
"actionType": "ajax",
|
|
4354
|
+
"args": {
|
|
4355
|
+
"api": {
|
|
4356
|
+
"url": "${context.rootUrl}/graphql",
|
|
4357
|
+
"method": "post",
|
|
4358
|
+
"headers": {
|
|
4359
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
4360
|
+
},
|
|
4361
|
+
"data": {
|
|
4362
|
+
"&": "$$",
|
|
4363
|
+
"uiSchema": "${uiSchema}",
|
|
4364
|
+
"recordId": "${uiSchema.list_views[listName]._id}"
|
|
4365
|
+
},
|
|
4366
|
+
"messages": {
|
|
4367
|
+
"success": "删除成功"
|
|
4368
|
+
},
|
|
4369
|
+
"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",
|
|
4370
|
+
"adaptor": "if (payload.errors) {\n payload.status = 2;\n payload.msg = payload.errors[0].message;\n}\nreturn payload;",
|
|
4371
|
+
}
|
|
4372
|
+
}
|
|
4373
|
+
},
|
|
4374
|
+
{
|
|
4375
|
+
"actionType": "url",
|
|
4376
|
+
"args": {
|
|
4377
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/all",
|
|
4378
|
+
"blank": false
|
|
4379
|
+
},
|
|
4380
|
+
"expression": "data.delete == 1"
|
|
4381
|
+
}
|
|
4382
|
+
]
|
|
4383
|
+
}
|
|
4384
|
+
}
|
|
4385
|
+
},
|
|
4386
|
+
{
|
|
4387
|
+
"type": "button",
|
|
4388
|
+
"visibleOn": "${false}",
|
|
4389
|
+
"label": "保存宽度(todo)"
|
|
4390
|
+
},
|
|
4391
|
+
// {
|
|
4392
|
+
// type: 'steedos-object-button',
|
|
4393
|
+
// name: 'standard_delete',
|
|
4394
|
+
// objectName: 'test0321__c',
|
|
4395
|
+
// // visibleOn: getButtonVisibleOn(button),
|
|
4396
|
+
// className: 'antd-Button--default'
|
|
4397
|
+
// }
|
|
4398
|
+
]
|
|
4399
|
+
}
|
|
4400
|
+
]
|
|
3950
4401
|
},
|
|
3951
|
-
showDisplayAs? getDisplayAsButton(showDisplayAs) : {}
|
|
4402
|
+
showDisplayAs ? getDisplayAsButton(showDisplayAs) : {}
|
|
3952
4403
|
// {
|
|
3953
4404
|
// "type": "search-box",
|
|
3954
4405
|
// "align": "right",
|
|
@@ -4231,6 +4682,7 @@ setTimeout(()=>{
|
|
|
4231
4682
|
const tree = [{
|
|
4232
4683
|
"type": "input-tree",
|
|
4233
4684
|
"className": "",
|
|
4685
|
+
"inputClassName": "pl-0",
|
|
4234
4686
|
"id": "u:7fd77b7915b0",
|
|
4235
4687
|
"source": {
|
|
4236
4688
|
"method": "post",
|
|
@@ -4300,10 +4752,10 @@ setTimeout(()=>{
|
|
|
4300
4752
|
"style": {
|
|
4301
4753
|
"max-height": "100%",
|
|
4302
4754
|
"position": "absolute",
|
|
4303
|
-
"left": "-
|
|
4755
|
+
"left": "-200px",
|
|
4304
4756
|
"width": "190px",
|
|
4305
4757
|
"bottom": 0,
|
|
4306
|
-
"top": "
|
|
4758
|
+
"top": "-14px",
|
|
4307
4759
|
"overflow": "auto",
|
|
4308
4760
|
"min-height":"300px"
|
|
4309
4761
|
},
|
|
@@ -6211,11 +6663,11 @@ setTimeout(()=>{
|
|
|
6211
6663
|
}
|
|
6212
6664
|
|
|
6213
6665
|
async function getObjectCRUD(objectSchema, fields, options){
|
|
6666
|
+
// console.time('getObjectCRUD');
|
|
6214
6667
|
const { top, perPage, showDisplayAs = false, displayAs, crudClassName = "" } = options;
|
|
6215
6668
|
const nonpaged = objectSchema.paging && objectSchema.paging.enabled === false;
|
|
6216
6669
|
const isTreeObject = objectSchema.enable_tree;
|
|
6217
6670
|
const bulkActions = getBulkActions(objectSchema);
|
|
6218
|
-
|
|
6219
6671
|
const bodyProps = {
|
|
6220
6672
|
// toolbar: getToolbar(),
|
|
6221
6673
|
// headerToolbar: getObjectHeaderToolbar(objectSchema, options.formFactor, {showDisplayAs}),
|
|
@@ -6244,11 +6696,12 @@ setTimeout(()=>{
|
|
|
6244
6696
|
options.queryCount = false;
|
|
6245
6697
|
}
|
|
6246
6698
|
}
|
|
6247
|
-
|
|
6699
|
+
// console.log(`getObjectHeaderToolbar====2===>`, options.filterVisible)
|
|
6248
6700
|
bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, options.formFactor, {
|
|
6249
6701
|
showDisplayAs,
|
|
6250
6702
|
hiddenCount: options.queryCount === false,
|
|
6251
|
-
headerToolbarItems: options.headerToolbarItems
|
|
6703
|
+
headerToolbarItems: options.headerToolbarItems,
|
|
6704
|
+
filterVisible: options.filterVisible
|
|
6252
6705
|
});
|
|
6253
6706
|
|
|
6254
6707
|
|
|
@@ -6323,7 +6776,7 @@ setTimeout(()=>{
|
|
|
6323
6776
|
body = wrappedBody;
|
|
6324
6777
|
}
|
|
6325
6778
|
}
|
|
6326
|
-
|
|
6779
|
+
// console.timeEnd('getObjectCRUD');
|
|
6327
6780
|
// TODO: data应该只留loaded,其他属性都改为从上层传递下来
|
|
6328
6781
|
return {
|
|
6329
6782
|
type: 'service',
|
|
@@ -6445,7 +6898,8 @@ setTimeout(()=>{
|
|
|
6445
6898
|
"eventName": "@data.changed.${_master.objectName}"
|
|
6446
6899
|
},
|
|
6447
6900
|
"data": {
|
|
6448
|
-
"objectName": "${_master.objectName}"
|
|
6901
|
+
"objectName": "${_master.objectName}",
|
|
6902
|
+
"_isRelated": "${_isRelated || _master._isRelated}"
|
|
6449
6903
|
},
|
|
6450
6904
|
"expression": `\${_master.objectName != '${objectSchema.name}' && _master.objectName}`
|
|
6451
6905
|
},
|
|
@@ -8209,8 +8663,8 @@ setTimeout(()=>{
|
|
|
8209
8663
|
/*
|
|
8210
8664
|
* @Author: baozhoutao@steedos.com
|
|
8211
8665
|
* @Date: 2022-07-05 15:55:39
|
|
8212
|
-
* @LastEditors:
|
|
8213
|
-
* @LastEditTime: 2023-04-
|
|
8666
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
8667
|
+
* @LastEditTime: 2023-04-12 14:24:09
|
|
8214
8668
|
* @Description:
|
|
8215
8669
|
*/
|
|
8216
8670
|
|
|
@@ -8510,7 +8964,8 @@ setTimeout(()=>{
|
|
|
8510
8964
|
"ctx": ctx,
|
|
8511
8965
|
"requestAdaptor": listView.requestAdaptor,
|
|
8512
8966
|
"adaptor": listView.adaptor,
|
|
8513
|
-
"headerToolbarItems": ctx.headerToolbarItems
|
|
8967
|
+
"headerToolbarItems": ctx.headerToolbarItems,
|
|
8968
|
+
"filterVisible": ctx.filterVisible
|
|
8514
8969
|
};
|
|
8515
8970
|
return {
|
|
8516
8971
|
uiSchema,
|
|
@@ -8525,6 +8980,7 @@ setTimeout(()=>{
|
|
|
8525
8980
|
columns,
|
|
8526
8981
|
ctx = {}
|
|
8527
8982
|
) {
|
|
8983
|
+
// console.time('getTableSchema');
|
|
8528
8984
|
const uiSchema = await getUISchema(objectName);
|
|
8529
8985
|
|
|
8530
8986
|
let sort = ctx.sort;
|
|
@@ -8575,6 +9031,7 @@ setTimeout(()=>{
|
|
|
8575
9031
|
buttons: await getListViewItemButtons(uiSchema, ctx)
|
|
8576
9032
|
});
|
|
8577
9033
|
// console.log('getTableSchema====>amisSchema', amisSchema)
|
|
9034
|
+
// console.timeEnd('getTableSchema');
|
|
8578
9035
|
return {
|
|
8579
9036
|
uiSchema,
|
|
8580
9037
|
amisSchema,
|
|
@@ -12028,6 +12485,28 @@ setTimeout(()=>{
|
|
|
12028
12485
|
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" }))));
|
|
12029
12486
|
};
|
|
12030
12487
|
|
|
12488
|
+
/*
|
|
12489
|
+
* @Author: baozhoutao@steedos.com
|
|
12490
|
+
* @Date: 2023-04-07 18:31:31
|
|
12491
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
12492
|
+
* @LastEditTime: 2023-04-12 14:25:02
|
|
12493
|
+
* @Description:
|
|
12494
|
+
*/
|
|
12495
|
+
var SteedosSkeleton = function (props) {
|
|
12496
|
+
var body = props.body, render = props.render, _a = props.bodyClassName, bodyClassName = _a === void 0 ? "" : _a, _b = props.config, config = _b === void 0 ? {} : _b;
|
|
12497
|
+
if (___default.isString(config)) {
|
|
12498
|
+
config = JSON.parse(config);
|
|
12499
|
+
}
|
|
12500
|
+
var active = config.active, avatar = config.avatar, loading = config.loading, paragraph = config.paragraph, round = config.round, title = config.title;
|
|
12501
|
+
loading = ___default.isBoolean(loading) ? loading : loading === 'true';
|
|
12502
|
+
// console.log("SteedosSkeleton====>", loading, config, typeof loading)
|
|
12503
|
+
return React__default["default"].createElement(React__default["default"].Fragment, null,
|
|
12504
|
+
React__default["default"].createElement(antd.Skeleton, { active: active, avatar: avatar, loading: loading, paragraph: paragraph, round: round, title: title }),
|
|
12505
|
+
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, {
|
|
12506
|
+
// 这里的信息会作为 props 传递给子组件,一般情况下都不需要这个
|
|
12507
|
+
}))) : null));
|
|
12508
|
+
};
|
|
12509
|
+
|
|
12031
12510
|
var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
12032
12511
|
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;
|
|
12033
12512
|
return __generator(this, function (_d) {
|
|
@@ -12085,6 +12564,9 @@ setTimeout(()=>{
|
|
|
12085
12564
|
// if(objectApiName){
|
|
12086
12565
|
// formData.objectName = objectApiName;
|
|
12087
12566
|
// }
|
|
12567
|
+
if (___default.has(props, "recordId") && $schema.recordId !== "${recordId}") {
|
|
12568
|
+
formData.recordId = props.recordId;
|
|
12569
|
+
}
|
|
12088
12570
|
amisSchema.className = "steedos-object-form ".concat(className);
|
|
12089
12571
|
amisSchema.data = Object.assign(amisSchema.data, formData, { global: globalData, uiSchema: uiSchema });
|
|
12090
12572
|
// console.log(`===AmisObjectForm=amisSchema==`, amisSchema)
|
|
@@ -12094,11 +12576,11 @@ setTimeout(()=>{
|
|
|
12094
12576
|
}); };
|
|
12095
12577
|
|
|
12096
12578
|
var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
12097
|
-
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;
|
|
12098
|
-
return __generator(this, function (
|
|
12099
|
-
switch (
|
|
12579
|
+
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;
|
|
12580
|
+
return __generator(this, function (_f) {
|
|
12581
|
+
switch (_f.label) {
|
|
12100
12582
|
case 0:
|
|
12101
|
-
$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;
|
|
12583
|
+
$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;
|
|
12102
12584
|
ctx = props.ctx;
|
|
12103
12585
|
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);
|
|
12104
12586
|
defaults = {};
|
|
@@ -12125,7 +12607,7 @@ setTimeout(()=>{
|
|
|
12125
12607
|
}
|
|
12126
12608
|
return [4 /*yield*/, getUISchema(objectApiName, false)];
|
|
12127
12609
|
case 1:
|
|
12128
|
-
objectUiSchema =
|
|
12610
|
+
objectUiSchema = _f.sent();
|
|
12129
12611
|
listView = ___default.find(objectUiSchema.list_views, function (listView, name) {
|
|
12130
12612
|
// 传入listViewName空值则取第一个
|
|
12131
12613
|
if (!listName) {
|
|
@@ -12157,11 +12639,11 @@ setTimeout(()=>{
|
|
|
12157
12639
|
"blank": false
|
|
12158
12640
|
},
|
|
12159
12641
|
"actionType": "link",
|
|
12160
|
-
"expression": "${!!!event.data.recordId && event.data.__deletedRecord != true}" //是新建, 则进入详细页面.
|
|
12642
|
+
"expression": "${!!!event.data.recordId && event.data.__deletedRecord != true && event.data._isRelated != true}" //是新建, 则进入详细页面.
|
|
12161
12643
|
},
|
|
12162
12644
|
{
|
|
12163
12645
|
"actionType": "reload",
|
|
12164
|
-
"expression": "${event.data.recordId || event.data.__deletedRecord === true}" //不是新建, 则刷新列表
|
|
12646
|
+
"expression": "${(event.data.recordId || event.data.__deletedRecord === true) && event.data._isRelated != true}" //不是新建, 则刷新列表
|
|
12165
12647
|
}
|
|
12166
12648
|
]
|
|
12167
12649
|
};
|
|
@@ -12179,9 +12661,9 @@ setTimeout(()=>{
|
|
|
12179
12661
|
}
|
|
12180
12662
|
amisSchemaData = Object.assign({}, data, defaultData);
|
|
12181
12663
|
listViewId = (ctx === null || ctx === void 0 ? void 0 : ctx.listViewId) || amisSchemaData.listViewId;
|
|
12182
|
-
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:
|
|
12664
|
+
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 }))];
|
|
12183
12665
|
case 2:
|
|
12184
|
-
schema = (
|
|
12666
|
+
schema = (_f.sent());
|
|
12185
12667
|
amisSchema = schema.amisSchema;
|
|
12186
12668
|
uiSchema = schema.uiSchema;
|
|
12187
12669
|
body = [amisSchema];
|
|
@@ -12202,19 +12684,20 @@ setTimeout(()=>{
|
|
|
12202
12684
|
{
|
|
12203
12685
|
"type": "wrapper",
|
|
12204
12686
|
"size": "none",
|
|
12205
|
-
"className": "flex-shrink-0 min-w-[200px]
|
|
12687
|
+
"className": "flex-shrink-0 min-w-[200px] h-full border-r border-gray-200 lg:order-first lg:flex lg:flex-col",
|
|
12206
12688
|
"body": sideSchema
|
|
12207
12689
|
},
|
|
12208
12690
|
{
|
|
12209
12691
|
"type": "wrapper",
|
|
12210
12692
|
"size": "none",
|
|
12211
|
-
"className": "flex-1
|
|
12693
|
+
"className": "flex-1 focus:outline-none lg:order-last w-96 h-full",
|
|
12212
12694
|
"body": body
|
|
12213
12695
|
},
|
|
12214
12696
|
]
|
|
12215
12697
|
}];
|
|
12216
12698
|
}
|
|
12217
12699
|
serviceData = Object.assign({}, { listName: listName, uiSchema: uiSchema, showDisplayAs: showDisplayAs, displayAs: displayAs, recordPermissions: uiSchema.permissions, _id: null, $listviewId: listName });
|
|
12700
|
+
// console.timeEnd('AmisObjectListView')
|
|
12218
12701
|
return [2 /*return*/, {
|
|
12219
12702
|
"type": "service",
|
|
12220
12703
|
"body": body,
|
|
@@ -12296,6 +12779,7 @@ setTimeout(()=>{
|
|
|
12296
12779
|
amisSchema.data = Object.assign({}, amisSchema.data, amisSchemaData);
|
|
12297
12780
|
amisSchema.className = "steedos-object-table h-full flex flex-col ".concat(className);
|
|
12298
12781
|
// console.log(`AmisObjectTable===>amisSchema`, amisSchema)
|
|
12782
|
+
// console.timeEnd('AmisObjectTable')
|
|
12299
12783
|
return [2 /*return*/, amisSchema];
|
|
12300
12784
|
}
|
|
12301
12785
|
});
|
|
@@ -13394,7 +13878,7 @@ setTimeout(()=>{
|
|
|
13394
13878
|
}); };
|
|
13395
13879
|
|
|
13396
13880
|
var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
13397
|
-
var defaultFormFactor, appId, objectApiName, listviewId, display, _a, $schema, listName, displayAs, formFactor, page, listViewId, listSchema, defData;
|
|
13881
|
+
var defaultFormFactor, appId, objectApiName, listviewId, display, _a, $schema, listName, displayAs, formFactor, page, listViewId, listSchema, defData, pageGridClassName, pageSplitClassName;
|
|
13398
13882
|
return __generator(this, function (_b) {
|
|
13399
13883
|
switch (_b.label) {
|
|
13400
13884
|
case 0:
|
|
@@ -13432,11 +13916,12 @@ setTimeout(()=>{
|
|
|
13432
13916
|
if (listName) {
|
|
13433
13917
|
defData.listName = listName || listviewId;
|
|
13434
13918
|
}
|
|
13435
|
-
|
|
13919
|
+
pageGridClassName = listSchema.pageGridClassName || 'h-full sm:p-3';
|
|
13920
|
+
pageSplitClassName = listSchema.pageSplitClassName || 'p-0 flex flex-1 overflow-hidden h-full';
|
|
13436
13921
|
return [2 /*return*/, {
|
|
13437
13922
|
type: 'service',
|
|
13438
13923
|
data: defData,
|
|
13439
|
-
"className": (displayAs === 'grid') ?
|
|
13924
|
+
"className": (displayAs === 'grid') ? pageGridClassName : pageSplitClassName,
|
|
13440
13925
|
body: (displayAs === 'grid') ? ___default.defaultsDeep({ data: defData }, listSchema) : [
|
|
13441
13926
|
{
|
|
13442
13927
|
"type": "wrapper",
|
|
@@ -13559,6 +14044,7 @@ setTimeout(()=>{
|
|
|
13559
14044
|
exports.SteedosIcon = SteedosIcon;
|
|
13560
14045
|
exports.SteedosLib = index_esm;
|
|
13561
14046
|
exports.SteedosLoading = SteedosLoading;
|
|
14047
|
+
exports.SteedosSkeleton = SteedosSkeleton;
|
|
13562
14048
|
|
|
13563
14049
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13564
14050
|
|