@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/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/index.cjs.js +157 -93
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +157 -93
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +54 -52
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/header.d.ts +32 -0
- package/dist/types/lib/objectsRelated.d.ts +3 -0
- package/dist/types/schema/standard_edit.amis.d.ts +1 -0
- package/dist/types/schema/standard_new.amis.d.ts +1 -0
- package/dist/types/standard/button.d.ts +2 -0
- package/dist/types/workflow/approve.d.ts +1 -1
- package/dist/types/workflow/attachment.d.ts +1 -5
- package/dist/types/workflow/flow.d.ts +26 -27
- package/dist/types/workflow/instance.d.ts +1 -4
- package/dist/types/workflow/related.d.ts +1 -5
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1114,7 +1114,7 @@ function getRecordPermissionsQuery(object, recordId, options){
|
|
|
1114
1114
|
function getApi$2 (isMobile){
|
|
1115
1115
|
if(isMobile);else {
|
|
1116
1116
|
// return __meteor_runtime_config__.ROOT_URL_PATH_PREFIX + "/graphql"
|
|
1117
|
-
return `\${context.rootUrl}/graphql?reload=\${additionalFilters|join}`
|
|
1117
|
+
return `\${context.rootUrl}/graphql?reload=\${additionalFilters|join}&listName=\${listName}`
|
|
1118
1118
|
}
|
|
1119
1119
|
}
|
|
1120
1120
|
|
|
@@ -2354,7 +2354,7 @@ async function getColumnItemOnClick(field, options){
|
|
|
2354
2354
|
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
2355
2355
|
"recordLoaded": false, // 重置数据加载状态
|
|
2356
2356
|
"recordId": `\${${options.idFieldName}}`,//审批微页面依赖了作用域中的recordId
|
|
2357
|
-
"
|
|
2357
|
+
"_lookupObjectName": options.objectName
|
|
2358
2358
|
}
|
|
2359
2359
|
}) : {
|
|
2360
2360
|
"type": "steedos-record-detail",
|
|
@@ -2365,7 +2365,7 @@ async function getColumnItemOnClick(field, options){
|
|
|
2365
2365
|
"data": {
|
|
2366
2366
|
"_inDrawer": true, // 用于判断是否在抽屉中
|
|
2367
2367
|
"recordLoaded": false, // 重置数据加载状态
|
|
2368
|
-
"
|
|
2368
|
+
"_lookupObjectName": options.objectName
|
|
2369
2369
|
}
|
|
2370
2370
|
};
|
|
2371
2371
|
|
|
@@ -2538,7 +2538,7 @@ async function getTableColumns(object, fields, options){
|
|
|
2538
2538
|
body: {
|
|
2539
2539
|
type: "steedos-field",
|
|
2540
2540
|
static: true,
|
|
2541
|
-
|
|
2541
|
+
isLookupInTable: true,
|
|
2542
2542
|
config: {
|
|
2543
2543
|
type: "lookup",
|
|
2544
2544
|
reference_to: field.reference_to,
|
|
@@ -3360,10 +3360,13 @@ async function getTableApi(mainObject, fields, options){
|
|
|
3360
3360
|
// item[key] = value
|
|
3361
3361
|
// PC客户端附件子表列表点击标题预览附件功能依赖了_id,所以这里拼出来
|
|
3362
3362
|
let itemKeyValue = item[key];
|
|
3363
|
-
item[key] = value.map(function(
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3363
|
+
item[key] = value.map(function(curValue, index){
|
|
3364
|
+
let fileId = typeof itemKeyValue == 'string' ? itemKeyValue : itemKeyValue[index];
|
|
3365
|
+
// 克隆一份对象,避免下方value递归污染curValue
|
|
3366
|
+
let result = _.clone(curValue);
|
|
3367
|
+
result._id = fileId;
|
|
3368
|
+
result.value = fileId;
|
|
3369
|
+
return result;
|
|
3367
3370
|
});
|
|
3368
3371
|
}else{
|
|
3369
3372
|
item[key] = _.map(value, (item)=>{
|
|
@@ -3479,6 +3482,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
3479
3482
|
${options.adaptor || ''}
|
|
3480
3483
|
return payload;
|
|
3481
3484
|
`;
|
|
3485
|
+
// api.trackExpression='${additionalFilters|json}'
|
|
3482
3486
|
return api;
|
|
3483
3487
|
}
|
|
3484
3488
|
|
|
@@ -3607,6 +3611,11 @@ function getReadonlyFormAdaptor(object, fields, options){
|
|
|
3607
3611
|
objectName: "\${objectName}",
|
|
3608
3612
|
recordId: "\${recordId}"
|
|
3609
3613
|
}
|
|
3614
|
+
if(window.location.pathname.endsWith("/"+record._id)){
|
|
3615
|
+
payload.data.mainRecord= {
|
|
3616
|
+
record
|
|
3617
|
+
};
|
|
3618
|
+
}
|
|
3610
3619
|
window.postMessage(Object.assign({type: "record.loaded"}, {record: record}), "*")
|
|
3611
3620
|
}
|
|
3612
3621
|
if(payload.errors){
|
|
@@ -4880,8 +4889,8 @@ const parseSingleExpression = function (func, formData, dataPath, global, userSe
|
|
|
4880
4889
|
/*
|
|
4881
4890
|
* @Author: baozhoutao@steedos.com
|
|
4882
4891
|
* @Date: 2022-11-01 15:51:00
|
|
4883
|
-
* @LastEditors:
|
|
4884
|
-
* @LastEditTime:
|
|
4892
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
4893
|
+
* @LastEditTime: 2025-07-14 11:56:42
|
|
4885
4894
|
* @Description:
|
|
4886
4895
|
*/
|
|
4887
4896
|
|
|
@@ -5005,6 +5014,7 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5005
5014
|
"isLookup": "${isLookup}",
|
|
5006
5015
|
"listName": "${listName}",
|
|
5007
5016
|
"selectedRowResponseResult": "${selectedRowResponseResult}",
|
|
5017
|
+
"_lookupObjectName": "${_lookupObjectName}"
|
|
5008
5018
|
},
|
|
5009
5019
|
"title":i18next.t('frontend_form_new') + " ${uiSchema.label | raw}",
|
|
5010
5020
|
"body": [
|
|
@@ -5077,8 +5087,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5077
5087
|
/*
|
|
5078
5088
|
* @Author: baozhoutao@steedos.com
|
|
5079
5089
|
* @Date: 2022-11-01 15:49:58
|
|
5080
|
-
* @LastEditors:
|
|
5081
|
-
* @LastEditTime:
|
|
5090
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5091
|
+
* @LastEditTime: 2025-07-14 11:55:43
|
|
5082
5092
|
* @Description:
|
|
5083
5093
|
*/
|
|
5084
5094
|
|
|
@@ -5108,6 +5118,7 @@ const getSchema$4 = async (uiSchema, ctx) => {
|
|
|
5108
5118
|
: page.schema;
|
|
5109
5119
|
}
|
|
5110
5120
|
|
|
5121
|
+
// console.log('formSchema====>', formSchema);
|
|
5111
5122
|
|
|
5112
5123
|
return {
|
|
5113
5124
|
type: "service",
|
|
@@ -5132,9 +5143,10 @@ const getSchema$4 = async (uiSchema, ctx) => {
|
|
|
5132
5143
|
showCloseButton: true,
|
|
5133
5144
|
"data": {
|
|
5134
5145
|
"&": "$$",
|
|
5135
|
-
"_master": "${
|
|
5146
|
+
"_master": "${mainRecord}",
|
|
5136
5147
|
"_master._isRelated": "${_isRelated}",
|
|
5137
|
-
"_master.relatedKey": "${relatedKey}"
|
|
5148
|
+
"_master.relatedKey": "${relatedKey}",
|
|
5149
|
+
"_lookupObjectName": "${_lookupObjectName}"
|
|
5138
5150
|
},
|
|
5139
5151
|
size: "lg",
|
|
5140
5152
|
"actions": [
|
|
@@ -5233,12 +5245,12 @@ const getSchema$3 = (uiSchema)=>{
|
|
|
5233
5245
|
{
|
|
5234
5246
|
"actionType": "broadcast",
|
|
5235
5247
|
"args": {
|
|
5236
|
-
"eventName": "@data.changed.${
|
|
5248
|
+
"eventName": "@data.changed.${_lookupObjectName}"
|
|
5237
5249
|
},
|
|
5238
5250
|
"data": {
|
|
5239
|
-
"objectName": "${
|
|
5251
|
+
"objectName": "${_lookupObjectName}"
|
|
5240
5252
|
},
|
|
5241
|
-
"expression": `\${
|
|
5253
|
+
"expression": `\${_lookupObjectName != '${uiSchema.name}' && _lookupObjectName}`
|
|
5242
5254
|
}
|
|
5243
5255
|
]
|
|
5244
5256
|
}
|
|
@@ -6471,7 +6483,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6471
6483
|
});
|
|
6472
6484
|
// 有过滤条件时只显示搜索按钮上的红点,不自动展开搜索栏
|
|
6473
6485
|
if(!_.isEmpty(omitedEmptyFormValue)){
|
|
6474
|
-
let
|
|
6486
|
+
let scopeRef = SteedosUI.getRef(data.$scopeId);
|
|
6487
|
+
let crudService = scopeRef && scopeRef.parent.getComponentById("service_listview_" + data.objectName)
|
|
6475
6488
|
crudService && crudService.setData({isFieldsFilterEmpty: false});
|
|
6476
6489
|
// setData({ showFieldsFilter: true });//自动展开搜索栏
|
|
6477
6490
|
}
|
|
@@ -7570,6 +7583,7 @@ function getObjectListHeaderFirstLine(objectSchema, listViewName, ctx) {
|
|
|
7570
7583
|
"size": "sm",
|
|
7571
7584
|
"hideCaret": true,
|
|
7572
7585
|
"closeOnClick": true,
|
|
7586
|
+
"visibleOn": "\${listName && uiSchema.list_views[listName].disableSwitch != true}",
|
|
7573
7587
|
"btnClassName": "!bg-transparent !border-none !hover:border-none text-lg h-5 font-bold p-0 text-black leading-none",
|
|
7574
7588
|
"buttons": [
|
|
7575
7589
|
...listViewButtonOptions,
|
|
@@ -7582,6 +7596,12 @@ function getObjectListHeaderFirstLine(objectSchema, listViewName, ctx) {
|
|
|
7582
7596
|
},
|
|
7583
7597
|
listviewNewButton
|
|
7584
7598
|
]
|
|
7599
|
+
},
|
|
7600
|
+
{
|
|
7601
|
+
"type": "tpl",
|
|
7602
|
+
"className": "steedos-listview-change-button text-lg font-bold",
|
|
7603
|
+
"tpl": "\${listName ? uiSchema.list_views[listName].label : uiSchema.list_views[defaultListName].label}",
|
|
7604
|
+
"visibleOn": "\${listName && uiSchema.list_views[listName].disableSwitch}",
|
|
7585
7605
|
}
|
|
7586
7606
|
],
|
|
7587
7607
|
"md": "",
|
|
@@ -9979,16 +9999,16 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
9979
9999
|
},
|
|
9980
10000
|
"expression": `\${_master.objectName != '${objectSchema.name}' && _master.objectName}`
|
|
9981
10001
|
},
|
|
9982
|
-
//
|
|
10002
|
+
// 列表视图、对象表格、对象表单组件上的lookup字段,点开右侧弹出drawer窗口,修改记录后刷新列表
|
|
9983
10003
|
{
|
|
9984
10004
|
"actionType": "broadcast",
|
|
9985
10005
|
"args": {
|
|
9986
|
-
"eventName": "@data.changed.${
|
|
10006
|
+
"eventName": "@data.changed.${_lookupObjectName}"
|
|
9987
10007
|
},
|
|
9988
10008
|
"data": {
|
|
9989
|
-
"objectName": "${
|
|
10009
|
+
"objectName": "${_lookupObjectName}"
|
|
9990
10010
|
},
|
|
9991
|
-
"expression": `\${
|
|
10011
|
+
"expression": `\${_lookupObjectName != '${objectSchema.name}' && _lookupObjectName}`
|
|
9992
10012
|
},
|
|
9993
10013
|
...submitSuccActions,
|
|
9994
10014
|
// {
|
|
@@ -10359,7 +10379,10 @@ async function getRecordDetailRelatedListSchema(objectName, recordId, relatedObj
|
|
|
10359
10379
|
data: {
|
|
10360
10380
|
relatedKey: relatedKey,
|
|
10361
10381
|
listViewId: `amis-\${appId}-${relatedObjectName}-listview`,
|
|
10362
|
-
_isRelated: true
|
|
10382
|
+
_isRelated: true,
|
|
10383
|
+
record: {
|
|
10384
|
+
recordPermissions: relatedObjectUiSchema.permissions
|
|
10385
|
+
}
|
|
10363
10386
|
},
|
|
10364
10387
|
body:[
|
|
10365
10388
|
amisSchema
|
|
@@ -14224,7 +14247,8 @@ async function getFieldSearchable(perField, permissionFields, ctx){
|
|
|
14224
14247
|
_field.removable = false;
|
|
14225
14248
|
_field.value = [null,null];
|
|
14226
14249
|
_field.items = {
|
|
14227
|
-
type: "input-number"
|
|
14250
|
+
type: "input-number",
|
|
14251
|
+
clearValueOnEmpty: true
|
|
14228
14252
|
};
|
|
14229
14253
|
_field.is_wide = true;
|
|
14230
14254
|
fieldNamePrefix = `${fieldNamePrefix}between__`;
|
|
@@ -14272,6 +14296,10 @@ async function getFieldSearchable(perField, permissionFields, ctx){
|
|
|
14272
14296
|
delete _field.amis.hidden;
|
|
14273
14297
|
delete _field.amis.hiddenOn;
|
|
14274
14298
|
delete _field.amis.autoFill;
|
|
14299
|
+
if(_field.type.indexOf("-range") > -1 || _field.type === 'input-array'){
|
|
14300
|
+
// 范围类型不允许变更type,否则会因为某些属性兼容性问题报错页面奔溃,比如input-date-range类型有shortcuts属性,改为input-date后其shortcuts属性有兼容性问题
|
|
14301
|
+
delete _field.amis.type;
|
|
14302
|
+
}
|
|
14275
14303
|
}
|
|
14276
14304
|
|
|
14277
14305
|
const amisField = await convertSFieldToAmisField(_field, false, Object.assign({}, ctx, {fieldNamePrefix: fieldNamePrefix, required: false, showSystemFields: true, inFilterForm: true}));
|
|
@@ -16793,6 +16821,7 @@ const getJudgeOptions = async (instance) => {
|
|
|
16793
16821
|
|
|
16794
16822
|
const getJudgeInput = async (instance) => {
|
|
16795
16823
|
const judgeOptions = await getJudgeOptions(instance);
|
|
16824
|
+
// console.log('getJudgeInput', judgeOptions);
|
|
16796
16825
|
if (judgeOptions.length > 0 && instance.approve.type != 'cc') {
|
|
16797
16826
|
return {
|
|
16798
16827
|
type: "radios",
|
|
@@ -16833,6 +16862,7 @@ const getJudgeInput = async (instance) => {
|
|
|
16833
16862
|
|
|
16834
16863
|
//TODO 只有一个下一步时,默认选中,并且禁止修改.
|
|
16835
16864
|
const getNextStepInput = async (instance) => {
|
|
16865
|
+
// console.log('getNextStepInput', instance);
|
|
16836
16866
|
if(instance.approve?.type == 'cc'){
|
|
16837
16867
|
return ;
|
|
16838
16868
|
}
|
|
@@ -16868,14 +16898,30 @@ const getNextStepInput = async (instance) => {
|
|
|
16868
16898
|
"next_users": null
|
|
16869
16899
|
},
|
|
16870
16900
|
"source": {
|
|
16871
|
-
"url": "
|
|
16901
|
+
"url": "/api/workflow/v2/nextStep?judge=${new_judge}",
|
|
16872
16902
|
"headers": {
|
|
16873
16903
|
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
16874
16904
|
},
|
|
16875
16905
|
"method": "post",
|
|
16876
16906
|
"messages": {
|
|
16877
16907
|
},
|
|
16878
|
-
"requestAdaptor":
|
|
16908
|
+
"requestAdaptor": `
|
|
16909
|
+
let { judge } = api.data;
|
|
16910
|
+
const ctx = api.data.context;
|
|
16911
|
+
if(!judge){
|
|
16912
|
+
judge='approved'
|
|
16913
|
+
};
|
|
16914
|
+
const formValues = context._scoped.getComponentById("instance_form").getValues();
|
|
16915
|
+
api.data = {
|
|
16916
|
+
flowVersionId: ctx.flowVersion._id,
|
|
16917
|
+
instanceId: ctx._id,
|
|
16918
|
+
flowId: ctx.flow._id,
|
|
16919
|
+
step: ctx.step,
|
|
16920
|
+
judge: judge,
|
|
16921
|
+
values: formValues
|
|
16922
|
+
};
|
|
16923
|
+
return api;
|
|
16924
|
+
`,
|
|
16879
16925
|
"adaptor": `
|
|
16880
16926
|
payload.data = {
|
|
16881
16927
|
value: payload.nextSteps.length === 1 ? payload.nextSteps[0]._id : null,
|
|
@@ -16983,7 +17029,7 @@ const getNextStepUsersInput = async (instance) => {
|
|
|
16983
17029
|
"messages": {
|
|
16984
17030
|
},
|
|
16985
17031
|
"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": "
|
|
17032
|
+
"adaptor": "debugger;\npayload.data = {value: payload.nextStepUsers.length === 1 ? payload.nextStepUsers[0].id : null, options: payload.nextStepUsers};\nreturn payload;",
|
|
16987
17033
|
"data": {
|
|
16988
17034
|
"&": "$$",
|
|
16989
17035
|
"$scopeId": "$scopeId",
|
|
@@ -17008,8 +17054,8 @@ const getNextStepUsersInput = async (instance) => {
|
|
|
17008
17054
|
|
|
17009
17055
|
const getCCSubmitRequestAdaptor = async (instance) => {
|
|
17010
17056
|
return `
|
|
17011
|
-
const instanceForm =
|
|
17012
|
-
const approveValues =
|
|
17057
|
+
const instanceForm = context._scoped.getComponentById("instance_form");
|
|
17058
|
+
const approveValues = context._scoped.getComponentById("instance_approval").getValues();
|
|
17013
17059
|
api.data = {
|
|
17014
17060
|
instanceId: "${instance._id}",
|
|
17015
17061
|
traceId: "${instance.trace._id}",
|
|
@@ -17021,9 +17067,9 @@ const getCCSubmitRequestAdaptor = async (instance) => {
|
|
|
17021
17067
|
};
|
|
17022
17068
|
|
|
17023
17069
|
const getPostSubmitRequestAdaptor = async (instance) => {
|
|
17024
|
-
return ` const instanceForm =
|
|
17070
|
+
return ` const instanceForm = context._scoped.getComponentById("instance_form");
|
|
17025
17071
|
const formValues = instanceForm.getValues();
|
|
17026
|
-
const approveValues =
|
|
17072
|
+
const approveValues = context._scoped.getComponentById("instance_approval").getValues();
|
|
17027
17073
|
let nextUsers = approveValues.next_users;
|
|
17028
17074
|
if(_.isString(nextUsers)){
|
|
17029
17075
|
nextUsers = [approveValues.next_users];
|
|
@@ -17039,7 +17085,7 @@ const getPostSubmitRequestAdaptor = async (instance) => {
|
|
|
17039
17085
|
approves: [{
|
|
17040
17086
|
_id: "${instance.approve._id}",
|
|
17041
17087
|
next_steps: [{
|
|
17042
|
-
step: approveValues.next_step
|
|
17088
|
+
step: approveValues.next_step,
|
|
17043
17089
|
users: nextUsers,
|
|
17044
17090
|
}],
|
|
17045
17091
|
description: approveValues.suggestion,
|
|
@@ -17047,6 +17093,7 @@ const getPostSubmitRequestAdaptor = async (instance) => {
|
|
|
17047
17093
|
}]
|
|
17048
17094
|
}]
|
|
17049
17095
|
}]};
|
|
17096
|
+
console.log('submit api', api);
|
|
17050
17097
|
api.data = body;
|
|
17051
17098
|
return api;
|
|
17052
17099
|
`;
|
|
@@ -17054,8 +17101,8 @@ const getPostSubmitRequestAdaptor = async (instance) => {
|
|
|
17054
17101
|
|
|
17055
17102
|
const getPostEngineRequestAdaptor = async (instance) => {
|
|
17056
17103
|
return `
|
|
17057
|
-
const formValues =
|
|
17058
|
-
const approveValues =
|
|
17104
|
+
const formValues = context._scoped.getComponentById("instance_form").getValues();
|
|
17105
|
+
const approveValues = context._scoped.getComponentById("instance_approval").getValues();
|
|
17059
17106
|
let nextUsers = approveValues.next_users;
|
|
17060
17107
|
if(_.isString(nextUsers)){
|
|
17061
17108
|
nextUsers = [approveValues.next_users];
|
|
@@ -17066,7 +17113,7 @@ const getPostEngineRequestAdaptor = async (instance) => {
|
|
|
17066
17113
|
trace: "${instance.approve.trace}",
|
|
17067
17114
|
_id: "${instance.approve._id}",
|
|
17068
17115
|
next_steps: [{
|
|
17069
|
-
step: approveValues.next_step
|
|
17116
|
+
step: approveValues.next_step,
|
|
17070
17117
|
users: nextUsers,
|
|
17071
17118
|
}],
|
|
17072
17119
|
description: approveValues.suggestion,
|
|
@@ -17085,7 +17132,7 @@ const getPostEngineRequestAdaptor = async (instance) => {
|
|
|
17085
17132
|
* @returns
|
|
17086
17133
|
*/
|
|
17087
17134
|
const getSubmitActions = async (instance) => {
|
|
17088
|
-
|
|
17135
|
+
console.log(`getSubmitActions instance====`, instance);
|
|
17089
17136
|
let api = "";
|
|
17090
17137
|
let requestAdaptor = "";
|
|
17091
17138
|
if(instance.approve?.type == "cc"){
|
|
@@ -17102,7 +17149,9 @@ const getSubmitActions = async (instance) => {
|
|
|
17102
17149
|
return null; //TODO 考虑异常情况?
|
|
17103
17150
|
}
|
|
17104
17151
|
}
|
|
17105
|
-
|
|
17152
|
+
console.log(`getSubmitActions api====`, api);
|
|
17153
|
+
console.log(`getSubmitActions requestAdaptor====`, requestAdaptor);
|
|
17154
|
+
console.log('getObjectListViewPath========>', Router$1.getObjectListViewPath({appId: "${appId}", objectName: "${objectName}", listViewName: "${side_listview_id}"}));
|
|
17106
17155
|
return [
|
|
17107
17156
|
// 校验表单
|
|
17108
17157
|
{
|
|
@@ -17110,7 +17159,7 @@ const getSubmitActions = async (instance) => {
|
|
|
17110
17159
|
"args": {},
|
|
17111
17160
|
"actionType": "custom",
|
|
17112
17161
|
"script": `
|
|
17113
|
-
|
|
17162
|
+
console.log("======getSubmitActions");
|
|
17114
17163
|
const form = event.context.scoped.getComponentById("instance_form");
|
|
17115
17164
|
return form.validate().then((instanceFormValidate)=>{
|
|
17116
17165
|
event.setData({...event.data, instanceFormValidate})
|
|
@@ -17134,7 +17183,7 @@ const getSubmitActions = async (instance) => {
|
|
|
17134
17183
|
componentId: "",
|
|
17135
17184
|
args: {
|
|
17136
17185
|
api: {
|
|
17137
|
-
url:
|
|
17186
|
+
url: `${api}`,
|
|
17138
17187
|
method: "post",
|
|
17139
17188
|
dataType: "json",
|
|
17140
17189
|
data: {
|
|
@@ -17170,7 +17219,7 @@ const getSubmitActions = async (instance) => {
|
|
|
17170
17219
|
};
|
|
17171
17220
|
|
|
17172
17221
|
const getApprovalDrawerSchema = async (instance) => {
|
|
17173
|
-
|
|
17222
|
+
console.log("=============getApprovalDrawerSchema=============", instance);
|
|
17174
17223
|
return {
|
|
17175
17224
|
type: "drawer",
|
|
17176
17225
|
overlay: true,
|
|
@@ -17184,7 +17233,7 @@ const getApprovalDrawerSchema = async (instance) => {
|
|
|
17184
17233
|
bodyClassName: 'p-2',
|
|
17185
17234
|
footerClassName: 'p-2 pt-0',
|
|
17186
17235
|
drawerContainer: ()=>{
|
|
17187
|
-
return
|
|
17236
|
+
return document.body;
|
|
17188
17237
|
},
|
|
17189
17238
|
body: [
|
|
17190
17239
|
{
|
|
@@ -17333,15 +17382,11 @@ const getAttachments = async (instance)=>{
|
|
|
17333
17382
|
{
|
|
17334
17383
|
type: 'tpl',
|
|
17335
17384
|
inline: true,
|
|
17336
|
-
tpl: `<a href='
|
|
17385
|
+
tpl: `<a href='/api/v6/files/download/cfs.instances.filerecord/\${_id}/\${original.name}?download=true' target='_blank'>\${original.name}</a>`
|
|
17337
17386
|
}
|
|
17338
17387
|
],
|
|
17339
17388
|
"actions": [
|
|
17340
|
-
|
|
17341
|
-
"icon": "fa fa-eye",
|
|
17342
|
-
"type": "button",
|
|
17343
|
-
"id": "u:ef52fa8940a8"
|
|
17344
|
-
}
|
|
17389
|
+
|
|
17345
17390
|
],
|
|
17346
17391
|
"id": "u:550b3fdc8788"
|
|
17347
17392
|
},
|
|
@@ -17387,7 +17432,7 @@ const getAttachmentUploadInput = async (instance)=>{
|
|
|
17387
17432
|
"extractValue": false,
|
|
17388
17433
|
"valueField": "version_id",
|
|
17389
17434
|
"receiver": {
|
|
17390
|
-
"url": "
|
|
17435
|
+
"url": "/api/instance/${context._id}/file",
|
|
17391
17436
|
headers: {
|
|
17392
17437
|
Authorization: "Bearer ${context.tenantId},${context.authToken}"
|
|
17393
17438
|
},
|
|
@@ -17399,7 +17444,7 @@ const getAttachmentUploadInput = async (instance)=>{
|
|
|
17399
17444
|
api.data.append('instance', '${instance._id}');
|
|
17400
17445
|
api.data.append('approve', '${instance.approve?._id}');
|
|
17401
17446
|
api.data.append('owner', '${auth.userId}');
|
|
17402
|
-
api.data.append('owner_name', '${auth.name}');
|
|
17447
|
+
api.data.append('owner_name', '${auth.user.name}');
|
|
17403
17448
|
return api;
|
|
17404
17449
|
`
|
|
17405
17450
|
},
|
|
@@ -17478,11 +17523,6 @@ const getRelatedInstances = async (instance)=>{
|
|
|
17478
17523
|
}
|
|
17479
17524
|
],
|
|
17480
17525
|
"actions": [
|
|
17481
|
-
{
|
|
17482
|
-
"icon": "fa fa-eye",
|
|
17483
|
-
"type": "button",
|
|
17484
|
-
"id": "u:ef52fa8940a8"
|
|
17485
|
-
}
|
|
17486
17526
|
],
|
|
17487
17527
|
"id": "u:550b3fdc8788"
|
|
17488
17528
|
},
|
|
@@ -17899,6 +17939,10 @@ const getFieldEditTpl = async (field, label)=>{
|
|
|
17899
17939
|
case "section":
|
|
17900
17940
|
tpl.type = "input-text";
|
|
17901
17941
|
break;
|
|
17942
|
+
default:
|
|
17943
|
+
tpl.type = 'steedos-field';
|
|
17944
|
+
tpl.config = field.steedos_field;
|
|
17945
|
+
break;
|
|
17902
17946
|
}
|
|
17903
17947
|
}
|
|
17904
17948
|
// console.log('getFieldEditTpl ', label, tpl)
|
|
@@ -18023,15 +18067,15 @@ const getTdField = async (field, fieldsCount) => {
|
|
|
18023
18067
|
|
|
18024
18068
|
const getTdTitle = (field) => {
|
|
18025
18069
|
return {
|
|
18026
|
-
className:
|
|
18070
|
+
className: `td-title td-title-${field.type}`,
|
|
18027
18071
|
align: field.type != "section" ? "center" : "left",
|
|
18028
18072
|
width: field.type != "section" ? "16%" : "",
|
|
18029
18073
|
colspan: field.type == "section" ? 4 : "",
|
|
18030
|
-
background: "#FFFFFF",
|
|
18074
|
+
background: field.type == "section" ? "#f1f1f1" : "#FFFFFF",
|
|
18031
18075
|
body: [
|
|
18032
18076
|
{
|
|
18033
18077
|
type: "tpl",
|
|
18034
|
-
tpl: `<div>${field.name || field.code} ${field.is_required ? '<span class="antd-Form-star">*</span>' : ''}</div>`,
|
|
18078
|
+
tpl: `<div class='${field.type == "section" ? "font-bold" : ""}'>${field.name || field.code} ${field.is_required ? '<span class="antd-Form-star">*</span>' : ''}</div>`,
|
|
18035
18079
|
},
|
|
18036
18080
|
],
|
|
18037
18081
|
// "id": "u:9b001b7ff92d",
|
|
@@ -18104,6 +18148,7 @@ const getFormTableView = async (instance) => {
|
|
|
18104
18148
|
trs: await getFormTrs(instance),
|
|
18105
18149
|
id: "u:047f3669468b",
|
|
18106
18150
|
};
|
|
18151
|
+
console.log('getFormTableView===>', instance, formSchema);
|
|
18107
18152
|
return formSchema;
|
|
18108
18153
|
};
|
|
18109
18154
|
|
|
@@ -18133,6 +18178,14 @@ const getApplicantTableView = async (instance) => {
|
|
|
18133
18178
|
};
|
|
18134
18179
|
}
|
|
18135
18180
|
|
|
18181
|
+
if(applicantInput){
|
|
18182
|
+
if(applicantInput.className){
|
|
18183
|
+
applicantInput.className = `${applicantInput.className} inline-left`;
|
|
18184
|
+
}else {
|
|
18185
|
+
applicantInput.className = `inline-left`;
|
|
18186
|
+
}
|
|
18187
|
+
}
|
|
18188
|
+
|
|
18136
18189
|
return {
|
|
18137
18190
|
type: "table-view",
|
|
18138
18191
|
className: "instance-applicant-view",
|
|
@@ -18144,70 +18197,50 @@ const getApplicantTableView = async (instance) => {
|
|
|
18144
18197
|
className: "td-title",
|
|
18145
18198
|
background: "#FFFFFF",
|
|
18146
18199
|
align: "left",
|
|
18147
|
-
width: "
|
|
18200
|
+
width: "50%",
|
|
18148
18201
|
colspan: "",
|
|
18149
18202
|
body: [
|
|
18150
18203
|
{
|
|
18151
18204
|
type: "tpl",
|
|
18152
|
-
tpl: "<div
|
|
18205
|
+
tpl: "<div class='inline-left'>提交人:</div>",
|
|
18153
18206
|
id: "u:ee62634201bf",
|
|
18154
18207
|
},
|
|
18208
|
+
applicantInput
|
|
18155
18209
|
],
|
|
18156
18210
|
id: "u:6c24c1bb99c9",
|
|
18157
18211
|
style: {
|
|
18158
18212
|
padding: "none",
|
|
18159
18213
|
},
|
|
18160
18214
|
},
|
|
18161
|
-
{
|
|
18162
|
-
background: "#FFFFFF",
|
|
18163
|
-
colspan: 1,
|
|
18164
|
-
align: "left",
|
|
18165
|
-
className: "td-field",
|
|
18166
|
-
width: "32%",
|
|
18167
|
-
body: [
|
|
18168
|
-
applicantInput
|
|
18169
|
-
],
|
|
18170
|
-
id: "u:45d65d91905c",
|
|
18171
|
-
},
|
|
18172
18215
|
{
|
|
18173
18216
|
className: "td-title",
|
|
18174
18217
|
background: "#FFFFFF",
|
|
18175
18218
|
align: "left",
|
|
18176
|
-
width: "
|
|
18219
|
+
width: "50%",
|
|
18177
18220
|
colspan: "",
|
|
18178
18221
|
body: [
|
|
18179
18222
|
{
|
|
18180
18223
|
type: "tpl",
|
|
18181
|
-
tpl: "<div
|
|
18224
|
+
tpl: "<div class='inline-left'>提交日期:</div>",
|
|
18182
18225
|
id: "u:6d0a7763d527",
|
|
18183
18226
|
},
|
|
18184
|
-
],
|
|
18185
|
-
id: "u:c8b8214ac931",
|
|
18186
|
-
style: {
|
|
18187
|
-
padding: "none",
|
|
18188
|
-
},
|
|
18189
|
-
},
|
|
18190
|
-
{
|
|
18191
|
-
background: "#FFFFFF",
|
|
18192
|
-
colspan: 1,
|
|
18193
|
-
align: "left",
|
|
18194
|
-
className: "td-field",
|
|
18195
|
-
width: "32%",
|
|
18196
|
-
body: [
|
|
18197
18227
|
{
|
|
18198
18228
|
label: false,
|
|
18199
18229
|
mode: "horizontal",
|
|
18200
|
-
className: "m-none p-none",
|
|
18230
|
+
className: "m-none p-none inline-left",
|
|
18201
18231
|
disabled: true,
|
|
18202
18232
|
type: "tpl",
|
|
18203
18233
|
inputFormat: "YYYY-MM-DD",
|
|
18204
18234
|
valueFormat: "YYYY-MM-DDT00:00:00.000[Z]",
|
|
18205
18235
|
tpl: '<div>${submit_date}</div>',
|
|
18206
18236
|
id: "u:2016b04355f4",
|
|
18207
|
-
}
|
|
18237
|
+
}
|
|
18208
18238
|
],
|
|
18209
|
-
id: "u:
|
|
18210
|
-
|
|
18239
|
+
id: "u:c8b8214ac931",
|
|
18240
|
+
style: {
|
|
18241
|
+
padding: "none",
|
|
18242
|
+
},
|
|
18243
|
+
}
|
|
18211
18244
|
],
|
|
18212
18245
|
},
|
|
18213
18246
|
],
|
|
@@ -18253,6 +18286,7 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
18253
18286
|
name: "instancePage",
|
|
18254
18287
|
className: "steedos-amis-instance-view",
|
|
18255
18288
|
bodyClassName: "overflow-y-auto h-full",
|
|
18289
|
+
headerClassName: "p-0",
|
|
18256
18290
|
"title": {
|
|
18257
18291
|
"type": "steedos-record-detail-header",
|
|
18258
18292
|
"label": "标题面板",
|
|
@@ -18260,7 +18294,7 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
18260
18294
|
"recordId": instance._id,
|
|
18261
18295
|
"id": "u:e6b2adbe0e21",
|
|
18262
18296
|
"showRecordTitle": false,
|
|
18263
|
-
"className": "p-0 m-0 p0 m0"
|
|
18297
|
+
"className": "p-0 m-0 p0 m0 bg-gray-50"
|
|
18264
18298
|
},
|
|
18265
18299
|
"css": {
|
|
18266
18300
|
".instance-approve-history .antd-Table-table thead": {
|
|
@@ -18274,6 +18308,25 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
18274
18308
|
".antd-List-heading": {
|
|
18275
18309
|
"font-size": "14px",
|
|
18276
18310
|
"font-weight": "500"
|
|
18311
|
+
},
|
|
18312
|
+
".steedos-object-record-detail-header .antd-Grid-col--mdAuto": {
|
|
18313
|
+
"padding": "0px !important"
|
|
18314
|
+
},
|
|
18315
|
+
".steedos-amis-instance-view .antd-Page-body": {
|
|
18316
|
+
"width": "1024px"
|
|
18317
|
+
},
|
|
18318
|
+
".antd-List-placeholder": {
|
|
18319
|
+
"display": "none"
|
|
18320
|
+
},
|
|
18321
|
+
".steedos-amis-instance-view .antd-Table-fixedTop:after":{
|
|
18322
|
+
"box-shadow": "none"
|
|
18323
|
+
},
|
|
18324
|
+
".antd-List-items": {
|
|
18325
|
+
"border": '0px'
|
|
18326
|
+
},
|
|
18327
|
+
".antd-ListItem": {
|
|
18328
|
+
"border-top": "0px !important",
|
|
18329
|
+
"background": "transparent !important"
|
|
18277
18330
|
}
|
|
18278
18331
|
},
|
|
18279
18332
|
body: [
|
|
@@ -18618,7 +18671,10 @@ const isCurrentStepOpinionField = (field, currentStep)=>{
|
|
|
18618
18671
|
return ___default.includes(___default.map(getOpinionFieldStepsName(field), 'stepName'), currentStep?.name);
|
|
18619
18672
|
};
|
|
18620
18673
|
|
|
18621
|
-
|
|
18674
|
+
|
|
18675
|
+
const getInstanceInfo = async (props) => {
|
|
18676
|
+
console.log(`getInstanceInfo props`, props);
|
|
18677
|
+
const { instanceId, box } = props;
|
|
18622
18678
|
const userId = getSteedosAuth$1().userId;
|
|
18623
18679
|
const query = `{
|
|
18624
18680
|
instance: instances__findOne(id:"${instanceId}"){
|
|
@@ -18701,7 +18757,7 @@ const getInstanceInfo = async ({ instanceId, box }) => {
|
|
|
18701
18757
|
});
|
|
18702
18758
|
|
|
18703
18759
|
const moment = getMoment();
|
|
18704
|
-
|
|
18760
|
+
console.log('getInstanceInfo====>', step, formVersion.fields);
|
|
18705
18761
|
return {
|
|
18706
18762
|
box: box,
|
|
18707
18763
|
_id: instanceId,
|
|
@@ -18719,9 +18775,17 @@ const getInstanceInfo = async ({ instanceId, box }) => {
|
|
|
18719
18775
|
title: instance.name || instance.form.name,
|
|
18720
18776
|
name: instance.name || instance.form.name,
|
|
18721
18777
|
fields: ___default.map(formVersion.fields, (field) => {
|
|
18722
|
-
|
|
18778
|
+
const newField = Object.assign({}, field, {
|
|
18723
18779
|
permission: userApprove?.type != 'cc' && (step?.permissions[field.code] || ( isCurrentStepOpinionField(field, step) ? 'editable' : '')),
|
|
18724
18780
|
}) ;
|
|
18781
|
+
if(field.type === 'section'){
|
|
18782
|
+
newField.fields = ___default.map(field.fields, (sfield) => {
|
|
18783
|
+
return Object.assign({}, sfield, {
|
|
18784
|
+
permission: userApprove?.type != 'cc' && (step?.permissions[sfield.code] || ( isCurrentStepOpinionField(sfield, step) ? 'editable' : '')),
|
|
18785
|
+
});
|
|
18786
|
+
});
|
|
18787
|
+
}
|
|
18788
|
+
return newField;
|
|
18725
18789
|
}),
|
|
18726
18790
|
flowVersion: flowVersion,
|
|
18727
18791
|
formVersion: formVersion,
|