@steedos-widgets/amis-object 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.
@@ -1434,17 +1434,10 @@
1434
1434
  data.$value = `$${valueField}`;
1435
1435
  // data["&"] = "$$";
1436
1436
 
1437
- const fieldValue = ctx.value;
1438
-
1439
1437
  const requestAdaptor = `
1440
1438
  var filters = [['parent', '=', null]];
1441
1439
  api.data.query = api.data.query.replace(/{__filters}/g, JSON.stringify(filters));
1442
1440
  var defaultValue = api.data.$value;
1443
- var fieldValue = ${JSON.stringify(fieldValue)};
1444
- if(!defaultValue && fieldValue){
1445
- // 如果表单中没有字段值,则认字段上配置的value属性
1446
- defaultValue = fieldValue;
1447
- }
1448
1441
  var optionsFiltersOp = "${field.multiple ? "in" : "="}";
1449
1442
  var optionsFilters = [["user", optionsFiltersOp, []]];
1450
1443
  if (defaultValue) {
@@ -4333,6 +4326,11 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
4333
4326
  `;
4334
4327
  source.adaptor = `
4335
4328
  const enable_tree = ${refObjectConfig.enable_tree};
4329
+ const value = api.data.$self.value;
4330
+ if(!_.isEmpty(value)){
4331
+ // value 不为空值,表示返回当前选中节点信息
4332
+ return payload;
4333
+ }
4336
4334
  if(enable_tree){
4337
4335
  const records = payload.data.rows;
4338
4336
  const treeRecords = [];
@@ -4637,21 +4635,20 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
4637
4635
  // return await lookupToAmisGroup(field, readonly, ctx);
4638
4636
  }
4639
4637
 
4640
- if(ctx.ids || ctx.idsTrackOn){
4641
- return await lookupToAmisIdsPicker(field, readonly, ctx);
4642
- }
4643
-
4644
4638
  let referenceTo = await getReferenceTo(field);
4645
4639
  if(!referenceTo){
4646
4640
  return await lookupToAmisSelect(field, readonly, ctx);
4647
4641
  }
4648
4642
 
4649
- const refObject = await getUISchema(referenceTo.objectName);
4650
-
4651
4643
  if(referenceTo.objectName === "space_users" && field.reference_to_field === "user"){
4644
+ if(ctx.idsDependOn || field.amis){
4645
+ return await lookupToAmisIdsPicker(field, readonly, ctx);
4646
+ }
4652
4647
  return await lookupToAmisSelectUser(field, readonly, ctx);
4653
4648
  }
4654
4649
 
4650
+ const refObject = await getUISchema(referenceTo.objectName);
4651
+
4655
4652
  // 此处不参考 steedos 的 enable_enhanced_lookup 规则. 如果默认是开启弹出选择,用户选择过程操作太繁琐, 所以默认是关闭弹出选择.
4656
4653
  // 由于amis picker 目前不支持联动, 配置了depend_on时, 使用使用select ,以支持联动
4657
4654
  // TODO: 确认 amis picker 支持联动时, 清理field.depend_on判断
@@ -4686,7 +4683,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
4686
4683
  }
4687
4684
  const refObjectConfig = await getUISchema(referenceTo.objectName);
4688
4685
 
4689
- const { ids, idsTrackOn } = ctx;
4686
+ const { idsDependOn } = ctx;
4690
4687
 
4691
4688
  const fields = {
4692
4689
  [referenceTo.labelField.name]: referenceTo.labelField,
@@ -4700,14 +4697,9 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
4700
4697
  source.data.$term = "$term";
4701
4698
  source.data.$self = "$$";
4702
4699
 
4703
- if(ids && ids.length){
4704
- source.sendOn = true;
4705
- }
4706
- else {
4707
- source.sendOn = false;
4708
- }
4709
- if(idsTrackOn){
4710
- source.sendOn = `\${${idsTrackOn} && ${idsTrackOn}.length}`;
4700
+ if(idsDependOn && source.url){
4701
+ source.sendOn = `\${${idsDependOn} && ${idsDependOn}.length}`;
4702
+ source.url = `${source.url}&depend_on_${idsDependOn}=\${${idsDependOn}|join}`;
4711
4703
  }
4712
4704
 
4713
4705
  source.requestAdaptor = `
@@ -4724,10 +4716,10 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
4724
4716
  }
4725
4717
  }
4726
4718
 
4727
- var ids = ${JSON.stringify(ids)};
4728
- var idsTrackOn = "${idsTrackOn}";
4729
- if(idsTrackOn){
4730
- ids = api.data.$self[idsTrackOn];
4719
+ var ids;
4720
+ var idsDependOn = "${idsDependOn}";
4721
+ if(idsDependOn){
4722
+ ids = api.data.$self[idsDependOn];
4731
4723
  }
4732
4724
  if(ids && ids.length){
4733
4725
  filters.push(["${referenceTo.valueField.name}", "=", ids]);
@@ -7006,7 +6998,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
7006
6998
  const searchableFields = [];
7007
6999
  let { filter, sort, top, setDataToComponentId = '' } = options;
7008
7000
 
7009
- if(!top){
7001
+ if (!top) {
7010
7002
  // 日历请求不翻页
7011
7003
  top = 200;
7012
7004
  }
@@ -7132,7 +7124,8 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
7132
7124
  title: n["${calendarOptions.textExpr}"],
7133
7125
  start: n["${calendarOptions.startDateExpr}"],
7134
7126
  end: n["${calendarOptions.endDateExpr}"],
7135
- allDay: n["${calendarOptions.allDayExpr}"]
7127
+ allDay: n["${calendarOptions.allDayExpr}"],
7128
+ extendedProps: n
7136
7129
  }
7137
7130
  });
7138
7131
  const successCallback = selfData.successCallback;
@@ -7205,7 +7198,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
7205
7198
  return payload;
7206
7199
  `,
7207
7200
  headers: {
7208
- Authorization: "Bearer ${context.tenantId},${context.authToken}"
7201
+ Authorization: "Bearer ${context.tenantId},${context.authToken}"
7209
7202
  }
7210
7203
  };
7211
7204
  }
@@ -7224,9 +7217,9 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
7224
7217
  calendarOptions = Object.assign({}, DEFAULT_CALENDAR_OPTIONS, ___default.omitBy(calendarOptions, ___default.isNil));
7225
7218
 
7226
7219
  const titleFields = calendarOptions.title || [
7227
- calendarOptions.startDateExpr,
7228
- calendarOptions.endDateExpr,
7229
- calendarOptions.allDayExpr,
7220
+ calendarOptions.startDateExpr,
7221
+ calendarOptions.endDateExpr,
7222
+ calendarOptions.allDayExpr,
7230
7223
  calendarOptions.textExpr
7231
7224
  ];
7232
7225
  let fields = [];
@@ -7250,9 +7243,9 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
7250
7243
  }
7251
7244
  }
7252
7245
  let initialView = calendarOptions.currentView;
7253
- if(initialView){
7246
+ if (initialView) {
7254
7247
  // day, week, month, agenda
7255
- switch(initialView){
7248
+ switch (initialView) {
7256
7249
  case "day":
7257
7250
  initialView = "timeGridDay";
7258
7251
  break;
@@ -7263,7 +7256,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
7263
7256
  initialView = "dayGridMonth";
7264
7257
  break;
7265
7258
  case "agenda":
7266
- initialView = "timeGridDay";
7259
+ initialView = "listWeek";
7267
7260
  break;
7268
7261
  }
7269
7262
  }
@@ -7359,19 +7352,154 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
7359
7352
  const recordId = "${event.id}";
7360
7353
  const recordPermissionsApi = getCalendarRecordPermissionsApi(objectSchema, recordId);
7361
7354
  const recordSaveApi = getCalendarRecordSaveApi(objectSchema, calendarOptions);
7362
-
7355
+
7363
7356
  const businessHours = {
7364
- daysOfWeek: [ 1, 2, 3, 4, 5 ],
7357
+ daysOfWeek: [1, 2, 3, 4, 5],
7365
7358
  startTime: '08:00',
7366
7359
  endTime: '18:00',
7367
7360
  };
7368
- if(!___default.isEmpty(calendarOptions.startDayHour)){
7361
+ if (!___default.isEmpty(calendarOptions.startDayHour)) {
7369
7362
  businessHours.startTime = `${calendarOptions.startDayHour}:00`;
7370
7363
  }
7371
- if(!___default.isEmpty(calendarOptions.endDayHour)){
7364
+ if (!___default.isEmpty(calendarOptions.endDayHour)) {
7372
7365
  businessHours.endTime = `${calendarOptions.endDayHour}:00`;
7373
7366
  }
7374
-
7367
+
7368
+ const onEvent = {
7369
+ "getEvents": {
7370
+ "weight": 0,
7371
+ "actions": [
7372
+ {
7373
+ "componentId": "",
7374
+ "args": {
7375
+ },
7376
+ "actionType": "custom",
7377
+ "script": onGetEventsScript
7378
+ }
7379
+ ]
7380
+ },
7381
+ "select": {
7382
+ "weight": 0,
7383
+ "actions": [
7384
+ {
7385
+ "componentId": "",
7386
+ "args": {
7387
+ },
7388
+ "actionType": "custom",
7389
+ "script": onSelectScript
7390
+ }
7391
+ ]
7392
+ },
7393
+ "eventClick": {
7394
+ "weight": 0,
7395
+ "actions": [
7396
+ {
7397
+ "componentId": "",
7398
+ "args": {
7399
+ },
7400
+ "actionType": "custom",
7401
+ "script": onEventClickScript
7402
+ }
7403
+ ]
7404
+ },
7405
+ "eventAdd": {
7406
+ "weight": 0,
7407
+ "actions": [
7408
+ {
7409
+ "componentId": "",
7410
+ "args": {
7411
+ },
7412
+ "actionType": "custom",
7413
+ "script": "console.log('eventAdd'); console.log(event);"
7414
+ }
7415
+ ]
7416
+ },
7417
+ "eventChange": {
7418
+ "weight": 0,
7419
+ "actions": [
7420
+ {
7421
+ "actionType": 'ajax',
7422
+ "args": {
7423
+ "api": recordPermissionsApi
7424
+ }
7425
+ },
7426
+ {
7427
+ "actionType": "toast",
7428
+ "expression": "!event.data.editable",
7429
+ "args": {
7430
+ "msgType": "error",
7431
+ "msg": "您没有编辑该记录的权限!",
7432
+ "position": "top-center"
7433
+ }
7434
+ },
7435
+ {
7436
+ "actionType": 'ajax',
7437
+ "expression": "event.data.editable",
7438
+ "args": {
7439
+ "api": recordSaveApi,
7440
+ "messages": {
7441
+ "success": objectSchema.label + "修改成功",
7442
+ "failed": objectSchema.label + "修改失败!"
7443
+ }
7444
+ }
7445
+ }
7446
+ ]
7447
+ },
7448
+ "eventRemove": {
7449
+ "weight": 0,
7450
+ "actions": [
7451
+ {
7452
+ "componentId": "",
7453
+ "args": {
7454
+ },
7455
+ "actionType": "custom",
7456
+ "script": "console.log('eventRemove'); console.log(event);"
7457
+ }
7458
+ ]
7459
+ },
7460
+ "eventsSet": {
7461
+ "weight": 0,
7462
+ "actions": [
7463
+ {
7464
+ "componentId": "",
7465
+ "args": {
7466
+ },
7467
+ "actionType": "custom",
7468
+ "script": "console.log('eventsSet'); console.log(event);"
7469
+ }
7470
+ ]
7471
+ }
7472
+ };
7473
+
7474
+ Object.assign(onEvent, options.onEvent);
7475
+
7476
+ const config = options.config || {};
7477
+ if(config.eventContent && typeof config.eventContent === "string"){
7478
+ const hasReturn = /\breturn\b/.test(config.eventContent);
7479
+ if(hasReturn){
7480
+ try {
7481
+ // 如果是包括return语句的字符串,则按函数解析,见 https://fullcalendar.io/docs/content-injection
7482
+ let fn = new Function("arg", config.eventContent);
7483
+ config.eventContent = fn;
7484
+ } catch (e) {
7485
+ console.warn(e);
7486
+ }
7487
+ }
7488
+ }
7489
+
7490
+ if(config.noEventsContent && typeof config.noEventsContent === "string"){
7491
+ const hasReturn = /\breturn\b/.test(config.noEventsContent);
7492
+ if(hasReturn){
7493
+ try {
7494
+ // 如果是包括return语句的字符串,则按函数解析,见 https://fullcalendar.io/docs/content-injection
7495
+ let fn = new Function("arg", config.noEventsContent);
7496
+ config.noEventsContent = fn;
7497
+ } catch (e) {
7498
+ console.warn(e);
7499
+ }
7500
+ }
7501
+ }
7502
+
7375
7503
  const amisSchema = {
7376
7504
  "type": "steedos-fullcalendar",
7377
7505
  "label": "",
@@ -7381,111 +7509,8 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
7381
7509
  "selectMirror": permissions.allowCreate,
7382
7510
  "initialView": initialView,
7383
7511
  "businessHours": businessHours,
7384
- "onEvent": {
7385
- "getEvents": {
7386
- "weight": 0,
7387
- "actions": [
7388
- {
7389
- "componentId": "",
7390
- "args": {
7391
- },
7392
- "actionType": "custom",
7393
- "script": onGetEventsScript
7394
- }
7395
- ]
7396
- },
7397
- "select": {
7398
- "weight": 0,
7399
- "actions": [
7400
- {
7401
- "componentId": "",
7402
- "args": {
7403
- },
7404
- "actionType": "custom",
7405
- "script": onSelectScript
7406
- }
7407
- ]
7408
- },
7409
- "eventClick": {
7410
- "weight": 0,
7411
- "actions": [
7412
- {
7413
- "componentId": "",
7414
- "args": {
7415
- },
7416
- "actionType": "custom",
7417
- "script": onEventClickScript
7418
- }
7419
- ]
7420
- },
7421
- "eventAdd": {
7422
- "weight": 0,
7423
- "actions": [
7424
- {
7425
- "componentId": "",
7426
- "args": {
7427
- },
7428
- "actionType": "custom",
7429
- "script": "console.log('eventAdd'); console.log(event);"
7430
- }
7431
- ]
7432
- },
7433
- "eventChange": {
7434
- "weight": 0,
7435
- "actions": [
7436
- {
7437
- "actionType": 'ajax',
7438
- "args": {
7439
- "api": recordPermissionsApi
7440
- }
7441
- },
7442
- {
7443
- "actionType": "toast",
7444
- "expression": "!event.data.editable",
7445
- "args": {
7446
- "msgType": "error",
7447
- "msg": "您没有编辑该记录的权限!",
7448
- "position": "top-center"
7449
- }
7450
- },
7451
- {
7452
- "actionType": 'ajax',
7453
- "expression": "event.data.editable",
7454
- "args": {
7455
- "api": recordSaveApi,
7456
- "messages": {
7457
- "success": objectSchema.label + "修改成功",
7458
- "failed": objectSchema.label + "修改失败!"
7459
- }
7460
- }
7461
- }
7462
- ]
7463
- },
7464
- "eventRemove": {
7465
- "weight": 0,
7466
- "actions": [
7467
- {
7468
- "componentId": "",
7469
- "args": {
7470
- },
7471
- "actionType": "custom",
7472
- "script": "console.log('eventRemove'); console.log(event);"
7473
- }
7474
- ]
7475
- },
7476
- "eventsSet": {
7477
- "weight": 0,
7478
- "actions": [
7479
- {
7480
- "componentId": "",
7481
- "args": {
7482
- },
7483
- "actionType": "custom",
7484
- "script": "console.log('eventsSet'); console.log(event);"
7485
- }
7486
- ]
7487
- },
7488
- }
7512
+ ...config,
7513
+ "onEvent": onEvent
7489
7514
  };
7490
7515
  return amisSchema;
7491
7516
  }
@@ -9315,7 +9340,6 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
9315
9340
  "args": {
9316
9341
  "value": {
9317
9342
  new_judge: "${event.data.value}",
9318
- new_next_step: undefined,
9319
9343
  next_step: undefined,
9320
9344
  }
9321
9345
  },
@@ -9367,7 +9391,11 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
9367
9391
  id: "u:next_step",
9368
9392
  multiple: false,
9369
9393
  required: true,
9370
- selectFirst: true,
9394
+ // selectFirst: true,
9395
+ autoFill: {
9396
+ "new_next_step": "${step}",
9397
+ "next_users": null
9398
+ },
9371
9399
  "source": {
9372
9400
  "url": "${context.rootUrl}/api/workflow/v2/nextStep?judge=${new_judge}",
9373
9401
  "headers": {
@@ -9379,10 +9407,12 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
9379
9407
  "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;",
9380
9408
  "adaptor": `
9381
9409
  payload.data = {
9410
+ value: payload.nextSteps.length === 1 ? payload.nextSteps[0]._id : null,
9382
9411
  options: _.map(payload.nextSteps, (item)=>{
9383
9412
  return {
9384
9413
  label: item.name,
9385
- value: item
9414
+ value: item._id,
9415
+ step: item
9386
9416
  }
9387
9417
  })
9388
9418
  };
@@ -9395,29 +9425,29 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
9395
9425
  "judge": "${new_judge}",
9396
9426
  }
9397
9427
  },
9398
- "onEvent": {
9399
- "change": {
9400
- "weight": 0,
9401
- "actions": [
9402
- {
9403
- "componentId": "instance_approval",
9404
- "args": {
9405
- "value": {
9406
- new_next_step: "${event.data.value}",
9407
- }
9408
- },
9409
- "actionType": "setValue"
9410
- },
9411
- {
9412
- "args": {
9413
- next_step: "${event.data.value}",
9414
- },
9415
- "actionType": "broadcast",
9416
- eventName: "approve_next_step_change"
9417
- },
9418
- ]
9419
- }
9420
- }
9428
+ // "onEvent": {
9429
+ // "change": {
9430
+ // "weight": 0,
9431
+ // "actions": [
9432
+ // {
9433
+ // "componentId": "instance_approval",
9434
+ // "args": {
9435
+ // "value": {
9436
+ // new_next_step: "${event.data.value}",
9437
+ // }
9438
+ // },
9439
+ // "actionType": "setValue"
9440
+ // },
9441
+ // // {
9442
+ // // "args": {
9443
+ // // next_step: "${event.data.value}",
9444
+ // // },
9445
+ // // "actionType": "broadcast",
9446
+ // // eventName: "approve_next_step_change"
9447
+ // // },
9448
+ // ]
9449
+ // }
9450
+ // }
9421
9451
  },
9422
9452
  ],
9423
9453
  id: "u:4d3a884b437c",
@@ -9455,56 +9485,44 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
9455
9485
  body: [
9456
9486
  // TODO 处理下一步处理人默认值
9457
9487
  Object.assign({},
9458
- // await lookupToAmisPicker(
9459
- // {
9460
- // name: "next_users",
9461
- // label: false,
9462
- // reference_to: "space_users",
9463
- // reference_to_field: 'user',
9464
- // multiple: false,
9465
- // },
9466
- // false,
9467
- // {}
9468
- // ),
9469
9488
  {
9470
9489
  "type": "steedos-select-user"
9471
9490
  },
9472
-
9473
9491
  {
9474
9492
  name: "next_users",
9475
- // value: "",
9476
9493
  hiddenOn: "this.new_next_step.deal_type != 'pickupAtRuntime'",
9477
9494
  required: true
9478
9495
  }),
9479
9496
  {
9480
- type: "list-select",
9497
+ type: "steedos-select-user",
9481
9498
  label: "",
9482
9499
  name: "next_users",
9483
- // options: await getNextStepOptions(instance),
9484
9500
  id: "u:next_users",
9485
9501
  required: true,
9486
- multiple: "this.new_next_step.deal_type === 'counterSign'",
9487
- "source": {
9488
- "url": "${context.rootUrl}/api/workflow/v2/nextStepUsers",
9489
- "method": "post",
9490
- "sendOn": "!!this.new_next_step && this.new_next_step.step_type != 'end'",
9491
- "headers": {
9492
- "Authorization": "Bearer ${context.tenantId},${context.authToken}"
9493
- },
9494
- "messages": {
9502
+ hiddenOn: "this.new_next_step.deal_type === 'pickupAtRuntime'",
9503
+ amis: {
9504
+ multiple: "this.new_next_step.deal_type === 'counterSign'",
9505
+ "source": {
9506
+ "url": "${context.rootUrl}/api/workflow/v2/nextStepUsers",
9507
+ "method": "post",
9508
+ "sendOn": "!!this.new_next_step && this.new_next_step.step_type != 'end'",
9509
+ "headers": {
9510
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
9511
+ },
9512
+ "messages": {
9513
+ },
9514
+ "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;",
9515
+ "adaptor": "\npayload.data = {value: payload.nextStepUsers.length === 1 ? payload.nextStepUsers[0].id : null, options: payload.nextStepUsers};\nreturn payload;",
9516
+ "data": {
9517
+ "&": "$$",
9518
+ "$scopeId": "$scopeId",
9519
+ "context": "${context}",
9520
+ "next_step": "${new_next_step}",
9521
+ }
9495
9522
  },
9496
- "requestAdaptor": "console.log('======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;",
9497
- "adaptor": "\npayload.data = payload.nextStepUsers;\nreturn payload;",
9498
- "data": {
9499
- "&": "$$",
9500
- "$scopeId": "$scopeId",
9501
- "context": "${context}",
9502
- "next_step": "${new_next_step}",
9503
- }
9504
- },
9505
- "labelField": "name",
9506
- "valueField": "id",
9507
- hiddenOn: "this.new_next_step.deal_type === 'pickupAtRuntime'"
9523
+ "labelField": "name",
9524
+ "valueField": "id",
9525
+ }
9508
9526
  }
9509
9527
  ],
9510
9528
  id: "u:81a4913c61cc",
@@ -9706,6 +9724,10 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
9706
9724
  clearPersistDataAfterSubmit: true,
9707
9725
  persistData: `workflow_approve_form_${instance.approve._id}`,
9708
9726
  body: [
9727
+ {
9728
+ type: 'hidden',
9729
+ name: 'new_next_step'
9730
+ },
9709
9731
  await getJudgeInput(instance),
9710
9732
  {
9711
9733
  type: "textarea",
@@ -9736,7 +9758,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
9736
9758
  // {
9737
9759
  // "actionType": "reload",
9738
9760
  // "componentId": "u:nex_users",
9739
- // "args": {t
9761
+ // "args": {
9740
9762
  // }
9741
9763
  // }
9742
9764
  // ]
@@ -10047,7 +10069,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
10047
10069
  * @Author: baozhoutao@steedos.com
10048
10070
  * @Date: 2022-09-07 16:20:45
10049
10071
  * @LastEditors: baozhoutao@steedos.com
10050
- * @LastEditTime: 2023-03-22 14:43:18
10072
+ * @LastEditTime: 2023-03-23 16:49:44
10051
10073
  * @Description:
10052
10074
  */
10053
10075
 
@@ -10611,7 +10633,6 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
10611
10633
  trs: await getFormTrs(instance),
10612
10634
  id: "u:047f3669468b",
10613
10635
  };
10614
- console.log(`getFormTableView formSchema=====>`, formSchema);
10615
10636
  return formSchema;
10616
10637
  };
10617
10638
 
@@ -12053,11 +12074,12 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
12053
12074
  }); };
12054
12075
 
12055
12076
  var AmisObjectCalendar = function (props) { return __awaiter(void 0, void 0, void 0, function () {
12056
- var top, sort, filters, filtersFunction, title, currentView, startDateExpr, endDateExpr, allDayExpr, textExpr, data, defaultData, _a, className, objectApiName, amisSchemaData, schema, uiSchema, amisSchema, serviceData;
12077
+ var top, sort, filters, filtersFunction, title, currentView, startDateExpr, endDateExpr, allDayExpr, textExpr, data, defaultData, _a, className, onEvent, config, objectApiName, amisSchemaData, schema, uiSchema, amisSchema, serviceData;
12057
12078
  return __generator(this, function (_b) {
12058
12079
  switch (_b.label) {
12059
12080
  case 0:
12060
- props.$schema, top = props.top, sort = props.sort, filters = props.filters, filtersFunction = props.filtersFunction, title = props.title, currentView = props.currentView, startDateExpr = props.startDateExpr, endDateExpr = props.endDateExpr, allDayExpr = props.allDayExpr, textExpr = props.textExpr, data = props.data, defaultData = props.defaultData, _a = props.className, className = _a === void 0 ? "" : _a;
12081
+ console.log("AmisObjectCalendar props", props);
12082
+ props.$schema, top = props.top, sort = props.sort, filters = props.filters, filtersFunction = props.filtersFunction, title = props.title, currentView = props.currentView, startDateExpr = props.startDateExpr, endDateExpr = props.endDateExpr, allDayExpr = props.allDayExpr, textExpr = props.textExpr, data = props.data, defaultData = props.defaultData, _a = props.className, className = _a === void 0 ? "" : _a, onEvent = props.onEvent, config = props.config;
12061
12083
  objectApiName = props.objectApiName || "events";
12062
12084
  amisSchemaData = Object.assign({}, data, defaultData);
12063
12085
  return [4 /*yield*/, getCalendarSchema(amisSchemaData.appId, objectApiName, {
@@ -12067,7 +12089,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
12067
12089
  endDateExpr: endDateExpr,
12068
12090
  allDayExpr: allDayExpr,
12069
12091
  textExpr: textExpr
12070
- }, { top: top, sort: sort, filter: filters, filtersFunction: filtersFunction })];
12092
+ }, { top: top, sort: sort, filter: filters, filtersFunction: filtersFunction, onEvent: onEvent, config: config })];
12071
12093
  case 1:
12072
12094
  schema = (_b.sent());
12073
12095
  uiSchema = schema.uiSchema;
@@ -12234,15 +12256,14 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
12234
12256
  }); };
12235
12257
 
12236
12258
  var AmisSelectUser = function (props) { return __awaiter(void 0, void 0, void 0, function () {
12237
- var $schema, ids, idsTrackOn, _a, readonly, _b, selectFirst, amis, _c, ctx, value, amisSchema, steedosField, options, error_1;
12238
- return __generator(this, function (_d) {
12239
- switch (_d.label) {
12259
+ var $schema, idsDependOn, _a, readonly, amis, _b, ctx, amisSchema, steedosField, options, error_1;
12260
+ return __generator(this, function (_c) {
12261
+ switch (_c.label) {
12240
12262
  case 0:
12241
- $schema = props.$schema, props.data, ids = props.ids, idsTrackOn = props.idsTrackOn, _a = props.readonly, readonly = _a === void 0 ? false : _a, _b = props.selectFirst, selectFirst = _b === void 0 ? false : _b, amis = props.amis, _c = props.ctx, ctx = _c === void 0 ? {} : _c;
12242
- value = $schema.value;
12243
- _d.label = 1;
12263
+ $schema = props.$schema, props.data, idsDependOn = props.idsDependOn, _a = props.readonly, readonly = _a === void 0 ? false : _a, amis = props.amis, _b = props.ctx, ctx = _b === void 0 ? {} : _b;
12264
+ _c.label = 1;
12244
12265
  case 1:
12245
- _d.trys.push([1, 3, , 4]);
12266
+ _c.trys.push([1, 3, , 4]);
12246
12267
  steedosField = {
12247
12268
  type: "lookup",
12248
12269
  reference_to: "users",
@@ -12251,20 +12272,16 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
12251
12272
  multiple: $schema.multiple,
12252
12273
  required: $schema.required,
12253
12274
  searchable: $schema.searchable,
12254
- onEvent: $schema.onEvent,
12255
12275
  filters: $schema.filters,
12256
12276
  amis: amis
12257
12277
  };
12258
- options = Object.assign.apply(Object, __spreadArray(__spreadArray([{}], __read(ctx), false), [{ ids: ids, idsTrackOn: idsTrackOn, selectFirst: selectFirst }], false));
12259
- if (value) {
12260
- options.value = value;
12261
- }
12278
+ options = Object.assign.apply(Object, __spreadArray(__spreadArray([{}], __read(ctx), false), [{ idsDependOn: idsDependOn }], false));
12262
12279
  return [4 /*yield*/, index.convertSFieldToAmisField(steedosField, readonly, options)];
12263
12280
  case 2:
12264
- amisSchema = _d.sent();
12281
+ amisSchema = _c.sent();
12265
12282
  return [3 /*break*/, 4];
12266
12283
  case 3:
12267
- error_1 = _d.sent();
12284
+ error_1 = _c.sent();
12268
12285
  console.log("error", error_1);
12269
12286
  return [3 /*break*/, 4];
12270
12287
  case 4: return [2 /*return*/, amisSchema];
@@ -13024,28 +13041,34 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
13024
13041
  * @Author: baozhoutao@steedos.com
13025
13042
  * @Date: 2023-01-14 16:41:24
13026
13043
  * @LastEditors: baozhoutao@steedos.com
13027
- * @LastEditTime: 2023-02-23 09:48:53
13044
+ * @LastEditTime: 2023-03-23 11:37:25
13028
13045
  * @Description:
13029
13046
  */
13030
13047
  var getSelectFlowSchema = function (id, props) {
13031
- var label = props.label, data = props.data, name = props.name, required = props.required, _a = props.action, action = _a === void 0 ? 'query' : _a, _b = props.distributeInstanceId, distributeInstanceId = _b === void 0 ? "" : _b, _c = props.distributeStepId, distributeStepId = _c === void 0 ? "" : _c, _d = props.mode, mode = _d === void 0 ? 'input-tree' : _d, className = props.className, onEvent = props.onEvent, _e = props.multiple, multiple = _e === void 0 ? false : _e, delimiter = props.delimiter, joinValues = props.joinValues, extractValue = props.extractValue, searchable = props.searchable, _f = props.showIcon, showIcon = _f === void 0 ? true : _f, _g = props.showRadio, showRadio = _g === void 0 ? false : _g, showOutline = props.showOutline, initiallyOpen = props.initiallyOpen, unfoldedLevel = props.unfoldedLevel, treeContainerClassName = props.treeContainerClassName;
13032
- return {
13033
- "type": mode,
13034
- "id": id,
13035
- "label": label,
13036
- "name": name,
13037
- "options": [],
13038
- "multiple": multiple,
13039
- "delimiter": delimiter,
13040
- "joinValues": joinValues,
13041
- "extractValue": extractValue,
13042
- "searchable": searchable,
13043
- "showOutline": showOutline,
13044
- "initiallyOpen": initiallyOpen,
13045
- "unfoldedLevel": unfoldedLevel,
13046
- "className": className,
13047
- "required": required,
13048
- "treeContainerClassName": treeContainerClassName,
13048
+ var label = props.label, data = props.data, name = props.name, required = props.required, _a = props.action, action = _a === void 0 ? 'query' : _a, _b = props.distributeInstanceId, distributeInstanceId = _b === void 0 ? "" : _b, _c = props.distributeStepId, distributeStepId = _c === void 0 ? "" : _c, _d = props.mode, mode = _d === void 0 ? 'input-tree' : _d, className = props.className, onEvent = props.onEvent, _e = props.multiple, multiple = _e === void 0 ? false : _e, delimiter = props.delimiter, joinValues = props.joinValues, extractValue = props.extractValue, searchable = props.searchable, _f = props.showIcon, showIcon = _f === void 0 ? true : _f, _g = props.showRadio, showRadio = _g === void 0 ? false : _g, showOutline = props.showOutline, initiallyOpen = props.initiallyOpen, unfoldedLevel = props.unfoldedLevel, treeContainerClassName = props.treeContainerClassName, _h = props.amis, amis = _h === void 0 ? {} : _h;
13049
+ return __assign$2({ "type": mode, "id": id, "label": label, "name": name, "options": [], "multiple": multiple, "delimiter": delimiter, "joinValues": joinValues, "extractValue": extractValue, "searchable": searchable, "showOutline": showOutline, "initiallyOpen": initiallyOpen, "unfoldedLevel": unfoldedLevel, "className": className, "required": required, "treeContainerClassName": treeContainerClassName,
13050
+ // "menuTpl": {
13051
+ // type: "tpl",
13052
+ // tpl: "<div class='flex justify-between'><span>${label}</span><span class='rounded p-1 text-xs text-center w-14 ${children != null ? \'hidden\' : \'\'}'><button onClick='console.log(11111)'><i class='fa-regular fa-star'></i></button></span></div>",
13053
+ // "onEvent": {
13054
+ // "click": {
13055
+ // "weight": 0,
13056
+ // "actions": [
13057
+ // {
13058
+ // "args": {
13059
+ // "api": {
13060
+ // "url": "/aaa",
13061
+ // "method": "get",
13062
+ // "messages": {
13063
+ // }
13064
+ // }
13065
+ // },
13066
+ // "actionType": "download"
13067
+ // }
13068
+ // ]
13069
+ // }
13070
+ // }
13071
+ // },
13049
13072
  "source": {
13050
13073
  "method": "post",
13051
13074
  "url": "${context.rootUrl}/graphql?keywords=${keywords}",
@@ -13053,12 +13076,7 @@ filterService.setData({showFieldsFilter: !!!filterService.props.data.showFieldsF
13053
13076
  "headers": {
13054
13077
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
13055
13078
  }
13056
- },
13057
- "showIcon": showIcon,
13058
- "showRadio": showRadio,
13059
- "onlyLeaf": true,
13060
- "onEvent": onEvent,
13061
- };
13079
+ }, "showIcon": showIcon, "showRadio": showRadio, "onlyLeaf": true, "onEvent": onEvent }, amis);
13062
13080
  };
13063
13081
  /**
13064
13082
  *