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

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
@@ -1141,7 +1141,7 @@ function getRecordPermissionsQuery(object, recordId, options){
1141
1141
  function getApi$2 (isMobile){
1142
1142
  if(isMobile);else {
1143
1143
  // return __meteor_runtime_config__.ROOT_URL_PATH_PREFIX + "/graphql"
1144
- return `\${context.rootUrl}/graphql?reload=\${additionalFilters|join}`
1144
+ return `\${context.rootUrl}/graphql?reload=\${additionalFilters|join}&listName=\${listName}`
1145
1145
  }
1146
1146
  }
1147
1147
 
@@ -2381,7 +2381,7 @@ async function getColumnItemOnClick(field, options){
2381
2381
  "_inDrawer": true, // 用于判断是否在抽屉中
2382
2382
  "recordLoaded": false, // 重置数据加载状态
2383
2383
  "recordId": `\${${options.idFieldName}}`,//审批微页面依赖了作用域中的recordId
2384
- "_tableObjectName": options.objectName
2384
+ "_lookupObjectName": options.objectName
2385
2385
  }
2386
2386
  }) : {
2387
2387
  "type": "steedos-record-detail",
@@ -2392,7 +2392,7 @@ async function getColumnItemOnClick(field, options){
2392
2392
  "data": {
2393
2393
  "_inDrawer": true, // 用于判断是否在抽屉中
2394
2394
  "recordLoaded": false, // 重置数据加载状态
2395
- "_tableObjectName": options.objectName
2395
+ "_lookupObjectName": options.objectName
2396
2396
  }
2397
2397
  };
2398
2398
 
@@ -2565,7 +2565,7 @@ async function getTableColumns(object, fields, options){
2565
2565
  body: {
2566
2566
  type: "steedos-field",
2567
2567
  static: true,
2568
- tableObjectName: options.objectName,
2568
+ isLookupInTable: true,
2569
2569
  config: {
2570
2570
  type: "lookup",
2571
2571
  reference_to: field.reference_to,
@@ -3387,10 +3387,13 @@ async function getTableApi(mainObject, fields, options){
3387
3387
  // item[key] = value
3388
3388
  // PC客户端附件子表列表点击标题预览附件功能依赖了_id,所以这里拼出来
3389
3389
  let itemKeyValue = item[key];
3390
- item[key] = value.map(function(item, index){
3391
- item._id = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
3392
- item.value = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
3393
- return item;
3390
+ item[key] = value.map(function(curValue, index){
3391
+ let fileId = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
3392
+ // 克隆一份对象,避免下方value递归污染curValue
3393
+ let result = _.clone(curValue);
3394
+ result._id = fileId;
3395
+ result.value = fileId;
3396
+ return result;
3394
3397
  });
3395
3398
  }else{
3396
3399
  item[key] = _.map(value, (item)=>{
@@ -3506,6 +3509,7 @@ async function getTableApi(mainObject, fields, options){
3506
3509
  ${options.adaptor || ''}
3507
3510
  return payload;
3508
3511
  `;
3512
+ // api.trackExpression='${additionalFilters|json}'
3509
3513
  return api;
3510
3514
  }
3511
3515
 
@@ -3634,6 +3638,11 @@ function getReadonlyFormAdaptor(object, fields, options){
3634
3638
  objectName: "\${objectName}",
3635
3639
  recordId: "\${recordId}"
3636
3640
  }
3641
+ if(window.location.pathname.endsWith("/"+record._id)){
3642
+ payload.data.mainRecord= {
3643
+ record
3644
+ };
3645
+ }
3637
3646
  window.postMessage(Object.assign({type: "record.loaded"}, {record: record}), "*")
3638
3647
  }
3639
3648
  if(payload.errors){
@@ -4907,8 +4916,8 @@ const parseSingleExpression = function (func, formData, dataPath, global, userSe
4907
4916
  /*
4908
4917
  * @Author: baozhoutao@steedos.com
4909
4918
  * @Date: 2022-11-01 15:51:00
4910
- * @LastEditors: baozhoutao@steedos.com
4911
- * @LastEditTime: 2024-12-26 20:28:43
4919
+ * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
4920
+ * @LastEditTime: 2025-07-14 11:56:42
4912
4921
  * @Description:
4913
4922
  */
4914
4923
 
@@ -5032,6 +5041,7 @@ const getSchema$5 = async (uiSchema, ctx) => {
5032
5041
  "isLookup": "${isLookup}",
5033
5042
  "listName": "${listName}",
5034
5043
  "selectedRowResponseResult": "${selectedRowResponseResult}",
5044
+ "_lookupObjectName": "${_lookupObjectName}"
5035
5045
  },
5036
5046
  "title":i18next__default["default"].t('frontend_form_new') + " ${uiSchema.label | raw}",
5037
5047
  "body": [
@@ -5104,8 +5114,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
5104
5114
  /*
5105
5115
  * @Author: baozhoutao@steedos.com
5106
5116
  * @Date: 2022-11-01 15:49:58
5107
- * @LastEditors: yinlianghui@hotoa.com yinlianghui@hotoa.com
5108
- * @LastEditTime: 2024-05-19 10:01:07
5117
+ * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
5118
+ * @LastEditTime: 2025-07-14 11:55:43
5109
5119
  * @Description:
5110
5120
  */
5111
5121
 
@@ -5135,6 +5145,7 @@ const getSchema$4 = async (uiSchema, ctx) => {
5135
5145
  : page.schema;
5136
5146
  }
5137
5147
 
5148
+ // console.log('formSchema====>', formSchema);
5138
5149
 
5139
5150
  return {
5140
5151
  type: "service",
@@ -5159,9 +5170,10 @@ const getSchema$4 = async (uiSchema, ctx) => {
5159
5170
  showCloseButton: true,
5160
5171
  "data": {
5161
5172
  "&": "$$",
5162
- "_master": "${_master}",
5173
+ "_master": "${mainRecord}",
5163
5174
  "_master._isRelated": "${_isRelated}",
5164
- "_master.relatedKey": "${relatedKey}"
5175
+ "_master.relatedKey": "${relatedKey}",
5176
+ "_lookupObjectName": "${_lookupObjectName}"
5165
5177
  },
5166
5178
  size: "lg",
5167
5179
  "actions": [
@@ -5260,12 +5272,12 @@ const getSchema$3 = (uiSchema)=>{
5260
5272
  {
5261
5273
  "actionType": "broadcast",
5262
5274
  "args": {
5263
- "eventName": "@data.changed.${_tableObjectName}"
5275
+ "eventName": "@data.changed.${_lookupObjectName}"
5264
5276
  },
5265
5277
  "data": {
5266
- "objectName": "${_tableObjectName}"
5278
+ "objectName": "${_lookupObjectName}"
5267
5279
  },
5268
- "expression": `\${_tableObjectName != '${uiSchema.name}' && _tableObjectName}`
5280
+ "expression": `\${_lookupObjectName != '${uiSchema.name}' && _lookupObjectName}`
5269
5281
  }
5270
5282
  ]
5271
5283
  }
@@ -6498,7 +6510,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
6498
6510
  });
6499
6511
  // 有过滤条件时只显示搜索按钮上的红点,不自动展开搜索栏
6500
6512
  if(!_.isEmpty(omitedEmptyFormValue)){
6501
- let crudService = SteedosUI.getRef(data.$scopeId).parent.getComponentById("service_listview_" + data.objectName)
6513
+ let scopeRef = SteedosUI.getRef(data.$scopeId);
6514
+ let crudService = scopeRef && scopeRef.parent.getComponentById("service_listview_" + data.objectName)
6502
6515
  crudService && crudService.setData({isFieldsFilterEmpty: false});
6503
6516
  // setData({ showFieldsFilter: true });//自动展开搜索栏
6504
6517
  }
@@ -7597,6 +7610,7 @@ function getObjectListHeaderFirstLine(objectSchema, listViewName, ctx) {
7597
7610
  "size": "sm",
7598
7611
  "hideCaret": true,
7599
7612
  "closeOnClick": true,
7613
+ "visibleOn": "\${listName && uiSchema.list_views[listName].disableSwitch != true}",
7600
7614
  "btnClassName": "!bg-transparent !border-none !hover:border-none text-lg h-5 font-bold p-0 text-black leading-none",
7601
7615
  "buttons": [
7602
7616
  ...listViewButtonOptions,
@@ -7609,6 +7623,12 @@ function getObjectListHeaderFirstLine(objectSchema, listViewName, ctx) {
7609
7623
  },
7610
7624
  listviewNewButton
7611
7625
  ]
7626
+ },
7627
+ {
7628
+ "type": "tpl",
7629
+ "className": "steedos-listview-change-button text-lg font-bold",
7630
+ "tpl": "\${listName ? uiSchema.list_views[listName].label : uiSchema.list_views[defaultListName].label}",
7631
+ "visibleOn": "\${listName && uiSchema.list_views[listName].disableSwitch}",
7612
7632
  }
7613
7633
  ],
7614
7634
  "md": "",
@@ -10006,16 +10026,16 @@ async function getObjectForm(objectSchema, ctx){
10006
10026
  },
10007
10027
  "expression": `\${_master.objectName != '${objectSchema.name}' && _master.objectName}`
10008
10028
  },
10009
- // 列表视图、对象表格组件上的lookup字段,点开右侧弹出drawer窗口,修改记录后刷新列表
10029
+ // 列表视图、对象表格、对象表单组件上的lookup字段,点开右侧弹出drawer窗口,修改记录后刷新列表
10010
10030
  {
10011
10031
  "actionType": "broadcast",
10012
10032
  "args": {
10013
- "eventName": "@data.changed.${_tableObjectName}"
10033
+ "eventName": "@data.changed.${_lookupObjectName}"
10014
10034
  },
10015
10035
  "data": {
10016
- "objectName": "${_tableObjectName}"
10036
+ "objectName": "${_lookupObjectName}"
10017
10037
  },
10018
- "expression": `\${_tableObjectName != '${objectSchema.name}' && _tableObjectName}`
10038
+ "expression": `\${_lookupObjectName != '${objectSchema.name}' && _lookupObjectName}`
10019
10039
  },
10020
10040
  ...submitSuccActions,
10021
10041
  // {
@@ -10386,7 +10406,10 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
10386
10406
  data: {
10387
10407
  relatedKey: relatedKey,
10388
10408
  listViewId: `amis-\${appId}-${relatedObjectName}-listview`,
10389
- _isRelated: true
10409
+ _isRelated: true,
10410
+ record: {
10411
+ recordPermissions: relatedObjectUiSchema.permissions
10412
+ }
10390
10413
  },
10391
10414
  body:[
10392
10415
  amisSchema
@@ -14251,7 +14274,8 @@ async function getFieldSearchable(perField, permissionFields, ctx){
14251
14274
  _field.removable = false;
14252
14275
  _field.value = [null,null];
14253
14276
  _field.items = {
14254
- type: "input-number"
14277
+ type: "input-number",
14278
+ clearValueOnEmpty: true
14255
14279
  };
14256
14280
  _field.is_wide = true;
14257
14281
  fieldNamePrefix = `${fieldNamePrefix}between__`;
@@ -14299,6 +14323,10 @@ async function getFieldSearchable(perField, permissionFields, ctx){
14299
14323
  delete _field.amis.hidden;
14300
14324
  delete _field.amis.hiddenOn;
14301
14325
  delete _field.amis.autoFill;
14326
+ if(_field.type.indexOf("-range") > -1 || _field.type === 'input-array'){
14327
+ // 范围类型不允许变更type,否则会因为某些属性兼容性问题报错页面奔溃,比如input-date-range类型有shortcuts属性,改为input-date后其shortcuts属性有兼容性问题
14328
+ delete _field.amis.type;
14329
+ }
14302
14330
  }
14303
14331
 
14304
14332
  const amisField = await convertSFieldToAmisField(_field, false, Object.assign({}, ctx, {fieldNamePrefix: fieldNamePrefix, required: false, showSystemFields: true, inFilterForm: true}));
@@ -16820,6 +16848,7 @@ const getJudgeOptions = async (instance) => {
16820
16848
 
16821
16849
  const getJudgeInput = async (instance) => {
16822
16850
  const judgeOptions = await getJudgeOptions(instance);
16851
+ // console.log('getJudgeInput', judgeOptions);
16823
16852
  if (judgeOptions.length > 0 && instance.approve.type != 'cc') {
16824
16853
  return {
16825
16854
  type: "radios",
@@ -16860,6 +16889,7 @@ const getJudgeInput = async (instance) => {
16860
16889
 
16861
16890
  //TODO 只有一个下一步时,默认选中,并且禁止修改.
16862
16891
  const getNextStepInput = async (instance) => {
16892
+ // console.log('getNextStepInput', instance);
16863
16893
  if(instance.approve?.type == 'cc'){
16864
16894
  return ;
16865
16895
  }
@@ -16895,14 +16925,30 @@ const getNextStepInput = async (instance) => {
16895
16925
  "next_users": null
16896
16926
  },
16897
16927
  "source": {
16898
- "url": "${context.rootUrl}/api/workflow/v2/nextStep?judge=${new_judge}",
16928
+ "url": "/api/workflow/v2/nextStep?judge=${new_judge}",
16899
16929
  "headers": {
16900
16930
  "Authorization": "Bearer ${context.tenantId},${context.authToken}"
16901
16931
  },
16902
16932
  "method": "post",
16903
16933
  "messages": {
16904
16934
  },
16905
- "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;",
16935
+ "requestAdaptor": `
16936
+ let { judge } = api.data;
16937
+ const ctx = api.data.context;
16938
+ if(!judge){
16939
+ judge='approved'
16940
+ };
16941
+ const formValues = context._scoped.getComponentById("instance_form").getValues();
16942
+ api.data = {
16943
+ flowVersionId: ctx.flowVersion._id,
16944
+ instanceId: ctx._id,
16945
+ flowId: ctx.flow._id,
16946
+ step: ctx.step,
16947
+ judge: judge,
16948
+ values: formValues
16949
+ };
16950
+ return api;
16951
+ `,
16906
16952
  "adaptor": `
16907
16953
  payload.data = {
16908
16954
  value: payload.nextSteps.length === 1 ? payload.nextSteps[0]._id : null,
@@ -17010,7 +17056,7 @@ const getNextStepUsersInput = async (instance) => {
17010
17056
  "messages": {
17011
17057
  },
17012
17058
  "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;",
17013
- "adaptor": "\npayload.data = {value: payload.nextStepUsers.length === 1 ? payload.nextStepUsers[0].id : null, options: payload.nextStepUsers};\nreturn payload;",
17059
+ "adaptor": "debugger;\npayload.data = {value: payload.nextStepUsers.length === 1 ? payload.nextStepUsers[0].id : null, options: payload.nextStepUsers};\nreturn payload;",
17014
17060
  "data": {
17015
17061
  "&": "$$",
17016
17062
  "$scopeId": "$scopeId",
@@ -17035,8 +17081,8 @@ const getNextStepUsersInput = async (instance) => {
17035
17081
 
17036
17082
  const getCCSubmitRequestAdaptor = async (instance) => {
17037
17083
  return `
17038
- const instanceForm = SteedosUI.getRef(api.data.$scopeId).getComponentById("instance_form");
17039
- const approveValues = SteedosUI.getRef(api.data.$scopeId).getComponentById("instance_approval").getValues();
17084
+ const instanceForm = context._scoped.getComponentById("instance_form");
17085
+ const approveValues = context._scoped.getComponentById("instance_approval").getValues();
17040
17086
  api.data = {
17041
17087
  instanceId: "${instance._id}",
17042
17088
  traceId: "${instance.trace._id}",
@@ -17048,9 +17094,9 @@ const getCCSubmitRequestAdaptor = async (instance) => {
17048
17094
  };
17049
17095
 
17050
17096
  const getPostSubmitRequestAdaptor = async (instance) => {
17051
- return ` const instanceForm = SteedosUI.getRef(api.data.$scopeId).getComponentById("instance_form");
17097
+ return ` const instanceForm = context._scoped.getComponentById("instance_form");
17052
17098
  const formValues = instanceForm.getValues();
17053
- const approveValues = SteedosUI.getRef(api.data.$scopeId).getComponentById("instance_approval").getValues();
17099
+ const approveValues = context._scoped.getComponentById("instance_approval").getValues();
17054
17100
  let nextUsers = approveValues.next_users;
17055
17101
  if(_.isString(nextUsers)){
17056
17102
  nextUsers = [approveValues.next_users];
@@ -17066,7 +17112,7 @@ const getPostSubmitRequestAdaptor = async (instance) => {
17066
17112
  approves: [{
17067
17113
  _id: "${instance.approve._id}",
17068
17114
  next_steps: [{
17069
- step: approveValues.next_step._id,
17115
+ step: approveValues.next_step,
17070
17116
  users: nextUsers,
17071
17117
  }],
17072
17118
  description: approveValues.suggestion,
@@ -17074,6 +17120,7 @@ const getPostSubmitRequestAdaptor = async (instance) => {
17074
17120
  }]
17075
17121
  }]
17076
17122
  }]};
17123
+ console.log('submit api', api);
17077
17124
  api.data = body;
17078
17125
  return api;
17079
17126
  `;
@@ -17081,8 +17128,8 @@ const getPostSubmitRequestAdaptor = async (instance) => {
17081
17128
 
17082
17129
  const getPostEngineRequestAdaptor = async (instance) => {
17083
17130
  return `
17084
- const formValues = SteedosUI.getRef(api.data.$scopeId).getComponentById("instance_form").getValues();
17085
- const approveValues = SteedosUI.getRef(api.data.$scopeId).getComponentById("instance_approval").getValues();
17131
+ const formValues = context._scoped.getComponentById("instance_form").getValues();
17132
+ const approveValues = context._scoped.getComponentById("instance_approval").getValues();
17086
17133
  let nextUsers = approveValues.next_users;
17087
17134
  if(_.isString(nextUsers)){
17088
17135
  nextUsers = [approveValues.next_users];
@@ -17093,7 +17140,7 @@ const getPostEngineRequestAdaptor = async (instance) => {
17093
17140
  trace: "${instance.approve.trace}",
17094
17141
  _id: "${instance.approve._id}",
17095
17142
  next_steps: [{
17096
- step: approveValues.next_step._id,
17143
+ step: approveValues.next_step,
17097
17144
  users: nextUsers,
17098
17145
  }],
17099
17146
  description: approveValues.suggestion,
@@ -17112,7 +17159,7 @@ const getPostEngineRequestAdaptor = async (instance) => {
17112
17159
  * @returns
17113
17160
  */
17114
17161
  const getSubmitActions = async (instance) => {
17115
- // console.log(`getSubmitActions instance====`, instance)
17162
+ console.log(`getSubmitActions instance====`, instance);
17116
17163
  let api = "";
17117
17164
  let requestAdaptor = "";
17118
17165
  if(instance.approve?.type == "cc"){
@@ -17129,7 +17176,9 @@ const getSubmitActions = async (instance) => {
17129
17176
  return null; //TODO 考虑异常情况?
17130
17177
  }
17131
17178
  }
17132
-
17179
+ console.log(`getSubmitActions api====`, api);
17180
+ console.log(`getSubmitActions requestAdaptor====`, requestAdaptor);
17181
+ console.log('getObjectListViewPath========>', amisLib.Router.getObjectListViewPath({appId: "${appId}", objectName: "${objectName}", listViewName: "${side_listview_id}"}));
17133
17182
  return [
17134
17183
  // 校验表单
17135
17184
  {
@@ -17137,7 +17186,7 @@ const getSubmitActions = async (instance) => {
17137
17186
  "args": {},
17138
17187
  "actionType": "custom",
17139
17188
  "script": `
17140
- // console.log("======getSubmitActions");
17189
+ console.log("======getSubmitActions");
17141
17190
  const form = event.context.scoped.getComponentById("instance_form");
17142
17191
  return form.validate().then((instanceFormValidate)=>{
17143
17192
  event.setData({...event.data, instanceFormValidate})
@@ -17161,7 +17210,7 @@ const getSubmitActions = async (instance) => {
17161
17210
  componentId: "",
17162
17211
  args: {
17163
17212
  api: {
17164
- url: `\${context.rootUrl}${api}`,
17213
+ url: `${api}`,
17165
17214
  method: "post",
17166
17215
  dataType: "json",
17167
17216
  data: {
@@ -17197,7 +17246,7 @@ const getSubmitActions = async (instance) => {
17197
17246
  };
17198
17247
 
17199
17248
  const getApprovalDrawerSchema = async (instance) => {
17200
- // console.log("=============getApprovalDrawerSchema=============")
17249
+ console.log("=============getApprovalDrawerSchema=============", instance);
17201
17250
  return {
17202
17251
  type: "drawer",
17203
17252
  overlay: true,
@@ -17211,7 +17260,7 @@ const getApprovalDrawerSchema = async (instance) => {
17211
17260
  bodyClassName: 'p-2',
17212
17261
  footerClassName: 'p-2 pt-0',
17213
17262
  drawerContainer: ()=>{
17214
- return window.$(".antd-Page-content",window.$(".steedos-instance-wrapper"))[0];
17263
+ return document.body;
17215
17264
  },
17216
17265
  body: [
17217
17266
  {
@@ -17360,15 +17409,11 @@ const getAttachments = async (instance)=>{
17360
17409
  {
17361
17410
  type: 'tpl',
17362
17411
  inline: true,
17363
- tpl: `<a href='\${context.rootUrl}/api/files/instances/\${_id}?download=true' target='_blank'>\${original.name}</a>`
17412
+ tpl: `<a href='/api/v6/files/download/cfs.instances.filerecord/\${_id}/\${original.name}?download=true' target='_blank'>\${original.name}</a>`
17364
17413
  }
17365
17414
  ],
17366
17415
  "actions": [
17367
- {
17368
- "icon": "fa fa-eye",
17369
- "type": "button",
17370
- "id": "u:ef52fa8940a8"
17371
- }
17416
+
17372
17417
  ],
17373
17418
  "id": "u:550b3fdc8788"
17374
17419
  },
@@ -17414,7 +17459,7 @@ const getAttachmentUploadInput = async (instance)=>{
17414
17459
  "extractValue": false,
17415
17460
  "valueField": "version_id",
17416
17461
  "receiver": {
17417
- "url": "${context.rootUrl}/api/v4/instances/s3",
17462
+ "url": "/api/instance/${context._id}/file",
17418
17463
  headers: {
17419
17464
  Authorization: "Bearer ${context.tenantId},${context.authToken}"
17420
17465
  },
@@ -17426,7 +17471,7 @@ const getAttachmentUploadInput = async (instance)=>{
17426
17471
  api.data.append('instance', '${instance._id}');
17427
17472
  api.data.append('approve', '${instance.approve?._id}');
17428
17473
  api.data.append('owner', '${auth.userId}');
17429
- api.data.append('owner_name', '${auth.name}');
17474
+ api.data.append('owner_name', '${auth.user.name}');
17430
17475
  return api;
17431
17476
  `
17432
17477
  },
@@ -17505,11 +17550,6 @@ const getRelatedInstances = async (instance)=>{
17505
17550
  }
17506
17551
  ],
17507
17552
  "actions": [
17508
- {
17509
- "icon": "fa fa-eye",
17510
- "type": "button",
17511
- "id": "u:ef52fa8940a8"
17512
- }
17513
17553
  ],
17514
17554
  "id": "u:550b3fdc8788"
17515
17555
  },
@@ -17926,6 +17966,10 @@ const getFieldEditTpl = async (field, label)=>{
17926
17966
  case "section":
17927
17967
  tpl.type = "input-text";
17928
17968
  break;
17969
+ default:
17970
+ tpl.type = 'steedos-field';
17971
+ tpl.config = field.steedos_field;
17972
+ break;
17929
17973
  }
17930
17974
  }
17931
17975
  // console.log('getFieldEditTpl ', label, tpl)
@@ -18050,15 +18094,15 @@ const getTdField = async (field, fieldsCount) => {
18050
18094
 
18051
18095
  const getTdTitle = (field) => {
18052
18096
  return {
18053
- className: "td-title",
18097
+ className: `td-title td-title-${field.type}`,
18054
18098
  align: field.type != "section" ? "center" : "left",
18055
18099
  width: field.type != "section" ? "16%" : "",
18056
18100
  colspan: field.type == "section" ? 4 : "",
18057
- background: "#FFFFFF",
18101
+ background: field.type == "section" ? "#f1f1f1" : "#FFFFFF",
18058
18102
  body: [
18059
18103
  {
18060
18104
  type: "tpl",
18061
- tpl: `<div>${field.name || field.code} ${field.is_required ? '<span class="antd-Form-star">*</span>' : ''}</div>`,
18105
+ tpl: `<div class='${field.type == "section" ? "font-bold" : ""}'>${field.name || field.code} ${field.is_required ? '<span class="antd-Form-star">*</span>' : ''}</div>`,
18062
18106
  },
18063
18107
  ],
18064
18108
  // "id": "u:9b001b7ff92d",
@@ -18131,6 +18175,7 @@ const getFormTableView = async (instance) => {
18131
18175
  trs: await getFormTrs(instance),
18132
18176
  id: "u:047f3669468b",
18133
18177
  };
18178
+ console.log('getFormTableView===>', instance, formSchema);
18134
18179
  return formSchema;
18135
18180
  };
18136
18181
 
@@ -18160,6 +18205,14 @@ const getApplicantTableView = async (instance) => {
18160
18205
  };
18161
18206
  }
18162
18207
 
18208
+ if(applicantInput){
18209
+ if(applicantInput.className){
18210
+ applicantInput.className = `${applicantInput.className} inline-left`;
18211
+ }else {
18212
+ applicantInput.className = `inline-left`;
18213
+ }
18214
+ }
18215
+
18163
18216
  return {
18164
18217
  type: "table-view",
18165
18218
  className: "instance-applicant-view",
@@ -18171,70 +18224,50 @@ const getApplicantTableView = async (instance) => {
18171
18224
  className: "td-title",
18172
18225
  background: "#FFFFFF",
18173
18226
  align: "left",
18174
- width: "16%",
18227
+ width: "50%",
18175
18228
  colspan: "",
18176
18229
  body: [
18177
18230
  {
18178
18231
  type: "tpl",
18179
- tpl: "<div>提交人</div>",
18232
+ tpl: "<div class='inline-left'>提交人:</div>",
18180
18233
  id: "u:ee62634201bf",
18181
18234
  },
18235
+ applicantInput
18182
18236
  ],
18183
18237
  id: "u:6c24c1bb99c9",
18184
18238
  style: {
18185
18239
  padding: "none",
18186
18240
  },
18187
18241
  },
18188
- {
18189
- background: "#FFFFFF",
18190
- colspan: 1,
18191
- align: "left",
18192
- className: "td-field",
18193
- width: "32%",
18194
- body: [
18195
- applicantInput
18196
- ],
18197
- id: "u:45d65d91905c",
18198
- },
18199
18242
  {
18200
18243
  className: "td-title",
18201
18244
  background: "#FFFFFF",
18202
18245
  align: "left",
18203
- width: "16%",
18246
+ width: "50%",
18204
18247
  colspan: "",
18205
18248
  body: [
18206
18249
  {
18207
18250
  type: "tpl",
18208
- tpl: "<div>提交日期</div>",
18251
+ tpl: "<div class='inline-left'>提交日期:</div>",
18209
18252
  id: "u:6d0a7763d527",
18210
18253
  },
18211
- ],
18212
- id: "u:c8b8214ac931",
18213
- style: {
18214
- padding: "none",
18215
- },
18216
- },
18217
- {
18218
- background: "#FFFFFF",
18219
- colspan: 1,
18220
- align: "left",
18221
- className: "td-field",
18222
- width: "32%",
18223
- body: [
18224
18254
  {
18225
18255
  label: false,
18226
18256
  mode: "horizontal",
18227
- className: "m-none p-none",
18257
+ className: "m-none p-none inline-left",
18228
18258
  disabled: true,
18229
18259
  type: "tpl",
18230
18260
  inputFormat: "YYYY-MM-DD",
18231
18261
  valueFormat: "YYYY-MM-DDT00:00:00.000[Z]",
18232
18262
  tpl: '<div>${submit_date}</div>',
18233
18263
  id: "u:2016b04355f4",
18234
- },
18264
+ }
18235
18265
  ],
18236
- id: "u:81b07d82a5e4",
18237
- },
18266
+ id: "u:c8b8214ac931",
18267
+ style: {
18268
+ padding: "none",
18269
+ },
18270
+ }
18238
18271
  ],
18239
18272
  },
18240
18273
  ],
@@ -18280,6 +18313,7 @@ const getFlowFormSchema = async (instance, box) => {
18280
18313
  name: "instancePage",
18281
18314
  className: "steedos-amis-instance-view",
18282
18315
  bodyClassName: "overflow-y-auto h-full",
18316
+ headerClassName: "p-0",
18283
18317
  "title": {
18284
18318
  "type": "steedos-record-detail-header",
18285
18319
  "label": "标题面板",
@@ -18287,7 +18321,7 @@ const getFlowFormSchema = async (instance, box) => {
18287
18321
  "recordId": instance._id,
18288
18322
  "id": "u:e6b2adbe0e21",
18289
18323
  "showRecordTitle": false,
18290
- "className": "p-0 m-0 p0 m0"
18324
+ "className": "p-0 m-0 p0 m0 bg-gray-50"
18291
18325
  },
18292
18326
  "css": {
18293
18327
  ".instance-approve-history .antd-Table-table thead": {
@@ -18301,6 +18335,25 @@ const getFlowFormSchema = async (instance, box) => {
18301
18335
  ".antd-List-heading": {
18302
18336
  "font-size": "14px",
18303
18337
  "font-weight": "500"
18338
+ },
18339
+ ".steedos-object-record-detail-header .antd-Grid-col--mdAuto": {
18340
+ "padding": "0px !important"
18341
+ },
18342
+ ".steedos-amis-instance-view .antd-Page-body": {
18343
+ "width": "1024px"
18344
+ },
18345
+ ".antd-List-placeholder": {
18346
+ "display": "none"
18347
+ },
18348
+ ".steedos-amis-instance-view .antd-Table-fixedTop:after":{
18349
+ "box-shadow": "none"
18350
+ },
18351
+ ".antd-List-items": {
18352
+ "border": '0px'
18353
+ },
18354
+ ".antd-ListItem": {
18355
+ "border-top": "0px !important",
18356
+ "background": "transparent !important"
18304
18357
  }
18305
18358
  },
18306
18359
  body: [
@@ -18645,7 +18698,10 @@ const isCurrentStepOpinionField = (field, currentStep)=>{
18645
18698
  return ___default["default"].includes(___default["default"].map(getOpinionFieldStepsName(field), 'stepName'), currentStep?.name);
18646
18699
  };
18647
18700
 
18648
- const getInstanceInfo = async ({ instanceId, box }) => {
18701
+
18702
+ const getInstanceInfo = async (props) => {
18703
+ console.log(`getInstanceInfo props`, props);
18704
+ const { instanceId, box } = props;
18649
18705
  const userId = amisLib.getSteedosAuth().userId;
18650
18706
  const query = `{
18651
18707
  instance: instances__findOne(id:"${instanceId}"){
@@ -18728,7 +18784,7 @@ const getInstanceInfo = async ({ instanceId, box }) => {
18728
18784
  });
18729
18785
 
18730
18786
  const moment = getMoment();
18731
-
18787
+ console.log('getInstanceInfo====>', step, formVersion.fields);
18732
18788
  return {
18733
18789
  box: box,
18734
18790
  _id: instanceId,
@@ -18746,9 +18802,17 @@ const getInstanceInfo = async ({ instanceId, box }) => {
18746
18802
  title: instance.name || instance.form.name,
18747
18803
  name: instance.name || instance.form.name,
18748
18804
  fields: ___default["default"].map(formVersion.fields, (field) => {
18749
- return Object.assign({}, field, {
18805
+ const newField = Object.assign({}, field, {
18750
18806
  permission: userApprove?.type != 'cc' && (step?.permissions[field.code] || ( isCurrentStepOpinionField(field, step) ? 'editable' : '')),
18751
18807
  }) ;
18808
+ if(field.type === 'section'){
18809
+ newField.fields = ___default["default"].map(field.fields, (sfield) => {
18810
+ return Object.assign({}, sfield, {
18811
+ permission: userApprove?.type != 'cc' && (step?.permissions[sfield.code] || ( isCurrentStepOpinionField(sfield, step) ? 'editable' : '')),
18812
+ });
18813
+ });
18814
+ }
18815
+ return newField;
18752
18816
  }),
18753
18817
  flowVersion: flowVersion,
18754
18818
  formVersion: formVersion,