cat-qw-lib 0.43.20 → 0.43.21
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/fesm2022/cat-qw-lib.mjs
CHANGED
|
@@ -717,9 +717,12 @@ class BaseControlComponent {
|
|
|
717
717
|
checkUnsavedChanges() {
|
|
718
718
|
this.formStateService.selectIsFormSaved().subscribe((res) => {
|
|
719
719
|
console.log("3=> isFormSaved", res);
|
|
720
|
-
|
|
720
|
+
const hasChanges = JSON.stringify(this.initialRecord) !== JSON.stringify(this.record);
|
|
721
|
+
console.log("InitialRecord", this.initialRecord);
|
|
722
|
+
console.log("currentRecord", this.record);
|
|
723
|
+
console.log("hasChange", hasChanges);
|
|
724
|
+
if (res === false && hasChanges) {
|
|
721
725
|
console.log("4=> if false", res);
|
|
722
|
-
const hasChanges = JSON.stringify(this.initialRecord) !== JSON.stringify(this.record);
|
|
723
726
|
if (this.formStateService && hasChanges) {
|
|
724
727
|
console.log("5=> false", hasChanges);
|
|
725
728
|
this.formStateService.setShowConfirmation(hasChanges);
|
|
@@ -1333,7 +1336,7 @@ class BaseFormComponent {
|
|
|
1333
1336
|
return this.baseQuery?.getValue();
|
|
1334
1337
|
}
|
|
1335
1338
|
init() {
|
|
1336
|
-
this.formStateService.setIsFormSaved(
|
|
1339
|
+
this.formStateService.setIsFormSaved(true);
|
|
1337
1340
|
this.service.initList();
|
|
1338
1341
|
this.baseStore?.setRecordChange(SHARED.EMPTY);
|
|
1339
1342
|
let id = this.activatedRoute ? this.activatedRoute.snapshot.params[SHARED.ID] : '';
|