@steedos-widgets/amis-lib 6.10.27 → 6.10.28

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.cjs.js CHANGED
@@ -17652,21 +17652,21 @@ const getApprovalDrawerSchema = async (instance, events) => {
17652
17652
  placeholder: i18next__default["default"].t('frontend_workflow_suggestion_placeholder'),//"请填写意见",
17653
17653
  requiredOn: "${judge === 'rejected'}",
17654
17654
  value: userApprove?.description,
17655
- // "onEvent": {
17656
- // "blur": {
17657
- // "actions": [
17658
- // {
17659
- // "componentId": "u:instancePage",
17660
- // "actionType": "setValue",
17661
- // "args": {
17662
- // "value": {
17663
- // "instance_my_approve_description": "${value}"
17664
- // }
17665
- // }
17666
- // }
17667
- // ]
17668
- // }
17669
- // }
17655
+ "onEvent": {
17656
+ "blur": {
17657
+ "actions": [
17658
+ {
17659
+ "componentId": "u:instancePage",
17660
+ "actionType": "setValue",
17661
+ "args": {
17662
+ "value": {
17663
+ "instance_my_approve_description": "${value}"
17664
+ }
17665
+ }
17666
+ }
17667
+ ]
17668
+ }
17669
+ }
17670
17670
  },
17671
17671
  await getNextStepInput(instance, nextStepChangeEvents),
17672
17672
  await getNextStepUsersInput(instance, nextStepUserChangeEvents),
@@ -17991,7 +17991,7 @@ const getInstanceApprovalHistory = async ()=>{
17991
17991
  * @Author: baozhoutao@steedos.com
17992
17992
  * @Date: 2022-09-07 16:20:45
17993
17993
  * @LastEditors: 殷亮辉 yinlianghui@hotoa.com
17994
- * @LastEditTime: 2025-11-20 20:13:03
17994
+ * @LastEditTime: 2025-12-04 13:47:10
17995
17995
  * @Description:
17996
17996
  */
17997
17997
 
@@ -18786,6 +18786,22 @@ const getApplicantTableView = async (instance) => {
18786
18786
  "onEvent": {
18787
18787
  "change": {
18788
18788
  "actions": [
18789
+ {
18790
+ "actionType": "ajax",
18791
+ "api": {
18792
+ "url": "/api/workflow/v2/instance/save",
18793
+ "method": "post",
18794
+ "sendOn": "",
18795
+ "requestAdaptor": "var _SteedosUI$getRef$get, _approveValues$next_s;\nconst formValues = context._scoped.getComponentById(\"instance_form\").getValues(); const _formValues = JSON.parse(JSON.stringify(formValues)); if(_formValues){delete _formValues.__applicant} \nconst approveValues = (_SteedosUI$getRef$get = context._scoped.getComponentById(\"instance_approval\")) === null || _SteedosUI$getRef$get === void 0 ? void 0 : _SteedosUI$getRef$get.getValues();\nlet nextUsers = approveValues === null || approveValues === void 0 ? void 0 : approveValues.next_users;\nif (_.isString(nextUsers)) {\n nextUsers = [approveValues.next_users];\n}\nconst instance = context.record;\nconst body = {\n instance: {\n _id: instance._id,\n applicant: context.__applicant,\n submitter: formValues.submitter,\n traces: [{\n _id: instance.trace._id,\n step: instance.step._id,\n approves: [{\n _id: instance.approve._id,\n next_steps: [{\n step: approveValues === null || approveValues === void 0 || (_approveValues$next_s = approveValues.next_step) === null || _approveValues$next_s === void 0 ? void 0 : _approveValues$next_s._id,\n users: nextUsers\n }],\n description: approveValues === null || approveValues === void 0 ? void 0 : approveValues.suggestion,\n values: _formValues\n }]\n }]\n }\n};\napi.data = body;\nreturn api;",
18796
+ "adaptor": "if (payload.instance == \"upgraded\") { window.setTimeout(function(){ window.location.reload(); }, 2000); return {...payload, status: 1, msg: t('instance_action_instance_save_msg_upgraded')}; } \n return payload.instance === true ? {...payload, status: 0, msg: ''} : {...payload, status: 1, msg: t('instance_action_instance_save_msg_failed')};",
18797
+ "headers": {
18798
+ "Authorization": "Bearer ${context.tenantId},${context.authToken}"
18799
+ },
18800
+ "data": {
18801
+ "&": "$$"
18802
+ }
18803
+ }
18804
+ },
18789
18805
  {
18790
18806
  "actionType": "ajax",
18791
18807
  "api": {
@@ -18818,7 +18834,7 @@ const getApplicantTableView = async (instance) => {
18818
18834
  id: "u:2016b04355f4",
18819
18835
  };
18820
18836
  }
18821
-
18837
+ // console.log('applicantInput', applicantInput);
18822
18838
  if(applicantInput){
18823
18839
  if(applicantInput.className){
18824
18840
  applicantInput.className = `${applicantInput.className} inline-left`;
@@ -18997,8 +19013,7 @@ const getFlowFormSchema = async (instance, box) => {
18997
19013
  nextStepUserChangeEvents = onEvent?.nextStepUserChange?.actions || [];
18998
19014
  }
18999
19015
  // if (box == 'inbox' || box == 'draft') {
19000
- // TODO: 临时去掉 AutoOpenApproveDrawer 功能因为测试到性能问题
19001
- if ((box == 'inbox' || box == 'draft') && window.enableAutoOpenApproveDrawer) {
19016
+ if ((box == 'inbox' || box == 'draft') && !!!window.disableAutoOpenApproveDrawer) {
19002
19017
  // 滚动条滚动到底部弹出底部签批drawer窗口
19003
19018
  initedEvents.push({
19004
19019
  "actionType": "custom",
@@ -21903,6 +21918,17 @@ var widget_zh = {
21903
21918
  * @LastEditTime: 2025-08-26 10:17:05
21904
21919
  */
21905
21920
 
21921
+ const resources = {
21922
+ "en": {
21923
+ translation: en_us$1,
21924
+ 'widgets-meta': widget_en
21925
+ },
21926
+ "zh-CN": {
21927
+ translation: zh_cn$1,
21928
+ 'widgets-meta': widget_zh
21929
+ }
21930
+ };
21931
+
21906
21932
  const getUserLanguage$1 = () => {
21907
21933
  var lan = Builder.settings.context?.user?.language || Builder.settings.locale || window.navigator.language;
21908
21934
  if(lan === 'en' || lan.startsWith('en-')){
@@ -21910,15 +21936,33 @@ const getUserLanguage$1 = () => {
21910
21936
  }
21911
21937
  return lan;
21912
21938
  };
21939
+
21940
+ var locale$1 = "zh-CN";
21913
21941
  if (typeof window != 'undefined') {
21914
21942
  window.steedosI18next = i18next__namespace;
21915
- getUserLanguage$1();
21943
+ // locale = getUserLanguage();
21916
21944
  }
21917
21945
 
21918
- i18next__namespace.addResources('en', 'translation', en_us$1);
21919
- i18next__namespace.addResources('en', 'widgets-meta', widget_en);
21920
- i18next__namespace.addResources('zh-CN', 'translation', zh_cn$1);
21921
- i18next__namespace.addResources('zh-CN', 'widgets-meta', widget_zh);
21946
+ if (!i18next__namespace.isInitialized) {
21947
+ i18next__namespace
21948
+ // .use(LanguageDetector)
21949
+ .init({
21950
+ // lng: locale,
21951
+ fallbackLng: 'zh-CN',
21952
+ resources,
21953
+ }, ()=>{
21954
+ console.log("i18next initialized:", locale$1);
21955
+ // i18next.addResources('en', 'translation', en_us);
21956
+ // i18next.addResources('en', 'widgets-meta', widget_en);
21957
+ // i18next.addResources('zh-CN', 'translation', zh_cn);
21958
+ // i18next.addResources('zh-CN', 'widgets-meta', widget_zh);
21959
+ });
21960
+ } else {
21961
+ i18next__namespace.addResources('en', 'translation', en_us$1);
21962
+ i18next__namespace.addResources('en', 'widgets-meta', widget_en);
21963
+ i18next__namespace.addResources('zh-CN', 'translation', zh_cn$1);
21964
+ i18next__namespace.addResources('zh-CN', 'widgets-meta', widget_zh);
21965
+ }
21922
21966
 
21923
21967
  var asc$1 = "Asc";
21924
21968
  var cancel$1 = "Cancel";