@steedos-widgets/amis-object 6.10.1-beta.29 → 6.10.1-beta.31
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 +632 -569
- package/dist/amis-object.cjs.js +64 -47
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +632 -569
- package/dist/amis-object.esm.js +64 -47
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +632 -569
- package/dist/amis-object.umd.js +18 -18
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +19 -19
- package/dist/index.d.ts +1 -0
- package/dist/meta.js +11 -1
- package/package.json +3 -3
package/dist/amis-object.cjs.js
CHANGED
|
@@ -4683,7 +4683,7 @@ var frontend_display_type_is_split$1 = "Split View";
|
|
|
4683
4683
|
var frontend_display_as$1 = "Displayed as";
|
|
4684
4684
|
var frontend_record_sum$1 = "items";
|
|
4685
4685
|
var frontend_button_reload_tooltip$1 = "Refresh";
|
|
4686
|
-
var frontend_button_search_tooltip$1 = "Search";
|
|
4686
|
+
var frontend_button_search_tooltip$1 = "Advanced Search";
|
|
4687
4687
|
var frontend_fields_filter_button_search$1 = "Search";
|
|
4688
4688
|
var frontend_fields_filter_button_settings$1 = "Set search options";
|
|
4689
4689
|
var frontend_button_listview_control_tooltip$1 = "List View Controls";
|
|
@@ -4864,7 +4864,7 @@ var frontend_display_type_is_split = "分栏视图";
|
|
|
4864
4864
|
var frontend_display_as = "显示为";
|
|
4865
4865
|
var frontend_record_sum = "个项目";
|
|
4866
4866
|
var frontend_button_reload_tooltip = "刷新";
|
|
4867
|
-
var frontend_button_search_tooltip = "
|
|
4867
|
+
var frontend_button_search_tooltip = "高级搜索";
|
|
4868
4868
|
var frontend_fields_filter_button_search = "搜索";
|
|
4869
4869
|
var frontend_fields_filter_button_settings = "选择搜索项";
|
|
4870
4870
|
var frontend_button_listview_control_tooltip = "列表视图控制";
|
|
@@ -9267,7 +9267,7 @@ async function getObjectFieldsFilterButtonSchema(objectSchema) {
|
|
|
9267
9267
|
"type": "button",
|
|
9268
9268
|
"label": "",
|
|
9269
9269
|
"icon": "fa fa-search",
|
|
9270
|
-
"className": "bg-white p-2 rounded border-gray-300
|
|
9270
|
+
"className": "bg-white p-2 rounded border-gray-300",
|
|
9271
9271
|
"onEvent": {
|
|
9272
9272
|
"click": {
|
|
9273
9273
|
"actions": [
|
|
@@ -9291,7 +9291,7 @@ async function getObjectFieldsFilterFormSchema(ctx) {
|
|
|
9291
9291
|
const formSchema = {
|
|
9292
9292
|
"type": "service",
|
|
9293
9293
|
"visibleOn": "this.filterFormSearchableFields && this.filterFormSearchableFields.length",
|
|
9294
|
-
"className": ctx.formFactor === 'SMALL' ? "slds-filters__body p-0 mb-2 overflow-y-auto overflow-x-hidden" : "slds-filters__body p-0 sm:grid sm:gap-4 sm:grid-cols-4 p-
|
|
9294
|
+
"className": ctx.formFactor === 'SMALL' ? "slds-filters__body p-0 mb-2 overflow-y-auto overflow-x-hidden" : "slds-filters__body p-0 sm:grid sm:gap-4 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5 2xl:grid-cols-6 p-1",
|
|
9295
9295
|
"style":{
|
|
9296
9296
|
"max-height":ctx.formFactor === 'SMALL'?"30vh":"unset"
|
|
9297
9297
|
},
|
|
@@ -9416,24 +9416,24 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
9416
9416
|
const filterService = filterForm.context.getComponents().find(function(n){
|
|
9417
9417
|
return n.props.type === "service";
|
|
9418
9418
|
});
|
|
9419
|
-
let showFieldsFilter =
|
|
9420
|
-
const isMobile = window.innerWidth < 768;
|
|
9421
|
-
if(event.data.__from_fields_filter_settings_confirm){
|
|
9422
|
-
|
|
9423
|
-
|
|
9424
|
-
}
|
|
9425
|
-
else if(isMobile){
|
|
9426
|
-
|
|
9427
|
-
|
|
9428
|
-
}
|
|
9429
|
-
else if(event.data.displayAs === "split") {
|
|
9430
|
-
|
|
9431
|
-
|
|
9432
|
-
}
|
|
9433
|
-
else if(window.innerHeight >= 1200){
|
|
9434
|
-
|
|
9435
|
-
|
|
9436
|
-
}
|
|
9419
|
+
let showFieldsFilter = true;
|
|
9420
|
+
// const isMobile = window.innerWidth < 768;
|
|
9421
|
+
// if(event.data.__from_fields_filter_settings_confirm){
|
|
9422
|
+
// // 如果是从设置搜索项点击确认按钮触发的搜索事件不应该自动关闭搜索栏
|
|
9423
|
+
// showFieldsFilter = true;
|
|
9424
|
+
// }
|
|
9425
|
+
// else if(isMobile){
|
|
9426
|
+
// // 如果是手机端,点击搜索后自动关闭搜索栏
|
|
9427
|
+
// showFieldsFilter = false;
|
|
9428
|
+
// }
|
|
9429
|
+
// else if(event.data.displayAs === "split") {
|
|
9430
|
+
// // PC上分栏模式下的列表,始终按手机上效果处理,即自动关闭搜索栏
|
|
9431
|
+
// showFieldsFilter = false;
|
|
9432
|
+
// }
|
|
9433
|
+
// else if(window.innerHeight >= 1200){
|
|
9434
|
+
// // 高分辨率屏幕(2k+),列表高度比较高,没必要自动关闭搜索栏
|
|
9435
|
+
// showFieldsFilter = true;
|
|
9436
|
+
// }
|
|
9437
9437
|
filterService.setData({showFieldsFilter});
|
|
9438
9438
|
// resizeWindow();//已迁移到搜索栏表单提交事件中执行,因为表单项change后也会触发表单提交了
|
|
9439
9439
|
let isFieldsFilterEmpty = SteedosUI.isFilterFormValuesEmpty(filterFormValues);
|
|
@@ -9902,10 +9902,10 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
9902
9902
|
"className": "slds-filters__footer slds-grid slds-shrink-none flex justify-between p-0"
|
|
9903
9903
|
}],
|
|
9904
9904
|
"size": "xs",
|
|
9905
|
-
"className": "slds-filters"
|
|
9905
|
+
"className": "slds-filters px-0"
|
|
9906
9906
|
},
|
|
9907
9907
|
"size": "xs",
|
|
9908
|
-
"className": `
|
|
9908
|
+
"className": `p-0`,
|
|
9909
9909
|
"visibleOn": "this.showFieldsFilter",
|
|
9910
9910
|
},
|
|
9911
9911
|
"className": "bg-white"
|
|
@@ -10842,7 +10842,7 @@ function getObjectListHeader(objectSchema, listViewName, ctx) {
|
|
|
10842
10842
|
let headerSchema = [{
|
|
10843
10843
|
"type": "wrapper",
|
|
10844
10844
|
"body": body,
|
|
10845
|
-
"className": `
|
|
10845
|
+
"className": `p-3 m-4 shadow rounded bg-white`
|
|
10846
10846
|
}];
|
|
10847
10847
|
// console.log(`getObjectListHeader`, objectSchema, listViewName, ctx)
|
|
10848
10848
|
return headerSchema;
|
|
@@ -12224,7 +12224,7 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
12224
12224
|
return {
|
|
12225
12225
|
"type": "tooltip-wrapper",
|
|
12226
12226
|
"id": "steedos_crud_toolbar_quick_search",
|
|
12227
|
-
"align": "
|
|
12227
|
+
"align": "left",
|
|
12228
12228
|
"title": "",
|
|
12229
12229
|
"content": "可搜索字段:" + searchableFieldsLabel.join(","),
|
|
12230
12230
|
"placement": "bottom",
|
|
@@ -12286,6 +12286,8 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
12286
12286
|
if(!hiddenCount){
|
|
12287
12287
|
toolbarCount = {
|
|
12288
12288
|
"type": "tpl",
|
|
12289
|
+
"align": "right",
|
|
12290
|
+
"className": "text-gray-500 mr-2",
|
|
12289
12291
|
"tpl": "${count} " + instance.t('frontend_record_sum')
|
|
12290
12292
|
};
|
|
12291
12293
|
}
|
|
@@ -12368,7 +12370,7 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
12368
12370
|
"animation": true,
|
|
12369
12371
|
"visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
|
|
12370
12372
|
},
|
|
12371
|
-
"align": "
|
|
12373
|
+
"align": "left",
|
|
12372
12374
|
"className": "bg-white p-2 rounded text-gray-500",
|
|
12373
12375
|
"onEvent": {
|
|
12374
12376
|
"click": {
|
|
@@ -12393,11 +12395,11 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
12393
12395
|
if(toolbarCount){
|
|
12394
12396
|
toolbars.push(toolbarCount);
|
|
12395
12397
|
}
|
|
12398
|
+
toolbars.push(toolbarReloadButton);
|
|
12399
|
+
toolbars.push(toolbarDisplayAsButton);
|
|
12396
12400
|
if(toolbarFilter){
|
|
12397
12401
|
toolbars.push(toolbarFilter);
|
|
12398
12402
|
}
|
|
12399
|
-
toolbars.push(toolbarReloadButton);
|
|
12400
|
-
toolbars.push(toolbarDisplayAsButton);
|
|
12401
12403
|
toolbars.push(toolbarDQuickSearchBox);
|
|
12402
12404
|
return [
|
|
12403
12405
|
// "bulkActions",
|
|
@@ -12405,18 +12407,18 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
12405
12407
|
...toolbars,
|
|
12406
12408
|
]
|
|
12407
12409
|
}else {
|
|
12408
|
-
if(toolbarCount){
|
|
12409
|
-
toolbars.push(toolbarCount);
|
|
12410
|
-
}
|
|
12411
|
-
if(toolbarFilter){
|
|
12412
|
-
toolbars.push(toolbarFilter);
|
|
12413
|
-
}
|
|
12414
12410
|
toolbars.push(toolbarReloadButton);
|
|
12415
12411
|
toolbars.push(toolbarDisplayAsButton);
|
|
12416
12412
|
if(mainObject?.permissions?.allowCreateListViews){
|
|
12417
12413
|
toolbars.push(getSettingListviewToolbarButtonSchema());
|
|
12418
12414
|
}
|
|
12419
12415
|
toolbars.push(toolbarDQuickSearchBox);
|
|
12416
|
+
if(toolbarFilter){
|
|
12417
|
+
toolbars.push(toolbarFilter);
|
|
12418
|
+
}
|
|
12419
|
+
if(toolbarCount){
|
|
12420
|
+
toolbars.push(toolbarCount);
|
|
12421
|
+
}
|
|
12420
12422
|
return [
|
|
12421
12423
|
// "filter-toggler",
|
|
12422
12424
|
...(headerToolbarItems || []),
|
|
@@ -12713,7 +12715,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
12713
12715
|
const bodyProps = {
|
|
12714
12716
|
// toolbar: getToolbar(),
|
|
12715
12717
|
// headerToolbar: getObjectHeaderToolbar(objectSchema, options.formFactor, {showDisplayAs}),
|
|
12716
|
-
headerToolbarClassName: "px-
|
|
12718
|
+
headerToolbarClassName: "px-0 py-2 border-b",
|
|
12717
12719
|
footerToolbar: getObjectFooterToolbar(objectSchema, options.formFactor, {
|
|
12718
12720
|
...options,
|
|
12719
12721
|
disableStatistics: options.queryCount === false
|
|
@@ -15581,7 +15583,13 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
15581
15583
|
"__lookupField": {
|
|
15582
15584
|
"name": field.name,
|
|
15583
15585
|
"reference_to": refObjectConfig.name,
|
|
15584
|
-
"reference_to_field": field.reference_to_field
|
|
15586
|
+
"reference_to_field": field.reference_to_field,
|
|
15587
|
+
"filters": field.filters,
|
|
15588
|
+
"filtersFunction": field.filtersFunction,
|
|
15589
|
+
"_filtersFunction": field._filtersFunction,
|
|
15590
|
+
"inFilterForm": ctx.inFilterForm,
|
|
15591
|
+
"listviewFilter": listviewFilter,
|
|
15592
|
+
"listviewFiltersFunction": listviewFiltersFunction
|
|
15585
15593
|
}
|
|
15586
15594
|
});
|
|
15587
15595
|
|
|
@@ -17598,7 +17606,7 @@ function uuidv4() {
|
|
|
17598
17606
|
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
17599
17607
|
* @Date: 2023-11-15 09:50:22
|
|
17600
17608
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
17601
|
-
* @LastEditTime:
|
|
17609
|
+
* @LastEditTime: 2025-06-05 11:49:01
|
|
17602
17610
|
*/
|
|
17603
17611
|
|
|
17604
17612
|
/**
|
|
@@ -19090,7 +19098,8 @@ const getAmisInputTableSchema = async (props) => {
|
|
|
19090
19098
|
"name": "__op__",
|
|
19091
19099
|
"type": "operation",
|
|
19092
19100
|
"buttons": buttonsForColumnOperations,
|
|
19093
|
-
"width": 1
|
|
19101
|
+
"width": 1,
|
|
19102
|
+
"className": "steedos-input-table-column-operation",
|
|
19094
19103
|
});
|
|
19095
19104
|
}
|
|
19096
19105
|
// if (showAsInlineEditMode) {
|
|
@@ -22224,7 +22233,7 @@ var SteedosDropdownButton = function (props) {
|
|
|
22224
22233
|
var openData = (result === null || result === void 0 ? void 0 : result.hasOwnProperty('ok')) ? result.data : result;
|
|
22225
22234
|
setMenu(getMenu(render, buttons, btnClassName, {
|
|
22226
22235
|
// data: createObject(data, defaultsDeep(openData, data, {record: data}))
|
|
22227
|
-
data: createObject(data, Object.assign({}, data, { record: data }, openData))
|
|
22236
|
+
data: createObject(data, Object.assign({}, data, { record: data }, openData, { _master: { record: data } }))
|
|
22228
22237
|
}));
|
|
22229
22238
|
}).catch(function (e) {
|
|
22230
22239
|
console.error(e);
|
|
@@ -24915,11 +24924,12 @@ var SteedosObject = /** @class */ (function (_super) {
|
|
|
24915
24924
|
|
|
24916
24925
|
// md:border-b
|
|
24917
24926
|
var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
24918
|
-
var $schema, recordId,
|
|
24927
|
+
var $schema, recordId, mode, _a, layout, labelAlign, appId, fieldsExtend, _b, excludedFields, _c, fields, _d, form, _e, className, enableInitApi, initApiRequestAdaptor, initApiAdaptor, apiRequestAdaptor, apiAdaptor, enableTabs, tabsMode, submitSuccActions, data, formDataFilter, onFormDataFilter, env, defaultData, objectApiName, schemaKeys, formSchema, defaults, options, globalData, amisSchema, uiSchema, allData, schema, schema, formData;
|
|
24919
24928
|
return __generator(this, function (_f) {
|
|
24920
24929
|
switch (_f.label) {
|
|
24921
24930
|
case 0:
|
|
24922
|
-
$schema = props.$schema, recordId = props.recordId,
|
|
24931
|
+
$schema = props.$schema, recordId = props.recordId, mode = props.mode, _a = props.layout, layout = _a === void 0 ? "horizontal" : _a, labelAlign = props.labelAlign, appId = props.appId, fieldsExtend = props.fieldsExtend, _b = props.excludedFields, excludedFields = _b === void 0 ? null : _b, _c = props.fields, fields = _c === void 0 ? null : _c, _d = props.form, form = _d === void 0 ? {} : _d, _e = props.className, className = _e === void 0 ? "" : _e, enableInitApi = props.enableInitApi, initApiRequestAdaptor = props.initApiRequestAdaptor, initApiAdaptor = props.initApiAdaptor, apiRequestAdaptor = props.apiRequestAdaptor, apiAdaptor = props.apiAdaptor, enableTabs = props.enableTabs, tabsMode = props.tabsMode, submitSuccActions = props.submitSuccActions, data = props.data, formDataFilter = props.formDataFilter, onFormDataFilter = props.onFormDataFilter, env = props.env;
|
|
24932
|
+
defaultData = props.defaultData;
|
|
24923
24933
|
objectApiName = props.objectApiName || "space_users";
|
|
24924
24934
|
schemaKeys = _$1.difference(_$1.keys($schema), ["id", "form", "type", "mode", "layout", "defaultData", "formDataFilter", "onFormDataFilter", "env"]);
|
|
24925
24935
|
formSchema = _$1.pick(props, schemaKeys);
|
|
@@ -24947,6 +24957,13 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
24947
24957
|
allData = createObject(data, {});
|
|
24948
24958
|
if (!(mode === 'edit')) return [3 /*break*/, 2];
|
|
24949
24959
|
if (defaultData) {
|
|
24960
|
+
try {
|
|
24961
|
+
defaultData = _$1.isString(defaultData) ? JSON.parse(defaultData) : defaultData;
|
|
24962
|
+
}
|
|
24963
|
+
catch (error) {
|
|
24964
|
+
console.warn(error);
|
|
24965
|
+
defaultData = {};
|
|
24966
|
+
}
|
|
24950
24967
|
// 让ObjectForm支持props中的dafaultData属性与上层组件配置的defaultData混合
|
|
24951
24968
|
// 为了解决相关表新建时如果是表单类型微页面,因为找不到ObjectForm在哪层而造成无法设置ObjectForm的defaultData的问题
|
|
24952
24969
|
allData.defaultData = __assign$2({ "&": "${defaultData}" }, defaultData //这里的defaultData是form组件的defaultData属性值
|
|
@@ -25164,7 +25181,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
25164
25181
|
_reloadKey: _reloadKey,
|
|
25165
25182
|
data: _data,
|
|
25166
25183
|
style: style,
|
|
25167
|
-
className: "".concat(className, " sm:bg-
|
|
25184
|
+
className: "".concat(className, " sm:bg-[#FAFAFA] h-full steedos-object-listview ").concat(displayAs === 'split' ? 'sm:border-r' : 'sm:border-r'),
|
|
25168
25185
|
body: [{
|
|
25169
25186
|
"type": "wrapper",
|
|
25170
25187
|
"size": "none",
|
|
@@ -25188,7 +25205,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
25188
25205
|
"type": "service",
|
|
25189
25206
|
"id": "service_schema_api_" + objectApiName,
|
|
25190
25207
|
_reloadKey: _reloadKey,
|
|
25191
|
-
"className": " steedos-object-listview-content grow",
|
|
25208
|
+
"className": " steedos-object-listview-content grow px-3 py-1 m-4 mt-0 shadow rounded bg-white",
|
|
25192
25209
|
"schemaApi": {
|
|
25193
25210
|
// 这里url上加objectApiName属性是因为设计器中切换对象时不会变更列表视图界面,不可以用objectName=${objectName}使用作用域中objectName变量是因为设计器那边不会监听识别data变化来render组件
|
|
25194
25211
|
"url": "${context.rootUrl}/graphql?objectName=" + objectApiName + "&listName=${listName}&display=${display}&rebuildOn=" + rebuildOn + _reloadKey,
|
|
@@ -26212,7 +26229,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
26212
26229
|
"method": "get",
|
|
26213
26230
|
"url": "${context.rootUrl}/service/api/apps/${appId}/menus",
|
|
26214
26231
|
"sendOn": "!!appId",
|
|
26215
|
-
"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 let collapsed = false;\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n let 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 = \"").concat(data.tabId, "\";\n var usedGroupNames = [];\n let allowEditApp = false;\n if(stacked){\n if(context.appId == context.app.id){\n collapsed = _.includes(document.body.classList, 'sidebar-open') != true;\n }\n // console.log('collapsed', collapsed, document.body.classList, context.appId == context.app.id)\n if(collapsed){\n showIcon = false;\n }\n\n if(payload.allowEditApp && collapsed != true){\n allowEditApp = true;\n }\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n tab.iconClass = (tab.icon || 'account').replaceAll('_', '-');\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='whitespace-normal leading-6 no-underline group items-center rounded-md'><svg class=\"slds-icon_container slds-icon fill-gray-700 mr-2 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 \"searchKey\": tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index,\n \"tabApiName\": tab.tabApiName,\n \"type\": tab.type,\n \"tabIcon\": tab.icon\n // active: selectedId === tab.id,\n })\n })\n } else {\n var tabGroup = _.find(tab_groups, {\"group_name\": groupName});\n usedGroupNames.push(groupName);\n data.nav.push({\n \"label\": groupName,\n 'default_open': tabGroup && tabGroup.default_open != false,\n \"unfolded\": tabGroup && tabGroup.default_open != false,\n \"isGroup\": true,\n \"children\": _.sortBy(_.map(tabs, (tab) => {\n tab.iconClass = (tab.icon || 'account').replaceAll('_', '-');\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='whitespace-normal leading-6 block no-underline group items-center rounded-md'><svg class=\"slds-icon_container slds-icon fill-gray-700 mr-2 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 \"searchKey\": tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index,\n \"tabApiName\": tab.tabApiName,\n \"type\": tab.type,\n // active: selectedId === tab.id,\n \"groupName\": groupName,\n \"tabIcon\": tab.icon\n }\n }),(tab) => {return tab.index})\n }) \n }\n });\n \n }else{\n _.each(payload.children, (tab)=>{\n tab.iconClass = (tab.icon || 'account').replaceAll('_', '-');\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='whitespace-normal leading-6 no-underline group items-center rounded-md'><svg class=\"slds-icon_container slds-icon-standard-${ tab.iconClass } slds-icon !fill-white rounded-xl mr-2 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 \"searchKey\": tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index,\n \"tabApiName\": tab.tabApiName,\n \"type\": tab.type,\n \"tabIcon\": tab.icon\n // active: selectedId === tab.id,\n });\n })\n }\n //\u4EE5\u4E0B\u4E3Anav\u7B2C\u4E00\u5C42\u6392\u5E8F\uFF0C\u5305\u62EC\u5206\u7EC4\u4E0E\u9009\u9879\u5361\n // let groupLength = ((payload.tab_groups && payload.tab_groups.length) || 0) + 1000;\n data.nav = _.sortBy(data.nav, function(tab){\n if(tab.isGroup){\n return _.findIndex(payload.tab_groups, function(group){\n return group.group_name === tab.label;\n });\n }else{\n // \u6CA1\u6709\u5206\u7EC4\u7684\u9009\u9879\u5361\u6309index\u6392\u5217\u5728\u6709\u5206\u7EC4\u7684\u9009\u9879\u5361\u524D\u65B9\n return (tab.index || 0) - 1000;\n }\n })\n if(allowEditApp){\n _.each(payload.tab_groups, (group)=>{\n if(!_.includes(usedGroupNames, group.group_name)){\n data.nav.push({\n \"label\": group.group_name,\n 'default_open': group && group.default_open != false,\n \"unfolded\": group && group.default_open != false,\n \"isGroup\": true,\n \"children\": []\n })\n }\n });\n }\n\n if(collapsed){\n const collapsedNav = [];\n for(const item of data.nav){\n if(item.isGroup){\n if(collapsedNav.length > 0){\n collapsedNav.push({\n \"mode\": \"divider\"\n })\n }\n for(const childrenItem of item.children){\n collapsedNav.push(Object.assign({}, childrenItem, {\n disabledTip: true,\n label: {\n \"type\": \"tooltip-wrapper\",\n \"content\": childrenItem.label,\n \"placement\": \"right\",\n \"disabled\": true,\n \"body\": [\n {\n 'type': 'tpl',\n 'tpl': '<svg class=\"slds-icon_container slds-icon fill-gray-700 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#' + (childrenItem.tabIcon || 'account') + '\"></use></svg>'\n }\n ]\n }\n \n \n // label: false, \n // icon: '/assets/icons/standard-sprite/svg/symbols.svg#' + (childrenItem.tabIcon || 'account')\n }));\n }\n }else{\n collapsedNav.push(Object.assign({}, item, {\n disabledTip: true,\n label: {\n \"type\": \"tooltip-wrapper\",\n \"content\": item.label,\n \"placement\": \"right\",\n \"disabled\": true,\n \"body\": [\n {\n 'type': 'tpl',\n 'tpl': '<svg class=\"slds-icon_container slds-icon fill-gray-700 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#' + (item.tabIcon || 'account') + '\"></use></svg>'\n }\n ]\n }\n // label: false, \n // icon: '/assets/icons/standard-sprite/svg/symbols.svg#' + (item.tabIcon || 'account')\n }));\n }\n }\n data.nav = collapsedNav;\n }\n\n let editAppSearch = [];\n if(allowEditApp){\n editAppSearch = [{\n \"type\": \"grid\",\n \"className\": \"ml-3 mr-0\",\n \"columns\": [\n {\n \"md\": 10,\n \"columnClassName\": \"p-0\",\n \"body\": [\n // {\n // \"type\": \"search-box\",\n // \"name\": \"keywords\",\n // \"className\": \"!w-full\",\n // \"placeholder\": \"\u641C\u7D22\u83DC\u5355\",\n // \"autoFocus\": false,\n // \"searchImediately\": true,\n // \"clearable\": true,\n // \"clearAndSubmit\": true,\n // \"id\": \"s01\"\n // }\n {\n \"type\": \"button\",\n \"className\": \"toggle-sidebar\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"document.body.classList.toggle('sidebar-open')\",\n },\n {\n \"actionType\": \"rebuild\",\n \"componentId\": \"u:app-menu\",\n \"args\": {\n \"toggleSidebar\": true\n }\n }\n ]\n }\n },\n \"body\": [\n {\n \"type\": \"steedos-icon\",\n \"category\": \"utility\",\n \"name\": \"rows\",\n \"colorVariant\": \"default\",\n \"id\": \"u:afc3a08e8cf3\",\n \"className\": \"slds-button_icon slds-global-header__icon\"\n }\n ]\n }\n ]\n },\n {\n \"md\": 2,\n \"columnClassName\": \"p0 pl-2 steedos-app-menu-plus\",\n \"body\": [\n {\n \"type\": \"dropdown-button\",\n \"level\": \"link\",\n \"btnClassName\": \"text-gray-700 px-1 pt-0 text-base\",\n \"icon\": \"fa fa-cog\",\n \"closeOnClick\": true,\n \"closeOnOutside\": true,\n \"size\": \"md\",\n \"hideCaret\": true,\n \"align\": \"right\",\n \"buttons\": [\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"Api Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"o_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/objects/create_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Steedos.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"p_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/pages/create_page_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Steedos.getRelativeUrl('/api/pageDesign?pageId=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"required\": true,\n \"value\": \"t_${UUID(6)}\",\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n \n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"fLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u5916\u90E8\u94FE\u63A5\",\n \"name\": \"fUrl\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/tabs/create_link_tab_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.fLabel, icon: context.icon, url: context.fUrl}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"body\": [\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u9009\u9879\u5361\",\n \"config\": {\n \"type\": \"lookup\",\n \"reference_to\": \"tabs\",\n \"reference_to_field\": \"name\",\n \"required\": true,\n \"sort_no\": 30,\n \"name\": \"tabs\",\n \"multiple\": true,\n \"enable_enhanced_lookup\": true,\n \"amis\": {\n \"label\": false,\n \"embed\": true,\n }\n }\n }\n ],\n \"id\": \"u:709fd4d53437\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:ba7b707cddd8\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:2f3e5635b95d\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"size\": \"md\",\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/update_app_tabs_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', addTabNames: context.tabs}; return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5206\u7EC4\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5206\u7EC4\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"\u540D\u79F0\",\n \"name\": \"name\",\n \"id\": \"u:e5bd37f6699b\",\n \"placeholder\": \"\u5206\u7EC4\u540D\u79F0\",\n \"required\": true\n },\n {\n \"type\": \"checkbox\",\n \"option\": \"\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00\",\n \"name\": \"defaultOpen\",\n \"id\": \"u:dae5884c1623\",\n \"required\": true\n }\n ],\n \"id\": \"u:304b5b04c573\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d85\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a05b\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/apps/create_app_group_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, name: context.name, defaultOpen: context.defaultOpen}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n },\n },\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\u5E94\u7528\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const apps = payload.data.apps; if(apps && apps.length > 0){ return {data: apps[0]} }; return {data: null};\",\n \"requestAdaptor\": \"api.data={query: '{ apps(filters: [\\\"code\\\", \\\"=\\\", ' + context.appId + ']) { _id name}}'}; return api;\"\n }\n },\n {\n \"actionType\": \"drawer\",\n \"drawer\": {\n \"type\": \"drawer\",\n \"title\": \" \",\n \"headerClassName\": \"hidden\",\n \"size\": \"lg\",\n \"width\": window.drawerWidth || \"70%\",\n \"bodyClassName\": \"p-0 m-0 bg-gray-100\",\n \"closeOnEsc\": true,\n \"closeOnOutside\": true,\n \"resizable\": true,\n \"actions\": [],\n \"body\": {\n \"type\": \"service\",\n \"id\": \"u:1678e148c8d2\",\n \"messages\": {},\n \"schemaApi\": {\n \"url\": \"/api/pageSchema/app?objectApiName=apps&formFactor=LARGE&formFactor=LARGE\",\n \"method\": \"get\",\n \"adaptor\": \"const schema = {type: 'steedos-record-detail'}; schema.data={objectName: 'apps', _inDrawer: true, recordLoaded: false}; schema.objectApiName='apps'; schema.recordId=context.responseData._id; console.log('schema', schema); return {data: schema};\"\n }\n },\n \"className\": \"steedos-record-detail-drawer app-popover\",\n \"id\": \"u:fc5f055afa8c\"\n },\n \"preventDefault\": true\n }\n ]\n }\n }\n }\n ]\n }\n ]\n }\n ]\n }]\n }else if(stacked){\n editAppSearch = [{\n \"type\": \"button\",\n \"className\": \"toggle-sidebar text-center w-[60px]\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"document.body.classList.toggle('sidebar-open')\",\n },\n {\n \"actionType\": \"rebuild\",\n \"componentId\": \"u:app-menu\",\n \"args\": {\n \"toggleSidebar\": true\n }\n }\n ]\n }\n },\n \"body\": [\n {\n \"type\": \"steedos-icon\",\n \"category\": \"utility\",\n \"name\": \"rows\",\n \"colorVariant\": \"default\",\n \"id\": \"u:afc3a08e8cf3\",\n \"className\": \"slds-button_icon slds-global-header__icon\"\n }\n ]\n }]\n }\n\n let menuItems = data.nav;\n\n if(context.keywords){\n // \u5982\u679CmenuItem\u7684children, children\u662F\u6570\u7EC4\u7ED3\u6784, \u6BCF\u4E00\u9879\u7684searchKey\u5305\u542Bcontext.keywords, \u5219\u663E\u793AmenuItem\u53CA\u5176\u7B26\u5408\u6761\u4EF6\u7684children;\n menuItems = _.filter(menuItems, (menuItem)=>{\n if(menuItem.children){\n const children = _.filter(menuItem.children, (child)=>{\n return _.includes(child.searchKey, context.keywords);\n });\n\n if(children.length > 0){\n menuItem.children = children;\n }\n\n return children.length > 0;\n }\n })\n };\n\n if(!menuItems || menuItems.length == 0){\n menuItems = data.nav;\n }\n\n payload.data = {\n \"type\":\"service\",\n \"className\": \"steedos-app-service steedos-app-service-${allowEditApp ? 'edit' : 'readonly'}\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": menuItems,\n \"keyvalues\": \"${ss:keyvalues}\",\n \"allowEditApp\": allowEditApp,\n \"tab_groups\": tab_groups\n },\n \"id\": \"appMenuService\",\n \"onEvent\": {\n \"@data.changed.steedos_keyvalues\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"args\": {\n \"value\": {\n \"keyvalues\": \"${event.data.keyvalues}\"\n }\n }\n }\n ]\n }\n },\n \"body\": [\n ...editAppSearch,\n {\n \"type\": \"nav\",\n \"expandPosition\": \"after\",\n \"collapsed\": collapsed,\n \"searchable\": false,\n \"searchConfig\": {\n \"placeholder\": \"\u641C\u7D22\u83DC\u5355\",\n \"matchFunc\": \"return link.searchKey && link.searchKey.indexOf(keyword)>=0;\"\n },\n className: \"").concat(className, " text-black steedos-app-menu ").concat(stacked ? 'stacked' : '', "\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"draggable\": allowEditApp,\n \"dragOnSameLevel\": true,\n \"saveOrderApi\": {\n \"url\": \"/service/api/apps/update_app_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"\",\n \"requestAdaptor\": \"const menus = context.data;const tab_groups = [];const tab_items = {};_.each(menus, (menu) => { if (menu.isGroup) { tab_groups.push({ group_name: menu.label, default_open: menu.default_open, }); }else{tab_items[menu.tabApiName] = {group:''}}; if (menu.children) { _.each(menu.children, (menu2) => { tab_items[menu2.tabApiName] = { group: menu.label } }) }}); api.data={appId: context.app.id, tab_groups, tab_items}; return api;\",\n \"messages\": {}\n },\n \"itemActions\": [\n {\n \"type\": \"dropdown-button\",\n \"level\": \"link\",\n \"icon\": \"fa fa-ellipsis-h\",\n \"hideCaret\": true,\n \"closeOnClick\": true,\n \"closeOnOutside\": true,\n \"btnClassName\": \"!text-gray-700\",\n \"visibleOn\": \"!!allowEditApp\",\n \"className\": \"hidden hover-inline-flex px-1\",\n \"buttons\": [\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"Api Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"o_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/objects/create_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Steedos.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"p_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/pages/create_page_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Steedos.getRelativeUrl('/api/pageDesign?pageId=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"required\": true,\n \"value\": \"t_${UUID(6)}\",\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"fLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u5916\u90E8\u94FE\u63A5\",\n \"name\": \"fUrl\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/tabs/create_link_tab_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.fLabel, icon: context.icon, url: context.fUrl}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\",\n \"visibleOn\": \"!!this.isGroup\",\n },\n {\n \"type\": \"button\",\n \"label\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"body\": [\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u9009\u9879\u5361\",\n \"config\": {\n \"type\": \"lookup\",\n \"reference_to\": \"tabs\",\n \"reference_to_field\": \"name\",\n \"required\": true,\n \"sort_no\": 30,\n \"name\": \"tabs\",\n \"multiple\": true,\n \"enable_enhanced_lookup\": true,\n \"amis\": {\n \"label\": false,\n \"embed\": true,\n }\n }\n }\n ],\n \"id\": \"u:709fd4d53437\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:ba7b707cddd8\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:2f3e5635b95d\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"size\": \"md\",\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/update_app_tabs_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, addTabNames: context.tabs}; return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\",\n \"visibleOn\": \"!!this.isGroup\",\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\u5206\u7EC4\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u7F16\u8F91\u5206\u7EC4\",\n \"data\": {\n \"appId\": \"\\${app.id}\",\n \"name\": \"\\${event.data.label}\",\n \"oldName\": \"\\${event.data.label}\",\n \"defaultOpen\": \"\\${event.data.default_open}\"\n },\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"\u540D\u79F0\",\n \"name\": \"name\",\n \"id\": \"u:e5bd37f6699b\",\n \"placeholder\": \"\u5206\u7EC4\u540D\u79F0\",\n \"required\": true\n },\n {\n \"type\": \"checkbox\",\n \"option\": \"\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00\",\n \"name\": \"defaultOpen\",\n \"id\": \"u:dae5884c1623\",\n \"required\": true\n }\n ],\n \"id\": \"u:304b5b04c573\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d85\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a05b\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/apps/update_app_group_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"\",\n \"requestAdaptor\": \"api.data={appId: context.appId, name: context.name, defaultOpen: context.defaultOpen, oldName: context.oldName}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\u5BF9\u8C61\",\n \"visibleOn\": \"this.type==='object'\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"window.location.href=Steedos.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + event.data.id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href)\",\n \"expression\": \"${false}\"\n },\n {\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const objects = payload.data.objects; if(objects && objects.length > 0){ return {data: objects[0]} }; return {data: null};\",\n \"requestAdaptor\": \"api.data={query: '{ objects(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name}}'}; return api;\"\n }\n },\n {\n \"actionType\": \"drawer\",\n \"drawer\": {\n \"type\": \"drawer\",\n \"title\": \" \",\n \"headerClassName\": \"hidden\",\n \"size\": \"lg\",\n \"width\": window.drawerWidth || \"70%\",\n \"bodyClassName\": \"p-0 m-0 bg-gray-100\",\n \"closeOnEsc\": true,\n \"closeOnOutside\": true,\n \"resizable\": true,\n \"actions\": [],\n \"body\": {\n \"type\": \"service\",\n \"id\": \"u:1678e148c8d2\",\n \"messages\": {},\n \"schemaApi\": {\n \"url\": \"/api/pageSchema/record?objectApiName=objects&formFactor=LARGE\",\n \"method\": \"get\",\n \"adaptor\": \"const schema = JSON.parse(payload.schema); schema.data={objectName: 'objects', _inDrawer: true, recordLoaded: false}; schema.objectApiName='objects'; schema.recordId=context.responseData._id; return {data: schema};\"\n }\n },\n \"className\": \"steedos-record-detail-drawer app-popover\",\n \"id\": \"u:fc5f055afa8c\"\n },\n \"preventDefault\": true\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"expression\": \"${false}\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const objects = payload.data.objects; if(objects && objects.length > 0){ try{const objectId = objects[0]._id; navigate('/app/admin/objects/view/'+objectId+'?side_object=objects&side_listview_id=all')}catch(e){payload.error=e.message;} }; return payload;\",\n \"requestAdaptor\": \"api.data={query: '{ objects(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name}}'}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\u5FAE\u9875\u9762\",\n \"visibleOn\": \"this.type==='page'\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const tabs = payload.data.tabs; if(tabs && tabs.length > 0){ try{const pageId = tabs[0].page__expand._id; window.location.href=Steedos.getRelativeUrl('/api/pageDesign?pageId=' + pageId +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href)}catch(e){payload.error=e.message;} }; return payload;\",\n \"requestAdaptor\": \"api.data={query: '{ tabs(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name page page__expand { _id } }}'}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\u9009\u9879\u5361\",\n \"visibleOn\": \"this.type==='url'\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"if(payload.data.tabs && payload.data.tabs.length > 0){payload.data=payload.data.tabs[0]}; return payload\",\n \"requestAdaptor\": \"api.data={query: '{ tabs(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id oName:name fLabel:label fUrl:url icon }}'}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u7F16\u8F91\u5916\u90E8\u94FE\u63A5\",\n \"data\": {\n \"appId\": \"\\${app.id}\",\n \"&\": \"\\${event.data.responseResult}\"\n },\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"required\": true,\n \"disabled\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"fLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u5916\u90E8\u94FE\u63A5\",\n \"name\": \"fUrl\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/tabs/update_link_tab_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.appId, groupId: context.label, name: context.oName, label: context.fLabel, icon: context.icon, url: context.fUrl}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u79FB\u52A8\u5206\u7EC4\",\n \"visibleOn\": \"!!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"event.setData({appId: event.data.app.id, groups: [{label: event.data.app.name, value: 0, children: _.map(event.data.tab_groups, (tGroup)=>{return {label: tGroup.group_name, value: tGroup.group_name}})}] , tabApiName: event.data.tabApiName, groupName: event.data.groupName})\"\n },\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u79FB\u52A8\u5230\u6307\u5B9A\u5206\u7EC4\",\n \"data\": {\n \"appId\": \"\\${event.data.appId}\",\n \"groups\": \"\\${event.data.groups}\",\n \"tabApiName\": \"\\${event.data.tabApiName}\",\n \"groupName\": \"\\${event.data.groupName}\",\n \"oldGroupName\": \"\\${event.data.groupName}\",\n },\n \"body\": [\n {\n \"type\": \"tree-select\",\n \"label\": \"\",\n \"name\": \"groupName\",\n \"id\": \"u:26d0b458ff51\",\n \"multiple\": false,\n \"source\": \"\\${groups}\"\n }\n ],\n \"id\": \"u:d69cbb95089a\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:12261bf51dcb\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:b144775ea124\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/move_app_tab\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.appId, groupName: context.groupName, oldGroupName: context.oldGroupName, tabName: context.tabApiName}; return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u5220\u9664\u9009\u9879\u5361\",\n \"visibleOn\": \"!!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/delete_app_tab\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, tabName: context.tabApiName};return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n },\n \"id\": \"u:e54eed92d13f\",\n \"confirmText\": \"\u786E\u5B9A\u8981\u5220\u9664\u5417?\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u5220\u9664\u5206\u7EC4\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"if(event.data.children && event.data.children.length > 0){doAction({'actionType': 'toast','args': { 'msgType': 'warning', 'msg': '\u5206\u7EC4\u4E0B\u6709\u6570\u636E,\u7981\u6B62\u5220\u9664'}});event.stopPropagation();};\"\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/delete_app_group\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupName: context.label};return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n },\n \"id\": \"u:e54eed92d13f\",\n \"confirmText\": \"\u786E\u5B9A\u8981\u5220\u9664\u5417?\"\n }\n ]\n },\n ],\n \"source\": \"${items}\",\n //\u5DE6\u5C42\u663E\u793A\u65F6\u5BA1\u6279\u5355\u663E\u793Abadge\u6570\u91CF\n \"itemBadge\": {\n \"mode\": \"text\",\n \"text\": \"").concat(badgeText, "\",\n \"visibleOn\": \"${id == 'instance_tasks'}\",\n \"overflowCount\": 99,\n \"style\": stacked?{\n \"right\": \"20%\",\n \"margin-right\": \"-23px\",\n \"height\": \"20px\",\n \"border-radius\": \"10px\",\n \"font-size\": \"16px\",\n \"line-height\": \"18px\",\n \"top\": \"50%\"\n }:{\n \"transform\": \"translate(calc(50% - 17px), calc(-50% + 10px))\",\n \"border-radius\": \"6.5px\",\n \"height\": \"15px\",\n \"line-height\": \"13px\",\n \"padding\": \"0px 4px\",\n \"font-size\": \"12px\"\n }\n },\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 \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\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 \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n }\n }\n }\n ]\n };\n } catch (error) {\n console.log(`error`, error)\n }\n setTimeout(function(){\n $(\"[name='keywords']\").focus();\n }, 300);\n // console.log('AmisAppMenu AmisAppMenu=====>', payload)\n return payload;\n ")
|
|
26232
|
+
"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 let collapsed = false;\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n let 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 = \"").concat(data.tabId, "\";\n var usedGroupNames = [];\n let allowEditApp = false;\n if(stacked){\n if(context.appId == context.app.id){\n collapsed = _.includes(document.body.classList, 'sidebar-open') != true;\n }\n // console.log('collapsed', collapsed, document.body.classList, context.appId == context.app.id)\n if(collapsed){\n showIcon = false;\n }\n\n if(payload.allowEditApp && collapsed != true){\n allowEditApp = true;\n }\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n tab.iconClass = (tab.icon || 'account').replaceAll('_', '-');\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='whitespace-normal leading-6 no-underline group items-center rounded-md'><svg class=\"slds-icon_container slds-icon fill-gray-700 mr-2 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 \"searchKey\": tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index,\n \"tabApiName\": tab.tabApiName,\n \"type\": tab.type,\n \"tabIcon\": tab.icon\n // active: selectedId === tab.id,\n })\n })\n } else {\n var tabGroup = _.find(tab_groups, {\"group_name\": groupName});\n usedGroupNames.push(groupName);\n data.nav.push({\n \"label\": groupName,\n 'default_open': tabGroup && tabGroup.default_open != false,\n \"unfolded\": tabGroup && tabGroup.default_open != false,\n \"isGroup\": true,\n \"children\": _.sortBy(_.map(tabs, (tab) => {\n tab.iconClass = (tab.icon || 'account').replaceAll('_', '-');\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='whitespace-normal leading-6 block no-underline group items-center rounded-md'><svg class=\"slds-icon_container slds-icon fill-gray-700 mr-2 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 \"searchKey\": tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index,\n \"tabApiName\": tab.tabApiName,\n \"type\": tab.type,\n // active: selectedId === tab.id,\n \"groupName\": groupName,\n \"tabIcon\": tab.icon\n }\n }),(tab) => {return tab.index})\n }) \n }\n });\n \n }else{\n _.each(payload.children, (tab)=>{\n tab.iconClass = (tab.icon || 'account').replaceAll('_', '-');\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='whitespace-normal leading-6 no-underline group items-center rounded-md'><svg class=\"slds-icon_container slds-icon-standard-${ tab.iconClass } slds-icon !fill-white rounded-xl mr-2 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 \"searchKey\": tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index,\n \"tabApiName\": tab.tabApiName,\n \"type\": tab.type,\n \"tabIcon\": tab.icon\n // active: selectedId === tab.id,\n });\n })\n }\n //\u4EE5\u4E0B\u4E3Anav\u7B2C\u4E00\u5C42\u6392\u5E8F\uFF0C\u5305\u62EC\u5206\u7EC4\u4E0E\u9009\u9879\u5361\n // let groupLength = ((payload.tab_groups && payload.tab_groups.length) || 0) + 1000;\n data.nav = _.sortBy(data.nav, function(tab){\n if(tab.isGroup){\n return _.findIndex(payload.tab_groups, function(group){\n return group.group_name === tab.label;\n });\n }else{\n // \u6CA1\u6709\u5206\u7EC4\u7684\u9009\u9879\u5361\u6309index\u6392\u5217\u5728\u6709\u5206\u7EC4\u7684\u9009\u9879\u5361\u524D\u65B9\n return (tab.index || 0) - 1000;\n }\n })\n if(allowEditApp){\n _.each(payload.tab_groups, (group)=>{\n if(!_.includes(usedGroupNames, group.group_name)){\n data.nav.push({\n \"label\": group.group_name,\n 'default_open': group && group.default_open != false,\n \"unfolded\": group && group.default_open != false,\n \"isGroup\": true,\n \"children\": []\n })\n }\n });\n }\n\n if(collapsed){\n const collapsedNav = [];\n for(const item of data.nav){\n if(item.isGroup){\n if(collapsedNav.length > 0){\n collapsedNav.push({\n \"mode\": \"divider\"\n })\n }\n for(const childrenItem of item.children){\n collapsedNav.push(Object.assign({}, childrenItem, {\n disabledTip: true,\n label: {\n \"type\": \"tooltip-wrapper\",\n \"content\": childrenItem.label,\n \"placement\": \"right\",\n \"disabled\": true,\n \"body\": [\n {\n 'type': 'tpl',\n 'tpl': '<svg class=\"slds-icon_container slds-icon fill-gray-700 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#' + (childrenItem.tabIcon || 'account') + '\"></use></svg>'\n }\n ]\n }\n \n \n // label: false, \n // icon: '/assets/icons/standard-sprite/svg/symbols.svg#' + (childrenItem.tabIcon || 'account')\n }));\n }\n }else{\n collapsedNav.push(Object.assign({}, item, {\n disabledTip: true,\n label: {\n \"type\": \"tooltip-wrapper\",\n \"content\": item.label,\n \"placement\": \"right\",\n \"disabled\": true,\n \"body\": [\n {\n 'type': 'tpl',\n 'tpl': '<svg class=\"slds-icon_container slds-icon fill-gray-700 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#' + (item.tabIcon || 'account') + '\"></use></svg>'\n }\n ]\n }\n // label: false, \n // icon: '/assets/icons/standard-sprite/svg/symbols.svg#' + (item.tabIcon || 'account')\n }));\n }\n }\n data.nav = collapsedNav;\n }\n\n let editAppSearch = [];\n if(allowEditApp){\n editAppSearch = [{\n \"type\": \"grid\",\n \"className\": \"m-2\",\n \"columns\": [\n {\n \"md\": 9,\n \"columnClassName\": \"p-0\",\n \"body\": [\n {\n \"type\": \"button\",\n \"className\": \"toggle-sidebar\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"document.body.classList.toggle('sidebar-open')\",\n },\n {\n \"actionType\": \"rebuild\",\n \"componentId\": \"u:app-menu\",\n \"args\": {\n \"toggleSidebar\": true\n }\n }\n ]\n }\n },\n \"body\": [\n {\n \"type\": \"html\",\n \"html\": \"<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-7 h-7 p-1 hover:bg-white hover:shadow'><path stroke-linecap='round' stroke-linejoin='round' d='M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5' /></svg>\"\n }\n ]\n }\n ]\n },\n {\n \"md\": 3,\n \"columnClassName\": \"p-0 steedos-app-menu-plus\",\n \"body\": [\n {\n \"type\": \"dropdown-button\",\n \"level\": \"link\",\n \"className\": \"float-right\",\n \"btnClassName\": \"p-1 text-gray-600 hover:bg-white! hover:shadow!\",\n \"icon\": \"fa fa-gear\",\n \"iconOnly\": true,\n \"closeOnClick\": true,\n \"closeOnOutside\": true,\n // \"size\": \"md\",\n \"hideCaret\": true,\n \"align\": \"right\",\n \"buttons\": [\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"Api Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"o_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/objects/create_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Steedos.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"p_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/pages/create_page_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Steedos.getRelativeUrl('/api/pageDesign?pageId=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"required\": true,\n \"value\": \"t_${UUID(6)}\",\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n \n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"fLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u5916\u90E8\u94FE\u63A5\",\n \"name\": \"fUrl\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/tabs/create_link_tab_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', name: context.oName, label: context.fLabel, icon: context.icon, url: context.fUrl}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"body\": [\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u9009\u9879\u5361\",\n \"config\": {\n \"type\": \"lookup\",\n \"reference_to\": \"tabs\",\n \"reference_to_field\": \"name\",\n \"required\": true,\n \"sort_no\": 30,\n \"name\": \"tabs\",\n \"multiple\": true,\n \"enable_enhanced_lookup\": true,\n \"amis\": {\n \"label\": false,\n \"embed\": true,\n }\n }\n }\n ],\n \"id\": \"u:709fd4d53437\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:ba7b707cddd8\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:2f3e5635b95d\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"size\": \"md\",\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/update_app_tabs_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: '', addTabNames: context.tabs}; return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5206\u7EC4\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5206\u7EC4\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"\u540D\u79F0\",\n \"name\": \"name\",\n \"id\": \"u:e5bd37f6699b\",\n \"placeholder\": \"\u5206\u7EC4\u540D\u79F0\",\n \"required\": true\n },\n {\n \"type\": \"checkbox\",\n \"option\": \"\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00\",\n \"name\": \"defaultOpen\",\n \"id\": \"u:dae5884c1623\",\n \"required\": true\n }\n ],\n \"id\": \"u:304b5b04c573\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d85\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a05b\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/apps/create_app_group_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, name: context.name, defaultOpen: context.defaultOpen}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n },\n },\n {\n \"type\": \"divider\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\u5E94\u7528\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const apps = payload.data.apps; if(apps && apps.length > 0){ return {data: apps[0]} }; return {data: null};\",\n \"requestAdaptor\": \"api.data={query: '{ apps(filters: [\\\"code\\\", \\\"=\\\", ' + context.appId + ']) { _id name}}'}; return api;\"\n }\n },\n {\n \"actionType\": \"drawer\",\n \"drawer\": {\n \"type\": \"drawer\",\n \"title\": \" \",\n \"headerClassName\": \"hidden\",\n \"size\": \"lg\",\n \"width\": window.drawerWidth || \"70%\",\n \"bodyClassName\": \"p-0 m-0 bg-gray-100\",\n \"closeOnEsc\": true,\n \"closeOnOutside\": true,\n \"resizable\": true,\n \"actions\": [],\n \"body\": {\n \"type\": \"service\",\n \"id\": \"u:1678e148c8d2\",\n \"messages\": {},\n \"schemaApi\": {\n \"url\": \"/api/pageSchema/app?objectApiName=apps&formFactor=LARGE&formFactor=LARGE\",\n \"method\": \"get\",\n \"adaptor\": \"const schema = {type: 'steedos-record-detail'}; schema.data={objectName: 'apps', _inDrawer: true, recordLoaded: false}; schema.objectApiName='apps'; schema.recordId=context.responseData._id; console.log('schema', schema); return {data: schema};\"\n }\n },\n \"className\": \"steedos-record-detail-drawer app-popover\",\n \"id\": \"u:fc5f055afa8c\"\n },\n \"preventDefault\": true\n }\n ]\n }\n }\n }\n ]\n }\n ]\n }\n ]\n }]\n }else if(stacked){\n editAppSearch = [{\n \"type\": \"button\",\n \"className\": \"toggle-sidebar w-12 mx-3 my-2\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"document.body.classList.toggle('sidebar-open')\",\n },\n {\n \"actionType\": \"rebuild\",\n \"componentId\": \"u:app-menu\",\n \"args\": {\n \"toggleSidebar\": true\n }\n }\n ]\n }\n },\n \"body\": [\n {\n \"type\": \"html\",\n \"html\": \"<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-7 h-7 p-1 hover:bg-white hover:shadow'><path stroke-linecap='round' stroke-linejoin='round' d='M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5' /></svg>\"\n }\n ]\n }]\n }\n\n let menuItems = data.nav;\n\n if(context.keywords){\n // \u5982\u679CmenuItem\u7684children, children\u662F\u6570\u7EC4\u7ED3\u6784, \u6BCF\u4E00\u9879\u7684searchKey\u5305\u542Bcontext.keywords, \u5219\u663E\u793AmenuItem\u53CA\u5176\u7B26\u5408\u6761\u4EF6\u7684children;\n menuItems = _.filter(menuItems, (menuItem)=>{\n if(menuItem.children){\n const children = _.filter(menuItem.children, (child)=>{\n return _.includes(child.searchKey, context.keywords);\n });\n\n if(children.length > 0){\n menuItem.children = children;\n }\n\n return children.length > 0;\n }\n })\n };\n\n if(!menuItems || menuItems.length == 0){\n menuItems = data.nav;\n }\n\n payload.data = {\n \"type\":\"service\",\n \"className\": \"steedos-app-service steedos-app-service-${allowEditApp ? 'edit' : 'readonly'}\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": menuItems,\n \"keyvalues\": \"${ss:keyvalues}\",\n \"allowEditApp\": allowEditApp,\n \"tab_groups\": tab_groups\n },\n \"id\": \"appMenuService\",\n \"onEvent\": {\n \"@data.changed.steedos_keyvalues\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"args\": {\n \"value\": {\n \"keyvalues\": \"${event.data.keyvalues}\"\n }\n }\n }\n ]\n }\n },\n \"body\": [\n ...editAppSearch,\n {\n \"type\": \"nav\",\n \"expandPosition\": \"after\",\n \"collapsed\": collapsed,\n \"searchable\": false,\n \"searchConfig\": {\n \"placeholder\": \"\u641C\u7D22\u83DC\u5355\",\n \"matchFunc\": \"return link.searchKey && link.searchKey.indexOf(keyword)>=0;\"\n },\n className: \"").concat(className, " text-black steedos-app-menu ").concat(stacked ? 'stacked' : '', "\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"draggable\": allowEditApp,\n \"dragOnSameLevel\": false,\n \"saveOrderApi\": {\n \"url\": \"/service/api/apps/update_app_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"\",\n \"requestAdaptor\": \"const menus = context.data;const tab_groups = [];const tab_items = {};_.each(menus, (menu) => { if (menu.isGroup) { tab_groups.push({ group_name: menu.label, default_open: menu.default_open, }); }else{tab_items[menu.tabApiName] = {group:''}}; if (menu.children) { _.each(menu.children, (menu2) => { tab_items[menu2.tabApiName] = { group: menu.label } }) }}); api.data={appId: context.app.id, tab_groups, tab_items}; return api;\",\n \"messages\": {}\n },\n \"itemActions\": [\n {\n \"type\": \"dropdown-button\",\n \"level\": \"link\",\n \"icon\": \"fa fa-ellipsis-h\",\n \"hideCaret\": true,\n \"closeOnClick\": true,\n \"closeOnOutside\": true,\n \"btnClassName\": \"!text-gray-700\",\n \"visibleOn\": \"!!allowEditApp\",\n \"className\": \"hidden hover-inline-flex px-1\",\n \"buttons\": [\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5BF9\u8C61\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"Api Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"o_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/objects/create_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Steedos.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5FAE\u9875\u9762\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"value\": \"p_${UUID(6)}\",\n \"required\": true,\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"oLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/pages/create_page_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"window.location.href=Steedos.getRelativeUrl('/api/pageDesign?pageId=' + payload._id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href);return {}\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.oLabel, icon: context.icon}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u65B0\u5EFA\u5916\u90E8\u94FE\u63A5\",\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"required\": true,\n \"value\": \"t_${UUID(6)}\",\n \"validateOnChange\": true,\n \"validations\": {\n \"isVariableName\": /^[a-zA-Z]([A-Za-z0-9]|_(?!_))*[A-Za-z0-9]$/\n }\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"fLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u5916\u90E8\u94FE\u63A5\",\n \"name\": \"fUrl\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/tabs/create_link_tab_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, name: context.oName, label: context.fLabel, icon: context.icon, url: context.fUrl}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\",\n \"visibleOn\": \"!!this.isGroup\",\n },\n {\n \"type\": \"button\",\n \"label\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u6DFB\u52A0\u73B0\u6709\u9009\u9879\u5361\",\n \"body\": [\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u9009\u9879\u5361\",\n \"config\": {\n \"type\": \"lookup\",\n \"reference_to\": \"tabs\",\n \"reference_to_field\": \"name\",\n \"required\": true,\n \"sort_no\": 30,\n \"name\": \"tabs\",\n \"multiple\": true,\n \"enable_enhanced_lookup\": true,\n \"amis\": {\n \"label\": false,\n \"embed\": true,\n }\n }\n }\n ],\n \"id\": \"u:709fd4d53437\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:ba7b707cddd8\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:2f3e5635b95d\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"size\": \"md\",\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/update_app_tabs_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupId: context.label, addTabNames: context.tabs}; return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"divider\",\n \"visibleOn\": \"!!this.isGroup\",\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\u5206\u7EC4\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u7F16\u8F91\u5206\u7EC4\",\n \"data\": {\n \"appId\": \"\\${app.id}\",\n \"name\": \"\\${event.data.label}\",\n \"oldName\": \"\\${event.data.label}\",\n \"defaultOpen\": \"\\${event.data.default_open}\"\n },\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"\u540D\u79F0\",\n \"name\": \"name\",\n \"id\": \"u:e5bd37f6699b\",\n \"placeholder\": \"\u5206\u7EC4\u540D\u79F0\",\n \"required\": true\n },\n {\n \"type\": \"checkbox\",\n \"option\": \"\u662F\u5426\u9ED8\u8BA4\u5C55\u5F00\",\n \"name\": \"defaultOpen\",\n \"id\": \"u:dae5884c1623\",\n \"required\": true\n }\n ],\n \"id\": \"u:304b5b04c573\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d85\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a05b\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/apps/update_app_group_by_design\",\n \"method\": \"post\",\n \"adaptor\": \"\",\n \"requestAdaptor\": \"api.data={appId: context.appId, name: context.name, defaultOpen: context.defaultOpen, oldName: context.oldName}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u67E5\u770B\u5BF9\u8C61\",\n \"visibleOn\": \"this.type==='object'\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"window.location.href=Steedos.getRelativeUrl('/api/amisObjectFieldsDesign?oid=' + event.data.id +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href)\",\n \"expression\": \"${false}\"\n },\n {\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const objects = payload.data.objects; if(objects && objects.length > 0){ return {data: objects[0]} }; return {data: null};\",\n \"requestAdaptor\": \"api.data={query: '{ objects(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name}}'}; return api;\"\n }\n },\n {\n \"actionType\": \"drawer\",\n \"drawer\": {\n \"type\": \"drawer\",\n \"title\": \" \",\n \"headerClassName\": \"hidden\",\n \"size\": \"lg\",\n \"width\": window.drawerWidth || \"70%\",\n \"bodyClassName\": \"p-0 m-0 bg-gray-100\",\n \"closeOnEsc\": true,\n \"closeOnOutside\": true,\n \"resizable\": true,\n \"actions\": [],\n \"body\": {\n \"type\": \"service\",\n \"id\": \"u:1678e148c8d2\",\n \"messages\": {},\n \"schemaApi\": {\n \"url\": \"/api/pageSchema/record?objectApiName=objects&formFactor=LARGE\",\n \"method\": \"get\",\n \"adaptor\": \"const schema = JSON.parse(payload.schema); schema.data={objectName: 'objects', _inDrawer: true, recordLoaded: false}; schema.objectApiName='objects'; schema.recordId=context.responseData._id; return {data: schema};\"\n }\n },\n \"className\": \"steedos-record-detail-drawer app-popover\",\n \"id\": \"u:fc5f055afa8c\"\n },\n \"preventDefault\": true\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"expression\": \"${false}\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const objects = payload.data.objects; if(objects && objects.length > 0){ try{const objectId = objects[0]._id; navigate('/app/admin/objects/view/'+objectId+'?side_object=objects&side_listview_id=all')}catch(e){payload.error=e.message;} }; return payload;\",\n \"requestAdaptor\": \"api.data={query: '{ objects(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name}}'}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\u5FAE\u9875\u9762\",\n \"visibleOn\": \"this.type==='page'\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"const tabs = payload.data.tabs; if(tabs && tabs.length > 0){ try{const pageId = tabs[0].page__expand._id; window.location.href=Steedos.getRelativeUrl('/api/pageDesign?pageId=' + pageId +`&assetUrls=${Builder.settings.assetUrls}`+'&retUrl='+window.location.href)}catch(e){payload.error=e.message;} }; return payload;\",\n \"requestAdaptor\": \"api.data={query: '{ tabs(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id name page page__expand { _id } }}'}; return api;\",\n \"messages\": {}\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u7F16\u8F91\u9009\u9879\u5361\",\n \"visibleOn\": \"this.type==='url'\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/graphql\",\n \"method\": \"post\",\n \"adaptor\": \"if(payload.data.tabs && payload.data.tabs.length > 0){payload.data=payload.data.tabs[0]}; return payload\",\n \"requestAdaptor\": \"api.data={query: '{ tabs(filters: [\\\"name\\\", \\\"=\\\", ' + context.id + ']) { _id oName:name fLabel:label fUrl:url icon }}'}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u7F16\u8F91\u5916\u90E8\u94FE\u63A5\",\n \"data\": {\n \"appId\": \"\\${app.id}\",\n \"&\": \"\\${event.data.responseResult}\"\n },\n \"body\": [\n {\n \"type\": \"input-text\",\n \"label\": \"API Name\",\n \"name\": \"oName\",\n \"id\": \"u:dae5884c1633\",\n \"placeholder\": \"\u552F\u4E00\u6807\u8BC6\",\n \"required\": true,\n \"disabled\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u663E\u793A\u540D\u79F0\",\n \"name\": \"fLabel\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"input-text\",\n \"label\": \"\u5916\u90E8\u94FE\u63A5\",\n \"name\": \"fUrl\",\n \"id\": \"u:e5bd37f6691b\",\n \"required\": true\n },\n {\n \"type\": \"steedos-field\",\n \"label\": \"\u56FE\u6807\",\n \"config\": {\n \"label\": \"\u56FE\u6807\",\n \"type\": \"lookup\",\n \"required\": true,\n \"sort_no\": 30,\n \"optionsFunction\": \"function anonymous() { var options; options = []; _.forEach(Steedos.resources.sldsIcons.standard, function (svg) { return options.push({ value: svg, label: svg, icon: svg }); }); return options; }\",\n \"name\": \"icon\",\n \"inlineHelpText\": \"\",\n \"description\": \"\",\n \"hidden\": false,\n \"readonly\": false,\n \"disabled\": false\n }\n }\n ],\n \"id\": \"u:38b76ff2792d\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:21d3cccf4d83\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:238e5731a053\"\n }\n ],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\",\n \"body\": [\n {\n \"type\": \"spinner\",\n \"id\": \"u:7b15becd491f\",\n \"overlay\": true\n }\n ],\n \"id\": \"u:38b76ff2798d\",\n \"actions\": [],\n \"showCloseButton\": false,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": false,\n \"showLoading\": false,\n \"draggable\": false\n }\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"api\": {\n \"url\": \"/service/api/tabs/update_link_tab_by_design\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.appId, groupId: context.label, name: context.oName, label: context.fLabel, icon: context.icon, url: context.fUrl}; return api;\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u79FB\u52A8\u5206\u7EC4\",\n \"visibleOn\": \"!!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"event.setData({appId: event.data.app.id, groups: [{label: event.data.app.name, value: 0, children: _.map(event.data.tab_groups, (tGroup)=>{return {label: tGroup.group_name, value: tGroup.group_name}})}] , tabApiName: event.data.tabApiName, groupName: event.data.groupName})\"\n },\n {\n \"ignoreError\": false,\n \"actionType\": \"dialog\",\n \"dialog\": {\n \"type\": \"dialog\",\n \"title\": \"\u79FB\u52A8\u5230\u6307\u5B9A\u5206\u7EC4\",\n \"data\": {\n \"appId\": \"\\${event.data.appId}\",\n \"groups\": \"\\${event.data.groups}\",\n \"tabApiName\": \"\\${event.data.tabApiName}\",\n \"groupName\": \"\\${event.data.groupName}\",\n \"oldGroupName\": \"\\${event.data.groupName}\",\n },\n \"body\": [\n {\n \"type\": \"tree-select\",\n \"label\": \"\",\n \"name\": \"groupName\",\n \"id\": \"u:26d0b458ff51\",\n \"multiple\": false,\n \"source\": \"\\${groups}\"\n }\n ],\n \"id\": \"u:d69cbb95089a\",\n \"actions\": [\n {\n \"type\": \"button\",\n \"actionType\": \"cancel\",\n \"label\": \"\u53D6\u6D88\",\n \"id\": \"u:12261bf51dcb\"\n },\n {\n \"type\": \"button\",\n \"actionType\": \"confirm\",\n \"label\": \"\u786E\u5B9A\",\n \"primary\": true,\n \"id\": \"u:b144775ea124\"\n }\n ],\n \"showCloseButton\": true,\n \"closeOnOutside\": false,\n \"closeOnEsc\": false,\n \"showErrorMsg\": true,\n \"showLoading\": true,\n \"draggable\": false,\n \"onEvent\": {\n \"confirm\": {\n \"weight\": 0,\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/move_app_tab\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.appId, groupName: context.groupName, oldGroupName: context.oldGroupName, tabName: context.tabApiName}; return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n }\n }\n }\n ]\n }\n }\n },\n {\n \"type\": \"button\",\n \"label\": \"\u5220\u9664\u9009\u9879\u5361\",\n \"visibleOn\": \"!!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/delete_app_tab\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, tabName: context.tabApiName};return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n },\n \"id\": \"u:e54eed92d13f\",\n \"confirmText\": \"\u786E\u5B9A\u8981\u5220\u9664\u5417?\"\n },\n {\n \"type\": \"button\",\n \"label\": \"\u5220\u9664\u5206\u7EC4\",\n \"visibleOn\": \"!!this.isGroup\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"custom\",\n \"script\": \"if(event.data.children && event.data.children.length > 0){doAction({'actionType': 'toast','args': { 'msgType': 'warning', 'msg': '\u5206\u7EC4\u4E0B\u6709\u6570\u636E,\u7981\u6B62\u5220\u9664'}});event.stopPropagation();};\"\n },\n {\n \"ignoreError\": false,\n \"outputVar\": \"responseResult\",\n \"actionType\": \"ajax\",\n \"options\": {},\n \"api\": {\n \"url\": \"/service/api/apps/delete_app_group\",\n \"method\": \"post\",\n \"requestAdaptor\": \"api.data={appId: context.app.id, groupName: context.label};return api;\",\n \"adaptor\": \"\",\n \"messages\": {}\n }\n },\n {\n \"componentId\": \"u:app-menu\",\n \"groupType\": \"component\",\n \"actionType\": \"reload\"\n }\n ]\n }\n },\n \"id\": \"u:e54eed92d13f\",\n \"confirmText\": \"\u786E\u5B9A\u8981\u5220\u9664\u5417?\"\n }\n ]\n },\n ],\n \"source\": \"${items}\",\n //\u5DE6\u5C42\u663E\u793A\u65F6\u5BA1\u6279\u5355\u663E\u793Abadge\u6570\u91CF\n \"itemBadge\": {\n \"mode\": \"text\",\n \"text\": \"").concat(badgeText, "\",\n \"visibleOn\": \"${id == 'instance_tasks'}\",\n \"overflowCount\": 99,\n \"style\": stacked?{\n \"right\": \"20%\",\n \"margin-right\": \"-23px\",\n \"height\": \"20px\",\n \"border-radius\": \"10px\",\n \"font-size\": \"16px\",\n \"line-height\": \"18px\",\n \"top\": \"50%\"\n }:{\n \"transform\": \"translate(calc(50% - 17px), calc(-50% + 10px))\",\n \"border-radius\": \"6.5px\",\n \"height\": \"15px\",\n \"line-height\": \"13px\",\n \"padding\": \"0px 4px\",\n \"font-size\": \"12px\"\n }\n },\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 \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\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 \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n }\n }\n }\n ]\n };\n } catch (error) {\n console.log(`error`, error)\n }\n setTimeout(function(){\n $(\"[name='keywords']\").focus();\n }, 300);\n // console.log('AmisAppMenu AmisAppMenu=====>', payload)\n return payload;\n ")
|
|
26216
26233
|
}
|
|
26217
26234
|
};
|
|
26218
26235
|
// console.log(`AmisAppMenu schema=====>`, schema)
|
|
@@ -26971,7 +26988,7 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
|
|
|
26971
26988
|
body: [
|
|
26972
26989
|
{
|
|
26973
26990
|
type: "wrapper",
|
|
26974
|
-
className: 'sidebar-wrapper px-0
|
|
26991
|
+
className: 'sidebar-wrapper px-0 pt-0 pb-16 fixed z-20 h-full h-fill ease-in-out duration-300 flex flex-col border-r overflow-y-auto bg-[#F0F0F0] border-gray-300 block -translate-x-0 sm:w-[220px] w-64',
|
|
26975
26992
|
visibleOn: '${!!appId}',
|
|
26976
26993
|
body: [
|
|
26977
26994
|
{
|
|
@@ -28445,7 +28462,7 @@ var PageObject = function (props) { return __awaiter(void 0, void 0, void 0, fun
|
|
|
28445
28462
|
});
|
|
28446
28463
|
}); };
|
|
28447
28464
|
|
|
28448
|
-
var __assign=function(){return (__assign=Object.assign||function(e){for(var t,r=1,a=arguments.length;r<a;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 a=this.object;if(r)return r.allowCreate&&a.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 n=null;e=Steedos.absoluteUrl(e);try{var r=[{name:"Content-Type",value:"application/json"},{name:"Authorization",value:Steedos.getAuthorization()}],a={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){n=e;},error:function(e,t,r){var a,o;e.responseJSON&&e.responseJSON.error?(a=e.responseJSON.error,o=void(n={error:a}),o=a.reason||a.message||a,console.error(o)):console.error(e.responseJSON);}};return $.ajax(Object.assign({},a,t)),n}catch(e){console.error(e);}};function _extends(){return (_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r,a=arguments[t];for(r in a)Object.prototype.hasOwnProperty.call(a,r)&&(e[r]=a[r]);}return e}).apply(this,arguments)}const newFunctionComponent=o=>e=>{const[t,r]=React.useState(!0);var a=()=>{r(!1);};return _$1.has(e,"ref")||(window.SteedosUI.refs[e.name]={show:()=>{r(!0);},close:a}),React__default["default"].createElement(o,_extends({visible:t,onCancel:a,onClose:a},{width:"70%",style:{width:"70%",maxWidth:"950px",minWidth:"480px"}},e))},newComponentRender=(r,a)=>(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(a),e);ReactDOM.createRoot(t).render(e);},Modal=_$1.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"),_$1.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 a="";t=[`id: "${t}"`];return `{record:${e}__findOne${a=0<t.length?`(${t.join(",")})`:a}{${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):_$1.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:a,foreignKey:o}){return `/app/${e}/${t}/${r}/${a}/grid?related_field_name=`+o}};var withModalWrap=function(t,e){return function(e){return React__namespace.createElement(t,e)}},render=function(e,t,r,a){e=withModalWrap(e),e=React__namespace.createElement(e,__assign({},t));return ReactDOM__default["default"].render(e,r)};const safeRunFunction=(t,r,a,o)=>{try{let e=[];return _$1.isNil(r)||(e=_$1.isArray(r)?r:[r]),t.bind(o||{})(...e)}catch(e){return console.log(e),a}};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)))},getMoment=()=>window.amisRequire?window.amisRequire("moment"):window.moment||void 0,getGlobalNowData=()=>{var e=new Date,t=getMoment();let r=t().utc(),a=(r.set("hours",0),r.set("minutes",0),r.set("seconds",0),r.set("milliseconds",0),r=r.toDate(),t());return a.set("year",1970),a.set("month",0),a.set("date",1),a.set("hours",a.hours()+a.utcOffset()/60),a.set("seconds",0),a.set("milliseconds",0),a=a.toDate(),{now:e,today:r,timeNow:a}},parseSingleExpression=function(t,e,r,a){var o,n;if(a&&Object.assign(a,getGlobalNowData()),n=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))||{},"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(a)).replace(new RegExp("\\b"+o+"\\b","g"),"global").replace(/rootValue/g,JSON.stringify(n));try{return Function(e)()}catch(e){return console.log(e,t,r),t}};var Expression=Object.freeze({__proto__:null,isExpression:isExpression,getGlobalNowData:getGlobalNowData,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")||-1<express.indexOf("today")||-1<express.indexOf("timeNow")?`{${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})`)),_$1.isFunction(r)&&(r=safeRunFunction(r,[],null,{name:e.name})),_$1__namespace.isString(r)&&(r=getCompatibleDefaultValueExpression(r,e.multiple));var a=isExpression(r);switch(a&&("date"===e.type?r=r.replace(/\bglobal.now\b/g,"global.today"):"time"===e.type&&(r=r.replace(/\bglobal.now\b/g,"global.timeNow")),r=parseSingleExpression(r,{},"#",t)),e.type){case"select":var o=e.data_type||"text";!r||a||e.multiple||("text"!==o||_$1.isString(r)?"number"===o&&_$1.isString(r)?r=Number(r):"boolean"===o&&_$1.isString(r)&&(r="true"===r.toLowerCase()||"1"===r):r=String(r));break;case"number":_$1.isString(r)&&(r=Number(r));break;case"boolean":_$1.isString(r)?r="true"===r.toLowerCase()||"1"===r:_$1.isBoolean(r)||(r=!1);break;case"time":if(_$1.isDate(r))return moment(r).format("1970-01-01THH:mm:00.000[Z]");case"date":if(_$1.isDate(r))return moment(r).format("YYYY-MM-DDT00:00:00.000[Z]");case"datetime":if(_$1.isDate(r))return moment(r).format("YYYY-MM-DDTHH:mm:00.000Z")}return r};function getTreeOptions(t,e){const o=e?.valueField||"value",r=(e?.labelField,e?.unfoldedNum||1),a=[],n=(e,t,r,a)=>{return e.children&&"object"==typeof e.children[0]?e.children:r?(e=_.filter(t,e=>_.includes(r,e[o])),_.each(e,e=>{1<=a?(e.unfolded=!0,e.children&&(e.children=n(e,t,e.children,a-1))):e.children&&(e.children=n(e,t,e.children,a));}),e):void 0};for(var s=t,i=0;i<s.length;i++)if(s[i].noParent=0,s[i].unfolded=!1,s[i].parent){let e=1;for(var l=0;l<s.length;l++)s[i].parent==s[l][o]&&(e=0);1==e&&(s[i].noParent=1);}else s[i].noParent=1;return _.each(t,e=>{1==e.noParent&&(1<=r?(e.unfolded=!0,a.push(Object.assign({},e,{children:n(e,t,e.children,r-1)}))):a.push(Object.assign({},e,{children:n(e,t,e.children,r)})));}),a}function getClosestAmisComponentByType(t,r,a){let o=(a=a||{}).name;var e=a.direction||"up";let n=t.getComponents().find(function(e){return e.props.type===r&&(!o||e.props.name===o)});if(n)return n;if("down"===e){if(t.children&&t.children.length){for(let e=0;e<t.children.length&&!(n=getClosestAmisComponentByType(t.children[e],r,a));e++);return n}}else if("up"===e&&t.parent)return getClosestAmisComponentByType(t.parent,r,a)}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,a;_.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?(a=[[(r=""+t.replace("__searchable__",""))+"/o","=",e.o]],e.ids.length&&a.push([r+"/ids","=",e.ids]),o.push(a)):o.push([""+t.replace("__searchable__",""),"=",e])));}),o},getKeywordsSearchFilter:(e,t)=>{const o=[];var n;return e&&t&&(n=e.split(/\s+/),n=_$1.compact(n),t.forEach(function(r,e){let a=[];1==n.length?a=[r,"contains",n[0]]:n.forEach(function(e,t){a.push([r,"contains",e]),t<n.length-1&&a.push("and");}),a.length&&(o.push(a),e<t.length-1&&o.push("or"));})),o},getFormulaVariables:(e,t=!0)=>{const r=[];return _$1.isEmpty(e)||(r.push({label:"表单字段",children:[]}),lodash.forEach(e,function(e){r[0].children.push({label:e.label,value:e.value});})),t&&r.push({label:"全局变量",children:[{label:"用户ID",value:"global['userId']"},{label:"工作区ID",value:"global['spaceId']"},{label:"用户",children:[{label:"姓名",value:"global['user']['name']"},{label:"邮件",value:"global['user']['email']"},{label:"语言",value:"global['user']['language']"},{label:"简档",value:"global['user']['profile']"},{label:"权限集",value:"global['user']['roles']"},{label:"主部门ID",value:"global['user']['organization']['_id']"},{label:"部门(含上级)",value:"global['user']['organizations_parents']"},{label:"主分部ID",value:"global['user']['company_id']"},{label:"分部(多选)",value:"global['user']['company_ids']"},{label:"人员ID",value:"global['user']['spaceUserId']"},{label:"是否是工作区管理员",value:"global['user']['is_space_admin']"}]}]}),r},traverseNestedArrayFormula:(t,r)=>{var a=window.amisRequire&&window.amisRequire("amis")||Amis;for(let e=0;e<t.length;e++)if(Array.isArray(t[e]))SteedosUI$1.traverseNestedArrayFormula(t[e],r);else if(/\$\{([^}]*)\}/.test(t[e]))try{t[e]=a.evaluate(t[e],r);}catch(e){console.error("运行过滤器公式时出现错误:",e);}}});var _STANDARD_SPRITE_IDS="account,account_info,action_list_component,actions_and_buttons,activation_target,activations,address,agent_home,agent_session,aggregation_policy,all,announcement,answer_best,answer_private,answer_public,apex,apex_plugin,app,approval,apps,apps_admin,article,asset_action,asset_action_source,asset_audit,asset_downtime_period,asset_object,asset_relationship,asset_state_period,asset_warranty,assigned_resource,assignment,attach,avatar,avatar_loading,bot,bot_training,branch_merge,brand,budget,budget_allocation,bundle_config,bundle_policy,business_hours,buyer_account,buyer_group,calculated_insights,calibration,call,call_coaching,call_history,campaign,campaign_members,cancel_checkout,canvas,capacity_plan,care_request_reviewer,carousel,case,case_change_status,case_comment,case_email,case_log_a_call,case_milestone,case_transcript,case_wrap_up,catalog,category,change_request,channel_program_history,channel_program_levels,channel_program_members,channel_programs,chart,checkout,choice,client,cms,coaching,code_playground,code_set,code_set_bundle,collection,collection_variable,connected_apps,constant,contact,contact_list,contact_request,contract,contract_line_item,contract_payment,coupon_codes,currency,currency_input,custom,custom_component_task,custom_notification,customer_360,customer_lifecycle_analytics,customer_portal_users,customers,dashboard,dashboard_component,dashboard_ea,data_integration_hub,data_mapping,data_model,data_streams,datadotcom,dataset,date_input,date_time,decision,default,delegated_account,device,discounts,display_rich_text,display_text,document,document_reference,drafts,duration_downscale,dynamic_record_choice,education,einstein_replies,email,email_chatter,employee,employee_asset,employee_contact,employee_job,employee_job_position,employee_organization,empty,endorsement,entitlement,entitlement_policy,entitlement_process,entitlement_template,entity,entity_milestone,environment_hub,event,events,expense,expense_report,expense_report_entry,feed,feedback,field_sales,file,filter,filter_criteria,filter_criteria_rule,first_non_empty,flow,folder,forecasts,form,formula,fulfillment_order,generic_loading,global_constant,goals,group_loading,groups,guidance_center,hierarchy,high_velocity_sales,historical_adherence,holiday_operating_hours,home,household,identifier,immunization,incident,individual,insights,instore_locations,investment_account,invocable_action,iot_context,iot_orchestrations,javascript_button,job_family,job_position,job_profile,kanban,key_dates,knowledge,lead,lead_insights,lead_list,letterhead,lightning_component,lightning_usage,link,list_email,live_chat,live_chat_visitor,location,location_permit,log_a_call,logging,loop,macros,maintenance_asset,maintenance_plan,maintenance_work_rule,marketing_actions,med_rec_recommendation,med_rec_statement_recommendation,medication,medication_dispense,medication_ingredient,medication_reconciliation,medication_statement,merge,messaging_conversation,messaging_session,messaging_user,metrics,multi_picklist,multi_select_checkbox,network_contract,news,note,number_input,observation_component,omni_supervisor,operating_hours,opportunity,opportunity_contact_role,opportunity_splits,orchestrator,order_item,orders,outcome,output,partner_fund_allocation,partner_fund_claim,partner_fund_request,partner_marketing_budget,partners,password,past_chat,patient_medication_dosage,payment_gateway,people,performance,person_account,person_language,person_name,photo,picklist_choice,picklist_type,planogram,poll,portal,portal_roles,portal_roles_and_subordinates,post,practitioner_role,price_book_entries,price_books,pricebook,pricing_workspace,problem,procedure,procedure_detail,process,process_exception,product,product_consumed,product_consumed_state,product_item,product_item_transaction,product_quantity_rules,product_request,product_request_line_item,product_required,product_service_campaign,product_service_campaign_item,product_transfer,product_transfer_state,product_warranty_term,product_workspace,products,promotion_segments,promotions,promotions_workspace,propagation_policy,proposition,qualifications,question_best,question_feed,queue,quick_text,quip,quip_sheet,quotes,radio_button,read_receipts,recent,recipe,record,record_create,record_delete,record_lookup,record_signature_task,record_update,recycle_bin,related_list,relationship,reply_text,report,report_type,resource_absence,resource_capacity,resource_preference,resource_skill,restriction_policy,return_order,return_order_line_item,reward,rtc_presence,sales_cadence,sales_cadence_target,sales_channel,sales_path,sales_value,salesforce_cms,scan_card,schedule_objective,scheduling_constraint,scheduling_policy,screen,search,section,segments,selling_model,serialized_product,serialized_product_transaction,service_appointment,service_appointment_capacity_usage,service_contract,service_crew,service_crew_member,service_report,service_request,service_request_detail,service_resource,service_territory,service_territory_location,service_territory_member,service_territory_policy,settings,shift,shift_pattern,shift_pattern_entry,shift_preference,shift_scheduling_operation,shift_template,shift_type,shipment,skill,skill_entity,skill_requirement,slack,slider,sms,snippet,snippets,sobject,sobject_collection,social,solution,sort,sort_policy,sossession,stage,stage_collection,steps,store,store_group,story,strategy,survey,swarm_request,swarm_session,system_and_global_variable,tableau,task,task2,team_member,template,text,text_template,textarea,textbox,thanks,thanks_loading,timesheet,timesheet_entry,timeslot,today,toggle,topic,topic2,tour,tour_check,trailhead,trailhead_alt,travel_mode,unified_health_score,unmatched,user,user_role,variable,variation_attribute_setup,variation_products,video,visit_templates,visits,visualforce_page,voice_call,waits,warranty_term,webcart,work_capacity_limit,work_capacity_usage,work_contract,work_forecast,work_order,work_order_item,work_plan,work_plan_rule,work_plan_template,work_plan_template_entry,work_queue,work_step,work_step_template,work_type,work_type_group,workforce_engagement";const sldsIcons={standard:_STANDARD_SPRITE_IDS.split(",")};var organizationsTree={getSearchableFields:function(e){var o=["text","textarea","autonumber","url","email"];var n=[],s=e.context.uiSchema;return s&&_$1__namespace.each(s.fields,function(e){var t,r,a;t=e,r=s.NAME_FIELD_KEY,(a=!1!==(a=t.searchable)&&t.name===r?!0:a)&&-1<o.indexOf(t.type)&&n.push(e.name);}),n},getApiRequestAdaptor:function(e,t,r){var a="__keywords";if((r=void 0===r?{}:r).isLookup){if("loadOptions"===t.op)return o=[["_id","=",t.value]],Object.assign({},e,{method:"post",url:"/graphql",data:{query:"{rows:organizations(filters: "+JSON.stringify(o)+', top: 5000, skip: 0, sort: "sort_no desc"){_id,fullname,name,sort_no,_display:_ui{sort_no},parent,children}}'}});(r=t.__lookupField)?a="__keywords_lookup__".concat(r.name.replace(/\./g,"_"),"__to__").concat(r.reference_to):(a="",console.error("lookup字段快速搜索异常,作用域中未找到变量__lookupField"));}var t=this.getSearchableFields(e),o=[],n=JSON.parse(JSON.stringify(e.context)),r=SteedosUI$1.getSearchFilter(n)||[],r=(0<r.length&&(o=0<o.length?[o,"and",r]:r),t&&t.forEach(function(e){var t=n[e];_$1__namespace.isString(t)?o.push([e,"contains",t]):(_$1__namespace.isArray(t)||_$1__namespace.isBoolean(t)||t)&&o.push([e,"=",t]);}),SteedosUI$1.getKeywordsSearchFilter(n[a],t)),a=(r&&0<r.length&&o.push(r),e.data={},0<o.length&&Object.assign(e.data,{filters:JSON.stringify(o)}),e.body&&e.body.queryFields);return a&&Object.assign(e.data,{fields:a}),e.body.$self&&(e.body.$self.context&&e.body.$self.context.rootUrl,e.url="/service/api/organizations/root"),e},getApiAdaptor:function(e,t,r,a,o){return (o=void 0===o?{}:o).isLookup&&"loadOptions"===a.op?(o=_$1__namespace.map(e.data.rows,function(e){return delete e.children,delete e.parent,e}),e.data.rows=o):(a=r.data&&r.data.filters,e.data=__assign(__assign({},e.data),{isFilter:!!a}),e.data.__rootQueryFields=r.data&&r.data.fields,(e.data.rows||[]).forEach(function(e){e.__rootQueryFields=r.data&&r.data.fields;})),e},getDeferApiRequestAdaptor:function(e,t,r){var a=[],o=JSON.parse(JSON.stringify(e.context))._id,o=(o&&(a=[["parent","=",o]]),t&&t.__rootQueryFields||"_id,fullname,name,sort_no,hidden,_display:_ui{sort_no,hidden},parent,children");return Object.assign({},e,{data:{query:"{rows:organizations(filters: "+JSON.stringify(a)+', top: 5000, skip: 0, sort: "sort_no desc"){'+o+"}}"}})},getDeferApiAdaptor:function(e,t,r,a,o){var n=e.data;return n.children||(n.rows=n.rows.map(function(e){return e.defer=!(!e.children||!e.children.length),delete e.children,e}),n.children=n.rows,delete n.rows,delete n.count),e}},getBuilderContext=function(){return "undefined"==typeof window?{}:Builder.settings.context||Builder.settings},Steedos$1=__assign({resources:{sldsIcons:sldsIcons},organizationsTree:organizationsTree,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=Object.assign(Steedos$1,window.Steedos):window.Steedos=Steedos$1),"undefined"!=typeof window&&(window.SteedosUI?window.SteedosUI=Object.assign(SteedosUI$1,window.SteedosUI):window.SteedosUI=SteedosUI$1);
|
|
28465
|
+
var __assign=function(){return (__assign=Object.assign||function(e){for(var t,r=1,o=arguments.length;r<o;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);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 o=this.object;if(r)return r.allowCreate&&o.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 a=null;e=Steedos.absoluteUrl(e);try{var r=[{name:"Content-Type",value:"application/json"},{name:"Authorization",value:Steedos.getAuthorization()}],o={type:"get",url:e,dataType:"json",contentType:"application/json",beforeSend:function(t){if(r&&r.length)return r.forEach(function(e){return t.setRequestHeader(e.name,e.value)})},success:function(e){a=e;},error:function(e,t,r){var o,n;e.responseJSON&&e.responseJSON.error?(o=e.responseJSON.error,n=void(a={error:o}),n=o.reason||o.message||o,console.error(n)):console.error(e.responseJSON);}};return $.ajax(Object.assign({},o,t)),a}catch(e){console.error(e);}};function _extends(){return (_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r,o=arguments[t];for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r]);}return e}).apply(this,arguments)}const newFunctionComponent=n=>e=>{const[t,r]=React.useState(!0);var o=()=>{r(!1);};return _$1.has(e,"ref")||(window.SteedosUI.refs[e.name]={show:()=>{r(!0);},close:o}),React__default["default"].createElement(n,_extends({visible:t,onCancel:o,onClose:o},{width:"70%",style:{width:"70%",maxWidth:"950px",minWidth:"480px"}},e))},newComponentRender=(r,o)=>(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(o),e);ReactDOM.createRoot(t).render(e);},Modal=_$1.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"),_$1.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 o="";t=[`id: "${t}"`];return `{record:${e}__findOne${o=0<t.length?`(${t.join(",")})`:o}{${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):_$1.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:o,foreignKey:n}){return `/app/${e}/${t}/${r}/${o}/grid?related_field_name=`+n}};var withModalWrap=function(t,e){return function(e){return React__namespace.createElement(t,e)}},render=function(e,t,r,o){e=withModalWrap(e),e=React__namespace.createElement(e,__assign({},t));return ReactDOM__default["default"].render(e,r)};const safeRunFunction=(t,r,o,n)=>{try{let e=[];return _$1.isNil(r)||(e=_$1.isArray(r)?r:[r]),t.bind(n||{})(...e)}catch(e){return console.log(e),o}};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)))},getMoment=()=>window.amisRequire?window.amisRequire("moment"):window.moment||void 0,getGlobalNowData=()=>{var e=new Date,t=getMoment();let r=t().utc(),o=(r.set("hours",0),r.set("minutes",0),r.set("seconds",0),r.set("milliseconds",0),r=r.toDate(),t());return o.set("year",1970),o.set("month",0),o.set("date",1),o.set("hours",o.hours()+o.utcOffset()/60),o.set("seconds",0),o.set("milliseconds",0),o=o.toDate(),{now:e,today:r,timeNow:o}},parseSingleExpression=function(t,e,r,o){var n,a;if(o&&Object.assign(o,getGlobalNowData()),a=function(e,t){return "#"!==t&&t?"string"==typeof t?_.get(e,t):void console.error("path has to be a string"):e||{}}(e=void 0===e?{}:e,function(e){return "string"!=typeof e||1===(e=e.split(".")).length?"#":(e.pop(),e.join("."))}(r))||{},"string"!=typeof t)return t;n="__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,n)).replace(/\bglobal\b/g,JSON.stringify(o)).replace(new RegExp("\\b"+n+"\\b","g"),"global").replace(/rootValue/g,JSON.stringify(a));try{return Function(e)()}catch(e){return console.log(e,t,r),t}};var Expression=Object.freeze({__proto__:null,isExpression:isExpression,getGlobalNowData:getGlobalNowData,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")||-1<express.indexOf("today")||-1<express.indexOf("timeNow")?`{${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})`)),_$1.isFunction(r)&&(r=safeRunFunction(r,[],null,{name:e.name})),_$1__namespace.isString(r)&&(r=getCompatibleDefaultValueExpression(r,e.multiple));var o=isExpression(r);switch(o&&("date"===e.type?r=r.replace(/\bglobal.now\b/g,"global.today"):"time"===e.type&&(r=r.replace(/\bglobal.now\b/g,"global.timeNow")),r=parseSingleExpression(r,{},"#",t)),e.type){case"select":var n=e.data_type||"text";!r||o||e.multiple||("text"!==n||_$1.isString(r)?"number"===n&&_$1.isString(r)?r=Number(r):"boolean"===n&&_$1.isString(r)&&(r="true"===r.toLowerCase()||"1"===r):r=String(r));break;case"number":_$1.isString(r)&&(r=Number(r));break;case"boolean":_$1.isString(r)?r="true"===r.toLowerCase()||"1"===r:_$1.isBoolean(r)||(r=!1);break;case"time":if(_$1.isDate(r))return moment(r).format("1970-01-01THH:mm:00.000[Z]");case"date":if(_$1.isDate(r))return moment(r).format("YYYY-MM-DDT00:00:00.000[Z]");case"datetime":if(_$1.isDate(r))return moment(r).format("YYYY-MM-DDTHH:mm:00.000Z")}return r};function getTreeOptions(t,e){const n=e?.valueField||"value",r=(e?.labelField,e?.unfoldedNum||1),o=[],a=(e,t,r,o)=>{return e.children&&"object"==typeof e.children[0]?e.children:r?(e=_.filter(t,e=>_.includes(r,e[n])),_.each(e,e=>{1<=o?(e.unfolded=!0,e.children&&(e.children=a(e,t,e.children,o-1))):e.children&&(e.children=a(e,t,e.children,o));}),e):void 0};for(var s=t,i=0;i<s.length;i++)if(s[i].noParent=0,s[i].unfolded=!1,s[i].parent){let e=1;for(var l=0;l<s.length;l++)s[i].parent==s[l][n]&&(e=0);1==e&&(s[i].noParent=1);}else s[i].noParent=1;return _.each(t,e=>{1==e.noParent&&(1<=r?(e.unfolded=!0,o.push(Object.assign({},e,{children:a(e,t,e.children,r-1)}))):o.push(Object.assign({},e,{children:a(e,t,e.children,r)})));}),o}function getClosestAmisComponentByType(t,r,o){let n=(o=o||{}).name;var e=o.direction||"up";let a=t.getComponents().find(function(e){return e.props.type===r&&(!n||e.props.name===n)});if(a)return a;if("down"===e){if(t.children&&t.children.length){for(let e=0;e<t.children.length&&!(a=getClosestAmisComponentByType(t.children[e],r,o));e++);return a}}else if("up"===e&&t.parent)return getClosestAmisComponentByType(t.parent,r,o)}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 n=[];return _.each(e,(e,t)=>{var r,o;_.isEmpty(e)&&!_.isBoolean(e)||(_.startsWith(t,"__searchable__between__")?n.push([""+t.replace("__searchable__between__",""),"between",e]):_.startsWith(t,"__searchable__")&&(_.isString(e)?n.push([""+t.replace("__searchable__",""),"contains",e]):_.isObject(e)&&e.o?(o=[[(r=""+t.replace("__searchable__",""))+"/o","=",e.o]],e.ids.length&&o.push([r+"/ids","=",e.ids]),n.push(o)):n.push([""+t.replace("__searchable__",""),"=",e])));}),n},getKeywordsSearchFilter:(e,t)=>{const n=[];var a;return e&&t&&(a=e.split(/\s+/),a=_$1.compact(a),t.forEach(function(r,e){let o=[];1==a.length?o=[r,"contains",a[0]]:a.forEach(function(e,t){o.push([r,"contains",e]),t<a.length-1&&o.push("and");}),o.length&&(n.push(o),e<t.length-1&&n.push("or"));})),n},getFormulaVariables:(e,t=!0)=>{const r=[];return _$1.isEmpty(e)||(r.push({label:"表单字段",children:[]}),lodash.forEach(e,function(e){r[0].children.push({label:e.label,value:e.value});})),t&&r.push({label:"全局变量",children:[{label:"用户ID",value:"global['userId']"},{label:"工作区ID",value:"global['spaceId']"},{label:"用户",children:[{label:"姓名",value:"global['user']['name']"},{label:"邮件",value:"global['user']['email']"},{label:"语言",value:"global['user']['language']"},{label:"简档",value:"global['user']['profile']"},{label:"权限集",value:"global['user']['roles']"},{label:"主部门ID",value:"global['user']['organization']['_id']"},{label:"部门(含上级)",value:"global['user']['organizations_parents']"},{label:"主分部ID",value:"global['user']['company_id']"},{label:"分部(多选)",value:"global['user']['company_ids']"},{label:"人员ID",value:"global['user']['spaceUserId']"},{label:"是否是工作区管理员",value:"global['user']['is_space_admin']"}]}]}),r},traverseNestedArrayFormula:(t,r)=>{var o=window.amisRequire&&window.amisRequire("amis")||Amis;for(let e=0;e<t.length;e++)if(Array.isArray(t[e]))SteedosUI$1.traverseNestedArrayFormula(t[e],r);else if(/\$\{([^}]*)\}/.test(t[e]))try{t[e]=o.evaluate(t[e],r);}catch(e){console.error("运行过滤器公式时出现错误:",e);}}});var _STANDARD_SPRITE_IDS="account,account_info,action_list_component,actions_and_buttons,activation_target,activations,address,agent_home,agent_session,aggregation_policy,all,announcement,answer_best,answer_private,answer_public,apex,apex_plugin,app,approval,apps,apps_admin,article,asset_action,asset_action_source,asset_audit,asset_downtime_period,asset_object,asset_relationship,asset_state_period,asset_warranty,assigned_resource,assignment,attach,avatar,avatar_loading,bot,bot_training,branch_merge,brand,budget,budget_allocation,bundle_config,bundle_policy,business_hours,buyer_account,buyer_group,calculated_insights,calibration,call,call_coaching,call_history,campaign,campaign_members,cancel_checkout,canvas,capacity_plan,care_request_reviewer,carousel,case,case_change_status,case_comment,case_email,case_log_a_call,case_milestone,case_transcript,case_wrap_up,catalog,category,change_request,channel_program_history,channel_program_levels,channel_program_members,channel_programs,chart,checkout,choice,client,cms,coaching,code_playground,code_set,code_set_bundle,collection,collection_variable,connected_apps,constant,contact,contact_list,contact_request,contract,contract_line_item,contract_payment,coupon_codes,currency,currency_input,custom,custom_component_task,custom_notification,customer_360,customer_lifecycle_analytics,customer_portal_users,customers,dashboard,dashboard_component,dashboard_ea,data_integration_hub,data_mapping,data_model,data_streams,datadotcom,dataset,date_input,date_time,decision,default,delegated_account,device,discounts,display_rich_text,display_text,document,document_reference,drafts,duration_downscale,dynamic_record_choice,education,einstein_replies,email,email_chatter,employee,employee_asset,employee_contact,employee_job,employee_job_position,employee_organization,empty,endorsement,entitlement,entitlement_policy,entitlement_process,entitlement_template,entity,entity_milestone,environment_hub,event,events,expense,expense_report,expense_report_entry,feed,feedback,field_sales,file,filter,filter_criteria,filter_criteria_rule,first_non_empty,flow,folder,forecasts,form,formula,fulfillment_order,generic_loading,global_constant,goals,group_loading,groups,guidance_center,hierarchy,high_velocity_sales,historical_adherence,holiday_operating_hours,home,household,identifier,immunization,incident,individual,insights,instore_locations,investment_account,invocable_action,iot_context,iot_orchestrations,javascript_button,job_family,job_position,job_profile,kanban,key_dates,knowledge,lead,lead_insights,lead_list,letterhead,lightning_component,lightning_usage,link,list_email,live_chat,live_chat_visitor,location,location_permit,log_a_call,logging,loop,macros,maintenance_asset,maintenance_plan,maintenance_work_rule,marketing_actions,med_rec_recommendation,med_rec_statement_recommendation,medication,medication_dispense,medication_ingredient,medication_reconciliation,medication_statement,merge,messaging_conversation,messaging_session,messaging_user,metrics,multi_picklist,multi_select_checkbox,network_contract,news,note,number_input,observation_component,omni_supervisor,operating_hours,opportunity,opportunity_contact_role,opportunity_splits,orchestrator,order_item,orders,outcome,output,partner_fund_allocation,partner_fund_claim,partner_fund_request,partner_marketing_budget,partners,password,past_chat,patient_medication_dosage,payment_gateway,people,performance,person_account,person_language,person_name,photo,picklist_choice,picklist_type,planogram,poll,portal,portal_roles,portal_roles_and_subordinates,post,practitioner_role,price_book_entries,price_books,pricebook,pricing_workspace,problem,procedure,procedure_detail,process,process_exception,product,product_consumed,product_consumed_state,product_item,product_item_transaction,product_quantity_rules,product_request,product_request_line_item,product_required,product_service_campaign,product_service_campaign_item,product_transfer,product_transfer_state,product_warranty_term,product_workspace,products,promotion_segments,promotions,promotions_workspace,propagation_policy,proposition,qualifications,question_best,question_feed,queue,quick_text,quip,quip_sheet,quotes,radio_button,read_receipts,recent,recipe,record,record_create,record_delete,record_lookup,record_signature_task,record_update,recycle_bin,related_list,relationship,reply_text,report,report_type,resource_absence,resource_capacity,resource_preference,resource_skill,restriction_policy,return_order,return_order_line_item,reward,rtc_presence,sales_cadence,sales_cadence_target,sales_channel,sales_path,sales_value,salesforce_cms,scan_card,schedule_objective,scheduling_constraint,scheduling_policy,screen,search,section,segments,selling_model,serialized_product,serialized_product_transaction,service_appointment,service_appointment_capacity_usage,service_contract,service_crew,service_crew_member,service_report,service_request,service_request_detail,service_resource,service_territory,service_territory_location,service_territory_member,service_territory_policy,settings,shift,shift_pattern,shift_pattern_entry,shift_preference,shift_scheduling_operation,shift_template,shift_type,shipment,skill,skill_entity,skill_requirement,slack,slider,sms,snippet,snippets,sobject,sobject_collection,social,solution,sort,sort_policy,sossession,stage,stage_collection,steps,store,store_group,story,strategy,survey,swarm_request,swarm_session,system_and_global_variable,tableau,task,task2,team_member,template,text,text_template,textarea,textbox,thanks,thanks_loading,timesheet,timesheet_entry,timeslot,today,toggle,topic,topic2,tour,tour_check,trailhead,trailhead_alt,travel_mode,unified_health_score,unmatched,user,user_role,variable,variation_attribute_setup,variation_products,video,visit_templates,visits,visualforce_page,voice_call,waits,warranty_term,webcart,work_capacity_limit,work_capacity_usage,work_contract,work_forecast,work_order,work_order_item,work_plan,work_plan_rule,work_plan_template,work_plan_template_entry,work_queue,work_step,work_step_template,work_type,work_type_group,workforce_engagement";const sldsIcons={standard:_STANDARD_SPRITE_IDS.split(",")};var organizationsTree={getSearchableFields:function(e){var n=["text","textarea","autonumber","url","email"];var a=[],s=e.context.uiSchema;return s&&_$1__namespace.each(s.fields,function(e){var t,r,o;t=e,r=s.NAME_FIELD_KEY,(o=!1!==(o=t.searchable)&&t.name===r?!0:o)&&-1<n.indexOf(t.type)&&a.push(e.name);}),a},getApiRequestAdaptor:function(e,t,r){var o="__keywords",n=t.__lookupField;if((r=void 0===r?{}:r).isLookup){if("loadOptions"===t.op)return s=[["_id","=",t.value]],Object.assign({},e,{method:"post",url:"/graphql",data:{query:"{rows:organizations(filters: "+JSON.stringify(s)+', top: 5000, skip: 0, sort: "sort_no desc"){_id,fullname,name,sort_no,_display:_ui{sort_no},parent,children}}'}});n?o="__keywords_lookup__".concat(n.name.replace(/\./g,"_"),"__to__").concat(n.reference_to):(o="",console.error("lookup字段快速搜索异常,作用域中未找到变量__lookupField"));}var a,t=this.getSearchableFields(e),s=[],i=(r.isLookup&&(a=n.inFilterForm,(l=n.listviewFilter)&&l.length&&!a&&(s=l)),JSON.parse(JSON.stringify(e.context))),l=SteedosUI$1.getSearchFilter(i)||[],l=(0<l.length&&(s=0<s.length?[s,"and",l]:l),t&&t.forEach(function(e){var t=i[e];_$1__namespace.isString(t)?s.push([e,"contains",t]):(_$1__namespace.isArray(t)||_$1__namespace.isBoolean(t)||t)&&s.push([e,"=",t]);}),SteedosUI$1.getKeywordsSearchFilter(i[o],t)),n=(l&&0<l.length&&s.push(l),r.isLookup&&((o=n.filters)&&o.length&&(SteedosUI$1.traverseNestedArrayFormula(o,e.context),s.push(o)),a=n.inFilterForm,"string"==typeof(t=n.listviewFiltersFunction)&&(t=new Function("return ".concat(t))()),"string"==typeof(l=n.filtersFunction||n._filtersFunction)&&(l=new Function("return ".concat(l))()),t&&!a&&(r=t(s,e.context))&&r.length&&s.push(r),l&&!a&&(o=l(s,e.context))&&0<o.length&&s.push(o)),e.data={},0<s.length&&Object.assign(e.data,{filters:JSON.stringify(s)}),e.body&&e.body.queryFields);return n&&Object.assign(e.data,{fields:n}),e.body.$self&&(e.body.$self.context&&e.body.$self.context.rootUrl,e.url="/service/api/organizations/root"),e},getApiAdaptor:function(e,t,r,o,n){return (n=void 0===n?{}:n).isLookup&&"loadOptions"===o.op?(n=_$1__namespace.map(e.data.rows,function(e){return delete e.children,delete e.parent,e}),e.data.rows=n):(o=r.data&&r.data.filters,e.data=__assign(__assign({},e.data),{isFilter:!!o}),e.data.__rootQueryFields=r.data&&r.data.fields,(e.data.rows||[]).forEach(function(e){e.__rootQueryFields=r.data&&r.data.fields;})),e},getDeferApiRequestAdaptor:function(e,t,r){var o=[],n=JSON.parse(JSON.stringify(e.context))._id,n=(n&&(o=[["parent","=",n]]),t&&t.__rootQueryFields||"_id,fullname,name,sort_no,hidden,_display:_ui{sort_no,hidden},parent,children");return Object.assign({},e,{data:{query:"{rows:organizations(filters: "+JSON.stringify(o)+', top: 5000, skip: 0, sort: "sort_no desc"){'+n+"}}"}})},getDeferApiAdaptor:function(e,t,r,o,n){var a=e.data;return a.children||(a.rows=a.rows.map(function(e){return e.defer=!(!e.children||!e.children.length),delete e.children,e}),a.children=a.rows,delete a.rows,delete a.count),e}},getBuilderContext=function(){return "undefined"==typeof window?{}:Builder.settings.context||Builder.settings},Steedos$1=__assign({resources:{sldsIcons:sldsIcons},organizationsTree:organizationsTree,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=Object.assign(Steedos$1,window.Steedos):window.Steedos=Steedos$1),"undefined"!=typeof window&&(window.SteedosUI?window.SteedosUI=Object.assign(SteedosUI$1,window.SteedosUI):window.SteedosUI=SteedosUI$1);
|
|
28449
28466
|
|
|
28450
28467
|
var index_esm = /*#__PURE__*/Object.freeze({
|
|
28451
28468
|
__proto__: null,
|