wad-lab 1.2.2 → 1.2.4
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 +477 -627
- package/package.json +1 -1
- package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/App.vue +241 -429
- package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/components/ItemFormModal.vue +183 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/components/ItemPatchModal.vue +193 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-basic/src/components/ItemTable.vue +177 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/App.vue +150 -441
- package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/components/ItemFormModal.vue +207 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/components/ItemStats.vue +64 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-pinia/src/components/ItemTable.vue +195 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/App.vue +41 -90
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/components/ItemFormModal.vue +173 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/components/ItemTable.vue +102 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/components/NavBar.vue +57 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/DepartmentView.vue +132 -296
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router/src/views/EmployeeView.vue +126 -219
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/components/ItemDetail.vue +115 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/components/ItemTable.vue +104 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/components/SideBar.vue +59 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/CompanyLayout.vue +2 -51
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/DepartmentListView.vue +92 -250
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/EmployeeDetailView.vue +59 -181
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-children/src/views/EmployeeListView.vue +67 -315
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/App.vue +19 -70
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/components/ItemFormModal.vue +173 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/components/ItemPatchModal.vue +144 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/components/ItemTable.vue +102 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/components/NavBar.vue +53 -0
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/views/DepartmentView.vue +107 -229
- package/templates/fullstack-springboot-vue/frontend/vue-axios-router-pinia/src/views/EmployeeView.vue +143 -257
- package/templates/game-bingo/script.js +1 -1
- package/templates/game-memory-cards/script.js +2 -2
- package/templates/game-rock-paper-scissors/index.html +3 -3
- package/templates/game-rock-paper-scissors/script.js +2 -2
- package/templates/game-tic-tac-toe/script.js +2 -2
- package/templates/game-whack-a-mole/index.html +9 -9
- package/templates/servlet-basic/WEB-INF/ItemServlet.java +13 -0
- package/templates/servlet-basic/WEB-INF/classes/ItemServlet.class +0 -0
- package/templates/servlet-flow/WEB-INF/HelloServlet.java +34 -25
- package/templates/servlet-flow/WEB-INF/classes/HelloServlet.class +0 -0
- package/templates/servlet-jdbc/WEB-INF/JdbcItemServlet.java +13 -0
- package/templates/servlet-jdbc/WEB-INF/classes/JdbcItemServlet.class +0 -0
- package/templates/snippets/mongo-queries-cheatsheet.txt +105 -0
- package/templates/springboot-2model-aggregation-join/.mvn/wrapper/maven-wrapper.properties +3 -0
- package/templates/springboot-2model-aggregation-join/mvnw +295 -0
- package/templates/springboot-2model-aggregation-join/mvnw.cmd +189 -0
- package/templates/springboot-2model-aggregation-join/pom.xml +54 -0
- package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/AggregationApplication.java +11 -0
- package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/controller/DepartmentController.java +65 -0
- package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/controller/EmployeeController.java +65 -0
- package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/dto/DepartmentStatsDTO.java +15 -0
- package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/dto/EmployeeJoinDTO.java +19 -0
- package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/model/Department.java +20 -0
- package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/model/Employee.java +21 -0
- package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/repository/DepartmentRepository.java +9 -0
- package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/repository/EmployeeRepository.java +9 -0
- package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/service/DepartmentService.java +81 -0
- package/templates/springboot-2model-aggregation-join/src/main/java/com/example/aggregation/service/EmployeeService.java +80 -0
- package/templates/springboot-2model-aggregation-join/src/main/resources/application.properties +2 -0
- package/templates/springboot-2model-aggregation-join/src/test/java/com/example/aggregation/AggregationApplicationTests.java +13 -0
- package/templates/vue-2model-crud-patch/README.md +64 -0
- package/templates/vue-2model-crud-patch/index.html +12 -0
- package/templates/vue-2model-crud-patch/package-lock.json +1785 -0
- package/templates/vue-2model-crud-patch/package.json +21 -0
- package/templates/vue-2model-crud-patch/src/App.vue +63 -0
- package/templates/vue-2model-crud-patch/src/components/AnalyticsBoard.vue +291 -0
- package/templates/vue-2model-crud-patch/src/components/DepartmentFormModal.vue +138 -0
- package/templates/vue-2model-crud-patch/src/components/DepartmentPatchModal.vue +210 -0
- package/templates/vue-2model-crud-patch/src/components/DepartmentTable.vue +133 -0
- package/templates/vue-2model-crud-patch/src/components/EmployeeFormModal.vue +177 -0
- package/templates/vue-2model-crud-patch/src/components/EmployeePatchModal.vue +221 -0
- package/templates/vue-2model-crud-patch/src/components/EmployeeTable.vue +171 -0
- package/templates/vue-2model-crud-patch/src/components/NavBar.vue +156 -0
- package/templates/vue-2model-crud-patch/src/main.js +12 -0
- package/templates/vue-2model-crud-patch/src/router/index.js +33 -0
- package/templates/vue-2model-crud-patch/src/services/api.js +64 -0
- package/templates/vue-2model-crud-patch/src/stores/departmentStore.js +149 -0
- package/templates/vue-2model-crud-patch/src/stores/employeeStore.js +143 -0
- package/templates/vue-2model-crud-patch/src/style.css +415 -0
- package/templates/vue-2model-crud-patch/src/views/AnalyticsView.vue +59 -0
- package/templates/vue-2model-crud-patch/src/views/DepartmentsView.vue +135 -0
- package/templates/vue-2model-crud-patch/src/views/EmployeesView.vue +143 -0
- package/templates/vue-2model-crud-patch/vite.config.js +9 -0
- package/templates/vue-axios/src/App.vue +255 -264
- package/templates/vue-axios/src/components/ItemFormModal.vue +183 -0
- package/templates/vue-axios/src/components/ItemPatchModal.vue +193 -0
- package/templates/vue-axios/src/components/ItemTable.vue +177 -0
- package/templates/vue-axios-basic/src/App.vue +241 -429
- package/templates/vue-axios-basic/src/components/ItemFormModal.vue +183 -0
- package/templates/vue-axios-basic/src/components/ItemPatchModal.vue +193 -0
- package/templates/vue-axios-basic/src/components/ItemTable.vue +177 -0
- package/templates/vue-axios-pinia/src/App.vue +150 -441
- package/templates/vue-axios-pinia/src/components/ItemFormModal.vue +207 -0
- package/templates/vue-axios-pinia/src/components/ItemStats.vue +64 -0
- package/templates/vue-axios-pinia/src/components/ItemTable.vue +195 -0
- package/templates/vue-axios-router/src/App.vue +41 -90
- package/templates/vue-axios-router/src/components/ItemFormModal.vue +173 -0
- package/templates/vue-axios-router/src/components/ItemTable.vue +102 -0
- package/templates/vue-axios-router/src/components/NavBar.vue +57 -0
- package/templates/vue-axios-router/src/views/DepartmentView.vue +132 -296
- package/templates/vue-axios-router/src/views/EmployeeView.vue +126 -219
- package/templates/vue-axios-router-children/src/components/ItemDetail.vue +115 -0
- package/templates/vue-axios-router-children/src/components/ItemTable.vue +104 -0
- package/templates/vue-axios-router-children/src/components/SideBar.vue +59 -0
- package/templates/vue-axios-router-children/src/views/CompanyLayout.vue +2 -51
- package/templates/vue-axios-router-children/src/views/DepartmentListView.vue +92 -250
- package/templates/vue-axios-router-children/src/views/EmployeeDetailView.vue +59 -181
- package/templates/vue-axios-router-children/src/views/EmployeeListView.vue +67 -315
- package/templates/vue-axios-router-pinia/src/App.vue +19 -70
- package/templates/vue-axios-router-pinia/src/components/ItemFormModal.vue +173 -0
- package/templates/vue-axios-router-pinia/src/components/ItemPatchModal.vue +144 -0
- package/templates/vue-axios-router-pinia/src/components/ItemTable.vue +102 -0
- package/templates/vue-axios-router-pinia/src/components/NavBar.vue +53 -0
- package/templates/vue-axios-router-pinia/src/views/DepartmentView.vue +107 -229
- package/templates/vue-axios-router-pinia/src/views/EmployeeView.vue +143 -257
- package/templates/vue-banking-app/src/components/AccountOverview.vue +75 -0
- package/templates/vue-banking-app/src/components/TransactionForm.vue +89 -0
- package/templates/vue-banking-app/src/components/TransactionTable.vue +113 -0
- package/templates/vue-banking-app/src/stores/bankStore.js +16 -3
- package/templates/vue-banking-app/src/views/DashboardView.vue +23 -71
- package/templates/vue-banking-app/src/views/StatementView.vue +11 -158
- package/templates/vue-banking-app/src/views/TransactionFormView.vue +23 -121
- package/templates/vue-basics/src/App.vue +105 -76
- package/templates/vue-basics/src/components/CounterCard.vue +107 -0
- package/templates/vue-basics/src/components/ItemList.vue +99 -0
- package/templates/vue-basics/src/components/UserForm.vue +138 -0
- package/templates/vue-cart-router-pinia/src/components/CartSummary.vue +139 -0
- package/templates/vue-cart-router-pinia/src/components/CheckoutModal.vue +149 -0
- package/templates/vue-cart-router-pinia/src/components/ProductCard.vue +63 -0
- package/templates/vue-cart-router-pinia/src/stores/cartStore.js +11 -0
- package/templates/vue-cart-router-pinia/src/views/CartView.vue +52 -118
- package/templates/vue-cart-router-pinia/src/views/CheckoutView.vue +2 -5
- package/templates/vue-cart-router-pinia/src/views/ProductCatalogView.vue +20 -56
- package/templates/vue-employee-system/src/App.vue +75 -344
- package/templates/vue-employee-system/src/components/DepartmentFilter.vue +108 -0
- package/templates/vue-employee-system/src/components/EmployeeModal.vue +183 -0
- package/templates/vue-employee-system/src/components/EmployeeTable.vue +91 -0
- package/templates/vue-employee-system/src/stores/employeeStore.js +12 -0
- package/templates/vue-fetch/src/App.vue +261 -285
- package/templates/vue-fetch/src/components/FetchFormModal.vue +183 -0
- package/templates/vue-fetch/src/components/FetchPatchModal.vue +193 -0
- package/templates/vue-fetch/src/components/FetchTable.vue +177 -0
- package/templates/vue-food-ordering/src/components/CartSummary.vue +134 -0
- package/templates/vue-food-ordering/src/components/FoodMenu.vue +126 -0
- package/templates/vue-food-ordering/src/components/OrderModal.vue +150 -0
- package/templates/vue-food-ordering/src/views/MenuView.vue +11 -132
- package/templates/vue-food-ordering/src/views/OrderCartView.vue +31 -164
- package/templates/vue-game-rps/src/App.vue +29 -88
- package/templates/vue-game-tictactoe/src/App.vue +23 -53
- package/templates/vue-game-whackamole/src/App.vue +44 -63
- package/templates/vue-hospital-portal/src/components/AppointmentForm.vue +144 -0
- package/templates/vue-hospital-portal/src/components/DoctorCard.vue +73 -0
- package/templates/vue-hospital-portal/src/components/PatientTable.vue +123 -0
- package/templates/vue-hospital-portal/src/stores/hospitalStore.js +10 -1
- package/templates/vue-hospital-portal/src/views/OPDRegistrationView.vue +40 -416
- package/templates/vue-hospital-portal/src/views/PatientListView.vue +11 -301
- package/templates/vue-library-system/src/components/BookForm.vue +125 -0
- package/templates/vue-library-system/src/components/BookTable.vue +112 -0
- package/templates/vue-library-system/src/components/BorrowModal.vue +131 -0
- package/templates/vue-library-system/src/stores/libraryStore.js +26 -1
- package/templates/vue-library-system/src/views/BookCatalogView.vue +34 -415
- package/templates/vue-memory-game/src/App.vue +36 -40
- package/templates/vue-memory-game/src/stores/memoryStore.js +32 -37
- package/templates/vue-router/src/App.vue +24 -14
- package/templates/vue-router/src/components/AboutCard.vue +38 -0
- package/templates/vue-router/src/components/HomeHero.vue +75 -0
- package/templates/vue-router/src/components/NavBar.vue +54 -0
- package/templates/vue-router/src/views/ItemsLayout.vue +17 -9
- package/templates/vue-router/src/views/ListView.vue +106 -18
- package/templates/vue-router-pinia/src/App.vue +24 -14
- package/templates/vue-router-pinia/src/components/ItemFormModal.vue +163 -0
- package/templates/vue-router-pinia/src/components/ItemTable.vue +90 -0
- package/templates/vue-router-pinia/src/components/NavBar.vue +54 -0
- package/templates/vue-router-pinia/src/stores/itemStore.js +8 -1
- package/templates/vue-router-pinia/src/views/ListView.vue +78 -14
- package/templates/vue-router-pinia-springboot/frontend/src/App.vue +25 -8
- package/templates/vue-router-pinia-springboot/frontend/src/components/ItemFormModal.vue +183 -0
- package/templates/vue-router-pinia-springboot/frontend/src/components/ItemPatchModal.vue +193 -0
- package/templates/vue-router-pinia-springboot/frontend/src/components/ItemTable.vue +177 -0
- package/templates/vue-router-pinia-springboot/frontend/src/components/NavBar.vue +54 -0
- package/templates/vue-router-pinia-springboot/frontend/src/views/ListView.vue +92 -76
- package/templates/vue-springboot-mongo-aggregation/frontend/src/App.vue +184 -193
- package/templates/vue-springboot-mongo-aggregation/frontend/src/components/AnalyticsCards.vue +56 -0
- package/templates/vue-springboot-mongo-aggregation/frontend/src/components/CategorySummaryTable.vue +71 -0
- package/templates/vue-springboot-mongo-aggregation/frontend/src/components/ItemTable.vue +114 -0
- package/templates/vue-springboot-mongo-crud/frontend/src/App.vue +228 -158
- package/templates/vue-springboot-mongo-crud/frontend/src/components/ItemFormModal.vue +183 -0
- package/templates/vue-springboot-mongo-crud/frontend/src/components/ItemPatchModal.vue +193 -0
- package/templates/vue-springboot-mongo-crud/frontend/src/components/ItemTable.vue +177 -0
- package/templates/vue-symposium-system/src/App.vue +41 -256
- package/templates/vue-symposium-system/src/components/AttendeeTable.vue +100 -0
- package/templates/vue-symposium-system/src/components/EventCard.vue +67 -0
- package/templates/vue-symposium-system/src/components/RegistrationForm.vue +118 -0
- package/templates/vue-symposium-system/src/stores/symposiumStore.js +10 -0
- package/templates/vue-todo-pinia/src/App.vue +40 -138
- package/templates/vue-todo-pinia/src/components/TodoFilter.vue +74 -0
- package/templates/vue-todo-pinia/src/components/TodoInput.vue +53 -0
- package/templates/vue-todo-pinia/src/components/TodoList.vue +101 -0
- package/templates/vue-todo-pinia/src/stores/todoStore.js +6 -0
- package/templates/vue-todo-router/src/App.vue +5 -36
- package/templates/vue-todo-router/src/components/TodoForm.vue +78 -0
- package/templates/vue-todo-router/src/components/TodoList.vue +84 -0
- package/templates/vue-todo-router/src/components/TodoNavBar.vue +47 -0
- package/templates/vue-todo-router/src/data/todoState.js +7 -0
- package/templates/vue-todo-router/src/views/AddTodoView.vue +7 -66
- package/templates/vue-todo-router/src/views/TodoDetailView.vue +15 -1
- package/templates/vue-todo-router/src/views/TodoListView.vue +22 -64
|
@@ -1,257 +1,143 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
margin-bottom: 24px;
|
|
145
|
-
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
.card h3 {
|
|
149
|
-
font-size: 16px;
|
|
150
|
-
margin-bottom: 16px;
|
|
151
|
-
color: #333333;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.form {
|
|
155
|
-
display: flex;
|
|
156
|
-
flex-direction: column;
|
|
157
|
-
gap: 12px;
|
|
158
|
-
max-width: 400px;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
.form-group {
|
|
162
|
-
display: flex;
|
|
163
|
-
flex-direction: column;
|
|
164
|
-
gap: 4px;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
.form-group label {
|
|
168
|
-
font-size: 13px;
|
|
169
|
-
font-weight: 600;
|
|
170
|
-
color: #444444;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
.form-group input,
|
|
174
|
-
.form-group select {
|
|
175
|
-
padding: 8px 10px;
|
|
176
|
-
border: 1px solid #cccccc;
|
|
177
|
-
border-radius: 4px;
|
|
178
|
-
font-size: 14px;
|
|
179
|
-
background-color: #ffffff;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
.form-group input:focus,
|
|
183
|
-
.form-group select:focus {
|
|
184
|
-
outline: none;
|
|
185
|
-
border-color: #0066cc;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
.btn {
|
|
189
|
-
padding: 8px 14px;
|
|
190
|
-
border: none;
|
|
191
|
-
border-radius: 4px;
|
|
192
|
-
cursor: pointer;
|
|
193
|
-
font-size: 13px;
|
|
194
|
-
font-weight: 600;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.btn-primary {
|
|
198
|
-
background-color: #0066cc;
|
|
199
|
-
color: #ffffff;
|
|
200
|
-
align-self: flex-start;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
.btn-primary:hover {
|
|
204
|
-
background-color: #0052a3;
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
.btn-danger {
|
|
208
|
-
background-color: #d9383a;
|
|
209
|
-
color: #ffffff;
|
|
210
|
-
padding: 4px 8px;
|
|
211
|
-
font-size: 12px;
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
.btn-danger:hover {
|
|
215
|
-
background-color: #b8282a;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
.btn-warning {
|
|
219
|
-
background-color: #f0ad4e;
|
|
220
|
-
color: #ffffff;
|
|
221
|
-
padding: 4px 8px;
|
|
222
|
-
font-size: 12px;
|
|
223
|
-
margin-right: 6px;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
.btn-warning:hover {
|
|
227
|
-
background-color: #ec971f;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
.table-wrapper {
|
|
231
|
-
overflow-x: auto;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
table {
|
|
235
|
-
width: 100%;
|
|
236
|
-
border-collapse: collapse;
|
|
237
|
-
font-size: 13px;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
th, td {
|
|
241
|
-
text-align: left;
|
|
242
|
-
padding: 8px 10px;
|
|
243
|
-
border-bottom: 1px solid #eeeeee;
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
th {
|
|
247
|
-
background-color: #fafbfc;
|
|
248
|
-
color: #555555;
|
|
249
|
-
font-weight: 600;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
.empty {
|
|
253
|
-
text-align: center;
|
|
254
|
-
color: #888888;
|
|
255
|
-
padding: 16px;
|
|
256
|
-
}
|
|
257
|
-
</style>
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, onMounted } from 'vue'
|
|
3
|
+
import { useCompanyStore } from '../stores/companyStore'
|
|
4
|
+
import ItemTable from '../components/ItemTable.vue'
|
|
5
|
+
import ItemFormModal from '../components/ItemFormModal.vue'
|
|
6
|
+
import ItemPatchModal from '../components/ItemPatchModal.vue'
|
|
7
|
+
|
|
8
|
+
const store = useCompanyStore()
|
|
9
|
+
const isFormModalOpen = ref(false)
|
|
10
|
+
const isPatchModalOpen = ref(false)
|
|
11
|
+
const selectedEmp = ref(null)
|
|
12
|
+
|
|
13
|
+
const columns = [
|
|
14
|
+
{ key: 'id', label: 'ID' },
|
|
15
|
+
{ key: 'name', label: 'Name' },
|
|
16
|
+
{ key: 'email', label: 'Email' },
|
|
17
|
+
{
|
|
18
|
+
key: 'departmentId',
|
|
19
|
+
label: 'Department',
|
|
20
|
+
format: (val) => {
|
|
21
|
+
const dept = store.departments.find(d => d.id === val)
|
|
22
|
+
return dept ? dept.name : (val ? 'Dept #' + val : 'N/A')
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
key: 'salary',
|
|
27
|
+
label: 'Salary',
|
|
28
|
+
format: (val) => '$' + Number(val || 0).toLocaleString()
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
|
|
32
|
+
const formFields = ref([])
|
|
33
|
+
|
|
34
|
+
function prepareFormFields() {
|
|
35
|
+
formFields.value = [
|
|
36
|
+
{ key: 'name', label: 'Full Name', required: true, placeholder: 'e.g. John Doe' },
|
|
37
|
+
{ key: 'email', label: 'Email', type: 'email', required: true, placeholder: 'john@example.com' },
|
|
38
|
+
{
|
|
39
|
+
key: 'departmentId',
|
|
40
|
+
label: 'Department',
|
|
41
|
+
type: 'select',
|
|
42
|
+
required: true,
|
|
43
|
+
options: store.departments.map(d => ({ label: d.name + ' (' + d.code + ')', value: d.id }))
|
|
44
|
+
},
|
|
45
|
+
{ key: 'salary', label: 'Salary ($)', type: 'number', required: true, placeholder: '60000' }
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function openAddEmployee() {
|
|
50
|
+
prepareFormFields()
|
|
51
|
+
isFormModalOpen.value = true
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async function handleCreate(data) {
|
|
55
|
+
await store.createEmployee({
|
|
56
|
+
name: data.name,
|
|
57
|
+
email: data.email,
|
|
58
|
+
departmentId: Number(data.departmentId),
|
|
59
|
+
salary: Number(data.salary)
|
|
60
|
+
})
|
|
61
|
+
isFormModalOpen.value = false
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function handleOpenPatch(emp) {
|
|
65
|
+
selectedEmp.value = emp
|
|
66
|
+
isPatchModalOpen.value = true
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
async function handleApplyPatch(newSalary) {
|
|
70
|
+
if (selectedEmp.value && newSalary) {
|
|
71
|
+
await store.patchEmployee(selectedEmp.value.id, { salary: Number(newSalary) })
|
|
72
|
+
}
|
|
73
|
+
isPatchModalOpen.value = false
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async function handleDelete(id) {
|
|
77
|
+
if (confirm('Delete this employee?')) {
|
|
78
|
+
await store.deleteEmployee(id)
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
onMounted(() => {
|
|
83
|
+
store.fetchDepartments()
|
|
84
|
+
store.fetchEmployees()
|
|
85
|
+
})
|
|
86
|
+
</script>
|
|
87
|
+
|
|
88
|
+
<template>
|
|
89
|
+
<div class="view-container">
|
|
90
|
+
<div class="view-header">
|
|
91
|
+
<h2>Employee Management (Pinia)</h2>
|
|
92
|
+
<button type="button" class="btn btn-primary" @click="openAddEmployee">Add Employee</button>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
<ItemTable
|
|
96
|
+
:columns="columns"
|
|
97
|
+
:items="store.employees"
|
|
98
|
+
:loading="store.loading"
|
|
99
|
+
@patch="handleOpenPatch"
|
|
100
|
+
@delete="handleDelete"
|
|
101
|
+
/>
|
|
102
|
+
|
|
103
|
+
<ItemFormModal
|
|
104
|
+
:show="isFormModalOpen"
|
|
105
|
+
title="Create Employee"
|
|
106
|
+
:fields="formFields"
|
|
107
|
+
@close="isFormModalOpen = false"
|
|
108
|
+
@submit="handleCreate"
|
|
109
|
+
/>
|
|
110
|
+
|
|
111
|
+
<ItemPatchModal
|
|
112
|
+
:show="isPatchModalOpen"
|
|
113
|
+
title="Patch Employee Salary"
|
|
114
|
+
field-label="New Salary ($)"
|
|
115
|
+
:initial-value="selectedEmp ? selectedEmp.salary : ''"
|
|
116
|
+
@close="isPatchModalOpen = false"
|
|
117
|
+
@submit="handleApplyPatch"
|
|
118
|
+
/>
|
|
119
|
+
</div>
|
|
120
|
+
</template>
|
|
121
|
+
|
|
122
|
+
<style scoped>
|
|
123
|
+
.view-container {
|
|
124
|
+
display: flex;
|
|
125
|
+
flex-direction: column;
|
|
126
|
+
gap: 16px;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.view-header {
|
|
130
|
+
display: flex;
|
|
131
|
+
justify-content: space-between;
|
|
132
|
+
align-items: center;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.btn-primary {
|
|
136
|
+
background: #0284c7;
|
|
137
|
+
color: #fff;
|
|
138
|
+
border: none;
|
|
139
|
+
padding: 8px 14px;
|
|
140
|
+
border-radius: 6px;
|
|
141
|
+
cursor: pointer;
|
|
142
|
+
}
|
|
143
|
+
</style>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
accountHolder: { type: String, default: 'N/A' },
|
|
4
|
+
accountNumber: { type: String, default: 'N/A' },
|
|
5
|
+
accountType: { type: String, default: 'N/A' },
|
|
6
|
+
balance: { type: Number, default: 0 }
|
|
7
|
+
})
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="overview-card">
|
|
12
|
+
<h2>Account Overview</h2>
|
|
13
|
+
<div class="info-row">
|
|
14
|
+
<span>Account Holder:</span>
|
|
15
|
+
<strong>{{ accountHolder }}</strong>
|
|
16
|
+
</div>
|
|
17
|
+
<div class="info-row">
|
|
18
|
+
<span>Account Number:</span>
|
|
19
|
+
<strong>{{ accountNumber }}</strong>
|
|
20
|
+
</div>
|
|
21
|
+
<div class="info-row">
|
|
22
|
+
<span>Account Type:</span>
|
|
23
|
+
<strong>{{ accountType }}</strong>
|
|
24
|
+
</div>
|
|
25
|
+
<div class="balance-box">
|
|
26
|
+
<span>Available Balance</span>
|
|
27
|
+
<div class="balance-amount">${{ Number(balance).toLocaleString() }}</div>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<style scoped>
|
|
33
|
+
.overview-card {
|
|
34
|
+
background: #ffffff;
|
|
35
|
+
border: 1px solid #e2e8f0;
|
|
36
|
+
border-radius: 8px;
|
|
37
|
+
padding: 20px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.overview-card h2 {
|
|
41
|
+
font-size: 18px;
|
|
42
|
+
margin-bottom: 16px;
|
|
43
|
+
color: #1e293b;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.info-row {
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
padding: 8px 0;
|
|
50
|
+
border-bottom: 1px solid #f1f5f9;
|
|
51
|
+
font-size: 14px;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.balance-box {
|
|
55
|
+
margin-top: 16px;
|
|
56
|
+
background: #f8fafc;
|
|
57
|
+
padding: 16px;
|
|
58
|
+
border-radius: 6px;
|
|
59
|
+
text-align: center;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.balance-box span {
|
|
63
|
+
font-size: 12px;
|
|
64
|
+
text-transform: uppercase;
|
|
65
|
+
color: #64748b;
|
|
66
|
+
font-weight: 600;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.balance-amount {
|
|
70
|
+
font-size: 28px;
|
|
71
|
+
font-weight: 700;
|
|
72
|
+
color: #0f172a;
|
|
73
|
+
margin-top: 4px;
|
|
74
|
+
}
|
|
75
|
+
</style>
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactive } from 'vue'
|
|
3
|
+
|
|
4
|
+
const emit = defineEmits(['submit-transaction'])
|
|
5
|
+
|
|
6
|
+
const form = reactive({
|
|
7
|
+
type: 'DEPOSIT',
|
|
8
|
+
amount: '',
|
|
9
|
+
note: ''
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
function handleSubmit() {
|
|
13
|
+
if (!form.amount || Number(form.amount) <= 0) return
|
|
14
|
+
emit('submit-transaction', {
|
|
15
|
+
type: form.type,
|
|
16
|
+
amount: Number(form.amount),
|
|
17
|
+
note: form.note.trim()
|
|
18
|
+
})
|
|
19
|
+
form.amount = ''
|
|
20
|
+
form.note = ''
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<form @submit.prevent="handleSubmit" class="tx-form">
|
|
26
|
+
<div class="form-group">
|
|
27
|
+
<label for="tx-type">Transaction Type</label>
|
|
28
|
+
<select id="tx-type" v-model="form.type">
|
|
29
|
+
<option value="DEPOSIT">Deposit</option>
|
|
30
|
+
<option value="WITHDRAWAL">Withdrawal</option>
|
|
31
|
+
</select>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="form-group">
|
|
35
|
+
<label for="tx-amount">Amount ($)</label>
|
|
36
|
+
<input id="tx-amount" v-model.number="form.amount" type="number" step="any" min="1" required placeholder="100.00" />
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="form-group">
|
|
40
|
+
<label for="tx-note">Note / Description</label>
|
|
41
|
+
<input id="tx-note" v-model="form.note" placeholder="e.g. Salary, Groceries" />
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<button type="submit" class="btn btn-primary">Process Transaction</button>
|
|
45
|
+
</form>
|
|
46
|
+
</template>
|
|
47
|
+
|
|
48
|
+
<style scoped>
|
|
49
|
+
.tx-form {
|
|
50
|
+
background: #ffffff;
|
|
51
|
+
border: 1px solid #e2e8f0;
|
|
52
|
+
border-radius: 8px;
|
|
53
|
+
padding: 20px;
|
|
54
|
+
display: flex;
|
|
55
|
+
flex-direction: column;
|
|
56
|
+
gap: 12px;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.form-group {
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
gap: 4px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.form-group label {
|
|
66
|
+
font-size: 13px;
|
|
67
|
+
font-weight: 600;
|
|
68
|
+
color: #475569;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.form-group input,
|
|
72
|
+
.form-group select {
|
|
73
|
+
padding: 8px 12px;
|
|
74
|
+
border: 1px solid #cbd5e1;
|
|
75
|
+
border-radius: 6px;
|
|
76
|
+
font-size: 14px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.btn-primary {
|
|
80
|
+
background: #0284c7;
|
|
81
|
+
color: #fff;
|
|
82
|
+
border: none;
|
|
83
|
+
padding: 10px;
|
|
84
|
+
border-radius: 6px;
|
|
85
|
+
cursor: pointer;
|
|
86
|
+
font-weight: 500;
|
|
87
|
+
margin-top: 6px;
|
|
88
|
+
}
|
|
89
|
+
</style>
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
defineProps({
|
|
3
|
+
transactions: {
|
|
4
|
+
type: Array,
|
|
5
|
+
required: true
|
|
6
|
+
}
|
|
7
|
+
})
|
|
8
|
+
|
|
9
|
+
const emit = defineEmits(['patch', 'delete'])
|
|
10
|
+
|
|
11
|
+
function handlePatch(tx) {
|
|
12
|
+
const newNote = prompt('Update transaction note:', tx.note || '')
|
|
13
|
+
if (newNote !== null) {
|
|
14
|
+
emit('patch', { id: tx.id, note: newNote.trim() })
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<template>
|
|
20
|
+
<div class="table-container">
|
|
21
|
+
<table class="tx-table">
|
|
22
|
+
<thead>
|
|
23
|
+
<tr>
|
|
24
|
+
<th>Date</th>
|
|
25
|
+
<th>Type</th>
|
|
26
|
+
<th>Amount</th>
|
|
27
|
+
<th>Balance After</th>
|
|
28
|
+
<th>Note</th>
|
|
29
|
+
<th>Actions</th>
|
|
30
|
+
</tr>
|
|
31
|
+
</thead>
|
|
32
|
+
<tbody>
|
|
33
|
+
<tr v-if="transactions.length === 0">
|
|
34
|
+
<td colspan="6" class="empty">No transactions found.</td>
|
|
35
|
+
</tr>
|
|
36
|
+
<tr v-for="tx in transactions" :key="tx.id">
|
|
37
|
+
<td>{{ tx.date }}</td>
|
|
38
|
+
<td>
|
|
39
|
+
<span :class="['badge', tx.type === 'DEPOSIT' ? 'badge-green' : 'badge-red']">
|
|
40
|
+
{{ tx.type }}
|
|
41
|
+
</span>
|
|
42
|
+
</td>
|
|
43
|
+
<td>${{ Number(tx.amount).toFixed(2) }}</td>
|
|
44
|
+
<td>${{ Number(tx.balanceAfter).toFixed(2) }}</td>
|
|
45
|
+
<td>{{ tx.note || '-' }}</td>
|
|
46
|
+
<td class="action-cell">
|
|
47
|
+
<button type="button" class="btn btn-patch" @click="handlePatch(tx)">Patch</button>
|
|
48
|
+
<button type="button" class="btn btn-delete" @click="emit('delete', tx.id)">Delete</button>
|
|
49
|
+
</td>
|
|
50
|
+
</tr>
|
|
51
|
+
</tbody>
|
|
52
|
+
</table>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
|
|
56
|
+
<style scoped>
|
|
57
|
+
.table-container {
|
|
58
|
+
overflow-x: auto;
|
|
59
|
+
background: #ffffff;
|
|
60
|
+
border: 1px solid #e2e8f0;
|
|
61
|
+
border-radius: 8px;
|
|
62
|
+
padding: 16px;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.tx-table {
|
|
66
|
+
width: 100%;
|
|
67
|
+
border-collapse: collapse;
|
|
68
|
+
font-size: 13px;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
th, td {
|
|
72
|
+
padding: 10px;
|
|
73
|
+
border-bottom: 1px solid #f1f5f9;
|
|
74
|
+
text-align: left;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
th {
|
|
78
|
+
background: #f8fafc;
|
|
79
|
+
color: #475569;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.badge {
|
|
83
|
+
padding: 2px 6px;
|
|
84
|
+
border-radius: 4px;
|
|
85
|
+
font-size: 11px;
|
|
86
|
+
font-weight: 600;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.badge-green { background: #dcfce7; color: #166534; }
|
|
90
|
+
.badge-red { background: #fee2e2; color: #991b1b; }
|
|
91
|
+
|
|
92
|
+
.action-cell {
|
|
93
|
+
display: flex;
|
|
94
|
+
gap: 6px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.btn {
|
|
98
|
+
padding: 3px 6px;
|
|
99
|
+
border-radius: 4px;
|
|
100
|
+
font-size: 11px;
|
|
101
|
+
cursor: pointer;
|
|
102
|
+
border: 1px solid transparent;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.btn-patch { background: #8250df; color: #fff; }
|
|
106
|
+
.btn-delete { background: #cf222e; color: #fff; }
|
|
107
|
+
|
|
108
|
+
.empty {
|
|
109
|
+
text-align: center;
|
|
110
|
+
color: #94a3b8;
|
|
111
|
+
padding: 20px;
|
|
112
|
+
}
|
|
113
|
+
</style>
|