@steedos-widgets/amis-object 1.2.6 → 1.2.8
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 +43 -0
- package/dist/amis-object.cjs.js +261 -34
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +43 -0
- package/dist/amis-object.esm.js +262 -35
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +43 -0
- package/dist/amis-object.umd.js +261 -34
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +11 -11
- package/package.json +3 -3
package/dist/amis-object.umd.css
CHANGED
|
@@ -205,6 +205,39 @@ body {
|
|
|
205
205
|
overflow: unset;
|
|
206
206
|
}
|
|
207
207
|
|
|
208
|
+
/* 手机端native时间控件样式 */
|
|
209
|
+
@media (max-width: 768px){
|
|
210
|
+
.steedos-combo-edit .antd-Form-row{
|
|
211
|
+
display: flex !important;
|
|
212
|
+
-moz-column-gap: unset !important;
|
|
213
|
+
column-gap: unset !important;
|
|
214
|
+
}
|
|
215
|
+
.steedos-combo-edit .antd-Form::before{
|
|
216
|
+
content: unset;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.steedos-combo-edit .antd-Form .antd-Form-item::after{
|
|
220
|
+
content: unset;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.steedos-combo-edit .antd-Form .antd-Form-item{
|
|
224
|
+
padding: 0;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.steedos-combo-edit{
|
|
228
|
+
flex-wrap:nowrap !important;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.steedos-combo-edit .steedos-native-date .antd-TextControl-input input{
|
|
232
|
+
min-width: 120px;
|
|
233
|
+
align-items: start !important;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.steedos-combo-edit .steedos-native-time .antd-TextControl-input input{
|
|
237
|
+
min-width: 70px;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
208
241
|
.ant-dropdown-menu {
|
|
209
242
|
border: 1px solid #e5e5e5;
|
|
210
243
|
border-radius: 0.25rem;
|
|
@@ -608,6 +641,9 @@ body {
|
|
|
608
641
|
.rounded-full {
|
|
609
642
|
border-radius: 9999px
|
|
610
643
|
}
|
|
644
|
+
.rounded-xl {
|
|
645
|
+
border-radius: 0.75rem
|
|
646
|
+
}
|
|
611
647
|
.rounded-md {
|
|
612
648
|
border-radius: 0.375rem
|
|
613
649
|
}
|
|
@@ -724,6 +760,10 @@ body {
|
|
|
724
760
|
padding-left: 0.5rem;
|
|
725
761
|
padding-right: 0.5rem
|
|
726
762
|
}
|
|
763
|
+
.py-1 {
|
|
764
|
+
padding-top: 0.25rem;
|
|
765
|
+
padding-bottom: 0.25rem
|
|
766
|
+
}
|
|
727
767
|
.pt-4 {
|
|
728
768
|
padding-top: 1rem
|
|
729
769
|
}
|
|
@@ -903,6 +943,9 @@ body {
|
|
|
903
943
|
outline-offset: 2px
|
|
904
944
|
}
|
|
905
945
|
@media (min-width: 640px) {
|
|
946
|
+
.sm\:sticky {
|
|
947
|
+
position: sticky
|
|
948
|
+
}
|
|
906
949
|
.sm\:m-3 {
|
|
907
950
|
margin: 0.75rem
|
|
908
951
|
}
|
package/dist/amis-object.umd.js
CHANGED
|
@@ -2981,7 +2981,7 @@
|
|
|
2981
2981
|
return Promise.all(filterFormSearchableFields.map(function (item) {
|
|
2982
2982
|
const field = _.clone(fields[item]);
|
|
2983
2983
|
if (
|
|
2984
|
-
!_.includes(
|
|
2984
|
+
field && !_.includes(
|
|
2985
2985
|
[
|
|
2986
2986
|
"grid",
|
|
2987
2987
|
"avatar",
|
|
@@ -3028,7 +3028,7 @@
|
|
|
3028
3028
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
3029
3029
|
return n.props.type === "form";
|
|
3030
3030
|
});
|
|
3031
|
-
filterForm.handleFormSubmit(event)
|
|
3031
|
+
filterForm.handleFormSubmit(event);
|
|
3032
3032
|
// var filterFormValues = filterForm.getValues();
|
|
3033
3033
|
// var listView = scope.parent.parent.parent.getComponents().find(function(n){
|
|
3034
3034
|
// return n.props.type === "crud";
|
|
@@ -3042,8 +3042,30 @@
|
|
|
3042
3042
|
// }
|
|
3043
3043
|
// }
|
|
3044
3044
|
// listView.handleFilterSubmit(Object.assign({}, removedValues, filterFormValues));
|
|
3045
|
+
|
|
3046
|
+
let isMobile = Steedos.isMobile();
|
|
3047
|
+
if(isMobile){
|
|
3048
|
+
// 手机端点击搜索的时候自动收起搜索栏
|
|
3049
|
+
let resizeWindow = function(){
|
|
3050
|
+
//触发amis crud 高度重算
|
|
3051
|
+
setTimeout(()=>{
|
|
3052
|
+
window.dispatchEvent(new Event("resize"))
|
|
3053
|
+
}, 500);
|
|
3054
|
+
}
|
|
3055
|
+
const filterService = filterForm.context.getComponents().find(function(n){
|
|
3056
|
+
return n.props.type === "service";
|
|
3057
|
+
});
|
|
3058
|
+
filterService.setData({showFieldsFilter: false});
|
|
3059
|
+
resizeWindow();
|
|
3060
|
+
// 使用filterForm.getValues()的话,并不能拿到本地存储中的过滤条件,所以需要从event.data中取。
|
|
3061
|
+
let filterFormValues = event.data;
|
|
3062
|
+
let isFieldsFilterEmpty = SteedosUI.isFilterFormValuesEmpty(filterFormValues);
|
|
3063
|
+
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
3064
|
+
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
3065
|
+
crudService && crudService.setData({isFieldsFilterEmpty, showFieldsFilter: false});
|
|
3066
|
+
}
|
|
3045
3067
|
`;
|
|
3046
|
-
const
|
|
3068
|
+
const onCancelScript = `
|
|
3047
3069
|
const scope = event.context.scoped;
|
|
3048
3070
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
3049
3071
|
return n.props.type === "form";
|
|
@@ -3071,7 +3093,21 @@
|
|
|
3071
3093
|
}
|
|
3072
3094
|
}
|
|
3073
3095
|
listView.handleFilterSubmit(removedValues);
|
|
3074
|
-
|
|
3096
|
+
const filterService = filterForm.context.getComponents().find(function(n){
|
|
3097
|
+
return n.props.type === "service";
|
|
3098
|
+
});
|
|
3099
|
+
filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsFilter});
|
|
3100
|
+
//触发amis crud 高度重算
|
|
3101
|
+
setTimeout(()=>{
|
|
3102
|
+
window.dispatchEvent(new Event("resize"))
|
|
3103
|
+
}, 100);
|
|
3104
|
+
let isMobile = Steedos.isMobile();
|
|
3105
|
+
if(isMobile){
|
|
3106
|
+
// 手机端移除搜索按钮上的红点
|
|
3107
|
+
let crudService = scope.getComponentById("service_listview_" + event.data.objectName);
|
|
3108
|
+
crudService && crudService.setData({isFieldsFilterEmpty: true, showFieldsFilter: false});
|
|
3109
|
+
}
|
|
3110
|
+
`;
|
|
3075
3111
|
const dataProviderInited = `
|
|
3076
3112
|
const objectName = data.objectName;
|
|
3077
3113
|
const isLookup = data.isLookup;
|
|
@@ -3125,7 +3161,15 @@
|
|
|
3125
3161
|
});
|
|
3126
3162
|
// 有过滤条件时自动展开搜索栏
|
|
3127
3163
|
if(!_.isEmpty(omitedEmptyFormValue)){
|
|
3128
|
-
|
|
3164
|
+
let isMobile = Steedos.isMobile();
|
|
3165
|
+
if(isMobile){
|
|
3166
|
+
// 手机端不展开,只显示搜索按钮上的红点
|
|
3167
|
+
let crudService = SteedosUI.getRef(data.$scopeId).getComponentById("service_listview_" + data.objectName)
|
|
3168
|
+
crudService && crudService.setData({isFieldsFilterEmpty: false});
|
|
3169
|
+
}
|
|
3170
|
+
else{
|
|
3171
|
+
setData({ showFieldsFilter: true });
|
|
3172
|
+
}
|
|
3129
3173
|
}
|
|
3130
3174
|
}
|
|
3131
3175
|
}
|
|
@@ -3267,14 +3311,15 @@
|
|
|
3267
3311
|
},
|
|
3268
3312
|
{
|
|
3269
3313
|
"type": "button",
|
|
3270
|
-
"label": "
|
|
3314
|
+
"label": "取消",
|
|
3315
|
+
"name": "btn_filter_form_cancel",
|
|
3271
3316
|
"visibleOn": "this.filterFormSearchableFields && this.filterFormSearchableFields.length",
|
|
3272
3317
|
"onEvent": {
|
|
3273
3318
|
"click": {
|
|
3274
3319
|
"actions": [
|
|
3275
3320
|
{
|
|
3276
3321
|
"actionType": "custom",
|
|
3277
|
-
"script":
|
|
3322
|
+
"script": onCancelScript
|
|
3278
3323
|
}
|
|
3279
3324
|
]
|
|
3280
3325
|
}
|
|
@@ -3878,11 +3923,36 @@ const filterForm = scope.getComponents().find(function(n){
|
|
|
3878
3923
|
const filterService = filterForm.context.getComponents().find(function(n){
|
|
3879
3924
|
return n.props.type === "service";
|
|
3880
3925
|
});
|
|
3881
|
-
filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsFilter});
|
|
3882
|
-
|
|
3883
|
-
|
|
3884
|
-
|
|
3885
|
-
|
|
3926
|
+
// filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsFilter});
|
|
3927
|
+
let resizeWindow = function(){
|
|
3928
|
+
//触发amis crud 高度重算
|
|
3929
|
+
setTimeout(()=>{
|
|
3930
|
+
window.dispatchEvent(new Event("resize"))
|
|
3931
|
+
}, 500);
|
|
3932
|
+
}
|
|
3933
|
+
let isMobile = Steedos.isMobile();
|
|
3934
|
+
if(filterService.props.data.showFieldsFilter){
|
|
3935
|
+
if(isMobile){
|
|
3936
|
+
// 手机上只能通过取消按钮来关闭搜索栏
|
|
3937
|
+
return;
|
|
3938
|
+
}
|
|
3939
|
+
let buttonCancel = SteedosUI.getClosestAmisComponentByType(filterForm.context, "button", {
|
|
3940
|
+
direction: "down",
|
|
3941
|
+
name: "btn_filter_form_cancel"
|
|
3942
|
+
});
|
|
3943
|
+
buttonCancel.props.dispatchEvent('click', {}).then(function(){
|
|
3944
|
+
resizeWindow();
|
|
3945
|
+
});
|
|
3946
|
+
}
|
|
3947
|
+
else{
|
|
3948
|
+
filterService.setData({showFieldsFilter: true});
|
|
3949
|
+
resizeWindow();
|
|
3950
|
+
if(isMobile){
|
|
3951
|
+
// 手机端在显示搜索栏时隐藏刷新按钮
|
|
3952
|
+
let crudService = scope.getComponentById("service_listview_" + event.data.objectName);
|
|
3953
|
+
crudService && crudService.setData({showFieldsFilter: true});
|
|
3954
|
+
}
|
|
3955
|
+
}
|
|
3886
3956
|
`;
|
|
3887
3957
|
|
|
3888
3958
|
function getExportApiRequestAdaptorScript(){
|
|
@@ -3967,6 +4037,7 @@ setTimeout(()=>{
|
|
|
3967
4037
|
"className": "bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
3968
4038
|
"label": "",
|
|
3969
4039
|
"icon": "fa fa-sync",
|
|
4040
|
+
"visibleOn": "${!showFieldsFilter}",
|
|
3970
4041
|
"onEvent": {
|
|
3971
4042
|
"click": {
|
|
3972
4043
|
"actions": [
|
|
@@ -3982,6 +4053,15 @@ setTimeout(()=>{
|
|
|
3982
4053
|
"label": "",
|
|
3983
4054
|
"icon": "fa fa-search",
|
|
3984
4055
|
"type": "button",
|
|
4056
|
+
"badge": {
|
|
4057
|
+
"offsetx": [
|
|
4058
|
+
-2,
|
|
4059
|
+
2
|
|
4060
|
+
],
|
|
4061
|
+
"size":8,
|
|
4062
|
+
"animation": true,
|
|
4063
|
+
"visibleOn": "${isFieldsFilterEmpty == false}"
|
|
4064
|
+
},
|
|
3985
4065
|
"align": "right",
|
|
3986
4066
|
"className": "bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
3987
4067
|
"onEvent": {
|
|
@@ -4621,8 +4701,8 @@ setTimeout(()=>{
|
|
|
4621
4701
|
}
|
|
4622
4702
|
else {
|
|
4623
4703
|
return [
|
|
4704
|
+
"switch-per-page",
|
|
4624
4705
|
"statistics",
|
|
4625
|
-
// "switch-per-page",
|
|
4626
4706
|
"pagination"
|
|
4627
4707
|
]
|
|
4628
4708
|
}
|
|
@@ -5814,6 +5894,23 @@ setTimeout(()=>{
|
|
|
5814
5894
|
return readonly ? getAmisFileReadonlySchema(steedosField) : getAmisFileEditSchema(steedosField);
|
|
5815
5895
|
};
|
|
5816
5896
|
|
|
5897
|
+
/*
|
|
5898
|
+
* @Author: baozhoutao@steedos.com
|
|
5899
|
+
* @Date: 2022-07-20 16:29:22
|
|
5900
|
+
* @LastEditors: Please set LastEditors
|
|
5901
|
+
* @LastEditTime: 2023-05-11 11:19:54
|
|
5902
|
+
* @Description:
|
|
5903
|
+
*/
|
|
5904
|
+
|
|
5905
|
+
function getContrastColor(bgColor) {
|
|
5906
|
+
var backgroundColor = (bgColor.charAt(0) === '#') ? bgColor.substring(1, 7) : bgColor;
|
|
5907
|
+
var r = parseInt(backgroundColor.substr(0, 2), 16);
|
|
5908
|
+
var g = parseInt(backgroundColor.substr(2, 2), 16);
|
|
5909
|
+
var b = parseInt(backgroundColor.substr(4, 2), 16);
|
|
5910
|
+
var brightness = (r * 299 + g * 587 + b * 114) / 1000;
|
|
5911
|
+
return brightness >= 128 ? "#000000" : "#ffffff";
|
|
5912
|
+
}
|
|
5913
|
+
|
|
5817
5914
|
const OMIT_FIELDS = ['created', 'created_by', 'modified', 'modified_by'];
|
|
5818
5915
|
// const Lookup = require('./lookup');
|
|
5819
5916
|
|
|
@@ -5967,6 +6064,8 @@ setTimeout(()=>{
|
|
|
5967
6064
|
}
|
|
5968
6065
|
|
|
5969
6066
|
async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
6067
|
+
// console.log('convertSFieldToAmisField====>', field, readonly, ctx)
|
|
6068
|
+
const isMobile = window.innerWidth <= 768;
|
|
5970
6069
|
// 创建人和修改人、创建时间和修改时间不显示
|
|
5971
6070
|
if(___default__namespace.includes(OMIT_FIELDS, field.name) && ctx.showSystemFields != true){
|
|
5972
6071
|
return;
|
|
@@ -6001,20 +6100,42 @@ setTimeout(()=>{
|
|
|
6001
6100
|
// }
|
|
6002
6101
|
// break;
|
|
6003
6102
|
case 'select':
|
|
6004
|
-
|
|
6005
|
-
|
|
6006
|
-
|
|
6007
|
-
|
|
6008
|
-
|
|
6009
|
-
|
|
6010
|
-
|
|
6011
|
-
|
|
6012
|
-
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6103
|
+
if(readonly){
|
|
6104
|
+
const selectOptions = field.options;
|
|
6105
|
+
let map = {};
|
|
6106
|
+
___default__namespace.forEach(selectOptions,(option)=>{
|
|
6107
|
+
const optionValue = option.value + '';
|
|
6108
|
+
if(option.color){
|
|
6109
|
+
const background = '#'+option.color;
|
|
6110
|
+
const color = getContrastColor(background);
|
|
6111
|
+
const optionColorStyle = 'background:'+background+';color:'+color;
|
|
6112
|
+
map[optionValue] = `<span class="rounded-xl px-2 py-1" style='${optionColorStyle}'>${option.label}</span>`;
|
|
6113
|
+
}else {
|
|
6114
|
+
map[optionValue] = option.label;
|
|
6115
|
+
}
|
|
6116
|
+
});
|
|
6117
|
+
convertData = {
|
|
6118
|
+
type: "static-mapping",
|
|
6119
|
+
name: field.name,
|
|
6120
|
+
label: field.label,
|
|
6121
|
+
map: map
|
|
6122
|
+
};
|
|
6123
|
+
}else {
|
|
6124
|
+
convertData = {
|
|
6125
|
+
type: getAmisStaticFieldType('select', readonly),
|
|
6126
|
+
joinValues: false,
|
|
6127
|
+
options: getSelectFieldOptions(field),
|
|
6128
|
+
extractValue: true,
|
|
6129
|
+
clearable: true,
|
|
6130
|
+
labelField: 'label',
|
|
6131
|
+
valueField: 'value'
|
|
6132
|
+
};
|
|
6133
|
+
if(field.multiple){
|
|
6134
|
+
convertData.multiple = true;
|
|
6135
|
+
convertData.extractValue = true;
|
|
6136
|
+
}
|
|
6017
6137
|
}
|
|
6138
|
+
|
|
6018
6139
|
break;
|
|
6019
6140
|
case 'boolean':
|
|
6020
6141
|
convertData = {
|
|
@@ -6034,7 +6155,26 @@ setTimeout(()=>{
|
|
|
6034
6155
|
};
|
|
6035
6156
|
break;
|
|
6036
6157
|
case 'date':
|
|
6037
|
-
convertData = {
|
|
6158
|
+
convertData = isMobile && !readonly ? {
|
|
6159
|
+
type: "native-date",
|
|
6160
|
+
pipeIn: (value, data) => {
|
|
6161
|
+
if (value) {
|
|
6162
|
+
value = moment(value).utc().format('YYYY-MM-DD');
|
|
6163
|
+
return value;
|
|
6164
|
+
} else {
|
|
6165
|
+
return "";
|
|
6166
|
+
}
|
|
6167
|
+
|
|
6168
|
+
},
|
|
6169
|
+
pipeOut: (value, oldValue, data) => {
|
|
6170
|
+
if (value) {
|
|
6171
|
+
value = moment(value).format('YYYY-MM-DDT00:00:00.000[Z]');
|
|
6172
|
+
return value;
|
|
6173
|
+
} else {
|
|
6174
|
+
return "";
|
|
6175
|
+
}
|
|
6176
|
+
}
|
|
6177
|
+
} : {
|
|
6038
6178
|
type: getAmisStaticFieldType('date', readonly),
|
|
6039
6179
|
inputFormat: "YYYY-MM-DD",
|
|
6040
6180
|
format:'YYYY-MM-DDT00:00:00.000[Z]',
|
|
@@ -6053,12 +6193,48 @@ setTimeout(()=>{
|
|
|
6053
6193
|
};
|
|
6054
6194
|
break;
|
|
6055
6195
|
case 'datetime':
|
|
6056
|
-
convertData = {
|
|
6196
|
+
convertData = isMobile && !readonly ? {
|
|
6197
|
+
type: "combo",
|
|
6198
|
+
pipeIn: (value, data) => {
|
|
6199
|
+
let revalue = {};
|
|
6200
|
+
if (value && value != "Invalid date") {
|
|
6201
|
+
value = moment(value).format('YYYY-MM-DD HH:mm:ss');
|
|
6202
|
+
revalue[field.name + "-native-date"] = value.split(' ')[0];
|
|
6203
|
+
revalue[field.name + "-native-time"] = value.split(' ')[1];
|
|
6204
|
+
} else {
|
|
6205
|
+
revalue[field.name + "-native-date"] = "";
|
|
6206
|
+
revalue[field.name + "-native-time"] = "";
|
|
6207
|
+
}
|
|
6208
|
+
return revalue;
|
|
6209
|
+
},
|
|
6210
|
+
pipeOut: (value, oldValue, data) => {
|
|
6211
|
+
let revalue = "";
|
|
6212
|
+
if (value[field.name + "-native-date"] && value[field.name + "-native-time"]) {
|
|
6213
|
+
revalue = value[field.name + "-native-date"] + " " + value[field.name + "-native-time"];
|
|
6214
|
+
revalue = moment(revalue).utc().format('YYYY-MM-DDTHH:mm:ss.SSS[Z]');
|
|
6215
|
+
}
|
|
6216
|
+
return revalue;
|
|
6217
|
+
},
|
|
6218
|
+
items: [
|
|
6219
|
+
{
|
|
6220
|
+
type: "native-date",
|
|
6221
|
+
name: field.name + "-native-date",
|
|
6222
|
+
className: "steedos-native-date",
|
|
6223
|
+
value: ""
|
|
6224
|
+
},
|
|
6225
|
+
{
|
|
6226
|
+
type: "native-time",
|
|
6227
|
+
name: field.name + "-native-time",
|
|
6228
|
+
className: "steedos-native-time",
|
|
6229
|
+
value: ""
|
|
6230
|
+
}
|
|
6231
|
+
]
|
|
6232
|
+
} : {
|
|
6057
6233
|
type: getAmisStaticFieldType('datetime', readonly),
|
|
6058
6234
|
inputFormat: 'YYYY-MM-DD HH:mm',
|
|
6059
|
-
format:'YYYY-MM-DDTHH:mm:ss.SSSZ',
|
|
6235
|
+
format: 'YYYY-MM-DDTHH:mm:ss.SSSZ',
|
|
6060
6236
|
tpl: readonly ? getDateTimeTpl(field) : null,
|
|
6061
|
-
utc: true
|
|
6237
|
+
utc: true,
|
|
6062
6238
|
};
|
|
6063
6239
|
break;
|
|
6064
6240
|
case 'input-time-range':
|
|
@@ -6073,7 +6249,26 @@ setTimeout(()=>{
|
|
|
6073
6249
|
};
|
|
6074
6250
|
break;
|
|
6075
6251
|
case 'time':
|
|
6076
|
-
convertData = {
|
|
6252
|
+
convertData = isMobile && !readonly ? {
|
|
6253
|
+
type: "native-time",
|
|
6254
|
+
pipeIn: (value, data) => {
|
|
6255
|
+
if (value) {
|
|
6256
|
+
value = moment(value).utc().format('HH:mm');
|
|
6257
|
+
return value;
|
|
6258
|
+
} else {
|
|
6259
|
+
return "";
|
|
6260
|
+
}
|
|
6261
|
+
|
|
6262
|
+
},
|
|
6263
|
+
pipeOut: (value, oldValue, data) => {
|
|
6264
|
+
if (value) {
|
|
6265
|
+
value = moment('1970-01-01 ' + value).format('1970-01-01THH:mm:00.000[Z]');
|
|
6266
|
+
return value;
|
|
6267
|
+
} else {
|
|
6268
|
+
return "";
|
|
6269
|
+
}
|
|
6270
|
+
}
|
|
6271
|
+
} : {
|
|
6077
6272
|
type: getAmisStaticFieldType('time', readonly),
|
|
6078
6273
|
inputFormat: 'HH:mm',
|
|
6079
6274
|
timeFormat:'HH:mm',
|
|
@@ -6277,6 +6472,13 @@ setTimeout(()=>{
|
|
|
6277
6472
|
convertData.quickEdit = false;
|
|
6278
6473
|
}
|
|
6279
6474
|
|
|
6475
|
+
let fieldTypeClassName = ' steedos-' + convertData.type + (readonly ? '-readonly' : '-edit');
|
|
6476
|
+
if (convertData.className) {
|
|
6477
|
+
convertData.className = convertData.className + fieldTypeClassName;
|
|
6478
|
+
} else {
|
|
6479
|
+
convertData.className = fieldTypeClassName;
|
|
6480
|
+
}
|
|
6481
|
+
|
|
6280
6482
|
if(field.visible_on){
|
|
6281
6483
|
// convertData.visibleOn = `\$${field.visible_on.substring(1, field.visible_on.length -1).replace(/formData./g, '')}`;
|
|
6282
6484
|
if(field.visible_on.startsWith("{{")){
|
|
@@ -6961,6 +7163,7 @@ setTimeout(()=>{
|
|
|
6961
7163
|
hiddenOn: options.tableHiddenOn,
|
|
6962
7164
|
autoFillHeight: options.isRelated ? false : true,
|
|
6963
7165
|
className: `flex-auto ${crudClassName || ""}`,
|
|
7166
|
+
bodyClassName: "bg-white",
|
|
6964
7167
|
crudClassName: crudClassName,
|
|
6965
7168
|
},
|
|
6966
7169
|
bodyProps,
|
|
@@ -7306,7 +7509,31 @@ setTimeout(()=>{
|
|
|
7306
7509
|
...getAmisFileReadonlySchema(field)
|
|
7307
7510
|
}, field.amis, {name: field.name}));
|
|
7308
7511
|
}
|
|
7309
|
-
|
|
7512
|
+
else if(field.type === 'select'){
|
|
7513
|
+
const selectOptions = field.options;
|
|
7514
|
+
let map = {};
|
|
7515
|
+
___default.forEach(selectOptions,(option)=>{
|
|
7516
|
+
const optionValue = option.value + '';
|
|
7517
|
+
if(option.color){
|
|
7518
|
+
const background = '#'+option.color;
|
|
7519
|
+
const color = getContrastColor(background);
|
|
7520
|
+
const optionColorStyle = 'background:'+background+';color:'+color;
|
|
7521
|
+
map[optionValue] = `<span class="rounded-xl px-2 py-1" style='${optionColorStyle}'>${option.label}</span>`;
|
|
7522
|
+
}else {
|
|
7523
|
+
map[optionValue] = option.label;
|
|
7524
|
+
}
|
|
7525
|
+
});
|
|
7526
|
+
columns.push(Object.assign({}, {
|
|
7527
|
+
type: "mapping",
|
|
7528
|
+
name: field.name,
|
|
7529
|
+
label: field.label,
|
|
7530
|
+
map: map,
|
|
7531
|
+
sortable: field.sortable,
|
|
7532
|
+
width: field.width,
|
|
7533
|
+
toggled: field.toggled,
|
|
7534
|
+
className:"whitespace-nowrap",
|
|
7535
|
+
}, field.amis, {name: field.name}));
|
|
7536
|
+
}
|
|
7310
7537
|
else {
|
|
7311
7538
|
const tpl = await getFieldTpl(field, options);
|
|
7312
7539
|
|
|
@@ -13206,7 +13433,7 @@ setTimeout(()=>{
|
|
|
13206
13433
|
return __generator(this, function (_d) {
|
|
13207
13434
|
switch (_d.label) {
|
|
13208
13435
|
case 0:
|
|
13209
|
-
_a = props.className, className = _a === void 0 ? 'sticky top-0 z-10 bg-gray-100 border-b sm:shadow sm:rounded sm:border border-slate-300 p-4' : _a;
|
|
13436
|
+
_a = props.className, className = _a === void 0 ? 'sm:sticky top-0 z-10 bg-gray-100 border-b sm:shadow sm:rounded sm:border border-slate-300 p-4' : _a;
|
|
13210
13437
|
return [4 /*yield*/, getUISchema(props.objectApiName || "space_users", false)];
|
|
13211
13438
|
case 1:
|
|
13212
13439
|
objectUiSchema = _d.sent();
|
|
@@ -14764,7 +14991,7 @@ setTimeout(()=>{
|
|
|
14764
14991
|
});
|
|
14765
14992
|
}); };
|
|
14766
14993
|
|
|
14767
|
-
var __assign=function(){return (__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},StandardObjects={Base:{Actions:{standard_query:{visible:function(e,t,r){return !1}},standard_new:{visible:function(e,t,r){return "cms_files"!==e&&"instances"!==e&&(r?r.allowCreate:void 0)}},standard_edit:{visible:function(e,t,r){if(r)return r.allowEdit}},standard_delete:{visible:function(e,t,r){if(r)return r.allowDelete}},standard_import_data:{visible:function(e,t,r){var n=this.object;if(r)return r.allowCreate&&n.hasImportTemplates}},standard_approve:{visible:function(e,t,r){return !1}},standard_view_instance:{visible:function(e,t,r){return !1}},standard_submit_for_approval:{visible:function(e,t,r){return window.Steedos.ProcessManager.allowSubmit.apply(this,[e,t])},todo:function(e,t){return window.Steedos.ProcessManager.submit.apply(this,[e,t])}},standard_follow:{visible:function(e,t,r){return !1}},standard_delete_many:{visible:function(e,t,r){return !RegExp("\\w+/view/\\w+").test(location.pathname)&&(r?r.allowDelete:void 0)}}}}},authRequest=function(e,t){var a=null;e=Steedos.absoluteUrl(e);try{var r=[{name:"Content-Type",value:"application/json"},{name:"Authorization",value:Steedos.getAuthorization()}],n={type:"get",url:e,dataType:"json",contentType:"application/json",beforeSend:function(t){if(r&&r.length)return r.forEach(function(e){return t.setRequestHeader(e.name,e.value)})},success:function(e){a=e;},error:function(e,t,r){var n,o;e.responseJSON&&e.responseJSON.error?(n=e.responseJSON.error,o=void(a={error:n}),o=n.reason||n.message||n,console.error(o)):console.error(e.responseJSON);}};return $.ajax(Object.assign({},n,t)),a}catch(e){console.error(e);}};function _extends(){return (_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r,n=arguments[t];for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e}).apply(this,arguments)}const newFunctionComponent=o=>e=>{const[t,r]=React.useState(!0);var n=()=>{r(!1);};return ___default.has(e,"ref")||(window.SteedosUI.refs[e.name]={show:()=>{r(!0);},close:n}),React__default["default"].createElement(o,_extends({visible:t,onCancel:n,onClose:n},{width:"70%",style:{width:"70%",maxWidth:"950px",minWidth:"480px"}},e))},newComponentRender=(r,n)=>(e,t)=>{e.name||(e.name=r+"-"+(e.name||"default")),(t=t||document.getElementById(`steedos-${r}-root-`+e.name))||((t=document.createElement("div")).setAttribute("id",`steedos-${r}-root-`+e.name),document.body.appendChild(t));e=React__default["default"].createElement(newFunctionComponent(n),e);ReactDOM.createRoot(t).render(e);},Modal=___default.assign(newComponentRender("modal",antd.Modal),{info:antd.Modal.info,success:antd.Modal.success,error:antd.Modal.error,warning:antd.Modal.warning,confirm:antd.Modal.confirm}),Drawer=newComponentRender("drawer",antd.Drawer),getGraphqlFieldsQuery=e=>{const t=["_id"];return e.push("record_permissions"),___default.each(e,e=>{-1<e.indexOf(".")&&(e=e.split(".")[0]),t.push(""+e);}),""+t.join(" ")},getFindOneQuery=(e,t,r)=>{e=e.replace(/\./g,"_");r=getGraphqlFieldsQuery(r);let n="";t=[`id: "${t}"`];return `{record:${e}__findOne${n=0<t.length?`(${t.join(",")})`:n}{${r}}}`},SObject={getRecord:async(e,t,r)=>{return (await fetchAPI("/graphql",{method:"post",body:JSON.stringify({query:getFindOneQuery(e,t,r)})})).data.record},getUISchema:async(e,t)=>getUISchema(e,t)},canSaveFilter=e=>!(!e._id||e.owner!==getSteedosAuth()?.userId),ListView={showFilter:(e,{listView:t,data:r})=>{canSaveFilter(t);r.filters&&(r.filters=filtersToConditions(r.filters));},getVisibleFilter:(e,t)=>{return t||(canSaveFilter(e)?e.filters:void 0)},getQueryFilter:(e,t)=>{return canSaveFilter(e)?ListView.getVisibleFilter(e,t):___default.isEmpty(t)?e.filters:[e.filters,"and",t]},getFirstListView:async e=>{e=await window.getUISchema(e);return _.first(_.sortBy(_.values(e.list_views),"sort_no"))}},Router={getAppPath({appId:e}){return "/app/"+e},getPagePath(){},getObjectListViewPath({appId:e,objectName:t,listViewName:r}){return `/app/${e}/${t}/grid/`+r},getObjectDetailPath({appId:e,objectName:t,recordId:r}){return `/app/${e}/${t}/view/`+r},getObjectRelatedViewPath({appId:e,masterObjectName:t,masterRecordId:r,objectName:n,foreignKey:o}){return `/app/${e}/${t}/${r}/${n}/grid?related_field_name=`+o}};var withModalWrap=function(t,e){return function(e){return React.createElement(t,e)}},render=function(e,t,r,n){e=withModalWrap(e),e=React.createElement(e,__assign({},t));return ReactDOM__default["default"].render(e,r)};const safeRunFunction=(t,r,n,o)=>{try{var a=window.Creator;if(!!(!a||!a.getObjectUrl)&&/\bSteedos\b|\bCreator\b|\bMeteor\b|\bSession\b/.test(t))return console.info("调用了Creator|Steedos|Meteor|Session变量的脚本不执行,直接按空值处理。"),"";let e=[];return ___default.isNil(r)||(e=___default.isArray(r)?r:[r]),t.bind(o||{})(...e)}catch(e){return console.log(e),n}};function safeEval(js){try{return eval(js)}catch(e){console.error(e,js);}}const isExpression=function(e){var t,r;return "string"==typeof e&&(t=/^{{(function.+)}}$/,r=/^{{(.+=>.+)}}$/,!("string"!=typeof e||!e.match(/^{{(.+)}}$/)||e.match(t)||e.match(r)))},parseSingleExpression=function(t,e,r,n){var o,a=function(e,t){return "#"!==t&&t?"string"==typeof t?_.get(e,t):void console.error("path has to be a string"):e||{}}(e=void 0===e?{}:e,function(e){return "string"!=typeof e||1===(e=e.split(".")).length?"#":(e.pop(),e.join("."))}(r))||{};if("string"!=typeof t)return t;o="__G_L_O_B_A_L__",e="\n return "+t.substring(2,t.length-2).replace(/\bformData\b/g,JSON.stringify(e).replace(/\bglobal\b/g,o)).replace(/\bglobal\b/g,JSON.stringify(n)).replace(new RegExp("\\b"+o+"\\b","g"),"global").replace(/rootValue/g,JSON.stringify(a));try{return Function(e)()}catch(e){return console.log(e,t,r),t}};var Expression=Object.freeze({__proto__:null,isExpression:isExpression,parseSingleExpression:parseSingleExpression});const getCompatibleDefaultValueExpression=(e,t)=>{let r=e;return /^\{\w+(\.*\w+)*\}$/.test(e)&&(r=-1<e.indexOf("userId")||-1<e.indexOf("spaceId")||-1<e.indexOf("user.")||-1<e.indexOf("now")?`{${e}}`.replace("{{","{{global."):`{${e}}`.replace("{{","{{formData."),t&&(r=r.replace(/\{\{(.+)\}\}/,"{{[$1]}}"))),r},getFieldDefaultValue=(e,t)=>{if(!e)return null;let r=e.defaultValue;e._defaultValue&&(r=safeEval(`(${e._defaultValue})`)),___default.isFunction(r)&&(r=safeRunFunction(r,[],null,{name:e.name})),___default.isString(r)&&(r=getCompatibleDefaultValueExpression(r,e.multiple));var n=isExpression(r);return n&&(r=parseSingleExpression(r,{},"#",t)),"select"===e.type&&(t=e.data_type||"text",!r||n||e.multiple||("text"!==t||___default.isString(r)?"number"!==t||___default.isNumber(r)?"boolean"!==t||___default.isBoolean(r)||(r="true"===r):r=Number(r):r=String(r))),r};function getTreeOptions(t,e){const o=e?.valueField||"value";e?.labelField;const r=e?.unfoldedNum||1,n=[],a=(t,r,n)=>{var e;if(r)return e=_.filter(t,e=>_.includes(r,e[o])),_.each(e,e=>{1<=n?(e.unfolded=!0,e.children&&(e.children=a(t,e.children,n-1))):e.children&&(e.children=a(t,e.children,n));}),e};for(var i=t,s=0;s<i.length;s++)if(i[s].noParent=0,i[s].unfolded=!1,i[s].parent){let e=1;for(var l=0;l<i.length;l++)i[s].parent==i[l][o]&&(e=0);1==e&&(i[s].noParent=1);}else i[s].noParent=1;return _.each(t,e=>{1==e.noParent&&(1<=r?(e.unfolded=!0,n.push(Object.assign({},e,{children:a(t,e.children,r-1)}))):n.push(Object.assign({},e,{children:a(t,e.children,r)})));}),n}const SteedosUI$1=Object.assign({},{render:render,Router:Router,ListView:ListView,Object:SObject,Modal:Modal,Drawer:Drawer,refs:{},getRef(e){return SteedosUI$1.refs[e]},router:{go:(e,t)=>{var r=window.FlowRouter;if(t)return r?r.go(t):window.open(t);r?r.reload():console.warn("暂不支持自动跳转",e);},reload:()=>{console.log("reload");}},message:antd.message,notification:antd.notification,components:{Button:antd.Button,Space:antd.Space},getRefId:({type:e,appId:t,name:r})=>{switch(e){case"listview":return `amis-${t}-${r}-listview`;case"form":return `amis-${t}-${r}-form`;case"detail":return `amis-${t}-${r}-detail`;default:return `amis-${t}-${r}-`+e}},reloadRecord:()=>{if(window.FlowRouter)return window.FlowRouter.reload()},getFieldDefaultValue:getFieldDefaultValue,getTreeOptions:getTreeOptions});var getBuilderContext=function(){return "undefined"==typeof window?{}:Builder.settings.context||Builder.settings},Steedos$1=__assign({getRootUrl:function(e){var t=getBuilderContext();return t.rootUrl||("undefined"!=typeof window?window.localStorage.getItem("steedos:rootUrl"):"")||e},absoluteUrl:function(e){return void 0===e&&(e=""),"".concat(Steedos$1.getRootUrl()).concat(e)},getTenantId:function(){try{var e=getBuilderContext().tenantId;return (e=window.location.search&&!e?new URLSearchParams(window.location.search).get("X-Space-Id"):e)?e:null}catch(e){console.error(e);}},getAuthorization:function(){try{var e=getBuilderContext(),t=e.tenantId,r=e.authToken;return t&&r?"Bearer ".concat(t,",").concat(r):null}catch(e){console.error(e);}},authRequest:authRequest,StandardObjects:StandardObjects},Expression);"undefined"==typeof window||window.Steedos||(window.Steedos=Steedos$1),"undefined"==typeof window||window.SteedosUI||(window.SteedosUI=SteedosUI$1);
|
|
14994
|
+
var __assign=function(){return (__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},StandardObjects={Base:{Actions:{standard_query:{visible:function(e,t,n){return !1}},standard_new:{visible:function(e,t,n){return "cms_files"!==e&&"instances"!==e&&(n?n.allowCreate:void 0)}},standard_edit:{visible:function(e,t,n){if(n)return n.allowEdit}},standard_delete:{visible:function(e,t,n){if(n)return n.allowDelete}},standard_import_data:{visible:function(e,t,n){var r=this.object;if(n)return n.allowCreate&&r.hasImportTemplates}},standard_approve:{visible:function(e,t,n){return !1}},standard_view_instance:{visible:function(e,t,n){return !1}},standard_submit_for_approval:{visible:function(e,t,n){return window.Steedos.ProcessManager.allowSubmit.apply(this,[e,t])},todo:function(e,t){return window.Steedos.ProcessManager.submit.apply(this,[e,t])}},standard_follow:{visible:function(e,t,n){return !1}},standard_delete_many:{visible:function(e,t,n){return !RegExp("\\w+/view/\\w+").test(location.pathname)&&(n?n.allowDelete:void 0)}}}}},authRequest=function(e,t){var i=null;e=Steedos.absoluteUrl(e);try{var n=[{name:"Content-Type",value:"application/json"},{name:"Authorization",value:Steedos.getAuthorization()}],r={type:"get",url:e,dataType:"json",contentType:"application/json",beforeSend:function(t){if(n&&n.length)return n.forEach(function(e){return t.setRequestHeader(e.name,e.value)})},success:function(e){i=e;},error:function(e,t,n){var r,o;e.responseJSON&&e.responseJSON.error?(r=e.responseJSON.error,o=void(i={error:r}),o=r.reason||r.message||r,console.error(o)):console.error(e.responseJSON);}};return $.ajax(Object.assign({},r,t)),i}catch(e){console.error(e);}};function _extends(){return (_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n,r=arguments[t];for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);}return e}).apply(this,arguments)}const newFunctionComponent=o=>e=>{const[t,n]=React.useState(!0);var r=()=>{n(!1);};return ___default.has(e,"ref")||(window.SteedosUI.refs[e.name]={show:()=>{n(!0);},close:r}),React__default["default"].createElement(o,_extends({visible:t,onCancel:r,onClose:r},{width:"70%",style:{width:"70%",maxWidth:"950px",minWidth:"480px"}},e))},newComponentRender=(n,r)=>(e,t)=>{e.name||(e.name=n+"-"+(e.name||"default")),(t=t||document.getElementById(`steedos-${n}-root-`+e.name))||((t=document.createElement("div")).setAttribute("id",`steedos-${n}-root-`+e.name),document.body.appendChild(t));e=React__default["default"].createElement(newFunctionComponent(r),e);ReactDOM.createRoot(t).render(e);},Modal=___default.assign(newComponentRender("modal",antd.Modal),{info:antd.Modal.info,success:antd.Modal.success,error:antd.Modal.error,warning:antd.Modal.warning,confirm:antd.Modal.confirm}),Drawer=newComponentRender("drawer",antd.Drawer),getGraphqlFieldsQuery=e=>{const t=["_id"];return e.push("record_permissions"),___default.each(e,e=>{-1<e.indexOf(".")&&(e=e.split(".")[0]),t.push(""+e);}),""+t.join(" ")},getFindOneQuery=(e,t,n)=>{e=e.replace(/\./g,"_");n=getGraphqlFieldsQuery(n);let r="";t=[`id: "${t}"`];return `{record:${e}__findOne${r=0<t.length?`(${t.join(",")})`:r}{${n}}}`},SObject={getRecord:async(e,t,n)=>{return (await fetchAPI("/graphql",{method:"post",body:JSON.stringify({query:getFindOneQuery(e,t,n)})})).data.record},getUISchema:async(e,t)=>getUISchema(e,t)},canSaveFilter=e=>!(!e._id||e.owner!==getSteedosAuth()?.userId),ListView={showFilter:(e,{listView:t,data:n})=>{canSaveFilter(t);n.filters&&(n.filters=filtersToConditions(n.filters));},getVisibleFilter:(e,t)=>{return t||(canSaveFilter(e)?e.filters:void 0)},getQueryFilter:(e,t)=>{return canSaveFilter(e)?ListView.getVisibleFilter(e,t):___default.isEmpty(t)?e.filters:[e.filters,"and",t]},getFirstListView:async e=>{e=await window.getUISchema(e);return _.first(_.sortBy(_.values(e.list_views),"sort_no"))}},Router={getAppPath({appId:e}){return "/app/"+e},getPagePath(){},getObjectListViewPath({appId:e,objectName:t,listViewName:n}){return `/app/${e}/${t}/grid/`+n},getObjectDetailPath({appId:e,objectName:t,recordId:n}){return `/app/${e}/${t}/view/`+n},getObjectRelatedViewPath({appId:e,masterObjectName:t,masterRecordId:n,objectName:r,foreignKey:o}){return `/app/${e}/${t}/${n}/${r}/grid?related_field_name=`+o}};var withModalWrap=function(t,e){return function(e){return React.createElement(t,e)}},render=function(e,t,n,r){e=withModalWrap(e),e=React.createElement(e,__assign({},t));return ReactDOM__default["default"].render(e,n)};const safeRunFunction=(t,n,r,o)=>{try{var i=window.Creator;if(!!(!i||!i.getObjectUrl)&&/\bSteedos\b|\bCreator\b|\bMeteor\b|\bSession\b/.test(t))return console.info("调用了Creator|Steedos|Meteor|Session变量的脚本不执行,直接按空值处理。"),"";let e=[];return ___default.isNil(n)||(e=___default.isArray(n)?n:[n]),t.bind(o||{})(...e)}catch(e){return console.log(e),r}};function safeEval(js){try{return eval(js)}catch(e){console.error(e,js);}}const isExpression=function(e){var t,n;return "string"==typeof e&&(t=/^{{(function.+)}}$/,n=/^{{(.+=>.+)}}$/,!("string"!=typeof e||!e.match(/^{{(.+)}}$/)||e.match(t)||e.match(n)))},parseSingleExpression=function(t,e,n,r){var o,i=function(e,t){return "#"!==t&&t?"string"==typeof t?_.get(e,t):void console.error("path has to be a string"):e||{}}(e=void 0===e?{}:e,function(e){return "string"!=typeof e||1===(e=e.split(".")).length?"#":(e.pop(),e.join("."))}(n))||{};if("string"!=typeof t)return t;o="__G_L_O_B_A_L__",e="\n return "+t.substring(2,t.length-2).replace(/\bformData\b/g,JSON.stringify(e).replace(/\bglobal\b/g,o)).replace(/\bglobal\b/g,JSON.stringify(r)).replace(new RegExp("\\b"+o+"\\b","g"),"global").replace(/rootValue/g,JSON.stringify(i));try{return Function(e)()}catch(e){return console.log(e,t,n),t}};var Expression=Object.freeze({__proto__:null,isExpression:isExpression,parseSingleExpression:parseSingleExpression});const getCompatibleDefaultValueExpression=(e,t)=>{let n=e;return /^\{\w+(\.*\w+)*\}$/.test(e)&&(n=-1<e.indexOf("userId")||-1<e.indexOf("spaceId")||-1<e.indexOf("user.")||-1<e.indexOf("now")?`{${e}}`.replace("{{","{{global."):`{${e}}`.replace("{{","{{formData."),t&&(n=n.replace(/\{\{(.+)\}\}/,"{{[$1]}}"))),n},getFieldDefaultValue=(e,t)=>{if(!e)return null;let n=e.defaultValue;e._defaultValue&&(n=safeEval(`(${e._defaultValue})`)),___default.isFunction(n)&&(n=safeRunFunction(n,[],null,{name:e.name})),___default.isString(n)&&(n=getCompatibleDefaultValueExpression(n,e.multiple));var r=isExpression(n);return r&&(n=parseSingleExpression(n,{},"#",t)),"select"===e.type&&(t=e.data_type||"text",!n||r||e.multiple||("text"!==t||___default.isString(n)?"number"!==t||___default.isNumber(n)?"boolean"!==t||___default.isBoolean(n)||(n="true"===n):n=Number(n):n=String(n))),n};function getTreeOptions(t,e){const o=e?.valueField||"value";e?.labelField;const n=e?.unfoldedNum||1,r=[],i=(t,n,r)=>{var e;if(n)return e=_.filter(t,e=>_.includes(n,e[o])),_.each(e,e=>{1<=r?(e.unfolded=!0,e.children&&(e.children=i(t,e.children,r-1))):e.children&&(e.children=i(t,e.children,r));}),e};for(var a=t,s=0;s<a.length;s++)if(a[s].noParent=0,a[s].unfolded=!1,a[s].parent){let e=1;for(var l=0;l<a.length;l++)a[s].parent==a[l][o]&&(e=0);1==e&&(a[s].noParent=1);}else a[s].noParent=1;return _.each(t,e=>{1==e.noParent&&(1<=n?(e.unfolded=!0,r.push(Object.assign({},e,{children:i(t,e.children,n-1)}))):r.push(Object.assign({},e,{children:i(t,e.children,n)})));}),r}function getClosestAmisComponentByType(t,n,r){let o=(r=r||{}).name;var e=r.direction||"up";let i=t.getComponents().find(function(e){return e.props.type===n&&(!o||e.props.name===o)});if(i)return i;if("down"===e){if(t.children&&t.children.length){for(let e=0;e<t.children.length&&!(i=getClosestAmisComponentByType(t.children[e],n,r));e++);return i}}else if("up"===e&&t.parent)return getClosestAmisComponentByType(t.parent,n,r)}function isFilterFormValuesEmpty(e){let t=!0;var e=_.pickBy(e,function(e,t){return /^__searchable__/g.test(t)});return _.isEmpty(e)||(e=_.omitBy(e,function(e){return _.isNil(e)||_.isObject(e)&&_.isEmpty(e)||_.isArray(e)&&_.isEmpty(e.filter(function(e){return !_.isNil(e)}))||_.isString(e)&&0===e.length}),_.isEmpty(e)||(t=!1)),t}const SteedosUI$1=Object.assign({},{render:render,Router:Router,ListView:ListView,Object:SObject,Modal:Modal,Drawer:Drawer,refs:{},getRef(e){return SteedosUI$1.refs[e]},router:{go:(e,t)=>{var n=window.FlowRouter;if(t)return n?n.go(t):window.open(t);n?n.reload():console.warn("暂不支持自动跳转",e);},reload:()=>{console.log("reload");}},message:antd.message,notification:antd.notification,components:{Button:antd.Button,Space:antd.Space},getRefId:({type:e,appId:t,name:n})=>{switch(e){case"listview":return `amis-${t}-${n}-listview`;case"form":return `amis-${t}-${n}-form`;case"detail":return `amis-${t}-${n}-detail`;default:return `amis-${t}-${n}-`+e}},reloadRecord:()=>{if(window.FlowRouter)return window.FlowRouter.reload()},getFieldDefaultValue:getFieldDefaultValue,getTreeOptions:getTreeOptions,getClosestAmisComponentByType:getClosestAmisComponentByType,isFilterFormValuesEmpty:isFilterFormValuesEmpty});var getBuilderContext=function(){return "undefined"==typeof window?{}:Builder.settings.context||Builder.settings},Steedos$1=__assign({getRootUrl:function(e){var t=getBuilderContext();return t.rootUrl||("undefined"!=typeof window?window.localStorage.getItem("steedos:rootUrl"):"")||e},absoluteUrl:function(e){return void 0===e&&(e=""),"".concat(Steedos$1.getRootUrl()).concat(e)},getTenantId:function(){try{var e=getBuilderContext().tenantId;return (e=window.location.search&&!e?new URLSearchParams(window.location.search).get("X-Space-Id"):e)?e:null}catch(e){console.error(e);}},getAuthorization:function(){try{var e=getBuilderContext(),t=e.tenantId,n=e.authToken;return t&&n?"Bearer ".concat(t,",").concat(n):null}catch(e){console.error(e);}},authRequest:authRequest,StandardObjects:StandardObjects},Expression);"undefined"==typeof window||window.Steedos||(window.Steedos=Steedos$1),"undefined"==typeof window||window.SteedosUI||(window.SteedosUI=SteedosUI$1);
|
|
14768
14995
|
|
|
14769
14996
|
var index_esm = /*#__PURE__*/Object.freeze({
|
|
14770
14997
|
__proto__: null,
|