|
@@ -191,21 +191,21 @@
|
|
|
<div class="statistics-wrap gap-3">
|
|
|
<el-card shadow="nover" class="left-wrap">
|
|
|
<div class="top-title-wrap">
|
|
|
- <div class="title">流量统计</div>
|
|
|
+ <div class="title">{{ $t('message.iotCard.detail.flowChart.title') }}</div>
|
|
|
<div class="operate-wrap">
|
|
|
<el-button-group>
|
|
|
- <el-button @click="changeDate(1)" :type="activeIndex == 1 ? 'primary' : ''">昨日</el-button>
|
|
|
- <el-button @click="changeDate(2)" :type="activeIndex == 2 ? 'primary' : ''">近一周</el-button>
|
|
|
- <el-button @click="changeDate(3)" :type="activeIndex == 3 ? 'primary' : ''">近一月</el-button>
|
|
|
- <el-button @click="changeDate(4)" :type="activeIndex == 4 ? 'primary' : ''">近一年</el-button>
|
|
|
+ <el-button @click="changeDate(1)" :type="activeIndex == 1 ? 'primary' : ''">{{ $t('message.iotCard.detail.flowChart.buttons.yesterday') }}</el-button>
|
|
|
+ <el-button @click="changeDate(2)" :type="activeIndex == 2 ? 'primary' : ''">{{ $t('message.iotCard.detail.flowChart.buttons.week') }}</el-button>
|
|
|
+ <el-button @click="changeDate(3)" :type="activeIndex == 3 ? 'primary' : ''">{{ $t('message.iotCard.detail.flowChart.buttons.month') }}</el-button>
|
|
|
+ <el-button @click="changeDate(4)" :type="activeIndex == 4 ? 'primary' : ''">{{ $t('message.iotCard.detail.flowChart.buttons.year') }}</el-button>
|
|
|
</el-button-group>
|
|
|
<el-date-picker
|
|
|
class="date-picker-wrap"
|
|
|
v-model="dateRange"
|
|
|
- type="datetimerange"
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="开始时间"
|
|
|
- end-placeholder="结束时间"
|
|
|
+ type="daterange"
|
|
|
+ :range-separator="$t('message.iotCard.detail.flowChart.datePicker.rangeSeparator')"
|
|
|
+ :start-placeholder="$t('message.iotCard.detail.flowChart.datePicker.startPlaceholder')"
|
|
|
+ :end-placeholder="$t('message.iotCard.detail.flowChart.datePicker.endPlaceholder')"
|
|
|
format="YYYY-MM-DD HH:mm:ss"
|
|
|
date-format="YYYY/MM/DD"
|
|
|
time-format="hh:mm:ss"
|
|
@@ -217,17 +217,17 @@
|
|
|
</el-card>
|
|
|
|
|
|
<el-card shadow="nover" class="right-wrap">
|
|
|
- <div class="title">数据统计</div>
|
|
|
+ <div class="title">{{ $t('message.iotCard.detail.dataStatistics.title') }}</div>
|
|
|
<div class="line-wrap flow-line-wrap">
|
|
|
<div class="text-wrap">
|
|
|
- <div class="text">昨日流量消耗</div>
|
|
|
+ <div class="text">{{ $t('message.iotCard.detail.dataStatistics.yesterdayFlow') }}</div>
|
|
|
<div>{{formatSize(statisticsData.yesterdayTotal * 1024 * 1024)}}</div>
|
|
|
</div>
|
|
|
<div class="line-inner-wrap" ref="yesterdayLine"></div>
|
|
|
</div>
|
|
|
<div class="line-wrap flow-line-wrap">
|
|
|
<div class="text-wrap">
|
|
|
- <div class="text">当月流量消耗</div>
|
|
|
+ <div class="text">{{ $t('message.iotCard.detail.dataStatistics.monthFlow') }}</div>
|
|
|
<div>{{formatSize(statisticsData.monthTotal * 1024 * 1024)}}</div>
|
|
|
</div>
|
|
|
<div class="line-inner-wrap" ref="monthLine"></div>
|
|
@@ -235,7 +235,7 @@
|
|
|
|
|
|
<div class="line-wrap flow-line-wrap">
|
|
|
<div class="text-wrap">
|
|
|
- <div class="text">本年流量消耗</div>
|
|
|
+ <div class="text">{{ $t('message.iotCard.detail.dataStatistics.yearFlow') }}</div>
|
|
|
<div>{{formatSize(statisticsData.yearTotal * 1024 * 1024)}}</div>
|
|
|
</div>
|
|
|
<div class="line-inner-wrap" ref="yearLine"></div>
|
|
@@ -254,9 +254,11 @@ import { useStore } from '/@/store/index';
|
|
|
import { useRoute } from 'vue-router';
|
|
|
import * as echarts from 'echarts';
|
|
|
import dayjs from 'dayjs';
|
|
|
+import { useI18n } from 'vue-i18n';
|
|
|
|
|
|
const store = useStore();
|
|
|
const route = useRoute();
|
|
|
+const { t } = useI18n();
|
|
|
const sim = ref({
|
|
|
accNumber: "",// 卡号
|
|
|
iccid: "",// ICCID
|
|
@@ -407,17 +409,20 @@ const handleDateChange = async (value:any) => {
|
|
|
|
|
|
const formatOperator = (val:number) => {
|
|
|
// 1电信,2联通,3移动
|
|
|
- return ['', '电信', '联通', '移动'][val];
|
|
|
+ const operators = ['', t('message.iotCard.index.operators.telecom'), t('message.iotCard.index.operators.unicom'), t('message.iotCard.index.operators.mobile')];
|
|
|
+ return operators[val];
|
|
|
}
|
|
|
|
|
|
const formatType = (val:number) => {
|
|
|
// 1月卡,2季卡,3年卡,4其他
|
|
|
- return ['', '月卡', '季卡', '年卡', '其他'][val];
|
|
|
+ const types = ['', t('message.iotCard.index.types.monthly'), t('message.iotCard.index.types.quarterly'), t('message.iotCard.index.types.yearly'), t('message.iotCard.index.types.other')];
|
|
|
+ return types[val];
|
|
|
}
|
|
|
|
|
|
const formatStatus = (val:any) => {
|
|
|
// 1:可激活 2:测试激活 3:测试去激活 4:在用 5:停机 6:运营商管理状态
|
|
|
- return ['', '可激活', '测试激活', '测试去激活', '在用', '停机', '运营商管理状态'][val];
|
|
|
+ const statuses = ['', t('message.iotCard.index.status.activatable'), t('message.iotCard.index.status.testActivated'), t('message.iotCard.index.status.testDeactivated'), t('message.iotCard.index.status.inUse'), t('message.iotCard.index.status.suspended'), t('message.iotCard.index.status.operatorManaged')];
|
|
|
+ return statuses[val];
|
|
|
}
|
|
|
|
|
|
// 折线图 - 昨日流量消耗
|
|
@@ -443,14 +448,14 @@ const initYesterdayLineChart = () => {
|
|
|
formatter: function (params:any) {
|
|
|
var relVal = params[0].name
|
|
|
let circle = `<i style="margin-right:4px;display: inline-block;width: 10px;height: 10px;border-radius: 50%;background-color:${params[0].color}"></i>`
|
|
|
- relVal += '<br/>' + circle + ' 流量: ' + formatSize(params[0].value*1024*1024)
|
|
|
+ relVal += '<br/>' + circle + ' ' + t('message.iotCard.detail.charts.tooltip.flow') + ': ' + formatSize(params[0].value*1024*1024)
|
|
|
return relVal;
|
|
|
}
|
|
|
},
|
|
|
grid: { top: 10, right: 10, bottom: 10, left: 10 },
|
|
|
series: [
|
|
|
{
|
|
|
- name: '流量',
|
|
|
+ name: t('message.iotCard.detail.charts.series.flow'),
|
|
|
type: 'line',
|
|
|
smooth: true,
|
|
|
data: yesterdayLineData.value,
|
|
@@ -487,14 +492,14 @@ const initMonthLineChart = () => {
|
|
|
formatter: function (params:any) {
|
|
|
var relVal = params[0].name
|
|
|
let circle = `<i style="margin-right:4px;display: inline-block;width: 10px;height: 10px;border-radius: 50%;background-color:${params[0].color}"></i>`
|
|
|
- relVal += '<br/>' + circle + ' 流量: ' + formatSize(params[0].value*1024*1024)
|
|
|
+ relVal += '<br/>' + circle + ' ' + t('message.iotCard.detail.charts.tooltip.flow') + ': ' + formatSize(params[0].value*1024*1024)
|
|
|
return relVal;
|
|
|
}
|
|
|
},
|
|
|
grid: { top: 10, right: 10, bottom: 10, left: 10 },
|
|
|
series: [
|
|
|
{
|
|
|
- name: '流量',
|
|
|
+ name: t('message.iotCard.detail.charts.series.flow'),
|
|
|
type: 'line',
|
|
|
smooth: true,
|
|
|
data: monthLineData.value,
|
|
@@ -530,14 +535,14 @@ const initYearLineChart = () => {
|
|
|
formatter: function (params:any) {
|
|
|
var relVal = params[0].name
|
|
|
let circle = `<i style="margin-right:4px;display: inline-block;width: 10px;height: 10px;border-radius: 50%;background-color:${params[0].color}"></i>`
|
|
|
- relVal += '<br/>' + circle + ' 流量: ' + formatSize(params[0].value*1024*1024)
|
|
|
+ relVal += '<br/>' + circle + ' ' + t('message.iotCard.detail.charts.tooltip.flow') + ': ' + formatSize(params[0].value*1024*1024)
|
|
|
return relVal;
|
|
|
}
|
|
|
},
|
|
|
grid: { top: 10, right: 10, bottom: 10, left: 10 },
|
|
|
series: [
|
|
|
{
|
|
|
- name: '流量',
|
|
|
+ name: t('message.iotCard.detail.charts.series.flow'),
|
|
|
type: 'line',
|
|
|
smooth: true,
|
|
|
data: yearLineData.value,
|
|
@@ -562,7 +567,7 @@ const iniFlowLineChart = async () => {
|
|
|
formatter: function (params:any) {
|
|
|
var relVal = params[0].name
|
|
|
let circle = `<i style="margin-right:4px;display: inline-block;width: 10px;height: 10px;border-radius: 50%;background-color:${params[0].color}"></i>`
|
|
|
- relVal += '<br/>' + circle + ' 流量: ' + params[0].value + 'MB'
|
|
|
+ relVal += '<br/>' + circle + ' ' + t('message.iotCard.detail.charts.tooltip.flow') + ': ' + params[0].value + 'MB'
|
|
|
return relVal;
|
|
|
}
|
|
|
},
|
|
@@ -589,7 +594,7 @@ const iniFlowLineChart = async () => {
|
|
|
],
|
|
|
series: [
|
|
|
{
|
|
|
- name: '流量',
|
|
|
+ name: t('message.iotCard.detail.charts.series.flow'),
|
|
|
type: 'line',
|
|
|
symbolSize: 6,
|
|
|
symbol: 'circle',
|