@steedos-widgets/amis-lib 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/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +192 -60
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +192 -60
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +192 -60
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/fields/index.d.ts +2 -1
- package/dist/types/lib/converter/amis/fields/lookup.d.ts +1 -0
- package/dist/types/lib/converter/amis/toolbar.d.ts +2 -1
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -1074,6 +1074,7 @@
|
|
|
1074
1074
|
var frontend_objects_related_alert_start$1 = "No related table fields associated with the related list object";
|
|
1075
1075
|
var frontend_objects_related_alert_end$1 = "were found.";
|
|
1076
1076
|
var frontend_no_records_found$1 = "No records found.";
|
|
1077
|
+
var frontend_records_no_allowedit$1 = "You do not have edit permission for this record";
|
|
1077
1078
|
var en_us = {
|
|
1078
1079
|
frontend_field_group_generalization: frontend_field_group_generalization$1,
|
|
1079
1080
|
frontend_download: frontend_download$1,
|
|
@@ -1156,7 +1157,8 @@
|
|
|
1156
1157
|
frontend_message_modification_failed: frontend_message_modification_failed$1,
|
|
1157
1158
|
frontend_objects_related_alert_start: frontend_objects_related_alert_start$1,
|
|
1158
1159
|
frontend_objects_related_alert_end: frontend_objects_related_alert_end$1,
|
|
1159
|
-
frontend_no_records_found: frontend_no_records_found$1
|
|
1160
|
+
frontend_no_records_found: frontend_no_records_found$1,
|
|
1161
|
+
frontend_records_no_allowedit: frontend_records_no_allowedit$1
|
|
1160
1162
|
};
|
|
1161
1163
|
|
|
1162
1164
|
var frontend_field_group_generalization = "通用";
|
|
@@ -1180,7 +1182,7 @@
|
|
|
1180
1182
|
var frontend_display_as = "显示为";
|
|
1181
1183
|
var frontend_record_sum = "个项目";
|
|
1182
1184
|
var frontend_button_reload_tooltip = "刷新";
|
|
1183
|
-
var frontend_button_search_tooltip = "
|
|
1185
|
+
var frontend_button_search_tooltip = "查询";
|
|
1184
1186
|
var frontend_fields_filter_button_search = "搜索";
|
|
1185
1187
|
var frontend_fields_filter_button_settings = "设置搜索项";
|
|
1186
1188
|
var frontend_button_listview_control_tooltip = "列表视图控制";
|
|
@@ -1242,6 +1244,7 @@
|
|
|
1242
1244
|
var frontend_objects_related_alert_start = "未找到与相关列表对象";
|
|
1243
1245
|
var frontend_objects_related_alert_end = "关联的相关表字段";
|
|
1244
1246
|
var frontend_no_records_found = "无法找到记录";
|
|
1247
|
+
var frontend_records_no_allowedit = "您对这条记录没有编辑权限";
|
|
1245
1248
|
var zh_cn = {
|
|
1246
1249
|
frontend_field_group_generalization: frontend_field_group_generalization,
|
|
1247
1250
|
frontend_download: frontend_download,
|
|
@@ -1325,7 +1328,8 @@
|
|
|
1325
1328
|
frontend_message_modification_failed: frontend_message_modification_failed,
|
|
1326
1329
|
frontend_objects_related_alert_start: frontend_objects_related_alert_start,
|
|
1327
1330
|
frontend_objects_related_alert_end: frontend_objects_related_alert_end,
|
|
1328
|
-
frontend_no_records_found: frontend_no_records_found
|
|
1331
|
+
frontend_no_records_found: frontend_no_records_found,
|
|
1332
|
+
frontend_records_no_allowedit: frontend_records_no_allowedit
|
|
1329
1333
|
};
|
|
1330
1334
|
|
|
1331
1335
|
const resources = {
|
|
@@ -3379,12 +3383,14 @@
|
|
|
3379
3383
|
if(!event.data.isLookup){
|
|
3380
3384
|
// 刷新浏览器后,filterFormValues值是空的,只能从本地存储中取出并重置为空值
|
|
3381
3385
|
const listName = event.data.listName;
|
|
3382
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
3386
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
3383
3387
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
3384
3388
|
if(localListViewProps){
|
|
3385
3389
|
localListViewProps = JSON.parse(localListViewProps);
|
|
3386
3390
|
for(var k in localListViewProps){
|
|
3387
|
-
|
|
3391
|
+
if(k !== "__keywords"){
|
|
3392
|
+
removedValues[k] = null;
|
|
3393
|
+
}
|
|
3388
3394
|
}
|
|
3389
3395
|
}
|
|
3390
3396
|
}
|
|
@@ -3406,12 +3412,9 @@
|
|
|
3406
3412
|
const objectName = data.objectName;
|
|
3407
3413
|
const isLookup = data.isLookup;
|
|
3408
3414
|
const listName = data.listName;
|
|
3409
|
-
let searchableFieldsStoreKey = location.pathname + "/searchable_fields
|
|
3415
|
+
let searchableFieldsStoreKey = location.pathname + "/searchable_fields";
|
|
3410
3416
|
if(isLookup){
|
|
3411
|
-
searchableFieldsStoreKey += "lookup/" + objectName;
|
|
3412
|
-
}
|
|
3413
|
-
else{
|
|
3414
|
-
searchableFieldsStoreKey += (listName || "");
|
|
3417
|
+
searchableFieldsStoreKey += "/lookup/" + objectName;
|
|
3415
3418
|
}
|
|
3416
3419
|
let defaultSearchableFields = sessionStorage.getItem(searchableFieldsStoreKey);
|
|
3417
3420
|
if(defaultSearchableFields){
|
|
@@ -3438,7 +3441,7 @@
|
|
|
3438
3441
|
setData({ showFieldsFilter: false });
|
|
3439
3442
|
}
|
|
3440
3443
|
else{
|
|
3441
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
3444
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
3442
3445
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
3443
3446
|
if(localListViewProps){
|
|
3444
3447
|
localListViewProps = JSON.parse(localListViewProps);
|
|
@@ -3478,12 +3481,9 @@
|
|
|
3478
3481
|
return n.props.type === "service";
|
|
3479
3482
|
});
|
|
3480
3483
|
filterService.setData({ filterFormSearchableFields: value });
|
|
3481
|
-
let searchableFieldsStoreKey = location.pathname + "/searchable_fields
|
|
3484
|
+
let searchableFieldsStoreKey = location.pathname + "/searchable_fields";
|
|
3482
3485
|
if(isLookup){
|
|
3483
|
-
searchableFieldsStoreKey += "lookup/" + objectName;
|
|
3484
|
-
}
|
|
3485
|
-
else{
|
|
3486
|
-
searchableFieldsStoreKey += (listName || "");
|
|
3486
|
+
searchableFieldsStoreKey += "/lookup/" + objectName;
|
|
3487
3487
|
}
|
|
3488
3488
|
sessionStorage.setItem(searchableFieldsStoreKey, value);
|
|
3489
3489
|
|
|
@@ -3541,7 +3541,7 @@
|
|
|
3541
3541
|
}
|
|
3542
3542
|
|
|
3543
3543
|
// 列表视图crud支持本地缓存,所以需要进一步清除浏览器本地缓存里面用户在可搜索项中移除的字段值
|
|
3544
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
3544
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
3545
3545
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
3546
3546
|
if(localListViewProps){
|
|
3547
3547
|
localListViewProps = JSON.parse(localListViewProps);
|
|
@@ -5262,9 +5262,23 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5262
5262
|
`;
|
|
5263
5263
|
|
|
5264
5264
|
|
|
5265
|
-
function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true} = {}){
|
|
5265
|
+
function getObjectHeaderToolbar(mainObject, fields, formFactor, { showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true, isLookup = false } = {}){
|
|
5266
5266
|
// console.log(`getObjectHeaderToolbar====>`, filterVisible)
|
|
5267
|
-
console.log(`getObjectHeaderToolbar`, mainObject)
|
|
5267
|
+
// console.log(`getObjectHeaderToolbar`, mainObject)
|
|
5268
|
+
const searchableFieldsLabel = [];
|
|
5269
|
+
_.each(fields, function (field) {
|
|
5270
|
+
if (field.searchable && SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1) {
|
|
5271
|
+
searchableFieldsLabel.push(field.label);
|
|
5272
|
+
}
|
|
5273
|
+
});
|
|
5274
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
5275
|
+
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
5276
|
+
let crudKeywords = "";
|
|
5277
|
+
if(localListViewProps && !isLookup){
|
|
5278
|
+
localListViewProps = JSON.parse(localListViewProps);
|
|
5279
|
+
crudKeywords = (localListViewProps && localListViewProps.__keywords) || "";
|
|
5280
|
+
}
|
|
5281
|
+
|
|
5268
5282
|
const isMobile = window.innerWidth < 768;
|
|
5269
5283
|
if(isMobile){
|
|
5270
5284
|
showDisplayAs = false;
|
|
@@ -5320,7 +5334,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5320
5334
|
],
|
|
5321
5335
|
"size":8,
|
|
5322
5336
|
"animation": true,
|
|
5323
|
-
"visibleOn": "${isFieldsFilterEmpty == false}"
|
|
5337
|
+
"visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
|
|
5324
5338
|
},
|
|
5325
5339
|
"align": "right",
|
|
5326
5340
|
"className": "bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
@@ -5335,7 +5349,27 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5335
5349
|
}
|
|
5336
5350
|
}
|
|
5337
5351
|
} : {},
|
|
5338
|
-
getDisplayAsButton(mainObject?.name)
|
|
5352
|
+
getDisplayAsButton(mainObject?.name),
|
|
5353
|
+
{
|
|
5354
|
+
"type": "tooltip-wrapper",
|
|
5355
|
+
"align": "right",
|
|
5356
|
+
"title": "",
|
|
5357
|
+
"content": "可搜索字段:" + searchableFieldsLabel.join(","),
|
|
5358
|
+
"placement": "bottom",
|
|
5359
|
+
"tooltipTheme": "dark",
|
|
5360
|
+
"trigger": "click",
|
|
5361
|
+
// "className": "mr-1",
|
|
5362
|
+
"body": [
|
|
5363
|
+
{
|
|
5364
|
+
"type": "search-box",
|
|
5365
|
+
"name": "__keywords",
|
|
5366
|
+
"placeholder": "请输入关键字",
|
|
5367
|
+
"value": crudKeywords,
|
|
5368
|
+
"clearable": true,
|
|
5369
|
+
"clearAndSubmit": true
|
|
5370
|
+
}
|
|
5371
|
+
]
|
|
5372
|
+
},
|
|
5339
5373
|
]
|
|
5340
5374
|
}else {
|
|
5341
5375
|
return [
|
|
@@ -5354,21 +5388,9 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5354
5388
|
"type": "tpl",
|
|
5355
5389
|
"tpl": "${count} " + i18next__default["default"].t('frontend_record_sum')
|
|
5356
5390
|
},
|
|
5357
|
-
{
|
|
5358
|
-
"type": "reload",
|
|
5359
|
-
"align": "right",
|
|
5360
|
-
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
5361
|
-
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
5362
|
-
"tooltip":"",
|
|
5363
|
-
"tooltipPlacement": "top",
|
|
5364
|
-
"className": "bg-white p-2 rounded border-gray-300 text-gray-500"
|
|
5365
|
-
},
|
|
5366
|
-
// getExportExcelToolbarButtonSchema(),
|
|
5367
|
-
mainObject?.permissions?.allowCreateListViews ? getSettingListviewToolbarButtonSchema() : {},
|
|
5368
|
-
getDisplayAsButton(mainObject?.name),
|
|
5369
5391
|
filterVisible ? {
|
|
5370
5392
|
"label": i18next__default["default"].t('frontend_button_search_tooltip'),
|
|
5371
|
-
"icon": "fa fa-
|
|
5393
|
+
"icon": "fa fa-filter",
|
|
5372
5394
|
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
5373
5395
|
// "tooltip": i18next.t('frontend_button_search_tooltip'),
|
|
5374
5396
|
// "tooltipPlacement": "top",
|
|
@@ -5380,7 +5402,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5380
5402
|
],
|
|
5381
5403
|
"size":8,
|
|
5382
5404
|
"animation": true,
|
|
5383
|
-
"visibleOn": "${isFieldsFilterEmpty == false}"
|
|
5405
|
+
"visibleOn": "${isFieldsFilterEmpty == false && isLookup != true}"
|
|
5384
5406
|
},
|
|
5385
5407
|
"align": "right",
|
|
5386
5408
|
"className": "bg-white p-2 rounded border-gray-300 text-gray-500",
|
|
@@ -5394,14 +5416,39 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5394
5416
|
]
|
|
5395
5417
|
}
|
|
5396
5418
|
}
|
|
5397
|
-
} : {}
|
|
5398
|
-
|
|
5399
|
-
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5419
|
+
} : {},
|
|
5420
|
+
{
|
|
5421
|
+
"type": "reload",
|
|
5422
|
+
"align": "right",
|
|
5423
|
+
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
5424
|
+
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
5425
|
+
"tooltip":"",
|
|
5426
|
+
"tooltipPlacement": "top",
|
|
5427
|
+
"className": "bg-white p-2 rounded border-gray-300 text-gray-500"
|
|
5428
|
+
},
|
|
5429
|
+
// getExportExcelToolbarButtonSchema(),
|
|
5430
|
+
mainObject?.permissions?.allowCreateListViews ? getSettingListviewToolbarButtonSchema() : {},
|
|
5431
|
+
getDisplayAsButton(mainObject?.name),
|
|
5432
|
+
{
|
|
5433
|
+
"type": "tooltip-wrapper",
|
|
5434
|
+
"align": "right",
|
|
5435
|
+
"title": "",
|
|
5436
|
+
"content": "可搜索字段:" + searchableFieldsLabel.join(","),
|
|
5437
|
+
"placement": "bottom",
|
|
5438
|
+
"tooltipTheme": "dark",
|
|
5439
|
+
"trigger": "click",
|
|
5440
|
+
"className": "mr-1",
|
|
5441
|
+
"body": [
|
|
5442
|
+
{
|
|
5443
|
+
"type": "search-box",
|
|
5444
|
+
"name": "__keywords",
|
|
5445
|
+
"placeholder": "请输入关键字",
|
|
5446
|
+
"value": crudKeywords,
|
|
5447
|
+
"clearable": true,
|
|
5448
|
+
"clearAndSubmit": true
|
|
5449
|
+
}
|
|
5450
|
+
]
|
|
5451
|
+
},
|
|
5405
5452
|
// {
|
|
5406
5453
|
// "type": "drag-toggler",
|
|
5407
5454
|
// "align": "right"
|
|
@@ -5745,16 +5792,17 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5745
5792
|
"autoCheckChildren": false,
|
|
5746
5793
|
"searchable": true,
|
|
5747
5794
|
"searchConfig": {
|
|
5748
|
-
"sticky": true
|
|
5795
|
+
"sticky": true,
|
|
5796
|
+
"placeholder": "查找部门"
|
|
5749
5797
|
},
|
|
5750
5798
|
"unfoldedLevel": 2,
|
|
5751
5799
|
"style": {
|
|
5752
5800
|
"max-height": "100%",
|
|
5753
5801
|
"position": "absolute",
|
|
5754
|
-
"left": "-
|
|
5755
|
-
"width": "
|
|
5802
|
+
"left": "-330px",
|
|
5803
|
+
"width": "320px",
|
|
5756
5804
|
"bottom": 0,
|
|
5757
|
-
"top": "
|
|
5805
|
+
"top": "0",
|
|
5758
5806
|
"overflow": "auto",
|
|
5759
5807
|
"min-height":"300px"
|
|
5760
5808
|
},
|
|
@@ -5773,7 +5821,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5773
5821
|
ctx.idFieldName = refObjectConfig.idFieldName;
|
|
5774
5822
|
ctx.objectName = refObjectConfig.name;
|
|
5775
5823
|
|
|
5776
|
-
|
|
5824
|
+
let tableFields = [];
|
|
5777
5825
|
let i = 0;
|
|
5778
5826
|
const searchableFields = [];
|
|
5779
5827
|
|
|
@@ -5818,7 +5866,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5818
5866
|
})){
|
|
5819
5867
|
i++;
|
|
5820
5868
|
tableFields.push(field);
|
|
5821
|
-
if(field.searchable){
|
|
5869
|
+
if(field.searchable && SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1){
|
|
5822
5870
|
searchableFields.push(field.name);
|
|
5823
5871
|
}
|
|
5824
5872
|
}
|
|
@@ -5902,16 +5950,31 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5902
5950
|
}
|
|
5903
5951
|
}
|
|
5904
5952
|
|
|
5905
|
-
|
|
5906
5953
|
if(allowSearchFields){
|
|
5907
5954
|
allowSearchFields.forEach(function(key){
|
|
5908
5955
|
const keyValue = selfData[key];
|
|
5909
|
-
if(keyValue){
|
|
5956
|
+
if(_.isString(keyValue)){
|
|
5910
5957
|
filters.push([key, "contains", keyValue]);
|
|
5958
|
+
}else if(_.isArray(keyValue) || _.isBoolean(keyValue) || keyValue){
|
|
5959
|
+
filters.push([key, "=", keyValue]);
|
|
5911
5960
|
}
|
|
5912
5961
|
})
|
|
5913
5962
|
}
|
|
5914
5963
|
|
|
5964
|
+
if(selfData.__keywords && allowSearchFields){
|
|
5965
|
+
const keywordsFilters = [];
|
|
5966
|
+
allowSearchFields.forEach(function(key, index){
|
|
5967
|
+
const keyValue = selfData.__keywords;
|
|
5968
|
+
if(keyValue){
|
|
5969
|
+
keywordsFilters.push([key, "contains", keyValue]);
|
|
5970
|
+
if(index < allowSearchFields.length - 1){
|
|
5971
|
+
keywordsFilters.push('or');
|
|
5972
|
+
}
|
|
5973
|
+
}
|
|
5974
|
+
})
|
|
5975
|
+
filters.push(keywordsFilters);
|
|
5976
|
+
};
|
|
5977
|
+
|
|
5915
5978
|
var fieldFilters = ${JSON.stringify(field.filters)};
|
|
5916
5979
|
if(fieldFilters && fieldFilters.length){
|
|
5917
5980
|
filters.push(fieldFilters);
|
|
@@ -6000,6 +6063,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
6000
6063
|
if(refObjectConfig.paging && refObjectConfig.paging.enabled === false){
|
|
6001
6064
|
top = 1000;
|
|
6002
6065
|
}
|
|
6066
|
+
|
|
6003
6067
|
let pickerSchema = null;
|
|
6004
6068
|
if(ctx.formFactor === 'SMALL'){
|
|
6005
6069
|
pickerSchema = await getListSchema$1(tableFields, {
|
|
@@ -6021,18 +6085,19 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
6021
6085
|
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user" && !isMobile){
|
|
6022
6086
|
headerToolbarItems = getLookupSapceUserTreeSchema();
|
|
6023
6087
|
pickerSchema["style"] = {
|
|
6024
|
-
"margin-left":"
|
|
6088
|
+
"margin-left":"330px",
|
|
6025
6089
|
"min-height": "300px"
|
|
6026
6090
|
};
|
|
6027
6091
|
pickerSchema.className = pickerSchema.className || "" + " steedos-select-user";
|
|
6028
6092
|
}
|
|
6029
6093
|
|
|
6030
|
-
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, ctx.formFactor, { headerToolbarItems });
|
|
6094
|
+
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { headerToolbarItems, isLookup: true });
|
|
6031
6095
|
const isAllowCreate = refObjectConfig.permissions.allowCreate;
|
|
6032
6096
|
if (isAllowCreate) {
|
|
6033
6097
|
const new_button = await getSchema$5(refObjectConfig, { appId: ctx.appId, objectName: refObjectConfig.name, formFactor: ctx.formFactor });
|
|
6034
6098
|
new_button.align = "right";
|
|
6035
|
-
|
|
6099
|
+
// 保持快速搜索放在最左侧,新建按钮往里插,而不是push到最后
|
|
6100
|
+
pickerSchema.headerToolbar.splice(pickerSchema.headerToolbar.length - 1, 0, new_button);
|
|
6036
6101
|
}
|
|
6037
6102
|
pickerSchema.footerToolbar = refObjectConfig.enable_tree ? [] : getObjectFooterToolbar();
|
|
6038
6103
|
if (ctx.filterVisible !== false) {
|
|
@@ -6749,6 +6814,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
6749
6814
|
return readonly ? getAmisFileReadonlySchema(steedosField) : getAmisFileEditSchema(steedosField);
|
|
6750
6815
|
};
|
|
6751
6816
|
|
|
6817
|
+
const SEARCHABLE_FIELD_TYPES = ["text", "textarea", "autonumber", "url", "email"];
|
|
6752
6818
|
const OMIT_FIELDS = ['created', 'created_by', 'modified', 'modified_by'];
|
|
6753
6819
|
// const Lookup = require('./lookup');
|
|
6754
6820
|
|
|
@@ -7523,6 +7589,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
7523
7589
|
|
|
7524
7590
|
var index = /*#__PURE__*/Object.freeze({
|
|
7525
7591
|
__proto__: null,
|
|
7592
|
+
SEARCHABLE_FIELD_TYPES: SEARCHABLE_FIELD_TYPES,
|
|
7526
7593
|
OMIT_FIELDS: OMIT_FIELDS,
|
|
7527
7594
|
getBaseFields: getBaseFields,
|
|
7528
7595
|
getAmisFieldType: getAmisFieldType,
|
|
@@ -7722,7 +7789,71 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
7722
7789
|
`;
|
|
7723
7790
|
break;
|
|
7724
7791
|
}
|
|
7725
|
-
|
|
7792
|
+
quickEditSchema.body[0].visibleOn = "${quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}";
|
|
7793
|
+
quickEditSchema.body.push({
|
|
7794
|
+
"type":"service",
|
|
7795
|
+
"body":[
|
|
7796
|
+
{
|
|
7797
|
+
"type": "tpl",
|
|
7798
|
+
"tpl": i18next__default["default"].t('frontend_records_no_allowedit'),
|
|
7799
|
+
"visibleOn": "${!quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}"
|
|
7800
|
+
},
|
|
7801
|
+
{
|
|
7802
|
+
"type": "spinner",
|
|
7803
|
+
"showOn": "${quickedit_record_permissions_loading}"
|
|
7804
|
+
}
|
|
7805
|
+
],
|
|
7806
|
+
"onEvent":{
|
|
7807
|
+
"init":{
|
|
7808
|
+
"actions":[
|
|
7809
|
+
{
|
|
7810
|
+
"actionType": "setValue",
|
|
7811
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
7812
|
+
"args": {
|
|
7813
|
+
"value":{
|
|
7814
|
+
"quickedit_record_permissions_loading": true
|
|
7815
|
+
}
|
|
7816
|
+
}
|
|
7817
|
+
},
|
|
7818
|
+
{
|
|
7819
|
+
"actionType": "ajax",
|
|
7820
|
+
"args": {
|
|
7821
|
+
"api": {
|
|
7822
|
+
"url": "${context.rootUrl}/service/api/@\${objectName}/recordPermissions/${_id}",
|
|
7823
|
+
"method": "get",
|
|
7824
|
+
"headers": {
|
|
7825
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
7826
|
+
},
|
|
7827
|
+
"cache": 30000,
|
|
7828
|
+
"messages": {
|
|
7829
|
+
"failed": "失败了呢。。"
|
|
7830
|
+
}
|
|
7831
|
+
}
|
|
7832
|
+
}
|
|
7833
|
+
},
|
|
7834
|
+
{
|
|
7835
|
+
"actionType": "setValue",
|
|
7836
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
7837
|
+
"args": {
|
|
7838
|
+
"value":{
|
|
7839
|
+
"quickedit_record_permissions_loading": false
|
|
7840
|
+
}
|
|
7841
|
+
}
|
|
7842
|
+
},
|
|
7843
|
+
{
|
|
7844
|
+
"actionType": "setValue",
|
|
7845
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
7846
|
+
"args": {
|
|
7847
|
+
"value":{
|
|
7848
|
+
"quickedit_record_permissions": "${event.data}"
|
|
7849
|
+
}
|
|
7850
|
+
}
|
|
7851
|
+
}
|
|
7852
|
+
]
|
|
7853
|
+
}
|
|
7854
|
+
}
|
|
7855
|
+
|
|
7856
|
+
});
|
|
7726
7857
|
} else {
|
|
7727
7858
|
quickEditSchema = false;
|
|
7728
7859
|
}
|
|
@@ -7755,7 +7886,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
7755
7886
|
|
|
7756
7887
|
async function getTableColumns(fields, options){
|
|
7757
7888
|
const columns = [{name: '_index',type: 'text', width: 32, placeholder: ""}];
|
|
7758
|
-
const allowEdit = options.permissions?.allowEdit &&
|
|
7889
|
+
const allowEdit = options.permissions?.allowEdit && !options.isLookup && options.enable_inline_edit != false;
|
|
7759
7890
|
|
|
7760
7891
|
for (const field of fields) {
|
|
7761
7892
|
//增加quickEdit属性,实现快速编辑
|
|
@@ -8246,7 +8377,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8246
8377
|
baseFilters = filter;
|
|
8247
8378
|
}
|
|
8248
8379
|
___namespace.each(fields,function(field){
|
|
8249
|
-
if(field.searchable){
|
|
8380
|
+
if(field.searchable && SEARCHABLE_FIELD_TYPES.indexOf(field.type) > -1){
|
|
8250
8381
|
searchableFields.push(field.name);
|
|
8251
8382
|
}
|
|
8252
8383
|
});
|
|
@@ -8293,7 +8424,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8293
8424
|
try{
|
|
8294
8425
|
// TODO: 不应该直接在这里取localStorage,应该从外面传入
|
|
8295
8426
|
const listName = api.data.listName;
|
|
8296
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
8427
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
8297
8428
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
8298
8429
|
if(localListViewProps){
|
|
8299
8430
|
localListViewProps = JSON.parse(localListViewProps);
|
|
@@ -8494,7 +8625,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
8494
8625
|
try{
|
|
8495
8626
|
// TODO: 不应该直接在这里取localStorage,应该从外面传入
|
|
8496
8627
|
const listName = api.body.listName;
|
|
8497
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
8628
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
8498
8629
|
/**
|
|
8499
8630
|
* localListViewProps规范来自crud请求api中api.data.$self参数值的。
|
|
8500
8631
|
* 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
|
|
@@ -9684,7 +9815,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
9684
9815
|
}
|
|
9685
9816
|
}
|
|
9686
9817
|
// console.log(`getObjectHeaderToolbar====2===>`, options.filterVisible)
|
|
9687
|
-
bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, options.formFactor, {
|
|
9818
|
+
bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, fields, options.formFactor, {
|
|
9688
9819
|
showDisplayAs,
|
|
9689
9820
|
hiddenCount: options.queryCount === false,
|
|
9690
9821
|
headerToolbarItems: options.headerToolbarItems,
|
|
@@ -9809,6 +9940,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
9809
9940
|
return {
|
|
9810
9941
|
type: 'service',
|
|
9811
9942
|
className: '',
|
|
9943
|
+
//目前crud的service层id不认用户自定义id,只支持默认规则id
|
|
9812
9944
|
id: `service_${id}`,
|
|
9813
9945
|
name: `page`,
|
|
9814
9946
|
data: {
|