This commit is contained in:
cjb 2025-05-27 16:29:24 +08:00
parent 5c303e6e02
commit c328df6c52
10 changed files with 3284 additions and 1132 deletions

View File

@ -61,7 +61,6 @@ export function get6jytj(params?:Querydata) {
} }
//同比 环比 //同比 环比
export function gettbhb(type:number) { export function gettbhb(type:number) {
return server.request({ return server.request({
@ -80,3 +79,60 @@ export function gettbhb(type:number) {
// data // data
// }) // })
// } // }
//新版
//平台管理员 - 运营商,换电站,认证公司, 机器人 电池
export function ptgetotal() {
return server.request({
url: '/cloud/home/platform/data1',
method: 'get'
})
}
// 金额 占比, 半年交易情况等
export function zbjetotal() {
return server.request({
url: '/cloud/home/platform/data2',
method: 'get'
})
}
export function givealarm() {
return server.request({
url: '/cloud/home/alarm/data',
method: 'get'
})
}
//运营商角色
//总数
export function yysgetotal() {
return server.request({
url: '/cloud/home/roxy/data1',
method: 'get'
})
}
//当月和近半年统计
export function dybndata() {
return server.request({
url: '/cloud/home/roxy/data2',
method: 'get'
})
}
//运营商站端角色
export function zddata() {
return server.request({
url: '/cloud/home/station/data1',
method: 'get'
})
}
//企业用户角色
export function gongsdata() {
return server.request({
url: '/cloud/home/company/data',
method: 'get'
})
}

View File

@ -14,6 +14,9 @@ interface Addobj{
moreRemainFee?:String //换电时电量剩余过多的服务费 moreRemainFee?:String //换电时电量剩余过多的服务费
fewRemainSoc?:String //换电时电量剩余一般的soc界定 fewRemainSoc?:String //换电时电量剩余一般的soc界定
fewRemainFee?:String //换电时电量剩余一般的服务费 fewRemainFee?:String //换电时电量剩余一般的服务费
eachKmFee?:String //每公里收费
eachSocFee?:String //每SOC收费
eachKwhFee?:String //每度电收费
} }
export function addhdz(data:Addobj) { export function addhdz(data:Addobj) {

View File

@ -0,0 +1,692 @@
<template>
<div ref="homePage" class="page">
<!-- <el-button
type="primary"
plain
icon="Plus"
@click="testsx()">测试失效</el-button> -->
<el-row :gutter="20" class="mgb20">
<!--运营商-->
<el-col :span="4">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#409EFF'}">
<component is="Promotion" />
</el-icon>
<div class="grid-msg-right" style="border: none;" @click="toRout('/vehicle/operator')">
<div class="grid-msg-num" :style="{ color: '#409EFF'}">
{{ operatotal }}
</div>
<div style="font-size: 16px;">运营商</div>
</div>
</div>
</div>
</el-col>
<!--换电站-->
<el-col :span="6">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#28b3a1'}">
<component is="Flag" />
</el-icon>
<div class="grid-msg-right" @click="toRout('/swapstation/hdz')">
<div class="grid-msg-num" :style="{ color: '#28b3a1'}">
{{ hdztotal }}
</div>
<div style="font-size: 16px;">换电站</div>
</div>
<div class="grid-msg-right" style="border: none;" @click="toRout('/swapstation/hdz',{status: 1})">
<div class="grid-msg-num" :style="{ color: '#b5a210'}">
{{ kyhdz }}
</div>
<div style="font-size: 16px;">可用换电站</div>
</div>
</div>
</div>
</el-col>
<!--电池总量-->
<el-col :span="7">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#67C23A'}">
<component is="SuccessFilled" />
</el-icon>
<div class="grid-msg-right" @click="toRout('/vehicle/company')">
<div class="grid-msg-num" :style="{ color: '#67C23A'}">
{{ rzcompany }}
</div>
<div style="font-size: 16px;">认证公司</div>
</div>
<div class="grid-msg-right" @click="toRout('/vehicle/wxuser')">
<div class="grid-msg-num" :style="{ color: '#bc92c9'}">
{{ rzuser }}
</div>
<div style="font-size: 16px;">认证用户</div>
</div>
<div class="grid-msg-right" style="border: none;" @click="toRout('/vehicle/car')">
<div class="grid-msg-num" :style="{ color: '#3aaec2'}">
{{ rzvehicle }}
</div>
<div style="font-size: 16px;">认证车辆</div>
</div>
</div>
</div>
</el-col>
<!--机器人数量-->
<el-col :span="7">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#E6A23C'}">
<component is="BellFilled" />
</el-icon>
<div class="grid-msg-right" @click="toRout('swapstation/robot')">
<div class="grid-msg-num" :style="{ color: '#E6A23C'}">
{{ robottotal }}
</div>
<div style="font-size: 16px;">机器人总数</div>
</div>
<div class="grid-msg-right" style="border: none;" @click="toRout('swapstation/robot')">
<div class="grid-msg-num" :style="{ color: '#34a312'}">
{{ kyrobot }}
</div>
<div style="font-size: 16px;">可用机器人</div>
</div>
</div>
</div>
</el-col>
<!-- <el-col v-for="(item, index) in messageList" :key="index" :span="messageList.length -1 == index?4:5">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{ background: item.color }">
<component :is="item.icon" />
</el-icon>
<div class="grid-msg-right">
<div class="grid-msg-num" :style="{ color: item.color }">
{{ item.count }}
</div>
<div style="font-size: 16px;">{{ item.name }}</div>
</div>
</div>
</div>
</el-col> -->
</el-row>
<el-row :gutter="20" class="mgb20">
<el-col :span="12">
<div style="width: 100%;height: 150px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div style="display: flex;justify-content: space-between;cursor:pointer;">
<div style="width:31%;height: 150px;border-radius: 10px 0 0 10px;text-align: center;background: #fff;" @click="toRout('/swapstation/battery')">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #409eff;border-radius: 10px 10px 0 0;border-bottom: 3px solid #ebf5ff;">电池总量</div>
<div style="height: 100px;line-height: 100px;font-size: 40px;font-weight: bold;color: #409eff;">{{ dctotal }}</div>
</div>
<div style="width:31%;height: 150px;text-align: center;background: #fff;" @click="toRout('')">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #67c23a;border-radius: 10px 10px 0 0;border-bottom: 3px solid #ebf5ff;">充电电池</div>
<div style="height: 55px;line-height: 100px;font-size: 40px;font-weight: bold;color: #67c23a;">{{cddctotal}}</div>
</div>
<div style="width:31%;height: 150px;border-radius: 0 10px 10px 0;text-align: center;background: #fff;" @click="toRout('/swapstation/battery')">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #e6a23c;border-radius: 10px 10px 0 0;border-bottom: 3px solid #ebf5ff;">可用电池</div>
<div style="height: 100px;line-height: 100px;font-size: 40px;font-weight: bold;color: #e6a23c;">{{kydctotal}}</div>
</div>
</div>
</div>
</el-col>
<el-col :span="12">
<div style="width: 100%;height: 150px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div style="display: flex;justify-content: space-between;">
<div style="width:31%;height: 150px;border-radius: 10px 0 0 10px;text-align: center;background: #fff; cursor: pointer;" @click="toRout('/order/replabatt')">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #409eff;border-radius: 20px 20px 0 0;border-bottom: 3px solid #ebf5ff;">换电订单数</div>
<div style="height: 100px;line-height: 100px;font-size: 40px;font-weight: bold;color: #409eff;">{{totalOrder}}</div>
</div>
<div style="width:31%;height: 150px;border-radius: 10px 0 0 10px;text-align: center;background: #fff; cursor: pointer;" @click="toRout('/order/replabatt')">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #bc92c9;border-radius: 20px 20px 0 0;border-bottom: 3px solid #ebf5ff;">待支付订单数</div>
<div style="height: 100px;line-height: 100px;font-size: 40px;font-weight: bold;color: #bc92c9;">{{dzfOrder}}</div>
</div>
<div style="width:31%;height: 150px;border-radius: 0 10px 10px 0;text-align: center;background: #fff;">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #e6a23c;border-bottom: 3px solid #ebf5ff;border-radius: 20px 20px 0 0;">收入金额{{totalmoney > 10000000?'(万元)':'(元)'}}</div>
<div style="height: 100px;line-height: 100px;font-size: 40px;font-weight: bold;color: #e6a23c;">
{{ totalmoney }}
</div>
</div>
</div>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="mgb20">
<el-col :span="9">
<div ref="refChart4" class="chart-cont2" style="padding:10px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);background: #fff;"></div>
</el-col>
<el-col :span="15">
<div ref="refChart5" class="chart-cont2" style="padding:10px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);background: #fff;"></div>
</el-col>
</el-row>
<el-row >
<el-col :span="24">
<div style="width: 100%;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<el-table
:data="alarmlist"
border
stripe
height="260px"
>
<el-table-column label="站点名称" min-width="200" align="center" prop="stationName" :show-overflow-tooltip="true" />
<el-table-column label="报警类型" min-width="200" align="center" prop="alarmType" :show-overflow-tooltip="true" />
<el-table-column label="报警时间" min-width="200" align="center" prop="alarmTime" :show-overflow-tooltip="true" />
</el-table>
</div>
</el-col>
</el-row>
</div>
</template>
<script lang="ts" setup name="homePage">
import {
nextTick,
onMounted,
ref,
onBeforeUnmount,
watch
} from 'vue'
import { useRouter } from 'vue-router'
import * as echarts from "echarts"
import { useElementSize } from "@vueuse/core"
import {
ptgetotal,
zbjetotal,
givealarm
} from '@/api/home'
function glnum(n:any){
if(n>10000000){
return Math.round((n/1000000)*100)/100
}
return n/100
}
let router = useRouter()
function toRout(path:string,query:Record<string, any> = {}) {
router.push({
path,
query
})
}
//
let operatotal = ref('')
//
let hdztotal = ref('')
//
let kyhdz = ref('')
//
let dctotal = ref('')
//
let cddctotal = ref('')
//
let kydctotal = ref('')
//
let robottotal = ref('')
//
let kyrobot = ref('')
//
let rzcompany = ref('')
//
let rzuser = ref('')
//
let rzvehicle = ref('')
//
let tbList = ref<any>([])
//
ptgetotal().then(rps => {
operatotal.value = (rps.data as any).proxyNum
hdztotal.value = (rps.data as any).totalStation
kyhdz.value = (rps.data as any).workStation
dctotal.value = (rps.data as any).totalDC
cddctotal.value = (rps.data as any).chargeDC
kydctotal.value = (rps.data as any).availableDC
robottotal.value = (rps.data as any).totalRobot
kyrobot.value = (rps.data as any).availableRobot
rzcompany.value = (rps.data as any).totalCompanyNum
rzuser.value = (rps.data as any).totalUserNum
rzvehicle.value = (rps.data as any).totalCarNum
})
//
let alarmlist = ref<any>([])
givealarm().then((rps:any) => {
if(rps.data && rps.data.length > 0){
alarmlist.value = rps.data
}
})
//
// getgyctotal().then(rps => {
// rzcompany.value = (rps.data as any).conpany
// rzuser.value = (rps.data as any).totalUser
// rzvehicle.value = (rps.data as any).totalCar
// })
const messageList = ref([
{
type: "mytask",
name: "运营商",
count: 0,
color: "#409EFF",
icon: "Promotion",
linkUrl: "/workbench/workflow/task/myProcess",
},
{
type: "todo",
name: "换电站",
count: 55,
color: "#409EFF",
icon: "Flag",
linkUrl: "/workbench/workflow/task/todo",
},
{
type: "done",
name: "电池总量",
count: 0,
color: "#67C23A",
icon: "SuccessFilled",
linkUrl: "/workbench/workflow/task/done",
},
{
type: "conclude",
name: "充电电池数量",
count: 0,
color: "#67C23A",
icon: "Checked",
linkUrl: "/workbench/workflow/task/done",
},
{
type: "message",
name: "机器人数量",
count: 0,
color: "#E6A23C",
icon: "BellFilled",
linkUrl: "#",
},
// {
// type: "warninng",
// name: "",
// count: 0,
// color: "#F56C6C",
// icon: "WarningFilled",
// linkUrl: "#",
// },
]);
// 4
const refChart4 = ref();
let myChart4: echarts.EChartsType;
const initChart4 = () => {
if (refChart4.value) {
//echarts
myChart4 = echarts.init(refChart4.value);
//
const option = {
title: {
text: '运营商订单占比',
left: 'center',
textStyle: {
color: '#2363a5',
fontSize: 16
}
},
// grid: {
// left: '3%',
// top:'20%',
// right: '4%',
// bottom: '3%',
// containLabel: true
// },
label: {
show: true, //
formatter: '{b}({d}%)' // 使 formatter {b} {d} {@2019}
},
tooltip: {
trigger: "item",
},
// legend: {
// type: "scroll",
// orient: "horizontal",
// left: "center",
// bottom: 0,
// },
series: [
{
name: "数量",
type: "pie",
top:'10%',
radius: ['40%','70%'],
data: bzdata.value,
padAngle: 2,
emphasis: {
itemStyle: {
paddingTop:'20px',
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)"
},
},
itemStyle:{
borderRadius: 3
}
},
],
};
// 使
myChart4.setOption(option);
}
};
// 5
const refChart5 = ref();
let myChart5: echarts.EChartsType;
const initChart5 = () => {
if (refChart5.value) {
//echarts
myChart5 = echarts.init(refChart5.value);
//
const option = {
title: {
text: "换电站近半年订单统计",
left: "center",
textStyle: {
color: '#2363a5',
fontSize: 16
}
},
grid: {
left: '3%',
top:'25%',
right: '4%',
bottom: '3%',
containLabel: true
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
crossStyle: {
color: "#999",
},
},
},
// toolbox: {
// feature: {
// dataView: { title: "", show: true, readOnly: false },
// magicType: {
// title: { line: "线", bar: "" },
// show: true,
// type: ["line", "bar"],
// },
// restore: { title: "", show: true },
// saveAsImage: { title: "", show: true },
// },
// },
legend: {
data: [ "订单", "金额"],
top:25
//bottom: 0,
},
xAxis: [
{
type: "category",
data:xdata.value, //["1", "2", "3", "4", "5", "6", "7"],
axisPointer: {
type: "shadow",
},
},
],
yAxis: [
{
type: "value",
name: "订单",
// min: 0,
// max: 50,
// interval: 50,
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "金额",
// min: 0,
// max: 50,
// interval: 50,
axisLabel: {
formatter: "{value} 元",
}
},
],
series: [
{
name: "订单",
type: "bar",
tooltip: {
valueFormatter: function (value: string) {
return value;
},
},
data:yOrder.value, //[80.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
yAxisIndex:0
},
{
name: "金额",
type: "bar",
tooltip: {
valueFormatter: function (value: string) {
return value + " 元";
},
},
data:yMoney.value, //[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
yAxisIndex:1
},
// {
// name: "",
// type: "line",
// tooltip: {
// valueFormatter: function (value: string) {
// return value + " ";
// },
// },
// data:yMoney.value //[5.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
// },
// {
// name: "",
// type: "line",
// tooltip: {
// valueFormatter: function (value: string) {
// return value + " ml";
// },
// },
// data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
// }
],
};
// 使
myChart5.setOption(option);
}
};
//
const resizeChart = () => {
//
setTimeout(() => {
myChart4?.resize()
myChart5?.resize()
//myChart6?.resize()
}, 400);
};
//
const homePage = ref();
const { width: pageWidth } = useElementSize(homePage);
watch(pageWidth, () => {
resizeChart();
});
//
let totalOrder = ref('')
let dzfOrder = ref('')
//
let jyamount = ref<any>('')
let totalmoney = ref<any>('')
//
let zcamount = ref<any>('')
let totalRefund = ref<any>('')
//
let bzdata = ref<any>([])
//6
let xdata = ref<any>([])
let yMoney = ref<any>([])
let yOrder = ref<any>([])
//
onMounted(() => {
nextTick(() => {
zbjetotal().then(rps => {
totalOrder.value = (rps.data as any).totalOrderNum //
totalmoney.value = (rps.data as any).totalFinishAmount //()
totalmoney.value = glnum(totalmoney.value)
dzfOrder.value = (rps.data as any).totalPendingOrderNum
bzdata.value = (rps.data as any).countList.map((n:any) => {
return {
name:n.proxyName,
value:n.quantity
}
})
initChart4()
xdata.value = (rps.data as any).trendList.map((n:any) => {
return n.month
})
yOrder.value = (rps.data as any).trendList.map((n:any) => {
return n.quantity
})
yMoney.value = (rps.data as any).trendList.map((n:any) => {
return n.totalMoney/100
})
initChart5()
})
})
})
//
onBeforeUnmount(() => {
window.removeEventListener("resize", resizeChart)
})
// defineExpose使
// defineExpose({ value });
</script>
<style lang="less" scoped>
@message-width: 80px;
.page {
padding-bottom: 20px;
}
.grid-message {
display: flex;
align-items: center;
height: @message-width;
cursor: pointer;
}
.grid-msg-right {
flex: 1;
text-align: center;
font-size: 14px;
color: #999;
border-right:1px solid #ccc;
}
.grid-msg-num {
font-size: 30px;
font-weight: bold;
}
.grid-msg-icon {
font-size: 50px;
width: @message-width;
height: @message-width;
text-align: center;
line-height: @message-width;
color: #fff;
}
.chart-cont {
height: 140px;
> h1 {
color: #606266;
font-weight: normal;
display: flex;
font-size: 14px;
justify-content: space-between;
}
> p {
margin: 0;
padding: 0;
font-size: 30px;
line-height: 40px;
}
> div {
height: 60px;
width: 100%;
> p {
margin: 0;
padding-top: 10px;
line-height: 20px;
font-size: 12px;
color: #909399;
}
}
}
.chart-cont2 {
height: 260px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>

View File

@ -0,0 +1,251 @@
<template>
<div ref="homePage" class="page">
<el-row :gutter="20" class="mgb20">
<el-col :span="6">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#67C23A'}">
<component is="SuccessFilled" />
</el-icon>
<div class="grid-msg-right" @click="toRout('/vehicle/car')">
<div class="grid-msg-num" :style="{ color: '#67C23A'}">
{{ cltotal }}
</div>
<div style="font-size: 16px;">车辆总数</div>
</div>
</div>
</div>
</el-col>
<el-col :span="6">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#E6A23C'}">
<component is="BellFilled" />
</el-icon>
<div class="grid-msg-right" @click="toRout('/vehicle/wxuser')">
<div class="grid-msg-num" :style="{ color: '#E6A23C'}">
{{ ygtotal }}
</div>
<div style="font-size: 16px;">员工总数</div>
</div>
</div>
</div>
</el-col>
<el-col :span="6">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#E6A23C'}">
<component is="BellFilled" />
</el-icon>
<div class="grid-msg-right" @click="toRout('/order/replabatt')">
<div class="grid-msg-num" :style="{ color: '#E6A23C'}">
{{ djstotal }}
</div>
<div style="font-size: 16px;">待支付订单</div>
</div>
</div>
</div>
</el-col>
<el-col :span="6">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#E6A23C'}">
<component is="BellFilled" />
</el-icon>
<div class="grid-msg-right">
<div class="grid-msg-num" :style="{ color: '#E6A23C'}">
{{ djsjetotal/100 }}
</div>
<div style="font-size: 16px;">待支付金额</div>
</div>
</div>
</div>
</el-col>
</el-row>
<el-row >
<el-col :span="24">
<div style="width: 100%;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<el-table
:data="list"
border
stripe
height="700px"
>
<el-table-column label="换电时间" min-width="200" align="center" prop="swapTime" :show-overflow-tooltip="true" />
<el-table-column label="换电车辆" min-width="200" align="center" prop="swapCar" :show-overflow-tooltip="true" />
<el-table-column label="换电人" min-width="200" align="center" prop="swapUserName" :show-overflow-tooltip="true" />
<el-table-column label="换电金额(元)" min-width="200" align="center" prop="swapAmount" :show-overflow-tooltip="true">
<template #default="scope">
<div>{{scope.row.swapAmount/100}}</div>
</template>
</el-table-column>
</el-table>
</div>
</el-col>
</el-row>
</div>
</template>
<script lang="ts" setup name="homePage">
import {
ref,
} from 'vue'
import { useRouter } from 'vue-router'
import {
gongsdata
} from '@/api/home'
let cltotal = ref<any>('')
let ygtotal = ref<any>('')
let djstotal = ref<any>('')
let djsjetotal = ref<any>('')
let list = ref<any>([])
gongsdata().then((rps:any) => {
cltotal.value = rps.data.carNum //
ygtotal.value = rps.data.userNum //
djsjetotal.value = rps.data.pendingOrderAmount //
djstotal.value = rps.data.pendingOrderNum //
if(rps.data.orderList && rps.data.orderList.length > 0){
list.value = rps.data.orderList
}
})
function glnum(n:any){
if(n>10000000){
return Math.round((n/1000000)*100)/100
}
return n/100
}
let router = useRouter()
function toRout(path:string,query:Record<string, any> = {}) {
router.push({
path,
query
})
}
// defineExpose使
// defineExpose({ value });
</script>
<style lang="less" scoped>
@message-width: 80px;
.page {
padding-bottom: 20px;
}
.grid-message {
display: flex;
align-items: center;
height: @message-width;
cursor: pointer;
}
.grid-msg-right {
flex: 1;
text-align: center;
font-size: 14px;
color: #999;
border-right:1px solid #ccc;
}
.grid-msg-num {
font-size: 30px;
font-weight: bold;
}
.grid-msg-icon {
font-size: 50px;
width: @message-width;
height: @message-width;
text-align: center;
line-height: @message-width;
color: #fff;
}
.chart-cont {
height: 140px;
> h1 {
color: #606266;
font-weight: normal;
display: flex;
font-size: 14px;
justify-content: space-between;
}
> p {
margin: 0;
padding: 0;
font-size: 30px;
line-height: 40px;
}
> div {
height: 60px;
width: 100%;
> p {
margin: 0;
padding-top: 10px;
line-height: 20px;
font-size: 12px;
color: #909399;
}
}
}
.chart-cont2 {
height: 260px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>

View File

@ -0,0 +1,587 @@
<template>
<div ref="homePage" class="page">
<!-- <el-button
type="primary"
plain
icon="Plus"
@click="testsx()">测试失效</el-button> -->
<el-row :gutter="20" class="mgb20">
<!--换电站-->
<el-col :span="6">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#28b3a1'}">
<component is="Flag" />
</el-icon>
<div class="grid-msg-right" @click="toRout('/swapstation/hdz')">
<div class="grid-msg-num" :style="{ color: '#28b3a1'}">
{{ hdztotal }}
</div>
<div style="font-size: 16px;">换电站</div>
</div>
<div class="grid-msg-right" style="border: none;" @click="toRout('/swapstation/hdz',{status: 1})">
<div class="grid-msg-num" :style="{ color: '#b5a210'}">
{{ kyhdz }}
</div>
<div style="font-size: 16px;">可用换电站</div>
</div>
</div>
</div>
</el-col>
<!--电池总量-->
<el-col :span="12">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#67C23A'}">
<component is="SuccessFilled" />
</el-icon>
<div class="grid-msg-right" @click="toRout('/swapstation/battery')">
<div class="grid-msg-num" :style="{ color: '#67C23A'}">
{{ dctotal }}
</div>
<div style="font-size: 16px;">电池总量</div>
</div>
<div class="grid-msg-right" @click="toRout('')">
<div class="grid-msg-num" :style="{ color: '#bc92c9'}">
{{ dctotal }}
</div>
<div style="font-size: 16px;">充电电池</div>
</div>
<div class="grid-msg-right" style="border: none;" @click="toRout('/swapstation/battery')">
<div class="grid-msg-num" :style="{ color: '#3aaec2'}">
{{ kydctotal }}
</div>
<div style="font-size: 16px;">可用电池</div>
</div>
</div>
</div>
</el-col>
<!--机器人数量-->
<el-col :span="6">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#E6A23C'}">
<component is="BellFilled" />
</el-icon>
<div class="grid-msg-right" @click="toRout('swapstation/robot')">
<div class="grid-msg-num" :style="{ color: '#E6A23C'}">
{{ robottotal }}
</div>
<div style="font-size: 16px;">机器人总数</div>
</div>
<div class="grid-msg-right" style="border: none;" @click="toRout('swapstation/robot')">
<div class="grid-msg-num" :style="{ color: '#34a312'}">
{{ kyrobot }}
</div>
<div style="font-size: 16px;">可用机器人</div>
</div>
</div>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="mgb20">
<el-col :span="24">
<div style="display: flex;justify-content: space-between;width: 100%;height: 150px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div style="width:22%;height: 150px;border-radius: 10px 0 0 10px;text-align: center;background: #fff; cursor: pointer;" @click="toRout('/order/replabatt')">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #409eff;border-radius: 20px 20px 0 0;border-bottom: 3px solid #ebf5ff;">当月换电订单总量</div>
<div style="height: 100px;line-height: 100px;font-size: 40px;font-weight: bold;color: #409eff;">{{totalOrder}}</div>
</div>
<div style="width:22%;height: 150px;border-radius: 10px 0 0 10px;text-align: center;background: #fff; cursor: pointer;" @click="toRout('/order/replabatt')">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #409eff;border-radius: 20px 20px 0 0;border-bottom: 3px solid #ebf5ff;">当月换电总收入{{totalmoney > 10000000?'(万元)':'(元)'}}</div>
<div style="height: 100px;line-height: 100px;font-size: 40px;font-weight: bold;color: #409eff;">{{totalmoney}}</div>
</div>
<div style="width:22%;height: 150px;border-radius: 10px 0 0 10px;text-align: center;background: #fff; cursor: pointer;" @click="toRout('/order/replabatt')">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #bc92c9;border-radius: 20px 20px 0 0;border-bottom: 3px solid #ebf5ff;">当月待支付订单数</div>
<div style="height: 100px;line-height: 100px;font-size: 40px;font-weight: bold;color: #bc92c9;">{{dzfOrder}}</div>
</div>
<div style="width:22%;height: 150px;border-radius: 10px 0 0 10px;text-align: center;background: #fff; cursor: pointer;" @click="toRout('/order/replabatt')">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #bc92c9;border-radius: 20px 20px 0 0;border-bottom: 3px solid #ebf5ff;">当月待支付订金额{{djsamount > 10000000?'(万元)':'(元)'}}</div>
<div style="height: 100px;line-height: 100px;font-size: 40px;font-weight: bold;color: #bc92c9;">{{djsamount}}</div>
</div>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="mgb20">
<el-col :span="9">
<div ref="refChart4" class="chart-cont2" style="padding:10px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);background: #fff;"></div>
</el-col>
<el-col :span="15">
<div ref="refChart5" class="chart-cont2" style="padding:10px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);background: #fff;"></div>
</el-col>
</el-row>
<el-row >
<el-col :span="24">
<div style="width: 100%;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<el-table
:data="alarmlist"
border
stripe
height="260px"
>
<el-table-column label="站点名称" min-width="200" align="center" prop="stationName" :show-overflow-tooltip="true" />
<el-table-column label="报警类型" min-width="200" align="center" prop="alarmType" :show-overflow-tooltip="true" />
<el-table-column label="报警时间" min-width="200" align="center" prop="alarmTime" :show-overflow-tooltip="true" />
</el-table>
</div>
</el-col>
</el-row>
</div>
</template>
<script lang="ts" setup name="homePage">
import {
nextTick,
onMounted,
ref,
onBeforeUnmount,
watch
} from 'vue'
import { useRouter } from 'vue-router'
import * as echarts from "echarts"
import { useElementSize } from "@vueuse/core"
import {
givealarm,
yysgetotal,
dybndata
} from '@/api/home'
function glnum(n:any){
if(n>10000000){
return Math.round((n/1000000)*100)/100
}
return n/100
}
let router = useRouter()
function toRout(path:string,query:Record<string, any> = {}) {
router.push({
path,
query
})
}
//
let operatotal = ref('')
//
let hdztotal = ref('')
//
let kyhdz = ref('')
//
let dctotal = ref('')
//
let cddctotal = ref('')
//
let kydctotal = ref('')
//
let robottotal = ref('')
//
let kyrobot = ref('')
//
//
yysgetotal().then(rps => {
operatotal.value = (rps.data as any).proxyNum
hdztotal.value = (rps.data as any).totalStation
kyhdz.value = (rps.data as any).workStation
dctotal.value = (rps.data as any).totalDC
cddctotal.value = (rps.data as any).chargeDC
kydctotal.value = (rps.data as any).availableDC
robottotal.value = (rps.data as any).totalRobot
kyrobot.value = (rps.data as any).availableRobot
})
//
let alarmlist = ref<any>([])
givealarm().then((rps:any) => {
if(rps.data && rps.data.length > 0){
alarmlist.value = rps.data
}
})
//
// getgyctotal().then(rps => {
// rzcompany.value = (rps.data as any).conpany
// rzuser.value = (rps.data as any).totalUser
// rzvehicle.value = (rps.data as any).totalCar
// })
// 4
const refChart4 = ref();
let myChart4: echarts.EChartsType;
const initChart4 = () => {
if (refChart4.value) {
//echarts
myChart4 = echarts.init(refChart4.value);
//
const option = {
title: {
text: '运营商订单占比',
left: 'center',
textStyle: {
color: '#2363a5',
fontSize: 16
}
},
// grid: {
// left: '3%',
// top:'20%',
// right: '4%',
// bottom: '3%',
// containLabel: true
// },
label: {
show: true, //
formatter: '{b}({d}%)' // 使 formatter {b} {d} {@2019}
},
tooltip: {
trigger: "item",
},
// legend: {
// type: "scroll",
// orient: "horizontal",
// left: "center",
// bottom: 0,
// },
series: [
{
name: "数量",
type: "pie",
top:'10%',
radius: ['40%','70%'],
data: bzdata.value,
padAngle: 2,
emphasis: {
itemStyle: {
paddingTop:'20px',
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)"
},
},
itemStyle:{
borderRadius: 3
}
},
],
};
// 使
myChart4.setOption(option);
}
};
// 5
const refChart5 = ref();
let myChart5: echarts.EChartsType;
const initChart5 = () => {
if (refChart5.value) {
//echarts
myChart5 = echarts.init(refChart5.value);
//
const option = {
title: {
text: "换电站近半年订单统计",
left: "center",
textStyle: {
color: '#2363a5',
fontSize: 16
}
},
grid: {
left: '3%',
top:'25%',
right: '4%',
bottom: '3%',
containLabel: true
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
crossStyle: {
color: "#999",
},
},
},
// toolbox: {
// feature: {
// dataView: { title: "", show: true, readOnly: false },
// magicType: {
// title: { line: "线", bar: "" },
// show: true,
// type: ["line", "bar"],
// },
// restore: { title: "", show: true },
// saveAsImage: { title: "", show: true },
// },
// },
legend: {
data: [ "订单", "金额"],
top:25
//bottom: 0,
},
xAxis: [
{
type: "category",
data:xdata.value, //["1", "2", "3", "4", "5", "6", "7"],
axisPointer: {
type: "shadow",
},
},
],
yAxis: [
{
type: "value",
name: "订单",
// min: 0,
// max: 50,
// interval: 50,
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "金额",
// min: 0,
// max: 50,
// interval: 50,
axisLabel: {
formatter: "{value} 元",
}
},
],
series: [
{
name: "订单",
type: "bar",
tooltip: {
valueFormatter: function (value: string) {
return value;
},
},
data:yOrder.value, //[80.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
yAxisIndex:0
},
{
name: "金额",
type: "bar",
tooltip: {
valueFormatter: function (value: string) {
return value + " 元";
},
},
data:yMoney.value, //[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
yAxisIndex:1
},
// {
// name: "",
// type: "line",
// tooltip: {
// valueFormatter: function (value: string) {
// return value + " ";
// },
// },
// data:yMoney.value //[5.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
// },
// {
// name: "",
// type: "line",
// tooltip: {
// valueFormatter: function (value: string) {
// return value + " ml";
// },
// },
// data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
// }
],
};
// 使
myChart5.setOption(option);
}
};
//
const resizeChart = () => {
//
setTimeout(() => {
myChart4?.resize()
myChart5?.resize()
//myChart6?.resize()
}, 400);
};
//
const homePage = ref();
const { width: pageWidth } = useElementSize(homePage);
watch(pageWidth, () => {
resizeChart();
});
//
let totalOrder = ref('')
//
let dzfOrder = ref('')
//
let totalmoney = ref<any>('')
//
let djsamount = ref<any>('')
//
let bzdata = ref<any>([])
//6
let xdata = ref<any>([])
let yMoney = ref<any>([])
let yOrder = ref<any>([])
//
onMounted(() => {
nextTick(() => {
dybndata().then(rps => {
totalOrder.value = (rps.data as any).currentTotalOrderNum //
totalmoney.value = (rps.data as any).currentTotalFinishAmount //()
totalmoney.value = glnum(totalmoney.value)
dzfOrder.value = (rps.data as any).currentTotalPendingOrderNum //
djsamount.value = (rps.data as any).currentTotalPendingOrderAmount
djsamount.value = glnum(djsamount.value)
bzdata.value = (rps.data as any).countList.map((n:any) => {
return {
name:n.stationName,
value:n.quantity
}
})
initChart4()
xdata.value = (rps.data as any).trendList.map((n:any) => {
return n.month
})
yOrder.value = (rps.data as any).trendList.map((n:any) => {
return n.quantity
})
yMoney.value = (rps.data as any).trendList.map((n:any) => {
return n.totalMoney/100
})
initChart5()
})
})
})
//
onBeforeUnmount(() => {
window.removeEventListener("resize", resizeChart)
})
// defineExpose使
// defineExpose({ value });
</script>
<style lang="less" scoped>
@message-width: 80px;
.page {
padding-bottom: 20px;
}
.grid-message {
display: flex;
align-items: center;
height: @message-width;
cursor: pointer;
}
.grid-msg-right {
flex: 1;
text-align: center;
font-size: 14px;
color: #999;
border-right:1px solid #ccc;
}
.grid-msg-num {
font-size: 30px;
font-weight: bold;
}
.grid-msg-icon {
font-size: 50px;
width: @message-width;
height: @message-width;
text-align: center;
line-height: @message-width;
color: #fff;
}
.chart-cont {
height: 140px;
> h1 {
color: #606266;
font-weight: normal;
display: flex;
font-size: 14px;
justify-content: space-between;
}
> p {
margin: 0;
padding: 0;
font-size: 30px;
line-height: 40px;
}
> div {
height: 60px;
width: 100%;
> p {
margin: 0;
padding-top: 10px;
line-height: 20px;
font-size: 12px;
color: #909399;
}
}
}
.chart-cont2 {
height: 260px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>

View File

@ -0,0 +1,530 @@
<template>
<div ref="homePage" class="page">
<el-row :gutter="20" class="mgb20">
<!--电池总量-->
<el-col :span="12">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#67C23A'}">
<component is="SuccessFilled" />
</el-icon>
<div class="grid-msg-right" @click="toRout('/swapstation/battery')">
<div class="grid-msg-num" :style="{ color: '#67C23A'}">
{{ dctotal }}
</div>
<div style="font-size: 16px;">电池总量</div>
</div>
<div class="grid-msg-right" @click="toRout('')">
<div class="grid-msg-num" :style="{ color: '#bc92c9'}">
{{ dctotal }}
</div>
<div style="font-size: 16px;">充电电池</div>
</div>
<div class="grid-msg-right" style="border: none;" @click="toRout('/swapstation/battery')">
<div class="grid-msg-num" :style="{ color: '#3aaec2'}">
{{ kydctotal }}
</div>
<div style="font-size: 16px;">可用电池</div>
</div>
</div>
</div>
</el-col>
<!--机器人数量-->
<el-col :span="12">
<div style="width: 100%;border-radius: 12px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div class="grid-message" style="background: #fff;border-radius:15px">
<el-icon class="grid-msg-icon" style="border-radius: 12px 0 0 12px;" :style="{background:'#E6A23C'}">
<component is="BellFilled" />
</el-icon>
<div class="grid-msg-right" @click="toRout('swapstation/robot')">
<div class="grid-msg-num" :style="{ color: '#E6A23C'}">
{{ robottotal }}
</div>
<div style="font-size: 16px;">机器人总数</div>
</div>
<div class="grid-msg-right" style="border: none;" @click="toRout('swapstation/robot')">
<div class="grid-msg-num" :style="{ color: '#34a312'}">
{{ kyrobot }}
</div>
<div style="font-size: 16px;">可用机器人</div>
</div>
</div>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="mgb20">
<el-col :span="24">
<div style="display: flex;justify-content: space-between;width: 100%;height: 150px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<div style="width:32%;height: 150px;border-radius: 10px 0 0 10px;text-align: center;background: #fff; cursor: pointer;" @click="toRout('/order/replabatt')">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #409eff;border-radius: 20px 20px 0 0;border-bottom: 3px solid #ebf5ff;">换电订单总量</div>
<div style="height: 100px;line-height: 100px;font-size: 40px;font-weight: bold;color: #409eff;">{{totalOrder}}</div>
</div>
<div style="width:32%;height: 150px;border-radius: 10px 0 0 10px;text-align: center;background: #fff; cursor: pointer;" @click="toRout('/order/replabatt')">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #68b564;border-radius: 20px 20px 0 0;border-bottom: 3px solid #ebf5ff;">已结算换电订单</div>
<div style="height: 100px;line-height: 100px;font-size: 40px;font-weight: bold;color: #68b564;">{{yjstotal}}</div>
</div>
<div style="width:32%;height: 150px;border-radius: 10px 0 0 10px;text-align: center;background: #fff; cursor: pointer;" @click="toRout('/order/replabatt')">
<div style="width: 100%;height: 50px;line-height: 50px;font-size: 18px;color: #409eff;border-radius: 20px 20px 0 0;border-bottom: 3px solid #ebf5ff;">待结算换电订单</div>
<div style="height: 100px;line-height: 100px;font-size: 40px;font-weight: bold;color: #409eff;">{{daijstotal}}</div>
</div>
</div>
</el-col>
</el-row>
<el-row :gutter="20" class="mgb20">
<el-col :span="24">
<div ref="refChart5" class="chart-cont2" style="padding:10px;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);background: #fff;"></div>
</el-col>
</el-row>
<el-row >
<el-col :span="24">
<div style="width: 100%;border-radius: 10px;box-shadow: 0 0 20px -5px rgba(84, 151, 232, 0.5);">
<el-table
:data="alarmlist"
border
stripe
height="260px"
>
<el-table-column label="站点名称" min-width="200" align="center" prop="stationName" :show-overflow-tooltip="true" />
<el-table-column label="报警类型" min-width="200" align="center" prop="alarmType" :show-overflow-tooltip="true" />
<el-table-column label="报警时间" min-width="200" align="center" prop="alarmTime" :show-overflow-tooltip="true" />
</el-table>
</div>
</el-col>
</el-row>
</div>
</template>
<script lang="ts" setup name="homePage">
import {
nextTick,
onMounted,
ref,
onBeforeUnmount,
watch
} from 'vue'
import { useRouter } from 'vue-router'
import * as echarts from "echarts"
import { useElementSize } from "@vueuse/core"
import {
givealarm,
zddata
} from '@/api/home'
function glnum(n:any){
if(n>10000000){
return Math.round((n/1000000)*100)/100
}
return n/100
}
let router = useRouter()
function toRout(path:string,query:Record<string, any> = {}) {
router.push({
path,
query
})
}
//
let dctotal = ref('')
//
let cddctotal = ref('')
//
let kydctotal = ref('')
//
let robottotal = ref('')
//
let kyrobot = ref('')
//
//
let alarmlist = ref<any>([])
givealarm().then((rps:any) => {
if(rps.data && rps.data.length > 0){
alarmlist.value = rps.data
}
})
//
// getgyctotal().then(rps => {
// rzcompany.value = (rps.data as any).conpany
// rzuser.value = (rps.data as any).totalUser
// rzvehicle.value = (rps.data as any).totalCar
// })
// 4
const refChart4 = ref();
let myChart4: echarts.EChartsType;
const initChart4 = () => {
if (refChart4.value) {
//echarts
myChart4 = echarts.init(refChart4.value);
//
const option = {
title: {
text: '运营商订单占比',
left: 'center',
textStyle: {
color: '#2363a5',
fontSize: 16
}
},
// grid: {
// left: '3%',
// top:'20%',
// right: '4%',
// bottom: '3%',
// containLabel: true
// },
label: {
show: true, //
formatter: '{b}({d}%)' // 使 formatter {b} {d} {@2019}
},
tooltip: {
trigger: "item",
},
// legend: {
// type: "scroll",
// orient: "horizontal",
// left: "center",
// bottom: 0,
// },
series: [
{
name: "数量",
type: "pie",
top:'10%',
radius: ['40%','70%'],
data: bzdata.value,
padAngle: 2,
emphasis: {
itemStyle: {
paddingTop:'20px',
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: "rgba(0, 0, 0, 0.5)"
},
},
itemStyle:{
borderRadius: 3
}
},
],
};
// 使
myChart4.setOption(option);
}
};
// 5
const refChart5 = ref();
let myChart5: echarts.EChartsType;
const initChart5 = () => {
if (refChart5.value) {
//echarts
myChart5 = echarts.init(refChart5.value);
//
const option = {
title: {
text: "换电站近半年订单统计",
left: "center",
textStyle: {
color: '#2363a5',
fontSize: 16
}
},
grid: {
left: '3%',
top:'25%',
right: '4%',
bottom: '3%',
containLabel: true
},
tooltip: {
trigger: "axis",
axisPointer: {
type: "cross",
crossStyle: {
color: "#999",
},
},
},
// toolbox: {
// feature: {
// dataView: { title: "", show: true, readOnly: false },
// magicType: {
// title: { line: "线", bar: "" },
// show: true,
// type: ["line", "bar"],
// },
// restore: { title: "", show: true },
// saveAsImage: { title: "", show: true },
// },
// },
legend: {
data: [ "订单", "金额"],
top:25
//bottom: 0,
},
xAxis: [
{
type: "category",
data:xdata.value, //["1", "2", "3", "4", "5", "6", "7"],
axisPointer: {
type: "shadow",
},
},
],
yAxis: [
{
type: "value",
name: "订单",
// min: 0,
// max: 50,
// interval: 50,
axisLabel: {
formatter: "{value}",
},
},
{
type: "value",
name: "金额",
// min: 0,
// max: 50,
// interval: 50,
axisLabel: {
formatter: "{value} 元",
}
},
],
series: [
{
name: "订单",
type: "bar",
tooltip: {
valueFormatter: function (value: string) {
return value;
},
},
data:yOrder.value, //[80.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
yAxisIndex:0
},
{
name: "金额",
type: "bar",
tooltip: {
valueFormatter: function (value: string) {
return value + " 元";
},
},
data:yMoney.value, //[2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
yAxisIndex:1
},
// {
// name: "",
// type: "line",
// tooltip: {
// valueFormatter: function (value: string) {
// return value + " ";
// },
// },
// data:yMoney.value //[5.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3],
// },
// {
// name: "",
// type: "line",
// tooltip: {
// valueFormatter: function (value: string) {
// return value + " ml";
// },
// },
// data: [2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3],
// }
],
};
// 使
myChart5.setOption(option);
}
};
//
const resizeChart = () => {
//
setTimeout(() => {
myChart4?.resize()
myChart5?.resize()
//myChart6?.resize()
}, 400);
};
//
const homePage = ref();
const { width: pageWidth } = useElementSize(homePage);
watch(pageWidth, () => {
resizeChart();
});
//
let totalOrder = ref('')
//
let dzfOrder = ref('')
//
let totalmoney = ref<any>('')
let yjstotal = ref<any>('')
let daijstotal = ref<any>('')
//
let djsamount = ref<any>('')
//
let bzdata = ref<any>([])
//6
let xdata = ref<any>([])
let yMoney = ref<any>([])
let yOrder = ref<any>([])
//
onMounted(() => {
nextTick(() => {
//
zddata().then(rps => {
dctotal.value = (rps.data as any).totalDC
cddctotal.value = (rps.data as any).chargeDC
kydctotal.value = (rps.data as any).availableDC
robottotal.value = (rps.data as any).totalRobot
kyrobot.value = (rps.data as any).availableRobot
totalOrder.value = (rps.data as any).totalOrderNum //
yjstotal.value = (rps.data as any).totalFinishOrderNum //
daijstotal.value = (rps.data as any).totalPendingOrderNum //
xdata.value = (rps.data as any).trendList.map((n:any) => {
return n.month
})
yOrder.value = (rps.data as any).trendList.map((n:any) => {
return n.quantity
})
yMoney.value = (rps.data as any).trendList.map((n:any) => {
return n.totalMoney/100
})
initChart5()
})
})
})
//
onBeforeUnmount(() => {
window.removeEventListener("resize", resizeChart)
})
// defineExpose使
// defineExpose({ value });
</script>
<style lang="less" scoped>
@message-width: 80px;
.page {
padding-bottom: 20px;
}
.grid-message {
display: flex;
align-items: center;
height: @message-width;
cursor: pointer;
}
.grid-msg-right {
flex: 1;
text-align: center;
font-size: 14px;
color: #999;
border-right:1px solid #ccc;
}
.grid-msg-num {
font-size: 30px;
font-weight: bold;
}
.grid-msg-icon {
font-size: 50px;
width: @message-width;
height: @message-width;
text-align: center;
line-height: @message-width;
color: #fff;
}
.chart-cont {
height: 140px;
> h1 {
color: #606266;
font-weight: normal;
display: flex;
font-size: 14px;
justify-content: space-between;
}
> p {
margin: 0;
padding: 0;
font-size: 30px;
line-height: 40px;
}
> div {
height: 60px;
width: 100%;
> p {
margin: 0;
padding-top: 10px;
line-height: 20px;
font-size: 12px;
color: #909399;
}
}
}
.chart-cont2 {
height: 260px;
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
}
</style>

File diff suppressed because it is too large Load Diff

1138
src/views/index1.vue Normal file

File diff suppressed because it is too large Load Diff

View File

@ -302,7 +302,7 @@
function gethdzname(n:string) { function gethdzname(n:string) {
addata.stationName = n addata.stationName = n
} }
function showpop(num:any,row?:any){ function showpop(num:any,row?:any){
type.value = num type.value = num

View File

@ -97,7 +97,8 @@
const emit = defineEmits<{ const emit = defineEmits<{
cancel: [v?:boolean] cancel: [v?:boolean],
update:[]
}>() }>()
let showpop = ref(props.show) let showpop = ref(props.show)
@ -179,7 +180,8 @@
message: '分配成功' message: '分配成功'
}) })
setTimeout(() => { setTimeout(() => {
cancel() showpop.value = false
emit('update')
},2000) },2000)
}) })