@steedos-widgets/amis-lib 6.3.12-beta.9 → 6.3.12
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 +304 -55
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +304 -55
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +100 -56
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/fields/file.d.ts +2 -2
- package/dist/types/lib/converter/amis/fields_filter.d.ts +1 -10
- package/dist/types/lib/converter/amis/header.d.ts +1 -10
- package/dist/types/lib/converter/amis/toolbar.d.ts +1 -10
- package/dist/types/schema/standard_delete.amis.d.ts +13 -0
- package/dist/types/standard/button.d.ts +13 -0
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -532,8 +532,8 @@ function getComparableAmisVersion() {
|
|
|
532
532
|
/*
|
|
533
533
|
* @Author: baozhoutao@steedos.com
|
|
534
534
|
* @Date: 2022-05-23 09:53:08
|
|
535
|
-
* @LastEditors:
|
|
536
|
-
* @LastEditTime:
|
|
535
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
536
|
+
* @LastEditTime: 2025-04-08 10:55:41
|
|
537
537
|
* @Description:
|
|
538
538
|
*/
|
|
539
539
|
|
|
@@ -690,9 +690,10 @@ function getRelatedFieldTpl(field, ctx){
|
|
|
690
690
|
const href = Router.getObjectDetailPath({
|
|
691
691
|
formFactor: ctx.formFactor, appId: "${appId}", objectName: `${objectNameTpl}`, recordId: `${recordIdTpl}`
|
|
692
692
|
});
|
|
693
|
-
if(ctx.isRelated && window.innerWidth >= 768
|
|
693
|
+
if (window.innerWidth >= 768) { //(ctx.isRelated || isObjectListview) && window.innerWidth >= 768
|
|
694
|
+
// 相关表字段,包括列表视图、对象表格组件中的lookup/master_detail字段,在PC端显示时,点击字段值,不跳转到详情页而是右侧弹出drawer
|
|
694
695
|
labelTpl = `<a href="${href}" ${linkTarget} onclick="return false;">${labelTpl}</a>`;
|
|
695
|
-
}else {
|
|
696
|
+
} else {
|
|
696
697
|
labelTpl = `<a href="${href}" ${linkTarget}>${labelTpl}</a>`;
|
|
697
698
|
}
|
|
698
699
|
|
|
@@ -1240,7 +1241,7 @@ async function getPage({type, pageId = '', appId, objectName = '', recordId = ''
|
|
|
1240
1241
|
* @Author: baozhoutao@steedos.com
|
|
1241
1242
|
* @Date: 2022-10-28 14:15:09
|
|
1242
1243
|
* @LastEditors: baozhoutao@steedos.com
|
|
1243
|
-
* @LastEditTime:
|
|
1244
|
+
* @LastEditTime: 2025-02-13 09:31:02
|
|
1244
1245
|
* @Description:
|
|
1245
1246
|
*/
|
|
1246
1247
|
|
|
@@ -1299,7 +1300,7 @@ async function getLookupLinkOnClick(field, options) {
|
|
|
1299
1300
|
"title": " ",
|
|
1300
1301
|
"headerClassName": "hidden",
|
|
1301
1302
|
"size": "lg",
|
|
1302
|
-
"width": "70%",
|
|
1303
|
+
"width": window.drawerWidth || "70%",
|
|
1303
1304
|
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
1304
1305
|
"closeOnEsc": true,
|
|
1305
1306
|
"closeOnOutside": true,
|
|
@@ -1895,7 +1896,6 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
1895
1896
|
{
|
|
1896
1897
|
actionType: "custom",
|
|
1897
1898
|
script: `
|
|
1898
|
-
console.log("asdasd");
|
|
1899
1899
|
let items = _.cloneDeep(event.data.items);
|
|
1900
1900
|
let selectedItems = _.cloneDeep(event.data.selectedItems);
|
|
1901
1901
|
if(event.data.isBatchEdit){
|
|
@@ -1924,7 +1924,12 @@ async function getQuickEditSchema(object, columnField, options){
|
|
|
1924
1924
|
if (field.disabled) {
|
|
1925
1925
|
quickEditSchema = false;
|
|
1926
1926
|
} else {
|
|
1927
|
-
var
|
|
1927
|
+
var fieldCtx = Object.assign({}, ___namespace.omit(options, 'buttons'), {
|
|
1928
|
+
defaults: Object.assign({}, options.defaults, {
|
|
1929
|
+
formSchema: quickEditSchema
|
|
1930
|
+
})
|
|
1931
|
+
});
|
|
1932
|
+
var fieldSchema = await convertSFieldToAmisField(field, false, fieldCtx);
|
|
1928
1933
|
//存在属性上可编辑,实际不可编辑的字段,convertSFieldToAmisField函数可能会返回undefined,如summary
|
|
1929
1934
|
if (!!fieldSchema) {
|
|
1930
1935
|
quickEditSchema.body.push(fieldSchema);
|
|
@@ -2357,14 +2362,19 @@ function getFieldWidth(width){
|
|
|
2357
2362
|
}
|
|
2358
2363
|
|
|
2359
2364
|
async function getColumnItemOnClick(field, options){
|
|
2360
|
-
|
|
2365
|
+
let objectApiName = options.objectName;
|
|
2366
|
+
if(!(field.is_name || field.name === options.labelFieldName)){
|
|
2367
|
+
objectApiName = field.reference_to;
|
|
2368
|
+
}
|
|
2369
|
+
const recordPage = await getPage({ type: 'record', appId: options.appId, objectName: objectApiName, formFactor: options.formFactor });
|
|
2361
2370
|
const drawerRecordDetailSchema = recordPage ? Object.assign({}, recordPage.schema, {
|
|
2362
2371
|
"recordId": `\${${options.idFieldName}}`,
|
|
2363
2372
|
"data": {
|
|
2364
2373
|
...recordPage.schema.data,
|
|
2365
2374
|
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
2366
2375
|
"recordLoaded": false, // 重置数据加载状态
|
|
2367
|
-
"recordId": `\${${options.idFieldName}}
|
|
2376
|
+
"recordId": `\${${options.idFieldName}}`,//审批微页面依赖了作用域中的recordId
|
|
2377
|
+
"_tableObjectName": options.objectName
|
|
2368
2378
|
}
|
|
2369
2379
|
}) : {
|
|
2370
2380
|
"type": "steedos-record-detail",
|
|
@@ -2375,12 +2385,16 @@ async function getColumnItemOnClick(field, options){
|
|
|
2375
2385
|
"data": {
|
|
2376
2386
|
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
2377
2387
|
"recordLoaded": false, // 重置数据加载状态
|
|
2388
|
+
"_tableObjectName": options.objectName
|
|
2378
2389
|
}
|
|
2379
2390
|
};
|
|
2380
2391
|
|
|
2381
2392
|
if(!(field.is_name || field.name === options.labelFieldName)){
|
|
2382
2393
|
drawerRecordDetailSchema.objectApiName = field.reference_to;
|
|
2383
2394
|
drawerRecordDetailSchema.recordId = `\${_display.${field.name}.value}`;
|
|
2395
|
+
// if (recordPage){
|
|
2396
|
+
// drawerRecordDetailSchema.data.recordId = `\${_display.${field.name}.value}`
|
|
2397
|
+
// }
|
|
2384
2398
|
}
|
|
2385
2399
|
return {
|
|
2386
2400
|
"click": {
|
|
@@ -2392,7 +2406,7 @@ async function getColumnItemOnClick(field, options){
|
|
|
2392
2406
|
"title": " ",
|
|
2393
2407
|
"headerClassName": "hidden",
|
|
2394
2408
|
"size": "lg",
|
|
2395
|
-
"width": "70%",
|
|
2409
|
+
"width": window.drawerWidth || "70%",
|
|
2396
2410
|
"bodyClassName": "p-0 m-0 bg-gray-100",
|
|
2397
2411
|
"closeOnEsc": true,
|
|
2398
2412
|
"closeOnOutside": true,
|
|
@@ -2530,6 +2544,32 @@ async function getTableColumns(object, fields, options){
|
|
|
2530
2544
|
static: true,
|
|
2531
2545
|
}, fieldAmis, {name: field.name});
|
|
2532
2546
|
}
|
|
2547
|
+
else if(field.type === 'lookup' || field.type === 'master_detail'){
|
|
2548
|
+
columnItem = Object.assign({}, {
|
|
2549
|
+
type: "static-wrapper",
|
|
2550
|
+
name: field.name,
|
|
2551
|
+
label: field.label,
|
|
2552
|
+
sortable: field.sortable,
|
|
2553
|
+
width: getFieldWidth(field.width),
|
|
2554
|
+
toggled: field.toggled,
|
|
2555
|
+
className,
|
|
2556
|
+
size: "none",
|
|
2557
|
+
inputClassName: "inline",
|
|
2558
|
+
body: {
|
|
2559
|
+
type: "steedos-field",
|
|
2560
|
+
static: true,
|
|
2561
|
+
tableObjectName: options.objectName,
|
|
2562
|
+
config: {
|
|
2563
|
+
type: "lookup",
|
|
2564
|
+
reference_to: field.reference_to,
|
|
2565
|
+
name: field.name,
|
|
2566
|
+
label: null,
|
|
2567
|
+
multiple: field.multiple,
|
|
2568
|
+
amis: Object.assign({}, fieldAmis, { label: null })
|
|
2569
|
+
}
|
|
2570
|
+
}
|
|
2571
|
+
}, fieldAmis, {name: field.name});
|
|
2572
|
+
}
|
|
2533
2573
|
else {
|
|
2534
2574
|
const tpl = await getFieldTpl(field, options);
|
|
2535
2575
|
let type = 'static-text';
|
|
@@ -2578,10 +2618,20 @@ async function getTableColumns(object, fields, options){
|
|
|
2578
2618
|
columnItem.defaultColor = null;
|
|
2579
2619
|
}
|
|
2580
2620
|
|
|
2581
|
-
|
|
2621
|
+
let needClickEvent = false;
|
|
2622
|
+
// if (options.isRelated){
|
|
2623
|
+
// // 子表列表上,Lookup字段和名称字段都需要点击事件
|
|
2624
|
+
// needClickEvent = ((field.is_name || field.name === options.labelFieldName) || ((field.type == 'lookup' || field.type == 'master_detail') && _.isString(field.reference_to) && field.multiple != true));
|
|
2625
|
+
// }
|
|
2626
|
+
// else {// if (isObjectListview)
|
|
2627
|
+
// // 列表视图、对象表格中,Lookup字段需要点击事件
|
|
2628
|
+
// needClickEvent = (field.type == 'lookup' || field.type == 'master_detail') && _.isString(field.reference_to) && field.multiple != true;
|
|
2629
|
+
// }
|
|
2630
|
+
// lookup字段走steedos-field组件了,所以这里只需要判断子表名称字段才额外加点击事件弹出右侧详情
|
|
2631
|
+
needClickEvent = options.isRelated && (field.is_name || field.name === options.labelFieldName);
|
|
2632
|
+
if(window.innerWidth >= 768 && needClickEvent){
|
|
2582
2633
|
columnItem.onEvent = await getColumnItemOnClick(field, options);
|
|
2583
2634
|
}
|
|
2584
|
-
|
|
2585
2635
|
}
|
|
2586
2636
|
}
|
|
2587
2637
|
if(columnItem){
|
|
@@ -3436,6 +3486,11 @@ async function getTableApi(mainObject, fields, options){
|
|
|
3436
3486
|
}, 600);
|
|
3437
3487
|
}
|
|
3438
3488
|
}
|
|
3489
|
+
|
|
3490
|
+
// 列表搜索和快速搜索,有时在某些操作情况下还是会造成crud接口请求使用的过滤条件是上次的,这里强制把正确的过滤条件返回到crud,详细规则见:https://github.com/steedos/steedos-platform/issues/7112
|
|
3491
|
+
// lookup字段的弹出列表搜索不受这里影响,因为lookup字段的弹出列表搜索是单独的接口请求
|
|
3492
|
+
payload.data.__changedFilterFormValues = api.context.__changedFilterFormValues;
|
|
3493
|
+
payload.data.__changedSearchBoxValues = api.context.__changedSearchBoxValues;
|
|
3439
3494
|
${options.adaptor || ''}
|
|
3440
3495
|
return payload;
|
|
3441
3496
|
`;
|
|
@@ -5123,8 +5178,8 @@ const getSchema$4 = async (uiSchema, ctx) => {
|
|
|
5123
5178
|
/*
|
|
5124
5179
|
* @Author: 殷亮辉 yinlianghui@hotoa.com
|
|
5125
5180
|
* @Date: 2023-03-22 09:31:21
|
|
5126
|
-
* @LastEditors:
|
|
5127
|
-
* @LastEditTime:
|
|
5181
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5182
|
+
* @LastEditTime: 2025-04-07 16:02:53
|
|
5128
5183
|
*/
|
|
5129
5184
|
const getSchema$3 = (uiSchema)=>{
|
|
5130
5185
|
return {
|
|
@@ -5184,6 +5239,17 @@ const getSchema$3 = (uiSchema)=>{
|
|
|
5184
5239
|
"_isRelated": "${_isRelated}"
|
|
5185
5240
|
},
|
|
5186
5241
|
"expression": `\${_master.objectName != '${uiSchema.name}' && _master.objectName}`
|
|
5242
|
+
},
|
|
5243
|
+
// 列表视图、对象表格组件上的lookup字段,点开右侧弹出drawer窗口,删除记录后刷新列表
|
|
5244
|
+
{
|
|
5245
|
+
"actionType": "broadcast",
|
|
5246
|
+
"args": {
|
|
5247
|
+
"eventName": "@data.changed.${_tableObjectName}"
|
|
5248
|
+
},
|
|
5249
|
+
"data": {
|
|
5250
|
+
"objectName": "${_tableObjectName}"
|
|
5251
|
+
},
|
|
5252
|
+
"expression": `\${_tableObjectName != '${uiSchema.name}' && _tableObjectName}`
|
|
5187
5253
|
}
|
|
5188
5254
|
]
|
|
5189
5255
|
}
|
|
@@ -6167,15 +6233,38 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6167
6233
|
if (!ctx) {
|
|
6168
6234
|
ctx = {};
|
|
6169
6235
|
}
|
|
6236
|
+
const searchableFields = ctx.searchable_fields;
|
|
6237
|
+
const autoOpenFilter = !!ctx.auto_open_filter;
|
|
6170
6238
|
const btnSearchId = "btn_filter_form_search_" + new Date().getTime();
|
|
6171
6239
|
const filterFormSchema = await getObjectFieldsFilterFormSchema(ctx);
|
|
6172
6240
|
const keywordsSearchBoxName = ctx.keywordsSearchBoxName || "__keywords";
|
|
6173
6241
|
const onSearchScript = `
|
|
6174
|
-
|
|
6242
|
+
let isLookup = event.data.isLookup;
|
|
6243
|
+
let __lookupField = event.data.__lookupField;
|
|
6175
6244
|
const scope = event.context.scoped;
|
|
6245
|
+
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
6176
6246
|
var filterForm = scope.parent.parent.getComponents().find(function(n){
|
|
6177
6247
|
return n.props.type === "form";
|
|
6178
6248
|
});
|
|
6249
|
+
// 使用filterForm.getValues()的话,并不能拿到本地存储中的过滤条件,所以需要从event.data中取,因为本地存储中的过滤条件自动填充到表单上时filterForm.getValues()拿不到。
|
|
6250
|
+
let filterFormValues = event.data;
|
|
6251
|
+
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
|
|
6252
|
+
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});
|
|
6253
|
+
// 同步__changedFilterFormValues中的值
|
|
6254
|
+
// crud && crud.setData({__changedFilterFormValues: {}});
|
|
6255
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
6256
|
+
if(isLookup && __lookupField){
|
|
6257
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
6258
|
+
if(__lookupField.reference_to_field){
|
|
6259
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
6260
|
+
}
|
|
6261
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
6262
|
+
}
|
|
6263
|
+
if(crud){
|
|
6264
|
+
let crudData = crud.getData();
|
|
6265
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
6266
|
+
crud.setData(crudData);
|
|
6267
|
+
}
|
|
6179
6268
|
filterForm.handleFormSubmit(event);
|
|
6180
6269
|
// var filterFormValues = filterForm.getValues();
|
|
6181
6270
|
// var listView = scope.parent.parent.parent.getComponents().find(function(n){
|
|
@@ -6224,11 +6313,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6224
6313
|
}
|
|
6225
6314
|
filterService.setData({showFieldsFilter});
|
|
6226
6315
|
// resizeWindow();//已迁移到搜索栏表单提交事件中执行,因为表单项change后也会触发表单提交了
|
|
6227
|
-
// 使用filterForm.getValues()的话,并不能拿到本地存储中的过滤条件,所以需要从event.data中取。
|
|
6228
|
-
let filterFormValues = event.data;
|
|
6229
6316
|
let isFieldsFilterEmpty = SteedosUI.isFilterFormValuesEmpty(filterFormValues);
|
|
6230
|
-
let
|
|
6231
|
-
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
6317
|
+
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
|
|
6232
6318
|
crudService && crudService.setData({isFieldsFilterEmpty, showFieldsFilter});
|
|
6233
6319
|
`;
|
|
6234
6320
|
const onCancelScript = `
|
|
@@ -6314,10 +6400,27 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6314
6400
|
|
|
6315
6401
|
// 移除搜索按钮上的红点
|
|
6316
6402
|
// let crudService = scope.getComponentById("service_listview_" + event.data.objectName);
|
|
6317
|
-
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
6403
|
+
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
|
|
6318
6404
|
crudService && crudService.setData({isFieldsFilterEmpty: true, showFieldsFilter: false});
|
|
6319
6405
|
`;
|
|
6406
|
+
/**
|
|
6407
|
+
给lookup字段配置filter_form_data时可以配置为amis变量,也可以配置为事态key-value键值对象值:
|
|
6408
|
+
```
|
|
6409
|
+
"filter_form_data": "${selectedPublicGroupFilterFormData|toJson}"
|
|
6410
|
+
```
|
|
6411
|
+
or
|
|
6412
|
+
```
|
|
6413
|
+
"filter_form_data": {
|
|
6414
|
+
"public_group_ids": [
|
|
6415
|
+
"67addbef39f9a4503789b38d"
|
|
6416
|
+
]
|
|
6417
|
+
}
|
|
6418
|
+
```
|
|
6419
|
+
*/
|
|
6420
|
+
const filterFormValues = ctx.filter_form_data;
|
|
6320
6421
|
const dataProviderInited = `
|
|
6422
|
+
const searchableFields = ${JSON.stringify(searchableFields)};
|
|
6423
|
+
const autoOpenFilter = ${autoOpenFilter};
|
|
6321
6424
|
const objectName = data.objectName;
|
|
6322
6425
|
const isLookup = data.isLookup;
|
|
6323
6426
|
const listName = data.listName;
|
|
@@ -6330,6 +6433,11 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6330
6433
|
if(defaultSearchableFields){
|
|
6331
6434
|
defaultSearchableFields = defaultSearchableFields.split(",");
|
|
6332
6435
|
}
|
|
6436
|
+
if(_.isEmpty(defaultSearchableFields) && searchableFields){
|
|
6437
|
+
if(searchableFields.length){
|
|
6438
|
+
defaultSearchableFields = _.map(searchableFields, 'field');
|
|
6439
|
+
}
|
|
6440
|
+
}
|
|
6333
6441
|
if(_.isEmpty(defaultSearchableFields) && data.uiSchema){
|
|
6334
6442
|
let listView = data.uiSchema.list_views[data.listName];
|
|
6335
6443
|
const sFields = listView && listView.searchable_fields;
|
|
@@ -6347,8 +6455,18 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6347
6455
|
}
|
|
6348
6456
|
setData({ filterFormSearchableFields: defaultSearchableFields });
|
|
6349
6457
|
if(isLookup){
|
|
6458
|
+
let filterFormValues = ${_.isObject(filterFormValues) ? JSON.stringify(filterFormValues) : ('"' + filterFormValues + '"')} || {};
|
|
6459
|
+
const isAmisFormula = typeof filterFormValues === "string" && filterFormValues.indexOf("\${") > -1;
|
|
6460
|
+
if (isAmisFormula){
|
|
6461
|
+
filterFormValues = AmisCore.evaluate(filterFormValues, data) || {};
|
|
6462
|
+
}
|
|
6463
|
+
if (_.isObject(filterFormValues) || !_.isEmpty(filterFormValues)){
|
|
6464
|
+
let fields = data.uiSchema && data.uiSchema.fields;
|
|
6465
|
+
filterFormValues = SteedosUI.getSearchFilterFormValues(filterFormValues, fields);
|
|
6466
|
+
setData({ ...filterFormValues });
|
|
6467
|
+
}
|
|
6350
6468
|
// looup字段过滤器不在本地缓存记住过滤条件,所以初始始终隐藏过滤器
|
|
6351
|
-
setData({ showFieldsFilter:
|
|
6469
|
+
setData({ showFieldsFilter: autoOpenFilter });
|
|
6352
6470
|
}
|
|
6353
6471
|
else{
|
|
6354
6472
|
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
@@ -6638,13 +6756,15 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6638
6756
|
"actionType": "custom",
|
|
6639
6757
|
"script": onSearchableFieldsChangeScript
|
|
6640
6758
|
},
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6759
|
+
// 自动触发搜索事件会造成bug,应该是升级amis到6.4造成的,见:https://github.com/steedos/steedos-platform/issues/7121
|
|
6760
|
+
// 变更搜索项后,用户一般会点击搜索按钮,所以这里不自动触发搜索事件
|
|
6761
|
+
// {
|
|
6762
|
+
// "actionType": "click",
|
|
6763
|
+
// "componentId": btnSearchId,
|
|
6764
|
+
// "args": {
|
|
6765
|
+
// "__from_fields_filter_settings_confirm": true
|
|
6766
|
+
// }
|
|
6767
|
+
// },
|
|
6648
6768
|
{
|
|
6649
6769
|
"componentId": "",
|
|
6650
6770
|
"args": {},
|
|
@@ -7613,7 +7733,7 @@ async function getObjectListHeaderFieldsFilterBar(objectSchema, listViewName, ct
|
|
|
7613
7733
|
* @param {*} objectSchema 对象UISchema
|
|
7614
7734
|
* @returns amisSchema
|
|
7615
7735
|
*/
|
|
7616
|
-
function getObjectListHeader
|
|
7736
|
+
function getObjectListHeader(objectSchema, listViewName, ctx) {
|
|
7617
7737
|
if (!ctx) {
|
|
7618
7738
|
ctx = {};
|
|
7619
7739
|
}
|
|
@@ -8939,10 +9059,9 @@ function getObjectHeaderQuickSearchBox(mainObject, fields, formFactor, { isLooku
|
|
|
8939
9059
|
}
|
|
8940
9060
|
|
|
8941
9061
|
const onChangeScript = `
|
|
8942
|
-
// console.log("==search=onChangeScript===");
|
|
8943
9062
|
const scope = event.context.scoped;
|
|
8944
9063
|
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
8945
|
-
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
9064
|
+
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
|
|
8946
9065
|
let __changedSearchBoxValues = {};
|
|
8947
9066
|
__changedSearchBoxValues["${keywordsSearchBoxName}"] = event.data["${keywordsSearchBoxName}"];
|
|
8948
9067
|
// crudService && crudService.setData({__changedSearchBoxValues: __changedSearchBoxValues});
|
|
@@ -9309,10 +9428,28 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
9309
9428
|
let filterForm = SteedosUI.getClosestAmisComponentByType(scope, "form");
|
|
9310
9429
|
let filterFormService = SteedosUI.getClosestAmisComponentByType(filterForm.context, "service");
|
|
9311
9430
|
// 使用event.data的话,并不能拿到本地存储中的过滤条件,所以需要从filterFormService中取。
|
|
9312
|
-
let filterFormValues = filterFormService.getData()
|
|
9431
|
+
let filterFormValues = filterFormService.getData();
|
|
9432
|
+
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
|
|
9313
9433
|
let isFieldsFilterEmpty = SteedosUI.isFilterFormValuesEmpty(filterFormValues);
|
|
9314
9434
|
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
9315
|
-
|
|
9435
|
+
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});
|
|
9436
|
+
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
9437
|
+
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
9438
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
9439
|
+
if(isLookup && __lookupField){
|
|
9440
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
9441
|
+
if(__lookupField.reference_to_field){
|
|
9442
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
9443
|
+
}
|
|
9444
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
9445
|
+
}
|
|
9446
|
+
if(crud){
|
|
9447
|
+
let crudData = crud.getData();
|
|
9448
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
9449
|
+
crud.setData(crudData);
|
|
9450
|
+
}
|
|
9451
|
+
|
|
9452
|
+
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
|
|
9316
9453
|
crudService && crudService.setData({isFieldsFilterEmpty});
|
|
9317
9454
|
`;
|
|
9318
9455
|
let onChangeScript = `
|
|
@@ -9327,7 +9464,7 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
9327
9464
|
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
|
|
9328
9465
|
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
9329
9466
|
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});;
|
|
9330
|
-
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
9467
|
+
// let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
|
|
9331
9468
|
// crudService && crudService.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
9332
9469
|
// 这里不用crudService而用crud是因为lookup字段弹出的列表中的crudService中的变量无法传入crud的发送适配器中
|
|
9333
9470
|
// crud && crud.setData({__changedFilterFormValues: changedFilterFormValues});
|
|
@@ -9683,7 +9820,7 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
9683
9820
|
className: crudModeClassName,
|
|
9684
9821
|
//目前crud的service层id不认用户自定义id,只支持默认规则id,许多地方的格式都写死了service_listview_${objectname}
|
|
9685
9822
|
id: `service_${id}`,
|
|
9686
|
-
name:
|
|
9823
|
+
name: "service_object_table_crud",
|
|
9687
9824
|
data: options.amisData,
|
|
9688
9825
|
body: body,
|
|
9689
9826
|
//监听广播事件,重算crud高度
|
|
@@ -9847,6 +9984,17 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
9847
9984
|
},
|
|
9848
9985
|
"expression": `\${_master.objectName != '${objectSchema.name}' && _master.objectName}`
|
|
9849
9986
|
},
|
|
9987
|
+
// 列表视图、对象表格组件上的lookup字段,点开右侧弹出drawer窗口,修改记录后刷新列表
|
|
9988
|
+
{
|
|
9989
|
+
"actionType": "broadcast",
|
|
9990
|
+
"args": {
|
|
9991
|
+
"eventName": "@data.changed.${_tableObjectName}"
|
|
9992
|
+
},
|
|
9993
|
+
"data": {
|
|
9994
|
+
"objectName": "${_tableObjectName}"
|
|
9995
|
+
},
|
|
9996
|
+
"expression": `\${_tableObjectName != '${objectSchema.name}' && _tableObjectName}`
|
|
9997
|
+
},
|
|
9850
9998
|
...submitSuccActions,
|
|
9851
9999
|
// {
|
|
9852
10000
|
// "actionType": "custom",
|
|
@@ -10030,8 +10178,8 @@ const getRecordPermissions = async (objectName, recordId)=>{
|
|
|
10030
10178
|
/*
|
|
10031
10179
|
* @Author: baozhoutao@steedos.com
|
|
10032
10180
|
* @Date: 2022-07-05 15:55:39
|
|
10033
|
-
* @LastEditors:
|
|
10034
|
-
* @LastEditTime:
|
|
10181
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
10182
|
+
* @LastEditTime: 2025-01-08 13:32:51
|
|
10035
10183
|
* @Description:
|
|
10036
10184
|
*/
|
|
10037
10185
|
|
|
@@ -10105,7 +10253,7 @@ async function getObjectRelatedList(
|
|
|
10105
10253
|
|
|
10106
10254
|
// 获取单个相关表
|
|
10107
10255
|
async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObjectName, relatedKey, ctx){
|
|
10108
|
-
let { top, perPage, appId, relatedLabel, className, columns, sort, filters, visible_on } = ctx;
|
|
10256
|
+
let { top, perPage, appId, relatedLabel, className, columns, sort, filters, visible_on, enableHeaderToolbar } = ctx;
|
|
10109
10257
|
// console.log('getRecordDetailRelatedListSchema==>',objectName,recordId,relatedObjectName)
|
|
10110
10258
|
const relatedObjectUiSchema = await getUISchema(relatedObjectName);
|
|
10111
10259
|
if(!relatedObjectUiSchema){
|
|
@@ -10170,6 +10318,10 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
|
|
|
10170
10318
|
let headerToolbar = [];
|
|
10171
10319
|
if(!isMobile){
|
|
10172
10320
|
headerToolbar.push("bulkActions");
|
|
10321
|
+
if (enableHeaderToolbar) {
|
|
10322
|
+
// 通过 enableHeaderToolbar = true 可以控制是否显示内置的带过滤器的headerToolbar
|
|
10323
|
+
headerToolbar = undefined;
|
|
10324
|
+
}
|
|
10173
10325
|
}
|
|
10174
10326
|
const options = {
|
|
10175
10327
|
globalFilter,
|
|
@@ -10208,7 +10360,7 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
|
|
|
10208
10360
|
amisSchema: {
|
|
10209
10361
|
type: "service",
|
|
10210
10362
|
id: componentId,
|
|
10211
|
-
className: `steedos-record-related-list mb-4 last:mb-0 ${componentId} ${className}`,
|
|
10363
|
+
className: `steedos-record-related-list mb-4 last:mb-0 ${componentId} ${className} ${enableHeaderToolbar ? 'enable-header-toolbar' : ''}`,
|
|
10212
10364
|
data: {
|
|
10213
10365
|
relatedKey: relatedKey,
|
|
10214
10366
|
listViewId: `amis-\${appId}-${relatedObjectName}-listview`,
|
|
@@ -10310,6 +10462,7 @@ async function getRelatedListSchema(
|
|
|
10310
10462
|
listViewName,
|
|
10311
10463
|
ctx
|
|
10312
10464
|
) {
|
|
10465
|
+
const { enableHeaderToolbar } = ctx;
|
|
10313
10466
|
const uiSchema = await getUISchema(objectName);
|
|
10314
10467
|
if(!uiSchema){
|
|
10315
10468
|
return {}
|
|
@@ -10362,10 +10515,14 @@ async function getRelatedListSchema(
|
|
|
10362
10515
|
delete ctx.filters;
|
|
10363
10516
|
|
|
10364
10517
|
delete ctx.globalFilter;
|
|
10518
|
+
delete ctx.enableHeaderToolbar;
|
|
10365
10519
|
|
|
10366
10520
|
const adaptor = `
|
|
10367
10521
|
try{
|
|
10368
10522
|
if(setDataToComponentId){
|
|
10523
|
+
// 子表列表在headerToolbar过滤器中设置过过滤条件的话,始终显示子表列表,无论是否查询到数据
|
|
10524
|
+
// 改为使用css样式控制子表列表放开headerToolbar时,始终显示crud,只隐藏crud内部的表格,从而始终显示headerToolbar不受这里逻辑影响
|
|
10525
|
+
// var headerToolbarFilterChanged = context.isFieldsFilterEmpty === false;
|
|
10369
10526
|
if(payload.data.count){
|
|
10370
10527
|
setTimeout(function(){
|
|
10371
10528
|
// 设计器中获取不到window.$从而导致报错, 所以用纯js替换下。
|
|
@@ -10388,7 +10545,7 @@ async function getRelatedListSchema(
|
|
|
10388
10545
|
"filters": listviewFilter,
|
|
10389
10546
|
"filtersFunction": filtersFunction,
|
|
10390
10547
|
"sort": listViewSort,
|
|
10391
|
-
"filterVisible":
|
|
10548
|
+
"filterVisible": !!enableHeaderToolbar,
|
|
10392
10549
|
"requestAdaptor": ctx.requestAdaptor,
|
|
10393
10550
|
"adaptor": adaptor + ctx.adaptor || '',
|
|
10394
10551
|
"ctx": ctx,
|
|
@@ -10944,7 +11101,8 @@ async function getRecordDetailHeaderSchema(objectName,recordId, options){
|
|
|
10944
11101
|
}
|
|
10945
11102
|
|
|
10946
11103
|
async function getRecordDetailSchema(objectName, appId, props = {}){
|
|
10947
|
-
const uiSchema = await getUISchema(objectName);
|
|
11104
|
+
const uiSchema = await getUISchema(objectName);
|
|
11105
|
+
|
|
10948
11106
|
const relatedLists = await getObjectRelatedList(objectName);
|
|
10949
11107
|
const detailed = {
|
|
10950
11108
|
"title": i18next__default["default"].t('frontend_record_detail_tab_detailed'),
|
|
@@ -10983,6 +11141,21 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
|
|
|
10983
11141
|
if(relatedLists.length){
|
|
10984
11142
|
content.tabs.push(related);
|
|
10985
11143
|
}
|
|
11144
|
+
const contents = [content];
|
|
11145
|
+
if (uiSchema.enable_chatter && window.BuilderLiveblocks) {
|
|
11146
|
+
const chatter = {
|
|
11147
|
+
"type": "rooms-provider",
|
|
11148
|
+
"baseUrl": "${context.rootUrl}",
|
|
11149
|
+
"body": [
|
|
11150
|
+
{
|
|
11151
|
+
"type": "rooms-comments",
|
|
11152
|
+
"className": "flex flex-col gap-3 m-4",
|
|
11153
|
+
"roomId": "objects:${objectName}:${recordId}",
|
|
11154
|
+
}
|
|
11155
|
+
]
|
|
11156
|
+
};
|
|
11157
|
+
contents.push(chatter);
|
|
11158
|
+
}
|
|
10986
11159
|
// content.tabs = reverse(content.tabs)
|
|
10987
11160
|
return {
|
|
10988
11161
|
uiSchema,
|
|
@@ -10998,7 +11171,7 @@ async function getRecordDetailSchema(objectName, appId, props = {}){
|
|
|
10998
11171
|
"showButtons": props.showButtons,
|
|
10999
11172
|
"showBackButton": props.showBackButton,
|
|
11000
11173
|
},
|
|
11001
|
-
|
|
11174
|
+
...contents,
|
|
11002
11175
|
],
|
|
11003
11176
|
"objectApiName": "${objectName}",
|
|
11004
11177
|
"recordId": "${recordId}",
|
|
@@ -11782,14 +11955,42 @@ function getLookupSapceUserTreeSchema(isMobile){
|
|
|
11782
11955
|
{
|
|
11783
11956
|
"actionType": "custom",
|
|
11784
11957
|
"script": `
|
|
11958
|
+
console.log("lookup-tree-event.data:",event.data);
|
|
11959
|
+
console.log("lookup-tree-event.data.value.label:",event.data.value.label);
|
|
11960
|
+
console.log("lookup-tree-event.data.value.value:",event.data.value.value);
|
|
11785
11961
|
const scope = event.context.scoped;
|
|
11786
|
-
var
|
|
11962
|
+
var treeFilterFormValues={
|
|
11787
11963
|
"__searchable__organizations_parents":event.data.value.value
|
|
11788
11964
|
}
|
|
11789
|
-
var listView = scope.parent.getComponents().find(function(n){
|
|
11790
|
-
|
|
11965
|
+
// var listView = scope.parent.getComponents().find(function(n){
|
|
11966
|
+
// return n.props.type === "crud";
|
|
11967
|
+
// });
|
|
11968
|
+
// listView.handleFilterSubmit(Object.assign({}, filterFormValues));
|
|
11969
|
+
let __lookupField = event.data.__lookupField;
|
|
11970
|
+
let crud = SteedosUI.getClosestAmisComponentByType(scope, "crud");
|
|
11971
|
+
var filterForm = scope.getComponents().find(function(n){
|
|
11972
|
+
return n.props.type === "form";
|
|
11791
11973
|
});
|
|
11792
|
-
|
|
11974
|
+
let filterFormValues = filterForm.getData();
|
|
11975
|
+
filterFormValues = JSON.parse(JSON.stringify(filterFormValues)); //只取当层数据域中数据,去除__super层数据
|
|
11976
|
+
const changedFilterFormValues = _.pickBy(filterFormValues, function(n,k){return /^__searchable__/.test(k);});
|
|
11977
|
+
Object.assign(changedFilterFormValues, treeFilterFormValues);
|
|
11978
|
+
// 同步__changedFilterFormValues中的值
|
|
11979
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
11980
|
+
if(__lookupField){
|
|
11981
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
11982
|
+
if(__lookupField.reference_to_field){
|
|
11983
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
11984
|
+
}
|
|
11985
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
11986
|
+
}
|
|
11987
|
+
if(crud){
|
|
11988
|
+
let crudData = crud.getData();
|
|
11989
|
+
crudData[__changedFilterFormValuesKey] = changedFilterFormValues;
|
|
11990
|
+
crud.setData(crudData);
|
|
11991
|
+
}
|
|
11992
|
+
filterForm.setData(treeFilterFormValues);
|
|
11993
|
+
filterForm.handleFormSubmit(event);
|
|
11793
11994
|
`
|
|
11794
11995
|
},
|
|
11795
11996
|
{
|
|
@@ -11883,6 +12084,9 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
11883
12084
|
ctx.idFieldName = refObjectConfig.idFieldName;
|
|
11884
12085
|
ctx.objectName = refObjectConfig.name;
|
|
11885
12086
|
|
|
12087
|
+
// 是否显示lookup字段左侧的过滤器(如果有的话),默认为true,目前只有lookup选人字段有左侧树过滤器
|
|
12088
|
+
const showLeftFilter = field.show_left_filter !== false;
|
|
12089
|
+
|
|
11886
12090
|
let tableFields = [];
|
|
11887
12091
|
const searchableFields = [];
|
|
11888
12092
|
|
|
@@ -12004,6 +12208,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
12004
12208
|
// field.name可能是带点的名称,比如审批王中子表字段'instances.instances_submitter',如果不替换掉点,会造成审批王表单中新建子表行时报错
|
|
12005
12209
|
let keywordsSearchBoxName = `__keywords_lookup__${field.name.replace(/\./g, "_")}__to__${refObjectConfig.name}`;
|
|
12006
12210
|
|
|
12211
|
+
const filterFormValues = field.filter_form_data;
|
|
12007
12212
|
source.requestAdaptor = `
|
|
12008
12213
|
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
12009
12214
|
let __lookupField = api.data.$self.__lookupField;
|
|
@@ -12046,7 +12251,20 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
12046
12251
|
}
|
|
12047
12252
|
}
|
|
12048
12253
|
|
|
12049
|
-
|
|
12254
|
+
let filterFormValues = {};
|
|
12255
|
+
if (selfData.op !== 'loadOptions'){
|
|
12256
|
+
filterFormValues = ${___namespace.isObject(filterFormValues) ? JSON.stringify(filterFormValues) : ('"' + filterFormValues + '"')} || {};
|
|
12257
|
+
const isAmisFormula = typeof filterFormValues === "string" && filterFormValues.indexOf("\${") > -1;
|
|
12258
|
+
if (isAmisFormula){
|
|
12259
|
+
filterFormValues = AmisCore.evaluate(filterFormValues, context) || {};
|
|
12260
|
+
}
|
|
12261
|
+
if (_.isObject(filterFormValues) || !_.isEmpty(filterFormValues)){
|
|
12262
|
+
let fields = api.data.$self.uiSchema && api.data.$self.uiSchema.fields;
|
|
12263
|
+
filterFormValues = SteedosUI.getSearchFilterFormValues(filterFormValues, fields);
|
|
12264
|
+
}
|
|
12265
|
+
}
|
|
12266
|
+
|
|
12267
|
+
var searchableFilter = SteedosUI.getSearchFilter(Object.assign({}, { ...filterFormValues }, selfData)) || [];
|
|
12050
12268
|
|
|
12051
12269
|
if(searchableFilter.length > 0){
|
|
12052
12270
|
if(filters.length > 0 ){
|
|
@@ -12214,6 +12432,20 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
12214
12432
|
});
|
|
12215
12433
|
payload.data.rows = updatedResult;
|
|
12216
12434
|
}
|
|
12435
|
+
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
12436
|
+
let __lookupField = api.data.$self.__lookupField;
|
|
12437
|
+
if(__lookupField){
|
|
12438
|
+
let lookupTag = "__lookup__" + __lookupField.name + "__" + __lookupField.reference_to;
|
|
12439
|
+
if(__lookupField.reference_to_field){
|
|
12440
|
+
lookupTag += "__" + __lookupField.reference_to_field;
|
|
12441
|
+
}
|
|
12442
|
+
__changedFilterFormValuesKey += lookupTag;
|
|
12443
|
+
}
|
|
12444
|
+
let __changedFilterFormValues = api.context[__changedFilterFormValuesKey] || {};
|
|
12445
|
+
let __changedSearchBoxValues = api.context.__changedSearchBoxValues || {};
|
|
12446
|
+
// 列表搜索和快速搜索,有时在某些操作情况下还是会造成crud接口请求使用的过滤条件是上次的,这里强制把正确的过滤条件返回到crud,详细规则见:https://github.com/steedos/steedos-platform/issues/7112
|
|
12447
|
+
payload.data[__changedFilterFormValuesKey] = __changedFilterFormValues;
|
|
12448
|
+
payload.data.__changedSearchBoxValues = __changedSearchBoxValues;
|
|
12217
12449
|
return payload;
|
|
12218
12450
|
`;
|
|
12219
12451
|
if(field.optionsFunction || field._optionsFunction){
|
|
@@ -12222,7 +12454,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
12222
12454
|
return payload;
|
|
12223
12455
|
`;
|
|
12224
12456
|
}
|
|
12225
|
-
let top =
|
|
12457
|
+
let top = 500;
|
|
12226
12458
|
|
|
12227
12459
|
if(refObjectConfig.paging && refObjectConfig.paging.enabled === false){
|
|
12228
12460
|
top = 1000;
|
|
@@ -12249,7 +12481,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
12249
12481
|
|
|
12250
12482
|
pickerSchema.headerToolbar = getObjectHeaderToolbar(refObjectConfig, fieldsArr, ctx.formFactor, { isLookup: true, keywordsSearchBoxName });
|
|
12251
12483
|
|
|
12252
|
-
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user"){
|
|
12484
|
+
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user" && showLeftFilter){
|
|
12253
12485
|
pickerSchema.headerToolbar.push(getLookupSapceUserTreeSchema(isMobile));
|
|
12254
12486
|
pickerSchema.className = pickerSchema.className || "" + " steedos-select-user";
|
|
12255
12487
|
}
|
|
@@ -12269,7 +12501,11 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
12269
12501
|
pickerSchema.filter = await getObjectFilter(refObjectConfig, fields, {
|
|
12270
12502
|
...ctx,
|
|
12271
12503
|
isLookup: true,
|
|
12272
|
-
keywordsSearchBoxName
|
|
12504
|
+
keywordsSearchBoxName,
|
|
12505
|
+
searchable_fields: field.searchable_fields,
|
|
12506
|
+
auto_open_filter: field.auto_open_filter,
|
|
12507
|
+
show_left_filter: field.show_left_filter,
|
|
12508
|
+
filter_form_data: field.filter_form_data
|
|
12273
12509
|
});
|
|
12274
12510
|
}
|
|
12275
12511
|
pickerSchema.data = Object.assign({}, pickerSchema.data, {
|
|
@@ -12336,7 +12572,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
12336
12572
|
}
|
|
12337
12573
|
|
|
12338
12574
|
const ctx = ${JSON.stringify(ctx)};
|
|
12339
|
-
const componentId = ctx.defaults.formSchema.id;
|
|
12575
|
+
const componentId = ctx.defaults && ctx.defaults.formSchema && ctx.defaults.formSchema.id;
|
|
12340
12576
|
doAction({
|
|
12341
12577
|
actionType: 'setValue',
|
|
12342
12578
|
componentId: componentId,
|
|
@@ -12763,6 +12999,10 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
12763
12999
|
}
|
|
12764
13000
|
let amisSchema;
|
|
12765
13001
|
// 默认使用下拉框模式显示lookup选项,只能配置了enable_enhanced_lookup才使用弹出增强模式
|
|
13002
|
+
if(enableEnhancedLookup == true && field.amis && field.amis.type && field.amis.type !== 'picker'){
|
|
13003
|
+
// 如果配置了amis.type且其值不是picker,则不使用弹出增强模式
|
|
13004
|
+
enableEnhancedLookup = false;
|
|
13005
|
+
}
|
|
12766
13006
|
if(enableEnhancedLookup == true){
|
|
12767
13007
|
amisSchema = await lookupToAmisPicker(field, readonly, ctx);
|
|
12768
13008
|
}else if(refObject.enable_tree) {
|
|
@@ -13894,7 +14134,16 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
13894
14134
|
return convertData
|
|
13895
14135
|
}
|
|
13896
14136
|
// if(ctx.mode === 'edit'){
|
|
13897
|
-
let convertDataResult
|
|
14137
|
+
let convertDataResult;
|
|
14138
|
+
if(convertData.type == "steedos-field"){
|
|
14139
|
+
// 如果是steedos-field,不能把amis属性合并到steedos-field根属性中,要合并也是合并到steedos-field的config.amis中
|
|
14140
|
+
// 而steedos-field字段的amis属性本身就在config.amis中了,所以这里不需要再合并field.amis
|
|
14141
|
+
// 目前测试到受影响的是,把字段的amis属性配置为{"type": "checkboxes"}时,ObjectForm只读模式下,lookup字段返回的是type为steedos-field的组件,此时field.amis中的type不应该合并到steedos-field根属性中
|
|
14142
|
+
convertDataResult = Object.assign({}, baseData, convertData, { labelClassName: 'text-left', clearValueOnHidden: true, fieldName: field.name}, {name: baseData.name});
|
|
14143
|
+
}
|
|
14144
|
+
else {
|
|
14145
|
+
convertDataResult = Object.assign({}, baseData, convertData, { labelClassName: 'text-left', clearValueOnHidden: true, fieldName: field.name}, field.amis, {name: baseData.name});
|
|
14146
|
+
}
|
|
13898
14147
|
// 只读时file字段的外层control层若存在name,内部each组件存在问题
|
|
13899
14148
|
if(readonly && field.type == "file") {
|
|
13900
14149
|
convertDataResult.name = "";
|
|
@@ -16039,7 +16288,7 @@ async function getListviewInitSchema(objectApiName, listViewName, ctx) {
|
|
|
16039
16288
|
const defaults = ctx.defaults || {};
|
|
16040
16289
|
if(!defaults.headerSchema){
|
|
16041
16290
|
//传入isListviewInit是区别于对象列表类型的微页面,即getListPageInitSchema函数中该属性为false
|
|
16042
|
-
const headerSchema = await getObjectListHeader
|
|
16291
|
+
const headerSchema = await getObjectListHeader(uiSchema, listViewName, {
|
|
16043
16292
|
onlySecordLine: true,
|
|
16044
16293
|
isListviewInit: true
|
|
16045
16294
|
});
|
|
@@ -18590,7 +18839,7 @@ exports.getObjectDetailMoreButtons = getObjectDetailMoreButtons;
|
|
|
18590
18839
|
exports.getObjectFieldsFilterBarSchema = getObjectFieldsFilterBarSchema;
|
|
18591
18840
|
exports.getObjectFieldsFilterButtonSchema = getObjectFieldsFilterButtonSchema;
|
|
18592
18841
|
exports.getObjectFieldsFilterFormSchema = getObjectFieldsFilterFormSchema;
|
|
18593
|
-
exports.getObjectListHeader = getObjectListHeader
|
|
18842
|
+
exports.getObjectListHeader = getObjectListHeader;
|
|
18594
18843
|
exports.getObjectListHeaderFieldsFilterBar = getObjectListHeaderFieldsFilterBar;
|
|
18595
18844
|
exports.getObjectListHeaderFirstLine = getObjectListHeaderFirstLine;
|
|
18596
18845
|
exports.getObjectListHeaderSecordLine = getObjectListHeaderSecordLine;
|