@steedos-widgets/amis-object 1.3.17 → 1.3.19
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/AmisObjectTable.d.ts +1 -8
- package/dist/amis-object.cjs.css +12 -0
- package/dist/amis-object.cjs.js +114 -23
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +12 -0
- package/dist/amis-object.esm.js +115 -24
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +12 -0
- package/dist/amis-object.umd.js +52 -45
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +21 -21
- package/dist/meta.js +8 -2
- package/package.json +3 -3
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
import './AmisObjectTable.less';
|
|
2
|
-
export declare const AmisObjectTable: (props: any) => Promise<
|
|
3
|
-
type: string;
|
|
4
|
-
className: string;
|
|
5
|
-
id: string;
|
|
6
|
-
name: string;
|
|
7
|
-
data: any;
|
|
8
|
-
body: any;
|
|
9
|
-
}>;
|
|
2
|
+
export declare const AmisObjectTable: (props: any) => Promise<any>;
|
package/dist/amis-object.cjs.css
CHANGED
|
@@ -1827,6 +1827,18 @@ body.steedos {
|
|
|
1827
1827
|
.steedos-object-table thead tr th:nth-child(2) {
|
|
1828
1828
|
display: none;
|
|
1829
1829
|
}
|
|
1830
|
+
.steedos-object-table.is-steedos-tree-table thead tr th:nth-child(3) {
|
|
1831
|
+
display: none;
|
|
1832
|
+
}
|
|
1833
|
+
.steedos-object-table.is-steedos-tree-table thead tr th:nth-child(2) {
|
|
1834
|
+
display: table-cell;
|
|
1835
|
+
}
|
|
1836
|
+
.steedos-object-table .is-steedos-crud-data-empty thead tr th:nth-child(3) {
|
|
1837
|
+
display: table-cell;
|
|
1838
|
+
}
|
|
1839
|
+
.steedos-object-table .is-steedos-crud-data-empty thead tr th:nth-child(2) {
|
|
1840
|
+
display: none;
|
|
1841
|
+
}
|
|
1830
1842
|
.steedos-object-table tbody td.antd-Field--quickEditable > div {
|
|
1831
1843
|
display: flex;
|
|
1832
1844
|
align-items: center;
|
package/dist/amis-object.cjs.js
CHANGED
|
@@ -5155,9 +5155,9 @@ function getFieldWidth(width){
|
|
|
5155
5155
|
const defaultWidth = "unset";//用于使table内的td标签下生成div,实现将快速编辑按钮固定在右侧的效果,并不是为了unset效果
|
|
5156
5156
|
if(typeof width == 'string'){
|
|
5157
5157
|
if(isNaN(width)){
|
|
5158
|
-
return width;
|
|
5158
|
+
return width || defaultWidth;
|
|
5159
5159
|
}else {
|
|
5160
|
-
return Number(width);
|
|
5160
|
+
return Number(width) || defaultWidth;
|
|
5161
5161
|
}
|
|
5162
5162
|
}else if(typeof width == 'number'){
|
|
5163
5163
|
return width;
|
|
@@ -5258,6 +5258,7 @@ async function getTableColumns$1(fields, options){
|
|
|
5258
5258
|
width: getFieldWidth(field.width),
|
|
5259
5259
|
toggled: field.toggled,
|
|
5260
5260
|
className,
|
|
5261
|
+
inputClassName: "inline",
|
|
5261
5262
|
static: true,
|
|
5262
5263
|
}, field.amis, {name: field.name});
|
|
5263
5264
|
}
|
|
@@ -5295,6 +5296,7 @@ async function getTableColumns$1(fields, options){
|
|
|
5295
5296
|
tpl: tpl,
|
|
5296
5297
|
toggled: field.toggled,
|
|
5297
5298
|
className,
|
|
5299
|
+
inputClassName: "inline",
|
|
5298
5300
|
static: true,
|
|
5299
5301
|
options: field.type === 'html' ? {html: true} : null
|
|
5300
5302
|
// toggled: true
|
|
@@ -5316,8 +5318,8 @@ async function getTableColumns$1(fields, options){
|
|
|
5316
5318
|
const href = Router$1.getObjectDetailPath({
|
|
5317
5319
|
...options, formFactor: options.formFactor, appId: "${appId}", objectName: options.objectName || "${objectName}", recordId: `\${${options.idFieldName}}`
|
|
5318
5320
|
});
|
|
5319
|
-
columns[
|
|
5320
|
-
columns[
|
|
5321
|
+
columns[1].type = "tpl";
|
|
5322
|
+
columns[1].tpl = `<a href="${href}">\${${columns[1].name}}</a>`;
|
|
5321
5323
|
}
|
|
5322
5324
|
return columns;
|
|
5323
5325
|
}
|
|
@@ -6013,7 +6015,25 @@ async function getTableApi(mainObject, fields, options){
|
|
|
6013
6015
|
if(enable_tree){
|
|
6014
6016
|
const records = payload.data.rows || [];
|
|
6015
6017
|
const getTreeOptions = SteedosUI.getTreeOptions
|
|
6016
|
-
|
|
6018
|
+
let isTreeOptionsComputed = false;
|
|
6019
|
+
if(records.length === 1 && records[0].children){
|
|
6020
|
+
isTreeOptionsComputed = true;
|
|
6021
|
+
}
|
|
6022
|
+
if(!isTreeOptionsComputed){
|
|
6023
|
+
// 如果api接口设置在缓存,缓存期间并不会重新请求接口,payload.data.rows是上次计算后的结果
|
|
6024
|
+
payload.data.rows = getTreeOptions(records,{"valueField":"_id"});
|
|
6025
|
+
}
|
|
6026
|
+
try{
|
|
6027
|
+
setTimeout(() => {
|
|
6028
|
+
let expandBtn = $('.steedos-object-listview-content .antd-Table-content .antd-Table-table thead .antd-Table-expandBtn');
|
|
6029
|
+
if(expandBtn && expandBtn.length > 0 && !expandBtn.hasClass("is-active")){
|
|
6030
|
+
expandBtn[0].click();
|
|
6031
|
+
}
|
|
6032
|
+
}, 600);
|
|
6033
|
+
}
|
|
6034
|
+
catch(ex){
|
|
6035
|
+
console.error("tree数据格式展开异常:", ex);
|
|
6036
|
+
}
|
|
6017
6037
|
}
|
|
6018
6038
|
|
|
6019
6039
|
|
|
@@ -9320,12 +9340,13 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
9320
9340
|
*/
|
|
9321
9341
|
function getObjectListHeaderFirstLine(objectSchema, listViewName, ctx) {
|
|
9322
9342
|
const { icon, label } = objectSchema;
|
|
9343
|
+
const disabled_list_views = objectSchema.permissions.disabled_list_views;
|
|
9323
9344
|
const listViewButtonOptions = [];
|
|
9324
9345
|
_$1.each(
|
|
9325
9346
|
objectSchema.list_views,
|
|
9326
9347
|
(listView, name) => {
|
|
9327
|
-
if(name === "lookup"){
|
|
9328
|
-
// 内置lookup
|
|
9348
|
+
if(name === "lookup" || (disabled_list_views && disabled_list_views.indexOf(listView._id)>-1)){
|
|
9349
|
+
// 内置lookup为弹出选择专用视图,根据用户权限被禁用的视图,不显示在列表切换区域
|
|
9329
9350
|
return;
|
|
9330
9351
|
}
|
|
9331
9352
|
listViewButtonOptions.push({
|
|
@@ -9877,78 +9898,97 @@ function fields$1(){
|
|
|
9877
9898
|
|
|
9878
9899
|
function fieldsExtend$4(){
|
|
9879
9900
|
return {
|
|
9901
|
+
"group": "",
|
|
9880
9902
|
"label": {
|
|
9881
9903
|
"is_wide": true
|
|
9882
9904
|
},
|
|
9883
9905
|
"name": {
|
|
9906
|
+
"group": "",
|
|
9884
9907
|
"amis": {
|
|
9885
9908
|
"hidden": true,
|
|
9886
9909
|
"required": false
|
|
9887
9910
|
}
|
|
9888
9911
|
},
|
|
9889
9912
|
"object_name": {
|
|
9913
|
+
"group": "",
|
|
9890
9914
|
"amis": {
|
|
9891
9915
|
"hidden": true
|
|
9892
9916
|
}
|
|
9893
9917
|
},
|
|
9894
9918
|
"filter_scope": {
|
|
9919
|
+
"group": "",
|
|
9895
9920
|
"amis": {
|
|
9896
9921
|
"hidden": true,
|
|
9897
9922
|
"required": false
|
|
9898
9923
|
}
|
|
9899
9924
|
},
|
|
9900
9925
|
"columns": {
|
|
9926
|
+
"group": "",
|
|
9901
9927
|
"amis": {
|
|
9902
9928
|
"hidden": true,
|
|
9903
9929
|
"required": false
|
|
9904
9930
|
}
|
|
9905
9931
|
},
|
|
9906
9932
|
"mobile_columns":{
|
|
9933
|
+
"group": "",
|
|
9907
9934
|
"amis": {
|
|
9908
9935
|
"hidden": true,
|
|
9909
9936
|
"required": false
|
|
9910
9937
|
}
|
|
9911
9938
|
},
|
|
9912
9939
|
"searchable_fields":{
|
|
9940
|
+
"group": "",
|
|
9913
9941
|
"amis": {
|
|
9914
9942
|
"hidden": true,
|
|
9915
9943
|
"required": false
|
|
9916
9944
|
}
|
|
9917
9945
|
},
|
|
9918
9946
|
"filter_fields": {
|
|
9947
|
+
"group": "",
|
|
9919
9948
|
"amis": {
|
|
9920
9949
|
"hidden": true,
|
|
9921
9950
|
"required": false
|
|
9922
9951
|
}
|
|
9923
9952
|
},
|
|
9924
9953
|
"scrolling_mode": {
|
|
9954
|
+
"group": "",
|
|
9925
9955
|
"amis": {
|
|
9926
9956
|
"hidden": true,
|
|
9927
9957
|
"required": false
|
|
9928
9958
|
}
|
|
9929
9959
|
},
|
|
9930
9960
|
"sort": {
|
|
9961
|
+
"group": "",
|
|
9931
9962
|
"amis": {
|
|
9932
9963
|
"hidden": true,
|
|
9933
9964
|
"required": false
|
|
9934
9965
|
}
|
|
9935
9966
|
},
|
|
9936
9967
|
"show_count": {
|
|
9968
|
+
"group": "",
|
|
9937
9969
|
"amis": {
|
|
9938
9970
|
"hidden": true,
|
|
9939
9971
|
"required": false
|
|
9940
9972
|
}
|
|
9941
9973
|
},
|
|
9942
9974
|
"type": {
|
|
9975
|
+
"group": "",
|
|
9943
9976
|
"amis": {
|
|
9944
9977
|
"hidden": true,
|
|
9945
9978
|
"required": false
|
|
9946
9979
|
}
|
|
9947
9980
|
},
|
|
9948
9981
|
"shared": {
|
|
9982
|
+
"group": "",
|
|
9949
9983
|
"amis": {
|
|
9950
9984
|
"visibleOn": "${global.user.is_space_admin}"
|
|
9951
9985
|
}
|
|
9986
|
+
},
|
|
9987
|
+
"filters": {
|
|
9988
|
+
"group": "",
|
|
9989
|
+
"amis": {
|
|
9990
|
+
"hidden": true
|
|
9991
|
+
}
|
|
9952
9992
|
}
|
|
9953
9993
|
}
|
|
9954
9994
|
}
|
|
@@ -10095,6 +10135,12 @@ function fieldsExtend$3(){
|
|
|
10095
10135
|
"amis": {
|
|
10096
10136
|
"visibleOn": "${global.user.is_space_admin}"
|
|
10097
10137
|
}
|
|
10138
|
+
},
|
|
10139
|
+
"filters": {
|
|
10140
|
+
"group": "",
|
|
10141
|
+
"amis": {
|
|
10142
|
+
"hidden": true
|
|
10143
|
+
}
|
|
10098
10144
|
}
|
|
10099
10145
|
}
|
|
10100
10146
|
}
|
|
@@ -10433,7 +10479,6 @@ function fieldsExtend$1(){
|
|
|
10433
10479
|
}
|
|
10434
10480
|
},
|
|
10435
10481
|
"mobile_columns": {
|
|
10436
|
-
"group": instance.t('frontend_listview_control_columns_mobile_group'),
|
|
10437
10482
|
"amis": {
|
|
10438
10483
|
"type": "transfer",
|
|
10439
10484
|
"sortable": true,
|
|
@@ -11385,7 +11430,15 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
11385
11430
|
hiddenOn: options.tableHiddenOn,
|
|
11386
11431
|
autoFillHeight,
|
|
11387
11432
|
className: `flex-auto ${crudClassName || ""}`,
|
|
11388
|
-
|
|
11433
|
+
// 这里不可以用动态className,因为它会把样式类加到.antd-Crud和.antd-Table.antd-Crud-body这两层div中,而子表列表中crudClassName中有hidden样式类会造成所有子表都不显示的bug
|
|
11434
|
+
// className: {
|
|
11435
|
+
// [`flex-auto ${crudClassName || ""}`]: "true",
|
|
11436
|
+
// "is-steedos-crud-data-empty": "${!items || COUNT(items) == 0}"
|
|
11437
|
+
// },
|
|
11438
|
+
bodyClassName: {
|
|
11439
|
+
"bg-white": "true",
|
|
11440
|
+
"is-steedos-crud-data-empty": "${!items || COUNT(items) == 0}"
|
|
11441
|
+
},
|
|
11389
11442
|
crudClassName: crudClassName,
|
|
11390
11443
|
quickSaveApi: {
|
|
11391
11444
|
url: `\${context.rootUrl}/graphql`,
|
|
@@ -13276,8 +13329,6 @@ async function lookupToAmisTreeSelect(field, readonly, ctx) {
|
|
|
13276
13329
|
return amisSchema;
|
|
13277
13330
|
}
|
|
13278
13331
|
|
|
13279
|
-
const keywordsSearchBoxName = `__keywords_lookup`;
|
|
13280
|
-
|
|
13281
13332
|
const getReferenceToFieldSchema = (field, refObjectConfig)=>{
|
|
13282
13333
|
let referenceTo = field.reference_to;
|
|
13283
13334
|
if(!referenceTo){
|
|
@@ -13536,7 +13587,10 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
13536
13587
|
|
|
13537
13588
|
source.data.$term = "$term";
|
|
13538
13589
|
source.data.$self = "$$";
|
|
13539
|
-
|
|
13590
|
+
|
|
13591
|
+
// field.name可能是带点的名称,比如审批王中子表字段'instances.instances_submitter',如果不替换掉点,会造成审批王表单中新建子表行时报错
|
|
13592
|
+
let keywordsSearchBoxName = `__keywords_lookup__${field.name.replace(/\./g, "_")}__to__${refObjectConfig.name}`;
|
|
13593
|
+
|
|
13540
13594
|
source.requestAdaptor = `
|
|
13541
13595
|
let __changedFilterFormValues = api.data.$self.__changedFilterFormValues || {};
|
|
13542
13596
|
let __changedSearchBoxValues = api.data.$self.__changedSearchBoxValues || {};
|
|
@@ -13679,6 +13733,14 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
13679
13733
|
}
|
|
13680
13734
|
});
|
|
13681
13735
|
payload.data.rows = treeRecords;
|
|
13736
|
+
try{
|
|
13737
|
+
setTimeout(() => {
|
|
13738
|
+
$('.amis-dialog-widget.antd-Modal .antd-Table-content .antd-Table-table thead .antd-Table-expandBtn')[0]?.click();
|
|
13739
|
+
}, 600);
|
|
13740
|
+
}
|
|
13741
|
+
catch(ex){
|
|
13742
|
+
console.error("tree数据格式展开异常:", ex);
|
|
13743
|
+
}
|
|
13682
13744
|
}
|
|
13683
13745
|
return payload;
|
|
13684
13746
|
`;
|
|
@@ -13851,6 +13913,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
13851
13913
|
|
|
13852
13914
|
async function lookupToAmisSelect(field, readonly, ctx){
|
|
13853
13915
|
let referenceTo = await getReferenceTo(field);
|
|
13916
|
+
const isMobile = window.innerWidth <= 768;
|
|
13854
13917
|
const valueFieldKey = referenceTo && referenceTo.valueField?.name || '_id' ;
|
|
13855
13918
|
// const labelFieldKey = referenceTo && referenceTo.labelField?.name || 'name';
|
|
13856
13919
|
|
|
@@ -14031,7 +14094,11 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
14031
14094
|
</span>
|
|
14032
14095
|
<span class='pl-1.5'>\${label}</span>
|
|
14033
14096
|
</span>`;
|
|
14034
|
-
|
|
14097
|
+
const menuTpl = "${icon ? `"+select_menuTpl+"` : label}";
|
|
14098
|
+
// TODO: 待amis修复了此bug, 就可以撤销添加menuTpl的判断。
|
|
14099
|
+
if(!(isMobile && field.multiple)){
|
|
14100
|
+
data.menuTpl = menuTpl;
|
|
14101
|
+
}
|
|
14035
14102
|
if(field.multiple){
|
|
14036
14103
|
data.multiple = true;
|
|
14037
14104
|
data.extractValue = true;
|
|
@@ -14539,6 +14606,8 @@ function getSelectFieldOptions(field){
|
|
|
14539
14606
|
}
|
|
14540
14607
|
|
|
14541
14608
|
async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
14609
|
+
// console.log('convertSFieldToAmisField====>', field, readonly, ctx)
|
|
14610
|
+
const isMobile = window.innerWidth <= 768;
|
|
14542
14611
|
// 创建人和修改人、创建时间和修改时间不显示
|
|
14543
14612
|
if(_$1__namespace.includes(OMIT_FIELDS, field.name) && ctx.showSystemFields != true){
|
|
14544
14613
|
return;
|
|
@@ -14601,7 +14670,11 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
14601
14670
|
</span>
|
|
14602
14671
|
<span class='pl-1.5'>\${label}</span>
|
|
14603
14672
|
</span>`;
|
|
14604
|
-
|
|
14673
|
+
const menuTpl = "${icon ? `"+select_menuTpl+"` : label}";
|
|
14674
|
+
// TODO: 待amis修复了此bug, 就可以撤销添加menuTpl的判断。
|
|
14675
|
+
if(!(isMobile && field.multiple)){
|
|
14676
|
+
convertData.menuTpl = menuTpl;
|
|
14677
|
+
}
|
|
14605
14678
|
if(field.multiple){
|
|
14606
14679
|
convertData.multiple = true;
|
|
14607
14680
|
convertData.extractValue = true;
|
|
@@ -15462,7 +15535,7 @@ async function getFormBody(permissionFields, formFields, ctx){
|
|
|
15462
15535
|
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
15463
15536
|
* @Date: 2023-11-15 09:50:22
|
|
15464
15537
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
15465
|
-
* @LastEditTime: 2023-
|
|
15538
|
+
* @LastEditTime: 2023-12-04 17:36:50
|
|
15466
15539
|
*/
|
|
15467
15540
|
|
|
15468
15541
|
/**
|
|
@@ -15792,11 +15865,20 @@ const getAmisInputTableSchema = async (props, readonly) => {
|
|
|
15792
15865
|
],
|
|
15793
15866
|
"className": props.className
|
|
15794
15867
|
};
|
|
15868
|
+
let footerToolbar = _$1.clone(props.footerToolbar || []); //这里不clone的话,会造成死循环,应该是因为props属性变更会让组件重新渲染
|
|
15795
15869
|
if (props.addable) {
|
|
15796
15870
|
let buttonNewSchema = await getButtonNew(props);
|
|
15797
|
-
|
|
15871
|
+
footerToolbar.unshift(buttonNewSchema);
|
|
15872
|
+
}
|
|
15873
|
+
if (footerToolbar.length) {
|
|
15874
|
+
schema.body.push({
|
|
15875
|
+
"type": "wrapper",
|
|
15876
|
+
"size": "none",
|
|
15877
|
+
"body": footerToolbar
|
|
15878
|
+
});
|
|
15798
15879
|
}
|
|
15799
15880
|
if (props.amis) {
|
|
15881
|
+
delete props.amis.id;
|
|
15800
15882
|
Object.assign(schema.body[0], props.amis);
|
|
15801
15883
|
}
|
|
15802
15884
|
return schema;
|
|
@@ -19189,7 +19271,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
19189
19271
|
amisSchemaData = Object.assign({}, data, defaultData);
|
|
19190
19272
|
listViewId = (ctx === null || ctx === void 0 ? void 0 : ctx.listViewId) || amisSchemaData.listViewId;
|
|
19191
19273
|
allData = createObject(data, defaultData);
|
|
19192
|
-
listViewSchemaProps = __assign$2(__assign$2({ top: top, perPage: perPage,
|
|
19274
|
+
listViewSchemaProps = __assign$2(__assign$2({ top: top, perPage: perPage, defaults: defaults }, ctx), { listViewId: listViewId, setDataToComponentId: setDataToComponentId, filterVisible: filterVisible, showDisplayAs: showDisplayAs, displayAs: displayAs, headerToolbarItems: headerToolbarItems, rowClassNameExpr: rowClassNameExpr, hiddenColumnOperation: hiddenColumnOperation, columns: columns, crudDataFilter: crudDataFilter, onCrudDataFilter: onCrudDataFilter, amisData: allData, env: env, requestAdaptor: requestAdaptor, adaptor: adaptor });
|
|
19193
19275
|
if (!headerSchema) {
|
|
19194
19276
|
headerSchema = getObjectListHeader$1(uiSchema, listName, ctx);
|
|
19195
19277
|
}
|
|
@@ -19205,6 +19287,9 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
19205
19287
|
serviceData.uiSchema = uiSchema;
|
|
19206
19288
|
}
|
|
19207
19289
|
serviceData.defaultListName = listName ? listName : (_h = _$1.first(_$1.values(uiSchema.list_views))) === null || _h === void 0 ? void 0 : _h.name;
|
|
19290
|
+
if (!showHeader) {
|
|
19291
|
+
headerSchema = {};
|
|
19292
|
+
}
|
|
19208
19293
|
// console.timeEnd('AmisObjectListView')
|
|
19209
19294
|
// console.log('serviceData===>', serviceData)
|
|
19210
19295
|
// console.log('headerSchema===>', headerSchema)
|
|
@@ -19288,7 +19373,7 @@ function getTableColumns(columns, includedFields, fieldsExtend) {
|
|
|
19288
19373
|
return tableColumns;
|
|
19289
19374
|
}
|
|
19290
19375
|
var AmisObjectTable = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
19291
|
-
var $schema, filters, filtersFunction, amisCondition, top, headerSchema, includedFields, fieldsExtend, sort, sortField, sortOrder, extraColumns, data, defaultData, _a, formFactor, _b, className, requestAdaptor, adaptor, _c, filterVisible, headerToolbarItems, crudDataFilter, onCrudDataFilter, env, crudMode, _d, hiddenColumnOperation, ctx, crud, columns, defaults, objectApiName, schemaKeys, listSchema, setDataToComponentId, amisFilters, tableFilters, amisSchemaData, allData, appId, amisSchema;
|
|
19376
|
+
var $schema, filters, filtersFunction, amisCondition, top, headerSchema, includedFields, fieldsExtend, sort, sortField, sortOrder, extraColumns, data, defaultData, _a, formFactor, _b, className, requestAdaptor, adaptor, _c, filterVisible, headerToolbarItems, crudDataFilter, onCrudDataFilter, env, crudMode, _d, hiddenColumnOperation, ctx, crud, columns, defaults, objectApiName, schemaKeys, listSchema, setDataToComponentId, amisFilters, tableFilters, amisSchemaData, allData, appId, tableSchema, amisSchema, uiSchema;
|
|
19292
19377
|
return __generator(this, function (_e) {
|
|
19293
19378
|
switch (_e.label) {
|
|
19294
19379
|
case 0:
|
|
@@ -19342,12 +19427,14 @@ var AmisObjectTable = function (props) { return __awaiter(void 0, void 0, void 0
|
|
|
19342
19427
|
ctx = _$1.pickBy(ctx, function (value) { return value !== undefined; });
|
|
19343
19428
|
return [4 /*yield*/, getTableSchema(appId, objectApiName, columns, __assign$2(__assign$2({ filters: tableFilters, filtersFunction: filtersFunction, top: top, sort: sort, sortField: sortField, sortOrder: sortOrder, extraColumns: extraColumns, defaults: defaults }, ctx), { setDataToComponentId: setDataToComponentId, requestAdaptor: requestAdaptor, adaptor: adaptor, filterVisible: filterVisible, headerToolbarItems: headerToolbarItems, crudDataFilter: crudDataFilter, onCrudDataFilter: onCrudDataFilter, amisData: allData, env: env }))];
|
|
19344
19429
|
case 1:
|
|
19345
|
-
|
|
19430
|
+
tableSchema = _e.sent();
|
|
19431
|
+
amisSchema = tableSchema.amisSchema;
|
|
19432
|
+
uiSchema = tableSchema.uiSchema;
|
|
19346
19433
|
amisSchema.data = Object.assign({}, amisSchema.data, amisSchemaData);
|
|
19347
19434
|
if (_$1.has(props, 'objectApiName')) {
|
|
19348
19435
|
amisSchema.data.objectName = objectApiName;
|
|
19349
19436
|
}
|
|
19350
|
-
amisSchema.className = "steedos-object-table ".concat(amisSchema.className, " h-full flex flex-col ").concat(className);
|
|
19437
|
+
amisSchema.className = "steedos-object-table ".concat(uiSchema.enable_tree ? "is-steedos-tree-table" : "", " ").concat(amisSchema.className, " h-full flex flex-col ").concat(className);
|
|
19351
19438
|
amisSchema.objectApiName = objectApiName; //设计器中切换对象时画布中显示的列未同步变更
|
|
19352
19439
|
// console.timeEnd('AmisObjectTable')
|
|
19353
19440
|
return [2 /*return*/, amisSchema];
|
|
@@ -19511,12 +19598,12 @@ var AmisRecordService = function (props) { return __awaiter(void 0, void 0, void
|
|
|
19511
19598
|
}); };
|
|
19512
19599
|
|
|
19513
19600
|
var AmisRecordDetailRelatedList = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
19514
|
-
var $schema, objectApiName, recordId, relatedObjectApiName, data, relatedKey, top, perPage, hiddenEmptyTable, appId, relatedLabel, _a, className, columns, sort, filters, visible_on, requestAdaptor, adaptor, formFactor, formData, schema;
|
|
19601
|
+
var $schema, objectApiName, recordId, relatedObjectApiName, data, relatedKey, top, perPage, hiddenEmptyTable, appId, relatedLabel, _a, className, columns, sort, filters, visible_on, requestAdaptor, adaptor, visibleOn, formFactor, formData, schema;
|
|
19515
19602
|
var _b;
|
|
19516
19603
|
return __generator(this, function (_c) {
|
|
19517
19604
|
switch (_c.label) {
|
|
19518
19605
|
case 0:
|
|
19519
|
-
$schema = props.$schema, objectApiName = props.objectApiName, recordId = props.recordId, relatedObjectApiName = props.relatedObjectApiName, data = props.data, relatedKey = props.relatedKey, top = props.top, perPage = props.perPage, hiddenEmptyTable = props.hiddenEmptyTable, appId = props.appId, relatedLabel = props.relatedLabel, _a = props.className, className = _a === void 0 ? '' : _a, columns = props.columns, sort = props.sort, filters = props.filters, visible_on = props.visible_on, requestAdaptor = props.requestAdaptor, adaptor = props.adaptor;
|
|
19606
|
+
$schema = props.$schema, objectApiName = props.objectApiName, recordId = props.recordId, relatedObjectApiName = props.relatedObjectApiName, data = props.data, relatedKey = props.relatedKey, top = props.top, perPage = props.perPage, hiddenEmptyTable = props.hiddenEmptyTable, appId = props.appId, relatedLabel = props.relatedLabel, _a = props.className, className = _a === void 0 ? '' : _a, columns = props.columns, sort = props.sort, filters = props.filters, visible_on = props.visible_on, requestAdaptor = props.requestAdaptor, adaptor = props.adaptor, visibleOn = props.visibleOn;
|
|
19520
19607
|
formFactor = props.formFactor;
|
|
19521
19608
|
if (!formFactor) {
|
|
19522
19609
|
formFactor = window.innerWidth < 768 ? 'SMALL' : 'LARGE';
|
|
@@ -19551,6 +19638,10 @@ var AmisRecordDetailRelatedList = function (props) { return __awaiter(void 0, vo
|
|
|
19551
19638
|
}
|
|
19552
19639
|
});
|
|
19553
19640
|
}
|
|
19641
|
+
// 因为 visibleOn 的值格式是字符串,所以这里加个判断条件。
|
|
19642
|
+
if (visibleOn) {
|
|
19643
|
+
schema.visibleOn = visibleOn;
|
|
19644
|
+
}
|
|
19554
19645
|
return [2 /*return*/, schema];
|
|
19555
19646
|
}
|
|
19556
19647
|
});
|
|
@@ -21216,7 +21307,7 @@ var AmisInputTable = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
21216
21307
|
return __generator(this, function (_a) {
|
|
21217
21308
|
switch (_a.label) {
|
|
21218
21309
|
case 0:
|
|
21219
|
-
props.$schema, props.fields, props.name, props.id, props.data, props.columns, props.amis, props.className, props.tableClassName;
|
|
21310
|
+
props.$schema, props.fields, props.name, props.id, props.data, props.columns, props.amis, props.className, props.tableClassName, props.footerToolbar;
|
|
21220
21311
|
return [4 /*yield*/, getAmisInputTableSchema(props)];
|
|
21221
21312
|
case 1:
|
|
21222
21313
|
amisSchema = _a.sent();
|