修改
This commit is contained in:
parent
a236819f94
commit
fe5ff3c61d
@ -8,9 +8,7 @@ import {useRoute, useRouter } from 'vue-router'
|
|||||||
import { useCache } from '@/data-visualization/hooks/web/useCache'
|
import { useCache } from '@/data-visualization/hooks/web/useCache'
|
||||||
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 { wsCache } = useCache()
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
menuList: {
|
menuList: {
|
||||||
type: Array, // 根据实际数据结构调整
|
type: Array, // 根据实际数据结构调整
|
||||||
@ -40,11 +38,11 @@ watch(
|
|||||||
{ immediate: true } // 立即执行一次
|
{ immediate: true } // 立即执行一次
|
||||||
)
|
)
|
||||||
function menuclick(index: any) {
|
function menuclick(index: any) {
|
||||||
showcontent.value = ''
|
|
||||||
if (navmenulist.value[index].children.length == 0 || navmenulist.value[index].children == undefined) {
|
if (navmenulist.value[index].children.length == 0 || navmenulist.value[index].children == undefined) {
|
||||||
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 = ''
|
||||||
currentMoudleId.value = navmenulist.value[index].module_id
|
currentMoudleId.value = navmenulist.value[index].module_id
|
||||||
currentrow.value = navmenulist.value[index]
|
currentrow.value = navmenulist.value[index]
|
||||||
if (currentrow.value.module_type == '03') {
|
if (currentrow.value.module_type == '03') {
|
||||||
@ -53,7 +51,14 @@ function menuclick(index: any) {
|
|||||||
} else if (currentrow.value.module_type == '0301') {
|
} else if (currentrow.value.module_type == '0301') {
|
||||||
currentMoudleType.value = 'dashboard'
|
currentMoudleType.value = 'dashboard'
|
||||||
showcontent.value = 'dataVisualization'
|
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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -71,6 +76,11 @@ function childmenuclick(item: any) {
|
|||||||
} else if (currentrow.value.module_type == '05') {
|
} else if (currentrow.value.module_type == '05') {
|
||||||
showcontent.value = 'FormCreate'
|
showcontent.value = 'FormCreate'
|
||||||
}
|
}
|
||||||
|
const currentInfo = {
|
||||||
|
showcontent: showcontent.value,
|
||||||
|
currentrow: currentrow.value
|
||||||
|
}
|
||||||
|
localStorage.setItem('currentInfo', JSON.stringify(currentInfo))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 时间相关逻辑移动到独立组件中
|
// 时间相关逻辑移动到独立组件中
|
||||||
@ -116,12 +126,34 @@ onMounted(() => {
|
|||||||
navmenulist.value = props.menuList
|
navmenulist.value = props.menuList
|
||||||
navtitle.value = props.projectName
|
navtitle.value = props.projectName
|
||||||
userList.value = JSON.parse(localStorage.getItem('userInfo'))
|
userList.value = JSON.parse(localStorage.getItem('userInfo'))
|
||||||
|
const currentInfo:any = JSON.parse(localStorage.getItem('currentInfo'))
|
||||||
|
if (currentInfo?.showcontent) {
|
||||||
|
if(currentInfo.showcontent !=='FormCreate' && currentInfo.showcontent !=='dataVisualization'){
|
||||||
|
showcontent.value = currentInfo.showcontent
|
||||||
|
}else{
|
||||||
|
currentrow.value = currentInfo.currentrow
|
||||||
|
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'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
onBeforeUnmount(() => {
|
onBeforeUnmount(() => {
|
||||||
|
|
||||||
});
|
});
|
||||||
function permissionClick() {
|
function permissionClick() {
|
||||||
showcontent.value = 'PermissionSet'
|
showcontent.value = 'PermissionSet'
|
||||||
|
const currentInfo = {
|
||||||
|
showcontent: showcontent.value,
|
||||||
|
currentrow: currentrow.value
|
||||||
|
}
|
||||||
|
localStorage.setItem('currentInfo', JSON.stringify(currentInfo))
|
||||||
}
|
}
|
||||||
function logout() {
|
function logout() {
|
||||||
ElMessageBox.confirm(
|
ElMessageBox.confirm(
|
||||||
@ -137,6 +169,7 @@ function logout(){
|
|||||||
localStorage.removeItem('token')
|
localStorage.removeItem('token')
|
||||||
localStorage.removeItem('userInfo')
|
localStorage.removeItem('userInfo')
|
||||||
localStorage.removeItem('permissions')
|
localStorage.removeItem('permissions')
|
||||||
|
localStorage.removeItem('currentInfo')
|
||||||
router.push({
|
router.push({
|
||||||
path: '/UserLogin',
|
path: '/UserLogin',
|
||||||
})
|
})
|
||||||
@ -145,6 +178,11 @@ function logout(){
|
|||||||
}
|
}
|
||||||
function userdetails() {
|
function userdetails() {
|
||||||
showcontent.value = 'UserInfoSet'
|
showcontent.value = 'UserInfoSet'
|
||||||
|
const currentInfo = {
|
||||||
|
showcontent: showcontent.value,
|
||||||
|
currentrow: currentrow.value
|
||||||
|
}
|
||||||
|
localStorage.setItem('currentInfo', JSON.stringify(currentInfo))
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
@ -176,15 +214,19 @@ function userdetails(){
|
|||||||
<div class="Navbar-box-right">
|
<div class="Navbar-box-right">
|
||||||
<div style="margin-right: 10px;cursor: pointer;" @click="permissionClick"><img
|
<div style="margin-right: 10px;cursor: pointer;" @click="permissionClick"><img
|
||||||
src="@/assets/system/navpermission.png" alt=""></div>
|
src="@/assets/system/navpermission.png" alt=""></div>
|
||||||
<div style="margin-right: 10px;cursor: pointer;" @click="userdetails"><img src="@/assets/system/nav1.png" alt=""></div>
|
<div style="margin-right: 10px;cursor: pointer;" @click="userdetails"><img src="@/assets/system/nav1.png"
|
||||||
<div style="margin-right: 15px;min-width: 45px;cursor: pointer;" @click="userdetails">{{ userList.nickname }}</div>
|
alt="">
|
||||||
|
</div>
|
||||||
|
<div style="margin-right: 15px;min-width: 45px;cursor: pointer;" @click="userdetails">{{ userList.nickname }}
|
||||||
|
</div>
|
||||||
<div style="margin-right: 15px;cursor: pointer;"><img src="@/assets/system/nav3.png" alt=""></div>
|
<div style="margin-right: 15px;cursor: pointer;"><img src="@/assets/system/nav3.png" alt=""></div>
|
||||||
<div @click="logout" style="cursor: pointer;"><img src="@/assets/system/nav4.png" alt=""></div>
|
<div @click="logout" style="cursor: pointer;"><img src="@/assets/system/nav4.png" alt=""></div>
|
||||||
</div>
|
</div>
|
||||||
</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" :busiFlag="currentMoudleType" />
|
<dataVisualization v-if="showcontent == 'dataVisualization'" :appId="currentrow.module_id"
|
||||||
|
: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="props.applicationId" />
|
<UserInfoSet v-if="showcontent == 'UserInfoSet'" :userList="userList" :applicationId="props.applicationId" />
|
||||||
|
@ -8,7 +8,6 @@ import { i18n } from '@/data-visualization/plugins/vue-i18n'
|
|||||||
import * as ElementPlus from 'element-plus'
|
import * as ElementPlus from 'element-plus'
|
||||||
import less from 'less'
|
import less from 'less'
|
||||||
import defaultTemplate from '@/views/system/userlogin/login.vue?raw'
|
import defaultTemplate from '@/views/system/userlogin/login.vue?raw'
|
||||||
// import { moduleList, moduleById } from '@/api/application/module'
|
|
||||||
import { userLogin } from '@/api/data-visualization/manage/user'
|
import { userLogin } from '@/api/data-visualization/manage/user'
|
||||||
import { useCache } from '@/data-visualization/hooks/web/useCache'
|
import { useCache } from '@/data-visualization/hooks/web/useCache'
|
||||||
import { encrypt,decrypt } from '@/utils/rsaEncrypt';
|
import { encrypt,decrypt } from '@/utils/rsaEncrypt';
|
||||||
@ -76,7 +75,7 @@ const runCode = async () => {
|
|||||||
try {
|
try {
|
||||||
const response = await fetch(resolvedPath)
|
const response = await fetch(resolvedPath)
|
||||||
return { content: await response.text() }
|
return { content: await response.text() }
|
||||||
} catch (e) {
|
} catch (e:any) {
|
||||||
console.error(`文件加载失败: ${resolvedPath}`, e)
|
console.error(`文件加载失败: ${resolvedPath}`, e)
|
||||||
return { content: '<!-- 文件加载失败 -->' }
|
return { content: '<!-- 文件加载失败 -->' }
|
||||||
}
|
}
|
||||||
@ -94,7 +93,7 @@ const runCode = async () => {
|
|||||||
filename: 'dynamic.less'
|
filename: 'dynamic.less'
|
||||||
})
|
})
|
||||||
code = code.replace(full, `<style>${css}</style>`)
|
code = code.replace(full, `<style>${css}</style>`)
|
||||||
} catch (e) {
|
} catch (e:any) {
|
||||||
console.error('Less编译错误:', e.message)
|
console.error('Less编译错误:', e.message)
|
||||||
code = code.replace(full, `<style>/* Less Error: ${e.message} */</style>`)
|
code = code.replace(full, `<style>/* Less Error: ${e.message} */</style>`)
|
||||||
}
|
}
|
||||||
@ -121,7 +120,7 @@ const runCode = async () => {
|
|||||||
const content = await response.text()
|
const content = await response.text()
|
||||||
const { css } = await less.render(content, { filename: fileName })
|
const { css } = await less.render(content, { filename: fileName })
|
||||||
return { content: css, mediaType: 'text/css' }
|
return { content: css, mediaType: 'text/css' }
|
||||||
} catch (e) {
|
} catch (e:any) {
|
||||||
return { content: `/* Less Error: ${e.message} */`, mediaType: 'text/css' }
|
return { content: `/* Less Error: ${e.message} */`, mediaType: 'text/css' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user