mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 06:20:21 +00:00
Merge branch 'main' of https://bitbucket.org/studiotem/jandl-taskmanager-app into production
This commit is contained in:
commit
6575fec21f
14 files changed
+119
-13
No files matched your search
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<header class="login-header-border hover">
|
||||
<header class="login-header-border">
|
||||
<v-container>
|
||||
<img :src="require('@/plugins/app/_img/jandl-logo.svg')" alt="jandl-logo" @click="$router.push({name: 'Login'})">
|
||||
</v-container>
|
||||
|
||||
@@ -105,6 +105,10 @@ input[type="time"]::-webkit-calendar-picker-indicator
|
||||
.v-input
|
||||
height: 40px !important
|
||||
|
||||
.server-links
|
||||
a
|
||||
text-decoration: underline
|
||||
|
||||
@media (max-width: 534px)
|
||||
.mobile-view
|
||||
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: {
|
||||
_initScrollListener(repeat = 0) {
|
||||
if (this.initialized) return
|
||||
if (this.initialized && repeat > 0) return
|
||||
|
||||
const calendar = this.$refs.page?.querySelector('.vuecal__bg')
|
||||
|
||||
|
||||
@@ -120,7 +120,9 @@ export default {
|
||||
this.$toast.error('Nepodarilo sa nacitat data!')
|
||||
}
|
||||
|
||||
this._initScrollListener()
|
||||
setTimeout(() => {
|
||||
this._initScrollListener()
|
||||
}, 100)
|
||||
},
|
||||
|
||||
openMasterTaskModal(mastertaskId) {
|
||||
|
||||
@@ -181,7 +181,9 @@ export default {
|
||||
this.$toast.error('Nepodarilo sa nacitat data!')
|
||||
}
|
||||
|
||||
this._initScrollListener()
|
||||
setTimeout(() => {
|
||||
this._initScrollListener()
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,9 @@ export default {
|
||||
this.$toast.error('Nepodarilo sa nacitat data!')
|
||||
}
|
||||
|
||||
this._initScrollListener()
|
||||
setTimeout(() => {
|
||||
this._initScrollListener()
|
||||
}, 100)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,11 @@
|
||||
<section v-html="description" class="description-detail px-2 py-2 w-100 rounded mt-2" />
|
||||
</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">
|
||||
<p>Popis mastertasku</p>
|
||||
<section v-html="inheritedDescription" class="description-detail px-2 py-2 w-100 rounded mt-2" />
|
||||
@@ -11,6 +16,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getServerLinks } from '@/plugins/tm@_utils/server-links.utils'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
description: {
|
||||
@@ -22,6 +29,16 @@ export default {
|
||||
type: String || null,
|
||||
default: () => null
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
masterTaskDescLinks() {
|
||||
return getServerLinks(this.description)
|
||||
},
|
||||
|
||||
hasMasterTaskDescLinks() {
|
||||
return this.masterTaskDescLinks.trim().length > 0
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -43,7 +43,6 @@ export default {
|
||||
|
||||
onEmployeeSelected(id) {
|
||||
const employee = this.enrichedEmployees.find(employee => employee.id == id)
|
||||
console.log('add employee', employee)
|
||||
this.mastertask.employees.push(employee)
|
||||
this.showAddEmployeeInput = false
|
||||
},
|
||||
|
||||
@@ -280,8 +280,6 @@ export default {
|
||||
return employee
|
||||
})
|
||||
|
||||
console.log('NEW', this.mastertask)
|
||||
|
||||
// this.mastertask.project_code = project.code
|
||||
} else {
|
||||
this.mastertask = { employees: [], duration: 0, _deadline_time: '17:00' }
|
||||
|
||||
@@ -54,7 +54,6 @@ export default {
|
||||
},
|
||||
|
||||
createTask() {
|
||||
console.log(this.localData.date, this.localData.time, this.localData.employees)
|
||||
this.$events.emit('show-subtask-modal', {
|
||||
subtask: {
|
||||
deadline: this.localData.date,
|
||||
|
||||
@@ -4,13 +4,25 @@
|
||||
<section v-html="description" class="description-detail px-2 py-2 w-100 rounded mt-2" />
|
||||
</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">
|
||||
<p>Popis mastertasku</p>
|
||||
<section v-html="mastertaskDescription" class="description-detail px-2 py-2 w-100 rounded mt-2" />
|
||||
</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>
|
||||
|
||||
<script>
|
||||
import { getServerLinks } from '@/plugins/tm@_utils/server-links.utils'
|
||||
|
||||
export default {
|
||||
props: {
|
||||
description: {
|
||||
@@ -22,6 +34,24 @@ export default {
|
||||
type: String || 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>
|
||||
@@ -71,9 +71,6 @@ export default {
|
||||
})
|
||||
})
|
||||
},
|
||||
onFocus() {
|
||||
console.log('focus')
|
||||
},
|
||||
updateDate(date) {
|
||||
const timeblock = { ...this.timeblock }
|
||||
if (date) timeblock.date = date
|
||||
|
||||
@@ -368,7 +368,6 @@ export default {
|
||||
},
|
||||
|
||||
updateSubtask(subtask) {
|
||||
console.log('UPDATE SUBTASK: ', subtask.timeblocks[0])
|
||||
this.subtask = subtask
|
||||
},
|
||||
|
||||
|
||||
Reference in new issue
Block a user