@steedos-widgets/amis-object 6.3.0 → 6.3.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/AmisAppLauncher.d.ts +268 -3
- package/dist/amis-object.cjs.css +13 -21
- package/dist/amis-object.cjs.js +250 -169
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +13 -21
- package/dist/amis-object.esm.js +250 -169
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +13 -21
- package/dist/amis-object.umd.js +30 -28
- 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
|
@@ -4359,7 +4359,7 @@ async function getLookupLinkOnClick$1(field, options) {
|
|
|
4359
4359
|
const recordPage = await getPage({ type: 'record', appId: options.appId, objectName: options.objectName, formFactor: options.formFactor });
|
|
4360
4360
|
|
|
4361
4361
|
const drawerRecordDetailSchema = recordPage ? Object.assign({}, recordPage.schema, {
|
|
4362
|
-
"recordId":
|
|
4362
|
+
"recordId": `\${${field.name}}`,
|
|
4363
4363
|
"data": {
|
|
4364
4364
|
...recordPage.schema.data,
|
|
4365
4365
|
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
@@ -4369,7 +4369,7 @@ async function getLookupLinkOnClick$1(field, options) {
|
|
|
4369
4369
|
}) : {
|
|
4370
4370
|
"type": "steedos-record-detail",
|
|
4371
4371
|
"objectApiName": options.objectName,
|
|
4372
|
-
"recordId":
|
|
4372
|
+
"recordId": `\${${field.name}}`,
|
|
4373
4373
|
"showBackButton": false,
|
|
4374
4374
|
"showButtons": true,
|
|
4375
4375
|
"data": {
|
|
@@ -4475,7 +4475,7 @@ const getAmisFileReadonlySchema = async (steedosField,ctx = {})=>{
|
|
|
4475
4475
|
labelClassName: "hidden",
|
|
4476
4476
|
label: false,
|
|
4477
4477
|
className: 'm-0',
|
|
4478
|
-
tpl: `<a href="/app/-/cfs_files_filerecord/view/\${
|
|
4478
|
+
tpl: `<a href="/app/-/cfs_files_filerecord/view/\${${steedosField.name}}" ${lookupATagClick}>\${name}</a>`,
|
|
4479
4479
|
// tpl: "<%= item.name >",
|
|
4480
4480
|
// onEvent: window.innerWidth < 768 ? null : REFERENCE_VALUE_ITEM_ONCLICK
|
|
4481
4481
|
onEvent: window.innerWidth < 768 ? null : await getLookupLinkOnClick$1(steedosField, {
|
|
@@ -4958,6 +4958,11 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
4958
4958
|
const submitEvent = {
|
|
4959
4959
|
submit: {
|
|
4960
4960
|
actions: [
|
|
4961
|
+
{
|
|
4962
|
+
"actionType": "validate",
|
|
4963
|
+
"componentId": quickEditId,
|
|
4964
|
+
"outputVar": "form_validate_result"
|
|
4965
|
+
},
|
|
4961
4966
|
{
|
|
4962
4967
|
actionType: "custom",
|
|
4963
4968
|
script: `
|
|
@@ -4974,10 +4979,12 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
4974
4979
|
doAction({actionType: 'setValue', "args": {"value": event.data._display},componentId: "${options.objectName}" + "_display_" + event.data._index});
|
|
4975
4980
|
doAction({actionType: 'setValue', "args": {"value": event.data.${field.name}},componentId: "${options.objectName + "_" + field.name + "_"}" + event.data._index});
|
|
4976
4981
|
}
|
|
4977
|
-
|
|
4982
|
+
`,
|
|
4983
|
+
expression: "${!form_validate_result.error}"
|
|
4978
4984
|
},
|
|
4979
4985
|
{
|
|
4980
|
-
"actionType": "closeDialog"
|
|
4986
|
+
"actionType": "closeDialog",
|
|
4987
|
+
expression: "${!form_validate_result.error}"
|
|
4981
4988
|
}
|
|
4982
4989
|
]
|
|
4983
4990
|
}
|
|
@@ -5485,7 +5492,7 @@ async function getTableColumns$1(object, fields, options){
|
|
|
5485
5492
|
}
|
|
5486
5493
|
//增加quickEdit属性,实现快速编辑
|
|
5487
5494
|
const quickEditSchema = allowEdit ? await getQuickEditSchema(object, field, options) : allowEdit;
|
|
5488
|
-
let className =
|
|
5495
|
+
let className = `steedos-table-${field.type}-field`;
|
|
5489
5496
|
const bowserType = getBowserType();
|
|
5490
5497
|
if(bowserType === "Safari"){
|
|
5491
5498
|
className += " whitespace-nowrap ";
|
|
@@ -6576,7 +6583,7 @@ function getReadonlyFormAdaptor(object, fields, options){
|
|
|
6576
6583
|
nameLabel = `record._display.${nameField.name}.label`;
|
|
6577
6584
|
}
|
|
6578
6585
|
} else if (nameField){
|
|
6579
|
-
nameLabel = `(record._display
|
|
6586
|
+
nameLabel = `(record._display && record._display.${nameField.name}) || record.${nameField.name}`;
|
|
6580
6587
|
}
|
|
6581
6588
|
return `
|
|
6582
6589
|
if(payload.data.data.length === 0){
|
|
@@ -6769,7 +6776,7 @@ async function getEditFormInitApi(object, recordId, fields, options){
|
|
|
6769
6776
|
|
|
6770
6777
|
return {
|
|
6771
6778
|
method: "post",
|
|
6772
|
-
url: getApi$2() + '&objectName=${objectName}' ,
|
|
6779
|
+
url: getApi$2() + '&objectName=${objectName}' + "&recordId=${recordId}",
|
|
6773
6780
|
// sendOn: "!!this.recordId",
|
|
6774
6781
|
cache: API_CACHE,
|
|
6775
6782
|
requestAdaptor: `
|
|
@@ -16872,6 +16879,8 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
16872
16879
|
if(gridSub){
|
|
16873
16880
|
delete gridSub.name;
|
|
16874
16881
|
delete gridSub.label;
|
|
16882
|
+
//去除重复样式
|
|
16883
|
+
gridSub.className = gridSub.className.replace('border-b', '');
|
|
16875
16884
|
convertData.items.push(
|
|
16876
16885
|
Object.assign({}, gridSub, {label: subField.label}, subField.amis, {
|
|
16877
16886
|
name: subFieldName
|
|
@@ -16926,6 +16935,10 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
16926
16935
|
}
|
|
16927
16936
|
// if(ctx.mode === 'edit'){
|
|
16928
16937
|
let convertDataResult = Object.assign({}, baseData, convertData, { labelClassName: 'text-left', clearValueOnHidden: true, fieldName: field.name}, field.amis, {name: baseData.name});
|
|
16938
|
+
// 只读时file字段的外层control层若存在name,内部each组件存在问题
|
|
16939
|
+
if(readonly && field.type == "file") {
|
|
16940
|
+
convertDataResult.name = "";
|
|
16941
|
+
}
|
|
16929
16942
|
// console.log("convertDataResult:", convertDataResult);
|
|
16930
16943
|
return convertDataResult;
|
|
16931
16944
|
// }else{
|
|
@@ -17145,13 +17158,17 @@ const getSection = async (formFields, permissionFields, fieldSchemaArray, sectio
|
|
|
17145
17158
|
// console.log(`perField.type object ===> field`, field)
|
|
17146
17159
|
}
|
|
17147
17160
|
if (field.name.indexOf(".") < 0) {
|
|
17161
|
+
let _field = _.cloneDeep(field);
|
|
17162
|
+
if(field.type === "select" && field.data_type && field.data_type != "text"){
|
|
17163
|
+
_field.type = field.data_type;
|
|
17164
|
+
}
|
|
17148
17165
|
if(field.type === "steedos-field"){
|
|
17149
17166
|
// 如果是steedos-field则不需要通过convertSFieldToAmisField函数转换,因为steedos-field组件会转换
|
|
17150
|
-
fieldSetBody.push(
|
|
17167
|
+
fieldSetBody.push(_field);
|
|
17151
17168
|
}
|
|
17152
17169
|
else {
|
|
17153
17170
|
ctx.__formFields = formFields;
|
|
17154
|
-
const amisField = await convertSFieldToAmisField(
|
|
17171
|
+
const amisField = await convertSFieldToAmisField(_field, _field.readonly, ctx);
|
|
17155
17172
|
// 如果steedos-field稳定了,可以放开下面的代码直接用组件统一渲染字段
|
|
17156
17173
|
// const amisField = {
|
|
17157
17174
|
// "type": "steedos-field",
|
|
@@ -22846,7 +22863,7 @@ var AmisProvider = function (props) { return __awaiter(void 0, void 0, void 0, f
|
|
|
22846
22863
|
* @Description:
|
|
22847
22864
|
*/
|
|
22848
22865
|
var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
22849
|
-
var app, data, className, _a, showAppName, _b, appNameClassName, _c, customElements, _d, showAppIcon, formFactor, isMobile, on_click_script, mobile_blank_script, convertAppVisibleOnScript, pcInitApiAdaptorScript, mobileInitApiAdaptorScript, dialogSchema, badgeText;
|
|
22866
|
+
var app, data, className, _a, showAppName, _b, appNameClassName, _c, customElements, _d, showAppIcon, formFactor, isMobile, on_click_script, mobile_blank_script, convertAppVisibleOnScript, pcInitApiAdaptorScript, mobileInitApiAdaptorScript, dialogSchema, badgeText, overlaySchema;
|
|
22850
22867
|
return __generator(this, function (_e) {
|
|
22851
22868
|
app = props.app, data = props.data, className = props.className, _a = props.showAppName, showAppName = _a === void 0 ? true : _a, _b = props.appNameClassName, appNameClassName = _b === void 0 ? '' : _b, _c = props.customElements, customElements = _c === void 0 ? [] : _c, _d = props.showAppIcon, showAppIcon = _d === void 0 ? true : _d;
|
|
22852
22869
|
if (!app) {
|
|
@@ -22861,113 +22878,7 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
22861
22878
|
mobileInitApiAdaptorScript = "\n let app_items = payload;\n ".concat(convertAppVisibleOnScript, "\n payload = {\n app_items\n }\n return payload;\n ");
|
|
22862
22879
|
dialogSchema = {};
|
|
22863
22880
|
badgeText = "${IF(${id} == 'approve_workflow',${ss:keyvalues.badge.value|pick:'workflow'},${ss:keyvalues.badge.value|pick:${id}}) | toInt}";
|
|
22864
|
-
if (isMobile) {
|
|
22865
|
-
dialogSchema = {
|
|
22866
|
-
"type": "service",
|
|
22867
|
-
"className": "steedos-apps-service",
|
|
22868
|
-
"affixFooter": false,
|
|
22869
|
-
"body": [
|
|
22870
|
-
{
|
|
22871
|
-
"type": "each",
|
|
22872
|
-
"name": "app_items",
|
|
22873
|
-
"items": {
|
|
22874
|
-
"type": "button",
|
|
22875
|
-
"level": "link",
|
|
22876
|
-
"body": [
|
|
22877
|
-
{
|
|
22878
|
-
"type": "tpl",
|
|
22879
|
-
"tpl": "<div class='flex flex-col justify-center'><div class='text-center'><svg class='w-12 h-12 slds-icon slds-icon_container slds-icon-standard-${REPLACE(icon, '_', '-' )}' aria-hidden='true'><use xlink:href='/assets/icons/standard-sprite/svg/symbols.svg#${icon}'></use></svg></div><div class='text-center text-lg'>${name}</div></div>",
|
|
22880
|
-
"badge": {
|
|
22881
|
-
"mode": "text",
|
|
22882
|
-
"text": badgeText,
|
|
22883
|
-
"visibleOn": badgeText,
|
|
22884
|
-
"overflowCount": 99,
|
|
22885
|
-
"style": {
|
|
22886
|
-
"right": "50%",
|
|
22887
|
-
"margin-right": "-23px",
|
|
22888
|
-
"height": "20px",
|
|
22889
|
-
"border-radius": "10px",
|
|
22890
|
-
"font-size": "16px",
|
|
22891
|
-
"line-height": "18px"
|
|
22892
|
-
}
|
|
22893
|
-
}
|
|
22894
|
-
}
|
|
22895
|
-
],
|
|
22896
|
-
"onEvent": {
|
|
22897
|
-
"click": {
|
|
22898
|
-
"actions": [
|
|
22899
|
-
{
|
|
22900
|
-
"actionType": "closeDialog"
|
|
22901
|
-
},
|
|
22902
|
-
{
|
|
22903
|
-
"actionType": "link",
|
|
22904
|
-
"args": {
|
|
22905
|
-
"link": "${path}"
|
|
22906
|
-
},
|
|
22907
|
-
"expression": "${AND(!blank , !on_click)}"
|
|
22908
|
-
},
|
|
22909
|
-
{
|
|
22910
|
-
"actionType": "custom",
|
|
22911
|
-
"script": mobile_blank_script,
|
|
22912
|
-
"expression": "${AND(blank , !on_click)}"
|
|
22913
|
-
},
|
|
22914
|
-
{
|
|
22915
|
-
"actionType": "custom",
|
|
22916
|
-
"script": on_click_script,
|
|
22917
|
-
"expression": "${on_click}"
|
|
22918
|
-
}
|
|
22919
|
-
]
|
|
22920
|
-
}
|
|
22921
|
-
},
|
|
22922
|
-
"visibleOn": "${visible_on}",
|
|
22923
|
-
"className": "block w-1/3 py-4",
|
|
22924
|
-
"style": {
|
|
22925
|
-
"display": "inline-flex",
|
|
22926
|
-
"justify-content": "center"
|
|
22927
|
-
}
|
|
22928
|
-
},
|
|
22929
|
-
"className": "flex flex-wrap",
|
|
22930
|
-
"id": "u:a98e9f6fb4db"
|
|
22931
|
-
}
|
|
22932
|
-
],
|
|
22933
|
-
"clearValueOnHidden": false,
|
|
22934
|
-
"visible": true,
|
|
22935
|
-
"messages": {},
|
|
22936
|
-
"api": {
|
|
22937
|
-
"method": "get",
|
|
22938
|
-
"url": "${context.rootUrl}/service/api/apps/menus?mobile=true",
|
|
22939
|
-
"headers": {
|
|
22940
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
22941
|
-
},
|
|
22942
|
-
"adaptor": mobileInitApiAdaptorScript,
|
|
22943
|
-
"messages": {}
|
|
22944
|
-
},
|
|
22945
|
-
"onEvent": {
|
|
22946
|
-
"@data.changed.steedos_keyvalues": {
|
|
22947
|
-
"actions": [
|
|
22948
|
-
{
|
|
22949
|
-
"actionType": "reload"
|
|
22950
|
-
}
|
|
22951
|
-
]
|
|
22952
|
-
},
|
|
22953
|
-
"fetchInited": {
|
|
22954
|
-
"actions": [
|
|
22955
|
-
{
|
|
22956
|
-
"actionType": "broadcast",
|
|
22957
|
-
"args": {
|
|
22958
|
-
"eventName": "@appsLoaded"
|
|
22959
|
-
},
|
|
22960
|
-
"data": {
|
|
22961
|
-
"apps": "${event.data.app_items}"
|
|
22962
|
-
}
|
|
22963
|
-
}
|
|
22964
|
-
]
|
|
22965
|
-
}
|
|
22966
|
-
},
|
|
22967
|
-
"id": "u:2c8bd22d4ea8"
|
|
22968
|
-
};
|
|
22969
|
-
}
|
|
22970
|
-
else {
|
|
22881
|
+
if (!isMobile) {
|
|
22971
22882
|
dialogSchema = {
|
|
22972
22883
|
"type": "service",
|
|
22973
22884
|
"id": "u:0f6224a0836f",
|
|
@@ -23130,6 +23041,7 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
23130
23041
|
},
|
|
23131
23042
|
"api": {
|
|
23132
23043
|
"method": "get",
|
|
23044
|
+
"cache": "10000",
|
|
23133
23045
|
"url": "${context.rootUrl}/service/api/apps/menus?mobile=" + isMobile,
|
|
23134
23046
|
"data": null,
|
|
23135
23047
|
"headers": {
|
|
@@ -23139,11 +23051,139 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
23139
23051
|
}
|
|
23140
23052
|
};
|
|
23141
23053
|
}
|
|
23054
|
+
overlaySchema = {
|
|
23055
|
+
"type": "service",
|
|
23056
|
+
"className": isMobile ? "steedos-apps-service" : "steedos-apps-service w-96",
|
|
23057
|
+
"affixFooter": false,
|
|
23058
|
+
"body": [
|
|
23059
|
+
{
|
|
23060
|
+
"type": "each",
|
|
23061
|
+
"source": isMobile ? "${app_items}" : "${ARRAYFILTER(app_items, (item,index) => index<=8)}",
|
|
23062
|
+
"items": {
|
|
23063
|
+
"type": "button",
|
|
23064
|
+
"level": "link",
|
|
23065
|
+
"body": [
|
|
23066
|
+
{
|
|
23067
|
+
"type": "tpl",
|
|
23068
|
+
"tpl": "<div class='flex flex-col justify-center'><div class='text-center'><svg class='w-12 h-12 slds-icon slds-icon_container slds-icon-standard-${REPLACE(icon, '_', '-' )}' aria-hidden='true'><use xlink:href='/assets/icons/standard-sprite/svg/symbols.svg#${icon}'></use></svg></div><div class='text-center text-lg'>${name}</div></div>",
|
|
23069
|
+
"badge": {
|
|
23070
|
+
"mode": "text",
|
|
23071
|
+
"text": badgeText,
|
|
23072
|
+
"visibleOn": badgeText,
|
|
23073
|
+
"overflowCount": 99,
|
|
23074
|
+
"style": {
|
|
23075
|
+
"right": "50%",
|
|
23076
|
+
"margin-right": "-23px",
|
|
23077
|
+
"height": "20px",
|
|
23078
|
+
"border-radius": "10px",
|
|
23079
|
+
"font-size": "16px",
|
|
23080
|
+
"line-height": "18px"
|
|
23081
|
+
}
|
|
23082
|
+
}
|
|
23083
|
+
}
|
|
23084
|
+
],
|
|
23085
|
+
"onEvent": {
|
|
23086
|
+
"click": {
|
|
23087
|
+
"actions": [
|
|
23088
|
+
{
|
|
23089
|
+
"actionType": "closeDialog"
|
|
23090
|
+
},
|
|
23091
|
+
{
|
|
23092
|
+
"actionType": "link",
|
|
23093
|
+
"args": {
|
|
23094
|
+
"link": "${path}"
|
|
23095
|
+
},
|
|
23096
|
+
"expression": "${AND(!blank , !on_click)}"
|
|
23097
|
+
},
|
|
23098
|
+
{
|
|
23099
|
+
"actionType": "custom",
|
|
23100
|
+
"script": mobile_blank_script,
|
|
23101
|
+
"expression": "${AND(blank , !on_click)}"
|
|
23102
|
+
},
|
|
23103
|
+
{
|
|
23104
|
+
"actionType": "custom",
|
|
23105
|
+
"script": on_click_script,
|
|
23106
|
+
"expression": "${on_click}"
|
|
23107
|
+
}
|
|
23108
|
+
]
|
|
23109
|
+
}
|
|
23110
|
+
},
|
|
23111
|
+
"visibleOn": "${visible_on}",
|
|
23112
|
+
"className": "block w-1/3 py-4",
|
|
23113
|
+
"style": {
|
|
23114
|
+
"display": "inline-flex",
|
|
23115
|
+
"justify-content": "center"
|
|
23116
|
+
}
|
|
23117
|
+
},
|
|
23118
|
+
"className": "flex flex-wrap",
|
|
23119
|
+
"id": "u:a98e9f6fb4db"
|
|
23120
|
+
},
|
|
23121
|
+
isMobile ? null : {
|
|
23122
|
+
"type": "divider",
|
|
23123
|
+
"className": "m-0"
|
|
23124
|
+
},
|
|
23125
|
+
isMobile ? null : {
|
|
23126
|
+
"type": "button",
|
|
23127
|
+
"level": "link",
|
|
23128
|
+
"label": "更多",
|
|
23129
|
+
"className": "w-full h-10",
|
|
23130
|
+
"actionType": "dialog",
|
|
23131
|
+
"dialog": {
|
|
23132
|
+
"size": "xl",
|
|
23133
|
+
"title": {
|
|
23134
|
+
"type": "tpl",
|
|
23135
|
+
"tpl": instance.t('frontend_application_launcher'),
|
|
23136
|
+
"className": "block text-xl text-center"
|
|
23137
|
+
},
|
|
23138
|
+
"actions": [],
|
|
23139
|
+
"body": [
|
|
23140
|
+
dialogSchema
|
|
23141
|
+
]
|
|
23142
|
+
}
|
|
23143
|
+
}
|
|
23144
|
+
],
|
|
23145
|
+
"clearValueOnHidden": false,
|
|
23146
|
+
"visible": true,
|
|
23147
|
+
"messages": {},
|
|
23148
|
+
"api": {
|
|
23149
|
+
"method": "get",
|
|
23150
|
+
"cache": "10000",
|
|
23151
|
+
"url": "${context.rootUrl}/service/api/apps/menus?mobile=true",
|
|
23152
|
+
"headers": {
|
|
23153
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
23154
|
+
},
|
|
23155
|
+
"adaptor": mobileInitApiAdaptorScript,
|
|
23156
|
+
"messages": {}
|
|
23157
|
+
},
|
|
23158
|
+
"onEvent": {
|
|
23159
|
+
"@data.changed.steedos_keyvalues": {
|
|
23160
|
+
"actions": [
|
|
23161
|
+
{
|
|
23162
|
+
"actionType": "reload"
|
|
23163
|
+
}
|
|
23164
|
+
]
|
|
23165
|
+
},
|
|
23166
|
+
"fetchInited": {
|
|
23167
|
+
"actions": [
|
|
23168
|
+
{
|
|
23169
|
+
"actionType": "broadcast",
|
|
23170
|
+
"args": {
|
|
23171
|
+
"eventName": "@appsLoaded"
|
|
23172
|
+
},
|
|
23173
|
+
"data": {
|
|
23174
|
+
"apps": "${event.data.app_items}"
|
|
23175
|
+
}
|
|
23176
|
+
}
|
|
23177
|
+
]
|
|
23178
|
+
}
|
|
23179
|
+
},
|
|
23180
|
+
"id": "u:2c8bd22d4ea8"
|
|
23181
|
+
};
|
|
23142
23182
|
return [2 /*return*/, {
|
|
23143
23183
|
"type": "service",
|
|
23144
23184
|
className: className,
|
|
23145
23185
|
"body": [
|
|
23146
|
-
{
|
|
23186
|
+
isMobile ? {
|
|
23147
23187
|
"type": "button",
|
|
23148
23188
|
"actionType": "dialog",
|
|
23149
23189
|
"className": "flex items-center",
|
|
@@ -23178,10 +23218,43 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
23178
23218
|
},
|
|
23179
23219
|
"actions": [],
|
|
23180
23220
|
"body": [
|
|
23181
|
-
|
|
23221
|
+
overlaySchema
|
|
23182
23222
|
]
|
|
23183
23223
|
},
|
|
23184
23224
|
"id": "u:b5dc095e1c11"
|
|
23225
|
+
} : {
|
|
23226
|
+
"type": "steedos-dropdown",
|
|
23227
|
+
"placement": "bottomRight",
|
|
23228
|
+
"trigger": [
|
|
23229
|
+
"click"
|
|
23230
|
+
],
|
|
23231
|
+
"body": __spreadArray([
|
|
23232
|
+
{
|
|
23233
|
+
"type": "tpl",
|
|
23234
|
+
"className": "flex items-center",
|
|
23235
|
+
"tpl": "<div aria-haspopup='true' title='".concat(instance.t('frontend_open_app_launcher'), "' class='slds-icon-waffle_container slds-context-bar__button' type='button'><span class='slds-icon-waffle'><span class='slds-r1'></span><span class='slds-r2'></span><span class='slds-r3'></span><span class='slds-r4'></span><span class='slds-r5'></span><span class='slds-r6'></span><span class='slds-r7'></span><span class='slds-r8'></span><span class='slds-r9'></span></span></div>"),
|
|
23236
|
+
"badge": {
|
|
23237
|
+
"visibleOn": "${ss:keyvalues.badge.value.workflow | toInt}",
|
|
23238
|
+
"offset": [3, -3],
|
|
23239
|
+
"style": {
|
|
23240
|
+
"width": "8px",
|
|
23241
|
+
"height": "8px"
|
|
23242
|
+
}
|
|
23243
|
+
},
|
|
23244
|
+
"hiddenOn": "".concat(!showAppIcon)
|
|
23245
|
+
},
|
|
23246
|
+
{
|
|
23247
|
+
type: 'tpl',
|
|
23248
|
+
className: "text-xl ml-4 mr-4 text-black nowrap ".concat(appNameClassName, " "),
|
|
23249
|
+
tpl: '${app.name}',
|
|
23250
|
+
hiddenOn: "".concat(!!app || !!!showAppName)
|
|
23251
|
+
}
|
|
23252
|
+
], __read(customElements), false),
|
|
23253
|
+
"overlay": [
|
|
23254
|
+
overlaySchema
|
|
23255
|
+
],
|
|
23256
|
+
"className": "flex items-center",
|
|
23257
|
+
"open": false
|
|
23185
23258
|
}
|
|
23186
23259
|
],
|
|
23187
23260
|
"id": "u:06ee48db134a",
|
|
@@ -23877,7 +23950,7 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
|
|
|
23877
23950
|
body: [
|
|
23878
23951
|
{
|
|
23879
23952
|
"type": "wrapper",
|
|
23880
|
-
"className": "bg-white sticky p-0 top-0 z-40 w-full flex-none backdrop-blur transition-colors duration-500 lg:z-
|
|
23953
|
+
"className": "bg-white sticky p-0 top-0 z-40 w-full flex-none backdrop-blur transition-colors duration-500 lg:z-[1000] border-b-[3px] border-sky-500 border-solid steedos-header-container sm:shadow",
|
|
23881
23954
|
body: [
|
|
23882
23955
|
{
|
|
23883
23956
|
"type": "wrapper",
|
|
@@ -24203,8 +24276,8 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24203
24276
|
}
|
|
24204
24277
|
_5.label = 1;
|
|
24205
24278
|
case 1:
|
|
24206
|
-
_5.trys.push([1,
|
|
24207
|
-
if (!(fStatic && (steedosField.type === 'lookup' || steedosField.type === 'master_detail'))) return [3 /*break*/,
|
|
24279
|
+
_5.trys.push([1, 33, , 34]);
|
|
24280
|
+
if (!(fStatic && (steedosField.type === 'lookup' || steedosField.type === 'master_detail'))) return [3 /*break*/, 16];
|
|
24208
24281
|
lookupATagClick = 'onclick="return false;"';
|
|
24209
24282
|
if (window.innerWidth < 768) {
|
|
24210
24283
|
lookupATagClick = "";
|
|
@@ -24240,10 +24313,10 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24240
24313
|
};
|
|
24241
24314
|
if (!inInputTable) return [3 /*break*/, 2];
|
|
24242
24315
|
fieldBaseProps = Object.assign({}, fieldBaseProps, { type: 'select', source: source });
|
|
24243
|
-
return [3 /*break*/,
|
|
24316
|
+
return [3 /*break*/, 15];
|
|
24244
24317
|
case 2:
|
|
24245
24318
|
referenceTo_1 = steedosField.reference_to;
|
|
24246
|
-
if (!referenceTo_1) return [3 /*break*/,
|
|
24319
|
+
if (!referenceTo_1) return [3 /*break*/, 14];
|
|
24247
24320
|
if (isArray(referenceTo_1)) {
|
|
24248
24321
|
fieldValue = (_2 = props.data) === null || _2 === void 0 ? void 0 : _2[steedosField.name];
|
|
24249
24322
|
if (fieldValue && fieldValue.o) {
|
|
@@ -24333,7 +24406,7 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24333
24406
|
_q), {
|
|
24334
24407
|
type: 'static',
|
|
24335
24408
|
tpl: '-',
|
|
24336
|
-
className: "".concat(fieldBaseProps.className || '', " text-muted"),
|
|
24409
|
+
className: "".concat(fieldBaseProps.className || '', " text-muted !border-b-0"),
|
|
24337
24410
|
hiddenOn: "${_display.".concat(steedosField.name, "}"),
|
|
24338
24411
|
}],
|
|
24339
24412
|
_p)]));
|
|
@@ -24430,16 +24503,20 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24430
24503
|
case 12:
|
|
24431
24504
|
fieldBaseProps = Object.assign({}, fieldBaseProps, { type: 'static', tpl: '-', className: "".concat(fieldBaseProps.className || '', " text-muted") });
|
|
24432
24505
|
_5.label = 13;
|
|
24433
|
-
case 13:
|
|
24506
|
+
case 13: return [3 /*break*/, 15];
|
|
24507
|
+
case 14:
|
|
24508
|
+
fieldBaseProps = Object.assign({}, fieldBaseProps, { type: 'select', source: source });
|
|
24509
|
+
_5.label = 15;
|
|
24510
|
+
case 15:
|
|
24434
24511
|
schema = Object.assign({}, fieldBaseProps, pick(steedosField.amis || {}, ['className', 'inline', 'label', 'labelAlign', 'name', 'labelRemark', 'description', 'placeholder', 'staticClassName', 'staticLabelClassName', 'staticInputClassName', 'staticSchema']));
|
|
24435
24512
|
schema.placeholder = "";
|
|
24436
24513
|
// console.log(`steedos field [lookup] schema:`, schema)
|
|
24437
24514
|
return [2 /*return*/, schema];
|
|
24438
|
-
case
|
|
24439
|
-
if (!fStatic) return [3 /*break*/,
|
|
24440
|
-
if (!props.data.hasOwnProperty("_display")) return [3 /*break*/,
|
|
24515
|
+
case 16:
|
|
24516
|
+
if (!fStatic) return [3 /*break*/, 30];
|
|
24517
|
+
if (!props.data.hasOwnProperty("_display")) return [3 /*break*/, 18];
|
|
24441
24518
|
return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, true, ctx)];
|
|
24442
|
-
case
|
|
24519
|
+
case 17:
|
|
24443
24520
|
fieldSchema = _5.sent();
|
|
24444
24521
|
if (steedosField.type === 'file' && fieldSchema.disabled) {
|
|
24445
24522
|
fieldValue = fieldSchema.value;
|
|
@@ -24447,7 +24524,9 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24447
24524
|
hasImageOrFile_1 = false;
|
|
24448
24525
|
forEach(fieldValue, function (item) {
|
|
24449
24526
|
var fileName = item.name;
|
|
24450
|
-
|
|
24527
|
+
var match = fileName.match(/\.([^\.]+)$/);
|
|
24528
|
+
var fileType = match ? match[0] : '';
|
|
24529
|
+
if ([".pdf", ".jpg", ".jpeg", ".png", ".gif"].indexOf(fileType) > -1) {
|
|
24451
24530
|
hasImageOrFile_1 = true;
|
|
24452
24531
|
}
|
|
24453
24532
|
});
|
|
@@ -24458,8 +24537,10 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24458
24537
|
forEach(fieldValue, function (item) {
|
|
24459
24538
|
var fileName = item.name;
|
|
24460
24539
|
var fileUrl = item.url;
|
|
24540
|
+
var match = fileName.match(/\.([^\.]+)$/);
|
|
24541
|
+
var fileType = match ? match[0] : '';
|
|
24461
24542
|
var filePreviewHtml = '';
|
|
24462
|
-
if ([".pdf", ".jpg", ".jpeg", ".png", ".gif"].indexOf(
|
|
24543
|
+
if ([".pdf", ".jpg", ".jpeg", ".png", ".gif"].indexOf(fileType) > -1) {
|
|
24463
24544
|
var indexOfQuestionMark = fileUrl.indexOf('?');
|
|
24464
24545
|
if (indexOfQuestionMark > -1) {
|
|
24465
24546
|
var filePreviewUrl = fileUrl.substring(0, indexOfQuestionMark);
|
|
@@ -24476,55 +24557,55 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24476
24557
|
}
|
|
24477
24558
|
}
|
|
24478
24559
|
return [2 /*return*/, fieldSchema];
|
|
24479
|
-
case
|
|
24560
|
+
case 18:
|
|
24480
24561
|
schema = Object.assign({}, steedosField, {
|
|
24481
24562
|
type: getAmisStaticFieldType(steedosField.type, steedosField.data_type, steedosField),
|
|
24482
24563
|
static: true,
|
|
24483
24564
|
label: steedosField.label
|
|
24484
24565
|
});
|
|
24485
|
-
if (!(steedosField.type === "time" || steedosField.type === "input-time-range")) return [3 /*break*/,
|
|
24566
|
+
if (!(steedosField.type === "time" || steedosField.type === "input-time-range")) return [3 /*break*/, 19];
|
|
24486
24567
|
Object.assign(schema, {
|
|
24487
24568
|
inputFormat: 'HH:mm',
|
|
24488
24569
|
timeFormat: 'HH:mm',
|
|
24489
24570
|
format: '1970-01-01THH:mm:00.000[Z]',
|
|
24490
24571
|
});
|
|
24491
|
-
return [3 /*break*/,
|
|
24492
|
-
case
|
|
24493
|
-
if (!(steedosField.type === "percent")) return [3 /*break*/,
|
|
24572
|
+
return [3 /*break*/, 29];
|
|
24573
|
+
case 19:
|
|
24574
|
+
if (!(steedosField.type === "percent")) return [3 /*break*/, 20];
|
|
24494
24575
|
Object.assign(schema, {
|
|
24495
24576
|
"percent": steedosField.scale ? steedosField.scale : true
|
|
24496
24577
|
});
|
|
24497
|
-
return [3 /*break*/,
|
|
24498
|
-
case
|
|
24499
|
-
if (!(steedosField.type === "password")) return [3 /*break*/,
|
|
24578
|
+
return [3 /*break*/, 29];
|
|
24579
|
+
case 20:
|
|
24580
|
+
if (!(steedosField.type === "password")) return [3 /*break*/, 21];
|
|
24500
24581
|
Object.assign(schema, {
|
|
24501
24582
|
"tpl": "******"
|
|
24502
24583
|
});
|
|
24503
|
-
return [3 /*break*/,
|
|
24504
|
-
case
|
|
24505
|
-
if (!(steedosField.type === "select")) return [3 /*break*/,
|
|
24584
|
+
return [3 /*break*/, 29];
|
|
24585
|
+
case 21:
|
|
24586
|
+
if (!(steedosField.type === "select")) return [3 /*break*/, 22];
|
|
24506
24587
|
map = getSelectMap(steedosField.options);
|
|
24507
24588
|
Object.assign(schema, {
|
|
24508
24589
|
"placeholder": "",
|
|
24509
24590
|
"map": map
|
|
24510
24591
|
});
|
|
24511
|
-
return [3 /*break*/,
|
|
24512
|
-
case
|
|
24513
|
-
if (!(steedosField.type === "color")) return [3 /*break*/,
|
|
24592
|
+
return [3 /*break*/, 29];
|
|
24593
|
+
case 22:
|
|
24594
|
+
if (!(steedosField.type === "color")) return [3 /*break*/, 23];
|
|
24514
24595
|
Object.assign(schema, {
|
|
24515
24596
|
"defaultColor": null
|
|
24516
24597
|
});
|
|
24517
|
-
return [3 /*break*/,
|
|
24518
|
-
case
|
|
24519
|
-
if (!(steedosField.type === "number" || steedosField.type === 'currency')) return [3 /*break*/,
|
|
24598
|
+
return [3 /*break*/, 29];
|
|
24599
|
+
case 23:
|
|
24600
|
+
if (!(steedosField.type === "number" || steedosField.type === 'currency')) return [3 /*break*/, 24];
|
|
24520
24601
|
// amis input-number和number组件中的precision表示小数位数,并不是魔方平台的精度概念,要转换下,否则小数点后会显示很多的0
|
|
24521
24602
|
Object.assign(schema, {
|
|
24522
24603
|
"precision": steedosField.scale || 0,
|
|
24523
24604
|
"kilobitSeparator": steedosField.enable_thousands //识别enable_thousands,控制千分位分隔符
|
|
24524
24605
|
});
|
|
24525
|
-
return [3 /*break*/,
|
|
24526
|
-
case
|
|
24527
|
-
if (!(steedosField.type === "table")) return [3 /*break*/,
|
|
24606
|
+
return [3 /*break*/, 29];
|
|
24607
|
+
case 24:
|
|
24608
|
+
if (!(steedosField.type === "table")) return [3 /*break*/, 25];
|
|
24528
24609
|
if (steedosField.subFields) {
|
|
24529
24610
|
tableFields = [];
|
|
24530
24611
|
try {
|
|
@@ -24556,9 +24637,9 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24556
24637
|
}
|
|
24557
24638
|
});
|
|
24558
24639
|
}
|
|
24559
|
-
return [3 /*break*/,
|
|
24560
|
-
case
|
|
24561
|
-
if (!(steedosField.type === "image")) return [3 /*break*/,
|
|
24640
|
+
return [3 /*break*/, 29];
|
|
24641
|
+
case 25:
|
|
24642
|
+
if (!(steedosField.type === "image")) return [3 /*break*/, 26];
|
|
24562
24643
|
Object.assign(schema, {
|
|
24563
24644
|
enlargeAble: true,
|
|
24564
24645
|
showToolbar: true,
|
|
@@ -24589,15 +24670,15 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24589
24670
|
return value;
|
|
24590
24671
|
}
|
|
24591
24672
|
});
|
|
24592
|
-
return [3 /*break*/,
|
|
24593
|
-
case
|
|
24594
|
-
if (!(steedosField.type === "file")) return [3 /*break*/,
|
|
24673
|
+
return [3 /*break*/, 29];
|
|
24674
|
+
case 26:
|
|
24675
|
+
if (!(steedosField.type === "file")) return [3 /*break*/, 28];
|
|
24595
24676
|
return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, true, ctx)];
|
|
24596
|
-
case
|
|
24677
|
+
case 27:
|
|
24597
24678
|
// 附件static模式先保持原来的逻辑,依赖_display,审批王中相关功能在creator中
|
|
24598
24679
|
// convertSFieldToAmisField中会合并steedosField.amis,所以也不需要再次合并steedosField.amis,直接return就好
|
|
24599
24680
|
return [2 /*return*/, _5.sent()];
|
|
24600
|
-
case
|
|
24681
|
+
case 28:
|
|
24601
24682
|
if (steedosField.type === 'formula' || steedosField.type === 'summary') {
|
|
24602
24683
|
if (steedosField.data_type === 'number' || steedosField.data_type === 'currency') {
|
|
24603
24684
|
Object.assign(schema, {
|
|
@@ -24658,11 +24739,11 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24658
24739
|
disabled: true
|
|
24659
24740
|
});
|
|
24660
24741
|
}
|
|
24661
|
-
_5.label =
|
|
24662
|
-
case
|
|
24742
|
+
_5.label = 29;
|
|
24743
|
+
case 29:
|
|
24663
24744
|
Object.assign(schema, steedosField.amis || {});
|
|
24664
24745
|
return [2 /*return*/, schema];
|
|
24665
|
-
case
|
|
24746
|
+
case 30:
|
|
24666
24747
|
if (!ctx.className) {
|
|
24667
24748
|
ctx.className = className;
|
|
24668
24749
|
}
|
|
@@ -24723,16 +24804,16 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
24723
24804
|
}
|
|
24724
24805
|
}
|
|
24725
24806
|
return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
|
|
24726
|
-
case
|
|
24807
|
+
case 31:
|
|
24727
24808
|
schema = _5.sent();
|
|
24728
24809
|
// console.log(`AmisSteedosField return schema`, schema)
|
|
24729
24810
|
return [2 /*return*/, schema];
|
|
24730
|
-
case
|
|
24731
|
-
case
|
|
24811
|
+
case 32: return [3 /*break*/, 34];
|
|
24812
|
+
case 33:
|
|
24732
24813
|
error_1 = _5.sent();
|
|
24733
24814
|
console.log("error", error_1);
|
|
24734
|
-
return [3 /*break*/,
|
|
24735
|
-
case
|
|
24815
|
+
return [3 /*break*/, 34];
|
|
24816
|
+
case 34: return [2 /*return*/, null];
|
|
24736
24817
|
}
|
|
24737
24818
|
});
|
|
24738
24819
|
}); };
|