@steedos-widgets/amis-lib 3.6.0-beta.7 → 3.6.0-beta.9
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 +97 -30
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +97 -30
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +12 -9
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/index.d.ts +8 -0
- package/dist/types/lib/objects.d.ts +8 -0
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1643,7 +1643,6 @@ async function getQuickEditSchema(field, options){
|
|
|
1643
1643
|
{
|
|
1644
1644
|
"actionType": "custom",
|
|
1645
1645
|
"script": `
|
|
1646
|
-
|
|
1647
1646
|
var _display = _.cloneDeep(event.data._display);
|
|
1648
1647
|
${displayField}
|
|
1649
1648
|
doAction({actionType: 'setValue', "args": {"value": {_display}},componentId: "${quickEditId}"});
|
|
@@ -1814,6 +1813,23 @@ async function getQuickEditSchema(field, options){
|
|
|
1814
1813
|
"onEvent":{
|
|
1815
1814
|
"init":{
|
|
1816
1815
|
"actions":[
|
|
1816
|
+
//amis3.6无法从数据域中直接拿到正确的selectitems,需要通过crud组件的getSelected()函数获取
|
|
1817
|
+
{
|
|
1818
|
+
"actionType": "custom",
|
|
1819
|
+
"script": `
|
|
1820
|
+
crudScoped = event.context.scoped.getComponentById('${options.crudId}');
|
|
1821
|
+
const selectedItems = crudScoped && crudScoped.control.getSelected();
|
|
1822
|
+
doAction({
|
|
1823
|
+
"componentId": "${quickEditId}",
|
|
1824
|
+
"actionType": "setValue",
|
|
1825
|
+
"args": {
|
|
1826
|
+
"value": {
|
|
1827
|
+
selectedItems
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
});
|
|
1831
|
+
`
|
|
1832
|
+
},
|
|
1817
1833
|
{
|
|
1818
1834
|
"actionType": "setValue",
|
|
1819
1835
|
"componentId": quickEditId,
|
|
@@ -5744,12 +5760,16 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
5744
5760
|
// }
|
|
5745
5761
|
// listView.handleFilterSubmit(Object.assign({}, removedValues, filterFormValues));
|
|
5746
5762
|
// 点击搜索的时候自动收起搜索栏
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5763
|
+
//触发amis crud 高度重算
|
|
5764
|
+
doAction({
|
|
5765
|
+
"actionType": "broadcast",
|
|
5766
|
+
"args": {
|
|
5767
|
+
"eventName": "@height.changed.${objectSchema.name}"
|
|
5768
|
+
},
|
|
5769
|
+
"data": {
|
|
5770
|
+
"timeOut": 500
|
|
5771
|
+
}
|
|
5772
|
+
});
|
|
5753
5773
|
const filterService = filterForm.context.getComponents().find(function(n){
|
|
5754
5774
|
return n.props.type === "service";
|
|
5755
5775
|
});
|
|
@@ -5851,9 +5871,16 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
5851
5871
|
let filterFormService = SteedosUI.getClosestAmisComponentByType(filterForm.context, "service");
|
|
5852
5872
|
filterFormService.setData({showFieldsFilter: !!!filterFormService.props.data.showFieldsFilter});
|
|
5853
5873
|
//触发amis crud 高度重算
|
|
5854
|
-
|
|
5855
|
-
|
|
5856
|
-
|
|
5874
|
+
doAction({
|
|
5875
|
+
"actionType": "broadcast",
|
|
5876
|
+
"args": {
|
|
5877
|
+
"eventName": "@height.changed.${objectSchema.name}"
|
|
5878
|
+
},
|
|
5879
|
+
"data": {
|
|
5880
|
+
"timeOut": 100
|
|
5881
|
+
}
|
|
5882
|
+
});
|
|
5883
|
+
|
|
5857
5884
|
// 移除搜索按钮上的红点
|
|
5858
5885
|
// let crudService = scope.getComponentById("service_listview_" + event.data.objectName);
|
|
5859
5886
|
let crudService = crud && SteedosUI.getClosestAmisComponentByType(crud.context, "service");
|
|
@@ -6010,9 +6037,15 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6010
6037
|
sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify(localListViewProps));
|
|
6011
6038
|
}
|
|
6012
6039
|
//触发amis crud 高度重算
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6040
|
+
doAction({
|
|
6041
|
+
"actionType": "broadcast",
|
|
6042
|
+
"args": {
|
|
6043
|
+
"eventName": "@height.changed.${objectSchema.name}"
|
|
6044
|
+
},
|
|
6045
|
+
"data": {
|
|
6046
|
+
"timeOut": 100
|
|
6047
|
+
}
|
|
6048
|
+
});
|
|
6016
6049
|
// ===END===
|
|
6017
6050
|
`;
|
|
6018
6051
|
return {
|
|
@@ -7718,13 +7751,16 @@ const filterService = filterForm.context.getComponents().find(function(n){
|
|
|
7718
7751
|
});
|
|
7719
7752
|
let toShowFieldsFilter = !!!filterService.props.data.showFieldsFilter;
|
|
7720
7753
|
filterService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
}
|
|
7727
|
-
|
|
7754
|
+
//触发amis crud 高度重算
|
|
7755
|
+
doAction({
|
|
7756
|
+
"actionType": "broadcast",
|
|
7757
|
+
"args": {
|
|
7758
|
+
"eventName": "@height.changed." + event.data.objectName
|
|
7759
|
+
},
|
|
7760
|
+
"data": {
|
|
7761
|
+
"timeOut": 1000
|
|
7762
|
+
}
|
|
7763
|
+
});
|
|
7728
7764
|
// 手机端在显示搜索栏时隐藏crud上的刷新按钮,因为点击后crud高度显示有问题
|
|
7729
7765
|
let crudService = scope.getComponentById("service_listview_" + event.data.objectName);
|
|
7730
7766
|
crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
@@ -8088,12 +8124,16 @@ async function getObjectFilter(objectSchema, fields, options) {
|
|
|
8088
8124
|
return;
|
|
8089
8125
|
}
|
|
8090
8126
|
// 列表搜索栏字段值变更后立刻触发提交表单执行crud搜索,所以这里需要额外重算crud高度及筛选按钮红色星号图标显示隐藏
|
|
8091
|
-
|
|
8092
|
-
|
|
8093
|
-
|
|
8094
|
-
|
|
8095
|
-
|
|
8096
|
-
|
|
8127
|
+
//触发amis crud 高度重算
|
|
8128
|
+
doAction({
|
|
8129
|
+
"actionType": "broadcast",
|
|
8130
|
+
"args": {
|
|
8131
|
+
"eventName": "@height.changed.${objectSchema.name}"
|
|
8132
|
+
},
|
|
8133
|
+
"data": {
|
|
8134
|
+
"timeOut": 1000
|
|
8135
|
+
}
|
|
8136
|
+
});
|
|
8097
8137
|
resizeWindow();
|
|
8098
8138
|
const scope = event.context.scoped;
|
|
8099
8139
|
// let filterFormValues = event.data;
|
|
@@ -8442,7 +8482,24 @@ async function getObjectCRUD(objectSchema, fields, options){
|
|
|
8442
8482
|
id: `service_${id}`,
|
|
8443
8483
|
name: `page`,
|
|
8444
8484
|
data: options.amisData,
|
|
8445
|
-
body: body
|
|
8485
|
+
body: body,
|
|
8486
|
+
//监听广播事件,重算crud高度
|
|
8487
|
+
onEvent: {
|
|
8488
|
+
[`@height.changed.${objectSchema.name}`]: {
|
|
8489
|
+
"actions": [
|
|
8490
|
+
{
|
|
8491
|
+
"actionType": "custom",
|
|
8492
|
+
"script": `
|
|
8493
|
+
var crudScoped = event.context.scoped.getComponentById('${body.id}');
|
|
8494
|
+
var timeOut = event.data.timeOut || 500;
|
|
8495
|
+
setTimeout(()=>{
|
|
8496
|
+
crudScoped && crudScoped.control.updateAutoFillHeight();
|
|
8497
|
+
}, timeOut);
|
|
8498
|
+
`
|
|
8499
|
+
}
|
|
8500
|
+
]
|
|
8501
|
+
}
|
|
8502
|
+
}
|
|
8446
8503
|
}
|
|
8447
8504
|
}
|
|
8448
8505
|
|
|
@@ -11183,18 +11240,28 @@ async function lookupToAmis(field, readonly, ctx){
|
|
|
11183
11240
|
enableEnhancedLookup = true;
|
|
11184
11241
|
}
|
|
11185
11242
|
}
|
|
11243
|
+
let amisSchema;
|
|
11186
11244
|
// 默认使用下拉框模式显示lookup选项,只能配置了enable_enhanced_lookup才使用弹出增强模式
|
|
11187
11245
|
if(enableEnhancedLookup == true){
|
|
11188
|
-
|
|
11246
|
+
amisSchema = await lookupToAmisPicker(field, readonly, ctx);
|
|
11189
11247
|
}else if(refObject.enable_tree) {
|
|
11190
|
-
|
|
11248
|
+
amisSchema = await lookupToAmisTreeSelect(field, readonly, Object.assign({}, ctx, {
|
|
11191
11249
|
labelField: referenceTo.labelField?.name || 'name',
|
|
11192
11250
|
valueField: referenceTo.valueField?.name || '_id',
|
|
11193
11251
|
objectName: referenceTo.objectName
|
|
11194
11252
|
}));
|
|
11195
11253
|
}else {
|
|
11196
|
-
|
|
11254
|
+
amisSchema = await lookupToAmisSelect(field, readonly, ctx);
|
|
11197
11255
|
}
|
|
11256
|
+
let refLookupPage = refObject.pages && refObject.pages.lookup;
|
|
11257
|
+
if(refLookupPage){
|
|
11258
|
+
if(typeof refLookupPage == 'string'){
|
|
11259
|
+
refLookupPage = JSON.parse(refLookupPage);
|
|
11260
|
+
}
|
|
11261
|
+
// Object.assign(amisSchema, refLookupPage);
|
|
11262
|
+
// amisSchema = _.defaultsDeep({}, refLookupPage, amisSchema);
|
|
11263
|
+
}
|
|
11264
|
+
return amisSchema;
|
|
11198
11265
|
}
|
|
11199
11266
|
|
|
11200
11267
|
async function lookupToAmisSelectUser(field, readonly, ctx){
|