@steedos-widgets/amis-lib 6.10.1-beta.51 → 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/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
- const wizard = event.context.scoped.getComponentById("instance_wizard");
17455
- const form = event.context.scoped.getComponentById("instance_form");
17457
+ var wizard = event.context.scoped.getComponentById('instance_wizard');
17458
+ var form = event.context.scoped.getComponentById('instance_form');
17456
17459
 
17457
- // 1. 校验外层 form(直接表单项)
17458
- let formValidatePromise = form.validate();
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
- // 2. 校验 wizard(所有步骤数据)
17461
- let wizardValidatePromise = wizard?.form?.validate
17462
- ? wizard.form.validate()
17463
- : Promise.resolve(true);
17467
+ var stepsCount = wizard.state.rawSteps.length;
17468
+ var originStep = wizard.state.currentStep; // 索引从1开始
17464
17469
 
17465
- return Promise.all([formValidatePromise, wizardValidatePromise]).then(([formValid, wizardValid]) => {
17466
- const allValid = formValid && wizardValid;
17467
- event.setData({...event.data, instanceFormValidate: allValid});
17468
- return allValid;
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
+ }
17488
+
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-28 01:24:26
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-28 01:23:32
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'>相关台账信息</a>`
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-29 01:56:00
17912
+ * @LastEditTime: 2025-08-31 17:57:15
17886
17913
  * @Description:
17887
17914
  */
17888
17915
 
@@ -18488,6 +18515,7 @@ const getFormTableView = async (instance) => {
18488
18515
  };
18489
18516
 
18490
18517
  const getFormSteps = async (instance) => {
18518
+ const formMode = instance.form.current.mode || "normal";//normal,horizontal,inline
18491
18519
  const stepsSchema = [];
18492
18520
  let stepFields = [];
18493
18521
  let fields = [];
@@ -18515,11 +18543,21 @@ const getFormSteps = async (instance) => {
18515
18543
  let fieldSchema;
18516
18544
  for (const childField of field.fields) {
18517
18545
  fieldSchema = await getTdInputTpl(childField, true);
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
+ }
18553
+ }
18554
+ else {
18555
+ fieldSchema.mode = formMode;
18556
+ }
18518
18557
  stepFields.push(fieldSchema);
18519
18558
  }
18520
18559
  stepsSchema.push({
18521
18560
  "title": field.name,
18522
- "mode": "horizontal",
18523
18561
  "body": stepFields
18524
18562
  });
18525
18563
  }
@@ -18546,7 +18584,7 @@ const getFormSteps = async (instance) => {
18546
18584
  const getFormWizardView = async (instance) => {
18547
18585
  const formSchema = {
18548
18586
  type: "wizard",
18549
- className: "instance-form-view-wizard pt-4",
18587
+ className: "instance-form-view-wizard pt-4 mt-3",
18550
18588
  steps: await getFormSteps(instance),
18551
18589
  actionFinishLabel: "${'CustomAction.instances.instance_save' | t}",//"保存",
18552
18590
  id: "instance_wizard",
@@ -18716,7 +18754,7 @@ const getFlowFormSchema = async (instance, box) => {
18716
18754
  return {
18717
18755
  type: "page",
18718
18756
  name: "instancePage",
18719
- className: "steedos-amis-instance-view",
18757
+ className: "steedos-amis-instance-view " + "steedos-instance-style-" + formStyle,
18720
18758
  bodyClassName: "overflow-y-auto h-full steedos-amis-instance-view-body",
18721
18759
  headerClassName: "p-0",
18722
18760
  "title": {
@@ -18747,7 +18785,7 @@ const getFlowFormSchema = async (instance, box) => {
18747
18785
  ".steedos-object-record-detail-header .antd-Grid-col--mdAuto": {
18748
18786
  "padding": "0px !important"
18749
18787
  },
18750
- ".steedos-amis-instance-view .antd-Page-body": {
18788
+ ".steedos-amis-instance-view.steedos-instance-style-table .antd-Page-body": {
18751
18789
  "width": "1024px"
18752
18790
  },
18753
18791
  ".antd-List-placeholder": {
@@ -18983,7 +19021,7 @@ const getOpinionFieldStepsName = (field, top_keywords) => {
18983
19021
  * @Author: baozhoutao@steedos.com
18984
19022
  * @Date: 2022-09-09 17:47:37
18985
19023
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
18986
- * @LastEditTime: 2025-08-28 01:47:42
19024
+ * @LastEditTime: 2025-08-29 20:51:53
18987
19025
  * @Description:
18988
19026
  */
18989
19027
 
@@ -19160,6 +19198,7 @@ const getInstanceInfo = async (props) => {
19160
19198
  _id,
19161
19199
  name,
19162
19200
  style,
19201
+ mode,
19163
19202
  current,
19164
19203
  historys
19165
19204
  },