@steedos-widgets/amis-lib 1.1.0-beta.2 → 1.1.0
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 +99 -92
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +99 -92
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +99 -92
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/calendar.d.ts +18 -0
- package/dist/types/lib/objects.d.ts +18 -0
- package/dist/types/workflow/approve.d.ts +34 -45
- package/dist/types/workflow/flow.d.ts +34 -45
- package/package.json +2 -2
package/dist/index.umd.js
CHANGED
|
@@ -1075,17 +1075,10 @@
|
|
|
1075
1075
|
data.$value = `$${valueField}`;
|
|
1076
1076
|
// data["&"] = "$$";
|
|
1077
1077
|
|
|
1078
|
-
const fieldValue = ctx.value;
|
|
1079
|
-
|
|
1080
1078
|
const requestAdaptor = `
|
|
1081
1079
|
var filters = [['parent', '=', null]];
|
|
1082
1080
|
api.data.query = api.data.query.replace(/{__filters}/g, JSON.stringify(filters));
|
|
1083
1081
|
var defaultValue = api.data.$value;
|
|
1084
|
-
var fieldValue = ${JSON.stringify(fieldValue)};
|
|
1085
|
-
if(!defaultValue && fieldValue){
|
|
1086
|
-
// 如果表单中没有字段值,则认字段上配置的value属性
|
|
1087
|
-
defaultValue = fieldValue;
|
|
1088
|
-
}
|
|
1089
1082
|
var optionsFiltersOp = "${field.multiple ? "in" : "="}";
|
|
1090
1083
|
var optionsFilters = [["user", optionsFiltersOp, []]];
|
|
1091
1084
|
if (defaultValue) {
|
|
@@ -4278,21 +4271,20 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
4278
4271
|
// return await lookupToAmisGroup(field, readonly, ctx);
|
|
4279
4272
|
}
|
|
4280
4273
|
|
|
4281
|
-
if(ctx.ids || ctx.idsTrackOn){
|
|
4282
|
-
return await lookupToAmisIdsPicker(field, readonly, ctx);
|
|
4283
|
-
}
|
|
4284
|
-
|
|
4285
4274
|
let referenceTo = await getReferenceTo(field);
|
|
4286
4275
|
if(!referenceTo){
|
|
4287
4276
|
return await lookupToAmisSelect(field, readonly, ctx);
|
|
4288
4277
|
}
|
|
4289
4278
|
|
|
4290
|
-
const refObject = await getUISchema(referenceTo.objectName);
|
|
4291
|
-
|
|
4292
4279
|
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user"){
|
|
4280
|
+
if(ctx.idsDependOn || field.amis){
|
|
4281
|
+
return await lookupToAmisIdsPicker(field, readonly, ctx);
|
|
4282
|
+
}
|
|
4293
4283
|
return await lookupToAmisSelectUser(field, readonly, ctx);
|
|
4294
4284
|
}
|
|
4295
4285
|
|
|
4286
|
+
const refObject = await getUISchema(referenceTo.objectName);
|
|
4287
|
+
|
|
4296
4288
|
// 此处不参考 steedos 的 enable_enhanced_lookup 规则. 如果默认是开启弹出选择,用户选择过程操作太繁琐, 所以默认是关闭弹出选择.
|
|
4297
4289
|
// 由于amis picker 目前不支持联动, 配置了depend_on时, 使用使用select ,以支持联动
|
|
4298
4290
|
// TODO: 确认 amis picker 支持联动时, 清理field.depend_on判断
|
|
@@ -4327,7 +4319,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
4327
4319
|
}
|
|
4328
4320
|
const refObjectConfig = await getUISchema(referenceTo.objectName);
|
|
4329
4321
|
|
|
4330
|
-
const {
|
|
4322
|
+
const { idsDependOn } = ctx;
|
|
4331
4323
|
|
|
4332
4324
|
const fields = {
|
|
4333
4325
|
[referenceTo.labelField.name]: referenceTo.labelField,
|
|
@@ -4341,14 +4333,9 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
4341
4333
|
source.data.$term = "$term";
|
|
4342
4334
|
source.data.$self = "$$";
|
|
4343
4335
|
|
|
4344
|
-
if(
|
|
4345
|
-
source.sendOn =
|
|
4346
|
-
|
|
4347
|
-
else {
|
|
4348
|
-
source.sendOn = false;
|
|
4349
|
-
}
|
|
4350
|
-
if(idsTrackOn){
|
|
4351
|
-
source.sendOn = `\${${idsTrackOn} && ${idsTrackOn}.length}`;
|
|
4336
|
+
if(idsDependOn && source.url){
|
|
4337
|
+
source.sendOn = `\${${idsDependOn} && ${idsDependOn}.length}`;
|
|
4338
|
+
source.url = `${source.url}&depend_on_${idsDependOn}=\${${idsDependOn}|join}`;
|
|
4352
4339
|
}
|
|
4353
4340
|
|
|
4354
4341
|
source.requestAdaptor = `
|
|
@@ -4365,10 +4352,10 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
4365
4352
|
}
|
|
4366
4353
|
}
|
|
4367
4354
|
|
|
4368
|
-
var ids
|
|
4369
|
-
var
|
|
4370
|
-
if(
|
|
4371
|
-
ids = api.data.$self[
|
|
4355
|
+
var ids;
|
|
4356
|
+
var idsDependOn = "${idsDependOn}";
|
|
4357
|
+
if(idsDependOn){
|
|
4358
|
+
ids = api.data.$self[idsDependOn];
|
|
4372
4359
|
}
|
|
4373
4360
|
if(ids && ids.length){
|
|
4374
4361
|
filters.push(["${referenceTo.valueField.name}", "=", ids]);
|
|
@@ -6904,7 +6891,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
6904
6891
|
initialView = "dayGridMonth";
|
|
6905
6892
|
break;
|
|
6906
6893
|
case "agenda":
|
|
6907
|
-
initialView = "
|
|
6894
|
+
initialView = "listWeek";
|
|
6908
6895
|
break;
|
|
6909
6896
|
}
|
|
6910
6897
|
}
|
|
@@ -7126,6 +7113,30 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
7126
7113
|
}
|
|
7127
7114
|
]
|
|
7128
7115
|
},
|
|
7116
|
+
"eventDidMount": {
|
|
7117
|
+
"weight": 0,
|
|
7118
|
+
"actions": [
|
|
7119
|
+
{
|
|
7120
|
+
"componentId": "",
|
|
7121
|
+
"args": {
|
|
7122
|
+
},
|
|
7123
|
+
"actionType": "custom",
|
|
7124
|
+
"script": "console.log('eventDidMount'); console.log(event);"
|
|
7125
|
+
}
|
|
7126
|
+
]
|
|
7127
|
+
},
|
|
7128
|
+
"eventWillUnmount": {
|
|
7129
|
+
"weight": 0,
|
|
7130
|
+
"actions": [
|
|
7131
|
+
{
|
|
7132
|
+
"componentId": "",
|
|
7133
|
+
"args": {
|
|
7134
|
+
},
|
|
7135
|
+
"actionType": "custom",
|
|
7136
|
+
"script": "console.log('eventWillUnmount'); console.log(event);"
|
|
7137
|
+
}
|
|
7138
|
+
]
|
|
7139
|
+
},
|
|
7129
7140
|
}
|
|
7130
7141
|
};
|
|
7131
7142
|
return amisSchema;
|
|
@@ -8956,7 +8967,6 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
8956
8967
|
"args": {
|
|
8957
8968
|
"value": {
|
|
8958
8969
|
new_judge: "${event.data.value}",
|
|
8959
|
-
new_next_step: undefined,
|
|
8960
8970
|
next_step: undefined,
|
|
8961
8971
|
}
|
|
8962
8972
|
},
|
|
@@ -9008,7 +9018,11 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
9008
9018
|
id: "u:next_step",
|
|
9009
9019
|
multiple: false,
|
|
9010
9020
|
required: true,
|
|
9011
|
-
selectFirst: true,
|
|
9021
|
+
// selectFirst: true,
|
|
9022
|
+
autoFill: {
|
|
9023
|
+
"new_next_step": "${step}",
|
|
9024
|
+
"next_users": null
|
|
9025
|
+
},
|
|
9012
9026
|
"source": {
|
|
9013
9027
|
"url": "${context.rootUrl}/api/workflow/v2/nextStep?judge=${new_judge}",
|
|
9014
9028
|
"headers": {
|
|
@@ -9020,10 +9034,12 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
9020
9034
|
"requestAdaptor": "let { context, judge } = api.data; if(!judge){judge='approved'}\nconst formValues = SteedosUI.getRef(api.data.$scopeId).getComponentById(\"instance_form\").getValues();\n\napi.data = {\nflowVersionId: context.flowVersion._id,\n instanceId: context._id,\n flowId: context.flow._id,\n step: context.step,\n judge: judge,\n values: formValues\n}\n\n\n return api;",
|
|
9021
9035
|
"adaptor": `
|
|
9022
9036
|
payload.data = {
|
|
9037
|
+
value: payload.nextSteps.length === 1 ? payload.nextSteps[0]._id : null,
|
|
9023
9038
|
options: _.map(payload.nextSteps, (item)=>{
|
|
9024
9039
|
return {
|
|
9025
9040
|
label: item.name,
|
|
9026
|
-
value: item
|
|
9041
|
+
value: item._id,
|
|
9042
|
+
step: item
|
|
9027
9043
|
}
|
|
9028
9044
|
})
|
|
9029
9045
|
};
|
|
@@ -9036,29 +9052,29 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
9036
9052
|
"judge": "${new_judge}",
|
|
9037
9053
|
}
|
|
9038
9054
|
},
|
|
9039
|
-
"onEvent": {
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
}
|
|
9055
|
+
// "onEvent": {
|
|
9056
|
+
// "change": {
|
|
9057
|
+
// "weight": 0,
|
|
9058
|
+
// "actions": [
|
|
9059
|
+
// {
|
|
9060
|
+
// "componentId": "instance_approval",
|
|
9061
|
+
// "args": {
|
|
9062
|
+
// "value": {
|
|
9063
|
+
// new_next_step: "${event.data.value}",
|
|
9064
|
+
// }
|
|
9065
|
+
// },
|
|
9066
|
+
// "actionType": "setValue"
|
|
9067
|
+
// },
|
|
9068
|
+
// // {
|
|
9069
|
+
// // "args": {
|
|
9070
|
+
// // next_step: "${event.data.value}",
|
|
9071
|
+
// // },
|
|
9072
|
+
// // "actionType": "broadcast",
|
|
9073
|
+
// // eventName: "approve_next_step_change"
|
|
9074
|
+
// // },
|
|
9075
|
+
// ]
|
|
9076
|
+
// }
|
|
9077
|
+
// }
|
|
9062
9078
|
},
|
|
9063
9079
|
],
|
|
9064
9080
|
id: "u:4d3a884b437c",
|
|
@@ -9096,56 +9112,44 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
9096
9112
|
body: [
|
|
9097
9113
|
// TODO 处理下一步处理人默认值
|
|
9098
9114
|
Object.assign({},
|
|
9099
|
-
// await lookupToAmisPicker(
|
|
9100
|
-
// {
|
|
9101
|
-
// name: "next_users",
|
|
9102
|
-
// label: false,
|
|
9103
|
-
// reference_to: "space_users",
|
|
9104
|
-
// reference_to_field: 'user',
|
|
9105
|
-
// multiple: false,
|
|
9106
|
-
// },
|
|
9107
|
-
// false,
|
|
9108
|
-
// {}
|
|
9109
|
-
// ),
|
|
9110
9115
|
{
|
|
9111
9116
|
"type": "steedos-select-user"
|
|
9112
9117
|
},
|
|
9113
|
-
|
|
9114
9118
|
{
|
|
9115
9119
|
name: "next_users",
|
|
9116
|
-
// value: "",
|
|
9117
9120
|
hiddenOn: "this.new_next_step.deal_type != 'pickupAtRuntime'",
|
|
9118
9121
|
required: true
|
|
9119
9122
|
}),
|
|
9120
9123
|
{
|
|
9121
|
-
type: "
|
|
9124
|
+
type: "steedos-select-user",
|
|
9122
9125
|
label: "",
|
|
9123
9126
|
name: "next_users",
|
|
9124
|
-
// options: await getNextStepOptions(instance),
|
|
9125
9127
|
id: "u:next_users",
|
|
9126
9128
|
required: true,
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
"
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
"
|
|
9134
|
-
|
|
9135
|
-
|
|
9129
|
+
hiddenOn: "this.new_next_step.deal_type === 'pickupAtRuntime'",
|
|
9130
|
+
amis: {
|
|
9131
|
+
multiple: "this.new_next_step.deal_type === 'counterSign'",
|
|
9132
|
+
"source": {
|
|
9133
|
+
"url": "${context.rootUrl}/api/workflow/v2/nextStepUsers",
|
|
9134
|
+
"method": "post",
|
|
9135
|
+
"sendOn": "!!this.new_next_step && this.new_next_step.step_type != 'end'",
|
|
9136
|
+
"headers": {
|
|
9137
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
9138
|
+
},
|
|
9139
|
+
"messages": {
|
|
9140
|
+
},
|
|
9141
|
+
"requestAdaptor": "\nconst { context, next_step, $scopeId } = api.data;\nconst formValues = SteedosUI.getRef($scopeId).getComponentById(\"instance_form\").getValues();\n\napi.data = {\n instanceId: context._id,\n nextStepId: next_step._id,\n values: formValues\n}\n\n\n return api;",
|
|
9142
|
+
"adaptor": "\npayload.data = {value: payload.nextStepUsers.length === 1 ? payload.nextStepUsers[0].id : null, options: payload.nextStepUsers};\nreturn payload;",
|
|
9143
|
+
"data": {
|
|
9144
|
+
"&": "$$",
|
|
9145
|
+
"$scopeId": "$scopeId",
|
|
9146
|
+
"context": "${context}",
|
|
9147
|
+
"next_step": "${new_next_step}",
|
|
9148
|
+
}
|
|
9136
9149
|
},
|
|
9137
|
-
"
|
|
9138
|
-
"
|
|
9139
|
-
|
|
9140
|
-
"&": "$$",
|
|
9141
|
-
"$scopeId": "$scopeId",
|
|
9142
|
-
"context": "${context}",
|
|
9143
|
-
"next_step": "${new_next_step}",
|
|
9144
|
-
}
|
|
9145
|
-
},
|
|
9146
|
-
"labelField": "name",
|
|
9147
|
-
"valueField": "id",
|
|
9148
|
-
hiddenOn: "this.new_next_step.deal_type === 'pickupAtRuntime'"
|
|
9150
|
+
"labelField": "name",
|
|
9151
|
+
"valueField": "id",
|
|
9152
|
+
}
|
|
9149
9153
|
}
|
|
9150
9154
|
],
|
|
9151
9155
|
id: "u:81a4913c61cc",
|
|
@@ -9347,6 +9351,10 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
9347
9351
|
clearPersistDataAfterSubmit: true,
|
|
9348
9352
|
persistData: `workflow_approve_form_${instance.approve._id}`,
|
|
9349
9353
|
body: [
|
|
9354
|
+
{
|
|
9355
|
+
type: 'hidden',
|
|
9356
|
+
name: 'new_next_step'
|
|
9357
|
+
},
|
|
9350
9358
|
await getJudgeInput(instance),
|
|
9351
9359
|
{
|
|
9352
9360
|
type: "textarea",
|
|
@@ -9377,7 +9385,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
9377
9385
|
// {
|
|
9378
9386
|
// "actionType": "reload",
|
|
9379
9387
|
// "componentId": "u:nex_users",
|
|
9380
|
-
// "args": {
|
|
9388
|
+
// "args": {
|
|
9381
9389
|
// }
|
|
9382
9390
|
// }
|
|
9383
9391
|
// ]
|
|
@@ -9688,7 +9696,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
9688
9696
|
* @Author: baozhoutao@steedos.com
|
|
9689
9697
|
* @Date: 2022-09-07 16:20:45
|
|
9690
9698
|
* @LastEditors: baozhoutao@steedos.com
|
|
9691
|
-
* @LastEditTime: 2023-03-
|
|
9699
|
+
* @LastEditTime: 2023-03-23 16:49:44
|
|
9692
9700
|
* @Description:
|
|
9693
9701
|
*/
|
|
9694
9702
|
|
|
@@ -10252,7 +10260,6 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
10252
10260
|
trs: await getFormTrs(instance),
|
|
10253
10261
|
id: "u:047f3669468b",
|
|
10254
10262
|
};
|
|
10255
|
-
console.log(`getFormTableView formSchema=====>`, formSchema);
|
|
10256
10263
|
return formSchema;
|
|
10257
10264
|
};
|
|
10258
10265
|
|