Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zc-qiyewx-app
Project
Project
Details
Activity
Releases
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
杨勇飞
zc-qiyewx-app
Commits
044e129e
You need to sign in or sign up before continuing.
Commit
044e129e
authored
Feb 12, 2025
by
杨勇飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
v
parent
1cb744ba
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
122 additions
and
3 deletions
+122
-3
index.vue
pages/index/index.vue
+122
-3
No files found.
pages/index/index.vue
View file @
044e129e
...
@@ -172,10 +172,20 @@
...
@@ -172,10 +172,20 @@
</view>
</view>
</view>
</view>
<scroll-view
class=
"chart-scroll"
scroll-x
>
<scroll-view
class=
"chart-scroll"
scroll-x
>
<view
>
11111111111111111
</view>
<view
class=
"chart-wrapper"
id=
"myChart"
></view>
<view
class=
"chart-wrapper"
id=
"myChart"
></view>
<view
>
11111111111111111
</view>
</scroll-view>
</scroll-view>
</view>
</view>
<!-- 项目运营情况图表 -->
<view
class=
"operation-chart-container"
>
<view
class=
"chart-header"
>
<text
class=
"chart-title"
>
项目运营情况
</text>
</view>
<view
class=
"chart-wrapper"
id=
"operationChart"
></view>
</view>
<!-- 项目运营表格 -->
<!-- 项目运营表格 -->
<view
class=
"table-container"
>
<view
class=
"table-container"
>
<text
class=
"table-title"
>
项目运营情况
</text>
<text
class=
"table-title"
>
项目运营情况
</text>
...
@@ -204,6 +214,7 @@ import { uniIcons } from '@dcloudio/uni-ui'
...
@@ -204,6 +214,7 @@ import { uniIcons } from '@dcloudio/uni-ui'
loading
:
false
,
loading
:
false
,
activeTime
:
'today'
,
activeTime
:
'today'
,
myChart
:
null
,
myChart
:
null
,
operationChart
:
null
,
sortType
:
'receivable'
,
sortType
:
'receivable'
,
// 所有时间维度的数据集合
// 所有时间维度的数据集合
...
@@ -372,8 +383,9 @@ import { uniIcons } from '@dcloudio/uni-ui'
...
@@ -372,8 +383,9 @@ import { uniIcons } from '@dcloudio/uni-ui'
}
}
},
},
mounted
()
{
mounted
()
{
this
.
initChart
()
this
.
$nextTick
(()
=>
{
this
.
$nextTick
(()
=>
{
this
.
initChart
()
this
.
initOperationChart
()
this
.
sortChart
(
'receivable'
)
this
.
sortChart
(
'receivable'
)
window
.
addEventListener
(
'resize'
,
this
.
onResize
)
window
.
addEventListener
(
'resize'
,
this
.
onResize
)
})
})
...
@@ -468,6 +480,90 @@ import { uniIcons } from '@dcloudio/uni-ui'
...
@@ -468,6 +480,90 @@ import { uniIcons } from '@dcloudio/uni-ui'
}
}
this
.
myChart
.
setOption
(
option
)
this
.
myChart
.
setOption
(
option
)
console
.
log
(
option
)
console
.
log
(
'------------------this.initChart.setOption'
+
option
)
},
initOperationChart
()
{
this
.
operationChart
=
echarts
.
init
(
document
.
getElementById
(
'operationChart'
))
const
option
=
{
tooltip
:
{
trigger
:
'axis'
,
axisPointer
:
{
type
:
'shadow'
}
},
legend
:
{
data
:
[
'收入'
,
'支出'
,
'利润率'
],
right
:
10
,
top
:
0
},
grid
:
{
left
:
'3%'
,
right
:
'4%'
,
bottom
:
'3%'
,
containLabel
:
true
},
xAxis
:
[{
type
:
'category'
,
data
:
[
'项目A'
,
'项目B'
,
'项目C'
,
'项目D'
,
'项目E'
],
axisLabel
:
{
interval
:
0
,
rotate
:
30
}
}],
yAxis
:
[
{
type
:
'value'
,
name
:
'金额'
,
axisLabel
:
{
formatter
:
'{value} 万'
}
},
{
type
:
'value'
,
name
:
'利润率'
,
axisLabel
:
{
formatter
:
'{value} %'
}
}
],
series
:
[
{
name
:
'收入'
,
type
:
'bar'
,
barGap
:
0
,
data
:
[
50
,
45
,
40
,
38
,
35
],
itemStyle
:
{
color
:
'#FF4D4F'
}
},
{
name
:
'支出'
,
type
:
'bar'
,
data
:
[
30
,
25
,
20
,
18
,
15
],
itemStyle
:
{
color
:
'#52C41A'
}
},
{
name
:
'利润率'
,
type
:
'line'
,
yAxisIndex
:
1
,
data
:
[
40
,
44
,
50
,
52
,
57
],
symbol
:
'circle'
,
symbolSize
:
8
,
itemStyle
:
{
color
:
'#1890FF'
},
lineStyle
:
{
width
:
2
}
}
]
}
this
.
operationChart
.
setOption
(
option
)
},
},
switchTime
(
time
)
{
switchTime
(
time
)
{
this
.
activeTime
=
time
this
.
activeTime
=
time
...
@@ -530,10 +626,11 @@ import { uniIcons } from '@dcloudio/uni-ui'
...
@@ -530,10 +626,11 @@ import { uniIcons } from '@dcloudio/uni-ui'
beforeDestroy
()
{
beforeDestroy
()
{
if
(
this
.
myChart
)
{
if
(
this
.
myChart
)
{
this
.
myChart
.
dispose
()
this
.
myChart
.
dispose
()
}
this
.
operationChart
.
dispose
()
window
.
removeEventListener
(
'resize'
,
this
.
onResize
)
window
.
removeEventListener
(
'resize'
,
this
.
onResize
)
}
}
}
}
}
</
script
>
</
script
>
<
style
lang=
"scss"
>
<
style
lang=
"scss"
>
...
@@ -970,6 +1067,28 @@ import { uniIcons } from '@dcloudio/uni-ui'
...
@@ -970,6 +1067,28 @@ import { uniIcons } from '@dcloudio/uni-ui'
}
}
}
}
.operation-chart-container
{
background-color
:
#fff
;
padding
:
15px
;
border-radius
:
8px
;
margin-bottom
:
15px
;
.chart-header
{
margin-bottom
:
15px
;
.chart-title
{
font-size
:
16px
;
font-weight
:
bold
;
color
:
#333
;
}
}
.chart-wrapper
{
height
:
300px
;
width
:
100%
;
}
}
.table-container
{
.table-container
{
background-color
:
#fff
;
background-color
:
#fff
;
padding
:
15px
;
padding
:
15px
;
...
...
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