This commit is contained in:
xvv 2024-07-08 11:39:38 +08:00
parent b411834ea5
commit 16621a47c5
4 changed files with 285 additions and 47 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -63,7 +63,7 @@ export const constantRoutes = [
children: [
{
path: 'index',
component: () => import('@/views/Service/index.vue'),
component: () => import('@/views/index.vue'),
name: 'Index',
meta: { title: '系统首页', icon: 'dashboard', affix: true }
}

View File

@ -104,28 +104,66 @@
</div>
</div>
<div class="hui-hang"></div>
<div class="d-s">
<div class="d-s" >
<div>
<div class="h-tt" >活跃油站</div>
<div id="pie" style="width: 150px;height: 150px;"></div>
<div id="ccc" style="width: 300px;height: 200px; "></div>
</div>
<div class="h-r-ba"></div>
<div>
<div class="h-tt" >活跃油站</div>
<div class="d-s" style="justify-content: space-between">
<div id="cccc" style="width: 300px;height: 200px;margin-right: 50px"></div>
<div id="ccct" style="width: 300px;height: 200px;"></div>
</div>
</div>
</div>
</div>
<div class="right-box-t">
<div class="h-tt" >硬件设备</div>
<div class="d-s" style="margin: 30px 0px" v-for="(item,index) in 3" :key="index" >
<div class="r-img">
<img src="./../assets/images/pcin.png" style="width: 84px;height: 70px">
</div>
<div>容大(RT RONGTA)RP76II针式76mm小票打印机加油站二三联票据 RP76II/USB口</div>
</div>
</div>
</div>
<div class="bottom_">
<div class="h-tt" style="margin-bottom: 15px" >数据统计</div>
<div class="d-s">
<div class="anniu-h" :class="{ 'anniu-act': index == 0 }" v-for="(item,index) in timeList" :key="index">
{{item}}
</div>
<el-date-picker
v-model="value1"
type="datetimerange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</div>
<div id="ctct" style="width: 100%; height: 315px "></div>
</div>
</div>
</template>
<script>
import echarts from "echarts";
export default {
data(){
return{
form: {},
timeList:[
"今日",
"近一周",
"近一月",
"近一年",
],
options: [{
value: '选项1',
label: '黄金糕'
@ -148,60 +186,223 @@ export default {
}
},
mounted() {
this.initChart()
},
methods:{
initChart() {
const chart = echarts.init(document.getElementById('pie'))
const chart = echarts.init(document.getElementById('ccc'))
const chart1 = echarts.init(document.getElementById('cccc'))
const chart2= echarts.init(document.getElementById('ccct'))
const chart3= echarts.init(document.getElementById('ctct'))
const option = {
color: [
'#ff9655',
'#86E1BB',
'#8195F5',
'#0DC291',
'#FFB519',
],
dataset: {
source: [
['product', '#92', '#95', '#98'],
tooltip: {
trigger: 'item'
},
]
},
xAxis: {
type: 'category',
boundaryGap: false,
// data: ['2023.1.1', '2023.2.1', '2023.3.1', '2023.4.1', '2023.5.1', '2023.6.1', '2023.7.1']
data: this.timeDate
},
yAxis: {
type: 'value'
},
series: [
{
data: this.oilDate,
type: 'line',
smooth: true,
lineStyle: {
width: 4
},
areaStyle: {
opacity: 0.8,
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{
offset: 0,
color: '#fff'
},
{
offset: 1,
color: '#F8F1E7'
}
])
},
name: 'Access From',
type: 'pie',
radius: '80%',
data: [
{ value: 28, name: '28%' },
{ value: 72, name: '72%' },
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
const option1 = {
color: [
'#3B6ADE',
'#409eff',
],
tooltip: {
trigger: 'item'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: '80%',
data: [
{ value: 28, name: '28%' },
{ value: 72, name: '72%' },
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
const option2 = {
color: [
'#0DC291',
'#FFB519',
],
tooltip: {
trigger: 'item'
},
series: [
{
name: 'Access From',
type: 'pie',
radius: '80%',
data: [
{ value: 28, name: '28%' },
{ value: 72, name: '72%' },
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
const option3 = {
color: ['#FF9655', '#0DC291', '#409EFF'],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
crossStyle: {
color: '#999'
}
}
},
legend: {
data: ['交易金额', '交易笔数', '活跃油站数']
},
xAxis: [
{
type: 'category',
data: [
'00:00',
'02:00',
'04:00',
'06:00',
'08:00',
'10:00',
'12:00',
'14:00',
'16:00',
'18:00',
'20:00',
'22:00'
],
axisPointer: {
type: 'shadow'
}
}
],
yAxis: [
{
type: 'value',
name: '金额(元)',
min: 0,
max: 250,
interval: 50,
axisLabel: {
formatter: '{value} '
}
},
{
type: 'value',
name: '笔数',
min: 0,
max: 25,
interval: 5,
axisLabel: {
formatter: '{value}'
}
}
],
series: [
{
name: '活跃油站数',
type: 'bar',
tooltip: {
valueFormatter: function (value) {
return value + ' ml';
}
},
barWidth: 13,
itemStyle: {
normal: {
// 5]
barBorderRadius: [50, 50, 0, 0]
}
},
data: [
30.0, 31.9, 71.0, 23.2, 41.6, 31.7, 21.6, 30.0, 31.9, 71.0, 23.2, 41.6
]
},
]
{
name: '交易金额',
type: 'line',
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value + ' °C';
}
},
data: [3.0, 3.9, 7.0, 2.2, 4.6, 3.7, 2.6, 3.0, 3.9, 7.0, 3.2, 4.6]
},
{
name: '交易笔数',
type: 'line',
yAxisIndex: 1,
tooltip: {
valueFormatter: function (value) {
return value + ' °C';
}
},
data: [2.0, 3.9, 4.0, 5.2, 4.6, 6.7, 7.6, 6.0, 5.9, 4.0, 4.2, 2.6]
}
],
grid: {
left: '1%',
right: '1%',
bottom: '3%',
containLabel: true
}
};
chart.setOption(option)
chart1.setOption(option1)
chart2.setOption(option2)
chart3.setOption(option3)
}
}
@ -367,4 +568,41 @@ export default {
background: #F4F5F9;
margin: 15px auto;
}
.h-r-ba{
height: 170px;
margin: 0px 50px;
width: 5px;
background: #f4f5f9;
}
.r-img{
width: 84px;
height: 70px;
margin-right: 20px;
}
.bottom_{
width: 100%;
border-radius: 10px;
background: #fff;
box-sizing: border-box;
padding: 20px;
margin-top: 20px;
}
.anniu-h{
width: 80px;
height: 26px;
background: #FAFAFA;
border-radius: 4px 4px 4px 4px;
border: 1px solid #DDDDDD;
display: flex;
align-items: center;
justify-content: center;
color: #777777;
margin-right: 20px;
}
.anniu-act{
background: #FF9655 !important;
border: 1px solid #FF9655 !important;
color: #fff;
}
</style>

View File

@ -280,8 +280,8 @@ export default {
Cookies.remove('rememberMe');
}
app.$store.dispatch("Login", this.loginForm).then(() => {
// app.$router.push({ path: this.redirect || "/" }).catch(()=>{});
app.$router.push({ path: "/Service/index" }).catch(()=>{});
app.$router.push({ path: this.redirect || "/" }).catch(()=>{});
// app.$router.push({ path: "index" }).catch(()=>{});
}).catch(() => {
app.loading = false;
if (app.captchaOnOff) {