Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
bdc
/
bdcjg-web
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
9aa814ee
authored
2023-02-17 16:48:27 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:地图
1 parent
d2ed8625
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
13 deletions
src/common/echart/index.vue
src/components/Echart/Map/Chart.vue
src/layout/components/Navbar.vue
src/common/echart/index.vue
View file @
9aa814e
<
template
>
<div
:id=
"id"
:class=
"className"
:style=
"
{ height: height, width: width }" />
</
template
>
<
template
><div
:id=
"id"
:class=
"className"
:style=
"
{ height: height, width: width }" />
</
template
>
<
script
>
import
tdTheme
from
"./theme.json"
;
// 引入默认主题
import
"../map/hanzhong.js"
;
export
default
{
name
:
"echart"
,
props
:
{
...
...
@@ -30,14 +26,14 @@ export default {
default
:
()
=>
({}),
},
},
data
()
{
data
()
{
return
{
chart
:
null
,
};
},
watch
:
{
options
:
{
handler
(
options
)
{
handler
(
options
)
{
// 设置true清空echart缓存
this
.
chart
.
setOption
(
options
,
true
);
window
.
addEventListener
(
"resize"
,
()
=>
{
...
...
@@ -49,19 +45,19 @@ export default {
deep
:
true
,
},
},
mounted
()
{
mounted
()
{
this
.
$echarts
.
registerTheme
(
"tdTheme"
,
tdTheme
);
// 覆盖默认主题
this
.
initChart
();
},
beforeDestroy
()
{
beforeDestroy
()
{
this
.
chart
.
dispose
();
this
.
chart
=
null
;
},
methods
:
{
initChart
()
{
initChart
()
{
// 初始化echart
this
.
chart
=
this
.
$echarts
.
init
(
this
.
$el
,
"tdTheme"
);
function
nowSize
(
val
,
initWidth
=
1920
)
{
function
nowSize
(
val
,
initWidth
=
1920
)
{
return
val
*
(
nowClientWidth
/
initWidth
);
}
this
.
chart
.
setOption
(
this
.
options
,
true
);
...
...
src/components/Echart/Map/Chart.vue
View file @
9aa814e
...
...
@@ -18,6 +18,9 @@ export default {
components
:
{
Echart
,
},
created
()
{
require
(
`@/common/map/hanzhong.js`
)
},
props
:
{
cdata
:
{
type
:
Array
,
...
...
@@ -98,7 +101,7 @@ export default {
geo
:
{
aspectScale
:
1
,
//长宽比
zoom
:
1.1
,
mapType
:
'
汉中市
'
,
// 自定义扩展图表类型
mapType
:
''
,
// 自定义扩展图表类型
top
:
'15%'
,
left
:
'10%'
,
map
:
'汉中市'
,
...
...
src/layout/components/Navbar.vue
View file @
9aa814e
...
...
@@ -2,7 +2,7 @@
<div
class=
"navbar-con"
>
<div
class=
"navbar"
>
<div
class=
"title"
>
{{
logoName
[
0
].
DNAME
}}
{{
logoName
[
0
]
&&
logoName
[
0
]
.
DNAME
}}
</div>
<div
class=
"user"
>
欢迎进入系统
{{
userInfo
.
name
}}
...
...
Please
register
or
sign in
to post a comment