@hzab/flowlong-designer 1.0.7-beta2 → 1.0.7

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @hzab/flowlong-designer@1.0.7
2
2
 
3
- feat:审核人、抄送人添加直接主管配置
3
+ feat:审核人、抄送人添加直接主管配置;二次确认配置是否展示
4
4
 
5
5
  # @hzab/flowlong-designer@1.0.6
6
6
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hzab/flowlong-designer",
3
- "version": "1.0.7-beta2",
3
+ "version": "1.0.7",
4
4
  "description": "自定义审批流配置组件",
5
5
  "main": "src",
6
6
  "scripts": {
@@ -11,7 +11,7 @@ import "./index.less";
11
11
  import SignatureConfiguration from "../../components/SignatureConfiguration";
12
12
 
13
13
  export const Approver = (props) => {
14
- const { modelValue = {}, onChange, disable, readOnly } = props;
14
+ const { modelValue = {}, onChange, disable, readOnly, showSignature } = props;
15
15
  const [form, setForm] = useState({
16
16
  nodeName: "",
17
17
  setType: undefined,
@@ -37,7 +37,7 @@ export const Approver = (props) => {
37
37
 
38
38
  const selectorCtx = useContext(SelectContext);
39
39
 
40
- const formRef = useRef();
40
+ const formRef = useRef<any>();
41
41
  const nodeTitleRef = useRef();
42
42
  const signatureConfigurationRef = useRef<any>();
43
43
 
@@ -329,7 +329,15 @@ export const Approver = (props) => {
329
329
  className={`${readOnly ? "readonly-select" : ""}`}
330
330
  onChange={(e) =>
331
331
  setForm((f) => {
332
- f.extendConfig = { ...f.extendConfig, isChecked: e.target.checked };
332
+ f.extendConfig = {
333
+ ...f.extendConfig,
334
+ isChecked: e.target.checked,
335
+ directorUsers: [],
336
+ approvalEnd: undefined,
337
+ };
338
+ if (formRef?.current) {
339
+ formRef?.current?.setFieldsValue({ extendConfig: f.extendConfig });
340
+ }
333
341
  return { ...f };
334
342
  })
335
343
  }
@@ -341,7 +349,7 @@ export const Approver = (props) => {
341
349
  name={["extendConfig", "approvalEnd"]}
342
350
  >
343
351
  <Select
344
- disabled={readOnly}
352
+ disabled={readOnly || !form.extendConfig?.isChecked}
345
353
  className={`${readOnly ? "readonly-select" : ""}`}
346
354
  onSelect={(val) => {
347
355
  setForm((f) => {
@@ -581,11 +589,13 @@ export const Approver = (props) => {
581
589
  </Form.Item>
582
590
  ) : null}
583
591
  </Form>
584
- <SignatureConfiguration
585
- ref={signatureConfigurationRef}
586
- formData={form}
587
- type="approver"
588
- ></SignatureConfiguration>
592
+ {showSignature && (
593
+ <SignatureConfiguration
594
+ ref={signatureConfigurationRef}
595
+ formData={form}
596
+ type="approver"
597
+ ></SignatureConfiguration>
598
+ )}
589
599
  </Drawer>
590
600
  </div>
591
601
  </div>
@@ -10,7 +10,7 @@ import SignatureConfiguration from "../../components/SignatureConfiguration";
10
10
 
11
11
  export const Promoter = (props) => {
12
12
  const selectorCtx = useContext(SelectContext);
13
- const { modelValue: nodeConfig = {}, onChange, disable, readOnly } = props;
13
+ const { modelValue: nodeConfig = {}, onChange, disable, readOnly, showSignature } = props;
14
14
 
15
15
  const [drawer, setDrawer] = useState(false);
16
16
  const [isEditTitle, setIsEditTitle] = useState(false);
@@ -194,7 +194,9 @@ export const Promoter = (props) => {
194
194
  {!form.nodeAssigneeList || form.nodeAssigneeList?.length <= 0 ? (
195
195
  <Alert message="不指定则默认所有人都可发起此审批" type="info" />
196
196
  ) : null}
197
- <SignatureConfiguration ref={signatureConfigurationRef} formData={form}></SignatureConfiguration>
197
+ {showSignature && (
198
+ <SignatureConfiguration ref={signatureConfigurationRef} formData={form}></SignatureConfiguration>
199
+ )}
198
200
  </Drawer>
199
201
  </div>
200
202
  </div>
@@ -36,7 +36,7 @@ export const Approver = (props) => {
36
36
 
37
37
  const selectorCtx = useContext(SelectContext);
38
38
 
39
- const formRef = useRef();
39
+ const formRef = useRef<any>();
40
40
  const nodeTitleRef = useRef();
41
41
 
42
42
  function onShow() {
@@ -320,7 +320,15 @@ export const Approver = (props) => {
320
320
  disabled={readOnly}
321
321
  onChange={(e) =>
322
322
  setForm((f) => {
323
- f.extendConfig = { ...f.extendConfig, isChecked: e.target.checked };
323
+ f.extendConfig = {
324
+ ...f.extendConfig,
325
+ isChecked: e.target.checked,
326
+ directorUsers: [],
327
+ approvalEnd: undefined,
328
+ };
329
+ if (formRef?.current) {
330
+ formRef?.current?.setFieldsValue({ extendConfig: f.extendConfig });
331
+ }
324
332
  return { ...f };
325
333
  })
326
334
  }
package/src/index.tsx CHANGED
@@ -49,7 +49,17 @@ function copy(str) {
49
49
  }
50
50
 
51
51
  function FlowlongDesigner(props, ref) {
52
- const { value, flowName, roleListConfig, listConfig, initiatorListConfig, isShowJson, disable, readOnly } = props;
52
+ const {
53
+ value,
54
+ flowName,
55
+ roleListConfig,
56
+ listConfig,
57
+ initiatorListConfig,
58
+ isShowJson,
59
+ disable,
60
+ readOnly,
61
+ showSignature,
62
+ } = props;
53
63
  const [drawer, setDrawer] = useState(false);
54
64
  const [zoom, setZoom] = useState(1);
55
65
  const [data, setData] = useState(Object.keys(value || {}).length > 0 ? value : getInitNodeData({ name: flowName }));
@@ -131,6 +141,7 @@ function FlowlongDesigner(props, ref) {
131
141
  modelValue={data.nodeConfig}
132
142
  disable={disable}
133
143
  readOnly={readOnly}
144
+ showSignature={showSignature}
134
145
  onChange={(val) => {
135
146
  setData((d) => {
136
147
  d.nodeConfig = val;