@steedos-widgets/amis-object 3.6.4-beta.1 → 3.6.4-beta.2
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/AmisInputTable.d.ts +4 -0
- package/dist/amis/AmisRecordDetailHeader.d.ts +24 -0
- package/dist/amis-object.cjs.css +63 -14
- package/dist/amis-object.cjs.js +273 -63
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +63 -14
- package/dist/amis-object.esm.js +274 -64
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +63 -14
- package/dist/amis-object.umd.js +106 -89
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +21 -21
- package/package.json +3 -3
package/dist/amis-object.esm.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { createContext, useState, useEffect, createElement } from 'react';
|
|
2
2
|
import * as _$1 from 'lodash';
|
|
3
|
-
import _$1__default, { isEmpty, isArray, each, find, endsWith, cloneDeep, toArray, mergeWith, isString, union, has, map, slice, defaultsDeep as defaultsDeep$1, includes, clone, filter, omitBy, isNil, get as get$1, isObject as isObject$1,
|
|
3
|
+
import _$1__default, { isEmpty, isArray, each, find, endsWith, cloneDeep, forEach, toArray, mergeWith, isString, union, has, map, slice, defaultsDeep as defaultsDeep$1, includes, clone, filter, omitBy, isNil, get as get$1, isObject as isObject$1, trimEnd, isBoolean, startsWith, isFunction, compact, difference, keys, pick, first, values, pickBy, random, assign } from 'lodash';
|
|
4
4
|
import { Dropdown, Image, Tabs, Spin, Badge, Skeleton, Modal as Modal$1, message, notification, Button, Space, Drawer as Drawer$1 } from 'antd';
|
|
5
5
|
import ReactDOM, { createRoot } from 'react-dom';
|
|
6
6
|
|
|
@@ -3637,7 +3637,7 @@ function getComparableAmisVersion() {
|
|
|
3637
3637
|
* @Author: baozhoutao@steedos.com
|
|
3638
3638
|
* @Date: 2022-05-23 09:53:08
|
|
3639
3639
|
* @LastEditors: baozhoutao@steedos.com
|
|
3640
|
-
* @LastEditTime: 2024-02-
|
|
3640
|
+
* @LastEditTime: 2024-02-21 17:19:30
|
|
3641
3641
|
* @Description:
|
|
3642
3642
|
*/
|
|
3643
3643
|
|
|
@@ -3723,7 +3723,7 @@ function getNameTpl(field, ctx){
|
|
|
3723
3723
|
if(ctx && ctx.isLookup){
|
|
3724
3724
|
linkTarget = "target='_blank'";
|
|
3725
3725
|
}
|
|
3726
|
-
if(ctx.isRelated){
|
|
3726
|
+
if(ctx.isRelated && window.innerWidth >= 768){
|
|
3727
3727
|
return `<a href="${href}" ${linkTarget} onclick="return false;">\${${field.name} | raw}</a>`
|
|
3728
3728
|
}else {
|
|
3729
3729
|
return `<a href="${href}" ${linkTarget}>\${${field.name} | raw}</a>`
|
|
@@ -3781,7 +3781,7 @@ function getRelatedFieldTpl(field, ctx){
|
|
|
3781
3781
|
const href = Router$1.getObjectDetailPath({
|
|
3782
3782
|
formFactor: ctx.formFactor, appId: "${appId}", objectName: `${objectNameTpl}`, recordId: `${recordIdTpl}`
|
|
3783
3783
|
});
|
|
3784
|
-
if(ctx.isRelated){
|
|
3784
|
+
if(ctx.isRelated && window.innerWidth >= 768){
|
|
3785
3785
|
labelTpl = `<a href="${href}" ${linkTarget} onclick="return false;">${labelTpl}</a>`;
|
|
3786
3786
|
}else {
|
|
3787
3787
|
labelTpl = `<a href="${href}" ${linkTarget}>${labelTpl}</a>`;
|
|
@@ -5438,7 +5438,7 @@ async function getTableColumns$1(fields, options){
|
|
|
5438
5438
|
columnItem.defaultColor = null;
|
|
5439
5439
|
}
|
|
5440
5440
|
|
|
5441
|
-
if(((field.is_name || field.name === options.labelFieldName) || ((field.type == 'lookup' || field.type == 'master_detail') && _$1.isString(field.reference_to) && field.multiple != true)) && options.isRelated){
|
|
5441
|
+
if(window.innerWidth >= 768 && ((field.is_name || field.name === options.labelFieldName) || ((field.type == 'lookup' || field.type == 'master_detail') && _$1.isString(field.reference_to) && field.multiple != true)) && options.isRelated){
|
|
5442
5442
|
|
|
5443
5443
|
const drawerRecordDetailSchema = {
|
|
5444
5444
|
"type": "steedos-record-detail",
|
|
@@ -5466,16 +5466,17 @@ async function getTableColumns$1(fields, options){
|
|
|
5466
5466
|
"drawer": {
|
|
5467
5467
|
"type": "drawer",
|
|
5468
5468
|
"title": " ",
|
|
5469
|
-
"headerClassName": "",
|
|
5469
|
+
"headerClassName": "hidden",
|
|
5470
5470
|
"size": "lg",
|
|
5471
|
-
"bodyClassName": "p-0 m-0
|
|
5471
|
+
"bodyClassName": "p-0 m-0",
|
|
5472
5472
|
"closeOnEsc": true,
|
|
5473
|
+
"closeOnOutside": true,
|
|
5473
5474
|
"resizable": true,
|
|
5474
5475
|
"actions": [],
|
|
5475
5476
|
"body": [
|
|
5476
5477
|
drawerRecordDetailSchema
|
|
5477
5478
|
],
|
|
5478
|
-
"className": "app-popover",
|
|
5479
|
+
"className": "steedos-record-detail-drawer app-popover",
|
|
5479
5480
|
"id": "u:fc5f055afa8c"
|
|
5480
5481
|
},
|
|
5481
5482
|
"preventDefault": true
|
|
@@ -5533,7 +5534,7 @@ function getMobileLines(tpls){
|
|
|
5533
5534
|
let isNewLine = false;
|
|
5534
5535
|
let isLeft = true;
|
|
5535
5536
|
let lineChildrenClassName = "";
|
|
5536
|
-
let lineClassName = "flex items-center justify-between";
|
|
5537
|
+
let lineClassName = "flex items-center justify-between mb-1";
|
|
5537
5538
|
tpls.forEach(function(item){
|
|
5538
5539
|
if(isNewLine && lines.length < maxLineCount){
|
|
5539
5540
|
lines.push({
|
|
@@ -8833,44 +8834,46 @@ const getObjectDetailButtonsSchemas = (objectSchema, recordId, ctx)=>{
|
|
|
8833
8834
|
}
|
|
8834
8835
|
});
|
|
8835
8836
|
|
|
8836
|
-
return
|
|
8837
|
-
|
|
8838
|
-
|
|
8839
|
-
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8847
|
-
|
|
8848
|
-
|
|
8849
|
-
|
|
8850
|
-
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
8837
|
+
return [
|
|
8838
|
+
{
|
|
8839
|
+
"type": "button",
|
|
8840
|
+
"icon": "fa fa-angle-down",
|
|
8841
|
+
"visibleOn": phoneMoreButtonsVisibleOn,
|
|
8842
|
+
"onEvent": {
|
|
8843
|
+
"click": {
|
|
8844
|
+
"actions": [
|
|
8845
|
+
{
|
|
8846
|
+
"actionType": "drawer",
|
|
8847
|
+
"drawer": {
|
|
8848
|
+
"type": "drawer",
|
|
8849
|
+
"title": instance.t('frontend_operation'),
|
|
8850
|
+
"id": "object_actions_drawer_" + objectSchema.name,
|
|
8851
|
+
"body": [
|
|
8852
|
+
{
|
|
8853
|
+
"type": "button-group",
|
|
8854
|
+
"id": "u:fd837823be5b",
|
|
8855
|
+
"vertical": true,
|
|
8856
|
+
"tiled": true,
|
|
8857
|
+
"buttons": dropdownButtons,
|
|
8858
|
+
"btnLevel": "enhance",
|
|
8859
|
+
"className": "w-full",
|
|
8860
|
+
"btnClassName": "w-full",
|
|
8861
|
+
"size": "lg"
|
|
8862
|
+
}
|
|
8863
|
+
],
|
|
8864
|
+
"position": "bottom",
|
|
8865
|
+
"closeOnOutside": true,
|
|
8866
|
+
"resizable": false,
|
|
8867
|
+
"className": "buttons-drawer",
|
|
8868
|
+
"bodyClassName": "m-none p-none",
|
|
8869
|
+
"actions": []
|
|
8860
8870
|
}
|
|
8861
|
-
|
|
8862
|
-
|
|
8863
|
-
"closeOnOutside": true,
|
|
8864
|
-
"resizable": false,
|
|
8865
|
-
"className": "buttons-drawer",
|
|
8866
|
-
"bodyClassName": "m-none p-none",
|
|
8867
|
-
"actions": []
|
|
8868
|
-
}
|
|
8871
|
+
}
|
|
8872
|
+
]
|
|
8869
8873
|
}
|
|
8870
|
-
|
|
8874
|
+
}
|
|
8871
8875
|
}
|
|
8872
|
-
|
|
8873
|
-
}
|
|
8876
|
+
]
|
|
8874
8877
|
}else {
|
|
8875
8878
|
if(moreButtons.length > 0){
|
|
8876
8879
|
const dropdownButtonsSchema = {
|
|
@@ -9939,6 +9942,33 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
|
9939
9942
|
amisButtonsSchema = getObjectDetailButtonsSchemas(objectSchema, recordId, options);
|
|
9940
9943
|
}
|
|
9941
9944
|
|
|
9945
|
+
amisButtonsSchema.push(
|
|
9946
|
+
{
|
|
9947
|
+
"type": "button",
|
|
9948
|
+
"visibleOn": "${_inDrawer === true || _inRecordMini === true}",
|
|
9949
|
+
"className":"ant-dropdown-trigger slds-button slds-button_icon slds-button_icon-border-filled slds-button_icon-x-small slds-icon ml-1 flex",
|
|
9950
|
+
"onEvent": {
|
|
9951
|
+
"click": {
|
|
9952
|
+
"actions": [
|
|
9953
|
+
{
|
|
9954
|
+
"actionType": "custom",
|
|
9955
|
+
"script": "const data = event.data; window.open(`/app/${data.app_id}/${data.objectName}/view/${data.recordId}?side_object=${data.side_object}&side_listview_id=${data.side_listview_id}`)"
|
|
9956
|
+
}
|
|
9957
|
+
]
|
|
9958
|
+
}
|
|
9959
|
+
},
|
|
9960
|
+
"body": [
|
|
9961
|
+
{
|
|
9962
|
+
"type": "steedos-icon",
|
|
9963
|
+
"category": "utility",
|
|
9964
|
+
"name": "new_window",
|
|
9965
|
+
"colorVariant": "default",
|
|
9966
|
+
"className": "slds-button_icon slds-global-header__icon w-4"
|
|
9967
|
+
}
|
|
9968
|
+
]
|
|
9969
|
+
}
|
|
9970
|
+
);
|
|
9971
|
+
|
|
9942
9972
|
let backButtonsSchema = null;
|
|
9943
9973
|
|
|
9944
9974
|
if(options.showBackButton != false){
|
|
@@ -9959,7 +9989,32 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
|
9959
9989
|
"columns": [
|
|
9960
9990
|
{
|
|
9961
9991
|
"body": [
|
|
9962
|
-
backButtonsSchema
|
|
9992
|
+
backButtonsSchema,
|
|
9993
|
+
{
|
|
9994
|
+
"type": "button",
|
|
9995
|
+
"visibleOn": "${_inDrawer === true}",
|
|
9996
|
+
"className":"flex mr-4",
|
|
9997
|
+
"onEvent": {
|
|
9998
|
+
"click": {
|
|
9999
|
+
"actions": [
|
|
10000
|
+
{
|
|
10001
|
+
"componentId": "",
|
|
10002
|
+
"args": {},
|
|
10003
|
+
"actionType": "closeDrawer"
|
|
10004
|
+
}
|
|
10005
|
+
]
|
|
10006
|
+
}
|
|
10007
|
+
},
|
|
10008
|
+
"body": [
|
|
10009
|
+
{
|
|
10010
|
+
"type": "steedos-icon",
|
|
10011
|
+
"category": "utility",
|
|
10012
|
+
"name": "close",
|
|
10013
|
+
"colorVariant": "default",
|
|
10014
|
+
"className": "slds-button_icon slds-global-header__icon w-4"
|
|
10015
|
+
}
|
|
10016
|
+
]
|
|
10017
|
+
}
|
|
9963
10018
|
,{
|
|
9964
10019
|
"type": "tpl",
|
|
9965
10020
|
"className": "block",
|
|
@@ -10174,10 +10229,10 @@ async function getObjectRecordDetailRelatedListHeader(relatedObjectSchema, relat
|
|
|
10174
10229
|
"md": "auto"
|
|
10175
10230
|
}
|
|
10176
10231
|
],
|
|
10177
|
-
"className": "flex justify-between"
|
|
10232
|
+
"className": "flex justify-between min-h-8 items-center"
|
|
10178
10233
|
}
|
|
10179
10234
|
],
|
|
10180
|
-
"className": "steedos-record-related-header py-2 px-3 bg-gray-50 border"
|
|
10235
|
+
"className": "steedos-record-related-header py-2 px-3 bg-gray-50 border rounded"
|
|
10181
10236
|
};
|
|
10182
10237
|
return recordRelatedListHeader;
|
|
10183
10238
|
}
|
|
@@ -14887,6 +14942,33 @@ async function getApi(object, recordId, fields, options){
|
|
|
14887
14942
|
}
|
|
14888
14943
|
}
|
|
14889
14944
|
|
|
14945
|
+
async function getAutoFill(field, refObject) {
|
|
14946
|
+
let autoFillMapping = field.auto_fill_mapping;
|
|
14947
|
+
if (autoFillMapping && autoFillMapping.length) {
|
|
14948
|
+
let fillMapping = {};
|
|
14949
|
+
let fieldsForApi = [];
|
|
14950
|
+
autoFillMapping.forEach(function (item) {
|
|
14951
|
+
fillMapping[item.to] = `\${${item.from}}`;
|
|
14952
|
+
fieldsForApi.push(item.from);
|
|
14953
|
+
});
|
|
14954
|
+
// let api = {
|
|
14955
|
+
// // "url": "/amis/api/mock2/form/autoUpdate?browser=${browser}&version=${version}",
|
|
14956
|
+
// "url": `/api/v1/${refObject.name}/\${${field.name}}?fields=${JSON.stringify(fieldsForApi)}`,
|
|
14957
|
+
// // "responseData": {
|
|
14958
|
+
// // "name": "${name}"
|
|
14959
|
+
// // },
|
|
14960
|
+
// "silent": false
|
|
14961
|
+
// }
|
|
14962
|
+
// return {
|
|
14963
|
+
// fillMapping,
|
|
14964
|
+
// // api
|
|
14965
|
+
// }
|
|
14966
|
+
// 因为autoFill中配置了api的话,在表单初始化(比如新建记录)时并不会触发执行autoFill,所以只能暂时不用api
|
|
14967
|
+
// 给amis报过问题了,见:https://github.com/baidu/amis/issues/9631
|
|
14968
|
+
return fillMapping;
|
|
14969
|
+
}
|
|
14970
|
+
}
|
|
14971
|
+
|
|
14890
14972
|
async function lookupToAmis(field, readonly, ctx){
|
|
14891
14973
|
if(!ctx){
|
|
14892
14974
|
ctx = {};
|
|
@@ -14970,6 +15052,10 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
14970
15052
|
amisSchema = _$1.defaultsDeep({}, pageAmisSchema, amisSchema);
|
|
14971
15053
|
}
|
|
14972
15054
|
}
|
|
15055
|
+
const autoFill = await getAutoFill(field);
|
|
15056
|
+
if(autoFill){
|
|
15057
|
+
amisSchema.autoFill = autoFill;
|
|
15058
|
+
}
|
|
14973
15059
|
return amisSchema;
|
|
14974
15060
|
}
|
|
14975
15061
|
|
|
@@ -15145,6 +15231,7 @@ const getMarkdownFieldSchema = (field, readonly, ctx)=>{
|
|
|
15145
15231
|
{
|
|
15146
15232
|
"type": "editor",
|
|
15147
15233
|
"name": field.name,
|
|
15234
|
+
"labelClassName": "none",
|
|
15148
15235
|
"language": "markdown",
|
|
15149
15236
|
}
|
|
15150
15237
|
]
|
|
@@ -17642,7 +17729,9 @@ async function getButtonNew(props) {
|
|
|
17642
17729
|
"actions": await getButtonActions(props, "new")
|
|
17643
17730
|
}
|
|
17644
17731
|
},
|
|
17645
|
-
"level": "
|
|
17732
|
+
"level": "link",
|
|
17733
|
+
"className": "text-gray-500",
|
|
17734
|
+
"size": "xs"
|
|
17646
17735
|
};
|
|
17647
17736
|
}
|
|
17648
17737
|
|
|
@@ -17652,6 +17741,7 @@ async function getButtonEdit(props, showAsInlineEditMode) {
|
|
|
17652
17741
|
"label": "",
|
|
17653
17742
|
"icon": `fa fa-${showAsInlineEditMode ? "expand-alt" : "pencil"}`,//inline edit模式时显示为放开按钮,只读时显示为笔按钮
|
|
17654
17743
|
"level": "link",
|
|
17744
|
+
"className": "text-gray-400",
|
|
17655
17745
|
"onEvent": {
|
|
17656
17746
|
"click": {
|
|
17657
17747
|
"actions": await getButtonActions(props, "edit")
|
|
@@ -17666,6 +17756,7 @@ async function getButtonView(props) {
|
|
|
17666
17756
|
"label": "",
|
|
17667
17757
|
"icon": "fa fa-expand-alt",//fa-external-link
|
|
17668
17758
|
"level": "link",
|
|
17759
|
+
"className": "text-gray-400",
|
|
17669
17760
|
"onEvent": {
|
|
17670
17761
|
"click": {
|
|
17671
17762
|
"actions": await getButtonActions(props, "readonly")
|
|
@@ -17678,6 +17769,7 @@ async function getButtonDelete(props) {
|
|
|
17678
17769
|
return {
|
|
17679
17770
|
"type": "dropdown-button",
|
|
17680
17771
|
"level": "link",
|
|
17772
|
+
"btnClassName": "text-gray-400",
|
|
17681
17773
|
"icon": "fa fa-trash-alt",
|
|
17682
17774
|
"size": "xs",
|
|
17683
17775
|
"hideCaret": true,
|
|
@@ -17912,6 +18004,10 @@ const getAmisInputTableSchema = async (props) => {
|
|
|
17912
18004
|
"labelAlign": props.labelAlign,
|
|
17913
18005
|
//控制control的mode属性,https://aisuda.bce.baidu.com/amis/zh-CN/components/form/formitem#表单项展示
|
|
17914
18006
|
"mode": props.mode || null,
|
|
18007
|
+
"visibleOn": props.$schema.visibleOn,
|
|
18008
|
+
"visible": props.$schema.visible,
|
|
18009
|
+
"hiddenOn": props.$schema.hiddenOn,
|
|
18010
|
+
"hidden": props.$schema.hidden,
|
|
17915
18011
|
className
|
|
17916
18012
|
};
|
|
17917
18013
|
// console.log("===schema===", schema);
|
|
@@ -20584,11 +20680,15 @@ var index_esm$1 = /*#__PURE__*/Object.freeze({
|
|
|
20584
20680
|
getButtonVisibleOn: getButtonVisibleOn,
|
|
20585
20681
|
getButtons: getButtons,
|
|
20586
20682
|
getCalendarSchema: getCalendarSchema,
|
|
20683
|
+
getCreatedInfoTpl: getCreatedInfoTpl,
|
|
20684
|
+
getDateTimeTpl: getDateTimeTpl,
|
|
20685
|
+
getDateTpl: getDateTpl,
|
|
20587
20686
|
getDefaultRenderData: getDefaultRenderData,
|
|
20588
20687
|
getEnv: getEnv,
|
|
20589
20688
|
getEnvs: getEnvs,
|
|
20590
20689
|
getEvn: getEvn,
|
|
20591
20690
|
getField: getField,
|
|
20691
|
+
getFieldTpl: getFieldTpl,
|
|
20592
20692
|
getFileSrc: getFileSrc,
|
|
20593
20693
|
getFlowFormSchema: getFlowFormSchema,
|
|
20594
20694
|
getFormPageInitSchema: getFormPageInitSchema,
|
|
@@ -20605,8 +20705,14 @@ var index_esm$1 = /*#__PURE__*/Object.freeze({
|
|
|
20605
20705
|
getListViewItemButtons: getListViewItemButtons,
|
|
20606
20706
|
getListViewSort: getListViewSort,
|
|
20607
20707
|
getListviewInitSchema: getListviewInitSchema,
|
|
20708
|
+
getLocationTpl: getLocationTpl,
|
|
20608
20709
|
getLookupSapceUserTreeSchema: getLookupSapceUserTreeSchema,
|
|
20710
|
+
getLookupTpl: getLookupTpl,
|
|
20711
|
+
getModifiedInfoTpl: getModifiedInfoTpl,
|
|
20712
|
+
getNameTpl: getNameTpl,
|
|
20713
|
+
getNameTplUrl: getNameTplUrl,
|
|
20609
20714
|
getNotifications: getNotifications,
|
|
20715
|
+
getNumberTpl: getNumberTpl,
|
|
20610
20716
|
getObjectDetailButtons: getObjectDetailButtons,
|
|
20611
20717
|
getObjectDetailButtonsSchemas: getObjectDetailButtonsSchemas,
|
|
20612
20718
|
getObjectDetailMoreButtons: getObjectDetailMoreButtons,
|
|
@@ -20627,6 +20733,7 @@ var index_esm$1 = /*#__PURE__*/Object.freeze({
|
|
|
20627
20733
|
getObjectRelatedListHeader: getObjectRelatedListHeader,
|
|
20628
20734
|
getObjectRelatedListsMiniSchema: getObjectRelatedListsMiniSchema,
|
|
20629
20735
|
getPage: getPage,
|
|
20736
|
+
getPasswordTpl: getPasswordTpl,
|
|
20630
20737
|
getRecord: getRecord,
|
|
20631
20738
|
getRecordDetailHeaderSchema: getRecordDetailHeaderSchema,
|
|
20632
20739
|
getRecordDetailMiniSchema: getRecordDetailMiniSchema,
|
|
@@ -20635,21 +20742,29 @@ var index_esm$1 = /*#__PURE__*/Object.freeze({
|
|
|
20635
20742
|
getRecordPageInitSchema: getRecordPageInitSchema,
|
|
20636
20743
|
getRecordPermissions: getRecordPermissions,
|
|
20637
20744
|
getRecordServiceSchema: getRecordServiceSchema,
|
|
20745
|
+
getRefObjectNameFieldName: getRefObjectNameFieldName,
|
|
20638
20746
|
getReferenceTo: getReferenceTo,
|
|
20639
20747
|
getReferenceToFieldSchema: getReferenceToFieldSchema,
|
|
20640
20748
|
getReferenceToSync: getReferenceToSync,
|
|
20749
|
+
getRelatedFieldTpl: getRelatedFieldTpl,
|
|
20641
20750
|
getRelatedFieldValue: getRelatedFieldValue,
|
|
20642
20751
|
getRelatedListSchema: getRelatedListSchema,
|
|
20643
20752
|
getRelatedsCount: getRelatedsCount,
|
|
20644
20753
|
getRootUrl: getRootUrl,
|
|
20754
|
+
getSelectMap: getSelectMap,
|
|
20755
|
+
getSelectTpl: getSelectTpl,
|
|
20645
20756
|
getSelectUserSchema: getSelectUserSchema,
|
|
20646
20757
|
getSpaceUsersPickerAmisSchema: getSpaceUsersPickerAmisSchema,
|
|
20647
20758
|
getSpaceUsersPickerSchema: getSpaceUsersPickerSchema,
|
|
20648
20759
|
getSteedosAuth: getSteedosAuth,
|
|
20760
|
+
getSwitchTpl: getSwitchTpl,
|
|
20649
20761
|
getTableSchema: getTableSchema,
|
|
20650
20762
|
getTenantId: getTenantId,
|
|
20763
|
+
getTimeTpl: getTimeTpl,
|
|
20651
20764
|
getUISchema: getUISchema,
|
|
20652
20765
|
getUISchemaSync: getUISchemaSync$1,
|
|
20766
|
+
getUiFieldTpl: getUiFieldTpl,
|
|
20767
|
+
getUiFileSizeTpl: getUiFileSizeTpl,
|
|
20653
20768
|
getUserId: getUserId,
|
|
20654
20769
|
getViewSchema: getViewSchema,
|
|
20655
20770
|
isExpression: isExpression$1,
|
|
@@ -23001,10 +23116,58 @@ function getAmisStaticFieldType(type, data_type, options) {
|
|
|
23001
23116
|
else if (type === 'textarea') {
|
|
23002
23117
|
return 'static';
|
|
23003
23118
|
}
|
|
23119
|
+
else if (type === 'html') {
|
|
23120
|
+
return 'input-rich-text';
|
|
23121
|
+
}
|
|
23122
|
+
else if (type === 'markdown') {
|
|
23123
|
+
return 'static-markdown';
|
|
23124
|
+
}
|
|
23125
|
+
else if (type === 'select') {
|
|
23126
|
+
return 'static-mapping';
|
|
23127
|
+
}
|
|
23128
|
+
else if (type === 'color') {
|
|
23129
|
+
return 'static-color';
|
|
23130
|
+
}
|
|
23004
23131
|
return type;
|
|
23005
23132
|
}
|
|
23133
|
+
var REFERENCE_VALUE_ITEM_ONCLICK = {
|
|
23134
|
+
"click": {
|
|
23135
|
+
"actions": [
|
|
23136
|
+
{
|
|
23137
|
+
"actionType": "drawer",
|
|
23138
|
+
"drawer": {
|
|
23139
|
+
"type": "drawer",
|
|
23140
|
+
"title": " ",
|
|
23141
|
+
"headerClassName": "hidden",
|
|
23142
|
+
"size": "lg",
|
|
23143
|
+
"bodyClassName": "p-0 m-0",
|
|
23144
|
+
"closeOnEsc": true,
|
|
23145
|
+
"closeOnOutside": true,
|
|
23146
|
+
"resizable": true,
|
|
23147
|
+
"actions": [],
|
|
23148
|
+
"body": [
|
|
23149
|
+
{
|
|
23150
|
+
"type": "steedos-record-detail",
|
|
23151
|
+
"objectApiName": "${objectName}",
|
|
23152
|
+
"recordId": "${value}",
|
|
23153
|
+
"showBackButton": false,
|
|
23154
|
+
"showButtons": true,
|
|
23155
|
+
"data": {
|
|
23156
|
+
"_inDrawer": true,
|
|
23157
|
+
"recordLoaded": false, // 重置数据加载状态
|
|
23158
|
+
}
|
|
23159
|
+
}
|
|
23160
|
+
],
|
|
23161
|
+
"className": "steedos-record-detail-drawer app-popover",
|
|
23162
|
+
"id": "u:fc5f055afa8c"
|
|
23163
|
+
},
|
|
23164
|
+
"preventDefault": true
|
|
23165
|
+
}
|
|
23166
|
+
]
|
|
23167
|
+
}
|
|
23168
|
+
};
|
|
23006
23169
|
var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
23007
|
-
var steedosField, field, _a, readonly, _b, ctx, config, fStatic, env, inInputTable, className, defaultSource, source, fieldBaseProps, referenceTo_1, fieldValue, fieldRefObject, disPlayValue, res, valueOptions_1, fieldValue, values, disPlayValue_1, schema, fieldSchema, fieldValue, hasImageOrFile_1, fieldHtml_1, schema, tableFields, _c, _d, subField, subFieldName, fieldAmis, schema, error_1;
|
|
23170
|
+
var steedosField, field, _a, readonly, _b, ctx, config, fStatic, env, inInputTable, className, lookupATagClick, defaultSource, source, fieldBaseProps, referenceTo_1, fieldValue, fieldRefObject, disPlayValue, res, valueOptions_1, fieldValue, values, disPlayValue_1, schema, fieldSchema, fieldValue, hasImageOrFile_1, fieldHtml_1, schema, map, tableFields, _c, _d, subField, subFieldName, fieldAmis, schema, error_1;
|
|
23008
23171
|
var _e, e_1, _f;
|
|
23009
23172
|
var _g, _h, _j, _k, _l, _m;
|
|
23010
23173
|
return __generator(this, function (_o) {
|
|
@@ -23043,6 +23206,10 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
23043
23206
|
case 1:
|
|
23044
23207
|
_o.trys.push([1, 24, , 25]);
|
|
23045
23208
|
if (!(fStatic && (steedosField.type === 'lookup' || steedosField.type === 'master_detail'))) return [3 /*break*/, 7];
|
|
23209
|
+
lookupATagClick = 'onclick="return false;"';
|
|
23210
|
+
if (window.innerWidth < 768) {
|
|
23211
|
+
lookupATagClick = "";
|
|
23212
|
+
}
|
|
23046
23213
|
defaultSource = {
|
|
23047
23214
|
"method": "post",
|
|
23048
23215
|
"url": "${context.rootUrl}/graphql",
|
|
@@ -23119,8 +23286,8 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
23119
23286
|
labelClassName: "hidden",
|
|
23120
23287
|
label: false,
|
|
23121
23288
|
className: 'm-0',
|
|
23122
|
-
tpl: "<a href=\"/app/-/${objectName}/view/${value}\" target=\"_blank\">${label}</a>",
|
|
23123
|
-
popOver: fieldRefObject.compactLayouts ? {
|
|
23289
|
+
tpl: "<a href=\"/app/-/${objectName}/view/${value}\" target=\"_blank\" ".concat(lookupATagClick, ">${label}</a>"),
|
|
23290
|
+
popOver: fieldRefObject.compactLayouts && window.innerWidth >= 768 ? {
|
|
23124
23291
|
"trigger": "hover",
|
|
23125
23292
|
"className": "steedos-record-detail-popover",
|
|
23126
23293
|
"position": "left-bottom",
|
|
@@ -23139,11 +23306,12 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
23139
23306
|
"showBackButton": false,
|
|
23140
23307
|
"data": {
|
|
23141
23308
|
"objectName": "${objectName}",
|
|
23142
|
-
"recordId": "${value}"
|
|
23309
|
+
"recordId": "${value}",
|
|
23143
23310
|
}
|
|
23144
23311
|
}
|
|
23145
23312
|
]
|
|
23146
|
-
} : null
|
|
23313
|
+
} : null,
|
|
23314
|
+
onEvent: window.innerWidth < 768 ? null : REFERENCE_VALUE_ITEM_ONCLICK
|
|
23147
23315
|
}
|
|
23148
23316
|
}
|
|
23149
23317
|
]
|
|
@@ -23192,8 +23360,8 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
23192
23360
|
items: {
|
|
23193
23361
|
type: 'static',
|
|
23194
23362
|
className: 'm-0',
|
|
23195
|
-
tpl: "<a href=\"/app/-/${objectName}/view/${value}\" target=\"_blank\">${label}</a>",
|
|
23196
|
-
popOver: fieldRefObject.compactLayouts ? {
|
|
23363
|
+
tpl: "<a href=\"/app/-/${objectName}/view/${value}\" target=\"_blank\" ".concat(lookupATagClick, ">${label}</a>"),
|
|
23364
|
+
popOver: fieldRefObject.compactLayouts && window.innerWidth >= 768 ? {
|
|
23197
23365
|
"trigger": "hover",
|
|
23198
23366
|
"className": "steedos-record-detail-popover",
|
|
23199
23367
|
"position": "left-bottom",
|
|
@@ -23212,11 +23380,12 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
23212
23380
|
"showBackButton": false,
|
|
23213
23381
|
"data": {
|
|
23214
23382
|
"objectName": "${objectName}",
|
|
23215
|
-
"recordId": "${value}"
|
|
23383
|
+
"recordId": "${value}",
|
|
23216
23384
|
}
|
|
23217
23385
|
}
|
|
23218
23386
|
]
|
|
23219
|
-
} : null
|
|
23387
|
+
} : null,
|
|
23388
|
+
onEvent: window.innerWidth < 768 ? null : REFERENCE_VALUE_ITEM_ONCLICK
|
|
23220
23389
|
}
|
|
23221
23390
|
}
|
|
23222
23391
|
]
|
|
@@ -23299,8 +23468,10 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
23299
23468
|
return [3 /*break*/, 20];
|
|
23300
23469
|
case 12:
|
|
23301
23470
|
if (!(steedosField.type === "select")) return [3 /*break*/, 13];
|
|
23471
|
+
map = getSelectMap(steedosField.options);
|
|
23302
23472
|
Object.assign(schema, {
|
|
23303
|
-
"placeholder": ""
|
|
23473
|
+
"placeholder": "",
|
|
23474
|
+
"map": map
|
|
23304
23475
|
});
|
|
23305
23476
|
return [3 /*break*/, 20];
|
|
23306
23477
|
case 13:
|
|
@@ -23403,6 +23574,36 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
23403
23574
|
tpl: "<%=(data.".concat(steedosField.name, " || \"\").split(\"\\n\").join('<br>')%>")
|
|
23404
23575
|
});
|
|
23405
23576
|
}
|
|
23577
|
+
else if (steedosField.type === 'html') {
|
|
23578
|
+
Object.assign(schema, {
|
|
23579
|
+
"receiver": "${context.rootUrl}/s3/images",
|
|
23580
|
+
"options": {
|
|
23581
|
+
"menu": {
|
|
23582
|
+
"insert": {
|
|
23583
|
+
"title": "Insert",
|
|
23584
|
+
"items": "image link media addcomment pageembed codesample inserttable | charmap emoticons hr | pagebreak nonbreaking anchor tableofcontents | insertdatetime"
|
|
23585
|
+
}
|
|
23586
|
+
},
|
|
23587
|
+
"plugins": [
|
|
23588
|
+
"autoresize"
|
|
23589
|
+
],
|
|
23590
|
+
// "max_height": 2000,
|
|
23591
|
+
"statusbar": false,
|
|
23592
|
+
"readonly": true,
|
|
23593
|
+
"toolbar": false,
|
|
23594
|
+
"menubar": false
|
|
23595
|
+
}
|
|
23596
|
+
});
|
|
23597
|
+
}
|
|
23598
|
+
else if (steedosField.type === 'markdown') {
|
|
23599
|
+
Object.assign(schema, {
|
|
23600
|
+
"options": {
|
|
23601
|
+
"linkify": true,
|
|
23602
|
+
"html": true,
|
|
23603
|
+
"breaks": true
|
|
23604
|
+
}
|
|
23605
|
+
});
|
|
23606
|
+
}
|
|
23406
23607
|
_o.label = 20;
|
|
23407
23608
|
case 20:
|
|
23408
23609
|
Object.assign(schema, steedosField.amis || {});
|
|
@@ -23716,12 +23917,18 @@ var AmisInstanceDetail = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
23716
23917
|
}); };
|
|
23717
23918
|
|
|
23718
23919
|
var AmisInputTable = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
23719
|
-
var amisSchema;
|
|
23920
|
+
var extendProps, amisSchema;
|
|
23720
23921
|
return __generator(this, function (_a) {
|
|
23721
23922
|
switch (_a.label) {
|
|
23722
23923
|
case 0:
|
|
23723
|
-
props.$schema, props.fields, props.name, props.id, props.data, props.columns, props.amis, props.className, props.tableClassName, props.headerToolbar, props.footerToolbar, props.inlineEditMode, props.strictMode, props.dialog, props.primaryKey, props.showOperation, props.fieldPrefix, props.autoGeneratePrimaryKeyValue, props.mode;
|
|
23724
|
-
|
|
23924
|
+
props.$schema, props.fields, props.name, props.id, props.data, props.columns, props.amis, props.className, props.tableClassName, props.headerToolbar, props.footerToolbar, props.inlineEditMode, props.strictMode, props.dialog, props.primaryKey, props.showOperation, props.fieldPrefix, props.autoGeneratePrimaryKeyValue, props.mode, props.disabledOn, props.disabled, props.visibleOn, props.visible, props.hiddenOn, props.hidden;
|
|
23925
|
+
extendProps = {};
|
|
23926
|
+
if (props.disabledOn || props.disabled) {
|
|
23927
|
+
extendProps["addable"] = false;
|
|
23928
|
+
extendProps["editable"] = false;
|
|
23929
|
+
extendProps["removable"] = false;
|
|
23930
|
+
}
|
|
23931
|
+
return [4 /*yield*/, getAmisInputTableSchema(Object.assign({}, props, extendProps))];
|
|
23725
23932
|
case 1:
|
|
23726
23933
|
amisSchema = _a.sent();
|
|
23727
23934
|
// console.log("=AmisInputTable==amisSchema====", amisSchema);
|
|
@@ -23757,14 +23964,17 @@ var AmisRecordDetailMini = function (props) { return __awaiter(void 0, void 0, v
|
|
|
23757
23964
|
if (props.$$editor) {
|
|
23758
23965
|
options.isEditor = true;
|
|
23759
23966
|
}
|
|
23760
|
-
console.log("AmisRecordDetailMini==2=>", objectApiName, options);
|
|
23761
23967
|
return [4 /*yield*/, getRecordDetailMiniSchema(objectApiName, appId, options)];
|
|
23762
23968
|
case 1:
|
|
23763
23969
|
schema = _b.sent();
|
|
23764
23970
|
if (!isEmpty(schemaData)) {
|
|
23765
|
-
schema.data =
|
|
23971
|
+
schema.data = Object.assign({
|
|
23972
|
+
"_inDrawer": false,
|
|
23973
|
+
"_inRecordMini": true,
|
|
23974
|
+
"recordLoaded": false, // 重置数据加载状态
|
|
23975
|
+
}, schemaData);
|
|
23766
23976
|
}
|
|
23767
|
-
//
|
|
23977
|
+
// console.log(`AmisRecordDetailMini===>`, schema)
|
|
23768
23978
|
return [2 /*return*/, schema];
|
|
23769
23979
|
}
|
|
23770
23980
|
});
|