@steedos-widgets/amis-object 1.2.30 → 1.2.32
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/AmisObjectCalendar.d.ts +9 -0
- package/dist/amis-object.cjs.css +30 -3
- package/dist/amis-object.cjs.js +217 -65
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +30 -3
- package/dist/amis-object.esm.js +217 -65
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +30 -3
- package/dist/amis-object.umd.js +217 -65
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +11 -11
- package/package.json +3 -3
package/dist/amis-object.cjs.js
CHANGED
|
@@ -3656,7 +3656,7 @@ function getNameTpl(field, ctx){
|
|
|
3656
3656
|
|
|
3657
3657
|
function getRelatedFieldTpl(field, ctx){
|
|
3658
3658
|
let tpl = '';
|
|
3659
|
-
if(!field.reference_to && (field.optionsFunction || field._optionsFunction)){
|
|
3659
|
+
if(!field.reference_to && (field.optionsFunction || field._optionsFunction || field.options)){
|
|
3660
3660
|
if(field.isTableField){
|
|
3661
3661
|
return `\${${field.name}}`
|
|
3662
3662
|
}else {
|
|
@@ -4120,6 +4120,7 @@ var frontend_form_cancel$1 = "Cancel";
|
|
|
4120
4120
|
var frontend_form_new$1 = "New";
|
|
4121
4121
|
var frontend_form_edit$1 = "Edit";
|
|
4122
4122
|
var frontend_form_select$1 = "Select";
|
|
4123
|
+
var frontend_form_please_select$1 = "Please select";
|
|
4123
4124
|
var frontend_form_confirm$1 = "Confirm";
|
|
4124
4125
|
var frontend_form_delete$1 = "Delete";
|
|
4125
4126
|
var frontend_form_view$1 = "view";
|
|
@@ -4201,6 +4202,7 @@ var en_us = {
|
|
|
4201
4202
|
frontend_form_new: frontend_form_new$1,
|
|
4202
4203
|
frontend_form_edit: frontend_form_edit$1,
|
|
4203
4204
|
frontend_form_select: frontend_form_select$1,
|
|
4205
|
+
frontend_form_please_select: frontend_form_please_select$1,
|
|
4204
4206
|
frontend_form_confirm: frontend_form_confirm$1,
|
|
4205
4207
|
frontend_form_delete: frontend_form_delete$1,
|
|
4206
4208
|
frontend_form_view: frontend_form_view$1,
|
|
@@ -4283,6 +4285,7 @@ var frontend_form_cancel = "取消";
|
|
|
4283
4285
|
var frontend_form_new = "新建";
|
|
4284
4286
|
var frontend_form_edit = "编辑";
|
|
4285
4287
|
var frontend_form_select = "选择";
|
|
4288
|
+
var frontend_form_please_select = "请选择";
|
|
4286
4289
|
var frontend_form_confirm = "确认";
|
|
4287
4290
|
var frontend_form_delete = "删除";
|
|
4288
4291
|
var frontend_form_view = "查看";
|
|
@@ -4365,6 +4368,7 @@ var zh_cn = {
|
|
|
4365
4368
|
frontend_form_new: frontend_form_new,
|
|
4366
4369
|
frontend_form_edit: frontend_form_edit,
|
|
4367
4370
|
frontend_form_select: frontend_form_select,
|
|
4371
|
+
frontend_form_please_select: frontend_form_please_select,
|
|
4368
4372
|
frontend_form_confirm: frontend_form_confirm,
|
|
4369
4373
|
frontend_form_delete: frontend_form_delete,
|
|
4370
4374
|
frontend_form_view: frontend_form_view,
|
|
@@ -5731,7 +5735,8 @@ const StandardButtons = {
|
|
|
5731
5735
|
} = this;
|
|
5732
5736
|
const scopeId = this.scopeId || `amis-${appId}-${objectName}-listview`;
|
|
5733
5737
|
const scope = this.scope || SteedosUI?.getRef(scopeId);
|
|
5734
|
-
|
|
5738
|
+
//https://github.com/baidu/amis/pull/6807 .parent的改动是为适应3.2getComponentById的规则改动,不影响2.9
|
|
5739
|
+
const listViewRef = scope.parent?.getComponentById(`listview_${uiSchema.name}`);
|
|
5735
5740
|
if(_.isEmpty(listViewRef.props.store.toJSON().selectedItems)){
|
|
5736
5741
|
listViewRef.handleAction({}, {
|
|
5737
5742
|
"actionType": "toast",
|
|
@@ -8277,7 +8282,7 @@ const getSettingListviewToolbarButtonSchema = ()=>{
|
|
|
8277
8282
|
"trigger": "click",
|
|
8278
8283
|
"icon": "fa fa-cog",
|
|
8279
8284
|
"tooltip": instance.t('frontend_button_listview_control_tooltip'),
|
|
8280
|
-
"btnClassName": "antd-Button--iconOnly bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
8285
|
+
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded border-gray-300 text-gray-500",
|
|
8281
8286
|
"align": "right",
|
|
8282
8287
|
"visibleOn": "${!isLookup}",
|
|
8283
8288
|
"buttons": [
|
|
@@ -8321,7 +8326,7 @@ const getDisplayAsButton = function(objectName, showDisplayAs){
|
|
|
8321
8326
|
"type": "dropdown-button",
|
|
8322
8327
|
"icon": "fa fa-table-columns",
|
|
8323
8328
|
"tooltip": `${instance.t('frontend_display_as')} ${displayAsLabel}`,
|
|
8324
|
-
"btnClassName": "antd-Button--iconOnly bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
8329
|
+
"btnClassName": "antd-Button--iconOnly bg-white !p-2 rounded border-gray-300 text-gray-500",
|
|
8325
8330
|
"align": "right",
|
|
8326
8331
|
"visibleOn": "${window:innerWidth > 768 && !!!isLookup}",
|
|
8327
8332
|
"buttons": [
|
|
@@ -8983,6 +8988,14 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
8983
8988
|
}
|
|
8984
8989
|
}
|
|
8985
8990
|
|
|
8991
|
+
if(${referenceTo?.objectName === "space_users"} && ${field.reference_to_field === "user"}){
|
|
8992
|
+
if(filters.length > 0){
|
|
8993
|
+
filters = [ ["user_accepted", "=", true], "and", filters ]
|
|
8994
|
+
}else{
|
|
8995
|
+
filters = [["user_accepted", "=", true]];
|
|
8996
|
+
}
|
|
8997
|
+
}
|
|
8998
|
+
|
|
8986
8999
|
|
|
8987
9000
|
if(allowSearchFields){
|
|
8988
9001
|
allowSearchFields.forEach(function(key){
|
|
@@ -9199,6 +9212,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
9199
9212
|
|
|
9200
9213
|
const data = {
|
|
9201
9214
|
type: getAmisStaticFieldType('picker', readonly),
|
|
9215
|
+
modalTitle: instance.t('frontend_form_please_select') + " " + refObjectConfig.label,
|
|
9202
9216
|
labelField: referenceTo.labelField.name,
|
|
9203
9217
|
valueField: referenceTo.valueField.name,
|
|
9204
9218
|
modalMode: 'dialog', //TODO 设置 dialog 或者 drawer,用来配置弹出方式
|
|
@@ -9315,6 +9329,14 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
9315
9329
|
filters.push(fieldFilters);
|
|
9316
9330
|
}
|
|
9317
9331
|
|
|
9332
|
+
if(${referenceTo?.objectName === "space_users"} && ${field.reference_to_field === "user"}){
|
|
9333
|
+
if(filters.length > 0){
|
|
9334
|
+
filters = [ ["user_accepted", "=", true], "and", filters ]
|
|
9335
|
+
}else{
|
|
9336
|
+
filters = [["user_accepted", "=", true]];
|
|
9337
|
+
}
|
|
9338
|
+
}
|
|
9339
|
+
|
|
9318
9340
|
const inFilterForm = ${ctx.inFilterForm};
|
|
9319
9341
|
const filtersFunction = ${field.filtersFunction || field._filtersFunction};
|
|
9320
9342
|
|
|
@@ -9354,6 +9376,18 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
9354
9376
|
payload.data.options = options;
|
|
9355
9377
|
return payload;
|
|
9356
9378
|
`;
|
|
9379
|
+
}else if(field.options){
|
|
9380
|
+
apiInfo.adaptor = `
|
|
9381
|
+
var options = ${JSON.stringify(field.options)}
|
|
9382
|
+
if(api.data.$term){
|
|
9383
|
+
options = _.filter(options, function(o) {
|
|
9384
|
+
var label = o.label;
|
|
9385
|
+
return label.toLowerCase().indexOf(api.data.$term.toLowerCase()) > -1;
|
|
9386
|
+
});
|
|
9387
|
+
}
|
|
9388
|
+
payload.data.options = options;
|
|
9389
|
+
return payload;
|
|
9390
|
+
`;
|
|
9357
9391
|
}
|
|
9358
9392
|
|
|
9359
9393
|
const data = {
|
|
@@ -9433,11 +9467,6 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
9433
9467
|
// ids人员点选模式
|
|
9434
9468
|
return await lookupToAmisIdsPicker(field, readonly, ctx);
|
|
9435
9469
|
}
|
|
9436
|
-
if(!field.filters || field.filters.length == 0){
|
|
9437
|
-
field.filters = [["user_accepted", "=", true]];
|
|
9438
|
-
}else {
|
|
9439
|
-
field.filters = [ ["user_accepted", "=", true], "and", field.filters ];
|
|
9440
|
-
}
|
|
9441
9470
|
// 左侧树右侧人员列表的下拉框模式,不再支持,而是执行下面的lookupToAmisPicker函数弹出选人窗口
|
|
9442
9471
|
// return await lookupToAmisSelectUser(field, readonly, ctx);
|
|
9443
9472
|
}
|
|
@@ -9657,8 +9686,8 @@ const getHtmlFieldSchema = (field, readonly, ctx)=>{
|
|
|
9657
9686
|
/*
|
|
9658
9687
|
* @Author: baozhoutao@steedos.com
|
|
9659
9688
|
* @Date: 2022-10-28 14:52:55
|
|
9660
|
-
* @LastEditors:
|
|
9661
|
-
* @LastEditTime: 2023-
|
|
9689
|
+
* @LastEditors: liaodaxue
|
|
9690
|
+
* @LastEditTime: 2023-07-14 17:18:42
|
|
9662
9691
|
* @Description:
|
|
9663
9692
|
*/
|
|
9664
9693
|
|
|
@@ -9690,6 +9719,8 @@ function getAmisStaticFieldType(type, readonly, options){
|
|
|
9690
9719
|
return `static-images`;
|
|
9691
9720
|
}
|
|
9692
9721
|
return `static-${type}`;
|
|
9722
|
+
}else if(type === 'url'){
|
|
9723
|
+
return "input-url"
|
|
9693
9724
|
}else {
|
|
9694
9725
|
return 'static';
|
|
9695
9726
|
}
|
|
@@ -9925,13 +9956,13 @@ function getSelectFieldOptions(field){
|
|
|
9925
9956
|
___default__namespace.each(field.options, (item)=>{
|
|
9926
9957
|
switch (dataType) {
|
|
9927
9958
|
case 'number':
|
|
9928
|
-
options.push({label: item.label, value: Number(item.value)});
|
|
9959
|
+
options.push({label: item.label, value: Number(item.value), icon: item.icon});
|
|
9929
9960
|
break;
|
|
9930
9961
|
case 'text':
|
|
9931
|
-
options.push({label: item.label, value: String(item.value)});
|
|
9962
|
+
options.push({label: item.label, value: String(item.value), icon: item.icon});
|
|
9932
9963
|
break;
|
|
9933
9964
|
case 'boolean':
|
|
9934
|
-
options.push({label: item.label, value: item.value === 'false' ? false : true});
|
|
9965
|
+
options.push({label: item.label, value: item.value === 'false' ? false : true, icon: item.icon});
|
|
9935
9966
|
break;
|
|
9936
9967
|
}
|
|
9937
9968
|
});
|
|
@@ -9993,6 +10024,17 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
9993
10024
|
labelField: 'label',
|
|
9994
10025
|
valueField: 'value'
|
|
9995
10026
|
};
|
|
10027
|
+
const select_menuTpl = `<span class='flex items-center mt-0.5'>
|
|
10028
|
+
<span role='img' aria-label='smile' class='anticon anticon-smile'>
|
|
10029
|
+
<span class='slds-icon_container slds-icon-standard-\${REPLACE(icon,'_','-')}'>
|
|
10030
|
+
<svg class='slds-icon slds-icon_x-small' aria-hidden='true'>
|
|
10031
|
+
<use xlink:href='/assets/icons/standard-sprite/svg/symbols.svg#\${icon}'></use>
|
|
10032
|
+
</svg>
|
|
10033
|
+
</span>
|
|
10034
|
+
</span>
|
|
10035
|
+
<span class='pl-1.5'>\${label}</span>
|
|
10036
|
+
</span>`;
|
|
10037
|
+
convertData.menuTpl = "${icon ? `"+select_menuTpl+"` : label}";
|
|
9996
10038
|
if(field.multiple){
|
|
9997
10039
|
convertData.multiple = true;
|
|
9998
10040
|
convertData.extractValue = true;
|
|
@@ -10206,7 +10248,8 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
10206
10248
|
break;
|
|
10207
10249
|
case 'url':
|
|
10208
10250
|
convertData = {
|
|
10209
|
-
type: getAmisStaticFieldType('url', readonly, field)
|
|
10251
|
+
type: getAmisStaticFieldType('url', readonly, field),
|
|
10252
|
+
static: readonly ? true : false
|
|
10210
10253
|
};
|
|
10211
10254
|
if(readonly && field.show_as_qr){
|
|
10212
10255
|
convertData = {
|
|
@@ -10540,17 +10583,19 @@ async function getQuickEditSchema(field, options){
|
|
|
10540
10583
|
return EventType;
|
|
10541
10584
|
};
|
|
10542
10585
|
switch (field.type) {
|
|
10543
|
-
//TODO:amis的picker组件直接点击选项x时不会触发change事件,待处理
|
|
10586
|
+
//TODO: amis的picker组件直接点击选项x时不会触发change事件,待处理
|
|
10544
10587
|
case "lookup":
|
|
10545
10588
|
case "master_detail":
|
|
10589
|
+
let labelField = quickEditSchema.body[0].labelField || "label";
|
|
10590
|
+
let valueField = quickEditSchema.body[0].valueField || "value";
|
|
10546
10591
|
if (field.multiple) {
|
|
10547
10592
|
TempDisplayField = `
|
|
10548
10593
|
_display["${field.name}"] = [];
|
|
10549
|
-
event.data.
|
|
10594
|
+
event.data.selectedItems.forEach(function(item,index){
|
|
10550
10595
|
_display["${field.name}"].push(
|
|
10551
10596
|
{
|
|
10552
|
-
"label":
|
|
10553
|
-
"value":
|
|
10597
|
+
"label": item.${labelField},
|
|
10598
|
+
"value": item.${valueField},
|
|
10554
10599
|
"objectName": "${field.reference_to}"
|
|
10555
10600
|
}
|
|
10556
10601
|
)
|
|
@@ -10559,8 +10604,8 @@ async function getQuickEditSchema(field, options){
|
|
|
10559
10604
|
} else {
|
|
10560
10605
|
TempDisplayField = `
|
|
10561
10606
|
_display["${field.name}"] = {
|
|
10562
|
-
"label": event.data.
|
|
10563
|
-
"value": event.data.
|
|
10607
|
+
"label": event.data.selectedItems.${labelField},
|
|
10608
|
+
"value": event.data.selectedItems.${valueField},
|
|
10564
10609
|
"objectName": "${field.reference_to}"
|
|
10565
10610
|
}
|
|
10566
10611
|
`;
|
|
@@ -10724,7 +10769,7 @@ async function getTableColumns$1(fields, options){
|
|
|
10724
10769
|
type: "switch",
|
|
10725
10770
|
name: field.name,
|
|
10726
10771
|
label: field.label,
|
|
10727
|
-
width: field.width,
|
|
10772
|
+
width: field.width || defaultWidth,
|
|
10728
10773
|
toggled: field.toggled,
|
|
10729
10774
|
static: true,
|
|
10730
10775
|
className:"whitespace-nowrap",
|
|
@@ -10745,6 +10790,10 @@ async function getTableColumns$1(fields, options){
|
|
|
10745
10790
|
}
|
|
10746
10791
|
else if(field.type === 'select'){
|
|
10747
10792
|
const map = getSelectMap(field.options);
|
|
10793
|
+
let className = "";
|
|
10794
|
+
if(field.wrap === false){
|
|
10795
|
+
className += " whitespace-nowrap";
|
|
10796
|
+
}
|
|
10748
10797
|
columns.push(Object.assign({}, {
|
|
10749
10798
|
type: "mapping",
|
|
10750
10799
|
name: field.name,
|
|
@@ -10753,7 +10802,7 @@ async function getTableColumns$1(fields, options){
|
|
|
10753
10802
|
sortable: field.sortable,
|
|
10754
10803
|
width: field.width || defaultWidth,
|
|
10755
10804
|
toggled: field.toggled,
|
|
10756
|
-
className
|
|
10805
|
+
className,
|
|
10757
10806
|
static: true,
|
|
10758
10807
|
quickEdit: quickEditSchema
|
|
10759
10808
|
}, field.amis, {name: field.name}));
|
|
@@ -10765,8 +10814,12 @@ async function getTableColumns$1(fields, options){
|
|
|
10765
10814
|
type = 'tpl';
|
|
10766
10815
|
}else if(field.type === 'html'){
|
|
10767
10816
|
type = 'markdown';
|
|
10768
|
-
}else if(field.type === 'url'
|
|
10769
|
-
|
|
10817
|
+
}else if(field.type === 'url'){
|
|
10818
|
+
if(field.show_as_qr){
|
|
10819
|
+
type = 'qr-code';
|
|
10820
|
+
}else {
|
|
10821
|
+
type = 'input-url';
|
|
10822
|
+
}
|
|
10770
10823
|
}
|
|
10771
10824
|
let className = "";
|
|
10772
10825
|
if(field.type === 'textarea'){
|
|
@@ -11392,7 +11445,10 @@ async function getTableApi(mainObject, fields, options){
|
|
|
11392
11445
|
if(item[key]){
|
|
11393
11446
|
if(field._optionsFunction){
|
|
11394
11447
|
const optionsFunction = eval("(" + field._optionsFunction+ ")")(item);
|
|
11395
|
-
item[key + '__label'] = _.map(_.filter(optionsFunction, function(option){return
|
|
11448
|
+
item[key + '__label'] = _.map(_.filter(optionsFunction, function(option){return item[key] == option.value}), 'label').join(' ');
|
|
11449
|
+
}else if(field.options){
|
|
11450
|
+
const options = field.options;
|
|
11451
|
+
item[key + '__label'] = _.map(_.filter(options, function(option){return item[key] == option.value}), 'label').join(' ');
|
|
11396
11452
|
}
|
|
11397
11453
|
}
|
|
11398
11454
|
})
|
|
@@ -11447,7 +11503,8 @@ async function getTableApi(mainObject, fields, options){
|
|
|
11447
11503
|
|
|
11448
11504
|
const setDataToComponentId = "${setDataToComponentId}";
|
|
11449
11505
|
if(setDataToComponentId){
|
|
11450
|
-
|
|
11506
|
+
//https://github.com/baidu/amis/pull/6807 .parent的改动是为适应3.2getComponentById的规则改动,不影响2.9
|
|
11507
|
+
SteedosUI.getRef(api.body.$self.$scopeId)?.parent?.getComponentById(setDataToComponentId)?.setData({$count: payload.data.count})
|
|
11451
11508
|
};
|
|
11452
11509
|
${options.adaptor || ''}
|
|
11453
11510
|
return payload;
|
|
@@ -12139,17 +12196,18 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
|
|
|
12139
12196
|
"objectApiName": "\${objectName}",
|
|
12140
12197
|
"mode": "edit",
|
|
12141
12198
|
"defaultData": doc,
|
|
12142
|
-
|
|
12143
|
-
|
|
12144
|
-
|
|
12145
|
-
|
|
12146
|
-
|
|
12147
|
-
|
|
12148
|
-
|
|
12149
|
-
|
|
12150
|
-
|
|
12151
|
-
|
|
12152
|
-
}
|
|
12199
|
+
//改回为通用的提交事件
|
|
12200
|
+
// "onEvent": {
|
|
12201
|
+
// "submitSucc": {
|
|
12202
|
+
// "weight": 0,
|
|
12203
|
+
// "actions": [
|
|
12204
|
+
// {
|
|
12205
|
+
// "actionType": "custom",
|
|
12206
|
+
// "script": "event.data.view?.calendar.refetchEvents();"
|
|
12207
|
+
// }
|
|
12208
|
+
// ]
|
|
12209
|
+
// }
|
|
12210
|
+
// }
|
|
12153
12211
|
}
|
|
12154
12212
|
],
|
|
12155
12213
|
"closeOnEsc": false,
|
|
@@ -12278,6 +12336,20 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
|
|
|
12278
12336
|
"script": "console.log('eventsSet'); console.log(event);"
|
|
12279
12337
|
}
|
|
12280
12338
|
]
|
|
12339
|
+
},
|
|
12340
|
+
"getRef": {
|
|
12341
|
+
"weight": 0,
|
|
12342
|
+
"actions": [
|
|
12343
|
+
{
|
|
12344
|
+
"componentId": `service_${options.id}`,
|
|
12345
|
+
"args": {
|
|
12346
|
+
"value":{
|
|
12347
|
+
"calendarRef": "${event.data.calendarRef}"
|
|
12348
|
+
}
|
|
12349
|
+
},
|
|
12350
|
+
"actionType": "setValue",
|
|
12351
|
+
}
|
|
12352
|
+
]
|
|
12281
12353
|
}
|
|
12282
12354
|
};
|
|
12283
12355
|
|
|
@@ -12313,6 +12385,7 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
|
|
|
12313
12385
|
const amisSchema = {
|
|
12314
12386
|
"type": "steedos-fullcalendar",
|
|
12315
12387
|
"label": "",
|
|
12388
|
+
"id": options.id,
|
|
12316
12389
|
"name": "fullcalendar",
|
|
12317
12390
|
"placeholder":"${additionalFilters}",//用于触发reload
|
|
12318
12391
|
"editable": permissions.allowEdit,
|
|
@@ -12335,7 +12408,7 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
|
|
|
12335
12408
|
* @Author: baozhoutao@steedos.com
|
|
12336
12409
|
* @Date: 2022-05-26 16:02:08
|
|
12337
12410
|
* @LastEditors: liaodaxue
|
|
12338
|
-
* @LastEditTime: 2023-
|
|
12411
|
+
* @LastEditTime: 2023-07-12 15:45:55
|
|
12339
12412
|
* @Description:
|
|
12340
12413
|
*/
|
|
12341
12414
|
|
|
@@ -12394,7 +12467,11 @@ const getSection = async (formFields, permissionFields, fieldSchemaArray, sectio
|
|
|
12394
12467
|
|
|
12395
12468
|
// fieldSet 已支持显隐控制
|
|
12396
12469
|
const sectionFieldsVisibleOn = ___default__namespace.map(___default__namespace.compact(___default__namespace.map(fieldSetBody, 'visibleOn')), (visibleOn) => {
|
|
12397
|
-
|
|
12470
|
+
let visible = visibleOn;
|
|
12471
|
+
if(visible.indexOf('${')>-1){
|
|
12472
|
+
visible = visible.substring(visible.indexOf('{')+1, visible.indexOf('}'));
|
|
12473
|
+
}
|
|
12474
|
+
return visible ? "("+visible+")" : visible;
|
|
12398
12475
|
});
|
|
12399
12476
|
|
|
12400
12477
|
let section = {
|
|
@@ -16835,6 +16912,7 @@ var index_esm$1 = /*#__PURE__*/Object.freeze({
|
|
|
16835
16912
|
getRecordPageInitSchema: getRecordPageInitSchema,
|
|
16836
16913
|
getRecordPermissions: getRecordPermissions,
|
|
16837
16914
|
getRecordServiceSchema: getRecordServiceSchema,
|
|
16915
|
+
getReferenceTo: getReferenceTo,
|
|
16838
16916
|
getRelatedFieldValue: getRelatedFieldValue,
|
|
16839
16917
|
getRelatedListSchema: getRelatedListSchema,
|
|
16840
16918
|
getRelatedsCount: getRelatedsCount,
|
|
@@ -17588,32 +17666,45 @@ var AmisObjectTable = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
17588
17666
|
}); };
|
|
17589
17667
|
|
|
17590
17668
|
var AmisObjectCalendar = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
17591
|
-
var top, sort, filters, filtersFunction, title, currentView, startDateExpr, endDateExpr, allDayExpr, textExpr, data, defaultData, _a, className, onEvent, config, objectApiName, amisSchemaData, schema, uiSchema, amisSchema, serviceData;
|
|
17592
|
-
|
|
17593
|
-
|
|
17669
|
+
var top, sort, filters, filtersFunction, title, currentView, startDateExpr, endDateExpr, allDayExpr, textExpr, data, defaultData, _a, className, onEvent, config, objectApiName, amisSchemaData, id, schema, uiSchema, amisSchema, serviceData;
|
|
17670
|
+
var _b;
|
|
17671
|
+
return __generator(this, function (_c) {
|
|
17672
|
+
switch (_c.label) {
|
|
17594
17673
|
case 0:
|
|
17595
17674
|
console.log("AmisObjectCalendar props", props);
|
|
17596
17675
|
props.$schema, top = props.top, sort = props.sort, filters = props.filters, filtersFunction = props.filtersFunction, title = props.title, currentView = props.currentView, startDateExpr = props.startDateExpr, endDateExpr = props.endDateExpr, allDayExpr = props.allDayExpr, textExpr = props.textExpr, data = props.data, defaultData = props.defaultData, _a = props.className, className = _a === void 0 ? "" : _a, onEvent = props.onEvent, config = props.config;
|
|
17597
17676
|
objectApiName = props.objectApiName || "events";
|
|
17598
17677
|
amisSchemaData = Object.assign({}, data, defaultData);
|
|
17678
|
+
id = props.id || "steedos_object_calendar_".concat(objectApiName);
|
|
17599
17679
|
return [4 /*yield*/, getCalendarSchema(amisSchemaData.appId, objectApiName, {
|
|
17600
17680
|
title: title,
|
|
17601
17681
|
currentView: currentView,
|
|
17602
17682
|
startDateExpr: startDateExpr,
|
|
17603
17683
|
endDateExpr: endDateExpr,
|
|
17604
17684
|
allDayExpr: allDayExpr,
|
|
17605
|
-
textExpr: textExpr
|
|
17606
|
-
}, { top: top, sort: sort, filter: filters, filtersFunction: filtersFunction, onEvent: onEvent, config: config })];
|
|
17685
|
+
textExpr: textExpr,
|
|
17686
|
+
}, { top: top, sort: sort, filter: filters, filtersFunction: filtersFunction, onEvent: onEvent, config: config, id: id })];
|
|
17607
17687
|
case 1:
|
|
17608
|
-
schema = (
|
|
17688
|
+
schema = (_c.sent());
|
|
17609
17689
|
uiSchema = schema.uiSchema;
|
|
17610
17690
|
amisSchema = schema.amisSchema;
|
|
17611
17691
|
serviceData = Object.assign({}, { objectName: objectApiName, uiSchema: uiSchema });
|
|
17612
17692
|
return [2 /*return*/, {
|
|
17613
17693
|
"type": "service",
|
|
17614
17694
|
"body": amisSchema,
|
|
17695
|
+
"id": "service_".concat(id),
|
|
17615
17696
|
"className": "".concat(className),
|
|
17616
|
-
"data": serviceData
|
|
17697
|
+
"data": serviceData,
|
|
17698
|
+
"onEvent": (_b = {},
|
|
17699
|
+
_b["@data.changed.".concat(objectApiName)] = {
|
|
17700
|
+
"actions": [
|
|
17701
|
+
{
|
|
17702
|
+
"actionType": "custom",
|
|
17703
|
+
"script": "context.props.data.calendarRef.current.getApi().refetchEvents()"
|
|
17704
|
+
}
|
|
17705
|
+
]
|
|
17706
|
+
},
|
|
17707
|
+
_b)
|
|
17617
17708
|
}];
|
|
17618
17709
|
}
|
|
17619
17710
|
});
|
|
@@ -18077,8 +18168,6 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
18077
18168
|
"items": {
|
|
18078
18169
|
"type": "button",
|
|
18079
18170
|
"level": "link",
|
|
18080
|
-
"actionType": "link",
|
|
18081
|
-
"link": "${path}",
|
|
18082
18171
|
"body": [{
|
|
18083
18172
|
"type": "tpl",
|
|
18084
18173
|
"wrapperComponent": "span",
|
|
@@ -18088,6 +18177,21 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
18088
18177
|
"onEvent": {
|
|
18089
18178
|
"click": {
|
|
18090
18179
|
"actions": [
|
|
18180
|
+
{
|
|
18181
|
+
"actionType": "link",
|
|
18182
|
+
"args": {
|
|
18183
|
+
"link": "${path}"
|
|
18184
|
+
}
|
|
18185
|
+
},
|
|
18186
|
+
{
|
|
18187
|
+
"actionType": "broadcast",
|
|
18188
|
+
"args": {
|
|
18189
|
+
"eventName": "@tabId.changed"
|
|
18190
|
+
},
|
|
18191
|
+
"data": {
|
|
18192
|
+
"tabId": "${event.data.id}"
|
|
18193
|
+
}
|
|
18194
|
+
},
|
|
18091
18195
|
{
|
|
18092
18196
|
"actionType": "closeDialog"
|
|
18093
18197
|
}
|
|
@@ -18240,7 +18344,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
18240
18344
|
schemaApi: {
|
|
18241
18345
|
"method": "get",
|
|
18242
18346
|
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
|
|
18243
|
-
"adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": _.find(tab_groups, {\"group_name\": groupName})?.default_open != false,\n \"children\": _.map(tabs, (tab) => {\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target\n // active: selectedId === tab.id,\n });\n })\n }\n payload.data = {\n \"type\": \"nav\",\n className: \"").concat(className, "\",\n
|
|
18347
|
+
"adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"\";\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": _.find(tab_groups, {\"group_name\": groupName})?.default_open != false,\n \"children\": _.map(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n });\n })\n }\n\n payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav\n },\n \"id\": \"appMenuService\",\n \"body\":{\n \"type\": \"nav\",\n className: \"").concat(className, "\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n }\n ]\n }\n }\n }\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n return payload;\n "),
|
|
18244
18348
|
"headers": {
|
|
18245
18349
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
18246
18350
|
}
|
|
@@ -18292,7 +18396,7 @@ var AmisGlobalFooter = function (props) { return __awaiter(void 0, void 0, void
|
|
|
18292
18396
|
schemaApi: {
|
|
18293
18397
|
"method": "get",
|
|
18294
18398
|
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus?mobile=true"),
|
|
18295
|
-
"adaptor": "\n try {\n
|
|
18399
|
+
"adaptor": "\n try {\n if(payload.children.length == 0){\n payload.data = {};\n return payload\n }\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"\";\n let sum = 0;\n _.each(payload.children, (tab)=>{\n sum++;\n const classIcon = tab.icon.replace(/_/g,\"-\");\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n if(sum >= 5){\n data.nav.push({\n \"label\": {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[12px] font-medium rounded-md flex-col leading-3 nav-label'><svg class=\"slds-icon slds-icon_container slds-icon-standard-`+classIcon+` flex-shrink-0 h-10 w-10\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg><span>${tab.name}</span><i class=\"fa fa-angle-right\" aria-hidden=\"true\" style=\"position: absolute;right: 20px;color: #bababa;\"></i></span>`,\n className:'h-full flex items-center'\n },\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n });\n }else{\n data.nav.push({\n \"label\": {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 truncate text-slate-700 block -ml-px no-underline group flex items-center text-[12px] font-medium rounded-md flex-col leading-3 nav-label'><svg class=\"slds-icon slds-icon_container slds-icon-standard-`+classIcon+` flex-shrink-0 h-10 w-10\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg><span class=\"truncate\" style=\"max-width: 20vw\">${tab.name}</span></span>`,\n className:'h-full flex items-center'\n },\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n });\n }\n })\n\n payload.data = {\n \"type\": \"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav\n },\n \"id\": \"footerService\",\n \"body\": {\n \"type\": \"nav\",\n className: payload.children.length ==1 ? '").concat(className1, "' : '").concat(className, "',\n \"stacked\": ").concat(stacked, ",\n \"overflow\": {\n \"enable\": true,\n \"maxVisibleCount\": 4,\n \"overflowPopoverClassName\": \"steedos-global-footer-popup\",\n \"overflowLabel\":{\n \"type\": 'tpl',\n \"tpl\": `<span class='fill-slate-500 truncate text-slate-700 block -ml-px no-underline group flex items-center text-[12px] font-medium rounded-md flex-col leading-3 nav-label'><svg class=\" flex-shrink-0 h-10 w-10\" style=\"padding:7px\"><use xlink:href=\"/assets/icons/utility-sprite/svg/symbols.svg#rows\"></use></svg><span class=\"truncate\" style=\"max-width: 20vw\">").concat(instance.t('frontend_menu'), "</span></span>`,\n \"className\":'h-full flex items-center'\n },\n \"overflowIndicator\":\"\"\n },\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"footerService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"footerService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n }\n ]\n }\n }\n }\n \n };\n } catch (error) {\n console.log(`error`, error)\n }\n return payload;\n "),
|
|
18296
18400
|
"headers": {
|
|
18297
18401
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
18298
18402
|
}
|
|
@@ -18908,12 +19012,13 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
|
|
|
18908
19012
|
}); };
|
|
18909
19013
|
|
|
18910
19014
|
var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
18911
|
-
var steedosField, field, _a, readonly, _b, ctx, config, $schema, schema, error_1;
|
|
18912
|
-
|
|
18913
|
-
|
|
19015
|
+
var steedosField, field, _a, readonly, _b, ctx, config, $schema, fStatic, objectName, filters, valueFieldKey, labelFieldKey, referenceTo, referenceToField, value, _steedosField, referenceTo, referenceToField, schema, schema, error_1;
|
|
19016
|
+
var _c, _d, _e, _f, _g;
|
|
19017
|
+
return __generator(this, function (_h) {
|
|
19018
|
+
switch (_h.label) {
|
|
18914
19019
|
case 0:
|
|
18915
19020
|
steedosField = null;
|
|
18916
|
-
field = props.field, _a = props.readonly, readonly = _a === void 0 ? false : _a, _b = props.ctx, ctx = _b === void 0 ? {} : _b, config = props.config, $schema = props.$schema;
|
|
19021
|
+
field = props.field, _a = props.readonly, readonly = _a === void 0 ? false : _a, _b = props.ctx, ctx = _b === void 0 ? {} : _b, config = props.config, $schema = props.$schema, fStatic = props.static;
|
|
18917
19022
|
// console.log(`AmisSteedosField`, props)
|
|
18918
19023
|
if ($schema.config && ___default.isString($schema.config)) {
|
|
18919
19024
|
$schema.config = JSON.parse($schema.config);
|
|
@@ -18934,19 +19039,66 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
18934
19039
|
steedosField = JSON.parse(field);
|
|
18935
19040
|
}
|
|
18936
19041
|
}
|
|
18937
|
-
|
|
19042
|
+
_h.label = 1;
|
|
18938
19043
|
case 1:
|
|
18939
|
-
|
|
18940
|
-
|
|
19044
|
+
_h.trys.push([1, 9, , 10]);
|
|
19045
|
+
if (!(fStatic && (steedosField.type === 'lookup' || steedosField.type === 'master_detail'))) return [3 /*break*/, 6];
|
|
19046
|
+
objectName = void 0, filters = void 0, valueFieldKey = void 0, labelFieldKey = void 0;
|
|
19047
|
+
if (!props.data[steedosField.name]) {
|
|
19048
|
+
return [2 /*return*/, {}];
|
|
19049
|
+
}
|
|
19050
|
+
if (!___default.isString(steedosField.reference_to)) return [3 /*break*/, 3];
|
|
19051
|
+
return [4 /*yield*/, getReferenceTo(steedosField)];
|
|
18941
19052
|
case 2:
|
|
18942
|
-
|
|
18943
|
-
|
|
18944
|
-
|
|
19053
|
+
referenceTo = _h.sent();
|
|
19054
|
+
referenceToField = steedosField.reference_to_field || '_id';
|
|
19055
|
+
objectName = referenceTo.objectName;
|
|
19056
|
+
valueFieldKey = referenceTo && ((_c = referenceTo.valueField) === null || _c === void 0 ? void 0 : _c.name) || '_id';
|
|
19057
|
+
labelFieldKey = referenceTo && ((_d = referenceTo.labelField) === null || _d === void 0 ? void 0 : _d.name) || 'name';
|
|
19058
|
+
value = props.data[steedosField.name];
|
|
19059
|
+
if (___default.isString(value)) {
|
|
19060
|
+
value = [value];
|
|
19061
|
+
}
|
|
19062
|
+
filters = [referenceToField, "in", value];
|
|
19063
|
+
return [3 /*break*/, 5];
|
|
18945
19064
|
case 3:
|
|
18946
|
-
|
|
19065
|
+
_steedosField = __assign$2(__assign$2({}, steedosField), { reference_to: props.data[steedosField.name].o });
|
|
19066
|
+
return [4 /*yield*/, getReferenceTo(_steedosField)];
|
|
19067
|
+
case 4:
|
|
19068
|
+
referenceTo = _h.sent();
|
|
19069
|
+
referenceToField = _steedosField.reference_to_field || '_id';
|
|
19070
|
+
objectName = referenceTo.objectName;
|
|
19071
|
+
valueFieldKey = referenceTo && ((_e = referenceTo.valueField) === null || _e === void 0 ? void 0 : _e.name) || '_id';
|
|
19072
|
+
labelFieldKey = referenceTo && ((_f = referenceTo.labelField) === null || _f === void 0 ? void 0 : _f.name) || 'name';
|
|
19073
|
+
filters = [referenceToField, "in", props.data[_steedosField.name].ids];
|
|
19074
|
+
_h.label = 5;
|
|
19075
|
+
case 5:
|
|
19076
|
+
schema = Object.assign({}, {
|
|
19077
|
+
type: 'select',
|
|
19078
|
+
multiple: steedosField.multiple,
|
|
19079
|
+
name: steedosField.name,
|
|
19080
|
+
label: steedosField.label,
|
|
19081
|
+
static: true,
|
|
19082
|
+
className: (_g = steedosField.amis) === null || _g === void 0 ? void 0 : _g.className,
|
|
19083
|
+
source: {
|
|
19084
|
+
"method": "post",
|
|
19085
|
+
"url": "${context.rootUrl}/graphql",
|
|
19086
|
+
"requestAdaptor": "\n api.data = {\n query: '{options:".concat(objectName, "(filters: ").concat(JSON.stringify(filters), "){label: ").concat(labelFieldKey, ",value: ").concat(valueFieldKey, "}}'\n }\n return api;\n ")
|
|
19087
|
+
}
|
|
19088
|
+
}, ___default.pick(steedosField.amis || {}, ['className', 'inline', 'label', 'labelAlign', 'name', 'labelRemark', 'description', 'placeholder', 'staticClassName', 'staticLabelClassName', 'staticInputClassName', 'staticSchema']));
|
|
19089
|
+
// console.log(`AmisSteedosField return schema`, schema)
|
|
19090
|
+
return [2 /*return*/, schema];
|
|
19091
|
+
case 6: return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
|
|
19092
|
+
case 7:
|
|
19093
|
+
schema = _h.sent();
|
|
19094
|
+
// console.log(`AmisSteedosField return schema`, schema)
|
|
19095
|
+
return [2 /*return*/, schema];
|
|
19096
|
+
case 8: return [3 /*break*/, 10];
|
|
19097
|
+
case 9:
|
|
19098
|
+
error_1 = _h.sent();
|
|
18947
19099
|
console.log("error", error_1);
|
|
18948
|
-
return [3 /*break*/,
|
|
18949
|
-
case
|
|
19100
|
+
return [3 /*break*/, 10];
|
|
19101
|
+
case 10: return [2 /*return*/, null];
|
|
18950
19102
|
}
|
|
18951
19103
|
});
|
|
18952
19104
|
}); };
|
|
@@ -19239,7 +19391,7 @@ var PageObject = function (props) { return __awaiter(void 0, void 0, void 0, fun
|
|
|
19239
19391
|
});
|
|
19240
19392
|
}); };
|
|
19241
19393
|
|
|
19242
|
-
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=(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=[],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 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<=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);
|
|
19394
|
+
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);
|
|
19243
19395
|
|
|
19244
19396
|
var index_esm = /*#__PURE__*/Object.freeze({
|
|
19245
19397
|
__proto__: null,
|