@steedos-widgets/amis-object 1.3.4-beta.16 → 1.3.4-beta.18
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 +5 -2
- package/dist/amis-object.cjs.js +130 -41
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +5 -2
- package/dist/amis-object.esm.js +131 -42
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +5 -2
- package/dist/amis-object.umd.js +92 -82
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +21 -21
- package/dist/meta.js +29 -3
- package/package.json +3 -3
package/dist/amis-object.cjs.css
CHANGED
|
@@ -733,6 +733,9 @@ fieldset.antd-Collapse > legend{
|
|
|
733
733
|
text-overflow: ellipsis;
|
|
734
734
|
white-space: nowrap
|
|
735
735
|
}
|
|
736
|
+
.whitespace-normal {
|
|
737
|
+
white-space: normal
|
|
738
|
+
}
|
|
736
739
|
.whitespace-nowrap {
|
|
737
740
|
white-space: nowrap
|
|
738
741
|
}
|
|
@@ -917,8 +920,8 @@ fieldset.antd-Collapse > legend{
|
|
|
917
920
|
.text-xl {
|
|
918
921
|
font-size: 18px
|
|
919
922
|
}
|
|
920
|
-
.text-\[
|
|
921
|
-
font-size:
|
|
923
|
+
.text-\[14px\] {
|
|
924
|
+
font-size: 14px
|
|
922
925
|
}
|
|
923
926
|
.text-\[12px\] {
|
|
924
927
|
font-size: 12px
|
package/dist/amis-object.cjs.js
CHANGED
|
@@ -4933,6 +4933,13 @@ async function getSelectUserSchema(field, readonly, ctx) {
|
|
|
4933
4933
|
return amisSchema;
|
|
4934
4934
|
}
|
|
4935
4935
|
|
|
4936
|
+
/*
|
|
4937
|
+
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
4938
|
+
* @Date: 2023-03-22 09:31:21
|
|
4939
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
4940
|
+
* @LastEditTime: 2023-10-25 17:40:14
|
|
4941
|
+
*/
|
|
4942
|
+
|
|
4936
4943
|
const globalTag = '__G_L_O_B_A_L__';
|
|
4937
4944
|
|
|
4938
4945
|
const getParentPath = function (path) {
|
|
@@ -4972,7 +4979,29 @@ const isExpression$1 = function (func) {
|
|
|
4972
4979
|
return false;
|
|
4973
4980
|
};
|
|
4974
4981
|
|
|
4982
|
+
const getMoment$1 = () => {
|
|
4983
|
+
if (window.amisRequire) {
|
|
4984
|
+
return window.amisRequire("moment");
|
|
4985
|
+
} else if (window.moment) {
|
|
4986
|
+
return window.moment;
|
|
4987
|
+
}
|
|
4988
|
+
};
|
|
4989
|
+
|
|
4975
4990
|
const parseSingleExpression$1 = function (func, formData, dataPath, global, userSession = {}) {
|
|
4991
|
+
if (global) {
|
|
4992
|
+
let now = new Date();
|
|
4993
|
+
let moment = getMoment$1();
|
|
4994
|
+
let today = moment().utc();
|
|
4995
|
+
today.set("hours", 0);
|
|
4996
|
+
today.set("minutes", 0);
|
|
4997
|
+
today.set("seconds", 0);
|
|
4998
|
+
today = today.toDate();
|
|
4999
|
+
Object.assign(global, {
|
|
5000
|
+
now,
|
|
5001
|
+
today
|
|
5002
|
+
});
|
|
5003
|
+
}
|
|
5004
|
+
|
|
4976
5005
|
var error, funcBody, parent, parentPath, str;
|
|
4977
5006
|
|
|
4978
5007
|
if (formData === void 0) {
|
|
@@ -7532,7 +7561,8 @@ const getCopyListviewButtonSchema = ()=>{
|
|
|
7532
7561
|
"&": "${list_view}",
|
|
7533
7562
|
"name":"",
|
|
7534
7563
|
"label": instance.t('frontend_listview_control_clone_defaultData_label_start') + " ${list_view.label} " + instance.t('frontend_listview_control_clone_defaultData_label_end'),
|
|
7535
|
-
"shared":false
|
|
7564
|
+
"shared":false,
|
|
7565
|
+
"object_name": "${targetObjectName}",
|
|
7536
7566
|
},
|
|
7537
7567
|
"fieldsExtend": fieldsExtend$3(),
|
|
7538
7568
|
"fields": fields(),
|
|
@@ -9240,7 +9270,9 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
9240
9270
|
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { headerToolbarItems, isLookup: true, keywordsSearchBoxName });
|
|
9241
9271
|
const isAllowCreate = refObjectConfig.permissions.allowCreate;
|
|
9242
9272
|
const isCreate = _$1__namespace.isBoolean(field.create) ? field.create : true;
|
|
9243
|
-
|
|
9273
|
+
// lookup字段配置过滤条件就强制不显示新建按钮
|
|
9274
|
+
let isHasFilters = (field.filters || field._filtersFunction) ? true : false;
|
|
9275
|
+
if (isAllowCreate && isCreate && !isHasFilters) {
|
|
9244
9276
|
const new_button = await getSchema$5(refObjectConfig, { appId: ctx.appId, objectName: refObjectConfig.name, formFactor: ctx.formFactor });
|
|
9245
9277
|
new_button.align = "right";
|
|
9246
9278
|
// 保持快速搜索放在最左侧,新建按钮往里插,而不是push到最后
|
|
@@ -9617,7 +9649,7 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
9617
9649
|
// 此处不参考 steedos 的 enable_enhanced_lookup 规则. 如果默认是开启弹出选择,用户选择过程操作太繁琐, 所以默认是关闭弹出选择.
|
|
9618
9650
|
// 由于amis picker 目前不支持联动, 配置了depend_on时, 使用使用select ,以支持联动
|
|
9619
9651
|
// TODO: 确认 amis picker 支持联动时, 清理field.depend_on判断
|
|
9620
|
-
if(refObject.enable_enhanced_lookup == true
|
|
9652
|
+
if(refObject.enable_enhanced_lookup == true){
|
|
9621
9653
|
return await lookupToAmisPicker(field, readonly, ctx);
|
|
9622
9654
|
}else if(refObject.enable_tree) {
|
|
9623
9655
|
return await lookupToAmisTreeSelect(field, readonly, Object.assign({}, ctx, {
|
|
@@ -9934,8 +9966,8 @@ function getAmisStaticFieldType(type, readonly, options){
|
|
|
9934
9966
|
/*
|
|
9935
9967
|
* @Author: baozhoutao@steedos.com
|
|
9936
9968
|
* @Date: 2022-10-28 14:15:09
|
|
9937
|
-
* @LastEditors:
|
|
9938
|
-
* @LastEditTime:
|
|
9969
|
+
* @LastEditors: liaodaxue
|
|
9970
|
+
* @LastEditTime: 2023-10-30 17:51:54
|
|
9939
9971
|
* @Description:
|
|
9940
9972
|
*/
|
|
9941
9973
|
|
|
@@ -9986,11 +10018,26 @@ const getAmisFileEditSchema = (steedosField)=>{
|
|
|
9986
10018
|
useChunk: false, // 关闭分块上传
|
|
9987
10019
|
receiver: {
|
|
9988
10020
|
method: "post",
|
|
10021
|
+
dataType: "form-data",
|
|
9989
10022
|
url: `\${context.rootUrl}/s3/${tableName}`,
|
|
9990
|
-
|
|
9991
|
-
|
|
9992
|
-
|
|
9993
|
-
|
|
10023
|
+
requestAdaptor: `
|
|
10024
|
+
const { _master, global,context } = api.body;
|
|
10025
|
+
// const { recordId, objectName } = _master;
|
|
10026
|
+
const { spaceId, userId, user } = global;
|
|
10027
|
+
/*
|
|
10028
|
+
record_id: recordId,
|
|
10029
|
+
parent: recordId,
|
|
10030
|
+
object_name: objectName,
|
|
10031
|
+
owner_name: user.name,
|
|
10032
|
+
space: spaceId,
|
|
10033
|
+
owner: userId
|
|
10034
|
+
*/
|
|
10035
|
+
// 参考platform 2.2版本,附件字段保存时cfs.files.filerecord、cfs.images.filerecord表中的metadata下只保存space、owner两个属性值。
|
|
10036
|
+
api.data.append('space', spaceId);
|
|
10037
|
+
api.data.append('owner', userId);
|
|
10038
|
+
|
|
10039
|
+
return api;
|
|
10040
|
+
`,
|
|
9994
10041
|
adaptor: `
|
|
9995
10042
|
const { context } = api.body;
|
|
9996
10043
|
var rootUrl = context.rootUrl + "/api/files/${tableName}/";
|
|
@@ -11154,7 +11201,7 @@ async function getTableColumns$1(fields, options){
|
|
|
11154
11201
|
{
|
|
11155
11202
|
"args": {
|
|
11156
11203
|
"api": {
|
|
11157
|
-
"url": "${context.rootUrl
|
|
11204
|
+
"url": "${(versions[0] && versions[0].url) ? versions[0].url+'?download=true' : context.rootUrl+'/api/files/files/'+versions[0]+'?download=true'}",
|
|
11158
11205
|
"method": "get",
|
|
11159
11206
|
"headers": {
|
|
11160
11207
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
@@ -11634,6 +11681,7 @@ async function getTableSchema$1(fields, options){
|
|
|
11634
11681
|
}
|
|
11635
11682
|
return {
|
|
11636
11683
|
mode: "cards",
|
|
11684
|
+
perPageAvailable: [5, 10, 20, 50, 100, 500],
|
|
11637
11685
|
name: "thelist",
|
|
11638
11686
|
headerToolbarClassName: "py-2 px-2 border-gray-300 border-solid border-b",
|
|
11639
11687
|
className: "",
|
|
@@ -11656,6 +11704,7 @@ async function getTableSchema$1(fields, options){
|
|
|
11656
11704
|
|
|
11657
11705
|
return {
|
|
11658
11706
|
mode: "table",
|
|
11707
|
+
perPageAvailable: [5, 10, 20, 50, 100, 500],
|
|
11659
11708
|
name: "thelist",
|
|
11660
11709
|
headerToolbarClassName: "py-2 px-2 border-gray-300 border-solid border-b",
|
|
11661
11710
|
className: "",
|
|
@@ -12290,7 +12339,7 @@ async function getEditFormInitApi(object, recordId, fields, options){
|
|
|
12290
12339
|
${getScriptForRewriteValueForFileFields(fields)}
|
|
12291
12340
|
|
|
12292
12341
|
_.each(dataKeys, function(key){
|
|
12293
|
-
if(fieldKeys.indexOf(key)<0){
|
|
12342
|
+
if(fieldKeys.indexOf(key)<0 && key !== "_display"){
|
|
12294
12343
|
delete data[key];
|
|
12295
12344
|
}
|
|
12296
12345
|
})
|
|
@@ -13630,8 +13679,29 @@ const getFormFields = (objectSchema, formProps)=>{
|
|
|
13630
13679
|
return lodash.sortBy(_$1__default["default"].values(fields), "sort_no");
|
|
13631
13680
|
};
|
|
13632
13681
|
|
|
13682
|
+
async function getFormSchemaWithDataFilter(form, options = {}){
|
|
13683
|
+
const { formDataFilter, amisData, env } = options;
|
|
13684
|
+
let onFormDataFilter = options.onFormDataFilter;
|
|
13685
|
+
if (!onFormDataFilter && typeof formDataFilter === 'string') {
|
|
13686
|
+
onFormDataFilter = new Function(
|
|
13687
|
+
'form',
|
|
13688
|
+
'env',
|
|
13689
|
+
'data',
|
|
13690
|
+
formDataFilter
|
|
13691
|
+
);
|
|
13692
|
+
}
|
|
13693
|
+
|
|
13694
|
+
try {
|
|
13695
|
+
onFormDataFilter && (form = await onFormDataFilter(form, env, amisData) || form);
|
|
13696
|
+
} catch (e) {
|
|
13697
|
+
console.warn(e);
|
|
13698
|
+
}
|
|
13699
|
+
return form;
|
|
13700
|
+
}
|
|
13701
|
+
|
|
13633
13702
|
async function getObjectForm(objectSchema, ctx){
|
|
13634
|
-
const { recordId, formFactor, layout = formFactor === 'SMALL' ? 'normal' : "normal", labelAlign, tabId, appId, defaults, submitSuccActions = []
|
|
13703
|
+
const { recordId, formFactor, layout = formFactor === 'SMALL' ? 'normal' : "normal", labelAlign, tabId, appId, defaults, submitSuccActions = [],
|
|
13704
|
+
formDataFilter, onFormDataFilter, amisData, env } = ctx;
|
|
13635
13705
|
const fields = _$1__default["default"].values(objectSchema.fields);
|
|
13636
13706
|
const formFields = getFormFields(objectSchema, ctx);
|
|
13637
13707
|
const formSchema = defaults && defaults.formSchema || {};
|
|
@@ -13648,7 +13718,8 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
13648
13718
|
name: `page_edit_${recordId}`,
|
|
13649
13719
|
api: await getEditFormInitApi(objectSchema, recordId, fields, ctx),
|
|
13650
13720
|
data:{
|
|
13651
|
-
editFormInited: false
|
|
13721
|
+
editFormInited: false,
|
|
13722
|
+
...amisData
|
|
13652
13723
|
},
|
|
13653
13724
|
// data: {global: getGlobalData('edit'), recordId: recordId, objectName: objectSchema.name, context: {rootUrl: getRootUrl(), tenantId: getTenantId(), authToken: getAuthToken()}},
|
|
13654
13725
|
initApi: null,
|
|
@@ -13715,15 +13786,17 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
13715
13786
|
}
|
|
13716
13787
|
})]
|
|
13717
13788
|
};
|
|
13789
|
+
amisSchema.body[0] = await getFormSchemaWithDataFilter(amisSchema.body[0], { formDataFilter, onFormDataFilter, amisData, env });
|
|
13718
13790
|
return amisSchema;
|
|
13719
13791
|
}
|
|
13720
13792
|
|
|
13721
13793
|
async function getObjectDetail(objectSchema, recordId, ctx){
|
|
13722
|
-
const { formFactor, layout = formFactor === 'SMALL' ? 'normal' : "normal", labelAlign
|
|
13794
|
+
const { formFactor, layout = formFactor === 'SMALL' ? 'normal' : "normal", labelAlign,
|
|
13795
|
+
formDataFilter, onFormDataFilter, amisData, env } = ctx;
|
|
13723
13796
|
const fields = _$1__default["default"].values(objectSchema.fields);
|
|
13724
13797
|
const formFields = getFormFields(objectSchema, ctx);
|
|
13725
13798
|
const serviceId = `service_detail_page`;
|
|
13726
|
-
|
|
13799
|
+
const amisSchema = {
|
|
13727
13800
|
type: 'service',
|
|
13728
13801
|
name: `page_readonly_${recordId}`,
|
|
13729
13802
|
id: serviceId,
|
|
@@ -13805,7 +13878,10 @@ async function getObjectDetail(objectSchema, recordId, ctx){
|
|
|
13805
13878
|
]
|
|
13806
13879
|
}
|
|
13807
13880
|
}
|
|
13808
|
-
}
|
|
13881
|
+
};
|
|
13882
|
+
|
|
13883
|
+
amisSchema.body[0].body = await getFormSchemaWithDataFilter(amisSchema.body[0].body, { formDataFilter, onFormDataFilter, amisData, env });
|
|
13884
|
+
return amisSchema;
|
|
13809
13885
|
}
|
|
13810
13886
|
|
|
13811
13887
|
/*
|
|
@@ -13885,7 +13961,7 @@ const getRecordPermissions = async (objectName, recordId)=>{
|
|
|
13885
13961
|
* @Author: baozhoutao@steedos.com
|
|
13886
13962
|
* @Date: 2022-07-05 15:55:39
|
|
13887
13963
|
* @LastEditors: liaodaxue
|
|
13888
|
-
* @LastEditTime: 2023-
|
|
13964
|
+
* @LastEditTime: 2023-10-23 15:55:46
|
|
13889
13965
|
* @Description:
|
|
13890
13966
|
*/
|
|
13891
13967
|
|
|
@@ -14176,11 +14252,15 @@ async function getRelatedListSchema(
|
|
|
14176
14252
|
ctx
|
|
14177
14253
|
) {
|
|
14178
14254
|
const uiSchema = await getUISchema(objectName);
|
|
14255
|
+
if(!uiSchema){
|
|
14256
|
+
return {}
|
|
14257
|
+
}
|
|
14258
|
+
const listViewNames = _$1.map(uiSchema.list_views, 'name');
|
|
14179
14259
|
const listView = _$1.find(
|
|
14180
14260
|
uiSchema.list_views,
|
|
14181
14261
|
(listView, name) => {
|
|
14182
|
-
// 传入listViewName
|
|
14183
|
-
if(!listViewName){
|
|
14262
|
+
// 传入listViewName空值 或者 不存在 则取第一个
|
|
14263
|
+
if(!listViewName || listViewNames.indexOf(listViewName)<0){
|
|
14184
14264
|
listViewName = name;
|
|
14185
14265
|
}
|
|
14186
14266
|
return name === listViewName || listView._id === listViewName;
|
|
@@ -17240,7 +17320,7 @@ const getOpinionFieldStepsName = (field, top_keywords) => {
|
|
|
17240
17320
|
* @Description:
|
|
17241
17321
|
*/
|
|
17242
17322
|
|
|
17243
|
-
const getMoment = ()=>{
|
|
17323
|
+
const getMoment$2 = ()=>{
|
|
17244
17324
|
if(window.amisRequire){
|
|
17245
17325
|
return window.amisRequire("moment");
|
|
17246
17326
|
}else if(window.moment){
|
|
@@ -17467,7 +17547,7 @@ const getInstanceInfo = async ({ instanceId, box }) => {
|
|
|
17467
17547
|
method: "get",
|
|
17468
17548
|
});
|
|
17469
17549
|
|
|
17470
|
-
const moment = getMoment();
|
|
17550
|
+
const moment = getMoment$2();
|
|
17471
17551
|
|
|
17472
17552
|
return {
|
|
17473
17553
|
box: box,
|
|
@@ -18086,13 +18166,13 @@ var SteedosSkeleton = function (props) {
|
|
|
18086
18166
|
};
|
|
18087
18167
|
|
|
18088
18168
|
var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
18089
|
-
var $schema, recordId, defaultData, mode, layout, labelAlign, appId, fieldsExtend, _a, excludedFields, _b, fields, _c, form, _d, className, initApiRequestAdaptor, initApiAdaptor, apiRequestAdaptor, apiAdaptor, enableTabs, tabsMode, submitSuccActions, objectApiName, schemaKeys, formSchema, defaults, options, globalData, amisSchema, uiSchema, schema, schema, formData;
|
|
18169
|
+
var $schema, recordId, defaultData, mode, layout, labelAlign, appId, fieldsExtend, _a, excludedFields, _b, fields, _c, form, _d, className, initApiRequestAdaptor, initApiAdaptor, apiRequestAdaptor, apiAdaptor, enableTabs, tabsMode, submitSuccActions, data, formDataFilter, onFormDataFilter, env, objectApiName, schemaKeys, formSchema, defaults, options, globalData, amisSchema, uiSchema, allData, schema, schema, formData;
|
|
18090
18170
|
return __generator(this, function (_e) {
|
|
18091
18171
|
switch (_e.label) {
|
|
18092
18172
|
case 0:
|
|
18093
|
-
$schema = props.$schema, recordId = props.recordId, defaultData = props.defaultData, mode = props.mode, layout = props.layout, labelAlign = props.labelAlign, appId = props.appId, fieldsExtend = props.fieldsExtend, _a = props.excludedFields, excludedFields = _a === void 0 ? null : _a, _b = props.fields, fields = _b === void 0 ? null : _b, _c = props.form, form = _c === void 0 ? {} : _c, _d = props.className, className = _d === void 0 ? "" : _d, initApiRequestAdaptor = props.initApiRequestAdaptor, initApiAdaptor = props.initApiAdaptor, apiRequestAdaptor = props.apiRequestAdaptor, apiAdaptor = props.apiAdaptor, enableTabs = props.enableTabs, tabsMode = props.tabsMode, submitSuccActions = props.submitSuccActions;
|
|
18173
|
+
$schema = props.$schema, recordId = props.recordId, defaultData = props.defaultData, mode = props.mode, layout = props.layout, labelAlign = props.labelAlign, appId = props.appId, fieldsExtend = props.fieldsExtend, _a = props.excludedFields, excludedFields = _a === void 0 ? null : _a, _b = props.fields, fields = _b === void 0 ? null : _b, _c = props.form, form = _c === void 0 ? {} : _c, _d = props.className, className = _d === void 0 ? "" : _d, 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;
|
|
18094
18174
|
objectApiName = props.objectApiName || "space_users";
|
|
18095
|
-
schemaKeys = _$1.difference(_$1.keys($schema), ["id", "form", "type", "mode", "layout", "defaultData"]);
|
|
18175
|
+
schemaKeys = _$1.difference(_$1.keys($schema), ["id", "form", "type", "mode", "layout", "defaultData", "formDataFilter", "onFormDataFilter", "env"]);
|
|
18096
18176
|
formSchema = _$1.pick(props, schemaKeys);
|
|
18097
18177
|
defaults = {
|
|
18098
18178
|
formSchema: Object.assign({}, formSchema, form)
|
|
@@ -18115,7 +18195,14 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
18115
18195
|
}
|
|
18116
18196
|
globalData = props.data.global || {};
|
|
18117
18197
|
globalData.mode = mode === 'edit' ? 'edit' : 'read';
|
|
18198
|
+
allData = createObject(data, {});
|
|
18118
18199
|
if (!(mode === 'edit')) return [3 /*break*/, 2];
|
|
18200
|
+
if (defaultData) {
|
|
18201
|
+
// 让ObjectForm支持props中的dafaultData属性与上层组件配置的defaultData混合
|
|
18202
|
+
// 为了解决相关表新建时如果是表单类型微页面,因为找不到ObjectForm在哪层而造成无法设置ObjectForm的defaultData的问题
|
|
18203
|
+
allData.defaultData = __assign$2({ "&": "${defaultData}" }, defaultData //这里的defaultData是form组件的defaultData属性值
|
|
18204
|
+
);
|
|
18205
|
+
}
|
|
18119
18206
|
return [4 /*yield*/, getFormSchema(objectApiName, Object.assign({}, options, {
|
|
18120
18207
|
initApiRequestAdaptor: initApiRequestAdaptor,
|
|
18121
18208
|
initApiAdaptor: initApiAdaptor,
|
|
@@ -18123,17 +18210,15 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
18123
18210
|
apiAdaptor: apiAdaptor,
|
|
18124
18211
|
enableTabs: enableTabs,
|
|
18125
18212
|
tabsMode: tabsMode,
|
|
18126
|
-
submitSuccActions: submitSuccActions
|
|
18213
|
+
submitSuccActions: submitSuccActions,
|
|
18214
|
+
formDataFilter: formDataFilter,
|
|
18215
|
+
onFormDataFilter: onFormDataFilter,
|
|
18216
|
+
amisData: allData,
|
|
18217
|
+
env: env
|
|
18127
18218
|
}))];
|
|
18128
18219
|
case 1:
|
|
18129
18220
|
schema = _e.sent();
|
|
18130
18221
|
amisSchema = schema.amisSchema;
|
|
18131
|
-
if (defaultData) {
|
|
18132
|
-
// 让ObjectForm支持props中的dafaultData属性与上层组件配置的defaultData混合
|
|
18133
|
-
// 为了解决相关表新建时如果是表单类型微页面,因为找不到ObjectForm在哪层而造成无法设置ObjectForm的defaultData的问题
|
|
18134
|
-
amisSchema.data.defaultData = __assign$2({ "&": "${defaultData}" }, defaultData //这里的defaultData是form组件的defaultData属性值
|
|
18135
|
-
);
|
|
18136
|
-
}
|
|
18137
18222
|
uiSchema = schema.uiSchema;
|
|
18138
18223
|
return [3 /*break*/, 4];
|
|
18139
18224
|
case 2:
|
|
@@ -18144,7 +18229,11 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
18144
18229
|
initApiRequestAdaptor: initApiRequestAdaptor,
|
|
18145
18230
|
initApiAdaptor: initApiAdaptor,
|
|
18146
18231
|
enableTabs: enableTabs,
|
|
18147
|
-
tabsMode: tabsMode
|
|
18232
|
+
tabsMode: tabsMode,
|
|
18233
|
+
formDataFilter: formDataFilter,
|
|
18234
|
+
onFormDataFilter: onFormDataFilter,
|
|
18235
|
+
amisData: allData,
|
|
18236
|
+
env: env
|
|
18148
18237
|
}))];
|
|
18149
18238
|
case 3:
|
|
18150
18239
|
schema = _e.sent();
|
|
@@ -18323,7 +18412,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
18323
18412
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
18324
18413
|
},
|
|
18325
18414
|
"requestAdaptor": "api.data={query: '{spaces__findOne(id: \"none\"){_id,name}}'};return api;",
|
|
18326
|
-
"adaptor": "\n // console.log('service listview schemaApi adaptor....', api.body); \n let { appId, objectName, defaultListName: listName, display, formFactor: defaultFormFactor} = api.body;\n if(api.body.listName){\n listName = api.body.listName;\n }\n return new Promise((resolve)=>{\n const listViewSchemaProps = ".concat(JSON.stringify(listViewSchemaProps), ";\n const formFactor = ([\"split\"].indexOf(display) > -1) ? 'SMALL': defaultFormFactor;\n listViewSchemaProps.formFactor = formFactor;\n listViewSchemaProps.displayAs = display;\n // console.log(\"====listViewSchemaProps===>\", listName, display, listViewSchemaProps)\n window.getListSchema(appId, objectName, listName, listViewSchemaProps).then((schema)=>{\n try{\n const uiSchema = schema.uiSchema;\n const listView = _.find(\n uiSchema.list_views,\n (listView, name) => {\n // \u4F20\u5165listViewName\u7A7A\u503C\u5219\u53D6\u7B2C\u4E00\u4E2A\n if(!listName){\n listName = name;\n }\n return name === listName || listView._id === listName;\n }\n );\n if(listView){\n window.Steedos && window.Steedos.setDocumentTitle && window.Steedos.setDocumentTitle({pageName: listView.label || listView.name})\n }\n }catch(e){\n console.error(e)\n }\n payload.data = schema.amisSchema;\n console.log(\"payload================>\", payload)\n resolve(payload)\n });\n });\n ")
|
|
18415
|
+
"adaptor": "\n // console.log('service listview schemaApi adaptor....', api.body); \n let { appId, objectName, defaultListName: listName, display, formFactor: defaultFormFactor, uiSchema} = api.body;\n if(api.body.listName){\n listName = api.body.listName;\n }\n const listView = _.find(\n uiSchema.list_views,\n (listView, name) => {\n // \u4F20\u5165listViewName\u7A7A\u503C\u5219\u53D6\u7B2C\u4E00\u4E2A\n if(!listName){\n listName = name;\n }\n return name === listName || listView._id === listName;\n }\n );\n return new Promise((resolve)=>{\n const listViewSchemaProps = ".concat(JSON.stringify(listViewSchemaProps), ";\n const formFactor = ([\"split\"].indexOf(display) > -1) ? 'SMALL': defaultFormFactor;\n listViewSchemaProps.formFactor = formFactor;\n listViewSchemaProps.displayAs = display;\n // console.log(\"====listViewSchemaProps===>\", listName, display, listViewSchemaProps)\n const crud_mode = listView.crud_mode;\n if(crud_mode){\n if(!listViewSchemaProps.defaults.listSchema.mode){\n // \u8FD9\u91CC\u4F18\u5148\u8BA4\u5FAE\u9875\u9762\u4E2D\u4E3A\u5217\u8868\u89C6\u56FE\u7EC4\u4EF6\u914D\u7F6E\u7684crudMode\u53CAcrud.mode\u5C5E\u6027\uFF0C\n // \u53EA\u6709\u7EC4\u4EF6\u4E2D\u672A\u914D\u7F6E\u8BE5\u5C5E\u6027\u65F6\u624D\u53D6\u5143\u6570\u636E\u4E2D\u4E3A\u5F53\u524D\u5217\u8868\u89C6\u56FE\u914D\u7F6E\u7684crud_mode\u5C5E\u6027\u4F5C\u4E3Acrud\u7684mode\u503C\n // \u4E0D\u4F18\u5148\u8BA4\u5404\u4E2A\u5217\u8868\u89C6\u56FE\u5143\u6570\u636E\u4E2D\u7684\u914D\u7F6E\uFF0C\u662F\u56E0\u4E3A\u5728\u754C\u9762\u4E0A\u65B0\u5EFA\u7F16\u8F91\u5217\u8868\u89C6\u56FE\u65F6\uFF0Ccrud_mode\u5B57\u6BB5\u503C\u9ED8\u8BA4\u503C\u662Ftable\uFF0C\u8FD9\u4F1A\u8BA9\u5FAE\u9875\u9762\u4E2D\u5217\u8868\u89C6\u56FE\u7EC4\u4EF6\u4E2D\u914D\u7F6E\u7684crudMode\u53CAcrud.mode\u5C5E\u6027\u503C\u4E0D\u751F\u6548\n // \u5982\u679C\u60F3\u4F18\u5148\u8BA4\u5404\u4E2A\u5217\u8868\u89C6\u56FE\u5143\u6570\u636E\u4E2D\u7684\u914D\u7F6E\uFF0C\u53EA\u8981\u628A\u5FAE\u9875\u9762\u4E2D\u5217\u8868\u89C6\u56FE\u7EC4\u4EF6\u7684crudMode\u53CAcrud.mode\u5C5E\u6027\u503C\u6E05\u9664\u5373\u53EF\n listViewSchemaProps.defaults.listSchema.mode = crud_mode;\n }\n }\n window.getListSchema(appId, objectName, listName, listViewSchemaProps).then((schema)=>{\n try{\n const uiSchema = schema.uiSchema;\n const listView = _.find(\n uiSchema.list_views,\n (listView, name) => {\n // \u4F20\u5165listViewName\u7A7A\u503C\u5219\u53D6\u7B2C\u4E00\u4E2A\n if(!listName){\n listName = name;\n }\n return name === listName || listView._id === listName;\n }\n );\n if(listView){\n window.Steedos && window.Steedos.setDocumentTitle && window.Steedos.setDocumentTitle({pageName: listView.label || listView.name})\n }\n }catch(e){\n console.error(e)\n }\n payload.data = schema.amisSchema;\n console.log(\"payload================>\", payload)\n resolve(payload)\n });\n });\n ")
|
|
18327
18416
|
},
|
|
18328
18417
|
// "body": body,
|
|
18329
18418
|
// "data": serviceData
|
|
@@ -19122,7 +19211,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
19122
19211
|
schemaApi: {
|
|
19123
19212
|
"method": "get",
|
|
19124
19213
|
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
|
|
19125
|
-
"adaptor": "\n try {\n // console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"").concat(data.tabId, "\";\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n })\n })\n } else {\n var tabGroup = _.find(tab_groups, {\"group_name\": groupName});\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": tabGroup && tabGroup.default_open != false,\n \"isGroup\": true,\n \"children\": _.sortBy(_.map(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n }\n }),(tab) => {return tab.index})\n }) \n }\n });\n \n }else{\n _.each(payload.children, (tab)=>{\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\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 payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav\n },\n \"id\": \"appMenuService\",\n \"body\":{\n \"type\": \"nav\",\n className: \"").concat(className, " text-black\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n },\n {\n \"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 } catch (error) {\n console.log(`error`, error)\n }\n // console.log('payload===2==>', payload)\n return payload;\n "),
|
|
19214
|
+
"adaptor": "\n try {\n // console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"").concat(data.tabId, "\";\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 whitespace-normal leading-6 block -ml-px no-underline group flex items-center text-[14px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n })\n })\n } else {\n var tabGroup = _.find(tab_groups, {\"group_name\": groupName});\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": tabGroup && tabGroup.default_open != false,\n \"isGroup\": true,\n \"children\": _.sortBy(_.map(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 whitespace-normal leading-6 block -ml-px no-underline group flex items-center text-[14px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n }\n }),(tab) => {return tab.index})\n }) \n }\n });\n \n }else{\n _.each(payload.children, (tab)=>{\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 whitespace-normal leading-6 block -ml-px no-underline group flex items-center text-[14px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\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 payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav\n },\n \"id\": \"appMenuService\",\n \"body\":{\n \"type\": \"nav\",\n className: \"").concat(className, " text-black\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n },\n {\n \"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 } catch (error) {\n console.log(`error`, error)\n }\n // console.log('payload===2==>', payload)\n return payload;\n "),
|
|
19126
19215
|
"headers": {
|
|
19127
19216
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
19128
19217
|
}
|
|
@@ -19790,18 +19879,18 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
|
|
|
19790
19879
|
}); };
|
|
19791
19880
|
|
|
19792
19881
|
var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
19793
|
-
var steedosField, field, _a, readonly, _b, ctx, config,
|
|
19882
|
+
var steedosField, field, _a, readonly, _b, ctx, config, fStatic, objectName, filters, valueFieldKey, labelFieldKey, referenceTo, referenceToField, value, _steedosField, referenceTo, referenceToField, schema, schema, error_1;
|
|
19794
19883
|
var _c, _d, _e, _f, _g;
|
|
19795
19884
|
return __generator(this, function (_h) {
|
|
19796
19885
|
switch (_h.label) {
|
|
19797
19886
|
case 0:
|
|
19798
19887
|
steedosField = null;
|
|
19799
|
-
field = props.field, _a = props.readonly, readonly = _a === void 0 ? false : _a, _b = props.ctx, ctx = _b === void 0 ? {} : _b, config = props.config,
|
|
19888
|
+
field = props.field, _a = props.readonly, readonly = _a === void 0 ? false : _a, _b = props.ctx, ctx = _b === void 0 ? {} : _b, config = props.config, props.$schema, fStatic = props.static;
|
|
19800
19889
|
// console.log(`AmisSteedosField`, props)
|
|
19801
|
-
if
|
|
19802
|
-
|
|
19803
|
-
|
|
19804
|
-
}
|
|
19890
|
+
// if($schema.config && isString($schema.config)){
|
|
19891
|
+
// $schema.config = JSON.parse($schema.config)
|
|
19892
|
+
// props.config = $schema.config
|
|
19893
|
+
// }
|
|
19805
19894
|
if (_$1.isString(ctx)) {
|
|
19806
19895
|
ctx = JSON.parse(ctx);
|
|
19807
19896
|
}
|
|
@@ -20294,7 +20383,7 @@ var PageObject = function (props) { return __awaiter(void 0, void 0, void 0, fun
|
|
|
20294
20383
|
});
|
|
20295
20384
|
}); };
|
|
20296
20385
|
|
|
20297
|
-
var __assign=function(){return (__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},StandardObjects={Base:{Actions:{standard_query:{visible:function(e,t,r){return !1}},standard_new:{visible:function(e,t,r){return "cms_files"!==e&&"instances"!==e&&(r?r.allowCreate:void 0)}},standard_edit:{visible:function(e,t,r){if(r)return r.allowEdit}},standard_delete:{visible:function(e,t,r){if(r)return r.allowDelete}},standard_import_data:{visible:function(e,t,r){var n=this.object;if(r)return r.allowCreate&&n.hasImportTemplates}},standard_approve:{visible:function(e,t,r){return !1}},standard_view_instance:{visible:function(e,t,r){return !1}},standard_submit_for_approval:{visible:function(e,t,r){return window.Steedos.ProcessManager.allowSubmit.apply(this,[e,t])},todo:function(e,t){return window.Steedos.ProcessManager.submit.apply(this,[e,t])}},standard_follow:{visible:function(e,t,r){return !1}},standard_delete_many:{visible:function(e,t,r){return !RegExp("\\w+/view/\\w+").test(location.pathname)&&(r?r.allowDelete:void 0)}},standard_export_excel:{visible:function(e,t,r){return !1}}}}},authRequest=function(e,t){var s=null;e=Steedos.absoluteUrl(e);try{var r=[{name:"Content-Type",value:"application/json"},{name:"Authorization",value:Steedos.getAuthorization()}],n={type:"get",url:e,dataType:"json",contentType:"application/json",beforeSend:function(t){if(r&&r.length)return r.forEach(function(e){return t.setRequestHeader(e.name,e.value)})},success:function(e){s=e;},error:function(e,t,r){var n,o;e.responseJSON&&e.responseJSON.error?(n=e.responseJSON.error,o=void(s={error:n}),o=n.reason||n.message||n,console.error(o)):console.error(e.responseJSON);}};return $.ajax(Object.assign({},n,t)),s}catch(e){console.error(e);}};function _extends(){return (_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r,n=arguments[t];for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e}).apply(this,arguments)}const newFunctionComponent=o=>e=>{const[t,r]=React.useState(!0);var n=()=>{r(!1);};return _$1.has(e,"ref")||(window.SteedosUI.refs[e.name]={show:()=>{r(!0);},close:n}),React__default["default"].createElement(o,_extends({visible:t,onCancel:n,onClose:n},{width:"70%",style:{width:"70%",maxWidth:"950px",minWidth:"480px"}},e))},newComponentRender=(r,n)=>(e,t)=>{e.name||(e.name=r+"-"+(e.name||"default")),(t=t||document.getElementById(`steedos-${r}-root-`+e.name))||((t=document.createElement("div")).setAttribute("id",`steedos-${r}-root-`+e.name),document.body.appendChild(t));e=React__default["default"].createElement(newFunctionComponent(n),e);ReactDOM.createRoot(t).render(e);},Modal=_$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 n="";t=[`id: "${t}"`];return `{record:${e}__findOne${n=0<t.length?`(${t.join(",")})`:n}{${r}}}`},SObject={getRecord:async(e,t,r)=>{return (await fetchAPI("/graphql",{method:"post",body:JSON.stringify({query:getFindOneQuery(e,t,r)})})).data.record},getUISchema:async(e,t)=>getUISchema(e,t)},canSaveFilter=e=>!(!e._id||e.owner!==getSteedosAuth()?.userId),ListView={showFilter:(e,{listView:t,data:r})=>{canSaveFilter(t);r.filters&&(r.filters=filtersToConditions(r.filters));},getVisibleFilter:(e,t)=>{return t||(canSaveFilter(e)?e.filters:void 0)},getQueryFilter:(e,t)=>{return canSaveFilter(e)?ListView.getVisibleFilter(e,t):_$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:n,foreignKey:o}){return `/app/${e}/${t}/${r}/${n}/grid?related_field_name=`+o}};var withModalWrap=function(t,e){return function(e){return React.createElement(t,e)}},render=function(e,t,r,n){e=withModalWrap(e),e=React.createElement(e,__assign({},t));return ReactDOM__default["default"].render(e,r)};const safeRunFunction=(t,r,n,o)=>{try{var s=window.Creator;if(!!(!s||!s.getObjectUrl)&&/\bSteedos\b|\bCreator\b|\bMeteor\b|\bSession\b/.test(t))return console.info("调用了Creator|Steedos|Meteor|Session变量的脚本不执行,直接按空值处理。"),"";let e=[];return _$1.isNil(r)||(e=_$1.isArray(r)?r:[r]),t.bind(o||{})(...e)}catch(e){return console.log(e),n}};function safeEval(js){try{return eval(js)}catch(e){console.error(e,js);}}const isExpression=function(e){var t,r;return "string"==typeof e&&(t=/^{{(function.+)}}$/,r=/^{{(.+=>.+)}}$/,!("string"!=typeof e||!e.match(/^{{(.+)}}$/)||e.match(t)||e.match(r)))},parseSingleExpression=function(t,e,r,n){var o,s=function(e,t){return "#"!==t&&t?"string"==typeof t?_.get(e,t):void console.error("path has to be a string"):e||{}}(e=void 0===e?{}:e,function(e){return "string"!=typeof e||1===(e=e.split(".")).length?"#":(e.pop(),e.join("."))}(r))||{};if("string"!=typeof t)return t;o="__G_L_O_B_A_L__",e="\n return "+t.substring(2,t.length-2).replace(/\bformData\b/g,JSON.stringify(e).replace(/\bglobal\b/g,o)).replace(/\bglobal\b/g,JSON.stringify(n)).replace(new RegExp("\\b"+o+"\\b","g"),"global").replace(/rootValue/g,JSON.stringify(s));try{return Function(e)()}catch(e){return console.log(e,t,r),t}};var Expression=Object.freeze({__proto__:null,isExpression:isExpression,parseSingleExpression:parseSingleExpression});const getCompatibleDefaultValueExpression=(express,multiple)=>{const reg=/^\{\w+(\.*\w+)*\}$/,reg2=/^{{[\s\S]*}}$/;let result=express;if(reg.test(express)&&(result=-1<express.indexOf("userId")||-1<express.indexOf("spaceId")||-1<express.indexOf("user.")||-1<express.indexOf("now")?`{${express}}`.replace("{{","{{global."):`{${express}}`.replace("{{","{{formData."),multiple&&(result=result.replace(/\{\{(.+)\}\}/,"{{[$1]}}"))),reg2.test(express)&&(-1<express.indexOf("function")||-1<express.indexOf("=>"))){let regex=/\{\{([\s\S]*)\}\}/,matches=regex.exec(express);if(matches&&1<matches.length){let functionCode=matches[1];result=eval("("+functionCode+")")();}}return result},getFieldDefaultValue=(e,t)=>{if(!e)return null;let r=e.defaultValue;e._defaultValue&&(r=safeEval(`(${e._defaultValue})`)),_$1.isFunction(r)&&(r=safeRunFunction(r,[],null,{name:e.name})),_$1.isString(r)&&(r=getCompatibleDefaultValueExpression(r,e.multiple));var n=isExpression(r);switch(n&&(r=parseSingleExpression(r,{},"#",t)),e.type){case"select":var o=e.data_type||"text";!r||n||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);}return r};function getTreeOptions(t,e){const o=e?.valueField||"value";e?.labelField;const r=e?.unfoldedNum||1,n=[],s=(t,r,n)=>{var e;if(r)return e=_.filter(t,e=>_.includes(r,e[o])),_.each(e,e=>{1<=n?(e.unfolded=!0,e.children&&(e.children=s(t,e.children,n-1))):e.children&&(e.children=s(t,e.children,n));}),e};for(var i=t,a=0;a<i.length;a++)if(i[a].noParent=0,i[a].unfolded=!1,i[a].parent){let e=1;for(var l=0;l<i.length;l++)i[a].parent==i[l][o]&&(e=0);1==e&&(i[a].noParent=1);}else i[a].noParent=1;return _.each(t,e=>{1==e.noParent&&(1<=r?(e.unfolded=!0,n.push(Object.assign({},e,{children:s(t,e.children,r-1)}))):n.push(Object.assign({},e,{children:s(t,e.children,r)})));}),n}function getClosestAmisComponentByType(t,r,n){let o=(n=n||{}).name;var e=n.direction||"up";let s=t.getComponents().find(function(e){return e.props.type===r&&(!o||e.props.name===o)});if(s)return s;if("down"===e){if(t.children&&t.children.length){for(let e=0;e<t.children.length&&!(s=getClosestAmisComponentByType(t.children[e],r,n));e++);return s}}else if("up"===e&&t.parent)return getClosestAmisComponentByType(t.parent,r,n)}function isFilterFormValuesEmpty(e){let t=!0;var e=_.pickBy(e,function(e,t){return /^__searchable__/g.test(t)});return _.isEmpty(e)||(e=_.omitBy(e,function(e){return _.isNil(e)||_.isObject(e)&&_.isEmpty(e)||_.isArray(e)&&_.isEmpty(e.filter(function(e){return !_.isNil(e)}))||_.isString(e)&&0===e.length}),_.isEmpty(e)||(t=!1)),t}const SteedosUI$1=Object.assign({},{render:render,Router:Router,ListView:ListView,Object:SObject,Modal:Modal,Drawer:Drawer,refs:{},getRef(e){return SteedosUI$1.refs[e]},router:{go:(e,t)=>{var r=window.FlowRouter;if(t)return r?r.go(t):window.open(t);r?r.reload():console.warn("暂不支持自动跳转",e);},reload:()=>{console.log("reload");}},message:antd.message,notification:antd.notification,components:{Button:antd.Button,Space:antd.Space},getRefId:({type:e,appId:t,name:r})=>{switch(e){case"listview":return `amis-${t}-${r}-listview`;case"form":return `amis-${t}-${r}-form`;case"detail":return `amis-${t}-${r}-detail`;default:return `amis-${t}-${r}-`+e}},reloadRecord:()=>{if(window.FlowRouter)return window.FlowRouter.reload()},getFieldDefaultValue:getFieldDefaultValue,getTreeOptions:getTreeOptions,getClosestAmisComponentByType:getClosestAmisComponentByType,isFilterFormValuesEmpty:isFilterFormValuesEmpty,getSearchFilter:e=>{var o=[];return _.each(e,(e,t)=>{var r,n;_.isEmpty(e)&&!_.isBoolean(e)||(_.startsWith(t,"__searchable__between__")?o.push([""+t.replace("__searchable__between__",""),"between",e]):_.startsWith(t,"__searchable__")&&(_.isString(e)?o.push([""+t.replace("__searchable__",""),"contains",e]):_.isObject(e)&&e.o?(n=[[(r=""+t.replace("__searchable__",""))+"/o","=",e.o]],e.ids.length&&n.push([r+"/ids","=",e.ids]),o.push(n)):o.push([""+t.replace("__searchable__",""),"=",e])));}),o},getKeywordsSearchFilter:(e,t)=>{const o=[];var s;return e&&t&&(s=e.split(/\s+/),s=_$1.compact(s),t.forEach(function(r,e){let n=[];1==s.length?n=[r,"contains",s[0]]:s.forEach(function(e,t){n.push([r,"contains",e]),t<s.length-1&&n.push("or");}),n.length&&(o.push(n),e<t.length-1&&o.push("or"));})),o}});var getBuilderContext=function(){return "undefined"==typeof window?{}:Builder.settings.context||Builder.settings},Steedos$1=__assign({getRootUrl:function(e){var t=getBuilderContext();return t.rootUrl||("undefined"!=typeof window?window.localStorage.getItem("steedos:rootUrl"):"")||e},absoluteUrl:function(e){return void 0===e&&(e=""),"".concat(Steedos$1.getRootUrl()).concat(e)},getTenantId:function(){try{var e=getBuilderContext().tenantId;return (e=window.location.search&&!e?new URLSearchParams(window.location.search).get("X-Space-Id"):e)?e:null}catch(e){console.error(e);}},getAuthorization:function(){try{var e=getBuilderContext(),t=e.tenantId,r=e.authToken;return t&&r?"Bearer ".concat(t,",").concat(r):null}catch(e){console.error(e);}},authRequest:authRequest,StandardObjects:StandardObjects},Expression);"undefined"==typeof window||window.Steedos||(window.Steedos=Steedos$1),"undefined"==typeof window||window.SteedosUI||(window.SteedosUI=SteedosUI$1);
|
|
20386
|
+
var __assign=function(){return (__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},StandardObjects={Base:{Actions:{standard_query:{visible:function(e,t,r){return !1}},standard_new:{visible:function(e,t,r){return "cms_files"!==e&&"instances"!==e&&(r?r.allowCreate:void 0)}},standard_edit:{visible:function(e,t,r){if(r)return r.allowEdit}},standard_delete:{visible:function(e,t,r){if(r)return r.allowDelete}},standard_import_data:{visible:function(e,t,r){var n=this.object;if(r)return r.allowCreate&&n.hasImportTemplates}},standard_approve:{visible:function(e,t,r){return !1}},standard_view_instance:{visible:function(e,t,r){return !1}},standard_submit_for_approval:{visible:function(e,t,r){return window.Steedos.ProcessManager.allowSubmit.apply(this,[e,t])},todo:function(e,t){return window.Steedos.ProcessManager.submit.apply(this,[e,t])}},standard_follow:{visible:function(e,t,r){return !1}},standard_delete_many:{visible:function(e,t,r){return !RegExp("\\w+/view/\\w+").test(location.pathname)&&(r?r.allowDelete:void 0)}},standard_export_excel:{visible:function(e,t,r){return !1}}}}},authRequest=function(e,t){var s=null;e=Steedos.absoluteUrl(e);try{var r=[{name:"Content-Type",value:"application/json"},{name:"Authorization",value:Steedos.getAuthorization()}],n={type:"get",url:e,dataType:"json",contentType:"application/json",beforeSend:function(t){if(r&&r.length)return r.forEach(function(e){return t.setRequestHeader(e.name,e.value)})},success:function(e){s=e;},error:function(e,t,r){var n,o;e.responseJSON&&e.responseJSON.error?(n=e.responseJSON.error,o=void(s={error:n}),o=n.reason||n.message||n,console.error(o)):console.error(e.responseJSON);}};return $.ajax(Object.assign({},n,t)),s}catch(e){console.error(e);}};function _extends(){return (_extends=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r,n=arguments[t];for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r]);}return e}).apply(this,arguments)}const newFunctionComponent=o=>e=>{const[t,r]=React.useState(!0);var n=()=>{r(!1);};return _$1.has(e,"ref")||(window.SteedosUI.refs[e.name]={show:()=>{r(!0);},close:n}),React__default["default"].createElement(o,_extends({visible:t,onCancel:n,onClose:n},{width:"70%",style:{width:"70%",maxWidth:"950px",minWidth:"480px"}},e))},newComponentRender=(r,n)=>(e,t)=>{e.name||(e.name=r+"-"+(e.name||"default")),(t=t||document.getElementById(`steedos-${r}-root-`+e.name))||((t=document.createElement("div")).setAttribute("id",`steedos-${r}-root-`+e.name),document.body.appendChild(t));e=React__default["default"].createElement(newFunctionComponent(n),e);ReactDOM.createRoot(t).render(e);},Modal=_$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 n="";t=[`id: "${t}"`];return `{record:${e}__findOne${n=0<t.length?`(${t.join(",")})`:n}{${r}}}`},SObject={getRecord:async(e,t,r)=>{return (await fetchAPI("/graphql",{method:"post",body:JSON.stringify({query:getFindOneQuery(e,t,r)})})).data.record},getUISchema:async(e,t)=>getUISchema(e,t)},canSaveFilter=e=>!(!e._id||e.owner!==getSteedosAuth()?.userId),ListView={showFilter:(e,{listView:t,data:r})=>{canSaveFilter(t);r.filters&&(r.filters=filtersToConditions(r.filters));},getVisibleFilter:(e,t)=>{return t||(canSaveFilter(e)?e.filters:void 0)},getQueryFilter:(e,t)=>{return canSaveFilter(e)?ListView.getVisibleFilter(e,t):_$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:n,foreignKey:o}){return `/app/${e}/${t}/${r}/${n}/grid?related_field_name=`+o}};var withModalWrap=function(t,e){return function(e){return React.createElement(t,e)}},render=function(e,t,r,n){e=withModalWrap(e),e=React.createElement(e,__assign({},t));return ReactDOM__default["default"].render(e,r)};const safeRunFunction=(t,r,n,o)=>{try{var s=window.Creator;if(!!(!s||!s.getObjectUrl)&&/\bSteedos\b|\bCreator\b|\bMeteor\b|\bSession\b/.test(t))return console.info("调用了Creator|Steedos|Meteor|Session变量的脚本不执行,直接按空值处理。"),"";let e=[];return _$1.isNil(r)||(e=_$1.isArray(r)?r:[r]),t.bind(o||{})(...e)}catch(e){return console.log(e),n}};function safeEval(js){try{return eval(js)}catch(e){console.error(e,js);}}const isExpression=function(e){var t,r;return "string"==typeof e&&(t=/^{{(function.+)}}$/,r=/^{{(.+=>.+)}}$/,!("string"!=typeof e||!e.match(/^{{(.+)}}$/)||e.match(t)||e.match(r)))},getMoment=()=>window.amisRequire?window.amisRequire("moment"):window.moment||void 0,parseSingleExpression=function(t,e,r,n){if(n){var o=new Date;let e=getMoment()().utc();e.set("hours",0),e.set("minutes",0),e.set("seconds",0),e=e.toDate(),Object.assign(n,{now:o,today:e});}var s,o=function(e,t){return "#"!==t&&t?"string"==typeof t?_.get(e,t):void console.error("path has to be a string"):e||{}}(e=void 0===e?{}:e,function(e){return "string"!=typeof e||1===(e=e.split(".")).length?"#":(e.pop(),e.join("."))}(r))||{};if("string"!=typeof t)return t;s="__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,s)).replace(/\bglobal\b/g,JSON.stringify(n)).replace(new RegExp("\\b"+s+"\\b","g"),"global").replace(/rootValue/g,JSON.stringify(o));try{return Function(e)()}catch(e){return console.log(e,t,r),t}};var Expression=Object.freeze({__proto__:null,isExpression:isExpression,parseSingleExpression:parseSingleExpression});const getCompatibleDefaultValueExpression=(express,multiple)=>{console.log("===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")?`{${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.isString(r)&&(r=getCompatibleDefaultValueExpression(r,e.multiple));var n=isExpression(r);switch(n&&("date"===e.type&&(r=r.replace(/\bglobal.now\b/g,"global.today")),r=parseSingleExpression(r,{},"#",t)),e.type){case"select":var o=e.data_type||"text";!r||n||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);}return r};function getTreeOptions(t,e){const o=e?.valueField||"value";e?.labelField;const r=e?.unfoldedNum||1,n=[],s=(t,r,n)=>{var e;if(r)return e=_.filter(t,e=>_.includes(r,e[o])),_.each(e,e=>{1<=n?(e.unfolded=!0,e.children&&(e.children=s(t,e.children,n-1))):e.children&&(e.children=s(t,e.children,n));}),e};for(var i=t,a=0;a<i.length;a++)if(i[a].noParent=0,i[a].unfolded=!1,i[a].parent){let e=1;for(var l=0;l<i.length;l++)i[a].parent==i[l][o]&&(e=0);1==e&&(i[a].noParent=1);}else i[a].noParent=1;return _.each(t,e=>{1==e.noParent&&(1<=r?(e.unfolded=!0,n.push(Object.assign({},e,{children:s(t,e.children,r-1)}))):n.push(Object.assign({},e,{children:s(t,e.children,r)})));}),n}function getClosestAmisComponentByType(t,r,n){let o=(n=n||{}).name;var e=n.direction||"up";let s=t.getComponents().find(function(e){return e.props.type===r&&(!o||e.props.name===o)});if(s)return s;if("down"===e){if(t.children&&t.children.length){for(let e=0;e<t.children.length&&!(s=getClosestAmisComponentByType(t.children[e],r,n));e++);return s}}else if("up"===e&&t.parent)return getClosestAmisComponentByType(t.parent,r,n)}function isFilterFormValuesEmpty(e){let t=!0;var e=_.pickBy(e,function(e,t){return /^__searchable__/g.test(t)});return _.isEmpty(e)||(e=_.omitBy(e,function(e){return _.isNil(e)||_.isObject(e)&&_.isEmpty(e)||_.isArray(e)&&_.isEmpty(e.filter(function(e){return !_.isNil(e)}))||_.isString(e)&&0===e.length}),_.isEmpty(e)||(t=!1)),t}const SteedosUI$1=Object.assign({},{render:render,Router:Router,ListView:ListView,Object:SObject,Modal:Modal,Drawer:Drawer,refs:{},getRef(e){return SteedosUI$1.refs[e]},router:{go:(e,t)=>{var r=window.FlowRouter;if(t)return r?r.go(t):window.open(t);r?r.reload():console.warn("暂不支持自动跳转",e);},reload:()=>{console.log("reload");}},message:antd.message,notification:antd.notification,components:{Button:antd.Button,Space:antd.Space},getRefId:({type:e,appId:t,name:r})=>{switch(e){case"listview":return `amis-${t}-${r}-listview`;case"form":return `amis-${t}-${r}-form`;case"detail":return `amis-${t}-${r}-detail`;default:return `amis-${t}-${r}-`+e}},reloadRecord:()=>{if(window.FlowRouter)return window.FlowRouter.reload()},getFieldDefaultValue:getFieldDefaultValue,getTreeOptions:getTreeOptions,getClosestAmisComponentByType:getClosestAmisComponentByType,isFilterFormValuesEmpty:isFilterFormValuesEmpty,getSearchFilter:e=>{var o=[];return _.each(e,(e,t)=>{var r,n;_.isEmpty(e)&&!_.isBoolean(e)||(_.startsWith(t,"__searchable__between__")?o.push([""+t.replace("__searchable__between__",""),"between",e]):_.startsWith(t,"__searchable__")&&(_.isString(e)?o.push([""+t.replace("__searchable__",""),"contains",e]):_.isObject(e)&&e.o?(n=[[(r=""+t.replace("__searchable__",""))+"/o","=",e.o]],e.ids.length&&n.push([r+"/ids","=",e.ids]),o.push(n)):o.push([""+t.replace("__searchable__",""),"=",e])));}),o},getKeywordsSearchFilter:(e,t)=>{const o=[];var s;return e&&t&&(s=e.split(/\s+/),s=_$1.compact(s),t.forEach(function(r,e){let n=[];1==s.length?n=[r,"contains",s[0]]:s.forEach(function(e,t){n.push([r,"contains",e]),t<s.length-1&&n.push("or");}),n.length&&(o.push(n),e<t.length-1&&o.push("or"));})),o}});var getBuilderContext=function(){return "undefined"==typeof window?{}:Builder.settings.context||Builder.settings},Steedos$1=__assign({getRootUrl:function(e){var t=getBuilderContext();return t.rootUrl||("undefined"!=typeof window?window.localStorage.getItem("steedos:rootUrl"):"")||e},absoluteUrl:function(e){return void 0===e&&(e=""),"".concat(Steedos$1.getRootUrl()).concat(e)},getTenantId:function(){try{var e=getBuilderContext().tenantId;return (e=window.location.search&&!e?new URLSearchParams(window.location.search).get("X-Space-Id"):e)?e:null}catch(e){console.error(e);}},getAuthorization:function(){try{var e=getBuilderContext(),t=e.tenantId,r=e.authToken;return t&&r?"Bearer ".concat(t,",").concat(r):null}catch(e){console.error(e);}},authRequest:authRequest,StandardObjects:StandardObjects},Expression);"undefined"==typeof window||window.Steedos||(window.Steedos=Steedos$1),"undefined"==typeof window||window.SteedosUI||(window.SteedosUI=SteedosUI$1);
|
|
20298
20387
|
|
|
20299
20388
|
var index_esm = /*#__PURE__*/Object.freeze({
|
|
20300
20389
|
__proto__: null,
|