@steedos-widgets/amis-lib 1.1.0-beta.2 → 1.1.1
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 +231 -210
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +231 -210
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +231 -210
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/calendar.d.ts +1 -129
- package/dist/types/lib/objects.d.ts +1 -129
- 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) {
|
|
@@ -3974,6 +3967,11 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
3974
3967
|
`;
|
|
3975
3968
|
source.adaptor = `
|
|
3976
3969
|
const enable_tree = ${refObjectConfig.enable_tree};
|
|
3970
|
+
const value = api.data.$self.value;
|
|
3971
|
+
if(!_.isEmpty(value)){
|
|
3972
|
+
// value 不为空值,表示返回当前选中节点信息
|
|
3973
|
+
return payload;
|
|
3974
|
+
}
|
|
3977
3975
|
if(enable_tree){
|
|
3978
3976
|
const records = payload.data.rows;
|
|
3979
3977
|
const treeRecords = [];
|
|
@@ -4278,21 +4276,20 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
4278
4276
|
// return await lookupToAmisGroup(field, readonly, ctx);
|
|
4279
4277
|
}
|
|
4280
4278
|
|
|
4281
|
-
if(ctx.ids || ctx.idsTrackOn){
|
|
4282
|
-
return await lookupToAmisIdsPicker(field, readonly, ctx);
|
|
4283
|
-
}
|
|
4284
|
-
|
|
4285
4279
|
let referenceTo = await getReferenceTo(field);
|
|
4286
4280
|
if(!referenceTo){
|
|
4287
4281
|
return await lookupToAmisSelect(field, readonly, ctx);
|
|
4288
4282
|
}
|
|
4289
4283
|
|
|
4290
|
-
const refObject = await getUISchema(referenceTo.objectName);
|
|
4291
|
-
|
|
4292
4284
|
if(referenceTo.objectName === "space_users" && field.reference_to_field === "user"){
|
|
4285
|
+
if(ctx.idsDependOn || field.amis){
|
|
4286
|
+
return await lookupToAmisIdsPicker(field, readonly, ctx);
|
|
4287
|
+
}
|
|
4293
4288
|
return await lookupToAmisSelectUser(field, readonly, ctx);
|
|
4294
4289
|
}
|
|
4295
4290
|
|
|
4291
|
+
const refObject = await getUISchema(referenceTo.objectName);
|
|
4292
|
+
|
|
4296
4293
|
// 此处不参考 steedos 的 enable_enhanced_lookup 规则. 如果默认是开启弹出选择,用户选择过程操作太繁琐, 所以默认是关闭弹出选择.
|
|
4297
4294
|
// 由于amis picker 目前不支持联动, 配置了depend_on时, 使用使用select ,以支持联动
|
|
4298
4295
|
// TODO: 确认 amis picker 支持联动时, 清理field.depend_on判断
|
|
@@ -4327,7 +4324,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
4327
4324
|
}
|
|
4328
4325
|
const refObjectConfig = await getUISchema(referenceTo.objectName);
|
|
4329
4326
|
|
|
4330
|
-
const {
|
|
4327
|
+
const { idsDependOn } = ctx;
|
|
4331
4328
|
|
|
4332
4329
|
const fields = {
|
|
4333
4330
|
[referenceTo.labelField.name]: referenceTo.labelField,
|
|
@@ -4341,14 +4338,9 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
4341
4338
|
source.data.$term = "$term";
|
|
4342
4339
|
source.data.$self = "$$";
|
|
4343
4340
|
|
|
4344
|
-
if(
|
|
4345
|
-
source.sendOn =
|
|
4346
|
-
|
|
4347
|
-
else {
|
|
4348
|
-
source.sendOn = false;
|
|
4349
|
-
}
|
|
4350
|
-
if(idsTrackOn){
|
|
4351
|
-
source.sendOn = `\${${idsTrackOn} && ${idsTrackOn}.length}`;
|
|
4341
|
+
if(idsDependOn && source.url){
|
|
4342
|
+
source.sendOn = `\${${idsDependOn} && ${idsDependOn}.length}`;
|
|
4343
|
+
source.url = `${source.url}&depend_on_${idsDependOn}=\${${idsDependOn}|join}`;
|
|
4352
4344
|
}
|
|
4353
4345
|
|
|
4354
4346
|
source.requestAdaptor = `
|
|
@@ -4365,10 +4357,10 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
4365
4357
|
}
|
|
4366
4358
|
}
|
|
4367
4359
|
|
|
4368
|
-
var ids
|
|
4369
|
-
var
|
|
4370
|
-
if(
|
|
4371
|
-
ids = api.data.$self[
|
|
4360
|
+
var ids;
|
|
4361
|
+
var idsDependOn = "${idsDependOn}";
|
|
4362
|
+
if(idsDependOn){
|
|
4363
|
+
ids = api.data.$self[idsDependOn];
|
|
4372
4364
|
}
|
|
4373
4365
|
if(ids && ids.length){
|
|
4374
4366
|
filters.push(["${referenceTo.valueField.name}", "=", ids]);
|
|
@@ -6647,7 +6639,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
6647
6639
|
const searchableFields = [];
|
|
6648
6640
|
let { filter, sort, top, setDataToComponentId = '' } = options;
|
|
6649
6641
|
|
|
6650
|
-
if(!top){
|
|
6642
|
+
if (!top) {
|
|
6651
6643
|
// 日历请求不翻页
|
|
6652
6644
|
top = 200;
|
|
6653
6645
|
}
|
|
@@ -6773,7 +6765,8 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
6773
6765
|
title: n["${calendarOptions.textExpr}"],
|
|
6774
6766
|
start: n["${calendarOptions.startDateExpr}"],
|
|
6775
6767
|
end: n["${calendarOptions.endDateExpr}"],
|
|
6776
|
-
allDay: n["${calendarOptions.allDayExpr}"]
|
|
6768
|
+
allDay: n["${calendarOptions.allDayExpr}"],
|
|
6769
|
+
extendedProps: n
|
|
6777
6770
|
}
|
|
6778
6771
|
});
|
|
6779
6772
|
const successCallback = selfData.successCallback;
|
|
@@ -6846,7 +6839,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
6846
6839
|
return payload;
|
|
6847
6840
|
`,
|
|
6848
6841
|
headers: {
|
|
6849
|
-
|
|
6842
|
+
Authorization: "Bearer ${context.tenantId},${context.authToken}"
|
|
6850
6843
|
}
|
|
6851
6844
|
};
|
|
6852
6845
|
}
|
|
@@ -6865,9 +6858,9 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
6865
6858
|
calendarOptions = Object.assign({}, DEFAULT_CALENDAR_OPTIONS, _$1.omitBy(calendarOptions, _$1.isNil));
|
|
6866
6859
|
|
|
6867
6860
|
const titleFields = calendarOptions.title || [
|
|
6868
|
-
calendarOptions.startDateExpr,
|
|
6869
|
-
calendarOptions.endDateExpr,
|
|
6870
|
-
calendarOptions.allDayExpr,
|
|
6861
|
+
calendarOptions.startDateExpr,
|
|
6862
|
+
calendarOptions.endDateExpr,
|
|
6863
|
+
calendarOptions.allDayExpr,
|
|
6871
6864
|
calendarOptions.textExpr
|
|
6872
6865
|
];
|
|
6873
6866
|
let fields = [];
|
|
@@ -6891,9 +6884,9 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
6891
6884
|
}
|
|
6892
6885
|
}
|
|
6893
6886
|
let initialView = calendarOptions.currentView;
|
|
6894
|
-
if(initialView){
|
|
6887
|
+
if (initialView) {
|
|
6895
6888
|
// day, week, month, agenda
|
|
6896
|
-
switch(initialView){
|
|
6889
|
+
switch (initialView) {
|
|
6897
6890
|
case "day":
|
|
6898
6891
|
initialView = "timeGridDay";
|
|
6899
6892
|
break;
|
|
@@ -6904,7 +6897,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
6904
6897
|
initialView = "dayGridMonth";
|
|
6905
6898
|
break;
|
|
6906
6899
|
case "agenda":
|
|
6907
|
-
initialView = "
|
|
6900
|
+
initialView = "listWeek";
|
|
6908
6901
|
break;
|
|
6909
6902
|
}
|
|
6910
6903
|
}
|
|
@@ -7000,19 +6993,154 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
7000
6993
|
const recordId = "${event.id}";
|
|
7001
6994
|
const recordPermissionsApi = getCalendarRecordPermissionsApi(objectSchema, recordId);
|
|
7002
6995
|
const recordSaveApi = getCalendarRecordSaveApi(objectSchema, calendarOptions);
|
|
7003
|
-
|
|
6996
|
+
|
|
7004
6997
|
const businessHours = {
|
|
7005
|
-
daysOfWeek: [
|
|
6998
|
+
daysOfWeek: [1, 2, 3, 4, 5],
|
|
7006
6999
|
startTime: '08:00',
|
|
7007
7000
|
endTime: '18:00',
|
|
7008
7001
|
};
|
|
7009
|
-
if(!_$1.isEmpty(calendarOptions.startDayHour)){
|
|
7002
|
+
if (!_$1.isEmpty(calendarOptions.startDayHour)) {
|
|
7010
7003
|
businessHours.startTime = `${calendarOptions.startDayHour}:00`;
|
|
7011
7004
|
}
|
|
7012
|
-
if(!_$1.isEmpty(calendarOptions.endDayHour)){
|
|
7005
|
+
if (!_$1.isEmpty(calendarOptions.endDayHour)) {
|
|
7013
7006
|
businessHours.endTime = `${calendarOptions.endDayHour}:00`;
|
|
7014
7007
|
}
|
|
7015
|
-
|
|
7008
|
+
|
|
7009
|
+
const onEvent = {
|
|
7010
|
+
"getEvents": {
|
|
7011
|
+
"weight": 0,
|
|
7012
|
+
"actions": [
|
|
7013
|
+
{
|
|
7014
|
+
"componentId": "",
|
|
7015
|
+
"args": {
|
|
7016
|
+
},
|
|
7017
|
+
"actionType": "custom",
|
|
7018
|
+
"script": onGetEventsScript
|
|
7019
|
+
}
|
|
7020
|
+
]
|
|
7021
|
+
},
|
|
7022
|
+
"select": {
|
|
7023
|
+
"weight": 0,
|
|
7024
|
+
"actions": [
|
|
7025
|
+
{
|
|
7026
|
+
"componentId": "",
|
|
7027
|
+
"args": {
|
|
7028
|
+
},
|
|
7029
|
+
"actionType": "custom",
|
|
7030
|
+
"script": onSelectScript
|
|
7031
|
+
}
|
|
7032
|
+
]
|
|
7033
|
+
},
|
|
7034
|
+
"eventClick": {
|
|
7035
|
+
"weight": 0,
|
|
7036
|
+
"actions": [
|
|
7037
|
+
{
|
|
7038
|
+
"componentId": "",
|
|
7039
|
+
"args": {
|
|
7040
|
+
},
|
|
7041
|
+
"actionType": "custom",
|
|
7042
|
+
"script": onEventClickScript
|
|
7043
|
+
}
|
|
7044
|
+
]
|
|
7045
|
+
},
|
|
7046
|
+
"eventAdd": {
|
|
7047
|
+
"weight": 0,
|
|
7048
|
+
"actions": [
|
|
7049
|
+
{
|
|
7050
|
+
"componentId": "",
|
|
7051
|
+
"args": {
|
|
7052
|
+
},
|
|
7053
|
+
"actionType": "custom",
|
|
7054
|
+
"script": "console.log('eventAdd'); console.log(event);"
|
|
7055
|
+
}
|
|
7056
|
+
]
|
|
7057
|
+
},
|
|
7058
|
+
"eventChange": {
|
|
7059
|
+
"weight": 0,
|
|
7060
|
+
"actions": [
|
|
7061
|
+
{
|
|
7062
|
+
"actionType": 'ajax',
|
|
7063
|
+
"args": {
|
|
7064
|
+
"api": recordPermissionsApi
|
|
7065
|
+
}
|
|
7066
|
+
},
|
|
7067
|
+
{
|
|
7068
|
+
"actionType": "toast",
|
|
7069
|
+
"expression": "!event.data.editable",
|
|
7070
|
+
"args": {
|
|
7071
|
+
"msgType": "error",
|
|
7072
|
+
"msg": "您没有编辑该记录的权限!",
|
|
7073
|
+
"position": "top-center"
|
|
7074
|
+
}
|
|
7075
|
+
},
|
|
7076
|
+
{
|
|
7077
|
+
"actionType": 'ajax',
|
|
7078
|
+
"expression": "event.data.editable",
|
|
7079
|
+
"args": {
|
|
7080
|
+
"api": recordSaveApi,
|
|
7081
|
+
"messages": {
|
|
7082
|
+
"success": objectSchema.label + "修改成功",
|
|
7083
|
+
"failed": objectSchema.label + "修改失败!"
|
|
7084
|
+
}
|
|
7085
|
+
}
|
|
7086
|
+
}
|
|
7087
|
+
]
|
|
7088
|
+
},
|
|
7089
|
+
"eventRemove": {
|
|
7090
|
+
"weight": 0,
|
|
7091
|
+
"actions": [
|
|
7092
|
+
{
|
|
7093
|
+
"componentId": "",
|
|
7094
|
+
"args": {
|
|
7095
|
+
},
|
|
7096
|
+
"actionType": "custom",
|
|
7097
|
+
"script": "console.log('eventRemove'); console.log(event);"
|
|
7098
|
+
}
|
|
7099
|
+
]
|
|
7100
|
+
},
|
|
7101
|
+
"eventsSet": {
|
|
7102
|
+
"weight": 0,
|
|
7103
|
+
"actions": [
|
|
7104
|
+
{
|
|
7105
|
+
"componentId": "",
|
|
7106
|
+
"args": {
|
|
7107
|
+
},
|
|
7108
|
+
"actionType": "custom",
|
|
7109
|
+
"script": "console.log('eventsSet'); console.log(event);"
|
|
7110
|
+
}
|
|
7111
|
+
]
|
|
7112
|
+
}
|
|
7113
|
+
};
|
|
7114
|
+
|
|
7115
|
+
Object.assign(onEvent, options.onEvent);
|
|
7116
|
+
|
|
7117
|
+
const config = options.config || {};
|
|
7118
|
+
if(config.eventContent && typeof config.eventContent === "string"){
|
|
7119
|
+
const hasReturn = /\breturn\b/.test(config.eventContent);
|
|
7120
|
+
if(hasReturn){
|
|
7121
|
+
try {
|
|
7122
|
+
// 如果是包括return语句的字符串,则按函数解析,见 https://fullcalendar.io/docs/content-injection
|
|
7123
|
+
let fn = new Function("arg", config.eventContent);
|
|
7124
|
+
config.eventContent = fn;
|
|
7125
|
+
} catch (e) {
|
|
7126
|
+
console.warn(e);
|
|
7127
|
+
}
|
|
7128
|
+
}
|
|
7129
|
+
}
|
|
7130
|
+
|
|
7131
|
+
if(config.noEventsContent && typeof config.noEventsContent === "string"){
|
|
7132
|
+
const hasReturn = /\breturn\b/.test(config.noEventsContent);
|
|
7133
|
+
if(hasReturn){
|
|
7134
|
+
try {
|
|
7135
|
+
// 如果是包括return语句的字符串,则按函数解析,见 https://fullcalendar.io/docs/content-injection
|
|
7136
|
+
let fn = new Function("arg", config.noEventsContent);
|
|
7137
|
+
config.noEventsContent = fn;
|
|
7138
|
+
} catch (e) {
|
|
7139
|
+
console.warn(e);
|
|
7140
|
+
}
|
|
7141
|
+
}
|
|
7142
|
+
}
|
|
7143
|
+
|
|
7016
7144
|
const amisSchema = {
|
|
7017
7145
|
"type": "steedos-fullcalendar",
|
|
7018
7146
|
"label": "",
|
|
@@ -7022,111 +7150,8 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
7022
7150
|
"selectMirror": permissions.allowCreate,
|
|
7023
7151
|
"initialView": initialView,
|
|
7024
7152
|
"businessHours": businessHours,
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
"weight": 0,
|
|
7028
|
-
"actions": [
|
|
7029
|
-
{
|
|
7030
|
-
"componentId": "",
|
|
7031
|
-
"args": {
|
|
7032
|
-
},
|
|
7033
|
-
"actionType": "custom",
|
|
7034
|
-
"script": onGetEventsScript
|
|
7035
|
-
}
|
|
7036
|
-
]
|
|
7037
|
-
},
|
|
7038
|
-
"select": {
|
|
7039
|
-
"weight": 0,
|
|
7040
|
-
"actions": [
|
|
7041
|
-
{
|
|
7042
|
-
"componentId": "",
|
|
7043
|
-
"args": {
|
|
7044
|
-
},
|
|
7045
|
-
"actionType": "custom",
|
|
7046
|
-
"script": onSelectScript
|
|
7047
|
-
}
|
|
7048
|
-
]
|
|
7049
|
-
},
|
|
7050
|
-
"eventClick": {
|
|
7051
|
-
"weight": 0,
|
|
7052
|
-
"actions": [
|
|
7053
|
-
{
|
|
7054
|
-
"componentId": "",
|
|
7055
|
-
"args": {
|
|
7056
|
-
},
|
|
7057
|
-
"actionType": "custom",
|
|
7058
|
-
"script": onEventClickScript
|
|
7059
|
-
}
|
|
7060
|
-
]
|
|
7061
|
-
},
|
|
7062
|
-
"eventAdd": {
|
|
7063
|
-
"weight": 0,
|
|
7064
|
-
"actions": [
|
|
7065
|
-
{
|
|
7066
|
-
"componentId": "",
|
|
7067
|
-
"args": {
|
|
7068
|
-
},
|
|
7069
|
-
"actionType": "custom",
|
|
7070
|
-
"script": "console.log('eventAdd'); console.log(event);"
|
|
7071
|
-
}
|
|
7072
|
-
]
|
|
7073
|
-
},
|
|
7074
|
-
"eventChange": {
|
|
7075
|
-
"weight": 0,
|
|
7076
|
-
"actions": [
|
|
7077
|
-
{
|
|
7078
|
-
"actionType": 'ajax',
|
|
7079
|
-
"args": {
|
|
7080
|
-
"api": recordPermissionsApi
|
|
7081
|
-
}
|
|
7082
|
-
},
|
|
7083
|
-
{
|
|
7084
|
-
"actionType": "toast",
|
|
7085
|
-
"expression": "!event.data.editable",
|
|
7086
|
-
"args": {
|
|
7087
|
-
"msgType": "error",
|
|
7088
|
-
"msg": "您没有编辑该记录的权限!",
|
|
7089
|
-
"position": "top-center"
|
|
7090
|
-
}
|
|
7091
|
-
},
|
|
7092
|
-
{
|
|
7093
|
-
"actionType": 'ajax',
|
|
7094
|
-
"expression": "event.data.editable",
|
|
7095
|
-
"args": {
|
|
7096
|
-
"api": recordSaveApi,
|
|
7097
|
-
"messages": {
|
|
7098
|
-
"success": objectSchema.label + "修改成功",
|
|
7099
|
-
"failed": objectSchema.label + "修改失败!"
|
|
7100
|
-
}
|
|
7101
|
-
}
|
|
7102
|
-
}
|
|
7103
|
-
]
|
|
7104
|
-
},
|
|
7105
|
-
"eventRemove": {
|
|
7106
|
-
"weight": 0,
|
|
7107
|
-
"actions": [
|
|
7108
|
-
{
|
|
7109
|
-
"componentId": "",
|
|
7110
|
-
"args": {
|
|
7111
|
-
},
|
|
7112
|
-
"actionType": "custom",
|
|
7113
|
-
"script": "console.log('eventRemove'); console.log(event);"
|
|
7114
|
-
}
|
|
7115
|
-
]
|
|
7116
|
-
},
|
|
7117
|
-
"eventsSet": {
|
|
7118
|
-
"weight": 0,
|
|
7119
|
-
"actions": [
|
|
7120
|
-
{
|
|
7121
|
-
"componentId": "",
|
|
7122
|
-
"args": {
|
|
7123
|
-
},
|
|
7124
|
-
"actionType": "custom",
|
|
7125
|
-
"script": "console.log('eventsSet'); console.log(event);"
|
|
7126
|
-
}
|
|
7127
|
-
]
|
|
7128
|
-
},
|
|
7129
|
-
}
|
|
7153
|
+
...config,
|
|
7154
|
+
"onEvent": onEvent
|
|
7130
7155
|
};
|
|
7131
7156
|
return amisSchema;
|
|
7132
7157
|
}
|
|
@@ -8956,7 +8981,6 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
8956
8981
|
"args": {
|
|
8957
8982
|
"value": {
|
|
8958
8983
|
new_judge: "${event.data.value}",
|
|
8959
|
-
new_next_step: undefined,
|
|
8960
8984
|
next_step: undefined,
|
|
8961
8985
|
}
|
|
8962
8986
|
},
|
|
@@ -9008,7 +9032,11 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
9008
9032
|
id: "u:next_step",
|
|
9009
9033
|
multiple: false,
|
|
9010
9034
|
required: true,
|
|
9011
|
-
selectFirst: true,
|
|
9035
|
+
// selectFirst: true,
|
|
9036
|
+
autoFill: {
|
|
9037
|
+
"new_next_step": "${step}",
|
|
9038
|
+
"next_users": null
|
|
9039
|
+
},
|
|
9012
9040
|
"source": {
|
|
9013
9041
|
"url": "${context.rootUrl}/api/workflow/v2/nextStep?judge=${new_judge}",
|
|
9014
9042
|
"headers": {
|
|
@@ -9020,10 +9048,12 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
9020
9048
|
"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
9049
|
"adaptor": `
|
|
9022
9050
|
payload.data = {
|
|
9051
|
+
value: payload.nextSteps.length === 1 ? payload.nextSteps[0]._id : null,
|
|
9023
9052
|
options: _.map(payload.nextSteps, (item)=>{
|
|
9024
9053
|
return {
|
|
9025
9054
|
label: item.name,
|
|
9026
|
-
value: item
|
|
9055
|
+
value: item._id,
|
|
9056
|
+
step: item
|
|
9027
9057
|
}
|
|
9028
9058
|
})
|
|
9029
9059
|
};
|
|
@@ -9036,29 +9066,29 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
9036
9066
|
"judge": "${new_judge}",
|
|
9037
9067
|
}
|
|
9038
9068
|
},
|
|
9039
|
-
"onEvent": {
|
|
9040
|
-
|
|
9041
|
-
|
|
9042
|
-
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
}
|
|
9069
|
+
// "onEvent": {
|
|
9070
|
+
// "change": {
|
|
9071
|
+
// "weight": 0,
|
|
9072
|
+
// "actions": [
|
|
9073
|
+
// {
|
|
9074
|
+
// "componentId": "instance_approval",
|
|
9075
|
+
// "args": {
|
|
9076
|
+
// "value": {
|
|
9077
|
+
// new_next_step: "${event.data.value}",
|
|
9078
|
+
// }
|
|
9079
|
+
// },
|
|
9080
|
+
// "actionType": "setValue"
|
|
9081
|
+
// },
|
|
9082
|
+
// // {
|
|
9083
|
+
// // "args": {
|
|
9084
|
+
// // next_step: "${event.data.value}",
|
|
9085
|
+
// // },
|
|
9086
|
+
// // "actionType": "broadcast",
|
|
9087
|
+
// // eventName: "approve_next_step_change"
|
|
9088
|
+
// // },
|
|
9089
|
+
// ]
|
|
9090
|
+
// }
|
|
9091
|
+
// }
|
|
9062
9092
|
},
|
|
9063
9093
|
],
|
|
9064
9094
|
id: "u:4d3a884b437c",
|
|
@@ -9096,56 +9126,44 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
9096
9126
|
body: [
|
|
9097
9127
|
// TODO 处理下一步处理人默认值
|
|
9098
9128
|
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
9129
|
{
|
|
9111
9130
|
"type": "steedos-select-user"
|
|
9112
9131
|
},
|
|
9113
|
-
|
|
9114
9132
|
{
|
|
9115
9133
|
name: "next_users",
|
|
9116
|
-
// value: "",
|
|
9117
9134
|
hiddenOn: "this.new_next_step.deal_type != 'pickupAtRuntime'",
|
|
9118
9135
|
required: true
|
|
9119
9136
|
}),
|
|
9120
9137
|
{
|
|
9121
|
-
type: "
|
|
9138
|
+
type: "steedos-select-user",
|
|
9122
9139
|
label: "",
|
|
9123
9140
|
name: "next_users",
|
|
9124
|
-
// options: await getNextStepOptions(instance),
|
|
9125
9141
|
id: "u:next_users",
|
|
9126
9142
|
required: true,
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
|
|
9130
|
-
"
|
|
9131
|
-
|
|
9132
|
-
|
|
9133
|
-
"
|
|
9134
|
-
|
|
9135
|
-
|
|
9143
|
+
hiddenOn: "this.new_next_step.deal_type === 'pickupAtRuntime'",
|
|
9144
|
+
amis: {
|
|
9145
|
+
multiple: "this.new_next_step.deal_type === 'counterSign'",
|
|
9146
|
+
"source": {
|
|
9147
|
+
"url": "${context.rootUrl}/api/workflow/v2/nextStepUsers",
|
|
9148
|
+
"method": "post",
|
|
9149
|
+
"sendOn": "!!this.new_next_step && this.new_next_step.step_type != 'end'",
|
|
9150
|
+
"headers": {
|
|
9151
|
+
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
9152
|
+
},
|
|
9153
|
+
"messages": {
|
|
9154
|
+
},
|
|
9155
|
+
"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;",
|
|
9156
|
+
"adaptor": "\npayload.data = {value: payload.nextStepUsers.length === 1 ? payload.nextStepUsers[0].id : null, options: payload.nextStepUsers};\nreturn payload;",
|
|
9157
|
+
"data": {
|
|
9158
|
+
"&": "$$",
|
|
9159
|
+
"$scopeId": "$scopeId",
|
|
9160
|
+
"context": "${context}",
|
|
9161
|
+
"next_step": "${new_next_step}",
|
|
9162
|
+
}
|
|
9136
9163
|
},
|
|
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'"
|
|
9164
|
+
"labelField": "name",
|
|
9165
|
+
"valueField": "id",
|
|
9166
|
+
}
|
|
9149
9167
|
}
|
|
9150
9168
|
],
|
|
9151
9169
|
id: "u:81a4913c61cc",
|
|
@@ -9347,6 +9365,10 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
9347
9365
|
clearPersistDataAfterSubmit: true,
|
|
9348
9366
|
persistData: `workflow_approve_form_${instance.approve._id}`,
|
|
9349
9367
|
body: [
|
|
9368
|
+
{
|
|
9369
|
+
type: 'hidden',
|
|
9370
|
+
name: 'new_next_step'
|
|
9371
|
+
},
|
|
9350
9372
|
await getJudgeInput(instance),
|
|
9351
9373
|
{
|
|
9352
9374
|
type: "textarea",
|
|
@@ -9377,7 +9399,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
9377
9399
|
// {
|
|
9378
9400
|
// "actionType": "reload",
|
|
9379
9401
|
// "componentId": "u:nex_users",
|
|
9380
|
-
// "args": {
|
|
9402
|
+
// "args": {
|
|
9381
9403
|
// }
|
|
9382
9404
|
// }
|
|
9383
9405
|
// ]
|
|
@@ -9688,7 +9710,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
9688
9710
|
* @Author: baozhoutao@steedos.com
|
|
9689
9711
|
* @Date: 2022-09-07 16:20:45
|
|
9690
9712
|
* @LastEditors: baozhoutao@steedos.com
|
|
9691
|
-
* @LastEditTime: 2023-03-
|
|
9713
|
+
* @LastEditTime: 2023-03-23 16:49:44
|
|
9692
9714
|
* @Description:
|
|
9693
9715
|
*/
|
|
9694
9716
|
|
|
@@ -10252,7 +10274,6 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
|
|
|
10252
10274
|
trs: await getFormTrs(instance),
|
|
10253
10275
|
id: "u:047f3669468b",
|
|
10254
10276
|
};
|
|
10255
|
-
console.log(`getFormTableView formSchema=====>`, formSchema);
|
|
10256
10277
|
return formSchema;
|
|
10257
10278
|
};
|
|
10258
10279
|
|