wad-lab 1.1.6 → 1.1.8
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/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 +24 -0
- package/templates/vue-axios-interceptor/src/App.vue +177 -159
- package/templates/vue-axios-pinia/src/App.vue +14 -0
- 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 +24 -0
- package/templates/vue-axios-props-emits/src/components/DepartmentList.vue +2 -1
- package/templates/vue-axios-props-emits/src/components/EmployeeList.vue +2 -1
- package/templates/vue-axios-router/src/views/DepartmentView.vue +23 -0
- package/templates/vue-axios-router/src/views/EmployeeView.vue +23 -0
- 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/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,152 +1,164 @@
|
|
|
1
|
-
<script setup>
|
|
2
|
-
import { ref } from 'vue'
|
|
3
|
-
|
|
4
|
-
const props = defineProps(['departments'])
|
|
5
|
-
const emit = defineEmits(['create', 'delete'])
|
|
6
|
-
|
|
7
|
-
const name = ref('')
|
|
8
|
-
const code = ref('')
|
|
9
|
-
|
|
10
|
-
function handleSubmit() {
|
|
11
|
-
if (!name.value || !code.value) return
|
|
12
|
-
emit('create', {
|
|
13
|
-
name: name.value.trim(),
|
|
14
|
-
code: code.value.trim()
|
|
15
|
-
})
|
|
16
|
-
name.value = ''
|
|
17
|
-
code.value = ''
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function handleDelete(id) {
|
|
21
|
-
emit('delete', id)
|
|
22
|
-
}
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<template>
|
|
26
|
-
<section class="section">
|
|
27
|
-
<h2>Departments</h2>
|
|
28
|
-
<form class="form" @submit.prevent="handleSubmit">
|
|
29
|
-
<div class="form-group">
|
|
30
|
-
<label for="dept-name">Department Name</label>
|
|
31
|
-
<input id="dept-name" v-model="name" type="text" placeholder="e.g. Engineering" required>
|
|
32
|
-
</div>
|
|
33
|
-
<div class="form-group">
|
|
34
|
-
<label for="dept-code">Department Code</label>
|
|
35
|
-
<input id="dept-code" v-model="code" type="text" placeholder="e.g. ENG" required>
|
|
36
|
-
</div>
|
|
37
|
-
<button type="submit" class="btn btn-primary">Add Department</button>
|
|
38
|
-
</form>
|
|
39
|
-
|
|
40
|
-
<div class="table-container">
|
|
41
|
-
<p v-if="!departments || departments.length === 0" class="empty">No departments available.</p>
|
|
42
|
-
<table v-else class="data-table">
|
|
43
|
-
<thead>
|
|
44
|
-
<tr>
|
|
45
|
-
<th>ID</th>
|
|
46
|
-
<th>Name</th>
|
|
47
|
-
<th>Code</th>
|
|
48
|
-
<th>Actions</th>
|
|
49
|
-
</tr>
|
|
50
|
-
</thead>
|
|
51
|
-
<tbody>
|
|
52
|
-
<tr v-for="dept in departments" :key="dept.id">
|
|
53
|
-
<td>{{ dept.id }}</td>
|
|
54
|
-
<td>{{ dept.name }}</td>
|
|
55
|
-
<td>{{ dept.code }}</td>
|
|
56
|
-
<td>
|
|
57
|
-
<button class="btn btn-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
</
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
border
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
font-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
border
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
border
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
color:
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
color:
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
.data-table
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps(['departments'])
|
|
5
|
+
const emit = defineEmits(['create', 'delete', 'patch'])
|
|
6
|
+
|
|
7
|
+
const name = ref('')
|
|
8
|
+
const code = ref('')
|
|
9
|
+
|
|
10
|
+
function handleSubmit() {
|
|
11
|
+
if (!name.value || !code.value) return
|
|
12
|
+
emit('create', {
|
|
13
|
+
name: name.value.trim(),
|
|
14
|
+
code: code.value.trim()
|
|
15
|
+
})
|
|
16
|
+
name.value = ''
|
|
17
|
+
code.value = ''
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function handleDelete(id) {
|
|
21
|
+
emit('delete', id)
|
|
22
|
+
}
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<section class="section">
|
|
27
|
+
<h2>Departments</h2>
|
|
28
|
+
<form class="form" @submit.prevent="handleSubmit">
|
|
29
|
+
<div class="form-group">
|
|
30
|
+
<label for="dept-name">Department Name</label>
|
|
31
|
+
<input id="dept-name" v-model="name" type="text" placeholder="e.g. Engineering" required>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="form-group">
|
|
34
|
+
<label for="dept-code">Department Code</label>
|
|
35
|
+
<input id="dept-code" v-model="code" type="text" placeholder="e.g. ENG" required>
|
|
36
|
+
</div>
|
|
37
|
+
<button type="submit" class="btn btn-primary">Add Department</button>
|
|
38
|
+
</form>
|
|
39
|
+
|
|
40
|
+
<div class="table-container">
|
|
41
|
+
<p v-if="!departments || departments.length === 0" class="empty">No departments available.</p>
|
|
42
|
+
<table v-else class="data-table">
|
|
43
|
+
<thead>
|
|
44
|
+
<tr>
|
|
45
|
+
<th>ID</th>
|
|
46
|
+
<th>Name</th>
|
|
47
|
+
<th>Code</th>
|
|
48
|
+
<th>Actions</th>
|
|
49
|
+
</tr>
|
|
50
|
+
</thead>
|
|
51
|
+
<tbody>
|
|
52
|
+
<tr v-for="dept in departments" :key="dept.id">
|
|
53
|
+
<td>{{ dept.id }}</td>
|
|
54
|
+
<td>{{ dept.name }}</td>
|
|
55
|
+
<td>{{ dept.code }}</td>
|
|
56
|
+
<td>
|
|
57
|
+
<button class="btn btn-patch" @click="$emit('patch', dept.id, dept.code)">Patch</button>
|
|
58
|
+
<button class="btn btn-danger" @click="handleDelete(dept.id)">Delete</button>
|
|
59
|
+
</td>
|
|
60
|
+
</tr>
|
|
61
|
+
</tbody>
|
|
62
|
+
</table>
|
|
63
|
+
</div>
|
|
64
|
+
</section>
|
|
65
|
+
</template>
|
|
66
|
+
|
|
67
|
+
<style scoped>
|
|
68
|
+
.section {
|
|
69
|
+
border: 1px solid #ccc;
|
|
70
|
+
border-radius: 4px;
|
|
71
|
+
padding: 16px;
|
|
72
|
+
margin-bottom: 24px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.form {
|
|
76
|
+
display: flex;
|
|
77
|
+
flex-wrap: wrap;
|
|
78
|
+
gap: 12px;
|
|
79
|
+
align-items: flex-end;
|
|
80
|
+
margin-bottom: 16px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.form-group {
|
|
84
|
+
display: flex;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
gap: 4px;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.form-group label {
|
|
90
|
+
font-size: 14px;
|
|
91
|
+
font-weight: 600;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.form-group input {
|
|
95
|
+
padding: 6px 10px;
|
|
96
|
+
border: 1px solid #ccc;
|
|
97
|
+
border-radius: 4px;
|
|
98
|
+
font-size: 14px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.btn {
|
|
102
|
+
padding: 6px 14px;
|
|
103
|
+
border: 1px solid transparent;
|
|
104
|
+
border-radius: 4px;
|
|
105
|
+
cursor: pointer;
|
|
106
|
+
font-size: 14px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.btn-primary {
|
|
110
|
+
background-color: #007bff;
|
|
111
|
+
color: white;
|
|
112
|
+
border-color: #007bff;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.btn-primary:hover {
|
|
116
|
+
background-color: #0069d9;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.btn-danger {
|
|
120
|
+
background-color: #dc3545;
|
|
121
|
+
color: white;
|
|
122
|
+
border-color: #dc3545;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
.btn-danger:hover {
|
|
126
|
+
background-color: #c82333;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.btn-patch {
|
|
130
|
+
background-color: #17a2b8;
|
|
131
|
+
color: white;
|
|
132
|
+
border-color: #17a2b8;
|
|
133
|
+
margin-right: 6px;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.btn-patch:hover {
|
|
137
|
+
background-color: #138496;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.table-container {
|
|
141
|
+
overflow-x: auto;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.data-table {
|
|
145
|
+
width: 100%;
|
|
146
|
+
border-collapse: collapse;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
.data-table th,
|
|
150
|
+
.data-table td {
|
|
151
|
+
border: 1px solid #ddd;
|
|
152
|
+
padding: 8px 12px;
|
|
153
|
+
text-align: left;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.data-table th {
|
|
157
|
+
background-color: #f2f2f2;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.empty {
|
|
161
|
+
color: #666;
|
|
162
|
+
font-style: italic;
|
|
163
|
+
}
|
|
164
|
+
</style>
|