@steedos-widgets/amis-lib 1.2.27 → 1.2.28
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 +84 -29
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +84 -29
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +84 -29
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/buttons.d.ts +3 -4
- package/dist/types/lib/converter/amis/fields/editor.d.ts +10 -8
- package/dist/types/lib/converter/amis/header.d.ts +18 -8
- package/dist/types/lib/converter/amis/index.d.ts +1 -0
- package/dist/types/lib/objects.d.ts +2 -2
- package/dist/types/lib/page_init.d.ts +1 -0
- package/dist/types/schema/standard_edit.amis.d.ts +9 -0
- package/dist/types/schema/standard_import_data.amis.d.ts +3 -0
- package/dist/types/schema/standard_new.amis.d.ts +9 -0
- package/dist/types/standard/button.d.ts +21 -0
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -1755,8 +1755,8 @@
|
|
|
1755
1755
|
/*
|
|
1756
1756
|
* @Author: baozhoutao@steedos.com
|
|
1757
1757
|
* @Date: 2022-11-01 15:51:00
|
|
1758
|
-
* @LastEditors:
|
|
1759
|
-
* @LastEditTime: 2023-06-
|
|
1758
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
1759
|
+
* @LastEditTime: 2023-06-28 23:19:41
|
|
1760
1760
|
* @Description:
|
|
1761
1761
|
*/
|
|
1762
1762
|
|
|
@@ -1807,6 +1807,16 @@
|
|
|
1807
1807
|
return {
|
|
1808
1808
|
data: formSchema
|
|
1809
1809
|
};
|
|
1810
|
+
`;
|
|
1811
|
+
const onDialogCancelScript = `
|
|
1812
|
+
// 这里加setTimeout是因为amis的Bug,它会先触发cancel事件执行此脚本关闭父窗口然后再关闭子窗口
|
|
1813
|
+
// 正确的顺序应该是先关闭子窗口再关闭父窗口,顺序错了会造成第二次点击新建按钮的时候异常
|
|
1814
|
+
setTimeout(function(){
|
|
1815
|
+
doAction({
|
|
1816
|
+
"actionType": "cancel",
|
|
1817
|
+
"componentId": "object_actions_drawer_${uiSchema.name}"
|
|
1818
|
+
});
|
|
1819
|
+
}, 200);
|
|
1810
1820
|
`;
|
|
1811
1821
|
return {
|
|
1812
1822
|
"type": "service",
|
|
@@ -1868,6 +1878,17 @@
|
|
|
1868
1878
|
"closeOnEsc": false,
|
|
1869
1879
|
"closeOnOutside": false,
|
|
1870
1880
|
"size": "lg",
|
|
1881
|
+
"onEvent": {
|
|
1882
|
+
"cancel": {
|
|
1883
|
+
"actions": [
|
|
1884
|
+
{
|
|
1885
|
+
"actionType": "custom",
|
|
1886
|
+
"script": onDialogCancelScript,
|
|
1887
|
+
"expression": "${window:innerWidth < 768}",
|
|
1888
|
+
}
|
|
1889
|
+
]
|
|
1890
|
+
}
|
|
1891
|
+
},
|
|
1871
1892
|
"actions": [
|
|
1872
1893
|
{
|
|
1873
1894
|
type: 'button',
|
|
@@ -1930,7 +1951,7 @@
|
|
|
1930
1951
|
* @Author: baozhoutao@steedos.com
|
|
1931
1952
|
* @Date: 2022-11-01 15:49:58
|
|
1932
1953
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
1933
|
-
* @LastEditTime: 2023-
|
|
1954
|
+
* @LastEditTime: 2023-06-28 23:22:31
|
|
1934
1955
|
* @Description:
|
|
1935
1956
|
*/
|
|
1936
1957
|
|
|
@@ -1959,6 +1980,17 @@
|
|
|
1959
1980
|
? JSON.parse(page.schema)
|
|
1960
1981
|
: page.schema;
|
|
1961
1982
|
}
|
|
1983
|
+
|
|
1984
|
+
const onDialogCancelScript = `
|
|
1985
|
+
// 这里加setTimeout是因为amis的Bug,它会先触发cancel事件执行此脚本关闭父窗口然后再关闭子窗口
|
|
1986
|
+
// 正确的顺序应该是先关闭子窗口再关闭父窗口,顺序错了会造成第二次点击编辑按钮的时候异常
|
|
1987
|
+
setTimeout(function(){
|
|
1988
|
+
doAction({
|
|
1989
|
+
"actionType": "cancel",
|
|
1990
|
+
"componentId": "object_actions_drawer_${uiSchema.name}"
|
|
1991
|
+
});
|
|
1992
|
+
}, 200);
|
|
1993
|
+
`;
|
|
1962
1994
|
|
|
1963
1995
|
return {
|
|
1964
1996
|
type: "service",
|
|
@@ -1982,6 +2014,17 @@
|
|
|
1982
2014
|
closeOnOutside: false,
|
|
1983
2015
|
showCloseButton: true,
|
|
1984
2016
|
size: "lg",
|
|
2017
|
+
"onEvent": {
|
|
2018
|
+
"cancel": {
|
|
2019
|
+
"actions": [
|
|
2020
|
+
{
|
|
2021
|
+
"actionType": "custom",
|
|
2022
|
+
"script": onDialogCancelScript,
|
|
2023
|
+
"expression": "${window:innerWidth < 768}",
|
|
2024
|
+
}
|
|
2025
|
+
]
|
|
2026
|
+
}
|
|
2027
|
+
},
|
|
1985
2028
|
},
|
|
1986
2029
|
},
|
|
1987
2030
|
],
|
|
@@ -2278,6 +2321,7 @@
|
|
|
2278
2321
|
label: i18next__default["default"].t('frontend_import_data_file'),
|
|
2279
2322
|
required: true,
|
|
2280
2323
|
type: "input-file",
|
|
2324
|
+
accept: ".xlsx,.xls",
|
|
2281
2325
|
className: "m-1",
|
|
2282
2326
|
labelClassName: "text-left",
|
|
2283
2327
|
clearValueOnHidden: true,
|
|
@@ -2942,6 +2986,7 @@
|
|
|
2942
2986
|
"drawer": {
|
|
2943
2987
|
"type": "drawer",
|
|
2944
2988
|
"title": "操作",
|
|
2989
|
+
"id": "object_actions_drawer_" + objectSchema.name,
|
|
2945
2990
|
"body": [
|
|
2946
2991
|
{
|
|
2947
2992
|
"type": "button-group",
|
|
@@ -2964,7 +3009,6 @@
|
|
|
2964
3009
|
"size": "lg"
|
|
2965
3010
|
}
|
|
2966
3011
|
],
|
|
2967
|
-
"id": "u:9815f7366b9f",
|
|
2968
3012
|
"position": "bottom",
|
|
2969
3013
|
"closeOnOutside": true,
|
|
2970
3014
|
"resizable": false,
|
|
@@ -2975,8 +3019,7 @@
|
|
|
2975
3019
|
}
|
|
2976
3020
|
]
|
|
2977
3021
|
}
|
|
2978
|
-
}
|
|
2979
|
-
"id": "u:ee7c7929e6ae"
|
|
3022
|
+
}
|
|
2980
3023
|
}
|
|
2981
3024
|
}else {
|
|
2982
3025
|
if(moreButtons.length > 0){
|
|
@@ -3008,6 +3051,7 @@
|
|
|
3008
3051
|
"drawer": {
|
|
3009
3052
|
"type": "drawer",
|
|
3010
3053
|
"title": "操作",
|
|
3054
|
+
"id": "object_actions_drawer_" + objectSchema.name,
|
|
3011
3055
|
"body": [
|
|
3012
3056
|
{
|
|
3013
3057
|
"type": "button-group",
|
|
@@ -3031,7 +3075,6 @@
|
|
|
3031
3075
|
"size": "lg"
|
|
3032
3076
|
}
|
|
3033
3077
|
],
|
|
3034
|
-
"id": "u:9815f7366b9f",
|
|
3035
3078
|
"position": "bottom",
|
|
3036
3079
|
"closeOnOutside": true,
|
|
3037
3080
|
"resizable": false,
|
|
@@ -3042,8 +3085,7 @@
|
|
|
3042
3085
|
}
|
|
3043
3086
|
]
|
|
3044
3087
|
}
|
|
3045
|
-
}
|
|
3046
|
-
"id": "u:ee7c7929e6ae"
|
|
3088
|
+
}
|
|
3047
3089
|
}
|
|
3048
3090
|
}else {
|
|
3049
3091
|
return ___default["default"].map(buttons, (button) => {
|
|
@@ -3072,6 +3114,7 @@
|
|
|
3072
3114
|
"drawer": {
|
|
3073
3115
|
"type": "drawer",
|
|
3074
3116
|
"title": "操作",
|
|
3117
|
+
"id": "object_actions_drawer_" + objectSchema.name,
|
|
3075
3118
|
"body": [
|
|
3076
3119
|
{
|
|
3077
3120
|
"type": "button-group",
|
|
@@ -5648,6 +5691,8 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5648
5691
|
const fieldsArr = [];
|
|
5649
5692
|
|
|
5650
5693
|
const listName = "all";
|
|
5694
|
+
|
|
5695
|
+
const isMobile = window.innerWidth < 768;
|
|
5651
5696
|
|
|
5652
5697
|
const listView = ___namespace.find(
|
|
5653
5698
|
refObjectConfig.list_views,
|
|
@@ -5724,6 +5769,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5724
5769
|
|
|
5725
5770
|
source.data.$term = "$term";
|
|
5726
5771
|
source.data.$self = "$$";
|
|
5772
|
+
|
|
5727
5773
|
|
|
5728
5774
|
source.requestAdaptor = `
|
|
5729
5775
|
const selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
@@ -5759,6 +5805,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5759
5805
|
}
|
|
5760
5806
|
}
|
|
5761
5807
|
|
|
5808
|
+
|
|
5762
5809
|
if(allowSearchFields){
|
|
5763
5810
|
allowSearchFields.forEach(function(key){
|
|
5764
5811
|
const keyValue = selfData[key];
|
|
@@ -5874,7 +5921,6 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5874
5921
|
pickerSchema.affixHeader = false;
|
|
5875
5922
|
|
|
5876
5923
|
var headerToolbarItems = [];
|
|
5877
|
-
const isMobile = window.innerWidth < 768;
|
|
5878
5924
|
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user" && !isMobile){
|
|
5879
5925
|
headerToolbarItems = getLookupSapceUserTreeSchema();
|
|
5880
5926
|
pickerSchema["style"] = {
|
|
@@ -5955,7 +6001,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
5955
6001
|
}
|
|
5956
6002
|
|
|
5957
6003
|
const ctx = ${JSON.stringify(ctx)};
|
|
5958
|
-
const componentId = ctx.defaults.formSchema.id
|
|
6004
|
+
const componentId = ctx.defaults.formSchema.id;
|
|
5959
6005
|
doAction({
|
|
5960
6006
|
actionType: 'setValue',
|
|
5961
6007
|
componentId: componentId,
|
|
@@ -6209,6 +6255,11 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
6209
6255
|
// ids人员点选模式
|
|
6210
6256
|
return await lookupToAmisIdsPicker(field, readonly, ctx);
|
|
6211
6257
|
}
|
|
6258
|
+
if(!field.filters || field.filters.length == 0){
|
|
6259
|
+
field.filters = [["user_accepted", "=", true]];
|
|
6260
|
+
}else {
|
|
6261
|
+
field.filters = [ ["user_accepted", "=", true], "and", field.filters ];
|
|
6262
|
+
}
|
|
6212
6263
|
// 左侧树右侧人员列表的下拉框模式,不再支持,而是执行下面的lookupToAmisPicker函数弹出选人窗口
|
|
6213
6264
|
// return await lookupToAmisSelectUser(field, readonly, ctx);
|
|
6214
6265
|
}
|
|
@@ -6349,7 +6400,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
6349
6400
|
* @Author: baozhoutao@steedos.com
|
|
6350
6401
|
* @Date: 2023-01-13 17:27:54
|
|
6351
6402
|
* @LastEditors: liaodaxue
|
|
6352
|
-
* @LastEditTime: 2023-06-
|
|
6403
|
+
* @LastEditTime: 2023-06-30 10:29:52
|
|
6353
6404
|
* @Description:
|
|
6354
6405
|
*/
|
|
6355
6406
|
|
|
@@ -6357,12 +6408,16 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
6357
6408
|
const getMarkdownFieldSchema = (field, readonly, ctx)=>{
|
|
6358
6409
|
if(readonly){
|
|
6359
6410
|
return {
|
|
6360
|
-
"type": "
|
|
6361
|
-
"
|
|
6362
|
-
"
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6411
|
+
"type": "control",
|
|
6412
|
+
"label": field.label,
|
|
6413
|
+
"body": {
|
|
6414
|
+
"type": "markdown",
|
|
6415
|
+
"name": field.name,
|
|
6416
|
+
"options": {
|
|
6417
|
+
"linkify": true,
|
|
6418
|
+
"html": true,
|
|
6419
|
+
"breaks": true
|
|
6420
|
+
}
|
|
6366
6421
|
}
|
|
6367
6422
|
}
|
|
6368
6423
|
}else {
|
|
@@ -7443,6 +7498,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
7443
7498
|
async function getTableColumns(fields, options){
|
|
7444
7499
|
const columns = [{name: '_index',type: 'text', width: 32, placeholder: ""}];
|
|
7445
7500
|
const allowEdit = options.permissions?.allowEdit && options.permissions?.modifyAllRecords && !options.isLookup && options.enable_inline_edit != false;
|
|
7501
|
+
const defaultWidth = "unset";//用于使table内的td标签下生成div,实现将快速编辑按钮固定在右侧的效果,并不是为了unset效果
|
|
7446
7502
|
for (const field of fields) {
|
|
7447
7503
|
//增加quickEdit属性,实现快速编辑
|
|
7448
7504
|
const quickEditSchema = allowEdit ? await getQuickEditSchema(field, options) : allowEdit;
|
|
@@ -7499,7 +7555,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
7499
7555
|
type: "switch",
|
|
7500
7556
|
name: field.name,
|
|
7501
7557
|
label: field.label,
|
|
7502
|
-
width: field.width,
|
|
7558
|
+
width: field.width || defaultWidth,
|
|
7503
7559
|
toggled: field.toggled,
|
|
7504
7560
|
quickEdit: quickEditSchema,
|
|
7505
7561
|
className:"whitespace-nowrap",
|
|
@@ -7514,7 +7570,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
7514
7570
|
label: field.label,
|
|
7515
7571
|
map: map,
|
|
7516
7572
|
sortable: field.sortable,
|
|
7517
|
-
width: field.width,
|
|
7573
|
+
width: field.width || defaultWidth,
|
|
7518
7574
|
toggled: field.toggled,
|
|
7519
7575
|
className:"whitespace-nowrap",
|
|
7520
7576
|
quickEdit: quickEditSchema
|
|
@@ -7543,7 +7599,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
7543
7599
|
label: field.label,
|
|
7544
7600
|
sortable: field.sortable,
|
|
7545
7601
|
// searchable: field.searchable,
|
|
7546
|
-
width: field.width,
|
|
7602
|
+
width: field.width || defaultWidth,
|
|
7547
7603
|
type: type,
|
|
7548
7604
|
tpl: tpl,
|
|
7549
7605
|
toggled: field.toggled,
|
|
@@ -9095,8 +9151,8 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
9095
9151
|
/*
|
|
9096
9152
|
* @Author: baozhoutao@steedos.com
|
|
9097
9153
|
* @Date: 2022-05-26 16:02:08
|
|
9098
|
-
* @LastEditors:
|
|
9099
|
-
* @LastEditTime: 2023-06-
|
|
9154
|
+
* @LastEditors: liaodaxue
|
|
9155
|
+
* @LastEditTime: 2023-06-29 17:27:19
|
|
9100
9156
|
* @Description:
|
|
9101
9157
|
*/
|
|
9102
9158
|
|
|
@@ -9190,7 +9246,7 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
9190
9246
|
const section = await getSection(formFields, permissionFields, fieldSchemaArray, key, ctx);
|
|
9191
9247
|
if (section.body.length > 0) {
|
|
9192
9248
|
if (section.visibleOn) {
|
|
9193
|
-
sectionVisibleOns.push(section.visibleOn);
|
|
9249
|
+
sectionVisibleOns.push("("+section.visibleOn+")");
|
|
9194
9250
|
}
|
|
9195
9251
|
else {
|
|
9196
9252
|
sectionVisibleOns.push("true");
|
|
@@ -9528,8 +9584,12 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
9528
9584
|
if(___default["default"].has(formSchema, 'className')){
|
|
9529
9585
|
formSchema.className = 'steedos-amis-form';
|
|
9530
9586
|
}
|
|
9587
|
+
if(!formSchema.id){
|
|
9588
|
+
formSchema.id = 'form_' + objectSchema.name;
|
|
9589
|
+
}
|
|
9531
9590
|
const amisSchema = {
|
|
9532
9591
|
type: 'service',
|
|
9592
|
+
id: `service_${formSchema.id}`,
|
|
9533
9593
|
className: 'p-0',
|
|
9534
9594
|
name: `page_edit_${recordId}`,
|
|
9535
9595
|
api: await getEditFormInitApi(objectSchema, recordId, fields, ctx),
|
|
@@ -9600,11 +9660,6 @@ crudService && crudService.setData({showFieldsFilter: toShowFieldsFilter});
|
|
|
9600
9660
|
}
|
|
9601
9661
|
})]
|
|
9602
9662
|
};
|
|
9603
|
-
if(formSchema.id){
|
|
9604
|
-
amisSchema.id = `service-${formSchema.id}`;
|
|
9605
|
-
}else {
|
|
9606
|
-
amisSchema.id = `new-${objectSchema.name}`;
|
|
9607
|
-
}
|
|
9608
9663
|
return amisSchema;
|
|
9609
9664
|
}
|
|
9610
9665
|
|