This commit is contained in:
romankko2 committed 2024-06-28 17:09:41 +02:00
commit 6575fec21f
14 files changed
+116 -10

No files matched your search

@@ -1,5 +1,5 @@
<template> <template>
<header class="login-header-border hover"> <header class="login-header-border">
<v-container> <v-container>
<img :src="require('@/plugins/app/_img/jandl-logo.svg')" alt="jandl-logo" @click="$router.push({name: 'Login'})"> <img :src="require('@/plugins/app/_img/jandl-logo.svg')" alt="jandl-logo" @click="$router.push({name: 'Login'})">
</v-container> </v-container>
+4
View File
@@ -105,6 +105,10 @@ input[type="time"]::-webkit-calendar-picker-indicator
.v-input .v-input
height: 40px !important height: 40px !important
.server-links
a
text-decoration: underline
@media (max-width: 534px) @media (max-width: 534px)
.mobile-view .mobile-view
flex-direction: column flex-direction: column
@@ -0,0 +1,57 @@
export function getServerLinks(description) {
const os = detectOS()
// Create a temporary DOM element to manipulate the HTML content
const tempDiv = document.createElement('div')
tempDiv.innerHTML = description
const links = new Set()
const paragraphs = tempDiv.querySelectorAll('p')
paragraphs.forEach(p => {
const text = p.textContent.trim()
if (os === 'mac' && text.startsWith('smb://')) {
links.add(`<a href="${text}" target="_blank" rel="noopener noreferrer">${text}</a>`)
} else if (os === 'win' && text.startsWith('\\\\')) {
links.add(`<a href="file://${text.replace(/\\/g, '/')}" target="_blank" rel="noopener noreferrer">${text}</a>`)
} else if (os === 'mac' && text.startsWith('\\\\')) {
const smbLink = 'smb:' + text.replace(/\\/g, '/')
links.add(`<a href="${smbLink}" target="_blank" rel="noopener noreferrer">${smbLink}</a>`)
} else if (os === 'win' && text.startsWith('smb://')) {
const windowsLink = text.replace(/^smb:/, '').replace(/\//g, '\\')
links.add(`<a href="file://${windowsLink}" target="_blank" rel="noopener noreferrer">${windowsLink}</a>`)
}
const anchor = p.querySelector('a')
if (anchor) {
const href = anchor.getAttribute('href')
if (os === 'mac' && href.startsWith('smb://')) {
links.add(`<a href="${href}" target="_blank" rel="noopener noreferrer">${href}</a>`)
} else if (os === 'win' && href.startsWith('\\\\')) {
links.add(`<a href="file://${href.replace(/\\/g, '/')}" target="_blank" rel="noopener noreferrer">${href}</a>`)
} else if (os === 'mac' && href.startsWith('\\\\')) {
const smbLink = 'smb:' + href.replace(/\\/g, '/')
links.add(`<a href="${smbLink}" target="_blank" rel="noopener noreferrer">${smbLink}</a>`)
} else if (os === 'win' && href.startsWith('smb://')) {
const windowsLink = href.replace(/^smb:/, '').replace(/\//g, '\\')
links.add(`<a href="file://${windowsLink}" target="_blank" rel="noopener noreferrer">${windowsLink}</a>`)
}
}
})
return Array.from(links).join('<br>')
}
export function detectOS() {
const platform = window.navigator.platform
const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K']
const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE']
if (macosPlatforms.indexOf(platform) !== -1) {
return 'mac'
} else if (windowsPlatforms.indexOf(platform) !== -1) {
return 'win'
}
return 'win'
}
@@ -16,7 +16,7 @@ export default {
methods: { methods: {
_initScrollListener(repeat = 0) { _initScrollListener(repeat = 0) {
if (this.initialized) return if (this.initialized && repeat > 0) return
const calendar = this.$refs.page?.querySelector('.vuecal__bg') const calendar = this.$refs.page?.querySelector('.vuecal__bg')
@@ -120,7 +120,9 @@ export default {
this.$toast.error('Nepodarilo sa nacitat data!') this.$toast.error('Nepodarilo sa nacitat data!')
} }
setTimeout(() => {
this._initScrollListener() this._initScrollListener()
}, 100)
}, },
openMasterTaskModal(mastertaskId) { openMasterTaskModal(mastertaskId) {
@@ -181,7 +181,9 @@ export default {
this.$toast.error('Nepodarilo sa nacitat data!') this.$toast.error('Nepodarilo sa nacitat data!')
} }
setTimeout(() => {
this._initScrollListener() this._initScrollListener()
}, 100)
} }
} }
} }
@@ -86,7 +86,9 @@ export default {
this.$toast.error('Nepodarilo sa nacitat data!') this.$toast.error('Nepodarilo sa nacitat data!')
} }
setTimeout(() => {
this._initScrollListener() this._initScrollListener()
}, 100)
} }
} }
} }
@@ -4,6 +4,11 @@
<section v-html="description" class="description-detail px-2 py-2 w-100 rounded mt-2" /> <section v-html="description" class="description-detail px-2 py-2 w-100 rounded mt-2" />
</div> </div>
<div v-if="hasMasterTaskDescLinks" class="px-5">
<p class="py-3">Odkazy na server</p>
<p class="server-links" v-html="masterTaskDescLinks" />
</div>
<div class="px-5 py-5 border-bottom" v-if="inheritedDescription"> <div class="px-5 py-5 border-bottom" v-if="inheritedDescription">
<p>Popis mastertasku</p> <p>Popis mastertasku</p>
<section v-html="inheritedDescription" class="description-detail px-2 py-2 w-100 rounded mt-2" /> <section v-html="inheritedDescription" class="description-detail px-2 py-2 w-100 rounded mt-2" />
@@ -11,6 +16,8 @@
</template> </template>
<script> <script>
import { getServerLinks } from '@/plugins/tm@_utils/server-links.utils'
export default { export default {
props: { props: {
description: { description: {
@@ -22,6 +29,16 @@ export default {
type: String || null, type: String || null,
default: () => null default: () => null
} }
},
computed: {
masterTaskDescLinks() {
return getServerLinks(this.description)
},
hasMasterTaskDescLinks() {
return this.masterTaskDescLinks.trim().length > 0
}
} }
} }
</script> </script>
@@ -43,7 +43,6 @@ export default {
onEmployeeSelected(id) { onEmployeeSelected(id) {
const employee = this.enrichedEmployees.find(employee => employee.id == id) const employee = this.enrichedEmployees.find(employee => employee.id == id)
console.log('add employee', employee)
this.mastertask.employees.push(employee) this.mastertask.employees.push(employee)
this.showAddEmployeeInput = false this.showAddEmployeeInput = false
}, },
@@ -280,8 +280,6 @@ export default {
return employee return employee
}) })
console.log('NEW', this.mastertask)
// this.mastertask.project_code = project.code // this.mastertask.project_code = project.code
} else { } else {
this.mastertask = { employees: [], duration: 0, _deadline_time: '17:00' } this.mastertask = { employees: [], duration: 0, _deadline_time: '17:00' }
@@ -54,7 +54,6 @@ export default {
}, },
createTask() { createTask() {
console.log(this.localData.date, this.localData.time, this.localData.employees)
this.$events.emit('show-subtask-modal', { this.$events.emit('show-subtask-modal', {
subtask: { subtask: {
deadline: this.localData.date, deadline: this.localData.date,
@@ -4,13 +4,25 @@
<section v-html="description" class="description-detail px-2 py-2 w-100 rounded mt-2" /> <section v-html="description" class="description-detail px-2 py-2 w-100 rounded mt-2" />
</div> </div>
<div v-if="hasSubtaskDescLinks" class="px-5">
<p class="py-3">Odkazy na server</p>
<p class="server-links" v-html="subtaskDescLinks" />
</div>
<div class="px-5 py-5 border-bottom" v-if="mastertaskDescription"> <div class="px-5 py-5 border-bottom" v-if="mastertaskDescription">
<p>Popis mastertasku</p> <p>Popis mastertasku</p>
<section v-html="mastertaskDescription" class="description-detail px-2 py-2 w-100 rounded mt-2" /> <section v-html="mastertaskDescription" class="description-detail px-2 py-2 w-100 rounded mt-2" />
</div> </div>
<div v-if="hasSubtaskMTDescLinks" class="px-5">
<p class="py-3">Odkazy na server</p>
<p class="server-links" v-html="subtaskMTDecsLinks" />
</div>
</template> </template>
<script> <script>
import { getServerLinks } from '@/plugins/tm@_utils/server-links.utils'
export default { export default {
props: { props: {
description: { description: {
@@ -22,6 +34,24 @@ export default {
type: String || null, type: String || null,
default: () => null default: () => null
} }
},
computed: {
subtaskDescLinks() {
return getServerLinks(this.description)
},
subtaskMTDecsLinks() {
return getServerLinks(this.mastertaskDescription)
},
hasSubtaskDescLinks() {
return this.subtaskDescLinks.trim().length > 0
},
hasSubtaskMTDescLinks() {
return this.subtaskMTDecsLinks.trim().length > 0
}
} }
} }
</script> </script>
@@ -71,9 +71,6 @@ export default {
}) })
}) })
}, },
onFocus() {
console.log('focus')
},
updateDate(date) { updateDate(date) {
const timeblock = { ...this.timeblock } const timeblock = { ...this.timeblock }
if (date) timeblock.date = date if (date) timeblock.date = date
@@ -368,7 +368,6 @@ export default {
}, },
updateSubtask(subtask) { updateSubtask(subtask) {
console.log('UPDATE SUBTASK: ', subtask.timeblocks[0])
this.subtask = subtask this.subtask = subtask
}, },