@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.esm.js
CHANGED
|
@@ -4191,6 +4191,7 @@ var frontend_message_modification_failed$1 = "Modification failed!";
|
|
|
4191
4191
|
var frontend_objects_related_alert_start$1 = "No related table fields associated with the related list object";
|
|
4192
4192
|
var frontend_objects_related_alert_end$1 = "were found.";
|
|
4193
4193
|
var frontend_no_records_found$1 = "No records found.";
|
|
4194
|
+
var frontend_records_no_allowedit$1 = "You do not have edit permission for this record";
|
|
4194
4195
|
var en_us = {
|
|
4195
4196
|
frontend_field_group_generalization: frontend_field_group_generalization$1,
|
|
4196
4197
|
frontend_download: frontend_download$1,
|
|
@@ -4273,7 +4274,8 @@ var en_us = {
|
|
|
4273
4274
|
frontend_message_modification_failed: frontend_message_modification_failed$1,
|
|
4274
4275
|
frontend_objects_related_alert_start: frontend_objects_related_alert_start$1,
|
|
4275
4276
|
frontend_objects_related_alert_end: frontend_objects_related_alert_end$1,
|
|
4276
|
-
frontend_no_records_found: frontend_no_records_found$1
|
|
4277
|
+
frontend_no_records_found: frontend_no_records_found$1,
|
|
4278
|
+
frontend_records_no_allowedit: frontend_records_no_allowedit$1
|
|
4277
4279
|
};
|
|
4278
4280
|
|
|
4279
4281
|
var frontend_field_group_generalization = "通用";
|
|
@@ -4297,7 +4299,7 @@ var frontend_display_type_is_split = "分栏视图";
|
|
|
4297
4299
|
var frontend_display_as = "显示为";
|
|
4298
4300
|
var frontend_record_sum = "个项目";
|
|
4299
4301
|
var frontend_button_reload_tooltip = "刷新";
|
|
4300
|
-
var frontend_button_search_tooltip = "
|
|
4302
|
+
var frontend_button_search_tooltip = "查询";
|
|
4301
4303
|
var frontend_fields_filter_button_search = "搜索";
|
|
4302
4304
|
var frontend_fields_filter_button_settings = "设置搜索项";
|
|
4303
4305
|
var frontend_button_listview_control_tooltip = "列表视图控制";
|
|
@@ -4359,6 +4361,7 @@ var frontend_message_modification_failed = "修改失败!";
|
|
|
4359
4361
|
var frontend_objects_related_alert_start = "未找到与相关列表对象";
|
|
4360
4362
|
var frontend_objects_related_alert_end = "关联的相关表字段";
|
|
4361
4363
|
var frontend_no_records_found = "无法找到记录";
|
|
4364
|
+
var frontend_records_no_allowedit = "您对这条记录没有编辑权限";
|
|
4362
4365
|
var zh_cn = {
|
|
4363
4366
|
frontend_field_group_generalization: frontend_field_group_generalization,
|
|
4364
4367
|
frontend_download: frontend_download,
|
|
@@ -4442,7 +4445,8 @@ var zh_cn = {
|
|
|
4442
4445
|
frontend_message_modification_failed: frontend_message_modification_failed,
|
|
4443
4446
|
frontend_objects_related_alert_start: frontend_objects_related_alert_start,
|
|
4444
4447
|
frontend_objects_related_alert_end: frontend_objects_related_alert_end,
|
|
4445
|
-
frontend_no_records_found: frontend_no_records_found
|
|
4448
|
+
frontend_no_records_found: frontend_no_records_found,
|
|
4449
|
+
frontend_records_no_allowedit: frontend_records_no_allowedit
|
|
4446
4450
|
};
|
|
4447
4451
|
|
|
4448
4452
|
const resources = {
|
|
@@ -6496,12 +6500,14 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6496
6500
|
if(!event.data.isLookup){
|
|
6497
6501
|
// 刷新浏览器后,filterFormValues值是空的,只能从本地存储中取出并重置为空值
|
|
6498
6502
|
const listName = event.data.listName;
|
|
6499
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
6503
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
6500
6504
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
6501
6505
|
if(localListViewProps){
|
|
6502
6506
|
localListViewProps = JSON.parse(localListViewProps);
|
|
6503
6507
|
for(var k in localListViewProps){
|
|
6504
|
-
|
|
6508
|
+
if(k !== "__keywords"){
|
|
6509
|
+
removedValues[k] = null;
|
|
6510
|
+
}
|
|
6505
6511
|
}
|
|
6506
6512
|
}
|
|
6507
6513
|
}
|
|
@@ -6523,12 +6529,9 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6523
6529
|
const objectName = data.objectName;
|
|
6524
6530
|
const isLookup = data.isLookup;
|
|
6525
6531
|
const listName = data.listName;
|
|
6526
|
-
let searchableFieldsStoreKey = location.pathname + "/searchable_fields
|
|
6532
|
+
let searchableFieldsStoreKey = location.pathname + "/searchable_fields";
|
|
6527
6533
|
if(isLookup){
|
|
6528
|
-
searchableFieldsStoreKey += "lookup/" + objectName;
|
|
6529
|
-
}
|
|
6530
|
-
else{
|
|
6531
|
-
searchableFieldsStoreKey += (listName || "");
|
|
6534
|
+
searchableFieldsStoreKey += "/lookup/" + objectName;
|
|
6532
6535
|
}
|
|
6533
6536
|
let defaultSearchableFields = sessionStorage.getItem(searchableFieldsStoreKey);
|
|
6534
6537
|
if(defaultSearchableFields){
|
|
@@ -6555,7 +6558,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6555
6558
|
setData({ showFieldsFilter: false });
|
|
6556
6559
|
}
|
|
6557
6560
|
else{
|
|
6558
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
6561
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
6559
6562
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
6560
6563
|
if(localListViewProps){
|
|
6561
6564
|
localListViewProps = JSON.parse(localListViewProps);
|
|
@@ -6595,12 +6598,9 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6595
6598
|
return n.props.type === "service";
|
|
6596
6599
|
});
|
|
6597
6600
|
filterService.setData({ filterFormSearchableFields: value });
|
|
6598
|
-
let searchableFieldsStoreKey = location.pathname + "/searchable_fields
|
|
6601
|
+
let searchableFieldsStoreKey = location.pathname + "/searchable_fields";
|
|
6599
6602
|
if(isLookup){
|
|
6600
|
-
searchableFieldsStoreKey += "lookup/" + objectName;
|
|
6601
|
-
}
|
|
6602
|
-
else{
|
|
6603
|
-
searchableFieldsStoreKey += (listName || "");
|
|
6603
|
+
searchableFieldsStoreKey += "/lookup/" + objectName;
|
|
6604
6604
|
}
|
|
6605
6605
|
sessionStorage.setItem(searchableFieldsStoreKey, value);
|
|
6606
6606
|
|
|
@@ -6658,7 +6658,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6658
6658
|
}
|
|
6659
6659
|
|
|
6660
6660
|
// 列表视图crud支持本地缓存,所以需要进一步清除浏览器本地缓存里面用户在可搜索项中移除的字段值
|
|
6661
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
6661
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
6662
6662
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
6663
6663
|
if(localListViewProps){
|
|
6664
6664
|
localListViewProps = JSON.parse(localListViewProps);
|
|
@@ -8379,9 +8379,23 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8379
8379
|
`;
|
|
8380
8380
|
|
|
8381
8381
|
|
|
8382
|
-
function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true} = {}){
|
|
8382
|
+
function getObjectHeaderToolbar(mainObject, fields, formFactor, { showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true, isLookup = false } = {}){
|
|
8383
8383
|
// console.log(`getObjectHeaderToolbar====>`, filterVisible)
|
|
8384
|
-
console.log(`getObjectHeaderToolbar`, mainObject)
|
|
8384
|
+
// console.log(`getObjectHeaderToolbar`, mainObject)
|
|
8385
|
+
const searchableFieldsLabel = [];
|
|
8386
|
+
_.each(fields, function (field) {
|
|
8387
|
+
if (field.searchable && SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1) {
|
|
8388
|
+
searchableFieldsLabel.push(field.label);
|
|
8389
|
+
}
|
|
8390
|
+
});
|
|
8391
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
8392
|
+
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
8393
|
+
let crudKeywords = "";
|
|
8394
|
+
if(localListViewProps && !isLookup){
|
|
8395
|
+
localListViewProps = JSON.parse(localListViewProps);
|
|
8396
|
+
crudKeywords = (localListViewProps && localListViewProps.__keywords) || "";
|
|
8397
|
+
}
|
|
8398
|
+
|
|
8385
8399
|
const isMobile = window.innerWidth < 768;
|
|
8386
8400
|
if(isMobile){
|
|
8387
8401
|
showDisplayAs = false;
|
|
@@ -8437,7 +8451,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
8437
8451
|
],
|
|
8438
8452
|
"size":8,
|
|
8439
8453
|
"animation": true,
|
|
8440
|
-
"visibleOn": "${isFieldsFilterEmpty == false}"
|
|
8454
|
+
"visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
|
|
8441
8455
|
},
|
|
8442
8456
|
"align": "right",
|
|
8443
8457
|
"className": "bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
@@ -8452,7 +8466,27 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
8452
8466
|
}
|
|
8453
8467
|
}
|
|
8454
8468
|
} : {},
|
|
8455
|
-
getDisplayAsButton(mainObject?.name)
|
|
8469
|
+
getDisplayAsButton(mainObject?.name),
|
|
8470
|
+
{
|
|
8471
|
+
"type": "tooltip-wrapper",
|
|
8472
|
+
"align": "right",
|
|
8473
|
+
"title": "",
|
|
8474
|
+
"content": "可搜索字段:" + searchableFieldsLabel.join(","),
|
|
8475
|
+
"placement": "bottom",
|
|
8476
|
+
"tooltipTheme": "dark",
|
|
8477
|
+
"trigger": "click",
|
|
8478
|
+
// "className": "mr-1",
|
|
8479
|
+
"body": [
|
|
8480
|
+
{
|
|
8481
|
+
"type": "search-box",
|
|
8482
|
+
"name": "__keywords",
|
|
8483
|
+
"placeholder": "请输入关键字",
|
|
8484
|
+
"value": crudKeywords,
|
|
8485
|
+
"clearable": true,
|
|
8486
|
+
"clearAndSubmit": true
|
|
8487
|
+
}
|
|
8488
|
+
]
|
|
8489
|
+
},
|
|
8456
8490
|
]
|
|
8457
8491
|
}else {
|
|
8458
8492
|
return [
|
|
@@ -8471,21 +8505,9 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
8471
8505
|
"type": "tpl",
|
|
8472
8506
|
"tpl": "${count} " + instance.t('frontend_record_sum')
|
|
8473
8507
|
},
|
|
8474
|
-
{
|
|
8475
|
-
"type": "reload",
|
|
8476
|
-
"align": "right",
|
|
8477
|
-
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
8478
|
-
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
8479
|
-
"tooltip":"",
|
|
8480
|
-
"tooltipPlacement": "top",
|
|
8481
|
-
"className": "bg-white p-2 rounded border-gray-300 text-gray-500"
|
|
8482
|
-
},
|
|
8483
|
-
// getExportExcelToolbarButtonSchema(),
|
|
8484
|
-
mainObject?.permissions?.allowCreateListViews ? getSettingListviewToolbarButtonSchema() : {},
|
|
8485
|
-
getDisplayAsButton(mainObject?.name),
|
|
8486
8508
|
filterVisible ? {
|
|
8487
8509
|
"label": instance.t('frontend_button_search_tooltip'),
|
|
8488
|
-
"icon": "fa fa-
|
|
8510
|
+
"icon": "fa fa-filter",
|
|
8489
8511
|
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
8490
8512
|
// "tooltip": i18next.t('frontend_button_search_tooltip'),
|
|
8491
8513
|
// "tooltipPlacement": "top",
|
|
@@ -8497,7 +8519,7 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
8497
8519
|
],
|
|
8498
8520
|
"size":8,
|
|
8499
8521
|
"animation": true,
|
|
8500
|
-
"visibleOn": "${isFieldsFilterEmpty == false}"
|
|
8522
|
+
"visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
|
|
8501
8523
|
},
|
|
8502
8524
|
"align": "right",
|
|
8503
8525
|
"className": "bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
@@ -8511,14 +8533,39 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
8511
8533
|
]
|
|
8512
8534
|
}
|
|
8513
8535
|
}
|
|
8514
|
-
} : {}
|
|
8515
|
-
|
|
8516
|
-
|
|
8517
|
-
|
|
8518
|
-
|
|
8519
|
-
|
|
8520
|
-
|
|
8521
|
-
|
|
8536
|
+
} : {},
|
|
8537
|
+
{
|
|
8538
|
+
"type": "reload",
|
|
8539
|
+
"align": "right",
|
|
8540
|
+
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
8541
|
+
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
8542
|
+
"tooltip":"",
|
|
8543
|
+
"tooltipPlacement": "top",
|
|
8544
|
+
"className": "bg-white p-2 rounded border-gray-300 text-gray-500"
|
|
8545
|
+
},
|
|
8546
|
+
// getExportExcelToolbarButtonSchema(),
|
|
8547
|
+
mainObject?.permissions?.allowCreateListViews ? getSettingListviewToolbarButtonSchema() : {},
|
|
8548
|
+
getDisplayAsButton(mainObject?.name),
|
|
8549
|
+
{
|
|
8550
|
+
"type": "tooltip-wrapper",
|
|
8551
|
+
"align": "right",
|
|
8552
|
+
"title": "",
|
|
8553
|
+
"content": "可搜索字段:" + searchableFieldsLabel.join(","),
|
|
8554
|
+
"placement": "bottom",
|
|
8555
|
+
"tooltipTheme": "dark",
|
|
8556
|
+
"trigger": "click",
|
|
8557
|
+
"className": "mr-1",
|
|
8558
|
+
"body": [
|
|
8559
|
+
{
|
|
8560
|
+
"type": "search-box",
|
|
8561
|
+
"name": "__keywords",
|
|
8562
|
+
"placeholder": "请输入关键字",
|
|
8563
|
+
"value": crudKeywords,
|
|
8564
|
+
"clearable": true,
|
|
8565
|
+
"clearAndSubmit": true
|
|
8566
|
+
}
|
|
8567
|
+
]
|
|
8568
|
+
},
|
|
8522
8569
|
// {
|
|
8523
8570
|
// "type": "drag-toggler",
|
|
8524
8571
|
// "align": "right"
|
|
@@ -8862,16 +8909,17 @@ function getLookupSapceUserTreeSchema(){
|
|
|
8862
8909
|
"autoCheckChildren": false,
|
|
8863
8910
|
"searchable": true,
|
|
8864
8911
|
"searchConfig": {
|
|
8865
|
-
"sticky": true
|
|
8912
|
+
"sticky": true,
|
|
8913
|
+
"placeholder": "查找部门"
|
|
8866
8914
|
},
|
|
8867
8915
|
"unfoldedLevel": 2,
|
|
8868
8916
|
"style": {
|
|
8869
8917
|
"max-height": "100%",
|
|
8870
8918
|
"position": "absolute",
|
|
8871
|
-
"left": "-
|
|
8872
|
-
"width": "
|
|
8919
|
+
"left": "-330px",
|
|
8920
|
+
"width": "320px",
|
|
8873
8921
|
"bottom": 0,
|
|
8874
|
-
"top": "
|
|
8922
|
+
"top": "0",
|
|
8875
8923
|
"overflow": "auto",
|
|
8876
8924
|
"min-height":"300px"
|
|
8877
8925
|
},
|
|
@@ -8890,7 +8938,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
8890
8938
|
ctx.idFieldName = refObjectConfig.idFieldName;
|
|
8891
8939
|
ctx.objectName = refObjectConfig.name;
|
|
8892
8940
|
|
|
8893
|
-
|
|
8941
|
+
let tableFields = [];
|
|
8894
8942
|
let i = 0;
|
|
8895
8943
|
const searchableFields = [];
|
|
8896
8944
|
|
|
@@ -8935,7 +8983,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
8935
8983
|
})){
|
|
8936
8984
|
i++;
|
|
8937
8985
|
tableFields.push(field);
|
|
8938
|
-
if(field.searchable){
|
|
8986
|
+
if(field.searchable && SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1){
|
|
8939
8987
|
searchableFields.push(field.name);
|
|
8940
8988
|
}
|
|
8941
8989
|
}
|
|
@@ -9019,16 +9067,31 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
9019
9067
|
}
|
|
9020
9068
|
}
|
|
9021
9069
|
|
|
9022
|
-
|
|
9023
9070
|
if(allowSearchFields){
|
|
9024
9071
|
allowSearchFields.forEach(function(key){
|
|
9025
9072
|
const keyValue = selfData[key];
|
|
9026
|
-
if(keyValue){
|
|
9073
|
+
if(_.isString(keyValue)){
|
|
9027
9074
|
filters.push([key, "contains", keyValue]);
|
|
9075
|
+
}else if(_.isArray(keyValue) || _.isBoolean(keyValue) || keyValue){
|
|
9076
|
+
filters.push([key, "=", keyValue]);
|
|
9028
9077
|
}
|
|
9029
9078
|
})
|
|
9030
9079
|
}
|
|
9031
9080
|
|
|
9081
|
+
if(selfData.__keywords && allowSearchFields){
|
|
9082
|
+
const keywordsFilters = [];
|
|
9083
|
+
allowSearchFields.forEach(function(key, index){
|
|
9084
|
+
const keyValue = selfData.__keywords;
|
|
9085
|
+
if(keyValue){
|
|
9086
|
+
keywordsFilters.push([key, "contains", keyValue]);
|
|
9087
|
+
if(index < allowSearchFields.length - 1){
|
|
9088
|
+
keywordsFilters.push('or');
|
|
9089
|
+
}
|
|
9090
|
+
}
|
|
9091
|
+
})
|
|
9092
|
+
filters.push(keywordsFilters);
|
|
9093
|
+
};
|
|
9094
|
+
|
|
9032
9095
|
var fieldFilters = ${JSON.stringify(field.filters)};
|
|
9033
9096
|
if(fieldFilters && fieldFilters.length){
|
|
9034
9097
|
filters.push(fieldFilters);
|
|
@@ -9117,6 +9180,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
9117
9180
|
if(refObjectConfig.paging && refObjectConfig.paging.enabled === false){
|
|
9118
9181
|
top = 1000;
|
|
9119
9182
|
}
|
|
9183
|
+
|
|
9120
9184
|
let pickerSchema = null;
|
|
9121
9185
|
if(ctx.formFactor === 'SMALL'){
|
|
9122
9186
|
pickerSchema = await getListSchema$1(tableFields, {
|
|
@@ -9138,18 +9202,19 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
9138
9202
|
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user" && !isMobile){
|
|
9139
9203
|
headerToolbarItems = getLookupSapceUserTreeSchema();
|
|
9140
9204
|
pickerSchema["style"] = {
|
|
9141
|
-
"margin-left":"
|
|
9205
|
+
"margin-left":"330px",
|
|
9142
9206
|
"min-height": "300px"
|
|
9143
9207
|
};
|
|
9144
9208
|
pickerSchema.className = pickerSchema.className || "" + " steedos-select-user";
|
|
9145
9209
|
}
|
|
9146
9210
|
|
|
9147
|
-
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, ctx.formFactor, { headerToolbarItems });
|
|
9211
|
+
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { headerToolbarItems, isLookup: true });
|
|
9148
9212
|
const isAllowCreate = refObjectConfig.permissions.allowCreate;
|
|
9149
9213
|
if (isAllowCreate) {
|
|
9150
9214
|
const new_button = await getSchema$5(refObjectConfig, { appId: ctx.appId, objectName: refObjectConfig.name, formFactor: ctx.formFactor });
|
|
9151
9215
|
new_button.align = "right";
|
|
9152
|
-
|
|
9216
|
+
// 保持快速搜索放在最左侧,新建按钮往里插,而不是push到最后
|
|
9217
|
+
pickerSchema.headerToolbar.splice(pickerSchema.headerToolbar.length - 1, 0, new_button);
|
|
9153
9218
|
}
|
|
9154
9219
|
pickerSchema.footerToolbar = refObjectConfig.enable_tree ? [] : getObjectFooterToolbar();
|
|
9155
9220
|
if (ctx.filterVisible !== false) {
|
|
@@ -9866,6 +9931,7 @@ const getAmisFileSchema = (steedosField, readonly)=>{
|
|
|
9866
9931
|
return readonly ? getAmisFileReadonlySchema(steedosField) : getAmisFileEditSchema(steedosField);
|
|
9867
9932
|
};
|
|
9868
9933
|
|
|
9934
|
+
const SEARCHABLE_FIELD_TYPES = ["text", "textarea", "autonumber", "url", "email"];
|
|
9869
9935
|
const OMIT_FIELDS = ['created', 'created_by', 'modified', 'modified_by'];
|
|
9870
9936
|
// const Lookup = require('./lookup');
|
|
9871
9937
|
|
|
@@ -10640,6 +10706,7 @@ if (typeof window != 'undefined') {
|
|
|
10640
10706
|
|
|
10641
10707
|
var index = /*#__PURE__*/Object.freeze({
|
|
10642
10708
|
__proto__: null,
|
|
10709
|
+
SEARCHABLE_FIELD_TYPES: SEARCHABLE_FIELD_TYPES,
|
|
10643
10710
|
OMIT_FIELDS: OMIT_FIELDS,
|
|
10644
10711
|
getBaseFields: getBaseFields,
|
|
10645
10712
|
getAmisFieldType: getAmisFieldType,
|
|
@@ -10839,7 +10906,71 @@ async function getQuickEditSchema(field, options){
|
|
|
10839
10906
|
`;
|
|
10840
10907
|
break;
|
|
10841
10908
|
}
|
|
10842
|
-
|
|
10909
|
+
quickEditSchema.body[0].visibleOn = "${quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}";
|
|
10910
|
+
quickEditSchema.body.push({
|
|
10911
|
+
"type":"service",
|
|
10912
|
+
"body":[
|
|
10913
|
+
{
|
|
10914
|
+
"type": "tpl",
|
|
10915
|
+
"tpl": instance.t('frontend_records_no_allowedit'),
|
|
10916
|
+
"visibleOn": "${!quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}"
|
|
10917
|
+
},
|
|
10918
|
+
{
|
|
10919
|
+
"type": "spinner",
|
|
10920
|
+
"showOn": "${quickedit_record_permissions_loading}"
|
|
10921
|
+
}
|
|
10922
|
+
],
|
|
10923
|
+
"onEvent":{
|
|
10924
|
+
"init":{
|
|
10925
|
+
"actions":[
|
|
10926
|
+
{
|
|
10927
|
+
"actionType": "setValue",
|
|
10928
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
10929
|
+
"args": {
|
|
10930
|
+
"value":{
|
|
10931
|
+
"quickedit_record_permissions_loading": true
|
|
10932
|
+
}
|
|
10933
|
+
}
|
|
10934
|
+
},
|
|
10935
|
+
{
|
|
10936
|
+
"actionType": "ajax",
|
|
10937
|
+
"args": {
|
|
10938
|
+
"api": {
|
|
10939
|
+
"url": "${context.rootUrl}/service/api/@\${objectName}/recordPermissions/${_id}",
|
|
10940
|
+
"method": "get",
|
|
10941
|
+
"headers": {
|
|
10942
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
10943
|
+
},
|
|
10944
|
+
"cache": 30000,
|
|
10945
|
+
"messages": {
|
|
10946
|
+
"failed": "失败了呢。。"
|
|
10947
|
+
}
|
|
10948
|
+
}
|
|
10949
|
+
}
|
|
10950
|
+
},
|
|
10951
|
+
{
|
|
10952
|
+
"actionType": "setValue",
|
|
10953
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
10954
|
+
"args": {
|
|
10955
|
+
"value":{
|
|
10956
|
+
"quickedit_record_permissions_loading": false
|
|
10957
|
+
}
|
|
10958
|
+
}
|
|
10959
|
+
},
|
|
10960
|
+
{
|
|
10961
|
+
"actionType": "setValue",
|
|
10962
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
10963
|
+
"args": {
|
|
10964
|
+
"value":{
|
|
10965
|
+
"quickedit_record_permissions": "${event.data}"
|
|
10966
|
+
}
|
|
10967
|
+
}
|
|
10968
|
+
}
|
|
10969
|
+
]
|
|
10970
|
+
}
|
|
10971
|
+
}
|
|
10972
|
+
|
|
10973
|
+
});
|
|
10843
10974
|
} else {
|
|
10844
10975
|
quickEditSchema = false;
|
|
10845
10976
|
}
|
|
@@ -10872,7 +11003,7 @@ function getFieldWidth(width){
|
|
|
10872
11003
|
|
|
10873
11004
|
async function getTableColumns$1(fields, options){
|
|
10874
11005
|
const columns = [{name: '_index',type: 'text', width: 32, placeholder: ""}];
|
|
10875
|
-
const allowEdit = options.permissions?.allowEdit &&
|
|
11006
|
+
const allowEdit = options.permissions?.allowEdit && !options.isLookup && options.enable_inline_edit != false;
|
|
10876
11007
|
|
|
10877
11008
|
for (const field of fields) {
|
|
10878
11009
|
//增加quickEdit属性,实现快速编辑
|
|
@@ -11363,7 +11494,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
11363
11494
|
baseFilters = filter;
|
|
11364
11495
|
}
|
|
11365
11496
|
___default.each(fields,function(field){
|
|
11366
|
-
if(field.searchable){
|
|
11497
|
+
if(field.searchable && SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1){
|
|
11367
11498
|
searchableFields.push(field.name);
|
|
11368
11499
|
}
|
|
11369
11500
|
});
|
|
@@ -11410,7 +11541,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
11410
11541
|
try{
|
|
11411
11542
|
// TODO: 不应该直接在这里取localStorage,应该从外面传入
|
|
11412
11543
|
const listName = api.data.listName;
|
|
11413
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
11544
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
11414
11545
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
11415
11546
|
if(localListViewProps){
|
|
11416
11547
|
localListViewProps = JSON.parse(localListViewProps);
|
|
@@ -11611,7 +11742,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
11611
11742
|
try{
|
|
11612
11743
|
// TODO: 不应该直接在这里取localStorage,应该从外面传入
|
|
11613
11744
|
const listName = api.body.listName;
|
|
11614
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
11745
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
11615
11746
|
/**
|
|
11616
11747
|
* localListViewProps规范来自crud请求api中api.data.$self参数值的。
|
|
11617
11748
|
* 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
|
|
@@ -12801,7 +12932,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
12801
12932
|
}
|
|
12802
12933
|
}
|
|
12803
12934
|
// console.log(`getObjectHeaderToolbar====2===>`, options.filterVisible)
|
|
12804
|
-
bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, options.formFactor, {
|
|
12935
|
+
bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, fields, options.formFactor, {
|
|
12805
12936
|
showDisplayAs,
|
|
12806
12937
|
hiddenCount: options.queryCount === false,
|
|
12807
12938
|
headerToolbarItems: options.headerToolbarItems,
|
|
@@ -12926,6 +13057,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
12926
13057
|
return {
|
|
12927
13058
|
type: 'service',
|
|
12928
13059
|
className: '',
|
|
13060
|
+
//目前crud的service层id不认用户自定义id,只支持默认规则id
|
|
12929
13061
|
id: `service_${id}`,
|
|
12930
13062
|
name: `page`,
|
|
12931
13063
|
data: {
|
|
@@ -18514,7 +18646,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
18514
18646
|
if (links) {
|
|
18515
18647
|
return [2 /*return*/, {
|
|
18516
18648
|
"type": "nav",
|
|
18517
|
-
className: "".concat(className),
|
|
18649
|
+
className: "".concat(className, " text-black"),
|
|
18518
18650
|
"stacked": stacked,
|
|
18519
18651
|
"overflow": overflow,
|
|
18520
18652
|
"indentSize": indentSize,
|
|
@@ -18526,7 +18658,7 @@ var AmisAppMenu = function (props) { return __awaiter(void 0, void 0, void 0, fu
|
|
|
18526
18658
|
schemaApi: {
|
|
18527
18659
|
"method": "get",
|
|
18528
18660
|
"url": "${context.rootUrl}/service/api/apps/".concat(appId, "/menus"),
|
|
18529
|
-
"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
|
|
18661
|
+
"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 "),
|
|
18530
18662
|
"headers": {
|
|
18531
18663
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
18532
18664
|
}
|
|
@@ -19562,7 +19694,8 @@ var PageListView = function (props) { return __awaiter(void 0, void 0, void 0, f
|
|
|
19562
19694
|
type: 'service',
|
|
19563
19695
|
className: {
|
|
19564
19696
|
"h-full": "true",
|
|
19565
|
-
"sm:px-3 sm:pt-3": "${display != 'split'}"
|
|
19697
|
+
"sm:px-3 sm:pt-3 page-list-grid": "${display != 'split'}",
|
|
19698
|
+
"page-list-split": "${display == 'split'}"
|
|
19566
19699
|
},
|
|
19567
19700
|
body: listSchema
|
|
19568
19701
|
}];
|