@steedos-widgets/amis-object 6.3.1 → 6.3.3
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 +1 -0
- package/dist/amis-object.cjs.js +173 -136
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +1 -0
- package/dist/amis-object.esm.js +173 -136
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +1 -0
- package/dist/amis-object.umd.js +20 -21
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +21 -21
- package/dist/meta.js +70 -75
- package/package.json +3 -3
package/dist/amis-object.cjs.css
CHANGED
package/dist/amis-object.cjs.js
CHANGED
|
@@ -4986,6 +4986,11 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
4986
4986
|
const submitEvent = {
|
|
4987
4987
|
submit: {
|
|
4988
4988
|
actions: [
|
|
4989
|
+
{
|
|
4990
|
+
"actionType": "validate",
|
|
4991
|
+
"componentId": quickEditId,
|
|
4992
|
+
"outputVar": "form_validate_result"
|
|
4993
|
+
},
|
|
4989
4994
|
{
|
|
4990
4995
|
actionType: "custom",
|
|
4991
4996
|
script: `
|
|
@@ -5002,10 +5007,12 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
5002
5007
|
doAction({actionType: 'setValue', "args": {"value": event.data._display},componentId: "${options.objectName}" + "_display_" + event.data._index});
|
|
5003
5008
|
doAction({actionType: 'setValue', "args": {"value": event.data.${field.name}},componentId: "${options.objectName + "_" + field.name + "_"}" + event.data._index});
|
|
5004
5009
|
}
|
|
5005
|
-
|
|
5010
|
+
`,
|
|
5011
|
+
expression: "${!form_validate_result.error}"
|
|
5006
5012
|
},
|
|
5007
5013
|
{
|
|
5008
|
-
"actionType": "closeDialog"
|
|
5014
|
+
"actionType": "closeDialog",
|
|
5015
|
+
expression: "${!form_validate_result.error}"
|
|
5009
5016
|
}
|
|
5010
5017
|
]
|
|
5011
5018
|
}
|
|
@@ -6604,7 +6611,7 @@ function getReadonlyFormAdaptor(object, fields, options){
|
|
|
6604
6611
|
nameLabel = `record._display.${nameField.name}.label`;
|
|
6605
6612
|
}
|
|
6606
6613
|
} else if (nameField){
|
|
6607
|
-
nameLabel = `(record._display
|
|
6614
|
+
nameLabel = `(record._display && record._display.${nameField.name}) || record.${nameField.name}`;
|
|
6608
6615
|
}
|
|
6609
6616
|
return `
|
|
6610
6617
|
if(payload.data.data.length === 0){
|
|
@@ -6797,7 +6804,7 @@ async function getEditFormInitApi(object, recordId, fields, options){
|
|
|
6797
6804
|
|
|
6798
6805
|
return {
|
|
6799
6806
|
method: "post",
|
|
6800
|
-
url: getApi$2() + '&objectName=${objectName}' ,
|
|
6807
|
+
url: getApi$2() + '&objectName=${objectName}' + "&recordId=${recordId}",
|
|
6801
6808
|
// sendOn: "!!this.recordId",
|
|
6802
6809
|
cache: API_CACHE,
|
|
6803
6810
|
requestAdaptor: `
|
|
@@ -12849,9 +12856,10 @@ async function getFormSchemaWithDataFilter(form, options = {}){
|
|
|
12849
12856
|
async function getObjectForm(objectSchema, ctx){
|
|
12850
12857
|
const { recordId, formFactor, layout = formFactor === 'SMALL' ? 'normal' : "horizontal", labelAlign, tabId, appId, defaults, submitSuccActions = [],
|
|
12851
12858
|
formDataFilter, onFormDataFilter, amisData, env } = ctx;
|
|
12859
|
+
let enableTabs = ctx.enableTabs;
|
|
12852
12860
|
//优先识别组件上的enableTabs属性,若不存在,则识别对象上定义的
|
|
12853
|
-
if (typeof
|
|
12854
|
-
|
|
12861
|
+
if (typeof enableTabs !== 'boolean') {
|
|
12862
|
+
enableTabs = objectSchema.enable_form_tabs;
|
|
12855
12863
|
}
|
|
12856
12864
|
const fields = _$1__default["default"].values(objectSchema.fields);
|
|
12857
12865
|
const formFields = getFormFields$1(objectSchema, ctx);
|
|
@@ -12895,7 +12903,7 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
12895
12903
|
body: {
|
|
12896
12904
|
type: 'wrapper',
|
|
12897
12905
|
className: 'p-0 m-0',
|
|
12898
|
-
body: await getFormBody(fields, formFields, Object.assign({}, ctx, {fieldGroups: objectSchema.field_groups, omitReadonlyFields: true})),
|
|
12906
|
+
body: await getFormBody(fields, formFields, Object.assign({}, ctx, {fieldGroups: objectSchema.field_groups, omitReadonlyFields: true, enableTabs})),
|
|
12899
12907
|
hiddenOn: "${editFormInited != true}",
|
|
12900
12908
|
},
|
|
12901
12909
|
panelClassName:'m-0 sm:rounded-lg shadow-none border-none',
|
|
@@ -12950,6 +12958,11 @@ async function getObjectDetail(objectSchema, recordId, ctx){
|
|
|
12950
12958
|
const fields = _$1__default["default"].values(objectSchema.fields);
|
|
12951
12959
|
const formFields = getFormFields$1(objectSchema, ctx);
|
|
12952
12960
|
const serviceId = `service_detail_page`;
|
|
12961
|
+
let enableTabs = ctx.enableTabs;
|
|
12962
|
+
//优先识别组件上的enableTabs属性,若不存在,则识别对象上定义的
|
|
12963
|
+
if (typeof enableTabs !== 'boolean') {
|
|
12964
|
+
enableTabs = objectSchema.enable_form_tabs;
|
|
12965
|
+
}
|
|
12953
12966
|
const amisSchema = {
|
|
12954
12967
|
type: 'service',
|
|
12955
12968
|
name: `page_readonly_${recordId}`,
|
|
@@ -12976,7 +12989,7 @@ async function getObjectDetail(objectSchema, recordId, ctx){
|
|
|
12976
12989
|
body: await getFormBody(
|
|
12977
12990
|
_$1.map(fields, (field) => { field.readonly = true; return field; }),
|
|
12978
12991
|
_$1.map(formFields, (field) => { field.readonly = true; return field; }),
|
|
12979
|
-
Object.assign({}, ctx, { showSystemFields: true, fieldGroups: objectSchema.field_groups })
|
|
12992
|
+
Object.assign({}, ctx, { showSystemFields: true, fieldGroups: objectSchema.field_groups, enableTabs })
|
|
12980
12993
|
),
|
|
12981
12994
|
className: 'steedos-amis-form bg-white',
|
|
12982
12995
|
actions: [], // 不显示表单默认的提交按钮
|
|
@@ -22208,7 +22221,7 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
22208
22221
|
initApiRequestAdaptor: initApiRequestAdaptor,
|
|
22209
22222
|
initApiAdaptor: initApiAdaptor,
|
|
22210
22223
|
enableTabs: enableTabs,
|
|
22211
|
-
tabsMode: tabsMode,
|
|
22224
|
+
tabsMode: tabsMode || "vertical",
|
|
22212
22225
|
formDataFilter: formDataFilter,
|
|
22213
22226
|
onFormDataFilter: onFormDataFilter,
|
|
22214
22227
|
amisData: allData,
|
|
@@ -24205,6 +24218,9 @@ function getAmisStaticFieldType(type, data_type, options) {
|
|
|
24205
24218
|
else if (type === 'color') {
|
|
24206
24219
|
return 'static-color';
|
|
24207
24220
|
}
|
|
24221
|
+
else if (type === 'file') {
|
|
24222
|
+
return 'control';
|
|
24223
|
+
}
|
|
24208
24224
|
return type;
|
|
24209
24225
|
}
|
|
24210
24226
|
function getLookupLinkOnClick(field, options) {
|
|
@@ -24297,8 +24313,8 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24297
24313
|
}
|
|
24298
24314
|
_5.label = 1;
|
|
24299
24315
|
case 1:
|
|
24300
|
-
_5.trys.push([1,
|
|
24301
|
-
if (!(fStatic && (steedosField.type === 'lookup' || steedosField.type === 'master_detail'))) return [3 /*break*/,
|
|
24316
|
+
_5.trys.push([1, 22, , 23]);
|
|
24317
|
+
if (!(fStatic && (steedosField.type === 'lookup' || steedosField.type === 'master_detail'))) return [3 /*break*/, 16];
|
|
24302
24318
|
lookupATagClick = 'onclick="return false;"';
|
|
24303
24319
|
if (window.innerWidth < 768) {
|
|
24304
24320
|
lookupATagClick = "";
|
|
@@ -24334,10 +24350,10 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24334
24350
|
};
|
|
24335
24351
|
if (!inInputTable) return [3 /*break*/, 2];
|
|
24336
24352
|
fieldBaseProps = Object.assign({}, fieldBaseProps, { type: 'select', source: source });
|
|
24337
|
-
return [3 /*break*/,
|
|
24353
|
+
return [3 /*break*/, 15];
|
|
24338
24354
|
case 2:
|
|
24339
24355
|
referenceTo_1 = steedosField.reference_to;
|
|
24340
|
-
if (!referenceTo_1) return [3 /*break*/,
|
|
24356
|
+
if (!referenceTo_1) return [3 /*break*/, 14];
|
|
24341
24357
|
if (_$1.isArray(referenceTo_1)) {
|
|
24342
24358
|
fieldValue = (_2 = props.data) === null || _2 === void 0 ? void 0 : _2[steedosField.name];
|
|
24343
24359
|
if (fieldValue && fieldValue.o) {
|
|
@@ -24524,16 +24540,20 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24524
24540
|
case 12:
|
|
24525
24541
|
fieldBaseProps = Object.assign({}, fieldBaseProps, { type: 'static', tpl: '-', className: "".concat(fieldBaseProps.className || '', " text-muted") });
|
|
24526
24542
|
_5.label = 13;
|
|
24527
|
-
case 13:
|
|
24543
|
+
case 13: return [3 /*break*/, 15];
|
|
24544
|
+
case 14:
|
|
24545
|
+
fieldBaseProps = Object.assign({}, fieldBaseProps, { type: 'select', source: source });
|
|
24546
|
+
_5.label = 15;
|
|
24547
|
+
case 15:
|
|
24528
24548
|
schema = Object.assign({}, fieldBaseProps, _$1.pick(steedosField.amis || {}, ['className', 'inline', 'label', 'labelAlign', 'name', 'labelRemark', 'description', 'placeholder', 'staticClassName', 'staticLabelClassName', 'staticInputClassName', 'staticSchema']));
|
|
24529
24549
|
schema.placeholder = "";
|
|
24530
24550
|
// console.log(`steedos field [lookup] schema:`, schema)
|
|
24531
24551
|
return [2 /*return*/, schema];
|
|
24532
|
-
case
|
|
24533
|
-
if (!fStatic) return [3 /*break*/,
|
|
24534
|
-
if (!props.data.hasOwnProperty("_display")) return [3 /*break*/,
|
|
24552
|
+
case 16:
|
|
24553
|
+
if (!fStatic) return [3 /*break*/, 19];
|
|
24554
|
+
if (!props.data.hasOwnProperty("_display")) return [3 /*break*/, 18];
|
|
24535
24555
|
return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, true, ctx)];
|
|
24536
|
-
case
|
|
24556
|
+
case 17:
|
|
24537
24557
|
fieldSchema = _5.sent();
|
|
24538
24558
|
if (steedosField.type === 'file' && fieldSchema.disabled) {
|
|
24539
24559
|
fieldValue = fieldSchema.value;
|
|
@@ -24541,7 +24561,9 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24541
24561
|
hasImageOrFile_1 = false;
|
|
24542
24562
|
_$1.forEach(fieldValue, function (item) {
|
|
24543
24563
|
var fileName = item.name;
|
|
24544
|
-
|
|
24564
|
+
var match = fileName.match(/\.([^\.]+)$/);
|
|
24565
|
+
var fileType = match ? match[0] : '';
|
|
24566
|
+
if ([".pdf", ".jpg", ".jpeg", ".png", ".gif"].indexOf(fileType) > -1) {
|
|
24545
24567
|
hasImageOrFile_1 = true;
|
|
24546
24568
|
}
|
|
24547
24569
|
});
|
|
@@ -24552,8 +24574,10 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24552
24574
|
_$1.forEach(fieldValue, function (item) {
|
|
24553
24575
|
var fileName = item.name;
|
|
24554
24576
|
var fileUrl = item.url;
|
|
24577
|
+
var match = fileName.match(/\.([^\.]+)$/);
|
|
24578
|
+
var fileType = match ? match[0] : '';
|
|
24555
24579
|
var filePreviewHtml = '';
|
|
24556
|
-
if ([".pdf", ".jpg", ".jpeg", ".png", ".gif"].indexOf(
|
|
24580
|
+
if ([".pdf", ".jpg", ".jpeg", ".png", ".gif"].indexOf(fileType) > -1) {
|
|
24557
24581
|
var indexOfQuestionMark = fileUrl.indexOf('?');
|
|
24558
24582
|
if (indexOfQuestionMark > -1) {
|
|
24559
24583
|
var filePreviewUrl = fileUrl.substring(0, indexOfQuestionMark);
|
|
@@ -24570,129 +24594,144 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24570
24594
|
}
|
|
24571
24595
|
}
|
|
24572
24596
|
return [2 /*return*/, fieldSchema];
|
|
24573
|
-
case
|
|
24597
|
+
case 18:
|
|
24574
24598
|
schema = Object.assign({}, steedosField, {
|
|
24575
24599
|
type: getAmisStaticFieldType(steedosField.type, steedosField.data_type, steedosField),
|
|
24576
24600
|
static: true,
|
|
24577
24601
|
label: steedosField.label
|
|
24578
24602
|
});
|
|
24579
|
-
if (
|
|
24580
|
-
|
|
24581
|
-
|
|
24582
|
-
|
|
24583
|
-
|
|
24584
|
-
|
|
24585
|
-
|
|
24586
|
-
|
|
24587
|
-
|
|
24588
|
-
|
|
24589
|
-
|
|
24590
|
-
}
|
|
24591
|
-
|
|
24592
|
-
|
|
24593
|
-
|
|
24594
|
-
|
|
24595
|
-
|
|
24596
|
-
|
|
24597
|
-
|
|
24598
|
-
|
|
24599
|
-
|
|
24600
|
-
|
|
24601
|
-
|
|
24602
|
-
|
|
24603
|
-
|
|
24604
|
-
|
|
24605
|
-
|
|
24606
|
-
|
|
24607
|
-
|
|
24608
|
-
|
|
24609
|
-
|
|
24610
|
-
|
|
24611
|
-
|
|
24612
|
-
|
|
24613
|
-
|
|
24614
|
-
|
|
24615
|
-
|
|
24616
|
-
|
|
24617
|
-
|
|
24618
|
-
|
|
24619
|
-
|
|
24620
|
-
|
|
24621
|
-
|
|
24622
|
-
|
|
24623
|
-
|
|
24624
|
-
|
|
24625
|
-
|
|
24626
|
-
subField = _o.value;
|
|
24627
|
-
if (!subField.name.endsWith(".$")) {
|
|
24628
|
-
subFieldName = subField.name.replace("".concat(steedosField._prefix || '').concat(steedosField.name, ".$."), '').replace("".concat(steedosField.name, "."), '');
|
|
24629
|
-
// const gridSub = await convertSFieldToAmisField(Object.assign({}, subField, {name: subFieldName, isTableField: true}), readonly, ctx);
|
|
24630
|
-
tableFields.push(Object.assign({}, subField, { name: subFieldName }));
|
|
24603
|
+
if (steedosField.type === "time" || steedosField.type === "input-time-range") {
|
|
24604
|
+
Object.assign(schema, {
|
|
24605
|
+
inputFormat: 'HH:mm',
|
|
24606
|
+
timeFormat: 'HH:mm',
|
|
24607
|
+
format: '1970-01-01THH:mm:00.000[Z]',
|
|
24608
|
+
});
|
|
24609
|
+
}
|
|
24610
|
+
else if (steedosField.type === "percent") {
|
|
24611
|
+
Object.assign(schema, {
|
|
24612
|
+
"percent": steedosField.scale ? steedosField.scale : true
|
|
24613
|
+
});
|
|
24614
|
+
}
|
|
24615
|
+
else if (steedosField.type === "password") {
|
|
24616
|
+
Object.assign(schema, {
|
|
24617
|
+
"tpl": "******"
|
|
24618
|
+
});
|
|
24619
|
+
}
|
|
24620
|
+
else if (steedosField.type === "select") {
|
|
24621
|
+
map = getSelectMap(steedosField.options);
|
|
24622
|
+
Object.assign(schema, {
|
|
24623
|
+
"placeholder": "",
|
|
24624
|
+
"map": map
|
|
24625
|
+
});
|
|
24626
|
+
}
|
|
24627
|
+
else if (steedosField.type === "color") {
|
|
24628
|
+
Object.assign(schema, {
|
|
24629
|
+
"defaultColor": null
|
|
24630
|
+
});
|
|
24631
|
+
}
|
|
24632
|
+
else if (steedosField.type === "number" || steedosField.type === 'currency') {
|
|
24633
|
+
// amis input-number和number组件中的precision表示小数位数,并不是魔方平台的精度概念,要转换下,否则小数点后会显示很多的0
|
|
24634
|
+
Object.assign(schema, {
|
|
24635
|
+
"precision": steedosField.scale || 0,
|
|
24636
|
+
"kilobitSeparator": steedosField.enable_thousands //识别enable_thousands,控制千分位分隔符
|
|
24637
|
+
});
|
|
24638
|
+
}
|
|
24639
|
+
else if (steedosField.type === "table") {
|
|
24640
|
+
if (steedosField.subFields) {
|
|
24641
|
+
tableFields = [];
|
|
24642
|
+
try {
|
|
24643
|
+
for (_m = __values(steedosField.subFields), _o = _m.next(); !_o.done; _o = _m.next()) {
|
|
24644
|
+
subField = _o.value;
|
|
24645
|
+
if (!subField.name.endsWith(".$")) {
|
|
24646
|
+
subFieldName = subField.name.replace("".concat(steedosField._prefix || '').concat(steedosField.name, ".$."), '').replace("".concat(steedosField.name, "."), '');
|
|
24647
|
+
// const gridSub = await convertSFieldToAmisField(Object.assign({}, subField, {name: subFieldName, isTableField: true}), readonly, ctx);
|
|
24648
|
+
tableFields.push(Object.assign({}, subField, { name: subFieldName }));
|
|
24649
|
+
}
|
|
24631
24650
|
}
|
|
24632
24651
|
}
|
|
24633
|
-
|
|
24634
|
-
|
|
24635
|
-
|
|
24636
|
-
|
|
24637
|
-
|
|
24652
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
24653
|
+
finally {
|
|
24654
|
+
try {
|
|
24655
|
+
if (_o && !_o.done && (_y = _m.return)) _y.call(_m);
|
|
24656
|
+
}
|
|
24657
|
+
finally { if (e_1) throw e_1.error; }
|
|
24638
24658
|
}
|
|
24639
|
-
|
|
24659
|
+
Object.assign(schema, {
|
|
24660
|
+
type: 'steedos-input-table',
|
|
24661
|
+
editable: false,
|
|
24662
|
+
addable: false,
|
|
24663
|
+
removable: false,
|
|
24664
|
+
draggable: false,
|
|
24665
|
+
fields: tableFields,
|
|
24666
|
+
amis: {
|
|
24667
|
+
columnsTogglable: false
|
|
24668
|
+
}
|
|
24669
|
+
});
|
|
24640
24670
|
}
|
|
24641
|
-
Object.assign(schema, {
|
|
24642
|
-
type: 'steedos-input-table',
|
|
24643
|
-
editable: false,
|
|
24644
|
-
addable: false,
|
|
24645
|
-
removable: false,
|
|
24646
|
-
draggable: false,
|
|
24647
|
-
fields: tableFields,
|
|
24648
|
-
amis: {
|
|
24649
|
-
columnsTogglable: false
|
|
24650
|
-
}
|
|
24651
|
-
});
|
|
24652
24671
|
}
|
|
24653
|
-
|
|
24654
|
-
|
|
24655
|
-
|
|
24656
|
-
|
|
24657
|
-
|
|
24658
|
-
|
|
24659
|
-
|
|
24660
|
-
|
|
24661
|
-
|
|
24662
|
-
value =
|
|
24672
|
+
else if (steedosField.type === "image") {
|
|
24673
|
+
Object.assign(schema, {
|
|
24674
|
+
enlargeAble: true,
|
|
24675
|
+
showToolbar: true,
|
|
24676
|
+
pipeIn: function (value, data) {
|
|
24677
|
+
if (steedosField.multiple) {
|
|
24678
|
+
if (!value) {
|
|
24679
|
+
value = [defaultImageValue];
|
|
24680
|
+
}
|
|
24681
|
+
value = value.map(function (item) {
|
|
24682
|
+
if (item && item.split("/").length === 1) {
|
|
24683
|
+
// 不是url格式时转为url格式显示
|
|
24684
|
+
return window.getImageFieldUrl(window.Meteor.absoluteUrl("/api/files/images/".concat(item)));
|
|
24685
|
+
}
|
|
24686
|
+
else {
|
|
24687
|
+
return item;
|
|
24688
|
+
}
|
|
24689
|
+
});
|
|
24663
24690
|
}
|
|
24664
|
-
|
|
24665
|
-
if (
|
|
24666
|
-
|
|
24667
|
-
return window.getImageFieldUrl(window.Meteor.absoluteUrl("/api/files/images/".concat(item)));
|
|
24691
|
+
else {
|
|
24692
|
+
if (_$1.isArray(value)) {
|
|
24693
|
+
value = value[0];
|
|
24668
24694
|
}
|
|
24669
|
-
|
|
24670
|
-
|
|
24695
|
+
if (value && value.split("/").length === 1) {
|
|
24696
|
+
// 不是url格式时转为url格式显示
|
|
24697
|
+
return window.getImageFieldUrl(window.Meteor.absoluteUrl("/api/files/images/".concat(value)));
|
|
24671
24698
|
}
|
|
24672
|
-
});
|
|
24673
|
-
}
|
|
24674
|
-
else {
|
|
24675
|
-
if (_$1.isArray(value)) {
|
|
24676
|
-
value = value[0];
|
|
24677
|
-
}
|
|
24678
|
-
if (value && value.split("/").length === 1) {
|
|
24679
|
-
// 不是url格式时转为url格式显示
|
|
24680
|
-
return window.getImageFieldUrl(window.Meteor.absoluteUrl("/api/files/images/".concat(value)));
|
|
24681
24699
|
}
|
|
24700
|
+
return value;
|
|
24682
24701
|
}
|
|
24683
|
-
|
|
24684
|
-
|
|
24685
|
-
|
|
24686
|
-
|
|
24687
|
-
|
|
24688
|
-
|
|
24689
|
-
|
|
24690
|
-
|
|
24691
|
-
|
|
24692
|
-
|
|
24693
|
-
|
|
24694
|
-
|
|
24695
|
-
|
|
24702
|
+
});
|
|
24703
|
+
}
|
|
24704
|
+
else if (steedosField.type === "file") {
|
|
24705
|
+
Object.assign(schema, {
|
|
24706
|
+
"body": [
|
|
24707
|
+
{
|
|
24708
|
+
"type": "service",
|
|
24709
|
+
"api": {
|
|
24710
|
+
"method": "post",
|
|
24711
|
+
"url": "${context.rootUrl}/graphql?file=${".concat(steedosField.name, "}"),
|
|
24712
|
+
"headers": {
|
|
24713
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
24714
|
+
},
|
|
24715
|
+
"data": {
|
|
24716
|
+
"query": "{fileData:cfs_files_filerecord(filters:[\"_id\",\"in\",${".concat(steedosField.name, "|asArray|json}]){_id,original}}")
|
|
24717
|
+
}
|
|
24718
|
+
},
|
|
24719
|
+
"body": [
|
|
24720
|
+
{
|
|
24721
|
+
"type": "each",
|
|
24722
|
+
"source": "${fileData}",
|
|
24723
|
+
"className": "flex flex-col",
|
|
24724
|
+
"items": {
|
|
24725
|
+
"type": "tpl",
|
|
24726
|
+
"tpl": "<a href='${context.rootUrl}/api/files/files/${_id}?download=true' target='_blank'>${original.name}</a>"
|
|
24727
|
+
}
|
|
24728
|
+
}
|
|
24729
|
+
]
|
|
24730
|
+
}
|
|
24731
|
+
]
|
|
24732
|
+
}, { name: "" });
|
|
24733
|
+
}
|
|
24734
|
+
else if (steedosField.type === 'formula' || steedosField.type === 'summary') {
|
|
24696
24735
|
if (steedosField.data_type === 'number' || steedosField.data_type === 'currency') {
|
|
24697
24736
|
Object.assign(schema, {
|
|
24698
24737
|
"precision": steedosField.scale || 0
|
|
@@ -24752,11 +24791,9 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24752
24791
|
disabled: true
|
|
24753
24792
|
});
|
|
24754
24793
|
}
|
|
24755
|
-
_5.label = 27;
|
|
24756
|
-
case 27:
|
|
24757
24794
|
Object.assign(schema, steedosField.amis || {});
|
|
24758
24795
|
return [2 /*return*/, schema];
|
|
24759
|
-
case
|
|
24796
|
+
case 19:
|
|
24760
24797
|
if (!ctx.className) {
|
|
24761
24798
|
ctx.className = className;
|
|
24762
24799
|
}
|
|
@@ -24817,16 +24854,16 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24817
24854
|
}
|
|
24818
24855
|
}
|
|
24819
24856
|
return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
|
|
24820
|
-
case
|
|
24857
|
+
case 20:
|
|
24821
24858
|
schema = _5.sent();
|
|
24822
24859
|
// console.log(`AmisSteedosField return schema`, schema)
|
|
24823
24860
|
return [2 /*return*/, schema];
|
|
24824
|
-
case
|
|
24825
|
-
case
|
|
24861
|
+
case 21: return [3 /*break*/, 23];
|
|
24862
|
+
case 22:
|
|
24826
24863
|
error_1 = _5.sent();
|
|
24827
24864
|
console.log("error", error_1);
|
|
24828
|
-
return [3 /*break*/,
|
|
24829
|
-
case
|
|
24865
|
+
return [3 /*break*/, 23];
|
|
24866
|
+
case 23: return [2 /*return*/, null];
|
|
24830
24867
|
}
|
|
24831
24868
|
});
|
|
24832
24869
|
}); };
|