mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 14:29:34 +00:00
[teams] napojenie requestov
This commit is contained in:
1 parent
96954845a1
commit
86bea63cdd
9 files changed
+32
-30
No files matched your search
@@ -5,11 +5,11 @@
|
||||
</v-main>
|
||||
</v-app>
|
||||
|
||||
<Z-team-modal ref="z-team-modal" />
|
||||
<Z-delete-team-modal ref="z-delete-team-modal" @deleted="onTeamDeleted" />
|
||||
<Z-team-modal ref="z-team-modal" @update="onTeamUpdate" />
|
||||
<Z-delete-team-modal ref="z-delete-team-modal" @update="onTeamUpdate" />
|
||||
|
||||
<Z-task-modal ref="z-task-modal" />
|
||||
<Z-delete-task-modal ref="z-delete-task-modal" @deleted="onTaskDeleted" />
|
||||
<Z-delete-task-modal ref="z-delete-task-modal" @update="onTaskDeleted" />
|
||||
<Z-complete-task-modal ref="z-complete-task-modal" />
|
||||
<Z-task-add-time-modal ref="z-task-add-time-modal" />
|
||||
<Z-blocker-modal ref="z-blocker-modal" />
|
||||
@@ -76,7 +76,7 @@ export default {
|
||||
},
|
||||
|
||||
methods: {
|
||||
onTeamDeleted(team) {
|
||||
onTeamUpdate(team) {
|
||||
this.$events.emit('on-team-deleted', team)
|
||||
},
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ const options: Options = {
|
||||
'POST v1/auth/login': true,
|
||||
'POST v1/auth/post': true,
|
||||
|
||||
'GET v1/master-tasks/(id)': true,
|
||||
'GET v1/master-tasks': true,
|
||||
// 'GET v1/master-tasks/(id)': true,
|
||||
// 'GET v1/master-tasks': true,
|
||||
'POST v1/master-tasks/(id)': true,
|
||||
'DELETE v1/master-tasks/(id)': true,
|
||||
'POST v1/master-tasks': true,
|
||||
@@ -64,11 +64,11 @@ const options: Options = {
|
||||
'DELETE v1/tasks/(id)': true,
|
||||
|
||||
// 'GET v1/teams/(id)': true,
|
||||
'POST v1/teams/(id)': true,
|
||||
'DELETE v1/teams/(id)': true,
|
||||
// 'POST v1/teams/(id)': true,
|
||||
// 'DELETE v1/teams/(id)': true,
|
||||
// 'GET v1/teams': true,
|
||||
// 'GET v1/teamsx': true,
|
||||
'POST v1/teams': true,
|
||||
// 'POST v1/teams': true,
|
||||
|
||||
// 'GET v1/employees': true,
|
||||
'GET v1/search': true,
|
||||
|
||||
@@ -53,7 +53,7 @@ export default {
|
||||
|
||||
// format masterTasks to event format for calendar
|
||||
events = events.map(event => {
|
||||
const color = this._stringToHexColor(`${event.project_code}${event.name}`)
|
||||
const color = this._stringToHexColor(event.color)
|
||||
|
||||
return {
|
||||
id: event.id,
|
||||
@@ -81,7 +81,7 @@ export default {
|
||||
try {
|
||||
this.teams = await this.$axios.get_auth_data('v1/teams')
|
||||
this.employees = await this.$axios.get_auth_data('v1/employees')
|
||||
this.masterTasks = await this.$axios.get_auth_data('v1/master-tasks')
|
||||
this.masterTasks = await this.$axios.get_auth_data('v1/mastertasks')
|
||||
} catch (error) {
|
||||
this.masterTasks = {error}
|
||||
}
|
||||
@@ -98,19 +98,19 @@ export default {
|
||||
},
|
||||
|
||||
_stringToHexColor(string) {
|
||||
let hash = 0;
|
||||
let hash = 0
|
||||
|
||||
for (let i = 0; i < string.length; i++) {
|
||||
hash = string.charCodeAt(i) + ((hash << 5) - hash);
|
||||
hash = string.charCodeAt(i) + ((hash << 5) - hash)
|
||||
}
|
||||
|
||||
let color = '#';
|
||||
let color = '#'
|
||||
for (let i = 0; i < 3; i++) {
|
||||
let value = (hash >> (i * 8)) & 0xFF;
|
||||
color += ('00' + value.toString(16)).substr(-2);
|
||||
let value = (hash >> (i * 8)) & 0xFF
|
||||
color += ('00' + value.toString(16)).substr(-2)
|
||||
}
|
||||
return color;
|
||||
return color
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
@@ -3,7 +3,7 @@
|
||||
<v-select
|
||||
v-model="selectedEmployee"
|
||||
class="subheader-input"
|
||||
:items="employees"
|
||||
:items="[null, ...employees]"
|
||||
item-title="fullName"
|
||||
item-value="id"
|
||||
label="Zamestnanec"
|
||||
|
||||
@@ -423,7 +423,7 @@ export default {
|
||||
|
||||
async _load(masterTaskId) {
|
||||
try {
|
||||
this.masterTask = await this.$axios.get_auth_data(`v1/master-tasks/${masterTaskId}`)
|
||||
this.masterTask = await this.$axios.get_auth_data(`v1/mastertasks/${masterTaskId}`)
|
||||
} catch (error) {
|
||||
this.$toast.error(error)
|
||||
}
|
||||
@@ -439,7 +439,7 @@ export default {
|
||||
|
||||
async _update() {
|
||||
try {
|
||||
await this.$axios.post_auth(`v1/master-tasks/${this.masterTask.id}`)
|
||||
await this.$axios.post_auth(`v1/mastertasks/${this.masterTask.id}`)
|
||||
} catch (error) {
|
||||
this.$toast.error(error)
|
||||
}
|
||||
@@ -447,7 +447,7 @@ export default {
|
||||
|
||||
async deleteTask(masterTaskId) {
|
||||
try {
|
||||
await this.$axios.delete(`v1/master-tasks/${masterTaskId}`)
|
||||
await this.$axios.delete(`v1/mastertasks/${masterTaskId}`)
|
||||
this.close()
|
||||
} catch (error) {
|
||||
this.$toast.error(error)
|
||||
|
||||
@@ -475,7 +475,7 @@ export default {
|
||||
|
||||
async _update() {
|
||||
try {
|
||||
await this.$axios.post_auth(`v1/master-tasks/${this.task.id}`)
|
||||
await this.$axios.post_auth(`v1/mastertasks/${this.task.id}`)
|
||||
} catch (error) {
|
||||
this.$toast.error(error)
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
<script>
|
||||
export default {
|
||||
emits: ['deleted'],
|
||||
emits: ['update'],
|
||||
|
||||
data() {
|
||||
return {
|
||||
@@ -35,9 +35,9 @@ export default {
|
||||
|
||||
async deleteTeam() {
|
||||
try {
|
||||
await this.$axios.delete(`v1/teams/${this.team.id}`)
|
||||
await this.$axios.delete_auth(`v1/teams/${this.team.id}`)
|
||||
this.visible = false
|
||||
this.$emit('deleted', this.team)
|
||||
this.$emit('update', this.team)
|
||||
} catch (error) {
|
||||
this.$toast.error(error)
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ import errorUtils from '@/plugins/lib@auth/_utils/error.utils'
|
||||
const atLeastOne = (value) => value.length
|
||||
|
||||
export default {
|
||||
emits: ['close'],
|
||||
emits: ['close', 'update'],
|
||||
|
||||
components: {
|
||||
ZAutocomplete,
|
||||
@@ -143,7 +143,8 @@ export default {
|
||||
|
||||
async _create() {
|
||||
try {
|
||||
await this.$axios.post_auth(`v1/teams`, this.team)
|
||||
await this.$axios.post_auth('v1/teams', {data: this.team})
|
||||
this.$emit('update', this.team)
|
||||
} catch (error) {
|
||||
this.$toast.error(error)
|
||||
}
|
||||
@@ -151,7 +152,8 @@ export default {
|
||||
|
||||
async _edit() {
|
||||
try {
|
||||
await this.$axios.post_auth(`v1/teams/${this.team.id}`, this.team)
|
||||
await this.$axios.put_auth(`v1/teams/${this.team.id}`, {data: this.team})
|
||||
this.$emit('update', this.team)
|
||||
} catch (error) {
|
||||
this.$toast.error(error)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<W-loadable :content="teams">
|
||||
<A-teams-table :teams="teams" />
|
||||
<A-teams-table :teams="teams" @reloadData="_loadData" />
|
||||
</W-loadable>
|
||||
</template>
|
||||
|
||||
|
||||
Reference in new issue
Block a user