hl-core 0.0.10-beta.4 → 0.0.10-beta.40
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/README.md +0 -2
- package/api/base.api.ts +331 -191
- package/api/interceptors.ts +3 -5
- package/components/Complex/TextBlock.vue +2 -0
- package/components/Dialog/Dialog.vue +7 -1
- package/components/Dialog/FamilyDialog.vue +2 -0
- package/components/Form/DigitalDocument.vue +52 -0
- package/components/Form/DynamicForm.vue +1 -0
- package/components/Form/FormData.vue +1 -0
- package/components/Form/ManagerAttachment.vue +17 -8
- package/components/Form/ProductConditionsBlock.vue +12 -6
- package/components/Input/Datepicker.vue +5 -0
- package/components/Input/DynamicInput.vue +2 -0
- package/components/Input/FormInput.vue +7 -0
- package/components/Input/OtpInput.vue +25 -0
- package/components/Input/PanelInput.vue +1 -0
- package/components/Input/RoundedInput.vue +4 -0
- package/components/Input/RoundedSelect.vue +4 -0
- package/components/Input/SwitchInput.vue +2 -0
- package/components/Input/TextAreaField.vue +71 -0
- package/components/Input/TextInput.vue +2 -0
- package/components/Layout/Drawer.vue +2 -0
- package/components/Menu/MenuNav.vue +1 -1
- package/components/Pages/Anketa.vue +168 -169
- package/components/Pages/Auth.vue +2 -0
- package/components/Pages/ContragentForm.vue +2 -1
- package/components/Pages/Documents.vue +432 -59
- package/components/Pages/MemberForm.vue +334 -160
- package/components/Pages/ProductConditions.vue +800 -226
- package/components/Panel/PanelHandler.vue +280 -121
- package/components/Transitions/Animation.vue +2 -0
- package/components/Utilities/Chip.vue +3 -1
- package/components/Utilities/JsonViewer.vue +1 -2
- package/composables/classes.ts +133 -49
- package/composables/constants.ts +43 -0
- package/composables/fields.ts +6 -4
- package/composables/index.ts +293 -7
- package/composables/styles.ts +8 -24
- package/configs/pwa.ts +1 -7
- package/layouts/clear.vue +1 -1
- package/layouts/default.vue +1 -1
- package/layouts/full.vue +1 -1
- package/locales/ru.json +79 -19
- package/nuxt.config.ts +10 -13
- package/package.json +12 -12
- package/plugins/head.ts +2 -1
- package/store/data.store.ts +765 -530
- package/store/member.store.ts +18 -6
- package/store/rules.ts +22 -2
- package/types/enum.ts +32 -2
- package/types/env.d.ts +2 -2
- package/types/form.ts +71 -74
- package/types/index.ts +921 -873
package/composables/index.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { useDisplay } from 'vuetify';
|
|
2
|
-
import jwt_decode from 'jwt-decode';
|
|
2
|
+
import { jwtDecode as jwt_decode } from 'jwt-decode';
|
|
3
3
|
import { XMLParser } from 'fast-xml-parser';
|
|
4
4
|
import { AxiosError } from 'axios';
|
|
5
5
|
import { DocumentReaderApi, Scenario, TextFieldType, LCID } from '@regulaforensics/document-reader-webclient';
|
|
6
|
-
import { PolicyholderClass } from '../composables/classes';
|
|
6
|
+
import { PolicyholderClass, Value, User } from '../composables/classes';
|
|
7
|
+
import type { EnvModes, NestedKeyOf, Projects, ResponseStructure, Utils } from '../types';
|
|
8
|
+
import { Roles, Statuses } from '../types/enum';
|
|
7
9
|
|
|
8
10
|
export const useEnv = () => {
|
|
9
11
|
return {
|
|
@@ -16,7 +18,8 @@ export const useEnv = () => {
|
|
|
16
18
|
|
|
17
19
|
export class Masks {
|
|
18
20
|
numbers: string = '#*';
|
|
19
|
-
otp: string = '
|
|
21
|
+
otp: string = '####';
|
|
22
|
+
otpSixDigit: string = '######';
|
|
20
23
|
spacedNumbers: string = '### ### ### ### ### ### ###';
|
|
21
24
|
iin: string = '###-###-###-###';
|
|
22
25
|
phone: string = '+7 (7##) ### ## ##';
|
|
@@ -86,6 +89,29 @@ export const reformatDate = (date: string) => {
|
|
|
86
89
|
}
|
|
87
90
|
};
|
|
88
91
|
|
|
92
|
+
export const reformatDateWithHours = (date: string) => {
|
|
93
|
+
if (date) {
|
|
94
|
+
const data = new Date(date);
|
|
95
|
+
let day: string | number = data.getDate();
|
|
96
|
+
let month: string | number = data.getMonth() + 1;
|
|
97
|
+
let hour: string | number = data.getHours();
|
|
98
|
+
let minute: string | number = data.getMinutes();
|
|
99
|
+
if (month < 10) {
|
|
100
|
+
month = '0' + month;
|
|
101
|
+
}
|
|
102
|
+
if (day < 10) {
|
|
103
|
+
day = '0' + day;
|
|
104
|
+
}
|
|
105
|
+
if (minute < 10) {
|
|
106
|
+
minute = '0' + minute;
|
|
107
|
+
}
|
|
108
|
+
const year = data.getFullYear();
|
|
109
|
+
return `${day}.${month}.${year} - ${hour}:${minute}`;
|
|
110
|
+
} else {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
|
|
89
115
|
export const reformatIin = (iin: string) => {
|
|
90
116
|
if (!!iin) {
|
|
91
117
|
const matched = iin.match(/.{1,3}/g);
|
|
@@ -101,13 +127,22 @@ export const formatPhone = (phone: string) => {
|
|
|
101
127
|
|
|
102
128
|
export const cleanWhiteSpace = (str: string) => String(str).replace(/\s+/g, '');
|
|
103
129
|
|
|
104
|
-
export const jwtDecode = (token
|
|
105
|
-
if (token) return jwt_decode(token);
|
|
130
|
+
export const jwtDecode = (token?: string | null) => {
|
|
131
|
+
if (token) return jwt_decode<Utils.JwtToken>(token);
|
|
106
132
|
else return null;
|
|
107
133
|
};
|
|
108
134
|
|
|
109
135
|
export const isValidToken = (token: string) => {
|
|
110
|
-
|
|
136
|
+
try {
|
|
137
|
+
if (token) {
|
|
138
|
+
const decoded = jwtDecode(token);
|
|
139
|
+
return !!decoded && (new Date(Number(decoded.exp) * 1000).getTime() - Date.now()) / 1000 > 0;
|
|
140
|
+
}
|
|
141
|
+
return false;
|
|
142
|
+
} catch (err) {
|
|
143
|
+
console.log(err);
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
111
146
|
};
|
|
112
147
|
|
|
113
148
|
export const isValidGUID = (value: string) => {
|
|
@@ -146,8 +181,16 @@ export const parseProcents = (val: string | number) => (val ? Number(((val as nu
|
|
|
146
181
|
|
|
147
182
|
export const formatProcents = (val: string | number) => (val ? Number(((val as number) / 100).toFixed(2)) : Number(val));
|
|
148
183
|
|
|
184
|
+
export const formatSpacedNumber = (val: any) => ((!isNaN(val) && val !== null) || typeof val === 'string' ? Number(String(val).replace(/\s/g, '')) : 0);
|
|
185
|
+
|
|
149
186
|
export const sanitizeURL = (text: string) => (text ? text.replace(/\r?\n|\r|\\|"/g, '') : '');
|
|
150
187
|
|
|
188
|
+
export const sanitize = (text: string) =>
|
|
189
|
+
String(text)
|
|
190
|
+
.replace(/\r?\n|\r/g, '')
|
|
191
|
+
.replace(/\\/g, '')
|
|
192
|
+
.replace(/"/g, '');
|
|
193
|
+
|
|
151
194
|
export const yearEnding = (number: number, titles: string[], cases: number[]) => {
|
|
152
195
|
return titles[number % 100 > 4 && number % 100 < 20 ? 2 : cases[number % 10 < 5 ? number % 10 : 5]];
|
|
153
196
|
};
|
|
@@ -273,6 +316,7 @@ export const setAddressBeneficiary = (whichIndex: number, sameAddress: boolean)
|
|
|
273
316
|
if (beneficiary.id === 0) {
|
|
274
317
|
beneficiary.registrationCity = new Value();
|
|
275
318
|
beneficiary.registrationCountry = new Value();
|
|
319
|
+
beneficiary.birthPlace = new Value();
|
|
276
320
|
beneficiary.registrationMicroDistrict = '';
|
|
277
321
|
beneficiary.registrationNumberApartment = '';
|
|
278
322
|
beneficiary.registrationNumberApartment = '';
|
|
@@ -295,6 +339,13 @@ export const setAddressBeneficiary = (whichIndex: number, sameAddress: boolean)
|
|
|
295
339
|
const city = dataStore.cities.find(i => i.nameRu === cityName.replace('г.', ''));
|
|
296
340
|
beneficiary.registrationCity = city ?? new Value();
|
|
297
341
|
}
|
|
342
|
+
const contragentData = beneficiary.response.contragent;
|
|
343
|
+
if (contragentData) {
|
|
344
|
+
const country = dataStore.countries.find((i: Value) => i.nameRu?.match(new RegExp(contragentData.birthPlace, 'i')));
|
|
345
|
+
beneficiary.birthPlace = country ?? new Value();
|
|
346
|
+
} else {
|
|
347
|
+
beneficiary.birthPlace = new Value();
|
|
348
|
+
}
|
|
298
349
|
const province = dataStore.states.find(i => i.ids === benAddress[0].stateCode);
|
|
299
350
|
const localityType = dataStore.localityTypes.find(i => i.nameRu === benAddress[0].cityTypeName);
|
|
300
351
|
const region = dataStore.regions.find(i => i.ids == benAddress[0].regionCode);
|
|
@@ -332,6 +383,7 @@ export const setAddressInsured = (whichIndex: number, sameAddress: boolean) => {
|
|
|
332
383
|
if (insured.id === 0) {
|
|
333
384
|
insured.registrationCity = new Value();
|
|
334
385
|
insured.registrationCountry = new Value();
|
|
386
|
+
insured.birthPlace = new Value();
|
|
335
387
|
insured.registrationMicroDistrict = '';
|
|
336
388
|
insured.registrationNumberApartment = '';
|
|
337
389
|
insured.registrationNumberApartment = '';
|
|
@@ -354,6 +406,13 @@ export const setAddressInsured = (whichIndex: number, sameAddress: boolean) => {
|
|
|
354
406
|
const city = dataStore.cities.find(i => i.nameRu === cityName.replace('г.', ''));
|
|
355
407
|
insured.registrationCity = city ?? new Value();
|
|
356
408
|
}
|
|
409
|
+
const contragentData = insured.response.contragent;
|
|
410
|
+
if (contragentData) {
|
|
411
|
+
const country = dataStore.countries.find((i: Value) => i.nameRu?.match(new RegExp(contragentData.birthPlace, 'i')));
|
|
412
|
+
insured.birthPlace = country ?? new Value();
|
|
413
|
+
} else {
|
|
414
|
+
insured.birthPlace = new Value();
|
|
415
|
+
}
|
|
357
416
|
const province = dataStore.states.find(i => i.ids === benAddress[0].stateCode);
|
|
358
417
|
const localityType = dataStore.localityTypes.find(i => i.nameRu === benAddress[0].cityTypeName);
|
|
359
418
|
const region = dataStore.regions.find(i => i.ids == benAddress[0].regionCode);
|
|
@@ -473,7 +532,7 @@ export const getStrValuePerEnv = (which: WhichValuePerEnv) => {
|
|
|
473
532
|
test: 'http://aml-dev.halyklife.nb/api',
|
|
474
533
|
},
|
|
475
534
|
};
|
|
476
|
-
return valuesPerEnv[which][import.meta.env.VITE_MODE];
|
|
535
|
+
return valuesPerEnv[which][import.meta.env.VITE_MODE as EnvModes];
|
|
477
536
|
};
|
|
478
537
|
|
|
479
538
|
export const getMainPageRoute = () => {
|
|
@@ -609,3 +668,230 @@ export const isEveryFormDisabled = (isDisabledForm: any) => {
|
|
|
609
668
|
};
|
|
610
669
|
|
|
611
670
|
export class ApiError extends AxiosError<any, any> {}
|
|
671
|
+
|
|
672
|
+
export class ProcessController {
|
|
673
|
+
isProcessEditable = (statusCode?: keyof typeof Statuses) => {
|
|
674
|
+
const getEditibleStatuses = () => {
|
|
675
|
+
const defaultStatuses = constants.editableStatuses;
|
|
676
|
+
return defaultStatuses;
|
|
677
|
+
};
|
|
678
|
+
return !!getEditibleStatuses().find(status => status === statusCode);
|
|
679
|
+
};
|
|
680
|
+
isProcessReturnable = (statusCode?: keyof typeof Statuses) => {
|
|
681
|
+
const getReturnableStatuses = () => {
|
|
682
|
+
const defaultStatuses = constants.returnStatementStatuses;
|
|
683
|
+
return defaultStatuses;
|
|
684
|
+
};
|
|
685
|
+
return !!getReturnableStatuses().find(status => status === statusCode);
|
|
686
|
+
};
|
|
687
|
+
isProcessCancel = (statusCode?: keyof typeof Statuses) => {
|
|
688
|
+
const getCanceleStatuses = () => {
|
|
689
|
+
const defaultStatuses = constants.cancelApplicationStatuses;
|
|
690
|
+
return defaultStatuses;
|
|
691
|
+
};
|
|
692
|
+
return !!getCanceleStatuses().find(status => status === statusCode);
|
|
693
|
+
};
|
|
694
|
+
isProcessReject = (statusCode?: keyof typeof Statuses) => {
|
|
695
|
+
const getRejectStatuses = () => {
|
|
696
|
+
const defaultStatuses = constants.rejectApplicationStatuses;
|
|
697
|
+
return defaultStatuses;
|
|
698
|
+
};
|
|
699
|
+
return !!getRejectStatuses().find(status => status === statusCode);
|
|
700
|
+
};
|
|
701
|
+
}
|
|
702
|
+
|
|
703
|
+
export class RoleController {
|
|
704
|
+
user: User = new User();
|
|
705
|
+
|
|
706
|
+
isRole = (whichRole: keyof typeof Roles) => {
|
|
707
|
+
if (this.user.roles.length === 0) {
|
|
708
|
+
const token = localStorage.getItem('accessToken') || null;
|
|
709
|
+
if (token) {
|
|
710
|
+
const decoded = jwtDecode(token);
|
|
711
|
+
if (decoded) {
|
|
712
|
+
this.user.id = String(decoded.sub);
|
|
713
|
+
this.user.fullName = `${decoded.lastName} ${decoded.firstName} ${decoded.middleName ?? ''}`;
|
|
714
|
+
this.user.code = decoded.code;
|
|
715
|
+
this.user.branchCode = decoded.branchCode;
|
|
716
|
+
const key = getKeyWithPattern(decoded, 'role');
|
|
717
|
+
if (key) {
|
|
718
|
+
const roles = decoded[key as keyof Utils.JwtToken];
|
|
719
|
+
if (typeof roles === 'string') {
|
|
720
|
+
this.user.roles.push(roles);
|
|
721
|
+
} else if (typeof roles === 'object') {
|
|
722
|
+
this.user.roles = roles;
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
return !!this.user.roles.find(i => i === whichRole);
|
|
729
|
+
};
|
|
730
|
+
isInitiator = (productFromExternal?: string) => {
|
|
731
|
+
const env = useEnv();
|
|
732
|
+
const dataStore = useDataStore();
|
|
733
|
+
const hasAccessByProduct = (() => {
|
|
734
|
+
const product = productFromExternal as Projects;
|
|
735
|
+
if (dataStore.isLifetrip || product === 'lifetrip') return this.isBranchDirector();
|
|
736
|
+
if (dataStore.isPension || product === 'pensionannuitynew') return this.isBranchDirector();
|
|
737
|
+
if (dataStore.isLifeBusiness || product === 'lifebusiness') return this.isHeadManager() || this.isBranchDirector();
|
|
738
|
+
return false;
|
|
739
|
+
})();
|
|
740
|
+
return this.isManager() || this.isAgent() || this.isAgentMycar() || this.isManagerHalykBank() || this.isServiceManager() || this.isAgentAuletti() || hasAccessByProduct;
|
|
741
|
+
};
|
|
742
|
+
isManager = () => {
|
|
743
|
+
return this.isRole(constants.roles.Manager);
|
|
744
|
+
};
|
|
745
|
+
isCompliance = () => {
|
|
746
|
+
return this.isRole(constants.roles.Compliance);
|
|
747
|
+
};
|
|
748
|
+
isAdmin = () => {
|
|
749
|
+
return this.isRole(constants.roles.Admin);
|
|
750
|
+
};
|
|
751
|
+
isJurist = () => {
|
|
752
|
+
return this.isRole(constants.roles.Jurist);
|
|
753
|
+
};
|
|
754
|
+
isAgent = () => {
|
|
755
|
+
return this.isRole(constants.roles.Agent);
|
|
756
|
+
};
|
|
757
|
+
isManagerHalykBank = () => {
|
|
758
|
+
return this.isRole(constants.roles.ManagerHalykBank);
|
|
759
|
+
};
|
|
760
|
+
isServiceManager = () => {
|
|
761
|
+
return this.isRole(constants.roles.ServiceManager);
|
|
762
|
+
};
|
|
763
|
+
isUSNSsanctioner = () => {
|
|
764
|
+
return this.isRole(constants.roles.USNSsanctioner);
|
|
765
|
+
};
|
|
766
|
+
isUnderwriter = () => {
|
|
767
|
+
return this.isRole(constants.roles.Underwriter);
|
|
768
|
+
};
|
|
769
|
+
isActuary = () => {
|
|
770
|
+
return this.isRole(constants.roles.Actuary);
|
|
771
|
+
};
|
|
772
|
+
isAgentMycar = () => {
|
|
773
|
+
return this.isRole(constants.roles.AgentMycar);
|
|
774
|
+
};
|
|
775
|
+
isAgentAuletti = () => {
|
|
776
|
+
return this.isRole(constants.roles.AgentAuletti);
|
|
777
|
+
};
|
|
778
|
+
isManagerAuletti = () => {
|
|
779
|
+
return this.isRole(constants.roles.ManagerAuletti);
|
|
780
|
+
};
|
|
781
|
+
isAnalyst = () => {
|
|
782
|
+
return this.isRole(constants.roles.Analyst);
|
|
783
|
+
};
|
|
784
|
+
isUpk = () => {
|
|
785
|
+
return this.isRole(constants.roles.UPK);
|
|
786
|
+
};
|
|
787
|
+
isUrp = () => {
|
|
788
|
+
return this.isRole(constants.roles.URP);
|
|
789
|
+
};
|
|
790
|
+
isUsns = () => {
|
|
791
|
+
return this.isRole(constants.roles.USNS);
|
|
792
|
+
};
|
|
793
|
+
isAccountant = () => {
|
|
794
|
+
return this.isRole(constants.roles.Accountant);
|
|
795
|
+
};
|
|
796
|
+
isDrn = () => {
|
|
797
|
+
return this.isRole(constants.roles.DRNSJ);
|
|
798
|
+
};
|
|
799
|
+
isSupport = () => {
|
|
800
|
+
return this.isRole(constants.roles.Support);
|
|
801
|
+
};
|
|
802
|
+
isFinCenter = () => {
|
|
803
|
+
return this.isRole(constants.roles.FinCenter);
|
|
804
|
+
};
|
|
805
|
+
isSupervisor = () => {
|
|
806
|
+
return this.isRole(constants.roles.Supervisor);
|
|
807
|
+
};
|
|
808
|
+
isHeadManager = () => {
|
|
809
|
+
return this.isRole(constants.roles.HeadManager);
|
|
810
|
+
};
|
|
811
|
+
isBranchDirector = () => {
|
|
812
|
+
return this.isRole(constants.roles.BranchDirector);
|
|
813
|
+
};
|
|
814
|
+
isUSNSACCINS = () => {
|
|
815
|
+
return this.isRole(constants.roles.USNSACCINS);
|
|
816
|
+
};
|
|
817
|
+
isDsuio = () => {
|
|
818
|
+
return this.isRole(constants.roles.Dsuio);
|
|
819
|
+
};
|
|
820
|
+
isHeadDso = () => {
|
|
821
|
+
return this.isRole(constants.roles.HEADDSO);
|
|
822
|
+
};
|
|
823
|
+
isAdjuster = () => {
|
|
824
|
+
return this.isRole(constants.roles.SettlementLosses);
|
|
825
|
+
};
|
|
826
|
+
isHeadAdjuster = () => {
|
|
827
|
+
return this.isRole(constants.roles.HeadSettlementLosses);
|
|
828
|
+
};
|
|
829
|
+
isDsoDirector = () => {
|
|
830
|
+
return this.isRole(constants.roles.DsoDirector);
|
|
831
|
+
};
|
|
832
|
+
isArchivist = () => {
|
|
833
|
+
return this.isRole(constants.roles.Archivist);
|
|
834
|
+
};
|
|
835
|
+
isAccountantDirector = () => {
|
|
836
|
+
return this.isRole(constants.roles.AccountantDirector);
|
|
837
|
+
};
|
|
838
|
+
isHeadOfDso = () => {
|
|
839
|
+
return this.isRole(constants.roles.HeadOfDso);
|
|
840
|
+
};
|
|
841
|
+
isUrsp = () => {
|
|
842
|
+
return this.isRole(constants.roles.URSP);
|
|
843
|
+
};
|
|
844
|
+
hasAccess = () => {
|
|
845
|
+
const baseAccessRoles = this.isAdmin() || this.isSupport() || this.isAnalyst() || this.isDrn();
|
|
846
|
+
return {
|
|
847
|
+
invoiceInfo: this.isAdmin() || this.isSupport(),
|
|
848
|
+
toLKA: this.isAgent() || this.isManagerHalykBank() || baseAccessRoles,
|
|
849
|
+
toAML: this.isCompliance() || baseAccessRoles,
|
|
850
|
+
toAULETTI: this.isAgentAuletti() || this.isManagerAuletti() || baseAccessRoles,
|
|
851
|
+
toLKA_A: this.isAgentAuletti() || baseAccessRoles,
|
|
852
|
+
toUU: this.isServiceManager() || this.isAccountant() || this.isAdjuster() || this.isHeadAdjuster() || baseAccessRoles,
|
|
853
|
+
toDSO:
|
|
854
|
+
this.isDsuio() ||
|
|
855
|
+
this.isActuary() ||
|
|
856
|
+
this.isHeadOfDso() ||
|
|
857
|
+
this.isAccountant() ||
|
|
858
|
+
this.isUSNSACCINS() ||
|
|
859
|
+
this.isDsoDirector() ||
|
|
860
|
+
this.isServiceManager() ||
|
|
861
|
+
this.isUSNSsanctioner() ||
|
|
862
|
+
this.isAccountantDirector() ||
|
|
863
|
+
baseAccessRoles,
|
|
864
|
+
toEFO:
|
|
865
|
+
this.isManager() ||
|
|
866
|
+
this.isAgent() ||
|
|
867
|
+
this.isAgentMycar() ||
|
|
868
|
+
this.isManagerHalykBank() ||
|
|
869
|
+
this.isHeadManager() ||
|
|
870
|
+
this.isServiceManager() ||
|
|
871
|
+
this.isUSNSsanctioner() ||
|
|
872
|
+
this.isUnderwriter() ||
|
|
873
|
+
this.isActuary() ||
|
|
874
|
+
this.isAdmin() ||
|
|
875
|
+
this.isCompliance() ||
|
|
876
|
+
this.isAnalyst() ||
|
|
877
|
+
this.isUpk() ||
|
|
878
|
+
this.isFinCenter() ||
|
|
879
|
+
this.isSupervisor() ||
|
|
880
|
+
this.isSupport() ||
|
|
881
|
+
this.isDrn() ||
|
|
882
|
+
this.isUrp() ||
|
|
883
|
+
this.isUsns() ||
|
|
884
|
+
this.isJurist() ||
|
|
885
|
+
this.isAccountant() ||
|
|
886
|
+
this.isBranchDirector() ||
|
|
887
|
+
this.isUSNSACCINS() ||
|
|
888
|
+
this.isDsuio() ||
|
|
889
|
+
this.isAdjuster() ||
|
|
890
|
+
this.isDsoDirector() ||
|
|
891
|
+
this.isAccountantDirector() ||
|
|
892
|
+
this.isHeadAdjuster() ||
|
|
893
|
+
this.isHeadOfDso() ||
|
|
894
|
+
this.isUrsp(),
|
|
895
|
+
};
|
|
896
|
+
};
|
|
897
|
+
}
|
package/composables/styles.ts
CHANGED
|
@@ -15,24 +15,13 @@ export class Styles {
|
|
|
15
15
|
blueTextLight: string = 'text-[#F3F6FC]';
|
|
16
16
|
|
|
17
17
|
// Green
|
|
18
|
-
greenBg: string =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
: 'bg-[#009C73]';
|
|
22
|
-
greenBgHover: string =
|
|
23
|
-
import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' || import.meta.env.VITE_PRODUCT === 'lka-auletti'
|
|
24
|
-
? 'bg-[#C19B5F]'
|
|
25
|
-
: 'hover:bg-[#00a277]';
|
|
26
|
-
greenBgLight: string =
|
|
27
|
-
import.meta.env.VITE_PRODUCT === 'auletti' || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' || import.meta.env.VITE_PRODUCT === 'lka-auletti'
|
|
28
|
-
? 'bg-[#e8d2af]'
|
|
29
|
-
: 'bg-[#EAF6EF]';
|
|
18
|
+
greenBg: string = String(import.meta.env.VITE_PRODUCT).includes('auletti') || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' ? 'bg-[#DEBE8C]' : 'bg-[#009C73]';
|
|
19
|
+
greenBgHover: string = String(import.meta.env.VITE_PRODUCT).includes('auletti') || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' ? 'bg-[#C19B5F]' : 'hover:bg-[#00a277]';
|
|
20
|
+
greenBgLight: string = String(import.meta.env.VITE_PRODUCT).includes('auletti') || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' ? 'bg-[#e8d2af]' : 'bg-[#EAF6EF]';
|
|
30
21
|
greenText: string = '!text-[#009C73]';
|
|
31
22
|
greenTextHover: string = 'hover:text-[#009C73]';
|
|
32
23
|
greenBgLightHover: string =
|
|
33
|
-
import.meta.env.VITE_PRODUCT
|
|
34
|
-
? 'hover:bg-[#efdfc6]'
|
|
35
|
-
: 'hover:bg-[#dbf0e4]';
|
|
24
|
+
String(import.meta.env.VITE_PRODUCT).includes('auletti') || import.meta.env.VITE_PARENT_PRODUCT === 'auletti' ? 'hover:bg-[#efdfc6]' : 'hover:bg-[#dbf0e4]';
|
|
36
25
|
|
|
37
26
|
// Yellow
|
|
38
27
|
yellowText: string = '!text-[#FAB31C]';
|
|
@@ -65,7 +54,7 @@ export class Styles {
|
|
|
65
54
|
blueBorder: string = 'border-[1px] border-[#A0B3D8]';
|
|
66
55
|
blueLightBorder: string = 'border-[1px] border-[#F3F6FC]';
|
|
67
56
|
greenBorder: string =
|
|
68
|
-
import.meta.env.VITE_PRODUCT
|
|
57
|
+
String(import.meta.env.VITE_PRODUCT).includes('auletti') || import.meta.env.VITE_PARENT_PRODUCT === 'auletti'
|
|
69
58
|
? 'border-[1px] border-[#DEBE8C]'
|
|
70
59
|
: 'border-[1px] border-[#009C73]';
|
|
71
60
|
redBorder: string = 'border-[1px] border-[#FD2D39]';
|
|
@@ -91,9 +80,9 @@ export class Styles {
|
|
|
91
80
|
greenLightBtn: string;
|
|
92
81
|
|
|
93
82
|
// Complex
|
|
94
|
-
flexColNav: string;
|
|
95
|
-
emptyBlockCol: string;
|
|
96
|
-
scrollPage: string;
|
|
83
|
+
flexColNav: string = 'flex flex-col gap-[10px] px-2 pt-[14px]';
|
|
84
|
+
emptyBlockCol: string = 'w-[60px] sm:w-[100px] h-[30%] rounded-[8px] bg-[#f5f5f5]';
|
|
85
|
+
scrollPage: string = 'max-h-[85svh] overflow-y-scroll';
|
|
97
86
|
flexCenter: string = 'flex items-center justify-center';
|
|
98
87
|
|
|
99
88
|
// Muted or disabled
|
|
@@ -111,11 +100,6 @@ export class Styles {
|
|
|
111
100
|
this.whiteBorderBtn = ` ${this.blackText} ${this.textTitle} ${this.rounded} w-full ${this.blueLightBgHover} border-[#A0B3D8] border-[1px]`;
|
|
112
101
|
this.blueLightBtn = `${this.blueBgLight} ${this.greyTextLight} ${this.textTitle} ${this.rounded} w-full ${this.blueBgLightHover}`;
|
|
113
102
|
this.greenLightBtn = `${this.greenBgLight} ${this.greenText} ${this.textTitle} ${this.rounded} w-full ${this.greenBgLightHover}`;
|
|
114
|
-
|
|
115
|
-
// Complex
|
|
116
|
-
this.flexColNav = 'flex flex-col gap-[10px] px-2 pt-[14px]';
|
|
117
|
-
this.emptyBlockCol = 'w-[60px] sm:w-[100px] h-[30%] rounded-[8px] bg-[#f5f5f5]';
|
|
118
|
-
this.scrollPage = 'max-h-[85svh] overflow-y-scroll';
|
|
119
103
|
}
|
|
120
104
|
}
|
|
121
105
|
|
package/configs/pwa.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { ModuleOptions } from '@vite-pwa/nuxt';
|
|
|
3
3
|
export const pwaBaseConfig: Partial<ModuleOptions> = {
|
|
4
4
|
registerType: 'autoUpdate',
|
|
5
5
|
workbox: {
|
|
6
|
-
globPatterns: ['**/*.{js,css,html,txt,png,ico,svg}'],
|
|
6
|
+
globPatterns: ['**/*.{js,css,html,txt,png,ico,svg,json}'],
|
|
7
7
|
navigateFallbackDenylist: [/^\/api\//],
|
|
8
8
|
navigateFallback: '/',
|
|
9
9
|
cleanupOutdatedCaches: true,
|
|
@@ -54,10 +54,4 @@ export const pwaBaseConfig: Partial<ModuleOptions> = {
|
|
|
54
54
|
},
|
|
55
55
|
registerWebManifestInRouteRules: true,
|
|
56
56
|
writePlugin: true,
|
|
57
|
-
devOptions: {
|
|
58
|
-
enabled: true,
|
|
59
|
-
suppressWarnings: true,
|
|
60
|
-
navigateFallback: '/',
|
|
61
|
-
type: 'module',
|
|
62
|
-
},
|
|
63
57
|
};
|
package/layouts/clear.vue
CHANGED
|
@@ -8,7 +8,7 @@ const { $pwa } = useNuxtApp();
|
|
|
8
8
|
|
|
9
9
|
const onInit = async () => {
|
|
10
10
|
const projectConfig = dataStore.projectConfig;
|
|
11
|
-
if (
|
|
11
|
+
if (process.env.NODE_ENV === 'production' && $pwa && projectConfig === null) {
|
|
12
12
|
const hasConfig = await dataStore.getProjectConfig();
|
|
13
13
|
if (hasConfig === true) {
|
|
14
14
|
const commitVersion = String(import.meta.env.VITE_COMMIT_VERSION);
|
package/layouts/default.vue
CHANGED
|
@@ -52,7 +52,7 @@ const onBack = async (item: MenuItem) => {
|
|
|
52
52
|
|
|
53
53
|
const onInit = async () => {
|
|
54
54
|
const projectConfig = dataStore.projectConfig;
|
|
55
|
-
if (
|
|
55
|
+
if (process.env.NODE_ENV === 'production' && $pwa && projectConfig === null) {
|
|
56
56
|
const hasConfig = await dataStore.getProjectConfig();
|
|
57
57
|
if (hasConfig === true) {
|
|
58
58
|
const commitVersion = String(import.meta.env.VITE_COMMIT_VERSION);
|
package/layouts/full.vue
CHANGED
|
@@ -11,7 +11,7 @@ const { $pwa } = useNuxtApp();
|
|
|
11
11
|
|
|
12
12
|
const onInit = async () => {
|
|
13
13
|
const projectConfig = dataStore.projectConfig;
|
|
14
|
-
if (
|
|
14
|
+
if (process.env.NODE_ENV === 'production' && $pwa && projectConfig === null) {
|
|
15
15
|
const hasConfig = await dataStore.getProjectConfig();
|
|
16
16
|
if (hasConfig === true) {
|
|
17
17
|
const commitVersion = String(import.meta.env.VITE_COMMIT_VERSION);
|