@steedos-widgets/amis-lib 6.10.1-beta.52 → 6.10.1-beta.53
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 +55 -23
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +55 -23
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +11 -10
- package/dist/index.umd.js.map +1 -1
- package/dist/types/workflow/attachment.d.ts +4 -4
- package/dist/types/workflow/flow.d.ts +8 -2
- package/package.json +2 -2
package/dist/index.esm.js
CHANGED
|
@@ -1598,6 +1598,7 @@ var frontend_workflow_approval_history_read$1 = "Read";
|
|
|
1598
1598
|
var frontend_workflow_approval_history_unprocessed$1 = "Unprocessed";
|
|
1599
1599
|
var frontend_workflow_attachment$1 = "Attachment";
|
|
1600
1600
|
var frontend_workflow_attachment_upload$1 = "Upload";
|
|
1601
|
+
var frontend_workflow_attachment_upload_success$1 = "Uploaded successfully";
|
|
1601
1602
|
var frontend_workflow_related_file$1 = "Related File";
|
|
1602
1603
|
var frontend_workflow_judge_option_approved$1 = "Approved";
|
|
1603
1604
|
var frontend_workflow_judge_option_rejected$1 = "Rejected";
|
|
@@ -1750,6 +1751,7 @@ var en_us$1 = {
|
|
|
1750
1751
|
frontend_workflow_approval_history_unprocessed: frontend_workflow_approval_history_unprocessed$1,
|
|
1751
1752
|
frontend_workflow_attachment: frontend_workflow_attachment$1,
|
|
1752
1753
|
frontend_workflow_attachment_upload: frontend_workflow_attachment_upload$1,
|
|
1754
|
+
frontend_workflow_attachment_upload_success: frontend_workflow_attachment_upload_success$1,
|
|
1753
1755
|
frontend_workflow_related_file: frontend_workflow_related_file$1,
|
|
1754
1756
|
frontend_workflow_judge_option_approved: frontend_workflow_judge_option_approved$1,
|
|
1755
1757
|
frontend_workflow_judge_option_rejected: frontend_workflow_judge_option_rejected$1,
|
|
@@ -1904,6 +1906,7 @@ var frontend_workflow_approval_history_read = "已读";
|
|
|
1904
1906
|
var frontend_workflow_approval_history_unprocessed = "未处理";
|
|
1905
1907
|
var frontend_workflow_attachment = "附件";
|
|
1906
1908
|
var frontend_workflow_attachment_upload = "上传";
|
|
1909
|
+
var frontend_workflow_attachment_upload_success = "上传成功";
|
|
1907
1910
|
var frontend_workflow_related_file = "相关文件";
|
|
1908
1911
|
var frontend_workflow_judge_option_approved = "核准";
|
|
1909
1912
|
var frontend_workflow_judge_option_rejected = "驳回";
|
|
@@ -2057,6 +2060,7 @@ var zh_cn$1 = {
|
|
|
2057
2060
|
frontend_workflow_approval_history_unprocessed: frontend_workflow_approval_history_unprocessed,
|
|
2058
2061
|
frontend_workflow_attachment: frontend_workflow_attachment,
|
|
2059
2062
|
frontend_workflow_attachment_upload: frontend_workflow_attachment_upload,
|
|
2063
|
+
frontend_workflow_attachment_upload_success: frontend_workflow_attachment_upload_success,
|
|
2060
2064
|
frontend_workflow_related_file: frontend_workflow_related_file,
|
|
2061
2065
|
frontend_workflow_judge_option_approved: frontend_workflow_judge_option_approved,
|
|
2062
2066
|
frontend_workflow_judge_option_rejected: frontend_workflow_judge_option_rejected,
|
|
@@ -2074,7 +2078,6 @@ var zh_cn$1 = {
|
|
|
2074
2078
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
2075
2079
|
* @LastEditTime: 2025-08-26 10:17:05
|
|
2076
2080
|
*/
|
|
2077
|
-
|
|
2078
2081
|
const resources = {
|
|
2079
2082
|
"en": {
|
|
2080
2083
|
translation: en_us$1
|
|
@@ -2085,7 +2088,7 @@ const resources = {
|
|
|
2085
2088
|
};
|
|
2086
2089
|
|
|
2087
2090
|
const getUserLanguage$1 = () => {
|
|
2088
|
-
var lan = Builder.settings.context?.user?.language || window.navigator.language;
|
|
2091
|
+
var lan = Builder.settings.context?.user?.language || Builder.settings.locale || window.navigator.language;
|
|
2089
2092
|
if(lan === 'en' || lan.startsWith('en-')){
|
|
2090
2093
|
lan = 'en';
|
|
2091
2094
|
}
|
|
@@ -17451,21 +17454,45 @@ const getSubmitActions = async (instance) => {
|
|
|
17451
17454
|
"args": {},
|
|
17452
17455
|
"actionType": "custom",
|
|
17453
17456
|
"script": `
|
|
17454
|
-
|
|
17455
|
-
|
|
17457
|
+
var wizard = event.context.scoped.getComponentById('instance_wizard');
|
|
17458
|
+
var form = event.context.scoped.getComponentById('instance_form');
|
|
17456
17459
|
|
|
17457
|
-
|
|
17458
|
-
|
|
17460
|
+
if (!wizard) {
|
|
17461
|
+
return form.validate().then(function(formValid) {
|
|
17462
|
+
event.setData(Object.assign({}, event.data, {instanceFormValidate: formValid}));
|
|
17463
|
+
return formValid;
|
|
17464
|
+
});
|
|
17465
|
+
}
|
|
17459
17466
|
|
|
17460
|
-
|
|
17461
|
-
|
|
17462
|
-
|
|
17463
|
-
|
|
17467
|
+
var stepsCount = wizard.state.rawSteps.length;
|
|
17468
|
+
var originStep = wizard.state.currentStep; // 索引从1开始
|
|
17469
|
+
|
|
17470
|
+
function validateStepsUntilFail(i) {
|
|
17471
|
+
if (i > stepsCount) {
|
|
17472
|
+
// 所有校验都通过,回到原来的页面
|
|
17473
|
+
return wizard.gotoStep(originStep).then(function(){
|
|
17474
|
+
return true;
|
|
17475
|
+
});
|
|
17476
|
+
}
|
|
17477
|
+
return wizard.gotoStep(i).then(function() {
|
|
17478
|
+
return wizard.form.validate();
|
|
17479
|
+
}).then(function(valid) {
|
|
17480
|
+
if (!valid) {
|
|
17481
|
+
// 校验失败,停在本步骤,返回 false
|
|
17482
|
+
return false;
|
|
17483
|
+
}
|
|
17484
|
+
// 校验通过,递归下一个
|
|
17485
|
+
return validateStepsUntilFail(i + 1);
|
|
17486
|
+
});
|
|
17487
|
+
}
|
|
17464
17488
|
|
|
17465
|
-
return
|
|
17466
|
-
|
|
17467
|
-
|
|
17468
|
-
|
|
17489
|
+
return form.validate().then(function(formValid){
|
|
17490
|
+
return validateStepsUntilFail(1).then(function(wizardValid){
|
|
17491
|
+
// wizardValid为false时,当前wizard已停在第一个未通过步骤,并且未通过表单项高亮
|
|
17492
|
+
var allValid = formValid && wizardValid;
|
|
17493
|
+
event.setData(Object.assign({}, event.data, {instanceFormValidate: allValid}));
|
|
17494
|
+
return allValid;
|
|
17495
|
+
});
|
|
17469
17496
|
});
|
|
17470
17497
|
`
|
|
17471
17498
|
},
|
|
@@ -17644,7 +17671,7 @@ const getApprovalDrawerSchema = async (instance) => {
|
|
|
17644
17671
|
* @Author: baozhoutao@steedos.com
|
|
17645
17672
|
* @Date: 2022-09-16 17:27:24
|
|
17646
17673
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
17647
|
-
* @LastEditTime: 2025-08-
|
|
17674
|
+
* @LastEditTime: 2025-08-31 09:53:48
|
|
17648
17675
|
* @Description:
|
|
17649
17676
|
*/
|
|
17650
17677
|
// TODO attachments
|
|
@@ -17704,7 +17731,7 @@ const getAttachmentUploadInput = async (instance)=>{
|
|
|
17704
17731
|
if(!instance.approve){
|
|
17705
17732
|
return {
|
|
17706
17733
|
type: 'tpl',
|
|
17707
|
-
tpl:
|
|
17734
|
+
tpl: i18next$1.t('frontend_workflow_attachment')
|
|
17708
17735
|
}
|
|
17709
17736
|
}
|
|
17710
17737
|
const auth = getSteedosAuth$1();
|
|
@@ -17766,7 +17793,7 @@ const getAttachmentUploadInput = async (instance)=>{
|
|
|
17766
17793
|
"position": "top-right",
|
|
17767
17794
|
"closeButton": true,
|
|
17768
17795
|
"showIcon": true,
|
|
17769
|
-
"msg": "上传成功"
|
|
17796
|
+
"msg": i18next$1.t('frontend_workflow_attachment_upload_success'),//"上传成功"
|
|
17770
17797
|
},
|
|
17771
17798
|
"actionType": "toast"
|
|
17772
17799
|
},
|
|
@@ -17789,7 +17816,7 @@ const getAttachmentUploadInput = async (instance)=>{
|
|
|
17789
17816
|
* @Author: baozhoutao@steedos.com
|
|
17790
17817
|
* @Date: 2022-09-16 17:26:12
|
|
17791
17818
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
17792
|
-
* @LastEditTime: 2025-08-
|
|
17819
|
+
* @LastEditTime: 2025-08-31 09:46:58
|
|
17793
17820
|
* @Description:
|
|
17794
17821
|
*/
|
|
17795
17822
|
const getRelatedRecords = async (instance)=>{
|
|
@@ -17799,7 +17826,7 @@ const getRelatedRecords = async (instance)=>{
|
|
|
17799
17826
|
return map(instance.record_ids, (item)=>{
|
|
17800
17827
|
return {
|
|
17801
17828
|
type: 'tpl',
|
|
17802
|
-
tpl: `<a href='/app/-/${item.o}/view/${item.ids[0]}' target='_blank'
|
|
17829
|
+
tpl: `<a href='/app/-/${item.o}/view/${item.ids[0]}' target='_blank'>${i18next$1.t('frontend_workflow_related_records_link_title')}</a>`
|
|
17803
17830
|
}
|
|
17804
17831
|
})
|
|
17805
17832
|
};
|
|
@@ -17882,7 +17909,7 @@ const getInstanceApprovalHistory = async ()=>{
|
|
|
17882
17909
|
* @Author: baozhoutao@steedos.com
|
|
17883
17910
|
* @Date: 2022-09-07 16:20:45
|
|
17884
17911
|
* @LastEditors: 殷亮辉 yinlianghui@hotoa.com
|
|
17885
|
-
* @LastEditTime: 2025-08-
|
|
17912
|
+
* @LastEditTime: 2025-08-31 17:57:15
|
|
17886
17913
|
* @Description:
|
|
17887
17914
|
*/
|
|
17888
17915
|
|
|
@@ -18516,8 +18543,13 @@ const getFormSteps = async (instance) => {
|
|
|
18516
18543
|
let fieldSchema;
|
|
18517
18544
|
for (const childField of field.fields) {
|
|
18518
18545
|
fieldSchema = await getTdInputTpl(childField, true);
|
|
18519
|
-
if (fieldSchema.type === "steedos-field"){
|
|
18520
|
-
fieldSchema.config.amis
|
|
18546
|
+
if (fieldSchema.type === "steedos-field" && fieldSchema.config) {
|
|
18547
|
+
if (fieldSchema.config.amis) {
|
|
18548
|
+
fieldSchema.config.amis.mode = formMode;
|
|
18549
|
+
}
|
|
18550
|
+
else {
|
|
18551
|
+
fieldSchema.config.amis = { mode: formMode };
|
|
18552
|
+
}
|
|
18521
18553
|
}
|
|
18522
18554
|
else {
|
|
18523
18555
|
fieldSchema.mode = formMode;
|
|
@@ -18552,7 +18584,7 @@ const getFormSteps = async (instance) => {
|
|
|
18552
18584
|
const getFormWizardView = async (instance) => {
|
|
18553
18585
|
const formSchema = {
|
|
18554
18586
|
type: "wizard",
|
|
18555
|
-
className: "instance-form-view-wizard pt-4",
|
|
18587
|
+
className: "instance-form-view-wizard pt-4 mt-3",
|
|
18556
18588
|
steps: await getFormSteps(instance),
|
|
18557
18589
|
actionFinishLabel: "${'CustomAction.instances.instance_save' | t}",//"保存",
|
|
18558
18590
|
id: "instance_wizard",
|