@steedos-widgets/amis-lib 6.3.12-beta.17 → 6.3.12-beta.19
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 +50 -3
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +50 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +16 -12
- package/dist/index.umd.js.map +1 -1
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -6144,6 +6144,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6144
6144
|
if (!ctx) {
|
|
6145
6145
|
ctx = {};
|
|
6146
6146
|
}
|
|
6147
|
+
console.log("getObjectFieldsFilterBarSchema===", ctx);
|
|
6147
6148
|
const searchableFields = ctx.searchable_fields;
|
|
6148
6149
|
const autoOpenFilter = !!ctx.auto_open_filter;
|
|
6149
6150
|
const btnSearchId = "btn_filter_form_search_" + new Date().getTime();
|
|
@@ -6314,6 +6315,7 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6314
6315
|
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service", {name: "service_object_table_crud"});
|
|
6315
6316
|
crudService && crudService.setData({isFieldsFilterEmpty: true, showFieldsFilter: false});
|
|
6316
6317
|
`;
|
|
6318
|
+
const filterFormValues = ctx.filter_form_data;
|
|
6317
6319
|
const dataProviderInited = `
|
|
6318
6320
|
const searchableFields = ${JSON.stringify(searchableFields)};
|
|
6319
6321
|
const autoOpenFilter = ${autoOpenFilter};
|
|
@@ -6351,6 +6353,20 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6351
6353
|
}
|
|
6352
6354
|
setData({ filterFormSearchableFields: defaultSearchableFields });
|
|
6353
6355
|
if(isLookup){
|
|
6356
|
+
let filterFormValues = ${_.isObject(filterFormValues) ? JSON.stringify(filterFormValues) : ('"' + filterFormValues + '"')} || {};
|
|
6357
|
+
const isAmisFormula = typeof filterFormValues === "string" && filterFormValues.indexOf("\${") > -1;
|
|
6358
|
+
if (isAmisFormula){
|
|
6359
|
+
filterFormValues = AmisCore.evaluate(filterFormValues, data) || {};
|
|
6360
|
+
}
|
|
6361
|
+
if (_.isObject(filterFormValues) || !_.isEmpty(filterFormValues)){
|
|
6362
|
+
filterFormValues = _.pickBy(filterFormValues, function(n,k){
|
|
6363
|
+
return defaultSearchableFields.indexOf(k) > -1;
|
|
6364
|
+
});
|
|
6365
|
+
filterFormValues = _.mapKeys(filterFormValues, function(n,k){
|
|
6366
|
+
return "__searchable__" + k;
|
|
6367
|
+
})
|
|
6368
|
+
setData({ ...filterFormValues });
|
|
6369
|
+
}
|
|
6354
6370
|
// looup字段过滤器不在本地缓存记住过滤条件,所以初始始终隐藏过滤器
|
|
6355
6371
|
setData({ showFieldsFilter: autoOpenFilter });
|
|
6356
6372
|
}
|
|
@@ -11812,6 +11828,7 @@ function getLookupSapceUserTreeSchema(isMobile){
|
|
|
11812
11828
|
{
|
|
11813
11829
|
"actionType": "custom",
|
|
11814
11830
|
"script": `
|
|
11831
|
+
console.log("===__searchable__organizations_parents===",event.data);
|
|
11815
11832
|
const scope = event.context.scoped;
|
|
11816
11833
|
var filterFormValues={
|
|
11817
11834
|
"__searchable__organizations_parents":event.data.value.value
|
|
@@ -12037,6 +12054,7 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
12037
12054
|
// field.name可能是带点的名称,比如审批王中子表字段'instances.instances_submitter',如果不替换掉点,会造成审批王表单中新建子表行时报错
|
|
12038
12055
|
let keywordsSearchBoxName = `__keywords_lookup__${field.name.replace(/\./g, "_")}__to__${refObjectConfig.name}`;
|
|
12039
12056
|
|
|
12057
|
+
const filterFormValues = field.filter_form_data;
|
|
12040
12058
|
source.requestAdaptor = `
|
|
12041
12059
|
let __changedFilterFormValuesKey = "__changedFilterFormValues";
|
|
12042
12060
|
let __lookupField = api.data.$self.__lookupField;
|
|
@@ -12079,7 +12097,21 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
12079
12097
|
}
|
|
12080
12098
|
}
|
|
12081
12099
|
|
|
12082
|
-
|
|
12100
|
+
let filterFormValues = ${_$1.isObject(filterFormValues) ? JSON.stringify(filterFormValues) : ('"' + filterFormValues + '"')} || {};
|
|
12101
|
+
const isAmisFormula = typeof filterFormValues === "string" && filterFormValues.indexOf("\${") > -1;
|
|
12102
|
+
if (isAmisFormula){
|
|
12103
|
+
filterFormValues = AmisCore.evaluate(filterFormValues, context) || {};
|
|
12104
|
+
}
|
|
12105
|
+
if (_.isObject(filterFormValues) || !_.isEmpty(filterFormValues)){
|
|
12106
|
+
// filterFormValues = _.pickBy(filterFormValues, function(n,k){
|
|
12107
|
+
// return defaultSearchableFields.indexOf(k) > -1;
|
|
12108
|
+
// });
|
|
12109
|
+
filterFormValues = _.mapKeys(filterFormValues, function(n,k){
|
|
12110
|
+
return "__searchable__" + k;
|
|
12111
|
+
})
|
|
12112
|
+
}
|
|
12113
|
+
|
|
12114
|
+
var searchableFilter = SteedosUI.getSearchFilter(Object.assign({}, { ...filterFormValues }, selfData)) || [];
|
|
12083
12115
|
|
|
12084
12116
|
if(searchableFilter.length > 0){
|
|
12085
12117
|
if(filters.length > 0 ){
|
|
@@ -12313,13 +12345,15 @@ async function lookupToAmisPicker(field, readonly, ctx){
|
|
|
12313
12345
|
}
|
|
12314
12346
|
pickerSchema.footerToolbar = refObjectConfig.enable_tree ? [] : getObjectFooterToolbar(refObjectConfig,ctx.formFactor,{isLookup: true});
|
|
12315
12347
|
if (ctx.filterVisible !== false) {
|
|
12348
|
+
console.log("lookupToAmisPicker===pickerSchema.filter===field===", field);
|
|
12316
12349
|
pickerSchema.filter = await getObjectFilter(refObjectConfig, fields, {
|
|
12317
12350
|
...ctx,
|
|
12318
12351
|
isLookup: true,
|
|
12319
12352
|
keywordsSearchBoxName,
|
|
12320
12353
|
searchable_fields: field.searchable_fields,
|
|
12321
12354
|
auto_open_filter: field.auto_open_filter,
|
|
12322
|
-
show_left_filter: field.show_left_filter
|
|
12355
|
+
show_left_filter: field.show_left_filter,
|
|
12356
|
+
filter_form_data: field.filter_form_data
|
|
12323
12357
|
});
|
|
12324
12358
|
}
|
|
12325
12359
|
pickerSchema.data = Object.assign({}, pickerSchema.data, {
|
|
@@ -12813,6 +12847,10 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
12813
12847
|
}
|
|
12814
12848
|
let amisSchema;
|
|
12815
12849
|
// 默认使用下拉框模式显示lookup选项,只能配置了enable_enhanced_lookup才使用弹出增强模式
|
|
12850
|
+
if(enableEnhancedLookup == true && field.amis && field.amis.type && field.amis.type !== 'picker'){
|
|
12851
|
+
// 如果配置了amis.type且其值不是picker,则不使用弹出增强模式
|
|
12852
|
+
enableEnhancedLookup = false;
|
|
12853
|
+
}
|
|
12816
12854
|
if(enableEnhancedLookup == true){
|
|
12817
12855
|
amisSchema = await lookupToAmisPicker(field, readonly, ctx);
|
|
12818
12856
|
}else if(refObject.enable_tree) {
|
|
@@ -13944,7 +13982,16 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
13944
13982
|
return convertData
|
|
13945
13983
|
}
|
|
13946
13984
|
// if(ctx.mode === 'edit'){
|
|
13947
|
-
let convertDataResult
|
|
13985
|
+
let convertDataResult;
|
|
13986
|
+
if(convertData.type == "steedos-field"){
|
|
13987
|
+
// 如果是steedos-field,不能把amis属性合并到steedos-field根属性中,要合并也是合并到steedos-field的config.amis中
|
|
13988
|
+
// 而steedos-field字段的amis属性本身就在config.amis中了,所以这里不需要再合并field.amis
|
|
13989
|
+
// 目前测试到受影响的是,把字段的amis属性配置为{"type": "checkboxes"}时,ObjectForm只读模式下,lookup字段返回的是type为steedos-field的组件,此时field.amis中的type不应该合并到steedos-field根属性中
|
|
13990
|
+
convertDataResult = Object.assign({}, baseData, convertData, { labelClassName: 'text-left', clearValueOnHidden: true, fieldName: field.name}, {name: baseData.name});
|
|
13991
|
+
}
|
|
13992
|
+
else {
|
|
13993
|
+
convertDataResult = Object.assign({}, baseData, convertData, { labelClassName: 'text-left', clearValueOnHidden: true, fieldName: field.name}, field.amis, {name: baseData.name});
|
|
13994
|
+
}
|
|
13948
13995
|
// 只读时file字段的外层control层若存在name,内部each组件存在问题
|
|
13949
13996
|
if(readonly && field.type == "file") {
|
|
13950
13997
|
convertDataResult.name = "";
|