Compare commits

...

11 Commits

Author SHA1 Message Date
sockenklaus
6878cc51ea updated dependencies 2021-12-17 14:46:22 +01:00
Sockenklaus
e0446e97de updated dependencies 2021-12-10 00:24:24 +01:00
sockenklaus
ed4377ad77 Update README.md 2021-12-02 13:06:15 +01:00
sockenklaus
9f2a9920af Update README.md 2021-12-02 13:00:26 +01:00
sockenklaus
132195796c Update README.md 2021-12-02 12:54:55 +01:00
sockenklaus
e480811bb1 Update README.md 2021-12-02 12:54:38 +01:00
Sockenklaus
28d42204ab fixed some typescript errors 2021-12-02 12:41:22 +01:00
Sockenklaus
f5b59c3ae8 updated some packages 2021-12-02 11:49:16 +01:00
Sockenklaus
92f62a2189 updated vue to 3.2.23 2021-12-02 11:36:20 +01:00
sockenklaus
8bb3e16329 Merge pull request #29 from sockenklaus:sockenklaus/issue26
Sockenklaus/issue26
2021-11-28 14:35:47 +01:00
Sockenklaus
e79efce565 Employees-Index: Debounce fetchFromApi
Fixes #26
2021-11-28 14:35:00 +01:00
8 changed files with 708 additions and 643 deletions

View File

@@ -1,11 +1,25 @@
# Vue 3 + Typescript + Vite # About Duty-Schedule-FE
Duty-Schedule-FE is the web frontend for Duty-Schedule, a software to create and distribute team based duty schedules für employees working in a shift system that consists of one daily shift and one daily on-call duty.
This software is, as of today, in a ***very, very early development stage***.
## Planned features
* [ ] 🧑‍⚕️ Create and manage employees with standing data, working hours and individual user logins
* [ ] 🤴 Create and manage customers with default workload, shift lengths and core teams
* [ ] 📋 Create and manage duty schedules for any customer with core team members and additional team members.
* [ ] 🗄️ Version duty schedules and retrace the change process of any schedule
* [ ] 📧 Distribute new schedule versions to customer, core team and additional team members.
## Vue 3 + Typescript + Vite
This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more. This template should help get you started developing with Vue 3 and Typescript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
## Recommended IDE Setup ### Recommended IDE Setup
- [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) - [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)
## Type Support For `.vue` Imports in TS ### Type Support For `.vue` Imports in TS
Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's `.vue` type support plugin by running `Volar: Switch TS Plugin on/off` from VSCode command palette. Since TypeScript cannot handle type information for `.vue` imports, they are shimmed to be a generic Vue component type by default. In most cases this is fine if you don't really care about component prop types outside of templates. However, if you wish to get actual prop types in `.vue` imports (for example to get props validation when using manual `h(...)` calls), you can enable Volar's `.vue` type support plugin by running `Volar: Switch TS Plugin on/off` from VSCode command palette.

1279
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -8,32 +8,31 @@
"serve": "vite preview" "serve": "vite preview"
}, },
"dependencies": { "dependencies": {
"@oruga-ui/oruga-next": "^0.4.5", "@popperjs/core": "^2.11.0",
"@popperjs/core": "^2.10.2",
"@vuelidate/core": "^2.0.0-alpha.32", "@vuelidate/core": "^2.0.0-alpha.32",
"@vuelidate/validators": "^2.0.0-alpha.25", "@vuelidate/validators": "^2.0.0-alpha.25",
"axios": "^0.23.0", "axios": "^0.24.0",
"bootstrap": "^5.1.3", "bootstrap": "^5.1.3",
"bootstrap-icons": "^1.6.0", "bootstrap-icons": "^1.7.2",
"date-fns": "^2.25.0", "date-fns": "^2.27.0",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"pinia": "^2.0.3", "pinia": "^2.0.6",
"pinia-plugin-persist": "^0.0.92", "pinia-plugin-persist": "^0.0.92",
"uuid": "^8.3.2", "uuid": "^8.3.2",
"vue": "^3.2.21", "vue": "^3.2.23",
"vue-imask": "^6.2.2", "vue-imask": "^6.2.2",
"vue-request": "^1.2.3", "vue-request": "^1.2.3",
"vue-router": "^4.0.12", "vue-router": "^4.0.12",
"vue-tsc": "^0.3.0" "vue-tsc": "^0.29.8"
}, },
"devDependencies": { "devDependencies": {
"@types/bootstrap": "^5.1.6", "@types/bootstrap": "^5.1.6",
"@types/lodash": "^4.14.176", "@types/lodash": "^4.14.178",
"@types/node": "^16.11.1", "@types/node": "^17.0.0",
"@types/uuid": "^8.3.1", "@types/uuid": "^8.3.3",
"@vitejs/plugin-vue": "^1.9.3", "@vitejs/plugin-vue": "^2.0.1",
"sass": "^1.43.2", "sass": "^1.45.0",
"typescript": "^4.4.4", "typescript": "^4.5.4",
"vite": "^2.6.7" "vite": "^2.7.3"
} }
} }

View File

@@ -51,9 +51,12 @@ const unionColumns = computed(() => {
return union(props.columns, columnsChecked.value) return union(props.columns, columnsChecked.value)
}) })
const search = _debounce(() => { function search() {
emit('search', queryString.value) emit('search', queryString.value)
}, 150) }
/* const search = _debounce(() => {
emit('search', queryString.value)
}, 150) */
</script> </script>

View File

@@ -31,7 +31,7 @@ div.modal.fade(
:key="i" :key="i"
@click="setResult(sugg)" @click="setResult(sugg)"
:class="{'active' : selected === i}" :class="{'active' : selected === i}"
) {{sugg.last_name}}, {{sugg.first_name}} ) {{sugg.lastName}}, {{sugg.firstName}}
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@@ -79,7 +79,7 @@ div.modal.fade(
function setResult(pResult : Employee) { function setResult(pResult : Employee) {
result.value = pResult result.value = pResult
query.value = pResult.last_name+', '+pResult.first_name query.value = pResult.lastName+', '+pResult.firstName
isOpenSuggestions.value = false isOpenSuggestions.value = false
selected.value = 0 selected.value = 0
suggestions.value = [] suggestions.value = []

View File

@@ -54,8 +54,8 @@ export const useEmployee = defineStore({
}, },
actions: { actions: {
assignTruthyValues(target: Object, source: Object) { assignTruthyValues(target: Employee, source: Employee) {
for (const key in source) { for (let key in source) {
if (source[key]) { if (source[key]) {
target[key] = source[key] target[key] = source[key]
} }

View File

@@ -3,6 +3,7 @@ import { useUser } from '@/stores/user'
import axios from '@/axios' import axios from '@/axios'
import _cloneDeep from 'lodash/cloneDeep' import _cloneDeep from 'lodash/cloneDeep'
import _assign from 'lodash/assign' import _assign from 'lodash/assign'
import _debounce from 'lodash/debounce'
import { reactive, watch, onMounted } from 'vue' import { reactive, watch, onMounted } from 'vue'
export default defineStore('employees', () => { export default defineStore('employees', () => {
@@ -74,9 +75,9 @@ export default defineStore('employees', () => {
state.page = pPage state.page = pPage
} }
watch(() => [state.limit, state.sort_by, state.simple_search, state.page], () => { watch(() => [state.limit, state.sort_by, state.simple_search, state.page], _debounce(() => {
fetchFromApi() fetchFromApi()
}) }, 300))
onMounted(() => { onMounted(() => {
fetchFromApi() fetchFromApi()

View File

@@ -13,7 +13,8 @@ type Employee = {
passwordConfirm?: string, passwordConfirm?: string,
isActive: boolean, isActive: boolean,
createdAt?: Date, createdAt?: Date,
updatedAt?: Date updatedAt?: Date,
[key: string]: any
} }
type EmployeeApiValidationError = { type EmployeeApiValidationError = {