antd-management-fast-develop 1.1.167 → 1.1.168

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": "antd-management-fast-develop",
3
- "version": "1.1.167",
3
+ "version": "1.1.168",
4
4
  "description": "",
5
5
  "license": "ISC",
6
6
  "author": "",
@@ -7,7 +7,9 @@ const {
7
7
  promptSuccess,
8
8
  promptWarn,
9
9
  promptEmptyLine,
10
+ readJsonFileSync,
10
11
  writeJsonFileSync,
12
+ checkStringIsEmpty,
11
13
  } = require('easy-soft-develop');
12
14
 
13
15
  const configDefined = {
@@ -590,6 +592,22 @@ function generateConfigCore({
590
592
  }) {
591
593
  const listResult = [];
592
594
 
595
+ const filePath = `${path}/../${fileName}`;
596
+
597
+ let listOriginal = [];
598
+
599
+ try {
600
+ let dataSource = readJsonFileSync(filePath);
601
+
602
+ if (Array.isArray(dataSource.list)) {
603
+ listOriginal = dataSource.list;
604
+ }
605
+ } catch (error_) {
606
+ // ignore
607
+
608
+ console.log(error_);
609
+ }
610
+
593
611
  for (const o of list) {
594
612
  const judgeResult = judgeCallback(o);
595
613
 
@@ -599,21 +617,61 @@ function generateConfigCore({
599
617
 
600
618
  const { folder, model, key } = o;
601
619
 
602
- listResult.push(
603
- buildCallback({
604
- mainFolder,
605
- folder,
606
- model,
607
- key,
608
- }),
609
- );
620
+ const data = buildCallback({
621
+ mainFolder,
622
+ folder,
623
+ model,
624
+ key,
625
+ });
626
+
627
+ const { folder: folderAdjust, fileName: fileNameAdjust } = {
628
+ folder: '',
629
+ fileName: '',
630
+ ...data,
631
+ };
632
+
633
+ const listOriginalFilter = [];
634
+
635
+ for (const one of listOriginal) {
636
+ const { folder: folderItem, fileName: fileNameItem } = {
637
+ folder: '',
638
+ fileName: '',
639
+ ...one,
640
+ };
641
+
642
+ if (
643
+ !checkStringIsEmpty(folderItem) &&
644
+ !checkStringIsEmpty(fileNameItem) &&
645
+ folderItem === folderAdjust &&
646
+ fileNameItem === fileNameAdjust
647
+ ) {
648
+ listOriginalFilter.push(one);
649
+ }
650
+ }
651
+
652
+ if (listOriginalFilter.length > 0) {
653
+ const first = listOriginalFilter[0];
654
+
655
+ const { visibleFlag: visibleFlagAdjust } = {
656
+ visibleFlag: '',
657
+ ...first,
658
+ };
659
+
660
+ console.log({ filePath, listOriginal, listOriginalFilter });
661
+
662
+ if (!checkStringIsEmpty(visibleFlagAdjust)) {
663
+ data.visibleFlag = visibleFlagAdjust;
664
+ }
665
+ }
666
+
667
+ listResult.push(data);
610
668
  }
611
669
 
612
670
  const result = {};
613
671
 
614
672
  result.list = listResult;
615
673
 
616
- writeJsonFileSync(`${path}/../${fileName}`, result, {
674
+ writeJsonFileSync(filePath, result, {
617
675
  coverFile: true,
618
676
  });
619
677