@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.cjs.js CHANGED
@@ -10557,7 +10557,7 @@ function formatUISchemaCache(objectName, uiSchema){
10557
10557
  });
10558
10558
  }
10559
10559
 
10560
- async function getUISchema(objectName, force, retry = true) {
10560
+ async function getUISchema(objectName, force = false, retry = true) {
10561
10561
  if (!objectName) {
10562
10562
  return;
10563
10563
  }
@@ -14583,8 +14583,8 @@ function uuidv4() {
14583
14583
  /*
14584
14584
  * @Author: 殷亮辉 yinlianghui@hotoa.com
14585
14585
  * @Date: 2023-11-15 09:50:22
14586
- * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
14587
- * @LastEditTime: 2025-12-04 22:52:15
14586
+ * @LastEditors: yinlianghui yinlianghui@hotoa.com
14587
+ * @LastEditTime: 2025-12-10 17:04:58
14588
14588
  */
14589
14589
 
14590
14590
  /**
@@ -15313,8 +15313,8 @@ async function getForm(props, mode = "edit", formId) {
15313
15313
  var currentFormValues = JSON.parse(JSON.stringify(event.data));
15314
15314
  var parent = event.data.__super.__super.parent;
15315
15315
  var __parentIndex = event.data.__super.__super.__parentIndex;
15316
- let uuidv4 = new Function("return (" + ${uuidv4.toString()} + ")()");
15317
- var primaryKey = "${primaryKey}";
15316
+ // let uuidv4 = new Function("return (" + ${uuidv4.toString()} + ")()");
15317
+ // var primaryKey = "${primaryKey}";
15318
15318
  if(parent){
15319
15319
  fieldValue[__parentIndex].children[currentIndex] = currentFormValues;
15320
15320
  // 重写父节点,并且改变其某个属性以让子节点修改的内容回显到界面上
@@ -15562,8 +15562,11 @@ async function getButtonActions(props, mode) {
15562
15562
  }
15563
15563
  if(newItem[primaryKey]){
15564
15564
  // 如果newItem已经有主键字段值,则重新生成新的主键值,否则会重复。
15565
- let uuidv4 = new Function("return (" + ${uuidv4.toString()} + ")()");
15566
- newItem[primaryKey] = uuidv4();
15565
+ // let uuidv4 = new Function("return (" + ${uuidv4.toString()} + ")()");
15566
+ // newItem[primaryKey] = uuidv4();
15567
+ // 删除primaryKey会自动加primaryKey,这里不删除primaryKey审批王会有bug,像上面重新给新的uuid值也一样,见:[子表-通过复制出来的记录,再点击编辑,没有值](https://github.com/steedos/steedos-plugins/issues/83)
15568
+ // 只能删除primaryKey键值,改后不影响autoGeneratePrimaryKeyValue功能最终效果
15569
+ delete newItem[primaryKey];
15567
15570
  }
15568
15571
  if(parent){
15569
15572
  fieldValue[__parentIndex].children.push(newItem);
@@ -17770,7 +17773,7 @@ const getApprovalDrawerSchema = async (instance, events) => {
17770
17773
  },
17771
17774
  ]
17772
17775
  };
17773
- console.log(`getApprovalDrawerSchema: `, schema);
17776
+ // console.log(`getApprovalDrawerSchema: `, schema)
17774
17777
  return schema;
17775
17778
  };
17776
17779
 
@@ -18007,14 +18010,122 @@ const getInstanceApprovalHistory = async ()=>{
18007
18010
  }
18008
18011
  };
18009
18012
 
18010
- /*
18011
- * @Author: baozhoutao@steedos.com
18012
- * @Date: 2022-09-07 16:20:45
18013
- * @LastEditors: yinlianghui yinlianghui@hotoa.com
18014
- * @LastEditTime: 2025-12-09 17:13:13
18015
- * @Description:
18016
- */
18017
-
18013
+ const getStepsSchema = (instance) => {
18014
+ if(instance.box === 'draft' && instance.state === 'draft' && instance.flow.allow_select_step){
18015
+ const schema = {
18016
+ "type": "service",
18017
+ "id": "u:set_steps_users",
18018
+ "api": {
18019
+ "url": "/api/workflow/v2/nextSteps",
18020
+ "method": "post",
18021
+ "requestAdaptor": `
18022
+ const ctx = api.data.context;
18023
+ const formValues = context._scoped.getComponentById("instance_form").getValues();
18024
+ api.data = {
18025
+ flowVersionId: ctx.flowVersion._id,
18026
+ instanceId: ctx._id,
18027
+ flowId: ctx.flow._id,
18028
+ step: ctx.step,
18029
+ values: formValues
18030
+ };
18031
+ return api;
18032
+ `,
18033
+ "adaptor": `
18034
+ payload.stepIds = _.map(payload.nextSteps, '_id');
18035
+ return payload;
18036
+ `
18037
+ }
18038
+ ,
18039
+ "body": [
18040
+ {
18041
+ "type": "table2",
18042
+ "source": "$nextSteps",
18043
+ "className": "set-next-steps-users my-4",
18044
+ "label": false,
18045
+ "needConfirm": false,
18046
+ "bordered": true,
18047
+ "title": "审批步骤",
18048
+ "quickSaveItemApi": {
18049
+ "url": "/api/workflow/v2/set_instance_steps",
18050
+ "method": "post",
18051
+ "requestAdaptor": `
18052
+ if(event && false){
18053
+ api.data = {
18054
+ instanceId: 'none'
18055
+ }
18056
+ }else{
18057
+ const ctx = api.data.context;
18058
+ api.data = {
18059
+ instanceId: ctx._id,
18060
+ stepId: context._id,
18061
+ selected: context.selected,
18062
+ handler: context.stepHandler
18063
+ };
18064
+ }
18065
+
18066
+ return api;
18067
+ `,
18068
+ "adaptor": `
18069
+ payload.stepIds = _.map(payload.nextSteps, '_id');
18070
+ return payload;
18071
+ `
18072
+ },
18073
+ // "rowSelection": {
18074
+ // "type": "checkbox",
18075
+ // "keyField": "id",
18076
+ // "checked": true,
18077
+ // "selected": true,
18078
+ // // "disableOn": "${allow_skip != true}",
18079
+ // "selectedRowKeysExpr": "${ARRAYINCLUDES(stepIds, id)}"
18080
+ // },
18081
+ "columns": [
18082
+ {
18083
+ "label": "选择",
18084
+ "name": "selected",
18085
+ "width": 50,
18086
+ "quickEdit": {
18087
+ "type": "checkbox",
18088
+ "mode": "inline",
18089
+ "id": "selected",
18090
+ "name": "selected",
18091
+ "saveImmediately": true,
18092
+ "value": true,
18093
+ "disabledOn": "${allow_skip != true}",
18094
+ }
18095
+ },
18096
+ {
18097
+ "label": "步骤名称",
18098
+ "name": "name",
18099
+ "quickEdit": false
18100
+ },
18101
+ {
18102
+ "label": "处理人",
18103
+ "name": "stepHandler",
18104
+ "quickEdit": {
18105
+ "type": "steedos-instance-handler",
18106
+ "mode": "inline",
18107
+ "id": "stepHandler",
18108
+ "name": "stepHandler",
18109
+ "saveImmediately": true
18110
+ }
18111
+ },
18112
+ // {
18113
+ // "label": "操作",
18114
+ // "name": "actions"
18115
+ // }
18116
+ ]
18117
+ }
18118
+ ]
18119
+ };
18120
+ return schema;
18121
+ }else {
18122
+ return {
18123
+ type: 'tpl',
18124
+ id: "u:set_steps_users",
18125
+ tpl: ''
18126
+ }
18127
+ }
18128
+ };
18018
18129
 
18019
18130
  const getSelectOptions = (field) => {
18020
18131
  const options = [];
@@ -19179,11 +19290,17 @@ const getFlowFormSchema = async (instance, box) => {
19179
19290
  "componentId": "u:next_step",
19180
19291
  "args": {}
19181
19292
  },
19293
+ {
19294
+ "actionType": "reload",
19295
+ "componentId": "u:set_steps_users",
19296
+ "args": {}
19297
+ },
19182
19298
  ...changeEvents
19183
19299
  ]
19184
19300
  }
19185
19301
  }
19186
19302
  },
19303
+ await getStepsSchema(instance),
19187
19304
  await getInstanceApprovalHistory(),
19188
19305
  await getApproveButton(instance, { submitEvents , nextStepInitedEvents, nextStepChangeEvents, nextStepUserChangeEvents})
19189
19306
  ],
@@ -19452,7 +19569,8 @@ const getInstanceInfo = async (props) => {
19452
19569
  flow:flow__expand{
19453
19570
  _id,
19454
19571
  name,
19455
- perms
19572
+ perms,
19573
+ allow_select_step
19456
19574
  }
19457
19575
  }
19458
19576
  }