修改bug

This commit is contained in:
limengnan 2025-05-29 09:21:15 +08:00
parent 08e428f5c3
commit 14e3313cec
5 changed files with 42 additions and 11 deletions

View File

@ -49,6 +49,8 @@ import { useCache } from '@/hooks/web/useCache'
import DeFullscreen from '@/components/visualization/common/DeFullscreen.vue' import DeFullscreen from '@/components/visualization/common/DeFullscreen.vue'
import DeAppApply from '@/views/common/DeAppApply.vue' import DeAppApply from '@/views/common/DeAppApply.vue'
import { useUserStoreWithOut } from '@/store/modules/user' import { useUserStoreWithOut } from '@/store/modules/user'
import { useRoute } from 'vue-router'
const route = useRoute()
const { t } = useI18n() const { t } = useI18n()
const dvMainStore = dvMainStoreWithOut() const dvMainStore = dvMainStoreWithOut()
const snapshotStore = snapshotStoreWithOut() const snapshotStore = snapshotStoreWithOut()
@ -265,9 +267,10 @@ const clearCanvas = () => {
} }
const backToMain = () => { const backToMain = () => {
let url = '#/panel/index' let url = '#/module'
if (dvInfo.value.id) { const appId:any = route.query.appId
url = url + '?dvId=' + dvInfo.value.id if (appId) {
url = url + '?id=' + appId
} }
if (styleChangeTimes.value > 0) { if (styleChangeTimes.value > 0) {
ElMessageBox.confirm(t('components.sure_to_exit'), { ElMessageBox.confirm(t('components.sure_to_exit'), {

View File

@ -73,6 +73,8 @@ const dvModel = 'dataV'
const outerParamsSetRef = ref(null) const outerParamsSetRef = ref(null)
const fullScreeRef = ref(null) const fullScreeRef = ref(null)
const userStore = useUserStoreWithOut() const userStore = useUserStoreWithOut()
import { useRoute } from 'vue-router'
const route = useRoute()
const { t } = useI18n() const { t } = useI18n()
const props = defineProps({ const props = defineProps({
@ -221,10 +223,13 @@ const editCanvasName = () => {
} }
const backToMain = () => { const backToMain = () => {
let url = '#/screen/index' let url = '#/module'
if (dvInfo.value.id) { const appId:any = route.query.appId
url = url + '?dvId=' + dvInfo.value.id if (appId) {
url = url + '?id=' + appId
} }
if (styleChangeTimes.value > 0) { if (styleChangeTimes.value > 0) {
ElMessageBox.confirm(t('visualization.change_save_tips'), { ElMessageBox.confirm(t('visualization.change_save_tips'), {
confirmButtonType: 'primary', confirmButtonType: 'primary',

View File

@ -103,6 +103,8 @@ function handleDatasetName(){ // 关键字搜索
const handleNodeClick = (data: any) => { // const handleNodeClick = (data: any) => { //
if(data.node_type == '02'){ if(data.node_type == '02'){
emit('handleNodeClick', data) emit('handleNodeClick', data)
}else{
emit('handleNodeClick', {})
} }
} }
function moreClic(event:any ,data:any){ // function moreClic(event:any ,data:any){ //
@ -123,7 +125,6 @@ function moreClic(event:any ,data:any){ // 更多操作
isTreeDrag.value = true isTreeDrag.value = true
} }
function editClic(data:any){ function editClic(data:any){
console.log(data)
if(data.type == '03'){ if(data.type == '03'){
window.open('/#/dvsCanvas?dvId=' + data.id+'&appId=' + projectInfo.value.id, '_blank'); window.open('/#/dvsCanvas?dvId=' + data.id+'&appId=' + projectInfo.value.id, '_blank');
}else if(data.type == '0301'){ }else if(data.type == '0301'){

View File

@ -10,8 +10,13 @@ const props = defineProps({
projectInfo: { projectInfo: {
type: String, type: String,
default: '' default: ''
},
treeInfo: {
type: String,
default: ''
} }
}) })
const treeInfo:any = ref({})
const appStore = useAppStoreWithOut() const appStore = useAppStoreWithOut()
const embeddedStore = useEmbedded() const embeddedStore = useEmbedded()
const dvMainStore = dvMainStoreWithOut() const dvMainStore = dvMainStoreWithOut()
@ -20,12 +25,27 @@ const isDataEaseBi = computed(() => appStore.getIsDataEaseBi)
const projectInfo:any=ref({ const projectInfo:any=ref({
}) })
watch(() => props.projectInfo, val => { watch(() => props.projectInfo, (val:any) => {
projectInfo.value = props.projectInfo projectInfo.value = val
}) })
watch(() => props.treeInfo, (val:any) => {
treeInfo.value = val
})
onMounted(()=>{ onMounted(()=>{
projectInfo.value = props.projectInfo projectInfo.value = props.projectInfo
}) })
function designClick(){
if(treeInfo.value.type == '03'){
window.open('/#/dvsCanvas?dvId=' + treeInfo.value.id+'&appId=' + projectInfo.value.id, '_blank');
}else if(treeInfo.value.type == '0301'){
window.open('/#/dashboard?resourceId=' + treeInfo.value.id + '&appId='+projectInfo.value.id, '_blank');
}else if(treeInfo.value.type == '04'||treeInfo.value.type == '05'||treeInfo.value.type == '06'){
window.open('/#/formcreatedesigner?moduleId=' +treeInfo.value.id + '&appId='+projectInfo.value.id, '_blank');
}
}
// //
const previewpage=()=>{ const previewpage=()=>{
if(dvInfo.value.id !== null){ if(dvInfo.value.id !== null){
@ -57,7 +77,7 @@ const initOpenHandler = newWindow => {
</div> </div>
<div class="project-header-right"> <div class="project-header-right">
<div class="preview-button" @click="previewpage">预览</div> <div class="preview-button" @click="previewpage">预览</div>
<div class="design-button">设计</div> <div class="design-button" @click="designClick">设计</div>
</div> </div>
</div> </div>
</template> </template>

View File

@ -23,6 +23,7 @@ const state = reactive({
dvInfo: null, dvInfo: null,
curPreviewGap: 0 curPreviewGap: 0
}) })
const treeInfo:any = ref({})
const dataInitState = ref(true) const dataInitState = ref(true)
const downloadStatus = ref(false) const downloadStatus = ref(false)
const dvPreviewRef = ref(null) const dvPreviewRef = ref(null)
@ -109,6 +110,7 @@ const loadCanvasData = (dvId, weight?, ext?) => {
} }
function handleNodeClick(e){ function handleNodeClick(e){
treeInfo.value = e
isFormCreate.value = false isFormCreate.value = false
dataInitState.value = false dataInitState.value = false
isNavbar.value = false isNavbar.value = false
@ -131,7 +133,7 @@ onBeforeMount(() => {
</script> </script>
<template> <template>
<div class="project-box"> <div class="project-box">
<Header :projectInfo="projectInfo"/> <Header :projectInfo="projectInfo" :treeInfo="treeInfo" />
<div class="project-content" v-if="applicationId != ''"> <div class="project-content" v-if="applicationId != ''">
<Leftmenu class="Leftmenu" v-if="applicationId != ''" :projectInfo="projectInfo" @handleNodeClick="handleNodeClick"/> <Leftmenu class="Leftmenu" v-if="applicationId != ''" :projectInfo="projectInfo" @handleNodeClick="handleNodeClick"/>
<dv-preview <dv-preview