@finema/finework-layer 0.2.77 → 0.2.79
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/.husky/pre-commit +1 -1
- package/.playground/app/assets/css/main.css +6 -6
- package/.playground/app/pages/layout-admin/[id]/index.vue +145 -145
- package/.playground/app/pages/layout-admin/test/[id]/index.vue +286 -286
- package/.playground/app/pages/layout-admin.vue +283 -285
- package/.playground/app/pages/layout-user.vue +284 -284
- package/.playground/app/pages/submenu/layout-admin.vue +210 -210
- package/.vscode/settings.json +5 -1
- package/CHANGELOG.md +382 -374
- package/app/app.config.ts +144 -144
- package/app/app.vue +10 -10
- package/app/assets/css/main.css +77 -77
- package/app/components/Button/ActionIcon.vue +29 -29
- package/app/components/Button/Back.vue +22 -22
- package/app/components/Format/Currency.vue +17 -17
- package/app/components/Format/Date.vue +24 -24
- package/app/components/Format/DateTime.vue +24 -24
- package/app/components/Format/Number.vue +17 -17
- package/app/components/Format/Percent.vue +38 -38
- package/app/components/Format/TimeFromNow.vue +38 -38
- package/app/components/InfoItemList.vue +196 -196
- package/app/components/Layout/Admin/Sidebar.vue +343 -329
- package/app/components/Layout/Admin/index.vue +240 -224
- package/app/components/Layout/Apps.vue +45 -45
- package/app/components/Layout/User/index.vue +102 -102
- package/app/components/Notifications/index.vue +162 -162
- package/app/components/StatusBox.vue +56 -56
- package/app/composables/useAuth.ts +207 -207
- package/app/composables/useNotification.ts +76 -76
- package/app/composables/useRequestOptions.ts +86 -86
- package/app/constants/routes.ts +86 -86
- package/app/error.vue +218 -218
- package/app/middleware/auth.ts +45 -45
- package/app/middleware/common.ts +12 -12
- package/app/middleware/guest.ts +7 -7
- package/app/middleware/permissions.ts +29 -29
- package/bun.lock +2758 -2758
- package/eslint.config.js +206 -2
- package/index.d.ts +16 -16
- package/nuxt.config.ts +41 -41
- package/package.json +38 -38
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
import type { AxiosRequestConfig } from 'axios'
|
|
2
|
-
|
|
3
|
-
export enum FileAppType {
|
|
4
|
-
COMMON = 'COMMON',
|
|
5
|
-
PMO = 'PMO',
|
|
6
|
-
HR = 'HR',
|
|
7
|
-
FINANCE = 'FINANCE',
|
|
8
|
-
QUOTATION = 'QUOTATION',
|
|
9
|
-
TODO = 'TODO',
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const useRequestOptions = () => {
|
|
13
|
-
const config = useRuntimeConfig()
|
|
14
|
-
|
|
15
|
-
const mock = (): Omit<AxiosRequestConfig, 'baseURL'> & {
|
|
16
|
-
baseURL: string
|
|
17
|
-
} => {
|
|
18
|
-
return {
|
|
19
|
-
baseURL: config.public.baseAPIMock || 'http://localhost:3000/api/mock',
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const base = (): Omit<AxiosRequestConfig, 'baseURL'> & {
|
|
24
|
-
baseURL: string
|
|
25
|
-
} => {
|
|
26
|
-
return {
|
|
27
|
-
baseURL: config.public.baseAPI,
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const auth = (): Omit<AxiosRequestConfig, 'baseURL'> & {
|
|
32
|
-
baseURL: string
|
|
33
|
-
} => {
|
|
34
|
-
return {
|
|
35
|
-
baseURL: config.public.baseAPI,
|
|
36
|
-
headers: {
|
|
37
|
-
Authorization: `Bearer ${useAuth().token.value}`,
|
|
38
|
-
},
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const file = (fileAppType: FileAppType = FileAppType.COMMON): Omit<AxiosRequestConfig, 'baseURL'> & {
|
|
43
|
-
baseURL: string
|
|
44
|
-
} => {
|
|
45
|
-
return {
|
|
46
|
-
baseURL: config.public.baseAPI + '/uploads',
|
|
47
|
-
headers: {
|
|
48
|
-
Authorization: `Bearer ${useAuth().token.value}`,
|
|
49
|
-
},
|
|
50
|
-
transformRequest: (data) => {
|
|
51
|
-
if (data instanceof FormData) {
|
|
52
|
-
data.append('app', fileAppType)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return data
|
|
56
|
-
},
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const filePublic = (fileAppType: FileAppType = FileAppType.COMMON): Omit<AxiosRequestConfig, 'baseURL'> & {
|
|
61
|
-
baseURL: string
|
|
62
|
-
} => {
|
|
63
|
-
return {
|
|
64
|
-
baseURL: config.public.baseAPI + '/uploads',
|
|
65
|
-
headers: {
|
|
66
|
-
Authorization: `Bearer ${useAuth().token.value}`,
|
|
67
|
-
},
|
|
68
|
-
transformRequest: (data) => {
|
|
69
|
-
if (data instanceof FormData) {
|
|
70
|
-
data.append('is_public', 'true')
|
|
71
|
-
data.append('app', fileAppType)
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return data
|
|
75
|
-
},
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
base,
|
|
81
|
-
mock,
|
|
82
|
-
auth,
|
|
83
|
-
file,
|
|
84
|
-
filePublic,
|
|
85
|
-
}
|
|
86
|
-
}
|
|
1
|
+
import type { AxiosRequestConfig } from 'axios'
|
|
2
|
+
|
|
3
|
+
export enum FileAppType {
|
|
4
|
+
COMMON = 'COMMON',
|
|
5
|
+
PMO = 'PMO',
|
|
6
|
+
HR = 'HR',
|
|
7
|
+
FINANCE = 'FINANCE',
|
|
8
|
+
QUOTATION = 'QUOTATION',
|
|
9
|
+
TODO = 'TODO',
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const useRequestOptions = () => {
|
|
13
|
+
const config = useRuntimeConfig()
|
|
14
|
+
|
|
15
|
+
const mock = (): Omit<AxiosRequestConfig, 'baseURL'> & {
|
|
16
|
+
baseURL: string
|
|
17
|
+
} => {
|
|
18
|
+
return {
|
|
19
|
+
baseURL: config.public.baseAPIMock || 'http://localhost:3000/api/mock',
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const base = (): Omit<AxiosRequestConfig, 'baseURL'> & {
|
|
24
|
+
baseURL: string
|
|
25
|
+
} => {
|
|
26
|
+
return {
|
|
27
|
+
baseURL: config.public.baseAPI,
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const auth = (): Omit<AxiosRequestConfig, 'baseURL'> & {
|
|
32
|
+
baseURL: string
|
|
33
|
+
} => {
|
|
34
|
+
return {
|
|
35
|
+
baseURL: config.public.baseAPI,
|
|
36
|
+
headers: {
|
|
37
|
+
Authorization: `Bearer ${useAuth().token.value}`,
|
|
38
|
+
},
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const file = (fileAppType: FileAppType = FileAppType.COMMON): Omit<AxiosRequestConfig, 'baseURL'> & {
|
|
43
|
+
baseURL: string
|
|
44
|
+
} => {
|
|
45
|
+
return {
|
|
46
|
+
baseURL: config.public.baseAPI + '/uploads',
|
|
47
|
+
headers: {
|
|
48
|
+
Authorization: `Bearer ${useAuth().token.value}`,
|
|
49
|
+
},
|
|
50
|
+
transformRequest: (data) => {
|
|
51
|
+
if (data instanceof FormData) {
|
|
52
|
+
data.append('app', fileAppType)
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return data
|
|
56
|
+
},
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const filePublic = (fileAppType: FileAppType = FileAppType.COMMON): Omit<AxiosRequestConfig, 'baseURL'> & {
|
|
61
|
+
baseURL: string
|
|
62
|
+
} => {
|
|
63
|
+
return {
|
|
64
|
+
baseURL: config.public.baseAPI + '/uploads',
|
|
65
|
+
headers: {
|
|
66
|
+
Authorization: `Bearer ${useAuth().token.value}`,
|
|
67
|
+
},
|
|
68
|
+
transformRequest: (data) => {
|
|
69
|
+
if (data instanceof FormData) {
|
|
70
|
+
data.append('is_public', 'true')
|
|
71
|
+
data.append('app', fileAppType)
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
return data
|
|
75
|
+
},
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return {
|
|
80
|
+
base,
|
|
81
|
+
mock,
|
|
82
|
+
auth,
|
|
83
|
+
file,
|
|
84
|
+
filePublic,
|
|
85
|
+
}
|
|
86
|
+
}
|
package/app/constants/routes.ts
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
export const routes = {
|
|
2
|
-
home: {
|
|
3
|
-
label: 'หน้าแรก',
|
|
4
|
-
to: '/',
|
|
5
|
-
},
|
|
6
|
-
chooseTeam: {
|
|
7
|
-
label: 'เลือกทีม',
|
|
8
|
-
to: '/choose-team',
|
|
9
|
-
},
|
|
10
|
-
login: {
|
|
11
|
-
label: 'เลือก',
|
|
12
|
-
to: '/login',
|
|
13
|
-
},
|
|
14
|
-
logout: {
|
|
15
|
-
label: 'Log out',
|
|
16
|
-
to: '/api/auth/logout',
|
|
17
|
-
},
|
|
18
|
-
releaseHistory: {
|
|
19
|
-
label: 'Release History',
|
|
20
|
-
to: '/releases',
|
|
21
|
-
icon: 'heroicons:tag',
|
|
22
|
-
},
|
|
23
|
-
account: {
|
|
24
|
-
profile: {
|
|
25
|
-
label: 'โปรไฟล์',
|
|
26
|
-
to: '/account/profile',
|
|
27
|
-
icon: 'mage:user',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
announcements: {
|
|
32
|
-
label: 'Finema Newsletter',
|
|
33
|
-
to: '/announcements',
|
|
34
|
-
icon: 'mage:announcement',
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
adminClockin: {
|
|
38
|
-
checkinDashboard: {
|
|
39
|
-
label: 'ภาพรวมเช็คอิน',
|
|
40
|
-
icon: 'mage:dashboard',
|
|
41
|
-
to: '/clockin-admin',
|
|
42
|
-
permissions: ['clockin:ADMIN'],
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
adminTimesheet: {
|
|
46
|
-
summaryReport: {
|
|
47
|
-
label: 'ภาพรวม',
|
|
48
|
-
icon: 'heroicons-outline:user-group',
|
|
49
|
-
to: '/timesheet-admin/reports/summary',
|
|
50
|
-
permissions: ['timesheet:ADMIN'],
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
admin: {
|
|
54
|
-
users: {
|
|
55
|
-
label: 'จัดการผู้ใช้งาน',
|
|
56
|
-
icon: 'hugeicons:user-circle-02',
|
|
57
|
-
to: '/admin/users',
|
|
58
|
-
// permissions: ['setting:SUPER'],
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
clockin: {
|
|
62
|
-
home: {
|
|
63
|
-
label: 'Clock-In',
|
|
64
|
-
icon: 'i-heroicons-outline:location-marker',
|
|
65
|
-
to: '/clockin',
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
timesheet: {
|
|
69
|
-
home: {
|
|
70
|
-
label: 'Timesheet',
|
|
71
|
-
icon: 'mage:dashboard',
|
|
72
|
-
to: '/timesheet',
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
pmo: {
|
|
76
|
-
project: {
|
|
77
|
-
projects: {
|
|
78
|
-
label: 'โครงการของฉัน',
|
|
79
|
-
to: '/pmo/projects',
|
|
80
|
-
icon: 'lucide:layers',
|
|
81
|
-
permissions: ['pmo:USER', 'pmo:ADMIN', 'pmo:SUPER'],
|
|
82
|
-
},
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
} as const
|
|
1
|
+
export const routes = {
|
|
2
|
+
home: {
|
|
3
|
+
label: 'หน้าแรก',
|
|
4
|
+
to: '/',
|
|
5
|
+
},
|
|
6
|
+
chooseTeam: {
|
|
7
|
+
label: 'เลือกทีม',
|
|
8
|
+
to: '/choose-team',
|
|
9
|
+
},
|
|
10
|
+
login: {
|
|
11
|
+
label: 'เลือก',
|
|
12
|
+
to: '/login',
|
|
13
|
+
},
|
|
14
|
+
logout: {
|
|
15
|
+
label: 'Log out',
|
|
16
|
+
to: '/api/auth/logout',
|
|
17
|
+
},
|
|
18
|
+
releaseHistory: {
|
|
19
|
+
label: 'Release History',
|
|
20
|
+
to: '/releases',
|
|
21
|
+
icon: 'heroicons:tag',
|
|
22
|
+
},
|
|
23
|
+
account: {
|
|
24
|
+
profile: {
|
|
25
|
+
label: 'โปรไฟล์',
|
|
26
|
+
to: '/account/profile',
|
|
27
|
+
icon: 'mage:user',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
announcements: {
|
|
32
|
+
label: 'Finema Newsletter',
|
|
33
|
+
to: '/announcements',
|
|
34
|
+
icon: 'mage:announcement',
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
adminClockin: {
|
|
38
|
+
checkinDashboard: {
|
|
39
|
+
label: 'ภาพรวมเช็คอิน',
|
|
40
|
+
icon: 'mage:dashboard',
|
|
41
|
+
to: '/clockin-admin',
|
|
42
|
+
permissions: ['clockin:ADMIN'],
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
adminTimesheet: {
|
|
46
|
+
summaryReport: {
|
|
47
|
+
label: 'ภาพรวม',
|
|
48
|
+
icon: 'heroicons-outline:user-group',
|
|
49
|
+
to: '/timesheet-admin/reports/summary',
|
|
50
|
+
permissions: ['timesheet:ADMIN'],
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
admin: {
|
|
54
|
+
users: {
|
|
55
|
+
label: 'จัดการผู้ใช้งาน',
|
|
56
|
+
icon: 'hugeicons:user-circle-02',
|
|
57
|
+
to: '/admin/users',
|
|
58
|
+
// permissions: ['setting:SUPER'],
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
clockin: {
|
|
62
|
+
home: {
|
|
63
|
+
label: 'Clock-In',
|
|
64
|
+
icon: 'i-heroicons-outline:location-marker',
|
|
65
|
+
to: '/clockin',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
timesheet: {
|
|
69
|
+
home: {
|
|
70
|
+
label: 'Timesheet',
|
|
71
|
+
icon: 'mage:dashboard',
|
|
72
|
+
to: '/timesheet',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
pmo: {
|
|
76
|
+
project: {
|
|
77
|
+
projects: {
|
|
78
|
+
label: 'โครงการของฉัน',
|
|
79
|
+
to: '/pmo/projects',
|
|
80
|
+
icon: 'lucide:layers',
|
|
81
|
+
permissions: ['pmo:USER', 'pmo:ADMIN', 'pmo:SUPER'],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
} as const
|