@steedos-widgets/amis-lib 6.10.31 → 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.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
  }
@@ -17770,7 +17770,7 @@ const getApprovalDrawerSchema = async (instance, events) => {
17770
17770
  },
17771
17771
  ]
17772
17772
  };
17773
- console.log(`getApprovalDrawerSchema: `, schema);
17773
+ // console.log(`getApprovalDrawerSchema: `, schema)
17774
17774
  return schema;
17775
17775
  };
17776
17776
 
@@ -18007,14 +18007,122 @@ const getInstanceApprovalHistory = async ()=>{
18007
18007
  }
18008
18008
  };
18009
18009
 
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 16:06:24
18015
- * @Description:
18016
- */
18017
-
18010
+ const getStepsSchema = (instance) => {
18011
+ if(instance.box === 'draft' && instance.state === 'draft' && instance.flow.allow_select_step){
18012
+ const schema = {
18013
+ "type": "service",
18014
+ "id": "u:set_steps_users",
18015
+ "api": {
18016
+ "url": "/api/workflow/v2/nextSteps",
18017
+ "method": "post",
18018
+ "requestAdaptor": `
18019
+ const ctx = api.data.context;
18020
+ const formValues = context._scoped.getComponentById("instance_form").getValues();
18021
+ api.data = {
18022
+ flowVersionId: ctx.flowVersion._id,
18023
+ instanceId: ctx._id,
18024
+ flowId: ctx.flow._id,
18025
+ step: ctx.step,
18026
+ values: formValues
18027
+ };
18028
+ return api;
18029
+ `,
18030
+ "adaptor": `
18031
+ payload.stepIds = _.map(payload.nextSteps, '_id');
18032
+ return payload;
18033
+ `
18034
+ }
18035
+ ,
18036
+ "body": [
18037
+ {
18038
+ "type": "table2",
18039
+ "source": "$nextSteps",
18040
+ "className": "set-next-steps-users my-4",
18041
+ "label": false,
18042
+ "needConfirm": false,
18043
+ "bordered": true,
18044
+ "title": "审批步骤",
18045
+ "quickSaveItemApi": {
18046
+ "url": "/api/workflow/v2/set_instance_steps",
18047
+ "method": "post",
18048
+ "requestAdaptor": `
18049
+ if(event && false){
18050
+ api.data = {
18051
+ instanceId: 'none'
18052
+ }
18053
+ }else{
18054
+ const ctx = api.data.context;
18055
+ api.data = {
18056
+ instanceId: ctx._id,
18057
+ stepId: context._id,
18058
+ selected: context.selected,
18059
+ handler: context.stepHandler
18060
+ };
18061
+ }
18062
+
18063
+ return api;
18064
+ `,
18065
+ "adaptor": `
18066
+ payload.stepIds = _.map(payload.nextSteps, '_id');
18067
+ return payload;
18068
+ `
18069
+ },
18070
+ // "rowSelection": {
18071
+ // "type": "checkbox",
18072
+ // "keyField": "id",
18073
+ // "checked": true,
18074
+ // "selected": true,
18075
+ // // "disableOn": "${allow_skip != true}",
18076
+ // "selectedRowKeysExpr": "${ARRAYINCLUDES(stepIds, id)}"
18077
+ // },
18078
+ "columns": [
18079
+ {
18080
+ "label": "选择",
18081
+ "name": "selected",
18082
+ "width": 50,
18083
+ "quickEdit": {
18084
+ "type": "checkbox",
18085
+ "mode": "inline",
18086
+ "id": "selected",
18087
+ "name": "selected",
18088
+ "saveImmediately": true,
18089
+ "value": true,
18090
+ "disabledOn": "${allow_skip != true}",
18091
+ }
18092
+ },
18093
+ {
18094
+ "label": "步骤名称",
18095
+ "name": "name",
18096
+ "quickEdit": false
18097
+ },
18098
+ {
18099
+ "label": "处理人",
18100
+ "name": "stepHandler",
18101
+ "quickEdit": {
18102
+ "type": "steedos-instance-handler",
18103
+ "mode": "inline",
18104
+ "id": "stepHandler",
18105
+ "name": "stepHandler",
18106
+ "saveImmediately": true
18107
+ }
18108
+ },
18109
+ // {
18110
+ // "label": "操作",
18111
+ // "name": "actions"
18112
+ // }
18113
+ ]
18114
+ }
18115
+ ]
18116
+ };
18117
+ return schema;
18118
+ }else {
18119
+ return {
18120
+ type: 'tpl',
18121
+ id: "u:set_steps_users",
18122
+ tpl: ''
18123
+ }
18124
+ }
18125
+ };
18018
18126
 
18019
18127
  const getSelectOptions = (field) => {
18020
18128
  const options = [];
@@ -18960,7 +19068,7 @@ const getApproveButton = async (instance, events)=>{
18960
19068
  var instancePageContent = document.querySelector(".steedos-amis-instance-view .antd-Page-content");
18961
19069
  var approvalDrawerContent = document.querySelector(".approval-drawer .antd-Drawer-content");
18962
19070
  if (instancePageContent && approvalDrawerContent) {
18963
- $(instancePageContent).css("paddingBottom", `${approvalDrawerContent.clientHeight + 10}px`);
19071
+ $(instancePageContent).css("paddingBottom", `${approvalDrawerContent.clientHeight + 2}px`);
18964
19072
  }
18965
19073
  }
18966
19074
  }
@@ -19101,8 +19209,12 @@ const getFlowFormSchema = async (instance, box) => {
19101
19209
  "font-size": "14px",
19102
19210
  "font-weight": "500"
19103
19211
  },
19104
- ".steedos-amis-instance-view.steedos-instance-style-table .antd-Page-body": {
19105
- "width": "1024px"
19212
+ ".steedos-amis-instance-view.steedos-instance-style-table .antd-Page-body .steedos-amis-instance-view-content": {
19213
+ "max-width": "1024px"
19214
+ },
19215
+ ".steedos-amis-instance-view .approval-drawer.antd-Drawer .antd-Drawer-content": {
19216
+ "box-shadow": "none",
19217
+ "border-top": "1px solid rgb(209 213 219)"
19106
19218
  },
19107
19219
  ".antd-List-placeholder": {
19108
19220
  "display": "none"
@@ -19121,66 +19233,77 @@ const getFlowFormSchema = async (instance, box) => {
19121
19233
  "background": "transparent !important"
19122
19234
  }
19123
19235
  },
19124
- body: [
19125
- await getAttachments(instance),
19126
- await getRelatedInstances(),
19127
- await getRelatedRecords(instance),
19128
- {
19129
- type: "form",
19130
- debug: false,
19131
- wrapWithPanel: false,
19132
- resetAfterSubmit: true,
19133
- body: [
19134
- {
19135
- type: "tpl",
19136
- id: "u:f5bb0ad602a6",
19137
- tpl: `<div class="instance-name">${instance.title}</div>`,
19138
- inline: true,
19139
- wrapperComponent: "",
19140
- style: {
19141
- fontFamily: "",
19142
- fontSize: 12,
19143
- textAlign: "center",
19144
- },
19145
- },
19146
- formContentSchema,
19147
- await getApplicantTableView(instance),
19148
- ],
19149
- id: "instance_form",
19150
- onEvent: {
19151
- // validateError: {
19152
- // weight: 0,
19153
- // actions: [
19154
- // {
19155
- // "componentId": "",
19156
- // "args": {
19157
- // "msgType": "info",
19158
- // "position": "top-right",
19159
- // "closeButton": true,
19160
- // "showIcon": true,
19161
- // "title": i18next.t('frontend_workflow_submit_validate_error_title'),//"提交失败",
19162
- // "msg": i18next.t('frontend_workflow_submit_validate_error_msg'),//"请填写必填字段"
19163
- // },
19164
- // "actionType": "toast"
19165
- // }
19166
- // ],
19167
- // },
19168
- change: {
19169
- weight: 0,
19170
- actions: [
19171
- {
19172
- "actionType": "reload",
19173
- "componentId": "u:next_step",
19174
- "args": {}
19236
+ body: [{
19237
+ "type": "wrapper",
19238
+ "body": [
19239
+ await getAttachments(instance),
19240
+ await getRelatedInstances(),
19241
+ await getRelatedRecords(instance),
19242
+ {
19243
+ type: "form",
19244
+ debug: false,
19245
+ wrapWithPanel: false,
19246
+ resetAfterSubmit: true,
19247
+ body: [
19248
+ {
19249
+ type: "tpl",
19250
+ id: "u:f5bb0ad602a6",
19251
+ tpl: `<div class="instance-name">${instance.title}</div>`,
19252
+ inline: true,
19253
+ wrapperComponent: "",
19254
+ style: {
19255
+ fontFamily: "",
19256
+ fontSize: 12,
19257
+ textAlign: "center",
19175
19258
  },
19176
- ...changeEvents
19177
- ]
19259
+ },
19260
+ formContentSchema,
19261
+ await getApplicantTableView(instance),
19262
+ ],
19263
+ id: "instance_form",
19264
+ onEvent: {
19265
+ // validateError: {
19266
+ // weight: 0,
19267
+ // actions: [
19268
+ // {
19269
+ // "componentId": "",
19270
+ // "args": {
19271
+ // "msgType": "info",
19272
+ // "position": "top-right",
19273
+ // "closeButton": true,
19274
+ // "showIcon": true,
19275
+ // "title": i18next.t('frontend_workflow_submit_validate_error_title'),//"提交失败",
19276
+ // "msg": i18next.t('frontend_workflow_submit_validate_error_msg'),//"请填写必填字段"
19277
+ // },
19278
+ // "actionType": "toast"
19279
+ // }
19280
+ // ],
19281
+ // },
19282
+ change: {
19283
+ weight: 0,
19284
+ actions: [
19285
+ {
19286
+ "actionType": "reload",
19287
+ "componentId": "u:next_step",
19288
+ "args": {}
19289
+ },
19290
+ {
19291
+ "actionType": "reload",
19292
+ "componentId": "u:set_steps_users",
19293
+ "args": {}
19294
+ },
19295
+ ...changeEvents
19296
+ ]
19297
+ }
19178
19298
  }
19179
- }
19180
- },
19181
- await getInstanceApprovalHistory(),
19182
- await getApproveButton(instance, { submitEvents , nextStepInitedEvents, nextStepChangeEvents, nextStepUserChangeEvents})
19183
- ],
19299
+ },
19300
+ await getStepsSchema(instance),
19301
+ await getInstanceApprovalHistory(),
19302
+ await getApproveButton(instance, { submitEvents , nextStepInitedEvents, nextStepChangeEvents, nextStepUserChangeEvents})
19303
+ ],
19304
+ "size": "none",
19305
+ "className": "steedos-amis-instance-view-content"
19306
+ }],
19184
19307
  id: "u:instancePage",
19185
19308
  messages: {},
19186
19309
  pullRefresh: {},
@@ -19443,7 +19566,8 @@ const getInstanceInfo = async (props) => {
19443
19566
  flow:flow__expand{
19444
19567
  _id,
19445
19568
  name,
19446
- perms
19569
+ perms,
19570
+ allow_select_step
19447
19571
  }
19448
19572
  }
19449
19573
  }