wad-lab 1.1.5 → 1.1.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/bin/index.js +30 -3
- package/package.json +1 -1
- package/templates/fullstack-springboot-vue/backend/src/main/java/com/example/company/controller/CompanyController.java +88 -74
- package/templates/fullstack-springboot-vue/backend/src/main/java/com/example/company/model/Employee.java +73 -73
- package/templates/fullstack-springboot-vue/backend/src/main/java/com/example/company/service/CompanyService.java +90 -60
- package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/App.vue +429 -405
- package/templates/fullstack-springboot-vue/frontend/vue-axios-interceptor/src/App.vue +177 -159
- package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/App.vue +441 -427
- package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/stores/companyStore.js +126 -96
- package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/src/App.vue +84 -69
- package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/src/components/DepartmentSection.vue +164 -152
- package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/src/components/EmployeeSection.vue +193 -181
- package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia-props/src/stores/companyStore.js +126 -35
- package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/App.vue +191 -167
- package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/components/DepartmentForm.vue +98 -98
- package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/components/DepartmentList.vue +92 -91
- package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/components/EmployeeForm.vue +128 -128
- package/templates/fullstack-springboot-vue/frontend/vue-axios-props-emits/src/components/EmployeeList.vue +95 -94
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/App.vue +90 -90
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/AddEmployeeView.vue +247 -247
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/DepartmentView.vue +296 -273
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/EmployeeView.vue +219 -196
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/HomeDashboardView.vue +263 -263
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/DepartmentListView.vue +250 -231
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/EmployeeDetailView.vue +181 -159
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/EmployeeListView.vue +315 -295
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/stores/companyStore.js +137 -70
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/views/DepartmentView.vue +229 -209
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/views/EmployeeView.vue +257 -237
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/components/EntityTable.vue +106 -92
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/stores/companyStore.js +139 -84
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/views/ManageDepartmentsView.vue +73 -64
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia-props/src/views/ManageEmployeesView.vue +76 -67
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/App.vue +59 -59
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/components/DataCard.vue +72 -53
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/views/DepartmentPage.vue +89 -77
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-props/src/views/EmployeePage.vue +128 -116
- package/templates/springboot-2model-1controller-api/src/main/java/com/example/company/controller/CompanyController.java +88 -74
- package/templates/springboot-2model-1controller-api/src/main/java/com/example/company/model/Employee.java +73 -73
- package/templates/springboot-2model-1controller-api/src/main/java/com/example/company/service/CompanyService.java +90 -60
- package/templates/springboot-course-registration/src/main/java/com/example/coursereg/controller/CourseController.java +46 -42
- package/templates/springboot-course-registration/src/main/java/com/example/coursereg/service/CourseService.java +70 -60
- package/templates/springboot-hospital-api/src/main/java/com/example/hospital/controller/HospitalController.java +54 -50
- package/templates/springboot-hospital-api/src/main/java/com/example/hospital/service/HospitalService.java +65 -54
- package/templates/springboot-library-api/src/main/java/com/example/library/controller/LibraryController.java +57 -51
- package/templates/springboot-library-api/src/main/java/com/example/library/service/LibraryService.java +70 -60
- package/templates/springboot-mockmvc/src/main/java/com/example/mockmvc/controller/ItemController.java +45 -41
- package/templates/springboot-mockmvc/src/main/java/com/example/mockmvc/service/ItemService.java +48 -38
- package/templates/springboot-mongo-aggregation/src/main/java/com/example/aggregation/controller/ItemController.java +45 -41
- package/templates/springboot-mongo-aggregation/src/main/java/com/example/aggregation/service/ItemService.java +48 -38
- package/templates/springboot-mongo-aggregation-mockmvc/src/main/java/com/example/aggmockmvc/controller/ItemController.java +45 -41
- package/templates/springboot-mongo-aggregation-mockmvc/src/main/java/com/example/aggmockmvc/service/ItemService.java +48 -38
- package/templates/springboot-mongo-crud/src/main/java/com/example/crud/controller/ItemController.java +45 -41
- package/templates/springboot-mongo-crud/src/main/java/com/example/crud/service/ItemService.java +48 -38
- package/templates/vue-axios/src/App.vue +264 -243
- package/templates/vue-axios/src/services/ItemService.js +27 -21
- package/templates/vue-axios-basic/src/App.vue +429 -405
- package/templates/vue-axios-interceptor/src/App.vue +177 -159
- package/templates/vue-axios-pinia/src/App.vue +441 -427
- package/templates/vue-axios-pinia/src/stores/companyStore.js +126 -96
- package/templates/vue-axios-pinia-props/src/App.vue +84 -69
- package/templates/vue-axios-pinia-props/src/components/DepartmentSection.vue +164 -152
- package/templates/vue-axios-pinia-props/src/components/EmployeeSection.vue +193 -181
- package/templates/vue-axios-pinia-props/src/stores/companyStore.js +126 -35
- package/templates/vue-axios-props-emits/src/App.vue +191 -167
- package/templates/vue-axios-props-emits/src/components/DepartmentForm.vue +98 -98
- package/templates/vue-axios-props-emits/src/components/DepartmentList.vue +92 -91
- package/templates/vue-axios-props-emits/src/components/EmployeeForm.vue +128 -128
- package/templates/vue-axios-props-emits/src/components/EmployeeList.vue +95 -94
- package/templates/vue-axios-router/src/App.vue +90 -90
- package/templates/vue-axios-router/src/views/AddEmployeeView.vue +247 -247
- package/templates/vue-axios-router/src/views/DepartmentView.vue +296 -273
- package/templates/vue-axios-router/src/views/EmployeeView.vue +219 -196
- package/templates/vue-axios-router/src/views/HomeDashboardView.vue +263 -263
- package/templates/vue-axios-router-children/src/views/DepartmentListView.vue +250 -231
- package/templates/vue-axios-router-children/src/views/EmployeeDetailView.vue +181 -159
- package/templates/vue-axios-router-children/src/views/EmployeeListView.vue +315 -295
- package/templates/vue-axios-router-pinia/src/stores/companyStore.js +137 -70
- package/templates/vue-axios-router-pinia/src/views/DepartmentView.vue +229 -209
- package/templates/vue-axios-router-pinia/src/views/EmployeeView.vue +257 -237
- package/templates/vue-axios-router-pinia-props/src/components/EntityTable.vue +106 -92
- package/templates/vue-axios-router-pinia-props/src/stores/companyStore.js +139 -84
- package/templates/vue-axios-router-pinia-props/src/views/ManageDepartmentsView.vue +73 -64
- package/templates/vue-axios-router-pinia-props/src/views/ManageEmployeesView.vue +76 -67
- package/templates/vue-axios-router-props/src/App.vue +59 -59
- package/templates/vue-axios-router-props/src/components/DataCard.vue +72 -53
- package/templates/vue-axios-router-props/src/views/DepartmentPage.vue +89 -77
- package/templates/vue-axios-router-props/src/views/EmployeePage.vue +128 -116
- package/templates/vue-fetch/src/App.vue +285 -259
- package/templates/vue-router-pinia-springboot/backend/src/main/java/com/example/crud/controller/ItemController.java +45 -41
- package/templates/vue-router-pinia-springboot/backend/src/main/java/com/example/crud/service/ItemService.java +45 -35
- package/templates/vue-router-pinia-springboot/frontend/src/services/ItemService.js +24 -21
- package/templates/vue-router-pinia-springboot/frontend/src/stores/itemStore.js +42 -37
- package/templates/vue-router-pinia-springboot/frontend/src/views/ListView.vue +76 -67
- package/templates/vue-springboot-mongo-aggregation/backend/src/main/java/com/example/aggregation/controller/ItemController.java +45 -41
- package/templates/vue-springboot-mongo-aggregation/backend/src/main/java/com/example/aggregation/service/ItemService.java +45 -35
- package/templates/vue-springboot-mongo-crud/backend/src/main/java/com/example/crud/controller/ItemController.java +45 -41
- package/templates/vue-springboot-mongo-crud/backend/src/main/java/com/example/crud/service/ItemService.java +45 -35
- package/templates/vue-springboot-mongo-crud/frontend/src/App.vue +158 -149
- package/templates/vue-springboot-mongo-crud/frontend/src/services/ItemService.js +24 -21
|
@@ -1,159 +1,181 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="employee-detail-page">
|
|
3
|
-
<div class="header-actions">
|
|
4
|
-
<router-link to="/company/employees" class="btn btn-secondary">← Back to Employees</router-link>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
<span class="detail-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
<span class="detail-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<span class="detail-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
</
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
import {
|
|
44
|
-
import
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
.
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
color: #
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="employee-detail-page">
|
|
3
|
+
<div class="header-actions">
|
|
4
|
+
<router-link to="/company/employees" class="btn btn-secondary">← Back to Employees</router-link>
|
|
5
|
+
<button @click="handleQuickPatchSalary" class="btn btn-warning">Quick Patch Salary</button>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<div v-if="loading" class="card">
|
|
9
|
+
<p>Loading employee details...</p>
|
|
10
|
+
</div>
|
|
11
|
+
|
|
12
|
+
<div v-else-if="error" class="card error-card">
|
|
13
|
+
<p>{{ error }}</p>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<div v-else-if="employee" class="card detail-card">
|
|
17
|
+
<header class="detail-header">
|
|
18
|
+
<h1>{{ employee.name }}</h1>
|
|
19
|
+
<span class="badge">ID: {{ employee.id }}</span>
|
|
20
|
+
</header>
|
|
21
|
+
|
|
22
|
+
<div class="detail-grid">
|
|
23
|
+
<div class="detail-item">
|
|
24
|
+
<span class="detail-label">Email Address</span>
|
|
25
|
+
<span class="detail-value">{{ employee.email }}</span>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<div class="detail-item">
|
|
29
|
+
<span class="detail-label">Department ID</span>
|
|
30
|
+
<span class="detail-value">{{ employee.departmentId }}</span>
|
|
31
|
+
</div>
|
|
32
|
+
|
|
33
|
+
<div class="detail-item">
|
|
34
|
+
<span class="detail-label">Salary</span>
|
|
35
|
+
<span class="detail-value">${{ Number(employee.salary).toLocaleString() }}</span>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<script setup>
|
|
43
|
+
import { ref, onMounted } from 'vue'
|
|
44
|
+
import { useRoute } from 'vue-router'
|
|
45
|
+
import api from '../services/api'
|
|
46
|
+
|
|
47
|
+
const route = useRoute()
|
|
48
|
+
const employee = ref(null)
|
|
49
|
+
const loading = ref(true)
|
|
50
|
+
const error = ref('')
|
|
51
|
+
|
|
52
|
+
const fetchEmployee = async () => {
|
|
53
|
+
const id = route.params.id
|
|
54
|
+
loading.value = true
|
|
55
|
+
error.value = ''
|
|
56
|
+
try {
|
|
57
|
+
const res = await api.get(`/employees/${id}`)
|
|
58
|
+
employee.value = res.data
|
|
59
|
+
} catch (err) {
|
|
60
|
+
error.value = 'Failed to load employee details.'
|
|
61
|
+
} finally {
|
|
62
|
+
loading.value = false
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const handleQuickPatchSalary = async () => {
|
|
67
|
+
if (!employee.value) return
|
|
68
|
+
const id = route.params.id
|
|
69
|
+
const salary = prompt('New salary:', employee.value.salary)
|
|
70
|
+
if (salary !== null && salary !== '') {
|
|
71
|
+
try {
|
|
72
|
+
await api.patch(`/employees/${id}`, { salary: Number(salary) })
|
|
73
|
+
await fetchEmployee()
|
|
74
|
+
} catch (err) {
|
|
75
|
+
error.value = 'Failed to patch employee salary.'
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
onMounted(() => {
|
|
81
|
+
fetchEmployee()
|
|
82
|
+
})
|
|
83
|
+
</script>
|
|
84
|
+
|
|
85
|
+
<style scoped>
|
|
86
|
+
.employee-detail-page {
|
|
87
|
+
max-width: 650px;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.header-actions {
|
|
91
|
+
display: flex;
|
|
92
|
+
gap: 12px;
|
|
93
|
+
margin-bottom: 20px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.btn {
|
|
97
|
+
padding: 8px 16px;
|
|
98
|
+
border: none;
|
|
99
|
+
border-radius: 6px;
|
|
100
|
+
cursor: pointer;
|
|
101
|
+
font-weight: 500;
|
|
102
|
+
text-decoration: none;
|
|
103
|
+
display: inline-flex;
|
|
104
|
+
align-items: center;
|
|
105
|
+
transition: opacity 0.2s;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.btn:hover {
|
|
109
|
+
opacity: 0.9;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.btn-secondary {
|
|
113
|
+
background-color: #64748b;
|
|
114
|
+
color: #ffffff;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.btn-warning {
|
|
118
|
+
background-color: #f59e0b;
|
|
119
|
+
color: #ffffff;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.card {
|
|
123
|
+
background: #ffffff;
|
|
124
|
+
padding: 28px;
|
|
125
|
+
border-radius: 8px;
|
|
126
|
+
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.error-card {
|
|
130
|
+
color: #ef4444;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
.detail-header {
|
|
134
|
+
display: flex;
|
|
135
|
+
align-items: center;
|
|
136
|
+
justify-content: space-between;
|
|
137
|
+
border-bottom: 1px solid #e2e8f0;
|
|
138
|
+
padding-bottom: 16px;
|
|
139
|
+
margin-bottom: 20px;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.detail-header h1 {
|
|
143
|
+
font-size: 1.5rem;
|
|
144
|
+
color: #1e293b;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.badge {
|
|
148
|
+
background-color: #e2e8f0;
|
|
149
|
+
color: #475569;
|
|
150
|
+
font-size: 0.85rem;
|
|
151
|
+
font-weight: 600;
|
|
152
|
+
padding: 4px 10px;
|
|
153
|
+
border-radius: 20px;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.detail-grid {
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
gap: 16px;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.detail-item {
|
|
163
|
+
display: flex;
|
|
164
|
+
flex-direction: column;
|
|
165
|
+
gap: 4px;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.detail-label {
|
|
169
|
+
font-size: 0.85rem;
|
|
170
|
+
color: #64748b;
|
|
171
|
+
font-weight: 500;
|
|
172
|
+
text-transform: uppercase;
|
|
173
|
+
letter-spacing: 0.05em;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.detail-value {
|
|
177
|
+
font-size: 1.1rem;
|
|
178
|
+
color: #0f172a;
|
|
179
|
+
font-weight: 600;
|
|
180
|
+
}
|
|
181
|
+
</style>
|