Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
Vue-Dashboard
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高源
Vue-Dashboard
Commits
aa518835
Commit
aa518835
authored
Mar 17, 2025
by
高源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
外部图表功能添加
parent
d506034a
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
35 additions
and
30 deletions
+35
-30
index.html
dist/index.html
+2
-2
search-modal.vue
...layouts/modules/global-search/components/search-modal.vue
+1
-1
index.vue
src/layouts/modules/global-tab/index.vue
+1
-1
index.ts
src/router/routes/index.ts
+1
-1
index.ts
src/store/modules/route/index.ts
+2
-2
[url].vue
src/views/_builtin/iframe-page/[url].vue
+3
-3
extJs.vue
src/views/_builtin/iframe-page/extJs.vue
+2
-2
vueComponent.vue
src/views/_builtin/iframe-page/vueComponent.vue
+13
-4
webview.vue
src/views/_builtin/iframe-page/webview.vue
+2
-2
index.vue
src/views/home/index.vue
+8
-12
No files found.
dist/index.html
View file @
aa518835
<!doctype html>
<html
lang=
"zh-cmn-Hans"
>
<head>
<meta
name=
"buildTime"
content=
"2025-03-
06 10:17:29
"
>
<meta
name=
"buildTime"
content=
"2025-03-
17 14:02:13
"
>
<meta
charset=
"UTF-8"
/>
<link
rel=
"icon"
href=
"/favicon.svg"
/>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
/>
<meta
name=
"color-scheme"
content=
"light dark"
/>
<title>
VueDashboard
</title>
<script
type=
"module"
crossorigin
src=
"/Content/VueDashboardUi/VueDashboard1/assets/index-
ClligkOZ
.js"
></script>
<script
type=
"module"
crossorigin
src=
"/Content/VueDashboardUi/VueDashboard1/assets/index-
vhyBwSMe
.js"
></script>
<link
rel=
"stylesheet"
crossorigin
href=
"/Content/VueDashboardUi/VueDashboard1/assets/index-9k_B1ZU8.css"
>
</head>
<body>
...
...
src/layouts/modules/global-search/components/search-modal.vue
View file @
aa518835
...
...
@@ -76,7 +76,7 @@ function getActivePathIndex() {
function
handleEnter
()
{
if
(
resultOptions
.
value
?.
length
===
0
||
activePath
.
value
===
''
)
return
;
handleClose
();
console
.
log
(
'activePath'
,
activePath
.
value
);
//
console.log('activePath', activePath.value);
// const activePathValue = formatString(activePath.value);
// router.push(activePathValue);
router
.
push
(
activePath
.
value
);
...
...
src/layouts/modules/global-tab/index.vue
View file @
aa518835
...
...
@@ -149,7 +149,7 @@ async function handleContextMenu(e: MouseEvent, tabId: string) {
function
init
()
{
tabStore
.
initTabStore
(
route
);
console
.
log
(
tabStore
);
//
console.log(tabStore);
}
function
removeFocus
()
{
...
...
src/router/routes/index.ts
View file @
aa518835
...
...
@@ -195,7 +195,7 @@ const { data: menus } = await getRootMenu(
const
MenuThree
=
await
getMenuThree
(
menus
?.
MenusMain
?.
Results
);
const
MenuRoot
=
menus
?.
MenuRoot
;
console
.
log
(
MenuRoot
);
//
console.log(MenuRoot);
// 存储 MenuRoot 到 store
if
(
MenuRoot
)
{
...
...
src/store/modules/route/index.ts
View file @
aa518835
...
...
@@ -360,12 +360,12 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => {
/** 设置MenuRoot 如果数据不包含Kvid字段则返回不存储 */
function
setMenuRoot
(
data
:
Api
.
Menu
.
MenuRoot
)
{
if
(
!
data
.
Kvid
)
{
console
.
log
(
'MenuRoot数据不包含Kvid字段,不进行存储'
);
//
console.log('MenuRoot数据不包含Kvid字段,不进行存储');
return
;
}
menuRoot
.
value
=
data
;
console
.
log
(
'MenuRoot数据:'
,
data
);
//
console.log('MenuRoot数据:', data);
}
return
{
...
...
src/views/_builtin/iframe-page/[url].vue
View file @
aa518835
...
...
@@ -35,7 +35,7 @@ const tabCloseEventBus = useEventBus('tab-close');
// 清理所有资源的函数
const
cleanupResources
=
()
=>
{
console
.
log
(
'清理iframe-page资源'
);
//
console.log('清理iframe-page资源');
// 清理webview (iframe)
if
(
webviewRef
.
value
&&
typeof
webviewRef
.
value
.
cleanup
===
'function'
)
{
...
...
@@ -112,7 +112,7 @@ const loadExternalComponent = async (url: string) => {
loadModule
(
url
,
options
)
.
then
(
component
=>
{
asyncComponent
.
value
=
component
;
console
.
log
(
'Component loaded:'
,
asyncComponent
.
value
);
//
console.log('Component loaded:', asyncComponent.value);
})
.
catch
(
error
=>
{
console
.
error
(
'Error loading component:'
,
error
);
...
...
@@ -127,7 +127,7 @@ const handleMenuAccess = async () => {
// 确保 DOM 已准备好
await
nextTick
();
console
.
log
(
'Processing:'
,
{
url
,
kvid
,
type
});
//
console.log('Processing:', { url, kvid, type });
const
origin
=
window
.
location
.
origin
;
// 创建后端地址 - 假设后端在80端口
const
backendOrigin
=
origin
.
replace
(
':8080'
,
':80'
);
...
...
src/views/_builtin/iframe-page/extJs.vue
View file @
aa518835
...
...
@@ -44,7 +44,7 @@ function updateExtComponent(newUrl: string) {
// 清理函数 - 完全销毁ExtJS组件
function
cleanup
()
{
console
.
log
(
'清理ExtJS资源'
);
//
console.log('清理ExtJS资源');
if
(
extComponent
)
{
try
{
...
...
@@ -57,7 +57,7 @@ function cleanup() {
container
.
innerHTML
=
''
;
}
}
catch
(
e
)
{
console
.
error
(
'清理ExtJS组件时出错:'
,
e
);
//
console.error('清理ExtJS组件时出错:', e);
}
// 清空引用
...
...
src/views/_builtin/iframe-page/vueComponent.vue
View file @
aa518835
...
...
@@ -12,7 +12,10 @@ import {
import
{
NConfigProvider
,
darkTheme
}
from
'naive-ui'
;
import
*
as
naive
from
'naive-ui'
;
import
axios
from
'axios'
;
import
*
as
echarts
from
'echarts/core'
;
import
{
useThemeStore
}
from
'@/store/modules/theme'
;
// 引入echarts相关
import
{
useEcharts
}
from
'@/hooks/common/echarts'
;
defineOptions
({
name
:
'VueComponent'
});
...
...
@@ -41,16 +44,22 @@ Object.keys(naive).forEach(key => {
declare
global
{
interface
Window
{
$axios
:
typeof
axios
;
$echarts
:
typeof
echarts
;
$useEcharts
:
typeof
useEcharts
;
$themeStore
:
typeof
themeStore
;
}
}
// 全局注入axios
(
window
as
any
).
$axios
=
axios
;
// 全局注入echarts和useEcharts
(
window
as
any
).
$echarts
=
echarts
;
(
window
as
any
).
$useEcharts
=
useEcharts
;
// 全局注入主题存储
(
window
as
any
).
$themeStore
=
themeStore
;
// 清理函数 - 完全销毁Vue组件
function
cleanup
()
{
console
.
log
(
'清理Vue组件资源'
);
try
{
// 清空组件引用
asyncComponent
.
value
=
null
;
...
...
@@ -61,7 +70,7 @@ function cleanup() {
container
.
innerHTML
=
''
;
}
}
catch
(
e
)
{
console
.
error
(
'清理Vue组件时出错:'
,
e
);
//
console.error('清理Vue组件时出错:', e);
}
}
...
...
@@ -75,7 +84,7 @@ onMounted(async () => {
asyncComponent
.
value
=
props
.
url
;
isActive
.
value
=
true
;
}
catch
(
err
)
{
console
.
error
(
'组件加载错误:'
,
err
);
//
console.error('组件加载错误:', err);
error
.
value
=
true
;
}
finally
{
loading
.
value
=
false
;
...
...
src/views/_builtin/iframe-page/webview.vue
View file @
aa518835
...
...
@@ -40,7 +40,7 @@ function updateExtComponent(newUrl: string) {
// 清理函数 - 完全销毁iframe
function
cleanup
()
{
console
.
log
(
'清理webview资源'
);
//
console.log('清理webview资源');
if
(
iframeEl
)
{
try
{
...
...
@@ -53,7 +53,7 @@ function cleanup() {
container
.
removeChild
(
iframeEl
);
}
}
catch
(
e
)
{
console
.
error
(
'清理iframe时出错:'
,
e
);
//
console.error('清理iframe时出错:', e);
}
// 清空引用
...
...
src/views/home/index.vue
View file @
aa518835
<
script
setup
lang=
"ts"
>
import
{
onActivated
,
onDeactivated
,
computed
,
watch
,
ref
,
onMounted
,
onUnmounted
}
from
'vue'
;
import
{
onActivated
,
onDeactivated
,
computed
,
watch
,
ref
,
onMounted
,
onUnmounted
}
from
'vue'
;
import
{
useAppStore
}
from
'@/store/modules/app'
;
import
{
useRouteStore
}
from
'@/store/modules/route'
;
import
HeaderBanner
from
'./modules/header-banner.vue'
;
...
...
@@ -51,12 +51,12 @@ onDeactivated(() => {
});
// 监听 MenuRoot 变化
watch
(
menuRoot
,
async
(
newValue
)
=>
{
console
.
log
(
'MenuRoot updated:'
,
newValue
);
//
console.log('MenuRoot updated:', newValue);
if
(
newValue
)
{
const
{
data
}
=
await
getDefaultMenu
(
`/Restful/Kivii.Basic.Entities.Menu/Query.json?ParentKvid=
${
newValue
.
Kvid
}
&isRelateFunction=true`
);
console
.
log
(
'Menu data:'
,
data
);
//
console.log('Menu data:', data);
if
(
data
?.
Results
&&
data
?.
Results
.
length
>
0
)
{
const
autoStartItem
=
data
?.
Results
.
find
(
item
=>
{
...
...
@@ -64,7 +64,7 @@ watch(menuRoot, async (newValue) => {
const
params
=
JSON
.
parse
(
item
.
Parameters
||
'{}'
);
return
params
.
AutoStartup
===
'true'
;
}
catch
(
error
)
{
console
.
error
(
'Parameters parse error:'
,
error
);
//
console.error('Parameters parse error:', error);
return
false
;
}
});
...
...
@@ -76,7 +76,7 @@ watch(menuRoot, async (newValue) => {
kvid
:
autoStartItem
.
Kvid
,
url
:
''
};
console
.
log
(
'autoStartProps:'
,
autoStartProps
.
value
);
//
console.log('autoStartProps:', autoStartProps.value);
}
}
}
...
...
@@ -98,14 +98,10 @@ const gap = computed(() => (appStore.isMobile ? 0 : 16));
</NGi>
</NGrid>
<!-- 添加 IframePage 组件,增加 isExtjsRootReady 检查 -->
<template
v-if=
"isExtjsRootReady"
>
<template
v-if=
"isExtjsRootReady"
>
<div
v-show=
"isActive"
:id=
"extjsContainerId"
style=
"width: 100%; height: 100%"
>
<IframePage
v-if=
"autoStartProps.type"
:type=
"autoStartProps.type"
:kvid=
"autoStartProps.kvid"
:url=
"autoStartProps.url"
/>
<IframePage
v-if=
"autoStartProps.type"
:type=
"autoStartProps.type"
:kvid=
"autoStartProps.kvid"
:url=
"autoStartProps.url"
/>
</div>
</
template
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment