@steedos-widgets/amis-object 3.6.2-beta.4 → 3.6.2-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/amis/AmisInputTable.d.ts +1 -0
- package/dist/amis/AmisRecordDetail.d.ts +4 -4
- package/dist/amis/AmisRecordDetailHeader.d.ts +1 -56
- package/dist/amis/AmisRecordDetailMini.d.ts +31 -0
- package/dist/amis/AmisRecordService.d.ts +42 -6
- package/dist/amis/index.d.ts +1 -0
- package/dist/amis-object.cjs.css +124 -14
- package/dist/amis-object.cjs.js +712 -362
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +124 -14
- package/dist/amis-object.esm.js +713 -364
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +124 -14
- package/dist/amis-object.umd.js +214 -182
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +21 -21
- package/dist/meta.js +505 -393
- package/dist/metas/AmisRecordDetailMini.d.ts +2 -0
- package/dist/pages/PageObject.d.ts +1 -0
- package/package.json +3 -3
package/dist/amis-object.cjs.js
CHANGED
|
@@ -4584,9 +4584,9 @@ var frontend_display_type_is_split = "分栏视图";
|
|
|
4584
4584
|
var frontend_display_as = "显示为";
|
|
4585
4585
|
var frontend_record_sum = "个项目";
|
|
4586
4586
|
var frontend_button_reload_tooltip = "刷新";
|
|
4587
|
-
var frontend_button_search_tooltip = "
|
|
4587
|
+
var frontend_button_search_tooltip = "搜索";
|
|
4588
4588
|
var frontend_fields_filter_button_search = "搜索";
|
|
4589
|
-
var frontend_fields_filter_button_settings = "
|
|
4589
|
+
var frontend_fields_filter_button_settings = "选择搜索项";
|
|
4590
4590
|
var frontend_button_listview_control_tooltip = "列表视图控制";
|
|
4591
4591
|
var frontend_button_listview_control_label = "列表视图控制";
|
|
4592
4592
|
var frontend_listview_control_columns = "显示的列";
|
|
@@ -5243,7 +5243,7 @@ async function getTableColumns$1(fields, options){
|
|
|
5243
5243
|
if(field.wrap != true){
|
|
5244
5244
|
className += " whitespace-nowrap ";
|
|
5245
5245
|
}else {
|
|
5246
|
-
className += " break-
|
|
5246
|
+
className += " break-words ";
|
|
5247
5247
|
}
|
|
5248
5248
|
let columnItem;
|
|
5249
5249
|
if((field.is_name || field.name === options.labelFieldName) && options.objectName === 'cms_files'){
|
|
@@ -5679,7 +5679,8 @@ async function getTableOperation(ctx){
|
|
|
5679
5679
|
label: " ",
|
|
5680
5680
|
fixed: 'right',
|
|
5681
5681
|
labelClassName: 'text-center',
|
|
5682
|
-
|
|
5682
|
+
//TODO:目前3.6.3-patch.3版本中对于动态classname处理存在问题,简单处理固定列问题,等待amis解决crud的columns不支持动态classname的问题
|
|
5683
|
+
className: 'text-center steedos-listview-operation w-10 is-sticky is-sticky-right is-sticky-first-right',
|
|
5683
5684
|
buttons: [
|
|
5684
5685
|
{
|
|
5685
5686
|
"type": "steedos-dropdown-button",
|
|
@@ -5775,7 +5776,7 @@ async function getTableSchema$1(fields, options){
|
|
|
5775
5776
|
}
|
|
5776
5777
|
return {
|
|
5777
5778
|
mode: "cards",
|
|
5778
|
-
perPageAvailable: [
|
|
5779
|
+
perPageAvailable: [20, 50, 100, 500],
|
|
5779
5780
|
name: "thelist",
|
|
5780
5781
|
headerToolbarClassName: "py-2 px-2 border-gray-300 border-solid border-b",
|
|
5781
5782
|
className: "",
|
|
@@ -5808,7 +5809,7 @@ async function getTableSchema$1(fields, options){
|
|
|
5808
5809
|
|
|
5809
5810
|
return {
|
|
5810
5811
|
mode: "table",
|
|
5811
|
-
perPageAvailable: [
|
|
5812
|
+
perPageAvailable: [20, 50, 100, 500],
|
|
5812
5813
|
name: "thelist",
|
|
5813
5814
|
headerToolbarClassName: "py-2 px-2 border-gray-300 border-solid border-b",
|
|
5814
5815
|
className: "",
|
|
@@ -6312,12 +6313,21 @@ function getReadonlyFormAdaptor(object, fields, options){
|
|
|
6312
6313
|
}
|
|
6313
6314
|
payload.data = data;
|
|
6314
6315
|
payload.data.__objectName = "${object.name}";
|
|
6315
|
-
payload.data.
|
|
6316
|
+
payload.data.record = record;
|
|
6317
|
+
|
|
6318
|
+
payload.data.NAME_FIELD_VALUE = record.${object.NAME_FIELD_KEY || 'name'};
|
|
6319
|
+
payload.data._master = {
|
|
6320
|
+
record: record,
|
|
6321
|
+
objectName: "${object.name}",
|
|
6322
|
+
recordId: record._id
|
|
6323
|
+
}
|
|
6316
6324
|
window.postMessage(Object.assign({type: "record.loaded"}, {record: record}), "*")
|
|
6317
6325
|
}
|
|
6318
6326
|
if(payload.errors){
|
|
6319
6327
|
payload.status = 2;
|
|
6320
6328
|
payload.msg = payload.errors[0].message;
|
|
6329
|
+
}else{
|
|
6330
|
+
payload.data.recordLoaded = true;
|
|
6321
6331
|
}
|
|
6322
6332
|
${options && options.initApiAdaptor || ''}
|
|
6323
6333
|
return payload;
|
|
@@ -6460,7 +6470,7 @@ async function getEditFormInitApi(object, recordId, fields, options){
|
|
|
6460
6470
|
cache: API_CACHE,
|
|
6461
6471
|
requestAdaptor: `
|
|
6462
6472
|
// 所有不想在network请求中发送的数据都应该从data中分离出来,data变量只需要留下query才需要发送出去
|
|
6463
|
-
var { recordId, objectName, uiSchema, global, context, ...data} = api.data;
|
|
6473
|
+
var { recordId, objectName, uiSchema, global, context, _master, ...data} = api.data;
|
|
6464
6474
|
if(!recordId){
|
|
6465
6475
|
// 新建则不请求任何数据
|
|
6466
6476
|
data.query = "{data:" + objectName + "(filters: " + JSON.stringify(["_id", "=", null]) + ", top: 1){_id}}";
|
|
@@ -6535,15 +6545,17 @@ async function getEditFormInitApi(object, recordId, fields, options){
|
|
|
6535
6545
|
}
|
|
6536
6546
|
// data下的变量需要在保存接口(getSaveApi)中被删除。
|
|
6537
6547
|
payload.data = {
|
|
6538
|
-
...initialValues
|
|
6548
|
+
...initialValues,
|
|
6549
|
+
editFormInited: true
|
|
6539
6550
|
}
|
|
6540
6551
|
${options.initApiAdaptor || ''}
|
|
6552
|
+
// console.log('getEditFormInitApi======>', payload);
|
|
6541
6553
|
return payload;
|
|
6542
6554
|
`,
|
|
6543
|
-
responseData: {
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
},
|
|
6555
|
+
// responseData: {
|
|
6556
|
+
// initialValues: "$$",
|
|
6557
|
+
// editFormInited: true
|
|
6558
|
+
// },
|
|
6547
6559
|
data: data,
|
|
6548
6560
|
headers: {
|
|
6549
6561
|
Authorization: "Bearer ${context.tenantId},${context.authToken}"
|
|
@@ -8294,7 +8306,7 @@ const StandardButtons = {
|
|
|
8294
8306
|
}
|
|
8295
8307
|
};
|
|
8296
8308
|
|
|
8297
|
-
const getGlobalData
|
|
8309
|
+
const getGlobalData = () => {
|
|
8298
8310
|
return {
|
|
8299
8311
|
now: new Date(),
|
|
8300
8312
|
};
|
|
@@ -8353,7 +8365,7 @@ const getButtonVisible = (button, ctx) => {
|
|
|
8353
8365
|
button._visible,
|
|
8354
8366
|
props.record,
|
|
8355
8367
|
"#",
|
|
8356
|
-
getGlobalData
|
|
8368
|
+
getGlobalData(),
|
|
8357
8369
|
props.userSession
|
|
8358
8370
|
);
|
|
8359
8371
|
};
|
|
@@ -9731,6 +9743,48 @@ function getObjectListHeader$1(objectSchema, listViewName, ctx) {
|
|
|
9731
9743
|
return headerSchema;
|
|
9732
9744
|
}
|
|
9733
9745
|
|
|
9746
|
+
function getBackButtonSchema(){
|
|
9747
|
+
return {
|
|
9748
|
+
"type": "service",
|
|
9749
|
+
"onEvent": {
|
|
9750
|
+
"@history_paths.changed": {
|
|
9751
|
+
"actions": [
|
|
9752
|
+
{
|
|
9753
|
+
"actionType": "reload",
|
|
9754
|
+
// amis 3.6需要传入data来触发下面的window:historyPaths重新计算,此问题随机偶发,加上data后正常
|
|
9755
|
+
"data": {
|
|
9756
|
+
}
|
|
9757
|
+
}
|
|
9758
|
+
]
|
|
9759
|
+
}
|
|
9760
|
+
},
|
|
9761
|
+
"body":[{
|
|
9762
|
+
"type": "button",
|
|
9763
|
+
"visibleOn": "${window:innerWidth > 768 && (window:historyPaths.length > 1 || window:historyPaths[0].params.record_id) && display !== 'split'}",
|
|
9764
|
+
"className":"flex mr-4",
|
|
9765
|
+
"onEvent": {
|
|
9766
|
+
"click": {
|
|
9767
|
+
"actions": [
|
|
9768
|
+
{
|
|
9769
|
+
"actionType": "custom",
|
|
9770
|
+
"script": "window.goBack()"
|
|
9771
|
+
}
|
|
9772
|
+
]
|
|
9773
|
+
}
|
|
9774
|
+
},
|
|
9775
|
+
"body": [
|
|
9776
|
+
{
|
|
9777
|
+
"type": "steedos-icon",
|
|
9778
|
+
"category": "utility",
|
|
9779
|
+
"name": "back",
|
|
9780
|
+
"colorVariant": "default",
|
|
9781
|
+
"className": "slds-button_icon slds-global-header__icon w-4"
|
|
9782
|
+
}
|
|
9783
|
+
]
|
|
9784
|
+
}]
|
|
9785
|
+
}
|
|
9786
|
+
}
|
|
9787
|
+
|
|
9734
9788
|
/**
|
|
9735
9789
|
* 记录详细界面顶部头amisSchema,也是标题面板组件的amisSchema
|
|
9736
9790
|
* @param {*} objectSchema 对象UISchema
|
|
@@ -9739,11 +9793,21 @@ function getObjectListHeader$1(objectSchema, listViewName, ctx) {
|
|
|
9739
9793
|
* @returns amisSchema
|
|
9740
9794
|
*/
|
|
9741
9795
|
async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
9796
|
+
// console.log(`getObjectRecordDetailHeader====>`, options)
|
|
9742
9797
|
const { showRecordTitle = true } = options || {};
|
|
9743
9798
|
// console.log('getObjectRecordDetailHeader==>', objectSchema, recordId)
|
|
9744
9799
|
const { name, label, icon, NAME_FIELD_KEY } = objectSchema;
|
|
9745
9800
|
|
|
9746
|
-
let amisButtonsSchema =
|
|
9801
|
+
let amisButtonsSchema = [];
|
|
9802
|
+
if(options.showButtons != false){
|
|
9803
|
+
amisButtonsSchema = getObjectDetailButtonsSchemas(objectSchema, recordId, options);
|
|
9804
|
+
}
|
|
9805
|
+
|
|
9806
|
+
let backButtonsSchema = null;
|
|
9807
|
+
|
|
9808
|
+
if(options.showBackButton != false){
|
|
9809
|
+
backButtonsSchema = getBackButtonSchema();
|
|
9810
|
+
}
|
|
9747
9811
|
|
|
9748
9812
|
// console.log(`getObjectRecordDetailHeader==>`, amisButtonsSchema)
|
|
9749
9813
|
|
|
@@ -9758,45 +9822,9 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
|
9758
9822
|
"type": "grid",
|
|
9759
9823
|
"columns": [
|
|
9760
9824
|
{
|
|
9761
|
-
"body": [
|
|
9762
|
-
|
|
9763
|
-
|
|
9764
|
-
"@history_paths.changed": {
|
|
9765
|
-
"actions": [
|
|
9766
|
-
{
|
|
9767
|
-
"actionType": "reload",
|
|
9768
|
-
// amis 3.6需要传入data来触发下面的window:historyPaths重新计算,此问题随机偶发,加上data后正常
|
|
9769
|
-
"data": {
|
|
9770
|
-
}
|
|
9771
|
-
}
|
|
9772
|
-
]
|
|
9773
|
-
}
|
|
9774
|
-
},
|
|
9775
|
-
"body":[{
|
|
9776
|
-
"type": "button",
|
|
9777
|
-
"visibleOn": "${window:innerWidth > 768 && (window:historyPaths.length > 1 || window:historyPaths[0].params.record_id) && display !== 'split'}",
|
|
9778
|
-
"className":"flex mr-4",
|
|
9779
|
-
"onEvent": {
|
|
9780
|
-
"click": {
|
|
9781
|
-
"actions": [
|
|
9782
|
-
{
|
|
9783
|
-
"actionType": "custom",
|
|
9784
|
-
"script": "window.goBack()"
|
|
9785
|
-
}
|
|
9786
|
-
]
|
|
9787
|
-
}
|
|
9788
|
-
},
|
|
9789
|
-
"body": [
|
|
9790
|
-
{
|
|
9791
|
-
"type": "steedos-icon",
|
|
9792
|
-
"category": "utility",
|
|
9793
|
-
"name": "back",
|
|
9794
|
-
"colorVariant": "default",
|
|
9795
|
-
"className": "slds-button_icon slds-global-header__icon w-4"
|
|
9796
|
-
}
|
|
9797
|
-
]
|
|
9798
|
-
}]
|
|
9799
|
-
},{
|
|
9825
|
+
"body": [
|
|
9826
|
+
backButtonsSchema
|
|
9827
|
+
,{
|
|
9800
9828
|
"type": "tpl",
|
|
9801
9829
|
"className": "block",
|
|
9802
9830
|
// "tpl": `<img class='slds-icon slds-icon_container slds-icon-standard-${standardIcon}' src='\${context.rootUrl}/unpkg.com/@salesforce-ux/design-system/assets/icons/standard/${icon}.svg'>`
|
|
@@ -9817,8 +9845,7 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
|
9817
9845
|
},
|
|
9818
9846
|
{
|
|
9819
9847
|
"type": "tpl",
|
|
9820
|
-
"tpl": "${
|
|
9821
|
-
// "tpl": "${(record && uiSchema && record[uiSchema.NAME_FIELD_KEY]) || name}",
|
|
9848
|
+
"tpl": "${NAME_FIELD_VALUE}",
|
|
9822
9849
|
"inline": false,
|
|
9823
9850
|
"wrapperComponent": "",
|
|
9824
9851
|
"className": "record-detail-header-name leading-5 text-xl font-bold"
|
|
@@ -9846,7 +9873,7 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
|
9846
9873
|
let body = [
|
|
9847
9874
|
{
|
|
9848
9875
|
"type": "wrapper",
|
|
9849
|
-
"className": "p-
|
|
9876
|
+
"className": "p-4",
|
|
9850
9877
|
"body": [
|
|
9851
9878
|
{
|
|
9852
9879
|
"type": "grid",
|
|
@@ -9861,7 +9888,7 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
|
9861
9888
|
if(showRecordTitle){
|
|
9862
9889
|
body.push({
|
|
9863
9890
|
"type": "wrapper",
|
|
9864
|
-
"className": "p-
|
|
9891
|
+
"className": "p-4",
|
|
9865
9892
|
"body": [
|
|
9866
9893
|
{
|
|
9867
9894
|
"type": "grid",
|
|
@@ -9873,11 +9900,38 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
|
9873
9900
|
});
|
|
9874
9901
|
}
|
|
9875
9902
|
|
|
9903
|
+
let max = 10;
|
|
9904
|
+
if(options.formFactor === 'SMALL'){
|
|
9905
|
+
max = 4;
|
|
9906
|
+
}
|
|
9907
|
+
|
|
9908
|
+
if(objectSchema.compactLayouts){
|
|
9909
|
+
const details = [];
|
|
9910
|
+
_.each(_.slice(_.difference(objectSchema.compactLayouts, [objectSchema.NAME_FIELD_KEY]), 0, max), (fieldName)=>{
|
|
9911
|
+
const field = objectSchema.fields[fieldName];
|
|
9912
|
+
if(field){
|
|
9913
|
+
details.push({
|
|
9914
|
+
type: 'steedos-field',
|
|
9915
|
+
static: true,
|
|
9916
|
+
config: field,
|
|
9917
|
+
});
|
|
9918
|
+
}
|
|
9919
|
+
});
|
|
9920
|
+
|
|
9921
|
+
body.push({
|
|
9922
|
+
"type": "form",
|
|
9923
|
+
"className": "p-4 pb-0 bg-white compact-layouts",
|
|
9924
|
+
"wrapWithPanel": false,
|
|
9925
|
+
"actions": [],
|
|
9926
|
+
"body": details,
|
|
9927
|
+
"hiddenOn": "${recordLoaded != true}"
|
|
9928
|
+
});
|
|
9929
|
+
}
|
|
9930
|
+
|
|
9876
9931
|
return {
|
|
9877
9932
|
type: 'service',
|
|
9878
9933
|
id: `page_readonly_${name}_header`,
|
|
9879
9934
|
name: `page`,
|
|
9880
|
-
data: { objectName: name, _id: recordId, recordPermissions: objectSchema.permissions, uiSchema: objectSchema, record: "${record}" },
|
|
9881
9935
|
body: body,
|
|
9882
9936
|
className: ''
|
|
9883
9937
|
}
|
|
@@ -11084,7 +11138,7 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
11084
11138
|
{
|
|
11085
11139
|
"type": "search-box",
|
|
11086
11140
|
"name": keywordsSearchBoxName,
|
|
11087
|
-
"placeholder": "
|
|
11141
|
+
"placeholder": "快捷搜索",
|
|
11088
11142
|
"value": crudKeywords,
|
|
11089
11143
|
// "clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
|
|
11090
11144
|
"clearAndSubmit": true,
|
|
@@ -11685,7 +11739,9 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
11685
11739
|
return payload;
|
|
11686
11740
|
`
|
|
11687
11741
|
},
|
|
11688
|
-
rowClassNameExpr
|
|
11742
|
+
// 外层data发生变化的时候, 不会重新渲染rowClassNameExpr, 所以先用css标记tr唯一标识
|
|
11743
|
+
// 使用表达式给tr添加初始选中状态
|
|
11744
|
+
rowClassNameExpr: options.rowClassNameExpr || "<%= data._id === data.recordId ? 'steedos-record-tr steedos-record-tr-' + data._id + ' steedos-record-selected' : 'steedos-record-tr steedos-record-tr-' + data._id %>"
|
|
11689
11745
|
}, bodyProps);
|
|
11690
11746
|
|
|
11691
11747
|
}
|
|
@@ -11700,7 +11756,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
11700
11756
|
|
|
11701
11757
|
if(body.columns && options.formFactor != 'SMALL'){
|
|
11702
11758
|
//将_display放入crud的columns的倒数第二列中(最后一列会影响固定列),可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
|
|
11703
|
-
body.columns.splice(body.columns.length -
|
|
11759
|
+
body.columns.splice(body.columns.length -1 , 0, {name: '_display',type: 'static', width: 1, placeholder: "",id: objectSchema.name + "_display_${_index}", tpl: "${''}"});
|
|
11704
11760
|
}
|
|
11705
11761
|
|
|
11706
11762
|
if (defaults) {
|
|
@@ -11758,11 +11814,6 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
11758
11814
|
}
|
|
11759
11815
|
}
|
|
11760
11816
|
|
|
11761
|
-
const getGlobalData = (mode)=>{
|
|
11762
|
-
const user = getSteedosAuth();
|
|
11763
|
-
return {mode: mode, user: user, spaceId: user.spaceId, userId: user.userId}
|
|
11764
|
-
};
|
|
11765
|
-
|
|
11766
11817
|
const getFormFields$1 = (objectSchema, formProps)=>{
|
|
11767
11818
|
/**
|
|
11768
11819
|
* fieldsExtend: 重写字段定义
|
|
@@ -11840,9 +11891,7 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
11840
11891
|
id: `service_${formSchema.id}`,
|
|
11841
11892
|
className: 'p-0',
|
|
11842
11893
|
name: `page_edit_${recordId}`,
|
|
11843
|
-
api: await getEditFormInitApi(objectSchema, recordId, fields, ctx),
|
|
11844
11894
|
data:{
|
|
11845
|
-
editFormInited: false,
|
|
11846
11895
|
...amisData
|
|
11847
11896
|
},
|
|
11848
11897
|
// data: {global: getGlobalData('edit'), recordId: recordId, objectName: objectSchema.name, context: {rootUrl: getRootUrl(), tenantId: getTenantId(), authToken: getAuthToken()}},
|
|
@@ -11851,8 +11900,9 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
11851
11900
|
body: [defaultsDeep({}, formSchema, {
|
|
11852
11901
|
type: "form",
|
|
11853
11902
|
mode: layout,
|
|
11903
|
+
initApi: await getEditFormInitApi(objectSchema, recordId, fields, ctx),
|
|
11854
11904
|
data: {
|
|
11855
|
-
|
|
11905
|
+
editFormInited: false,
|
|
11856
11906
|
},
|
|
11857
11907
|
labelAlign,
|
|
11858
11908
|
persistData: false,
|
|
@@ -11866,11 +11916,15 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
11866
11916
|
submitText: "", // amis 表单不显示提交按钮, 表单提交由项目代码接管
|
|
11867
11917
|
api: await getSaveApi(objectSchema, recordId, fields, ctx),
|
|
11868
11918
|
initFetch: recordId != 'new',
|
|
11869
|
-
body:
|
|
11919
|
+
body: {
|
|
11920
|
+
type: 'wrapper',
|
|
11921
|
+
className: 'p-0 m-0',
|
|
11922
|
+
body: await getFormBody(fields, formFields, Object.assign({}, ctx, {fieldGroups: objectSchema.field_groups})),
|
|
11923
|
+
hiddenOn: "${editFormInited != true}",
|
|
11924
|
+
},
|
|
11870
11925
|
panelClassName:'m-0 sm:rounded-lg shadow-none border-none',
|
|
11871
11926
|
bodyClassName: 'p-0',
|
|
11872
11927
|
className: 'steedos-amis-form',
|
|
11873
|
-
hiddenOn: "${editFormInited != true}",
|
|
11874
11928
|
onEvent: {
|
|
11875
11929
|
"submitSucc": {
|
|
11876
11930
|
"weight": 0,
|
|
@@ -11924,8 +11978,7 @@ async function getObjectDetail(objectSchema, recordId, ctx){
|
|
|
11924
11978
|
type: 'service',
|
|
11925
11979
|
name: `page_readonly_${recordId}`,
|
|
11926
11980
|
id: serviceId,
|
|
11927
|
-
|
|
11928
|
-
api: await getReadonlyFormInitApi(objectSchema, recordId, fields, ctx),
|
|
11981
|
+
// api: await getReadonlyFormInitApi(objectSchema, recordId, fields, ctx),
|
|
11929
11982
|
body: [
|
|
11930
11983
|
{
|
|
11931
11984
|
"type": "wrapper", //form 的 hiddenOn 会导致 form onEvent 异常, 使用wrapper包裹一次form,并在wrapper上控制显隐
|
|
@@ -11951,60 +12004,41 @@ async function getObjectDetail(objectSchema, recordId, ctx){
|
|
|
11951
12004
|
),
|
|
11952
12005
|
className: 'steedos-amis-form bg-white',
|
|
11953
12006
|
actions: [], // 不显示表单默认的提交按钮
|
|
11954
|
-
onEvent: {
|
|
11955
|
-
[`@data.changed.${objectSchema.name}`]: { // 由于amis service 组件的 onEvent 存在bug ,此处借助form来刷新 上层 service https://github.com/baidu/amis/issues/6294
|
|
11956
|
-
"actions": [
|
|
11957
|
-
{
|
|
11958
|
-
"actionType": "reload",
|
|
11959
|
-
"componentId": serviceId,
|
|
11960
|
-
"expression": "this.__deletedRecord != true"
|
|
11961
|
-
},
|
|
11962
|
-
{
|
|
11963
|
-
// "args": {
|
|
11964
|
-
// "url": "/app/${appId}/${objectName}/grid/${side_listview_id}",
|
|
11965
|
-
// "blank": false
|
|
11966
|
-
// },
|
|
11967
|
-
"actionType": "custom",
|
|
11968
|
-
"script": "window.goBack()",
|
|
11969
|
-
"expression": "this.__deletedRecord === true"
|
|
11970
|
-
}
|
|
11971
|
-
]
|
|
11972
|
-
}
|
|
11973
|
-
}
|
|
11974
12007
|
},
|
|
11975
12008
|
}
|
|
11976
12009
|
],
|
|
11977
|
-
onEvent: {
|
|
11978
|
-
|
|
11979
|
-
|
|
11980
|
-
|
|
11981
|
-
|
|
11982
|
-
|
|
11983
|
-
|
|
11984
|
-
|
|
11985
|
-
|
|
11986
|
-
|
|
11987
|
-
|
|
11988
|
-
|
|
11989
|
-
|
|
11990
|
-
|
|
11991
|
-
|
|
11992
|
-
|
|
11993
|
-
|
|
11994
|
-
|
|
11995
|
-
|
|
11996
|
-
|
|
11997
|
-
|
|
11998
|
-
|
|
11999
|
-
|
|
12000
|
-
|
|
12001
|
-
|
|
12002
|
-
|
|
12003
|
-
|
|
12004
|
-
}
|
|
12010
|
+
// onEvent: {
|
|
12011
|
+
// "fetchInited": {
|
|
12012
|
+
// "weight": 0,
|
|
12013
|
+
// "actions": [
|
|
12014
|
+
// {
|
|
12015
|
+
// actionType: 'broadcast',
|
|
12016
|
+
// eventName: "recordLoaded",
|
|
12017
|
+
// args: {
|
|
12018
|
+
// eventName: "recordLoaded"
|
|
12019
|
+
// },
|
|
12020
|
+
// data: {
|
|
12021
|
+
// objectName: "${event.data.__objectName}",
|
|
12022
|
+
// record: "${event.data.__record}"
|
|
12023
|
+
// },
|
|
12024
|
+
// expression: "${event.data.__response.error != true}"
|
|
12025
|
+
// },
|
|
12026
|
+
// {
|
|
12027
|
+
// "actionType": "setValue",
|
|
12028
|
+
// "args": {
|
|
12029
|
+
// value: {
|
|
12030
|
+
// "recordLoaded": true,
|
|
12031
|
+
// }
|
|
12032
|
+
// },
|
|
12033
|
+
// expression: "${event.data.__response.error != true}"
|
|
12034
|
+
// }
|
|
12035
|
+
// ]
|
|
12036
|
+
// }
|
|
12037
|
+
// }
|
|
12005
12038
|
};
|
|
12006
12039
|
|
|
12007
12040
|
amisSchema.body[0].body = await getFormSchemaWithDataFilter(amisSchema.body[0].body, { formDataFilter, onFormDataFilter, amisData, env });
|
|
12041
|
+
// console.log('getObjectDetail=====>', amisSchema);
|
|
12008
12042
|
return amisSchema;
|
|
12009
12043
|
}
|
|
12010
12044
|
|
|
@@ -12084,8 +12118,8 @@ const getRecordPermissions = async (objectName, recordId)=>{
|
|
|
12084
12118
|
/*
|
|
12085
12119
|
* @Author: baozhoutao@steedos.com
|
|
12086
12120
|
* @Date: 2022-07-05 15:55:39
|
|
12087
|
-
* @LastEditors:
|
|
12088
|
-
* @LastEditTime:
|
|
12121
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
12122
|
+
* @LastEditTime: 2024-01-15 10:34:46
|
|
12089
12123
|
* @Description:
|
|
12090
12124
|
*/
|
|
12091
12125
|
|
|
@@ -12465,11 +12499,44 @@ async function getRelatedListSchema(
|
|
|
12465
12499
|
};
|
|
12466
12500
|
}
|
|
12467
12501
|
|
|
12502
|
+
async function getObjectRelatedListsMiniSchema(objectApiName){
|
|
12503
|
+
const relatedLists = await getObjectRelatedList(objectApiName);
|
|
12504
|
+
|
|
12505
|
+
const relatedListsMiniSchema = [];
|
|
12506
|
+
|
|
12507
|
+
for (const relatedList of relatedLists) {
|
|
12508
|
+
relatedListsMiniSchema.push(
|
|
12509
|
+
{
|
|
12510
|
+
type: 'steedos-record-detail-list-mini',
|
|
12511
|
+
objectApiName: objectApiName,
|
|
12512
|
+
// recordId: recordId,
|
|
12513
|
+
formFactor: formFactor,
|
|
12514
|
+
relatedObjectApiName: relatedList.object_name,
|
|
12515
|
+
foreign_key: relatedList.foreign_key,
|
|
12516
|
+
relatedKey: relatedList.foreign_key,
|
|
12517
|
+
columns: relatedList.columns,
|
|
12518
|
+
sort: relatedList.sort,
|
|
12519
|
+
filters: relatedList.filters,
|
|
12520
|
+
visible_on: relatedList.visible_on,
|
|
12521
|
+
perPage: relatedList.page_size || perPage,
|
|
12522
|
+
hiddenEmptyTable: true,
|
|
12523
|
+
relatedLabel: relatedList.label
|
|
12524
|
+
}
|
|
12525
|
+
);
|
|
12526
|
+
}
|
|
12527
|
+
|
|
12528
|
+
return {
|
|
12529
|
+
type: 'wrapper',
|
|
12530
|
+
className: "steedos-record-detail-related-lists-mini",
|
|
12531
|
+
body: relatedListsMiniSchema
|
|
12532
|
+
}
|
|
12533
|
+
}
|
|
12534
|
+
|
|
12468
12535
|
/*
|
|
12469
12536
|
* @Author: baozhoutao@steedos.com
|
|
12470
12537
|
* @Date: 2022-07-05 15:55:39
|
|
12471
|
-
* @LastEditors:
|
|
12472
|
-
* @LastEditTime:
|
|
12538
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
12539
|
+
* @LastEditTime: 2024-01-16 11:14:34
|
|
12473
12540
|
* @Description:
|
|
12474
12541
|
*/
|
|
12475
12542
|
|
|
@@ -12641,7 +12708,7 @@ async function getField(objectName, fieldName) {
|
|
|
12641
12708
|
async function getFormSchema(objectName, ctx) {
|
|
12642
12709
|
const uiSchema = await getUISchema(objectName);
|
|
12643
12710
|
const amisSchema = await getObjectForm(uiSchema, ctx);
|
|
12644
|
-
console.log(`getFormSchema====>`, amisSchema)
|
|
12711
|
+
// console.log(`getFormSchema====>`, amisSchema)
|
|
12645
12712
|
return {
|
|
12646
12713
|
uiSchema,
|
|
12647
12714
|
amisSchema,
|
|
@@ -12999,78 +13066,136 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
|
|
|
12999
13066
|
if(relatedLists.length){
|
|
13000
13067
|
content.tabs.push(related);
|
|
13001
13068
|
}
|
|
13069
|
+
content.tabs = _$1.reverse(content.tabs);
|
|
13002
13070
|
return {
|
|
13003
13071
|
uiSchema,
|
|
13004
13072
|
amisSchema: {
|
|
13005
|
-
"type": "service",
|
|
13073
|
+
"type": "steedos-record-service",
|
|
13006
13074
|
"body": [
|
|
13007
13075
|
{
|
|
13008
13076
|
"type": "steedos-record-detail-header",
|
|
13009
13077
|
"label": "标题面板",
|
|
13010
13078
|
"objectApiName": "${objectName}",
|
|
13011
13079
|
"recordId": "${recordId}",
|
|
13012
|
-
"id": "u:48d2c28eb755"
|
|
13080
|
+
"id": "u:48d2c28eb755",
|
|
13081
|
+
"showButtons": props.showButtons,
|
|
13082
|
+
"showBackButton": props.showBackButton,
|
|
13013
13083
|
},
|
|
13014
13084
|
content
|
|
13015
13085
|
],
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
|
|
13019
|
-
},
|
|
13020
|
-
onEvent: {
|
|
13021
|
-
"recordLoaded": {
|
|
13022
|
-
"actions": [
|
|
13023
|
-
{
|
|
13024
|
-
"actionType": "reload",
|
|
13025
|
-
"data": {
|
|
13026
|
-
"name": `\${record.${uiSchema.NAME_FIELD_KEY || 'name'}}`,
|
|
13027
|
-
"_master.record": `\${record}`,
|
|
13028
|
-
// 不清楚reload 如何给对象下的某个key复制, 所以此处重复设置_master的objectName、recordId
|
|
13029
|
-
"_master.objectName": "${objectName}",
|
|
13030
|
-
"_master.recordId": "${recordId}"
|
|
13031
|
-
}
|
|
13032
|
-
}
|
|
13033
|
-
]
|
|
13034
|
-
},
|
|
13035
|
-
...props.onEvent
|
|
13036
|
-
},
|
|
13086
|
+
"objectApiName": "${objectName}",
|
|
13087
|
+
"recordId": "${recordId}",
|
|
13088
|
+
onEvent: props.onEvent,
|
|
13037
13089
|
}
|
|
13038
13090
|
}
|
|
13039
13091
|
}
|
|
13040
13092
|
|
|
13041
|
-
async function getRecordServiceSchema(objectName, appId, props = {}) {
|
|
13093
|
+
async function getRecordServiceSchema(objectName, appId, props = {}, body) {
|
|
13042
13094
|
const uiSchema = await getUISchema(objectName);
|
|
13095
|
+
const fields = _$1__default["default"].values(uiSchema.fields);
|
|
13096
|
+
const serviceId = `u:steedos-record-service-${objectName}`;
|
|
13043
13097
|
return {
|
|
13044
13098
|
uiSchema,
|
|
13045
13099
|
amisSchema: {
|
|
13046
|
-
|
|
13047
|
-
"
|
|
13048
|
-
data: {
|
|
13049
|
-
"_master.objectName": "${objectName}",
|
|
13050
|
-
"_master.recordId": "${recordId}"
|
|
13051
|
-
},
|
|
13052
|
-
"style": {
|
|
13053
|
-
"padding": "var(--Page-body-padding)",
|
|
13054
|
-
...props.style
|
|
13055
|
-
},
|
|
13100
|
+
type: 'service',
|
|
13101
|
+
className: "p-0 m-0",
|
|
13056
13102
|
onEvent: {
|
|
13057
|
-
|
|
13103
|
+
[`@data.changed.${objectName}`]: {
|
|
13058
13104
|
"actions": [
|
|
13059
13105
|
{
|
|
13060
13106
|
"actionType": "reload",
|
|
13061
|
-
"
|
|
13062
|
-
|
|
13063
|
-
|
|
13064
|
-
|
|
13065
|
-
|
|
13066
|
-
|
|
13067
|
-
|
|
13107
|
+
"componentId": serviceId,
|
|
13108
|
+
"expression": "this.__deletedRecord != true"
|
|
13109
|
+
},
|
|
13110
|
+
{
|
|
13111
|
+
"actionType": "custom",
|
|
13112
|
+
"script": "window.goBack()",
|
|
13113
|
+
"expression": "this.__deletedRecord === true"
|
|
13068
13114
|
}
|
|
13069
13115
|
]
|
|
13070
13116
|
},
|
|
13071
|
-
|
|
13117
|
+
},
|
|
13118
|
+
body: {
|
|
13119
|
+
"type": "service",
|
|
13120
|
+
id: serviceId,
|
|
13121
|
+
className: 'steedos-record-service p-0 md:p-2',
|
|
13122
|
+
api: await getReadonlyFormInitApi(uiSchema, props.recordId, fields, props),
|
|
13123
|
+
body: {
|
|
13124
|
+
"type": "wrapper",
|
|
13125
|
+
"className": "p-0 m-0",
|
|
13126
|
+
"body": body || [],
|
|
13127
|
+
"hiddenOn": "${recordLoaded != true}"
|
|
13128
|
+
},
|
|
13129
|
+
data: {
|
|
13130
|
+
"_master.objectName": "${objectName}",
|
|
13131
|
+
"_master.recordId": "${recordId}",
|
|
13132
|
+
...(props.data || {})
|
|
13133
|
+
},
|
|
13134
|
+
"style": {
|
|
13135
|
+
// "padding": "var(--Page-body-padding)",
|
|
13136
|
+
...props.style
|
|
13137
|
+
},
|
|
13138
|
+
onEvent: {
|
|
13139
|
+
// 如果定义了fetchInited,则无法接收到广播事件@data.changed
|
|
13140
|
+
"fetchInited": {
|
|
13141
|
+
"weight": 0,
|
|
13142
|
+
"actions": [
|
|
13143
|
+
{
|
|
13144
|
+
actionType: 'broadcast',
|
|
13145
|
+
eventName: "recordLoaded",
|
|
13146
|
+
data: {
|
|
13147
|
+
objectName: "${event.data.__objectName}",
|
|
13148
|
+
record: "${event.data.record}"
|
|
13149
|
+
},
|
|
13150
|
+
expression: "${event.data.__response.error != true}"
|
|
13151
|
+
},
|
|
13152
|
+
]
|
|
13153
|
+
},
|
|
13154
|
+
...props.onEvent
|
|
13155
|
+
}
|
|
13072
13156
|
}
|
|
13073
13157
|
}
|
|
13158
|
+
|
|
13159
|
+
|
|
13160
|
+
}
|
|
13161
|
+
}
|
|
13162
|
+
|
|
13163
|
+
async function getRecordDetailMiniSchema(objectName, appId, props = {}){
|
|
13164
|
+
const uiSchema = await getUISchema(objectName);
|
|
13165
|
+
const fields = _$1__default["default"].values(uiSchema.fields);
|
|
13166
|
+
|
|
13167
|
+
props.initApiAdaptor = 'payload.data=Object.assign({}, payload.data, payload.data.record); payload.data._finished=true; console.log("payload data is ====>", payload)';
|
|
13168
|
+
|
|
13169
|
+
// TODO 处理相关表
|
|
13170
|
+
// getObjectRelatedListsMiniSchema
|
|
13171
|
+
|
|
13172
|
+
return {
|
|
13173
|
+
type: "form",
|
|
13174
|
+
wrapWithPanel: false,
|
|
13175
|
+
actions: [],
|
|
13176
|
+
initApi: await getReadonlyFormInitApi(uiSchema, props.recordId, fields, props),
|
|
13177
|
+
body: {
|
|
13178
|
+
"type": "wrapper",
|
|
13179
|
+
"className": "p-0 m-0",
|
|
13180
|
+
"body": [
|
|
13181
|
+
{
|
|
13182
|
+
"type": "steedos-record-detail-header",
|
|
13183
|
+
"showButtons": false,
|
|
13184
|
+
"showBackButton": false,
|
|
13185
|
+
"objectApiName": "${objectName}",
|
|
13186
|
+
"recordId": "${recordId}",
|
|
13187
|
+
},
|
|
13188
|
+
// {
|
|
13189
|
+
// "type": "steedos-object-related-lists",
|
|
13190
|
+
// "label": "相关列表",
|
|
13191
|
+
// "objectApiName": "${objectName}",
|
|
13192
|
+
// "staticRecordId": "${recordId}",
|
|
13193
|
+
// formFactor: "SMALL",
|
|
13194
|
+
// appId: appId
|
|
13195
|
+
// }
|
|
13196
|
+
],
|
|
13197
|
+
"hiddenOn": "${_finished != true}"
|
|
13198
|
+
}
|
|
13074
13199
|
}
|
|
13075
13200
|
}
|
|
13076
13201
|
|
|
@@ -14221,7 +14346,8 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
14221
14346
|
labelField: referenceTo.labelField.name,
|
|
14222
14347
|
valueField: referenceTo.valueField.name,
|
|
14223
14348
|
// disabledOn: this._master目的是相关表新建时禁止编辑关联字段; this.relatedKey目的是相关表编辑时禁止编辑关联字段,多选字段可以编辑。
|
|
14224
|
-
disabledOn: `${readonly}
|
|
14349
|
+
disabledOn: `${readonly}`,
|
|
14350
|
+
hiddenOn: `( (this._master && (this._master.relatedKey ==='${field.name}')) || ((this.relatedKey ==='${field.name}') && (${field.multiple} != true)) )`,
|
|
14225
14351
|
modalMode: 'dialog', //TODO 设置 dialog 或者 drawer,用来配置弹出方式
|
|
14226
14352
|
source: source,
|
|
14227
14353
|
size: "lg",
|
|
@@ -14465,9 +14591,15 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
14465
14591
|
// console.log(`lookupToAmis====`, field, readonly, ctx)
|
|
14466
14592
|
if(readonly){
|
|
14467
14593
|
return {
|
|
14468
|
-
type:
|
|
14469
|
-
|
|
14594
|
+
type: 'steedos-field',
|
|
14595
|
+
config: field,
|
|
14596
|
+
static: true
|
|
14470
14597
|
}
|
|
14598
|
+
|
|
14599
|
+
// return {
|
|
14600
|
+
// type: Field.getAmisStaticFieldType('picker', readonly),
|
|
14601
|
+
// tpl: Tpl.getRelatedFieldTpl(field, ctx)
|
|
14602
|
+
// }
|
|
14471
14603
|
}
|
|
14472
14604
|
if(field.reference_to && !_$1__namespace.isString(field.reference_to) && !readonly){
|
|
14473
14605
|
return {
|
|
@@ -15460,11 +15592,9 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
15460
15592
|
if(field.subFields){
|
|
15461
15593
|
convertData = {
|
|
15462
15594
|
type: 'steedos-input-table',
|
|
15463
|
-
showIndex: true,
|
|
15464
15595
|
editable: !readonly,
|
|
15465
15596
|
addable: !readonly,
|
|
15466
15597
|
removable: !readonly,
|
|
15467
|
-
draggable: !readonly,
|
|
15468
15598
|
fields: [],
|
|
15469
15599
|
amis:{
|
|
15470
15600
|
columnsTogglable: false
|
|
@@ -15922,7 +16052,7 @@ async function getFormBody(permissionFields, formFields, ctx){
|
|
|
15922
16052
|
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
15923
16053
|
* @Date: 2023-11-15 09:50:22
|
|
15924
16054
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
15925
|
-
* @LastEditTime: 2024-01-14
|
|
16055
|
+
* @LastEditTime: 2024-01-16 14:58:51
|
|
15926
16056
|
*/
|
|
15927
16057
|
|
|
15928
16058
|
/**
|
|
@@ -16071,8 +16201,15 @@ function getFormPagination(props, mode) {
|
|
|
16071
16201
|
let currentIndex = event.data.index;
|
|
16072
16202
|
// 翻页到下一页之前需要先把当前页改动的内容保存到中间变量__tableItems中
|
|
16073
16203
|
let currentFormValues = scope.getComponentById(__formId).getValues();
|
|
16074
|
-
|
|
16075
|
-
|
|
16204
|
+
var parent = event.data.parent;
|
|
16205
|
+
var __parentIndex = event.data.__parentIndex;
|
|
16206
|
+
if(parent){
|
|
16207
|
+
fieldValue[__parentIndex].children[currentIndex] = currentFormValues;
|
|
16208
|
+
// 重写父节点,并且改变其某个属性以让子节点修改的内容回显到界面上
|
|
16209
|
+
fieldValue[__parentIndex] = Object.assign({}, fieldValue[__parentIndex], {
|
|
16210
|
+
children: fieldValue[__parentIndex].children,
|
|
16211
|
+
__fix_rerender_after_children_modified_tag: new Date().getTime()
|
|
16212
|
+
});
|
|
16076
16213
|
}
|
|
16077
16214
|
else{
|
|
16078
16215
|
fieldValue[currentIndex] = currentFormValues;
|
|
@@ -16210,9 +16347,14 @@ function getFormPaginationWrapper(props, form, mode) {
|
|
|
16210
16347
|
}
|
|
16211
16348
|
];
|
|
16212
16349
|
let onServiceInitedScript = `
|
|
16213
|
-
|
|
16350
|
+
var parent = event.data.parent;
|
|
16351
|
+
var fieldValue = event.data.__tableItems;
|
|
16352
|
+
if(parent){
|
|
16214
16353
|
// 如果是子行,即在节点嵌套情况下,当前节点如果是children属性下的子节点时,则算出其所属父行的索引值
|
|
16215
|
-
|
|
16354
|
+
var primaryKey = "${props.primaryKey}";
|
|
16355
|
+
event.data.__parentIndex = _.findIndex(fieldValue, function(item){
|
|
16356
|
+
return item[primaryKey] == parent[primaryKey];
|
|
16357
|
+
});
|
|
16216
16358
|
}
|
|
16217
16359
|
// 以下脚本是为了解决有时弹出编辑表单时,表单中的值比最后一次编辑保存的值会延迟一拍。
|
|
16218
16360
|
// 比如:inlineEditMode模式时,用户在表格单元格中直接修改数据,然后弹出的表单form中并没有包含单元格中修改的内容
|
|
@@ -16324,6 +16466,11 @@ async function getForm(props, mode = "edit", formId) {
|
|
|
16324
16466
|
var __parentIndex = event.data.__super.__super.__parentIndex;
|
|
16325
16467
|
if(parent){
|
|
16326
16468
|
fieldValue[__parentIndex].children[currentIndex] = currentFormValues;
|
|
16469
|
+
// 重写父节点,并且改变其某个属性以让子节点修改的内容回显到界面上
|
|
16470
|
+
fieldValue[__parentIndex] = Object.assign({}, fieldValue[__parentIndex], {
|
|
16471
|
+
children: fieldValue[__parentIndex].children,
|
|
16472
|
+
__fix_rerender_after_children_modified_tag: new Date().getTime()
|
|
16473
|
+
});
|
|
16327
16474
|
}
|
|
16328
16475
|
else{
|
|
16329
16476
|
fieldValue[currentIndex] = currentFormValues;
|
|
@@ -16468,9 +16615,13 @@ async function getButtonActions(props, mode) {
|
|
|
16468
16615
|
let fieldValue = event.data.__tableItems;//这里不可以_.cloneDeep,因为翻页form中用的是event.data.__tableItems,直接变更其值即可改变表单中的值
|
|
16469
16616
|
// 新建一条空白行并保存到子表组件
|
|
16470
16617
|
var parent = event.data.__super.parent;
|
|
16471
|
-
var
|
|
16618
|
+
var primaryKey = "${props.primaryKey}";
|
|
16619
|
+
var __parentIndex = parent && _.findIndex(fieldValue, function(item){
|
|
16620
|
+
return item[primaryKey] == parent[primaryKey];
|
|
16621
|
+
});
|
|
16472
16622
|
if(parent){
|
|
16473
16623
|
fieldValue[__parentIndex].children.push({});
|
|
16624
|
+
// 这里实测不需要fieldValue[__parentIndex] = ... 来重写整个父行让子表回显,所以没加相关代码
|
|
16474
16625
|
}
|
|
16475
16626
|
else{
|
|
16476
16627
|
fieldValue.push({});
|
|
@@ -16505,9 +16656,13 @@ async function getButtonActions(props, mode) {
|
|
|
16505
16656
|
// 复制当前页数据到新建行并保存到子表组件
|
|
16506
16657
|
// fieldValue.push(newItem);
|
|
16507
16658
|
var parent = event.data.__super.parent;
|
|
16508
|
-
var
|
|
16659
|
+
var primaryKey = "${props.primaryKey}";
|
|
16660
|
+
var __parentIndex = parent && _.findIndex(fieldValue, function(item){
|
|
16661
|
+
return item[primaryKey] == parent[primaryKey];
|
|
16662
|
+
});
|
|
16509
16663
|
if(parent){
|
|
16510
16664
|
fieldValue[__parentIndex].children.push(newItem);
|
|
16665
|
+
// 这里实测不需要fieldValue[__parentIndex] = ... 来重写整个父行让子表回显,所以没加相关代码
|
|
16511
16666
|
}
|
|
16512
16667
|
else{
|
|
16513
16668
|
fieldValue.push(newItem);
|
|
@@ -16523,7 +16678,6 @@ async function getButtonActions(props, mode) {
|
|
|
16523
16678
|
let __paginationServiceId = "${formPaginationId}";
|
|
16524
16679
|
let __paginationData = scope.getComponentById(__paginationServiceId).getData();
|
|
16525
16680
|
event.data.index = __paginationData.index;
|
|
16526
|
-
// event.data.__page = fieldValue.length - 1;//这里不可以用Object.assign否则,event.data中上层作用域数据会丢失
|
|
16527
16681
|
if(parent){
|
|
16528
16682
|
event.data.__page = fieldValue[__parentIndex].children.length - 1;//这里不可以用Object.assign否则,event.data中上层作用域数据会丢失
|
|
16529
16683
|
event.data.__parentIndex = __parentIndex; //执行下面的翻页按钮事件中依赖了__parentIndex值
|
|
@@ -16612,8 +16766,9 @@ async function getButtonActions(props, mode) {
|
|
|
16612
16766
|
// 为了解决"弹出的dialog窗口中子表组件会影响页面布局界面中父作用域字段值",比如设计字段布局微页面中的设置分组功能,弹出的就是子表dialog
|
|
16613
16767
|
// 所以这里使用json|toJson转一次,断掉event.data.__tableItems与上层任用域中props.name的联系
|
|
16614
16768
|
// "__tableItems": `\${${props.name}|json|toJson}`
|
|
16615
|
-
//
|
|
16616
|
-
|
|
16769
|
+
// 在节点嵌套情况下,当前节点正好是带children属性的节点的话,这里弹出的dialog映射到的会是children数组,这是amis目前的规则,
|
|
16770
|
+
// 所以这里加判断有children时,用__super.__super让映射到正确的作用域层,如果不加,则__tableItems取到的会是children数组,而不是整个子表组件的值
|
|
16771
|
+
"__tableItems": `\${((children ? __super.__super.${props.name} : __super.${props.name}) || [])|json|toJson}`
|
|
16617
16772
|
},
|
|
16618
16773
|
"actions": dialogButtons,
|
|
16619
16774
|
"onEvent": {
|
|
@@ -16731,9 +16886,17 @@ async function getButtonActions(props, mode) {
|
|
|
16731
16886
|
let lastestFieldValue = _.clone(wrapperServiceData["${props.name}"]);
|
|
16732
16887
|
var currentIndex = event.data.index;
|
|
16733
16888
|
var parent = event.data.__super.parent;
|
|
16734
|
-
var
|
|
16889
|
+
var primaryKey = "${props.primaryKey}";
|
|
16890
|
+
var __parentIndex = parent && _.findIndex(lastestFieldValue, function(item){
|
|
16891
|
+
return item[primaryKey] == parent[primaryKey];
|
|
16892
|
+
});
|
|
16735
16893
|
if(parent){
|
|
16736
16894
|
lastestFieldValue[__parentIndex].children.splice(currentIndex, 1);
|
|
16895
|
+
// 重写父节点,并且改变其某个属性以让子节点修改的内容回显到界面上
|
|
16896
|
+
lastestFieldValue[__parentIndex] = Object.assign({}, lastestFieldValue[__parentIndex], {
|
|
16897
|
+
children: lastestFieldValue[__parentIndex].children,
|
|
16898
|
+
__fix_rerender_after_children_modified_tag: new Date().getTime()
|
|
16899
|
+
});
|
|
16737
16900
|
}
|
|
16738
16901
|
else{
|
|
16739
16902
|
lastestFieldValue.splice(currentIndex, 1);
|
|
@@ -16823,38 +16986,47 @@ const getAmisInputTableSchema = async (props) => {
|
|
|
16823
16986
|
if (!props.id) {
|
|
16824
16987
|
props.id = "steedos_input_table_" + props.name + "_" + Math.random().toString(36).substr(2, 9);
|
|
16825
16988
|
}
|
|
16989
|
+
if (!props.primaryKey) {
|
|
16990
|
+
props.primaryKey = "_id";
|
|
16991
|
+
}
|
|
16992
|
+
let showOperation = props.showOperation;
|
|
16993
|
+
if(showOperation !== false){
|
|
16994
|
+
showOperation = true;
|
|
16995
|
+
}
|
|
16826
16996
|
let serviceId = getComponentId("table_service", props.id);
|
|
16827
16997
|
let buttonsForColumnOperations = [];
|
|
16828
16998
|
let inlineEditMode = props.inlineEditMode;
|
|
16829
16999
|
let showAsInlineEditMode = inlineEditMode && props.editable;
|
|
16830
|
-
if
|
|
16831
|
-
|
|
16832
|
-
|
|
16833
|
-
|
|
16834
|
-
|
|
16835
|
-
|
|
16836
|
-
|
|
16837
|
-
|
|
16838
|
-
|
|
16839
|
-
|
|
16840
|
-
|
|
16841
|
-
|
|
17000
|
+
if(showOperation){
|
|
17001
|
+
if (props.editable) {
|
|
17002
|
+
let showEditButton = true;
|
|
17003
|
+
if (showAsInlineEditMode) {
|
|
17004
|
+
// 始终显示弹出子表表单按钮,如果需要判断只在有列被隐藏时才需要显示弹出表单按钮放开下面的if逻辑就好
|
|
17005
|
+
showEditButton = true;
|
|
17006
|
+
// // inline edit模式下只在有列被隐藏时才需要显示编辑按钮
|
|
17007
|
+
// if (props.columns && props.columns.length > 0 && props.columns.length < props.fields.length) {
|
|
17008
|
+
// showEditButton = true;
|
|
17009
|
+
// }
|
|
17010
|
+
// else {
|
|
17011
|
+
// showEditButton = false;
|
|
17012
|
+
// }
|
|
17013
|
+
}
|
|
17014
|
+
// 编辑时显示编辑按钮
|
|
17015
|
+
if (showEditButton) {
|
|
17016
|
+
let buttonEditSchema = await getButtonEdit(props, showAsInlineEditMode);
|
|
17017
|
+
buttonsForColumnOperations.push(buttonEditSchema);
|
|
17018
|
+
}
|
|
16842
17019
|
}
|
|
16843
|
-
|
|
16844
|
-
|
|
16845
|
-
|
|
16846
|
-
|
|
17020
|
+
else {
|
|
17021
|
+
// 只读时显示查看按钮
|
|
17022
|
+
// 如果想只在有列被隐藏时才需要显示查看按钮可以加上判断:if (props.columns && props.columns.length > 0 && props.columns.length < props.fields.length)
|
|
17023
|
+
let buttonViewSchema = await getButtonView(props);
|
|
17024
|
+
buttonsForColumnOperations.push(buttonViewSchema);
|
|
17025
|
+
}
|
|
17026
|
+
if (props.removable) {
|
|
17027
|
+
let buttonDeleteSchema = await getButtonDelete(props);
|
|
17028
|
+
buttonsForColumnOperations.push(buttonDeleteSchema);
|
|
16847
17029
|
}
|
|
16848
|
-
}
|
|
16849
|
-
else {
|
|
16850
|
-
// 只读时显示查看按钮
|
|
16851
|
-
// 如果想只在有列被隐藏时才需要显示查看按钮可以加上判断:if (props.columns && props.columns.length > 0 && props.columns.length < props.fields.length)
|
|
16852
|
-
let buttonViewSchema = await getButtonView(props);
|
|
16853
|
-
buttonsForColumnOperations.push(buttonViewSchema);
|
|
16854
|
-
}
|
|
16855
|
-
if (props.removable) {
|
|
16856
|
-
let buttonDeleteSchema = await getButtonDelete(props);
|
|
16857
|
-
buttonsForColumnOperations.push(buttonDeleteSchema);
|
|
16858
17030
|
}
|
|
16859
17031
|
let inputTableSchema = {
|
|
16860
17032
|
"type": "input-table",
|
|
@@ -16873,7 +17045,13 @@ const getAmisInputTableSchema = async (props) => {
|
|
|
16873
17045
|
"strictMode": props.strictMode,
|
|
16874
17046
|
"showTableAddBtn": false,
|
|
16875
17047
|
"showFooterAddBtn": false,
|
|
16876
|
-
"className": props.tableClassName
|
|
17048
|
+
"className": props.tableClassName,
|
|
17049
|
+
"pipeOut": (value, data) => {
|
|
17050
|
+
return (value || []).map(function(item){
|
|
17051
|
+
delete item.__fix_rerender_after_children_modified_tag;
|
|
17052
|
+
return item;
|
|
17053
|
+
});
|
|
17054
|
+
}
|
|
16877
17055
|
};
|
|
16878
17056
|
if (buttonsForColumnOperations.length) {
|
|
16879
17057
|
inputTableSchema.columns.push({
|
|
@@ -16896,7 +17074,7 @@ const getAmisInputTableSchema = async (props) => {
|
|
|
16896
17074
|
return item.depend_on;
|
|
16897
17075
|
});
|
|
16898
17076
|
if (isAnyFieldHasDependOn) {
|
|
16899
|
-
// 有任意一个子字段有depend_on
|
|
17077
|
+
// 有任意一个子字段有depend_on属性时,强制设置禁用静态模式,因为strictMode模式下,dependOn的字段值变更后,不会rerender整个子表
|
|
16900
17078
|
Object.assign(inputTableSchema, {
|
|
16901
17079
|
strictMode: false
|
|
16902
17080
|
});
|
|
@@ -17001,7 +17179,7 @@ async function getListPageInitSchema(objectApiName, formFactor, userSession) {
|
|
|
17001
17179
|
// 获取
|
|
17002
17180
|
async function getRecordPageInitSchema(objectApiName){
|
|
17003
17181
|
const relatedList = await getObjectRelatedList(objectApiName);
|
|
17004
|
-
|
|
17182
|
+
await getUISchema(objectApiName);
|
|
17005
17183
|
let body = [
|
|
17006
17184
|
// detailHeaderAmisSchema,
|
|
17007
17185
|
{
|
|
@@ -17009,28 +17187,7 @@ async function getRecordPageInitSchema(objectApiName){
|
|
|
17009
17187
|
"label": "标题面板",
|
|
17010
17188
|
"objectApiName": "${objectName}",
|
|
17011
17189
|
"recordId": "${recordId}",
|
|
17012
|
-
"onEvent": {
|
|
17013
|
-
"recordLoaded": {
|
|
17014
|
-
"actions": [
|
|
17015
|
-
{
|
|
17016
|
-
"actionType": "setValue",
|
|
17017
|
-
"args": {
|
|
17018
|
-
"value": {
|
|
17019
|
-
"recordLoaded": true,
|
|
17020
|
-
}
|
|
17021
|
-
}
|
|
17022
|
-
},
|
|
17023
|
-
{
|
|
17024
|
-
"actionType": "reload",
|
|
17025
|
-
"data": {
|
|
17026
|
-
"name": `\${record.${uiSchema?.NAME_FIELD_KEY || 'name'}}`,
|
|
17027
|
-
"record": `\${record}`,
|
|
17028
|
-
"recordLoaded": true,
|
|
17029
|
-
}
|
|
17030
|
-
}
|
|
17031
|
-
]
|
|
17032
|
-
}
|
|
17033
|
-
}
|
|
17190
|
+
"onEvent": {}
|
|
17034
17191
|
}
|
|
17035
17192
|
];
|
|
17036
17193
|
let contentBody = {
|
|
@@ -19663,9 +19820,11 @@ var index_esm$1 = /*#__PURE__*/Object.freeze({
|
|
|
19663
19820
|
getObjectRelatedList: getObjectRelatedList,
|
|
19664
19821
|
getObjectRelatedListButtons: getObjectRelatedListButtons,
|
|
19665
19822
|
getObjectRelatedListHeader: getObjectRelatedListHeader,
|
|
19823
|
+
getObjectRelatedListsMiniSchema: getObjectRelatedListsMiniSchema,
|
|
19666
19824
|
getPage: getPage,
|
|
19667
19825
|
getRecord: getRecord,
|
|
19668
19826
|
getRecordDetailHeaderSchema: getRecordDetailHeaderSchema,
|
|
19827
|
+
getRecordDetailMiniSchema: getRecordDetailMiniSchema,
|
|
19669
19828
|
getRecordDetailRelatedListSchema: getRecordDetailRelatedListSchema,
|
|
19670
19829
|
getRecordDetailSchema: getRecordDetailSchema,
|
|
19671
19830
|
getRecordPageInitSchema: getRecordPageInitSchema,
|
|
@@ -19847,7 +20006,7 @@ var AmisObjectFieldLookup = function (props) {
|
|
|
19847
20006
|
};
|
|
19848
20007
|
|
|
19849
20008
|
var AmisObjectButton = function (props) {
|
|
19850
|
-
// console.log(`AmisObjectButton
|
|
20009
|
+
// console.log(`AmisObjectButton=====》`, props)
|
|
19851
20010
|
var objectName = props.objectName, name = props.name, data = props.data, render = props.render, className = props.className, listViewId = props.listViewId;
|
|
19852
20011
|
var _a = __read(React.useState(), 2), button = _a[0], setButton = _a[1];
|
|
19853
20012
|
var _b = __read(React.useState(), 2), uiSchema = _b[0], setUiSchema = _b[1];
|
|
@@ -19905,7 +20064,7 @@ var AmisObjectButton = function (props) {
|
|
|
19905
20064
|
if (schema && className) {
|
|
19906
20065
|
schema.className = schema.className + ' steedos-object-button ' + className;
|
|
19907
20066
|
}
|
|
19908
|
-
var renderData = Object.assign(
|
|
20067
|
+
var renderData = Object.assign({}, { objectName: objectName, app_id: appId, className: className });
|
|
19909
20068
|
if (data._id) {
|
|
19910
20069
|
renderData.recordId = data._id;
|
|
19911
20070
|
}
|
|
@@ -20208,7 +20367,8 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
20208
20367
|
formData.recordId = props.recordId;
|
|
20209
20368
|
}
|
|
20210
20369
|
amisSchema.className = "steedos-object-form ".concat(className);
|
|
20211
|
-
|
|
20370
|
+
// console.log('AmisObjectForm amisSchema======>', amisSchema)
|
|
20371
|
+
amisSchema.data = Object.assign({}, amisSchema.data || {}, formData, { global: globalData, uiSchema: uiSchema });
|
|
20212
20372
|
if (_$1.has(props, 'objectApiName')) {
|
|
20213
20373
|
amisSchema.data.objectName = objectApiName;
|
|
20214
20374
|
}
|
|
@@ -20397,7 +20557,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
20397
20557
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
20398
20558
|
},
|
|
20399
20559
|
"requestAdaptor": "api.data={query: '{spaces__findOne(id: \"none\"){_id,name}}'};return api;",
|
|
20400
|
-
"adaptor": "\n // console.log('service listview schemaApi adaptor....', api.body); \n let { appId, objectName, defaultListName: listName, display, formFactor: defaultFormFactor, uiSchema} = api.body;\n if(api.body.listName){\n listName = api.body.listName;\n }\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 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 const crud_mode = listView.crud_mode;\n if(crud_mode){\n if(!listViewSchemaProps.defaults.listSchema.mode){\n // \u8FD9\u91CC\u4F18\u5148\u8BA4\u5FAE\u9875\u9762\u4E2D\u4E3A\u5217\u8868\u89C6\u56FE\u7EC4\u4EF6\u914D\u7F6E\u7684crudMode\u53CAcrud.mode\u5C5E\u6027\uFF0C\n // \u53EA\u6709\u7EC4\u4EF6\u4E2D\u672A\u914D\u7F6E\u8BE5\u5C5E\u6027\u65F6\u624D\u53D6\u5143\u6570\u636E\u4E2D\u4E3A\u5F53\u524D\u5217\u8868\u89C6\u56FE\u914D\u7F6E\u7684crud_mode\u5C5E\u6027\u4F5C\u4E3Acrud\u7684mode\u503C\n // \u4E0D\u4F18\u5148\u8BA4\u5404\u4E2A\u5217\u8868\u89C6\u56FE\u5143\u6570\u636E\u4E2D\u7684\u914D\u7F6E\uFF0C\u662F\u56E0\u4E3A\u5728\u754C\u9762\u4E0A\u65B0\u5EFA\u7F16\u8F91\u5217\u8868\u89C6\u56FE\u65F6\uFF0Ccrud_mode\u5B57\u6BB5\u503C\u9ED8\u8BA4\u503C\u662Ftable\uFF0C\u8FD9\u4F1A\u8BA9\u5FAE\u9875\u9762\u4E2D\u5217\u8868\u89C6\u56FE\u7EC4\u4EF6\u4E2D\u914D\u7F6E\u7684crudMode\u53CAcrud.mode\u5C5E\u6027\u503C\u4E0D\u751F\u6548\n // \u5982\u679C\u60F3\u4F18\u5148\u8BA4\u5404\u4E2A\u5217\u8868\u89C6\u56FE\u5143\u6570\u636E\u4E2D\u7684\u914D\u7F6E\uFF0C\u53EA\u8981\u628A\u5FAE\u9875\u9762\u4E2D\u5217\u8868\u89C6\u56FE\u7EC4\u4EF6\u7684crudMode\u53CAcrud.mode\u5C5E\u6027\u503C\u6E05\u9664\u5373\u53EF\n listViewSchemaProps.defaults.listSchema.mode = crud_mode;\n }\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
|
|
20560
|
+
"adaptor": "\n // console.log('service listview schemaApi adaptor....', api.body); \n let { appId, objectName, defaultListName: listName, display, formFactor: defaultFormFactor, uiSchema} = api.body;\n if(api.body.listName){\n listName = api.body.listName;\n }\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 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 const crud_mode = listView.crud_mode;\n if(crud_mode){\n if(!listViewSchemaProps.defaults.listSchema.mode){\n // \u8FD9\u91CC\u4F18\u5148\u8BA4\u5FAE\u9875\u9762\u4E2D\u4E3A\u5217\u8868\u89C6\u56FE\u7EC4\u4EF6\u914D\u7F6E\u7684crudMode\u53CAcrud.mode\u5C5E\u6027\uFF0C\n // \u53EA\u6709\u7EC4\u4EF6\u4E2D\u672A\u914D\u7F6E\u8BE5\u5C5E\u6027\u65F6\u624D\u53D6\u5143\u6570\u636E\u4E2D\u4E3A\u5F53\u524D\u5217\u8868\u89C6\u56FE\u914D\u7F6E\u7684crud_mode\u5C5E\u6027\u4F5C\u4E3Acrud\u7684mode\u503C\n // \u4E0D\u4F18\u5148\u8BA4\u5404\u4E2A\u5217\u8868\u89C6\u56FE\u5143\u6570\u636E\u4E2D\u7684\u914D\u7F6E\uFF0C\u662F\u56E0\u4E3A\u5728\u754C\u9762\u4E0A\u65B0\u5EFA\u7F16\u8F91\u5217\u8868\u89C6\u56FE\u65F6\uFF0Ccrud_mode\u5B57\u6BB5\u503C\u9ED8\u8BA4\u503C\u662Ftable\uFF0C\u8FD9\u4F1A\u8BA9\u5FAE\u9875\u9762\u4E2D\u5217\u8868\u89C6\u56FE\u7EC4\u4EF6\u4E2D\u914D\u7F6E\u7684crudMode\u53CAcrud.mode\u5C5E\u6027\u503C\u4E0D\u751F\u6548\n // \u5982\u679C\u60F3\u4F18\u5148\u8BA4\u5404\u4E2A\u5217\u8868\u89C6\u56FE\u5143\u6570\u636E\u4E2D\u7684\u914D\u7F6E\uFF0C\u53EA\u8981\u628A\u5FAE\u9875\u9762\u4E2D\u5217\u8868\u89C6\u56FE\u7EC4\u4EF6\u7684crudMode\u53CAcrud.mode\u5C5E\u6027\u503C\u6E05\u9664\u5373\u53EF\n listViewSchemaProps.defaults.listSchema.mode = crud_mode;\n }\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 resolve(payload)\n });\n });\n ")
|
|
20401
20561
|
},
|
|
20402
20562
|
// "body": body,
|
|
20403
20563
|
// "data": serviceData
|
|
@@ -20555,34 +20715,18 @@ var AmisObjectCalendar = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
20555
20715
|
}); };
|
|
20556
20716
|
|
|
20557
20717
|
var AmisRecordDetailHeader = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
20558
|
-
var _a, className, schemaFilter,
|
|
20718
|
+
var _a, className, schemaFilter, showButtons, showBackButton, defaultOnEvent, recordId, _b, onEvent, _c, showRecordTitle, objectApiName, schema, config, schemaFilterFun, _config, e_1;
|
|
20559
20719
|
return __generator(this, function (_d) {
|
|
20560
20720
|
switch (_d.label) {
|
|
20561
20721
|
case 0:
|
|
20562
|
-
_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-
|
|
20722
|
+
_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-0' : _a, schemaFilter = props.schemaFilter, showButtons = props.showButtons, showBackButton = props.showBackButton;
|
|
20563
20723
|
return [4 /*yield*/, getUISchema(props.objectApiName || "space_users", false)];
|
|
20564
20724
|
case 1:
|
|
20565
|
-
|
|
20566
|
-
defaultOnEvent = {
|
|
20567
|
-
"recordLoaded": {
|
|
20568
|
-
"actions": [
|
|
20569
|
-
{
|
|
20570
|
-
"actionType": "reload",
|
|
20571
|
-
"data": {
|
|
20572
|
-
"name": "${event.data.record.".concat((objectUiSchema === null || objectUiSchema === void 0 ? void 0 : objectUiSchema.NAME_FIELD_KEY) || 'name', "}"),
|
|
20573
|
-
"record": "${event.data.record}",
|
|
20574
|
-
"_id": "\${event.data.record._id}",
|
|
20575
|
-
"recordId": "\${event.data.record._id}",
|
|
20576
|
-
"recordLoaded": true,
|
|
20577
|
-
},
|
|
20578
|
-
"expression": "${event.data.objectName == '".concat(objectUiSchema === null || objectUiSchema === void 0 ? void 0 : objectUiSchema.name, "'}")
|
|
20579
|
-
}
|
|
20580
|
-
]
|
|
20581
|
-
}
|
|
20582
|
-
};
|
|
20725
|
+
_d.sent();
|
|
20726
|
+
defaultOnEvent = {};
|
|
20583
20727
|
props.$schema, recordId = props.recordId, _b = props.onEvent, onEvent = _b === void 0 ? defaultOnEvent : _b, _c = props.showRecordTitle, showRecordTitle = _c === void 0 ? true : _c;
|
|
20584
20728
|
objectApiName = props.objectApiName || "space_users";
|
|
20585
|
-
return [4 /*yield*/, getRecordDetailHeaderSchema(objectApiName, recordId, { showRecordTitle: showRecordTitle, formFactor: props.data.formFactor })];
|
|
20729
|
+
return [4 /*yield*/, getRecordDetailHeaderSchema(objectApiName, recordId, { showRecordTitle: showRecordTitle, formFactor: props.data.formFactor, showButtons: showButtons, showBackButton: showBackButton })];
|
|
20586
20730
|
case 2:
|
|
20587
20731
|
schema = (_d.sent()).amisSchema;
|
|
20588
20732
|
schema.className = className;
|
|
@@ -20601,18 +20745,20 @@ var AmisRecordDetailHeader = function (props) { return __awaiter(void 0, void 0,
|
|
|
20601
20745
|
e_1 = _d.sent();
|
|
20602
20746
|
console.warn(e_1);
|
|
20603
20747
|
return [3 /*break*/, 6];
|
|
20604
|
-
case 6:
|
|
20748
|
+
case 6:
|
|
20749
|
+
// console.log(`AmisRecordDetailHeader==>`, config)
|
|
20750
|
+
return [2 /*return*/, config];
|
|
20605
20751
|
}
|
|
20606
20752
|
});
|
|
20607
20753
|
}); };
|
|
20608
20754
|
|
|
20609
20755
|
var AmisRecordDetail = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
20610
|
-
var className, $schema, appId, _a, objectApiName, body, schema;
|
|
20756
|
+
var className, $schema, appId, _a, objectApiName, body, showButtons, showBackButton, schema;
|
|
20611
20757
|
return __generator(this, function (_b) {
|
|
20612
20758
|
switch (_b.label) {
|
|
20613
20759
|
case 0:
|
|
20614
|
-
className = props.className, $schema = props.$schema, appId = props.appId, _a = props.objectApiName, objectApiName = _a === void 0 ? "space_users" : _a, props.recordId, props.onEvent, props.defaultData, body = props.body;
|
|
20615
|
-
return [4 /*yield*/, getRecordDetailSchema(objectApiName, appId)];
|
|
20760
|
+
className = props.className, $schema = props.$schema, appId = props.appId, _a = props.objectApiName, objectApiName = _a === void 0 ? "space_users" : _a, props.recordId, props.onEvent, props.defaultData, body = props.body, showButtons = props.showButtons, showBackButton = props.showBackButton;
|
|
20761
|
+
return [4 /*yield*/, getRecordDetailSchema(objectApiName, appId, { showButtons: showButtons, showBackButton: showBackButton })];
|
|
20616
20762
|
case 1:
|
|
20617
20763
|
schema = (_b.sent()).amisSchema;
|
|
20618
20764
|
// 在非记录页组件下全局作用域下无recordId,会导致表单接口sendOn始终为false,无法发起请求。
|
|
@@ -20622,8 +20768,17 @@ var AmisRecordDetail = function (props) { return __awaiter(void 0, void 0, void
|
|
|
20622
20768
|
// }
|
|
20623
20769
|
// schema.data = Object.assign({}, schema.data, recordDetailData);
|
|
20624
20770
|
if (_$1.has(props, "recordId") && $schema.recordId !== "${recordId}") {
|
|
20771
|
+
if (!schema.data) {
|
|
20772
|
+
schema.data = {};
|
|
20773
|
+
}
|
|
20625
20774
|
schema.data.recordId = props.recordId;
|
|
20626
20775
|
}
|
|
20776
|
+
if (_$1.has(props, "objectApiName") && props.objectApiName && $schema.objectApiName !== "${objectName}") {
|
|
20777
|
+
if (!schema.data) {
|
|
20778
|
+
schema.data = {};
|
|
20779
|
+
}
|
|
20780
|
+
schema.data.objectName = props.objectApiName;
|
|
20781
|
+
}
|
|
20627
20782
|
schema.className = className;
|
|
20628
20783
|
if (body) {
|
|
20629
20784
|
schema.body = body;
|
|
@@ -20637,28 +20792,39 @@ var AmisRecordDetail = function (props) { return __awaiter(void 0, void 0, void
|
|
|
20637
20792
|
/*
|
|
20638
20793
|
* @Author: baozhoutao@steedos.com
|
|
20639
20794
|
* @Date: 2022-12-08 10:32:17
|
|
20640
|
-
* @LastEditors:
|
|
20641
|
-
* @LastEditTime:
|
|
20795
|
+
* @LastEditors: baozhoutao@steedos.com
|
|
20796
|
+
* @LastEditTime: 2024-01-16 14:09:23
|
|
20642
20797
|
* @Description:
|
|
20643
20798
|
*/
|
|
20644
20799
|
var AmisRecordService = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
20645
|
-
var className, _a, objectApiName, body, style, schema;
|
|
20800
|
+
var className, $schema, appId, _a, objectApiName, body, style, recordId, options, schema;
|
|
20646
20801
|
return __generator(this, function (_b) {
|
|
20647
20802
|
switch (_b.label) {
|
|
20648
20803
|
case 0:
|
|
20649
|
-
className = props.className, props.$schema, props.appId, _a = props.objectApiName, objectApiName = _a === void 0 ? "space_users" : _a, props.
|
|
20650
|
-
|
|
20804
|
+
className = props.className, $schema = props.$schema, appId = props.appId, _a = props.objectApiName, objectApiName = _a === void 0 ? "space_users" : _a, props.fields, body = props.body, style = props.style, props.onEvent, recordId = props.recordId;
|
|
20805
|
+
if (_$1.has($schema.data, "recordId") && $schema.data.recordId !== "${recordId}") {
|
|
20806
|
+
recordId = $schema.data.recordId;
|
|
20807
|
+
}
|
|
20808
|
+
if (_$1.has($schema.data, "objectName") && $schema.data.objectName !== "${objectName}") {
|
|
20809
|
+
objectApiName = $schema.data.objectName;
|
|
20810
|
+
}
|
|
20811
|
+
options = { onEvent: $schema.onEvent, data: $schema.data, recordId: recordId };
|
|
20812
|
+
if (props.$$editor) {
|
|
20813
|
+
options.isEditor = true;
|
|
20814
|
+
}
|
|
20815
|
+
return [4 /*yield*/, getRecordServiceSchema(objectApiName, appId, options, body)];
|
|
20651
20816
|
case 1:
|
|
20652
20817
|
schema = (_b.sent()).amisSchema;
|
|
20653
|
-
if (body) {
|
|
20654
|
-
schema.body = body;
|
|
20655
|
-
}
|
|
20656
20818
|
if (className) {
|
|
20657
20819
|
schema.className = className;
|
|
20658
20820
|
}
|
|
20659
20821
|
if (style) {
|
|
20822
|
+
if (!schema.style) {
|
|
20823
|
+
schema.style = {};
|
|
20824
|
+
}
|
|
20660
20825
|
Object.assign(schema.style, style);
|
|
20661
20826
|
}
|
|
20827
|
+
// console.log(`AmisRecordService====schema==>`, schema)
|
|
20662
20828
|
return [2 /*return*/, schema];
|
|
20663
20829
|
}
|
|
20664
20830
|
});
|
|
@@ -20715,7 +20881,7 @@ var AmisRecordDetailRelatedList = function (props) { return __awaiter(void 0, vo
|
|
|
20715
20881
|
}); };
|
|
20716
20882
|
|
|
20717
20883
|
var AmisRecordDetailRelatedLists = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
20718
|
-
var $schema, objectApiName, recordId, _a, perPage, relatedLists, staticRecordId;
|
|
20884
|
+
var $schema, objectApiName, recordId, _a, perPage, formFactor, relatedLists, staticRecordId;
|
|
20719
20885
|
return __generator(this, function (_b) {
|
|
20720
20886
|
switch (_b.label) {
|
|
20721
20887
|
case 0:
|
|
@@ -20730,7 +20896,10 @@ var AmisRecordDetailRelatedLists = function (props) { return __awaiter(void 0, v
|
|
|
20730
20896
|
"className": "mb-3"
|
|
20731
20897
|
}];
|
|
20732
20898
|
}
|
|
20733
|
-
props.formFactor;
|
|
20899
|
+
formFactor = props.formFactor;
|
|
20900
|
+
if (!formFactor) {
|
|
20901
|
+
formFactor = window.innerWidth < 768 ? 'SMALL' : 'LARGE';
|
|
20902
|
+
}
|
|
20734
20903
|
return [4 /*yield*/, getObjectRelatedList(objectApiName)];
|
|
20735
20904
|
case 1:
|
|
20736
20905
|
relatedLists = _b.sent();
|
|
@@ -20743,11 +20912,12 @@ var AmisRecordDetailRelatedLists = function (props) { return __awaiter(void 0, v
|
|
|
20743
20912
|
"className": "mb-3"
|
|
20744
20913
|
}];
|
|
20745
20914
|
}
|
|
20746
|
-
staticRecordId =
|
|
20915
|
+
staticRecordId = props.staticRecordId;
|
|
20747
20916
|
// 在设计器中的设计状态,当上层有recordId具体值,相关表组件的$schema.recordId的默认值就是 "${recordId}"; 会导致获取不到 _master, 进而导致组件显示不了数据。
|
|
20748
20917
|
if (_$1.has(props, "recordId") && ($schema.recordId !== "${recordId}" || (props.$$editor && props.recordId !== "${recordId}"))) {
|
|
20749
20918
|
staticRecordId = recordId;
|
|
20750
20919
|
}
|
|
20920
|
+
// console.log('relatedLists======>', relatedLists, staticRecordId)
|
|
20751
20921
|
return [2 /*return*/, {
|
|
20752
20922
|
type: 'service',
|
|
20753
20923
|
className: "steedos-record-detail-related-lists",
|
|
@@ -20756,6 +20926,7 @@ var AmisRecordDetailRelatedLists = function (props) { return __awaiter(void 0, v
|
|
|
20756
20926
|
type: 'steedos-object-related-listview',
|
|
20757
20927
|
objectApiName: objectApiName,
|
|
20758
20928
|
// recordId: recordId,
|
|
20929
|
+
formFactor: formFactor,
|
|
20759
20930
|
relatedObjectApiName: item.object_name,
|
|
20760
20931
|
foreign_key: item.foreign_key,
|
|
20761
20932
|
relatedKey: item.foreign_key,
|
|
@@ -20770,6 +20941,7 @@ var AmisRecordDetailRelatedLists = function (props) { return __awaiter(void 0, v
|
|
|
20770
20941
|
if (staticRecordId) {
|
|
20771
20942
|
relatedList.recordId = staticRecordId;
|
|
20772
20943
|
}
|
|
20944
|
+
// console.log('relatedList=====>', relatedList)
|
|
20773
20945
|
return relatedList;
|
|
20774
20946
|
})
|
|
20775
20947
|
}];
|
|
@@ -21910,13 +22082,13 @@ function getAmisStaticFieldType(type, data_type, options) {
|
|
|
21910
22082
|
return "switch";
|
|
21911
22083
|
}
|
|
21912
22084
|
else if (type === 'currency') {
|
|
21913
|
-
return "number";
|
|
22085
|
+
return "input-number";
|
|
21914
22086
|
}
|
|
21915
22087
|
else if (type === 'autonumber') {
|
|
21916
22088
|
return "input-text"; //不可以用text,因为会出现字段label显示不出来的问题
|
|
21917
22089
|
}
|
|
21918
22090
|
else if (type === 'percent') {
|
|
21919
|
-
return "number";
|
|
22091
|
+
return "input-number";
|
|
21920
22092
|
}
|
|
21921
22093
|
else if (type === 'formula' || type === 'summary') {
|
|
21922
22094
|
return getAmisStaticFieldType(data_type, null, options);
|
|
@@ -21933,14 +22105,14 @@ function getAmisStaticFieldType(type, data_type, options) {
|
|
|
21933
22105
|
return type;
|
|
21934
22106
|
}
|
|
21935
22107
|
var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
21936
|
-
var steedosField, field, _a, readonly, _b, ctx, config, fStatic, env, inInputTable, defaultSource, source, fieldBaseProps,
|
|
21937
|
-
var e_1,
|
|
21938
|
-
var
|
|
21939
|
-
return __generator(this, function (
|
|
21940
|
-
switch (
|
|
22108
|
+
var steedosField, field, _a, readonly, _b, ctx, config, fStatic, env, inInputTable, className, defaultSource, source, fieldBaseProps, referenceTo_1, fieldRefObject, disPlayValue, res, valueOptions_1, fieldValue, values, disPlayValue_1, schema, fieldSchema, fieldValue, hasImageOrFile_1, fieldHtml_1, schema, tableFields, _c, _d, subField, subFieldName, fieldAmis, schema, error_1;
|
|
22109
|
+
var _e, e_1, _f;
|
|
22110
|
+
var _g, _h, _j, _k, _l;
|
|
22111
|
+
return __generator(this, function (_m) {
|
|
22112
|
+
switch (_m.label) {
|
|
21941
22113
|
case 0:
|
|
21942
22114
|
steedosField = null;
|
|
21943
|
-
field = props.field, _a = props.readonly, readonly = _a === void 0 ? false : _a, _b = props.ctx, ctx = _b === void 0 ? {} : _b, config = props.config, props.$schema, fStatic = props.static, env = props.env, inInputTable = props.inInputTable;
|
|
22115
|
+
field = props.field, _a = props.readonly, readonly = _a === void 0 ? false : _a, _b = props.ctx, ctx = _b === void 0 ? {} : _b, config = props.config, props.$schema, fStatic = props.static, env = props.env, inInputTable = props.inInputTable, className = props.className;
|
|
21944
22116
|
// console.log(`AmisSteedosField`, props)
|
|
21945
22117
|
// if($schema.config && isString($schema.config)){
|
|
21946
22118
|
// $schema.config = JSON.parse($schema.config)
|
|
@@ -21968,14 +22140,14 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
21968
22140
|
// 字段配置为只读,强制走fStatic模式,加上_display判断是为了不影响历史代码,比如直接在ObjectForm中调用steedos-field组件
|
|
21969
22141
|
fStatic = true;
|
|
21970
22142
|
}
|
|
21971
|
-
|
|
22143
|
+
_m.label = 1;
|
|
21972
22144
|
case 1:
|
|
21973
|
-
|
|
21974
|
-
if (!(fStatic && (steedosField.type === 'lookup' || steedosField.type === 'master_detail'))) return [3 /*break*/,
|
|
22145
|
+
_m.trys.push([1, 24, , 25]);
|
|
22146
|
+
if (!(fStatic && (steedosField.type === 'lookup' || steedosField.type === 'master_detail'))) return [3 /*break*/, 7];
|
|
21975
22147
|
defaultSource = {
|
|
21976
22148
|
"method": "post",
|
|
21977
22149
|
"url": "${context.rootUrl}/graphql",
|
|
21978
|
-
"requestAdaptor": "\n var steedosField = ".concat(JSON.stringify(steedosField), ";\n var objectName, filters, valueFieldKey, labelFieldKey;\n if(_.isString(steedosField.reference_to)){\n // reference_to\u4E3A\u5355\u9009\n const referenceTo = getReferenceToSync(steedosField);\n const referenceToField = steedosField.reference_to_field || '_id';\n\n objectName = referenceTo.objectName\n valueFieldKey = referenceTo && referenceTo.valueField?.name || '_id' ;\n labelFieldKey = referenceTo && referenceTo.labelField?.name || 'name';\n let value = _.get(api.data, steedosField.name);\n if(_.isString(value)){\n value = [value]\n }\n filters = [referenceToField, \"in\", value || []];\n if(objectName == \"object_fields\" || objectName == \"object_actions\"){\n //\u5BF9\u8C61\u4E3Aobject_fields\u65F6\uFF0C\u5FC5\u987B\u52A0\u4E0Aobject\u7684\u8FC7\u6EE4\u6761\u4EF6\n const filtersFunction = ").concat(steedosField.filtersFunction || steedosField._filtersFunction, ";\n if(filtersFunction){\n const _filters = filtersFunction(filters, api.data);\n if(_filters && _filters.length > 0){\n filters = [filters,_filters]\n }\n }\n }\n }else{\n // reference_to\u4E3A\u591A\u9009\n const _steedosField = {\n ...steedosField,\n reference_to: api.data[steedosField.name].o\n }\n const referenceTo = getReferenceToSync(_steedosField);\n const referenceToField = _steedosField.reference_to_field || '_id';\n\n objectName = referenceTo.objectName\n valueFieldKey = referenceTo && referenceTo.valueField?.name || '_id' ;\n labelFieldKey = referenceTo && referenceTo.labelField?.name || 'name';\n let value = api.data[_steedosField.name] && api.data[_steedosField.name].ids;\n filters = [referenceToField, \"in\", value || []];\n }\n api.data = {\n query: '{options:' + objectName + '(filters: ' + JSON.stringify(filters) + '){label: ' + labelFieldKey + ',value: ' + valueFieldKey + '}}'\n }\n return api;\n "),
|
|
22150
|
+
"requestAdaptor": "\n var steedosField = ".concat(JSON.stringify(steedosField), ";\n // console.log('defaultSource====>steedosField', steedosField);\n var objectName, filters, valueFieldKey, labelFieldKey;\n if(_.isString(steedosField.reference_to)){\n // reference_to\u4E3A\u5355\u9009\n const referenceTo = getReferenceToSync(steedosField);\n const referenceToField = steedosField.reference_to_field || '_id';\n\n objectName = referenceTo.objectName\n valueFieldKey = referenceTo && referenceTo.valueField?.name || '_id' ;\n labelFieldKey = referenceTo && referenceTo.labelField?.name || 'name';\n let value = _.get(api.data, steedosField.name);\n if(_.isString(value)){\n value = [value]\n }\n filters = [referenceToField, \"in\", value || []];\n if(objectName == \"object_fields\" || objectName == \"object_actions\"){\n //\u5BF9\u8C61\u4E3Aobject_fields\u65F6\uFF0C\u5FC5\u987B\u52A0\u4E0Aobject\u7684\u8FC7\u6EE4\u6761\u4EF6\n const filtersFunction = ").concat(steedosField.filtersFunction || steedosField._filtersFunction, ";\n if(filtersFunction){\n const _filters = filtersFunction(filters, api.data);\n if(_filters && _filters.length > 0){\n filters = [filters,_filters]\n }\n }\n }\n }else{\n // reference_to\u4E3A\u591A\u9009\n const _steedosField = {\n ...steedosField,\n reference_to: api.data[steedosField.name].o\n }\n const referenceTo = getReferenceToSync(_steedosField);\n const referenceToField = _steedosField.reference_to_field || '_id';\n\n objectName = referenceTo.objectName\n valueFieldKey = referenceTo && referenceTo.valueField?.name || '_id' ;\n labelFieldKey = referenceTo && referenceTo.labelField?.name || 'name';\n let value = api.data[_steedosField.name] && api.data[_steedosField.name].ids;\n filters = [referenceToField, \"in\", value || []];\n }\n\n // \u989D\u5916\u8FD4\u56DE_id\u5B57\u6BB5\n api.data = {\n query: '{options:' + objectName + '(filters: ' + JSON.stringify(filters) + '){label: ' + labelFieldKey + ',value: ' + valueFieldKey + ', _id}}'\n }\n return api;\n "),
|
|
21979
22151
|
"trackExpression": "${" + steedosField.name + "}",
|
|
21980
22152
|
"cache": 3000
|
|
21981
22153
|
};
|
|
@@ -21992,50 +22164,165 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
21992
22164
|
defaultSource.adaptor = "\n var options = ".concat(JSON.stringify(steedosField.options), "\n if(api.body.$term){\n options = _.filter(options, function(o) {\n var label = o.label;\n return label.toLowerCase().indexOf(api.body.$term.toLowerCase()) > -1;\n });\n }\n if(!payload.data){\n payload.data = {};\n }\n payload.data.options = options;\n return payload;\n ");
|
|
21993
22165
|
}
|
|
21994
22166
|
}
|
|
21995
|
-
source = ((
|
|
22167
|
+
source = ((_g = steedosField.amis) === null || _g === void 0 ? void 0 : _g.source) || ((_h = steedosField.amis) === null || _h === void 0 ? void 0 : _h.autoComplete) || defaultSource;
|
|
21996
22168
|
fieldBaseProps = {
|
|
21997
22169
|
multiple: steedosField.multiple,
|
|
21998
22170
|
name: steedosField.name,
|
|
21999
22171
|
label: steedosField.label,
|
|
22000
22172
|
static: true,
|
|
22001
|
-
className: (
|
|
22173
|
+
className: "".concat(className || '', " ").concat(((_j = steedosField.amis) === null || _j === void 0 ? void 0 : _j.className) || '')
|
|
22002
22174
|
};
|
|
22003
22175
|
if (!inInputTable) return [3 /*break*/, 2];
|
|
22004
22176
|
fieldBaseProps = Object.assign({}, fieldBaseProps, { type: 'select', source: source });
|
|
22005
|
-
return [3 /*break*/,
|
|
22177
|
+
return [3 /*break*/, 6];
|
|
22006
22178
|
case 2:
|
|
22007
|
-
|
|
22008
|
-
|
|
22179
|
+
referenceTo_1 = steedosField.reference_to;
|
|
22180
|
+
steedosField.reference_to_field;
|
|
22181
|
+
if (referenceTo_1 === 'users') {
|
|
22182
|
+
referenceTo_1 = 'space_users';
|
|
22183
|
+
}
|
|
22184
|
+
return [4 /*yield*/, getUISchema(referenceTo_1)];
|
|
22009
22185
|
case 3:
|
|
22010
|
-
|
|
22011
|
-
|
|
22012
|
-
|
|
22013
|
-
if (
|
|
22014
|
-
|
|
22015
|
-
|
|
22016
|
-
|
|
22017
|
-
|
|
22018
|
-
|
|
22019
|
-
|
|
22020
|
-
|
|
22021
|
-
|
|
22022
|
-
|
|
22023
|
-
|
|
22186
|
+
fieldRefObject = _m.sent();
|
|
22187
|
+
if (!(props.data._display && _$1.has(props.data._display, steedosField.name))) return [3 /*break*/, 4];
|
|
22188
|
+
disPlayValue = props.data._display[steedosField.name];
|
|
22189
|
+
if (disPlayValue) {
|
|
22190
|
+
if (!_$1.isArray(disPlayValue) && _$1.isObject(disPlayValue)) {
|
|
22191
|
+
disPlayValue = [disPlayValue];
|
|
22192
|
+
}
|
|
22193
|
+
fieldBaseProps = Object.assign({}, fieldBaseProps, {
|
|
22194
|
+
type: 'control',
|
|
22195
|
+
name: null,
|
|
22196
|
+
body: {
|
|
22197
|
+
type: 'wrapper',
|
|
22198
|
+
className: "steedos-field-lookup-wrapper p-0",
|
|
22199
|
+
"wrapWithPanel": false,
|
|
22200
|
+
"actions": [],
|
|
22201
|
+
body: [
|
|
22202
|
+
{
|
|
22203
|
+
type: 'each',
|
|
22204
|
+
className: "steedos-field-lookup-each flex flex-wrap gap-2",
|
|
22205
|
+
source: "${_display.".concat(steedosField.name, "|asArray}"),
|
|
22206
|
+
items: {
|
|
22207
|
+
type: 'static',
|
|
22208
|
+
className: 'm-0',
|
|
22209
|
+
tpl: "<a href=\"/app/-/${objectName}/view/${value}\" target=\"_blank\">${label}</a>",
|
|
22210
|
+
popOver: fieldRefObject.compactLayouts ? {
|
|
22211
|
+
"trigger": "hover",
|
|
22212
|
+
"className": "steedos-record-detail-popover",
|
|
22213
|
+
"position": "left-bottom",
|
|
22214
|
+
"showIcon": false,
|
|
22215
|
+
"title": false,
|
|
22216
|
+
"offset": {
|
|
22217
|
+
"top": 0,
|
|
22218
|
+
"left": 20
|
|
22219
|
+
},
|
|
22220
|
+
"body": [
|
|
22221
|
+
{
|
|
22222
|
+
"type": "steedos-record-mini",
|
|
22223
|
+
"objectApiName": "${objectName}",
|
|
22224
|
+
"recordId": "${value}",
|
|
22225
|
+
"showButtons": false,
|
|
22226
|
+
"showBackButton": false,
|
|
22227
|
+
"data": {
|
|
22228
|
+
"objectName": "${objectName}",
|
|
22229
|
+
"recordId": "${value}"
|
|
22230
|
+
}
|
|
22231
|
+
}
|
|
22232
|
+
]
|
|
22233
|
+
} : null
|
|
22234
|
+
}
|
|
22235
|
+
}
|
|
22236
|
+
]
|
|
22024
22237
|
}
|
|
22025
22238
|
});
|
|
22026
22239
|
}
|
|
22027
|
-
|
|
22028
|
-
|
|
22029
|
-
|
|
22240
|
+
else {
|
|
22241
|
+
fieldBaseProps = Object.assign({}, fieldBaseProps, { type: 'static', tpl: '-', className: "".concat(fieldBaseProps.className || '', " text-muted") });
|
|
22242
|
+
}
|
|
22243
|
+
return [3 /*break*/, 6];
|
|
22244
|
+
case 4: return [4 /*yield*/, env.fetcher(source, props.data)];
|
|
22245
|
+
case 5:
|
|
22246
|
+
res = _m.sent();
|
|
22247
|
+
valueOptions_1 = ((_k = res === null || res === void 0 ? void 0 : res.data) === null || _k === void 0 ? void 0 : _k.options) || [];
|
|
22248
|
+
fieldValue = (_l = props.data) === null || _l === void 0 ? void 0 : _l[steedosField.name];
|
|
22249
|
+
values = fieldValue;
|
|
22250
|
+
if (_$1.isString(values)) {
|
|
22251
|
+
values = [values];
|
|
22252
|
+
}
|
|
22253
|
+
if (values && values.length > 0) {
|
|
22254
|
+
disPlayValue_1 = [];
|
|
22255
|
+
_$1.each(values, function (value) {
|
|
22256
|
+
var option = valueOptions_1.find(function (item) { return item.value === value; });
|
|
22257
|
+
if (option) {
|
|
22258
|
+
disPlayValue_1.push({
|
|
22259
|
+
objectName: referenceTo_1,
|
|
22260
|
+
value: option._id || option.value,
|
|
22261
|
+
label: option.label
|
|
22262
|
+
});
|
|
22263
|
+
}
|
|
22264
|
+
});
|
|
22265
|
+
fieldBaseProps = Object.assign({}, fieldBaseProps, { type: 'control', name: null, body: {
|
|
22266
|
+
type: 'form',
|
|
22267
|
+
className: "steedos-field-lookup-wrapper p-0",
|
|
22268
|
+
"wrapWithPanel": false,
|
|
22269
|
+
"actions": [],
|
|
22270
|
+
data: (_e = {},
|
|
22271
|
+
_e[steedosField.name] = disPlayValue_1,
|
|
22272
|
+
_e),
|
|
22273
|
+
body: [
|
|
22274
|
+
{
|
|
22275
|
+
type: 'each',
|
|
22276
|
+
className: "steedos-field-lookup-each flex flex-wrap gap-2",
|
|
22277
|
+
source: "${".concat(steedosField.name, "}"),
|
|
22278
|
+
items: {
|
|
22279
|
+
type: 'static',
|
|
22280
|
+
className: 'm-0',
|
|
22281
|
+
tpl: "<a href=\"/app/-/${objectName}/view/${value}\" target=\"_blank\">${label}</a>",
|
|
22282
|
+
popOver: fieldRefObject.compactLayouts ? {
|
|
22283
|
+
"trigger": "hover",
|
|
22284
|
+
"className": "steedos-record-detail-popover",
|
|
22285
|
+
"position": "left-bottom",
|
|
22286
|
+
"showIcon": false,
|
|
22287
|
+
"title": false,
|
|
22288
|
+
"offset": {
|
|
22289
|
+
"top": 0,
|
|
22290
|
+
"left": 20
|
|
22291
|
+
},
|
|
22292
|
+
"body": [
|
|
22293
|
+
{
|
|
22294
|
+
"type": "steedos-record-mini",
|
|
22295
|
+
"objectApiName": "${objectName}",
|
|
22296
|
+
"recordId": "${value}",
|
|
22297
|
+
"showButtons": false,
|
|
22298
|
+
"showBackButton": false,
|
|
22299
|
+
"data": {
|
|
22300
|
+
"objectName": "${objectName}",
|
|
22301
|
+
"recordId": "${value}"
|
|
22302
|
+
}
|
|
22303
|
+
}
|
|
22304
|
+
]
|
|
22305
|
+
} : null
|
|
22306
|
+
}
|
|
22307
|
+
}
|
|
22308
|
+
]
|
|
22309
|
+
} });
|
|
22310
|
+
}
|
|
22311
|
+
else {
|
|
22312
|
+
fieldBaseProps = Object.assign({}, fieldBaseProps, { type: 'static', tpl: '-', className: "".concat(fieldBaseProps.className || '', " text-muted") });
|
|
22313
|
+
}
|
|
22314
|
+
_m.label = 6;
|
|
22315
|
+
case 6:
|
|
22030
22316
|
schema = Object.assign({}, fieldBaseProps, _$1.pick(steedosField.amis || {}, ['className', 'inline', 'label', 'labelAlign', 'name', 'labelRemark', 'description', 'placeholder', 'staticClassName', 'staticLabelClassName', 'staticInputClassName', 'staticSchema']));
|
|
22031
22317
|
schema.placeholder = "";
|
|
22318
|
+
// console.log(`steedos field [lookup] schema:`, schema)
|
|
22032
22319
|
return [2 /*return*/, schema];
|
|
22033
|
-
case
|
|
22034
|
-
if (!fStatic) return [3 /*break*/,
|
|
22035
|
-
if (!props.data.hasOwnProperty("_display")) return [3 /*break*/,
|
|
22320
|
+
case 7:
|
|
22321
|
+
if (!fStatic) return [3 /*break*/, 21];
|
|
22322
|
+
if (!props.data.hasOwnProperty("_display")) return [3 /*break*/, 9];
|
|
22036
22323
|
return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
|
|
22037
|
-
case
|
|
22038
|
-
fieldSchema =
|
|
22324
|
+
case 8:
|
|
22325
|
+
fieldSchema = _m.sent();
|
|
22039
22326
|
if (steedosField.type === 'file' && fieldSchema.disabled) {
|
|
22040
22327
|
fieldValue = fieldSchema.value;
|
|
22041
22328
|
if (fieldValue && fieldValue.length) {
|
|
@@ -22071,59 +22358,59 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22071
22358
|
}
|
|
22072
22359
|
}
|
|
22073
22360
|
return [2 /*return*/, fieldSchema];
|
|
22074
|
-
case
|
|
22361
|
+
case 9:
|
|
22075
22362
|
schema = Object.assign({}, steedosField, {
|
|
22076
22363
|
type: getAmisStaticFieldType(steedosField.type, steedosField.data_type, steedosField),
|
|
22077
22364
|
static: true,
|
|
22078
22365
|
label: steedosField.label
|
|
22079
22366
|
});
|
|
22080
|
-
if (!(steedosField.type === "time")) return [3 /*break*/,
|
|
22367
|
+
if (!(steedosField.type === "time")) return [3 /*break*/, 10];
|
|
22081
22368
|
Object.assign(schema, {
|
|
22082
22369
|
inputFormat: 'HH:mm',
|
|
22083
22370
|
timeFormat: 'HH:mm',
|
|
22084
22371
|
format: '1970-01-01THH:mm:00.000[Z]',
|
|
22085
22372
|
});
|
|
22086
|
-
return [3 /*break*/,
|
|
22087
|
-
case
|
|
22088
|
-
if (!(steedosField.type === "percent")) return [3 /*break*/,
|
|
22373
|
+
return [3 /*break*/, 20];
|
|
22374
|
+
case 10:
|
|
22375
|
+
if (!(steedosField.type === "percent")) return [3 /*break*/, 11];
|
|
22089
22376
|
Object.assign(schema, {
|
|
22090
22377
|
"percent": steedosField.scale ? steedosField.scale : true
|
|
22091
22378
|
});
|
|
22092
|
-
return [3 /*break*/,
|
|
22093
|
-
case
|
|
22094
|
-
if (!(steedosField.type === "password")) return [3 /*break*/,
|
|
22379
|
+
return [3 /*break*/, 20];
|
|
22380
|
+
case 11:
|
|
22381
|
+
if (!(steedosField.type === "password")) return [3 /*break*/, 12];
|
|
22095
22382
|
Object.assign(schema, {
|
|
22096
22383
|
"revealPassword": false //没生效,需要用样式隐藏
|
|
22097
22384
|
});
|
|
22098
|
-
return [3 /*break*/,
|
|
22099
|
-
case
|
|
22100
|
-
if (!(steedosField.type === "select")) return [3 /*break*/,
|
|
22385
|
+
return [3 /*break*/, 20];
|
|
22386
|
+
case 12:
|
|
22387
|
+
if (!(steedosField.type === "select")) return [3 /*break*/, 13];
|
|
22101
22388
|
Object.assign(schema, {
|
|
22102
22389
|
"placeholder": ""
|
|
22103
22390
|
});
|
|
22104
|
-
return [3 /*break*/,
|
|
22105
|
-
case
|
|
22106
|
-
if (!(steedosField.type === "color")) return [3 /*break*/,
|
|
22391
|
+
return [3 /*break*/, 20];
|
|
22392
|
+
case 13:
|
|
22393
|
+
if (!(steedosField.type === "color")) return [3 /*break*/, 14];
|
|
22107
22394
|
Object.assign(schema, {
|
|
22108
22395
|
"defaultColor": null
|
|
22109
22396
|
});
|
|
22110
|
-
return [3 /*break*/,
|
|
22111
|
-
case
|
|
22112
|
-
if (!(steedosField.type === "number")) return [3 /*break*/,
|
|
22397
|
+
return [3 /*break*/, 20];
|
|
22398
|
+
case 14:
|
|
22399
|
+
if (!(steedosField.type === "number" || steedosField.type === 'currency')) return [3 /*break*/, 15];
|
|
22113
22400
|
// amis input-number和number组件中的precision表示小数位数,并不是魔方平台的精度概念,要转换下,否则小数点后会显示很多的0
|
|
22114
22401
|
Object.assign(schema, {
|
|
22115
22402
|
"precision": steedosField.scale || 0
|
|
22116
22403
|
});
|
|
22117
|
-
return [3 /*break*/,
|
|
22118
|
-
case
|
|
22119
|
-
if (!(steedosField.type === "table")) return [3 /*break*/,
|
|
22404
|
+
return [3 /*break*/, 20];
|
|
22405
|
+
case 15:
|
|
22406
|
+
if (!(steedosField.type === "table")) return [3 /*break*/, 16];
|
|
22120
22407
|
if (steedosField.subFields) {
|
|
22121
22408
|
tableFields = [];
|
|
22122
22409
|
try {
|
|
22123
|
-
for (_c = __values(
|
|
22410
|
+
for (_c = __values(steedosField.subFields), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
22124
22411
|
subField = _d.value;
|
|
22125
22412
|
if (!subField.name.endsWith(".$")) {
|
|
22126
|
-
subFieldName = subField.name.replace("".concat(
|
|
22413
|
+
subFieldName = subField.name.replace("".concat(steedosField._prefix || '').concat(steedosField.name, ".$."), '').replace("".concat(steedosField.name, "."), '');
|
|
22127
22414
|
// const gridSub = await convertSFieldToAmisField(Object.assign({}, subField, {name: subFieldName, isTableField: true}), readonly, ctx);
|
|
22128
22415
|
tableFields.push(Object.assign({}, subField, { name: subFieldName }));
|
|
22129
22416
|
}
|
|
@@ -22132,13 +22419,12 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22132
22419
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
22133
22420
|
finally {
|
|
22134
22421
|
try {
|
|
22135
|
-
if (_d && !_d.done && (
|
|
22422
|
+
if (_d && !_d.done && (_f = _c.return)) _f.call(_c);
|
|
22136
22423
|
}
|
|
22137
22424
|
finally { if (e_1) throw e_1.error; }
|
|
22138
22425
|
}
|
|
22139
22426
|
Object.assign(schema, {
|
|
22140
22427
|
type: 'steedos-input-table',
|
|
22141
|
-
showIndex: true,
|
|
22142
22428
|
editable: false,
|
|
22143
22429
|
addable: false,
|
|
22144
22430
|
removable: false,
|
|
@@ -22149,9 +22435,9 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22149
22435
|
}
|
|
22150
22436
|
});
|
|
22151
22437
|
}
|
|
22152
|
-
return [3 /*break*/,
|
|
22153
|
-
case
|
|
22154
|
-
if (!(steedosField.type === "image")) return [3 /*break*/,
|
|
22438
|
+
return [3 /*break*/, 20];
|
|
22439
|
+
case 16:
|
|
22440
|
+
if (!(steedosField.type === "image")) return [3 /*break*/, 17];
|
|
22155
22441
|
Object.assign(schema, {
|
|
22156
22442
|
enlargeAble: true,
|
|
22157
22443
|
showToolbar: true,
|
|
@@ -22182,18 +22468,27 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22182
22468
|
return value;
|
|
22183
22469
|
}
|
|
22184
22470
|
});
|
|
22185
|
-
return [3 /*break*/,
|
|
22186
|
-
case
|
|
22187
|
-
if (!(steedosField.type === "file")) return [3 /*break*/,
|
|
22471
|
+
return [3 /*break*/, 20];
|
|
22472
|
+
case 17:
|
|
22473
|
+
if (!(steedosField.type === "file")) return [3 /*break*/, 19];
|
|
22188
22474
|
return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
|
|
22189
|
-
case
|
|
22475
|
+
case 18:
|
|
22190
22476
|
// 附件static模式先保持原来的逻辑,依赖_display,审批王中相关功能在creator中
|
|
22191
22477
|
// convertSFieldToAmisField中会合并steedosField.amis,所以也不需要再次合并steedosField.amis,直接return就好
|
|
22192
|
-
return [2 /*return*/,
|
|
22193
|
-
case
|
|
22478
|
+
return [2 /*return*/, _m.sent()];
|
|
22479
|
+
case 19:
|
|
22480
|
+
if (steedosField.type === 'formula' || steedosField.type === 'summary') {
|
|
22481
|
+
if (steedosField.data_type === 'number' || steedosField.data_type === 'currency') {
|
|
22482
|
+
Object.assign(schema, {
|
|
22483
|
+
"precision": steedosField.scale || 0
|
|
22484
|
+
});
|
|
22485
|
+
}
|
|
22486
|
+
}
|
|
22487
|
+
_m.label = 20;
|
|
22488
|
+
case 20:
|
|
22194
22489
|
Object.assign(schema, steedosField.amis || {});
|
|
22195
22490
|
return [2 /*return*/, schema];
|
|
22196
|
-
case
|
|
22491
|
+
case 21:
|
|
22197
22492
|
fieldAmis = steedosField.amis || {};
|
|
22198
22493
|
if (!props.data.hasOwnProperty("_display")) {
|
|
22199
22494
|
// 有_display时保持原来的逻辑不变,不走以下新的逻辑,审批王中会特意传入_display以跳过后面新加的代码
|
|
@@ -22251,16 +22546,16 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22251
22546
|
}
|
|
22252
22547
|
}
|
|
22253
22548
|
return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
|
|
22254
|
-
case
|
|
22255
|
-
schema =
|
|
22549
|
+
case 22:
|
|
22550
|
+
schema = _m.sent();
|
|
22256
22551
|
// console.log(`AmisSteedosField return schema`, schema)
|
|
22257
22552
|
return [2 /*return*/, schema];
|
|
22258
|
-
case
|
|
22259
|
-
case
|
|
22260
|
-
error_1 =
|
|
22553
|
+
case 23: return [3 /*break*/, 25];
|
|
22554
|
+
case 24:
|
|
22555
|
+
error_1 = _m.sent();
|
|
22261
22556
|
console.log("error", error_1);
|
|
22262
|
-
return [3 /*break*/,
|
|
22263
|
-
case
|
|
22557
|
+
return [3 /*break*/, 25];
|
|
22558
|
+
case 25: return [2 /*return*/, null];
|
|
22264
22559
|
}
|
|
22265
22560
|
});
|
|
22266
22561
|
}); };
|
|
@@ -22503,7 +22798,7 @@ var AmisInputTable = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
22503
22798
|
return __generator(this, function (_a) {
|
|
22504
22799
|
switch (_a.label) {
|
|
22505
22800
|
case 0:
|
|
22506
|
-
props.$schema, props.fields, props.name, props.id, props.data, props.columns, props.amis, props.className, props.tableClassName, props.headerToolbar, props.footerToolbar, props.inlineEditMode, props.strictMode, props.dialog;
|
|
22801
|
+
props.$schema, props.fields, props.name, props.id, props.data, props.columns, props.amis, props.className, props.tableClassName, props.headerToolbar, props.footerToolbar, props.inlineEditMode, props.strictMode, props.dialog, props.primaryKey, props.showOperation;
|
|
22507
22802
|
return [4 /*yield*/, getAmisInputTableSchema(props)];
|
|
22508
22803
|
case 1:
|
|
22509
22804
|
amisSchema = _a.sent();
|
|
@@ -22513,6 +22808,46 @@ var AmisInputTable = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
22513
22808
|
});
|
|
22514
22809
|
}); };
|
|
22515
22810
|
|
|
22811
|
+
var AmisRecordDetailMini = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
22812
|
+
var $schema, appId, _a, objectApiName, recordId, schemaData, options, schema;
|
|
22813
|
+
return __generator(this, function (_b) {
|
|
22814
|
+
switch (_b.label) {
|
|
22815
|
+
case 0:
|
|
22816
|
+
props.className, $schema = props.$schema, appId = props.appId, _a = props.objectApiName, objectApiName = _a === void 0 ? "space_users" : _a, props.fields, props.body, props.style, props.onEvent, recordId = props.recordId;
|
|
22817
|
+
schemaData = {};
|
|
22818
|
+
if (_$1.has(props.data, "recordId") && props.data.recordId !== "${recordId}") {
|
|
22819
|
+
recordId = props.data.recordId;
|
|
22820
|
+
schemaData.recordId = recordId;
|
|
22821
|
+
}
|
|
22822
|
+
if (_$1.has(props.data, "value")) {
|
|
22823
|
+
recordId = props.data.value;
|
|
22824
|
+
schemaData.recordId = recordId;
|
|
22825
|
+
}
|
|
22826
|
+
if (_$1.has(props.data, "objectName") && props.data.objectName !== "${objectName}") {
|
|
22827
|
+
objectApiName = props.data.objectName;
|
|
22828
|
+
schemaData.objectName = objectApiName;
|
|
22829
|
+
}
|
|
22830
|
+
options = {
|
|
22831
|
+
onEvent: $schema.onEvent,
|
|
22832
|
+
data: $schema.data,
|
|
22833
|
+
recordId: recordId
|
|
22834
|
+
};
|
|
22835
|
+
if (props.$$editor) {
|
|
22836
|
+
options.isEditor = true;
|
|
22837
|
+
}
|
|
22838
|
+
console.log("AmisRecordDetailMini==2=>", objectApiName, options);
|
|
22839
|
+
return [4 /*yield*/, getRecordDetailMiniSchema(objectApiName, appId, options)];
|
|
22840
|
+
case 1:
|
|
22841
|
+
schema = _b.sent();
|
|
22842
|
+
if (!_$1.isEmpty(schemaData)) {
|
|
22843
|
+
schema.data = schemaData;
|
|
22844
|
+
}
|
|
22845
|
+
// console.log(`AmisRecordDetailMini===>`, schema)
|
|
22846
|
+
return [2 /*return*/, schema];
|
|
22847
|
+
}
|
|
22848
|
+
});
|
|
22849
|
+
}); };
|
|
22850
|
+
|
|
22516
22851
|
var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
22517
22852
|
var formFactor, appId, objectApiName, display, data, _display, page, listSchema;
|
|
22518
22853
|
return __generator(this, function (_b) {
|
|
@@ -22593,7 +22928,7 @@ var PageRecordDetail = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22593
22928
|
"type": "steedos-record-detail",
|
|
22594
22929
|
// "recordId": "${recordId}",
|
|
22595
22930
|
"objectApiName": "${objectName}",
|
|
22596
|
-
className: "sm:m-3",
|
|
22931
|
+
// className: "sm:m-3",
|
|
22597
22932
|
appId: appId,
|
|
22598
22933
|
}
|
|
22599
22934
|
],
|
|
@@ -22608,7 +22943,7 @@ var PageRecordDetail = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22608
22943
|
"actions": [
|
|
22609
22944
|
{
|
|
22610
22945
|
"actionType": "custom",
|
|
22611
|
-
"script": "window.Steedos && window.Steedos.setDocumentTitle && Steedos.setDocumentTitle({pageName: event.data.record.name})"
|
|
22946
|
+
"script": "window.Steedos && window.Steedos.setDocumentTitle && Steedos.setDocumentTitle({pageName: event.data.record.name}); $('.steedos-record-tr').removeClass('steedos-record-selected');$('.steedos-record-tr-'+event.data.record._id).addClass('steedos-record-selected');"
|
|
22612
22947
|
}
|
|
22613
22948
|
]
|
|
22614
22949
|
}
|
|
@@ -22687,7 +23022,21 @@ var PageObject = function (props) { return __awaiter(void 0, void 0, void 0, fun
|
|
|
22687
23022
|
"visibleOn": "${pageType !== 'record' && pageType !== 'list'}"
|
|
22688
23023
|
}
|
|
22689
23024
|
]
|
|
22690
|
-
}
|
|
23025
|
+
},
|
|
23026
|
+
// onEvent: {
|
|
23027
|
+
// "recordLoaded": {
|
|
23028
|
+
// "actions": [
|
|
23029
|
+
// {
|
|
23030
|
+
// "actionType": "setValue",
|
|
23031
|
+
// "args": {
|
|
23032
|
+
// "value": {
|
|
23033
|
+
// "steedos_selected_recordId": "${event.data.record._id}"
|
|
23034
|
+
// }
|
|
23035
|
+
// }
|
|
23036
|
+
// }
|
|
23037
|
+
// ]
|
|
23038
|
+
// }
|
|
23039
|
+
// }
|
|
22691
23040
|
}];
|
|
22692
23041
|
}
|
|
22693
23042
|
});
|
|
@@ -22719,6 +23068,7 @@ exports.AmisObjectTable = AmisObjectTable;
|
|
|
22719
23068
|
exports.AmisProvider = AmisProvider;
|
|
22720
23069
|
exports.AmisRecordDetail = AmisRecordDetail;
|
|
22721
23070
|
exports.AmisRecordDetailHeader = AmisRecordDetailHeader;
|
|
23071
|
+
exports.AmisRecordDetailMini = AmisRecordDetailMini;
|
|
22722
23072
|
exports.AmisRecordDetailRelatedList = AmisRecordDetailRelatedList;
|
|
22723
23073
|
exports.AmisRecordDetailRelatedLists = AmisRecordDetailRelatedLists;
|
|
22724
23074
|
exports.AmisRecordService = AmisRecordService;
|