@steedos-widgets/amis-object 1.3.0-beta.3 → 1.3.0-beta.5
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-object.cjs.css +25 -3
- package/dist/amis-object.cjs.js +36 -24
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +25 -3
- package/dist/amis-object.esm.js +36 -24
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +25 -3
- package/dist/amis-object.umd.js +21 -18
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +16 -16
- package/package.json +3 -3
package/dist/amis-object.cjs.css
CHANGED
|
@@ -1187,11 +1187,21 @@ fieldset.antd-Collapse > legend{
|
|
|
1187
1187
|
.steedos-select-user .antd-Table .antd-SearchBox {
|
|
1188
1188
|
margin-top: 0;
|
|
1189
1189
|
}
|
|
1190
|
-
@media (max-width:
|
|
1190
|
+
@media (max-width: 768px) {
|
|
1191
1191
|
.antd-Crud-toolbar {
|
|
1192
1192
|
flex-basis: 0;
|
|
1193
1193
|
flex-grow: 1;
|
|
1194
1194
|
}
|
|
1195
|
+
.steedos-object-table .antd-Table-footToolbar {
|
|
1196
|
+
border-top: 1px solid #e5e7eb;
|
|
1197
|
+
}
|
|
1198
|
+
.steedos-object-table .antd-Table-footToolbar .antd-Crud-toolbar-item {
|
|
1199
|
+
justify-content: center;
|
|
1200
|
+
width: 100%;
|
|
1201
|
+
}
|
|
1202
|
+
.steedos-object-table .antd-Table-footToolbar .antd-Crud-toolbar-item .antd-Pagination-inputGroup-left {
|
|
1203
|
+
display: none;
|
|
1204
|
+
}
|
|
1195
1205
|
}
|
|
1196
1206
|
.steedos-object-table .two-lines-truncate {
|
|
1197
1207
|
white-space: pre-wrap;
|
|
@@ -1568,10 +1578,22 @@ fieldset.antd-Collapse > legend{
|
|
|
1568
1578
|
}
|
|
1569
1579
|
@media (max-width: 767px) {
|
|
1570
1580
|
.steedos-object-table .antd-Table-content {
|
|
1571
|
-
max-height: calc(100vh -
|
|
1581
|
+
max-height: calc(100vh - 207px);
|
|
1572
1582
|
}
|
|
1573
1583
|
.steedos-object-listview .antd-Table-content {
|
|
1574
|
-
max-height: calc(100vh -
|
|
1584
|
+
max-height: calc(100vh - 305px);
|
|
1585
|
+
}
|
|
1586
|
+
body.zoom-large .steedos-object-table .antd-Table-content {
|
|
1587
|
+
max-height: calc(100vh - 336px);
|
|
1588
|
+
}
|
|
1589
|
+
body.zoom-large .steedos-object-listview .antd-Table-content {
|
|
1590
|
+
max-height: calc(100vh - 432px);
|
|
1591
|
+
}
|
|
1592
|
+
body.zoom-extra-large .steedos-object-table .antd-Table-content {
|
|
1593
|
+
max-height: calc(100vh - 526px);
|
|
1594
|
+
}
|
|
1595
|
+
body.zoom-extra-large .steedos-object-listview .antd-Table-content {
|
|
1596
|
+
max-height: calc(100vh - 622px);
|
|
1575
1597
|
}
|
|
1576
1598
|
.steedos-global-footer-root .antd-Nav-Menu-horizontal:after {
|
|
1577
1599
|
/*手机端底部导航左右间隔不平衡*/
|
package/dist/amis-object.cjs.js
CHANGED
|
@@ -5606,7 +5606,7 @@ const getSchema$2 = (uiSchema) => {
|
|
|
5606
5606
|
* @Author: baozhoutao@steedos.com
|
|
5607
5607
|
* @Date: 2022-11-07 17:00:38
|
|
5608
5608
|
* @LastEditors: baozhoutao@steedos.com
|
|
5609
|
-
* @LastEditTime:
|
|
5609
|
+
* @LastEditTime: 2023-08-24 16:44:42
|
|
5610
5610
|
* @Description:
|
|
5611
5611
|
*/
|
|
5612
5612
|
|
|
@@ -5626,7 +5626,7 @@ const getSchema$1 = (uiSchema)=>{
|
|
|
5626
5626
|
"componentId": "",
|
|
5627
5627
|
"args": {
|
|
5628
5628
|
"blank": false,
|
|
5629
|
-
"url": "/app/${app_id}/${objectName}/view/${_id}"
|
|
5629
|
+
"url": "/app/${app_id}/${objectName}/view/${_id}?side_object=${objectName}&side_listview_id=${listName}"
|
|
5630
5630
|
},
|
|
5631
5631
|
"actionType": "link"
|
|
5632
5632
|
}
|
|
@@ -7212,7 +7212,7 @@ async function getObjectRecordDetailHeader(objectSchema, recordId, options) {
|
|
|
7212
7212
|
"actions": [
|
|
7213
7213
|
{
|
|
7214
7214
|
"actionType": "custom",
|
|
7215
|
-
"script": "
|
|
7215
|
+
"script": "window.goBack()"
|
|
7216
7216
|
}
|
|
7217
7217
|
]
|
|
7218
7218
|
}
|
|
@@ -8414,7 +8414,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8414
8414
|
|
|
8415
8415
|
function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLookup = false, keywordsSearchBoxName = "__keywords" } = {}){
|
|
8416
8416
|
const searchableFieldsLabel = [];
|
|
8417
|
-
_.each(fields, function (field) {
|
|
8417
|
+
_.each(mainObject.fields, function (field) {
|
|
8418
8418
|
if (isFieldQuickSearchable(field, mainObject.NAME_FIELD_KEY)) {
|
|
8419
8419
|
searchableFieldsLabel.push(field.label);
|
|
8420
8420
|
}
|
|
@@ -8606,8 +8606,14 @@ function getObjectHeaderToolbar(mainObject, fields, formFactor, {
|
|
|
8606
8606
|
|
|
8607
8607
|
function getObjectFooterToolbar(mainObject, formFactor, options) {
|
|
8608
8608
|
if (formFactor === 'SMALL') {
|
|
8609
|
+
// return [
|
|
8610
|
+
// "load-more",
|
|
8611
|
+
// ]
|
|
8609
8612
|
return [
|
|
8610
|
-
|
|
8613
|
+
{
|
|
8614
|
+
"type": "pagination",
|
|
8615
|
+
"maxButtons": 5
|
|
8616
|
+
}
|
|
8611
8617
|
]
|
|
8612
8618
|
}
|
|
8613
8619
|
else {
|
|
@@ -9006,13 +9012,16 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
9006
9012
|
})){
|
|
9007
9013
|
i++;
|
|
9008
9014
|
tableFields.push(field);
|
|
9009
|
-
if(isFieldQuickSearchable(field, refObjectConfig.NAME_FIELD_KEY)){
|
|
9010
|
-
searchableFields.push(field.name);
|
|
9011
|
-
}
|
|
9012
9015
|
}
|
|
9013
9016
|
}
|
|
9014
9017
|
});
|
|
9015
9018
|
|
|
9019
|
+
___default__namespace.each(refObjectConfig.fields, function (field) {
|
|
9020
|
+
if(isFieldQuickSearchable(field, refObjectConfig.NAME_FIELD_KEY)){
|
|
9021
|
+
searchableFields.push(field.name);
|
|
9022
|
+
}
|
|
9023
|
+
});
|
|
9024
|
+
|
|
9016
9025
|
const fields = {
|
|
9017
9026
|
[referenceTo.labelField.name]: referenceTo.labelField,
|
|
9018
9027
|
[referenceTo.valueField.name]: referenceTo.valueField
|
|
@@ -11219,7 +11228,7 @@ function getMobileLines(tpls){
|
|
|
11219
11228
|
lineChildrenClassName = "steedos-listview-item-left two-lines-truncate";
|
|
11220
11229
|
if(item.field.is_wide){
|
|
11221
11230
|
// 左侧全行样式可以单独写
|
|
11222
|
-
lineChildrenClassName = "steedos-listview-item-wide truncate";
|
|
11231
|
+
lineChildrenClassName = "steedos-listview-item-wide two-lines-truncate";
|
|
11223
11232
|
}
|
|
11224
11233
|
if(lines.length === 0){
|
|
11225
11234
|
// 第一个字段加粗黑色显示
|
|
@@ -11472,6 +11481,7 @@ async function getTableOperation(ctx){
|
|
|
11472
11481
|
|
|
11473
11482
|
async function getTableSchema$1(fields, options){
|
|
11474
11483
|
let isLookup = options && options.isLookup;
|
|
11484
|
+
let hiddenColumnOperation = options && options.hiddenColumnOperation;
|
|
11475
11485
|
if(!options){
|
|
11476
11486
|
options = {};
|
|
11477
11487
|
}
|
|
@@ -11481,7 +11491,7 @@ async function getTableSchema$1(fields, options){
|
|
|
11481
11491
|
}
|
|
11482
11492
|
else {
|
|
11483
11493
|
columns = await getTableColumns$1(fields, options);
|
|
11484
|
-
if(!isLookup){
|
|
11494
|
+
if(!isLookup && !hiddenColumnOperation){
|
|
11485
11495
|
columns.push(await getTableOperation(options));
|
|
11486
11496
|
}
|
|
11487
11497
|
}
|
|
@@ -11532,7 +11542,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
11532
11542
|
baseFilters = filter;
|
|
11533
11543
|
}
|
|
11534
11544
|
|
|
11535
|
-
___default__namespace.each(fields, function (field) {
|
|
11545
|
+
___default__namespace.each(mainObject.fields, function (field) {
|
|
11536
11546
|
if (isFieldQuickSearchable(field, mainObject.NAME_FIELD_KEY)) {
|
|
11537
11547
|
searchableFields.push(field.name);
|
|
11538
11548
|
}
|
|
@@ -11593,8 +11603,9 @@ async function getTableApi(mainObject, fields, options){
|
|
|
11593
11603
|
// 所以会把localSearchableFilter中已经存过的页码覆盖
|
|
11594
11604
|
// 如果是第一次加载组件始终让翻页页码从本地存储中取值
|
|
11595
11605
|
let formFactor = "${options.formFactor}";
|
|
11596
|
-
//
|
|
11597
|
-
|
|
11606
|
+
// api.data.pageNo = formFactor === "SMALL" ? 1 : (localListViewProps.page || 1);
|
|
11607
|
+
// 移动端暂时去除加载更多,放开翻页
|
|
11608
|
+
api.data.pageNo = localListViewProps.page || 1;
|
|
11598
11609
|
}
|
|
11599
11610
|
}
|
|
11600
11611
|
}
|
|
@@ -11794,7 +11805,8 @@ async function getTableApi(mainObject, fields, options){
|
|
|
11794
11805
|
// 如果是第一次加载组件始终让翻页页码从本地存储中取值
|
|
11795
11806
|
let formFactor = "${options.formFactor}";
|
|
11796
11807
|
// 移动端不识别本地存储中的翻页页码,否则点击加载更多按钮后无法刷新回第一页
|
|
11797
|
-
selfData.page = formFactor === "SMALL" ? 1 : (localListViewProps.page || 1);
|
|
11808
|
+
// selfData.page = formFactor === "SMALL" ? 1 : (localListViewProps.page || 1);
|
|
11809
|
+
selfData.page = localListViewProps.page || 1;
|
|
11798
11810
|
}
|
|
11799
11811
|
}
|
|
11800
11812
|
delete selfData.context;
|
|
@@ -13328,7 +13340,7 @@ async function getObjectDetail(objectSchema, recordId, ctx){
|
|
|
13328
13340
|
// "blank": false
|
|
13329
13341
|
// },
|
|
13330
13342
|
"actionType": "custom",
|
|
13331
|
-
"script": "
|
|
13343
|
+
"script": "window.goBack()",
|
|
13332
13344
|
"expression": "this.__deletedRecord === true"
|
|
13333
13345
|
}
|
|
13334
13346
|
]
|
|
@@ -17822,12 +17834,12 @@ var AmisObjectForm = function (props) { return __awaiter(void 0, void 0, void 0,
|
|
|
17822
17834
|
}); };
|
|
17823
17835
|
|
|
17824
17836
|
var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, void 0, function () {
|
|
17825
|
-
var $schema, top, perPage, _a, showHeader, data, defaultData, _b, crud, _c, className, crudClassName, _d, showDisplayAs, sideSchema, _f, filterVisible, headerToolbarItems, rowClassNameExpr, headerSchema, ctx, listName, defaults, objectApiName, displayAs, formFactor, isMobile, uiSchema, listView, schemaKeys, listSchema, setDataToComponentId, amisSchemaData, listViewId, listViewSchemaProps, serviceData;
|
|
17826
|
-
var
|
|
17827
|
-
return __generator(this, function (
|
|
17828
|
-
switch (
|
|
17837
|
+
var $schema, top, perPage, _a, showHeader, data, defaultData, _b, crud, _c, className, crudClassName, _d, showDisplayAs, sideSchema, _f, filterVisible, headerToolbarItems, rowClassNameExpr, _g, hiddenColumnOperation, headerSchema, ctx, listName, defaults, objectApiName, displayAs, formFactor, isMobile, uiSchema, listView, schemaKeys, listSchema, setDataToComponentId, amisSchemaData, listViewId, listViewSchemaProps, serviceData;
|
|
17838
|
+
var _h;
|
|
17839
|
+
return __generator(this, function (_j) {
|
|
17840
|
+
switch (_j.label) {
|
|
17829
17841
|
case 0:
|
|
17830
|
-
$schema = props.$schema, top = props.top, perPage = props.perPage, _a = props.showHeader, showHeader = _a === void 0 ? true : _a, data = props.data, defaultData = props.defaultData, _b = props.crud, crud = _b === void 0 ? {} : _b, _c = props.className, className = _c === void 0 ? "" : _c, crudClassName = props.crudClassName, _d = props.showDisplayAs, showDisplayAs = _d === void 0 ? false : _d, sideSchema = props.sideSchema, props.columnsTogglable, _f = props.filterVisible, filterVisible = _f === void 0 ? true : _f, headerToolbarItems = props.headerToolbarItems, rowClassNameExpr = props.rowClassNameExpr;
|
|
17842
|
+
$schema = props.$schema, top = props.top, perPage = props.perPage, _a = props.showHeader, showHeader = _a === void 0 ? true : _a, data = props.data, defaultData = props.defaultData, _b = props.crud, crud = _b === void 0 ? {} : _b, _c = props.className, className = _c === void 0 ? "" : _c, crudClassName = props.crudClassName, _d = props.showDisplayAs, showDisplayAs = _d === void 0 ? false : _d, sideSchema = props.sideSchema, props.columnsTogglable, _f = props.filterVisible, filterVisible = _f === void 0 ? true : _f, headerToolbarItems = props.headerToolbarItems, rowClassNameExpr = props.rowClassNameExpr, _g = props.hiddenColumnOperation, hiddenColumnOperation = _g === void 0 ? false : _g;
|
|
17831
17843
|
headerSchema = props.headerSchema;
|
|
17832
17844
|
ctx = props.ctx;
|
|
17833
17845
|
listName = (defaultData === null || defaultData === void 0 ? void 0 : defaultData.listName) || (data === null || data === void 0 ? void 0 : data.listName) || (props === null || props === void 0 ? void 0 : props.listName);
|
|
@@ -17856,7 +17868,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
17856
17868
|
}
|
|
17857
17869
|
return [4 /*yield*/, getUISchema(objectApiName, false)];
|
|
17858
17870
|
case 1:
|
|
17859
|
-
uiSchema =
|
|
17871
|
+
uiSchema = _j.sent();
|
|
17860
17872
|
listView = ___default.find(uiSchema.list_views, function (listView, name) {
|
|
17861
17873
|
// 传入listViewName空值则取第一个
|
|
17862
17874
|
if (!listName) {
|
|
@@ -17907,7 +17919,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
17907
17919
|
}
|
|
17908
17920
|
amisSchemaData = Object.assign({}, data, defaultData);
|
|
17909
17921
|
listViewId = (ctx === null || ctx === void 0 ? void 0 : ctx.listViewId) || amisSchemaData.listViewId;
|
|
17910
|
-
listViewSchemaProps = __assign$2(__assign$2({ top: top, perPage: perPage, showHeader: showHeader, defaults: defaults }, ctx), { listViewId: listViewId, setDataToComponentId: setDataToComponentId, filterVisible: filterVisible, showDisplayAs: showDisplayAs, displayAs: displayAs, headerToolbarItems: headerToolbarItems, rowClassNameExpr: rowClassNameExpr });
|
|
17922
|
+
listViewSchemaProps = __assign$2(__assign$2({ top: top, perPage: perPage, showHeader: showHeader, defaults: defaults }, ctx), { listViewId: listViewId, setDataToComponentId: setDataToComponentId, filterVisible: filterVisible, showDisplayAs: showDisplayAs, displayAs: displayAs, headerToolbarItems: headerToolbarItems, rowClassNameExpr: rowClassNameExpr, hiddenColumnOperation: hiddenColumnOperation });
|
|
17911
17923
|
if (!headerSchema) {
|
|
17912
17924
|
headerSchema = getObjectListHeader$1(uiSchema, listName, ctx);
|
|
17913
17925
|
}
|
|
@@ -17921,7 +17933,7 @@ var AmisObjectListView = function (props) { return __awaiter(void 0, void 0, voi
|
|
|
17921
17933
|
if (!___default.has(data, 'uiSchema')) {
|
|
17922
17934
|
serviceData.uiSchema = uiSchema;
|
|
17923
17935
|
}
|
|
17924
|
-
serviceData.defaultListName = listName ? listName : (
|
|
17936
|
+
serviceData.defaultListName = listName ? listName : (_h = ___default.first(___default.values(uiSchema.list_views))) === null || _h === void 0 ? void 0 : _h.name;
|
|
17925
17937
|
// console.timeEnd('AmisObjectListView')
|
|
17926
17938
|
// console.log('serviceData===>', serviceData)
|
|
17927
17939
|
// console.log('headerSchema===>', headerSchema)
|
|
@@ -19252,7 +19264,7 @@ var AmisGlobalHeader = function (props) { return __awaiter(void 0, void 0, void
|
|
|
19252
19264
|
"actions": [
|
|
19253
19265
|
{
|
|
19254
19266
|
"actionType": "custom",
|
|
19255
|
-
"script": "
|
|
19267
|
+
"script": "window.goBack()"
|
|
19256
19268
|
}
|
|
19257
19269
|
]
|
|
19258
19270
|
}
|