@steedos-widgets/amis-object 1.2.39-beta.1 → 1.2.40
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 +39 -4
- package/dist/amis-object.cjs.js +82 -65
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +39 -4
- package/dist/amis-object.esm.js +82 -65
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +39 -4
- package/dist/amis-object.umd.js +82 -65
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +16 -16
- package/dist/pages/PageListView.d.ts +2 -1
- package/package.json +3 -3
package/dist/amis-object.cjs.css
CHANGED
|
@@ -419,12 +419,12 @@ fieldset.antd-Collapse > legend{
|
|
|
419
419
|
.mr-4 {
|
|
420
420
|
margin-right: 1rem
|
|
421
421
|
}
|
|
422
|
-
.mr-2 {
|
|
423
|
-
margin-right: 0.5rem
|
|
424
|
-
}
|
|
425
422
|
.mr-1 {
|
|
426
423
|
margin-right: 0.25rem
|
|
427
424
|
}
|
|
425
|
+
.mr-2 {
|
|
426
|
+
margin-right: 0.5rem
|
|
427
|
+
}
|
|
428
428
|
.mt-0\.5 {
|
|
429
429
|
margin-top: 0.125rem
|
|
430
430
|
}
|
|
@@ -1185,7 +1185,7 @@ fieldset.antd-Collapse > legend{
|
|
|
1185
1185
|
position: unset;
|
|
1186
1186
|
}
|
|
1187
1187
|
.steedos-select-user .antd-Table .antd-Table-content {
|
|
1188
|
-
max-height: calc(100vh -
|
|
1188
|
+
max-height: calc(100vh - 343px);
|
|
1189
1189
|
}
|
|
1190
1190
|
.steedos-select-user .antd-Table .antd-SearchBox {
|
|
1191
1191
|
margin-top: 0;
|
|
@@ -1363,6 +1363,41 @@ fieldset.antd-Collapse > legend{
|
|
|
1363
1363
|
width: 100%;
|
|
1364
1364
|
justify-content: unset;
|
|
1365
1365
|
}
|
|
1366
|
+
/*
|
|
1367
|
+
列表快速搜索,手机端及PC端分栏模式需要独占一行
|
|
1368
|
+
*/
|
|
1369
|
+
.steedos-crud-mobile-search-box .antd-Crud .antd-Crud-toolbar .antd-Crud-toolbar-item--right:last-child {
|
|
1370
|
+
width: 100%;
|
|
1371
|
+
margin-top: 8px;
|
|
1372
|
+
}
|
|
1373
|
+
.steedos-crud-mobile-search-box .antd-Crud .antd-Crud-toolbar .antd-Crud-toolbar-item--right:last-child .antd-TooltipWrapper {
|
|
1374
|
+
width: 100%;
|
|
1375
|
+
}
|
|
1376
|
+
.steedos-crud-mobile-search-box .antd-Crud .antd-Crud-toolbar .antd-Crud-toolbar-item--right:last-child .antd-TooltipWrapper .antd-SearchBox.is-active {
|
|
1377
|
+
width: 100%;
|
|
1378
|
+
}
|
|
1379
|
+
.page-list-split .steedos-object-listview .antd-Crud .antd-Crud-toolbar .antd-Crud-toolbar-item--right:last-child {
|
|
1380
|
+
width: 100%;
|
|
1381
|
+
margin-top: 8px;
|
|
1382
|
+
}
|
|
1383
|
+
.page-list-split .steedos-object-listview .antd-Crud .antd-Crud-toolbar .antd-Crud-toolbar-item--right:last-child .antd-TooltipWrapper {
|
|
1384
|
+
width: 100%;
|
|
1385
|
+
}
|
|
1386
|
+
.page-list-split .steedos-object-listview .antd-Crud .antd-Crud-toolbar .antd-Crud-toolbar-item--right:last-child .antd-TooltipWrapper .antd-SearchBox.is-active {
|
|
1387
|
+
width: 100%;
|
|
1388
|
+
}
|
|
1389
|
+
@media (max-width: 768px) {
|
|
1390
|
+
.steedos-object-listview .antd-Crud .antd-Crud-toolbar .antd-Crud-toolbar-item--right:last-child {
|
|
1391
|
+
width: 100%;
|
|
1392
|
+
margin-top: 8px;
|
|
1393
|
+
}
|
|
1394
|
+
.steedos-object-listview .antd-Crud .antd-Crud-toolbar .antd-Crud-toolbar-item--right:last-child .antd-TooltipWrapper {
|
|
1395
|
+
width: 100%;
|
|
1396
|
+
}
|
|
1397
|
+
.steedos-object-listview .antd-Crud .antd-Crud-toolbar .antd-Crud-toolbar-item--right:last-child .antd-TooltipWrapper .antd-SearchBox.is-active {
|
|
1398
|
+
width: 100%;
|
|
1399
|
+
}
|
|
1400
|
+
}
|
|
1366
1401
|
|
|
1367
1402
|
@media (min-width: 767px) {
|
|
1368
1403
|
.steedos-object-table tbody td.antd-Field--quickEditable div {
|
package/dist/amis-object.cjs.js
CHANGED
|
@@ -6454,6 +6454,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6454
6454
|
}
|
|
6455
6455
|
const btnSearchId = "btn_filter_form_search_" + new Date().getTime();
|
|
6456
6456
|
const filterFormSchema = await getObjectFieldsFilterFormSchema(ctx);
|
|
6457
|
+
const keywordsSearchBoxName = ctx.keywordsSearchBoxName || "__keywords";
|
|
6457
6458
|
const onSearchScript = `
|
|
6458
6459
|
const scope = event.context.scoped;
|
|
6459
6460
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
@@ -6539,6 +6540,11 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6539
6540
|
}
|
|
6540
6541
|
}
|
|
6541
6542
|
}
|
|
6543
|
+
else{
|
|
6544
|
+
const keywordsSearchBoxName = "${keywordsSearchBoxName}";
|
|
6545
|
+
//lookup字段保留快速搜索条件
|
|
6546
|
+
removedValues[keywordsSearchBoxName] = filterFormValues[keywordsSearchBoxName];
|
|
6547
|
+
}
|
|
6542
6548
|
filterForm.reset();
|
|
6543
6549
|
listView.handleFilterSubmit(removedValues);
|
|
6544
6550
|
const filterService = filterForm.context.getComponents().find(function(n){
|
|
@@ -8406,24 +8412,51 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8406
8412
|
// }
|
|
8407
8413
|
`;
|
|
8408
8414
|
|
|
8409
|
-
|
|
8410
|
-
function getObjectHeaderToolbar(mainObject, fields, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true} = {}){
|
|
8411
|
-
// console.log(`getObjectHeaderToolbar====>`, filterVisible)
|
|
8412
|
-
// console.log(`getObjectHeaderToolbar`, mainObject)
|
|
8415
|
+
function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup = false, keywordsSearchBoxName = "__keywords" } = {}){
|
|
8413
8416
|
const searchableFieldsLabel = [];
|
|
8414
8417
|
_.each(fields, function (field) {
|
|
8415
|
-
if (field.
|
|
8418
|
+
if (isFieldQuickSearchable(field, mainObject.NAME_FIELD_KEY)) {
|
|
8416
8419
|
searchableFieldsLabel.push(field.label);
|
|
8417
8420
|
}
|
|
8418
8421
|
});
|
|
8422
|
+
|
|
8419
8423
|
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
8420
8424
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
8421
8425
|
let crudKeywords = "";
|
|
8422
|
-
if(localListViewProps){
|
|
8426
|
+
if(localListViewProps && !isLookup){
|
|
8423
8427
|
localListViewProps = JSON.parse(localListViewProps);
|
|
8424
8428
|
crudKeywords = (localListViewProps && localListViewProps.__keywords) || "";
|
|
8425
8429
|
}
|
|
8426
8430
|
|
|
8431
|
+
return {
|
|
8432
|
+
"type": "tooltip-wrapper",
|
|
8433
|
+
"align": "right",
|
|
8434
|
+
"title": "",
|
|
8435
|
+
"content": "可搜索字段:" + searchableFieldsLabel.join(","),
|
|
8436
|
+
"placement": "bottom",
|
|
8437
|
+
"tooltipTheme": "dark",
|
|
8438
|
+
"trigger": "click",
|
|
8439
|
+
"className": formFactor !== 'SMALL' ? "mr-1" : '',
|
|
8440
|
+
"visible": !!searchableFieldsLabel.length,
|
|
8441
|
+
"body": [
|
|
8442
|
+
{
|
|
8443
|
+
"type": "search-box",
|
|
8444
|
+
"name": keywordsSearchBoxName,
|
|
8445
|
+
"placeholder": "快速搜索",
|
|
8446
|
+
"value": crudKeywords,
|
|
8447
|
+
"clearable": true,
|
|
8448
|
+
"clearAndSubmit": true
|
|
8449
|
+
}
|
|
8450
|
+
]
|
|
8451
|
+
}
|
|
8452
|
+
}
|
|
8453
|
+
|
|
8454
|
+
function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
8455
|
+
showDisplayAs = false, hiddenCount = false, headerToolbarItems,
|
|
8456
|
+
filterVisible = true, isLookup = false, keywordsSearchBoxName } = {}){
|
|
8457
|
+
// console.log(`getObjectHeaderToolbar====>`, filterVisible)
|
|
8458
|
+
// console.log(`getObjectHeaderToolbar`, mainObject)
|
|
8459
|
+
|
|
8427
8460
|
const isMobile = window.innerWidth < 768;
|
|
8428
8461
|
if(isMobile){
|
|
8429
8462
|
showDisplayAs = false;
|
|
@@ -8479,7 +8512,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {showDisplayAs =
|
|
|
8479
8512
|
],
|
|
8480
8513
|
"size":8,
|
|
8481
8514
|
"animation": true,
|
|
8482
|
-
"visibleOn": "${isFieldsFilterEmpty == false}"
|
|
8515
|
+
"visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
|
|
8483
8516
|
},
|
|
8484
8517
|
"align": "right",
|
|
8485
8518
|
"className": "bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
@@ -8494,7 +8527,8 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {showDisplayAs =
|
|
|
8494
8527
|
}
|
|
8495
8528
|
}
|
|
8496
8529
|
} : {},
|
|
8497
|
-
getDisplayAsButton(mainObject?.name)
|
|
8530
|
+
getDisplayAsButton(mainObject?.name),
|
|
8531
|
+
getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup, keywordsSearchBoxName })
|
|
8498
8532
|
]
|
|
8499
8533
|
}else {
|
|
8500
8534
|
return [
|
|
@@ -8527,7 +8561,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {showDisplayAs =
|
|
|
8527
8561
|
],
|
|
8528
8562
|
"size":8,
|
|
8529
8563
|
"animation": true,
|
|
8530
|
-
"visibleOn": "${isFieldsFilterEmpty == false}"
|
|
8564
|
+
"visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
|
|
8531
8565
|
},
|
|
8532
8566
|
"align": "right",
|
|
8533
8567
|
"className": "bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
@@ -8554,26 +8588,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {showDisplayAs =
|
|
|
8554
8588
|
// getExportExcelToolbarButtonSchema(),
|
|
8555
8589
|
mainObject?.permissions?.allowCreateListViews ? getSettingListviewToolbarButtonSchema() : {},
|
|
8556
8590
|
getDisplayAsButton(mainObject?.name),
|
|
8557
|
-
{
|
|
8558
|
-
"type": "tooltip-wrapper",
|
|
8559
|
-
"align": "right",
|
|
8560
|
-
"title": "",
|
|
8561
|
-
"content": "可模糊搜索字段:" + searchableFieldsLabel.join(","),
|
|
8562
|
-
"placement": "bottom",
|
|
8563
|
-
"tooltipTheme": "dark",
|
|
8564
|
-
"trigger": "click",
|
|
8565
|
-
"className": "mr-1",
|
|
8566
|
-
"body": [
|
|
8567
|
-
{
|
|
8568
|
-
"type": "search-box",
|
|
8569
|
-
"name": "__keywords",
|
|
8570
|
-
"placeholder": "请输入关键字",
|
|
8571
|
-
"value": crudKeywords,
|
|
8572
|
-
"clearable": true,
|
|
8573
|
-
"clearAndSubmit": true
|
|
8574
|
-
}
|
|
8575
|
-
]
|
|
8576
|
-
},
|
|
8591
|
+
getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup, keywordsSearchBoxName }),
|
|
8577
8592
|
// {
|
|
8578
8593
|
// "type": "drag-toggler",
|
|
8579
8594
|
// "align": "right"
|
|
@@ -8924,8 +8939,8 @@ function getLookupSapceUserTreeSchema(){
|
|
|
8924
8939
|
"style": {
|
|
8925
8940
|
"max-height": "100%",
|
|
8926
8941
|
"position": "absolute",
|
|
8927
|
-
"left": "-
|
|
8928
|
-
"width": "
|
|
8942
|
+
"left": "-330px",
|
|
8943
|
+
"width": "320px",
|
|
8929
8944
|
"bottom": 0,
|
|
8930
8945
|
"top": "0",
|
|
8931
8946
|
"overflow": "auto",
|
|
@@ -8991,7 +9006,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
8991
9006
|
})){
|
|
8992
9007
|
i++;
|
|
8993
9008
|
tableFields.push(field);
|
|
8994
|
-
if(field.
|
|
9009
|
+
if(isFieldQuickSearchable(field, refObjectConfig.NAME_FIELD_KEY)){
|
|
8995
9010
|
searchableFields.push(field.name);
|
|
8996
9011
|
}
|
|
8997
9012
|
}
|
|
@@ -9032,7 +9047,8 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
9032
9047
|
source.data.$term = "$term";
|
|
9033
9048
|
source.data.$self = "$$";
|
|
9034
9049
|
|
|
9035
|
-
|
|
9050
|
+
let keywordsSearchBoxName = `__keywords_lookup__${field.name}__to__${refObjectConfig.name}`;
|
|
9051
|
+
|
|
9036
9052
|
source.requestAdaptor = `
|
|
9037
9053
|
const selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
9038
9054
|
var filters = [];
|
|
@@ -9086,19 +9102,10 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
9086
9102
|
})
|
|
9087
9103
|
}
|
|
9088
9104
|
|
|
9089
|
-
|
|
9090
|
-
|
|
9091
|
-
allowSearchFields.forEach(function(key, index){
|
|
9092
|
-
const keyValue = selfData.__keywords;
|
|
9093
|
-
if(keyValue){
|
|
9094
|
-
keywordsFilters.push([key, "contains", keyValue]);
|
|
9095
|
-
if(index < allowSearchFields.length - 1){
|
|
9096
|
-
keywordsFilters.push('or');
|
|
9097
|
-
}
|
|
9098
|
-
}
|
|
9099
|
-
})
|
|
9105
|
+
var keywordsFilters = SteedosUI.getKeywordsSearchFilter(selfData.${keywordsSearchBoxName}, allowSearchFields);
|
|
9106
|
+
if(keywordsFilters && keywordsFilters.length > 0){
|
|
9100
9107
|
filters.push(keywordsFilters);
|
|
9101
|
-
}
|
|
9108
|
+
}
|
|
9102
9109
|
|
|
9103
9110
|
var fieldFilters = ${JSON.stringify(field.filters)};
|
|
9104
9111
|
if(fieldFilters && fieldFilters.length){
|
|
@@ -9210,13 +9217,13 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
9210
9217
|
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user" && !isMobile){
|
|
9211
9218
|
headerToolbarItems = getLookupSapceUserTreeSchema();
|
|
9212
9219
|
pickerSchema["style"] = {
|
|
9213
|
-
"margin-left":"
|
|
9220
|
+
"margin-left":"330px",
|
|
9214
9221
|
"min-height": "300px"
|
|
9215
9222
|
};
|
|
9216
9223
|
pickerSchema.className = pickerSchema.className || "" + " steedos-select-user";
|
|
9217
9224
|
}
|
|
9218
9225
|
|
|
9219
|
-
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, ctx.formFactor, { headerToolbarItems });
|
|
9226
|
+
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { headerToolbarItems, isLookup: true, keywordsSearchBoxName });
|
|
9220
9227
|
const isAllowCreate = refObjectConfig.permissions.allowCreate;
|
|
9221
9228
|
if (isAllowCreate) {
|
|
9222
9229
|
const new_button = await getSchema$5(refObjectConfig, { appId: ctx.appId, objectName: refObjectConfig.name, formFactor: ctx.formFactor });
|
|
@@ -9227,8 +9234,9 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
9227
9234
|
pickerSchema.footerToolbar = refObjectConfig.enable_tree ? [] : getObjectFooterToolbar();
|
|
9228
9235
|
if (ctx.filterVisible !== false) {
|
|
9229
9236
|
pickerSchema.filter = await getObjectFilter(refObjectConfig, fields, {
|
|
9237
|
+
...ctx,
|
|
9230
9238
|
isLookup: true,
|
|
9231
|
-
|
|
9239
|
+
keywordsSearchBoxName
|
|
9232
9240
|
});
|
|
9233
9241
|
}
|
|
9234
9242
|
pickerSchema.data = Object.assign({}, pickerSchema.data, {
|
|
@@ -9564,7 +9572,7 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
9564
9572
|
}
|
|
9565
9573
|
|
|
9566
9574
|
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user"){
|
|
9567
|
-
if(ctx.idsDependOn
|
|
9575
|
+
if(ctx.idsDependOn){
|
|
9568
9576
|
// ids人员点选模式
|
|
9569
9577
|
return await lookupToAmisIdsPicker(field, readonly, ctx);
|
|
9570
9578
|
}
|
|
@@ -9939,6 +9947,7 @@ const getAmisFileSchema = (steedosField, readonly)=>{
|
|
|
9939
9947
|
return readonly ? getAmisFileReadonlySchema(steedosField) : getAmisFileEditSchema(steedosField);
|
|
9940
9948
|
};
|
|
9941
9949
|
|
|
9950
|
+
const QUICK_SEARCHABLE_FIELD_TYPES = ["text", "textarea", "autonumber", "url", "email"];
|
|
9942
9951
|
const OMIT_FIELDS = ['created', 'created_by', 'modified', 'modified_by'];
|
|
9943
9952
|
// const Lookup = require('./lookup');
|
|
9944
9953
|
|
|
@@ -10711,8 +10720,22 @@ if (typeof window != 'undefined') {
|
|
|
10711
10720
|
window.isFieldTypeSearchable = isFieldTypeSearchable;
|
|
10712
10721
|
}
|
|
10713
10722
|
|
|
10723
|
+
|
|
10724
|
+
function isFieldQuickSearchable(field, nameFieldKey) {
|
|
10725
|
+
let fieldSearchable = field.searchable;
|
|
10726
|
+
if(fieldSearchable !== false && field.name === nameFieldKey){
|
|
10727
|
+
// 对象上名称字段的searchable默认认为是true
|
|
10728
|
+
fieldSearchable = true;
|
|
10729
|
+
}
|
|
10730
|
+
if (fieldSearchable && QUICK_SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1) {
|
|
10731
|
+
return true;
|
|
10732
|
+
}
|
|
10733
|
+
return false;
|
|
10734
|
+
}
|
|
10735
|
+
|
|
10714
10736
|
var index = /*#__PURE__*/Object.freeze({
|
|
10715
10737
|
__proto__: null,
|
|
10738
|
+
QUICK_SEARCHABLE_FIELD_TYPES: QUICK_SEARCHABLE_FIELD_TYPES,
|
|
10716
10739
|
OMIT_FIELDS: OMIT_FIELDS,
|
|
10717
10740
|
getBaseFields: getBaseFields,
|
|
10718
10741
|
getAmisFieldType: getAmisFieldType,
|
|
@@ -10723,6 +10746,7 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
10723
10746
|
convertSFieldToAmisField: convertSFieldToAmisField,
|
|
10724
10747
|
getFieldSearchable: getFieldSearchable,
|
|
10725
10748
|
isFieldTypeSearchable: isFieldTypeSearchable,
|
|
10749
|
+
isFieldQuickSearchable: isFieldQuickSearchable,
|
|
10726
10750
|
getAmisStaticFieldType: getAmisStaticFieldType
|
|
10727
10751
|
});
|
|
10728
10752
|
|
|
@@ -11499,8 +11523,9 @@ async function getTableApi(mainObject, fields, options){
|
|
|
11499
11523
|
if(filter){
|
|
11500
11524
|
baseFilters = filter;
|
|
11501
11525
|
}
|
|
11502
|
-
|
|
11503
|
-
|
|
11526
|
+
|
|
11527
|
+
___default__namespace.each(fields, function (field) {
|
|
11528
|
+
if (isFieldQuickSearchable(field, mainObject.NAME_FIELD_KEY)) {
|
|
11504
11529
|
searchableFields.push(field.name);
|
|
11505
11530
|
}
|
|
11506
11531
|
});
|
|
@@ -11628,19 +11653,10 @@ async function getTableApi(mainObject, fields, options){
|
|
|
11628
11653
|
})
|
|
11629
11654
|
}
|
|
11630
11655
|
|
|
11631
|
-
|
|
11632
|
-
|
|
11633
|
-
allowSearchFields.forEach(function(key, index){
|
|
11634
|
-
const keyValue = selfData.__keywords;
|
|
11635
|
-
if(keyValue){
|
|
11636
|
-
keywordsFilters.push([key, "contains", keyValue]);
|
|
11637
|
-
if(index < allowSearchFields.length - 1){
|
|
11638
|
-
keywordsFilters.push('or');
|
|
11639
|
-
}
|
|
11640
|
-
}
|
|
11641
|
-
})
|
|
11656
|
+
var keywordsFilters = SteedosUI.getKeywordsSearchFilter(selfData.__keywords, allowSearchFields);
|
|
11657
|
+
if(keywordsFilters && keywordsFilters.length > 0){
|
|
11642
11658
|
userFilters.push(keywordsFilters);
|
|
11643
|
-
}
|
|
11659
|
+
}
|
|
11644
11660
|
|
|
11645
11661
|
let filters = [];
|
|
11646
11662
|
|
|
@@ -19700,7 +19716,8 @@ var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, f
|
|
|
19700
19716
|
type: 'service',
|
|
19701
19717
|
className: {
|
|
19702
19718
|
"h-full": "true",
|
|
19703
|
-
"sm:px-3 sm:pt-3": "${display != 'split'}"
|
|
19719
|
+
"sm:px-3 sm:pt-3 page-list-grid": "${display != 'split'}",
|
|
19720
|
+
"page-list-split": "${display == 'split'}"
|
|
19704
19721
|
},
|
|
19705
19722
|
body: listSchema
|
|
19706
19723
|
}];
|
|
@@ -19819,7 +19836,7 @@ var PageObject = function (props) { return __awaiter(void 0, void 0, void 0, fun
|
|
|
19819
19836
|
});
|
|
19820
19837
|
}); };
|
|
19821
19838
|
|
|
19822
|
-
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)}},standard_export_excel:{visible:function(e,t,r){return !1}}}}},authRequest=function(e,t){var i=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){i=e;},error:function(e,t,r){var n,o;e.responseJSON&&e.responseJSON.error?(n=e.responseJSON.error,o=void(i={error:n}),o=n.reason||n.message||n,console.error(o)):console.error(e.responseJSON);}};return $.ajax(Object.assign({},n,t)),i}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 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(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,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("."))}(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(i));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=(express,multiple)=>{const reg=/^\{\w+(\.*\w+)*\}$/,reg2=/^{{[\s\S]*}}$/;let result=express;if(reg.test(express)&&(result=-1<express.indexOf("userId")||-1<express.indexOf("spaceId")||-1<express.indexOf("user.")||-1<express.indexOf("now")?`{${express}}`.replace("{{","{{global."):`{${express}}`.replace("{{","{{formData."),multiple&&(result=result.replace(/\{\{(.+)\}\}/,"{{[$1]}}"))),reg2.test(express)&&(-1<express.indexOf("function")||-1<express.indexOf("=>"))){let regex=/\{\{([\s\S]*)\}\}/,matches=regex.exec(express);if(matches&&1<matches.length){let functionCode=matches[1];result=eval("("+functionCode+")")();}}return result},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=[],i=(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=i(t,e.children,n-1))):e.children&&(e.children=i(t,e.children,n));}),e};for(var s=t,a=0;a<s.length;a++)if(s[a].noParent=0,s[a].unfolded=!1,s[a].parent){let e=1;for(var l=0;l<s.length;l++)s[a].parent==s[l][o]&&(e=0);1==e&&(s[a].noParent=1);}else s[a].noParent=1;return _.each(t,e=>{1==e.noParent&&(1<=r?(e.unfolded=!0,n.push(Object.assign({},e,{children:i(t,e.children,r-1)}))):n.push(Object.assign({},e,{children:i(t,e.children,r)})));}),n}function getClosestAmisComponentByType(t,r,n){let o=(n=n||{}).name;var e=n.direction||"up";let i=t.getComponents().find(function(e){return e.props.type===r&&(!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],r,n));e++);return i}}else if("up"===e&&t.parent)return getClosestAmisComponentByType(t.parent,r,n)}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 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,getClosestAmisComponentByType:getClosestAmisComponentByType,isFilterFormValuesEmpty:isFilterFormValuesEmpty,getSearchFilter:e=>{var o=[];return _.each(e,(e,t)=>{var r,n;_.isEmpty(e)&&!_.isBoolean(e)||(_.startsWith(t,"__searchable__between__")?o.push([""+t.replace("__searchable__between__",""),"between",e]):_.startsWith(t,"__searchable__")&&(_.isString(e)?o.push([""+t.replace("__searchable__",""),"contains",e]):_.isObject(e)&&e.o?(n=[[(r=""+t.replace("__searchable__",""))+"/o","=",e.o]],e.ids.length&&n.push([r+"/ids","=",e.ids]),o.push(n)):o.push([""+t.replace("__searchable__",""),"=",e])));}),o}});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);
|
|
19839
|
+
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)}},standard_export_excel:{visible:function(e,t,r){return !1}}}}},authRequest=function(e,t){var s=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){s=e;},error:function(e,t,r){var n,o;e.responseJSON&&e.responseJSON.error?(n=e.responseJSON.error,o=void(s={error:n}),o=n.reason||n.message||n,console.error(o)):console.error(e.responseJSON);}};return $.ajax(Object.assign({},n,t)),s}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 s=window.Creator;if(!!(!s||!s.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,s=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(s));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=(express,multiple)=>{const reg=/^\{\w+(\.*\w+)*\}$/,reg2=/^{{[\s\S]*}}$/;let result=express;if(reg.test(express)&&(result=-1<express.indexOf("userId")||-1<express.indexOf("spaceId")||-1<express.indexOf("user.")||-1<express.indexOf("now")?`{${express}}`.replace("{{","{{global."):`{${express}}`.replace("{{","{{formData."),multiple&&(result=result.replace(/\{\{(.+)\}\}/,"{{[$1]}}"))),reg2.test(express)&&(-1<express.indexOf("function")||-1<express.indexOf("=>"))){let regex=/\{\{([\s\S]*)\}\}/,matches=regex.exec(express);if(matches&&1<matches.length){let functionCode=matches[1];result=eval("("+functionCode+")")();}}return result},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=[],s=(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=s(t,e.children,n-1))):e.children&&(e.children=s(t,e.children,n));}),e};for(var i=t,a=0;a<i.length;a++)if(i[a].noParent=0,i[a].unfolded=!1,i[a].parent){let e=1;for(var l=0;l<i.length;l++)i[a].parent==i[l][o]&&(e=0);1==e&&(i[a].noParent=1);}else i[a].noParent=1;return _.each(t,e=>{1==e.noParent&&(1<=r?(e.unfolded=!0,n.push(Object.assign({},e,{children:s(t,e.children,r-1)}))):n.push(Object.assign({},e,{children:s(t,e.children,r)})));}),n}function getClosestAmisComponentByType(t,r,n){let o=(n=n||{}).name;var e=n.direction||"up";let s=t.getComponents().find(function(e){return e.props.type===r&&(!o||e.props.name===o)});if(s)return s;if("down"===e){if(t.children&&t.children.length){for(let e=0;e<t.children.length&&!(s=getClosestAmisComponentByType(t.children[e],r,n));e++);return s}}else if("up"===e&&t.parent)return getClosestAmisComponentByType(t.parent,r,n)}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 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,getClosestAmisComponentByType:getClosestAmisComponentByType,isFilterFormValuesEmpty:isFilterFormValuesEmpty,getSearchFilter:e=>{var o=[];return _.each(e,(e,t)=>{var r,n;_.isEmpty(e)&&!_.isBoolean(e)||(_.startsWith(t,"__searchable__between__")?o.push([""+t.replace("__searchable__between__",""),"between",e]):_.startsWith(t,"__searchable__")&&(_.isString(e)?o.push([""+t.replace("__searchable__",""),"contains",e]):_.isObject(e)&&e.o?(n=[[(r=""+t.replace("__searchable__",""))+"/o","=",e.o]],e.ids.length&&n.push([r+"/ids","=",e.ids]),o.push(n)):o.push([""+t.replace("__searchable__",""),"=",e])));}),o},getKeywordsSearchFilter:(e,t)=>{const o=[];var s;return e&&t&&(s=e.split(/\s+/),s=___default.compact(s),t.forEach(function(r,e){let n=[];1==s.length?n=[r,"contains",s[0]]:s.forEach(function(e,t){n.push([r,"contains",e]),t<s.length-1&&n.push("or");}),n.length&&(o.push(n),e<t.length-1&&o.push("or"));})),o}});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);
|
|
19823
19840
|
|
|
19824
19841
|
var index_esm = /*#__PURE__*/Object.freeze({
|
|
19825
19842
|
__proto__: null,
|