@steedos-widgets/amis-lib 6.10.32 → 6.10.34-beta.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/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
  }
@@ -14556,8 +14556,8 @@ function uuidv4() {
14556
14556
  /*
14557
14557
  * @Author: 殷亮辉 yinlianghui@hotoa.com
14558
14558
  * @Date: 2023-11-15 09:50:22
14559
- * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
14560
- * @LastEditTime: 2025-12-04 22:52:15
14559
+ * @LastEditors: yinlianghui yinlianghui@hotoa.com
14560
+ * @LastEditTime: 2025-12-10 17:04:58
14561
14561
  */
14562
14562
 
14563
14563
  /**
@@ -15286,8 +15286,8 @@ async function getForm(props, mode = "edit", formId) {
15286
15286
  var currentFormValues = JSON.parse(JSON.stringify(event.data));
15287
15287
  var parent = event.data.__super.__super.parent;
15288
15288
  var __parentIndex = event.data.__super.__super.__parentIndex;
15289
- let uuidv4 = new Function("return (" + ${uuidv4.toString()} + ")()");
15290
- var primaryKey = "${primaryKey}";
15289
+ // let uuidv4 = new Function("return (" + ${uuidv4.toString()} + ")()");
15290
+ // var primaryKey = "${primaryKey}";
15291
15291
  if(parent){
15292
15292
  fieldValue[__parentIndex].children[currentIndex] = currentFormValues;
15293
15293
  // 重写父节点,并且改变其某个属性以让子节点修改的内容回显到界面上
@@ -15535,8 +15535,11 @@ async function getButtonActions(props, mode) {
15535
15535
  }
15536
15536
  if(newItem[primaryKey]){
15537
15537
  // 如果newItem已经有主键字段值,则重新生成新的主键值,否则会重复。
15538
- let uuidv4 = new Function("return (" + ${uuidv4.toString()} + ")()");
15539
- newItem[primaryKey] = uuidv4();
15538
+ // let uuidv4 = new Function("return (" + ${uuidv4.toString()} + ")()");
15539
+ // newItem[primaryKey] = uuidv4();
15540
+ // 删除primaryKey会自动加primaryKey,这里不删除primaryKey审批王会有bug,像上面重新给新的uuid值也一样,见:[子表-通过复制出来的记录,再点击编辑,没有值](https://github.com/steedos/steedos-plugins/issues/83)
15541
+ // 只能删除primaryKey键值,改后不影响autoGeneratePrimaryKeyValue功能最终效果
15542
+ delete newItem[primaryKey];
15540
15543
  }
15541
15544
  if(parent){
15542
15545
  fieldValue[__parentIndex].children.push(newItem);
@@ -17743,7 +17746,7 @@ const getApprovalDrawerSchema = async (instance, events) => {
17743
17746
  },
17744
17747
  ]
17745
17748
  };
17746
- console.log(`getApprovalDrawerSchema: `, schema);
17749
+ // console.log(`getApprovalDrawerSchema: `, schema)
17747
17750
  return schema;
17748
17751
  };
17749
17752
 
@@ -17980,14 +17983,122 @@ const getInstanceApprovalHistory = async ()=>{
17980
17983
  }
17981
17984
  };
17982
17985
 
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
-
17986
+ const getStepsSchema = (instance) => {
17987
+ if(instance.box === 'draft' && instance.state === 'draft' && instance.flow.allow_select_step){
17988
+ const schema = {
17989
+ "type": "service",
17990
+ "id": "u:set_steps_users",
17991
+ "api": {
17992
+ "url": "/api/workflow/v2/nextSteps",
17993
+ "method": "post",
17994
+ "requestAdaptor": `
17995
+ const ctx = api.data.context;
17996
+ const formValues = context._scoped.getComponentById("instance_form").getValues();
17997
+ api.data = {
17998
+ flowVersionId: ctx.flowVersion._id,
17999
+ instanceId: ctx._id,
18000
+ flowId: ctx.flow._id,
18001
+ step: ctx.step,
18002
+ values: formValues
18003
+ };
18004
+ return api;
18005
+ `,
18006
+ "adaptor": `
18007
+ payload.stepIds = _.map(payload.nextSteps, '_id');
18008
+ return payload;
18009
+ `
18010
+ }
18011
+ ,
18012
+ "body": [
18013
+ {
18014
+ "type": "table2",
18015
+ "source": "$nextSteps",
18016
+ "className": "set-next-steps-users my-4",
18017
+ "label": false,
18018
+ "needConfirm": false,
18019
+ "bordered": true,
18020
+ "title": "审批步骤",
18021
+ "quickSaveItemApi": {
18022
+ "url": "/api/workflow/v2/set_instance_steps",
18023
+ "method": "post",
18024
+ "requestAdaptor": `
18025
+ if(event && false){
18026
+ api.data = {
18027
+ instanceId: 'none'
18028
+ }
18029
+ }else{
18030
+ const ctx = api.data.context;
18031
+ api.data = {
18032
+ instanceId: ctx._id,
18033
+ stepId: context._id,
18034
+ selected: context.selected,
18035
+ handler: context.stepHandler
18036
+ };
18037
+ }
18038
+
18039
+ return api;
18040
+ `,
18041
+ "adaptor": `
18042
+ payload.stepIds = _.map(payload.nextSteps, '_id');
18043
+ return payload;
18044
+ `
18045
+ },
18046
+ // "rowSelection": {
18047
+ // "type": "checkbox",
18048
+ // "keyField": "id",
18049
+ // "checked": true,
18050
+ // "selected": true,
18051
+ // // "disableOn": "${allow_skip != true}",
18052
+ // "selectedRowKeysExpr": "${ARRAYINCLUDES(stepIds, id)}"
18053
+ // },
18054
+ "columns": [
18055
+ {
18056
+ "label": "选择",
18057
+ "name": "selected",
18058
+ "width": 50,
18059
+ "quickEdit": {
18060
+ "type": "checkbox",
18061
+ "mode": "inline",
18062
+ "id": "selected",
18063
+ "name": "selected",
18064
+ "saveImmediately": true,
18065
+ "value": true,
18066
+ "disabledOn": "${allow_skip != true}",
18067
+ }
18068
+ },
18069
+ {
18070
+ "label": "步骤名称",
18071
+ "name": "name",
18072
+ "quickEdit": false
18073
+ },
18074
+ {
18075
+ "label": "处理人",
18076
+ "name": "stepHandler",
18077
+ "quickEdit": {
18078
+ "type": "steedos-instance-handler",
18079
+ "mode": "inline",
18080
+ "id": "stepHandler",
18081
+ "name": "stepHandler",
18082
+ "saveImmediately": true
18083
+ }
18084
+ },
18085
+ // {
18086
+ // "label": "操作",
18087
+ // "name": "actions"
18088
+ // }
18089
+ ]
18090
+ }
18091
+ ]
18092
+ };
18093
+ return schema;
18094
+ }else {
18095
+ return {
18096
+ type: 'tpl',
18097
+ id: "u:set_steps_users",
18098
+ tpl: ''
18099
+ }
18100
+ }
18101
+ };
17991
18102
 
17992
18103
  const getSelectOptions = (field) => {
17993
18104
  const options = [];
@@ -19152,11 +19263,17 @@ const getFlowFormSchema = async (instance, box) => {
19152
19263
  "componentId": "u:next_step",
19153
19264
  "args": {}
19154
19265
  },
19266
+ {
19267
+ "actionType": "reload",
19268
+ "componentId": "u:set_steps_users",
19269
+ "args": {}
19270
+ },
19155
19271
  ...changeEvents
19156
19272
  ]
19157
19273
  }
19158
19274
  }
19159
19275
  },
19276
+ await getStepsSchema(instance),
19160
19277
  await getInstanceApprovalHistory(),
19161
19278
  await getApproveButton(instance, { submitEvents , nextStepInitedEvents, nextStepChangeEvents, nextStepUserChangeEvents})
19162
19279
  ],
@@ -19425,7 +19542,8 @@ const getInstanceInfo = async (props) => {
19425
19542
  flow:flow__expand{
19426
19543
  _id,
19427
19544
  name,
19428
- perms
19545
+ perms,
19546
+ allow_select_step
19429
19547
  }
19430
19548
  }
19431
19549
  }