@steedos-widgets/amis-lib 1.2.37 → 1.2.39-beta.1
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 +180 -60
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +180 -60
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +180 -60
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/fields/lookup.d.ts +1 -0
- package/dist/types/lib/converter/amis/toolbar.d.ts +2 -2
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1050,6 +1050,7 @@ var frontend_message_modification_failed$1 = "Modification failed!";
|
|
|
1050
1050
|
var frontend_objects_related_alert_start$1 = "No related table fields associated with the related list object";
|
|
1051
1051
|
var frontend_objects_related_alert_end$1 = "were found.";
|
|
1052
1052
|
var frontend_no_records_found$1 = "No records found.";
|
|
1053
|
+
var frontend_records_no_allowedit$1 = "You do not have edit permission for this record";
|
|
1053
1054
|
var en_us = {
|
|
1054
1055
|
frontend_field_group_generalization: frontend_field_group_generalization$1,
|
|
1055
1056
|
frontend_download: frontend_download$1,
|
|
@@ -1132,7 +1133,8 @@ var en_us = {
|
|
|
1132
1133
|
frontend_message_modification_failed: frontend_message_modification_failed$1,
|
|
1133
1134
|
frontend_objects_related_alert_start: frontend_objects_related_alert_start$1,
|
|
1134
1135
|
frontend_objects_related_alert_end: frontend_objects_related_alert_end$1,
|
|
1135
|
-
frontend_no_records_found: frontend_no_records_found$1
|
|
1136
|
+
frontend_no_records_found: frontend_no_records_found$1,
|
|
1137
|
+
frontend_records_no_allowedit: frontend_records_no_allowedit$1
|
|
1136
1138
|
};
|
|
1137
1139
|
|
|
1138
1140
|
var frontend_field_group_generalization = "通用";
|
|
@@ -1156,7 +1158,7 @@ var frontend_display_type_is_split = "分栏视图";
|
|
|
1156
1158
|
var frontend_display_as = "显示为";
|
|
1157
1159
|
var frontend_record_sum = "个项目";
|
|
1158
1160
|
var frontend_button_reload_tooltip = "刷新";
|
|
1159
|
-
var frontend_button_search_tooltip = "
|
|
1161
|
+
var frontend_button_search_tooltip = "查询";
|
|
1160
1162
|
var frontend_fields_filter_button_search = "搜索";
|
|
1161
1163
|
var frontend_fields_filter_button_settings = "设置搜索项";
|
|
1162
1164
|
var frontend_button_listview_control_tooltip = "列表视图控制";
|
|
@@ -1218,6 +1220,7 @@ var frontend_message_modification_failed = "修改失败!";
|
|
|
1218
1220
|
var frontend_objects_related_alert_start = "未找到与相关列表对象";
|
|
1219
1221
|
var frontend_objects_related_alert_end = "关联的相关表字段";
|
|
1220
1222
|
var frontend_no_records_found = "无法找到记录";
|
|
1223
|
+
var frontend_records_no_allowedit = "您对这条记录没有编辑权限";
|
|
1221
1224
|
var zh_cn = {
|
|
1222
1225
|
frontend_field_group_generalization: frontend_field_group_generalization,
|
|
1223
1226
|
frontend_download: frontend_download,
|
|
@@ -1301,7 +1304,8 @@ var zh_cn = {
|
|
|
1301
1304
|
frontend_message_modification_failed: frontend_message_modification_failed,
|
|
1302
1305
|
frontend_objects_related_alert_start: frontend_objects_related_alert_start,
|
|
1303
1306
|
frontend_objects_related_alert_end: frontend_objects_related_alert_end,
|
|
1304
|
-
frontend_no_records_found: frontend_no_records_found
|
|
1307
|
+
frontend_no_records_found: frontend_no_records_found,
|
|
1308
|
+
frontend_records_no_allowedit: frontend_records_no_allowedit
|
|
1305
1309
|
};
|
|
1306
1310
|
|
|
1307
1311
|
const resources = {
|
|
@@ -3355,12 +3359,14 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
3355
3359
|
if(!event.data.isLookup){
|
|
3356
3360
|
// 刷新浏览器后,filterFormValues值是空的,只能从本地存储中取出并重置为空值
|
|
3357
3361
|
const listName = event.data.listName;
|
|
3358
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
3362
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
3359
3363
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
3360
3364
|
if(localListViewProps){
|
|
3361
3365
|
localListViewProps = JSON.parse(localListViewProps);
|
|
3362
3366
|
for(var k in localListViewProps){
|
|
3363
|
-
|
|
3367
|
+
if(k !== "__keywords"){
|
|
3368
|
+
removedValues[k] = null;
|
|
3369
|
+
}
|
|
3364
3370
|
}
|
|
3365
3371
|
}
|
|
3366
3372
|
}
|
|
@@ -3382,12 +3388,9 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
3382
3388
|
const objectName = data.objectName;
|
|
3383
3389
|
const isLookup = data.isLookup;
|
|
3384
3390
|
const listName = data.listName;
|
|
3385
|
-
let searchableFieldsStoreKey = location.pathname + "/searchable_fields
|
|
3391
|
+
let searchableFieldsStoreKey = location.pathname + "/searchable_fields";
|
|
3386
3392
|
if(isLookup){
|
|
3387
|
-
searchableFieldsStoreKey += "lookup/" + objectName;
|
|
3388
|
-
}
|
|
3389
|
-
else{
|
|
3390
|
-
searchableFieldsStoreKey += (listName || "");
|
|
3393
|
+
searchableFieldsStoreKey += "/lookup/" + objectName;
|
|
3391
3394
|
}
|
|
3392
3395
|
let defaultSearchableFields = sessionStorage.getItem(searchableFieldsStoreKey);
|
|
3393
3396
|
if(defaultSearchableFields){
|
|
@@ -3414,7 +3417,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
3414
3417
|
setData({ showFieldsFilter: false });
|
|
3415
3418
|
}
|
|
3416
3419
|
else{
|
|
3417
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
3420
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
3418
3421
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
3419
3422
|
if(localListViewProps){
|
|
3420
3423
|
localListViewProps = JSON.parse(localListViewProps);
|
|
@@ -3454,12 +3457,9 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
3454
3457
|
return n.props.type === "service";
|
|
3455
3458
|
});
|
|
3456
3459
|
filterService.setData({ filterFormSearchableFields: value });
|
|
3457
|
-
let searchableFieldsStoreKey = location.pathname + "/searchable_fields
|
|
3460
|
+
let searchableFieldsStoreKey = location.pathname + "/searchable_fields";
|
|
3458
3461
|
if(isLookup){
|
|
3459
|
-
searchableFieldsStoreKey += "lookup/" + objectName;
|
|
3460
|
-
}
|
|
3461
|
-
else{
|
|
3462
|
-
searchableFieldsStoreKey += (listName || "");
|
|
3462
|
+
searchableFieldsStoreKey += "/lookup/" + objectName;
|
|
3463
3463
|
}
|
|
3464
3464
|
sessionStorage.setItem(searchableFieldsStoreKey, value);
|
|
3465
3465
|
|
|
@@ -3517,7 +3517,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
3517
3517
|
}
|
|
3518
3518
|
|
|
3519
3519
|
// 列表视图crud支持本地缓存,所以需要进一步清除浏览器本地缓存里面用户在可搜索项中移除的字段值
|
|
3520
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
3520
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
3521
3521
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
3522
3522
|
if(localListViewProps){
|
|
3523
3523
|
localListViewProps = JSON.parse(localListViewProps);
|
|
@@ -5238,9 +5238,23 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5238
5238
|
`;
|
|
5239
5239
|
|
|
5240
5240
|
|
|
5241
|
-
function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true} = {}){
|
|
5241
|
+
function getObjectHeaderToolbar(mainObject, fields, formFactor, {showDisplayAs = false, hiddenCount = false, headerToolbarItems, filterVisible = true} = {}){
|
|
5242
5242
|
// console.log(`getObjectHeaderToolbar====>`, filterVisible)
|
|
5243
|
-
console.log(`getObjectHeaderToolbar`, mainObject)
|
|
5243
|
+
// console.log(`getObjectHeaderToolbar`, mainObject)
|
|
5244
|
+
const searchableFieldsLabel = [];
|
|
5245
|
+
_.each(fields, function (field) {
|
|
5246
|
+
if (field.searchable) {
|
|
5247
|
+
searchableFieldsLabel.push(field.label);
|
|
5248
|
+
}
|
|
5249
|
+
});
|
|
5250
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
5251
|
+
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
5252
|
+
let crudKeywords = "";
|
|
5253
|
+
if(localListViewProps){
|
|
5254
|
+
localListViewProps = JSON.parse(localListViewProps);
|
|
5255
|
+
crudKeywords = (localListViewProps && localListViewProps.__keywords) || "";
|
|
5256
|
+
}
|
|
5257
|
+
|
|
5244
5258
|
const isMobile = window.innerWidth < 768;
|
|
5245
5259
|
if(isMobile){
|
|
5246
5260
|
showDisplayAs = false;
|
|
@@ -5330,21 +5344,9 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
5330
5344
|
"type": "tpl",
|
|
5331
5345
|
"tpl": "${count} " + i18next.t('frontend_record_sum')
|
|
5332
5346
|
},
|
|
5333
|
-
{
|
|
5334
|
-
"type": "reload",
|
|
5335
|
-
"align": "right",
|
|
5336
|
-
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
5337
|
-
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
5338
|
-
"tooltip":"",
|
|
5339
|
-
"tooltipPlacement": "top",
|
|
5340
|
-
"className": "bg-white p-2 rounded border-gray-300 text-gray-500"
|
|
5341
|
-
},
|
|
5342
|
-
// getExportExcelToolbarButtonSchema(),
|
|
5343
|
-
mainObject?.permissions?.allowCreateListViews ? getSettingListviewToolbarButtonSchema() : {},
|
|
5344
|
-
getDisplayAsButton(mainObject?.name),
|
|
5345
5347
|
filterVisible ? {
|
|
5346
5348
|
"label": i18next.t('frontend_button_search_tooltip'),
|
|
5347
|
-
"icon": "fa fa-
|
|
5349
|
+
"icon": "fa fa-filter",
|
|
5348
5350
|
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
5349
5351
|
// "tooltip": i18next.t('frontend_button_search_tooltip'),
|
|
5350
5352
|
// "tooltipPlacement": "top",
|
|
@@ -5370,14 +5372,39 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
5370
5372
|
]
|
|
5371
5373
|
}
|
|
5372
5374
|
}
|
|
5373
|
-
} : {}
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5375
|
+
} : {},
|
|
5376
|
+
{
|
|
5377
|
+
"type": "reload",
|
|
5378
|
+
"align": "right",
|
|
5379
|
+
//TODO: dropdown-button只支持在按钮上方配置提示,对于上方按钮的点击会有影响,为保持统一,暂时去除,等待amis优化,https://github.com/baidu/amis/issues/7330
|
|
5380
|
+
// "tooltip": i18next.t('frontend_button_reload_tooltip'),
|
|
5381
|
+
"tooltip":"",
|
|
5382
|
+
"tooltipPlacement": "top",
|
|
5383
|
+
"className": "bg-white p-2 rounded border-gray-300 text-gray-500"
|
|
5384
|
+
},
|
|
5385
|
+
// getExportExcelToolbarButtonSchema(),
|
|
5386
|
+
mainObject?.permissions?.allowCreateListViews ? getSettingListviewToolbarButtonSchema() : {},
|
|
5387
|
+
getDisplayAsButton(mainObject?.name),
|
|
5388
|
+
{
|
|
5389
|
+
"type": "tooltip-wrapper",
|
|
5390
|
+
"align": "right",
|
|
5391
|
+
"title": "",
|
|
5392
|
+
"content": "可模糊搜索字段:" + searchableFieldsLabel.join(","),
|
|
5393
|
+
"placement": "bottom",
|
|
5394
|
+
"tooltipTheme": "dark",
|
|
5395
|
+
"trigger": "click",
|
|
5396
|
+
"className": "mr-1",
|
|
5397
|
+
"body": [
|
|
5398
|
+
{
|
|
5399
|
+
"type": "search-box",
|
|
5400
|
+
"name": "__keywords",
|
|
5401
|
+
"placeholder": "请输入关键字",
|
|
5402
|
+
"value": crudKeywords,
|
|
5403
|
+
"clearable": true,
|
|
5404
|
+
"clearAndSubmit": true
|
|
5405
|
+
}
|
|
5406
|
+
]
|
|
5407
|
+
},
|
|
5381
5408
|
// {
|
|
5382
5409
|
// "type": "drag-toggler",
|
|
5383
5410
|
// "align": "right"
|
|
@@ -5393,18 +5420,27 @@ function getObjectHeaderToolbar(mainObject, formFactor, {showDisplayAs = false,
|
|
|
5393
5420
|
|
|
5394
5421
|
}
|
|
5395
5422
|
|
|
5396
|
-
function getObjectFooterToolbar(mainObject, formFactor) {
|
|
5423
|
+
function getObjectFooterToolbar(mainObject, formFactor, options) {
|
|
5397
5424
|
if (formFactor === 'SMALL') {
|
|
5398
5425
|
return [
|
|
5399
5426
|
"load-more",
|
|
5400
5427
|
]
|
|
5401
5428
|
}
|
|
5402
5429
|
else {
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5430
|
+
if(options && options.isRelated){
|
|
5431
|
+
return [
|
|
5432
|
+
"statistics",
|
|
5433
|
+
"pagination"
|
|
5434
|
+
]
|
|
5435
|
+
|
|
5436
|
+
}
|
|
5437
|
+
else {
|
|
5438
|
+
return [
|
|
5439
|
+
"switch-per-page",
|
|
5440
|
+
"statistics",
|
|
5441
|
+
"pagination"
|
|
5442
|
+
]
|
|
5443
|
+
}
|
|
5408
5444
|
}
|
|
5409
5445
|
}
|
|
5410
5446
|
|
|
@@ -5712,16 +5748,17 @@ function getLookupSapceUserTreeSchema(){
|
|
|
5712
5748
|
"autoCheckChildren": false,
|
|
5713
5749
|
"searchable": true,
|
|
5714
5750
|
"searchConfig": {
|
|
5715
|
-
"sticky": true
|
|
5751
|
+
"sticky": true,
|
|
5752
|
+
"placeholder": "查找部门"
|
|
5716
5753
|
},
|
|
5717
5754
|
"unfoldedLevel": 2,
|
|
5718
5755
|
"style": {
|
|
5719
5756
|
"max-height": "100%",
|
|
5720
5757
|
"position": "absolute",
|
|
5721
|
-
"left": "-
|
|
5722
|
-
"width": "
|
|
5758
|
+
"left": "-220px",
|
|
5759
|
+
"width": "210px",
|
|
5723
5760
|
"bottom": 0,
|
|
5724
|
-
"top": "
|
|
5761
|
+
"top": "0",
|
|
5725
5762
|
"overflow": "auto",
|
|
5726
5763
|
"min-height":"300px"
|
|
5727
5764
|
},
|
|
@@ -5740,7 +5777,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
5740
5777
|
ctx.idFieldName = refObjectConfig.idFieldName;
|
|
5741
5778
|
ctx.objectName = refObjectConfig.name;
|
|
5742
5779
|
|
|
5743
|
-
|
|
5780
|
+
let tableFields = [];
|
|
5744
5781
|
let i = 0;
|
|
5745
5782
|
const searchableFields = [];
|
|
5746
5783
|
|
|
@@ -5869,16 +5906,31 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
5869
5906
|
}
|
|
5870
5907
|
}
|
|
5871
5908
|
|
|
5872
|
-
|
|
5873
5909
|
if(allowSearchFields){
|
|
5874
5910
|
allowSearchFields.forEach(function(key){
|
|
5875
5911
|
const keyValue = selfData[key];
|
|
5876
|
-
if(keyValue){
|
|
5912
|
+
if(_.isString(keyValue)){
|
|
5877
5913
|
filters.push([key, "contains", keyValue]);
|
|
5914
|
+
}else if(_.isArray(keyValue) || _.isBoolean(keyValue) || keyValue){
|
|
5915
|
+
filters.push([key, "=", keyValue]);
|
|
5878
5916
|
}
|
|
5879
5917
|
})
|
|
5880
5918
|
}
|
|
5881
5919
|
|
|
5920
|
+
if(selfData.__keywords && allowSearchFields){
|
|
5921
|
+
const keywordsFilters = [];
|
|
5922
|
+
allowSearchFields.forEach(function(key, index){
|
|
5923
|
+
const keyValue = selfData.__keywords;
|
|
5924
|
+
if(keyValue){
|
|
5925
|
+
keywordsFilters.push([key, "contains", keyValue]);
|
|
5926
|
+
if(index < allowSearchFields.length - 1){
|
|
5927
|
+
keywordsFilters.push('or');
|
|
5928
|
+
}
|
|
5929
|
+
}
|
|
5930
|
+
})
|
|
5931
|
+
filters.push(keywordsFilters);
|
|
5932
|
+
};
|
|
5933
|
+
|
|
5882
5934
|
var fieldFilters = ${JSON.stringify(field.filters)};
|
|
5883
5935
|
if(fieldFilters && fieldFilters.length){
|
|
5884
5936
|
filters.push(fieldFilters);
|
|
@@ -5967,6 +6019,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
5967
6019
|
if(refObjectConfig.paging && refObjectConfig.paging.enabled === false){
|
|
5968
6020
|
top = 1000;
|
|
5969
6021
|
}
|
|
6022
|
+
|
|
5970
6023
|
let pickerSchema = null;
|
|
5971
6024
|
if(ctx.formFactor === 'SMALL'){
|
|
5972
6025
|
pickerSchema = await getListSchema$1(tableFields, {
|
|
@@ -5988,7 +6041,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
5988
6041
|
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user" && !isMobile){
|
|
5989
6042
|
headerToolbarItems = getLookupSapceUserTreeSchema();
|
|
5990
6043
|
pickerSchema["style"] = {
|
|
5991
|
-
"margin-left":"
|
|
6044
|
+
"margin-left":"220px",
|
|
5992
6045
|
"min-height": "300px"
|
|
5993
6046
|
};
|
|
5994
6047
|
pickerSchema.className = pickerSchema.className || "" + " steedos-select-user";
|
|
@@ -5999,7 +6052,8 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
5999
6052
|
if (isAllowCreate) {
|
|
6000
6053
|
const new_button = await getSchema$5(refObjectConfig, { appId: ctx.appId, objectName: refObjectConfig.name, formFactor: ctx.formFactor });
|
|
6001
6054
|
new_button.align = "right";
|
|
6002
|
-
|
|
6055
|
+
// 保持快速搜索放在最左侧,新建按钮往里插,而不是push到最后
|
|
6056
|
+
pickerSchema.headerToolbar.splice(pickerSchema.headerToolbar.length - 1, 0, new_button);
|
|
6003
6057
|
}
|
|
6004
6058
|
pickerSchema.footerToolbar = refObjectConfig.enable_tree ? [] : getObjectFooterToolbar();
|
|
6005
6059
|
if (ctx.filterVisible !== false) {
|
|
@@ -7689,7 +7743,71 @@ async function getQuickEditSchema(field, options){
|
|
|
7689
7743
|
`;
|
|
7690
7744
|
break;
|
|
7691
7745
|
}
|
|
7692
|
-
|
|
7746
|
+
quickEditSchema.body[0].visibleOn = "${quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}";
|
|
7747
|
+
quickEditSchema.body.push({
|
|
7748
|
+
"type":"service",
|
|
7749
|
+
"body":[
|
|
7750
|
+
{
|
|
7751
|
+
"type": "tpl",
|
|
7752
|
+
"tpl": i18next.t('frontend_records_no_allowedit'),
|
|
7753
|
+
"visibleOn": "${!quickedit_record_permissions.allowEdit && quickedit_record_permissions_loading == false}"
|
|
7754
|
+
},
|
|
7755
|
+
{
|
|
7756
|
+
"type": "spinner",
|
|
7757
|
+
"showOn": "${quickedit_record_permissions_loading}"
|
|
7758
|
+
}
|
|
7759
|
+
],
|
|
7760
|
+
"onEvent":{
|
|
7761
|
+
"init":{
|
|
7762
|
+
"actions":[
|
|
7763
|
+
{
|
|
7764
|
+
"actionType": "setValue",
|
|
7765
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
7766
|
+
"args": {
|
|
7767
|
+
"value":{
|
|
7768
|
+
"quickedit_record_permissions_loading": true
|
|
7769
|
+
}
|
|
7770
|
+
}
|
|
7771
|
+
},
|
|
7772
|
+
{
|
|
7773
|
+
"actionType": "ajax",
|
|
7774
|
+
"args": {
|
|
7775
|
+
"api": {
|
|
7776
|
+
"url": "${context.rootUrl}/service/api/@\${objectName}/recordPermissions/${_id}",
|
|
7777
|
+
"method": "get",
|
|
7778
|
+
"headers": {
|
|
7779
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
7780
|
+
},
|
|
7781
|
+
"cache": 30000,
|
|
7782
|
+
"messages": {
|
|
7783
|
+
"failed": "失败了呢。。"
|
|
7784
|
+
}
|
|
7785
|
+
}
|
|
7786
|
+
}
|
|
7787
|
+
},
|
|
7788
|
+
{
|
|
7789
|
+
"actionType": "setValue",
|
|
7790
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
7791
|
+
"args": {
|
|
7792
|
+
"value":{
|
|
7793
|
+
"quickedit_record_permissions_loading": false
|
|
7794
|
+
}
|
|
7795
|
+
}
|
|
7796
|
+
},
|
|
7797
|
+
{
|
|
7798
|
+
"actionType": "setValue",
|
|
7799
|
+
"componentId": `service_listview_${options.objectName}`,
|
|
7800
|
+
"args": {
|
|
7801
|
+
"value":{
|
|
7802
|
+
"quickedit_record_permissions": "${event.data}"
|
|
7803
|
+
}
|
|
7804
|
+
}
|
|
7805
|
+
}
|
|
7806
|
+
]
|
|
7807
|
+
}
|
|
7808
|
+
}
|
|
7809
|
+
|
|
7810
|
+
});
|
|
7693
7811
|
} else {
|
|
7694
7812
|
quickEditSchema = false;
|
|
7695
7813
|
}
|
|
@@ -7722,7 +7840,7 @@ function getFieldWidth(width){
|
|
|
7722
7840
|
|
|
7723
7841
|
async function getTableColumns(fields, options){
|
|
7724
7842
|
const columns = [{name: '_index',type: 'text', width: 32, placeholder: ""}];
|
|
7725
|
-
const allowEdit = options.permissions?.allowEdit &&
|
|
7843
|
+
const allowEdit = options.permissions?.allowEdit && !options.isLookup && options.enable_inline_edit != false;
|
|
7726
7844
|
|
|
7727
7845
|
for (const field of fields) {
|
|
7728
7846
|
//增加quickEdit属性,实现快速编辑
|
|
@@ -8260,7 +8378,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
8260
8378
|
try{
|
|
8261
8379
|
// TODO: 不应该直接在这里取localStorage,应该从外面传入
|
|
8262
8380
|
const listName = api.data.listName;
|
|
8263
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
8381
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
8264
8382
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
8265
8383
|
if(localListViewProps){
|
|
8266
8384
|
localListViewProps = JSON.parse(localListViewProps);
|
|
@@ -8461,7 +8579,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
8461
8579
|
try{
|
|
8462
8580
|
// TODO: 不应该直接在这里取localStorage,应该从外面传入
|
|
8463
8581
|
const listName = api.body.listName;
|
|
8464
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
8582
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
8465
8583
|
/**
|
|
8466
8584
|
* localListViewProps规范来自crud请求api中api.data.$self参数值的。
|
|
8467
8585
|
* 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
|
|
@@ -9626,6 +9744,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
9626
9744
|
// headerToolbar: getObjectHeaderToolbar(objectSchema, options.formFactor, {showDisplayAs}),
|
|
9627
9745
|
headerToolbarClassName: "px-4 py-2 border-gray-300 bg-gray-100 border-solid border-b",
|
|
9628
9746
|
footerToolbar: getObjectFooterToolbar(objectSchema, options.formFactor, {
|
|
9747
|
+
...options,
|
|
9629
9748
|
disableStatistics: options.queryCount === false
|
|
9630
9749
|
}),
|
|
9631
9750
|
filter: options.filterVisible !== false && await getObjectFilter(objectSchema, fields, options),
|
|
@@ -9650,7 +9769,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
9650
9769
|
}
|
|
9651
9770
|
}
|
|
9652
9771
|
// console.log(`getObjectHeaderToolbar====2===>`, options.filterVisible)
|
|
9653
|
-
bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, options.formFactor, {
|
|
9772
|
+
bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, fields, options.formFactor, {
|
|
9654
9773
|
showDisplayAs,
|
|
9655
9774
|
hiddenCount: options.queryCount === false,
|
|
9656
9775
|
headerToolbarItems: options.headerToolbarItems,
|
|
@@ -9775,6 +9894,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
9775
9894
|
return {
|
|
9776
9895
|
type: 'service',
|
|
9777
9896
|
className: '',
|
|
9897
|
+
//目前crud的service层id不认用户自定义id,只支持默认规则id
|
|
9778
9898
|
id: `service_${id}`,
|
|
9779
9899
|
name: `page`,
|
|
9780
9900
|
data: {
|