@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.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { useState, useEffect, createElement } from 'react';
|
|
2
2
|
import * as ___default from 'lodash';
|
|
3
3
|
import ___default__default, { isEmpty, isArray, each, find, endsWith, cloneDeep, includes, map, keys, sortBy, compact, toArray, mergeWith, isString, slice, defaultsDeep as defaultsDeep$1, isObject as isObject$1, filter, get, isBoolean, omitBy, isNil, has, startsWith, isFunction, difference, pick, pickBy, random, assign, isNumber } from 'lodash';
|
|
4
|
-
import { Dropdown, Tabs, Spin, Badge, Modal as Modal$1, message, notification, Button, Space, Drawer as Drawer$1 } from 'antd';
|
|
4
|
+
import { Dropdown, Tabs, Spin, Badge, Skeleton, Modal as Modal$1, message, notification, Button, Space, Drawer as Drawer$1 } from 'antd';
|
|
5
5
|
import ReactDOM, { createRoot } from 'react-dom';
|
|
6
6
|
|
|
7
7
|
/******************************************************************************
|
|
@@ -1944,8 +1944,8 @@ const getSchema$3 = async (uiSchema, ctx) => {
|
|
|
1944
1944
|
/*
|
|
1945
1945
|
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
1946
1946
|
* @Date: 2023-03-22 09:31:21
|
|
1947
|
-
* @LastEditors:
|
|
1948
|
-
* @LastEditTime: 2023-04-
|
|
1947
|
+
* @LastEditors: Please set LastEditors
|
|
1948
|
+
* @LastEditTime: 2023-04-12 10:35:36
|
|
1949
1949
|
*/
|
|
1950
1950
|
const getSchema$2 = (uiSchema)=>{
|
|
1951
1951
|
return {
|
|
@@ -2000,7 +2000,8 @@ const getSchema$2 = (uiSchema)=>{
|
|
|
2000
2000
|
"eventName": "@data.changed.${_master.objectName}"
|
|
2001
2001
|
},
|
|
2002
2002
|
"data": {
|
|
2003
|
-
"objectName": "${_master.objectName}"
|
|
2003
|
+
"objectName": "${_master.objectName}",
|
|
2004
|
+
"_isRelated": "${_isRelated}"
|
|
2004
2005
|
},
|
|
2005
2006
|
"expression": `\${_master.objectName != '${uiSchema.name}' && _master.objectName}`
|
|
2006
2007
|
}
|
|
@@ -3716,6 +3717,9 @@ const getDisplayAsButton = function(objectName, showDisplayAs){
|
|
|
3716
3717
|
};
|
|
3717
3718
|
};
|
|
3718
3719
|
|
|
3720
|
+
|
|
3721
|
+
|
|
3722
|
+
|
|
3719
3723
|
const onFieldsFilterToggleScript = `
|
|
3720
3724
|
const scope = event.context.scoped;
|
|
3721
3725
|
const filterForm = scope.getComponents().find(function(n){
|
|
@@ -3733,7 +3737,6 @@ setTimeout(()=>{
|
|
|
3733
3737
|
|
|
3734
3738
|
function getExportApiRequestAdaptorScript(){
|
|
3735
3739
|
return `
|
|
3736
|
-
console.log(api.url);
|
|
3737
3740
|
// 获取列表视图的属性
|
|
3738
3741
|
let uiSchema = api.body.uiSchema;
|
|
3739
3742
|
let list_views = uiSchema.list_views;
|
|
@@ -3782,12 +3785,12 @@ function getExportApiRequestAdaptorScript(){
|
|
|
3782
3785
|
if (filters && filters.length > 0) {
|
|
3783
3786
|
api.url = api.url + "&filters=" + JSON.stringify(filters);
|
|
3784
3787
|
}
|
|
3785
|
-
console.log(api.url);
|
|
3786
3788
|
return api;
|
|
3787
3789
|
`
|
|
3788
3790
|
}
|
|
3789
3791
|
|
|
3790
|
-
function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems} = {}){
|
|
3792
|
+
function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true} = {}){
|
|
3793
|
+
// console.log(`getObjectHeaderToolbar====>`, filterVisible)
|
|
3791
3794
|
const isMobile = window.innerWidth < 768;
|
|
3792
3795
|
if(isMobile){
|
|
3793
3796
|
showDisplayAs = false;
|
|
@@ -3824,7 +3827,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3824
3827
|
}
|
|
3825
3828
|
},
|
|
3826
3829
|
},
|
|
3827
|
-
{
|
|
3830
|
+
filterVisible ? {
|
|
3828
3831
|
"label": "",
|
|
3829
3832
|
"icon": "fa fa-search",
|
|
3830
3833
|
"type": "button",
|
|
@@ -3840,7 +3843,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3840
3843
|
]
|
|
3841
3844
|
}
|
|
3842
3845
|
}
|
|
3843
|
-
},
|
|
3846
|
+
} : {},
|
|
3844
3847
|
showDisplayAs? getDisplayAsButton(mainObject?.name) : {}
|
|
3845
3848
|
]
|
|
3846
3849
|
}else {
|
|
@@ -3856,10 +3859,6 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3856
3859
|
// "type": "columns-toggler",
|
|
3857
3860
|
// "className": "mr-2"
|
|
3858
3861
|
// },
|
|
3859
|
-
// {
|
|
3860
|
-
// "type": "export-excel",
|
|
3861
|
-
// "align": "right"
|
|
3862
|
-
// },
|
|
3863
3862
|
hiddenCount ? {} : {
|
|
3864
3863
|
"type": "tpl",
|
|
3865
3864
|
"tpl": "${count} 个项目"
|
|
@@ -3905,7 +3904,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3905
3904
|
}
|
|
3906
3905
|
}
|
|
3907
3906
|
},
|
|
3908
|
-
{
|
|
3907
|
+
filterVisible ? {
|
|
3909
3908
|
"label": "",
|
|
3910
3909
|
"icon": "fa fa-search",
|
|
3911
3910
|
"type": "button",
|
|
@@ -3921,8 +3920,460 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
3921
3920
|
]
|
|
3922
3921
|
}
|
|
3923
3922
|
}
|
|
3923
|
+
} : {},
|
|
3924
|
+
{
|
|
3925
|
+
"type": "dropdown-button",
|
|
3926
|
+
"trigger": "click",
|
|
3927
|
+
"icon": "fa fa-cog",
|
|
3928
|
+
"btnClassName": "antd-Button--iconOnly bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
3929
|
+
"align": "right",
|
|
3930
|
+
"visibleOn": "${!isLookup}",
|
|
3931
|
+
"buttons": [
|
|
3932
|
+
{
|
|
3933
|
+
"label": "列表视图操作",
|
|
3934
|
+
"children": [
|
|
3935
|
+
{
|
|
3936
|
+
"type": "button",
|
|
3937
|
+
"label": "新建",
|
|
3938
|
+
"onEvent": {
|
|
3939
|
+
"click": {
|
|
3940
|
+
"weight": 0,
|
|
3941
|
+
"actions": [
|
|
3942
|
+
{
|
|
3943
|
+
"dialog": {
|
|
3944
|
+
"type": "dialog",
|
|
3945
|
+
"title": "新建 列表视图",
|
|
3946
|
+
"data": {
|
|
3947
|
+
"&": "$$",
|
|
3948
|
+
"all": "${uiSchema.list_views.all}",
|
|
3949
|
+
"list_view": "${uiSchema.list_views[listName]}",
|
|
3950
|
+
"appId": "${appId}",
|
|
3951
|
+
"global": "${global}",
|
|
3952
|
+
"objectName": "${objectName}",
|
|
3953
|
+
},
|
|
3954
|
+
"body": [
|
|
3955
|
+
{
|
|
3956
|
+
"type": "steedos-object-form",
|
|
3957
|
+
"label": "对象表单",
|
|
3958
|
+
"objectApiName": "object_listviews",
|
|
3959
|
+
"recordId": "",
|
|
3960
|
+
"mode": "edit",
|
|
3961
|
+
"defaultData": {
|
|
3962
|
+
"&": "${list_view}",
|
|
3963
|
+
"name":"",
|
|
3964
|
+
"label":"",
|
|
3965
|
+
"filters":"",
|
|
3966
|
+
"shared":false
|
|
3967
|
+
},
|
|
3968
|
+
"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}",
|
|
3969
|
+
"fields": [
|
|
3970
|
+
"label",
|
|
3971
|
+
"name",
|
|
3972
|
+
"object_name",
|
|
3973
|
+
"filter_scope",
|
|
3974
|
+
"show_count",
|
|
3975
|
+
"columns.$.field",
|
|
3976
|
+
"columns.$.width",
|
|
3977
|
+
"sort.$.field_name",
|
|
3978
|
+
"sort.$.order",
|
|
3979
|
+
"filters",
|
|
3980
|
+
"mobile_columns.$.field",
|
|
3981
|
+
"searchable_fields.$.field",
|
|
3982
|
+
"is_system",
|
|
3983
|
+
"shared"
|
|
3984
|
+
],
|
|
3985
|
+
"onEvent": {
|
|
3986
|
+
"submitSucc": {
|
|
3987
|
+
"weight": 0,
|
|
3988
|
+
"actions": [
|
|
3989
|
+
{
|
|
3990
|
+
"args": {
|
|
3991
|
+
// 直接使用recordId不能拿到数据,只能通过result里面拿数据
|
|
3992
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/listview_${result.data.recordId|lowerCase}",
|
|
3993
|
+
"blank": false
|
|
3994
|
+
},
|
|
3995
|
+
"actionType": "url",
|
|
3996
|
+
}
|
|
3997
|
+
]
|
|
3998
|
+
}
|
|
3999
|
+
},
|
|
4000
|
+
"messages": {
|
|
4001
|
+
"success": "成功",
|
|
4002
|
+
"failed": "失败"
|
|
4003
|
+
},
|
|
4004
|
+
}
|
|
4005
|
+
],
|
|
4006
|
+
"showCloseButton": true,
|
|
4007
|
+
"showErrorMsg": true,
|
|
4008
|
+
"showLoading": true,
|
|
4009
|
+
"closeOnEsc": false,
|
|
4010
|
+
"dataMapSwitch": false,
|
|
4011
|
+
"size": "lg"
|
|
4012
|
+
},
|
|
4013
|
+
"actionType": "dialog"
|
|
4014
|
+
}
|
|
4015
|
+
]
|
|
4016
|
+
}
|
|
4017
|
+
}
|
|
4018
|
+
},
|
|
4019
|
+
{
|
|
4020
|
+
"type": "button",
|
|
4021
|
+
"label": "复制",
|
|
4022
|
+
"onEvent": {
|
|
4023
|
+
"click": {
|
|
4024
|
+
"weight": 0,
|
|
4025
|
+
"actions": [
|
|
4026
|
+
{
|
|
4027
|
+
"dialog": {
|
|
4028
|
+
"type": "dialog",
|
|
4029
|
+
"title": "复制 列表视图",
|
|
4030
|
+
"data": {
|
|
4031
|
+
"&": "$$",
|
|
4032
|
+
"listName": "${listName}",
|
|
4033
|
+
"objectName": "${objectName}",
|
|
4034
|
+
"list_view": "${uiSchema.list_views[listName]}",
|
|
4035
|
+
"appId": "${appId}",
|
|
4036
|
+
"global": "${global}"
|
|
4037
|
+
},
|
|
4038
|
+
"body": [
|
|
4039
|
+
{
|
|
4040
|
+
"type": "steedos-object-form",
|
|
4041
|
+
"label": "对象表单",
|
|
4042
|
+
"objectApiName": "object_listviews",
|
|
4043
|
+
"recordId": "",
|
|
4044
|
+
"mode": "edit",
|
|
4045
|
+
"fields": [
|
|
4046
|
+
],
|
|
4047
|
+
"defaultData": {
|
|
4048
|
+
"&": "${list_view}",
|
|
4049
|
+
"name":"",
|
|
4050
|
+
"label": "${list_view.label}的副本",
|
|
4051
|
+
"shared":false
|
|
4052
|
+
},
|
|
4053
|
+
"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}",
|
|
4054
|
+
"fields": [
|
|
4055
|
+
"label",
|
|
4056
|
+
"name",
|
|
4057
|
+
"object_name",
|
|
4058
|
+
"filter_scope",
|
|
4059
|
+
"show_count",
|
|
4060
|
+
"columns.$.field",
|
|
4061
|
+
"columns.$.width",
|
|
4062
|
+
"sort.$.field_name",
|
|
4063
|
+
"sort.$.order",
|
|
4064
|
+
"filters",
|
|
4065
|
+
"mobile_columns.$.field",
|
|
4066
|
+
"searchable_fields.$.field",
|
|
4067
|
+
"is_system",
|
|
4068
|
+
"shared"
|
|
4069
|
+
],
|
|
4070
|
+
"onEvent": {
|
|
4071
|
+
"submitSucc": {
|
|
4072
|
+
"weight": 0,
|
|
4073
|
+
"actions": [
|
|
4074
|
+
{
|
|
4075
|
+
"args": {
|
|
4076
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/listview_${result.data.recordId|lowerCase}",
|
|
4077
|
+
"blank": false
|
|
4078
|
+
},
|
|
4079
|
+
"actionType": "url",
|
|
4080
|
+
}
|
|
4081
|
+
]
|
|
4082
|
+
}
|
|
4083
|
+
}
|
|
4084
|
+
}
|
|
4085
|
+
],
|
|
4086
|
+
"showCloseButton": true,
|
|
4087
|
+
"showErrorMsg": true,
|
|
4088
|
+
"showLoading": true,
|
|
4089
|
+
"closeOnEsc": false,
|
|
4090
|
+
"dataMapSwitch": false,
|
|
4091
|
+
"size": "lg"
|
|
4092
|
+
},
|
|
4093
|
+
"actionType": "dialog"
|
|
4094
|
+
}
|
|
4095
|
+
]
|
|
4096
|
+
}
|
|
4097
|
+
}
|
|
4098
|
+
},
|
|
4099
|
+
{
|
|
4100
|
+
"type": "button",
|
|
4101
|
+
"label": "重命名",
|
|
4102
|
+
"visibleOn": "(global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && ['all', 'recent', 'my'].indexOf(listName) == -1",
|
|
4103
|
+
"onEvent": {
|
|
4104
|
+
"click": {
|
|
4105
|
+
"weight": 0,
|
|
4106
|
+
"actions": [
|
|
4107
|
+
{
|
|
4108
|
+
"dialog": {
|
|
4109
|
+
"type": "dialog",
|
|
4110
|
+
"title": "重命名 列表视图",
|
|
4111
|
+
"data": {
|
|
4112
|
+
"objectName": "${objectName}",
|
|
4113
|
+
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4114
|
+
"appId": "${appId}"
|
|
4115
|
+
},
|
|
4116
|
+
"body": [
|
|
4117
|
+
{
|
|
4118
|
+
"type": "steedos-object-form",
|
|
4119
|
+
"label": "对象表单",
|
|
4120
|
+
"objectApiName": "object_listviews",
|
|
4121
|
+
"recordId": "${recordId}",
|
|
4122
|
+
"mode": "edit",
|
|
4123
|
+
"fields": [
|
|
4124
|
+
"label"
|
|
4125
|
+
],
|
|
4126
|
+
"fieldsExtend": "{\n \"label\":{\n \"is_wide\": true\n }\n}",
|
|
4127
|
+
"onEvent": {
|
|
4128
|
+
"submitSucc": {
|
|
4129
|
+
"weight": 0,
|
|
4130
|
+
"actions": [
|
|
4131
|
+
{
|
|
4132
|
+
"args": {
|
|
4133
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/${name}",
|
|
4134
|
+
"blank": false
|
|
4135
|
+
},
|
|
4136
|
+
"actionType": "url",
|
|
4137
|
+
},
|
|
4138
|
+
]
|
|
4139
|
+
}
|
|
4140
|
+
}
|
|
4141
|
+
}
|
|
4142
|
+
],
|
|
4143
|
+
"showCloseButton": true,
|
|
4144
|
+
"showErrorMsg": true,
|
|
4145
|
+
"showLoading": true,
|
|
4146
|
+
"size": "lg"
|
|
4147
|
+
},
|
|
4148
|
+
"actionType": "dialog"
|
|
4149
|
+
}
|
|
4150
|
+
]
|
|
4151
|
+
}
|
|
4152
|
+
}
|
|
4153
|
+
},
|
|
4154
|
+
{
|
|
4155
|
+
"type": "button",
|
|
4156
|
+
"label": "共享设置",
|
|
4157
|
+
"visibleOn": "global.user.is_space_admin && ['all', 'recent', 'my'].indexOf(listName) == -1",
|
|
4158
|
+
"onEvent": {
|
|
4159
|
+
"click": {
|
|
4160
|
+
"weight": 0,
|
|
4161
|
+
"actions": [
|
|
4162
|
+
{
|
|
4163
|
+
"dialog": {
|
|
4164
|
+
"type": "dialog",
|
|
4165
|
+
"title": "共享设置",
|
|
4166
|
+
"data": {
|
|
4167
|
+
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4168
|
+
},
|
|
4169
|
+
"body": [
|
|
4170
|
+
{
|
|
4171
|
+
"type": "steedos-object-form",
|
|
4172
|
+
"label": "对象表单",
|
|
4173
|
+
"objectApiName": "object_listviews",
|
|
4174
|
+
"recordId": "${recordId}",
|
|
4175
|
+
"mode": "edit",
|
|
4176
|
+
"fields": [
|
|
4177
|
+
"shared"
|
|
4178
|
+
]
|
|
4179
|
+
}
|
|
4180
|
+
],
|
|
4181
|
+
"showCloseButton": true,
|
|
4182
|
+
"showErrorMsg": true,
|
|
4183
|
+
"showLoading": true,
|
|
4184
|
+
"closeOnEsc": false,
|
|
4185
|
+
"dataMapSwitch": false,
|
|
4186
|
+
"size": "md"
|
|
4187
|
+
},
|
|
4188
|
+
"actionType": "dialog"
|
|
4189
|
+
}
|
|
4190
|
+
]
|
|
4191
|
+
}
|
|
4192
|
+
}
|
|
4193
|
+
},
|
|
4194
|
+
{
|
|
4195
|
+
"type": "button",
|
|
4196
|
+
"label": "过滤设置",
|
|
4197
|
+
"visibleOn": "(global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && ['all', 'recent', 'my'].indexOf(listName) == -1",
|
|
4198
|
+
"onEvent": {
|
|
4199
|
+
"click": {
|
|
4200
|
+
"weight": 0,
|
|
4201
|
+
"actions": [
|
|
4202
|
+
{
|
|
4203
|
+
"dialog": {
|
|
4204
|
+
"type": "dialog",
|
|
4205
|
+
"title": "过滤设置",
|
|
4206
|
+
"data": {
|
|
4207
|
+
"objectName": "${objectName}",
|
|
4208
|
+
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4209
|
+
"listName": "${listName}",
|
|
4210
|
+
"appId": "${appId}"
|
|
4211
|
+
},
|
|
4212
|
+
"body": [
|
|
4213
|
+
{
|
|
4214
|
+
"type": "steedos-object-form",
|
|
4215
|
+
"label": "对象表单",
|
|
4216
|
+
"objectApiName": "object_listviews",
|
|
4217
|
+
"recordId": "${recordId}",
|
|
4218
|
+
"mode": "edit",
|
|
4219
|
+
"initApiAdaptor": "",
|
|
4220
|
+
"fields": [
|
|
4221
|
+
"filters"
|
|
4222
|
+
],
|
|
4223
|
+
"initApiRequestAdaptor": "",
|
|
4224
|
+
"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;",
|
|
4225
|
+
"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",
|
|
4226
|
+
"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}",
|
|
4227
|
+
"onEvent": {
|
|
4228
|
+
"submitSucc": {
|
|
4229
|
+
"weight": 0,
|
|
4230
|
+
"actions": [
|
|
4231
|
+
{
|
|
4232
|
+
"args": {
|
|
4233
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/${listName}",
|
|
4234
|
+
"blank": false
|
|
4235
|
+
},
|
|
4236
|
+
"actionType": "url",
|
|
4237
|
+
}
|
|
4238
|
+
]
|
|
4239
|
+
}
|
|
4240
|
+
}
|
|
4241
|
+
}
|
|
4242
|
+
],
|
|
4243
|
+
"showCloseButton": true,
|
|
4244
|
+
"showErrorMsg": true,
|
|
4245
|
+
"showLoading": true,
|
|
4246
|
+
"closeOnEsc": false,
|
|
4247
|
+
"dataMapSwitch": false,
|
|
4248
|
+
"size": "lg"
|
|
4249
|
+
},
|
|
4250
|
+
"actionType": "dialog"
|
|
4251
|
+
}
|
|
4252
|
+
]
|
|
4253
|
+
}
|
|
4254
|
+
}
|
|
4255
|
+
},
|
|
4256
|
+
{
|
|
4257
|
+
"type": "button",
|
|
4258
|
+
"label": "显示的列",
|
|
4259
|
+
"visibleOn": "(global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && ['all', 'recent', 'my'].indexOf(listName) == -1",
|
|
4260
|
+
"onEvent": {
|
|
4261
|
+
"click": {
|
|
4262
|
+
"weight": 0,
|
|
4263
|
+
"actions": [
|
|
4264
|
+
{
|
|
4265
|
+
"args": {},
|
|
4266
|
+
"dialog": {
|
|
4267
|
+
"type": "dialog",
|
|
4268
|
+
"title": "显示的列",
|
|
4269
|
+
"data": {
|
|
4270
|
+
"&": "$$",
|
|
4271
|
+
"objectName": "${objectName}",
|
|
4272
|
+
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4273
|
+
"listName": "${listName}",
|
|
4274
|
+
"appId": "${appId}"
|
|
4275
|
+
},
|
|
4276
|
+
"body": [
|
|
4277
|
+
{
|
|
4278
|
+
"type": "steedos-object-form",
|
|
4279
|
+
"label": "对象表单",
|
|
4280
|
+
"objectApiName": "object_listviews",
|
|
4281
|
+
"recordId": "${recordId}",
|
|
4282
|
+
"mode": "edit",
|
|
4283
|
+
"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}",
|
|
4284
|
+
"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;",
|
|
4285
|
+
"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;",
|
|
4286
|
+
"fields": [
|
|
4287
|
+
"columns",
|
|
4288
|
+
"mobile_columns"
|
|
4289
|
+
],
|
|
4290
|
+
"onEvent": {
|
|
4291
|
+
"submitSucc": {
|
|
4292
|
+
"weight": 0,
|
|
4293
|
+
"actions": [
|
|
4294
|
+
{
|
|
4295
|
+
"args": {
|
|
4296
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/${listName}",
|
|
4297
|
+
"blank": false
|
|
4298
|
+
},
|
|
4299
|
+
"actionType": "url"
|
|
4300
|
+
}
|
|
4301
|
+
]
|
|
4302
|
+
}
|
|
4303
|
+
}
|
|
4304
|
+
}
|
|
4305
|
+
],
|
|
4306
|
+
"searchable": true,
|
|
4307
|
+
"showCloseButton": true,
|
|
4308
|
+
"showErrorMsg": true,
|
|
4309
|
+
"showLoading": true,
|
|
4310
|
+
"size": "lg"
|
|
4311
|
+
},
|
|
4312
|
+
"actionType": "dialog"
|
|
4313
|
+
}
|
|
4314
|
+
]
|
|
4315
|
+
}
|
|
4316
|
+
}
|
|
4317
|
+
},
|
|
4318
|
+
{
|
|
4319
|
+
"type": "button",
|
|
4320
|
+
"label": "删除",
|
|
4321
|
+
"visibleOn": "(global.user.is_space_admin || global.userId == uiSchema.list_views[listName].owner) && ['all', 'recent', 'my'].indexOf(listName) == -1",
|
|
4322
|
+
"confirmText": "如果您删除此列表视图,该视图将为所有具备访问权限的用户永久删除。是否确定要删除?",
|
|
4323
|
+
"onEvent": {
|
|
4324
|
+
"click": {
|
|
4325
|
+
"actions": [
|
|
4326
|
+
{
|
|
4327
|
+
"actionType": "ajax",
|
|
4328
|
+
"args": {
|
|
4329
|
+
"api": {
|
|
4330
|
+
"url": "${context.rootUrl}/graphql",
|
|
4331
|
+
"method": "post",
|
|
4332
|
+
"headers": {
|
|
4333
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
4334
|
+
},
|
|
4335
|
+
"data": {
|
|
4336
|
+
"&": "$$",
|
|
4337
|
+
"uiSchema": "${uiSchema}",
|
|
4338
|
+
"recordId": "${uiSchema.list_views[listName]._id}"
|
|
4339
|
+
},
|
|
4340
|
+
"messages": {
|
|
4341
|
+
"success": "删除成功"
|
|
4342
|
+
},
|
|
4343
|
+
"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",
|
|
4344
|
+
"adaptor": "if (payload.errors) {\n payload.status = 2;\n payload.msg = payload.errors[0].message;\n}\nreturn payload;",
|
|
4345
|
+
}
|
|
4346
|
+
}
|
|
4347
|
+
},
|
|
4348
|
+
{
|
|
4349
|
+
"actionType": "url",
|
|
4350
|
+
"args": {
|
|
4351
|
+
"url": "${context.rootUrl}/app/${appId}/${objectName}/grid/all",
|
|
4352
|
+
"blank": false
|
|
4353
|
+
},
|
|
4354
|
+
"expression": "data.delete == 1"
|
|
4355
|
+
}
|
|
4356
|
+
]
|
|
4357
|
+
}
|
|
4358
|
+
}
|
|
4359
|
+
},
|
|
4360
|
+
{
|
|
4361
|
+
"type": "button",
|
|
4362
|
+
"visibleOn": "${false}",
|
|
4363
|
+
"label": "保存宽度(todo)"
|
|
4364
|
+
},
|
|
4365
|
+
// {
|
|
4366
|
+
// type: 'steedos-object-button',
|
|
4367
|
+
// name: 'standard_delete',
|
|
4368
|
+
// objectName: 'test0321__c',
|
|
4369
|
+
// // visibleOn: getButtonVisibleOn(button),
|
|
4370
|
+
// className: 'antd-Button--default'
|
|
4371
|
+
// }
|
|
4372
|
+
]
|
|
4373
|
+
}
|
|
4374
|
+
]
|
|
3924
4375
|
},
|
|
3925
|
-
showDisplayAs? getDisplayAsButton(showDisplayAs) : {}
|
|
4376
|
+
showDisplayAs ? getDisplayAsButton(showDisplayAs) : {}
|
|
3926
4377
|
// {
|
|
3927
4378
|
// "type": "search-box",
|
|
3928
4379
|
// "align": "right",
|
|
@@ -4205,6 +4656,7 @@ function getLookupSapceUserTreeSchema(){
|
|
|
4205
4656
|
const tree = [{
|
|
4206
4657
|
"type": "input-tree",
|
|
4207
4658
|
"className": "",
|
|
4659
|
+
"inputClassName": "pl-0",
|
|
4208
4660
|
"id": "u:7fd77b7915b0",
|
|
4209
4661
|
"source": {
|
|
4210
4662
|
"method": "post",
|
|
@@ -4274,10 +4726,10 @@ function getLookupSapceUserTreeSchema(){
|
|
|
4274
4726
|
"style": {
|
|
4275
4727
|
"max-height": "100%",
|
|
4276
4728
|
"position": "absolute",
|
|
4277
|
-
"left": "-
|
|
4729
|
+
"left": "-200px",
|
|
4278
4730
|
"width": "190px",
|
|
4279
4731
|
"bottom": 0,
|
|
4280
|
-
"top": "
|
|
4732
|
+
"top": "-14px",
|
|
4281
4733
|
"overflow": "auto",
|
|
4282
4734
|
"min-height":"300px"
|
|
4283
4735
|
},
|
|
@@ -6185,11 +6637,11 @@ function getBulkActions(objectSchema){
|
|
|
6185
6637
|
}
|
|
6186
6638
|
|
|
6187
6639
|
async function getObjectCRUD(objectSchema, fields, options){
|
|
6640
|
+
// console.time('getObjectCRUD');
|
|
6188
6641
|
const { top, perPage, showDisplayAs = false, displayAs, crudClassName = "" } = options;
|
|
6189
6642
|
const nonpaged = objectSchema.paging && objectSchema.paging.enabled === false;
|
|
6190
6643
|
const isTreeObject = objectSchema.enable_tree;
|
|
6191
6644
|
const bulkActions = getBulkActions(objectSchema);
|
|
6192
|
-
|
|
6193
6645
|
const bodyProps = {
|
|
6194
6646
|
// toolbar: getToolbar(),
|
|
6195
6647
|
// headerToolbar: getObjectHeaderToolbar(objectSchema, options.formFactor, {showDisplayAs}),
|
|
@@ -6218,11 +6670,12 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
6218
6670
|
options.queryCount = false;
|
|
6219
6671
|
}
|
|
6220
6672
|
}
|
|
6221
|
-
|
|
6673
|
+
// console.log(`getObjectHeaderToolbar====2===>`, options.filterVisible)
|
|
6222
6674
|
bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, options.formFactor, {
|
|
6223
6675
|
showDisplayAs,
|
|
6224
6676
|
hiddenCount: options.queryCount === false,
|
|
6225
|
-
headerToolbarItems: options.headerToolbarItems
|
|
6677
|
+
headerToolbarItems: options.headerToolbarItems,
|
|
6678
|
+
filterVisible: options.filterVisible
|
|
6226
6679
|
});
|
|
6227
6680
|
|
|
6228
6681
|
|
|
@@ -6297,7 +6750,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
6297
6750
|
body = wrappedBody;
|
|
6298
6751
|
}
|
|
6299
6752
|
}
|
|
6300
|
-
|
|
6753
|
+
// console.timeEnd('getObjectCRUD');
|
|
6301
6754
|
// TODO: data应该只留loaded,其他属性都改为从上层传递下来
|
|
6302
6755
|
return {
|
|
6303
6756
|
type: 'service',
|
|
@@ -6419,7 +6872,8 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
6419
6872
|
"eventName": "@data.changed.${_master.objectName}"
|
|
6420
6873
|
},
|
|
6421
6874
|
"data": {
|
|
6422
|
-
"objectName": "${_master.objectName}"
|
|
6875
|
+
"objectName": "${_master.objectName}",
|
|
6876
|
+
"_isRelated": "${_isRelated || _master._isRelated}"
|
|
6423
6877
|
},
|
|
6424
6878
|
"expression": `\${_master.objectName != '${objectSchema.name}' && _master.objectName}`
|
|
6425
6879
|
},
|
|
@@ -8183,8 +8637,8 @@ async function getRelatedListSchema(
|
|
|
8183
8637
|
/*
|
|
8184
8638
|
* @Author: baozhoutao@steedos.com
|
|
8185
8639
|
* @Date: 2022-07-05 15:55:39
|
|
8186
|
-
* @LastEditors:
|
|
8187
|
-
* @LastEditTime: 2023-04-
|
|
8640
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
8641
|
+
* @LastEditTime: 2023-04-12 14:24:09
|
|
8188
8642
|
* @Description:
|
|
8189
8643
|
*/
|
|
8190
8644
|
|
|
@@ -8484,7 +8938,8 @@ async function getListSchema(
|
|
|
8484
8938
|
"ctx": ctx,
|
|
8485
8939
|
"requestAdaptor": listView.requestAdaptor,
|
|
8486
8940
|
"adaptor": listView.adaptor,
|
|
8487
|
-
"headerToolbarItems": ctx.headerToolbarItems
|
|
8941
|
+
"headerToolbarItems": ctx.headerToolbarItems,
|
|
8942
|
+
"filterVisible": ctx.filterVisible
|
|
8488
8943
|
};
|
|
8489
8944
|
return {
|
|
8490
8945
|
uiSchema,
|
|
@@ -8499,6 +8954,7 @@ async function getTableSchema(
|
|
|
8499
8954
|
columns,
|
|
8500
8955
|
ctx = {}
|
|
8501
8956
|
) {
|
|
8957
|
+
// console.time('getTableSchema');
|
|
8502
8958
|
const uiSchema = await getUISchema(objectName);
|
|
8503
8959
|
|
|
8504
8960
|
let sort = ctx.sort;
|
|
@@ -8549,6 +9005,7 @@ async function getTableSchema(
|
|
|
8549
9005
|
buttons: await getListViewItemButtons(uiSchema, ctx)
|
|
8550
9006
|
});
|
|
8551
9007
|
// console.log('getTableSchema====>amisSchema', amisSchema)
|
|
9008
|
+
// console.timeEnd('getTableSchema');
|
|
8552
9009
|
return {
|
|
8553
9010
|
uiSchema,
|
|
8554
9011
|
amisSchema,
|
|
@@ -12002,6 +12459,28 @@ var SteedosLoading = function (props) {
|
|
|
12002
12459
|
React.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" }))));
|
|
12003
12460
|
};
|
|
12004
12461
|
|
|
12462
|
+
/*
|
|
12463
|
+
* @Author: baozhoutao@steedos.com
|
|
12464
|
+
* @Date: 2023-04-07 18:31:31
|
|
12465
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
12466
|
+
* @LastEditTime: 2023-04-12 14:25:02
|
|
12467
|
+
* @Description:
|
|
12468
|
+
*/
|
|
12469
|
+
var SteedosSkeleton = function (props) {
|
|
12470
|
+
var body = props.body, render = props.render, _a = props.bodyClassName, bodyClassName = _a === void 0 ? "" : _a, _b = props.config, config = _b === void 0 ? {} : _b;
|
|
12471
|
+
if (isString(config)) {
|
|
12472
|
+
config = JSON.parse(config);
|
|
12473
|
+
}
|
|
12474
|
+
var active = config.active, avatar = config.avatar, loading = config.loading, paragraph = config.paragraph, round = config.round, title = config.title;
|
|
12475
|
+
loading = isBoolean(loading) ? loading : loading === 'true';
|
|
12476
|
+
// console.log("SteedosSkeleton====>", loading, config, typeof loading)
|
|
12477
|
+
return React.createElement(React.Fragment, null,
|
|
12478
|
+
React.createElement(Skeleton, { active: active, avatar: avatar, loading: loading, paragraph: paragraph, round: round, title: title }),
|
|
12479
|
+
React.createElement("div", { className: loading ? 'hidden w-full h-full' : 'w-full h-full' }, body ? (React.createElement("div", { className: "steedos-skeleton-body ".concat(bodyClassName) }, render('body', body, {
|
|
12480
|
+
// 这里的信息会作为 props 传递给子组件,一般情况下都不需要这个
|
|
12481
|
+
}))) : null));
|
|
12482
|
+
};
|
|
12483
|
+
|
|
12005
12484
|
var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
12006
12485
|
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;
|
|
12007
12486
|
return __generator(this, function (_d) {
|
|
@@ -12059,6 +12538,9 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
12059
12538
|
// if(objectApiName){
|
|
12060
12539
|
// formData.objectName = objectApiName;
|
|
12061
12540
|
// }
|
|
12541
|
+
if (has(props, "recordId") && $schema.recordId !== "${recordId}") {
|
|
12542
|
+
formData.recordId = props.recordId;
|
|
12543
|
+
}
|
|
12062
12544
|
amisSchema.className = "steedos-object-form ".concat(className);
|
|
12063
12545
|
amisSchema.data = Object.assign(amisSchema.data, formData, { global: globalData, uiSchema: uiSchema });
|
|
12064
12546
|
// console.log(`===AmisObjectForm=amisSchema==`, amisSchema)
|
|
@@ -12068,11 +12550,11 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
12068
12550
|
}); };
|
|
12069
12551
|
|
|
12070
12552
|
var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
12071
|
-
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;
|
|
12072
|
-
return __generator(this, function (
|
|
12073
|
-
switch (
|
|
12553
|
+
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;
|
|
12554
|
+
return __generator(this, function (_f) {
|
|
12555
|
+
switch (_f.label) {
|
|
12074
12556
|
case 0:
|
|
12075
|
-
$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;
|
|
12557
|
+
$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;
|
|
12076
12558
|
ctx = props.ctx;
|
|
12077
12559
|
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);
|
|
12078
12560
|
defaults = {};
|
|
@@ -12099,7 +12581,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
12099
12581
|
}
|
|
12100
12582
|
return [4 /*yield*/, getUISchema(objectApiName, false)];
|
|
12101
12583
|
case 1:
|
|
12102
|
-
objectUiSchema =
|
|
12584
|
+
objectUiSchema = _f.sent();
|
|
12103
12585
|
listView = find(objectUiSchema.list_views, function (listView, name) {
|
|
12104
12586
|
// 传入listViewName空值则取第一个
|
|
12105
12587
|
if (!listName) {
|
|
@@ -12131,11 +12613,11 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
12131
12613
|
"blank": false
|
|
12132
12614
|
},
|
|
12133
12615
|
"actionType": "link",
|
|
12134
|
-
"expression": "${!!!event.data.recordId && event.data.__deletedRecord != true}" //是新建, 则进入详细页面.
|
|
12616
|
+
"expression": "${!!!event.data.recordId && event.data.__deletedRecord != true && event.data._isRelated != true}" //是新建, 则进入详细页面.
|
|
12135
12617
|
},
|
|
12136
12618
|
{
|
|
12137
12619
|
"actionType": "reload",
|
|
12138
|
-
"expression": "${event.data.recordId || event.data.__deletedRecord === true}" //不是新建, 则刷新列表
|
|
12620
|
+
"expression": "${(event.data.recordId || event.data.__deletedRecord === true) && event.data._isRelated != true}" //不是新建, 则刷新列表
|
|
12139
12621
|
}
|
|
12140
12622
|
]
|
|
12141
12623
|
};
|
|
@@ -12153,9 +12635,9 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
12153
12635
|
}
|
|
12154
12636
|
amisSchemaData = Object.assign({}, data, defaultData);
|
|
12155
12637
|
listViewId = (ctx === null || ctx === void 0 ? void 0 : ctx.listViewId) || amisSchemaData.listViewId;
|
|
12156
|
-
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:
|
|
12638
|
+
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 }))];
|
|
12157
12639
|
case 2:
|
|
12158
|
-
schema = (
|
|
12640
|
+
schema = (_f.sent());
|
|
12159
12641
|
amisSchema = schema.amisSchema;
|
|
12160
12642
|
uiSchema = schema.uiSchema;
|
|
12161
12643
|
body = [amisSchema];
|
|
@@ -12176,19 +12658,20 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
12176
12658
|
{
|
|
12177
12659
|
"type": "wrapper",
|
|
12178
12660
|
"size": "none",
|
|
12179
|
-
"className": "flex-shrink-0 min-w-[200px]
|
|
12661
|
+
"className": "flex-shrink-0 min-w-[200px] h-full border-r border-gray-200 lg:order-first lg:flex lg:flex-col",
|
|
12180
12662
|
"body": sideSchema
|
|
12181
12663
|
},
|
|
12182
12664
|
{
|
|
12183
12665
|
"type": "wrapper",
|
|
12184
12666
|
"size": "none",
|
|
12185
|
-
"className": "flex-1
|
|
12667
|
+
"className": "flex-1 focus:outline-none lg:order-last w-96 h-full",
|
|
12186
12668
|
"body": body
|
|
12187
12669
|
},
|
|
12188
12670
|
]
|
|
12189
12671
|
}];
|
|
12190
12672
|
}
|
|
12191
12673
|
serviceData = Object.assign({}, { listName: listName, uiSchema: uiSchema, showDisplayAs: showDisplayAs, displayAs: displayAs, recordPermissions: uiSchema.permissions, _id: null, $listviewId: listName });
|
|
12674
|
+
// console.timeEnd('AmisObjectListView')
|
|
12192
12675
|
return [2 /*return*/, {
|
|
12193
12676
|
"type": "service",
|
|
12194
12677
|
"body": body,
|
|
@@ -12270,6 +12753,7 @@ var AmisObjectTable = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
12270
12753
|
amisSchema.data = Object.assign({}, amisSchema.data, amisSchemaData);
|
|
12271
12754
|
amisSchema.className = "steedos-object-table h-full flex flex-col ".concat(className);
|
|
12272
12755
|
// console.log(`AmisObjectTable===>amisSchema`, amisSchema)
|
|
12756
|
+
// console.timeEnd('AmisObjectTable')
|
|
12273
12757
|
return [2 /*return*/, amisSchema];
|
|
12274
12758
|
}
|
|
12275
12759
|
});
|
|
@@ -13368,7 +13852,7 @@ var AmisInstanceDetail = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
13368
13852
|
}); };
|
|
13369
13853
|
|
|
13370
13854
|
var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
13371
|
-
var defaultFormFactor, appId, objectApiName, listviewId, display, _a, $schema, listName, displayAs, formFactor, page, listViewId, listSchema, defData;
|
|
13855
|
+
var defaultFormFactor, appId, objectApiName, listviewId, display, _a, $schema, listName, displayAs, formFactor, page, listViewId, listSchema, defData, pageGridClassName, pageSplitClassName;
|
|
13372
13856
|
return __generator(this, function (_b) {
|
|
13373
13857
|
switch (_b.label) {
|
|
13374
13858
|
case 0:
|
|
@@ -13406,11 +13890,12 @@ var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, f
|
|
|
13406
13890
|
if (listName) {
|
|
13407
13891
|
defData.listName = listName || listviewId;
|
|
13408
13892
|
}
|
|
13409
|
-
|
|
13893
|
+
pageGridClassName = listSchema.pageGridClassName || 'h-full sm:p-3';
|
|
13894
|
+
pageSplitClassName = listSchema.pageSplitClassName || 'p-0 flex flex-1 overflow-hidden h-full';
|
|
13410
13895
|
return [2 /*return*/, {
|
|
13411
13896
|
type: 'service',
|
|
13412
13897
|
data: defData,
|
|
13413
|
-
"className": (displayAs === 'grid') ?
|
|
13898
|
+
"className": (displayAs === 'grid') ? pageGridClassName : pageSplitClassName,
|
|
13414
13899
|
body: (displayAs === 'grid') ? defaultsDeep$1({ data: defData }, listSchema) : [
|
|
13415
13900
|
{
|
|
13416
13901
|
"type": "wrapper",
|
|
@@ -13503,5 +13988,5 @@ var index_esm = /*#__PURE__*/Object.freeze({
|
|
|
13503
13988
|
SteedosUI: SteedosUI$1
|
|
13504
13989
|
});
|
|
13505
13990
|
|
|
13506
|
-
export { AmisAppLauncher, AmisAppMenu, AmisGlobalHeader, AmisInstanceDetail, index_esm$1 as AmisLib, AmisLogo, AmisObjectButton, AmisObjectCalendar, AmisObjectFieldLookup, AmisObjectForm, AmisObjectListView, AmisObjectTable, AmisProvider, AmisRecordDetail, AmisRecordDetailHeader, AmisRecordDetailRelatedList, AmisRecordDetailRelatedLists, AmisSelectFlow, AmisSelectUser, AmisSteedosField, FromNow, PageListView, PageRecordDetail, SteedosBadge, SteedosBadgeRibbon, SteedosDropdown, SteedosDropdownButton, SteedosIcon, index_esm as SteedosLib, SteedosLoading };
|
|
13991
|
+
export { AmisAppLauncher, AmisAppMenu, AmisGlobalHeader, AmisInstanceDetail, index_esm$1 as AmisLib, AmisLogo, AmisObjectButton, AmisObjectCalendar, AmisObjectFieldLookup, AmisObjectForm, AmisObjectListView, AmisObjectTable, AmisProvider, AmisRecordDetail, AmisRecordDetailHeader, AmisRecordDetailRelatedList, AmisRecordDetailRelatedLists, AmisSelectFlow, AmisSelectUser, AmisSteedosField, FromNow, PageListView, PageRecordDetail, SteedosBadge, SteedosBadgeRibbon, SteedosDropdown, SteedosDropdownButton, SteedosIcon, index_esm as SteedosLib, SteedosLoading, SteedosSkeleton };
|
|
13507
13992
|
//# sourceMappingURL=amis-object.esm.js.map
|