@steedos-widgets/amis-object 1.2.6-beta.9 → 1.2.6
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 +0 -5
- package/dist/amis/AmisObjectListview.d.ts +1 -7
- package/dist/amis/AmisRecordDetailHeader.d.ts +39 -1
- package/dist/amis/AmisRecordDetailRelatedLists.d.ts +1 -14
- package/dist/amis/AmisSelectFlow.d.ts +1 -0
- package/dist/amis-object.cjs.css +127 -32
- package/dist/amis-object.cjs.js +507 -165
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +127 -32
- package/dist/amis-object.esm.js +508 -166
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +127 -32
- package/dist/amis-object.umd.js +507 -165
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +11 -11
- package/dist/meta.js +1 -1
- package/dist/pages/PageListView.d.ts +4 -1
- package/package.json +3 -3
package/dist/amis-object.umd.js
CHANGED
|
@@ -1735,26 +1735,11 @@
|
|
|
1735
1735
|
}
|
|
1736
1736
|
};
|
|
1737
1737
|
|
|
1738
|
-
/*
|
|
1739
|
-
* @Author: baozhoutao@steedos.com
|
|
1740
|
-
* @Date: 2022-08-04 10:42:49
|
|
1741
|
-
* @LastEditors: baozhoutao@steedos.com
|
|
1742
|
-
* @LastEditTime: 2022-08-25 10:28:47
|
|
1743
|
-
* @Description:
|
|
1744
|
-
*/
|
|
1745
|
-
var config = {
|
|
1746
|
-
listView: {
|
|
1747
|
-
newRecordMode: 'modal',
|
|
1748
|
-
editRecordMode: 'modal',
|
|
1749
|
-
perPage: 20
|
|
1750
|
-
}
|
|
1751
|
-
};
|
|
1752
|
-
|
|
1753
1738
|
/*
|
|
1754
1739
|
* @Author: baozhoutao@steedos.com
|
|
1755
1740
|
* @Date: 2022-11-01 15:51:00
|
|
1756
|
-
* @LastEditors:
|
|
1757
|
-
* @LastEditTime: 2023-04-
|
|
1741
|
+
* @LastEditors: Please set LastEditors
|
|
1742
|
+
* @LastEditTime: 2023-04-26 11:52:04
|
|
1758
1743
|
* @Description:
|
|
1759
1744
|
*/
|
|
1760
1745
|
|
|
@@ -1846,7 +1831,8 @@
|
|
|
1846
1831
|
"schemaApi": {
|
|
1847
1832
|
"data": {
|
|
1848
1833
|
"isLookup": "${isLookup}",
|
|
1849
|
-
"_master": "${_master}"
|
|
1834
|
+
"_master": "${_master}",
|
|
1835
|
+
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}"
|
|
1850
1836
|
},
|
|
1851
1837
|
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}",
|
|
1852
1838
|
"method": "get",
|
|
@@ -1855,7 +1841,7 @@
|
|
|
1855
1841
|
"headers": {
|
|
1856
1842
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
1857
1843
|
},
|
|
1858
|
-
"requestAdaptor": "",
|
|
1844
|
+
"requestAdaptor": "return { ...api, url: api.body.url }",
|
|
1859
1845
|
"adaptor": schemaApiAdaptor
|
|
1860
1846
|
}
|
|
1861
1847
|
}
|
|
@@ -2764,6 +2750,166 @@
|
|
|
2764
2750
|
|
|
2765
2751
|
const executeButton = execute;
|
|
2766
2752
|
|
|
2753
|
+
|
|
2754
|
+
const getObjectDetailHeaderButtons = (objectSchema, recordId)=>{
|
|
2755
|
+
const { name } = objectSchema;
|
|
2756
|
+
const buttons = getObjectDetailButtons(objectSchema, {});
|
|
2757
|
+
const moreButtons = getObjectDetailMoreButtons(objectSchema, {
|
|
2758
|
+
recordId: recordId,
|
|
2759
|
+
objectName: name
|
|
2760
|
+
});
|
|
2761
|
+
let amisButtonsSchema = ___default__default["default"].map(buttons, (button) => {
|
|
2762
|
+
return {
|
|
2763
|
+
type: 'steedos-object-button',
|
|
2764
|
+
name: button.name,
|
|
2765
|
+
objectName: button.objectName,
|
|
2766
|
+
visibleOn: getButtonVisibleOn$1(button),
|
|
2767
|
+
className: `button_${button.name}`
|
|
2768
|
+
}
|
|
2769
|
+
});
|
|
2770
|
+
let dropdownButtons = ___default__default["default"].map(moreButtons, (button) => {
|
|
2771
|
+
return {
|
|
2772
|
+
type: 'steedos-object-button',
|
|
2773
|
+
name: button.name,
|
|
2774
|
+
objectName: button.objectName,
|
|
2775
|
+
visibleOn: getButtonVisibleOn$1(button),
|
|
2776
|
+
}
|
|
2777
|
+
});
|
|
2778
|
+
return {
|
|
2779
|
+
buttons: amisButtonsSchema,
|
|
2780
|
+
moreButtons: dropdownButtons
|
|
2781
|
+
};
|
|
2782
|
+
};
|
|
2783
|
+
|
|
2784
|
+
const getObjectDetailButtonsSchemas = (objectSchema, recordId, ctx)=>{
|
|
2785
|
+
const { buttons, moreButtons } = getObjectDetailHeaderButtons(objectSchema, recordId);
|
|
2786
|
+
if(ctx.formFactor === 'SMALL'){
|
|
2787
|
+
return {
|
|
2788
|
+
"type": "button",
|
|
2789
|
+
"icon": "fa fa-angle-down",
|
|
2790
|
+
"onEvent": {
|
|
2791
|
+
"click": {
|
|
2792
|
+
"actions": [
|
|
2793
|
+
{
|
|
2794
|
+
"actionType": "drawer",
|
|
2795
|
+
"drawer": {
|
|
2796
|
+
"type": "drawer",
|
|
2797
|
+
"title": "操作",
|
|
2798
|
+
"body": [
|
|
2799
|
+
{
|
|
2800
|
+
"type": "button-group",
|
|
2801
|
+
"id": "u:fd837823be5b",
|
|
2802
|
+
"vertical": true,
|
|
2803
|
+
"tiled": true,
|
|
2804
|
+
"buttons": [
|
|
2805
|
+
...___default__default["default"].map(buttons, (button)=>{
|
|
2806
|
+
button.className += ' w-full';
|
|
2807
|
+
return button;
|
|
2808
|
+
}),
|
|
2809
|
+
...___default__default["default"].map(moreButtons, (button)=>{
|
|
2810
|
+
button.className += ' w-full';
|
|
2811
|
+
return button;
|
|
2812
|
+
})
|
|
2813
|
+
],
|
|
2814
|
+
"btnLevel": "enhance",
|
|
2815
|
+
"className": "w-full",
|
|
2816
|
+
"btnClassName": "w-full",
|
|
2817
|
+
"size": "lg"
|
|
2818
|
+
}
|
|
2819
|
+
],
|
|
2820
|
+
"id": "u:9815f7366b9f",
|
|
2821
|
+
"position": "bottom",
|
|
2822
|
+
"closeOnOutside": true,
|
|
2823
|
+
"resizable": false,
|
|
2824
|
+
"className": "buttons-drawer",
|
|
2825
|
+
"bodyClassName": "m-none p-none",
|
|
2826
|
+
"actions": []
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
]
|
|
2830
|
+
}
|
|
2831
|
+
},
|
|
2832
|
+
"id": "u:ee7c7929e6ae"
|
|
2833
|
+
}
|
|
2834
|
+
}else {
|
|
2835
|
+
if(moreButtons.length > 0){
|
|
2836
|
+
const dropdownButtonsSchema = {
|
|
2837
|
+
type: "steedos-dropdown-button",
|
|
2838
|
+
label: "",
|
|
2839
|
+
buttons: moreButtons,
|
|
2840
|
+
className: 'slds-icon'
|
|
2841
|
+
};
|
|
2842
|
+
buttons.push(dropdownButtonsSchema);
|
|
2843
|
+
}
|
|
2844
|
+
return buttons;
|
|
2845
|
+
}
|
|
2846
|
+
};
|
|
2847
|
+
|
|
2848
|
+
|
|
2849
|
+
const getObjectListViewButtonsSchemas = (objectSchema, ctx)=>{
|
|
2850
|
+
const buttons = getListViewButtons(objectSchema, ctx);
|
|
2851
|
+
if(ctx.formFactor === 'SMALL'){
|
|
2852
|
+
return {
|
|
2853
|
+
"type": "button",
|
|
2854
|
+
"icon": "fa fa-angle-down",
|
|
2855
|
+
"onEvent": {
|
|
2856
|
+
"click": {
|
|
2857
|
+
"actions": [
|
|
2858
|
+
{
|
|
2859
|
+
"actionType": "drawer",
|
|
2860
|
+
"drawer": {
|
|
2861
|
+
"type": "drawer",
|
|
2862
|
+
"title": "操作",
|
|
2863
|
+
"body": [
|
|
2864
|
+
{
|
|
2865
|
+
"type": "button-group",
|
|
2866
|
+
"id": "u:fd837823be5b",
|
|
2867
|
+
"vertical": true,
|
|
2868
|
+
"tiled": true,
|
|
2869
|
+
"buttons": [
|
|
2870
|
+
...___default__default["default"].map(buttons, (button)=>{
|
|
2871
|
+
return {
|
|
2872
|
+
type: 'steedos-object-button',
|
|
2873
|
+
name: button.name,
|
|
2874
|
+
objectName: button.objectName,
|
|
2875
|
+
visibleOn: getButtonVisibleOn$1(button),
|
|
2876
|
+
className: `button_${button.name} w-full`
|
|
2877
|
+
}
|
|
2878
|
+
})
|
|
2879
|
+
],
|
|
2880
|
+
"btnLevel": "enhance",
|
|
2881
|
+
"className": "w-full",
|
|
2882
|
+
"btnClassName": "w-full",
|
|
2883
|
+
"size": "lg"
|
|
2884
|
+
}
|
|
2885
|
+
],
|
|
2886
|
+
"id": "u:9815f7366b9f",
|
|
2887
|
+
"position": "bottom",
|
|
2888
|
+
"closeOnOutside": true,
|
|
2889
|
+
"resizable": false,
|
|
2890
|
+
"className": "buttons-drawer",
|
|
2891
|
+
"bodyClassName": "m-none p-none",
|
|
2892
|
+
"actions": []
|
|
2893
|
+
}
|
|
2894
|
+
}
|
|
2895
|
+
]
|
|
2896
|
+
}
|
|
2897
|
+
},
|
|
2898
|
+
"id": "u:ee7c7929e6ae"
|
|
2899
|
+
}
|
|
2900
|
+
}else {
|
|
2901
|
+
return ___default__default["default"].map(buttons, (button) => {
|
|
2902
|
+
return {
|
|
2903
|
+
type: 'steedos-object-button',
|
|
2904
|
+
name: button.name,
|
|
2905
|
+
objectName: button.objectName,
|
|
2906
|
+
visibleOn: getButtonVisibleOn$1(button),
|
|
2907
|
+
className: `button_${button.name}`
|
|
2908
|
+
}
|
|
2909
|
+
});
|
|
2910
|
+
}
|
|
2911
|
+
};
|
|
2912
|
+
|
|
2767
2913
|
async function getObjectFieldsFilterButtonSchema(objectSchema) {
|
|
2768
2914
|
// const amisListViewId = `listview_${objectSchema.name}`;
|
|
2769
2915
|
return {
|
|
@@ -2896,6 +3042,35 @@
|
|
|
2896
3042
|
// }
|
|
2897
3043
|
// }
|
|
2898
3044
|
// listView.handleFilterSubmit(Object.assign({}, removedValues, filterFormValues));
|
|
3045
|
+
`;
|
|
3046
|
+
const onResetScript = `
|
|
3047
|
+
const scope = event.context.scoped;
|
|
3048
|
+
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
3049
|
+
return n.props.type === "form";
|
|
3050
|
+
});
|
|
3051
|
+
var filterFormValues = filterForm.getValues();
|
|
3052
|
+
var listView = scope.parent.parent.parent.getComponents().find(function(n){
|
|
3053
|
+
return n.props.type === "crud";
|
|
3054
|
+
});
|
|
3055
|
+
const removedValues = {};
|
|
3056
|
+
for(var k in filterFormValues){
|
|
3057
|
+
if(/^__searchable__/.test(k)){
|
|
3058
|
+
removedValues[k] = "";
|
|
3059
|
+
}
|
|
3060
|
+
}
|
|
3061
|
+
if(!event.data.isLookup){
|
|
3062
|
+
// 刷新浏览器后,filterFormValues值是空的,只能从本地存储中取出并重置为空值
|
|
3063
|
+
const listViewId = event.data.listViewId;
|
|
3064
|
+
const listViewPropsStoreKey = location.pathname + "/crud/" + listViewId ;
|
|
3065
|
+
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
3066
|
+
if(localListViewProps){
|
|
3067
|
+
localListViewProps = JSON.parse(localListViewProps);
|
|
3068
|
+
for(var k in localListViewProps){
|
|
3069
|
+
removedValues[k] = "";
|
|
3070
|
+
}
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
3073
|
+
listView.handleFilterSubmit(removedValues);
|
|
2899
3074
|
`;
|
|
2900
3075
|
const dataProviderInited = `
|
|
2901
3076
|
const objectName = data.objectName;
|
|
@@ -3090,6 +3265,21 @@
|
|
|
3090
3265
|
}
|
|
3091
3266
|
}
|
|
3092
3267
|
},
|
|
3268
|
+
{
|
|
3269
|
+
"type": "button",
|
|
3270
|
+
"label": "重置",
|
|
3271
|
+
"visibleOn": "this.filterFormSearchableFields && this.filterFormSearchableFields.length",
|
|
3272
|
+
"onEvent": {
|
|
3273
|
+
"click": {
|
|
3274
|
+
"actions": [
|
|
3275
|
+
{
|
|
3276
|
+
"actionType": "custom",
|
|
3277
|
+
"script": onResetScript
|
|
3278
|
+
}
|
|
3279
|
+
]
|
|
3280
|
+
}
|
|
3281
|
+
}
|
|
3282
|
+
},
|
|
3093
3283
|
{
|
|
3094
3284
|
"type": "button",
|
|
3095
3285
|
"label": "设置搜索项",
|
|
@@ -3246,17 +3436,7 @@
|
|
|
3246
3436
|
}
|
|
3247
3437
|
);
|
|
3248
3438
|
|
|
3249
|
-
|
|
3250
|
-
let amisButtonsSchema = ___default.map(buttons, (button) => {
|
|
3251
|
-
return {
|
|
3252
|
-
type: 'steedos-object-button',
|
|
3253
|
-
name: button.name,
|
|
3254
|
-
objectName: button.objectName,
|
|
3255
|
-
visibleOn: getButtonVisibleOn$1(button),
|
|
3256
|
-
className: `button_${button.name}`
|
|
3257
|
-
}
|
|
3258
|
-
});
|
|
3259
|
-
|
|
3439
|
+
let amisButtonsSchema = getObjectListViewButtonsSchemas(objectSchema, {formFactor: ctx.formFactor});
|
|
3260
3440
|
const reg = new RegExp('_', 'g');
|
|
3261
3441
|
const standardIcon = icon && icon.replace(reg, '-');
|
|
3262
3442
|
return {
|
|
@@ -3289,8 +3469,8 @@
|
|
|
3289
3469
|
},
|
|
3290
3470
|
{
|
|
3291
3471
|
"type": "dropdown-button",
|
|
3292
|
-
"className": "",
|
|
3293
|
-
"label": "\${uiSchema.list_views[listName].label}",
|
|
3472
|
+
"className": "",
|
|
3473
|
+
"label": "\${listName ? uiSchema.list_views[listName].label : uiSchema.list_views[defaultListName].label}",
|
|
3294
3474
|
"rightIcon": "fa fa-caret-down",
|
|
3295
3475
|
"size": "sm",
|
|
3296
3476
|
"hideCaret": true,
|
|
@@ -3438,7 +3618,10 @@
|
|
|
3438
3618
|
* @returns amisSchema
|
|
3439
3619
|
*/
|
|
3440
3620
|
function getObjectListHeader$1(objectSchema, listViewName, ctx) {
|
|
3441
|
-
|
|
3621
|
+
if (!ctx) {
|
|
3622
|
+
ctx = {};
|
|
3623
|
+
}
|
|
3624
|
+
let firstLineSchema = getObjectListHeaderFirstLine(objectSchema, listViewName, ctx);
|
|
3442
3625
|
let body = [firstLineSchema];
|
|
3443
3626
|
let headerSchema = [{
|
|
3444
3627
|
"type": "wrapper",
|
|
@@ -3459,35 +3642,11 @@
|
|
|
3459
3642
|
const { showRecordTitle = true } = options || {};
|
|
3460
3643
|
// console.log('getObjectRecordDetailHeader==>', objectSchema, recordId)
|
|
3461
3644
|
const { name, label, icon, NAME_FIELD_KEY } = objectSchema;
|
|
3462
|
-
|
|
3463
|
-
|
|
3464
|
-
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
let amisButtonsSchema = ___default.map(buttons, (button) => {
|
|
3468
|
-
return {
|
|
3469
|
-
type: 'steedos-object-button',
|
|
3470
|
-
name: button.name,
|
|
3471
|
-
objectName: button.objectName,
|
|
3472
|
-
visibleOn: getButtonVisibleOn$1(button),
|
|
3473
|
-
className: `button_${button.name}`
|
|
3474
|
-
}
|
|
3475
|
-
});
|
|
3476
|
-
let dropdownButtons = ___default.map(moreButtons, (button) => {
|
|
3477
|
-
return {
|
|
3478
|
-
type: 'steedos-object-button',
|
|
3479
|
-
name: button.name,
|
|
3480
|
-
objectName: button.objectName,
|
|
3481
|
-
visibleOn: getButtonVisibleOn$1(button),
|
|
3482
|
-
}
|
|
3483
|
-
});
|
|
3484
|
-
const dropdownButtonsSchema = {
|
|
3485
|
-
type: "steedos-dropdown-button",
|
|
3486
|
-
label: "",
|
|
3487
|
-
buttons: dropdownButtons,
|
|
3488
|
-
className: 'slds-icon'
|
|
3489
|
-
};
|
|
3490
|
-
amisButtonsSchema.push(dropdownButtonsSchema);
|
|
3645
|
+
|
|
3646
|
+
let amisButtonsSchema = getObjectDetailButtonsSchemas(objectSchema, recordId, options);
|
|
3647
|
+
|
|
3648
|
+
// console.log(`getObjectRecordDetailHeader==>`, amisButtonsSchema)
|
|
3649
|
+
|
|
3491
3650
|
const reg = new RegExp('_', 'g');
|
|
3492
3651
|
const standardIcon = icon && icon.replace(reg, '-');
|
|
3493
3652
|
|
|
@@ -3698,8 +3857,8 @@
|
|
|
3698
3857
|
"icon": "fa fa-table-columns",
|
|
3699
3858
|
"btnClassName": "antd-Button--iconOnly bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
3700
3859
|
"align": "right",
|
|
3701
|
-
"visibleOn": "${
|
|
3702
|
-
"buttons": [
|
|
3860
|
+
"visibleOn": "${window:innerWidth > 768 && !!!isLookup}",
|
|
3861
|
+
"buttons": [
|
|
3703
3862
|
{
|
|
3704
3863
|
"label": "显示为",
|
|
3705
3864
|
"children": buttons
|
|
@@ -3796,6 +3955,7 @@ setTimeout(()=>{
|
|
|
3796
3955
|
`;
|
|
3797
3956
|
return [
|
|
3798
3957
|
// "bulkActions",
|
|
3958
|
+
...(headerToolbarItems || []),
|
|
3799
3959
|
hiddenCount ? {} :{
|
|
3800
3960
|
"type": "tpl",
|
|
3801
3961
|
"tpl": "${count} 个项目"
|
|
@@ -3940,7 +4100,7 @@ setTimeout(()=>{
|
|
|
3940
4100
|
"list_view": "${uiSchema.list_views[listName]}",
|
|
3941
4101
|
"appId": "${appId}",
|
|
3942
4102
|
"global": "${global}",
|
|
3943
|
-
"
|
|
4103
|
+
"targetObjectName": "${objectName}",
|
|
3944
4104
|
},
|
|
3945
4105
|
"body": [
|
|
3946
4106
|
{
|
|
@@ -3980,7 +4140,7 @@ setTimeout(()=>{
|
|
|
3980
4140
|
{
|
|
3981
4141
|
"args": {
|
|
3982
4142
|
// 直接使用recordId不能拿到数据,只能通过result里面拿数据
|
|
3983
|
-
"url": "${context.rootUrl}/app/${appId}/${
|
|
4143
|
+
"url": "${context.rootUrl}/app/${appId}/${targetObjectName}/grid/listview_${result.data.recordId|lowerCase}",
|
|
3984
4144
|
"blank": false
|
|
3985
4145
|
},
|
|
3986
4146
|
"actionType": "url",
|
|
@@ -4021,7 +4181,7 @@ setTimeout(()=>{
|
|
|
4021
4181
|
"data": {
|
|
4022
4182
|
"&": "$$",
|
|
4023
4183
|
"listName": "${listName}",
|
|
4024
|
-
"
|
|
4184
|
+
"targetObjectName": "${objectName}",
|
|
4025
4185
|
"list_view": "${uiSchema.list_views[listName]}",
|
|
4026
4186
|
"appId": "${appId}",
|
|
4027
4187
|
"global": "${global}"
|
|
@@ -4064,7 +4224,7 @@ setTimeout(()=>{
|
|
|
4064
4224
|
"actions": [
|
|
4065
4225
|
{
|
|
4066
4226
|
"args": {
|
|
4067
|
-
"url": "${context.rootUrl}/app/${appId}/${
|
|
4227
|
+
"url": "${context.rootUrl}/app/${appId}/${targetObjectName}/grid/listview_${result.data.recordId|lowerCase}",
|
|
4068
4228
|
"blank": false
|
|
4069
4229
|
},
|
|
4070
4230
|
"actionType": "url",
|
|
@@ -4100,7 +4260,7 @@ setTimeout(()=>{
|
|
|
4100
4260
|
"type": "dialog",
|
|
4101
4261
|
"title": "重命名 列表视图",
|
|
4102
4262
|
"data": {
|
|
4103
|
-
"
|
|
4263
|
+
"targetObjectName": "${objectName}",
|
|
4104
4264
|
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4105
4265
|
"appId": "${appId}"
|
|
4106
4266
|
},
|
|
@@ -4121,7 +4281,7 @@ setTimeout(()=>{
|
|
|
4121
4281
|
"actions": [
|
|
4122
4282
|
{
|
|
4123
4283
|
"args": {
|
|
4124
|
-
"url": "${context.rootUrl}/app/${appId}/${
|
|
4284
|
+
"url": "${context.rootUrl}/app/${appId}/${targetObjectName}/grid/${name}",
|
|
4125
4285
|
"blank": false
|
|
4126
4286
|
},
|
|
4127
4287
|
"actionType": "url",
|
|
@@ -4195,6 +4355,7 @@ setTimeout(()=>{
|
|
|
4195
4355
|
"type": "dialog",
|
|
4196
4356
|
"title": "过滤设置",
|
|
4197
4357
|
"data": {
|
|
4358
|
+
"targetObjectName": "${objectName}",
|
|
4198
4359
|
"objectName": "${objectName}",
|
|
4199
4360
|
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4200
4361
|
"listName": "${listName}",
|
|
@@ -4220,7 +4381,7 @@ setTimeout(()=>{
|
|
|
4220
4381
|
"actions": [
|
|
4221
4382
|
{
|
|
4222
4383
|
"args": {
|
|
4223
|
-
"url": "${context.rootUrl}/app/${appId}/${
|
|
4384
|
+
"url": "${context.rootUrl}/app/${appId}/${targetObjectName}/grid/${listName}",
|
|
4224
4385
|
"blank": false
|
|
4225
4386
|
},
|
|
4226
4387
|
"actionType": "url",
|
|
@@ -4258,6 +4419,7 @@ setTimeout(()=>{
|
|
|
4258
4419
|
"title": "显示的列",
|
|
4259
4420
|
"data": {
|
|
4260
4421
|
"&": "$$",
|
|
4422
|
+
"targetObjectName": "${objectName}",
|
|
4261
4423
|
"objectName": "${objectName}",
|
|
4262
4424
|
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4263
4425
|
"listName": "${listName}",
|
|
@@ -4283,7 +4445,7 @@ setTimeout(()=>{
|
|
|
4283
4445
|
"actions": [
|
|
4284
4446
|
{
|
|
4285
4447
|
"args": {
|
|
4286
|
-
"url": "${context.rootUrl}/app/${appId}/${
|
|
4448
|
+
"url": "${context.rootUrl}/app/${appId}/${targetObjectName}/grid/${listName}",
|
|
4287
4449
|
"blank": false
|
|
4288
4450
|
},
|
|
4289
4451
|
"actionType": "url"
|
|
@@ -4319,6 +4481,7 @@ setTimeout(()=>{
|
|
|
4319
4481
|
"title": "弹框标题",
|
|
4320
4482
|
"data": {
|
|
4321
4483
|
"&": "$$",
|
|
4484
|
+
"targetObjectName": "${objectName}",
|
|
4322
4485
|
"objectName": "${objectName}",
|
|
4323
4486
|
"recordId": "${uiSchema.list_views[listName]._id}",
|
|
4324
4487
|
"listName": "${listName}",
|
|
@@ -4344,7 +4507,7 @@ setTimeout(()=>{
|
|
|
4344
4507
|
"actions": [
|
|
4345
4508
|
{
|
|
4346
4509
|
"args": {
|
|
4347
|
-
"url": "${context.rootUrl}/app/${appId}/${
|
|
4510
|
+
"url": "${context.rootUrl}/app/${appId}/${targetObjectName}/grid/${listName}",
|
|
4348
4511
|
"blank": false
|
|
4349
4512
|
},
|
|
4350
4513
|
"actionType": "url"
|
|
@@ -4892,13 +5055,16 @@ setTimeout(()=>{
|
|
|
4892
5055
|
var sort = orderBy + ' ' + orderDir;
|
|
4893
5056
|
sort = orderBy ? sort : "${sort}";
|
|
4894
5057
|
var allowSearchFields = ${JSON.stringify(searchableFields)};
|
|
5058
|
+
let fieldValue;
|
|
4895
5059
|
if(api.data.$term){
|
|
4896
5060
|
filters = [["name", "contains", "'+ api.data.$term +'"]];
|
|
4897
5061
|
}else if(selfData.op === 'loadOptions' && selfData.value){
|
|
4898
5062
|
if(selfData.value?.indexOf(',') > 0){
|
|
4899
|
-
|
|
5063
|
+
fieldValue = selfData.value.split(',');
|
|
5064
|
+
filters = [["${referenceTo.valueField.name}", "=", fieldValue]];
|
|
4900
5065
|
}else{
|
|
4901
|
-
|
|
5066
|
+
fieldValue = selfData.value;
|
|
5067
|
+
filters = [["${referenceTo.valueField.name}", "=", fieldValue]];
|
|
4902
5068
|
}
|
|
4903
5069
|
}
|
|
4904
5070
|
|
|
@@ -4952,6 +5118,9 @@ setTimeout(()=>{
|
|
|
4952
5118
|
if(enable_tree){
|
|
4953
5119
|
pageSize = 10000;
|
|
4954
5120
|
}
|
|
5121
|
+
if(fieldValue && _.isArray(fieldValue) && fieldValue.length > pageSize){
|
|
5122
|
+
pageSize = fieldValue.length;
|
|
5123
|
+
}
|
|
4955
5124
|
api.data.query = api.data.query.replace(/{__filters}/g, JSON.stringify(filters)).replace('{__top}', pageSize).replace('{__skip}', skip).replace('{__sort}', sort.trim());
|
|
4956
5125
|
return api;
|
|
4957
5126
|
`;
|
|
@@ -5032,6 +5201,8 @@ setTimeout(()=>{
|
|
|
5032
5201
|
...ctx
|
|
5033
5202
|
});
|
|
5034
5203
|
|
|
5204
|
+
pickerSchema.affixHeader = false;
|
|
5205
|
+
|
|
5035
5206
|
var headerToolbarItems = [];
|
|
5036
5207
|
const isMobile = window.innerWidth < 768;
|
|
5037
5208
|
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user" && !isMobile){
|
|
@@ -5049,14 +5220,11 @@ setTimeout(()=>{
|
|
|
5049
5220
|
pickerSchema.headerToolbar.push(new_button);
|
|
5050
5221
|
}
|
|
5051
5222
|
pickerSchema.footerToolbar = refObjectConfig.enable_tree ? [] : getObjectFooterToolbar();
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
...ctx
|
|
5058
|
-
});
|
|
5059
|
-
}
|
|
5223
|
+
if (ctx.filterVisible !== false) {
|
|
5224
|
+
pickerSchema.filter = await getObjectFilter(refObjectConfig, fields, {
|
|
5225
|
+
isLookup: true,
|
|
5226
|
+
...ctx
|
|
5227
|
+
});
|
|
5060
5228
|
}
|
|
5061
5229
|
pickerSchema.data = Object.assign({}, pickerSchema.data, {
|
|
5062
5230
|
"&": "$$",
|
|
@@ -5240,11 +5408,12 @@ setTimeout(()=>{
|
|
|
5240
5408
|
autoComplete: apiInfo,
|
|
5241
5409
|
searchable: true,
|
|
5242
5410
|
};
|
|
5411
|
+
//删除xlink:href中的rootUrl前缀,解决客户端svg为空的问题
|
|
5243
5412
|
const select_menuTpl = `<span class='flex items-center mt-0.5'>
|
|
5244
5413
|
<span role='img' aria-label='smile' class='anticon anticon-smile'>
|
|
5245
5414
|
<span class='slds-icon_container slds-icon-standard-\${REPLACE(icon,'_','-')}'>
|
|
5246
5415
|
<svg class='slds-icon slds-icon_x-small' aria-hidden='true'>
|
|
5247
|
-
<use xlink:href='
|
|
5416
|
+
<use xlink:href='/assets/icons/standard-sprite/svg/symbols.svg#\${icon}'></use>
|
|
5248
5417
|
</svg>
|
|
5249
5418
|
</span>
|
|
5250
5419
|
</span>
|
|
@@ -5302,8 +5471,10 @@ setTimeout(()=>{
|
|
|
5302
5471
|
|
|
5303
5472
|
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user"){
|
|
5304
5473
|
if(ctx.idsDependOn || field.amis){
|
|
5474
|
+
// ids人员点选模式
|
|
5305
5475
|
return await lookupToAmisIdsPicker(field, readonly, ctx);
|
|
5306
5476
|
}
|
|
5477
|
+
// 左侧树右侧人员列表的下拉框模式,不再支持,而是执行下面的lookupToAmisPicker函数弹出选人窗口
|
|
5307
5478
|
// return await lookupToAmisSelectUser(field, readonly, ctx);
|
|
5308
5479
|
}
|
|
5309
5480
|
|
|
@@ -5404,6 +5575,9 @@ setTimeout(()=>{
|
|
|
5404
5575
|
top: top,
|
|
5405
5576
|
...ctx
|
|
5406
5577
|
});
|
|
5578
|
+
|
|
5579
|
+
pickerSchema.affixHeader = false;
|
|
5580
|
+
|
|
5407
5581
|
}
|
|
5408
5582
|
|
|
5409
5583
|
const data = {
|
|
@@ -5433,7 +5607,6 @@ setTimeout(()=>{
|
|
|
5433
5607
|
if(readonly){
|
|
5434
5608
|
data.tpl = await getLookupTpl(field, ctx);
|
|
5435
5609
|
}
|
|
5436
|
-
|
|
5437
5610
|
return data;
|
|
5438
5611
|
}
|
|
5439
5612
|
|
|
@@ -6012,7 +6185,7 @@ setTimeout(()=>{
|
|
|
6012
6185
|
convertData = {
|
|
6013
6186
|
type: "editor",
|
|
6014
6187
|
language: field.language,
|
|
6015
|
-
|
|
6188
|
+
editorDidMount: new Function('editor', 'monaco', field.editorDidMount)
|
|
6016
6189
|
};
|
|
6017
6190
|
break;
|
|
6018
6191
|
case 'toggle':
|
|
@@ -6033,7 +6206,7 @@ setTimeout(()=>{
|
|
|
6033
6206
|
columnsTogglable: false,
|
|
6034
6207
|
strictMode:false,
|
|
6035
6208
|
affixHeader: false, // 是否固定表头, 不固定表头, 否则form有y轴滚动条时, 表头会跟随滚动条滚动.
|
|
6036
|
-
|
|
6209
|
+
needConfirm: false,
|
|
6037
6210
|
editable: !readonly,
|
|
6038
6211
|
addable: !readonly,
|
|
6039
6212
|
removable: !readonly,
|
|
@@ -6263,6 +6436,12 @@ setTimeout(()=>{
|
|
|
6263
6436
|
// })
|
|
6264
6437
|
|
|
6265
6438
|
return `
|
|
6439
|
+
if(payload.data.data.length === 0){
|
|
6440
|
+
return {
|
|
6441
|
+
status: 2,
|
|
6442
|
+
msg: "无法找到记录"
|
|
6443
|
+
}
|
|
6444
|
+
}
|
|
6266
6445
|
if(payload.data.data){
|
|
6267
6446
|
var data = payload.data.data[0];
|
|
6268
6447
|
var gridAndObjectFieldsName = ${JSON.stringify(gridAndObjectFieldsName)};
|
|
@@ -6387,12 +6566,12 @@ setTimeout(()=>{
|
|
|
6387
6566
|
});
|
|
6388
6567
|
}
|
|
6389
6568
|
}else{
|
|
6390
|
-
data[item] = {
|
|
6569
|
+
data[item] = [{
|
|
6391
6570
|
value: fileFieldValue,
|
|
6392
6571
|
name: fileFieldDisplayValue.name,
|
|
6393
6572
|
url: fileFieldDisplayValue.url + "?download=true",
|
|
6394
6573
|
state: "uploaded"
|
|
6395
|
-
};
|
|
6574
|
+
}];
|
|
6396
6575
|
}
|
|
6397
6576
|
}
|
|
6398
6577
|
})
|
|
@@ -6410,7 +6589,7 @@ setTimeout(()=>{
|
|
|
6410
6589
|
|
|
6411
6590
|
return {
|
|
6412
6591
|
method: "post",
|
|
6413
|
-
url: getApi$2(),
|
|
6592
|
+
url: getApi$2() + '&objectName=${objectName}' ,
|
|
6414
6593
|
// sendOn: "!!this.recordId",
|
|
6415
6594
|
cache: API_CACHE,
|
|
6416
6595
|
requestAdaptor: `
|
|
@@ -6716,7 +6895,7 @@ setTimeout(()=>{
|
|
|
6716
6895
|
}),
|
|
6717
6896
|
filter: options.filterVisible !== false && await getObjectFilter(objectSchema, fields, options),
|
|
6718
6897
|
};
|
|
6719
|
-
if(options.formFactor !== 'SMALL'){
|
|
6898
|
+
if(options.formFactor !== 'SMALL' || ["split"].indexOf(options.displayAs) == -1){
|
|
6720
6899
|
Object.assign(bodyProps, {
|
|
6721
6900
|
bulkActions: options.bulkActions != false ? bulkActions : false
|
|
6722
6901
|
});
|
|
@@ -6930,7 +7109,8 @@ setTimeout(()=>{
|
|
|
6930
7109
|
"eventName": `@data.changed.${objectSchema.name}`
|
|
6931
7110
|
},
|
|
6932
7111
|
"data": {
|
|
6933
|
-
"objectName": `${objectSchema.name}
|
|
7112
|
+
"objectName": `${objectSchema.name}`,
|
|
7113
|
+
"displayAs": "${displayAs}"
|
|
6934
7114
|
}
|
|
6935
7115
|
},
|
|
6936
7116
|
{
|
|
@@ -7030,7 +7210,8 @@ setTimeout(()=>{
|
|
|
7030
7210
|
data: {
|
|
7031
7211
|
objectName: "${event.data.__objectName}",
|
|
7032
7212
|
record: "${event.data.__record}"
|
|
7033
|
-
}
|
|
7213
|
+
},
|
|
7214
|
+
expression: "${event.data.__response.error != true}"
|
|
7034
7215
|
},
|
|
7035
7216
|
{
|
|
7036
7217
|
"actionType": "setValue",
|
|
@@ -7038,7 +7219,8 @@ setTimeout(()=>{
|
|
|
7038
7219
|
value: {
|
|
7039
7220
|
"recordLoaded": true,
|
|
7040
7221
|
}
|
|
7041
|
-
}
|
|
7222
|
+
},
|
|
7223
|
+
expression: "${event.data.__response.error != true}"
|
|
7042
7224
|
}
|
|
7043
7225
|
]
|
|
7044
7226
|
}
|
|
@@ -7046,6 +7228,21 @@ setTimeout(()=>{
|
|
|
7046
7228
|
}
|
|
7047
7229
|
}
|
|
7048
7230
|
|
|
7231
|
+
/*
|
|
7232
|
+
* @Author: baozhoutao@steedos.com
|
|
7233
|
+
* @Date: 2022-08-04 10:42:49
|
|
7234
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
7235
|
+
* @LastEditTime: 2022-08-25 10:28:47
|
|
7236
|
+
* @Description:
|
|
7237
|
+
*/
|
|
7238
|
+
var config = {
|
|
7239
|
+
listView: {
|
|
7240
|
+
newRecordMode: 'modal',
|
|
7241
|
+
editRecordMode: 'modal',
|
|
7242
|
+
perPage: 20
|
|
7243
|
+
}
|
|
7244
|
+
};
|
|
7245
|
+
|
|
7049
7246
|
async function getTableColumns$1(fields, options){
|
|
7050
7247
|
const columns = [{name: '_index',type: 'text', width: 32, placeholder: ""}];
|
|
7051
7248
|
for (const field of fields) {
|
|
@@ -7119,6 +7316,13 @@ setTimeout(()=>{
|
|
|
7119
7316
|
}else if(field.type === 'html'){
|
|
7120
7317
|
type = 'markdown';
|
|
7121
7318
|
}
|
|
7319
|
+
let className = "";
|
|
7320
|
+
if(field.type === 'textarea'){
|
|
7321
|
+
className = 'min-w-56';
|
|
7322
|
+
}
|
|
7323
|
+
if(field.wrap === false){
|
|
7324
|
+
className += " whitespace-nowrap";
|
|
7325
|
+
}
|
|
7122
7326
|
if(!field.hidden && !field.extra){
|
|
7123
7327
|
columns.push(Object.assign({}, {
|
|
7124
7328
|
name: field.name,
|
|
@@ -7129,7 +7333,7 @@ setTimeout(()=>{
|
|
|
7129
7333
|
type: type,
|
|
7130
7334
|
tpl: tpl,
|
|
7131
7335
|
toggled: field.toggled,
|
|
7132
|
-
className
|
|
7336
|
+
className,
|
|
7133
7337
|
html: field.type === 'html' ? true : null
|
|
7134
7338
|
// toggled: true
|
|
7135
7339
|
}, field.amis, {name: field.name}));
|
|
@@ -7254,8 +7458,9 @@ setTimeout(()=>{
|
|
|
7254
7458
|
const url = getNameTplUrl(nameField, options);
|
|
7255
7459
|
|
|
7256
7460
|
const columnLines = getMobileLines(tpls);
|
|
7257
|
-
|
|
7258
|
-
|
|
7461
|
+
|
|
7462
|
+
|
|
7463
|
+
let column = {
|
|
7259
7464
|
name: nameField.name,
|
|
7260
7465
|
label: nameField.label,
|
|
7261
7466
|
sortable: nameField.sortable,
|
|
@@ -7264,13 +7469,66 @@ setTimeout(()=>{
|
|
|
7264
7469
|
actionType: "link",
|
|
7265
7470
|
link: url,
|
|
7266
7471
|
innerClassName: "steedos-listview-item block text-gray-500",
|
|
7267
|
-
body:{
|
|
7472
|
+
body: {
|
|
7268
7473
|
"type": "wrapper",
|
|
7269
7474
|
"body": columnLines,
|
|
7270
7475
|
"size": "none",
|
|
7271
7476
|
"className": "p-1"
|
|
7272
7477
|
}
|
|
7273
|
-
}
|
|
7478
|
+
};
|
|
7479
|
+
|
|
7480
|
+
if(options.objectName === 'cms_files'){
|
|
7481
|
+
if(window.Meteor?.isCordova){
|
|
7482
|
+
column = {
|
|
7483
|
+
...column,
|
|
7484
|
+
actionType: "",
|
|
7485
|
+
link: "",
|
|
7486
|
+
onEvent: {
|
|
7487
|
+
"click": {
|
|
7488
|
+
"actions": [
|
|
7489
|
+
{
|
|
7490
|
+
"script": `
|
|
7491
|
+
let cms_url = "/api/files/files/"+event.data.versions[0]+"?download=true"
|
|
7492
|
+
Steedos.cordovaDownload(encodeURI(Steedos.absoluteUrl(cms_url)), event.data.name);
|
|
7493
|
+
`,
|
|
7494
|
+
"actionType": "custom"
|
|
7495
|
+
}
|
|
7496
|
+
],
|
|
7497
|
+
"weight": 0
|
|
7498
|
+
}
|
|
7499
|
+
}
|
|
7500
|
+
};
|
|
7501
|
+
}else {
|
|
7502
|
+
column = {
|
|
7503
|
+
...column,
|
|
7504
|
+
actionType: "",
|
|
7505
|
+
link: "",
|
|
7506
|
+
onEvent: {
|
|
7507
|
+
"click": {
|
|
7508
|
+
"actions": [
|
|
7509
|
+
{
|
|
7510
|
+
"args": {
|
|
7511
|
+
"api": {
|
|
7512
|
+
"url": url,
|
|
7513
|
+
"method": "get",
|
|
7514
|
+
"headers": {
|
|
7515
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
7516
|
+
}
|
|
7517
|
+
}
|
|
7518
|
+
},
|
|
7519
|
+
"actionType": "download"
|
|
7520
|
+
}
|
|
7521
|
+
],
|
|
7522
|
+
"weight": 0
|
|
7523
|
+
}
|
|
7524
|
+
}
|
|
7525
|
+
};
|
|
7526
|
+
}
|
|
7527
|
+
|
|
7528
|
+
}
|
|
7529
|
+
|
|
7530
|
+
columns.push(column);
|
|
7531
|
+
|
|
7274
7532
|
|
|
7275
7533
|
return columns;
|
|
7276
7534
|
}
|
|
@@ -7389,7 +7647,7 @@ setTimeout(()=>{
|
|
|
7389
7647
|
options = {};
|
|
7390
7648
|
}
|
|
7391
7649
|
let columns = [];
|
|
7392
|
-
if(options.formFactor === 'SMALL'){
|
|
7650
|
+
if(options.formFactor === 'SMALL' || ["split"].indexOf(options.displayAs) > -1){
|
|
7393
7651
|
columns = await getMobileTableColumns(fields, options);
|
|
7394
7652
|
}
|
|
7395
7653
|
else {
|
|
@@ -7592,7 +7850,11 @@ setTimeout(()=>{
|
|
|
7592
7850
|
filters = systemFilters;
|
|
7593
7851
|
};
|
|
7594
7852
|
if(api.data.$self.additionalFilters){
|
|
7595
|
-
|
|
7853
|
+
if(_.isString(api.data.$self.additionalFilters)){
|
|
7854
|
+
userFilters.push(eval(api.data.$self.additionalFilters))
|
|
7855
|
+
}else{
|
|
7856
|
+
userFilters.push(api.data.$self.additionalFilters)
|
|
7857
|
+
}
|
|
7596
7858
|
}
|
|
7597
7859
|
|
|
7598
7860
|
if(api.data.$self._isRelated){
|
|
@@ -7625,8 +7887,7 @@ setTimeout(()=>{
|
|
|
7625
7887
|
if(_.isEmpty(filters)){
|
|
7626
7888
|
filters = userFilters;
|
|
7627
7889
|
}else{
|
|
7628
|
-
filters
|
|
7629
|
-
filters.push(userFilters)
|
|
7890
|
+
filters = [filters, 'and', userFilters]
|
|
7630
7891
|
}
|
|
7631
7892
|
}
|
|
7632
7893
|
api.data = {
|
|
@@ -8053,7 +8314,6 @@ setTimeout(()=>{
|
|
|
8053
8314
|
// ObjectForm会认作用域下的变量值
|
|
8054
8315
|
// TODO: 待组件支持initValues属性后应该改掉,不应该通过data直接传值
|
|
8055
8316
|
// TODO: 全天事件属性传入doc了但是没有生效,需要手动在ObjectForm中勾选全天事件
|
|
8056
|
-
event.data = doc;
|
|
8057
8317
|
const title = "新建 ${objectSchema.label}";
|
|
8058
8318
|
doAction(
|
|
8059
8319
|
{
|
|
@@ -8066,6 +8326,7 @@ setTimeout(()=>{
|
|
|
8066
8326
|
"type": "steedos-object-form",
|
|
8067
8327
|
"objectApiName": "\${objectName}",
|
|
8068
8328
|
"mode": "edit",
|
|
8329
|
+
"defaultData": doc,
|
|
8069
8330
|
"onEvent": {
|
|
8070
8331
|
"submitSucc": {
|
|
8071
8332
|
"weight": 0,
|
|
@@ -8358,7 +8619,7 @@ setTimeout(()=>{
|
|
|
8358
8619
|
* @Author: baozhoutao@steedos.com
|
|
8359
8620
|
* @Date: 2022-07-05 15:55:39
|
|
8360
8621
|
* @LastEditors: Please set LastEditors
|
|
8361
|
-
* @LastEditTime: 2023-
|
|
8622
|
+
* @LastEditTime: 2023-05-08 16:34:25
|
|
8362
8623
|
* @Description:
|
|
8363
8624
|
*/
|
|
8364
8625
|
|
|
@@ -8612,7 +8873,7 @@ setTimeout(()=>{
|
|
|
8612
8873
|
}
|
|
8613
8874
|
function getRelatedListProps(uiSchema, listViewName, ctx) {
|
|
8614
8875
|
if (ctx.columns) {
|
|
8615
|
-
const sort = getListViewSort(ctx.sort);
|
|
8876
|
+
const sort = getListViewSort({sort: ctx.sort});
|
|
8616
8877
|
let { filters , filtersFunction} = ctx;
|
|
8617
8878
|
if(!filtersFunction && filters){
|
|
8618
8879
|
filtersFunction = str2function(
|
|
@@ -8701,7 +8962,7 @@ setTimeout(()=>{
|
|
|
8701
8962
|
* @Author: baozhoutao@steedos.com
|
|
8702
8963
|
* @Date: 2022-07-05 15:55:39
|
|
8703
8964
|
* @LastEditors: baozhoutao@steedos.com
|
|
8704
|
-
* @LastEditTime: 2023-04-
|
|
8965
|
+
* @LastEditTime: 2023-04-28 11:11:29
|
|
8705
8966
|
* @Description:
|
|
8706
8967
|
*/
|
|
8707
8968
|
|
|
@@ -8899,6 +9160,9 @@ setTimeout(()=>{
|
|
|
8899
9160
|
ctx = {}
|
|
8900
9161
|
) {
|
|
8901
9162
|
const uiSchema = await getUISchema(objectName);
|
|
9163
|
+
if(!uiSchema){
|
|
9164
|
+
return {}
|
|
9165
|
+
}
|
|
8902
9166
|
const listView = ___default.find(
|
|
8903
9167
|
uiSchema.list_views,
|
|
8904
9168
|
(listView, name) => {
|
|
@@ -9452,7 +9716,10 @@ setTimeout(()=>{
|
|
|
9452
9716
|
const defaults = ctx.defaults || {};
|
|
9453
9717
|
if(!defaults.headerSchema){
|
|
9454
9718
|
//传入isListviewInit是区别于对象列表类型的微页面,即getListPageInitSchema函数中该属性为false
|
|
9455
|
-
const headerSchema = await getObjectListHeader$1(uiSchema
|
|
9719
|
+
const headerSchema = await getObjectListHeader$1(uiSchema, listViewName, {
|
|
9720
|
+
onlySecordLine: true,
|
|
9721
|
+
isListviewInit: true
|
|
9722
|
+
});
|
|
9456
9723
|
defaults.headerSchema = headerSchema;
|
|
9457
9724
|
}
|
|
9458
9725
|
ctx.defaults = defaults;
|
|
@@ -12130,6 +12397,7 @@ setTimeout(()=>{
|
|
|
12130
12397
|
getLookupSapceUserTreeSchema: getLookupSapceUserTreeSchema,
|
|
12131
12398
|
getNotifications: getNotifications,
|
|
12132
12399
|
getObjectDetailButtons: getObjectDetailButtons,
|
|
12400
|
+
getObjectDetailButtonsSchemas: getObjectDetailButtonsSchemas,
|
|
12133
12401
|
getObjectDetailMoreButtons: getObjectDetailMoreButtons,
|
|
12134
12402
|
getObjectFieldsFilterBarSchema: getObjectFieldsFilterBarSchema,
|
|
12135
12403
|
getObjectFieldsFilterButtonSchema: getObjectFieldsFilterButtonSchema,
|
|
@@ -12138,6 +12406,7 @@ setTimeout(()=>{
|
|
|
12138
12406
|
getObjectListHeaderFieldsFilterBar: getObjectListHeaderFieldsFilterBar,
|
|
12139
12407
|
getObjectListHeaderFirstLine: getObjectListHeaderFirstLine,
|
|
12140
12408
|
getObjectListHeaderSecordLine: getObjectListHeaderSecordLine,
|
|
12409
|
+
getObjectListViewButtonsSchemas: getObjectListViewButtonsSchemas,
|
|
12141
12410
|
getObjectRecordDetailHeader: getObjectRecordDetailHeader,
|
|
12142
12411
|
getObjectRecordDetailRelatedListHeader: getObjectRecordDetailRelatedListHeader,
|
|
12143
12412
|
getObjectRelated: getObjectRelated,
|
|
@@ -12385,15 +12654,16 @@ setTimeout(()=>{
|
|
|
12385
12654
|
React__default["default"].createElement("svg", { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 24 24", "stroke-width": "1.5", stroke: "currentColor", className: "animate-spin w-4 h-4" },
|
|
12386
12655
|
React__default["default"].createElement("path", { "stroke-linecap": "round", "stroke-linejoin": "round", d: "M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99" }))));
|
|
12387
12656
|
}
|
|
12657
|
+
// console.log('AmisObjectButton===>', button, className);
|
|
12388
12658
|
if (button.type === "amis_button") {
|
|
12389
12659
|
var amisSchema = button.amis_schema;
|
|
12390
12660
|
var schema = ___default.isString(amisSchema) ? JSON.parse(amisSchema) : amisSchema;
|
|
12391
12661
|
if (schema && schema.body.length > 0) {
|
|
12392
12662
|
delete schema.body[0]['visibleOn'];
|
|
12393
12663
|
}
|
|
12394
|
-
|
|
12395
|
-
|
|
12396
|
-
|
|
12664
|
+
if (schema && className) {
|
|
12665
|
+
schema.className = schema.className + ' ' + className;
|
|
12666
|
+
}
|
|
12397
12667
|
var renderData = Object.assign(data, { objectName: objectName, app_id: appId, className: className });
|
|
12398
12668
|
if (data._id) {
|
|
12399
12669
|
renderData.recordId = data._id;
|
|
@@ -12419,7 +12689,10 @@ setTimeout(()=>{
|
|
|
12419
12689
|
|
|
12420
12690
|
var getMenu = function (render, buttons, btnClassName, props) {
|
|
12421
12691
|
return ___default.map(buttons, function (button) {
|
|
12422
|
-
|
|
12692
|
+
if (btnClassName) {
|
|
12693
|
+
button.className = "".concat(button.className, " ").concat(btnClassName);
|
|
12694
|
+
}
|
|
12695
|
+
delete button.className;
|
|
12423
12696
|
return {
|
|
12424
12697
|
key: button.name,
|
|
12425
12698
|
label: (React__default["default"].createElement(React__default["default"].Fragment, null, render('body', button, props)))
|
|
@@ -12654,7 +12927,9 @@ setTimeout(()=>{
|
|
|
12654
12927
|
}
|
|
12655
12928
|
amisSchema.className = "steedos-object-form ".concat(className);
|
|
12656
12929
|
amisSchema.data = Object.assign(amisSchema.data, formData, { global: globalData, uiSchema: uiSchema });
|
|
12657
|
-
|
|
12930
|
+
if (___default.has(props, 'objectApiName')) {
|
|
12931
|
+
amisSchema.data.objectName = objectApiName;
|
|
12932
|
+
}
|
|
12658
12933
|
return [2 /*return*/, amisSchema];
|
|
12659
12934
|
}
|
|
12660
12935
|
});
|
|
@@ -12662,8 +12937,9 @@ setTimeout(()=>{
|
|
|
12662
12937
|
|
|
12663
12938
|
var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
12664
12939
|
var $schema, top, perPage, _a, showHeader, data, defaultData, _b, className, crudClassName, _c, showDisplayAs, sideSchema, _e, filterVisible, headerToolbarItems, headerSchema, ctx, listName, defaults, objectApiName, displayAs, formFactor, isMobile, uiSchema, listView, schemaKeys, listSchema, setDataToComponentId, amisSchemaData, listViewId, listViewSchemaProps, serviceData;
|
|
12665
|
-
|
|
12666
|
-
|
|
12940
|
+
var _f;
|
|
12941
|
+
return __generator(this, function (_g) {
|
|
12942
|
+
switch (_g.label) {
|
|
12667
12943
|
case 0:
|
|
12668
12944
|
// console.time('AmisObjectListView')
|
|
12669
12945
|
console.log("AmisObjectListView props", props);
|
|
@@ -12671,6 +12947,7 @@ setTimeout(()=>{
|
|
|
12671
12947
|
headerSchema = props.headerSchema;
|
|
12672
12948
|
ctx = props.ctx;
|
|
12673
12949
|
listName = (defaultData === null || defaultData === void 0 ? void 0 : defaultData.listName) || (data === null || data === void 0 ? void 0 : data.listName) || (props === null || props === void 0 ? void 0 : props.listName);
|
|
12950
|
+
console.log('AmisObjectListView ==listName=>', listName);
|
|
12674
12951
|
defaults = {};
|
|
12675
12952
|
objectApiName = props.objectApiName || "space_users";
|
|
12676
12953
|
if (!ctx) {
|
|
@@ -12687,15 +12964,16 @@ setTimeout(()=>{
|
|
|
12687
12964
|
formFactor = 'LARGE';
|
|
12688
12965
|
}
|
|
12689
12966
|
}
|
|
12690
|
-
|
|
12691
|
-
|
|
12692
|
-
|
|
12967
|
+
// 分栏模式不应该改变尺寸变量值
|
|
12968
|
+
// if(["split"].indexOf(displayAs) > -1){
|
|
12969
|
+
// formFactor = 'SMALL';
|
|
12970
|
+
// }
|
|
12693
12971
|
if (!ctx.formFactor) {
|
|
12694
12972
|
ctx.formFactor = formFactor;
|
|
12695
12973
|
}
|
|
12696
12974
|
return [4 /*yield*/, getUISchema(objectApiName, false)];
|
|
12697
12975
|
case 1:
|
|
12698
|
-
uiSchema =
|
|
12976
|
+
uiSchema = _g.sent();
|
|
12699
12977
|
listView = ___default.find(uiSchema.list_views, function (listView, name) {
|
|
12700
12978
|
// 传入listViewName空值则取第一个
|
|
12701
12979
|
if (!listName) {
|
|
@@ -12747,14 +13025,26 @@ setTimeout(()=>{
|
|
|
12747
13025
|
listViewId = (ctx === null || ctx === void 0 ? void 0 : ctx.listViewId) || amisSchemaData.listViewId;
|
|
12748
13026
|
listViewSchemaProps = __assign$2(__assign$2({ top: top, perPage: perPage, showHeader: showHeader, defaults: defaults }, ctx), { listViewId: listViewId, setDataToComponentId: setDataToComponentId, filterVisible: filterVisible, showDisplayAs: showDisplayAs, displayAs: displayAs, headerToolbarItems: headerToolbarItems });
|
|
12749
13027
|
if (!headerSchema) {
|
|
12750
|
-
headerSchema = getObjectListHeader$1(uiSchema);
|
|
13028
|
+
headerSchema = getObjectListHeader$1(uiSchema, listName, ctx);
|
|
12751
13029
|
}
|
|
12752
13030
|
serviceData = Object.assign({}, { showDisplayAs: showDisplayAs, displayAs: displayAs, recordPermissions: uiSchema.permissions, _id: null, $listviewId: listName });
|
|
13031
|
+
if (___default.has(props, 'objectApiName')) {
|
|
13032
|
+
serviceData.objectName = objectApiName;
|
|
13033
|
+
}
|
|
13034
|
+
if (___default.has(props, 'listName') && ___default.has(props, '$$editor')) {
|
|
13035
|
+
serviceData.listName = listName;
|
|
13036
|
+
}
|
|
13037
|
+
if (!___default.has(data, 'uiSchema')) {
|
|
13038
|
+
serviceData.uiSchema = uiSchema;
|
|
13039
|
+
}
|
|
13040
|
+
serviceData.defaultListName = listName ? listName : (_f = ___default.first(___default.values(uiSchema.list_views))) === null || _f === void 0 ? void 0 : _f.name;
|
|
12753
13041
|
// console.timeEnd('AmisObjectListView')
|
|
13042
|
+
// console.log('serviceData===>', serviceData)
|
|
13043
|
+
// console.log('headerSchema===>', headerSchema)
|
|
12754
13044
|
return [2 /*return*/, {
|
|
12755
13045
|
type: "service",
|
|
12756
13046
|
data: serviceData,
|
|
12757
|
-
className: "".concat(className, " steedos-object-listview"),
|
|
13047
|
+
className: "".concat(className, " sm:bg-gray-100 h-full sm:shadow sm:rounded-tl sm:rounded-tr steedos-object-listview"),
|
|
12758
13048
|
body: [{
|
|
12759
13049
|
"type": "wrapper",
|
|
12760
13050
|
"size": "none",
|
|
@@ -12783,8 +13073,8 @@ setTimeout(()=>{
|
|
|
12783
13073
|
"headers": {
|
|
12784
13074
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
12785
13075
|
},
|
|
12786
|
-
"requestAdaptor": "console.log('service listview schemaApi requestAdaptor======>');api.data={query: '{spaces__findOne(id: \"
|
|
12787
|
-
"adaptor": "\n console.log('service listview schemaApi adaptor....', api.body); \n
|
|
13076
|
+
"requestAdaptor": "console.log('service listview schemaApi requestAdaptor======>');api.data={query: '{spaces__findOne(id: \"none\"){_id,name}}'};return api;",
|
|
13077
|
+
"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 // console.log(\"====listViewSchemaProps===>\", listName, listViewSchemaProps)\n window.getListSchema(appId, objectName, listName, listViewSchemaProps).then((schema)=>{\n payload.data = schema.amisSchema;\n // console.log(\"payload================>\", payload)\n resolve(payload)\n });\n });\n ")
|
|
12788
13078
|
},
|
|
12789
13079
|
// "body": body,
|
|
12790
13080
|
// "data": serviceData
|
|
@@ -12939,7 +13229,7 @@ setTimeout(()=>{
|
|
|
12939
13229
|
};
|
|
12940
13230
|
props.$schema, recordId = props.recordId, _b = props.onEvent, onEvent = _b === void 0 ? defaultOnEvent : _b, _c = props.showRecordTitle, showRecordTitle = _c === void 0 ? true : _c;
|
|
12941
13231
|
objectApiName = props.objectApiName || "space_users";
|
|
12942
|
-
return [4 /*yield*/, getRecordDetailHeaderSchema(objectApiName, recordId, { showRecordTitle: showRecordTitle })];
|
|
13232
|
+
return [4 /*yield*/, getRecordDetailHeaderSchema(objectApiName, recordId, { showRecordTitle: showRecordTitle, formFactor: props.data.formFactor })];
|
|
12943
13233
|
case 2:
|
|
12944
13234
|
schema = (_d.sent()).amisSchema;
|
|
12945
13235
|
schema.className = className;
|
|
@@ -12957,12 +13247,11 @@ setTimeout(()=>{
|
|
|
12957
13247
|
* @Description:
|
|
12958
13248
|
*/
|
|
12959
13249
|
var AmisRecordDetail = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
12960
|
-
var className, appId, _a, objectApiName, body, schema;
|
|
13250
|
+
var className, $schema, appId, _a, objectApiName, body, schema;
|
|
12961
13251
|
return __generator(this, function (_b) {
|
|
12962
13252
|
switch (_b.label) {
|
|
12963
13253
|
case 0:
|
|
12964
|
-
|
|
12965
|
-
className = props.className, props.$schema, appId = props.appId, _a = props.objectApiName, objectApiName = _a === void 0 ? "space_users" : _a, props.recordId, props.onEvent, props.defaultData, body = props.body;
|
|
13254
|
+
className = props.className, $schema = props.$schema, appId = props.appId, _a = props.objectApiName, objectApiName = _a === void 0 ? "space_users" : _a, props.recordId, props.onEvent, props.defaultData, body = props.body;
|
|
12966
13255
|
return [4 /*yield*/, getRecordDetailSchema(objectApiName, appId)];
|
|
12967
13256
|
case 1:
|
|
12968
13257
|
schema = (_b.sent()).amisSchema;
|
|
@@ -12972,11 +13261,14 @@ setTimeout(()=>{
|
|
|
12972
13261
|
// recordDetailData.recordId = recordId;
|
|
12973
13262
|
// }
|
|
12974
13263
|
// schema.data = Object.assign({}, schema.data, recordDetailData);
|
|
13264
|
+
if (___default.has(props, "recordId") && $schema.recordId !== "${recordId}") {
|
|
13265
|
+
schema.data.recordId = props.recordId;
|
|
13266
|
+
}
|
|
12975
13267
|
schema.className = className;
|
|
12976
13268
|
if (body) {
|
|
12977
13269
|
schema.body = body;
|
|
12978
13270
|
}
|
|
12979
|
-
console.log(
|
|
13271
|
+
// console.log(`AmisRecordDetail====schema==>`, schema)
|
|
12980
13272
|
return [2 /*return*/, schema];
|
|
12981
13273
|
}
|
|
12982
13274
|
});
|
|
@@ -13013,11 +13305,11 @@ setTimeout(()=>{
|
|
|
13013
13305
|
}); };
|
|
13014
13306
|
|
|
13015
13307
|
var AmisRecordDetailRelatedList = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
13016
|
-
var objectApiName, recordId, relatedObjectApiName, relatedKey, top, perPage, hiddenEmptyTable, appId, relatedLabel, _a, className, columns, sort, filters, visible_on, requestAdaptor, adaptor, formFactor, schema;
|
|
13308
|
+
var $schema, objectApiName, recordId, relatedObjectApiName, relatedKey, top, perPage, hiddenEmptyTable, appId, relatedLabel, _a, className, columns, sort, filters, visible_on, requestAdaptor, adaptor, formFactor, formData, schema;
|
|
13017
13309
|
return __generator(this, function (_b) {
|
|
13018
13310
|
switch (_b.label) {
|
|
13019
13311
|
case 0:
|
|
13020
|
-
objectApiName = props.objectApiName, recordId = props.recordId, relatedObjectApiName = props.relatedObjectApiName, props.data, relatedKey = props.relatedKey, top = props.top, perPage = props.perPage, hiddenEmptyTable = props.hiddenEmptyTable, appId = props.appId, relatedLabel = props.relatedLabel, _a = props.className, className = _a === void 0 ? '' : _a, columns = props.columns, sort = props.sort, filters = props.filters, visible_on = props.visible_on, requestAdaptor = props.requestAdaptor, adaptor = props.adaptor;
|
|
13312
|
+
$schema = props.$schema, objectApiName = props.objectApiName, recordId = props.recordId, relatedObjectApiName = props.relatedObjectApiName, props.data, relatedKey = props.relatedKey, top = props.top, perPage = props.perPage, hiddenEmptyTable = props.hiddenEmptyTable, appId = props.appId, relatedLabel = props.relatedLabel, _a = props.className, className = _a === void 0 ? '' : _a, columns = props.columns, sort = props.sort, filters = props.filters, visible_on = props.visible_on, requestAdaptor = props.requestAdaptor, adaptor = props.adaptor;
|
|
13021
13313
|
formFactor = props.formFactor;
|
|
13022
13314
|
if (!formFactor) {
|
|
13023
13315
|
formFactor = window.innerWidth < 768 ? 'SMALL' : 'LARGE';
|
|
@@ -13032,20 +13324,25 @@ setTimeout(()=>{
|
|
|
13032
13324
|
"className": "mb-3"
|
|
13033
13325
|
}];
|
|
13034
13326
|
}
|
|
13327
|
+
formData = {};
|
|
13328
|
+
if (___default.has(props, "recordId") && $schema.recordId !== "${recordId}") {
|
|
13329
|
+
formData.recordId = recordId;
|
|
13330
|
+
}
|
|
13035
13331
|
return [4 /*yield*/, getRecordDetailRelatedListSchema(objectApiName, recordId, relatedObjectApiName, relatedKey, { top: top, perPage: perPage, appId: appId, relatedLabel: relatedLabel, className: className, formFactor: formFactor, columns: columns, sort: sort, filters: filters, visible_on: visible_on, isRelated: true, hiddenEmptyTable: hiddenEmptyTable, requestAdaptor: requestAdaptor, adaptor: adaptor })];
|
|
13036
13332
|
case 1:
|
|
13037
13333
|
schema = (_b.sent()).amisSchema;
|
|
13334
|
+
schema.data = Object.assign(schema.data, formData);
|
|
13038
13335
|
return [2 /*return*/, schema];
|
|
13039
13336
|
}
|
|
13040
13337
|
});
|
|
13041
13338
|
}); };
|
|
13042
13339
|
|
|
13043
13340
|
var AmisRecordDetailRelatedLists = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
13044
|
-
var objectApiName, _a, perPage, relatedLists;
|
|
13341
|
+
var $schema, objectApiName, recordId, _a, perPage, relatedLists, staticRecordId;
|
|
13045
13342
|
return __generator(this, function (_b) {
|
|
13046
13343
|
switch (_b.label) {
|
|
13047
13344
|
case 0:
|
|
13048
|
-
objectApiName = props.objectApiName, props.recordId, props.data, _a = props.perPage, perPage = _a === void 0 ? 5 : _a;
|
|
13345
|
+
$schema = props.$schema, objectApiName = props.objectApiName, recordId = props.recordId, props.data, _a = props.perPage, perPage = _a === void 0 ? 5 : _a;
|
|
13049
13346
|
if (!objectApiName) {
|
|
13050
13347
|
// if(!objectApiName || !recordId){
|
|
13051
13348
|
return [2 /*return*/, {
|
|
@@ -13069,11 +13366,15 @@ setTimeout(()=>{
|
|
|
13069
13366
|
"className": "mb-3"
|
|
13070
13367
|
}];
|
|
13071
13368
|
}
|
|
13369
|
+
staticRecordId = '';
|
|
13370
|
+
if (___default.has(props, "recordId") && $schema.recordId !== "${recordId}") {
|
|
13371
|
+
staticRecordId = recordId;
|
|
13372
|
+
}
|
|
13072
13373
|
return [2 /*return*/, {
|
|
13073
13374
|
type: 'service',
|
|
13074
13375
|
className: "steedos-record-detail-related-lists",
|
|
13075
13376
|
body: ___default.map(relatedLists, function (item) {
|
|
13076
|
-
|
|
13377
|
+
var relatedList = {
|
|
13077
13378
|
type: 'steedos-object-related-listview',
|
|
13078
13379
|
objectApiName: objectApiName,
|
|
13079
13380
|
// recordId: recordId,
|
|
@@ -13088,6 +13389,10 @@ setTimeout(()=>{
|
|
|
13088
13389
|
hiddenEmptyTable: true,
|
|
13089
13390
|
relatedLabel: item.label
|
|
13090
13391
|
};
|
|
13392
|
+
if (staticRecordId) {
|
|
13393
|
+
relatedList.recordId = staticRecordId;
|
|
13394
|
+
}
|
|
13395
|
+
return relatedList;
|
|
13091
13396
|
})
|
|
13092
13397
|
}];
|
|
13093
13398
|
}
|
|
@@ -13138,12 +13443,12 @@ setTimeout(()=>{
|
|
|
13138
13443
|
/*
|
|
13139
13444
|
* @Author: baozhoutao@steedos.com
|
|
13140
13445
|
* @Date: 2022-09-01 14:44:57
|
|
13141
|
-
* @LastEditors:
|
|
13142
|
-
* @LastEditTime: 2023-
|
|
13446
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
13447
|
+
* @LastEditTime: 2023-05-08 15:05:32
|
|
13143
13448
|
* @Description:
|
|
13144
13449
|
*/
|
|
13145
13450
|
var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
13146
|
-
var app, data, className, _a, showAppName, _b, appNameClassName, formFactor, isMobile, dialogSchema;
|
|
13451
|
+
var app, data, className, _a, showAppName, _b, appNameClassName, formFactor, isMobile, on_click_script, mobile_blank_script, dialogSchema;
|
|
13147
13452
|
return __generator(this, function (_c) {
|
|
13148
13453
|
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;
|
|
13149
13454
|
if (!app) {
|
|
@@ -13151,6 +13456,8 @@ setTimeout(()=>{
|
|
|
13151
13456
|
}
|
|
13152
13457
|
formFactor = window.innerWidth < 768 ? 'SMALL' : 'LARGE';
|
|
13153
13458
|
isMobile = formFactor === "SMALL" ? true : false;
|
|
13459
|
+
on_click_script = "\n var evalFunString = \"(function(){\" + event.data.on_click + \"})()\";\n try{\n eval(evalFunString);\n }\n catch(e){\n console.error(\"catch some error when eval the on_click script for app link:\");\n console.error(e.message + \"\\r\\n\" + e.stack);\n }\n ";
|
|
13460
|
+
mobile_blank_script = "\n if(event.data.path[0] == \"/\"){\n Steedos.openWindow(event.data.context.rootUrl + event.data.path)\n }else{\n Steedos.openWindow(event.data.path)\n }\n ";
|
|
13154
13461
|
dialogSchema = {};
|
|
13155
13462
|
if (isMobile) {
|
|
13156
13463
|
dialogSchema = {
|
|
@@ -13163,8 +13470,6 @@ setTimeout(()=>{
|
|
|
13163
13470
|
"items": {
|
|
13164
13471
|
"type": "button",
|
|
13165
13472
|
"level": "link",
|
|
13166
|
-
"actionType": "link",
|
|
13167
|
-
"link": "${path}",
|
|
13168
13473
|
"body": [
|
|
13169
13474
|
{
|
|
13170
13475
|
"type": "tpl",
|
|
@@ -13190,6 +13495,23 @@ setTimeout(()=>{
|
|
|
13190
13495
|
"actions": [
|
|
13191
13496
|
{
|
|
13192
13497
|
"actionType": "closeDialog"
|
|
13498
|
+
},
|
|
13499
|
+
{
|
|
13500
|
+
"actionType": "link",
|
|
13501
|
+
"args": {
|
|
13502
|
+
"link": "${path}"
|
|
13503
|
+
},
|
|
13504
|
+
"expression": "${AND(!blank , !on_click)}"
|
|
13505
|
+
},
|
|
13506
|
+
{
|
|
13507
|
+
"actionType": "custom",
|
|
13508
|
+
"script": mobile_blank_script,
|
|
13509
|
+
"expression": "${AND(blank , !on_click)}"
|
|
13510
|
+
},
|
|
13511
|
+
{
|
|
13512
|
+
"actionType": "custom",
|
|
13513
|
+
"script": on_click_script,
|
|
13514
|
+
"expression": "${on_click}"
|
|
13193
13515
|
}
|
|
13194
13516
|
]
|
|
13195
13517
|
}
|
|
@@ -13213,18 +13535,26 @@ setTimeout(()=>{
|
|
|
13213
13535
|
"headers": {
|
|
13214
13536
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
13215
13537
|
},
|
|
13216
|
-
"adaptor": "\nlet app_items = payload;\npayload
|
|
13538
|
+
"adaptor": "\nlet app_items = payload;\npayload = {\n app_items\n}\nreturn payload;",
|
|
13217
13539
|
"messages": {}
|
|
13218
13540
|
},
|
|
13219
13541
|
"onEvent": {
|
|
13220
13542
|
"@data.changed.steedos_keyvalues": {
|
|
13221
13543
|
"actions": [
|
|
13222
13544
|
{
|
|
13223
|
-
"actionType": "
|
|
13545
|
+
"actionType": "reload"
|
|
13546
|
+
}
|
|
13547
|
+
]
|
|
13548
|
+
},
|
|
13549
|
+
"fetchInited": {
|
|
13550
|
+
"actions": [
|
|
13551
|
+
{
|
|
13552
|
+
"actionType": "broadcast",
|
|
13224
13553
|
"args": {
|
|
13225
|
-
"
|
|
13226
|
-
|
|
13227
|
-
|
|
13554
|
+
"eventName": "@appsLoaded"
|
|
13555
|
+
},
|
|
13556
|
+
"data": {
|
|
13557
|
+
"apps": "${event.data.app_items}"
|
|
13228
13558
|
}
|
|
13229
13559
|
}
|
|
13230
13560
|
]
|
|
@@ -13289,7 +13619,7 @@ setTimeout(()=>{
|
|
|
13289
13619
|
"args": {
|
|
13290
13620
|
"link": "${path}"
|
|
13291
13621
|
},
|
|
13292
|
-
"expression": "${!blank}"
|
|
13622
|
+
"expression": "${AND(!blank , !on_click)}"
|
|
13293
13623
|
},
|
|
13294
13624
|
{
|
|
13295
13625
|
"actionType": "url",
|
|
@@ -13297,7 +13627,12 @@ setTimeout(()=>{
|
|
|
13297
13627
|
"url": "${path}",
|
|
13298
13628
|
"blank": true
|
|
13299
13629
|
},
|
|
13300
|
-
"expression": "${blank}"
|
|
13630
|
+
"expression": "${AND(blank , !on_click)}"
|
|
13631
|
+
},
|
|
13632
|
+
{
|
|
13633
|
+
"actionType": "custom",
|
|
13634
|
+
"script": on_click_script,
|
|
13635
|
+
"expression": "${!!on_click}"
|
|
13301
13636
|
}
|
|
13302
13637
|
]
|
|
13303
13638
|
}
|
|
@@ -13359,11 +13694,19 @@ setTimeout(()=>{
|
|
|
13359
13694
|
"@data.changed.steedos_keyvalues": {
|
|
13360
13695
|
"actions": [
|
|
13361
13696
|
{
|
|
13362
|
-
"actionType": "
|
|
13697
|
+
"actionType": "reload"
|
|
13698
|
+
}
|
|
13699
|
+
]
|
|
13700
|
+
},
|
|
13701
|
+
"fetchInited": {
|
|
13702
|
+
"actions": [
|
|
13703
|
+
{
|
|
13704
|
+
"actionType": "broadcast",
|
|
13363
13705
|
"args": {
|
|
13364
|
-
"
|
|
13365
|
-
|
|
13366
|
-
|
|
13706
|
+
"eventName": "@appsLoaded"
|
|
13707
|
+
},
|
|
13708
|
+
"data": {
|
|
13709
|
+
"apps": "${event.data.app_items}"
|
|
13367
13710
|
}
|
|
13368
13711
|
}
|
|
13369
13712
|
]
|
|
@@ -13376,7 +13719,7 @@ setTimeout(()=>{
|
|
|
13376
13719
|
"headers": {
|
|
13377
13720
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
13378
13721
|
},
|
|
13379
|
-
"adaptor": "\nlet app_items = payload;\nlet object_items = [];\nlet objects = [];\napp_items.forEach((item) => {\n item.children.forEach((i) => {\n if (objects.indexOf(i.id) < 0) {\n objects.push(i.id);\n object_items.push(i)\n }\n })\n})\npayload
|
|
13722
|
+
"adaptor": "\nlet app_items = payload;\nlet object_items = [];\nlet objects = [];\napp_items.forEach((item) => {\n item.children.forEach((i) => {\n if (objects.indexOf(i.id) < 0) {\n objects.push(i.id);\n object_items.push(i)\n }\n })\n})\npayload = {\n app_items,\n object_items\n}\nreturn payload;"
|
|
13380
13723
|
}
|
|
13381
13724
|
};
|
|
13382
13725
|
}
|
|
@@ -13430,12 +13773,7 @@ setTimeout(()=>{
|
|
|
13430
13773
|
"@data.changed.steedos_keyvalues": {
|
|
13431
13774
|
"actions": [
|
|
13432
13775
|
{
|
|
13433
|
-
"actionType": "
|
|
13434
|
-
"args": {
|
|
13435
|
-
"value": {
|
|
13436
|
-
"keyvalue": "${event.data.keyvalue.value}"
|
|
13437
|
-
}
|
|
13438
|
-
}
|
|
13776
|
+
"actionType": "reload"
|
|
13439
13777
|
}
|
|
13440
13778
|
]
|
|
13441
13779
|
}
|
|
@@ -13480,7 +13818,7 @@ setTimeout(()=>{
|
|
|
13480
13818
|
type: 'service',
|
|
13481
13819
|
schemaApi: {
|
|
13482
13820
|
"method": "get",
|
|
13483
|
-
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus
|
|
13821
|
+
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
|
|
13484
13822
|
"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 if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium 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 // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": true,\n \"children\": _.map(tabs, (tab) => {\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium 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 // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[15px] font-medium 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 // active: selectedId === tab.id,\n });\n })\n }\n payload.data = {\n \"type\": \"nav\",\n className: \"").concat(className, "\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"links\": data.nav,\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n return payload;\n "),
|
|
13485
13823
|
"headers": {
|
|
13486
13824
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
@@ -13496,7 +13834,7 @@ setTimeout(()=>{
|
|
|
13496
13834
|
* @Author: baozhoutao@steedos.com
|
|
13497
13835
|
* @Date: 2022-09-01 14:44:57
|
|
13498
13836
|
* @LastEditors: baozhoutao@steedos.com
|
|
13499
|
-
* @LastEditTime: 2023-04-
|
|
13837
|
+
* @LastEditTime: 2023-04-27 13:26:12
|
|
13500
13838
|
* @Description:
|
|
13501
13839
|
*/
|
|
13502
13840
|
var AmisGlobalFooter = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -13507,8 +13845,8 @@ setTimeout(()=>{
|
|
|
13507
13845
|
appId = data.context.appId || 'admin';
|
|
13508
13846
|
}
|
|
13509
13847
|
isMobile = window.innerWidth <= 768;
|
|
13510
|
-
className = 'fixed bottom-0 z-20 flex justify-evenly w-full h-16 bg-gray-100
|
|
13511
|
-
className1 = 'fixed bottom-0 z-20 flex justify-center w-full h-16 bg-gray-100
|
|
13848
|
+
className = 'fixed bottom-0 z-20 flex justify-evenly w-full h-16 bg-gray-100 steedos-global-footer';
|
|
13849
|
+
className1 = 'fixed bottom-0 z-20 flex justify-center w-full h-16 bg-gray-100 steedos-global-footer';
|
|
13512
13850
|
schema = {};
|
|
13513
13851
|
if (links) {
|
|
13514
13852
|
schema = {
|
|
@@ -13532,8 +13870,8 @@ setTimeout(()=>{
|
|
|
13532
13870
|
type: 'service',
|
|
13533
13871
|
schemaApi: {
|
|
13534
13872
|
"method": "get",
|
|
13535
|
-
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus?
|
|
13536
|
-
"adaptor": "\n
|
|
13873
|
+
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus?mobile=true"),
|
|
13874
|
+
"adaptor": "\n try {\n\n if(payload.children.length == 0){\n payload.data = {};\n return payload\n }\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n let sum = 0;\n _.each(payload.children, (tab)=>{\n sum++;\n const classIcon = tab.icon.replace(/_/g,\"-\");\n if(sum >= 5){\n data.nav.push({\n \"label\": {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[12px] font-medium rounded-md flex-col leading-3 nav-label'><svg class=\"slds-icon slds-icon_container slds-icon-standard-`+classIcon+` flex-shrink-0 h-10 w-10\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg><span>${tab.name}</span><i class=\"fa fa-angle-right\" aria-hidden=\"true\" style=\"position: absolute;right: 20px;color: #bababa;\"></i></span>`,\n className:'h-full flex items-center'\n },\n \"to\": tab.path,\n \"target\":tab.target\n });\n }else{\n data.nav.push({\n \"label\": {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[12px] font-medium rounded-md flex-col leading-3 nav-label'><svg class=\"slds-icon slds-icon_container slds-icon-standard-`+classIcon+` flex-shrink-0 h-10 w-10\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`,\n className:'h-full flex items-center'\n },\n \"to\": tab.path,\n \"target\":tab.target\n });\n }\n \n })\n\n payload.data = {\n \"type\": \"nav\",\n className: payload.children.length ==1 ? '").concat(className1, "' : '").concat(className, "',\n \"stacked\": ").concat(stacked, ",\n \"overflow\": {\n \"enable\": true,\n \"maxVisibleCount\": 4,\n \"overflowPopoverClassName\": \"steedos-global-footer-popup\",\n \"overflowLabel\":{\n \"type\": 'tpl',\n \"tpl\": `<span class='fill-slate-500 text-slate-700 block -ml-px no-underline group flex items-center text-[12px] font-medium rounded-md flex-col leading-3 nav-label'><svg class=\" flex-shrink-0 h-10 w-10\" style=\"padding:7px\"><use xlink:href=\"/assets/icons/utility-sprite/svg/symbols.svg#rows\"></use></svg>\u83DC\u5355</span>`,\n \"className\":'h-full flex items-center'\n },\n \"overflowIndicator\":\"\"\n },\n \"indentSize\": ").concat(indentSize, ",\n \"links\": data.nav,\n };\n } catch (error) {\n console.log(`error`, error)\n }\n return payload;\n "),
|
|
13537
13875
|
"headers": {
|
|
13538
13876
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
13539
13877
|
}
|
|
@@ -14054,7 +14392,7 @@ setTimeout(()=>{
|
|
|
14054
14392
|
{
|
|
14055
14393
|
"type": "button",
|
|
14056
14394
|
"className": 'p-0 absolute inset-0 mt-[50px] sm:mt-[90px]',
|
|
14057
|
-
hiddenOn: "${app.showSidebar != true}",
|
|
14395
|
+
hiddenOn: "${OR(app.showSidebar != true,isMobile)}",
|
|
14058
14396
|
body: [
|
|
14059
14397
|
{
|
|
14060
14398
|
type: "wrapper",
|
|
@@ -14150,7 +14488,7 @@ setTimeout(()=>{
|
|
|
14150
14488
|
var getSelectFlowSchema = function (id, props) {
|
|
14151
14489
|
var label = props.label, data = props.data, name = props.name, required = props.required, _a = props.action, action = _a === void 0 ? 'query' : _a, _b = props.distributeInstanceId, distributeInstanceId = _b === void 0 ? "" : _b, _c = props.distributeStepId, distributeStepId = _c === void 0 ? "" : _c, _d = props.mode, mode = _d === void 0 ? 'input-tree' : _d, className = props.className, onEvent = props.onEvent, _e = props.multiple, multiple = _e === void 0 ? false : _e, delimiter = props.delimiter, joinValues = props.joinValues, extractValue = props.extractValue, searchable = props.searchable, _f = props.showIcon, showIcon = _f === void 0 ? true : _f, _g = props.showRadio, showRadio = _g === void 0 ? false : _g, showOutline = props.showOutline, initiallyOpen = props.initiallyOpen, unfoldedLevel = props.unfoldedLevel, treeContainerClassName = props.treeContainerClassName, _h = props.amis, amis = _h === void 0 ? {} : _h;
|
|
14152
14490
|
console.log("=====onEvent", onEvent);
|
|
14153
|
-
return __assign$2({ "type": mode, "id": id, "label": label, "name": name, "options": [], "multiple": multiple, "delimiter": delimiter, "joinValues": joinValues, "extractValue": extractValue, "searchable": searchable, "showOutline": showOutline, "initiallyOpen": initiallyOpen, "unfoldedLevel": unfoldedLevel, "className": className, "required": required, "treeContainerClassName": treeContainerClassName,
|
|
14491
|
+
return __assign$2({ "type": mode, "id": id, "label": label, "name": name, "options": [], "multiple": multiple, "delimiter": delimiter, "joinValues": joinValues, "extractValue": extractValue, "searchable": searchable, "showOutline": showOutline, "initiallyOpen": initiallyOpen, "unfoldedLevel": unfoldedLevel, "className": className, "required": required, "treeContainerClassName": treeContainerClassName, "heightAuto": true,
|
|
14154
14492
|
// "menuTpl": {
|
|
14155
14493
|
// // type: "button",
|
|
14156
14494
|
// type: "tpl",
|
|
@@ -14207,6 +14545,7 @@ setTimeout(()=>{
|
|
|
14207
14545
|
return {
|
|
14208
14546
|
"type": "service",
|
|
14209
14547
|
"id": "selectFlowService",
|
|
14548
|
+
"className": "steedos-select-flow-service",
|
|
14210
14549
|
"body": [
|
|
14211
14550
|
{
|
|
14212
14551
|
"type": "search-box",
|
|
@@ -14305,7 +14644,10 @@ setTimeout(()=>{
|
|
|
14305
14644
|
// const pageSplitClassName = listSchema.pageSplitClassName || 'p-0 flex flex-1 overflow-hidden h-full'
|
|
14306
14645
|
return [2 /*return*/, {
|
|
14307
14646
|
type: 'service',
|
|
14308
|
-
className:
|
|
14647
|
+
className: {
|
|
14648
|
+
"h-full": "true",
|
|
14649
|
+
"sm:px-3 sm:pt-3": "${display != 'split'}"
|
|
14650
|
+
},
|
|
14309
14651
|
body: listSchema
|
|
14310
14652
|
}];
|
|
14311
14653
|
}
|