切换不了页面问题
This commit is contained in:
parent
64857adc03
commit
5124f180a6
@ -26,7 +26,7 @@ import { storeToRefs } from 'pinia'
|
|||||||
import { useI18n } from '@/data-visualization/hooks/web/useI18n'
|
import { useI18n } from '@/data-visualization/hooks/web/useI18n'
|
||||||
import { dvMainStoreWithOut } from '@/data-visualization/store/modules/data-visualization/dvMain'
|
import { dvMainStoreWithOut } from '@/data-visualization/store/modules/data-visualization/dvMain'
|
||||||
import { comInfo } from './com-info'
|
import { comInfo } from './com-info'
|
||||||
// import { useEmitt } from '@/data-visualization/hooks/web/useEmitt'
|
import { useEmitt } from '@/data-visualization/hooks/web/useEmitt'
|
||||||
import StyleInject from './StyleInject.vue'
|
import StyleInject from './StyleInject.vue'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
view: {
|
view: {
|
||||||
@ -241,7 +241,7 @@ const onComponentClick = () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// const { emitter } = useEmitt()
|
const { emitter } = useEmitt()
|
||||||
const unMountSelect = shallowRef([])
|
const unMountSelect = shallowRef([])
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
unMountSelect.value = list.value.map(ele => ele.id)
|
unMountSelect.value = list.value.map(ele => ele.id)
|
||||||
|
@ -389,11 +389,16 @@ export async function initCanvasData(dvId, busiFlag, callBack) {
|
|||||||
dvMainStore.setCanvasViewInfo(canvasViewInfoPreview)
|
dvMainStore.setCanvasViewInfo(canvasViewInfoPreview)
|
||||||
// 刷新联动信息
|
// 刷新联动信息
|
||||||
getPanelAllLinkageInfo(dvInfo.id).then(rsp => {
|
getPanelAllLinkageInfo(dvInfo.id).then(rsp => {
|
||||||
dvMainStore.setNowPanelTrackInfo(rsp.data)
|
if(rsp && rsp.data){
|
||||||
|
dvMainStore.setNowPanelTrackInfo(rsp.data)
|
||||||
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
// 刷新跳转信息
|
// 刷新跳转信息
|
||||||
queryVisualizationJumpInfo(dvInfo.id).then(rsp => {
|
queryVisualizationJumpInfo(dvInfo.id).then(rsp => {
|
||||||
dvMainStore.setNowPanelJumpInfo(rsp.data)
|
if(rsp && rsp.data){
|
||||||
|
dvMainStore.setNowPanelJumpInfo(rsp.data)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
callBack({ canvasDataResult, canvasStyleResult, dvInfo, canvasViewInfoPreview })
|
callBack({ canvasDataResult, canvasStyleResult, dvInfo, canvasViewInfoPreview })
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, watch, onMounted, onBeforeUnmount, shallowRef } from 'vue'
|
import { ref, watch, onMounted, onBeforeUnmount, shallowRef, nextTick } from 'vue'
|
||||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||||
// import Assocmodule from '@/viewsnew/application/SfcEditor/NavbarEditor/assocPage.vue'
|
// import Assocmodule from '@/viewsnew/application/SfcEditor/NavbarEditor/assocPage.vue'
|
||||||
import PermissionSet from '@/views/system/manage/index.vue'
|
import PermissionSet from '@/views/system/manage/index.vue'
|
||||||
@ -7,6 +7,7 @@ import UserInfoSet from '@/views/system/manage/user/userinfo.vue'
|
|||||||
import { useRoute, useRouter } from 'vue-router'
|
import { useRoute, useRouter } from 'vue-router'
|
||||||
import dataVisualization from '@/data-visualization/index.vue'
|
import dataVisualization from '@/data-visualization/index.vue'
|
||||||
import FormCreate from '@/views/BuiltInPage/FormCreate.vue'
|
import FormCreate from '@/views/BuiltInPage/FormCreate.vue'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const navtitle: any = ref('')
|
const navtitle: any = ref('')
|
||||||
const navmenulist: any = ref([
|
const navmenulist: any = ref([
|
||||||
@ -23,9 +24,36 @@ function menuclick(index: any) {
|
|||||||
checkindex.value = index
|
checkindex.value = index
|
||||||
currentMoudleId.value = navmenulist.value[index].module_id
|
currentMoudleId.value = navmenulist.value[index].module_id
|
||||||
if (navmenulist.value[index].module_id && navmenulist.value[index].module_id !== '') {
|
if (navmenulist.value[index].module_id && navmenulist.value[index].module_id !== '') {
|
||||||
showcontent.value = ''
|
showcontent.value = ''
|
||||||
|
currentMoudleType.value = ''
|
||||||
currentMoudleId.value = navmenulist.value[index].module_id
|
currentMoudleId.value = navmenulist.value[index].module_id
|
||||||
currentrow.value = navmenulist.value[index]
|
currentrow.value = navmenulist.value[index]
|
||||||
|
nextTick(() => {
|
||||||
|
if (currentrow.value.module_type == '03') {
|
||||||
|
currentMoudleType.value = 'dataV'
|
||||||
|
showcontent.value = 'dataVisualization'
|
||||||
|
} else if (currentrow.value.module_type == '0301') {
|
||||||
|
currentMoudleType.value = 'dashboard'
|
||||||
|
showcontent.value = 'dataVisualization'
|
||||||
|
} else if (currentrow.value.module_type == '05') {
|
||||||
|
showcontent.value = 'FormCreate'
|
||||||
|
}
|
||||||
|
const currentInfo = {
|
||||||
|
showcontent: showcontent.value,
|
||||||
|
currentrow: currentrow.value
|
||||||
|
}
|
||||||
|
localStorage.setItem('currentInfo', JSON.stringify(currentInfo))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function childmenuclick(item: any) {
|
||||||
|
if (item.module_id && item.module_id !== '') {
|
||||||
|
showcontent.value = ''
|
||||||
|
currentMoudleType.value = ''
|
||||||
|
currentrow.value = item
|
||||||
|
currentMoudleId.value = item.module_id
|
||||||
|
nextTick(() => {
|
||||||
if (currentrow.value.module_type == '03') {
|
if (currentrow.value.module_type == '03') {
|
||||||
currentMoudleType.value = 'dataV'
|
currentMoudleType.value = 'dataV'
|
||||||
showcontent.value = 'dataVisualization'
|
showcontent.value = 'dataVisualization'
|
||||||
@ -40,28 +68,7 @@ function menuclick(index: any) {
|
|||||||
currentrow: currentrow.value
|
currentrow: currentrow.value
|
||||||
}
|
}
|
||||||
localStorage.setItem('currentInfo', JSON.stringify(currentInfo))
|
localStorage.setItem('currentInfo', JSON.stringify(currentInfo))
|
||||||
}
|
})
|
||||||
}
|
|
||||||
}
|
|
||||||
function childmenuclick(item: any) {
|
|
||||||
showcontent.value = ''
|
|
||||||
if (item.module_id && item.module_id !== '') {
|
|
||||||
currentrow.value = item
|
|
||||||
currentMoudleId.value = item.module_id
|
|
||||||
if (currentrow.value.module_type == '03') {
|
|
||||||
currentMoudleType.value = 'dataV'
|
|
||||||
showcontent.value = 'dataVisualization'
|
|
||||||
} else if (currentrow.value.module_type == '0301') {
|
|
||||||
currentMoudleType.value = 'dashboard'
|
|
||||||
showcontent.value = 'dataVisualization'
|
|
||||||
} else if (currentrow.value.module_type == '05') {
|
|
||||||
showcontent.value = 'FormCreate'
|
|
||||||
}
|
|
||||||
const currentInfo = {
|
|
||||||
showcontent: showcontent.value,
|
|
||||||
currentrow: currentrow.value
|
|
||||||
}
|
|
||||||
localStorage.setItem('currentInfo', JSON.stringify(currentInfo))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 时间相关逻辑移动到独立组件中
|
// 时间相关逻辑移动到独立组件中
|
||||||
@ -109,17 +116,19 @@ onMounted(() => {
|
|||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
|
||||||
});
|
});
|
||||||
function init(){
|
function init() {
|
||||||
|
showcontent.value = ''
|
||||||
|
currentMoudleType.value = ''
|
||||||
userList.value = JSON.parse(localStorage.getItem('userInfo') || '{}')
|
userList.value = JSON.parse(localStorage.getItem('userInfo') || '{}')
|
||||||
navtitle.value = userList.value.app_name
|
navtitle.value = userList.value.app_name
|
||||||
applicationId.value = userList.id
|
applicationId.value = userList.id
|
||||||
const permissions:any = JSON.parse(localStorage.getItem('permissions')|| '{}')
|
const permissions: any = JSON.parse(localStorage.getItem('permissions') || '{}')
|
||||||
navmenulist.value = gettreeData(permissions)
|
navmenulist.value = gettreeData(permissions)
|
||||||
const currentInfo:any = JSON.parse(localStorage.getItem('currentInfo')|| '{}')
|
const currentInfo: any = JSON.parse(localStorage.getItem('currentInfo') || '{}')
|
||||||
if (currentInfo?.showcontent) {
|
if (currentInfo?.showcontent) {
|
||||||
if(currentInfo.showcontent !=='FormCreate' && currentInfo.showcontent !=='dataVisualization'){
|
if (currentInfo.showcontent !== 'FormCreate' && currentInfo.showcontent !== 'dataVisualization') {
|
||||||
showcontent.value = currentInfo.showcontent
|
showcontent.value = currentInfo.showcontent
|
||||||
}else{
|
} else {
|
||||||
currentrow.value = currentInfo.currentrow
|
currentrow.value = currentInfo.currentrow
|
||||||
if (currentrow.value.module_type == '03') {
|
if (currentrow.value.module_type == '03') {
|
||||||
currentMoudleType.value = 'dataV'
|
currentMoudleType.value = 'dataV'
|
||||||
@ -133,14 +142,14 @@ function init(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function gettreeData(orglist:any) {
|
function gettreeData(orglist: any) {
|
||||||
const res:any = {};
|
const res: any = {};
|
||||||
for (const row of orglist) {
|
for (const row of orglist) {
|
||||||
// 处理 parentid 并解构需要字段
|
// 处理 parentid 并解构需要字段
|
||||||
const parentid = row.parentid || "0";
|
const parentid = row.parentid || "0";
|
||||||
const { id, name,code, isdisplay, appId, type,module_id,module_type } = row;
|
const { id, name, code, isdisplay, appId, type, module_id, module_type } = row;
|
||||||
// 统一节点数据对象
|
// 统一节点数据对象
|
||||||
const nodeData = { parentid, id, name,code, isdisplay, appId, type,module_id,module_type }
|
const nodeData = { parentid, id, name, code, isdisplay, appId, type, module_id, module_type }
|
||||||
// 更新或创建节点
|
// 更新或创建节点
|
||||||
if (res[id]) {
|
if (res[id]) {
|
||||||
Object.assign(res[id], nodeData);
|
Object.assign(res[id], nodeData);
|
||||||
@ -164,7 +173,7 @@ function permissionClick() {
|
|||||||
}
|
}
|
||||||
localStorage.setItem('currentInfo', JSON.stringify(currentInfo))
|
localStorage.setItem('currentInfo', JSON.stringify(currentInfo))
|
||||||
}
|
}
|
||||||
function routerlink(){
|
function routerlink() {
|
||||||
router.push({ path: '/UserLogin' })
|
router.push({ path: '/UserLogin' })
|
||||||
}
|
}
|
||||||
function logout() {
|
function logout() {
|
||||||
@ -235,11 +244,11 @@ function userdetails() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="system-box-content" style="height: calc(100vh - 65px);">
|
<div class="system-box-content" style="height: calc(100vh - 65px);">
|
||||||
<dataVisualization v-if="showcontent == 'dataVisualization'" :appId="currentrow.module_id"
|
<dataVisualization v-if="showcontent === 'dataVisualization'" :appId="currentrow.module_id"
|
||||||
:busiFlag="currentMoudleType" />
|
:busiFlag="currentMoudleType" />
|
||||||
<FormCreate v-if="showcontent == 'FormCreate'" :appId="currentrow.module_id" />
|
<FormCreate v-if="showcontent === 'FormCreate'" :appId="currentrow.module_id" />
|
||||||
<PermissionSet v-if="showcontent == 'PermissionSet'" :isshowheader="true" />
|
<PermissionSet v-if="showcontent === 'PermissionSet'" :isshowheader="true" />
|
||||||
<UserInfoSet v-if="showcontent == 'UserInfoSet'" :userList="userList" :applicationId="applicationId" />
|
<UserInfoSet v-if="showcontent === 'UserInfoSet'" :userList="userList" :applicationId="applicationId" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
Loading…
Reference in New Issue
Block a user