From ddc63f964ccbdbaae0adaba34e6c5e86740ee3e4 Mon Sep 17 00:00:00 2001 From: romankko2 Date: Mon, 13 Feb 2023 18:40:47 +0100 Subject: [PATCH] full text search subtask, files fixy --- app/src/plugins/app/_config/router.ts | 14 ++++++++ .../plugins/tm@_components/z-files-upload.vue | 34 +++++++++++++------ .../master-task/_mixins/selects.mixin.ts | 6 ++-- .../master-task/z-master-task-modal.vue | 5 +-- .../plugins/tm@modal/task/z-task-modal.vue | 33 ++++++------------ 5 files changed, 53 insertions(+), 39 deletions(-) diff --git a/app/src/plugins/app/_config/router.ts b/app/src/plugins/app/_config/router.ts index 9b5d54b..6801cca 100644 --- a/app/src/plugins/app/_config/router.ts +++ b/app/src/plugins/app/_config/router.ts @@ -113,4 +113,18 @@ const router = createRouter({ routes }) +// router.afterEach((to) => { +// if (to.fullPath.includes('?master-task')) { +// const searchParams = new URLSearchParams(to.fullPath.split('?')[1]) +// const id = searchParams.get('id') + +// this.$events.emit('show-master-task-modal', { id }) +// } else if (to.fullPath.includes('?task')) { +// const searchParams = new URLSearchParams(to.fullPath.split('?')[1]) +// const id = searchParams.get('id') + +// this.$events.emit('show-task-modal', { id }) +// } +// }) + export default router diff --git a/app/src/plugins/tm@_components/z-files-upload.vue b/app/src/plugins/tm@_components/z-files-upload.vue index 700472b..2156398 100644 --- a/app/src/plugins/tm@_components/z-files-upload.vue +++ b/app/src/plugins/tm@_components/z-files-upload.vue @@ -8,16 +8,16 @@ NAHRAŤ -
+
{{ file.name }} - +
@@ -28,20 +28,32 @@ export default { emit: ['files-uploaded'], - data() { - return { - files: [], - } - }, + props: { + files: { + type: Array, + default: () => [] + } + }, + + data() { + return { + uploadedFiles: [] + } + }, + + created() { + this.uploadedFiles = this.files + console.log(this.uploadedFiles) + }, methods: { onChange() { - this.files = [...this.files, ...this.$refs.fileUpload.files] - this.$emit('files-uploaded', this.files) + this.uploadedFiles = [...this.uploadedFiles, ...this.$refs.fileUpload.files] + this.$emit('files-uploaded', this.uploadedFiles) }, remove(index) { - this.files.splice(index, 1) + this.uploadedFiles.splice(index, 1) }, }, } diff --git a/app/src/plugins/tm@modal/master-task/_mixins/selects.mixin.ts b/app/src/plugins/tm@modal/master-task/_mixins/selects.mixin.ts index 85d8ee9..64ab9bc 100644 --- a/app/src/plugins/tm@modal/master-task/_mixins/selects.mixin.ts +++ b/app/src/plugins/tm@modal/master-task/_mixins/selects.mixin.ts @@ -26,9 +26,9 @@ export default { onMasterTaskSelected({ key }) { const masterTask = this.masterTasks.find(masterTask => masterTask.id == key) - this.masterTask.name = masterTask.name - console.log(masterTask.name) - this.masterTask.master_task.id = masterTask.id + this.task.master_task.name = masterTask.name + this.task.master_task.id = masterTask.id + this.task.project_code = masterTask.project_code }, onEmployeeSelected({ key }) { diff --git a/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue b/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue index 1caecf3..d6e94e8 100644 --- a/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue +++ b/app/src/plugins/tm@modal/master-task/z-master-task-modal.vue @@ -38,7 +38,7 @@
- + {{ masterTask.id ? 'ULOŽIŤ' : 'VYTVORIŤ' }} @@ -122,7 +122,8 @@ export default { projects: null, employees: null, masterTask: null, - showAddEmployeeInput: false + showAddEmployeeInput: false, + date: null, } }, diff --git a/app/src/plugins/tm@modal/task/z-task-modal.vue b/app/src/plugins/tm@modal/task/z-task-modal.vue index c759ec7..8f6b64a 100644 --- a/app/src/plugins/tm@modal/task/z-task-modal.vue +++ b/app/src/plugins/tm@modal/task/z-task-modal.vue @@ -10,36 +10,24 @@ - - - - + /> - + {{ @@ -398,7 +385,7 @@ export default { Datepicker, ZFilesUpload, QuillEditor, - // ZAutocomplete + ZAutocomplete }, data() {