@steedos-widgets/amis-lib 6.10.1-beta.34 → 6.10.1-beta.36
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 +115 -90
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +115 -90
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +54 -51
- package/dist/index.umd.js.map +1 -1
- package/dist/types/lib/converter/amis/fields/lookup.d.ts +2 -5
- package/dist/types/lib/converter/amis/fields_filter.d.ts +2 -4
- package/dist/types/lib/converter/amis/header.d.ts +33 -2
- package/dist/types/lib/converter/amis/toolbar.d.ts +1 -2
- 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/flow.d.ts +9 -16
- 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,
|
|
@@ -3133,7 +3133,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
3133
3133
|
let valueField = mainObject.key_field || '_id';
|
|
3134
3134
|
const api = await getApi$1(mainObject, null, fields, {count: options.queryCount, alias: 'rows', limit: top, queryOptions: `filters: {__filters}, top: {__top}, skip: {__skip}, sort: "{__sort}"`});
|
|
3135
3135
|
|
|
3136
|
-
api.url;//设计器上对象表格组件需要切换对象重新请求列表数据
|
|
3136
|
+
// api.url;//设计器上对象表格组件需要切换对象重新请求列表数据
|
|
3137
3137
|
// if(options.isRelated){
|
|
3138
3138
|
// api.url += "&recordId=${_master.recordId}";
|
|
3139
3139
|
// }
|
|
@@ -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-22 14:29:15
|
|
4885
4894
|
* @Description:
|
|
4886
4895
|
*/
|
|
4887
4896
|
|
|
@@ -4955,7 +4964,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
4955
4964
|
}
|
|
4956
4965
|
const uiSchema = event.data.uiSchema;
|
|
4957
4966
|
const objectName = event.data.objectName;
|
|
4958
|
-
const
|
|
4967
|
+
const crudId = event.data.crudId || "listview_" + objectName;
|
|
4968
|
+
const listViewRef = event.context.scoped.getComponentById(crudId);
|
|
4959
4969
|
const selectedItems = listViewRef && listViewRef.props.store.toJSON().selectedItems || [];
|
|
4960
4970
|
event.data.selectedIds = _.map(selectedItems, uiSchema.idFieldName || '_id');
|
|
4961
4971
|
`;
|
|
@@ -5005,6 +5015,7 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5005
5015
|
"isLookup": "${isLookup}",
|
|
5006
5016
|
"listName": "${listName}",
|
|
5007
5017
|
"selectedRowResponseResult": "${selectedRowResponseResult}",
|
|
5018
|
+
"_lookupObjectName": "${_lookupObjectName}"
|
|
5008
5019
|
},
|
|
5009
5020
|
"title":i18next.t('frontend_form_new') + " ${uiSchema.label | raw}",
|
|
5010
5021
|
"body": [
|
|
@@ -5077,8 +5088,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5077
5088
|
/*
|
|
5078
5089
|
* @Author: baozhoutao@steedos.com
|
|
5079
5090
|
* @Date: 2022-11-01 15:49:58
|
|
5080
|
-
* @LastEditors:
|
|
5081
|
-
* @LastEditTime:
|
|
5091
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5092
|
+
* @LastEditTime: 2025-07-14 11:55:43
|
|
5082
5093
|
* @Description:
|
|
5083
5094
|
*/
|
|
5084
5095
|
|
|
@@ -5108,6 +5119,7 @@ const getSchema$4 = async (uiSchema, ctx) => {
|
|
|
5108
5119
|
: page.schema;
|
|
5109
5120
|
}
|
|
5110
5121
|
|
|
5122
|
+
// console.log('formSchema====>', formSchema);
|
|
5111
5123
|
|
|
5112
5124
|
return {
|
|
5113
5125
|
type: "service",
|
|
@@ -5132,9 +5144,10 @@ const getSchema$4 = async (uiSchema, ctx) => {
|
|
|
5132
5144
|
showCloseButton: true,
|
|
5133
5145
|
"data": {
|
|
5134
5146
|
"&": "$$",
|
|
5135
|
-
"_master": "${
|
|
5147
|
+
"_master": "${mainRecord}",
|
|
5136
5148
|
"_master._isRelated": "${_isRelated}",
|
|
5137
|
-
"_master.relatedKey": "${relatedKey}"
|
|
5149
|
+
"_master.relatedKey": "${relatedKey}",
|
|
5150
|
+
"_lookupObjectName": "${_lookupObjectName}"
|
|
5138
5151
|
},
|
|
5139
5152
|
size: "lg",
|
|
5140
5153
|
"actions": [
|
|
@@ -5233,12 +5246,12 @@ const getSchema$3 = (uiSchema)=>{
|
|
|
5233
5246
|
{
|
|
5234
5247
|
"actionType": "broadcast",
|
|
5235
5248
|
"args": {
|
|
5236
|
-
"eventName": "@data.changed.${
|
|
5249
|
+
"eventName": "@data.changed.${_lookupObjectName}"
|
|
5237
5250
|
},
|
|
5238
5251
|
"data": {
|
|
5239
|
-
"objectName": "${
|
|
5252
|
+
"objectName": "${_lookupObjectName}"
|
|
5240
5253
|
},
|
|
5241
|
-
"expression": `\${
|
|
5254
|
+
"expression": `\${_lookupObjectName != '${uiSchema.name}' && _lookupObjectName}`
|
|
5242
5255
|
}
|
|
5243
5256
|
]
|
|
5244
5257
|
}
|
|
@@ -5497,8 +5510,8 @@ const getSchema = async (uiSchema, ctx) => {
|
|
|
5497
5510
|
/*
|
|
5498
5511
|
* @Author: baozhoutao@steedos.com
|
|
5499
5512
|
* @Date: 2022-11-01 15:53:07
|
|
5500
|
-
* @LastEditors:
|
|
5501
|
-
* @LastEditTime:
|
|
5513
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5514
|
+
* @LastEditTime: 2025-07-22 14:12:01
|
|
5502
5515
|
* @Description:
|
|
5503
5516
|
*/
|
|
5504
5517
|
|
|
@@ -5528,10 +5541,12 @@ const StandardButtons = {
|
|
|
5528
5541
|
const {
|
|
5529
5542
|
appId,
|
|
5530
5543
|
objectName,
|
|
5531
|
-
uiSchema
|
|
5544
|
+
uiSchema,
|
|
5545
|
+
record
|
|
5532
5546
|
} = this;
|
|
5547
|
+
const crudId = record?.crudId || `listview_${uiSchema.name}`;
|
|
5533
5548
|
const scope = this.scope;
|
|
5534
|
-
const listViewRef = scope.parent?.getComponentById(
|
|
5549
|
+
const listViewRef = scope.parent?.getComponentById(crudId);
|
|
5535
5550
|
if(_.isEmpty(listViewRef.props.store.toJSON().selectedItems)){
|
|
5536
5551
|
listViewRef.handleAction({}, {
|
|
5537
5552
|
"actionType": "toast",
|
|
@@ -6159,19 +6174,11 @@ async function getObjectFieldsFilterFormSchema(ctx) {
|
|
|
6159
6174
|
},
|
|
6160
6175
|
"schemaApi": {
|
|
6161
6176
|
method: 'post',
|
|
6162
|
-
url: `\${context.rootUrl}/graphql?reload=\${filterFormSearchableFields|join}`,
|
|
6163
6177
|
data: {
|
|
6164
6178
|
$self: "$$",
|
|
6165
|
-
query: "
|
|
6179
|
+
query: ""
|
|
6166
6180
|
},
|
|
6167
|
-
|
|
6168
|
-
return {
|
|
6169
|
-
...api,
|
|
6170
|
-
data: {
|
|
6171
|
-
query: api.data.query
|
|
6172
|
-
}
|
|
6173
|
-
};
|
|
6174
|
-
`,
|
|
6181
|
+
url: `/api/amis/health_check?reload=\${filterFormSearchableFields|join}`,
|
|
6175
6182
|
adaptor: `
|
|
6176
6183
|
if(payload.errors){
|
|
6177
6184
|
payload.status = 2;
|
|
@@ -6471,7 +6478,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6471
6478
|
});
|
|
6472
6479
|
// 有过滤条件时只显示搜索按钮上的红点,不自动展开搜索栏
|
|
6473
6480
|
if(!_.isEmpty(omitedEmptyFormValue)){
|
|
6474
|
-
let
|
|
6481
|
+
let scopeRef = SteedosUI.getRef(data.$scopeId);
|
|
6482
|
+
let crudService = scopeRef && scopeRef.parent.getComponentById("service_listview_" + data.objectName)
|
|
6475
6483
|
crudService && crudService.setData({isFieldsFilterEmpty: false});
|
|
6476
6484
|
// setData({ showFieldsFilter: true });//自动展开搜索栏
|
|
6477
6485
|
}
|
|
@@ -7570,6 +7578,7 @@ function getObjectListHeaderFirstLine(objectSchema, listViewName, ctx) {
|
|
|
7570
7578
|
"size": "sm",
|
|
7571
7579
|
"hideCaret": true,
|
|
7572
7580
|
"closeOnClick": true,
|
|
7581
|
+
"visibleOn": "\${listName && uiSchema.list_views[listName].disableSwitch != true}",
|
|
7573
7582
|
"btnClassName": "!bg-transparent !border-none !hover:border-none text-lg h-5 font-bold p-0 text-black leading-none",
|
|
7574
7583
|
"buttons": [
|
|
7575
7584
|
...listViewButtonOptions,
|
|
@@ -7582,6 +7591,12 @@ function getObjectListHeaderFirstLine(objectSchema, listViewName, ctx) {
|
|
|
7582
7591
|
},
|
|
7583
7592
|
listviewNewButton
|
|
7584
7593
|
]
|
|
7594
|
+
},
|
|
7595
|
+
{
|
|
7596
|
+
"type": "tpl",
|
|
7597
|
+
"className": "steedos-listview-change-button text-lg font-bold",
|
|
7598
|
+
"tpl": "\${listName ? uiSchema.list_views[listName].label : uiSchema.list_views[defaultListName].label}",
|
|
7599
|
+
"visibleOn": "\${listName && uiSchema.list_views[listName].disableSwitch}",
|
|
7585
7600
|
}
|
|
7586
7601
|
],
|
|
7587
7602
|
"md": "",
|
|
@@ -9979,16 +9994,16 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
9979
9994
|
},
|
|
9980
9995
|
"expression": `\${_master.objectName != '${objectSchema.name}' && _master.objectName}`
|
|
9981
9996
|
},
|
|
9982
|
-
//
|
|
9997
|
+
// 列表视图、对象表格、对象表单组件上的lookup字段,点开右侧弹出drawer窗口,修改记录后刷新列表
|
|
9983
9998
|
{
|
|
9984
9999
|
"actionType": "broadcast",
|
|
9985
10000
|
"args": {
|
|
9986
|
-
"eventName": "@data.changed.${
|
|
10001
|
+
"eventName": "@data.changed.${_lookupObjectName}"
|
|
9987
10002
|
},
|
|
9988
10003
|
"data": {
|
|
9989
|
-
"objectName": "${
|
|
10004
|
+
"objectName": "${_lookupObjectName}"
|
|
9990
10005
|
},
|
|
9991
|
-
"expression": `\${
|
|
10006
|
+
"expression": `\${_lookupObjectName != '${objectSchema.name}' && _lookupObjectName}`
|
|
9992
10007
|
},
|
|
9993
10008
|
...submitSuccActions,
|
|
9994
10009
|
// {
|
|
@@ -12722,11 +12737,8 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
12722
12737
|
}else {
|
|
12723
12738
|
apiInfo = {
|
|
12724
12739
|
method: "post",
|
|
12725
|
-
|
|
12726
|
-
|
|
12727
|
-
"headers": {
|
|
12728
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
12729
|
-
}
|
|
12740
|
+
data: {$: "$$", query: ""},
|
|
12741
|
+
url: "/api/amis/health_check?reload=\${additionalFilters|join}&listName=\${listName}"
|
|
12730
12742
|
};
|
|
12731
12743
|
}
|
|
12732
12744
|
|
|
@@ -14172,9 +14184,9 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
14172
14184
|
// if(ctx.mode === 'edit'){
|
|
14173
14185
|
let convertDataResult;
|
|
14174
14186
|
if(convertData.type == "steedos-field"){
|
|
14175
|
-
// 如果是steedos-field,不能把amis属性合并到steedos-field根属性中,要合并也是合并到steedos-field的config.amis中
|
|
14176
|
-
// 而steedos-field字段的amis
|
|
14177
|
-
// 目前测试到受影响的是,把字段的amis属性配置为{"type": "checkboxes"}时,ObjectForm只读模式下,lookup字段返回的是type为steedos-field
|
|
14187
|
+
// 如果是steedos-field,不能把field.amis属性合并到steedos-field根属性中,要合并也是合并到steedos-field的config.amis中
|
|
14188
|
+
// 而steedos-field字段的config属性中的amis属性已经有了这里的field.amis,所以这里不需要再合并field.amis
|
|
14189
|
+
// 目前测试到受影响的是,把字段的amis属性配置为{"type": "checkboxes"}时,ObjectForm只读模式下,lookup字段返回的是type为steedos-field的组件,此时如果在这里合并field.amis,那么其type就变成了checkboxes,导致lookup字段显示为复选框
|
|
14178
14190
|
convertDataResult = Object.assign({}, baseData, convertData, { labelClassName: 'text-left', clearValueOnHidden: true, fieldName: field.name}, {name: baseData.name});
|
|
14179
14191
|
}
|
|
14180
14192
|
else {
|
|
@@ -14227,7 +14239,8 @@ async function getFieldSearchable(perField, permissionFields, ctx){
|
|
|
14227
14239
|
_field.removable = false;
|
|
14228
14240
|
_field.value = [null,null];
|
|
14229
14241
|
_field.items = {
|
|
14230
|
-
type: "input-number"
|
|
14242
|
+
type: "input-number",
|
|
14243
|
+
clearValueOnEmpty: true
|
|
14231
14244
|
};
|
|
14232
14245
|
_field.is_wide = true;
|
|
14233
14246
|
fieldNamePrefix = `${fieldNamePrefix}between__`;
|
|
@@ -14275,6 +14288,10 @@ async function getFieldSearchable(perField, permissionFields, ctx){
|
|
|
14275
14288
|
delete _field.amis.hidden;
|
|
14276
14289
|
delete _field.amis.hiddenOn;
|
|
14277
14290
|
delete _field.amis.autoFill;
|
|
14291
|
+
if(_field.type.indexOf("-range") > -1 || _field.type === 'input-array'){
|
|
14292
|
+
// 范围类型不允许变更type,否则会因为某些属性兼容性问题报错页面奔溃,比如input-date-range类型有shortcuts属性,改为input-date后其shortcuts属性有兼容性问题
|
|
14293
|
+
delete _field.amis.type;
|
|
14294
|
+
}
|
|
14278
14295
|
}
|
|
14279
14296
|
|
|
14280
14297
|
const amisField = await convertSFieldToAmisField(_field, false, Object.assign({}, ctx, {fieldNamePrefix: fieldNamePrefix, required: false, showSystemFields: true, inFilterForm: true}));
|
|
@@ -17004,7 +17021,7 @@ const getNextStepUsersInput = async (instance) => {
|
|
|
17004
17021
|
"messages": {
|
|
17005
17022
|
},
|
|
17006
17023
|
"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;",
|
|
17007
|
-
"adaptor": "
|
|
17024
|
+
"adaptor": "\npayload.data = {value: payload.nextStepUsers.length === 1 ? payload.nextStepUsers[0].id : null, options: payload.nextStepUsers};\nreturn payload;",
|
|
17008
17025
|
"data": {
|
|
17009
17026
|
"&": "$$",
|
|
17010
17027
|
"$scopeId": "$scopeId",
|
|
@@ -17197,10 +17214,10 @@ const getApprovalDrawerSchema = async (instance) => {
|
|
|
17197
17214
|
console.log("=============getApprovalDrawerSchema=============", instance);
|
|
17198
17215
|
return {
|
|
17199
17216
|
type: "drawer",
|
|
17200
|
-
overlay:
|
|
17217
|
+
overlay: false,
|
|
17201
17218
|
resizable: false,
|
|
17202
17219
|
closeOnEsc: true,
|
|
17203
|
-
closeOnOutside:
|
|
17220
|
+
closeOnOutside: false,
|
|
17204
17221
|
size: "sm",
|
|
17205
17222
|
title: `${instance.step.name}`,
|
|
17206
17223
|
className: "approval-drawer absolute",
|
|
@@ -17914,6 +17931,10 @@ const getFieldEditTpl = async (field, label)=>{
|
|
|
17914
17931
|
case "section":
|
|
17915
17932
|
tpl.type = "input-text";
|
|
17916
17933
|
break;
|
|
17934
|
+
default:
|
|
17935
|
+
tpl.type = 'steedos-field';
|
|
17936
|
+
tpl.config = field.steedos_field;
|
|
17937
|
+
break;
|
|
17917
17938
|
}
|
|
17918
17939
|
}
|
|
17919
17940
|
// console.log('getFieldEditTpl ', label, tpl)
|
|
@@ -18038,15 +18059,15 @@ const getTdField = async (field, fieldsCount) => {
|
|
|
18038
18059
|
|
|
18039
18060
|
const getTdTitle = (field) => {
|
|
18040
18061
|
return {
|
|
18041
|
-
className:
|
|
18062
|
+
className: `td-title td-title-${field.type}`,
|
|
18042
18063
|
align: field.type != "section" ? "center" : "left",
|
|
18043
18064
|
width: field.type != "section" ? "16%" : "",
|
|
18044
18065
|
colspan: field.type == "section" ? 4 : "",
|
|
18045
|
-
background: "#FFFFFF",
|
|
18066
|
+
background: field.type == "section" ? "#f1f1f1" : "#FFFFFF",
|
|
18046
18067
|
body: [
|
|
18047
18068
|
{
|
|
18048
18069
|
type: "tpl",
|
|
18049
|
-
tpl: `<div>${field.name || field.code} ${field.is_required ? '<span class="antd-Form-star">*</span>' : ''}</div>`,
|
|
18070
|
+
tpl: `<div class='${field.type == "section" ? "font-bold" : ""}'>${field.name || field.code} ${field.is_required ? '<span class="antd-Form-star">*</span>' : ''}</div>`,
|
|
18050
18071
|
},
|
|
18051
18072
|
],
|
|
18052
18073
|
// "id": "u:9b001b7ff92d",
|
|
@@ -18119,6 +18140,7 @@ const getFormTableView = async (instance) => {
|
|
|
18119
18140
|
trs: await getFormTrs(instance),
|
|
18120
18141
|
id: "u:047f3669468b",
|
|
18121
18142
|
};
|
|
18143
|
+
console.log('getFormTableView===>', instance, formSchema);
|
|
18122
18144
|
return formSchema;
|
|
18123
18145
|
};
|
|
18124
18146
|
|
|
@@ -18148,6 +18170,14 @@ const getApplicantTableView = async (instance) => {
|
|
|
18148
18170
|
};
|
|
18149
18171
|
}
|
|
18150
18172
|
|
|
18173
|
+
if(applicantInput){
|
|
18174
|
+
if(applicantInput.className){
|
|
18175
|
+
applicantInput.className = `${applicantInput.className} inline-left`;
|
|
18176
|
+
}else {
|
|
18177
|
+
applicantInput.className = `inline-left`;
|
|
18178
|
+
}
|
|
18179
|
+
}
|
|
18180
|
+
|
|
18151
18181
|
return {
|
|
18152
18182
|
type: "table-view",
|
|
18153
18183
|
className: "instance-applicant-view",
|
|
@@ -18159,70 +18189,50 @@ const getApplicantTableView = async (instance) => {
|
|
|
18159
18189
|
className: "td-title",
|
|
18160
18190
|
background: "#FFFFFF",
|
|
18161
18191
|
align: "left",
|
|
18162
|
-
width: "
|
|
18192
|
+
width: "50%",
|
|
18163
18193
|
colspan: "",
|
|
18164
18194
|
body: [
|
|
18165
18195
|
{
|
|
18166
18196
|
type: "tpl",
|
|
18167
|
-
tpl: "<div
|
|
18197
|
+
tpl: "<div class='inline-left'>提交人:</div>",
|
|
18168
18198
|
id: "u:ee62634201bf",
|
|
18169
18199
|
},
|
|
18200
|
+
applicantInput
|
|
18170
18201
|
],
|
|
18171
18202
|
id: "u:6c24c1bb99c9",
|
|
18172
18203
|
style: {
|
|
18173
18204
|
padding: "none",
|
|
18174
18205
|
},
|
|
18175
18206
|
},
|
|
18176
|
-
{
|
|
18177
|
-
background: "#FFFFFF",
|
|
18178
|
-
colspan: 1,
|
|
18179
|
-
align: "left",
|
|
18180
|
-
className: "td-field",
|
|
18181
|
-
width: "32%",
|
|
18182
|
-
body: [
|
|
18183
|
-
applicantInput
|
|
18184
|
-
],
|
|
18185
|
-
id: "u:45d65d91905c",
|
|
18186
|
-
},
|
|
18187
18207
|
{
|
|
18188
18208
|
className: "td-title",
|
|
18189
18209
|
background: "#FFFFFF",
|
|
18190
18210
|
align: "left",
|
|
18191
|
-
width: "
|
|
18211
|
+
width: "50%",
|
|
18192
18212
|
colspan: "",
|
|
18193
18213
|
body: [
|
|
18194
18214
|
{
|
|
18195
18215
|
type: "tpl",
|
|
18196
|
-
tpl: "<div
|
|
18216
|
+
tpl: "<div class='inline-left'>提交日期:</div>",
|
|
18197
18217
|
id: "u:6d0a7763d527",
|
|
18198
18218
|
},
|
|
18199
|
-
],
|
|
18200
|
-
id: "u:c8b8214ac931",
|
|
18201
|
-
style: {
|
|
18202
|
-
padding: "none",
|
|
18203
|
-
},
|
|
18204
|
-
},
|
|
18205
|
-
{
|
|
18206
|
-
background: "#FFFFFF",
|
|
18207
|
-
colspan: 1,
|
|
18208
|
-
align: "left",
|
|
18209
|
-
className: "td-field",
|
|
18210
|
-
width: "32%",
|
|
18211
|
-
body: [
|
|
18212
18219
|
{
|
|
18213
18220
|
label: false,
|
|
18214
18221
|
mode: "horizontal",
|
|
18215
|
-
className: "m-none p-none",
|
|
18222
|
+
className: "m-none p-none inline-left",
|
|
18216
18223
|
disabled: true,
|
|
18217
18224
|
type: "tpl",
|
|
18218
18225
|
inputFormat: "YYYY-MM-DD",
|
|
18219
18226
|
valueFormat: "YYYY-MM-DDT00:00:00.000[Z]",
|
|
18220
18227
|
tpl: '<div>${submit_date}</div>',
|
|
18221
18228
|
id: "u:2016b04355f4",
|
|
18222
|
-
}
|
|
18229
|
+
}
|
|
18223
18230
|
],
|
|
18224
|
-
id: "u:
|
|
18225
|
-
|
|
18231
|
+
id: "u:c8b8214ac931",
|
|
18232
|
+
style: {
|
|
18233
|
+
padding: "none",
|
|
18234
|
+
},
|
|
18235
|
+
}
|
|
18226
18236
|
],
|
|
18227
18237
|
},
|
|
18228
18238
|
],
|
|
@@ -18267,7 +18277,7 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
18267
18277
|
type: "page",
|
|
18268
18278
|
name: "instancePage",
|
|
18269
18279
|
className: "steedos-amis-instance-view",
|
|
18270
|
-
bodyClassName: "overflow-y-auto h-full",
|
|
18280
|
+
bodyClassName: "overflow-y-auto h-full steedos-amis-instance-view-body",
|
|
18271
18281
|
headerClassName: "p-0",
|
|
18272
18282
|
"title": {
|
|
18273
18283
|
"type": "steedos-record-detail-header",
|
|
@@ -18276,9 +18286,12 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
18276
18286
|
"recordId": instance._id,
|
|
18277
18287
|
"id": "u:e6b2adbe0e21",
|
|
18278
18288
|
"showRecordTitle": false,
|
|
18279
|
-
"className": "p-0 m-0 p0 m0"
|
|
18289
|
+
"className": "p-0 m-0 p0 m0 bg-gray-50"
|
|
18280
18290
|
},
|
|
18281
18291
|
"css": {
|
|
18292
|
+
".steedos-amis-instance-view-body": {
|
|
18293
|
+
"height": "calc(100% - 65px)"
|
|
18294
|
+
},
|
|
18282
18295
|
".instance-approve-history .antd-Table-table thead": {
|
|
18283
18296
|
"display": "none"
|
|
18284
18297
|
},
|
|
@@ -18295,11 +18308,14 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
18295
18308
|
"padding": "0px !important"
|
|
18296
18309
|
},
|
|
18297
18310
|
".steedos-amis-instance-view .antd-Page-body": {
|
|
18298
|
-
"width": "
|
|
18311
|
+
"width": "1024px"
|
|
18299
18312
|
},
|
|
18300
18313
|
".antd-List-placeholder": {
|
|
18301
18314
|
"display": "none"
|
|
18302
18315
|
},
|
|
18316
|
+
".steedos-amis-instance-view .antd-Table-fixedTop":{
|
|
18317
|
+
"top": "-13px"
|
|
18318
|
+
},
|
|
18303
18319
|
".steedos-amis-instance-view .antd-Table-fixedTop:after":{
|
|
18304
18320
|
"box-shadow": "none"
|
|
18305
18321
|
},
|
|
@@ -18653,6 +18669,7 @@ const isCurrentStepOpinionField = (field, currentStep)=>{
|
|
|
18653
18669
|
return ___default.includes(___default.map(getOpinionFieldStepsName(field), 'stepName'), currentStep?.name);
|
|
18654
18670
|
};
|
|
18655
18671
|
|
|
18672
|
+
|
|
18656
18673
|
const getInstanceInfo = async (props) => {
|
|
18657
18674
|
console.log(`getInstanceInfo props`, props);
|
|
18658
18675
|
const { instanceId, box } = props;
|
|
@@ -18738,7 +18755,7 @@ const getInstanceInfo = async (props) => {
|
|
|
18738
18755
|
});
|
|
18739
18756
|
|
|
18740
18757
|
const moment = getMoment();
|
|
18741
|
-
|
|
18758
|
+
console.log('getInstanceInfo====>', step, formVersion.fields);
|
|
18742
18759
|
return {
|
|
18743
18760
|
box: box,
|
|
18744
18761
|
_id: instanceId,
|
|
@@ -18756,9 +18773,17 @@ const getInstanceInfo = async (props) => {
|
|
|
18756
18773
|
title: instance.name || instance.form.name,
|
|
18757
18774
|
name: instance.name || instance.form.name,
|
|
18758
18775
|
fields: ___default.map(formVersion.fields, (field) => {
|
|
18759
|
-
|
|
18776
|
+
const newField = Object.assign({}, field, {
|
|
18760
18777
|
permission: userApprove?.type != 'cc' && (step?.permissions[field.code] || ( isCurrentStepOpinionField(field, step) ? 'editable' : '')),
|
|
18761
18778
|
}) ;
|
|
18779
|
+
if(field.type === 'section'){
|
|
18780
|
+
newField.fields = ___default.map(field.fields, (sfield) => {
|
|
18781
|
+
return Object.assign({}, sfield, {
|
|
18782
|
+
permission: userApprove?.type != 'cc' && (step?.permissions[sfield.code] || ( isCurrentStepOpinionField(sfield, step) ? 'editable' : '')),
|
|
18783
|
+
});
|
|
18784
|
+
});
|
|
18785
|
+
}
|
|
18786
|
+
return newField;
|
|
18762
18787
|
}),
|
|
18763
18788
|
flowVersion: flowVersion,
|
|
18764
18789
|
formVersion: formVersion,
|