@steedos-widgets/amis-object 3.6.2-beta.5 → 3.6.2-beta.7
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/AmisRecordDetail.d.ts +0 -3
- package/dist/amis/AmisRecordDetailHeader.d.ts +0 -7
- package/dist/amis/AmisRecordService.d.ts +36 -16
- package/dist/amis-object.cjs.css +40 -35
- package/dist/amis-object.cjs.js +186 -211
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +40 -35
- package/dist/amis-object.esm.js +186 -211
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +40 -35
- package/dist/amis-object.umd.js +67 -56
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +21 -21
- package/dist/pages/PageObject.d.ts +1 -0
- package/package.json +3 -3
package/dist/amis-object.esm.js
CHANGED
|
@@ -4556,9 +4556,9 @@ var frontend_display_type_is_split = "分栏视图";
|
|
|
4556
4556
|
var frontend_display_as = "显示为";
|
|
4557
4557
|
var frontend_record_sum = "个项目";
|
|
4558
4558
|
var frontend_button_reload_tooltip = "刷新";
|
|
4559
|
-
var frontend_button_search_tooltip = "
|
|
4559
|
+
var frontend_button_search_tooltip = "搜索";
|
|
4560
4560
|
var frontend_fields_filter_button_search = "搜索";
|
|
4561
|
-
var frontend_fields_filter_button_settings = "
|
|
4561
|
+
var frontend_fields_filter_button_settings = "选择搜索项";
|
|
4562
4562
|
var frontend_button_listview_control_tooltip = "列表视图控制";
|
|
4563
4563
|
var frontend_button_listview_control_label = "列表视图控制";
|
|
4564
4564
|
var frontend_listview_control_columns = "显示的列";
|
|
@@ -5212,12 +5212,11 @@ async function getTableColumns$1(fields, options){
|
|
|
5212
5212
|
//增加quickEdit属性,实现快速编辑
|
|
5213
5213
|
const quickEditSchema = allowEdit ? await getQuickEditSchema(field, options) : allowEdit;
|
|
5214
5214
|
let className = "";
|
|
5215
|
-
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
// }
|
|
5215
|
+
if(field.wrap != true){
|
|
5216
|
+
className += " whitespace-nowrap ";
|
|
5217
|
+
}else {
|
|
5218
|
+
className += " break-words ";
|
|
5219
|
+
}
|
|
5221
5220
|
let columnItem;
|
|
5222
5221
|
if((field.is_name || field.name === options.labelFieldName) && options.objectName === 'cms_files'){
|
|
5223
5222
|
const previewFileScript = `
|
|
@@ -5749,7 +5748,7 @@ async function getTableSchema$1(fields, options){
|
|
|
5749
5748
|
}
|
|
5750
5749
|
return {
|
|
5751
5750
|
mode: "cards",
|
|
5752
|
-
perPageAvailable: [
|
|
5751
|
+
perPageAvailable: [20, 50, 100, 500],
|
|
5753
5752
|
name: "thelist",
|
|
5754
5753
|
headerToolbarClassName: "py-2 px-2 border-gray-300 border-solid border-b",
|
|
5755
5754
|
className: "",
|
|
@@ -5782,7 +5781,7 @@ async function getTableSchema$1(fields, options){
|
|
|
5782
5781
|
|
|
5783
5782
|
return {
|
|
5784
5783
|
mode: "table",
|
|
5785
|
-
perPageAvailable: [
|
|
5784
|
+
perPageAvailable: [20, 50, 100, 500],
|
|
5786
5785
|
name: "thelist",
|
|
5787
5786
|
headerToolbarClassName: "py-2 px-2 border-gray-300 border-solid border-b",
|
|
5788
5787
|
className: "",
|
|
@@ -6288,7 +6287,7 @@ function getReadonlyFormAdaptor(object, fields, options){
|
|
|
6288
6287
|
payload.data.__objectName = "${object.name}";
|
|
6289
6288
|
payload.data.record = record;
|
|
6290
6289
|
|
|
6291
|
-
payload.data.
|
|
6290
|
+
payload.data.NAME_FIELD_VALUE = record.${object.NAME_FIELD_KEY || 'name'};
|
|
6292
6291
|
payload.data._master = {
|
|
6293
6292
|
record: record,
|
|
6294
6293
|
objectName: "${object.name}",
|
|
@@ -6443,7 +6442,7 @@ async function getEditFormInitApi(object, recordId, fields, options){
|
|
|
6443
6442
|
cache: API_CACHE,
|
|
6444
6443
|
requestAdaptor: `
|
|
6445
6444
|
// 所有不想在network请求中发送的数据都应该从data中分离出来,data变量只需要留下query才需要发送出去
|
|
6446
|
-
var { recordId, objectName, uiSchema, global, context, ...data} = api.data;
|
|
6445
|
+
var { recordId, objectName, uiSchema, global, context, _master, ...data} = api.data;
|
|
6447
6446
|
if(!recordId){
|
|
6448
6447
|
// 新建则不请求任何数据
|
|
6449
6448
|
data.query = "{data:" + objectName + "(filters: " + JSON.stringify(["_id", "=", null]) + ", top: 1){_id}}";
|
|
@@ -6518,15 +6517,17 @@ async function getEditFormInitApi(object, recordId, fields, options){
|
|
|
6518
6517
|
}
|
|
6519
6518
|
// data下的变量需要在保存接口(getSaveApi)中被删除。
|
|
6520
6519
|
payload.data = {
|
|
6521
|
-
...initialValues
|
|
6520
|
+
...initialValues,
|
|
6521
|
+
editFormInited: true
|
|
6522
6522
|
}
|
|
6523
6523
|
${options.initApiAdaptor || ''}
|
|
6524
|
+
// console.log('getEditFormInitApi======>', payload);
|
|
6524
6525
|
return payload;
|
|
6525
6526
|
`,
|
|
6526
|
-
responseData: {
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
},
|
|
6527
|
+
// responseData: {
|
|
6528
|
+
// initialValues: "$$",
|
|
6529
|
+
// editFormInited: true
|
|
6530
|
+
// },
|
|
6530
6531
|
data: data,
|
|
6531
6532
|
headers: {
|
|
6532
6533
|
Authorization: "Bearer ${context.tenantId},${context.authToken}"
|
|
@@ -9816,8 +9817,7 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
|
9816
9817
|
},
|
|
9817
9818
|
{
|
|
9818
9819
|
"type": "tpl",
|
|
9819
|
-
"tpl": "${
|
|
9820
|
-
// "tpl": "${(record && uiSchema && record[uiSchema.NAME_FIELD_KEY]) || name}",
|
|
9820
|
+
"tpl": "${NAME_FIELD_VALUE}",
|
|
9821
9821
|
"inline": false,
|
|
9822
9822
|
"wrapperComponent": "",
|
|
9823
9823
|
"className": "record-detail-header-name leading-5 text-xl font-bold"
|
|
@@ -9845,7 +9845,7 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
|
9845
9845
|
let body = [
|
|
9846
9846
|
{
|
|
9847
9847
|
"type": "wrapper",
|
|
9848
|
-
"className": "p-4",
|
|
9848
|
+
"className": "p-4 bg-gray-100 border-b sm:sticky top-0 z-10",
|
|
9849
9849
|
"body": [
|
|
9850
9850
|
{
|
|
9851
9851
|
"type": "grid",
|
|
@@ -9892,7 +9892,7 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
|
9892
9892
|
|
|
9893
9893
|
body.push({
|
|
9894
9894
|
"type": "form",
|
|
9895
|
-
"className": "p-4
|
|
9895
|
+
"className": "p-4 bg-white compact-layouts",
|
|
9896
9896
|
"wrapWithPanel": false,
|
|
9897
9897
|
"actions": [],
|
|
9898
9898
|
"body": details,
|
|
@@ -9904,7 +9904,6 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
|
9904
9904
|
type: 'service',
|
|
9905
9905
|
id: `page_readonly_${name}_header`,
|
|
9906
9906
|
name: `page`,
|
|
9907
|
-
data: { objectName: name, _id: recordId, recordPermissions: objectSchema.permissions, uiSchema: objectSchema, record: "${record}" },
|
|
9908
9907
|
body: body,
|
|
9909
9908
|
className: ''
|
|
9910
9909
|
}
|
|
@@ -9976,7 +9975,7 @@ async function getObjectRecordDetailRelatedListHeader(relatedObjectSchema, relat
|
|
|
9976
9975
|
"className": "flex justify-between"
|
|
9977
9976
|
}
|
|
9978
9977
|
],
|
|
9979
|
-
"className": "
|
|
9978
|
+
"className": "pt-0 pb-2 px-0"
|
|
9980
9979
|
};
|
|
9981
9980
|
return recordRelatedListHeader;
|
|
9982
9981
|
}
|
|
@@ -11111,7 +11110,7 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
11111
11110
|
{
|
|
11112
11111
|
"type": "search-box",
|
|
11113
11112
|
"name": keywordsSearchBoxName,
|
|
11114
|
-
"placeholder": "
|
|
11113
|
+
"placeholder": "快捷搜索",
|
|
11115
11114
|
"value": crudKeywords,
|
|
11116
11115
|
// "clearable": true,//因为清除并不会触发失去焦点事件,只有禁用,但是它会触发change事件,所以等升级到amis 3.4+后可以重新放开
|
|
11117
11116
|
"clearAndSubmit": true,
|
|
@@ -11712,7 +11711,9 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
11712
11711
|
return payload;
|
|
11713
11712
|
`
|
|
11714
11713
|
},
|
|
11715
|
-
rowClassNameExpr
|
|
11714
|
+
// 外层data发生变化的时候, 不会重新渲染rowClassNameExpr, 所以先用css标记tr唯一标识
|
|
11715
|
+
// 使用表达式给tr添加初始选中状态
|
|
11716
|
+
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 %>"
|
|
11716
11717
|
}, bodyProps);
|
|
11717
11718
|
|
|
11718
11719
|
}
|
|
@@ -11727,7 +11728,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
11727
11728
|
|
|
11728
11729
|
if(body.columns && options.formFactor != 'SMALL'){
|
|
11729
11730
|
//将_display放入crud的columns的倒数第二列中(最后一列会影响固定列),可以通过setvalue修改行内数据域的_display,而不影响上层items的_display,用于批量编辑
|
|
11730
|
-
body.columns.splice(body.columns.length -1 , 0, {name: '_display',type: 'static', width: 1, placeholder: "",id: objectSchema.name + "_display_${_index}", tpl: "${}"});
|
|
11731
|
+
body.columns.splice(body.columns.length -1 , 0, {name: '_display',type: 'static', width: 1, placeholder: "",id: objectSchema.name + "_display_${_index}", tpl: "${''}"});
|
|
11731
11732
|
}
|
|
11732
11733
|
|
|
11733
11734
|
if (defaults) {
|
|
@@ -11862,9 +11863,7 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
11862
11863
|
id: `service_${formSchema.id}`,
|
|
11863
11864
|
className: 'p-0',
|
|
11864
11865
|
name: `page_edit_${recordId}`,
|
|
11865
|
-
api: await getEditFormInitApi(objectSchema, recordId, fields, ctx),
|
|
11866
11866
|
data:{
|
|
11867
|
-
editFormInited: false,
|
|
11868
11867
|
...amisData
|
|
11869
11868
|
},
|
|
11870
11869
|
// data: {global: getGlobalData('edit'), recordId: recordId, objectName: objectSchema.name, context: {rootUrl: getRootUrl(), tenantId: getTenantId(), authToken: getAuthToken()}},
|
|
@@ -11873,8 +11872,9 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
11873
11872
|
body: [defaultsDeep({}, formSchema, {
|
|
11874
11873
|
type: "form",
|
|
11875
11874
|
mode: layout,
|
|
11875
|
+
initApi: await getEditFormInitApi(objectSchema, recordId, fields, ctx),
|
|
11876
11876
|
data: {
|
|
11877
|
-
|
|
11877
|
+
editFormInited: false,
|
|
11878
11878
|
},
|
|
11879
11879
|
labelAlign,
|
|
11880
11880
|
persistData: false,
|
|
@@ -11888,11 +11888,15 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
11888
11888
|
submitText: "", // amis 表单不显示提交按钮, 表单提交由项目代码接管
|
|
11889
11889
|
api: await getSaveApi(objectSchema, recordId, fields, ctx),
|
|
11890
11890
|
initFetch: recordId != 'new',
|
|
11891
|
-
body:
|
|
11891
|
+
body: {
|
|
11892
|
+
type: 'wrapper',
|
|
11893
|
+
className: 'p-0 m-0',
|
|
11894
|
+
body: await getFormBody(fields, formFields, Object.assign({}, ctx, {fieldGroups: objectSchema.field_groups})),
|
|
11895
|
+
hiddenOn: "${editFormInited != true}",
|
|
11896
|
+
},
|
|
11892
11897
|
panelClassName:'m-0 sm:rounded-lg shadow-none border-none',
|
|
11893
11898
|
bodyClassName: 'p-0',
|
|
11894
11899
|
className: 'steedos-amis-form',
|
|
11895
|
-
hiddenOn: "${editFormInited != true}",
|
|
11896
11900
|
onEvent: {
|
|
11897
11901
|
"submitSucc": {
|
|
11898
11902
|
"weight": 0,
|
|
@@ -12275,7 +12279,7 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
|
|
|
12275
12279
|
amisSchema: {
|
|
12276
12280
|
type: "service",
|
|
12277
12281
|
id: componentId,
|
|
12278
|
-
className: `steedos-record-related-list
|
|
12282
|
+
className: `steedos-record-related-list pt-4 pb-2 border-b first:pt-0 last:border-0 ${componentId} ${className}`,
|
|
12279
12283
|
data: {
|
|
12280
12284
|
relatedKey: relatedKey,
|
|
12281
12285
|
listViewId: `amis-\${appId}-${relatedObjectName}-listview`,
|
|
@@ -12504,7 +12508,7 @@ async function getObjectRelatedListsMiniSchema(objectApiName){
|
|
|
12504
12508
|
* @Author: baozhoutao@steedos.com
|
|
12505
12509
|
* @Date: 2022-07-05 15:55:39
|
|
12506
12510
|
* @LastEditors: baozhoutao@steedos.com
|
|
12507
|
-
* @LastEditTime: 2024-01-
|
|
12511
|
+
* @LastEditTime: 2024-01-16 11:14:34
|
|
12508
12512
|
* @Description:
|
|
12509
12513
|
*/
|
|
12510
12514
|
|
|
@@ -13002,34 +13006,29 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
|
|
|
13002
13006
|
"label": "对象表单",
|
|
13003
13007
|
"objectApiName": "${objectName}",
|
|
13004
13008
|
"recordId": "${recordId}",
|
|
13005
|
-
"id": "u:d4a495811d57",
|
|
13006
13009
|
appId: appId
|
|
13007
13010
|
}
|
|
13008
13011
|
],
|
|
13009
|
-
"id": "u:5d4e7e3f6ecc"
|
|
13010
13012
|
};
|
|
13011
13013
|
const related = {
|
|
13012
13014
|
"title": instance.t('frontend_record_detail_tab_related'),
|
|
13013
|
-
"className": "px-0
|
|
13015
|
+
"className": "px-0 py-4",
|
|
13014
13016
|
"body": [
|
|
13015
13017
|
{
|
|
13016
13018
|
"type": "steedos-object-related-lists",
|
|
13017
13019
|
"label": "相关列表",
|
|
13018
13020
|
"objectApiName": "${objectName}",
|
|
13019
13021
|
"recordId": "${recordId}",
|
|
13020
|
-
"id": "u:3b85b7b7a7f6",
|
|
13021
13022
|
appId: appId
|
|
13022
13023
|
}
|
|
13023
13024
|
],
|
|
13024
|
-
"id": "u:1a0326aeec2b"
|
|
13025
13025
|
};
|
|
13026
13026
|
const content = {
|
|
13027
13027
|
"type": "tabs",
|
|
13028
|
-
"className": "
|
|
13028
|
+
"className": "steedos-record-tabs p-4 m-0",
|
|
13029
13029
|
"tabs": [
|
|
13030
13030
|
detailed
|
|
13031
13031
|
],
|
|
13032
|
-
"id": "u:a649e4094a12"
|
|
13033
13032
|
};
|
|
13034
13033
|
if(relatedLists.length){
|
|
13035
13034
|
content.tabs.push(related);
|
|
@@ -13058,88 +13057,73 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
|
|
|
13058
13057
|
}
|
|
13059
13058
|
}
|
|
13060
13059
|
|
|
13061
|
-
async function getRecordServiceSchema(objectName, appId, props = {}) {
|
|
13060
|
+
async function getRecordServiceSchema(objectName, appId, props = {}, body) {
|
|
13062
13061
|
const uiSchema = await getUISchema(objectName);
|
|
13063
13062
|
const fields = _$1__default.values(uiSchema.fields);
|
|
13063
|
+
const serviceId = `u:steedos-record-service-${objectName}`;
|
|
13064
13064
|
return {
|
|
13065
13065
|
uiSchema,
|
|
13066
13066
|
amisSchema: {
|
|
13067
|
-
|
|
13068
|
-
className:
|
|
13069
|
-
api: await getReadonlyFormInitApi(uiSchema, props.recordId, fields, props),
|
|
13070
|
-
"body": {
|
|
13071
|
-
"type": "wrapper",
|
|
13072
|
-
"className": "p-0 m-0",
|
|
13073
|
-
"body": [],
|
|
13074
|
-
"hiddenOn": "${recordLoaded != true}"
|
|
13075
|
-
},
|
|
13076
|
-
data: {
|
|
13077
|
-
"_master.objectName": "${objectName}",
|
|
13078
|
-
"_master.recordId": "${recordId}",
|
|
13079
|
-
...(props.data || {})
|
|
13080
|
-
},
|
|
13081
|
-
"style": {
|
|
13082
|
-
// "padding": "var(--Page-body-padding)",
|
|
13083
|
-
...props.style
|
|
13084
|
-
},
|
|
13067
|
+
type: 'service',
|
|
13068
|
+
className: "p-0 m-0",
|
|
13085
13069
|
onEvent: {
|
|
13086
13070
|
[`@data.changed.${objectName}`]: {
|
|
13087
|
-
"actions": [
|
|
13088
|
-
{
|
|
13089
|
-
"actionType": "reload",
|
|
13090
|
-
"expression": "this.__deletedRecord != true"
|
|
13091
|
-
},
|
|
13092
|
-
{
|
|
13093
|
-
"actionType": "custom",
|
|
13094
|
-
"script": "window.goBack()",
|
|
13095
|
-
"expression": "this.__deletedRecord === true"
|
|
13096
|
-
}
|
|
13097
|
-
]
|
|
13098
|
-
},
|
|
13099
|
-
// 如果定义了fetchInited,则无法接收到广播事件@data.changed
|
|
13100
|
-
// "fetchInited": {
|
|
13101
|
-
// "weight": 0,
|
|
13102
|
-
// "actions": [
|
|
13103
|
-
// // {
|
|
13104
|
-
// // actionType: 'broadcast',
|
|
13105
|
-
// // eventName: "recordLoaded",
|
|
13106
|
-
// // args: {
|
|
13107
|
-
// // eventName: "recordLoaded"
|
|
13108
|
-
// // },
|
|
13109
|
-
// // data: {
|
|
13110
|
-
// // objectName: "${event.data.__objectName}",
|
|
13111
|
-
// // record: "${event.data.__record}"
|
|
13112
|
-
// // },
|
|
13113
|
-
// // expression: "${event.data.__response.error != true}"
|
|
13114
|
-
// // },
|
|
13115
|
-
// {
|
|
13116
|
-
// "actionType": "setValue",
|
|
13117
|
-
// "args": {
|
|
13118
|
-
// value: {
|
|
13119
|
-
// "recordLoaded": true,
|
|
13120
|
-
// }
|
|
13121
|
-
// },
|
|
13122
|
-
// expression: "${event.data.__response.error != true}"
|
|
13123
|
-
// }
|
|
13124
|
-
// ]
|
|
13125
|
-
// },
|
|
13126
|
-
"recordLoaded": {
|
|
13127
13071
|
"actions": [
|
|
13128
13072
|
{
|
|
13129
13073
|
"actionType": "reload",
|
|
13130
|
-
"
|
|
13131
|
-
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
|
|
13074
|
+
"componentId": serviceId,
|
|
13075
|
+
"expression": "this.__deletedRecord != true"
|
|
13076
|
+
},
|
|
13077
|
+
{
|
|
13078
|
+
"actionType": "custom",
|
|
13079
|
+
"script": "window.goBack()",
|
|
13080
|
+
"expression": "this.__deletedRecord === true"
|
|
13137
13081
|
}
|
|
13138
13082
|
]
|
|
13139
13083
|
},
|
|
13140
|
-
|
|
13084
|
+
},
|
|
13085
|
+
body: {
|
|
13086
|
+
"type": "service",
|
|
13087
|
+
id: serviceId,
|
|
13088
|
+
className: 'steedos-record-service p-0',
|
|
13089
|
+
api: await getReadonlyFormInitApi(uiSchema, props.recordId, fields, props),
|
|
13090
|
+
body: {
|
|
13091
|
+
"type": "wrapper",
|
|
13092
|
+
"className": "p-0 m-0",
|
|
13093
|
+
"body": body || [],
|
|
13094
|
+
"hiddenOn": "${recordLoaded != true}"
|
|
13095
|
+
},
|
|
13096
|
+
data: {
|
|
13097
|
+
"_master.objectName": "${objectName}",
|
|
13098
|
+
"_master.recordId": "${recordId}",
|
|
13099
|
+
...(props.data || {})
|
|
13100
|
+
},
|
|
13101
|
+
"style": {
|
|
13102
|
+
// "padding": "var(--Page-body-padding)",
|
|
13103
|
+
...props.style
|
|
13104
|
+
},
|
|
13105
|
+
onEvent: {
|
|
13106
|
+
// 如果定义了fetchInited,则无法接收到广播事件@data.changed
|
|
13107
|
+
"fetchInited": {
|
|
13108
|
+
"weight": 0,
|
|
13109
|
+
"actions": [
|
|
13110
|
+
{
|
|
13111
|
+
actionType: 'broadcast',
|
|
13112
|
+
eventName: "recordLoaded",
|
|
13113
|
+
data: {
|
|
13114
|
+
objectName: "${event.data.__objectName}",
|
|
13115
|
+
record: "${event.data.record}"
|
|
13116
|
+
},
|
|
13117
|
+
expression: "${event.data.__response.error != true}"
|
|
13118
|
+
},
|
|
13119
|
+
]
|
|
13120
|
+
},
|
|
13121
|
+
...props.onEvent
|
|
13122
|
+
}
|
|
13141
13123
|
}
|
|
13142
13124
|
}
|
|
13125
|
+
|
|
13126
|
+
|
|
13143
13127
|
}
|
|
13144
13128
|
}
|
|
13145
13129
|
|
|
@@ -16035,7 +16019,7 @@ async function getFormBody(permissionFields, formFields, ctx){
|
|
|
16035
16019
|
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
16036
16020
|
* @Date: 2023-11-15 09:50:22
|
|
16037
16021
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
16038
|
-
* @LastEditTime: 2024-01-
|
|
16022
|
+
* @LastEditTime: 2024-01-16 14:58:51
|
|
16039
16023
|
*/
|
|
16040
16024
|
|
|
16041
16025
|
/**
|
|
@@ -16972,38 +16956,44 @@ const getAmisInputTableSchema = async (props) => {
|
|
|
16972
16956
|
if (!props.primaryKey) {
|
|
16973
16957
|
props.primaryKey = "_id";
|
|
16974
16958
|
}
|
|
16959
|
+
let showOperation = props.showOperation;
|
|
16960
|
+
if(showOperation !== false){
|
|
16961
|
+
showOperation = true;
|
|
16962
|
+
}
|
|
16975
16963
|
let serviceId = getComponentId("table_service", props.id);
|
|
16976
16964
|
let buttonsForColumnOperations = [];
|
|
16977
16965
|
let inlineEditMode = props.inlineEditMode;
|
|
16978
16966
|
let showAsInlineEditMode = inlineEditMode && props.editable;
|
|
16979
|
-
if
|
|
16980
|
-
|
|
16981
|
-
|
|
16982
|
-
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
|
|
16986
|
-
|
|
16987
|
-
|
|
16988
|
-
|
|
16989
|
-
|
|
16990
|
-
|
|
16967
|
+
if(showOperation){
|
|
16968
|
+
if (props.editable) {
|
|
16969
|
+
let showEditButton = true;
|
|
16970
|
+
if (showAsInlineEditMode) {
|
|
16971
|
+
// 始终显示弹出子表表单按钮,如果需要判断只在有列被隐藏时才需要显示弹出表单按钮放开下面的if逻辑就好
|
|
16972
|
+
showEditButton = true;
|
|
16973
|
+
// // inline edit模式下只在有列被隐藏时才需要显示编辑按钮
|
|
16974
|
+
// if (props.columns && props.columns.length > 0 && props.columns.length < props.fields.length) {
|
|
16975
|
+
// showEditButton = true;
|
|
16976
|
+
// }
|
|
16977
|
+
// else {
|
|
16978
|
+
// showEditButton = false;
|
|
16979
|
+
// }
|
|
16980
|
+
}
|
|
16981
|
+
// 编辑时显示编辑按钮
|
|
16982
|
+
if (showEditButton) {
|
|
16983
|
+
let buttonEditSchema = await getButtonEdit(props, showAsInlineEditMode);
|
|
16984
|
+
buttonsForColumnOperations.push(buttonEditSchema);
|
|
16985
|
+
}
|
|
16991
16986
|
}
|
|
16992
|
-
|
|
16993
|
-
|
|
16994
|
-
|
|
16995
|
-
|
|
16987
|
+
else {
|
|
16988
|
+
// 只读时显示查看按钮
|
|
16989
|
+
// 如果想只在有列被隐藏时才需要显示查看按钮可以加上判断:if (props.columns && props.columns.length > 0 && props.columns.length < props.fields.length)
|
|
16990
|
+
let buttonViewSchema = await getButtonView(props);
|
|
16991
|
+
buttonsForColumnOperations.push(buttonViewSchema);
|
|
16992
|
+
}
|
|
16993
|
+
if (props.removable) {
|
|
16994
|
+
let buttonDeleteSchema = await getButtonDelete(props);
|
|
16995
|
+
buttonsForColumnOperations.push(buttonDeleteSchema);
|
|
16996
16996
|
}
|
|
16997
|
-
}
|
|
16998
|
-
else {
|
|
16999
|
-
// 只读时显示查看按钮
|
|
17000
|
-
// 如果想只在有列被隐藏时才需要显示查看按钮可以加上判断:if (props.columns && props.columns.length > 0 && props.columns.length < props.fields.length)
|
|
17001
|
-
let buttonViewSchema = await getButtonView(props);
|
|
17002
|
-
buttonsForColumnOperations.push(buttonViewSchema);
|
|
17003
|
-
}
|
|
17004
|
-
if (props.removable) {
|
|
17005
|
-
let buttonDeleteSchema = await getButtonDelete(props);
|
|
17006
|
-
buttonsForColumnOperations.push(buttonDeleteSchema);
|
|
17007
16997
|
}
|
|
17008
16998
|
let inputTableSchema = {
|
|
17009
16999
|
"type": "input-table",
|
|
@@ -17051,7 +17041,7 @@ const getAmisInputTableSchema = async (props) => {
|
|
|
17051
17041
|
return item.depend_on;
|
|
17052
17042
|
});
|
|
17053
17043
|
if (isAnyFieldHasDependOn) {
|
|
17054
|
-
// 有任意一个子字段有depend_on
|
|
17044
|
+
// 有任意一个子字段有depend_on属性时,强制设置禁用静态模式,因为strictMode模式下,dependOn的字段值变更后,不会rerender整个子表
|
|
17055
17045
|
Object.assign(inputTableSchema, {
|
|
17056
17046
|
strictMode: false
|
|
17057
17047
|
});
|
|
@@ -17156,7 +17146,7 @@ async function getListPageInitSchema(objectApiName, formFactor, userSession) {
|
|
|
17156
17146
|
// 获取
|
|
17157
17147
|
async function getRecordPageInitSchema(objectApiName){
|
|
17158
17148
|
const relatedList = await getObjectRelatedList(objectApiName);
|
|
17159
|
-
|
|
17149
|
+
await getUISchema(objectApiName);
|
|
17160
17150
|
let body = [
|
|
17161
17151
|
// detailHeaderAmisSchema,
|
|
17162
17152
|
{
|
|
@@ -17164,28 +17154,7 @@ async function getRecordPageInitSchema(objectApiName){
|
|
|
17164
17154
|
"label": "标题面板",
|
|
17165
17155
|
"objectApiName": "${objectName}",
|
|
17166
17156
|
"recordId": "${recordId}",
|
|
17167
|
-
"onEvent": {
|
|
17168
|
-
"recordLoaded": {
|
|
17169
|
-
"actions": [
|
|
17170
|
-
{
|
|
17171
|
-
"actionType": "setValue",
|
|
17172
|
-
"args": {
|
|
17173
|
-
"value": {
|
|
17174
|
-
"recordLoaded": true,
|
|
17175
|
-
}
|
|
17176
|
-
}
|
|
17177
|
-
},
|
|
17178
|
-
{
|
|
17179
|
-
"actionType": "reload",
|
|
17180
|
-
"data": {
|
|
17181
|
-
"name": `\${record.${uiSchema?.NAME_FIELD_KEY || 'name'}}`,
|
|
17182
|
-
"record": `\${record}`,
|
|
17183
|
-
"recordLoaded": true,
|
|
17184
|
-
}
|
|
17185
|
-
}
|
|
17186
|
-
]
|
|
17187
|
-
}
|
|
17188
|
-
}
|
|
17157
|
+
"onEvent": {}
|
|
17189
17158
|
}
|
|
17190
17159
|
];
|
|
17191
17160
|
let contentBody = {
|
|
@@ -20062,7 +20031,7 @@ var AmisObjectButton = function (props) {
|
|
|
20062
20031
|
if (schema && className) {
|
|
20063
20032
|
schema.className = schema.className + ' steedos-object-button ' + className;
|
|
20064
20033
|
}
|
|
20065
|
-
var renderData = Object.assign(
|
|
20034
|
+
var renderData = Object.assign({}, { objectName: objectName, app_id: appId, className: className });
|
|
20066
20035
|
if (data._id) {
|
|
20067
20036
|
renderData.recordId = data._id;
|
|
20068
20037
|
}
|
|
@@ -20555,7 +20524,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
20555
20524
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
20556
20525
|
},
|
|
20557
20526
|
"requestAdaptor": "api.data={query: '{spaces__findOne(id: \"none\"){_id,name}}'};return api;",
|
|
20558
|
-
"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
|
|
20527
|
+
"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 ")
|
|
20559
20528
|
},
|
|
20560
20529
|
// "body": body,
|
|
20561
20530
|
// "data": serviceData
|
|
@@ -20713,31 +20682,15 @@ var AmisObjectCalendar = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
20713
20682
|
}); };
|
|
20714
20683
|
|
|
20715
20684
|
var AmisRecordDetailHeader = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
20716
|
-
var _a, className, schemaFilter, showButtons, showBackButton,
|
|
20685
|
+
var _a, className, schemaFilter, showButtons, showBackButton, defaultOnEvent, recordId, _b, onEvent, _c, showRecordTitle, objectApiName, schema, config, schemaFilterFun, _config, e_1;
|
|
20717
20686
|
return __generator(this, function (_d) {
|
|
20718
20687
|
switch (_d.label) {
|
|
20719
20688
|
case 0:
|
|
20720
|
-
_a = props.className, className = _a === void 0 ? '
|
|
20689
|
+
_a = props.className, className = _a === void 0 ? 'z-10 p-0 bg-gray-100' : _a, schemaFilter = props.schemaFilter, showButtons = props.showButtons, showBackButton = props.showBackButton;
|
|
20721
20690
|
return [4 /*yield*/, getUISchema(props.objectApiName || "space_users", false)];
|
|
20722
20691
|
case 1:
|
|
20723
|
-
|
|
20724
|
-
defaultOnEvent = {
|
|
20725
|
-
"recordLoaded": {
|
|
20726
|
-
"actions": [
|
|
20727
|
-
{
|
|
20728
|
-
"actionType": "reload",
|
|
20729
|
-
"data": {
|
|
20730
|
-
"name": "${event.data.record.".concat((objectUiSchema === null || objectUiSchema === void 0 ? void 0 : objectUiSchema.NAME_FIELD_KEY) || 'name', "}"),
|
|
20731
|
-
"record": "${event.data.record}",
|
|
20732
|
-
"_id": "\${event.data.record._id}",
|
|
20733
|
-
"recordId": "\${event.data.record._id}",
|
|
20734
|
-
"recordLoaded": true,
|
|
20735
|
-
},
|
|
20736
|
-
"expression": "${event.data.objectName == '".concat(objectUiSchema === null || objectUiSchema === void 0 ? void 0 : objectUiSchema.name, "'}")
|
|
20737
|
-
}
|
|
20738
|
-
]
|
|
20739
|
-
}
|
|
20740
|
-
};
|
|
20692
|
+
_d.sent();
|
|
20693
|
+
defaultOnEvent = {};
|
|
20741
20694
|
props.$schema, recordId = props.recordId, _b = props.onEvent, onEvent = _b === void 0 ? defaultOnEvent : _b, _c = props.showRecordTitle, showRecordTitle = _c === void 0 ? true : _c;
|
|
20742
20695
|
objectApiName = props.objectApiName || "space_users";
|
|
20743
20696
|
return [4 /*yield*/, getRecordDetailHeaderSchema(objectApiName, recordId, { showRecordTitle: showRecordTitle, formFactor: props.data.formFactor, showButtons: showButtons, showBackButton: showBackButton })];
|
|
@@ -20807,7 +20760,7 @@ var AmisRecordDetail = function (props) { return __awaiter(void 0, void 0, void
|
|
|
20807
20760
|
* @Author: baozhoutao@steedos.com
|
|
20808
20761
|
* @Date: 2022-12-08 10:32:17
|
|
20809
20762
|
* @LastEditors: baozhoutao@steedos.com
|
|
20810
|
-
* @LastEditTime: 2024-01-
|
|
20763
|
+
* @LastEditTime: 2024-01-16 14:09:23
|
|
20811
20764
|
* @Description:
|
|
20812
20765
|
*/
|
|
20813
20766
|
var AmisRecordService = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -20826,16 +20779,16 @@ var AmisRecordService = function (props) { return __awaiter(void 0, void 0, void
|
|
|
20826
20779
|
if (props.$$editor) {
|
|
20827
20780
|
options.isEditor = true;
|
|
20828
20781
|
}
|
|
20829
|
-
return [4 /*yield*/, getRecordServiceSchema(objectApiName, appId, options)];
|
|
20782
|
+
return [4 /*yield*/, getRecordServiceSchema(objectApiName, appId, options, body)];
|
|
20830
20783
|
case 1:
|
|
20831
20784
|
schema = (_b.sent()).amisSchema;
|
|
20832
|
-
if (body) {
|
|
20833
|
-
schema.body.body = body;
|
|
20834
|
-
}
|
|
20835
20785
|
if (className) {
|
|
20836
20786
|
schema.className = className;
|
|
20837
20787
|
}
|
|
20838
20788
|
if (style) {
|
|
20789
|
+
if (!schema.style) {
|
|
20790
|
+
schema.style = {};
|
|
20791
|
+
}
|
|
20839
20792
|
Object.assign(schema.style, style);
|
|
20840
20793
|
}
|
|
20841
20794
|
// console.log(`AmisRecordService====schema==>`, schema)
|
|
@@ -22096,13 +22049,13 @@ function getAmisStaticFieldType(type, data_type, options) {
|
|
|
22096
22049
|
return "switch";
|
|
22097
22050
|
}
|
|
22098
22051
|
else if (type === 'currency') {
|
|
22099
|
-
return "number";
|
|
22052
|
+
return "input-number";
|
|
22100
22053
|
}
|
|
22101
22054
|
else if (type === 'autonumber') {
|
|
22102
22055
|
return "input-text"; //不可以用text,因为会出现字段label显示不出来的问题
|
|
22103
22056
|
}
|
|
22104
22057
|
else if (type === 'percent') {
|
|
22105
|
-
return "number";
|
|
22058
|
+
return "input-number";
|
|
22106
22059
|
}
|
|
22107
22060
|
else if (type === 'formula' || type === 'summary') {
|
|
22108
22061
|
return getAmisStaticFieldType(data_type, null, options);
|
|
@@ -22156,7 +22109,7 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22156
22109
|
}
|
|
22157
22110
|
_m.label = 1;
|
|
22158
22111
|
case 1:
|
|
22159
|
-
_m.trys.push([1,
|
|
22112
|
+
_m.trys.push([1, 24, , 25]);
|
|
22160
22113
|
if (!(fStatic && (steedosField.type === 'lookup' || steedosField.type === 'master_detail'))) return [3 /*break*/, 7];
|
|
22161
22114
|
defaultSource = {
|
|
22162
22115
|
"method": "post",
|
|
@@ -22332,7 +22285,7 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22332
22285
|
// console.log(`steedos field [lookup] schema:`, schema)
|
|
22333
22286
|
return [2 /*return*/, schema];
|
|
22334
22287
|
case 7:
|
|
22335
|
-
if (!fStatic) return [3 /*break*/,
|
|
22288
|
+
if (!fStatic) return [3 /*break*/, 21];
|
|
22336
22289
|
if (!props.data.hasOwnProperty("_display")) return [3 /*break*/, 9];
|
|
22337
22290
|
return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
|
|
22338
22291
|
case 8:
|
|
@@ -22384,47 +22337,47 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22384
22337
|
timeFormat: 'HH:mm',
|
|
22385
22338
|
format: '1970-01-01THH:mm:00.000[Z]',
|
|
22386
22339
|
});
|
|
22387
|
-
return [3 /*break*/,
|
|
22340
|
+
return [3 /*break*/, 20];
|
|
22388
22341
|
case 10:
|
|
22389
22342
|
if (!(steedosField.type === "percent")) return [3 /*break*/, 11];
|
|
22390
22343
|
Object.assign(schema, {
|
|
22391
22344
|
"percent": steedosField.scale ? steedosField.scale : true
|
|
22392
22345
|
});
|
|
22393
|
-
return [3 /*break*/,
|
|
22346
|
+
return [3 /*break*/, 20];
|
|
22394
22347
|
case 11:
|
|
22395
22348
|
if (!(steedosField.type === "password")) return [3 /*break*/, 12];
|
|
22396
22349
|
Object.assign(schema, {
|
|
22397
22350
|
"revealPassword": false //没生效,需要用样式隐藏
|
|
22398
22351
|
});
|
|
22399
|
-
return [3 /*break*/,
|
|
22352
|
+
return [3 /*break*/, 20];
|
|
22400
22353
|
case 12:
|
|
22401
22354
|
if (!(steedosField.type === "select")) return [3 /*break*/, 13];
|
|
22402
22355
|
Object.assign(schema, {
|
|
22403
22356
|
"placeholder": ""
|
|
22404
22357
|
});
|
|
22405
|
-
return [3 /*break*/,
|
|
22358
|
+
return [3 /*break*/, 20];
|
|
22406
22359
|
case 13:
|
|
22407
22360
|
if (!(steedosField.type === "color")) return [3 /*break*/, 14];
|
|
22408
22361
|
Object.assign(schema, {
|
|
22409
22362
|
"defaultColor": null
|
|
22410
22363
|
});
|
|
22411
|
-
return [3 /*break*/,
|
|
22364
|
+
return [3 /*break*/, 20];
|
|
22412
22365
|
case 14:
|
|
22413
|
-
if (!(steedosField.type === "number")) return [3 /*break*/, 15];
|
|
22366
|
+
if (!(steedosField.type === "number" || steedosField.type === 'currency')) return [3 /*break*/, 15];
|
|
22414
22367
|
// amis input-number和number组件中的precision表示小数位数,并不是魔方平台的精度概念,要转换下,否则小数点后会显示很多的0
|
|
22415
22368
|
Object.assign(schema, {
|
|
22416
22369
|
"precision": steedosField.scale || 0
|
|
22417
22370
|
});
|
|
22418
|
-
return [3 /*break*/,
|
|
22371
|
+
return [3 /*break*/, 20];
|
|
22419
22372
|
case 15:
|
|
22420
22373
|
if (!(steedosField.type === "table")) return [3 /*break*/, 16];
|
|
22421
22374
|
if (steedosField.subFields) {
|
|
22422
22375
|
tableFields = [];
|
|
22423
22376
|
try {
|
|
22424
|
-
for (_c = __values(
|
|
22377
|
+
for (_c = __values(steedosField.subFields), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
22425
22378
|
subField = _d.value;
|
|
22426
22379
|
if (!subField.name.endsWith(".$")) {
|
|
22427
|
-
subFieldName = subField.name.replace("".concat(
|
|
22380
|
+
subFieldName = subField.name.replace("".concat(steedosField._prefix || '').concat(steedosField.name, ".$."), '').replace("".concat(steedosField.name, "."), '');
|
|
22428
22381
|
// const gridSub = await convertSFieldToAmisField(Object.assign({}, subField, {name: subFieldName, isTableField: true}), readonly, ctx);
|
|
22429
22382
|
tableFields.push(Object.assign({}, subField, { name: subFieldName }));
|
|
22430
22383
|
}
|
|
@@ -22439,7 +22392,6 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22439
22392
|
}
|
|
22440
22393
|
Object.assign(schema, {
|
|
22441
22394
|
type: 'steedos-input-table',
|
|
22442
|
-
showIndex: true,
|
|
22443
22395
|
editable: false,
|
|
22444
22396
|
addable: false,
|
|
22445
22397
|
removable: false,
|
|
@@ -22450,7 +22402,7 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22450
22402
|
}
|
|
22451
22403
|
});
|
|
22452
22404
|
}
|
|
22453
|
-
return [3 /*break*/,
|
|
22405
|
+
return [3 /*break*/, 20];
|
|
22454
22406
|
case 16:
|
|
22455
22407
|
if (!(steedosField.type === "image")) return [3 /*break*/, 17];
|
|
22456
22408
|
Object.assign(schema, {
|
|
@@ -22483,7 +22435,7 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22483
22435
|
return value;
|
|
22484
22436
|
}
|
|
22485
22437
|
});
|
|
22486
|
-
return [3 /*break*/,
|
|
22438
|
+
return [3 /*break*/, 20];
|
|
22487
22439
|
case 17:
|
|
22488
22440
|
if (!(steedosField.type === "file")) return [3 /*break*/, 19];
|
|
22489
22441
|
return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
|
|
@@ -22492,9 +22444,18 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22492
22444
|
// convertSFieldToAmisField中会合并steedosField.amis,所以也不需要再次合并steedosField.amis,直接return就好
|
|
22493
22445
|
return [2 /*return*/, _m.sent()];
|
|
22494
22446
|
case 19:
|
|
22447
|
+
if (steedosField.type === 'formula' || steedosField.type === 'summary') {
|
|
22448
|
+
if (steedosField.data_type === 'number' || steedosField.data_type === 'currency') {
|
|
22449
|
+
Object.assign(schema, {
|
|
22450
|
+
"precision": steedosField.scale || 0
|
|
22451
|
+
});
|
|
22452
|
+
}
|
|
22453
|
+
}
|
|
22454
|
+
_m.label = 20;
|
|
22455
|
+
case 20:
|
|
22495
22456
|
Object.assign(schema, steedosField.amis || {});
|
|
22496
22457
|
return [2 /*return*/, schema];
|
|
22497
|
-
case
|
|
22458
|
+
case 21:
|
|
22498
22459
|
fieldAmis = steedosField.amis || {};
|
|
22499
22460
|
if (!props.data.hasOwnProperty("_display")) {
|
|
22500
22461
|
// 有_display时保持原来的逻辑不变,不走以下新的逻辑,审批王中会特意传入_display以跳过后面新加的代码
|
|
@@ -22552,16 +22513,16 @@ var AmisSteedosField = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22552
22513
|
}
|
|
22553
22514
|
}
|
|
22554
22515
|
return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, ctx)];
|
|
22555
|
-
case
|
|
22516
|
+
case 22:
|
|
22556
22517
|
schema = _m.sent();
|
|
22557
22518
|
// console.log(`AmisSteedosField return schema`, schema)
|
|
22558
22519
|
return [2 /*return*/, schema];
|
|
22559
|
-
case
|
|
22560
|
-
case
|
|
22520
|
+
case 23: return [3 /*break*/, 25];
|
|
22521
|
+
case 24:
|
|
22561
22522
|
error_1 = _m.sent();
|
|
22562
22523
|
console.log("error", error_1);
|
|
22563
|
-
return [3 /*break*/,
|
|
22564
|
-
case
|
|
22524
|
+
return [3 /*break*/, 25];
|
|
22525
|
+
case 25: return [2 /*return*/, null];
|
|
22565
22526
|
}
|
|
22566
22527
|
});
|
|
22567
22528
|
}); };
|
|
@@ -22804,7 +22765,7 @@ var AmisInputTable = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
22804
22765
|
return __generator(this, function (_a) {
|
|
22805
22766
|
switch (_a.label) {
|
|
22806
22767
|
case 0:
|
|
22807
|
-
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;
|
|
22768
|
+
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;
|
|
22808
22769
|
return [4 /*yield*/, getAmisInputTableSchema(props)];
|
|
22809
22770
|
case 1:
|
|
22810
22771
|
amisSchema = _a.sent();
|
|
@@ -22927,7 +22888,7 @@ var PageRecordDetail = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22927
22888
|
recordPage = _a.sent();
|
|
22928
22889
|
recordSchema = recordPage ? recordPage.schema : {
|
|
22929
22890
|
"type": "wrapper",
|
|
22930
|
-
"className": "overflow-y-auto p-0 m-0 flex-1 h-full",
|
|
22891
|
+
"className": "steedos-record-content bg-white overflow-y-auto p-0 m-0 flex-1 h-full",
|
|
22931
22892
|
"name": "amis-".concat(appId, "-").concat(objectApiName, "-detail"),
|
|
22932
22893
|
"body": [
|
|
22933
22894
|
{
|
|
@@ -22949,7 +22910,7 @@ var PageRecordDetail = function (props) { return __awaiter(void 0, void 0, void
|
|
|
22949
22910
|
"actions": [
|
|
22950
22911
|
{
|
|
22951
22912
|
"actionType": "custom",
|
|
22952
|
-
"script": "window.Steedos && window.Steedos.setDocumentTitle && Steedos.setDocumentTitle({pageName: event.data.record.name})"
|
|
22913
|
+
"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');"
|
|
22953
22914
|
}
|
|
22954
22915
|
]
|
|
22955
22916
|
}
|
|
@@ -23028,7 +22989,21 @@ var PageObject = function (props) { return __awaiter(void 0, void 0, void 0, fun
|
|
|
23028
22989
|
"visibleOn": "${pageType !== 'record' && pageType !== 'list'}"
|
|
23029
22990
|
}
|
|
23030
22991
|
]
|
|
23031
|
-
}
|
|
22992
|
+
},
|
|
22993
|
+
// onEvent: {
|
|
22994
|
+
// "recordLoaded": {
|
|
22995
|
+
// "actions": [
|
|
22996
|
+
// {
|
|
22997
|
+
// "actionType": "setValue",
|
|
22998
|
+
// "args": {
|
|
22999
|
+
// "value": {
|
|
23000
|
+
// "steedos_selected_recordId": "${event.data.record._id}"
|
|
23001
|
+
// }
|
|
23002
|
+
// }
|
|
23003
|
+
// }
|
|
23004
|
+
// ]
|
|
23005
|
+
// }
|
|
23006
|
+
// }
|
|
23032
23007
|
}];
|
|
23033
23008
|
}
|
|
23034
23009
|
});
|