@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.esm.js
CHANGED
|
@@ -3585,7 +3585,7 @@ function getLookupListView(refObjectConfig) {
|
|
|
3585
3585
|
* @Author: baozhoutao@steedos.com
|
|
3586
3586
|
* @Date: 2022-05-23 09:53:08
|
|
3587
3587
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
3588
|
-
* @LastEditTime: 2023-
|
|
3588
|
+
* @LastEditTime: 2023-09-19 14:38:39
|
|
3589
3589
|
* @Description:
|
|
3590
3590
|
*/
|
|
3591
3591
|
|
|
@@ -3593,39 +3593,39 @@ function getCreatedInfoTpl(formFactor){
|
|
|
3593
3593
|
const href = Router$1.getObjectDetailPath({
|
|
3594
3594
|
formFactor, appId: "admin", objectName: 'users', recordId: '${created_by._id}'
|
|
3595
3595
|
});
|
|
3596
|
-
return `<
|
|
3596
|
+
return `<span><a href='${href}'>\${_display.created_by.label}</a>\${_display.created}</span>`
|
|
3597
3597
|
}
|
|
3598
3598
|
|
|
3599
3599
|
function getModifiedInfoTpl(formFactor){
|
|
3600
3600
|
const href = Router$1.getObjectDetailPath({
|
|
3601
3601
|
formFactor, appId: "admin", objectName: 'users', recordId: '${modified_by._id}'
|
|
3602
3602
|
});
|
|
3603
|
-
return `<
|
|
3603
|
+
return `<span><a href='${href}'>\${_display.modified_by.label}</a>\${_display.modified}</span>`
|
|
3604
3604
|
}
|
|
3605
3605
|
|
|
3606
3606
|
function getNumberTpl(field){
|
|
3607
|
-
return `<
|
|
3607
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
3608
3608
|
}
|
|
3609
3609
|
|
|
3610
3610
|
function getTimeTpl(field){
|
|
3611
|
-
return `<
|
|
3611
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
3612
3612
|
}
|
|
3613
3613
|
|
|
3614
3614
|
function getDateTpl(field){
|
|
3615
|
-
return `<
|
|
3615
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
3616
3616
|
}
|
|
3617
3617
|
|
|
3618
3618
|
|
|
3619
3619
|
function getDateTimeTpl(field){
|
|
3620
|
-
return `<
|
|
3620
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
3621
3621
|
}
|
|
3622
3622
|
|
|
3623
3623
|
function getUiFieldTpl(field){
|
|
3624
|
-
return `<
|
|
3624
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
3625
3625
|
}
|
|
3626
3626
|
|
|
3627
3627
|
function getUiFileSizeTpl(field){
|
|
3628
|
-
return `<
|
|
3628
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
3629
3629
|
}
|
|
3630
3630
|
|
|
3631
3631
|
//TODO 处理name字段
|
|
@@ -3636,7 +3636,7 @@ async function getRefObjectNameFieldName(field){
|
|
|
3636
3636
|
}
|
|
3637
3637
|
|
|
3638
3638
|
function getSelectTpl(field){
|
|
3639
|
-
return `<
|
|
3639
|
+
return `<span>\${_display.${field.name}}</span>`
|
|
3640
3640
|
}
|
|
3641
3641
|
function getSelectMap(selectOptions){
|
|
3642
3642
|
let map = {};
|
|
@@ -3765,9 +3765,13 @@ async function getLookupTpl(field, ctx){
|
|
|
3765
3765
|
}
|
|
3766
3766
|
|
|
3767
3767
|
function getSwitchTpl(field){
|
|
3768
|
+
let fieldDataStrTpl = `data._display.${field.name}`;
|
|
3769
|
+
if(field.isTableField){
|
|
3770
|
+
fieldDataStrTpl = `data.${field.name}`;
|
|
3771
|
+
}
|
|
3768
3772
|
return `<% if (data.${field.name}) { %>
|
|
3769
|
-
<span class="slds-icon_container slds-icon-utility-check slds-current-color" title="
|
|
3770
|
-
<span ><%=
|
|
3773
|
+
<span class="slds-icon_container slds-icon-utility-check slds-current-color" title="<%=${fieldDataStrTpl}%>">
|
|
3774
|
+
<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>
|
|
3771
3775
|
</span>
|
|
3772
3776
|
<% } %>`
|
|
3773
3777
|
}
|
|
@@ -4345,7 +4349,7 @@ var frontend_display_type_is_split = "分栏视图";
|
|
|
4345
4349
|
var frontend_display_as = "显示为";
|
|
4346
4350
|
var frontend_record_sum = "个项目";
|
|
4347
4351
|
var frontend_button_reload_tooltip = "刷新";
|
|
4348
|
-
var frontend_button_search_tooltip = "
|
|
4352
|
+
var frontend_button_search_tooltip = "筛选";
|
|
4349
4353
|
var frontend_fields_filter_button_search = "搜索";
|
|
4350
4354
|
var frontend_fields_filter_button_settings = "设置搜索项";
|
|
4351
4355
|
var frontend_button_listview_control_tooltip = "列表视图控制";
|
|
@@ -4967,7 +4971,7 @@ const parseSingleExpression$1 = function (func, formData, dataPath, global, user
|
|
|
4967
4971
|
* @Author: baozhoutao@steedos.com
|
|
4968
4972
|
* @Date: 2022-11-01 15:51:00
|
|
4969
4973
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
4970
|
-
* @LastEditTime: 2023-
|
|
4974
|
+
* @LastEditTime: 2023-09-25 14:53:05
|
|
4971
4975
|
* @Description:
|
|
4972
4976
|
*/
|
|
4973
4977
|
|
|
@@ -4986,18 +4990,31 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
4986
4990
|
formSchema = _.isString(payload.schema) ? JSON.parse(payload.schema) : payload.schema;
|
|
4987
4991
|
}
|
|
4988
4992
|
|
|
4993
|
+
const fields = ${JSON.stringify(uiSchema.fields)};
|
|
4994
|
+
const selectedRowResponseResult = api.body.selectedRowResponseResult;
|
|
4995
|
+
let defaultData = {};
|
|
4996
|
+
|
|
4997
|
+
if(!_.isEmpty(selectedRowResponseResult)){
|
|
4998
|
+
const fieldsKeys = _.keys(fields);
|
|
4999
|
+
// 如果新建记录时复制的数据中有omit或其他不相关字段数据时不应该一起保存到数据库,
|
|
5000
|
+
// 原规则见:https://github.com/steedos/steedos-frontend/issues/297
|
|
5001
|
+
_.forEach(selectedRowResponseResult, (val, key) => {
|
|
5002
|
+
if (fieldsKeys.indexOf(key) > -1 && fields[key].omit !== true) {
|
|
5003
|
+
defaultData[key] = val;
|
|
5004
|
+
}
|
|
5005
|
+
})
|
|
5006
|
+
}
|
|
5007
|
+
|
|
4989
5008
|
const _master = api.body._master;
|
|
4990
5009
|
if(_master && _master._isRelated){
|
|
4991
5010
|
const relatedKey = _master.relatedKey;
|
|
4992
5011
|
const masterObjectName = _master.objectName;
|
|
4993
5012
|
const recordId = _master.recordId;
|
|
4994
5013
|
let relatedKeySaveValue = recordId;
|
|
4995
|
-
const fields = ${JSON.stringify(uiSchema.fields)};
|
|
4996
5014
|
const relatedField = fields[relatedKey];
|
|
4997
5015
|
if(relatedField.reference_to_field && relatedField.reference_to_field !== '_id'){
|
|
4998
5016
|
relatedKeySaveValue = _master.record[relatedField.reference_to_field];
|
|
4999
5017
|
}
|
|
5000
|
-
let defaultData = {};
|
|
5001
5018
|
let relatedKeyValue;
|
|
5002
5019
|
if(!_.isString(relatedField.reference_to)){
|
|
5003
5020
|
relatedKeyValue = { o: masterObjectName, ids: [relatedKeySaveValue] };
|
|
@@ -5007,6 +5024,9 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5007
5024
|
relatedKeyValue = relatedKeySaveValue;
|
|
5008
5025
|
}
|
|
5009
5026
|
defaultData[relatedKey]=relatedKeyValue;
|
|
5027
|
+
}
|
|
5028
|
+
|
|
5029
|
+
if(!_.isEmpty(defaultData)){
|
|
5010
5030
|
if(payload.schema){
|
|
5011
5031
|
// 表单微页面第一层要求是page
|
|
5012
5032
|
formSchema.data.defaultData = defaultData;
|
|
@@ -5029,6 +5049,18 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5029
5049
|
});
|
|
5030
5050
|
}, 200);
|
|
5031
5051
|
`;
|
|
5052
|
+
const getSelectedRowsScript = `
|
|
5053
|
+
const isLookup = event.data.isLookup;
|
|
5054
|
+
if(isLookup){
|
|
5055
|
+
// lookup弹出窗口的新建功能不需要支持复制新建
|
|
5056
|
+
return;
|
|
5057
|
+
}
|
|
5058
|
+
const uiSchema = event.data.uiSchema;
|
|
5059
|
+
const objectName = event.data.objectName;
|
|
5060
|
+
const listViewRef = event.context.scoped.getComponentById("listview_" + objectName);
|
|
5061
|
+
const selectedItems = listViewRef && listViewRef.props.store.toJSON().selectedItems || [];
|
|
5062
|
+
event.data.selectedIds = _.map(selectedItems, uiSchema.idFieldName || '_id');
|
|
5063
|
+
`;
|
|
5032
5064
|
return {
|
|
5033
5065
|
"type": "service",
|
|
5034
5066
|
"body": [
|
|
@@ -5041,6 +5073,21 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5041
5073
|
"click": {
|
|
5042
5074
|
"weight": 0,
|
|
5043
5075
|
"actions": [
|
|
5076
|
+
{
|
|
5077
|
+
"actionType": "custom",
|
|
5078
|
+
"script": getSelectedRowsScript
|
|
5079
|
+
},
|
|
5080
|
+
{
|
|
5081
|
+
"actionType": "ajax",
|
|
5082
|
+
"outputVar": "selectedRowResponseResult",
|
|
5083
|
+
"args": {
|
|
5084
|
+
"api": {
|
|
5085
|
+
"url": "${context.rootUrl}/api/v1/${uiSchema.name}/${selectedIds|first}",
|
|
5086
|
+
"method": "get"
|
|
5087
|
+
}
|
|
5088
|
+
},
|
|
5089
|
+
"expression": "${selectedIds.length > 0}"
|
|
5090
|
+
},
|
|
5044
5091
|
{
|
|
5045
5092
|
"actionType": "dialog",
|
|
5046
5093
|
"dialog": {
|
|
@@ -5058,7 +5105,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5058
5105
|
"displayAs": "${displayAs}",
|
|
5059
5106
|
"uiSchema": "${uiSchema}",
|
|
5060
5107
|
"isLookup": "${isLookup}",
|
|
5061
|
-
"listName": "${listName}"
|
|
5108
|
+
"listName": "${listName}",
|
|
5109
|
+
"selectedRowResponseResult": "${selectedRowResponseResult}",
|
|
5062
5110
|
},
|
|
5063
5111
|
"title":instance.t('frontend_form_new') + " ${uiSchema.label | raw}",
|
|
5064
5112
|
"body": [
|
|
@@ -5070,7 +5118,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5070
5118
|
"data": {
|
|
5071
5119
|
"isLookup": "${isLookup}",
|
|
5072
5120
|
"_master": "${_master}",
|
|
5073
|
-
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}"
|
|
5121
|
+
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}",
|
|
5122
|
+
"selectedRowResponseResult": "${selectedRowResponseResult}"
|
|
5074
5123
|
},
|
|
5075
5124
|
"url": "${context.rootUrl}/api/pageSchema/form?app=${appId}&objectApiName=${objectName}&formFactor=${formFactor}",
|
|
5076
5125
|
"method": "get",
|
|
@@ -6001,9 +6050,30 @@ const getObjectDetailHeaderButtons = (objectSchema, recordId)=>{
|
|
|
6001
6050
|
const getObjectDetailButtonsSchemas = (objectSchema, recordId, ctx)=>{
|
|
6002
6051
|
const { buttons, moreButtons, moreButtonsVisibleOn } = getObjectDetailHeaderButtons(objectSchema, recordId);
|
|
6003
6052
|
if(ctx.formFactor === 'SMALL'){
|
|
6053
|
+
const dropdownButtons = [
|
|
6054
|
+
..._$1.map(buttons, (button) => {
|
|
6055
|
+
button.className += ' w-full';
|
|
6056
|
+
return button;
|
|
6057
|
+
}),
|
|
6058
|
+
..._$1.map(moreButtons, (button) => {
|
|
6059
|
+
button.className += ' w-full';
|
|
6060
|
+
return button;
|
|
6061
|
+
})
|
|
6062
|
+
];
|
|
6063
|
+
|
|
6064
|
+
let phoneMoreButtonsVisibleOn = '';
|
|
6065
|
+
_$1.forEach(dropdownButtons, (button, index) => {
|
|
6066
|
+
if(index === 0){
|
|
6067
|
+
phoneMoreButtonsVisibleOn = button.visibleOn;
|
|
6068
|
+
}else {
|
|
6069
|
+
phoneMoreButtonsVisibleOn = phoneMoreButtonsVisibleOn + ' || ' + button.visibleOn;
|
|
6070
|
+
}
|
|
6071
|
+
});
|
|
6072
|
+
|
|
6004
6073
|
return {
|
|
6005
6074
|
"type": "button",
|
|
6006
6075
|
"icon": "fa fa-angle-down",
|
|
6076
|
+
"visibleOn": phoneMoreButtonsVisibleOn,
|
|
6007
6077
|
"onEvent": {
|
|
6008
6078
|
"click": {
|
|
6009
6079
|
"actions": [
|
|
@@ -6019,16 +6089,7 @@ const getObjectDetailButtonsSchemas = (objectSchema, recordId, ctx)=>{
|
|
|
6019
6089
|
"id": "u:fd837823be5b",
|
|
6020
6090
|
"vertical": true,
|
|
6021
6091
|
"tiled": true,
|
|
6022
|
-
"buttons":
|
|
6023
|
-
..._$1.map(buttons, (button)=>{
|
|
6024
|
-
button.className += ' w-full';
|
|
6025
|
-
return button;
|
|
6026
|
-
}),
|
|
6027
|
-
..._$1.map(moreButtons, (button)=>{
|
|
6028
|
-
button.className += ' w-full';
|
|
6029
|
-
return button;
|
|
6030
|
-
})
|
|
6031
|
-
],
|
|
6092
|
+
"buttons": dropdownButtons,
|
|
6032
6093
|
"btnLevel": "enhance",
|
|
6033
6094
|
"className": "w-full",
|
|
6034
6095
|
"btnClassName": "w-full",
|
|
@@ -6053,7 +6114,7 @@ const getObjectDetailButtonsSchemas = (objectSchema, recordId, ctx)=>{
|
|
|
6053
6114
|
type: "steedos-dropdown-button",
|
|
6054
6115
|
label: "",
|
|
6055
6116
|
buttons: moreButtons,
|
|
6056
|
-
className: 'slds-icon',
|
|
6117
|
+
className: 'slds-icon ml-1',
|
|
6057
6118
|
visibleOn: moreButtonsVisibleOn
|
|
6058
6119
|
};
|
|
6059
6120
|
buttons.push(dropdownButtonsSchema);
|
|
@@ -6796,13 +6857,15 @@ function getObjectListHeaderFirstLine(objectSchema, listViewName, ctx) {
|
|
|
6796
6857
|
"visibleOn": "${display == 'split'?false:true}"
|
|
6797
6858
|
}];
|
|
6798
6859
|
if(ctx.formFactor !== 'SMALL'){
|
|
6860
|
+
const restButtons = Array.isArray(amisButtonsSchema) ? amisButtonsSchema.filter(obj => obj.name !== "standard_new"):[];
|
|
6799
6861
|
buttonSchema.push({
|
|
6800
6862
|
"type": "flex",
|
|
6801
6863
|
"items":[
|
|
6802
6864
|
standardNewButton,
|
|
6803
|
-
{
|
|
6865
|
+
(restButtons.length > 0) && {
|
|
6804
6866
|
"type": "dropdown-button",
|
|
6805
|
-
"buttons":
|
|
6867
|
+
"buttons": restButtons,
|
|
6868
|
+
"className": " ml-1",
|
|
6806
6869
|
"menuClassName": "p-none split-dropdown-buttons",
|
|
6807
6870
|
"align": "right",
|
|
6808
6871
|
"size": "sm"
|
|
@@ -6934,7 +6997,6 @@ async function getObjectListHeaderSecordLine(objectSchema, listViewName, ctx) {
|
|
|
6934
6997
|
},
|
|
6935
6998
|
{
|
|
6936
6999
|
"body": [
|
|
6937
|
-
fieldsFilterButtonSchema,
|
|
6938
7000
|
{
|
|
6939
7001
|
"type": "button",
|
|
6940
7002
|
"label": "",
|
|
@@ -6943,6 +7005,7 @@ async function getObjectListHeaderSecordLine(objectSchema, listViewName, ctx) {
|
|
|
6943
7005
|
"target": amisListViewId,
|
|
6944
7006
|
"className": "bg-white p-2 rounded border-gray-300 text-gray-500"
|
|
6945
7007
|
},
|
|
7008
|
+
fieldsFilterButtonSchema,
|
|
6946
7009
|
// {
|
|
6947
7010
|
// "type": "button",
|
|
6948
7011
|
// "label": "",
|
|
@@ -7190,7 +7253,7 @@ async function getObjectRecordDetailRelatedListHeader(relatedObjectSchema, relat
|
|
|
7190
7253
|
"body": [
|
|
7191
7254
|
{
|
|
7192
7255
|
"type": "tpl",
|
|
7193
|
-
"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>`,
|
|
7256
|
+
"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>`,
|
|
7194
7257
|
"inline": false,
|
|
7195
7258
|
"wrapperComponent": "",
|
|
7196
7259
|
"className": "",
|
|
@@ -8279,7 +8342,7 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
8279
8342
|
{
|
|
8280
8343
|
"type": "search-box",
|
|
8281
8344
|
"name": keywordsSearchBoxName,
|
|
8282
|
-
"placeholder": "
|
|
8345
|
+
"placeholder": "搜索此列表",
|
|
8283
8346
|
"value": crudKeywords,
|
|
8284
8347
|
"clearable": true,
|
|
8285
8348
|
"clearAndSubmit": true
|
|
@@ -8402,10 +8465,10 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
8402
8465
|
if(toolbarCount){
|
|
8403
8466
|
toolbars.push(toolbarCount);
|
|
8404
8467
|
}
|
|
8405
|
-
toolbars.push(toolbarReloadButton);
|
|
8406
8468
|
if(toolbarFilter){
|
|
8407
8469
|
toolbars.push(toolbarFilter);
|
|
8408
8470
|
}
|
|
8471
|
+
toolbars.push(toolbarReloadButton);
|
|
8409
8472
|
toolbars.push(toolbarDisplayAsButton);
|
|
8410
8473
|
toolbars.push(toolbarDQuickSearchBox);
|
|
8411
8474
|
return [
|
|
@@ -8421,19 +8484,20 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
8421
8484
|
toolbars.push(toolbarFilter);
|
|
8422
8485
|
}
|
|
8423
8486
|
toolbars.push(toolbarReloadButton);
|
|
8487
|
+
toolbars.push(toolbarDisplayAsButton);
|
|
8424
8488
|
if(mainObject?.permissions?.allowCreateListViews){
|
|
8425
8489
|
toolbars.push(getSettingListviewToolbarButtonSchema());
|
|
8426
8490
|
}
|
|
8427
|
-
toolbars.push(toolbarDisplayAsButton);
|
|
8428
8491
|
toolbars.push(toolbarDQuickSearchBox);
|
|
8429
8492
|
return [
|
|
8430
8493
|
// "filter-toggler",
|
|
8431
8494
|
...(headerToolbarItems || []),
|
|
8432
8495
|
"bulkActions",
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8496
|
+
// 不能放开crud columns-toggler否则crud card模式会报错
|
|
8497
|
+
// {
|
|
8498
|
+
// "type": "columns-toggler",
|
|
8499
|
+
// "className": "hidden"
|
|
8500
|
+
// },
|
|
8437
8501
|
...toolbars,
|
|
8438
8502
|
// {
|
|
8439
8503
|
// "type": "columns-toggler",
|
|
@@ -9040,10 +9104,13 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
9040
9104
|
const op = api.data.$self.op;
|
|
9041
9105
|
if(!_.isEmpty(op)){
|
|
9042
9106
|
// op不为空,表示处于字段初始编辑状态,不是点击后出现弹窗状态。
|
|
9107
|
+
// 这里不可以用_.pick函数让payload只返回labelField和valueField,因为字段上配置的amis autoFill功能可能依赖了其他字段
|
|
9108
|
+
/*
|
|
9043
9109
|
const rows = _.map(payload.data.rows, (item)=>{
|
|
9044
9110
|
return _.pick(item, ["${referenceTo.labelField.name}", "${referenceTo.valueField.name}"]);
|
|
9045
9111
|
})
|
|
9046
9112
|
payload.data.rows = rows;
|
|
9113
|
+
*/
|
|
9047
9114
|
return payload;
|
|
9048
9115
|
}
|
|
9049
9116
|
if(enable_tree){
|
|
@@ -10470,7 +10537,7 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
10470
10537
|
label: subField.label,
|
|
10471
10538
|
quickEdit: readonly ? false : gridSub
|
|
10472
10539
|
};
|
|
10473
|
-
if(subField.type
|
|
10540
|
+
if(["lookup", "boolean", "toggle"].indexOf(subField.type) > -1){
|
|
10474
10541
|
gridItemSchema.type = gridSub.type;
|
|
10475
10542
|
gridItemSchema.tpl = gridSub.tpl;
|
|
10476
10543
|
}
|
|
@@ -11404,7 +11471,7 @@ async function getTableOperation(ctx){
|
|
|
11404
11471
|
label: instance.t('frontend_operation'),
|
|
11405
11472
|
fixed: 'right',
|
|
11406
11473
|
labelClassName: 'text-center',
|
|
11407
|
-
className: 'text-center steedos-listview-operation w-
|
|
11474
|
+
className: 'text-center steedos-listview-operation w-10',
|
|
11408
11475
|
buttons: [
|
|
11409
11476
|
{
|
|
11410
11477
|
"type": "steedos-dropdown-button",
|
|
@@ -11436,11 +11503,10 @@ async function getTableOperation(ctx){
|
|
|
11436
11503
|
}
|
|
11437
11504
|
|
|
11438
11505
|
async function getTableSchema$1(fields, options){
|
|
11439
|
-
let isLookup = options && options.isLookup;
|
|
11440
|
-
let hiddenColumnOperation = options && options.hiddenColumnOperation;
|
|
11441
11506
|
if(!options){
|
|
11442
11507
|
options = {};
|
|
11443
11508
|
}
|
|
11509
|
+
let { isLookup, hiddenColumnOperation } = options;
|
|
11444
11510
|
let columns = [];
|
|
11445
11511
|
let useMobileColumns = options.formFactor === 'SMALL' || ["split"].indexOf(options.displayAs) > -1;
|
|
11446
11512
|
if(isLookup){
|
|
@@ -11452,6 +11518,7 @@ async function getTableSchema$1(fields, options){
|
|
|
11452
11518
|
}
|
|
11453
11519
|
else {
|
|
11454
11520
|
columns = await getTableColumns$1(fields, options);
|
|
11521
|
+
|
|
11455
11522
|
if(!isLookup && !hiddenColumnOperation){
|
|
11456
11523
|
columns.push(await getTableOperation(options));
|
|
11457
11524
|
}
|
|
@@ -11460,7 +11527,7 @@ async function getTableSchema$1(fields, options){
|
|
|
11460
11527
|
return {
|
|
11461
11528
|
mode: "table",
|
|
11462
11529
|
name: "thelist",
|
|
11463
|
-
headerToolbarClassName: "py-2 px-2 border-gray-300
|
|
11530
|
+
headerToolbarClassName: "py-2 px-2 border-gray-300 border-solid border-b",
|
|
11464
11531
|
className: "",
|
|
11465
11532
|
draggable: false,
|
|
11466
11533
|
defaultParams: getDefaultParams(options),
|
|
@@ -12756,6 +12823,161 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
|
|
|
12756
12823
|
return amisSchema;
|
|
12757
12824
|
}
|
|
12758
12825
|
|
|
12826
|
+
/******************************************************************************
|
|
12827
|
+
Copyright (c) Microsoft Corporation.
|
|
12828
|
+
|
|
12829
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
12830
|
+
purpose with or without fee is hereby granted.
|
|
12831
|
+
|
|
12832
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
12833
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
12834
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12835
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12836
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
12837
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
12838
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
12839
|
+
***************************************************************************** */
|
|
12840
|
+
|
|
12841
|
+
var __assign$1 = function() {
|
|
12842
|
+
__assign$1 = Object.assign || function __assign(t) {
|
|
12843
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
12844
|
+
s = arguments[i];
|
|
12845
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
12846
|
+
}
|
|
12847
|
+
return t;
|
|
12848
|
+
};
|
|
12849
|
+
return __assign$1.apply(this, arguments);
|
|
12850
|
+
};
|
|
12851
|
+
|
|
12852
|
+
/**
|
|
12853
|
+
* 将例如像 a.b.c 或 a[1].b 的字符串转换为路径数组
|
|
12854
|
+
*
|
|
12855
|
+
* @param string 要转换的字符串
|
|
12856
|
+
*/
|
|
12857
|
+
var keyToPath = function (string) {
|
|
12858
|
+
var result = [];
|
|
12859
|
+
if (string.charCodeAt(0) === '.'.charCodeAt(0)) {
|
|
12860
|
+
result.push('');
|
|
12861
|
+
}
|
|
12862
|
+
string.replace(new RegExp('[^.[\\]]+|\\[(?:([^"\'][^[]*)|(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))', 'g'), function (match, expression, quote, subString) {
|
|
12863
|
+
var key = match;
|
|
12864
|
+
if (quote) {
|
|
12865
|
+
key = subString.replace(/\\(\\)?/g, '$1');
|
|
12866
|
+
}
|
|
12867
|
+
else if (expression) {
|
|
12868
|
+
key = expression.trim();
|
|
12869
|
+
}
|
|
12870
|
+
result.push(key);
|
|
12871
|
+
return '';
|
|
12872
|
+
});
|
|
12873
|
+
return result;
|
|
12874
|
+
};
|
|
12875
|
+
|
|
12876
|
+
// 方便取值的时候能够把上层的取到,但是获取的时候不会全部把所有的数据获取到。
|
|
12877
|
+
function createObject(superProps, props, properties) {
|
|
12878
|
+
if (superProps && Object.isFrozen(superProps)) {
|
|
12879
|
+
superProps = cloneObject(superProps);
|
|
12880
|
+
}
|
|
12881
|
+
var obj = superProps
|
|
12882
|
+
? Object.create(superProps, __assign$1(__assign$1({}, properties), { __super: {
|
|
12883
|
+
value: superProps,
|
|
12884
|
+
writable: false,
|
|
12885
|
+
enumerable: false
|
|
12886
|
+
} }))
|
|
12887
|
+
: Object.create(Object.prototype, properties);
|
|
12888
|
+
props &&
|
|
12889
|
+
isObject(props) &&
|
|
12890
|
+
Object.keys(props).forEach(function (key) { return (obj[key] = props[key]); });
|
|
12891
|
+
return obj;
|
|
12892
|
+
}
|
|
12893
|
+
function cloneObject(target, persistOwnProps) {
|
|
12894
|
+
if (persistOwnProps === void 0) { persistOwnProps = true; }
|
|
12895
|
+
var obj = target && target.__super
|
|
12896
|
+
? Object.create(target.__super, {
|
|
12897
|
+
__super: {
|
|
12898
|
+
value: target.__super,
|
|
12899
|
+
writable: false,
|
|
12900
|
+
enumerable: false
|
|
12901
|
+
}
|
|
12902
|
+
})
|
|
12903
|
+
: Object.create(Object.prototype);
|
|
12904
|
+
persistOwnProps &&
|
|
12905
|
+
target &&
|
|
12906
|
+
Object.keys(target).forEach(function (key) { return (obj[key] = target[key]); });
|
|
12907
|
+
return obj;
|
|
12908
|
+
}
|
|
12909
|
+
function extendObject(target, src, persistOwnProps) {
|
|
12910
|
+
if (persistOwnProps === void 0) { persistOwnProps = true; }
|
|
12911
|
+
var obj = cloneObject(target, persistOwnProps);
|
|
12912
|
+
src && Object.keys(src).forEach(function (key) { return (obj[key] = src[key]); });
|
|
12913
|
+
return obj;
|
|
12914
|
+
}
|
|
12915
|
+
function isObject(obj) {
|
|
12916
|
+
var typename = typeof obj;
|
|
12917
|
+
return (obj &&
|
|
12918
|
+
typename !== 'string' &&
|
|
12919
|
+
typename !== 'number' &&
|
|
12920
|
+
typename !== 'boolean' &&
|
|
12921
|
+
typename !== 'function' &&
|
|
12922
|
+
!Array.isArray(obj));
|
|
12923
|
+
}
|
|
12924
|
+
function setVariable(data, key, value, convertKeyToPath) {
|
|
12925
|
+
data = data || {};
|
|
12926
|
+
if (key in data) {
|
|
12927
|
+
data[key] = value;
|
|
12928
|
+
return;
|
|
12929
|
+
}
|
|
12930
|
+
var parts = convertKeyToPath !== false ? keyToPath(key) : [key];
|
|
12931
|
+
var last = parts.pop();
|
|
12932
|
+
while (parts.length) {
|
|
12933
|
+
var key_1 = parts.shift();
|
|
12934
|
+
if (isPlainObject_1(data[key_1])) {
|
|
12935
|
+
data = data[key_1] = __assign$1({}, data[key_1]);
|
|
12936
|
+
}
|
|
12937
|
+
else if (Array.isArray(data[key_1])) {
|
|
12938
|
+
data[key_1] = data[key_1].concat();
|
|
12939
|
+
data = data[key_1];
|
|
12940
|
+
}
|
|
12941
|
+
else if (data[key_1]) {
|
|
12942
|
+
// throw new Error(`目标路径不是纯对象,不能覆盖`);
|
|
12943
|
+
// 强行转成对象
|
|
12944
|
+
data[key_1] = {};
|
|
12945
|
+
data = data[key_1];
|
|
12946
|
+
}
|
|
12947
|
+
else {
|
|
12948
|
+
data[key_1] = {};
|
|
12949
|
+
data = data[key_1];
|
|
12950
|
+
}
|
|
12951
|
+
}
|
|
12952
|
+
data[last] = value;
|
|
12953
|
+
}
|
|
12954
|
+
function deleteVariable(data, key) {
|
|
12955
|
+
if (!data) {
|
|
12956
|
+
return;
|
|
12957
|
+
}
|
|
12958
|
+
else if (data.hasOwnProperty(key)) {
|
|
12959
|
+
delete data[key];
|
|
12960
|
+
return;
|
|
12961
|
+
}
|
|
12962
|
+
var parts = keyToPath(key);
|
|
12963
|
+
var last = parts.pop();
|
|
12964
|
+
while (parts.length) {
|
|
12965
|
+
var key_2 = parts.shift();
|
|
12966
|
+
if (isPlainObject_1(data[key_2])) {
|
|
12967
|
+
data = data[key_2] = __assign$1({}, data[key_2]);
|
|
12968
|
+
}
|
|
12969
|
+
else if (data[key_2]) {
|
|
12970
|
+
throw new Error("\u76EE\u6807\u8DEF\u5F84\u4E0D\u662F\u7EAF\u5BF9\u8C61\uFF0C\u4E0D\u80FD\u4FEE\u6539");
|
|
12971
|
+
}
|
|
12972
|
+
else {
|
|
12973
|
+
break;
|
|
12974
|
+
}
|
|
12975
|
+
}
|
|
12976
|
+
if (data && data.hasOwnProperty && data.hasOwnProperty(last)) {
|
|
12977
|
+
delete data[last];
|
|
12978
|
+
}
|
|
12979
|
+
}
|
|
12980
|
+
|
|
12759
12981
|
/*
|
|
12760
12982
|
* @Author: baozhoutao@steedos.com
|
|
12761
12983
|
* @Date: 2022-05-26 16:02:08
|
|
@@ -12996,9 +13218,30 @@ function getBulkActions(objectSchema){
|
|
|
12996
13218
|
]
|
|
12997
13219
|
}
|
|
12998
13220
|
|
|
13221
|
+
async function getCrudSchemaWithDataFilter(crud, options = {}){
|
|
13222
|
+
const { crudDataFilter, amisData, env } = options;
|
|
13223
|
+
let onCrudDataFilter = options.onCrudDataFilter;
|
|
13224
|
+
if (!onCrudDataFilter && typeof crudDataFilter === 'string') {
|
|
13225
|
+
onCrudDataFilter = new Function(
|
|
13226
|
+
'crud',
|
|
13227
|
+
'env',
|
|
13228
|
+
'data',
|
|
13229
|
+
crudDataFilter
|
|
13230
|
+
);
|
|
13231
|
+
}
|
|
13232
|
+
|
|
13233
|
+
try {
|
|
13234
|
+
onCrudDataFilter && (crud = await onCrudDataFilter(crud, env, amisData) || crud);
|
|
13235
|
+
} catch (e) {
|
|
13236
|
+
console.warn(e);
|
|
13237
|
+
}
|
|
13238
|
+
return crud;
|
|
13239
|
+
}
|
|
13240
|
+
|
|
12999
13241
|
async function getObjectCRUD(objectSchema, fields, options){
|
|
13000
13242
|
// console.time('getObjectCRUD');
|
|
13001
|
-
const { top, perPage, showDisplayAs = false, displayAs, crudClassName = ""
|
|
13243
|
+
const { top, perPage, showDisplayAs = false, displayAs, crudClassName = "",
|
|
13244
|
+
crudDataFilter, onCrudDataFilter, amisData, env } = options;
|
|
13002
13245
|
const nonpaged = objectSchema.paging && objectSchema.paging.enabled === false;
|
|
13003
13246
|
const isTreeObject = objectSchema.enable_tree;
|
|
13004
13247
|
const bulkActions = getBulkActions(objectSchema);
|
|
@@ -13039,6 +13282,14 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
13039
13282
|
filterVisible: options.filterVisible
|
|
13040
13283
|
});
|
|
13041
13284
|
|
|
13285
|
+
options.amisData = createObject(options.amisData, {
|
|
13286
|
+
objectName: objectSchema.name,
|
|
13287
|
+
// _id: null,
|
|
13288
|
+
recordPermissions: objectSchema.permissions,
|
|
13289
|
+
uiSchema: objectSchema,
|
|
13290
|
+
// loaded: false //crud接收适配器中设置为true,否则就是刷新浏览器第一次加载
|
|
13291
|
+
});
|
|
13292
|
+
|
|
13042
13293
|
|
|
13043
13294
|
let body = null;
|
|
13044
13295
|
const id = `listview_${objectSchema.name}`;
|
|
@@ -13064,7 +13315,12 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
13064
13315
|
if(objectSchema.name === 'organizations'){
|
|
13065
13316
|
labelFieldName = 'name';
|
|
13066
13317
|
}
|
|
13067
|
-
|
|
13318
|
+
let tableOptions = Object.assign({
|
|
13319
|
+
idFieldName: objectSchema.idFieldName, labelFieldName: labelFieldName,
|
|
13320
|
+
permissions:objectSchema.permissions,enable_inline_edit:objectSchema.enable_inline_edit
|
|
13321
|
+
}, options);
|
|
13322
|
+
tableOptions.amisData = createObject(options.amisData || {}, {});
|
|
13323
|
+
const table = await getTableSchema$1(fields, tableOptions);
|
|
13068
13324
|
delete table.mode;
|
|
13069
13325
|
//image与avatar需要在提交修改时特别处理
|
|
13070
13326
|
const imageNames = _$1__default.compact(_$1__default.map(_$1__default.filter(fields, (field) => ["image","avatar"].includes(field.type)), 'name'));
|
|
@@ -13122,17 +13378,26 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
13122
13378
|
Authorization: "Bearer ${context.tenantId},${context.authToken}",
|
|
13123
13379
|
},
|
|
13124
13380
|
requestAdaptor: quickSaveApiRequestAdaptor,
|
|
13381
|
+
adaptor: `
|
|
13382
|
+
if(payload.errors){
|
|
13383
|
+
payload.status = 2;
|
|
13384
|
+
payload.msg = window.t ? window.t(payload.errors[0].message) : payload.errors[0].message;
|
|
13385
|
+
}
|
|
13386
|
+
return payload;
|
|
13387
|
+
`
|
|
13125
13388
|
},
|
|
13126
13389
|
rowClassNameExpr: options.rowClassNameExpr
|
|
13127
|
-
},
|
|
13128
|
-
|
|
13129
|
-
);
|
|
13390
|
+
}, bodyProps);
|
|
13391
|
+
|
|
13130
13392
|
}
|
|
13131
13393
|
|
|
13132
13394
|
const defaults = options.defaults;
|
|
13395
|
+
|
|
13396
|
+
const listSchema = (defaults && defaults.listSchema) || {};
|
|
13397
|
+
body = defaultsDeep({}, listSchema, body);
|
|
13398
|
+
body = await getCrudSchemaWithDataFilter(body, { crudDataFilter, onCrudDataFilter, amisData, env });
|
|
13399
|
+
|
|
13133
13400
|
if (defaults) {
|
|
13134
|
-
const listSchema = defaults.listSchema || {};
|
|
13135
|
-
body = defaultsDeep({}, listSchema, body);
|
|
13136
13401
|
const headerSchema = defaults.headerSchema;
|
|
13137
13402
|
const footerSchema = defaults.footerSchema;
|
|
13138
13403
|
if (headerSchema || footerSchema) {
|
|
@@ -13161,16 +13426,10 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
13161
13426
|
return {
|
|
13162
13427
|
type: 'service',
|
|
13163
13428
|
className: '',
|
|
13164
|
-
//目前crud的service层id不认用户自定义id,只支持默认规则id
|
|
13429
|
+
//目前crud的service层id不认用户自定义id,只支持默认规则id,许多地方的格式都写死了service_listview_${objectname}
|
|
13165
13430
|
id: `service_${id}`,
|
|
13166
13431
|
name: `page`,
|
|
13167
|
-
data:
|
|
13168
|
-
objectName: objectSchema.name,
|
|
13169
|
-
// _id: null,
|
|
13170
|
-
recordPermissions: objectSchema.permissions,
|
|
13171
|
-
uiSchema: objectSchema,
|
|
13172
|
-
// loaded: false //crud接收适配器中设置为true,否则就是刷新浏览器第一次加载
|
|
13173
|
-
},
|
|
13432
|
+
data: options.amisData,
|
|
13174
13433
|
body: body
|
|
13175
13434
|
}
|
|
13176
13435
|
}
|
|
@@ -13470,7 +13729,7 @@ const getRecordPermissions = async (objectName, recordId)=>{
|
|
|
13470
13729
|
* @Author: baozhoutao@steedos.com
|
|
13471
13730
|
* @Date: 2022-07-05 15:55:39
|
|
13472
13731
|
* @LastEditors: liaodaxue
|
|
13473
|
-
* @LastEditTime: 2023-
|
|
13732
|
+
* @LastEditTime: 2023-09-25 17:18:08
|
|
13474
13733
|
* @Description:
|
|
13475
13734
|
*/
|
|
13476
13735
|
|
|
@@ -13645,7 +13904,8 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
|
|
|
13645
13904
|
setDataToComponentId: componentId,
|
|
13646
13905
|
// tableHiddenOn: hiddenEmptyTable ? "this.$count === 0" : null,
|
|
13647
13906
|
appId: appId,
|
|
13648
|
-
crudClassName: 'border-t border-
|
|
13907
|
+
crudClassName: 'border-t border-gray-300 hidden',
|
|
13908
|
+
refField,
|
|
13649
13909
|
...ctx
|
|
13650
13910
|
};
|
|
13651
13911
|
const amisSchema= (await getRelatedListSchema(relatedObjectName, 'all', options)).amisSchema;
|
|
@@ -13657,7 +13917,7 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
|
|
|
13657
13917
|
amisSchema: {
|
|
13658
13918
|
type: "service",
|
|
13659
13919
|
id: componentId,
|
|
13660
|
-
className: `steedos-record-related-list ${componentId} rounded border border-
|
|
13920
|
+
className: `steedos-record-related-list ${componentId} rounded border border-gray-300 bg-gray-100 mb-4 ${className}`,
|
|
13661
13921
|
data: {
|
|
13662
13922
|
relatedKey: relatedKey,
|
|
13663
13923
|
listViewId: `amis-\${appId}-${relatedObjectName}-listview`,
|
|
@@ -13760,10 +14020,33 @@ async function getRelatedListSchema(
|
|
|
13760
14020
|
ctx
|
|
13761
14021
|
) {
|
|
13762
14022
|
const uiSchema = await getUISchema(objectName);
|
|
13763
|
-
const listView =
|
|
14023
|
+
const listView = find(
|
|
14024
|
+
uiSchema.list_views,
|
|
14025
|
+
(listView, name) => {
|
|
14026
|
+
// 传入listViewName空值则取第一个
|
|
14027
|
+
if(!listViewName){
|
|
14028
|
+
listViewName = name;
|
|
14029
|
+
}
|
|
14030
|
+
return name === listViewName || listView._id === listViewName;
|
|
14031
|
+
}
|
|
14032
|
+
);
|
|
13764
14033
|
const listViewProps = getRelatedListProps(uiSchema,listViewName, ctx);
|
|
13765
14034
|
// console.log('listViewProps==>', listViewProps)
|
|
13766
14035
|
const {columns: listViewColumns, sort: listViewSort, filter: listviewFilter, filtersFunction } = listViewProps;
|
|
14036
|
+
|
|
14037
|
+
const refFieldName = ctx.refField && ctx.refField.name;
|
|
14038
|
+
|
|
14039
|
+
let relatedListColumns = listViewColumns;
|
|
14040
|
+
if(refFieldName){
|
|
14041
|
+
relatedListColumns = listViewColumns.filter(function(columnItem){
|
|
14042
|
+
if(typeof columnItem === "string"){
|
|
14043
|
+
return columnItem !== refFieldName;
|
|
14044
|
+
}
|
|
14045
|
+
else {
|
|
14046
|
+
return columnItem.field !== refFieldName;
|
|
14047
|
+
}
|
|
14048
|
+
});
|
|
14049
|
+
}
|
|
13767
14050
|
|
|
13768
14051
|
const defaults = ctx.defaults || {};
|
|
13769
14052
|
|
|
@@ -13801,7 +14084,7 @@ async function getRelatedListSchema(
|
|
|
13801
14084
|
const amisSchema = {
|
|
13802
14085
|
"type": "steedos-object-table",
|
|
13803
14086
|
"objectApiName": objectName,
|
|
13804
|
-
"columns":
|
|
14087
|
+
"columns": relatedListColumns,
|
|
13805
14088
|
"extraColumns": listView.extra_columns,
|
|
13806
14089
|
"filters": listviewFilter,
|
|
13807
14090
|
"filtersFunction": filtersFunction,
|
|
@@ -13822,7 +14105,7 @@ async function getRelatedListSchema(
|
|
|
13822
14105
|
* @Author: baozhoutao@steedos.com
|
|
13823
14106
|
* @Date: 2022-07-05 15:55:39
|
|
13824
14107
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
13825
|
-
* @LastEditTime: 2023-09-
|
|
14108
|
+
* @LastEditTime: 2023-09-21 17:35:06
|
|
13826
14109
|
* @Description:
|
|
13827
14110
|
*/
|
|
13828
14111
|
|
|
@@ -14155,7 +14438,9 @@ async function getListSchema(
|
|
|
14155
14438
|
"adaptor": listView.adaptor,
|
|
14156
14439
|
"headerToolbarItems": ctx.headerToolbarItems,
|
|
14157
14440
|
"filterVisible": ctx.filterVisible,
|
|
14158
|
-
"rowClassNameExpr": ctx.rowClassNameExpr
|
|
14441
|
+
"rowClassNameExpr": ctx.rowClassNameExpr,
|
|
14442
|
+
"crudDataFilter": ctx.crudDataFilter,
|
|
14443
|
+
"onCrudDataFilter": ctx.onCrudDataFilter
|
|
14159
14444
|
};
|
|
14160
14445
|
// console.log(`getListSchema===>`,amisSchema)
|
|
14161
14446
|
return {
|
|
@@ -14258,7 +14543,7 @@ async function getTableSchema(
|
|
|
14258
14543
|
fields = fields.concat(extraFields);
|
|
14259
14544
|
}
|
|
14260
14545
|
|
|
14261
|
-
|
|
14546
|
+
let crudOptions = {
|
|
14262
14547
|
tabId: objectName,
|
|
14263
14548
|
appId: appName,
|
|
14264
14549
|
objectName: objectName,
|
|
@@ -14267,8 +14552,9 @@ async function getTableSchema(
|
|
|
14267
14552
|
sort,
|
|
14268
14553
|
headerToolbarItems: ctx.headerToolbarItems,
|
|
14269
14554
|
buttons: await getListViewItemButtons(uiSchema, ctx)
|
|
14270
|
-
}
|
|
14271
|
-
|
|
14555
|
+
};
|
|
14556
|
+
crudOptions.amisData = createObject(ctx.amisData || {}, {});
|
|
14557
|
+
const amisSchema = await getObjectCRUD(uiSchema, fields, crudOptions);
|
|
14272
14558
|
// console.timeEnd('getTableSchema');
|
|
14273
14559
|
return {
|
|
14274
14560
|
uiSchema,
|
|
@@ -14340,7 +14626,7 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
|
|
|
14340
14626
|
};
|
|
14341
14627
|
const content = {
|
|
14342
14628
|
"type": "tabs",
|
|
14343
|
-
"className": "sm:mt-3 bg-white sm:
|
|
14629
|
+
"className": "sm:mt-3 bg-white sm:rounded sm:border border-gray-300 p-4",
|
|
14344
14630
|
"tabs": [
|
|
14345
14631
|
detailed
|
|
14346
14632
|
],
|
|
@@ -14527,7 +14813,7 @@ async function getListPageInitSchema(objectApiName, formFactor, userSession) {
|
|
|
14527
14813
|
"columnsTogglable": false,
|
|
14528
14814
|
"showHeader": true,
|
|
14529
14815
|
// "headerSchema": headerSchema
|
|
14530
|
-
className: "sm:border bg-white sm:
|
|
14816
|
+
className: "sm:border bg-white sm:rounded border-gray-300 border-solid"
|
|
14531
14817
|
}]
|
|
14532
14818
|
}
|
|
14533
14819
|
}
|
|
@@ -14585,7 +14871,7 @@ async function getRecordPageInitSchema(objectApiName){
|
|
|
14585
14871
|
]
|
|
14586
14872
|
}
|
|
14587
14873
|
],
|
|
14588
|
-
"className": "sm:mt-3 flex flex-col region-main bg-white sm:
|
|
14874
|
+
"className": "sm:mt-3 flex flex-col region-main bg-white sm:rounded sm:border border-gray-300",
|
|
14589
14875
|
"linksClassName": "pl-4 pt-2"
|
|
14590
14876
|
};
|
|
14591
14877
|
if(relatedList.length){
|
|
@@ -15052,161 +15338,6 @@ const registerRemoteAssets = async (assetUrls)=>{
|
|
|
15052
15338
|
}
|
|
15053
15339
|
};
|
|
15054
15340
|
|
|
15055
|
-
/******************************************************************************
|
|
15056
|
-
Copyright (c) Microsoft Corporation.
|
|
15057
|
-
|
|
15058
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
15059
|
-
purpose with or without fee is hereby granted.
|
|
15060
|
-
|
|
15061
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
15062
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
15063
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
15064
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
15065
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
15066
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15067
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15068
|
-
***************************************************************************** */
|
|
15069
|
-
|
|
15070
|
-
var __assign$1 = function() {
|
|
15071
|
-
__assign$1 = Object.assign || function __assign(t) {
|
|
15072
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
15073
|
-
s = arguments[i];
|
|
15074
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
15075
|
-
}
|
|
15076
|
-
return t;
|
|
15077
|
-
};
|
|
15078
|
-
return __assign$1.apply(this, arguments);
|
|
15079
|
-
};
|
|
15080
|
-
|
|
15081
|
-
/**
|
|
15082
|
-
* 将例如像 a.b.c 或 a[1].b 的字符串转换为路径数组
|
|
15083
|
-
*
|
|
15084
|
-
* @param string 要转换的字符串
|
|
15085
|
-
*/
|
|
15086
|
-
var keyToPath = function (string) {
|
|
15087
|
-
var result = [];
|
|
15088
|
-
if (string.charCodeAt(0) === '.'.charCodeAt(0)) {
|
|
15089
|
-
result.push('');
|
|
15090
|
-
}
|
|
15091
|
-
string.replace(new RegExp('[^.[\\]]+|\\[(?:([^"\'][^[]*)|(["\'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))', 'g'), function (match, expression, quote, subString) {
|
|
15092
|
-
var key = match;
|
|
15093
|
-
if (quote) {
|
|
15094
|
-
key = subString.replace(/\\(\\)?/g, '$1');
|
|
15095
|
-
}
|
|
15096
|
-
else if (expression) {
|
|
15097
|
-
key = expression.trim();
|
|
15098
|
-
}
|
|
15099
|
-
result.push(key);
|
|
15100
|
-
return '';
|
|
15101
|
-
});
|
|
15102
|
-
return result;
|
|
15103
|
-
};
|
|
15104
|
-
|
|
15105
|
-
// 方便取值的时候能够把上层的取到,但是获取的时候不会全部把所有的数据获取到。
|
|
15106
|
-
function createObject(superProps, props, properties) {
|
|
15107
|
-
if (superProps && Object.isFrozen(superProps)) {
|
|
15108
|
-
superProps = cloneObject(superProps);
|
|
15109
|
-
}
|
|
15110
|
-
var obj = superProps
|
|
15111
|
-
? Object.create(superProps, __assign$1(__assign$1({}, properties), { __super: {
|
|
15112
|
-
value: superProps,
|
|
15113
|
-
writable: false,
|
|
15114
|
-
enumerable: false
|
|
15115
|
-
} }))
|
|
15116
|
-
: Object.create(Object.prototype, properties);
|
|
15117
|
-
props &&
|
|
15118
|
-
isObject(props) &&
|
|
15119
|
-
Object.keys(props).forEach(function (key) { return (obj[key] = props[key]); });
|
|
15120
|
-
return obj;
|
|
15121
|
-
}
|
|
15122
|
-
function cloneObject(target, persistOwnProps) {
|
|
15123
|
-
if (persistOwnProps === void 0) { persistOwnProps = true; }
|
|
15124
|
-
var obj = target && target.__super
|
|
15125
|
-
? Object.create(target.__super, {
|
|
15126
|
-
__super: {
|
|
15127
|
-
value: target.__super,
|
|
15128
|
-
writable: false,
|
|
15129
|
-
enumerable: false
|
|
15130
|
-
}
|
|
15131
|
-
})
|
|
15132
|
-
: Object.create(Object.prototype);
|
|
15133
|
-
persistOwnProps &&
|
|
15134
|
-
target &&
|
|
15135
|
-
Object.keys(target).forEach(function (key) { return (obj[key] = target[key]); });
|
|
15136
|
-
return obj;
|
|
15137
|
-
}
|
|
15138
|
-
function extendObject(target, src, persistOwnProps) {
|
|
15139
|
-
if (persistOwnProps === void 0) { persistOwnProps = true; }
|
|
15140
|
-
var obj = cloneObject(target, persistOwnProps);
|
|
15141
|
-
src && Object.keys(src).forEach(function (key) { return (obj[key] = src[key]); });
|
|
15142
|
-
return obj;
|
|
15143
|
-
}
|
|
15144
|
-
function isObject(obj) {
|
|
15145
|
-
var typename = typeof obj;
|
|
15146
|
-
return (obj &&
|
|
15147
|
-
typename !== 'string' &&
|
|
15148
|
-
typename !== 'number' &&
|
|
15149
|
-
typename !== 'boolean' &&
|
|
15150
|
-
typename !== 'function' &&
|
|
15151
|
-
!Array.isArray(obj));
|
|
15152
|
-
}
|
|
15153
|
-
function setVariable(data, key, value, convertKeyToPath) {
|
|
15154
|
-
data = data || {};
|
|
15155
|
-
if (key in data) {
|
|
15156
|
-
data[key] = value;
|
|
15157
|
-
return;
|
|
15158
|
-
}
|
|
15159
|
-
var parts = convertKeyToPath !== false ? keyToPath(key) : [key];
|
|
15160
|
-
var last = parts.pop();
|
|
15161
|
-
while (parts.length) {
|
|
15162
|
-
var key_1 = parts.shift();
|
|
15163
|
-
if (isPlainObject_1(data[key_1])) {
|
|
15164
|
-
data = data[key_1] = __assign$1({}, data[key_1]);
|
|
15165
|
-
}
|
|
15166
|
-
else if (Array.isArray(data[key_1])) {
|
|
15167
|
-
data[key_1] = data[key_1].concat();
|
|
15168
|
-
data = data[key_1];
|
|
15169
|
-
}
|
|
15170
|
-
else if (data[key_1]) {
|
|
15171
|
-
// throw new Error(`目标路径不是纯对象,不能覆盖`);
|
|
15172
|
-
// 强行转成对象
|
|
15173
|
-
data[key_1] = {};
|
|
15174
|
-
data = data[key_1];
|
|
15175
|
-
}
|
|
15176
|
-
else {
|
|
15177
|
-
data[key_1] = {};
|
|
15178
|
-
data = data[key_1];
|
|
15179
|
-
}
|
|
15180
|
-
}
|
|
15181
|
-
data[last] = value;
|
|
15182
|
-
}
|
|
15183
|
-
function deleteVariable(data, key) {
|
|
15184
|
-
if (!data) {
|
|
15185
|
-
return;
|
|
15186
|
-
}
|
|
15187
|
-
else if (data.hasOwnProperty(key)) {
|
|
15188
|
-
delete data[key];
|
|
15189
|
-
return;
|
|
15190
|
-
}
|
|
15191
|
-
var parts = keyToPath(key);
|
|
15192
|
-
var last = parts.pop();
|
|
15193
|
-
while (parts.length) {
|
|
15194
|
-
var key_2 = parts.shift();
|
|
15195
|
-
if (isPlainObject_1(data[key_2])) {
|
|
15196
|
-
data = data[key_2] = __assign$1({}, data[key_2]);
|
|
15197
|
-
}
|
|
15198
|
-
else if (data[key_2]) {
|
|
15199
|
-
throw new Error("\u76EE\u6807\u8DEF\u5F84\u4E0D\u662F\u7EAF\u5BF9\u8C61\uFF0C\u4E0D\u80FD\u4FEE\u6539");
|
|
15200
|
-
}
|
|
15201
|
-
else {
|
|
15202
|
-
break;
|
|
15203
|
-
}
|
|
15204
|
-
}
|
|
15205
|
-
if (data && data.hasOwnProperty && data.hasOwnProperty(last)) {
|
|
15206
|
-
delete data[last];
|
|
15207
|
-
}
|
|
15208
|
-
}
|
|
15209
|
-
|
|
15210
15341
|
/*
|
|
15211
15342
|
* @Author: baozhoutao@steedos.com
|
|
15212
15343
|
* @Date: 2022-12-17 17:03:40
|
|
@@ -17867,14 +17998,12 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
17867
17998
|
}); };
|
|
17868
17999
|
|
|
17869
18000
|
var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
17870
|
-
var $schema, top, perPage, _a, showHeader, data, defaultData, _b, crud, _c, className, crudClassName,
|
|
17871
|
-
var
|
|
17872
|
-
return __generator(this, function (
|
|
17873
|
-
switch (
|
|
18001
|
+
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;
|
|
18002
|
+
var _j;
|
|
18003
|
+
return __generator(this, function (_k) {
|
|
18004
|
+
switch (_k.label) {
|
|
17874
18005
|
case 0:
|
|
17875
|
-
|
|
17876
|
-
console.log("AmisObjectListView props", props);
|
|
17877
|
-
$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;
|
|
18006
|
+
$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;
|
|
17878
18007
|
headerSchema = props.headerSchema;
|
|
17879
18008
|
ctx = props.ctx;
|
|
17880
18009
|
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);
|
|
@@ -17903,7 +18032,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
17903
18032
|
}
|
|
17904
18033
|
return [4 /*yield*/, getUISchema(objectApiName, false)];
|
|
17905
18034
|
case 1:
|
|
17906
|
-
uiSchema =
|
|
18035
|
+
uiSchema = _k.sent();
|
|
17907
18036
|
listView = find(uiSchema.list_views, function (listView, name) {
|
|
17908
18037
|
// 传入listViewName空值则取第一个
|
|
17909
18038
|
if (!listName) {
|
|
@@ -17954,7 +18083,8 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
17954
18083
|
}
|
|
17955
18084
|
amisSchemaData = Object.assign({}, data, defaultData);
|
|
17956
18085
|
listViewId = (ctx === null || ctx === void 0 ? void 0 : ctx.listViewId) || amisSchemaData.listViewId;
|
|
17957
|
-
|
|
18086
|
+
allData = createObject(data, defaultData);
|
|
18087
|
+
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 });
|
|
17958
18088
|
if (!headerSchema) {
|
|
17959
18089
|
headerSchema = getObjectListHeader$1(uiSchema, listName, ctx);
|
|
17960
18090
|
}
|
|
@@ -17968,14 +18098,15 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
17968
18098
|
if (!has(data, 'uiSchema')) {
|
|
17969
18099
|
serviceData.uiSchema = uiSchema;
|
|
17970
18100
|
}
|
|
17971
|
-
serviceData.defaultListName = listName ? listName : (
|
|
18101
|
+
serviceData.defaultListName = listName ? listName : (_j = first(values(uiSchema.list_views))) === null || _j === void 0 ? void 0 : _j.name;
|
|
17972
18102
|
// console.timeEnd('AmisObjectListView')
|
|
17973
18103
|
// console.log('serviceData===>', serviceData)
|
|
17974
18104
|
// console.log('headerSchema===>', headerSchema)
|
|
17975
18105
|
return [2 /*return*/, {
|
|
17976
18106
|
type: "service",
|
|
17977
18107
|
data: serviceData,
|
|
17978
|
-
|
|
18108
|
+
style: style,
|
|
18109
|
+
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'),
|
|
17979
18110
|
body: [{
|
|
17980
18111
|
"type": "wrapper",
|
|
17981
18112
|
"size": "none",
|
|
@@ -17997,16 +18128,17 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
17997
18128
|
body: __spreadArray(__spreadArray([], __read(headerSchema), false), [
|
|
17998
18129
|
{
|
|
17999
18130
|
"type": "service",
|
|
18131
|
+
"id": "service_schema_api_" + objectApiName,
|
|
18000
18132
|
"schemaApi": {
|
|
18001
18133
|
// 这里url上加objectApiName属性是因为设计器中切换对象时不会变更列表视图界面,不可以用objectName=${objectName}使用作用域中objectName变量是因为设计器那边不会监听识别data变化来render组件
|
|
18002
|
-
"url": "${context.rootUrl}/graphql?objectName=" + objectApiName + "&listName=${listName}&display=${display}",
|
|
18134
|
+
"url": "${context.rootUrl}/graphql?objectName=" + objectApiName + "&listName=${listName}&display=${display}&rebuildOn=" + rebuildOn,
|
|
18003
18135
|
"method": "post",
|
|
18004
18136
|
"messages": {},
|
|
18005
18137
|
"headers": {
|
|
18006
18138
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
18007
18139
|
},
|
|
18008
18140
|
"requestAdaptor": "api.data={query: '{spaces__findOne(id: \"none\"){_id,name}}'};return api;",
|
|
18009
|
-
"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
|
|
18141
|
+
"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 ")
|
|
18010
18142
|
},
|
|
18011
18143
|
// "body": body,
|
|
18012
18144
|
// "data": serviceData
|
|
@@ -18049,13 +18181,11 @@ function getTableColumns(columns, includedFields, fieldsExtend) {
|
|
|
18049
18181
|
return tableColumns;
|
|
18050
18182
|
}
|
|
18051
18183
|
var AmisObjectTable = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
18052
|
-
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;
|
|
18184
|
+
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;
|
|
18053
18185
|
return __generator(this, function (_e) {
|
|
18054
18186
|
switch (_e.label) {
|
|
18055
18187
|
case 0:
|
|
18056
|
-
|
|
18057
|
-
console.log("AmisObjectTable props", props);
|
|
18058
|
-
$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;
|
|
18188
|
+
$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;
|
|
18059
18189
|
ctx = props.ctx;
|
|
18060
18190
|
if (!ctx) {
|
|
18061
18191
|
ctx = {};
|
|
@@ -18086,10 +18216,11 @@ var AmisObjectTable = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
18086
18216
|
amisFilters = amisCondition && conditionsToFilters(amisCondition);
|
|
18087
18217
|
tableFilters = filters || amisFilters;
|
|
18088
18218
|
amisSchemaData = Object.assign({}, data, defaultData);
|
|
18219
|
+
allData = createObject(data, defaultData);
|
|
18089
18220
|
appId = (data === null || data === void 0 ? void 0 : data.appId) || (defaultData === null || defaultData === void 0 ? void 0 : defaultData.appId);
|
|
18090
18221
|
// ctx中值为undefined的属性不能保留,否则会导致 filters等被覆盖。
|
|
18091
18222
|
ctx = pickBy(ctx, function (value) { return value !== undefined; });
|
|
18092
|
-
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 }))];
|
|
18223
|
+
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 }))];
|
|
18093
18224
|
case 1:
|
|
18094
18225
|
amisSchema = (_e.sent()).amisSchema;
|
|
18095
18226
|
amisSchema.data = Object.assign({}, amisSchema.data, amisSchemaData);
|
|
@@ -18098,7 +18229,6 @@ var AmisObjectTable = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
18098
18229
|
}
|
|
18099
18230
|
amisSchema.className = "steedos-object-table h-full flex flex-col ".concat(className);
|
|
18100
18231
|
amisSchema.objectApiName = objectApiName; //设计器中切换对象时画布中显示的列未同步变更
|
|
18101
|
-
// console.log(`AmisObjectTable===>amisSchema`, amisSchema)
|
|
18102
18232
|
// console.timeEnd('AmisObjectTable')
|
|
18103
18233
|
return [2 /*return*/, amisSchema];
|
|
18104
18234
|
}
|
|
@@ -18155,7 +18285,7 @@ var AmisRecordDetailHeader = function (props) { return __awaiter(void 0, void 0,
|
|
|
18155
18285
|
return __generator(this, function (_d) {
|
|
18156
18286
|
switch (_d.label) {
|
|
18157
18287
|
case 0:
|
|
18158
|
-
_a = props.className, className = _a === void 0 ? 'sm:sticky top-0 z-10 bg-gray-100 border-b sm:
|
|
18288
|
+
_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;
|
|
18159
18289
|
return [4 /*yield*/, getUISchema(props.objectApiName || "space_users", false)];
|
|
18160
18290
|
case 1:
|
|
18161
18291
|
objectUiSchema = _d.sent();
|
|
@@ -18387,7 +18517,7 @@ var AmisSelectUser = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
18387
18517
|
|
|
18388
18518
|
var AmisProvider = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
18389
18519
|
return __generator(this, function (_a) {
|
|
18390
|
-
console.log(
|
|
18520
|
+
// console.log(`AmisProvider props`, props)
|
|
18391
18521
|
return [2 /*return*/, {}];
|
|
18392
18522
|
});
|
|
18393
18523
|
}); };
|
|
@@ -18396,7 +18526,7 @@ var AmisProvider = function (props) { return __awaiter(void 0, void 0, void 0, f
|
|
|
18396
18526
|
* @Author: baozhoutao@steedos.com
|
|
18397
18527
|
* @Date: 2022-09-01 14:44:57
|
|
18398
18528
|
* @LastEditors: liaodaxue
|
|
18399
|
-
* @LastEditTime: 2023-09-19
|
|
18529
|
+
* @LastEditTime: 2023-09-19 15:20:58
|
|
18400
18530
|
* @Description:
|
|
18401
18531
|
*/
|
|
18402
18532
|
var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -18620,7 +18750,7 @@ var AmisAppLauncher = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
18620
18750
|
"actions": [
|
|
18621
18751
|
{
|
|
18622
18752
|
"actionType": "custom",
|
|
18623
|
-
"script": "\nconst path = context.props.data.path;\ndoAction({\n actionType: '
|
|
18753
|
+
"script": "\nconst path = context.props.data.path;\ndoAction({\n actionType: 'link',\n args: {\n \"url\": path,\n \"blank\": false\n }\n});"
|
|
18624
18754
|
},
|
|
18625
18755
|
{
|
|
18626
18756
|
"actionType": "broadcast",
|
|
@@ -18767,7 +18897,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
18767
18897
|
appId = data.context.appId || 'admin';
|
|
18768
18898
|
}
|
|
18769
18899
|
// console.log(`AmisAppMenu appId`, appId)
|
|
18770
|
-
console.log(
|
|
18900
|
+
// console.log(`AmisAppMenu`, appId, props)
|
|
18771
18901
|
if (links) {
|
|
18772
18902
|
return [2 /*return*/, {
|
|
18773
18903
|
"type": "nav",
|
|
@@ -18783,13 +18913,13 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
18783
18913
|
schemaApi: {
|
|
18784
18914
|
"method": "get",
|
|
18785
18915
|
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
|
|
18786
|
-
"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 "),
|
|
18916
|
+
"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 "),
|
|
18787
18917
|
"headers": {
|
|
18788
18918
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
18789
18919
|
}
|
|
18790
18920
|
}
|
|
18791
18921
|
};
|
|
18792
|
-
console.log(
|
|
18922
|
+
// console.log(`schema=====>`, schema)
|
|
18793
18923
|
return [2 /*return*/, schema];
|
|
18794
18924
|
});
|
|
18795
18925
|
}); };
|
|
@@ -18834,7 +18964,7 @@ var AmisGlobalFooter = function (props) { return __awaiter(void 0, void 0, void
|
|
|
18834
18964
|
schemaApi: {
|
|
18835
18965
|
"method": "get",
|
|
18836
18966
|
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus?mobile=true"),
|
|
18837
|
-
"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-
|
|
18967
|
+
"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 "),
|
|
18838
18968
|
"headers": {
|
|
18839
18969
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
18840
18970
|
}
|
|
@@ -18994,7 +19124,7 @@ var AmisGlobalHeaderToolbar = function (props) { return __awaiter(void 0, void 0
|
|
|
18994
19124
|
"name": "notifications",
|
|
18995
19125
|
"items": {
|
|
18996
19126
|
"type": "tpl",
|
|
18997
|
-
"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-
|
|
19127
|
+
"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>",
|
|
18998
19128
|
"id": "u:07ece657c7b7",
|
|
18999
19129
|
"onEvent": {
|
|
19000
19130
|
"click": {
|
|
@@ -19246,7 +19376,7 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
|
|
|
19246
19376
|
body: [
|
|
19247
19377
|
{
|
|
19248
19378
|
"type": "wrapper",
|
|
19249
|
-
"className": "bg-white sticky p-0 top-0 z-40 w-full flex-none backdrop-blur transition-colors duration-500 lg:z-50
|
|
19379
|
+
"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",
|
|
19250
19380
|
body: [
|
|
19251
19381
|
{
|
|
19252
19382
|
"type": "wrapper",
|
|
@@ -19412,7 +19542,7 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
|
|
|
19412
19542
|
body: [
|
|
19413
19543
|
{
|
|
19414
19544
|
type: "wrapper",
|
|
19415
|
-
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-
|
|
19545
|
+
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',
|
|
19416
19546
|
body: [
|
|
19417
19547
|
{
|
|
19418
19548
|
"type": "steedos-app-launcher",
|
|
@@ -19714,7 +19844,7 @@ var getSelectFlowSchema = function (id, props) {
|
|
|
19714
19844
|
var AmisSelectFlow = function (props) {
|
|
19715
19845
|
//mode: "input-tree" | "tree-select"
|
|
19716
19846
|
var _a = props.mode, mode = _a === void 0 ? "input-tree" : _a, _b = props.id, id = _b === void 0 ? "selectFlow" + random(10000, 99999) : _b;
|
|
19717
|
-
console.log(
|
|
19847
|
+
// console.log(`AmisSelectFlow props`, props);
|
|
19718
19848
|
var inputId = "".concat(id, "_input");
|
|
19719
19849
|
var flowSchema = getSelectFlowSchema(inputId, props);
|
|
19720
19850
|
if (mode === "tree-select") {
|
|
@@ -19801,7 +19931,7 @@ var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, f
|
|
|
19801
19931
|
"showHeader": true,
|
|
19802
19932
|
// "showDisplayAs": (formFactor !== 'SMALL'),
|
|
19803
19933
|
// "formFactor": formFactor,
|
|
19804
|
-
// "className": (displayAs === 'split')? 'w-full': 'p-0 flex-1 m-0 sm:border sm:shadow sm:rounded border-
|
|
19934
|
+
// "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'
|
|
19805
19935
|
};
|
|
19806
19936
|
// const defData = {
|
|
19807
19937
|
// ...$schema.data,
|
|
@@ -19910,7 +20040,7 @@ var PageObject = function (props) { return __awaiter(void 0, void 0, void 0, fun
|
|
|
19910
20040
|
"type": "wrapper",
|
|
19911
20041
|
"size": "none",
|
|
19912
20042
|
"className": {
|
|
19913
|
-
"p-0 flex-shrink-0 min-w-[388px] w-fit
|
|
20043
|
+
"p-0 flex-shrink-0 min-w-[388px] w-fit lg:order-first lg:flex lg:flex-col": "${display == 'split'}",
|
|
19914
20044
|
'h-full': "${display != 'split'}",
|
|
19915
20045
|
},
|
|
19916
20046
|
"body": {
|