@steedos-widgets/amis-object 1.3.3 → 1.3.4-beta.10
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/AmisObjectListview.d.ts +2 -0
- package/dist/amis/AmisObjectTable.d.ts +2 -6
- package/dist/amis/AmisRecordDetailHeader.d.ts +1 -0
- package/dist/amis-object.cjs.css +210 -41
- package/dist/amis-object.cjs.js +391 -261
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +210 -41
- package/dist/amis-object.esm.js +391 -261
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +210 -41
- package/dist/amis-object.umd.js +141 -140
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets-dev.json +19 -0
- package/dist/assets.json +35 -16
- package/dist/meta.js +49 -9
- package/dist/pages/PageObject.d.ts +2 -2
- package/package.json +3 -3
package/dist/amis-object.cjs.js
CHANGED
|
@@ -3613,7 +3613,7 @@ function getLookupListView(refObjectConfig) {
|
|
|
3613
3613
|
* @Author: baozhoutao@steedos.com
|
|
3614
3614
|
* @Date: 2022-05-23 09:53:08
|
|
3615
3615
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
3616
|
-
* @LastEditTime: 2023-
|
|
3616
|
+
* @LastEditTime: 2023-09-19 14:38:39
|
|
3617
3617
|
* @Description:
|
|
3618
3618
|
*/
|
|
3619
3619
|
|
|
@@ -3621,39 +3621,39 @@ function getCreatedInfoTpl(formFactor){
|
|
|
3621
3621
|
const href = Router$1.getObjectDetailPath({
|
|
3622
3622
|
formFactor, appId: "admin", objectName: 'users', recordId: '${created_by._id}'
|
|
3623
3623
|
});
|
|
3624
|
-
return `<
|
|
3624
|
+
return `<span><a href='${href}'>\${_display.created_by.label}</a>\${_display.created}</span>`
|
|
3625
3625
|
}
|
|
3626
3626
|
|
|
3627
3627
|
function getModifiedInfoTpl(formFactor){
|
|
3628
3628
|
const href = Router$1.getObjectDetailPath({
|
|
3629
3629
|
formFactor, appId: "admin", objectName: 'users', recordId: '${modified_by._id}'
|
|
3630
3630
|
});
|
|
3631
|
-
return `<
|
|
3631
|
+
return `<span><a href='${href}'>\${_display.modified_by.label}</a>\${_display.modified}</span>`
|
|
3632
3632
|
}
|
|
3633
3633
|
|
|
3634
3634
|
function getNumberTpl(field){
|
|
3635
|
-
return `<
|
|
3635
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
3636
3636
|
}
|
|
3637
3637
|
|
|
3638
3638
|
function getTimeTpl(field){
|
|
3639
|
-
return `<
|
|
3639
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
3640
3640
|
}
|
|
3641
3641
|
|
|
3642
3642
|
function getDateTpl(field){
|
|
3643
|
-
return `<
|
|
3643
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
3644
3644
|
}
|
|
3645
3645
|
|
|
3646
3646
|
|
|
3647
3647
|
function getDateTimeTpl(field){
|
|
3648
|
-
return `<
|
|
3648
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
3649
3649
|
}
|
|
3650
3650
|
|
|
3651
3651
|
function getUiFieldTpl(field){
|
|
3652
|
-
return `<
|
|
3652
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
3653
3653
|
}
|
|
3654
3654
|
|
|
3655
3655
|
function getUiFileSizeTpl(field){
|
|
3656
|
-
return `<
|
|
3656
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
3657
3657
|
}
|
|
3658
3658
|
|
|
3659
3659
|
//TODO 处理name字段
|
|
@@ -3664,7 +3664,7 @@ async function getRefObjectNameFieldName(field){
|
|
|
3664
3664
|
}
|
|
3665
3665
|
|
|
3666
3666
|
function getSelectTpl(field){
|
|
3667
|
-
return `<
|
|
3667
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
3668
3668
|
}
|
|
3669
3669
|
function getSelectMap(selectOptions){
|
|
3670
3670
|
let map = {};
|
|
@@ -3793,9 +3793,13 @@ async function getLookupTpl(field, ctx){
|
|
|
3793
3793
|
}
|
|
3794
3794
|
|
|
3795
3795
|
function getSwitchTpl(field){
|
|
3796
|
+
let fieldDataStrTpl = `data._display.${field.name}`;
|
|
3797
|
+
if(field.isTableField){
|
|
3798
|
+
fieldDataStrTpl = `data.${field.name}`;
|
|
3799
|
+
}
|
|
3796
3800
|
return `<% if (data.${field.name}) { %>
|
|
3797
|
-
<span class="slds-icon_container slds-icon-utility-check slds-current-color" title="
|
|
3798
|
-
<span ><%=
|
|
3801
|
+
<span class="slds-icon_container slds-icon-utility-check slds-current-color" title="<%=${fieldDataStrTpl}%>">
|
|
3802
|
+
<span ><%= ${fieldDataStrTpl} === "√" ? "<svg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke-width='1.5' stroke='currentColor' class='w-4 h-4'><path stroke-linecap='round' stroke-linejoin='round' d='M4.5 12.75l6 6 9-13.5' /></svg>" : ${fieldDataStrTpl} %></span>
|
|
3799
3803
|
</span>
|
|
3800
3804
|
<% } %>`
|
|
3801
3805
|
}
|
|
@@ -4373,7 +4377,7 @@ var frontend_display_type_is_split = "分栏视图";
|
|
|
4373
4377
|
var frontend_display_as = "显示为";
|
|
4374
4378
|
var frontend_record_sum = "个项目";
|
|
4375
4379
|
var frontend_button_reload_tooltip = "刷新";
|
|
4376
|
-
var frontend_button_search_tooltip = "
|
|
4380
|
+
var frontend_button_search_tooltip = "筛选";
|
|
4377
4381
|
var frontend_fields_filter_button_search = "搜索";
|
|
4378
4382
|
var frontend_fields_filter_button_settings = "设置搜索项";
|
|
4379
4383
|
var frontend_button_listview_control_tooltip = "列表视图控制";
|
|
@@ -4995,7 +4999,7 @@ const parseSingleExpression$1 = function (func, formData, dataPath, global, user
|
|
|
4995
4999
|
* @Author: baozhoutao@steedos.com
|
|
4996
5000
|
* @Date: 2022-11-01 15:51:00
|
|
4997
5001
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
4998
|
-
* @LastEditTime: 2023-
|
|
5002
|
+
* @LastEditTime: 2023-09-25 14:53:05
|
|
4999
5003
|
* @Description:
|
|
5000
5004
|
*/
|
|
5001
5005
|
|
|
@@ -5014,18 +5018,31 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5014
5018
|
formSchema = _.isString(payload.schema) ? JSON.parse(payload.schema) : payload.schema;
|
|
5015
5019
|
}
|
|
5016
5020
|
|
|
5021
|
+
const fields = ${JSON.stringify(uiSchema.fields)};
|
|
5022
|
+
const selectedRowResponseResult = api.body.selectedRowResponseResult;
|
|
5023
|
+
let defaultData = {};
|
|
5024
|
+
|
|
5025
|
+
if(!_.isEmpty(selectedRowResponseResult)){
|
|
5026
|
+
const fieldsKeys = _.keys(fields);
|
|
5027
|
+
// 如果新建记录时复制的数据中有omit或其他不相关字段数据时不应该一起保存到数据库,
|
|
5028
|
+
// 原规则见:https://github.com/steedos/steedos-frontend/issues/297
|
|
5029
|
+
_.forEach(selectedRowResponseResult, (val, key) => {
|
|
5030
|
+
if (fieldsKeys.indexOf(key) > -1 && fields[key].omit !== true) {
|
|
5031
|
+
defaultData[key] = val;
|
|
5032
|
+
}
|
|
5033
|
+
})
|
|
5034
|
+
}
|
|
5035
|
+
|
|
5017
5036
|
const _master = api.body._master;
|
|
5018
5037
|
if(_master && _master._isRelated){
|
|
5019
5038
|
const relatedKey = _master.relatedKey;
|
|
5020
5039
|
const masterObjectName = _master.objectName;
|
|
5021
5040
|
const recordId = _master.recordId;
|
|
5022
5041
|
let relatedKeySaveValue = recordId;
|
|
5023
|
-
const fields = ${JSON.stringify(uiSchema.fields)};
|
|
5024
5042
|
const relatedField = fields[relatedKey];
|
|
5025
5043
|
if(relatedField.reference_to_field && relatedField.reference_to_field !== '_id'){
|
|
5026
5044
|
relatedKeySaveValue = _master.record[relatedField.reference_to_field];
|
|
5027
5045
|
}
|
|
5028
|
-
let defaultData = {};
|
|
5029
5046
|
let relatedKeyValue;
|
|
5030
5047
|
if(!_.isString(relatedField.reference_to)){
|
|
5031
5048
|
relatedKeyValue = { o: masterObjectName, ids: [relatedKeySaveValue] };
|
|
@@ -5035,6 +5052,9 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5035
5052
|
relatedKeyValue = relatedKeySaveValue;
|
|
5036
5053
|
}
|
|
5037
5054
|
defaultData[relatedKey]=relatedKeyValue;
|
|
5055
|
+
}
|
|
5056
|
+
|
|
5057
|
+
if(!_.isEmpty(defaultData)){
|
|
5038
5058
|
if(payload.schema){
|
|
5039
5059
|
// 表单微页面第一层要求是page
|
|
5040
5060
|
formSchema.data.defaultData = defaultData;
|
|
@@ -5057,6 +5077,18 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5057
5077
|
});
|
|
5058
5078
|
}, 200);
|
|
5059
5079
|
`;
|
|
5080
|
+
const getSelectedRowsScript = `
|
|
5081
|
+
const isLookup = event.data.isLookup;
|
|
5082
|
+
if(isLookup){
|
|
5083
|
+
// lookup弹出窗口的新建功能不需要支持复制新建
|
|
5084
|
+
return;
|
|
5085
|
+
}
|
|
5086
|
+
const uiSchema = event.data.uiSchema;
|
|
5087
|
+
const objectName = event.data.objectName;
|
|
5088
|
+
const listViewRef = event.context.scoped.getComponentById("listview_" + objectName);
|
|
5089
|
+
const selectedItems = listViewRef && listViewRef.props.store.toJSON().selectedItems || [];
|
|
5090
|
+
event.data.selectedIds = _.map(selectedItems, uiSchema.idFieldName || '_id');
|
|
5091
|
+
`;
|
|
5060
5092
|
return {
|
|
5061
5093
|
"type": "service",
|
|
5062
5094
|
"body": [
|
|
@@ -5069,6 +5101,21 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5069
5101
|
"click": {
|
|
5070
5102
|
"weight": 0,
|
|
5071
5103
|
"actions": [
|
|
5104
|
+
{
|
|
5105
|
+
"actionType": "custom",
|
|
5106
|
+
"script": getSelectedRowsScript
|
|
5107
|
+
},
|
|
5108
|
+
{
|
|
5109
|
+
"actionType": "ajax",
|
|
5110
|
+
"outputVar": "selectedRowResponseResult",
|
|
5111
|
+
"args": {
|
|
5112
|
+
"api": {
|
|
5113
|
+
"url": "${context.rootUrl}/api/v1/${uiSchema.name}/${selectedIds|first}",
|
|
5114
|
+
"method": "get"
|
|
5115
|
+
}
|
|
5116
|
+
},
|
|
5117
|
+
"expression": "${selectedIds.length > 0}"
|
|
5118
|
+
},
|
|
5072
5119
|
{
|
|
5073
5120
|
"actionType": "dialog",
|
|
5074
5121
|
"dialog": {
|
|
@@ -5086,7 +5133,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5086
5133
|
"displayAs": "${displayAs}",
|
|
5087
5134
|
"uiSchema": "${uiSchema}",
|
|
5088
5135
|
"isLookup": "${isLookup}",
|
|
5089
|
-
"listName": "${listName}"
|
|
5136
|
+
"listName": "${listName}",
|
|
5137
|
+
"selectedRowResponseResult": "${selectedRowResponseResult}",
|
|
5090
5138
|
},
|
|
5091
5139
|
"title":instance.t('frontend_form_new') + " ${uiSchema.label | raw}",
|
|
5092
5140
|
"body": [
|
|
@@ -5098,7 +5146,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5098
5146
|
"data": {
|
|
5099
5147
|
"isLookup": "${isLookup}",
|
|
5100
5148
|
"_master": "${_master}",
|
|
5101
|
-
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}"
|
|
5149
|
+
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}",
|
|
5150
|
+
"selectedRowResponseResult": "${selectedRowResponseResult}"
|
|
5102
5151
|
},
|
|
5103
5152
|
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}",
|
|
5104
5153
|
"method": "get",
|
|
@@ -6029,9 +6078,30 @@ const getObjectDetailHeaderButtons = (objectSchema, recordId)=>{
|
|
|
6029
6078
|
const getObjectDetailButtonsSchemas = (objectSchema, recordId, ctx)=>{
|
|
6030
6079
|
const { buttons, moreButtons, moreButtonsVisibleOn } = getObjectDetailHeaderButtons(objectSchema, recordId);
|
|
6031
6080
|
if(ctx.formFactor === 'SMALL'){
|
|
6081
|
+
const dropdownButtons = [
|
|
6082
|
+
..._$1__namespace.map(buttons, (button) => {
|
|
6083
|
+
button.className += ' w-full';
|
|
6084
|
+
return button;
|
|
6085
|
+
}),
|
|
6086
|
+
..._$1__namespace.map(moreButtons, (button) => {
|
|
6087
|
+
button.className += ' w-full';
|
|
6088
|
+
return button;
|
|
6089
|
+
})
|
|
6090
|
+
];
|
|
6091
|
+
|
|
6092
|
+
let phoneMoreButtonsVisibleOn = '';
|
|
6093
|
+
_$1__namespace.forEach(dropdownButtons, (button, index) => {
|
|
6094
|
+
if(index === 0){
|
|
6095
|
+
phoneMoreButtonsVisibleOn = button.visibleOn;
|
|
6096
|
+
}else {
|
|
6097
|
+
phoneMoreButtonsVisibleOn = phoneMoreButtonsVisibleOn + ' || ' + button.visibleOn;
|
|
6098
|
+
}
|
|
6099
|
+
});
|
|
6100
|
+
|
|
6032
6101
|
return {
|
|
6033
6102
|
"type": "button",
|
|
6034
6103
|
"icon": "fa fa-angle-down",
|
|
6104
|
+
"visibleOn": phoneMoreButtonsVisibleOn,
|
|
6035
6105
|
"onEvent": {
|
|
6036
6106
|
"click": {
|
|
6037
6107
|
"actions": [
|
|
@@ -6047,16 +6117,7 @@ const getObjectDetailButtonsSchemas = (objectSchema, recordId, ctx)=>{
|
|
|
6047
6117
|
"id": "u:fd837823be5b",
|
|
6048
6118
|
"vertical": true,
|
|
6049
6119
|
"tiled": true,
|
|
6050
|
-
"buttons":
|
|
6051
|
-
..._$1__namespace.map(buttons, (button)=>{
|
|
6052
|
-
button.className += ' w-full';
|
|
6053
|
-
return button;
|
|
6054
|
-
}),
|
|
6055
|
-
..._$1__namespace.map(moreButtons, (button)=>{
|
|
6056
|
-
button.className += ' w-full';
|
|
6057
|
-
return button;
|
|
6058
|
-
})
|
|
6059
|
-
],
|
|
6120
|
+
"buttons": dropdownButtons,
|
|
6060
6121
|
"btnLevel": "enhance",
|
|
6061
6122
|
"className": "w-full",
|
|
6062
6123
|
"btnClassName": "w-full",
|
|
@@ -6081,7 +6142,7 @@ const getObjectDetailButtonsSchemas = (objectSchema, recordId, ctx)=>{
|
|
|
6081
6142
|
type: "steedos-dropdown-button",
|
|
6082
6143
|
label: "",
|
|
6083
6144
|
buttons: moreButtons,
|
|
6084
|
-
className: 'slds-icon',
|
|
6145
|
+
className: 'slds-icon ml-1',
|
|
6085
6146
|
visibleOn: moreButtonsVisibleOn
|
|
6086
6147
|
};
|
|
6087
6148
|
buttons.push(dropdownButtonsSchema);
|
|
@@ -6824,13 +6885,15 @@ function getObjectListHeaderFirstLine(objectSchema, listViewName, ctx) {
|
|
|
6824
6885
|
"visibleOn": "${display == 'split'?false:true}"
|
|
6825
6886
|
}];
|
|
6826
6887
|
if(ctx.formFactor !== 'SMALL'){
|
|
6888
|
+
const restButtons = Array.isArray(amisButtonsSchema) ? amisButtonsSchema.filter(obj => obj.name !== "standard_new"):[];
|
|
6827
6889
|
buttonSchema.push({
|
|
6828
6890
|
"type": "flex",
|
|
6829
6891
|
"items":[
|
|
6830
6892
|
standardNewButton,
|
|
6831
|
-
{
|
|
6893
|
+
(restButtons.length > 0) && {
|
|
6832
6894
|
"type": "dropdown-button",
|
|
6833
|
-
"buttons":
|
|
6895
|
+
"buttons": restButtons,
|
|
6896
|
+
"className": " ml-1",
|
|
6834
6897
|
"menuClassName": "p-none split-dropdown-buttons",
|
|
6835
6898
|
"align": "right",
|
|
6836
6899
|
"size": "sm"
|
|
@@ -6962,7 +7025,6 @@ async function getObjectListHeaderSecordLine(objectSchema, listViewName, ctx) {
|
|
|
6962
7025
|
},
|
|
6963
7026
|
{
|
|
6964
7027
|
"body": [
|
|
6965
|
-
fieldsFilterButtonSchema,
|
|
6966
7028
|
{
|
|
6967
7029
|
"type": "button",
|
|
6968
7030
|
"label": "",
|
|
@@ -6971,6 +7033,7 @@ async function getObjectListHeaderSecordLine(objectSchema, listViewName, ctx) {
|
|
|
6971
7033
|
"target": amisListViewId,
|
|
6972
7034
|
"className": "bg-white p-2 rounded border-gray-300 text-gray-500"
|
|
6973
7035
|
},
|
|
7036
|
+
fieldsFilterButtonSchema,
|
|
6974
7037
|
// {
|
|
6975
7038
|
// "type": "button",
|
|
6976
7039
|
// "label": "",
|
|
@@ -7218,7 +7281,7 @@ async function getObjectRecordDetailRelatedListHeader(relatedObjectSchema, relat
|
|
|
7218
7281
|
"body": [
|
|
7219
7282
|
{
|
|
7220
7283
|
"type": "tpl",
|
|
7221
|
-
"tpl": `<a class="text-black text-base font-bold" href="/app/\${appId}/\${_master.objectName}/\${_master.recordId}/\${objectName}/grid?related_field_name=\${relatedKey}">${relatedLabel}(\${$count})</a>`,
|
|
7284
|
+
"tpl": `<a class="text-black text-base font-bold hover:font-bold" href="/app/\${appId}/\${_master.objectName}/\${_master.recordId}/\${objectName}/grid?related_field_name=\${relatedKey}">${relatedLabel}(\${$count})</a>`,
|
|
7222
7285
|
"inline": false,
|
|
7223
7286
|
"wrapperComponent": "",
|
|
7224
7287
|
"className": "",
|
|
@@ -8307,7 +8370,7 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
8307
8370
|
{
|
|
8308
8371
|
"type": "search-box",
|
|
8309
8372
|
"name": keywordsSearchBoxName,
|
|
8310
|
-
"placeholder": "
|
|
8373
|
+
"placeholder": "搜索此列表",
|
|
8311
8374
|
"value": crudKeywords,
|
|
8312
8375
|
"clearable": true,
|
|
8313
8376
|
"clearAndSubmit": true
|
|
@@ -8430,10 +8493,10 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
8430
8493
|
if(toolbarCount){
|
|
8431
8494
|
toolbars.push(toolbarCount);
|
|
8432
8495
|
}
|
|
8433
|
-
toolbars.push(toolbarReloadButton);
|
|
8434
8496
|
if(toolbarFilter){
|
|
8435
8497
|
toolbars.push(toolbarFilter);
|
|
8436
8498
|
}
|
|
8499
|
+
toolbars.push(toolbarReloadButton);
|
|
8437
8500
|
toolbars.push(toolbarDisplayAsButton);
|
|
8438
8501
|
toolbars.push(toolbarDQuickSearchBox);
|
|
8439
8502
|
return [
|
|
@@ -8449,19 +8512,20 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
8449
8512
|
toolbars.push(toolbarFilter);
|
|
8450
8513
|
}
|
|
8451
8514
|
toolbars.push(toolbarReloadButton);
|
|
8515
|
+
toolbars.push(toolbarDisplayAsButton);
|
|
8452
8516
|
if(mainObject?.permissions?.allowCreateListViews){
|
|
8453
8517
|
toolbars.push(getSettingListviewToolbarButtonSchema());
|
|
8454
8518
|
}
|
|
8455
|
-
toolbars.push(toolbarDisplayAsButton);
|
|
8456
8519
|
toolbars.push(toolbarDQuickSearchBox);
|
|
8457
8520
|
return [
|
|
8458
8521
|
// "filter-toggler",
|
|
8459
8522
|
...(headerToolbarItems || []),
|
|
8460
8523
|
"bulkActions",
|
|
8461
|
-
|
|
8462
|
-
|
|
8463
|
-
|
|
8464
|
-
|
|
8524
|
+
// 不能放开crud columns-toggler否则crud card模式会报错
|
|
8525
|
+
// {
|
|
8526
|
+
// "type": "columns-toggler",
|
|
8527
|
+
// "className": "hidden"
|
|
8528
|
+
// },
|
|
8465
8529
|
...toolbars,
|
|
8466
8530
|
// {
|
|
8467
8531
|
// "type": "columns-toggler",
|
|
@@ -9068,10 +9132,13 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
9068
9132
|
const op = api.data.$self.op;
|
|
9069
9133
|
if(!_.isEmpty(op)){
|
|
9070
9134
|
// op不为空,表示处于字段初始编辑状态,不是点击后出现弹窗状态。
|
|
9135
|
+
// 这里不可以用_.pick函数让payload只返回labelField和valueField,因为字段上配置的amis autoFill功能可能依赖了其他字段
|
|
9136
|
+
/*
|
|
9071
9137
|
const rows = _.map(payload.data.rows, (item)=>{
|
|
9072
9138
|
return _.pick(item, ["${referenceTo.labelField.name}", "${referenceTo.valueField.name}"]);
|
|
9073
9139
|
})
|
|
9074
9140
|
payload.data.rows = rows;
|
|
9141
|
+
*/
|
|
9075
9142
|
return payload;
|
|
9076
9143
|
}
|
|
9077
9144
|
if(enable_tree){
|
|
@@ -10498,7 +10565,7 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
10498
10565
|
label: subField.label,
|
|
10499
10566
|
quickEdit: readonly ? false : gridSub
|
|
10500
10567
|
};
|
|
10501
|
-
if(subField.type
|
|
10568
|
+
if(["lookup", "boolean", "toggle"].indexOf(subField.type) > -1){
|
|
10502
10569
|
gridItemSchema.type = gridSub.type;
|
|
10503
10570
|
gridItemSchema.tpl = gridSub.tpl;
|
|
10504
10571
|
}
|
|
@@ -11432,7 +11499,7 @@ async function getTableOperation(ctx){
|
|
|
11432
11499
|
label: instance.t('frontend_operation'),
|
|
11433
11500
|
fixed: 'right',
|
|
11434
11501
|
labelClassName: 'text-center',
|
|
11435
|
-
className: 'text-center steedos-listview-operation w-
|
|
11502
|
+
className: 'text-center steedos-listview-operation w-10',
|
|
11436
11503
|
buttons: [
|
|
11437
11504
|
{
|
|
11438
11505
|
"type": "steedos-dropdown-button",
|
|
@@ -11464,11 +11531,10 @@ async function getTableOperation(ctx){
|
|
|
11464
11531
|
}
|
|
11465
11532
|
|
|
11466
11533
|
async function getTableSchema$1(fields, options){
|
|
11467
|
-
let isLookup = options && options.isLookup;
|
|
11468
|
-
let hiddenColumnOperation = options && options.hiddenColumnOperation;
|
|
11469
11534
|
if(!options){
|
|
11470
11535
|
options = {};
|
|
11471
11536
|
}
|
|
11537
|
+
let { isLookup, hiddenColumnOperation } = options;
|
|
11472
11538
|
let columns = [];
|
|
11473
11539
|
let useMobileColumns = options.formFactor === 'SMALL' || ["split"].indexOf(options.displayAs) > -1;
|
|
11474
11540
|
if(isLookup){
|
|
@@ -11480,6 +11546,7 @@ async function getTableSchema$1(fields, options){
|
|
|
11480
11546
|
}
|
|
11481
11547
|
else {
|
|
11482
11548
|
columns = await getTableColumns$1(fields, options);
|
|
11549
|
+
|
|
11483
11550
|
if(!isLookup && !hiddenColumnOperation){
|
|
11484
11551
|
columns.push(await getTableOperation(options));
|
|
11485
11552
|
}
|
|
@@ -11488,7 +11555,7 @@ async function getTableSchema$1(fields, options){
|
|
|
11488
11555
|
return {
|
|
11489
11556
|
mode: "table",
|
|
11490
11557
|
name: "thelist",
|
|
11491
|
-
headerToolbarClassName: "py-2 px-2 border-gray-300
|
|
11558
|
+
headerToolbarClassName: "py-2 px-2 border-gray-300 border-solid border-b",
|
|
11492
11559
|
className: "",
|
|
11493
11560
|
draggable: false,
|
|
11494
11561
|
defaultParams: getDefaultParams(options),
|
|
@@ -12784,6 +12851,161 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
|
|
|
12784
12851
|
return amisSchema;
|
|
12785
12852
|
}
|
|
12786
12853
|
|
|
12854
|
+
/******************************************************************************
|
|
12855
|
+
Copyright (c) Microsoft Corporation.
|
|
12856
|
+
|
|
12857
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
12858
|
+
purpose with or without fee is hereby granted.
|
|
12859
|
+
|
|
12860
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
12861
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
12862
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12863
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12864
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12865
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
12866
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
12867
|
+
***************************************************************************** */
|
|
12868
|
+
|
|
12869
|
+
var __assign$1 = function() {
|
|
12870
|
+
__assign$1 = Object.assign || function __assign(t) {
|
|
12871
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12872
|
+
s = arguments[i];
|
|
12873
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
12874
|
+
}
|
|
12875
|
+
return t;
|
|
12876
|
+
};
|
|
12877
|
+
return __assign$1.apply(this, arguments);
|
|
12878
|
+
};
|
|
12879
|
+
|
|
12880
|
+
/**
|
|
12881
|
+
* 将例如像 a.b.c 或 a[1].b 的字符串转换为路径数组
|
|
12882
|
+
*
|
|
12883
|
+
* @param string 要转换的字符串
|
|
12884
|
+
*/
|
|
12885
|
+
var keyToPath = function (string) {
|
|
12886
|
+
var result = [];
|
|
12887
|
+
if (string.charCodeAt(0) === '.'.charCodeAt(0)) {
|
|
12888
|
+
result.push('');
|
|
12889
|
+
}
|
|
12890
|
+
string.replace(new RegExp('[^.[\\]]+|\\[(?:([^"\'][^[]*)|(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))', 'g'), function (match, expression, quote, subString) {
|
|
12891
|
+
var key = match;
|
|
12892
|
+
if (quote) {
|
|
12893
|
+
key = subString.replace(/\\(\\)?/g, '$1');
|
|
12894
|
+
}
|
|
12895
|
+
else if (expression) {
|
|
12896
|
+
key = expression.trim();
|
|
12897
|
+
}
|
|
12898
|
+
result.push(key);
|
|
12899
|
+
return '';
|
|
12900
|
+
});
|
|
12901
|
+
return result;
|
|
12902
|
+
};
|
|
12903
|
+
|
|
12904
|
+
// 方便取值的时候能够把上层的取到,但是获取的时候不会全部把所有的数据获取到。
|
|
12905
|
+
function createObject(superProps, props, properties) {
|
|
12906
|
+
if (superProps && Object.isFrozen(superProps)) {
|
|
12907
|
+
superProps = cloneObject(superProps);
|
|
12908
|
+
}
|
|
12909
|
+
var obj = superProps
|
|
12910
|
+
? Object.create(superProps, __assign$1(__assign$1({}, properties), { __super: {
|
|
12911
|
+
value: superProps,
|
|
12912
|
+
writable: false,
|
|
12913
|
+
enumerable: false
|
|
12914
|
+
} }))
|
|
12915
|
+
: Object.create(Object.prototype, properties);
|
|
12916
|
+
props &&
|
|
12917
|
+
isObject(props) &&
|
|
12918
|
+
Object.keys(props).forEach(function (key) { return (obj[key] = props[key]); });
|
|
12919
|
+
return obj;
|
|
12920
|
+
}
|
|
12921
|
+
function cloneObject(target, persistOwnProps) {
|
|
12922
|
+
if (persistOwnProps === void 0) { persistOwnProps = true; }
|
|
12923
|
+
var obj = target && target.__super
|
|
12924
|
+
? Object.create(target.__super, {
|
|
12925
|
+
__super: {
|
|
12926
|
+
value: target.__super,
|
|
12927
|
+
writable: false,
|
|
12928
|
+
enumerable: false
|
|
12929
|
+
}
|
|
12930
|
+
})
|
|
12931
|
+
: Object.create(Object.prototype);
|
|
12932
|
+
persistOwnProps &&
|
|
12933
|
+
target &&
|
|
12934
|
+
Object.keys(target).forEach(function (key) { return (obj[key] = target[key]); });
|
|
12935
|
+
return obj;
|
|
12936
|
+
}
|
|
12937
|
+
function extendObject(target, src, persistOwnProps) {
|
|
12938
|
+
if (persistOwnProps === void 0) { persistOwnProps = true; }
|
|
12939
|
+
var obj = cloneObject(target, persistOwnProps);
|
|
12940
|
+
src && Object.keys(src).forEach(function (key) { return (obj[key] = src[key]); });
|
|
12941
|
+
return obj;
|
|
12942
|
+
}
|
|
12943
|
+
function isObject(obj) {
|
|
12944
|
+
var typename = typeof obj;
|
|
12945
|
+
return (obj &&
|
|
12946
|
+
typename !== 'string' &&
|
|
12947
|
+
typename !== 'number' &&
|
|
12948
|
+
typename !== 'boolean' &&
|
|
12949
|
+
typename !== 'function' &&
|
|
12950
|
+
!Array.isArray(obj));
|
|
12951
|
+
}
|
|
12952
|
+
function setVariable(data, key, value, convertKeyToPath) {
|
|
12953
|
+
data = data || {};
|
|
12954
|
+
if (key in data) {
|
|
12955
|
+
data[key] = value;
|
|
12956
|
+
return;
|
|
12957
|
+
}
|
|
12958
|
+
var parts = convertKeyToPath !== false ? keyToPath(key) : [key];
|
|
12959
|
+
var last = parts.pop();
|
|
12960
|
+
while (parts.length) {
|
|
12961
|
+
var key_1 = parts.shift();
|
|
12962
|
+
if (isPlainObject_1(data[key_1])) {
|
|
12963
|
+
data = data[key_1] = __assign$1({}, data[key_1]);
|
|
12964
|
+
}
|
|
12965
|
+
else if (Array.isArray(data[key_1])) {
|
|
12966
|
+
data[key_1] = data[key_1].concat();
|
|
12967
|
+
data = data[key_1];
|
|
12968
|
+
}
|
|
12969
|
+
else if (data[key_1]) {
|
|
12970
|
+
// throw new Error(`目标路径不是纯对象,不能覆盖`);
|
|
12971
|
+
// 强行转成对象
|
|
12972
|
+
data[key_1] = {};
|
|
12973
|
+
data = data[key_1];
|
|
12974
|
+
}
|
|
12975
|
+
else {
|
|
12976
|
+
data[key_1] = {};
|
|
12977
|
+
data = data[key_1];
|
|
12978
|
+
}
|
|
12979
|
+
}
|
|
12980
|
+
data[last] = value;
|
|
12981
|
+
}
|
|
12982
|
+
function deleteVariable(data, key) {
|
|
12983
|
+
if (!data) {
|
|
12984
|
+
return;
|
|
12985
|
+
}
|
|
12986
|
+
else if (data.hasOwnProperty(key)) {
|
|
12987
|
+
delete data[key];
|
|
12988
|
+
return;
|
|
12989
|
+
}
|
|
12990
|
+
var parts = keyToPath(key);
|
|
12991
|
+
var last = parts.pop();
|
|
12992
|
+
while (parts.length) {
|
|
12993
|
+
var key_2 = parts.shift();
|
|
12994
|
+
if (isPlainObject_1(data[key_2])) {
|
|
12995
|
+
data = data[key_2] = __assign$1({}, data[key_2]);
|
|
12996
|
+
}
|
|
12997
|
+
else if (data[key_2]) {
|
|
12998
|
+
throw new Error("\u76EE\u6807\u8DEF\u5F84\u4E0D\u662F\u7EAF\u5BF9\u8C61\uFF0C\u4E0D\u80FD\u4FEE\u6539");
|
|
12999
|
+
}
|
|
13000
|
+
else {
|
|
13001
|
+
break;
|
|
13002
|
+
}
|
|
13003
|
+
}
|
|
13004
|
+
if (data && data.hasOwnProperty && data.hasOwnProperty(last)) {
|
|
13005
|
+
delete data[last];
|
|
13006
|
+
}
|
|
13007
|
+
}
|
|
13008
|
+
|
|
12787
13009
|
/*
|
|
12788
13010
|
* @Author: baozhoutao@steedos.com
|
|
12789
13011
|
* @Date: 2022-05-26 16:02:08
|
|
@@ -13024,9 +13246,30 @@ function getBulkActions(objectSchema){
|
|
|
13024
13246
|
]
|
|
13025
13247
|
}
|
|
13026
13248
|
|
|
13249
|
+
async function getCrudSchemaWithDataFilter(crud, options = {}){
|
|
13250
|
+
const { crudDataFilter, amisData, env } = options;
|
|
13251
|
+
let onCrudDataFilter = options.onCrudDataFilter;
|
|
13252
|
+
if (!onCrudDataFilter && typeof crudDataFilter === 'string') {
|
|
13253
|
+
onCrudDataFilter = new Function(
|
|
13254
|
+
'crud',
|
|
13255
|
+
'env',
|
|
13256
|
+
'data',
|
|
13257
|
+
crudDataFilter
|
|
13258
|
+
);
|
|
13259
|
+
}
|
|
13260
|
+
|
|
13261
|
+
try {
|
|
13262
|
+
onCrudDataFilter && (crud = await onCrudDataFilter(crud, env, amisData) || crud);
|
|
13263
|
+
} catch (e) {
|
|
13264
|
+
console.warn(e);
|
|
13265
|
+
}
|
|
13266
|
+
return crud;
|
|
13267
|
+
}
|
|
13268
|
+
|
|
13027
13269
|
async function getObjectCRUD(objectSchema, fields, options){
|
|
13028
13270
|
// console.time('getObjectCRUD');
|
|
13029
|
-
const { top, perPage, showDisplayAs = false, displayAs, crudClassName = ""
|
|
13271
|
+
const { top, perPage, showDisplayAs = false, displayAs, crudClassName = "",
|
|
13272
|
+
crudDataFilter, onCrudDataFilter, amisData, env } = options;
|
|
13030
13273
|
const nonpaged = objectSchema.paging && objectSchema.paging.enabled === false;
|
|
13031
13274
|
const isTreeObject = objectSchema.enable_tree;
|
|
13032
13275
|
const bulkActions = getBulkActions(objectSchema);
|
|
@@ -13067,6 +13310,14 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
13067
13310
|
filterVisible: options.filterVisible
|
|
13068
13311
|
});
|
|
13069
13312
|
|
|
13313
|
+
options.amisData = createObject(options.amisData, {
|
|
13314
|
+
objectName: objectSchema.name,
|
|
13315
|
+
// _id: null,
|
|
13316
|
+
recordPermissions: objectSchema.permissions,
|
|
13317
|
+
uiSchema: objectSchema,
|
|
13318
|
+
// loaded: false //crud接收适配器中设置为true,否则就是刷新浏览器第一次加载
|
|
13319
|
+
});
|
|
13320
|
+
|
|
13070
13321
|
|
|
13071
13322
|
let body = null;
|
|
13072
13323
|
const id = `listview_${objectSchema.name}`;
|
|
@@ -13092,7 +13343,12 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
13092
13343
|
if(objectSchema.name === 'organizations'){
|
|
13093
13344
|
labelFieldName = 'name';
|
|
13094
13345
|
}
|
|
13095
|
-
|
|
13346
|
+
let tableOptions = Object.assign({
|
|
13347
|
+
idFieldName: objectSchema.idFieldName, labelFieldName: labelFieldName,
|
|
13348
|
+
permissions:objectSchema.permissions,enable_inline_edit:objectSchema.enable_inline_edit
|
|
13349
|
+
}, options);
|
|
13350
|
+
tableOptions.amisData = createObject(options.amisData || {}, {});
|
|
13351
|
+
const table = await getTableSchema$1(fields, tableOptions);
|
|
13096
13352
|
delete table.mode;
|
|
13097
13353
|
//image与avatar需要在提交修改时特别处理
|
|
13098
13354
|
const imageNames = _$1__default["default"].compact(_$1__default["default"].map(_$1__default["default"].filter(fields, (field) => ["image","avatar"].includes(field.type)), 'name'));
|
|
@@ -13150,17 +13406,26 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
13150
13406
|
Authorization: "Bearer ${context.tenantId},${context.authToken}",
|
|
13151
13407
|
},
|
|
13152
13408
|
requestAdaptor: quickSaveApiRequestAdaptor,
|
|
13409
|
+
adaptor: `
|
|
13410
|
+
if(payload.errors){
|
|
13411
|
+
payload.status = 2;
|
|
13412
|
+
payload.msg = window.t ? window.t(payload.errors[0].message) : payload.errors[0].message;
|
|
13413
|
+
}
|
|
13414
|
+
return payload;
|
|
13415
|
+
`
|
|
13153
13416
|
},
|
|
13154
13417
|
rowClassNameExpr: options.rowClassNameExpr
|
|
13155
|
-
},
|
|
13156
|
-
|
|
13157
|
-
);
|
|
13418
|
+
}, bodyProps);
|
|
13419
|
+
|
|
13158
13420
|
}
|
|
13159
13421
|
|
|
13160
13422
|
const defaults = options.defaults;
|
|
13423
|
+
|
|
13424
|
+
const listSchema = (defaults && defaults.listSchema) || {};
|
|
13425
|
+
body = defaultsDeep({}, listSchema, body);
|
|
13426
|
+
body = await getCrudSchemaWithDataFilter(body, { crudDataFilter, onCrudDataFilter, amisData, env });
|
|
13427
|
+
|
|
13161
13428
|
if (defaults) {
|
|
13162
|
-
const listSchema = defaults.listSchema || {};
|
|
13163
|
-
body = defaultsDeep({}, listSchema, body);
|
|
13164
13429
|
const headerSchema = defaults.headerSchema;
|
|
13165
13430
|
const footerSchema = defaults.footerSchema;
|
|
13166
13431
|
if (headerSchema || footerSchema) {
|
|
@@ -13189,16 +13454,10 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
13189
13454
|
return {
|
|
13190
13455
|
type: 'service',
|
|
13191
13456
|
className: '',
|
|
13192
|
-
//目前crud的service层id不认用户自定义id,只支持默认规则id
|
|
13457
|
+
//目前crud的service层id不认用户自定义id,只支持默认规则id,许多地方的格式都写死了service_listview_${objectname}
|
|
13193
13458
|
id: `service_${id}`,
|
|
13194
13459
|
name: `page`,
|
|
13195
|
-
data:
|
|
13196
|
-
objectName: objectSchema.name,
|
|
13197
|
-
// _id: null,
|
|
13198
|
-
recordPermissions: objectSchema.permissions,
|
|
13199
|
-
uiSchema: objectSchema,
|
|
13200
|
-
// loaded: false //crud接收适配器中设置为true,否则就是刷新浏览器第一次加载
|
|
13201
|
-
},
|
|
13460
|
+
data: options.amisData,
|
|
13202
13461
|
body: body
|
|
13203
13462
|
}
|
|
13204
13463
|
}
|
|
@@ -13498,7 +13757,7 @@ const getRecordPermissions = async (objectName, recordId)=>{
|
|
|
13498
13757
|
* @Author: baozhoutao@steedos.com
|
|
13499
13758
|
* @Date: 2022-07-05 15:55:39
|
|
13500
13759
|
* @LastEditors: liaodaxue
|
|
13501
|
-
* @LastEditTime: 2023-
|
|
13760
|
+
* @LastEditTime: 2023-09-25 17:18:08
|
|
13502
13761
|
* @Description:
|
|
13503
13762
|
*/
|
|
13504
13763
|
|
|
@@ -13673,7 +13932,8 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
|
|
|
13673
13932
|
setDataToComponentId: componentId,
|
|
13674
13933
|
// tableHiddenOn: hiddenEmptyTable ? "this.$count === 0" : null,
|
|
13675
13934
|
appId: appId,
|
|
13676
|
-
crudClassName: 'border-t border-
|
|
13935
|
+
crudClassName: 'border-t border-gray-300 hidden',
|
|
13936
|
+
refField,
|
|
13677
13937
|
...ctx
|
|
13678
13938
|
};
|
|
13679
13939
|
const amisSchema= (await getRelatedListSchema(relatedObjectName, 'all', options)).amisSchema;
|
|
@@ -13685,7 +13945,7 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
|
|
|
13685
13945
|
amisSchema: {
|
|
13686
13946
|
type: "service",
|
|
13687
13947
|
id: componentId,
|
|
13688
|
-
className: `steedos-record-related-list ${componentId} rounded border border-
|
|
13948
|
+
className: `steedos-record-related-list ${componentId} rounded border border-gray-300 bg-gray-100 mb-4 ${className}`,
|
|
13689
13949
|
data: {
|
|
13690
13950
|
relatedKey: relatedKey,
|
|
13691
13951
|
listViewId: `amis-\${appId}-${relatedObjectName}-listview`,
|
|
@@ -13788,10 +14048,33 @@ async function getRelatedListSchema(
|
|
|
13788
14048
|
ctx
|
|
13789
14049
|
) {
|
|
13790
14050
|
const uiSchema = await getUISchema(objectName);
|
|
13791
|
-
const listView =
|
|
14051
|
+
const listView = _$1.find(
|
|
14052
|
+
uiSchema.list_views,
|
|
14053
|
+
(listView, name) => {
|
|
14054
|
+
// 传入listViewName空值则取第一个
|
|
14055
|
+
if(!listViewName){
|
|
14056
|
+
listViewName = name;
|
|
14057
|
+
}
|
|
14058
|
+
return name === listViewName || listView._id === listViewName;
|
|
14059
|
+
}
|
|
14060
|
+
);
|
|
13792
14061
|
const listViewProps = getRelatedListProps(uiSchema,listViewName, ctx);
|
|
13793
14062
|
// console.log('listViewProps==>', listViewProps)
|
|
13794
14063
|
const {columns: listViewColumns, sort: listViewSort, filter: listviewFilter, filtersFunction } = listViewProps;
|
|
14064
|
+
|
|
14065
|
+
const refFieldName = ctx.refField && ctx.refField.name;
|
|
14066
|
+
|
|
14067
|
+
let relatedListColumns = listViewColumns;
|
|
14068
|
+
if(refFieldName){
|
|
14069
|
+
relatedListColumns = listViewColumns.filter(function(columnItem){
|
|
14070
|
+
if(typeof columnItem === "string"){
|
|
14071
|
+
return columnItem !== refFieldName;
|
|
14072
|
+
}
|
|
14073
|
+
else {
|
|
14074
|
+
return columnItem.field !== refFieldName;
|
|
14075
|
+
}
|
|
14076
|
+
});
|
|
14077
|
+
}
|
|
13795
14078
|
|
|
13796
14079
|
const defaults = ctx.defaults || {};
|
|
13797
14080
|
|
|
@@ -13829,7 +14112,7 @@ async function getRelatedListSchema(
|
|
|
13829
14112
|
const amisSchema = {
|
|
13830
14113
|
"type": "steedos-object-table",
|
|
13831
14114
|
"objectApiName": objectName,
|
|
13832
|
-
"columns":
|
|
14115
|
+
"columns": relatedListColumns,
|
|
13833
14116
|
"extraColumns": listView.extra_columns,
|
|
13834
14117
|
"filters": listviewFilter,
|
|
13835
14118
|
"filtersFunction": filtersFunction,
|
|
@@ -13850,7 +14133,7 @@ async function getRelatedListSchema(
|
|
|
13850
14133
|
* @Author: baozhoutao@steedos.com
|
|
13851
14134
|
* @Date: 2022-07-05 15:55:39
|
|
13852
14135
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
13853
|
-
* @LastEditTime: 2023-09-
|
|
14136
|
+
* @LastEditTime: 2023-09-21 17:35:06
|
|
13854
14137
|
* @Description:
|
|
13855
14138
|
*/
|
|
13856
14139
|
|
|
@@ -14183,7 +14466,9 @@ async function getListSchema(
|
|
|
14183
14466
|
"adaptor": listView.adaptor,
|
|
14184
14467
|
"headerToolbarItems": ctx.headerToolbarItems,
|
|
14185
14468
|
"filterVisible": ctx.filterVisible,
|
|
14186
|
-
"rowClassNameExpr": ctx.rowClassNameExpr
|
|
14469
|
+
"rowClassNameExpr": ctx.rowClassNameExpr,
|
|
14470
|
+
"crudDataFilter": ctx.crudDataFilter,
|
|
14471
|
+
"onCrudDataFilter": ctx.onCrudDataFilter
|
|
14187
14472
|
};
|
|
14188
14473
|
// console.log(`getListSchema===>`,amisSchema)
|
|
14189
14474
|
return {
|
|
@@ -14286,7 +14571,7 @@ async function getTableSchema(
|
|
|
14286
14571
|
fields = fields.concat(extraFields);
|
|
14287
14572
|
}
|
|
14288
14573
|
|
|
14289
|
-
|
|
14574
|
+
let crudOptions = {
|
|
14290
14575
|
tabId: objectName,
|
|
14291
14576
|
appId: appName,
|
|
14292
14577
|
objectName: objectName,
|
|
@@ -14295,8 +14580,9 @@ async function getTableSchema(
|
|
|
14295
14580
|
sort,
|
|
14296
14581
|
headerToolbarItems: ctx.headerToolbarItems,
|
|
14297
14582
|
buttons: await getListViewItemButtons(uiSchema, ctx)
|
|
14298
|
-
}
|
|
14299
|
-
|
|
14583
|
+
};
|
|
14584
|
+
crudOptions.amisData = createObject(ctx.amisData || {}, {});
|
|
14585
|
+
const amisSchema = await getObjectCRUD(uiSchema, fields, crudOptions);
|
|
14300
14586
|
// console.timeEnd('getTableSchema');
|
|
14301
14587
|
return {
|
|
14302
14588
|
uiSchema,
|
|
@@ -14368,7 +14654,7 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
|
|
|
14368
14654
|
};
|
|
14369
14655
|
const content = {
|
|
14370
14656
|
"type": "tabs",
|
|
14371
|
-
"className": "sm:mt-3 bg-white sm:
|
|
14657
|
+
"className": "sm:mt-3 bg-white sm:rounded sm:border border-gray-300 p-4",
|
|
14372
14658
|
"tabs": [
|
|
14373
14659
|
detailed
|
|
14374
14660
|
],
|
|
@@ -14555,7 +14841,7 @@ async function getListPageInitSchema(objectApiName, formFactor, userSession) {
|
|
|
14555
14841
|
"columnsTogglable": false,
|
|
14556
14842
|
"showHeader": true,
|
|
14557
14843
|
// "headerSchema": headerSchema
|
|
14558
|
-
className: "sm:border bg-white sm:
|
|
14844
|
+
className: "sm:border bg-white sm:rounded border-gray-300 border-solid"
|
|
14559
14845
|
}]
|
|
14560
14846
|
}
|
|
14561
14847
|
}
|
|
@@ -14613,7 +14899,7 @@ async function getRecordPageInitSchema(objectApiName){
|
|
|
14613
14899
|
]
|
|
14614
14900
|
}
|
|
14615
14901
|
],
|
|
14616
|
-
"className": "sm:mt-3 flex flex-col region-main bg-white sm:
|
|
14902
|
+
"className": "sm:mt-3 flex flex-col region-main bg-white sm:rounded sm:border border-gray-300",
|
|
14617
14903
|
"linksClassName": "pl-4 pt-2"
|
|
14618
14904
|
};
|
|
14619
14905
|
if(relatedList.length){
|
|
@@ -15080,161 +15366,6 @@ const registerRemoteAssets = async (assetUrls)=>{
|
|
|
15080
15366
|
}
|
|
15081
15367
|
};
|
|
15082
15368
|
|
|
15083
|
-
/******************************************************************************
|
|
15084
|
-
Copyright (c) Microsoft Corporation.
|
|
15085
|
-
|
|
15086
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
15087
|
-
purpose with or without fee is hereby granted.
|
|
15088
|
-
|
|
15089
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
15090
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15091
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
15092
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
15093
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
15094
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15095
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15096
|
-
***************************************************************************** */
|
|
15097
|
-
|
|
15098
|
-
var __assign$1 = function() {
|
|
15099
|
-
__assign$1 = Object.assign || function __assign(t) {
|
|
15100
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
15101
|
-
s = arguments[i];
|
|
15102
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
15103
|
-
}
|
|
15104
|
-
return t;
|
|
15105
|
-
};
|
|
15106
|
-
return __assign$1.apply(this, arguments);
|
|
15107
|
-
};
|
|
15108
|
-
|
|
15109
|
-
/**
|
|
15110
|
-
* 将例如像 a.b.c 或 a[1].b 的字符串转换为路径数组
|
|
15111
|
-
*
|
|
15112
|
-
* @param string 要转换的字符串
|
|
15113
|
-
*/
|
|
15114
|
-
var keyToPath = function (string) {
|
|
15115
|
-
var result = [];
|
|
15116
|
-
if (string.charCodeAt(0) === '.'.charCodeAt(0)) {
|
|
15117
|
-
result.push('');
|
|
15118
|
-
}
|
|
15119
|
-
string.replace(new RegExp('[^.[\\]]+|\\[(?:([^"\'][^[]*)|(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))', 'g'), function (match, expression, quote, subString) {
|
|
15120
|
-
var key = match;
|
|
15121
|
-
if (quote) {
|
|
15122
|
-
key = subString.replace(/\\(\\)?/g, '$1');
|
|
15123
|
-
}
|
|
15124
|
-
else if (expression) {
|
|
15125
|
-
key = expression.trim();
|
|
15126
|
-
}
|
|
15127
|
-
result.push(key);
|
|
15128
|
-
return '';
|
|
15129
|
-
});
|
|
15130
|
-
return result;
|
|
15131
|
-
};
|
|
15132
|
-
|
|
15133
|
-
// 方便取值的时候能够把上层的取到,但是获取的时候不会全部把所有的数据获取到。
|
|
15134
|
-
function createObject(superProps, props, properties) {
|
|
15135
|
-
if (superProps && Object.isFrozen(superProps)) {
|
|
15136
|
-
superProps = cloneObject(superProps);
|
|
15137
|
-
}
|
|
15138
|
-
var obj = superProps
|
|
15139
|
-
? Object.create(superProps, __assign$1(__assign$1({}, properties), { __super: {
|
|
15140
|
-
value: superProps,
|
|
15141
|
-
writable: false,
|
|
15142
|
-
enumerable: false
|
|
15143
|
-
} }))
|
|
15144
|
-
: Object.create(Object.prototype, properties);
|
|
15145
|
-
props &&
|
|
15146
|
-
isObject(props) &&
|
|
15147
|
-
Object.keys(props).forEach(function (key) { return (obj[key] = props[key]); });
|
|
15148
|
-
return obj;
|
|
15149
|
-
}
|
|
15150
|
-
function cloneObject(target, persistOwnProps) {
|
|
15151
|
-
if (persistOwnProps === void 0) { persistOwnProps = true; }
|
|
15152
|
-
var obj = target && target.__super
|
|
15153
|
-
? Object.create(target.__super, {
|
|
15154
|
-
__super: {
|
|
15155
|
-
value: target.__super,
|
|
15156
|
-
writable: false,
|
|
15157
|
-
enumerable: false
|
|
15158
|
-
}
|
|
15159
|
-
})
|
|
15160
|
-
: Object.create(Object.prototype);
|
|
15161
|
-
persistOwnProps &&
|
|
15162
|
-
target &&
|
|
15163
|
-
Object.keys(target).forEach(function (key) { return (obj[key] = target[key]); });
|
|
15164
|
-
return obj;
|
|
15165
|
-
}
|
|
15166
|
-
function extendObject(target, src, persistOwnProps) {
|
|
15167
|
-
if (persistOwnProps === void 0) { persistOwnProps = true; }
|
|
15168
|
-
var obj = cloneObject(target, persistOwnProps);
|
|
15169
|
-
src && Object.keys(src).forEach(function (key) { return (obj[key] = src[key]); });
|
|
15170
|
-
return obj;
|
|
15171
|
-
}
|
|
15172
|
-
function isObject(obj) {
|
|
15173
|
-
var typename = typeof obj;
|
|
15174
|
-
return (obj &&
|
|
15175
|
-
typename !== 'string' &&
|
|
15176
|
-
typename !== 'number' &&
|
|
15177
|
-
typename !== 'boolean' &&
|
|
15178
|
-
typename !== 'function' &&
|
|
15179
|
-
!Array.isArray(obj));
|
|
15180
|
-
}
|
|
15181
|
-
function setVariable(data, key, value, convertKeyToPath) {
|
|
15182
|
-
data = data || {};
|
|
15183
|
-
if (key in data) {
|
|
15184
|
-
data[key] = value;
|
|
15185
|
-
return;
|
|
15186
|
-
}
|
|
15187
|
-
var parts = convertKeyToPath !== false ? keyToPath(key) : [key];
|
|
15188
|
-
var last = parts.pop();
|
|
15189
|
-
while (parts.length) {
|
|
15190
|
-
var key_1 = parts.shift();
|
|
15191
|
-
if (isPlainObject_1(data[key_1])) {
|
|
15192
|
-
data = data[key_1] = __assign$1({}, data[key_1]);
|
|
15193
|
-
}
|
|
15194
|
-
else if (Array.isArray(data[key_1])) {
|
|
15195
|
-
data[key_1] = data[key_1].concat();
|
|
15196
|
-
data = data[key_1];
|
|
15197
|
-
}
|
|
15198
|
-
else if (data[key_1]) {
|
|
15199
|
-
// throw new Error(`目标路径不是纯对象,不能覆盖`);
|
|
15200
|
-
// 强行转成对象
|
|
15201
|
-
data[key_1] = {};
|
|
15202
|
-
data = data[key_1];
|
|
15203
|
-
}
|
|
15204
|
-
else {
|
|
15205
|
-
data[key_1] = {};
|
|
15206
|
-
data = data[key_1];
|
|
15207
|
-
}
|
|
15208
|
-
}
|
|
15209
|
-
data[last] = value;
|
|
15210
|
-
}
|
|
15211
|
-
function deleteVariable(data, key) {
|
|
15212
|
-
if (!data) {
|
|
15213
|
-
return;
|
|
15214
|
-
}
|
|
15215
|
-
else if (data.hasOwnProperty(key)) {
|
|
15216
|
-
delete data[key];
|
|
15217
|
-
return;
|
|
15218
|
-
}
|
|
15219
|
-
var parts = keyToPath(key);
|
|
15220
|
-
var last = parts.pop();
|
|
15221
|
-
while (parts.length) {
|
|
15222
|
-
var key_2 = parts.shift();
|
|
15223
|
-
if (isPlainObject_1(data[key_2])) {
|
|
15224
|
-
data = data[key_2] = __assign$1({}, data[key_2]);
|
|
15225
|
-
}
|
|
15226
|
-
else if (data[key_2]) {
|
|
15227
|
-
throw new Error("\u76EE\u6807\u8DEF\u5F84\u4E0D\u662F\u7EAF\u5BF9\u8C61\uFF0C\u4E0D\u80FD\u4FEE\u6539");
|
|
15228
|
-
}
|
|
15229
|
-
else {
|
|
15230
|
-
break;
|
|
15231
|
-
}
|
|
15232
|
-
}
|
|
15233
|
-
if (data && data.hasOwnProperty && data.hasOwnProperty(last)) {
|
|
15234
|
-
delete data[last];
|
|
15235
|
-
}
|
|
15236
|
-
}
|
|
15237
|
-
|
|
15238
15369
|
/*
|
|
15239
15370
|
* @Author: baozhoutao@steedos.com
|
|
15240
15371
|
* @Date: 2022-12-17 17:03:40
|
|
@@ -17895,14 +18026,12 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
17895
18026
|
}); };
|
|
17896
18027
|
|
|
17897
18028
|
var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
17898
|
-
var $schema, top, perPage, _a, showHeader, data, defaultData, _b, crud, _c, className, crudClassName,
|
|
17899
|
-
var
|
|
17900
|
-
return __generator(this, function (
|
|
17901
|
-
switch (
|
|
18029
|
+
var $schema, top, perPage, _a, showHeader, data, defaultData, _b, crud, _c, className, _d, style, crudClassName, _e, showDisplayAs, sideSchema, _g, filterVisible, headerToolbarItems, rowClassNameExpr, _h, hiddenColumnOperation, columns, crudDataFilter, onCrudDataFilter, env, rebuildOn, headerSchema, ctx, listName, defaults, objectApiName, displayAs, formFactor, isMobile, uiSchema, listView, schemaKeys, listSchema, setDataToComponentId, amisSchemaData, listViewId, allData, listViewSchemaProps, serviceData;
|
|
18030
|
+
var _j;
|
|
18031
|
+
return __generator(this, function (_k) {
|
|
18032
|
+
switch (_k.label) {
|
|
17902
18033
|
case 0:
|
|
17903
|
-
|
|
17904
|
-
console.log("AmisObjectListView props", props);
|
|
17905
|
-
$schema = props.$schema, top = props.top, perPage = props.perPage, _a = props.showHeader, showHeader = _a === void 0 ? true : _a, data = props.data, defaultData = props.defaultData, _b = props.crud, crud = _b === void 0 ? {} : _b, _c = props.className, className = _c === void 0 ? "" : _c, crudClassName = props.crudClassName, _d = props.showDisplayAs, showDisplayAs = _d === void 0 ? false : _d, sideSchema = props.sideSchema, props.columnsTogglable, _f = props.filterVisible, filterVisible = _f === void 0 ? true : _f, headerToolbarItems = props.headerToolbarItems, rowClassNameExpr = props.rowClassNameExpr, _g = props.hiddenColumnOperation, hiddenColumnOperation = _g === void 0 ? false : _g;
|
|
18034
|
+
$schema = props.$schema, top = props.top, perPage = props.perPage, _a = props.showHeader, showHeader = _a === void 0 ? true : _a, data = props.data, defaultData = props.defaultData, _b = props.crud, crud = _b === void 0 ? {} : _b, _c = props.className, className = _c === void 0 ? "" : _c, _d = props.style, style = _d === void 0 ? {} : _d, crudClassName = props.crudClassName, _e = props.showDisplayAs, showDisplayAs = _e === void 0 ? false : _e, sideSchema = props.sideSchema, props.columnsTogglable, _g = props.filterVisible, filterVisible = _g === void 0 ? true : _g, headerToolbarItems = props.headerToolbarItems, rowClassNameExpr = props.rowClassNameExpr, _h = props.hiddenColumnOperation, hiddenColumnOperation = _h === void 0 ? false : _h, columns = props.columns, crudDataFilter = props.crudDataFilter, onCrudDataFilter = props.onCrudDataFilter, env = props.env, rebuildOn = props.rebuildOn;
|
|
17906
18035
|
headerSchema = props.headerSchema;
|
|
17907
18036
|
ctx = props.ctx;
|
|
17908
18037
|
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);
|
|
@@ -17931,7 +18060,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
17931
18060
|
}
|
|
17932
18061
|
return [4 /*yield*/, getUISchema(objectApiName, false)];
|
|
17933
18062
|
case 1:
|
|
17934
|
-
uiSchema =
|
|
18063
|
+
uiSchema = _k.sent();
|
|
17935
18064
|
listView = _$1.find(uiSchema.list_views, function (listView, name) {
|
|
17936
18065
|
// 传入listViewName空值则取第一个
|
|
17937
18066
|
if (!listName) {
|
|
@@ -17982,7 +18111,8 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
17982
18111
|
}
|
|
17983
18112
|
amisSchemaData = Object.assign({}, data, defaultData);
|
|
17984
18113
|
listViewId = (ctx === null || ctx === void 0 ? void 0 : ctx.listViewId) || amisSchemaData.listViewId;
|
|
17985
|
-
|
|
18114
|
+
allData = createObject(data, defaultData);
|
|
18115
|
+
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, rowClassNameExpr: rowClassNameExpr, hiddenColumnOperation: hiddenColumnOperation, columns: columns, crudDataFilter: crudDataFilter, onCrudDataFilter: onCrudDataFilter, amisData: allData, env: env });
|
|
17986
18116
|
if (!headerSchema) {
|
|
17987
18117
|
headerSchema = getObjectListHeader$1(uiSchema, listName, ctx);
|
|
17988
18118
|
}
|
|
@@ -17996,14 +18126,15 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
17996
18126
|
if (!_$1.has(data, 'uiSchema')) {
|
|
17997
18127
|
serviceData.uiSchema = uiSchema;
|
|
17998
18128
|
}
|
|
17999
|
-
serviceData.defaultListName = listName ? listName : (
|
|
18129
|
+
serviceData.defaultListName = listName ? listName : (_j = _$1.first(_$1.values(uiSchema.list_views))) === null || _j === void 0 ? void 0 : _j.name;
|
|
18000
18130
|
// console.timeEnd('AmisObjectListView')
|
|
18001
18131
|
// console.log('serviceData===>', serviceData)
|
|
18002
18132
|
// console.log('headerSchema===>', headerSchema)
|
|
18003
18133
|
return [2 /*return*/, {
|
|
18004
18134
|
type: "service",
|
|
18005
18135
|
data: serviceData,
|
|
18006
|
-
|
|
18136
|
+
style: style,
|
|
18137
|
+
className: "".concat(className, " sm:bg-gray-100 h-full border-gray-300 steedos-object-listview ").concat(displayAs === 'split' ? 'sm:border-r' : 'sm:rounded sm:border'),
|
|
18007
18138
|
body: [{
|
|
18008
18139
|
"type": "wrapper",
|
|
18009
18140
|
"size": "none",
|
|
@@ -18025,16 +18156,17 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
18025
18156
|
body: __spreadArray(__spreadArray([], __read(headerSchema), false), [
|
|
18026
18157
|
{
|
|
18027
18158
|
"type": "service",
|
|
18159
|
+
"id": "service_schema_api_" + objectApiName,
|
|
18028
18160
|
"schemaApi": {
|
|
18029
18161
|
// 这里url上加objectApiName属性是因为设计器中切换对象时不会变更列表视图界面,不可以用objectName=${objectName}使用作用域中objectName变量是因为设计器那边不会监听识别data变化来render组件
|
|
18030
|
-
"url": "${context.rootUrl}/graphql?objectName=" + objectApiName + "&listName=${listName}&display=${display}",
|
|
18162
|
+
"url": "${context.rootUrl}/graphql?objectName=" + objectApiName + "&listName=${listName}&display=${display}&rebuildOn=" + rebuildOn,
|
|
18031
18163
|
"method": "post",
|
|
18032
18164
|
"messages": {},
|
|
18033
18165
|
"headers": {
|
|
18034
18166
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
18035
18167
|
},
|
|
18036
18168
|
"requestAdaptor": "api.data={query: '{spaces__findOne(id: \"none\"){_id,name}}'};return api;",
|
|
18037
|
-
"adaptor": "\n // console.log('service listview schemaApi adaptor....', api.body); \n let { appId, objectName, defaultListName: listName, display, formFactor: defaultFormFactor} = api.body;\n if(api.body.listName){\n listName = api.body.listName;\n }\n return new Promise((resolve)=>{\n const listViewSchemaProps = ".concat(JSON.stringify(listViewSchemaProps), ";\n const formFactor = ([\"split\"].indexOf(display) > -1) ? 'SMALL': defaultFormFactor;\n listViewSchemaProps.formFactor = formFactor;\n listViewSchemaProps.displayAs = display;\n \n window.getListSchema(appId, objectName, listName, listViewSchemaProps).then((schema)=>{\n try{\n const uiSchema = schema.uiSchema;\n const listView = _.find(\n uiSchema.list_views,\n (listView, name) => {\n // \u4F20\u5165listViewName\u7A7A\u503C\u5219\u53D6\u7B2C\u4E00\u4E2A\n if(!listName){\n listName = name;\n }\n return name === listName || listView._id === listName;\n }\n );\n if(listView){\n window.Steedos && window.Steedos.setDocumentTitle && window.Steedos.setDocumentTitle({pageName: listView.label || listView.name})\n }\n }catch(e){\n console.error(e)\n }\n payload.data = schema.amisSchema;\n
|
|
18169
|
+
"adaptor": "\n // console.log('service listview schemaApi adaptor....', api.body); \n let { appId, objectName, defaultListName: listName, display, formFactor: defaultFormFactor} = api.body;\n if(api.body.listName){\n listName = api.body.listName;\n }\n return new Promise((resolve)=>{\n const listViewSchemaProps = ".concat(JSON.stringify(listViewSchemaProps), ";\n const formFactor = ([\"split\"].indexOf(display) > -1) ? 'SMALL': defaultFormFactor;\n listViewSchemaProps.formFactor = formFactor;\n listViewSchemaProps.displayAs = display;\n // console.log(\"====listViewSchemaProps===>\", listName, display, listViewSchemaProps)\n window.getListSchema(appId, objectName, listName, listViewSchemaProps).then((schema)=>{\n try{\n const uiSchema = schema.uiSchema;\n const listView = _.find(\n uiSchema.list_views,\n (listView, name) => {\n // \u4F20\u5165listViewName\u7A7A\u503C\u5219\u53D6\u7B2C\u4E00\u4E2A\n if(!listName){\n listName = name;\n }\n return name === listName || listView._id === listName;\n }\n );\n if(listView){\n window.Steedos && window.Steedos.setDocumentTitle && window.Steedos.setDocumentTitle({pageName: listView.label || listView.name})\n }\n }catch(e){\n console.error(e)\n }\n payload.data = schema.amisSchema;\n console.log(\"payload================>\", payload)\n resolve(payload)\n });\n });\n ")
|
|
18038
18170
|
},
|
|
18039
18171
|
// "body": body,
|
|
18040
18172
|
// "data": serviceData
|
|
@@ -18077,13 +18209,11 @@ function getTableColumns(columns, includedFields, fieldsExtend) {
|
|
|
18077
18209
|
return tableColumns;
|
|
18078
18210
|
}
|
|
18079
18211
|
var AmisObjectTable = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
18080
|
-
var $schema, filters, filtersFunction, amisCondition, top, headerSchema, includedFields, fieldsExtend, sort, sortField, sortOrder, extraColumns, data, defaultData, _a, crud, _b, formFactor, _c, className, requestAdaptor, adaptor, _d, filterVisible, headerToolbarItems, ctx, columns, defaults, objectApiName, schemaKeys, listSchema, setDataToComponentId, amisFilters, tableFilters, amisSchemaData, appId, amisSchema;
|
|
18212
|
+
var $schema, filters, filtersFunction, amisCondition, top, headerSchema, includedFields, fieldsExtend, sort, sortField, sortOrder, extraColumns, data, defaultData, _a, crud, _b, formFactor, _c, className, requestAdaptor, adaptor, _d, filterVisible, headerToolbarItems, crudDataFilter, onCrudDataFilter, env, ctx, columns, defaults, objectApiName, schemaKeys, listSchema, setDataToComponentId, amisFilters, tableFilters, amisSchemaData, allData, appId, amisSchema;
|
|
18081
18213
|
return __generator(this, function (_e) {
|
|
18082
18214
|
switch (_e.label) {
|
|
18083
18215
|
case 0:
|
|
18084
|
-
|
|
18085
|
-
console.log("AmisObjectTable props", props);
|
|
18086
|
-
$schema = props.$schema, filters = props.filters, filtersFunction = props.filtersFunction, amisCondition = props.amisCondition, top = props.top, headerSchema = props.headerSchema, includedFields = props.fields, fieldsExtend = props.fieldsExtend, sort = props.sort, sortField = props.sortField, sortOrder = props.sortOrder, extraColumns = props.extraColumns, data = props.data, defaultData = props.defaultData, _a = props.crud, crud = _a === void 0 ? {} : _a, _b = props.formFactor, formFactor = _b === void 0 ? window.innerWidth < 768 ? 'SMALL' : 'LARGE' : _b, _c = props.className, className = _c === void 0 ? "" : _c, requestAdaptor = props.requestAdaptor, adaptor = props.adaptor, _d = props.filterVisible, filterVisible = _d === void 0 ? true : _d, headerToolbarItems = props.headerToolbarItems;
|
|
18216
|
+
$schema = props.$schema, filters = props.filters, filtersFunction = props.filtersFunction, amisCondition = props.amisCondition, top = props.top, headerSchema = props.headerSchema, includedFields = props.fields, fieldsExtend = props.fieldsExtend, sort = props.sort, sortField = props.sortField, sortOrder = props.sortOrder, extraColumns = props.extraColumns, data = props.data, defaultData = props.defaultData, _a = props.crud, crud = _a === void 0 ? {} : _a, _b = props.formFactor, formFactor = _b === void 0 ? window.innerWidth < 768 ? 'SMALL' : 'LARGE' : _b, _c = props.className, className = _c === void 0 ? "" : _c, requestAdaptor = props.requestAdaptor, adaptor = props.adaptor, _d = props.filterVisible, filterVisible = _d === void 0 ? true : _d, headerToolbarItems = props.headerToolbarItems, crudDataFilter = props.crudDataFilter, onCrudDataFilter = props.onCrudDataFilter, env = props.env;
|
|
18087
18217
|
ctx = props.ctx;
|
|
18088
18218
|
if (!ctx) {
|
|
18089
18219
|
ctx = {};
|
|
@@ -18114,10 +18244,11 @@ var AmisObjectTable = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
18114
18244
|
amisFilters = amisCondition && conditionsToFilters(amisCondition);
|
|
18115
18245
|
tableFilters = filters || amisFilters;
|
|
18116
18246
|
amisSchemaData = Object.assign({}, data, defaultData);
|
|
18247
|
+
allData = createObject(data, defaultData);
|
|
18117
18248
|
appId = (data === null || data === void 0 ? void 0 : data.appId) || (defaultData === null || defaultData === void 0 ? void 0 : defaultData.appId);
|
|
18118
18249
|
// ctx中值为undefined的属性不能保留,否则会导致 filters等被覆盖。
|
|
18119
18250
|
ctx = _$1.pickBy(ctx, function (value) { return value !== undefined; });
|
|
18120
|
-
return [4 /*yield*/, getTableSchema(appId, objectApiName, columns, __assign$2(__assign$2({ filters: tableFilters, filtersFunction: filtersFunction, top: top, sort: sort, sortField: sortField, sortOrder: sortOrder, extraColumns: extraColumns, defaults: defaults }, ctx), { setDataToComponentId: setDataToComponentId, requestAdaptor: requestAdaptor, adaptor: adaptor, filterVisible: filterVisible, headerToolbarItems: headerToolbarItems }))];
|
|
18251
|
+
return [4 /*yield*/, getTableSchema(appId, objectApiName, columns, __assign$2(__assign$2({ filters: tableFilters, filtersFunction: filtersFunction, top: top, sort: sort, sortField: sortField, sortOrder: sortOrder, extraColumns: extraColumns, defaults: defaults }, ctx), { setDataToComponentId: setDataToComponentId, requestAdaptor: requestAdaptor, adaptor: adaptor, filterVisible: filterVisible, headerToolbarItems: headerToolbarItems, crudDataFilter: crudDataFilter, onCrudDataFilter: onCrudDataFilter, amisData: allData, env: env }))];
|
|
18121
18252
|
case 1:
|
|
18122
18253
|
amisSchema = (_e.sent()).amisSchema;
|
|
18123
18254
|
amisSchema.data = Object.assign({}, amisSchema.data, amisSchemaData);
|
|
@@ -18126,7 +18257,6 @@ var AmisObjectTable = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
18126
18257
|
}
|
|
18127
18258
|
amisSchema.className = "steedos-object-table h-full flex flex-col ".concat(className);
|
|
18128
18259
|
amisSchema.objectApiName = objectApiName; //设计器中切换对象时画布中显示的列未同步变更
|
|
18129
|
-
// console.log(`AmisObjectTable===>amisSchema`, amisSchema)
|
|
18130
18260
|
// console.timeEnd('AmisObjectTable')
|
|
18131
18261
|
return [2 /*return*/, amisSchema];
|
|
18132
18262
|
}
|
|
@@ -18183,7 +18313,7 @@ var AmisRecordDetailHeader = function (props) { return __awaiter(void 0, void 0,
|
|
|
18183
18313
|
return __generator(this, function (_d) {
|
|
18184
18314
|
switch (_d.label) {
|
|
18185
18315
|
case 0:
|
|
18186
|
-
_a = props.className, className = _a === void 0 ? 'sm:sticky top-0 z-10 bg-gray-100 border-b sm:
|
|
18316
|
+
_a = props.className, className = _a === void 0 ? 'sm:sticky top-0 z-10 bg-gray-100 border-b sm:rounded sm:border border-gray-300 p-4' : _a;
|
|
18187
18317
|
return [4 /*yield*/, getUISchema(props.objectApiName || "space_users", false)];
|
|
18188
18318
|
case 1:
|
|
18189
18319
|
objectUiSchema = _d.sent();
|
|
@@ -18415,7 +18545,7 @@ var AmisSelectUser = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
18415
18545
|
|
|
18416
18546
|
var AmisProvider = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
18417
18547
|
return __generator(this, function (_a) {
|
|
18418
|
-
console.log(
|
|
18548
|
+
// console.log(`AmisProvider props`, props)
|
|
18419
18549
|
return [2 /*return*/, {}];
|
|
18420
18550
|
});
|
|
18421
18551
|
}); };
|
|
@@ -18424,7 +18554,7 @@ var AmisProvider = function (props) { return __awaiter(void 0, void 0, void 0, f
|
|
|
18424
18554
|
* @Author: baozhoutao@steedos.com
|
|
18425
18555
|
* @Date: 2022-09-01 14:44:57
|
|
18426
18556
|
* @LastEditors: liaodaxue
|
|
18427
|
-
* @LastEditTime: 2023-09-19
|
|
18557
|
+
* @LastEditTime: 2023-09-19 15:20:58
|
|
18428
18558
|
* @Description:
|
|
18429
18559
|
*/
|
|
18430
18560
|
var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -18648,7 +18778,7 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
18648
18778
|
"actions": [
|
|
18649
18779
|
{
|
|
18650
18780
|
"actionType": "custom",
|
|
18651
|
-
"script": "\nconst path = context.props.data.path;\ndoAction({\n actionType: '
|
|
18781
|
+
"script": "\nconst path = context.props.data.path;\ndoAction({\n actionType: 'link',\n args: {\n \"url\": path,\n \"blank\": false\n }\n});"
|
|
18652
18782
|
},
|
|
18653
18783
|
{
|
|
18654
18784
|
"actionType": "broadcast",
|
|
@@ -18795,7 +18925,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
18795
18925
|
appId = data.context.appId || 'admin';
|
|
18796
18926
|
}
|
|
18797
18927
|
// console.log(`AmisAppMenu appId`, appId)
|
|
18798
|
-
console.log(
|
|
18928
|
+
// console.log(`AmisAppMenu`, appId, props)
|
|
18799
18929
|
if (links) {
|
|
18800
18930
|
return [2 /*return*/, {
|
|
18801
18931
|
"type": "nav",
|
|
@@ -18811,13 +18941,13 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
18811
18941
|
schemaApi: {
|
|
18812
18942
|
"method": "get",
|
|
18813
18943
|
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
|
|
18814
|
-
"adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"\";\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n })\n })\n } else {\n var tabGroup = _.find(tab_groups, {\"group_name\": groupName});\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": tabGroup && tabGroup.default_open != false,\n \"isGroup\": true,\n \"children\": _.sortBy(_.map(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n }\n }),(tab) => {return tab.index})\n }) \n }\n });\n \n }else{\n _.each(payload.children, (tab)=>{\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n });\n })\n }\n //\u4EE5\u4E0B\u4E3Anav\u7B2C\u4E00\u5C42\u6392\u5E8F\uFF0C\u5305\u62EC\u5206\u7EC4\u4E0E\u9009\u9879\u5361\n let groupLength = ((payload.tab_groups && payload.tab_groups.length) || 0) + 1000;\n data.nav = _.sortBy(data.nav, function(tab){\n if(tab.isGroup){\n return _.findIndex(payload.tab_groups, function(group){\n return group.group_name === tab.label;\n });\n }else{\n return groupLength + tab.index;\n }\n })\n payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav\n },\n \"id\": \"appMenuService\",\n \"body\":{\n \"type\": \"nav\",\n className: \"").concat(className, " text-black\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n }\n }\n }\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n return payload;\n "),
|
|
18944
|
+
"adaptor": "\n try {\n // console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"").concat(data.tabId, "\";\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n })\n })\n } else {\n var tabGroup = _.find(tab_groups, {\"group_name\": groupName});\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": tabGroup && tabGroup.default_open != false,\n \"isGroup\": true,\n \"children\": _.sortBy(_.map(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n }\n }),(tab) => {return tab.index})\n }) \n }\n });\n \n }else{\n _.each(payload.children, (tab)=>{\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n // active: selectedId === tab.id,\n });\n })\n }\n //\u4EE5\u4E0B\u4E3Anav\u7B2C\u4E00\u5C42\u6392\u5E8F\uFF0C\u5305\u62EC\u5206\u7EC4\u4E0E\u9009\u9879\u5361\n let groupLength = ((payload.tab_groups && payload.tab_groups.length) || 0) + 1000;\n data.nav = _.sortBy(data.nav, function(tab){\n if(tab.isGroup){\n return _.findIndex(payload.tab_groups, function(group){\n return group.group_name === tab.label;\n });\n }else{\n return groupLength + tab.index;\n }\n })\n payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav\n },\n \"id\": \"appMenuService\",\n \"body\":{\n \"type\": \"nav\",\n className: \"").concat(className, " text-black\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n },\n {\n \"actionType\": \"custom\",\n \"script\" : \"window.postMessage(Object.assign({type: 'nav.click', data: event.data.item}), '*');\"\n }\n ]\n }\n }\n }\n };\n } catch (error) {\n console.log(`error`, error)\n }\n // console.log('payload===2==>', payload)\n return payload;\n "),
|
|
18815
18945
|
"headers": {
|
|
18816
18946
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
18817
18947
|
}
|
|
18818
18948
|
}
|
|
18819
18949
|
};
|
|
18820
|
-
console.log(
|
|
18950
|
+
// console.log(`schema=====>`, schema)
|
|
18821
18951
|
return [2 /*return*/, schema];
|
|
18822
18952
|
});
|
|
18823
18953
|
}); };
|
|
@@ -18862,7 +18992,7 @@ var AmisGlobalFooter = function (props) { return __awaiter(void 0, void 0, void
|
|
|
18862
18992
|
schemaApi: {
|
|
18863
18993
|
"method": "get",
|
|
18864
18994
|
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus?mobile=true"),
|
|
18865
|
-
"adaptor": "\n try {\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 const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"\";\n let sum = 0;\n payload.children = _.sortBy(payload.children, function(tab){\n return tab.index;\n })\n _.each(payload.children, (tab)=>{\n sum++;\n const classIcon = tab.icon.replace(/_/g,\"-\");\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n if(sum >= 5){\n data.nav.push({\n \"label\": {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-
|
|
18995
|
+
"adaptor": "\n try {\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 const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"\";\n let sum = 0;\n payload.children = _.sortBy(payload.children, function(tab){\n return tab.index;\n })\n _.each(payload.children, (tab)=>{\n sum++;\n const classIcon = tab.icon.replace(/_/g,\"-\");\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n if(sum >= 5){\n data.nav.push({\n \"label\": {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 text-gray-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 \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n });\n }else{\n data.nav.push({\n \"label\": {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 truncate text-gray-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 class=\"truncate\" style=\"max-width: 20vw\">${tab.name}</span></span>`,\n className:'h-full flex items-center'\n },\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\",\n \"index\": tab.index\n });\n }\n })\n payload.data = {\n \"type\": \"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav\n },\n \"id\": \"footerService\",\n \"body\": {\n \"type\": \"nav\",\n className: \"").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=' truncate text-gray-700 block -ml-px no-underline group flex items-center text-[12px] font-medium rounded-md flex-col leading-3 nav-label'><svg class=\"!fill-slate-500 flex-shrink-0 !h-10 !w-10\" style=\"padding:7px\"><use xlink:href=\"/assets/icons/utility-sprite/svg/symbols.svg#rows\"></use></svg><span class=\"truncate\" style=\"max-width: 20vw\">").concat(instance.t('frontend_menu'), "</span></span>`,\n \"className\":'h-full flex items-center'\n },\n \"overflowIndicator\":\"\"\n },\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"footerService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"footerService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n }\n ]\n }\n }\n }\n \n };\n } catch (error) {\n console.log(`error`, error)\n }\n return payload;\n "),
|
|
18866
18996
|
"headers": {
|
|
18867
18997
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
18868
18998
|
}
|
|
@@ -19022,7 +19152,7 @@ var AmisGlobalHeaderToolbar = function (props) { return __awaiter(void 0, void 0
|
|
|
19022
19152
|
"name": "notifications",
|
|
19023
19153
|
"items": {
|
|
19024
19154
|
"type": "tpl",
|
|
19025
|
-
"tpl": "<div class='flex items-center p-4 hover:bg-sky-50'>\n <img src='<%=data.context.rootUrl + \"/avatar/\" + data.from%>' alt='' class='h-10 w-10 flex-none rounded-full'>\n <div class='ml-4 flex-auto'>\n <div class='font-medium'>\n <span class='text-primary'><%=data.name%></span>\n </div>\n <div class='mt-1 text-
|
|
19155
|
+
"tpl": "<div class='flex items-center p-4 hover:bg-sky-50'>\n <img src='<%=data.context.rootUrl + \"/avatar/\" + data.from%>' alt='' class='h-10 w-10 flex-none rounded-full'>\n <div class='ml-4 flex-auto'>\n <div class='font-medium'>\n <span class='text-primary'><%=data.name%></span>\n </div>\n <div class='mt-1 text-gray-700'>\n <%=data.body%>\n </div>\n <div class='mt-1 text-gray-700'>\n <%=moment(data.created).locale(data.global.user.language).fromNow()%>\n <abbr class='slds-text-link slds-m-horizontal_xxx-small <%=data.is_read ? 'hidden' : ''%>' title='unread'>\u25CF</abbr>\n </div>\n </div>\n </div>",
|
|
19026
19156
|
"id": "u:07ece657c7b7",
|
|
19027
19157
|
"onEvent": {
|
|
19028
19158
|
"click": {
|
|
@@ -19274,7 +19404,7 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
|
|
|
19274
19404
|
body: [
|
|
19275
19405
|
{
|
|
19276
19406
|
"type": "wrapper",
|
|
19277
|
-
"className": "bg-white sticky p-0 top-0 z-40 w-full flex-none backdrop-blur transition-colors duration-500 lg:z-50
|
|
19407
|
+
"className": "bg-white sticky p-0 top-0 z-40 w-full flex-none backdrop-blur transition-colors duration-500 lg:z-50 border-b-[3px] border-sky-500 border-solid steedos-header-container",
|
|
19278
19408
|
body: [
|
|
19279
19409
|
{
|
|
19280
19410
|
"type": "wrapper",
|
|
@@ -19440,7 +19570,7 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
|
|
|
19440
19570
|
body: [
|
|
19441
19571
|
{
|
|
19442
19572
|
type: "wrapper",
|
|
19443
|
-
className: 'sidebar-wrapper px-0 pt-4 pb-16 fixed z-20 h-full h-fill ease-in-out duration-300 flex flex-col border-r overflow-y-auto bg-white border-
|
|
19573
|
+
className: 'sidebar-wrapper px-0 pt-4 pb-16 fixed z-20 h-full h-fill ease-in-out duration-300 flex flex-col border-r overflow-y-auto bg-white border-gray-300 block -translate-x-0 sm:w-[220px] w-64',
|
|
19444
19574
|
body: [
|
|
19445
19575
|
{
|
|
19446
19576
|
"type": "steedos-app-launcher",
|
|
@@ -19742,7 +19872,7 @@ var getSelectFlowSchema = function (id, props) {
|
|
|
19742
19872
|
var AmisSelectFlow = function (props) {
|
|
19743
19873
|
//mode: "input-tree" | "tree-select"
|
|
19744
19874
|
var _a = props.mode, mode = _a === void 0 ? "input-tree" : _a, _b = props.id, id = _b === void 0 ? "selectFlow" + _$1.random(10000, 99999) : _b;
|
|
19745
|
-
console.log(
|
|
19875
|
+
// console.log(`AmisSelectFlow props`, props);
|
|
19746
19876
|
var inputId = "".concat(id, "_input");
|
|
19747
19877
|
var flowSchema = getSelectFlowSchema(inputId, props);
|
|
19748
19878
|
if (mode === "tree-select") {
|
|
@@ -19829,7 +19959,7 @@ var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, f
|
|
|
19829
19959
|
"showHeader": true,
|
|
19830
19960
|
// "showDisplayAs": (formFactor !== 'SMALL'),
|
|
19831
19961
|
// "formFactor": formFactor,
|
|
19832
|
-
// "className": (displayAs === 'split')? 'w-full': 'p-0 flex-1 m-0 sm:border sm:shadow sm:rounded border-
|
|
19962
|
+
// "className": (displayAs === 'split')? 'w-full': 'p-0 flex-1 m-0 sm:border sm:shadow sm:rounded border-gray-300 border-solid bg-gray-100'
|
|
19833
19963
|
};
|
|
19834
19964
|
// const defData = {
|
|
19835
19965
|
// ...$schema.data,
|
|
@@ -19938,7 +20068,7 @@ var PageObject = function (props) { return __awaiter(void 0, void 0, void 0, fun
|
|
|
19938
20068
|
"type": "wrapper",
|
|
19939
20069
|
"size": "none",
|
|
19940
20070
|
"className": {
|
|
19941
|
-
"p-0 flex-shrink-0 min-w-[388px] w-fit
|
|
20071
|
+
"p-0 flex-shrink-0 min-w-[388px] w-fit lg:order-first lg:flex lg:flex-col": "${display == 'split'}",
|
|
19942
20072
|
'h-full': "${display != 'split'}",
|
|
19943
20073
|
},
|
|
19944
20074
|
"body": {
|