@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.esm.js
CHANGED
|
@@ -2294,9 +2294,13 @@ var sfield_control_create_allowance$1 = "Allow Creation in Popup";
|
|
|
2294
2294
|
var sfield_control_depend_on$1 = "Dependency Fields";
|
|
2295
2295
|
var sfield_control_depend_on_remark$1 = "Changes in dependent fields trigger recalculation of the current field";
|
|
2296
2296
|
var sfield_control_enable_thousands$1 = "Show Thousands Separator";
|
|
2297
|
+
var sfield_control_filters$1 = "Lookup Relationship Filters Condition";
|
|
2298
|
+
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";
|
|
2297
2299
|
var sfield_control_create_unique_index$1 = "Create Unique Index";
|
|
2298
2300
|
var sfield_control_create_unique_index_remark$1 = "Performed once every day at midnight; existing indexes are not recreated.";
|
|
2301
|
+
var sfield_control_filterable$1 = "Enable quick search on the list page";
|
|
2299
2302
|
var sfield_control_default_filter_field$1 = "Default Filter Field";
|
|
2303
|
+
var sfield_control_sortable$1 = "Sortable";
|
|
2300
2304
|
var sfield_control_create_index$1 = "Create Index";
|
|
2301
2305
|
var sfield_control_create_index_remark$1 = "Performed once every day at midnight; existing indexes are not recreated.";
|
|
2302
2306
|
var sfield_control_name_field$1 = "Name Field";
|
|
@@ -2462,9 +2466,13 @@ var widget_ed = {
|
|
|
2462
2466
|
sfield_control_depend_on: sfield_control_depend_on$1,
|
|
2463
2467
|
sfield_control_depend_on_remark: sfield_control_depend_on_remark$1,
|
|
2464
2468
|
sfield_control_enable_thousands: sfield_control_enable_thousands$1,
|
|
2469
|
+
sfield_control_filters: sfield_control_filters$1,
|
|
2470
|
+
sfield_control_filters_remark: sfield_control_filters_remark$1,
|
|
2465
2471
|
sfield_control_create_unique_index: sfield_control_create_unique_index$1,
|
|
2466
2472
|
sfield_control_create_unique_index_remark: sfield_control_create_unique_index_remark$1,
|
|
2473
|
+
sfield_control_filterable: sfield_control_filterable$1,
|
|
2467
2474
|
sfield_control_default_filter_field: sfield_control_default_filter_field$1,
|
|
2475
|
+
sfield_control_sortable: sfield_control_sortable$1,
|
|
2468
2476
|
sfield_control_create_index: sfield_control_create_index$1,
|
|
2469
2477
|
sfield_control_create_index_remark: sfield_control_create_index_remark$1,
|
|
2470
2478
|
sfield_control_name_field: sfield_control_name_field$1,
|
|
@@ -3070,9 +3078,13 @@ var sfield_control_create_allowance = "弹出选择时允许新建";
|
|
|
3070
3078
|
var sfield_control_depend_on = "依赖字段";
|
|
3071
3079
|
var sfield_control_depend_on_remark = "依赖字段的变化会触发当前字段重算";
|
|
3072
3080
|
var sfield_control_enable_thousands = "显示千分符";
|
|
3081
|
+
var sfield_control_filters = "相关表过滤条件";
|
|
3082
|
+
var sfield_control_filters_remark = "当字段类型为相关表关系或主/子表关系时,可以为该字段配置过滤条件,过滤选项列表;其中字段值可以配置为公式,公式中引用的字段需要同时配置在依赖的字段中";
|
|
3073
3083
|
var sfield_control_create_unique_index = "创建唯一索引";
|
|
3074
3084
|
var sfield_control_create_unique_index_remark = "默认每天凌晨执行一次创建,已有的索引不重复创建。";
|
|
3085
|
+
var sfield_control_filterable = "启用列表页快速搜索";
|
|
3075
3086
|
var sfield_control_default_filter_field = "列表页过滤器默认字段";
|
|
3087
|
+
var sfield_control_sortable = "可排序";
|
|
3076
3088
|
var sfield_control_create_index = "创建索引";
|
|
3077
3089
|
var sfield_control_create_index_remark = "默认每天凌晨执行一次创建,已有的索引不重复创建。";
|
|
3078
3090
|
var sfield_control_name_field = "名称字段";
|
|
@@ -3238,9 +3250,13 @@ var widget_zh = {
|
|
|
3238
3250
|
sfield_control_depend_on: sfield_control_depend_on,
|
|
3239
3251
|
sfield_control_depend_on_remark: sfield_control_depend_on_remark,
|
|
3240
3252
|
sfield_control_enable_thousands: sfield_control_enable_thousands,
|
|
3253
|
+
sfield_control_filters: sfield_control_filters,
|
|
3254
|
+
sfield_control_filters_remark: sfield_control_filters_remark,
|
|
3241
3255
|
sfield_control_create_unique_index: sfield_control_create_unique_index,
|
|
3242
3256
|
sfield_control_create_unique_index_remark: sfield_control_create_unique_index_remark,
|
|
3257
|
+
sfield_control_filterable: sfield_control_filterable,
|
|
3243
3258
|
sfield_control_default_filter_field: sfield_control_default_filter_field,
|
|
3259
|
+
sfield_control_sortable: sfield_control_sortable,
|
|
3244
3260
|
sfield_control_create_index: sfield_control_create_index,
|
|
3245
3261
|
sfield_control_create_index_remark: sfield_control_create_index_remark,
|
|
3246
3262
|
sfield_control_name_field: sfield_control_name_field,
|
|
@@ -5038,12 +5054,15 @@ async function getTableApi(mainObject, fields, options){
|
|
|
5038
5054
|
let selfData = JSON.parse(JSON.stringify(api.data.$self));
|
|
5039
5055
|
// 保留一份初始data,以供自定义发送适配器中获取原始数据。
|
|
5040
5056
|
const data = _.cloneDeep(api.data);
|
|
5057
|
+
let needToStoreListViewProps;
|
|
5041
5058
|
try{
|
|
5042
5059
|
// TODO: 不应该直接在这里取localStorage,应该从外面传入
|
|
5043
5060
|
const listName = api.data.listName;
|
|
5061
|
+
// 只有在列表页面中才需要存储和读取本地存储中的参数,相关子表组件不需要
|
|
5062
|
+
needToStoreListViewProps = !!listName && !api.body.$self._isRelated;
|
|
5044
5063
|
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
5045
5064
|
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
5046
|
-
if(localListViewProps){
|
|
5065
|
+
if(needToStoreListViewProps && localListViewProps){
|
|
5047
5066
|
localListViewProps = JSON.parse(localListViewProps);
|
|
5048
5067
|
selfData = Object.assign({}, localListViewProps, selfData);
|
|
5049
5068
|
if(!api.data.filter){
|
|
@@ -5185,7 +5204,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
5185
5204
|
|
|
5186
5205
|
//写入本次存储filters、sort
|
|
5187
5206
|
const listViewPropsStoreKey = location.pathname + "/crud/query";
|
|
5188
|
-
sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify({
|
|
5207
|
+
needToStoreListViewProps && sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify({
|
|
5189
5208
|
filters: filters,
|
|
5190
5209
|
sort: sort.trim(),
|
|
5191
5210
|
pageSize: pageSize,
|
|
@@ -5292,9 +5311,12 @@ async function getTableApi(mainObject, fields, options){
|
|
|
5292
5311
|
}
|
|
5293
5312
|
|
|
5294
5313
|
|
|
5314
|
+
let needToStoreListViewProps;
|
|
5295
5315
|
try{
|
|
5296
5316
|
// TODO: 不应该直接在这里取localStorage,应该从外面传入
|
|
5297
5317
|
const listName = api.body.listName;
|
|
5318
|
+
// 只有在列表页面中才需要存储和读取本地存储中的参数,相关子表组件不需要
|
|
5319
|
+
needToStoreListViewProps = !!listName && !api.body.$self._isRelated;
|
|
5298
5320
|
const listViewPropsStoreKey = location.pathname + "/crud";
|
|
5299
5321
|
/**
|
|
5300
5322
|
* localListViewProps规范来自crud请求api中api.data.$self参数值的。
|
|
@@ -5306,7 +5328,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
5306
5328
|
* orderBy:排序字段
|
|
5307
5329
|
* orderDir:排序方向
|
|
5308
5330
|
*/
|
|
5309
|
-
let localListViewProps = sessionStorage.getItem(listViewPropsStoreKey);
|
|
5331
|
+
let localListViewProps = needToStoreListViewProps && sessionStorage.getItem(listViewPropsStoreKey);
|
|
5310
5332
|
let selfData = JSON.parse(JSON.stringify(api.body.$self));
|
|
5311
5333
|
if(localListViewProps){
|
|
5312
5334
|
localListViewProps = JSON.parse(localListViewProps);
|
|
@@ -5324,7 +5346,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
5324
5346
|
|
|
5325
5347
|
delete selfData.context;
|
|
5326
5348
|
delete selfData.global;
|
|
5327
|
-
sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify(selfData));
|
|
5349
|
+
needToStoreListViewProps && sessionStorage.setItem(listViewPropsStoreKey, JSON.stringify(selfData));
|
|
5328
5350
|
// 返回页码到UI界面
|
|
5329
5351
|
payload.data.page= selfData.page;
|
|
5330
5352
|
}
|
|
@@ -15629,6 +15651,7 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
15629
15651
|
format: 'YYYY-MM-DDTHH:mm:00.000Z',
|
|
15630
15652
|
tpl: readonly ? getDateTimeTpl(field) : null,
|
|
15631
15653
|
utc: true,
|
|
15654
|
+
closeOnSelect: false
|
|
15632
15655
|
};
|
|
15633
15656
|
break;
|
|
15634
15657
|
case 'input-time-range':
|
|
@@ -18898,7 +18921,7 @@ const getNextStepUsersInput = async (instance) => {
|
|
|
18898
18921
|
},
|
|
18899
18922
|
{
|
|
18900
18923
|
type: "list-select",
|
|
18901
|
-
label: "
|
|
18924
|
+
label: "",
|
|
18902
18925
|
name: "next_users",
|
|
18903
18926
|
id: "u:next_users",
|
|
18904
18927
|
required: true,
|
|
@@ -18942,7 +18965,7 @@ const getNextStepUsersInput = async (instance) => {
|
|
|
18942
18965
|
},
|
|
18943
18966
|
{
|
|
18944
18967
|
type: "list-select",
|
|
18945
|
-
label: "
|
|
18968
|
+
label: "",
|
|
18946
18969
|
name: "next_users",
|
|
18947
18970
|
id: "u:next_users",
|
|
18948
18971
|
required: true,
|
|
@@ -19105,7 +19128,7 @@ const getPostEngineRequestAdaptor = async (instance) => {
|
|
|
19105
19128
|
* @param instance
|
|
19106
19129
|
* @returns
|
|
19107
19130
|
*/
|
|
19108
|
-
const getSubmitActions = async (instance) => {
|
|
19131
|
+
const getSubmitActions = async (instance, submitEvents) => {
|
|
19109
19132
|
let api = "";
|
|
19110
19133
|
let requestAdaptor = "";
|
|
19111
19134
|
if(instance.approve?.type == "cc"){
|
|
@@ -19184,6 +19207,7 @@ const getSubmitActions = async (instance) => {
|
|
|
19184
19207
|
`,
|
|
19185
19208
|
expression: "${event.data.instanceFormValidate}"
|
|
19186
19209
|
},
|
|
19210
|
+
...submitEvents,
|
|
19187
19211
|
{
|
|
19188
19212
|
componentId: "",
|
|
19189
19213
|
args: {
|
|
@@ -19223,7 +19247,7 @@ const getSubmitActions = async (instance) => {
|
|
|
19223
19247
|
];
|
|
19224
19248
|
};
|
|
19225
19249
|
|
|
19226
|
-
const getApprovalDrawerSchema = async (instance) => {
|
|
19250
|
+
const getApprovalDrawerSchema = async (instance, submitEvents) => {
|
|
19227
19251
|
return {
|
|
19228
19252
|
type: "drawer",
|
|
19229
19253
|
overlay: false,
|
|
@@ -19316,7 +19340,7 @@ const getApprovalDrawerSchema = async (instance) => {
|
|
|
19316
19340
|
label: "${'Submit' | t}",
|
|
19317
19341
|
onEvent: {
|
|
19318
19342
|
click: {
|
|
19319
|
-
actions: await getSubmitActions(instance),
|
|
19343
|
+
actions: await getSubmitActions(instance, submitEvents),
|
|
19320
19344
|
},
|
|
19321
19345
|
},
|
|
19322
19346
|
id: "u:f6f8c3933f6c",
|
|
@@ -20393,7 +20417,7 @@ const getApplicantTableView = async (instance) => {
|
|
|
20393
20417
|
};
|
|
20394
20418
|
};
|
|
20395
20419
|
|
|
20396
|
-
const getApproveButton = async (instance)=>{
|
|
20420
|
+
const getApproveButton = async (instance, submitEvents)=>{
|
|
20397
20421
|
if(!instance.approve || ( instance.box != 'inbox' && instance.box != 'draft')){
|
|
20398
20422
|
return null;
|
|
20399
20423
|
}
|
|
@@ -20407,7 +20431,7 @@ const getApproveButton = async (instance)=>{
|
|
|
20407
20431
|
componentId: "",
|
|
20408
20432
|
args: {},
|
|
20409
20433
|
actionType: "drawer",
|
|
20410
|
-
drawer: await getApprovalDrawerSchema(instance),
|
|
20434
|
+
drawer: await getApprovalDrawerSchema(instance, submitEvents),
|
|
20411
20435
|
},
|
|
20412
20436
|
],
|
|
20413
20437
|
},
|
|
@@ -20429,6 +20453,19 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
20429
20453
|
formContentSchema = await getFormTableView(instance);
|
|
20430
20454
|
}
|
|
20431
20455
|
|
|
20456
|
+
const amisSchemaStr = instance.formVersion?.amis_schema;
|
|
20457
|
+
|
|
20458
|
+
let initedEvents = [];
|
|
20459
|
+
let changeEvents = [];
|
|
20460
|
+
let submitEvents = [];
|
|
20461
|
+
|
|
20462
|
+
if(amisSchemaStr){
|
|
20463
|
+
const onEvent = JSON.parse(instance.formVersion.amis_schema).onEvent;
|
|
20464
|
+
initedEvents = onEvent.inited.actions || [];
|
|
20465
|
+
changeEvents = onEvent.change.actions || [];
|
|
20466
|
+
submitEvents = onEvent.submit.actions || [];
|
|
20467
|
+
}
|
|
20468
|
+
|
|
20432
20469
|
console.log('getFlowFormSchema formContentSchema', formContentSchema);
|
|
20433
20470
|
return {
|
|
20434
20471
|
type: "page",
|
|
@@ -20534,13 +20571,14 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
20534
20571
|
"componentId": "u:next_step",
|
|
20535
20572
|
"args": {
|
|
20536
20573
|
}
|
|
20537
|
-
}
|
|
20574
|
+
},
|
|
20575
|
+
...changeEvents
|
|
20538
20576
|
]
|
|
20539
20577
|
}
|
|
20540
20578
|
}
|
|
20541
20579
|
},
|
|
20542
20580
|
await getInstanceApprovalHistory(),
|
|
20543
|
-
await getApproveButton(instance)
|
|
20581
|
+
await getApproveButton(instance, submitEvents)
|
|
20544
20582
|
],
|
|
20545
20583
|
id: "u:63849ea39e12",
|
|
20546
20584
|
messages: {},
|
|
@@ -20566,7 +20604,8 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
20566
20604
|
"value": "${event.data.context.approveValues}"
|
|
20567
20605
|
},
|
|
20568
20606
|
"expression": "${event.data.context.form.current.style === 'wizard'}"// 表单为 wizard 样式时需要初始同步表单数据,否则直接点击暂存按钮会清空数据
|
|
20569
|
-
}
|
|
20607
|
+
},
|
|
20608
|
+
...initedEvents
|
|
20570
20609
|
]
|
|
20571
20610
|
},
|
|
20572
20611
|
// inited: {
|