feat: url link
This commit is contained in:
@@ -103,11 +103,19 @@
|
||||
|
||||
const proJectId = computed(() => route.params.id)
|
||||
|
||||
const handleOpenReport = (data) => {
|
||||
previewRef.value.setSessionId(data)
|
||||
const handleOpenReport = (data, isUrls = false) => {
|
||||
if (isUrls) {
|
||||
previewRef.value.setUrls(data)
|
||||
} else {
|
||||
previewRef.value.setSessionId(data)
|
||||
}
|
||||
previewType.value = 'report'
|
||||
}
|
||||
|
||||
const handleOpenUrls = (data) => {
|
||||
handleOpenReport(data, true)
|
||||
}
|
||||
|
||||
watch(
|
||||
() => proJectId.value,
|
||||
(newVal, oldVal) => {
|
||||
@@ -120,6 +128,7 @@ const handleOpenReport = (data) => {
|
||||
|
||||
onMounted(() => {
|
||||
MyEvent.add('openReport', handleOpenReport)
|
||||
MyEvent.add('openUrls', handleOpenUrls)
|
||||
projectStore.clearProject()
|
||||
if (proJectId.value) {
|
||||
handleGetProjectInfoAndHistory()
|
||||
@@ -127,6 +136,7 @@ const handleOpenReport = (data) => {
|
||||
})
|
||||
onUnmounted(() => {
|
||||
MyEvent.remove('openReport', handleOpenReport)
|
||||
MyEvent.remove('openUrls', handleOpenUrls)
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user