@hzab/flowlong-designer 1.0.7-beta → 1.0.7-beta1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hzab/flowlong-designer",
3
- "version": "1.0.7-beta",
3
+ "version": "1.0.7-beta1",
4
4
  "description": "自定义审批流配置组件",
5
5
  "main": "src",
6
6
  "scripts": {
@@ -121,24 +121,31 @@ export const Approver = (props) => {
121
121
  }
122
122
 
123
123
  function onDrawerSave() {
124
- signatureConfigurationRef.current.form.validateFields().then(() => {
125
- const { extendConfig } = form;
124
+ signatureConfigurationRef.current.form.validateFields().then((res) => {
125
+ const { extendConfig = {} }: any = form;
126
+ extendConfig["confirmTxt"] = res?.extendConfig?.confirmTxt;
127
+ extendConfig["needConfirm"] = res?.extendConfig?.needConfirm;
128
+ extendConfig["needSign"] = res?.extendConfig?.needSign;
129
+ extendConfig["usePreSign"] = res?.extendConfig?.usePreSign;
126
130
  const newValue = {
127
131
  ...form,
128
132
  };
129
- if (!extendConfig.isChecked) {
130
- newValue.extendConfig.directorUsers = [];
131
- newValue.extendConfig.directorWorkAddr = false;
132
- } else {
133
- if (extendConfig.approvalEnd == 2) {
133
+ if (form.setType == "20") {
134
+ if (!extendConfig?.isChecked) {
135
+ newValue.extendConfig.directorUsers = [];
134
136
  newValue.extendConfig.directorWorkAddr = false;
135
137
  } else {
136
- newValue.extendConfig.directorWorkAddr = true;
137
- newValue.extendConfig.directorUsers = [];
138
+ if (extendConfig?.approvalEnd == 2) {
139
+ newValue.extendConfig.directorWorkAddr = false;
140
+ } else {
141
+ newValue.extendConfig.directorWorkAddr = true;
142
+ newValue.extendConfig.directorUsers = [];
143
+ }
138
144
  }
145
+ delete newValue.extendConfig?.approvalEnd;
146
+ delete newValue.extendConfig?.isChecked;
139
147
  }
140
- delete newValue.extendConfig.approvalEnd;
141
- delete newValue.extendConfig.isChecked;
148
+
142
149
  setForm(newValue);
143
150
  // 强制更新数据
144
151
  onChange && onChange(newValue);
@@ -74,12 +74,7 @@ export const Promoter = (props) => {
74
74
  signatureConfigurationRef.current.form.validateFields().then((res) => {
75
75
  const newValue = {
76
76
  ...form,
77
- extendConfig: {
78
- needSign: res?.needSign, //当前节点需要签名
79
- needConfirm: res?.needConfirm, //当前节点需要二次确认
80
- confirmTxt: res?.confirmTxt,
81
- usePreSign: res?.usePreSign,
82
- },
77
+ extendConfig: res?.extendConfig,
83
78
  };
84
79
  setForm(newValue);
85
80
  onChange && onChange({ ...newValue });
@@ -121,6 +121,23 @@ export const Approver = (props) => {
121
121
  }
122
122
 
123
123
  function onDrawerSave() {
124
+ const newValue = JSON.parse(JSON.stringify(form));
125
+ const { extendConfig } = newValue;
126
+ if (form.setType == "20") {
127
+ if (!extendConfig?.isChecked) {
128
+ newValue.extendConfig.directorUsers = [];
129
+ newValue.extendConfig.directorWorkAddr = false;
130
+ } else {
131
+ if (extendConfig?.approvalEnd == 2) {
132
+ newValue.extendConfig.directorWorkAddr = false;
133
+ } else {
134
+ newValue.extendConfig.directorWorkAddr = true;
135
+ newValue.extendConfig.directorUsers = [];
136
+ }
137
+ }
138
+ delete newValue.extendConfig?.approvalEnd;
139
+ delete newValue.extendConfig?.isChecked;
140
+ }
124
141
  // 强制更新数据
125
142
  onChange && onChange(form);
126
143
  onDrawerClose();
@@ -27,9 +27,10 @@ const SignatureConfiguration = (props: any, ref: any) => {
27
27
  form,
28
28
  };
29
29
  });
30
+
30
31
  useEffect(() => {
31
32
  if (formData?.extendConfig) {
32
- form.setFieldsValue(formData?.extendConfig);
33
+ form.setFieldValue("extendConfig", formData?.extendConfig);
33
34
  setIsSignature(formData?.extendConfig?.needSign);
34
35
  setSecondaryConfirmation(formData?.extendConfig?.needConfirm);
35
36
  } else if (type === "approver") {