@steedos-widgets/amis-lib 6.10.32 → 6.10.33

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/index.esm.js CHANGED
@@ -10530,7 +10530,7 @@ function formatUISchemaCache(objectName, uiSchema){
10530
10530
  });
10531
10531
  }
10532
10532
 
10533
- async function getUISchema(objectName, force, retry = true) {
10533
+ async function getUISchema(objectName, force = false, retry = true) {
10534
10534
  if (!objectName) {
10535
10535
  return;
10536
10536
  }
@@ -17743,7 +17743,7 @@ const getApprovalDrawerSchema = async (instance, events) => {
17743
17743
  },
17744
17744
  ]
17745
17745
  };
17746
- console.log(`getApprovalDrawerSchema: `, schema);
17746
+ // console.log(`getApprovalDrawerSchema: `, schema)
17747
17747
  return schema;
17748
17748
  };
17749
17749
 
@@ -17980,14 +17980,122 @@ const getInstanceApprovalHistory = async ()=>{
17980
17980
  }
17981
17981
  };
17982
17982
 
17983
- /*
17984
- * @Author: baozhoutao@steedos.com
17985
- * @Date: 2022-09-07 16:20:45
17986
- * @LastEditors: yinlianghui yinlianghui@hotoa.com
17987
- * @LastEditTime: 2025-12-09 17:13:13
17988
- * @Description:
17989
- */
17990
-
17983
+ const getStepsSchema = (instance) => {
17984
+ if(instance.box === 'draft' && instance.state === 'draft' && instance.flow.allow_select_step){
17985
+ const schema = {
17986
+ "type": "service",
17987
+ "id": "u:set_steps_users",
17988
+ "api": {
17989
+ "url": "/api/workflow/v2/nextSteps",
17990
+ "method": "post",
17991
+ "requestAdaptor": `
17992
+ const ctx = api.data.context;
17993
+ const formValues = context._scoped.getComponentById("instance_form").getValues();
17994
+ api.data = {
17995
+ flowVersionId: ctx.flowVersion._id,
17996
+ instanceId: ctx._id,
17997
+ flowId: ctx.flow._id,
17998
+ step: ctx.step,
17999
+ values: formValues
18000
+ };
18001
+ return api;
18002
+ `,
18003
+ "adaptor": `
18004
+ payload.stepIds = _.map(payload.nextSteps, '_id');
18005
+ return payload;
18006
+ `
18007
+ }
18008
+ ,
18009
+ "body": [
18010
+ {
18011
+ "type": "table2",
18012
+ "source": "$nextSteps",
18013
+ "className": "set-next-steps-users my-4",
18014
+ "label": false,
18015
+ "needConfirm": false,
18016
+ "bordered": true,
18017
+ "title": "审批步骤",
18018
+ "quickSaveItemApi": {
18019
+ "url": "/api/workflow/v2/set_instance_steps",
18020
+ "method": "post",
18021
+ "requestAdaptor": `
18022
+ if(event && false){
18023
+ api.data = {
18024
+ instanceId: 'none'
18025
+ }
18026
+ }else{
18027
+ const ctx = api.data.context;
18028
+ api.data = {
18029
+ instanceId: ctx._id,
18030
+ stepId: context._id,
18031
+ selected: context.selected,
18032
+ handler: context.stepHandler
18033
+ };
18034
+ }
18035
+
18036
+ return api;
18037
+ `,
18038
+ "adaptor": `
18039
+ payload.stepIds = _.map(payload.nextSteps, '_id');
18040
+ return payload;
18041
+ `
18042
+ },
18043
+ // "rowSelection": {
18044
+ // "type": "checkbox",
18045
+ // "keyField": "id",
18046
+ // "checked": true,
18047
+ // "selected": true,
18048
+ // // "disableOn": "${allow_skip != true}",
18049
+ // "selectedRowKeysExpr": "${ARRAYINCLUDES(stepIds, id)}"
18050
+ // },
18051
+ "columns": [
18052
+ {
18053
+ "label": "选择",
18054
+ "name": "selected",
18055
+ "width": 50,
18056
+ "quickEdit": {
18057
+ "type": "checkbox",
18058
+ "mode": "inline",
18059
+ "id": "selected",
18060
+ "name": "selected",
18061
+ "saveImmediately": true,
18062
+ "value": true,
18063
+ "disabledOn": "${allow_skip != true}",
18064
+ }
18065
+ },
18066
+ {
18067
+ "label": "步骤名称",
18068
+ "name": "name",
18069
+ "quickEdit": false
18070
+ },
18071
+ {
18072
+ "label": "处理人",
18073
+ "name": "stepHandler",
18074
+ "quickEdit": {
18075
+ "type": "steedos-instance-handler",
18076
+ "mode": "inline",
18077
+ "id": "stepHandler",
18078
+ "name": "stepHandler",
18079
+ "saveImmediately": true
18080
+ }
18081
+ },
18082
+ // {
18083
+ // "label": "操作",
18084
+ // "name": "actions"
18085
+ // }
18086
+ ]
18087
+ }
18088
+ ]
18089
+ };
18090
+ return schema;
18091
+ }else {
18092
+ return {
18093
+ type: 'tpl',
18094
+ id: "u:set_steps_users",
18095
+ tpl: ''
18096
+ }
18097
+ }
18098
+ };
17991
18099
 
17992
18100
  const getSelectOptions = (field) => {
17993
18101
  const options = [];
@@ -19152,11 +19260,17 @@ const getFlowFormSchema = async (instance, box) => {
19152
19260
  "componentId": "u:next_step",
19153
19261
  "args": {}
19154
19262
  },
19263
+ {
19264
+ "actionType": "reload",
19265
+ "componentId": "u:set_steps_users",
19266
+ "args": {}
19267
+ },
19155
19268
  ...changeEvents
19156
19269
  ]
19157
19270
  }
19158
19271
  }
19159
19272
  },
19273
+ await getStepsSchema(instance),
19160
19274
  await getInstanceApprovalHistory(),
19161
19275
  await getApproveButton(instance, { submitEvents , nextStepInitedEvents, nextStepChangeEvents, nextStepUserChangeEvents})
19162
19276
  ],
@@ -19425,7 +19539,8 @@ const getInstanceInfo = async (props) => {
19425
19539
  flow:flow__expand{
19426
19540
  _id,
19427
19541
  name,
19428
- perms
19542
+ perms,
19543
+ allow_select_step
19429
19544
  }
19430
19545
  }
19431
19546
  }