@steedos-widgets/amis-lib 6.10.1 → 6.10.2-beta.2
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 +53 -14
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +53 -14
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +21 -21
- package/dist/index.umd.js.map +1 -1
- package/dist/types/workflow/approve.d.ts +2 -66
- package/dist/types/workflow/flow.d.ts +3 -78
- package/package.json +2 -2
package/dist/index.cjs.js
CHANGED
|
@@ -2321,9 +2321,13 @@ var sfield_control_create_allowance$1 = "Allow Creation in Popup";
|
|
|
2321
2321
|
var sfield_control_depend_on$1 = "Dependency Fields";
|
|
2322
2322
|
var sfield_control_depend_on_remark$1 = "Changes in dependent fields trigger recalculation of the current field";
|
|
2323
2323
|
var sfield_control_enable_thousands$1 = "Show Thousands Separator";
|
|
2324
|
+
var sfield_control_filters$1 = "Lookup Relationship Filters Condition";
|
|
2325
|
+
var sfield_control_filters_remark$1 = "When the field type is Lookup Relationship or Master Detail Relationship, filtering conditions can be configured for the field, filtering option list; The field values can be configured as formulas, and the fields referenced in the formulas need to be configured in Dependent Fields at the same time";
|
|
2324
2326
|
var sfield_control_create_unique_index$1 = "Create Unique Index";
|
|
2325
2327
|
var sfield_control_create_unique_index_remark$1 = "Performed once every day at midnight; existing indexes are not recreated.";
|
|
2328
|
+
var sfield_control_filterable$1 = "Enable quick search on the list page";
|
|
2326
2329
|
var sfield_control_default_filter_field$1 = "Default Filter Field";
|
|
2330
|
+
var sfield_control_sortable$1 = "Sortable";
|
|
2327
2331
|
var sfield_control_create_index$1 = "Create Index";
|
|
2328
2332
|
var sfield_control_create_index_remark$1 = "Performed once every day at midnight; existing indexes are not recreated.";
|
|
2329
2333
|
var sfield_control_name_field$1 = "Name Field";
|
|
@@ -2489,9 +2493,13 @@ var widget_ed = {
|
|
|
2489
2493
|
sfield_control_depend_on: sfield_control_depend_on$1,
|
|
2490
2494
|
sfield_control_depend_on_remark: sfield_control_depend_on_remark$1,
|
|
2491
2495
|
sfield_control_enable_thousands: sfield_control_enable_thousands$1,
|
|
2496
|
+
sfield_control_filters: sfield_control_filters$1,
|
|
2497
|
+
sfield_control_filters_remark: sfield_control_filters_remark$1,
|
|
2492
2498
|
sfield_control_create_unique_index: sfield_control_create_unique_index$1,
|
|
2493
2499
|
sfield_control_create_unique_index_remark: sfield_control_create_unique_index_remark$1,
|
|
2500
|
+
sfield_control_filterable: sfield_control_filterable$1,
|
|
2494
2501
|
sfield_control_default_filter_field: sfield_control_default_filter_field$1,
|
|
2502
|
+
sfield_control_sortable: sfield_control_sortable$1,
|
|
2495
2503
|
sfield_control_create_index: sfield_control_create_index$1,
|
|
2496
2504
|
sfield_control_create_index_remark: sfield_control_create_index_remark$1,
|
|
2497
2505
|
sfield_control_name_field: sfield_control_name_field$1,
|
|
@@ -3097,9 +3105,13 @@ var sfield_control_create_allowance = "弹出选择时允许新建";
|
|
|
3097
3105
|
var sfield_control_depend_on = "依赖字段";
|
|
3098
3106
|
var sfield_control_depend_on_remark = "依赖字段的变化会触发当前字段重算";
|
|
3099
3107
|
var sfield_control_enable_thousands = "显示千分符";
|
|
3108
|
+
var sfield_control_filters = "相关表过滤条件";
|
|
3109
|
+
var sfield_control_filters_remark = "当字段类型为相关表关系或主/子表关系时,可以为该字段配置过滤条件,过滤选项列表;其中字段值可以配置为公式,公式中引用的字段需要同时配置在依赖的字段中";
|
|
3100
3110
|
var sfield_control_create_unique_index = "创建唯一索引";
|
|
3101
3111
|
var sfield_control_create_unique_index_remark = "默认每天凌晨执行一次创建,已有的索引不重复创建。";
|
|
3112
|
+
var sfield_control_filterable = "启用列表页快速搜索";
|
|
3102
3113
|
var sfield_control_default_filter_field = "列表页过滤器默认字段";
|
|
3114
|
+
var sfield_control_sortable = "可排序";
|
|
3103
3115
|
var sfield_control_create_index = "创建索引";
|
|
3104
3116
|
var sfield_control_create_index_remark = "默认每天凌晨执行一次创建,已有的索引不重复创建。";
|
|
3105
3117
|
var sfield_control_name_field = "名称字段";
|
|
@@ -3265,9 +3277,13 @@ var widget_zh = {
|
|
|
3265
3277
|
sfield_control_depend_on: sfield_control_depend_on,
|
|
3266
3278
|
sfield_control_depend_on_remark: sfield_control_depend_on_remark,
|
|
3267
3279
|
sfield_control_enable_thousands: sfield_control_enable_thousands,
|
|
3280
|
+
sfield_control_filters: sfield_control_filters,
|
|
3281
|
+
sfield_control_filters_remark: sfield_control_filters_remark,
|
|
3268
3282
|
sfield_control_create_unique_index: sfield_control_create_unique_index,
|
|
3269
3283
|
sfield_control_create_unique_index_remark: sfield_control_create_unique_index_remark,
|
|
3284
|
+
sfield_control_filterable: sfield_control_filterable,
|
|
3270
3285
|
sfield_control_default_filter_field: sfield_control_default_filter_field,
|
|
3286
|
+
sfield_control_sortable: sfield_control_sortable,
|
|
3271
3287
|
sfield_control_create_index: sfield_control_create_index,
|
|
3272
3288
|
sfield_control_create_index_remark: sfield_control_create_index_remark,
|
|
3273
3289
|
sfield_control_name_field: sfield_control_name_field,
|
|
@@ -5065,12 +5081,15 @@ async function getTableApi(mainObject, fields, options){
|
|
|
5065
5081
|
let selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
5066
5082
|
// 保留一份初始data,以供自定义发送适配器中获取原始数据。
|
|
5067
5083
|
const data = _.cloneDeep(api.data);
|
|
5084
|
+
let needToStoreListViewProps;
|
|
5068
5085
|
try{
|
|
5069
5086
|
// TODO: 不应该直接在这里取localStorage,应该从外面传入
|
|
5070
5087
|
const listName = api.data.listName;
|
|
5088
|
+
// 只有在列表页面中才需要存储和读取本地存储中的参数,相关子表组件不需要
|
|
5089
|
+
needToStoreListViewProps = !!listName && !api.body.$self._isRelated;
|
|
5071
5090
|
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
5072
5091
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
5073
|
-
if(localListViewProps){
|
|
5092
|
+
if(needToStoreListViewProps && localListViewProps){
|
|
5074
5093
|
localListViewProps = JSON.parse(localListViewProps);
|
|
5075
5094
|
selfData = Object.assign({}, localListViewProps, selfData);
|
|
5076
5095
|
if(!api.data.filter){
|
|
@@ -5212,7 +5231,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
5212
5231
|
|
|
5213
5232
|
//写入本次存储filters、sort
|
|
5214
5233
|
const listViewPropsStoreKey = location.pathname + "/crud/query";
|
|
5215
|
-
sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify({
|
|
5234
|
+
needToStoreListViewProps && sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify({
|
|
5216
5235
|
filters: filters,
|
|
5217
5236
|
sort: sort.trim(),
|
|
5218
5237
|
pageSize: pageSize,
|
|
@@ -5319,9 +5338,12 @@ async function getTableApi(mainObject, fields, options){
|
|
|
5319
5338
|
}
|
|
5320
5339
|
|
|
5321
5340
|
|
|
5341
|
+
let needToStoreListViewProps;
|
|
5322
5342
|
try{
|
|
5323
5343
|
// TODO: 不应该直接在这里取localStorage,应该从外面传入
|
|
5324
5344
|
const listName = api.body.listName;
|
|
5345
|
+
// 只有在列表页面中才需要存储和读取本地存储中的参数,相关子表组件不需要
|
|
5346
|
+
needToStoreListViewProps = !!listName && !api.body.$self._isRelated;
|
|
5325
5347
|
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
5326
5348
|
/**
|
|
5327
5349
|
* localListViewProps规范来自crud请求api中api.data.$self参数值的。
|
|
@@ -5333,7 +5355,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
5333
5355
|
* orderBy:排序字段
|
|
5334
5356
|
* orderDir:排序方向
|
|
5335
5357
|
*/
|
|
5336
|
-
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
5358
|
+
let localListViewProps = needToStoreListViewProps && sessionStorage.getItem(listViewPropsStoreKey);
|
|
5337
5359
|
let selfData = JSON.parse(JSON.stringify(api.body.$self));
|
|
5338
5360
|
if(localListViewProps){
|
|
5339
5361
|
localListViewProps = JSON.parse(localListViewProps);
|
|
@@ -5351,7 +5373,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
5351
5373
|
|
|
5352
5374
|
delete selfData.context;
|
|
5353
5375
|
delete selfData.global;
|
|
5354
|
-
sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify(selfData));
|
|
5376
|
+
needToStoreListViewProps && sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify(selfData));
|
|
5355
5377
|
// 返回页码到UI界面
|
|
5356
5378
|
payload.data.page= selfData.page;
|
|
5357
5379
|
}
|
|
@@ -15656,6 +15678,7 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
15656
15678
|
format: 'YYYY-MM-DDTHH:mm:00.000Z',
|
|
15657
15679
|
tpl: readonly ? getDateTimeTpl(field) : null,
|
|
15658
15680
|
utc: true,
|
|
15681
|
+
closeOnSelect: false
|
|
15659
15682
|
};
|
|
15660
15683
|
break;
|
|
15661
15684
|
case 'input-time-range':
|
|
@@ -18925,7 +18948,7 @@ const getNextStepUsersInput = async (instance) => {
|
|
|
18925
18948
|
},
|
|
18926
18949
|
{
|
|
18927
18950
|
type: "list-select",
|
|
18928
|
-
label: "
|
|
18951
|
+
label: "",
|
|
18929
18952
|
name: "next_users",
|
|
18930
18953
|
id: "u:next_users",
|
|
18931
18954
|
required: true,
|
|
@@ -18969,7 +18992,7 @@ const getNextStepUsersInput = async (instance) => {
|
|
|
18969
18992
|
},
|
|
18970
18993
|
{
|
|
18971
18994
|
type: "list-select",
|
|
18972
|
-
label: "
|
|
18995
|
+
label: "",
|
|
18973
18996
|
name: "next_users",
|
|
18974
18997
|
id: "u:next_users",
|
|
18975
18998
|
required: true,
|
|
@@ -19132,7 +19155,7 @@ const getPostEngineRequestAdaptor = async (instance) => {
|
|
|
19132
19155
|
* @param instance
|
|
19133
19156
|
* @returns
|
|
19134
19157
|
*/
|
|
19135
|
-
const getSubmitActions = async (instance) => {
|
|
19158
|
+
const getSubmitActions = async (instance, submitEvents) => {
|
|
19136
19159
|
let api = "";
|
|
19137
19160
|
let requestAdaptor = "";
|
|
19138
19161
|
if(instance.approve?.type == "cc"){
|
|
@@ -19211,6 +19234,7 @@ const getSubmitActions = async (instance) => {
|
|
|
19211
19234
|
`,
|
|
19212
19235
|
expression: "${event.data.instanceFormValidate}"
|
|
19213
19236
|
},
|
|
19237
|
+
...submitEvents,
|
|
19214
19238
|
{
|
|
19215
19239
|
componentId: "",
|
|
19216
19240
|
args: {
|
|
@@ -19250,7 +19274,7 @@ const getSubmitActions = async (instance) => {
|
|
|
19250
19274
|
];
|
|
19251
19275
|
};
|
|
19252
19276
|
|
|
19253
|
-
const getApprovalDrawerSchema = async (instance) => {
|
|
19277
|
+
const getApprovalDrawerSchema = async (instance, submitEvents) => {
|
|
19254
19278
|
return {
|
|
19255
19279
|
type: "drawer",
|
|
19256
19280
|
overlay: false,
|
|
@@ -19343,7 +19367,7 @@ const getApprovalDrawerSchema = async (instance) => {
|
|
|
19343
19367
|
label: "${'Submit' | t}",
|
|
19344
19368
|
onEvent: {
|
|
19345
19369
|
click: {
|
|
19346
|
-
actions: await getSubmitActions(instance),
|
|
19370
|
+
actions: await getSubmitActions(instance, submitEvents),
|
|
19347
19371
|
},
|
|
19348
19372
|
},
|
|
19349
19373
|
id: "u:f6f8c3933f6c",
|
|
@@ -20420,7 +20444,7 @@ const getApplicantTableView = async (instance) => {
|
|
|
20420
20444
|
};
|
|
20421
20445
|
};
|
|
20422
20446
|
|
|
20423
|
-
const getApproveButton = async (instance)=>{
|
|
20447
|
+
const getApproveButton = async (instance, submitEvents)=>{
|
|
20424
20448
|
if(!instance.approve || ( instance.box != 'inbox' && instance.box != 'draft')){
|
|
20425
20449
|
return null;
|
|
20426
20450
|
}
|
|
@@ -20434,7 +20458,7 @@ const getApproveButton = async (instance)=>{
|
|
|
20434
20458
|
componentId: "",
|
|
20435
20459
|
args: {},
|
|
20436
20460
|
actionType: "drawer",
|
|
20437
|
-
drawer: await getApprovalDrawerSchema(instance),
|
|
20461
|
+
drawer: await getApprovalDrawerSchema(instance, submitEvents),
|
|
20438
20462
|
},
|
|
20439
20463
|
],
|
|
20440
20464
|
},
|
|
@@ -20456,6 +20480,19 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
20456
20480
|
formContentSchema = await getFormTableView(instance);
|
|
20457
20481
|
}
|
|
20458
20482
|
|
|
20483
|
+
const amisSchemaStr = instance.formVersion?.amis_schema;
|
|
20484
|
+
|
|
20485
|
+
let initedEvents = [];
|
|
20486
|
+
let changeEvents = [];
|
|
20487
|
+
let submitEvents = [];
|
|
20488
|
+
|
|
20489
|
+
if(amisSchemaStr){
|
|
20490
|
+
const onEvent = JSON.parse(instance.formVersion.amis_schema).onEvent;
|
|
20491
|
+
initedEvents = onEvent.inited.actions || [];
|
|
20492
|
+
changeEvents = onEvent.change.actions || [];
|
|
20493
|
+
submitEvents = onEvent.submit.actions || [];
|
|
20494
|
+
}
|
|
20495
|
+
|
|
20459
20496
|
console.log('getFlowFormSchema formContentSchema', formContentSchema);
|
|
20460
20497
|
return {
|
|
20461
20498
|
type: "page",
|
|
@@ -20561,13 +20598,14 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
20561
20598
|
"componentId": "u:next_step",
|
|
20562
20599
|
"args": {
|
|
20563
20600
|
}
|
|
20564
|
-
}
|
|
20601
|
+
},
|
|
20602
|
+
...changeEvents
|
|
20565
20603
|
]
|
|
20566
20604
|
}
|
|
20567
20605
|
}
|
|
20568
20606
|
},
|
|
20569
20607
|
await getInstanceApprovalHistory(),
|
|
20570
|
-
await getApproveButton(instance)
|
|
20608
|
+
await getApproveButton(instance, submitEvents)
|
|
20571
20609
|
],
|
|
20572
20610
|
id: "u:63849ea39e12",
|
|
20573
20611
|
messages: {},
|
|
@@ -20593,7 +20631,8 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
20593
20631
|
"value": "${event.data.context.approveValues}"
|
|
20594
20632
|
},
|
|
20595
20633
|
"expression": "${event.data.context.form.current.style === 'wizard'}"// 表单为 wizard 样式时需要初始同步表单数据,否则直接点击暂存按钮会清空数据
|
|
20596
|
-
}
|
|
20634
|
+
},
|
|
20635
|
+
...initedEvents
|
|
20597
20636
|
]
|
|
20598
20637
|
},
|
|
20599
20638
|
// inited: {
|