Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
store-assistant-assemble
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 55920f4b
authored
Apr 23, 2023
by
王志慧
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
commit
1 parent
c032ea47
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
199 additions
and
213 deletions
packagesList/outDetail/components/OutputWork/components/OutputLine/OutputLine.js
packagesList/outDetail/components/OutputWork/index.js
packagesList/outDetail/components/echart/echart.js
packagesList/outDetail/components/echart/echart.json
packagesList/outDetail/components/line/line.js
packagesList/outDetail/components/line/line.json
ec-canvas/ec-canvas.js → packagesList/outDetail/ec-canvas/ec-canvas.js
ec-canvas/ec-canvas.json → packagesList/outDetail/ec-canvas/ec-canvas.json
ec-canvas/ec-canvas.wxml → packagesList/outDetail/ec-canvas/ec-canvas.wxml
ec-canvas/ec-canvas.wxss → packagesList/outDetail/ec-canvas/ec-canvas.wxss
ec-canvas/echarts.js → packagesList/outDetail/ec-canvas/echarts.js
ec-canvas/wx-canvas.js → packagesList/outDetail/ec-canvas/wx-canvas.js
packagesList/outDetail/components/OutputWork/components/OutputLine/OutputLine.js
View file @
55920f4
...
@@ -28,7 +28,7 @@ Component({
...
@@ -28,7 +28,7 @@ Component({
text
:
'年'
,
text
:
'年'
,
type
:
3
type
:
3
},
],
},
],
timePeriod
:
2
timePeriod
:
1
},
},
...
@@ -50,7 +50,6 @@ Component({
...
@@ -50,7 +50,6 @@ Component({
this
.
triggerEvent
(
'selectEvent'
)
this
.
triggerEvent
(
'selectEvent'
)
},
},
selectTime
()
{
selectTime
()
{
console
.
log
(
122
)
this
.
triggerEvent
(
'selectTime'
)
this
.
triggerEvent
(
'selectTime'
)
},
},
...
...
packagesList/outDetail/components/OutputWork/index.js
View file @
55920f4
This diff is collapsed.
Click to expand it.
packagesList/outDetail/components/echart/echart.js
View file @
55920f4
import
*
as
echarts
from
'../../../
..
/ec-canvas/echarts'
;
import
*
as
echarts
from
'../../../
outDetail
/ec-canvas/echarts'
;
Component
({
Component
({
/**
/**
...
@@ -24,16 +24,8 @@ Component({
...
@@ -24,16 +24,8 @@ Component({
},
},
observers
:
{
observers
:
{
'chartData'
:
function
(
data
)
{
'chartData'
:
function
(
data
)
{
if
(
data
.
length
==
0
)
{
console
.
log
(
data
,
'9999999999'
)
this
.
setData
({
this
.
initData
(
data
)
chartShow
:
true
,
ec
:
{
onInit
:
this
.
onInitChart
()
//这里就是在js中用到的方法名
}
})
}
else
{
// this.data.chart.changeData(data)
}
},
},
...
@@ -43,7 +35,7 @@ Component({
...
@@ -43,7 +35,7 @@ Component({
*/
*/
data
:
{
data
:
{
ec
:
{
ec
:
{
onInit
:
null
lazyLoad
:
true
}
}
},
},
...
@@ -51,112 +43,116 @@ Component({
...
@@ -51,112 +43,116 @@ Component({
* 组件的方法列表
* 组件的方法列表
*/
*/
methods
:
{
methods
:
{
onInitChart
()
{
onInitChart
(
xData
,
yData
)
{
return
(
canvas
,
width
,
height
,
dpr
)
=>
{
this
.
ecComponent
&&
this
.
ecComponent
.
init
(
(
canvas
,
width
,
height
,
dpr
)
=>
{
const
chart
=
echarts
.
init
(
canvas
,
null
,
{
const
chart
=
echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
width
:
width
,
height
:
height
,
height
:
height
,
devicePixelRatio
:
dpr
,
// new
devicePixelRatio
:
dpr
,
padding
:[
10
,
20
,
10
,
20
]
});
});
canvas
.
setChart
(
chart
);
this
.
setOption
(
chart
,
xData
,
yData
);
return
chart
;
})
var
option
=
{
},
grid
:
{
setOption
(
chart
,
xData
,
yData
)
{
left
:
8
,
var
option
=
{
right
:
10
,
grid
:
{
top
:
50
,
left
:
8
,
bottom
:
0
,
right
:
10
,
containLabel
:
true
top
:
50
,
},
bottom
:
0
,
tooltip
:
{
containLabel
:
true
trigger
:
'axis'
,
},
triggerOn
:
"mousemove"
,
tooltip
:
{
axisPointer
:
{
trigger
:
'axis'
,
lineStyle
:
{
triggerOn
:
"mousemove"
,
type
:
'solid'
axisPointer
:
{
}
lineStyle
:
{
},
type
:
'solid'
padding
:
[
2
,
10
],
borderWidth
:
2
,
borderColor
:
this
.
data
.
color
,
borderRadius
:
10
,
textStyle
:
{
color
:
this
.
data
.
color
,
fontSize
:
10
},
// position: function(pt) {
// console.log(pt)
// return [pt[0], pt[1]+20];
// },
formatter
:
function
(
item
)
{
console
.
log
(
item
)
return
`
${
item
[
0
].
value
}
`
+
'人'
}
}
},
},
xAxis
:
{
padding
:
[
2
,
10
],
type
:
'category'
,
borderWidth
:
2
,
axisLabel
:
{
borderColor
:
this
.
data
.
color
,
fontSize
:
11
,
borderRadius
:
10
,
color
:
'#A6A6A6'
textStyle
:
{
},
color
:
this
.
data
.
color
,
axisLine
:
{
fontSize
:
10
show
:
false
//坐标轴线线
},
},
// position: function(pt) {
axisTick
:
{
// console.log(pt)
show
:
false
//坐标轴刻度
// return [pt[0], pt[1]+20];
},
// },
data
:
[
'Mon'
,
'Tue'
,
'Wed'
,
'Thu'
]
formatter
:
function
(
item
)
{
console
.
log
(
item
)
return
`
${
item
[
0
].
value
}
`
+
'人'
}
},
xAxis
:
{
type
:
'category'
,
axisLabel
:
{
fontSize
:
11
,
color
:
'#A6A6A6'
},
axisLine
:
{
show
:
false
//坐标轴线线
},
axisTick
:
{
show
:
false
//坐标轴刻度
},
},
yAxis
:
{
data
:
xData
x
:
'center'
,
},
type
:
'value'
,
yAxis
:
{
axisLabel
:
{
x
:
'center'
,
fontSize
:
11
,
type
:
'value'
,
color
:
'#A6A6A6'
axisLabel
:
{
},
fontSize
:
11
,
axisLine
:
{
color
:
'#A6A6A6'
show
:
false
//坐标轴线线
},
},
axisLine
:
{
axisTick
:
{
show
:
false
//坐标轴线线
show
:
false
//坐标轴刻度
},
},
axisTick
:
{
splitLine
:
{
show
:
false
//坐标轴刻度
lineStyle
:
{
},
type
:
'dashed'
splitLine
:
{
}
lineStyle
:
{
type
:
'dashed'
}
}
}
},
series
:
[{
data
:
yData
,
type
:
'bar'
,
color
:
this
.
data
.
color
,
itemStyle
:
{
borderRadius
:
[
50
,
50
,
0
,
0
],
padding
:
[
50
,
50
,
0
,
0
]
},
},
series
:
[{
barWidth
:
24
data
:
[
820
,
932
,
901
,
934
],
}]
type
:
'bar'
,
};
color
:
this
.
data
.
color
,
chart
.
setOption
(
option
)
itemStyle
:
{
borderRadius
:
[
50
,
50
,
0
,
0
],
padding
:[
50
,
50
,
0
,
0
]
},
barWidth
:
24
}]
};
chart
.
setOption
(
option
);
return
chart
;
}
},
},
//初始化数据
//初始化数据
initData
()
{
initData
(
data
)
{
let
{
const
xData
=
[],
chartData
,
yData
=
[];
keys
,
const
[
x
,
y
]
=
this
.
data
.
keys
viewData
data
.
forEach
(
item
=>
{
}
=
this
xData
.
push
(
item
[
x
])
chartData
.
forEach
(
item
=>
{
yData
.
push
(
item
[
y
])
viewData
.
push
({
name
:
item
[
keys
[
0
]],
value
:
item
[
keys
[
1
]]
})
})
})
this
.
setData
({
xData
,
yData
})
this
.
onInitChart
(
xData
,
yData
)
},
},
},
ready
()
{
// 获取组件
this
.
ecComponent
=
this
.
selectComponent
(
'#mychart-dom-bar'
);
}
}
})
})
\ No newline at end of file
\ No newline at end of file
packagesList/outDetail/components/echart/echart.json
View file @
55920f4
{
{
"component"
:
true
,
"component"
:
true
,
"usingComponents"
:
{
"usingComponents"
:
{
"ec-canvas"
:
"../../../
..
/ec-canvas/ec-canvas"
"ec-canvas"
:
"../../../
outDetail
/ec-canvas/ec-canvas"
}
}
}
}
packagesList/outDetail/components/line/line.js
View file @
55920f4
import
*
as
echarts
from
'../../../
..
/ec-canvas/echarts'
;
import
*
as
echarts
from
'../../../
outDetail
/ec-canvas/echarts'
;
Component
({
Component
({
/**
/**
* 组件的属性列表
* 组件的属性列表
...
@@ -24,18 +24,6 @@ Component({
...
@@ -24,18 +24,6 @@ Component({
observers
:
{
observers
:
{
'chartData'
:
function
(
data
)
{
'chartData'
:
function
(
data
)
{
this
.
initData
(
data
)
this
.
initData
(
data
)
if
(
data
.
length
==
0
)
{
this
.
setData
({
chartShow
:
true
,
ec
:
{
onInit
:
this
.
onInitChart
()
}
})
}
else
{
// this.data.chart.changeData(data)
}
},
},
},
},
/**
/**
...
@@ -43,10 +31,8 @@ Component({
...
@@ -43,10 +31,8 @@ Component({
*/
*/
data
:
{
data
:
{
ec
:
{
ec
:
{
onInit
:
null
lazyLoad
:
true
},
}
xData
:[],
yData
:[]
},
},
...
@@ -54,114 +40,119 @@ Component({
...
@@ -54,114 +40,119 @@ Component({
* 组件的方法列表
* 组件的方法列表
*/
*/
methods
:
{
methods
:
{
onInitChart
()
{
onInitChart
(
xData
,
yData
)
{
return
(
canvas
,
width
,
height
,
dpr
)
=>
{
this
.
ecComponent
&&
this
.
ecComponent
.
init
((
canvas
,
width
,
height
,
dpr
)
=>
{
console
.
log
(
width
,
height
,
)
const
chart
=
echarts
.
init
(
canvas
,
null
,
{
const
chart
=
echarts
.
init
(
canvas
,
null
,
{
width
:
width
,
width
:
width
,
height
:
height
,
height
:
height
,
devicePixelRatio
:
dpr
// new
devicePixelRatio
:
dpr
// new
});
});
canvas
.
setChart
(
chart
);
this
.
setOption
(
chart
,
xData
,
yData
);
return
chart
;
})
},
setOption
(
chart
,
xData
,
yData
)
{
var
option
=
{
grid
:
{
left
:
8
,
right
:
30
,
top
:
50
,
bottom
:
0
,
containLabel
:
true
},
tooltip
:
{
trigger
:
'axis'
,
triggerOn
:
"mousemove"
,
axisPointer
:
{
lineStyle
:
{
type
:
'solid'
}
},
padding
:
[
2
,
10
],
borderWidth
:
2
,
borderColor
:
'#6ED0BE'
,
borderRadius
:
10
,
textStyle
:
{
color
:
'#6ED0BE'
,
fontSize
:
10
},
// position: function(pt) {
// console.log(pt)
// return [pt[0], pt[1]+20];
// },
formatter
:
function
(
item
)
{
console
.
log
(
item
)
return
`
${
item
[
0
].
value
}
`
+
'人'
}
},
xAxis
:
{
type
:
'category'
,
boundaryGap
:
false
,
// min:1,
// max: 5,
var
option
=
{
axisLabel
:
{
grid
:
{
fontSize
:
11
,
left
:
8
,
color
:
'#A6A6A6'
right
:
10
,
top
:
50
,
bottom
:
0
,
containLabel
:
true
},
},
tooltip
:
{
axisLine
:
{
trigger
:
'axis'
,
show
:
false
//坐标轴线线
triggerOn
:
"mousemove"
,
axisPointer
:
{
lineStyle
:
{
type
:
'solid'
}
},
padding
:
[
2
,
10
],
borderWidth
:
2
,
borderColor
:
'#6ED0BE'
,
borderRadius
:
10
,
textStyle
:
{
color
:
'#6ED0BE'
,
fontSize
:
10
},
// position: function(pt) {
// console.log(pt)
// return [pt[0], pt[1]+20];
// },
formatter
:
function
(
item
)
{
console
.
log
(
item
)
return
`
${
item
[
0
].
value
}
`
+
'人'
}
},
},
xAxis
:
{
axisTick
:
{
type
:
'category'
,
show
:
false
//坐标轴刻度
boundaryGap
:
false
,
axisLabel
:
{
fontSize
:
11
,
color
:
'#A6A6A6'
},
axisLine
:
{
show
:
false
//坐标轴线线
},
axisTick
:
{
show
:
false
//坐标轴刻度
},
data
:
this
.
data
.
xData
},
},
yAxis
:
{
data
:
xData
x
:
'center'
,
},
type
:
'value'
,
yAxis
:
{
axisLabel
:
{
x
:
'center'
,
fontSize
:
11
,
type
:
'value'
,
color
:
'#A6A6A6'
axisLabel
:
{
},
fontSize
:
11
,
axisLine
:
{
color
:
'#A6A6A6'
show
:
false
//坐标轴线线
},
axisTick
:
{
show
:
false
//坐标轴刻度
},
splitLine
:
{
lineStyle
:
{
type
:
'dashed'
}
}
},
},
dataZoom
:
{
axisLine
:
{
start
:
10
,
show
:
false
//坐标轴线线
type
:
"inside"
},
},
series
:
[{
axisTick
:
{
data
:
this
.
data
.
yData
,
show
:
false
//坐标轴刻度
type
:
'line'
,
},
smooth
:
true
,
splitLine
:
{
color
:
this
.
data
.
color
lineStyle
:
{
}]
type
:
'dashed'
};
}
}
chart
.
setOption
(
option
);
},
return
chart
;
dataZoom
:
{
type
:
"inside"
,
maxSpan
:
10
},
series
:
[{
data
:
yData
,
type
:
'line'
,
smooth
:
true
,
color
:
this
.
data
.
color
}]
}
}
chart
.
setOption
(
option
)
},
},
//初始化数据
//初始化数据
initData
(
data
)
{
initData
(
data
)
{
let
{
const
xData
=
[],
xData
,
yData
=
[];
yData
const
[
x
,
y
]
=
this
.
data
.
keys
}
=
this
.
data
data
.
forEach
(
item
=>
{
data
.
forEach
(
item
=>
{
xData
.
push
(
item
.
abscissaValue
)
xData
.
push
(
item
[
x
]
)
yData
.
push
(
item
.
ordinateValue
)
yData
.
push
(
item
[
y
]
)
})
})
this
.
setData
({
this
.
setData
({
xData
,
xData
,
yData
yData
})
})
this
.
onInitChart
(
xData
,
yData
)
},
},
},
ready
()
{
// 获取组件
this
.
ecComponent
=
this
.
selectComponent
(
'#mychart-dom-line'
);
}
}
})
})
\ No newline at end of file
\ No newline at end of file
packagesList/outDetail/components/line/line.json
View file @
55920f4
{
{
"component"
:
true
,
"component"
:
true
,
"usingComponents"
:
{
"usingComponents"
:
{
"ec-canvas"
:
"../../../
..
/ec-canvas/ec-canvas"
"ec-canvas"
:
"../../../
outDetail
/ec-canvas/ec-canvas"
}
}
}
}
ec-canvas/ec-canvas.js
→
packagesList/outDetail/
ec-canvas/ec-canvas.js
View file @
55920f4
File moved
ec-canvas/ec-canvas.json
→
packagesList/outDetail/
ec-canvas/ec-canvas.json
View file @
55920f4
File moved
ec-canvas/ec-canvas.wxml
→
packagesList/outDetail/
ec-canvas/ec-canvas.wxml
View file @
55920f4
File moved
ec-canvas/ec-canvas.wxss
→
packagesList/outDetail/
ec-canvas/ec-canvas.wxss
View file @
55920f4
File moved
ec-canvas/echarts.js
→
packagesList/outDetail/
ec-canvas/echarts.js
View file @
55920f4
File moved
ec-canvas/wx-canvas.js
→
packagesList/outDetail/
ec-canvas/wx-canvas.js
View file @
55920f4
File moved
Write
Preview
Markdown
is supported
Attach a file
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 post a comment