@steedos-widgets/amis-lib 1.2.38 → 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 +164 -54
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +164 -54
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +164 -54
- 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 +1 -1
- 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"
|
|
@@ -5721,16 +5748,17 @@ function getLookupSapceUserTreeSchema(){
|
|
|
5721
5748
|
"autoCheckChildren": false,
|
|
5722
5749
|
"searchable": true,
|
|
5723
5750
|
"searchConfig": {
|
|
5724
|
-
"sticky": true
|
|
5751
|
+
"sticky": true,
|
|
5752
|
+
"placeholder": "查找部门"
|
|
5725
5753
|
},
|
|
5726
5754
|
"unfoldedLevel": 2,
|
|
5727
5755
|
"style": {
|
|
5728
5756
|
"max-height": "100%",
|
|
5729
5757
|
"position": "absolute",
|
|
5730
|
-
"left": "-
|
|
5731
|
-
"width": "
|
|
5758
|
+
"left": "-220px",
|
|
5759
|
+
"width": "210px",
|
|
5732
5760
|
"bottom": 0,
|
|
5733
|
-
"top": "
|
|
5761
|
+
"top": "0",
|
|
5734
5762
|
"overflow": "auto",
|
|
5735
5763
|
"min-height":"300px"
|
|
5736
5764
|
},
|
|
@@ -5749,7 +5777,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
5749
5777
|
ctx.idFieldName = refObjectConfig.idFieldName;
|
|
5750
5778
|
ctx.objectName = refObjectConfig.name;
|
|
5751
5779
|
|
|
5752
|
-
|
|
5780
|
+
let tableFields = [];
|
|
5753
5781
|
let i = 0;
|
|
5754
5782
|
const searchableFields = [];
|
|
5755
5783
|
|
|
@@ -5878,16 +5906,31 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
5878
5906
|
}
|
|
5879
5907
|
}
|
|
5880
5908
|
|
|
5881
|
-
|
|
5882
5909
|
if(allowSearchFields){
|
|
5883
5910
|
allowSearchFields.forEach(function(key){
|
|
5884
5911
|
const keyValue = selfData[key];
|
|
5885
|
-
if(keyValue){
|
|
5912
|
+
if(_.isString(keyValue)){
|
|
5886
5913
|
filters.push([key, "contains", keyValue]);
|
|
5914
|
+
}else if(_.isArray(keyValue) || _.isBoolean(keyValue) || keyValue){
|
|
5915
|
+
filters.push([key, "=", keyValue]);
|
|
5887
5916
|
}
|
|
5888
5917
|
})
|
|
5889
5918
|
}
|
|
5890
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
|
+
|
|
5891
5934
|
var fieldFilters = ${JSON.stringify(field.filters)};
|
|
5892
5935
|
if(fieldFilters && fieldFilters.length){
|
|
5893
5936
|
filters.push(fieldFilters);
|
|
@@ -5976,6 +6019,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
5976
6019
|
if(refObjectConfig.paging && refObjectConfig.paging.enabled === false){
|
|
5977
6020
|
top = 1000;
|
|
5978
6021
|
}
|
|
6022
|
+
|
|
5979
6023
|
let pickerSchema = null;
|
|
5980
6024
|
if(ctx.formFactor === 'SMALL'){
|
|
5981
6025
|
pickerSchema = await getListSchema$1(tableFields, {
|
|
@@ -5997,7 +6041,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
5997
6041
|
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user" && !isMobile){
|
|
5998
6042
|
headerToolbarItems = getLookupSapceUserTreeSchema();
|
|
5999
6043
|
pickerSchema["style"] = {
|
|
6000
|
-
"margin-left":"
|
|
6044
|
+
"margin-left":"220px",
|
|
6001
6045
|
"min-height": "300px"
|
|
6002
6046
|
};
|
|
6003
6047
|
pickerSchema.className = pickerSchema.className || "" + " steedos-select-user";
|
|
@@ -6008,7 +6052,8 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
6008
6052
|
if (isAllowCreate) {
|
|
6009
6053
|
const new_button = await getSchema$5(refObjectConfig, { appId: ctx.appId, objectName: refObjectConfig.name, formFactor: ctx.formFactor });
|
|
6010
6054
|
new_button.align = "right";
|
|
6011
|
-
|
|
6055
|
+
// 保持快速搜索放在最左侧,新建按钮往里插,而不是push到最后
|
|
6056
|
+
pickerSchema.headerToolbar.splice(pickerSchema.headerToolbar.length - 1, 0, new_button);
|
|
6012
6057
|
}
|
|
6013
6058
|
pickerSchema.footerToolbar = refObjectConfig.enable_tree ? [] : getObjectFooterToolbar();
|
|
6014
6059
|
if (ctx.filterVisible !== false) {
|
|
@@ -7698,7 +7743,71 @@ async function getQuickEditSchema(field, options){
|
|
|
7698
7743
|
`;
|
|
7699
7744
|
break;
|
|
7700
7745
|
}
|
|
7701
|
-
|
|
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
|
+
});
|
|
7702
7811
|
} else {
|
|
7703
7812
|
quickEditSchema = false;
|
|
7704
7813
|
}
|
|
@@ -7731,7 +7840,7 @@ function getFieldWidth(width){
|
|
|
7731
7840
|
|
|
7732
7841
|
async function getTableColumns(fields, options){
|
|
7733
7842
|
const columns = [{name: '_index',type: 'text', width: 32, placeholder: ""}];
|
|
7734
|
-
const allowEdit = options.permissions?.allowEdit &&
|
|
7843
|
+
const allowEdit = options.permissions?.allowEdit && !options.isLookup && options.enable_inline_edit != false;
|
|
7735
7844
|
|
|
7736
7845
|
for (const field of fields) {
|
|
7737
7846
|
//增加quickEdit属性,实现快速编辑
|
|
@@ -8269,7 +8378,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
8269
8378
|
try{
|
|
8270
8379
|
// TODO: 不应该直接在这里取localStorage,应该从外面传入
|
|
8271
8380
|
const listName = api.data.listName;
|
|
8272
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
8381
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
8273
8382
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
8274
8383
|
if(localListViewProps){
|
|
8275
8384
|
localListViewProps = JSON.parse(localListViewProps);
|
|
@@ -8470,7 +8579,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
8470
8579
|
try{
|
|
8471
8580
|
// TODO: 不应该直接在这里取localStorage,应该从外面传入
|
|
8472
8581
|
const listName = api.body.listName;
|
|
8473
|
-
const listViewPropsStoreKey = location.pathname + "/crud
|
|
8582
|
+
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
8474
8583
|
/**
|
|
8475
8584
|
* localListViewProps规范来自crud请求api中api.data.$self参数值的。
|
|
8476
8585
|
* 比如:{"perPage":20,"page":1,"__searchable__name":"7","__searchable__between__n1__c":[null,null],"filter":[["name","contains","a"]]}
|
|
@@ -9660,7 +9769,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
9660
9769
|
}
|
|
9661
9770
|
}
|
|
9662
9771
|
// console.log(`getObjectHeaderToolbar====2===>`, options.filterVisible)
|
|
9663
|
-
bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, options.formFactor, {
|
|
9772
|
+
bodyProps.headerToolbar = getObjectHeaderToolbar(objectSchema, fields, options.formFactor, {
|
|
9664
9773
|
showDisplayAs,
|
|
9665
9774
|
hiddenCount: options.queryCount === false,
|
|
9666
9775
|
headerToolbarItems: options.headerToolbarItems,
|
|
@@ -9785,6 +9894,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
9785
9894
|
return {
|
|
9786
9895
|
type: 'service',
|
|
9787
9896
|
className: '',
|
|
9897
|
+
//目前crud的service层id不认用户自定义id,只支持默认规则id
|
|
9788
9898
|
id: `service_${id}`,
|
|
9789
9899
|
name: `page`,
|
|
9790
9900
|
data: {
|