@steedos-widgets/amis-object 1.2.38 → 1.2.39
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 +60 -11
- package/dist/amis-object.cjs.js +196 -63
- package/dist/amis-object.cjs.js.map +1 -1
- package/dist/amis-object.esm.css +60 -11
- package/dist/amis-object.esm.js +196 -63
- package/dist/amis-object.esm.js.map +1 -1
- package/dist/amis-object.umd.css +60 -11
- package/dist/amis-object.umd.js +196 -63
- package/dist/amis-object.umd.js.map +1 -1
- package/dist/assets.json +16 -16
- package/dist/pages/PageListView.d.ts +2 -1
- package/package.json +3 -3
package/dist/amis-object.umd.js
CHANGED
|
@@ -4217,6 +4217,7 @@
|
|
|
4217
4217
|
var frontend_objects_related_alert_start$1 = "No related table fields associated with the related list object";
|
|
4218
4218
|
var frontend_objects_related_alert_end$1 = "were found.";
|
|
4219
4219
|
var frontend_no_records_found$1 = "No records found.";
|
|
4220
|
+
var frontend_records_no_allowedit$1 = "You do not have edit permission for this record";
|
|
4220
4221
|
var en_us = {
|
|
4221
4222
|
frontend_field_group_generalization: frontend_field_group_generalization$1,
|
|
4222
4223
|
frontend_download: frontend_download$1,
|
|
@@ -4299,7 +4300,8 @@
|
|
|
4299
4300
|
frontend_message_modification_failed: frontend_message_modification_failed$1,
|
|
4300
4301
|
frontend_objects_related_alert_start: frontend_objects_related_alert_start$1,
|
|
4301
4302
|
frontend_objects_related_alert_end: frontend_objects_related_alert_end$1,
|
|
4302
|
-
frontend_no_records_found: frontend_no_records_found$1
|
|
4303
|
+
frontend_no_records_found: frontend_no_records_found$1,
|
|
4304
|
+
frontend_records_no_allowedit: frontend_records_no_allowedit$1
|
|
4303
4305
|
};
|
|
4304
4306
|
|
|
4305
4307
|
var frontend_field_group_generalization = "通用";
|
|
@@ -4323,7 +4325,7 @@
|
|
|
4323
4325
|
var frontend_display_as = "显示为";
|
|
4324
4326
|
var frontend_record_sum = "个项目";
|
|
4325
4327
|
var frontend_button_reload_tooltip = "刷新";
|
|
4326
|
-
var frontend_button_search_tooltip = "
|
|
4328
|
+
var frontend_button_search_tooltip = "查询";
|
|
4327
4329
|
var frontend_fields_filter_button_search = "搜索";
|
|
4328
4330
|
var frontend_fields_filter_button_settings = "设置搜索项";
|
|
4329
4331
|
var frontend_button_listview_control_tooltip = "列表视图控制";
|
|
@@ -4385,6 +4387,7 @@
|
|
|
4385
4387
|
var frontend_objects_related_alert_start = "未找到与相关列表对象";
|
|
4386
4388
|
var frontend_objects_related_alert_end = "关联的相关表字段";
|
|
4387
4389
|
var frontend_no_records_found = "无法找到记录";
|
|
4390
|
+
var frontend_records_no_allowedit = "您对这条记录没有编辑权限";
|
|
4388
4391
|
var zh_cn = {
|
|
4389
4392
|
frontend_field_group_generalization: frontend_field_group_generalization,
|
|
4390
4393
|
frontend_download: frontend_download,
|
|
@@ -4468,7 +4471,8 @@
|
|
|
4468
4471
|
frontend_message_modification_failed: frontend_message_modification_failed,
|
|
4469
4472
|
frontend_objects_related_alert_start: frontend_objects_related_alert_start,
|
|
4470
4473
|
frontend_objects_related_alert_end: frontend_objects_related_alert_end,
|
|
4471
|
-
frontend_no_records_found: frontend_no_records_found
|
|
4474
|
+
frontend_no_records_found: frontend_no_records_found,
|
|
4475
|
+
frontend_records_no_allowedit: frontend_records_no_allowedit
|
|
4472
4476
|
};
|
|
4473
4477
|
|
|
4474
4478
|
const resources = {
|
|
@@ -6522,12 +6526,14 @@
|
|
|
6522
6526
|
if(!event.data.isLookup){
|
|
6523
6527
|
// 刷新浏览器后,filterFormValues值是空的,只能从本地存储中取出并重置为空值
|
|
6524
6528
|
const listName = event.data.listName;
|
|
6525
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
6529
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
6526
6530
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
6527
6531
|
if(localListViewProps){
|
|
6528
6532
|
localListViewProps = JSON.parse(localListViewProps);
|
|
6529
6533
|
for(var k in localListViewProps){
|
|
6530
|
-
|
|
6534
|
+
if(k !== "__keywords"){
|
|
6535
|
+
removedValues[k] = null;
|
|
6536
|
+
}
|
|
6531
6537
|
}
|
|
6532
6538
|
}
|
|
6533
6539
|
}
|
|
@@ -6549,12 +6555,9 @@
|
|
|
6549
6555
|
const objectName = data.objectName;
|
|
6550
6556
|
const isLookup = data.isLookup;
|
|
6551
6557
|
const listName = data.listName;
|
|
6552
|
-
let searchableFieldsStoreKey = location.pathname + "/searchable_fields
|
|
6558
|
+
let searchableFieldsStoreKey = location.pathname + "/searchable_fields";
|
|
6553
6559
|
if(isLookup){
|
|
6554
|
-
searchableFieldsStoreKey += "lookup/" + objectName;
|
|
6555
|
-
}
|
|
6556
|
-
else{
|
|
6557
|
-
searchableFieldsStoreKey += (listName || "");
|
|
6560
|
+
searchableFieldsStoreKey += "/lookup/" + objectName;
|
|
6558
6561
|
}
|
|
6559
6562
|
let defaultSearchableFields = sessionStorage.getItem(searchableFieldsStoreKey);
|
|
6560
6563
|
if(defaultSearchableFields){
|
|
@@ -6581,7 +6584,7 @@
|
|
|
6581
6584
|
setData({ showFieldsFilter: false });
|
|
6582
6585
|
}
|
|
6583
6586
|
else{
|
|
6584
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
6587
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
6585
6588
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
6586
6589
|
if(localListViewProps){
|
|
6587
6590
|
localListViewProps = JSON.parse(localListViewProps);
|
|
@@ -6621,12 +6624,9 @@
|
|
|
6621
6624
|
return n.props.type === "service";
|
|
6622
6625
|
});
|
|
6623
6626
|
filterService.setData({ filterFormSearchableFields: value });
|
|
6624
|
-
let searchableFieldsStoreKey = location.pathname + "/searchable_fields
|
|
6627
|
+
let searchableFieldsStoreKey = location.pathname + "/searchable_fields";
|
|
6625
6628
|
if(isLookup){
|
|
6626
|
-
searchableFieldsStoreKey += "lookup/" + objectName;
|
|
6627
|
-
}
|
|
6628
|
-
else{
|
|
6629
|
-
searchableFieldsStoreKey += (listName || "");
|
|
6629
|
+
searchableFieldsStoreKey += "/lookup/" + objectName;
|
|
6630
6630
|
}
|
|
6631
6631
|
sessionStorage.setItem(searchableFieldsStoreKey, value);
|
|
6632
6632
|
|
|
@@ -6684,7 +6684,7 @@
|
|
|
6684
6684
|
}
|
|
6685
6685
|
|
|
6686
6686
|
// 列表视图crud支持本地缓存,所以需要进一步清除浏览器本地缓存里面用户在可搜索项中移除的字段值
|
|
6687
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
6687
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
6688
6688
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
6689
6689
|
if(localListViewProps){
|
|
6690
6690
|
localListViewProps = JSON.parse(localListViewProps);
|
|
@@ -8405,9 +8405,23 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8405
8405
|
`;
|
|
8406
8406
|
|
|
8407
8407
|
|
|
8408
|
-
function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true} = {}){
|
|
8408
|
+
function getObjectHeaderToolbar(mainObject, fields, formFactor, { showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true, isLookup = false } = {}){
|
|
8409
8409
|
// console.log(`getObjectHeaderToolbar====>`, filterVisible)
|
|
8410
|
-
console.log(`getObjectHeaderToolbar`, mainObject)
|
|
8410
|
+
// console.log(`getObjectHeaderToolbar`, mainObject)
|
|
8411
|
+
const searchableFieldsLabel = [];
|
|
8412
|
+
_.each(fields, function (field) {
|
|
8413
|
+
if (field.searchable && SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1) {
|
|
8414
|
+
searchableFieldsLabel.push(field.label);
|
|
8415
|
+
}
|
|
8416
|
+
});
|
|
8417
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
8418
|
+
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
8419
|
+
let crudKeywords = "";
|
|
8420
|
+
if(localListViewProps && !isLookup){
|
|
8421
|
+
localListViewProps = JSON.parse(localListViewProps);
|
|
8422
|
+
crudKeywords = (localListViewProps && localListViewProps.__keywords) || "";
|
|
8423
|
+
}
|
|
8424
|
+
|
|
8411
8425
|
const isMobile = window.innerWidth < 768;
|
|
8412
8426
|
if(isMobile){
|
|
8413
8427
|
showDisplayAs = false;
|
|
@@ -8463,7 +8477,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8463
8477
|
],
|
|
8464
8478
|
"size":8,
|
|
8465
8479
|
"animation": true,
|
|
8466
|
-
"visibleOn": "${isFieldsFilterEmpty == false}"
|
|
8480
|
+
"visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
|
|
8467
8481
|
},
|
|
8468
8482
|
"align": "right",
|
|
8469
8483
|
"className": "bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
@@ -8478,7 +8492,27 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8478
8492
|
}
|
|
8479
8493
|
}
|
|
8480
8494
|
} : {},
|
|
8481
|
-
getDisplayAsButton(mainObject?.name)
|
|
8495
|
+
getDisplayAsButton(mainObject?.name),
|
|
8496
|
+
{
|
|
8497
|
+
"type": "tooltip-wrapper",
|
|
8498
|
+
"align": "right",
|
|
8499
|
+
"title": "",
|
|
8500
|
+
"content": "可搜索字段:" + searchableFieldsLabel.join(","),
|
|
8501
|
+
"placement": "bottom",
|
|
8502
|
+
"tooltipTheme": "dark",
|
|
8503
|
+
"trigger": "click",
|
|
8504
|
+
// "className": "mr-1",
|
|
8505
|
+
"body": [
|
|
8506
|
+
{
|
|
8507
|
+
"type": "search-box",
|
|
8508
|
+
"name": "__keywords",
|
|
8509
|
+
"placeholder": "请输入关键字",
|
|
8510
|
+
"value": crudKeywords,
|
|
8511
|
+
"clearable": true,
|
|
8512
|
+
"clearAndSubmit": true
|
|
8513
|
+
}
|
|
8514
|
+
]
|
|
8515
|
+
},
|
|
8482
8516
|
]
|
|
8483
8517
|
}else {
|
|
8484
8518
|
return [
|
|
@@ -8497,21 +8531,9 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8497
8531
|
"type": "tpl",
|
|
8498
8532
|
"tpl": "${count} " + instance.t('frontend_record_sum')
|
|
8499
8533
|
},
|
|
8500
|
-
{
|
|
8501
|
-
"type": "reload",
|
|
8502
|
-
"align": "right",
|
|
8503
|
-
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
8504
|
-
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
8505
|
-
"tooltip":"",
|
|
8506
|
-
"tooltipPlacement": "top",
|
|
8507
|
-
"className": "bg-white p-2 rounded border-gray-300 text-gray-500"
|
|
8508
|
-
},
|
|
8509
|
-
// getExportExcelToolbarButtonSchema(),
|
|
8510
|
-
mainObject?.permissions?.allowCreateListViews ? getSettingListviewToolbarButtonSchema() : {},
|
|
8511
|
-
getDisplayAsButton(mainObject?.name),
|
|
8512
8534
|
filterVisible ? {
|
|
8513
8535
|
"label": instance.t('frontend_button_search_tooltip'),
|
|
8514
|
-
"icon": "fa fa-
|
|
8536
|
+
"icon": "fa fa-filter",
|
|
8515
8537
|
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
8516
8538
|
// "tooltip": i18next.t('frontend_button_search_tooltip'),
|
|
8517
8539
|
// "tooltipPlacement": "top",
|
|
@@ -8523,7 +8545,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8523
8545
|
],
|
|
8524
8546
|
"size":8,
|
|
8525
8547
|
"animation": true,
|
|
8526
|
-
"visibleOn": "${isFieldsFilterEmpty == false}"
|
|
8548
|
+
"visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
|
|
8527
8549
|
},
|
|
8528
8550
|
"align": "right",
|
|
8529
8551
|
"className": "bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
@@ -8537,14 +8559,39 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8537
8559
|
]
|
|
8538
8560
|
}
|
|
8539
8561
|
}
|
|
8540
|
-
} : {}
|
|
8541
|
-
|
|
8542
|
-
|
|
8543
|
-
|
|
8544
|
-
|
|
8545
|
-
|
|
8546
|
-
|
|
8547
|
-
|
|
8562
|
+
} : {},
|
|
8563
|
+
{
|
|
8564
|
+
"type": "reload",
|
|
8565
|
+
"align": "right",
|
|
8566
|
+
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
8567
|
+
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
8568
|
+
"tooltip":"",
|
|
8569
|
+
"tooltipPlacement": "top",
|
|
8570
|
+
"className": "bg-white p-2 rounded border-gray-300 text-gray-500"
|
|
8571
|
+
},
|
|
8572
|
+
// getExportExcelToolbarButtonSchema(),
|
|
8573
|
+
mainObject?.permissions?.allowCreateListViews ? getSettingListviewToolbarButtonSchema() : {},
|
|
8574
|
+
getDisplayAsButton(mainObject?.name),
|
|
8575
|
+
{
|
|
8576
|
+
"type": "tooltip-wrapper",
|
|
8577
|
+
"align": "right",
|
|
8578
|
+
"title": "",
|
|
8579
|
+
"content": "可搜索字段:" + searchableFieldsLabel.join(","),
|
|
8580
|
+
"placement": "bottom",
|
|
8581
|
+
"tooltipTheme": "dark",
|
|
8582
|
+
"trigger": "click",
|
|
8583
|
+
"className": "mr-1",
|
|
8584
|
+
"body": [
|
|
8585
|
+
{
|
|
8586
|
+
"type": "search-box",
|
|
8587
|
+
"name": "__keywords",
|
|
8588
|
+
"placeholder": "请输入关键字",
|
|
8589
|
+
"value": crudKeywords,
|
|
8590
|
+
"clearable": true,
|
|
8591
|
+
"clearAndSubmit": true
|
|
8592
|
+
}
|
|
8593
|
+
]
|
|
8594
|
+
},
|
|
8548
8595
|
// {
|
|
8549
8596
|
// "type": "drag-toggler",
|
|
8550
8597
|
// "align": "right"
|
|
@@ -8888,16 +8935,17 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8888
8935
|
"autoCheckChildren": false,
|
|
8889
8936
|
"searchable": true,
|
|
8890
8937
|
"searchConfig": {
|
|
8891
|
-
"sticky": true
|
|
8938
|
+
"sticky": true,
|
|
8939
|
+
"placeholder": "查找部门"
|
|
8892
8940
|
},
|
|
8893
8941
|
"unfoldedLevel": 2,
|
|
8894
8942
|
"style": {
|
|
8895
8943
|
"max-height": "100%",
|
|
8896
8944
|
"position": "absolute",
|
|
8897
|
-
"left": "-
|
|
8898
|
-
"width": "
|
|
8945
|
+
"left": "-330px",
|
|
8946
|
+
"width": "320px",
|
|
8899
8947
|
"bottom": 0,
|
|
8900
|
-
"top": "
|
|
8948
|
+
"top": "0",
|
|
8901
8949
|
"overflow": "auto",
|
|
8902
8950
|
"min-height":"300px"
|
|
8903
8951
|
},
|
|
@@ -8916,7 +8964,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8916
8964
|
ctx.idFieldName = refObjectConfig.idFieldName;
|
|
8917
8965
|
ctx.objectName = refObjectConfig.name;
|
|
8918
8966
|
|
|
8919
|
-
|
|
8967
|
+
let tableFields = [];
|
|
8920
8968
|
let i = 0;
|
|
8921
8969
|
const searchableFields = [];
|
|
8922
8970
|
|
|
@@ -8961,7 +9009,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8961
9009
|
})){
|
|
8962
9010
|
i++;
|
|
8963
9011
|
tableFields.push(field);
|
|
8964
|
-
if(field.searchable){
|
|
9012
|
+
if(field.searchable && SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1){
|
|
8965
9013
|
searchableFields.push(field.name);
|
|
8966
9014
|
}
|
|
8967
9015
|
}
|
|
@@ -9045,16 +9093,31 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
9045
9093
|
}
|
|
9046
9094
|
}
|
|
9047
9095
|
|
|
9048
|
-
|
|
9049
9096
|
if(allowSearchFields){
|
|
9050
9097
|
allowSearchFields.forEach(function(key){
|
|
9051
9098
|
const keyValue = selfData[key];
|
|
9052
|
-
if(keyValue){
|
|
9099
|
+
if(_.isString(keyValue)){
|
|
9053
9100
|
filters.push([key, "contains", keyValue]);
|
|
9101
|
+
}else if(_.isArray(keyValue) || _.isBoolean(keyValue) || keyValue){
|
|
9102
|
+
filters.push([key, "=", keyValue]);
|
|
9054
9103
|
}
|
|
9055
9104
|
})
|
|
9056
9105
|
}
|
|
9057
9106
|
|
|
9107
|
+
if(selfData.__keywords && allowSearchFields){
|
|
9108
|
+
const keywordsFilters = [];
|
|
9109
|
+
allowSearchFields.forEach(function(key, index){
|
|
9110
|
+
const keyValue = selfData.__keywords;
|
|
9111
|
+
if(keyValue){
|
|
9112
|
+
keywordsFilters.push([key, "contains", keyValue]);
|
|
9113
|
+
if(index < allowSearchFields.length - 1){
|
|
9114
|
+
keywordsFilters.push('or');
|
|
9115
|
+
}
|
|
9116
|
+
}
|
|
9117
|
+
})
|
|
9118
|
+
filters.push(keywordsFilters);
|
|
9119
|
+
};
|
|
9120
|
+
|
|
9058
9121
|
var fieldFilters = ${JSON.stringify(field.filters)};
|
|
9059
9122
|
if(fieldFilters && fieldFilters.length){
|
|
9060
9123
|
filters.push(fieldFilters);
|
|
@@ -9143,6 +9206,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
9143
9206
|
if(refObjectConfig.paging && refObjectConfig.paging.enabled === false){
|
|
9144
9207
|
top = 1000;
|
|
9145
9208
|
}
|
|
9209
|
+
|
|
9146
9210
|
let pickerSchema = null;
|
|
9147
9211
|
if(ctx.formFactor === 'SMALL'){
|
|
9148
9212
|
pickerSchema = await getListSchema$1(tableFields, {
|
|
@@ -9164,18 +9228,19 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
9164
9228
|
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user" && !isMobile){
|
|
9165
9229
|
headerToolbarItems = getLookupSapceUserTreeSchema();
|
|
9166
9230
|
pickerSchema["style"] = {
|
|
9167
|
-
"margin-left":"
|
|
9231
|
+
"margin-left":"330px",
|
|
9168
9232
|
"min-height": "300px"
|
|
9169
9233
|
};
|
|
9170
9234
|
pickerSchema.className = pickerSchema.className || "" + " steedos-select-user";
|
|
9171
9235
|
}
|
|
9172
9236
|
|
|
9173
|
-
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, ctx.formFactor, { headerToolbarItems });
|
|
9237
|
+
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { headerToolbarItems, isLookup: true });
|
|
9174
9238
|
const isAllowCreate = refObjectConfig.permissions.allowCreate;
|
|
9175
9239
|
if (isAllowCreate) {
|
|
9176
9240
|
const new_button = await getSchema$5(refObjectConfig, { appId: ctx.appId, objectName: refObjectConfig.name, formFactor: ctx.formFactor });
|
|
9177
9241
|
new_button.align = "right";
|
|
9178
|
-
|
|
9242
|
+
// 保持快速搜索放在最左侧,新建按钮往里插,而不是push到最后
|
|
9243
|
+
pickerSchema.headerToolbar.splice(pickerSchema.headerToolbar.length - 1, 0, new_button);
|
|
9179
9244
|
}
|
|
9180
9245
|
pickerSchema.footerToolbar = refObjectConfig.enable_tree ? [] : getObjectFooterToolbar();
|
|
9181
9246
|
if (ctx.filterVisible !== false) {
|
|
@@ -9892,6 +9957,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
9892
9957
|
return readonly ? getAmisFileReadonlySchema(steedosField) : getAmisFileEditSchema(steedosField);
|
|
9893
9958
|
};
|
|
9894
9959
|
|
|
9960
|
+
const SEARCHABLE_FIELD_TYPES = ["text", "textarea", "autonumber", "url", "email"];
|
|
9895
9961
|
const OMIT_FIELDS = ['created', 'created_by', 'modified', 'modified_by'];
|
|
9896
9962
|
// const Lookup = require('./lookup');
|
|
9897
9963
|
|
|
@@ -10666,6 +10732,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
10666
10732
|
|
|
10667
10733
|
var index = /*#__PURE__*/Object.freeze({
|
|
10668
10734
|
__proto__: null,
|
|
10735
|
+
SEARCHABLE_FIELD_TYPES: SEARCHABLE_FIELD_TYPES,
|
|
10669
10736
|
OMIT_FIELDS: OMIT_FIELDS,
|
|
10670
10737
|
getBaseFields: getBaseFields,
|
|
10671
10738
|
getAmisFieldType: getAmisFieldType,
|
|
@@ -10865,7 +10932,71 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
10865
10932
|
`;
|
|
10866
10933
|
break;
|
|
10867
10934
|
}
|
|
10868
|
-
|
|
10935
|
+
quickEditSchema.body[0].visibleOn = "${quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}";
|
|
10936
|
+
quickEditSchema.body.push({
|
|
10937
|
+
"type":"service",
|
|
10938
|
+
"body":[
|
|
10939
|
+
{
|
|
10940
|
+
"type": "tpl",
|
|
10941
|
+
"tpl": instance.t('frontend_records_no_allowedit'),
|
|
10942
|
+
"visibleOn": "${!quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}"
|
|
10943
|
+
},
|
|
10944
|
+
{
|
|
10945
|
+
"type": "spinner",
|
|
10946
|
+
"showOn": "${quickedit_record_permissions_loading}"
|
|
10947
|
+
}
|
|
10948
|
+
],
|
|
10949
|
+
"onEvent":{
|
|
10950
|
+
"init":{
|
|
10951
|
+
"actions":[
|
|
10952
|
+
{
|
|
10953
|
+
"actionType": "setValue",
|
|
10954
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
10955
|
+
"args": {
|
|
10956
|
+
"value":{
|
|
10957
|
+
"quickedit_record_permissions_loading": true
|
|
10958
|
+
}
|
|
10959
|
+
}
|
|
10960
|
+
},
|
|
10961
|
+
{
|
|
10962
|
+
"actionType": "ajax",
|
|
10963
|
+
"args": {
|
|
10964
|
+
"api": {
|
|
10965
|
+
"url": "${context.rootUrl}/service/api/@\${objectName}/recordPermissions/${_id}",
|
|
10966
|
+
"method": "get",
|
|
10967
|
+
"headers": {
|
|
10968
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
10969
|
+
},
|
|
10970
|
+
"cache": 30000,
|
|
10971
|
+
"messages": {
|
|
10972
|
+
"failed": "失败了呢。。"
|
|
10973
|
+
}
|
|
10974
|
+
}
|
|
10975
|
+
}
|
|
10976
|
+
},
|
|
10977
|
+
{
|
|
10978
|
+
"actionType": "setValue",
|
|
10979
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
10980
|
+
"args": {
|
|
10981
|
+
"value":{
|
|
10982
|
+
"quickedit_record_permissions_loading": false
|
|
10983
|
+
}
|
|
10984
|
+
}
|
|
10985
|
+
},
|
|
10986
|
+
{
|
|
10987
|
+
"actionType": "setValue",
|
|
10988
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
10989
|
+
"args": {
|
|
10990
|
+
"value":{
|
|
10991
|
+
"quickedit_record_permissions": "${event.data}"
|
|
10992
|
+
}
|
|
10993
|
+
}
|
|
10994
|
+
}
|
|
10995
|
+
]
|
|
10996
|
+
}
|
|
10997
|
+
}
|
|
10998
|
+
|
|
10999
|
+
});
|
|
10869
11000
|
} else {
|
|
10870
11001
|
quickEditSchema = false;
|
|
10871
11002
|
}
|
|
@@ -10898,7 +11029,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
10898
11029
|
|
|
10899
11030
|
async function getTableColumns$1(fields, options){
|
|
10900
11031
|
const columns = [{name: '_index',type: 'text', width: 32, placeholder: ""}];
|
|
10901
|
-
const allowEdit = options.permissions?.allowEdit &&
|
|
11032
|
+
const allowEdit = options.permissions?.allowEdit && !options.isLookup && options.enable_inline_edit != false;
|
|
10902
11033
|
|
|
10903
11034
|
for (const field of fields) {
|
|
10904
11035
|
//增加quickEdit属性,实现快速编辑
|
|
@@ -11389,7 +11520,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
11389
11520
|
baseFilters = filter;
|
|
11390
11521
|
}
|
|
11391
11522
|
___default__namespace.each(fields,function(field){
|
|
11392
|
-
if(field.searchable){
|
|
11523
|
+
if(field.searchable && SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1){
|
|
11393
11524
|
searchableFields.push(field.name);
|
|
11394
11525
|
}
|
|
11395
11526
|
});
|
|
@@ -11436,7 +11567,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
11436
11567
|
try{
|
|
11437
11568
|
// TODO: 不应该直接在这里取localStorage,应该从外面传入
|
|
11438
11569
|
const listName = api.data.listName;
|
|
11439
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
11570
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
11440
11571
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
11441
11572
|
if(localListViewProps){
|
|
11442
11573
|
localListViewProps = JSON.parse(localListViewProps);
|
|
@@ -11637,7 +11768,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
11637
11768
|
try{
|
|
11638
11769
|
// TODO: 不应该直接在这里取localStorage,应该从外面传入
|
|
11639
11770
|
const listName = api.body.listName;
|
|
11640
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
11771
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
11641
11772
|
/**
|
|
11642
11773
|
* localListViewProps规范来自crud请求api中api.data.$self参数值的。
|
|
11643
11774
|
* 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
|
|
@@ -12827,7 +12958,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
12827
12958
|
}
|
|
12828
12959
|
}
|
|
12829
12960
|
// console.log(`getObjectHeaderToolbar====2===>`, options.filterVisible)
|
|
12830
|
-
bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, options.formFactor, {
|
|
12961
|
+
bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, fields, options.formFactor, {
|
|
12831
12962
|
showDisplayAs,
|
|
12832
12963
|
hiddenCount: options.queryCount === false,
|
|
12833
12964
|
headerToolbarItems: options.headerToolbarItems,
|
|
@@ -12952,6 +13083,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
12952
13083
|
return {
|
|
12953
13084
|
type: 'service',
|
|
12954
13085
|
className: '',
|
|
13086
|
+
//目前crud的service层id不认用户自定义id,只支持默认规则id
|
|
12955
13087
|
id: `service_${id}`,
|
|
12956
13088
|
name: `page`,
|
|
12957
13089
|
data: {
|
|
@@ -18540,7 +18672,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
18540
18672
|
if (links) {
|
|
18541
18673
|
return [2 /*return*/, {
|
|
18542
18674
|
"type": "nav",
|
|
18543
|
-
className: "".concat(className),
|
|
18675
|
+
className: "".concat(className, " text-black"),
|
|
18544
18676
|
"stacked": stacked,
|
|
18545
18677
|
"overflow": overflow,
|
|
18546
18678
|
"indentSize": indentSize,
|
|
@@ -18552,7 +18684,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
18552
18684
|
schemaApi: {
|
|
18553
18685
|
"method": "get",
|
|
18554
18686
|
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
|
|
18555
|
-
"adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"\";\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500
|
|
18687
|
+
"adaptor": "\n try {\n console.log('payload====>', payload)\n if(payload.nav_schema){\n payload.data = payload.nav_schema;\n return payload\n }\n\n const data = { nav: [] };\n const stacked = ".concat(stacked, ";\n const showIcon = ").concat(showIcon, ";\n const selectedId = '").concat(selectedId, "';\n const tab_groups = payload.tab_groups;\n const locationPathname = window.location.pathname;\n var customTabId = \"\";\n var objectTabId = \"\";\n if(stacked){\n _.each(_.groupBy(payload.children, 'group'), (tabs, groupName) => {\n if (groupName === 'undefined' || groupName === '') {\n _.each(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n })\n })\n } else {\n data.nav.push({\n \"label\": groupName,\n \"unfolded\": _.find(tab_groups, {\"group_name\": groupName})?.default_open != false,\n \"children\": _.map(tabs, (tab) => {\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n return {\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n }\n })\n }) \n }\n });\n }else{\n _.each(payload.children, (tab)=>{\n if(locationPathname == tab.path){\n customTabId = tab.id;\n }else if(locationPathname.startsWith(tab.path + \"/\")){\n objectTabId = tab.id;\n }\n data.nav.push({\n \"label\": showIcon ? {\n type: 'tpl',\n tpl: `<span class='fill-slate-500 word-break leading-6 block -ml-px no-underline group flex items-center text-[15px] rounded-md'><svg class=\"mr-1 flex-shrink-0 h-6 w-6\"><use xlink:href=\"/assets/icons/standard-sprite/svg/symbols.svg#${tab.icon || 'account'}\"></use></svg>${tab.name}</span>`\n } : tab.name,\n \"to\": tab.path,\n \"target\":tab.target,\n \"id\": tab.id,\n \"activeOn\": \"\\\\${tabId == '\"+ tab.id +\"'}\"\n // active: selectedId === tab.id,\n });\n })\n }\n\n payload.data = {\n \"type\":\"service\",\n \"data\":{\n \"tabId\": customTabId || objectTabId,\n \"items\": data.nav\n },\n \"id\": \"appMenuService\",\n \"body\":{\n \"type\": \"nav\",\n className: \"").concat(className, " text-black\",\n \"stacked\": ").concat(stacked, ",\n \"overflow\": ").concat(JSON.stringify(overflow), ",\n \"indentSize\": ").concat(indentSize, ",\n \"source\": \"${items}\",\n \"onEvent\": {\n \"click\": {\n \"actions\": [\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.item.id}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.item.id}\"\n }\n ]\n },\n \"@tabId.changed\":{\n \"actions\":[\n {\n \"actionType\": \"setValue\",\n \"componentId\": \"appMenuService\",\n \"args\": {\n \"value\": {\n \"tabId\": \"${event.data.tabId}\",\n \"items\": data.nav\n }\n },\n \"expression\":\"${event.data.tabId}\"\n }\n ]\n }\n }\n }\n };\n } catch (error) {\n console.log(`error`, error)\n }\n console.log('payload===2==>', payload)\n return payload;\n "),
|
|
18556
18688
|
"headers": {
|
|
18557
18689
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
18558
18690
|
}
|
|
@@ -19588,7 +19720,8 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
19588
19720
|
type: 'service',
|
|
19589
19721
|
className: {
|
|
19590
19722
|
"h-full": "true",
|
|
19591
|
-
"sm:px-3 sm:pt-3": "${display != 'split'}"
|
|
19723
|
+
"sm:px-3 sm:pt-3 page-list-grid": "${display != 'split'}",
|
|
19724
|
+
"page-list-split": "${display == 'split'}"
|
|
19592
19725
|
},
|
|
19593
19726
|
body: listSchema
|
|
19594
19727
|
}];
|