Commit 14d3fc74 by 潘际乾

首页

parent d29c8bbc
...@@ -24,64 +24,77 @@ export default { ...@@ -24,64 +24,77 @@ export default {
name: "CustomerAnalyse", name: "CustomerAnalyse",
components: { CellHeaderVue }, components: { CellHeaderVue },
data() { data() {
return {}; return {
echartInstance: null,
};
}, },
mounted() { mounted() {
const echartInstance = echarts.init(document.getElementById("chart")); this.echartInstance = echarts.init(document.getElementById("chart"));
const option = { this.loadCharts()
title: { this.loadChartsBind = this.loadCharts.bind(this)
// text: "Test Demo", window.addEventListener('resize', this.loadChartsBind)
}, },
tooltip: { methods: {
trigger: "axis", loadCharts() {
axisPointer: { this.echartInstance.clear()
type: "shadow", const option = {
title: {
// text: "Test Demo",
}, },
}, tooltip: {
legend: { trigger: "axis",
bottom: "2%", axisPointer: {
}, type: "shadow",
grid: { },
left: "1%",
right: "6%",
top: "1%",
containLabel: true,
},
xAxis: {
type: "value",
boundaryGap: [0, 0.01],
},
yAxis: {
type: "category",
data: [
"海康威视",
"春晖指控",
"苏奥传感",
"东方财富",
"隆基股份",
"贵州茅台",
],
},
series: [
{
name: "业务量(万美元)",
type: "bar",
data: [18203, 23489, 29034, 104970, 131744, 230230],
}, },
{ legend: {
name: "融资量(万美元)", bottom: "2%",
type: "bar",
data: [19325, 23438, 31000, 121594, 134141, 381807],
}, },
{ grid: {
name: "费用收益(千美元)", left: "1%",
type: "bar", right: "6%",
data: [49325, 53438, 11000, 221594, 43241, 455807], top: "1%",
containLabel: true,
}, },
], xAxis: {
}; type: "value",
echartInstance.setOption(option); boundaryGap: [0, 0.01],
},
yAxis: {
type: "category",
data: [
"海康威视",
"春晖指控",
"苏奥传感",
"东方财富",
"隆基股份",
"贵州茅台",
],
},
series: [
{
name: "业务量(万美元)",
type: "bar",
data: [18203, 23489, 29034, 104970, 131744, 230230],
},
{
name: "融资量(万美元)",
type: "bar",
data: [19325, 23438, 31000, 121594, 134141, 381807],
},
{
name: "费用收益(千美元)",
type: "bar",
data: [49325, 53438, 11000, 221594, 43241, 455807],
},
],
};
this.echartInstance.setOption(option);
},
}, },
destroyed() {
window.removeEventListener('resize', this.loadChartsBind)
}
}; };
</script> </script>
......
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
<span class="el-icon-refresh" title="刷新"></span> <span class="el-icon-refresh" title="刷新"></span>
<span class="el-icon-more" title="操作"></span> <span class="el-icon-more" title="操作"></span>
</CellHeaderVue> </CellHeaderVue>
<c-content :height="cellScrollHeight">
<el-scrollbar :style="{ height: scrollbarHeight + 'px' }">
<div class="cell-content"> <div class="cell-content">
<div class="notice-item" v-for="(item, idx) in noticeList" :key="idx"> <div class="notice-item" v-for="(item, idx) in noticeList" :key="idx">
<div class="notice-title" :class="{ active: idx === 0 }"> <div class="notice-title" :class="{ active: idx === 0 }">
...@@ -17,7 +18,7 @@ ...@@ -17,7 +18,7 @@
</div> </div>
</div> </div>
</div> </div>
</c-content> </el-scrollbar>
</div> </div>
</template> </template>
...@@ -33,6 +34,11 @@ export default { ...@@ -33,6 +34,11 @@ export default {
required: true, required: true,
}, },
}, },
computed: {
scrollbarHeight() {
return window.document.body.clientHeight - this.cellScrollHeight;
},
},
data() { data() {
return { return {
noticeList: [ noticeList: [
......
<template> <template>
<div class="home-cell" id="quickSearch"> <div class="home-cell" id="quickSearch">
<CellHeaderVue title="快速查询"> </CellHeaderVue> <CellHeaderVue title="快速查询"> </CellHeaderVue>
<c-content :height="cellScrollHeight">
<el-scrollbar :style="{ height: scrollbarHeight + 'px' }">
<div class="cell-content"> <div class="cell-content">
<div <div
class="content-wrapper" class="content-wrapper"
v-for="(item, index) in options" v-for="(item, index) in options"
:key="index" :key="index"
:style="{ height: wrapperHeight + 'px' }" :style="{ height: Math.floor(scrollbarHeight * 0.3) + 'px' }"
> >
<div class="search-item-wrapper"> <div class="search-item-wrapper">
<div class="search-item"> <div class="search-item">
...@@ -18,7 +19,7 @@ ...@@ -18,7 +19,7 @@
</div> </div>
</div> </div>
</div> </div>
</c-content> </el-scrollbar>
</div> </div>
</template> </template>
...@@ -35,10 +36,8 @@ export default { ...@@ -35,10 +36,8 @@ export default {
}, },
}, },
computed: { computed: {
wrapperHeight() { scrollbarHeight() {
return Math.floor( return window.document.body.clientHeight - this.cellScrollHeight;
(window.document.body.clientHeight - this.cellScrollHeight) * 0.3
);
}, },
}, },
data() { data() {
......
...@@ -2,13 +2,13 @@ ...@@ -2,13 +2,13 @@
<div class="home-cell" id="quickVisit"> <div class="home-cell" id="quickVisit">
<CellHeaderVue title="快速访问"> </CellHeaderVue> <CellHeaderVue title="快速访问"> </CellHeaderVue>
<c-content :height="cellScrollHeight"> <el-scrollbar :style="{ height: scrollbarHeight + 'px' }">
<div class="cell-content"> <div class="cell-content">
<div <div
class="content-wrapper" class="content-wrapper"
v-for="(item, index) in quickVisitItem" v-for="(item, index) in quickVisitItem"
:key="index" :key="index"
:style="{ height: wrapperHeight + 'px' }" :style="{ height: Math.floor(scrollbarHeight * 0.3) + 'px' }"
> >
<div class="visit-item-wrapper"> <div class="visit-item-wrapper">
<div class="visit-item"> <div class="visit-item">
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</div> </div>
</div> </div>
</div> </div>
</c-content> </el-scrollbar>
</div> </div>
</template> </template>
...@@ -36,10 +36,8 @@ export default { ...@@ -36,10 +36,8 @@ export default {
}, },
}, },
computed: { computed: {
wrapperHeight() { scrollbarHeight() {
return Math.floor( return window.document.body.clientHeight - this.cellScrollHeight;
(window.document.body.clientHeight - this.cellScrollHeight) * 0.3
);
}, },
}, },
data() { data() {
......
...@@ -28,15 +28,23 @@ export default { ...@@ -28,15 +28,23 @@ export default {
QuickSearchVue, QuickSearchVue,
}, },
created() { created() {
this.cellScrollHeight = this.calcCellScrollHeight();
window.document.body.clientHeight - this.calcCellScrollHeightBind = this.calcCellScrollHeight.bind(this)
(window.document.body.clientHeight - 110 - 52 * 2 - 10) / 2; window.addEventListener("resize", this.calcCellScrollHeightBind)
}, },
data() { data() {
return { return {
cellScrollHeight: null, cellScrollHeight: null,
}; };
}, },
methods: {
calcCellScrollHeight() {
this.cellScrollHeight = window.document.body.clientHeight - (window.document.body.clientHeight - 110 - 52 * 2 - 10) / 2;
}
},
destroyed() {
window.removeEventListener("resize", this.calcCellScrollHeightBind)
}
}; };
</script> </script>
...@@ -62,4 +70,8 @@ export default { ...@@ -62,4 +70,8 @@ export default {
height: calc(100% - 52px); height: calc(100% - 52px);
overflow: auto; overflow: auto;
} }
.home-cell >>> .el-scrollbar__wrap{
overflow-y: scroll;
overflow-x: auto;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment