@steedos-widgets/amis-lib 6.10.1-beta.33 → 6.10.1-beta.34

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
@@ -10359,7 +10359,10 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
10359
10359
  data: {
10360
10360
  relatedKey: relatedKey,
10361
10361
  listViewId: `amis-\${appId}-${relatedObjectName}-listview`,
10362
- _isRelated: true
10362
+ _isRelated: true,
10363
+ record: {
10364
+ recordPermissions: relatedObjectUiSchema.permissions
10365
+ }
10363
10366
  },
10364
10367
  body:[
10365
10368
  amisSchema
@@ -16793,6 +16796,7 @@ const getJudgeOptions = async (instance) => {
16793
16796
 
16794
16797
  const getJudgeInput = async (instance) => {
16795
16798
  const judgeOptions = await getJudgeOptions(instance);
16799
+ // console.log('getJudgeInput', judgeOptions);
16796
16800
  if (judgeOptions.length > 0 && instance.approve.type != 'cc') {
16797
16801
  return {
16798
16802
  type: "radios",
@@ -16833,6 +16837,7 @@ const getJudgeInput = async (instance) => {
16833
16837
 
16834
16838
  //TODO 只有一个下一步时,默认选中,并且禁止修改.
16835
16839
  const getNextStepInput = async (instance) => {
16840
+ // console.log('getNextStepInput', instance);
16836
16841
  if(instance.approve?.type == 'cc'){
16837
16842
  return ;
16838
16843
  }
@@ -16868,14 +16873,30 @@ const getNextStepInput = async (instance) => {
16868
16873
  "next_users": null
16869
16874
  },
16870
16875
  "source": {
16871
- "url": "${context.rootUrl}/api/workflow/v2/nextStep?judge=${new_judge}",
16876
+ "url": "/api/workflow/v2/nextStep?judge=${new_judge}",
16872
16877
  "headers": {
16873
16878
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
16874
16879
  },
16875
16880
  "method": "post",
16876
16881
  "messages": {
16877
16882
  },
16878
- "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;",
16883
+ "requestAdaptor": `
16884
+ let { judge } = api.data;
16885
+ const ctx = api.data.context;
16886
+ if(!judge){
16887
+ judge='approved'
16888
+ };
16889
+ const formValues = context._scoped.getComponentById("instance_form").getValues();
16890
+ api.data = {
16891
+ flowVersionId: ctx.flowVersion._id,
16892
+ instanceId: ctx._id,
16893
+ flowId: ctx.flow._id,
16894
+ step: ctx.step,
16895
+ judge: judge,
16896
+ values: formValues
16897
+ };
16898
+ return api;
16899
+ `,
16879
16900
  "adaptor": `
16880
16901
  payload.data = {
16881
16902
  value: payload.nextSteps.length === 1 ? payload.nextSteps[0]._id : null,
@@ -16983,7 +17004,7 @@ const getNextStepUsersInput = async (instance) => {
16983
17004
  "messages": {
16984
17005
  },
16985
17006
  "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;",
16986
- "adaptor": "\npayload.data = {value: payload.nextStepUsers.length === 1 ? payload.nextStepUsers[0].id : null, options: payload.nextStepUsers};\nreturn payload;",
17007
+ "adaptor": "debugger;\npayload.data = {value: payload.nextStepUsers.length === 1 ? payload.nextStepUsers[0].id : null, options: payload.nextStepUsers};\nreturn payload;",
16987
17008
  "data": {
16988
17009
  "&": "$$",
16989
17010
  "$scopeId": "$scopeId",
@@ -17008,8 +17029,8 @@ const getNextStepUsersInput = async (instance) => {
17008
17029
 
17009
17030
  const getCCSubmitRequestAdaptor = async (instance) => {
17010
17031
  return `
17011
- const instanceForm = SteedosUI.getRef(api.data.$scopeId).getComponentById("instance_form");
17012
- const approveValues = SteedosUI.getRef(api.data.$scopeId).getComponentById("instance_approval").getValues();
17032
+ const instanceForm = context._scoped.getComponentById("instance_form");
17033
+ const approveValues = context._scoped.getComponentById("instance_approval").getValues();
17013
17034
  api.data = {
17014
17035
  instanceId: "${instance._id}",
17015
17036
  traceId: "${instance.trace._id}",
@@ -17021,9 +17042,9 @@ const getCCSubmitRequestAdaptor = async (instance) => {
17021
17042
  };
17022
17043
 
17023
17044
  const getPostSubmitRequestAdaptor = async (instance) => {
17024
- return ` const instanceForm = SteedosUI.getRef(api.data.$scopeId).getComponentById("instance_form");
17045
+ return ` const instanceForm = context._scoped.getComponentById("instance_form");
17025
17046
  const formValues = instanceForm.getValues();
17026
- const approveValues = SteedosUI.getRef(api.data.$scopeId).getComponentById("instance_approval").getValues();
17047
+ const approveValues = context._scoped.getComponentById("instance_approval").getValues();
17027
17048
  let nextUsers = approveValues.next_users;
17028
17049
  if(_.isString(nextUsers)){
17029
17050
  nextUsers = [approveValues.next_users];
@@ -17039,7 +17060,7 @@ const getPostSubmitRequestAdaptor = async (instance) => {
17039
17060
  approves: [{
17040
17061
  _id: "${instance.approve._id}",
17041
17062
  next_steps: [{
17042
- step: approveValues.next_step._id,
17063
+ step: approveValues.next_step,
17043
17064
  users: nextUsers,
17044
17065
  }],
17045
17066
  description: approveValues.suggestion,
@@ -17047,6 +17068,7 @@ const getPostSubmitRequestAdaptor = async (instance) => {
17047
17068
  }]
17048
17069
  }]
17049
17070
  }]};
17071
+ console.log('submit api', api);
17050
17072
  api.data = body;
17051
17073
  return api;
17052
17074
  `;
@@ -17054,8 +17076,8 @@ const getPostSubmitRequestAdaptor = async (instance) => {
17054
17076
 
17055
17077
  const getPostEngineRequestAdaptor = async (instance) => {
17056
17078
  return `
17057
- const formValues = SteedosUI.getRef(api.data.$scopeId).getComponentById("instance_form").getValues();
17058
- const approveValues = SteedosUI.getRef(api.data.$scopeId).getComponentById("instance_approval").getValues();
17079
+ const formValues = context._scoped.getComponentById("instance_form").getValues();
17080
+ const approveValues = context._scoped.getComponentById("instance_approval").getValues();
17059
17081
  let nextUsers = approveValues.next_users;
17060
17082
  if(_.isString(nextUsers)){
17061
17083
  nextUsers = [approveValues.next_users];
@@ -17066,7 +17088,7 @@ const getPostEngineRequestAdaptor = async (instance) => {
17066
17088
  trace: "${instance.approve.trace}",
17067
17089
  _id: "${instance.approve._id}",
17068
17090
  next_steps: [{
17069
- step: approveValues.next_step._id,
17091
+ step: approveValues.next_step,
17070
17092
  users: nextUsers,
17071
17093
  }],
17072
17094
  description: approveValues.suggestion,
@@ -17085,7 +17107,7 @@ const getPostEngineRequestAdaptor = async (instance) => {
17085
17107
  * @returns
17086
17108
  */
17087
17109
  const getSubmitActions = async (instance) => {
17088
- // console.log(`getSubmitActions instance====`, instance)
17110
+ console.log(`getSubmitActions instance====`, instance);
17089
17111
  let api = "";
17090
17112
  let requestAdaptor = "";
17091
17113
  if(instance.approve?.type == "cc"){
@@ -17102,7 +17124,9 @@ const getSubmitActions = async (instance) => {
17102
17124
  return null; //TODO 考虑异常情况?
17103
17125
  }
17104
17126
  }
17105
-
17127
+ console.log(`getSubmitActions api====`, api);
17128
+ console.log(`getSubmitActions requestAdaptor====`, requestAdaptor);
17129
+ console.log('getObjectListViewPath========>', Router$1.getObjectListViewPath({appId: "${appId}", objectName: "${objectName}", listViewName: "${side_listview_id}"}));
17106
17130
  return [
17107
17131
  // 校验表单
17108
17132
  {
@@ -17110,7 +17134,7 @@ const getSubmitActions = async (instance) => {
17110
17134
  "args": {},
17111
17135
  "actionType": "custom",
17112
17136
  "script": `
17113
- // console.log("======getSubmitActions");
17137
+ console.log("======getSubmitActions");
17114
17138
  const form = event.context.scoped.getComponentById("instance_form");
17115
17139
  return form.validate().then((instanceFormValidate)=>{
17116
17140
  event.setData({...event.data, instanceFormValidate})
@@ -17134,7 +17158,7 @@ const getSubmitActions = async (instance) => {
17134
17158
  componentId: "",
17135
17159
  args: {
17136
17160
  api: {
17137
- url: `\${context.rootUrl}${api}`,
17161
+ url: `${api}`,
17138
17162
  method: "post",
17139
17163
  dataType: "json",
17140
17164
  data: {
@@ -17170,7 +17194,7 @@ const getSubmitActions = async (instance) => {
17170
17194
  };
17171
17195
 
17172
17196
  const getApprovalDrawerSchema = async (instance) => {
17173
- // console.log("=============getApprovalDrawerSchema=============")
17197
+ console.log("=============getApprovalDrawerSchema=============", instance);
17174
17198
  return {
17175
17199
  type: "drawer",
17176
17200
  overlay: true,
@@ -17184,7 +17208,7 @@ const getApprovalDrawerSchema = async (instance) => {
17184
17208
  bodyClassName: 'p-2',
17185
17209
  footerClassName: 'p-2 pt-0',
17186
17210
  drawerContainer: ()=>{
17187
- return window.$(".antd-Page-content",window.$(".steedos-instance-wrapper"))[0];
17211
+ return document.body;
17188
17212
  },
17189
17213
  body: [
17190
17214
  {
@@ -17333,15 +17357,11 @@ const getAttachments = async (instance)=>{
17333
17357
  {
17334
17358
  type: 'tpl',
17335
17359
  inline: true,
17336
- tpl: `<a href='\${context.rootUrl}/api/files/instances/\${_id}?download=true' target='_blank'>\${original.name}</a>`
17360
+ tpl: `<a href='/api/v6/files/download/cfs.instances.filerecord/\${_id}/\${original.name}?download=true' target='_blank'>\${original.name}</a>`
17337
17361
  }
17338
17362
  ],
17339
17363
  "actions": [
17340
- {
17341
- "icon": "fa fa-eye",
17342
- "type": "button",
17343
- "id": "u:ef52fa8940a8"
17344
- }
17364
+
17345
17365
  ],
17346
17366
  "id": "u:550b3fdc8788"
17347
17367
  },
@@ -17387,7 +17407,7 @@ const getAttachmentUploadInput = async (instance)=>{
17387
17407
  "extractValue": false,
17388
17408
  "valueField": "version_id",
17389
17409
  "receiver": {
17390
- "url": "${context.rootUrl}/api/v4/instances/s3",
17410
+ "url": "/api/instance/${context._id}/file",
17391
17411
  headers: {
17392
17412
  Authorization: "Bearer ${context.tenantId},${context.authToken}"
17393
17413
  },
@@ -17399,7 +17419,7 @@ const getAttachmentUploadInput = async (instance)=>{
17399
17419
  api.data.append('instance', '${instance._id}');
17400
17420
  api.data.append('approve', '${instance.approve?._id}');
17401
17421
  api.data.append('owner', '${auth.userId}');
17402
- api.data.append('owner_name', '${auth.name}');
17422
+ api.data.append('owner_name', '${auth.user.name}');
17403
17423
  return api;
17404
17424
  `
17405
17425
  },
@@ -17478,11 +17498,6 @@ const getRelatedInstances = async (instance)=>{
17478
17498
  }
17479
17499
  ],
17480
17500
  "actions": [
17481
- {
17482
- "icon": "fa fa-eye",
17483
- "type": "button",
17484
- "id": "u:ef52fa8940a8"
17485
- }
17486
17501
  ],
17487
17502
  "id": "u:550b3fdc8788"
17488
17503
  },
@@ -18253,6 +18268,7 @@ const getFlowFormSchema = async (instance, box) => {
18253
18268
  name: "instancePage",
18254
18269
  className: "steedos-amis-instance-view",
18255
18270
  bodyClassName: "overflow-y-auto h-full",
18271
+ headerClassName: "p-0",
18256
18272
  "title": {
18257
18273
  "type": "steedos-record-detail-header",
18258
18274
  "label": "标题面板",
@@ -18274,6 +18290,25 @@ const getFlowFormSchema = async (instance, box) => {
18274
18290
  ".antd-List-heading": {
18275
18291
  "font-size": "14px",
18276
18292
  "font-weight": "500"
18293
+ },
18294
+ ".steedos-object-record-detail-header .antd-Grid-col--mdAuto": {
18295
+ "padding": "0px !important"
18296
+ },
18297
+ ".steedos-amis-instance-view .antd-Page-body": {
18298
+ "width": "710px"
18299
+ },
18300
+ ".antd-List-placeholder": {
18301
+ "display": "none"
18302
+ },
18303
+ ".steedos-amis-instance-view .antd-Table-fixedTop:after":{
18304
+ "box-shadow": "none"
18305
+ },
18306
+ ".antd-List-items": {
18307
+ "border": '0px'
18308
+ },
18309
+ ".antd-ListItem": {
18310
+ "border-top": "0px !important",
18311
+ "background": "transparent !important"
18277
18312
  }
18278
18313
  },
18279
18314
  body: [
@@ -18618,7 +18653,9 @@ const isCurrentStepOpinionField = (field, currentStep)=>{
18618
18653
  return ___default.includes(___default.map(getOpinionFieldStepsName(field), 'stepName'), currentStep?.name);
18619
18654
  };
18620
18655
 
18621
- const getInstanceInfo = async ({ instanceId, box }) => {
18656
+ const getInstanceInfo = async (props) => {
18657
+ console.log(`getInstanceInfo props`, props);
18658
+ const { instanceId, box } = props;
18622
18659
  const userId = getSteedosAuth$1().userId;
18623
18660
  const query = `{
18624
18661
  instance: instances__findOne(id:"${instanceId}"){