@steedos-widgets/amis-lib 6.10.17 → 6.10.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 +159 -59
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +159 -60
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +216 -233
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/calendar.d.ts +1 -1
- package/dist/types/workflow/approve.d.ts +32 -1
- package/dist/types/workflow/flow.d.ts +34 -0
- package/dist/types/workflow/index.d.ts +1 -1
- package/dist/types/workflow/instance.d.ts +1 -0
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -6101,13 +6101,13 @@ function getCalendarRecordSaveApi(object, calendarOptions) {
|
|
|
6101
6101
|
formData[calendarOptions.allDayExpr] = "${event.data.event.allDay}";
|
|
6102
6102
|
// formData[calendarOptions.textExpr] = "${event.data.event.title}";
|
|
6103
6103
|
const apiData = {
|
|
6104
|
-
objectName:
|
|
6104
|
+
objectName: object.name,
|
|
6105
6105
|
$: formData,
|
|
6106
6106
|
$self: "$$"
|
|
6107
6107
|
};
|
|
6108
6108
|
const saveDataTpl = `
|
|
6109
6109
|
const formData = api.data.$;
|
|
6110
|
-
const objectName =
|
|
6110
|
+
const objectName = ${object.name}};
|
|
6111
6111
|
let query = \`mutation{record: \${objectName}__update(id: "\${formData.${idFieldName}}", doc: {__saveData}){${idFieldName}}}\`;
|
|
6112
6112
|
delete formData.${idFieldName};
|
|
6113
6113
|
let __saveData = JSON.stringify(JSON.stringify(formData));
|
|
@@ -6234,7 +6234,7 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
|
|
|
6234
6234
|
"body": [
|
|
6235
6235
|
{
|
|
6236
6236
|
"type": "steedos-object-form",
|
|
6237
|
-
"objectApiName": "
|
|
6237
|
+
"objectApiName": "${objectSchema.name}",
|
|
6238
6238
|
"mode": "edit",
|
|
6239
6239
|
"defaultData": doc,
|
|
6240
6240
|
//改回为通用的提交事件
|
|
@@ -6433,14 +6433,14 @@ async function getObjectCalendar(objectSchema, calendarOptions, options) {
|
|
|
6433
6433
|
}
|
|
6434
6434
|
]
|
|
6435
6435
|
},
|
|
6436
|
-
"
|
|
6436
|
+
"setCalendarApi": {
|
|
6437
6437
|
"weight": 0,
|
|
6438
6438
|
"actions": [
|
|
6439
6439
|
{
|
|
6440
6440
|
"componentId": `service_${options.id}`,
|
|
6441
6441
|
"args": {
|
|
6442
6442
|
"value":{
|
|
6443
|
-
"
|
|
6443
|
+
"calendarApi": "${event.data.calendarApi}"
|
|
6444
6444
|
}
|
|
6445
6445
|
},
|
|
6446
6446
|
"actionType": "setValue",
|
|
@@ -16903,7 +16903,9 @@ function getInputTableCell(field, showAsInlineEditMode) {
|
|
|
16903
16903
|
// })
|
|
16904
16904
|
// },
|
|
16905
16905
|
label: field.label,
|
|
16906
|
-
name: field.name
|
|
16906
|
+
name: field.name,
|
|
16907
|
+
visibleOn: field.visibleOn,
|
|
16908
|
+
requiredOn: field.requiredOn
|
|
16907
16909
|
}
|
|
16908
16910
|
}
|
|
16909
16911
|
else {
|
|
@@ -16927,7 +16929,9 @@ function getInputTableCell(field, showAsInlineEditMode) {
|
|
|
16927
16929
|
"static": true,
|
|
16928
16930
|
"readonly": true,
|
|
16929
16931
|
label: field.label,
|
|
16930
|
-
name: field.name
|
|
16932
|
+
name: field.name,
|
|
16933
|
+
visibleOn: field.visibleOn,
|
|
16934
|
+
requiredOn: field.requiredOn
|
|
16931
16935
|
}
|
|
16932
16936
|
}
|
|
16933
16937
|
}
|
|
@@ -17766,7 +17770,8 @@ async function getButtonActions(props, mode) {
|
|
|
17766
17770
|
// "__tableItems": `\${${props.name}|json|toJson}`
|
|
17767
17771
|
// 在节点嵌套情况下,当前节点正好是带children属性的节点的话,这里弹出的dialog映射到的会是children数组,这是amis目前的规则,
|
|
17768
17772
|
// 所以这里加判断有children时,用__super.__super让映射到正确的作用域层,如果不加,则__tableItems取到的会是children数组,而不是整个子表组件的值
|
|
17769
|
-
"__tableItems": `\${((children ? __super.__super.${props.name} : __super.${props.name}) || [])|json|toJson}
|
|
17773
|
+
"__tableItems": `\${((children ? __super.__super.${props.name} : __super.${props.name}) || [])|json|toJson}`,
|
|
17774
|
+
...(props.actionData || {})
|
|
17770
17775
|
},
|
|
17771
17776
|
"actions": dialogButtons,
|
|
17772
17777
|
"onEvent": {
|
|
@@ -17892,7 +17897,8 @@ async function getButtonActions(props, mode) {
|
|
|
17892
17897
|
// "__tableItems": `\${((__super.parent ? __super.__super.${props.name} : __super.${props.name}) || [])|json|toJson}`
|
|
17893
17898
|
// 在节点嵌套情况下,当前节点正好是带children属性的节点的话,这里弹出的dialog映射到的会是children数组,这是amis目前的规则,
|
|
17894
17899
|
// 所以这里加判断有children时,用__super.__super让映射到正确的作用域层,如果不加,则__tableItems取到的会是children数组,而不是整个子表组件的值
|
|
17895
|
-
"__tableItems": `\${((children ? __super.__super.${props.name} : __super.${props.name}) || [])|json|toJson}
|
|
17900
|
+
"__tableItems": `\${((children ? __super.__super.${props.name} : __super.${props.name}) || [])|json|toJson}`,
|
|
17901
|
+
...(props.actionData || {})
|
|
17896
17902
|
},
|
|
17897
17903
|
}
|
|
17898
17904
|
}
|
|
@@ -19168,7 +19174,7 @@ const getJudgeInput = async (instance) => {
|
|
|
19168
19174
|
};
|
|
19169
19175
|
|
|
19170
19176
|
//TODO 只有一个下一步时,默认选中,并且禁止修改.
|
|
19171
|
-
const getNextStepInput = async (instance) => {
|
|
19177
|
+
const getNextStepInput = async (instance, nextStepChangeEvents) => {
|
|
19172
19178
|
// console.log('getNextStepInput', instance);
|
|
19173
19179
|
if(instance.approve?.type == 'cc'){
|
|
19174
19180
|
return ;
|
|
@@ -19256,29 +19262,14 @@ const getNextStepInput = async (instance) => {
|
|
|
19256
19262
|
"judge": "${new_judge}",
|
|
19257
19263
|
}
|
|
19258
19264
|
},
|
|
19259
|
-
|
|
19260
|
-
|
|
19261
|
-
|
|
19262
|
-
|
|
19263
|
-
|
|
19264
|
-
|
|
19265
|
-
|
|
19266
|
-
|
|
19267
|
-
// new_next_step: "${event.data.value}",
|
|
19268
|
-
// }
|
|
19269
|
-
// },
|
|
19270
|
-
// "actionType": "setValue"
|
|
19271
|
-
// },
|
|
19272
|
-
// // {
|
|
19273
|
-
// // "args": {
|
|
19274
|
-
// // next_step: "${event.data.value}",
|
|
19275
|
-
// // },
|
|
19276
|
-
// // "actionType": "broadcast",
|
|
19277
|
-
// // eventName: "approve_next_step_change"
|
|
19278
|
-
// // },
|
|
19279
|
-
// ]
|
|
19280
|
-
// }
|
|
19281
|
-
// }
|
|
19265
|
+
"onEvent": {
|
|
19266
|
+
"change": {
|
|
19267
|
+
"weight": 0,
|
|
19268
|
+
"actions": [
|
|
19269
|
+
...nextStepChangeEvents
|
|
19270
|
+
]
|
|
19271
|
+
}
|
|
19272
|
+
}
|
|
19282
19273
|
},
|
|
19283
19274
|
],
|
|
19284
19275
|
id: "u:4d3a884b437c",
|
|
@@ -19291,7 +19282,7 @@ const getNextStepInput = async (instance) => {
|
|
|
19291
19282
|
};
|
|
19292
19283
|
|
|
19293
19284
|
//TODO 只有一个处理人时,默认选中,禁止修改. 部分情况不需要显示下一步处理人
|
|
19294
|
-
const getNextStepUsersInput = async (instance) => {
|
|
19285
|
+
const getNextStepUsersInput = async (instance, nextStepUserChangeEvents) => {
|
|
19295
19286
|
if(instance.approve?.type == 'cc'){
|
|
19296
19287
|
return ;
|
|
19297
19288
|
}
|
|
@@ -19319,7 +19310,15 @@ const getNextStepUsersInput = async (instance) => {
|
|
|
19319
19310
|
label: "",
|
|
19320
19311
|
name: "next_users",
|
|
19321
19312
|
hiddenOn: "this.new_next_step.deal_type != 'pickupAtRuntime' || this.new_next_step.step_type == 'counterSign'",
|
|
19322
|
-
required: true
|
|
19313
|
+
required: true,
|
|
19314
|
+
"onEvent": {
|
|
19315
|
+
"change": {
|
|
19316
|
+
"weight": 0,
|
|
19317
|
+
"actions": [
|
|
19318
|
+
...nextStepUserChangeEvents
|
|
19319
|
+
]
|
|
19320
|
+
}
|
|
19321
|
+
}
|
|
19323
19322
|
},
|
|
19324
19323
|
{
|
|
19325
19324
|
type: "steedos-select-user",
|
|
@@ -19327,7 +19326,15 @@ const getNextStepUsersInput = async (instance) => {
|
|
|
19327
19326
|
name: "next_users",
|
|
19328
19327
|
hiddenOn: "this.new_next_step.deal_type != 'pickupAtRuntime' || this.new_next_step.step_type != 'counterSign'",
|
|
19329
19328
|
required: true,
|
|
19330
|
-
multiple: true
|
|
19329
|
+
multiple: true,
|
|
19330
|
+
"onEvent": {
|
|
19331
|
+
"change": {
|
|
19332
|
+
"weight": 0,
|
|
19333
|
+
"actions": [
|
|
19334
|
+
...nextStepUserChangeEvents
|
|
19335
|
+
]
|
|
19336
|
+
}
|
|
19337
|
+
}
|
|
19331
19338
|
},
|
|
19332
19339
|
{
|
|
19333
19340
|
type: "list-select",
|
|
@@ -19372,6 +19379,14 @@ const getNextStepUsersInput = async (instance) => {
|
|
|
19372
19379
|
value: '${new_next_step.approver_users}',
|
|
19373
19380
|
"joinValues": false,
|
|
19374
19381
|
"extractValue": true,
|
|
19382
|
+
"onEvent": {
|
|
19383
|
+
"change": {
|
|
19384
|
+
"weight": 0,
|
|
19385
|
+
"actions": [
|
|
19386
|
+
...nextStepUserChangeEvents
|
|
19387
|
+
]
|
|
19388
|
+
}
|
|
19389
|
+
}
|
|
19375
19390
|
},
|
|
19376
19391
|
{
|
|
19377
19392
|
type: "list-select",
|
|
@@ -19416,6 +19431,14 @@ const getNextStepUsersInput = async (instance) => {
|
|
|
19416
19431
|
value: '${new_next_step.approver_users}',
|
|
19417
19432
|
"joinValues": false,
|
|
19418
19433
|
"extractValue": true,
|
|
19434
|
+
"onEvent": {
|
|
19435
|
+
"change": {
|
|
19436
|
+
"weight": 0,
|
|
19437
|
+
"actions": [
|
|
19438
|
+
...nextStepUserChangeEvents
|
|
19439
|
+
]
|
|
19440
|
+
}
|
|
19441
|
+
}
|
|
19419
19442
|
},
|
|
19420
19443
|
// {
|
|
19421
19444
|
// type: "steedos-select-user",
|
|
@@ -19485,7 +19508,7 @@ const getPostSubmitRequestAdaptor = async (instance) => {
|
|
|
19485
19508
|
const body = {Instances: [{
|
|
19486
19509
|
_id: "${instance._id}",
|
|
19487
19510
|
flow: "${instance.flow._id}",
|
|
19488
|
-
applicant: formValues.
|
|
19511
|
+
applicant: formValues.__applicant,
|
|
19489
19512
|
submitter: formValues.submitter,
|
|
19490
19513
|
traces: [{
|
|
19491
19514
|
_id: "${instance.trace._id}",
|
|
@@ -19670,10 +19693,11 @@ const getSubmitActions = async (instance, submitEvents) => {
|
|
|
19670
19693
|
];
|
|
19671
19694
|
};
|
|
19672
19695
|
|
|
19673
|
-
const getApprovalDrawerSchema = async (instance,
|
|
19696
|
+
const getApprovalDrawerSchema = async (instance, events) => {
|
|
19697
|
+
const { submitEvents , nextStepInitedEvents, nextStepChangeEvents, nextStepUserChangeEvents } = events;
|
|
19674
19698
|
const userId = getSteedosAuth$1().userId;
|
|
19675
19699
|
const userApprove = getUserApprove({ instance, userId });
|
|
19676
|
-
|
|
19700
|
+
const schema = {
|
|
19677
19701
|
type: "drawer",
|
|
19678
19702
|
overlay: false,
|
|
19679
19703
|
resizable: false,
|
|
@@ -19691,6 +19715,10 @@ const getApprovalDrawerSchema = async (instance, submitEvents) => {
|
|
|
19691
19715
|
body: [
|
|
19692
19716
|
{
|
|
19693
19717
|
type: "form",
|
|
19718
|
+
initApi: {
|
|
19719
|
+
method: 'POST',
|
|
19720
|
+
url: '/api/v6/amis/health_check'
|
|
19721
|
+
},
|
|
19694
19722
|
debug: false,
|
|
19695
19723
|
id: "instance_approval",
|
|
19696
19724
|
resetAfterSubmit: true,
|
|
@@ -19728,8 +19756,8 @@ const getApprovalDrawerSchema = async (instance, submitEvents) => {
|
|
|
19728
19756
|
// }
|
|
19729
19757
|
// }
|
|
19730
19758
|
},
|
|
19731
|
-
await getNextStepInput(instance),
|
|
19732
|
-
await getNextStepUsersInput(instance),
|
|
19759
|
+
await getNextStepInput(instance, nextStepChangeEvents),
|
|
19760
|
+
await getNextStepUsersInput(instance, nextStepUserChangeEvents),
|
|
19733
19761
|
],
|
|
19734
19762
|
onEvent: {
|
|
19735
19763
|
"approve_judge_change": {
|
|
@@ -19742,6 +19770,11 @@ const getApprovalDrawerSchema = async (instance, submitEvents) => {
|
|
|
19742
19770
|
}
|
|
19743
19771
|
]
|
|
19744
19772
|
},
|
|
19773
|
+
"inited": {
|
|
19774
|
+
"actions": [
|
|
19775
|
+
...nextStepInitedEvents
|
|
19776
|
+
]
|
|
19777
|
+
}
|
|
19745
19778
|
// "approve_next_step_change": {
|
|
19746
19779
|
// "actions": [
|
|
19747
19780
|
// {
|
|
@@ -19805,6 +19838,8 @@ const getApprovalDrawerSchema = async (instance, submitEvents) => {
|
|
|
19805
19838
|
},
|
|
19806
19839
|
]
|
|
19807
19840
|
};
|
|
19841
|
+
console.log(`getApprovalDrawerSchema: `, schema);
|
|
19842
|
+
return schema;
|
|
19808
19843
|
};
|
|
19809
19844
|
|
|
19810
19845
|
/*
|
|
@@ -20089,15 +20124,22 @@ const getArgumentsList = (func)=>{
|
|
|
20089
20124
|
};
|
|
20090
20125
|
|
|
20091
20126
|
const getFieldEditTpl = async (field, label)=>{
|
|
20092
|
-
console.log('field',field)
|
|
20127
|
+
// console.log('field',field)
|
|
20093
20128
|
const tpl = {
|
|
20094
20129
|
label: label === true ? field.name : false,
|
|
20095
20130
|
name: field.code,
|
|
20096
20131
|
mode: "horizontal",
|
|
20097
20132
|
className: "m-none p-none form-control",
|
|
20098
20133
|
disabled: field.permission !== "editable",
|
|
20099
|
-
required: field.is_required
|
|
20134
|
+
required: field.is_required,
|
|
20135
|
+
visibleOn: field.visibleOn,
|
|
20136
|
+
requiredOn: field.requiredOn
|
|
20100
20137
|
};
|
|
20138
|
+
|
|
20139
|
+
if(field.formula){
|
|
20140
|
+
tpl.value = `$${field.formula}`;
|
|
20141
|
+
}
|
|
20142
|
+
|
|
20101
20143
|
if(isOpinionField(field)){
|
|
20102
20144
|
tpl.type = 'input-group';
|
|
20103
20145
|
tpl.body = [
|
|
@@ -20399,7 +20441,6 @@ const getFieldEditTpl = async (field, label)=>{
|
|
|
20399
20441
|
const filters = \`${_.replace(field.filters, /_.pluck/g, '_.map')}\`;
|
|
20400
20442
|
const url = \`${field.url}\`;
|
|
20401
20443
|
if(filters){
|
|
20402
|
-
console.log('filters', filters);
|
|
20403
20444
|
const joinKey = url.indexOf('?') > 0 ? '&' : '?';
|
|
20404
20445
|
if(filters.startsWith('function(') || filters.startsWith('function (')){
|
|
20405
20446
|
const argsName = ${JSON.stringify(argsName)};
|
|
@@ -20421,7 +20462,7 @@ const getFieldEditTpl = async (field, label)=>{
|
|
|
20421
20462
|
trackExpression: _.join(_.map(argsName, (item)=>{return `\${${item}|json}`}), '-')
|
|
20422
20463
|
};
|
|
20423
20464
|
tpl.isAmis=true;
|
|
20424
|
-
console.log(`odata`, tpl)
|
|
20465
|
+
// console.log(`odata`, tpl)
|
|
20425
20466
|
break;
|
|
20426
20467
|
case "html":
|
|
20427
20468
|
if (tpl.disabled) {
|
|
@@ -20451,6 +20492,11 @@ const getFieldEditTpl = async (field, label)=>{
|
|
|
20451
20492
|
tpl.editable = tpl.addable;
|
|
20452
20493
|
tpl.copyable = tpl.addable;
|
|
20453
20494
|
tpl.removable = tpl.addable;
|
|
20495
|
+
if(tpl.addable){
|
|
20496
|
+
tpl.actionData = {
|
|
20497
|
+
"&" : "$$"
|
|
20498
|
+
};
|
|
20499
|
+
}
|
|
20454
20500
|
// tpl.fieldPrefix = field.name + "_";
|
|
20455
20501
|
tpl.autoGeneratePrimaryKeyValue = true;
|
|
20456
20502
|
tpl.fields = [];
|
|
@@ -20461,7 +20507,16 @@ const getFieldEditTpl = async (field, label)=>{
|
|
|
20461
20507
|
if (sField.type != "hidden") {
|
|
20462
20508
|
sField.permission = field.permission;
|
|
20463
20509
|
const column = await getTdInputTpl(sField, true);
|
|
20510
|
+
// console.log('table column', column, sField);
|
|
20464
20511
|
if(column.type === 'steedos-field'){
|
|
20512
|
+
if(sField.visibleOn){
|
|
20513
|
+
column.config.visibleOn = sField.visibleOn;
|
|
20514
|
+
}
|
|
20515
|
+
|
|
20516
|
+
if(sField.requiredOn){
|
|
20517
|
+
column.config.requiredOn = sField.requiredOn;
|
|
20518
|
+
}
|
|
20519
|
+
|
|
20465
20520
|
tpl.fields.push(column.config);
|
|
20466
20521
|
}else {
|
|
20467
20522
|
tpl.fields.push(column);
|
|
@@ -20489,6 +20544,9 @@ const getFieldReadonlyTpl = async (field, label)=>{
|
|
|
20489
20544
|
mode: "horizontal",
|
|
20490
20545
|
className: "m-none p-none form-control",
|
|
20491
20546
|
};
|
|
20547
|
+
if(field.formula){
|
|
20548
|
+
tpl.value = `$${field.formula}`;
|
|
20549
|
+
}
|
|
20492
20550
|
if(includes(['text'], field.type)){
|
|
20493
20551
|
tpl.type = `static-${field.type}`;
|
|
20494
20552
|
}else if(field.type === 'select'){
|
|
@@ -20609,6 +20667,8 @@ const getTdField = async (field, fieldsCount) => {
|
|
|
20609
20667
|
};
|
|
20610
20668
|
|
|
20611
20669
|
const getTdTitle = (field) => {
|
|
20670
|
+
const requiredOn = field.config?.amis.requiredOn;
|
|
20671
|
+
// console.log('getTdTitle', field.is_required , requiredOn, field);
|
|
20612
20672
|
return {
|
|
20613
20673
|
className: `td-title td-title-${field.type}`,
|
|
20614
20674
|
align: field.type != "section" ? "center" : "left",
|
|
@@ -20618,7 +20678,8 @@ const getTdTitle = (field) => {
|
|
|
20618
20678
|
body: [
|
|
20619
20679
|
{
|
|
20620
20680
|
type: "tpl",
|
|
20621
|
-
tpl: `<div class='${field.type == "section" ? "font-bold" : ""}'>${field.name || field.code}
|
|
20681
|
+
tpl: `<div class='${field.type == "section" ? "font-bold" : ""}'>${field.name || field.code} <span class="antd-Form-star">*</span></div>`,
|
|
20682
|
+
className: field.is_required ? 'steedos-field-required' : (requiredOn ? {'steedos-field-required' : `${requiredOn}`} : '')
|
|
20622
20683
|
},
|
|
20623
20684
|
],
|
|
20624
20685
|
// "id": "u:9b001b7ff92d",
|
|
@@ -20645,6 +20706,7 @@ const getTds = async (tdFields) => {
|
|
|
20645
20706
|
};
|
|
20646
20707
|
|
|
20647
20708
|
const getFormTrs = async (instance) => {
|
|
20709
|
+
// console.log('getFormTrs instance====>', instance);
|
|
20648
20710
|
const trsSchema = [];
|
|
20649
20711
|
const trs = [];
|
|
20650
20712
|
let tdFields = [];
|
|
@@ -20799,9 +20861,9 @@ const getFormWizardView = async (instance) => {
|
|
|
20799
20861
|
const getApplicantTableView = async (instance) => {
|
|
20800
20862
|
let applicantInput = null;
|
|
20801
20863
|
if(instance.state === 'draft'){
|
|
20802
|
-
applicantInput = Object.assign({name: "
|
|
20864
|
+
applicantInput = Object.assign({name: "__applicant", value: instance.applicant || getSteedosAuth$1().userId, disabled: instance.box !== 'draft'}, await lookupToAmis$1(
|
|
20803
20865
|
{
|
|
20804
|
-
name: "
|
|
20866
|
+
name: "__applicant",
|
|
20805
20867
|
label: false,
|
|
20806
20868
|
reference_to: "space_users",
|
|
20807
20869
|
reference_to_field: 'user',
|
|
@@ -20809,7 +20871,31 @@ const getApplicantTableView = async (instance) => {
|
|
|
20809
20871
|
},
|
|
20810
20872
|
false,
|
|
20811
20873
|
{}
|
|
20812
|
-
)
|
|
20874
|
+
), {
|
|
20875
|
+
"onEvent": {
|
|
20876
|
+
"change": {
|
|
20877
|
+
"actions": [
|
|
20878
|
+
{
|
|
20879
|
+
"actionType": "ajax",
|
|
20880
|
+
"api": {
|
|
20881
|
+
"url": "/api/formula/user/${__applicant}",
|
|
20882
|
+
"method": "get",
|
|
20883
|
+
"messages": {
|
|
20884
|
+
"success": "",
|
|
20885
|
+
"failed": ""
|
|
20886
|
+
},
|
|
20887
|
+
"silent": true,
|
|
20888
|
+
"adaptor": "return {applicantInfo: payload}"
|
|
20889
|
+
}
|
|
20890
|
+
},
|
|
20891
|
+
{
|
|
20892
|
+
"actionType": "custom",
|
|
20893
|
+
"script": "doAction({'componentId': 'u:instancePage', 'actionType': 'setValue', 'args': { 'value': { 'applicant': event.data.applicantInfo } }}) "
|
|
20894
|
+
}
|
|
20895
|
+
]
|
|
20896
|
+
}
|
|
20897
|
+
}
|
|
20898
|
+
});
|
|
20813
20899
|
}else {
|
|
20814
20900
|
applicantInput = {
|
|
20815
20901
|
label: false,
|
|
@@ -20898,7 +20984,7 @@ const getApplicantTableView = async (instance) => {
|
|
|
20898
20984
|
};
|
|
20899
20985
|
};
|
|
20900
20986
|
|
|
20901
|
-
const getApproveButton = async (instance,
|
|
20987
|
+
const getApproveButton = async (instance, events)=>{
|
|
20902
20988
|
if(!instance.approve || ( instance.box != 'inbox' && instance.box != 'draft')){
|
|
20903
20989
|
return null;
|
|
20904
20990
|
}
|
|
@@ -20912,7 +20998,7 @@ const getApproveButton = async (instance, submitEvents)=>{
|
|
|
20912
20998
|
componentId: "",
|
|
20913
20999
|
args: {},
|
|
20914
21000
|
actionType: "drawer",
|
|
20915
|
-
drawer: await getApprovalDrawerSchema(instance,
|
|
21001
|
+
drawer: await getApprovalDrawerSchema(instance, events),
|
|
20916
21002
|
},
|
|
20917
21003
|
],
|
|
20918
21004
|
},
|
|
@@ -20986,12 +21072,18 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
20986
21072
|
let initedEvents = [];
|
|
20987
21073
|
let changeEvents = [];
|
|
20988
21074
|
let submitEvents = [];
|
|
21075
|
+
let nextStepInitedEvents = [];
|
|
21076
|
+
let nextStepChangeEvents = [];
|
|
21077
|
+
let nextStepUserChangeEvents = [];
|
|
20989
21078
|
|
|
20990
21079
|
if(amisSchemaStr){
|
|
20991
21080
|
const onEvent = JSON.parse(instance.formVersion.amis_schema).onEvent;
|
|
20992
|
-
initedEvents = onEvent?.inited
|
|
20993
|
-
changeEvents = onEvent?.change
|
|
20994
|
-
submitEvents = onEvent?.submit
|
|
21081
|
+
initedEvents = onEvent?.inited?.actions || [];
|
|
21082
|
+
changeEvents = onEvent?.change?.actions || [];
|
|
21083
|
+
submitEvents = onEvent?.submit?.actions || [];
|
|
21084
|
+
nextStepInitedEvents = onEvent?.nextStepInited?.actions || [];
|
|
21085
|
+
nextStepChangeEvents = onEvent?.nextStepChange?.actions || [];
|
|
21086
|
+
nextStepUserChangeEvents = onEvent?.nextStepUserChange.actions || [];
|
|
20995
21087
|
}
|
|
20996
21088
|
// if (box == 'inbox' || box == 'draft') {
|
|
20997
21089
|
// TODO: 临时去掉 AutoOpenApproveDrawer 功能因为测试到性能问题
|
|
@@ -21003,7 +21095,7 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
21003
21095
|
"args": {}
|
|
21004
21096
|
});
|
|
21005
21097
|
}
|
|
21006
|
-
|
|
21098
|
+
// console.log('formContentSchema....', formContentSchema)
|
|
21007
21099
|
return {
|
|
21008
21100
|
type: "page",
|
|
21009
21101
|
name: "instancePage",
|
|
@@ -21079,7 +21171,6 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
21079
21171
|
},
|
|
21080
21172
|
formContentSchema,
|
|
21081
21173
|
await getApplicantTableView(instance),
|
|
21082
|
-
|
|
21083
21174
|
],
|
|
21084
21175
|
id: "instance_form",
|
|
21085
21176
|
onEvent: {
|
|
@@ -21106,8 +21197,7 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
21106
21197
|
{
|
|
21107
21198
|
"actionType": "reload",
|
|
21108
21199
|
"componentId": "u:next_step",
|
|
21109
|
-
"args": {
|
|
21110
|
-
}
|
|
21200
|
+
"args": {}
|
|
21111
21201
|
},
|
|
21112
21202
|
...changeEvents
|
|
21113
21203
|
]
|
|
@@ -21115,7 +21205,7 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
21115
21205
|
}
|
|
21116
21206
|
},
|
|
21117
21207
|
await getInstanceApprovalHistory(),
|
|
21118
|
-
await getApproveButton(instance, submitEvents)
|
|
21208
|
+
await getApproveButton(instance, { submitEvents , nextStepInitedEvents, nextStepChangeEvents, nextStepUserChangeEvents})
|
|
21119
21209
|
],
|
|
21120
21210
|
id: "u:instancePage",
|
|
21121
21211
|
messages: {},
|
|
@@ -21630,6 +21720,15 @@ const getInstanceInfo = async (props) => {
|
|
|
21630
21720
|
};
|
|
21631
21721
|
};
|
|
21632
21722
|
|
|
21723
|
+
|
|
21724
|
+
|
|
21725
|
+
const getApplicant = async (userId) => {
|
|
21726
|
+
const result = await fetchAPI$1(`/api/formula/user/${userId}`, {
|
|
21727
|
+
method: "get"
|
|
21728
|
+
});
|
|
21729
|
+
return result;
|
|
21730
|
+
};
|
|
21731
|
+
|
|
21633
21732
|
var asc$1 = "Asc";
|
|
21634
21733
|
var cancel$1 = "Cancel";
|
|
21635
21734
|
var clear$1 = "Clear";
|
|
@@ -22417,5 +22516,5 @@ if (typeof window != 'undefined') {
|
|
|
22417
22516
|
currentAmis && currentAmis.registerLocale(locale, getAmisLocaleResource());
|
|
22418
22517
|
}
|
|
22419
22518
|
|
|
22420
|
-
export { index as Field, Router, absoluteUrl, amisRender, amisRootClick, cloneObject, conditionsToFilters, createObject, defaultsDeep, deleteVariable, execute, executeButton, extendObject, fetchAPI, filtersToConditions, getAmisInputTableSchema, getAmisLocaleResource, getApp, getApps, getAuthToken, getAuthorization, getButton, getButtonVisible, getButtonVisibleOn, getButtons, getCalendarSchema, getCreatedInfoTpl, getDateTimeTpl, getDateTpl, getDefaultRenderData, getEnv, getEnvs, getEvn, getField, getFieldTpl, getFileSrc, getFlowFormSchema, getFormPageInitSchema, getFormSchema, getGlobalNowData, getIdsPickerSchema, getImageSrc, getInstanceInfo, getListPageInitSchema, getListSchema, getListViewButtons, getListViewColumns, getListViewFilter, getListViewItemButtons, getListViewSort, getListviewInitSchema, getLocationTpl, getLookupSapceUserTreeSchema, getLookupTpl, getModifiedInfoTpl, getNameTpl, getNameTplUrl, getNotifications, getNumberTpl, getObjectDetailButtons, getObjectDetailButtonsSchemas, getObjectDetailMoreButtons, getObjectFieldsFilterBarSchema, getObjectFieldsFilterButtonSchema, getObjectFieldsFilterFormSchema, getObjectListHeader, getObjectListHeaderFieldsFilterBar, getObjectListHeaderFirstLine, getObjectListHeaderSecordLine, getObjectListViewButtonsSchemas, getObjectRecordDetailHeader, getObjectRecordDetailRelatedListButtonsSchemas, getObjectRecordDetailRelatedListHeader, getObjectRelated, getObjectRelatedList, getObjectRelatedListButtons, getObjectRelatedListHeader, getObjectRelatedListsMiniSchema, getPage, getPasswordTpl, getRecord, getRecordDetailHeaderSchema, getRecordDetailMiniSchema, getRecordDetailRelatedListSchema, getRecordDetailSchema, getRecordPageInitSchema, getRecordPermissions, getRecordServiceSchema, getRefObjectNameFieldName, getReferenceTo, getReferenceToFieldSchema, getReferenceToSync, getRelatedFieldTpl, getRelatedFieldValue, getRelatedListSchema, getRelatedsCount, getRootUrl, getSelectMap, getSelectTpl, getSelectUserSchema, getSpaceUsersPickerAmisSchema, getSpaceUsersPickerSchema, getSteedosAuth, getSwitchTpl, getTableSchema, getTenantId, getTimeTpl, getUISchema, getUISchemaSync$1 as getUISchemaSync, getUiFieldTpl, getUiFileSizeTpl, getUserId, getUserLanguage$1 as getUserLanguage, getViewSchema, isExpression, isObject, lookupToAmis, lookupToAmisIdsPicker, lookupToAmisPicker, lookupToAmisSelect, lookupToAmisSelectUser, markReadAll, parseSingleExpression, registerRemoteAssets, registerRenders, setEnv, setEnvs, setRootUrl, setSteedosAuth, setUISchemaFunction, setVariable, standardButtonsTodo, uuidv4 };
|
|
22519
|
+
export { index as Field, Router, absoluteUrl, amisRender, amisRootClick, cloneObject, conditionsToFilters, createObject, defaultsDeep, deleteVariable, execute, executeButton, extendObject, fetchAPI, filtersToConditions, getAmisInputTableSchema, getAmisLocaleResource, getApp, getApplicant, getApps, getAuthToken, getAuthorization, getButton, getButtonVisible, getButtonVisibleOn, getButtons, getCalendarSchema, getCreatedInfoTpl, getDateTimeTpl, getDateTpl, getDefaultRenderData, getEnv, getEnvs, getEvn, getField, getFieldTpl, getFileSrc, getFlowFormSchema, getFormPageInitSchema, getFormSchema, getGlobalNowData, getIdsPickerSchema, getImageSrc, getInstanceInfo, getListPageInitSchema, getListSchema, getListViewButtons, getListViewColumns, getListViewFilter, getListViewItemButtons, getListViewSort, getListviewInitSchema, getLocationTpl, getLookupSapceUserTreeSchema, getLookupTpl, getModifiedInfoTpl, getNameTpl, getNameTplUrl, getNotifications, getNumberTpl, getObjectDetailButtons, getObjectDetailButtonsSchemas, getObjectDetailMoreButtons, getObjectFieldsFilterBarSchema, getObjectFieldsFilterButtonSchema, getObjectFieldsFilterFormSchema, getObjectListHeader, getObjectListHeaderFieldsFilterBar, getObjectListHeaderFirstLine, getObjectListHeaderSecordLine, getObjectListViewButtonsSchemas, getObjectRecordDetailHeader, getObjectRecordDetailRelatedListButtonsSchemas, getObjectRecordDetailRelatedListHeader, getObjectRelated, getObjectRelatedList, getObjectRelatedListButtons, getObjectRelatedListHeader, getObjectRelatedListsMiniSchema, getPage, getPasswordTpl, getRecord, getRecordDetailHeaderSchema, getRecordDetailMiniSchema, getRecordDetailRelatedListSchema, getRecordDetailSchema, getRecordPageInitSchema, getRecordPermissions, getRecordServiceSchema, getRefObjectNameFieldName, getReferenceTo, getReferenceToFieldSchema, getReferenceToSync, getRelatedFieldTpl, getRelatedFieldValue, getRelatedListSchema, getRelatedsCount, getRootUrl, getSelectMap, getSelectTpl, getSelectUserSchema, getSpaceUsersPickerAmisSchema, getSpaceUsersPickerSchema, getSteedosAuth, getSwitchTpl, getTableSchema, getTenantId, getTimeTpl, getUISchema, getUISchemaSync$1 as getUISchemaSync, getUiFieldTpl, getUiFileSizeTpl, getUserId, getUserLanguage$1 as getUserLanguage, getViewSchema, isExpression, isObject, lookupToAmis, lookupToAmisIdsPicker, lookupToAmisPicker, lookupToAmisSelect, lookupToAmisSelectUser, markReadAll, parseSingleExpression, registerRemoteAssets, registerRenders, setEnv, setEnvs, setRootUrl, setSteedosAuth, setUISchemaFunction, setVariable, standardButtonsTodo, uuidv4 };
|
|
22421
22520
|
//# sourceMappingURL=index.esm.js.map
|