Commit 7f8dc469 by 前端

commit

1 parent 51af0f03
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:43:46 * @Date: 2022-10-25 10:43:46
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 14:32:16 * @LastEditTime: 2022-10-28 14:53:22
* @FilePath: \dj-data-view\src\components\barChart.vue * @FilePath: \dj-data-view\src\components\barChart.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -35,7 +35,7 @@ export default { ...@@ -35,7 +35,7 @@ export default {
default: '品牌' default: '品牌'
}, },
privateList: { privateList: {
type: Object, type: [Object, Array],
default: () => {} default: () => {}
}, },
// 0-月表;1-日表 // 0-月表;1-日表
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:43:46 * @Date: 2022-10-25 10:43:46
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-28 10:08:29 * @LastEditTime: 2022-10-31 10:28:51
* @FilePath: \dj-data-view\src\components\barChart.vue * @FilePath: \dj-data-view\src\components\barChart.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -84,7 +84,8 @@ export default { ...@@ -84,7 +84,8 @@ export default {
seriesIndex: 0, seriesIndex: 0,
dataIndex: 0 dataIndex: 0
}, },
timer: null timer: null,
currentData: {}
} }
}, },
// created() { // created() {
...@@ -120,15 +121,29 @@ export default { ...@@ -120,15 +121,29 @@ export default {
chartBindEvent() { chartBindEvent() {
this[this.domId].setOption(this.lineOptions) this[this.domId].setOption(this.lineOptions)
if (this.revese === false) return if (this.revese === false) return
this.chartAction()
this[this.domId].getZr().on( this[this.domId].getZr().on(
'mousemove', 'mousemove',
utils.debounce(params => { utils.debounce(params => {
const pointInPixel = [params.offsetX, params.offsetY] const pointInPixel = [params.offsetX, params.offsetY]
const pointInGrid = this[this.domId].convertFromPixel({ seriesIndex: 0 }, pointInPixel) const pointInGrid = this[this.domId].convertFromPixel({ seriesIndex: 0 }, pointInPixel)
const yIndex = pointInGrid[1] const yIndex = pointInGrid[1]
this.currentData = {
dataIndex: yIndex
}
this.$bus.$emit('drawChart', yIndex) this.$bus.$emit('drawChart', yIndex)
}, 500) }, 500)
) )
this[this.domId].on('globalout', () => {
this.chartAction(this.currentData.dataIndex)
})
},
chartAction(index = 7) {
this[this.domId].dispatchAction({
type: 'showTip',
seriesIndex: 0,
dataIndex: index
})
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:46:24 * @Date: 2022-10-25 10:46:24
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-28 12:32:22 * @LastEditTime: 2022-10-31 09:38:47
* @FilePath: \dj-data-view\src\components\barOptions.js * @FilePath: \dj-data-view\src\components\barOptions.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
...@@ -104,7 +104,7 @@ function getBarReverseOptions(obj) { ...@@ -104,7 +104,7 @@ function getBarReverseOptions(obj) {
axisLine: { axisLine: {
show: false show: false
}, },
data: ['一般发展', '一般价值', '一般挽留', '重要挽留', '重要价值', '重要发展', '重要保持', '一般保持'] data: ['一般发展', '一般价值', '一般挽留', '重要挽留', '重要价值', '重要发展', '重要保持', '一般保持'].reverse()
}, },
grid: { grid: {
left: '15%', left: '15%',
...@@ -275,23 +275,25 @@ function lineAndBarOptions(list) { ...@@ -275,23 +275,25 @@ function lineAndBarOptions(list) {
return `门店数:${item[0].value}<br>新增数:${item[1].value}` return `门店数:${item[0].value}<br>新增数:${item[1].value}`
} }
}, },
xAxis: { xAxis: [
type: 'category', {
axisLabel: { type: 'category',
color: '#fff', axisLabel: {
fontSize: '0.8em' color: '#fff',
}, fontSize: '0.8em'
splitLine: { },
show: false splitLine: {
}, show: false
axisTick: { },
show: false axisTick: {
}, show: false
axisLine: { },
show: false axisLine: {
}, show: false
data: statDate },
}, data: statDate
}
],
grid: { grid: {
left: '3%', left: '3%',
right: '6%', right: '6%',
...@@ -299,22 +301,41 @@ function lineAndBarOptions(list) { ...@@ -299,22 +301,41 @@ function lineAndBarOptions(list) {
bottom: '0%', bottom: '0%',
containLabel: true containLabel: true
}, },
yAxis: { yAxis: [
nameGap: 30, {
type: 'value', name: 'bar',
splitLine: { nameGap: 30,
lineStyle: { type: 'value',
color: '#2F314F' splitLine: {
} lineStyle: {
}, color: '#2F314F'
axisLabel: { }
color: '#fff', },
fontSize: '0.8em' axisLabel: {
color: '#fff',
fontSize: '0.8em'
},
splitNumber: 4
}, },
splitNumber: 4 {
}, name: 'line',
nameGap: 30,
type: 'value',
splitLine: {
lineStyle: {
color: '#2F314F'
}
},
axisLabel: {
color: '#fff',
fontSize: '0.8em'
},
splitNumber: 4
}
],
series: [ series: [
{ {
name: 'bar',
type: 'bar', type: 'bar',
symbol: 'circle', symbol: 'circle',
backgroundStyle: { backgroundStyle: {
...@@ -324,6 +345,7 @@ function lineAndBarOptions(list) { ...@@ -324,6 +345,7 @@ function lineAndBarOptions(list) {
data: increNum data: increNum
}, },
{ {
name: 'line',
type: 'line', type: 'line',
symbol: 'circle', symbol: 'circle',
itemStyle: { itemStyle: {
...@@ -352,6 +374,7 @@ function lineAndBarOptions(list) { ...@@ -352,6 +374,7 @@ function lineAndBarOptions(list) {
] ]
} }
}, },
yAxisIndex: 1,
data: totalNum data: totalNum
} }
] ]
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 前端 qianduan01@didihu.com.cn * @Author: 前端 qianduan01@didihu.com.cn
* @Date: 2022-10-25 10:12:26 * @Date: 2022-10-25 10:12:26
* @LastEditors: 前端 qianduan01@didihu.com.cn * @LastEditors: 前端 qianduan01@didihu.com.cn
* @LastEditTime: 2022-10-27 13:38:57 * @LastEditTime: 2022-10-31 10:16:04
* @FilePath: \dj-data-view\src\views\saas\project.vue * @FilePath: \dj-data-view\src\views\saas\project.vue
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
--> -->
...@@ -80,7 +80,8 @@ export default { ...@@ -80,7 +80,8 @@ export default {
width: 49.6%; width: 49.6%;
background: #0b0e31; background: #0b0e31;
.project-left { .project-left {
width: 2vw; width: 2.8vw;
padding: 0px 0.4vw;
height: 5.61vh; height: 5.61vh;
background: #2436b7; background: #2436b7;
text-align: center; text-align: center;
...@@ -89,9 +90,9 @@ export default { ...@@ -89,9 +90,9 @@ export default {
font-size: 10px; font-size: 10px;
line-height: 12px; line-height: 12px;
margin-top: 0.4vh; margin-top: 0.4vh;
&.fontSmall { // &.fontSmall {
font-size: 9px; // font-size: 9px;
} // }
} }
.project-icon { .project-icon {
width: 1.25vw; width: 1.25vw;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!