@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.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
|
-
"
|
|
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
|
-
"
|
|
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
|
-
|
|
2568
|
+
isLookupInTable: true,
|
|
2569
2569
|
config: {
|
|
2570
2570
|
type: "lookup",
|
|
2571
2571
|
reference_to: field.reference_to,
|
|
@@ -3160,7 +3160,7 @@ async function getTableApi(mainObject, fields, options){
|
|
|
3160
3160
|
let valueField = mainObject.key_field || '_id';
|
|
3161
3161
|
const api = await getApi$1(mainObject, null, fields, {count: options.queryCount, alias: 'rows', limit: top, queryOptions: `filters: {__filters}, top: {__top}, skip: {__skip}, sort: "{__sort}"`});
|
|
3162
3162
|
|
|
3163
|
-
api.url;//设计器上对象表格组件需要切换对象重新请求列表数据
|
|
3163
|
+
// api.url;//设计器上对象表格组件需要切换对象重新请求列表数据
|
|
3164
3164
|
// if(options.isRelated){
|
|
3165
3165
|
// api.url += "&recordId=${_master.recordId}";
|
|
3166
3166
|
// }
|
|
@@ -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(
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
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:
|
|
4911
|
-
* @LastEditTime:
|
|
4919
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
4920
|
+
* @LastEditTime: 2025-07-22 14:29:15
|
|
4912
4921
|
* @Description:
|
|
4913
4922
|
*/
|
|
4914
4923
|
|
|
@@ -4982,7 +4991,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
4982
4991
|
}
|
|
4983
4992
|
const uiSchema = event.data.uiSchema;
|
|
4984
4993
|
const objectName = event.data.objectName;
|
|
4985
|
-
const
|
|
4994
|
+
const crudId = event.data.crudId || "listview_" + objectName;
|
|
4995
|
+
const listViewRef = event.context.scoped.getComponentById(crudId);
|
|
4986
4996
|
const selectedItems = listViewRef && listViewRef.props.store.toJSON().selectedItems || [];
|
|
4987
4997
|
event.data.selectedIds = _.map(selectedItems, uiSchema.idFieldName || '_id');
|
|
4988
4998
|
`;
|
|
@@ -5032,6 +5042,7 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5032
5042
|
"isLookup": "${isLookup}",
|
|
5033
5043
|
"listName": "${listName}",
|
|
5034
5044
|
"selectedRowResponseResult": "${selectedRowResponseResult}",
|
|
5045
|
+
"_lookupObjectName": "${_lookupObjectName}"
|
|
5035
5046
|
},
|
|
5036
5047
|
"title":i18next__default["default"].t('frontend_form_new') + " ${uiSchema.label | raw}",
|
|
5037
5048
|
"body": [
|
|
@@ -5104,8 +5115,8 @@ const getSchema$5 = async (uiSchema, ctx) => {
|
|
|
5104
5115
|
/*
|
|
5105
5116
|
* @Author: baozhoutao@steedos.com
|
|
5106
5117
|
* @Date: 2022-11-01 15:49:58
|
|
5107
|
-
* @LastEditors:
|
|
5108
|
-
* @LastEditTime:
|
|
5118
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5119
|
+
* @LastEditTime: 2025-07-14 11:55:43
|
|
5109
5120
|
* @Description:
|
|
5110
5121
|
*/
|
|
5111
5122
|
|
|
@@ -5135,6 +5146,7 @@ const getSchema$4 = async (uiSchema, ctx) => {
|
|
|
5135
5146
|
: page.schema;
|
|
5136
5147
|
}
|
|
5137
5148
|
|
|
5149
|
+
// console.log('formSchema====>', formSchema);
|
|
5138
5150
|
|
|
5139
5151
|
return {
|
|
5140
5152
|
type: "service",
|
|
@@ -5159,9 +5171,10 @@ const getSchema$4 = async (uiSchema, ctx) => {
|
|
|
5159
5171
|
showCloseButton: true,
|
|
5160
5172
|
"data": {
|
|
5161
5173
|
"&": "$$",
|
|
5162
|
-
"_master": "${
|
|
5174
|
+
"_master": "${mainRecord}",
|
|
5163
5175
|
"_master._isRelated": "${_isRelated}",
|
|
5164
|
-
"_master.relatedKey": "${relatedKey}"
|
|
5176
|
+
"_master.relatedKey": "${relatedKey}",
|
|
5177
|
+
"_lookupObjectName": "${_lookupObjectName}"
|
|
5165
5178
|
},
|
|
5166
5179
|
size: "lg",
|
|
5167
5180
|
"actions": [
|
|
@@ -5260,12 +5273,12 @@ const getSchema$3 = (uiSchema)=>{
|
|
|
5260
5273
|
{
|
|
5261
5274
|
"actionType": "broadcast",
|
|
5262
5275
|
"args": {
|
|
5263
|
-
"eventName": "@data.changed.${
|
|
5276
|
+
"eventName": "@data.changed.${_lookupObjectName}"
|
|
5264
5277
|
},
|
|
5265
5278
|
"data": {
|
|
5266
|
-
"objectName": "${
|
|
5279
|
+
"objectName": "${_lookupObjectName}"
|
|
5267
5280
|
},
|
|
5268
|
-
"expression": `\${
|
|
5281
|
+
"expression": `\${_lookupObjectName != '${uiSchema.name}' && _lookupObjectName}`
|
|
5269
5282
|
}
|
|
5270
5283
|
]
|
|
5271
5284
|
}
|
|
@@ -5524,8 +5537,8 @@ const getSchema = async (uiSchema, ctx) => {
|
|
|
5524
5537
|
/*
|
|
5525
5538
|
* @Author: baozhoutao@steedos.com
|
|
5526
5539
|
* @Date: 2022-11-01 15:53:07
|
|
5527
|
-
* @LastEditors:
|
|
5528
|
-
* @LastEditTime:
|
|
5540
|
+
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
5541
|
+
* @LastEditTime: 2025-07-22 14:12:01
|
|
5529
5542
|
* @Description:
|
|
5530
5543
|
*/
|
|
5531
5544
|
|
|
@@ -5555,10 +5568,12 @@ const StandardButtons = {
|
|
|
5555
5568
|
const {
|
|
5556
5569
|
appId,
|
|
5557
5570
|
objectName,
|
|
5558
|
-
uiSchema
|
|
5571
|
+
uiSchema,
|
|
5572
|
+
record
|
|
5559
5573
|
} = this;
|
|
5574
|
+
const crudId = record?.crudId || `listview_${uiSchema.name}`;
|
|
5560
5575
|
const scope = this.scope;
|
|
5561
|
-
const listViewRef = scope.parent?.getComponentById(
|
|
5576
|
+
const listViewRef = scope.parent?.getComponentById(crudId);
|
|
5562
5577
|
if(_.isEmpty(listViewRef.props.store.toJSON().selectedItems)){
|
|
5563
5578
|
listViewRef.handleAction({}, {
|
|
5564
5579
|
"actionType": "toast",
|
|
@@ -6186,19 +6201,11 @@ async function getObjectFieldsFilterFormSchema(ctx) {
|
|
|
6186
6201
|
},
|
|
6187
6202
|
"schemaApi": {
|
|
6188
6203
|
method: 'post',
|
|
6189
|
-
url: `\${context.rootUrl}/graphql?reload=\${filterFormSearchableFields|join}`,
|
|
6190
6204
|
data: {
|
|
6191
6205
|
$self: "$$",
|
|
6192
|
-
query: "
|
|
6206
|
+
query: ""
|
|
6193
6207
|
},
|
|
6194
|
-
|
|
6195
|
-
return {
|
|
6196
|
-
...api,
|
|
6197
|
-
data: {
|
|
6198
|
-
query: api.data.query
|
|
6199
|
-
}
|
|
6200
|
-
};
|
|
6201
|
-
`,
|
|
6208
|
+
url: `/api/amis/health_check?reload=\${filterFormSearchableFields|join}`,
|
|
6202
6209
|
adaptor: `
|
|
6203
6210
|
if(payload.errors){
|
|
6204
6211
|
payload.status = 2;
|
|
@@ -6498,7 +6505,8 @@ async function getObjectFieldsFilterBarSchema(objectSchema, ctx) {
|
|
|
6498
6505
|
});
|
|
6499
6506
|
// 有过滤条件时只显示搜索按钮上的红点,不自动展开搜索栏
|
|
6500
6507
|
if(!_.isEmpty(omitedEmptyFormValue)){
|
|
6501
|
-
let
|
|
6508
|
+
let scopeRef = SteedosUI.getRef(data.$scopeId);
|
|
6509
|
+
let crudService = scopeRef && scopeRef.parent.getComponentById("service_listview_" + data.objectName)
|
|
6502
6510
|
crudService && crudService.setData({isFieldsFilterEmpty: false});
|
|
6503
6511
|
// setData({ showFieldsFilter: true });//自动展开搜索栏
|
|
6504
6512
|
}
|
|
@@ -7597,6 +7605,7 @@ function getObjectListHeaderFirstLine(objectSchema, listViewName, ctx) {
|
|
|
7597
7605
|
"size": "sm",
|
|
7598
7606
|
"hideCaret": true,
|
|
7599
7607
|
"closeOnClick": true,
|
|
7608
|
+
"visibleOn": "\${listName && uiSchema.list_views[listName].disableSwitch != true}",
|
|
7600
7609
|
"btnClassName": "!bg-transparent !border-none !hover:border-none text-lg h-5 font-bold p-0 text-black leading-none",
|
|
7601
7610
|
"buttons": [
|
|
7602
7611
|
...listViewButtonOptions,
|
|
@@ -7609,6 +7618,12 @@ function getObjectListHeaderFirstLine(objectSchema, listViewName, ctx) {
|
|
|
7609
7618
|
},
|
|
7610
7619
|
listviewNewButton
|
|
7611
7620
|
]
|
|
7621
|
+
},
|
|
7622
|
+
{
|
|
7623
|
+
"type": "tpl",
|
|
7624
|
+
"className": "steedos-listview-change-button text-lg font-bold",
|
|
7625
|
+
"tpl": "\${listName ? uiSchema.list_views[listName].label : uiSchema.list_views[defaultListName].label}",
|
|
7626
|
+
"visibleOn": "\${listName && uiSchema.list_views[listName].disableSwitch}",
|
|
7612
7627
|
}
|
|
7613
7628
|
],
|
|
7614
7629
|
"md": "",
|
|
@@ -10006,16 +10021,16 @@ async function getObjectForm(objectSchema, ctx){
|
|
|
10006
10021
|
},
|
|
10007
10022
|
"expression": `\${_master.objectName != '${objectSchema.name}' && _master.objectName}`
|
|
10008
10023
|
},
|
|
10009
|
-
//
|
|
10024
|
+
// 列表视图、对象表格、对象表单组件上的lookup字段,点开右侧弹出drawer窗口,修改记录后刷新列表
|
|
10010
10025
|
{
|
|
10011
10026
|
"actionType": "broadcast",
|
|
10012
10027
|
"args": {
|
|
10013
|
-
"eventName": "@data.changed.${
|
|
10028
|
+
"eventName": "@data.changed.${_lookupObjectName}"
|
|
10014
10029
|
},
|
|
10015
10030
|
"data": {
|
|
10016
|
-
"objectName": "${
|
|
10031
|
+
"objectName": "${_lookupObjectName}"
|
|
10017
10032
|
},
|
|
10018
|
-
"expression": `\${
|
|
10033
|
+
"expression": `\${_lookupObjectName != '${objectSchema.name}' && _lookupObjectName}`
|
|
10019
10034
|
},
|
|
10020
10035
|
...submitSuccActions,
|
|
10021
10036
|
// {
|
|
@@ -12749,11 +12764,8 @@ async function lookupToAmisSelect(field, readonly, ctx){
|
|
|
12749
12764
|
}else {
|
|
12750
12765
|
apiInfo = {
|
|
12751
12766
|
method: "post",
|
|
12752
|
-
|
|
12753
|
-
|
|
12754
|
-
"headers": {
|
|
12755
|
-
"Authorization": "Bearer ${context.tenantId},${context.authToken}"
|
|
12756
|
-
}
|
|
12767
|
+
data: {$: "$$", query: ""},
|
|
12768
|
+
url: "/api/amis/health_check?reload=\${additionalFilters|join}&listName=\${listName}"
|
|
12757
12769
|
};
|
|
12758
12770
|
}
|
|
12759
12771
|
|
|
@@ -14199,9 +14211,9 @@ async function convertSFieldToAmisField(field, readonly, ctx) {
|
|
|
14199
14211
|
// if(ctx.mode === 'edit'){
|
|
14200
14212
|
let convertDataResult;
|
|
14201
14213
|
if(convertData.type == "steedos-field"){
|
|
14202
|
-
// 如果是steedos-field,不能把amis属性合并到steedos-field根属性中,要合并也是合并到steedos-field的config.amis中
|
|
14203
|
-
// 而steedos-field字段的amis
|
|
14204
|
-
// 目前测试到受影响的是,把字段的amis属性配置为{"type": "checkboxes"}时,ObjectForm只读模式下,lookup字段返回的是type为steedos-field
|
|
14214
|
+
// 如果是steedos-field,不能把field.amis属性合并到steedos-field根属性中,要合并也是合并到steedos-field的config.amis中
|
|
14215
|
+
// 而steedos-field字段的config属性中的amis属性已经有了这里的field.amis,所以这里不需要再合并field.amis
|
|
14216
|
+
// 目前测试到受影响的是,把字段的amis属性配置为{"type": "checkboxes"}时,ObjectForm只读模式下,lookup字段返回的是type为steedos-field的组件,此时如果在这里合并field.amis,那么其type就变成了checkboxes,导致lookup字段显示为复选框
|
|
14205
14217
|
convertDataResult = Object.assign({}, baseData, convertData, { labelClassName: 'text-left', clearValueOnHidden: true, fieldName: field.name}, {name: baseData.name});
|
|
14206
14218
|
}
|
|
14207
14219
|
else {
|
|
@@ -14254,7 +14266,8 @@ async function getFieldSearchable(perField, permissionFields, ctx){
|
|
|
14254
14266
|
_field.removable = false;
|
|
14255
14267
|
_field.value = [null,null];
|
|
14256
14268
|
_field.items = {
|
|
14257
|
-
type: "input-number"
|
|
14269
|
+
type: "input-number",
|
|
14270
|
+
clearValueOnEmpty: true
|
|
14258
14271
|
};
|
|
14259
14272
|
_field.is_wide = true;
|
|
14260
14273
|
fieldNamePrefix = `${fieldNamePrefix}between__`;
|
|
@@ -14302,6 +14315,10 @@ async function getFieldSearchable(perField, permissionFields, ctx){
|
|
|
14302
14315
|
delete _field.amis.hidden;
|
|
14303
14316
|
delete _field.amis.hiddenOn;
|
|
14304
14317
|
delete _field.amis.autoFill;
|
|
14318
|
+
if(_field.type.indexOf("-range") > -1 || _field.type === 'input-array'){
|
|
14319
|
+
// 范围类型不允许变更type,否则会因为某些属性兼容性问题报错页面奔溃,比如input-date-range类型有shortcuts属性,改为input-date后其shortcuts属性有兼容性问题
|
|
14320
|
+
delete _field.amis.type;
|
|
14321
|
+
}
|
|
14305
14322
|
}
|
|
14306
14323
|
|
|
14307
14324
|
const amisField = await convertSFieldToAmisField(_field, false, Object.assign({}, ctx, {fieldNamePrefix: fieldNamePrefix, required: false, showSystemFields: true, inFilterForm: true}));
|
|
@@ -17031,7 +17048,7 @@ const getNextStepUsersInput = async (instance) => {
|
|
|
17031
17048
|
"messages": {
|
|
17032
17049
|
},
|
|
17033
17050
|
"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;",
|
|
17034
|
-
"adaptor": "
|
|
17051
|
+
"adaptor": "\npayload.data = {value: payload.nextStepUsers.length === 1 ? payload.nextStepUsers[0].id : null, options: payload.nextStepUsers};\nreturn payload;",
|
|
17035
17052
|
"data": {
|
|
17036
17053
|
"&": "$$",
|
|
17037
17054
|
"$scopeId": "$scopeId",
|
|
@@ -17224,10 +17241,10 @@ const getApprovalDrawerSchema = async (instance) => {
|
|
|
17224
17241
|
console.log("=============getApprovalDrawerSchema=============", instance);
|
|
17225
17242
|
return {
|
|
17226
17243
|
type: "drawer",
|
|
17227
|
-
overlay:
|
|
17244
|
+
overlay: false,
|
|
17228
17245
|
resizable: false,
|
|
17229
17246
|
closeOnEsc: true,
|
|
17230
|
-
closeOnOutside:
|
|
17247
|
+
closeOnOutside: false,
|
|
17231
17248
|
size: "sm",
|
|
17232
17249
|
title: `${instance.step.name}`,
|
|
17233
17250
|
className: "approval-drawer absolute",
|
|
@@ -17941,6 +17958,10 @@ const getFieldEditTpl = async (field, label)=>{
|
|
|
17941
17958
|
case "section":
|
|
17942
17959
|
tpl.type = "input-text";
|
|
17943
17960
|
break;
|
|
17961
|
+
default:
|
|
17962
|
+
tpl.type = 'steedos-field';
|
|
17963
|
+
tpl.config = field.steedos_field;
|
|
17964
|
+
break;
|
|
17944
17965
|
}
|
|
17945
17966
|
}
|
|
17946
17967
|
// console.log('getFieldEditTpl ', label, tpl)
|
|
@@ -18065,15 +18086,15 @@ const getTdField = async (field, fieldsCount) => {
|
|
|
18065
18086
|
|
|
18066
18087
|
const getTdTitle = (field) => {
|
|
18067
18088
|
return {
|
|
18068
|
-
className:
|
|
18089
|
+
className: `td-title td-title-${field.type}`,
|
|
18069
18090
|
align: field.type != "section" ? "center" : "left",
|
|
18070
18091
|
width: field.type != "section" ? "16%" : "",
|
|
18071
18092
|
colspan: field.type == "section" ? 4 : "",
|
|
18072
|
-
background: "#FFFFFF",
|
|
18093
|
+
background: field.type == "section" ? "#f1f1f1" : "#FFFFFF",
|
|
18073
18094
|
body: [
|
|
18074
18095
|
{
|
|
18075
18096
|
type: "tpl",
|
|
18076
|
-
tpl: `<div>${field.name || field.code} ${field.is_required ? '<span class="antd-Form-star">*</span>' : ''}</div>`,
|
|
18097
|
+
tpl: `<div class='${field.type == "section" ? "font-bold" : ""}'>${field.name || field.code} ${field.is_required ? '<span class="antd-Form-star">*</span>' : ''}</div>`,
|
|
18077
18098
|
},
|
|
18078
18099
|
],
|
|
18079
18100
|
// "id": "u:9b001b7ff92d",
|
|
@@ -18146,6 +18167,7 @@ const getFormTableView = async (instance) => {
|
|
|
18146
18167
|
trs: await getFormTrs(instance),
|
|
18147
18168
|
id: "u:047f3669468b",
|
|
18148
18169
|
};
|
|
18170
|
+
console.log('getFormTableView===>', instance, formSchema);
|
|
18149
18171
|
return formSchema;
|
|
18150
18172
|
};
|
|
18151
18173
|
|
|
@@ -18175,6 +18197,14 @@ const getApplicantTableView = async (instance) => {
|
|
|
18175
18197
|
};
|
|
18176
18198
|
}
|
|
18177
18199
|
|
|
18200
|
+
if(applicantInput){
|
|
18201
|
+
if(applicantInput.className){
|
|
18202
|
+
applicantInput.className = `${applicantInput.className} inline-left`;
|
|
18203
|
+
}else {
|
|
18204
|
+
applicantInput.className = `inline-left`;
|
|
18205
|
+
}
|
|
18206
|
+
}
|
|
18207
|
+
|
|
18178
18208
|
return {
|
|
18179
18209
|
type: "table-view",
|
|
18180
18210
|
className: "instance-applicant-view",
|
|
@@ -18186,70 +18216,50 @@ const getApplicantTableView = async (instance) => {
|
|
|
18186
18216
|
className: "td-title",
|
|
18187
18217
|
background: "#FFFFFF",
|
|
18188
18218
|
align: "left",
|
|
18189
|
-
width: "
|
|
18219
|
+
width: "50%",
|
|
18190
18220
|
colspan: "",
|
|
18191
18221
|
body: [
|
|
18192
18222
|
{
|
|
18193
18223
|
type: "tpl",
|
|
18194
|
-
tpl: "<div
|
|
18224
|
+
tpl: "<div class='inline-left'>提交人:</div>",
|
|
18195
18225
|
id: "u:ee62634201bf",
|
|
18196
18226
|
},
|
|
18227
|
+
applicantInput
|
|
18197
18228
|
],
|
|
18198
18229
|
id: "u:6c24c1bb99c9",
|
|
18199
18230
|
style: {
|
|
18200
18231
|
padding: "none",
|
|
18201
18232
|
},
|
|
18202
18233
|
},
|
|
18203
|
-
{
|
|
18204
|
-
background: "#FFFFFF",
|
|
18205
|
-
colspan: 1,
|
|
18206
|
-
align: "left",
|
|
18207
|
-
className: "td-field",
|
|
18208
|
-
width: "32%",
|
|
18209
|
-
body: [
|
|
18210
|
-
applicantInput
|
|
18211
|
-
],
|
|
18212
|
-
id: "u:45d65d91905c",
|
|
18213
|
-
},
|
|
18214
18234
|
{
|
|
18215
18235
|
className: "td-title",
|
|
18216
18236
|
background: "#FFFFFF",
|
|
18217
18237
|
align: "left",
|
|
18218
|
-
width: "
|
|
18238
|
+
width: "50%",
|
|
18219
18239
|
colspan: "",
|
|
18220
18240
|
body: [
|
|
18221
18241
|
{
|
|
18222
18242
|
type: "tpl",
|
|
18223
|
-
tpl: "<div
|
|
18243
|
+
tpl: "<div class='inline-left'>提交日期:</div>",
|
|
18224
18244
|
id: "u:6d0a7763d527",
|
|
18225
18245
|
},
|
|
18226
|
-
],
|
|
18227
|
-
id: "u:c8b8214ac931",
|
|
18228
|
-
style: {
|
|
18229
|
-
padding: "none",
|
|
18230
|
-
},
|
|
18231
|
-
},
|
|
18232
|
-
{
|
|
18233
|
-
background: "#FFFFFF",
|
|
18234
|
-
colspan: 1,
|
|
18235
|
-
align: "left",
|
|
18236
|
-
className: "td-field",
|
|
18237
|
-
width: "32%",
|
|
18238
|
-
body: [
|
|
18239
18246
|
{
|
|
18240
18247
|
label: false,
|
|
18241
18248
|
mode: "horizontal",
|
|
18242
|
-
className: "m-none p-none",
|
|
18249
|
+
className: "m-none p-none inline-left",
|
|
18243
18250
|
disabled: true,
|
|
18244
18251
|
type: "tpl",
|
|
18245
18252
|
inputFormat: "YYYY-MM-DD",
|
|
18246
18253
|
valueFormat: "YYYY-MM-DDT00:00:00.000[Z]",
|
|
18247
18254
|
tpl: '<div>${submit_date}</div>',
|
|
18248
18255
|
id: "u:2016b04355f4",
|
|
18249
|
-
}
|
|
18256
|
+
}
|
|
18250
18257
|
],
|
|
18251
|
-
id: "u:
|
|
18252
|
-
|
|
18258
|
+
id: "u:c8b8214ac931",
|
|
18259
|
+
style: {
|
|
18260
|
+
padding: "none",
|
|
18261
|
+
},
|
|
18262
|
+
}
|
|
18253
18263
|
],
|
|
18254
18264
|
},
|
|
18255
18265
|
],
|
|
@@ -18294,7 +18304,7 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
18294
18304
|
type: "page",
|
|
18295
18305
|
name: "instancePage",
|
|
18296
18306
|
className: "steedos-amis-instance-view",
|
|
18297
|
-
bodyClassName: "overflow-y-auto h-full",
|
|
18307
|
+
bodyClassName: "overflow-y-auto h-full steedos-amis-instance-view-body",
|
|
18298
18308
|
headerClassName: "p-0",
|
|
18299
18309
|
"title": {
|
|
18300
18310
|
"type": "steedos-record-detail-header",
|
|
@@ -18303,9 +18313,12 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
18303
18313
|
"recordId": instance._id,
|
|
18304
18314
|
"id": "u:e6b2adbe0e21",
|
|
18305
18315
|
"showRecordTitle": false,
|
|
18306
|
-
"className": "p-0 m-0 p0 m0"
|
|
18316
|
+
"className": "p-0 m-0 p0 m0 bg-gray-50"
|
|
18307
18317
|
},
|
|
18308
18318
|
"css": {
|
|
18319
|
+
".steedos-amis-instance-view-body": {
|
|
18320
|
+
"height": "calc(100% - 65px)"
|
|
18321
|
+
},
|
|
18309
18322
|
".instance-approve-history .antd-Table-table thead": {
|
|
18310
18323
|
"display": "none"
|
|
18311
18324
|
},
|
|
@@ -18322,11 +18335,14 @@ const getFlowFormSchema = async (instance, box) => {
|
|
|
18322
18335
|
"padding": "0px !important"
|
|
18323
18336
|
},
|
|
18324
18337
|
".steedos-amis-instance-view .antd-Page-body": {
|
|
18325
|
-
"width": "
|
|
18338
|
+
"width": "1024px"
|
|
18326
18339
|
},
|
|
18327
18340
|
".antd-List-placeholder": {
|
|
18328
18341
|
"display": "none"
|
|
18329
18342
|
},
|
|
18343
|
+
".steedos-amis-instance-view .antd-Table-fixedTop":{
|
|
18344
|
+
"top": "-13px"
|
|
18345
|
+
},
|
|
18330
18346
|
".steedos-amis-instance-view .antd-Table-fixedTop:after":{
|
|
18331
18347
|
"box-shadow": "none"
|
|
18332
18348
|
},
|
|
@@ -18680,6 +18696,7 @@ const isCurrentStepOpinionField = (field, currentStep)=>{
|
|
|
18680
18696
|
return ___default["default"].includes(___default["default"].map(getOpinionFieldStepsName(field), 'stepName'), currentStep?.name);
|
|
18681
18697
|
};
|
|
18682
18698
|
|
|
18699
|
+
|
|
18683
18700
|
const getInstanceInfo = async (props) => {
|
|
18684
18701
|
console.log(`getInstanceInfo props`, props);
|
|
18685
18702
|
const { instanceId, box } = props;
|
|
@@ -18765,7 +18782,7 @@ const getInstanceInfo = async (props) => {
|
|
|
18765
18782
|
});
|
|
18766
18783
|
|
|
18767
18784
|
const moment = getMoment();
|
|
18768
|
-
|
|
18785
|
+
console.log('getInstanceInfo====>', step, formVersion.fields);
|
|
18769
18786
|
return {
|
|
18770
18787
|
box: box,
|
|
18771
18788
|
_id: instanceId,
|
|
@@ -18783,9 +18800,17 @@ const getInstanceInfo = async (props) => {
|
|
|
18783
18800
|
title: instance.name || instance.form.name,
|
|
18784
18801
|
name: instance.name || instance.form.name,
|
|
18785
18802
|
fields: ___default["default"].map(formVersion.fields, (field) => {
|
|
18786
|
-
|
|
18803
|
+
const newField = Object.assign({}, field, {
|
|
18787
18804
|
permission: userApprove?.type != 'cc' && (step?.permissions[field.code] || ( isCurrentStepOpinionField(field, step) ? 'editable' : '')),
|
|
18788
18805
|
}) ;
|
|
18806
|
+
if(field.type === 'section'){
|
|
18807
|
+
newField.fields = ___default["default"].map(field.fields, (sfield) => {
|
|
18808
|
+
return Object.assign({}, sfield, {
|
|
18809
|
+
permission: userApprove?.type != 'cc' && (step?.permissions[sfield.code] || ( isCurrentStepOpinionField(sfield, step) ? 'editable' : '')),
|
|
18810
|
+
});
|
|
18811
|
+
});
|
|
18812
|
+
}
|
|
18813
|
+
return newField;
|
|
18789
18814
|
}),
|
|
18790
18815
|
flowVersion: flowVersion,
|
|
18791
18816
|
formVersion: formVersion,
|