|
@@ -1,10 +1,10 @@
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import {computed, onMounted, ref} from 'vue';
|
|
|
|
|
|
|
+import { computed, onMounted, ref } from "vue";
|
|
|
import request from "@/utils/request.js";
|
|
import request from "@/utils/request.js";
|
|
|
-import {ElMessage} from "element-plus";
|
|
|
|
|
-import ECharts from 'vue-echarts';
|
|
|
|
|
-import 'echarts';
|
|
|
|
|
-import {parseTime} from "@/utils/ruoyi.js";
|
|
|
|
|
|
|
+import { ElMessage } from "element-plus";
|
|
|
|
|
+import ECharts from "vue-echarts";
|
|
|
|
|
+import "echarts";
|
|
|
|
|
+import { parseTime } from "@/utils/ruoyi.js";
|
|
|
|
|
|
|
|
// Data refs
|
|
// Data refs
|
|
|
const newElectricityData = ref(null);
|
|
const newElectricityData = ref(null);
|
|
@@ -14,36 +14,36 @@ const tableLoading = ref(false);
|
|
|
const totalRecords = ref(0);
|
|
const totalRecords = ref(0);
|
|
|
const currentPage = ref(1);
|
|
const currentPage = ref(1);
|
|
|
const pageSize = ref(10);
|
|
const pageSize = ref(10);
|
|
|
-const searchQuery = ref('');
|
|
|
|
|
|
|
+const searchQuery = ref("");
|
|
|
const dateRange = ref([]);
|
|
const dateRange = ref([]);
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
tableNumber: {
|
|
tableNumber: {
|
|
|
type: String,
|
|
type: String,
|
|
|
- required: true
|
|
|
|
|
|
|
+ required: true,
|
|
|
},
|
|
},
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
// Computed properties for dashboard metrics
|
|
// Computed properties for dashboard metrics
|
|
|
const formattedVoltages = computed(() => {
|
|
const formattedVoltages = computed(() => {
|
|
|
- if (!newElectricityData.value) return {a: '0', b: '0', c: '0'};
|
|
|
|
|
|
|
+ if (!newElectricityData.value) return { a: "0", b: "0", c: "0" };
|
|
|
return {
|
|
return {
|
|
|
a: parseFloat(newElectricityData.value.aVoltage || 0).toFixed(2),
|
|
a: parseFloat(newElectricityData.value.aVoltage || 0).toFixed(2),
|
|
|
b: parseFloat(newElectricityData.value.bVoltage || 0).toFixed(2),
|
|
b: parseFloat(newElectricityData.value.bVoltage || 0).toFixed(2),
|
|
|
- c: parseFloat(newElectricityData.value.cVoltage || 0).toFixed(2)
|
|
|
|
|
|
|
+ c: parseFloat(newElectricityData.value.cVoltage || 0).toFixed(2),
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const formattedCurrents = computed(() => {
|
|
const formattedCurrents = computed(() => {
|
|
|
- if (!newElectricityData.value) return {a: '0', b: '0', c: '0'};
|
|
|
|
|
|
|
+ if (!newElectricityData.value) return { a: "0", b: "0", c: "0" };
|
|
|
return {
|
|
return {
|
|
|
a: parseFloat(newElectricityData.value.aCurrent || 0).toFixed(2),
|
|
a: parseFloat(newElectricityData.value.aCurrent || 0).toFixed(2),
|
|
|
b: parseFloat(newElectricityData.value.bCurrent || 0).toFixed(2),
|
|
b: parseFloat(newElectricityData.value.bCurrent || 0).toFixed(2),
|
|
|
- c: parseFloat(newElectricityData.value.cCurrent || 0).toFixed(2)
|
|
|
|
|
|
|
+ c: parseFloat(newElectricityData.value.cCurrent || 0).toFixed(2),
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
const totalPowerConsumption = computed(() => {
|
|
const totalPowerConsumption = computed(() => {
|
|
|
- if (!newElectricityData.value) return '0';
|
|
|
|
|
|
|
+ if (!newElectricityData.value) return "0";
|
|
|
return parseFloat(newElectricityData.value.totalElectricity || 0).toFixed(2);
|
|
return parseFloat(newElectricityData.value.totalElectricity || 0).toFixed(2);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -54,46 +54,46 @@ const voltageChartOption = computed(() => {
|
|
|
const data = electricityRecords.value.slice().reverse();
|
|
const data = electricityRecords.value.slice().reverse();
|
|
|
return {
|
|
return {
|
|
|
tooltip: {
|
|
tooltip: {
|
|
|
- trigger: 'axis'
|
|
|
|
|
|
|
+ trigger: "axis",
|
|
|
},
|
|
},
|
|
|
legend: {
|
|
legend: {
|
|
|
- data: ['A相电压', 'B相电压', 'C相电压']
|
|
|
|
|
|
|
+ data: ["A相电压", "B相电压", "C相电压"],
|
|
|
},
|
|
},
|
|
|
grid: {
|
|
grid: {
|
|
|
- left: '3%',
|
|
|
|
|
- right: '4%',
|
|
|
|
|
- bottom: '3%',
|
|
|
|
|
- containLabel: true
|
|
|
|
|
|
|
+ left: "3%",
|
|
|
|
|
+ right: "4%",
|
|
|
|
|
+ bottom: "3%",
|
|
|
|
|
+ containLabel: true,
|
|
|
},
|
|
},
|
|
|
xAxis: {
|
|
xAxis: {
|
|
|
- type: 'category',
|
|
|
|
|
|
|
+ type: "category",
|
|
|
boundaryGap: false,
|
|
boundaryGap: false,
|
|
|
- data: data.map(item => {
|
|
|
|
|
|
|
+ data: data.map((item) => {
|
|
|
const date = new Date(item.createTime);
|
|
const date = new Date(item.createTime);
|
|
|
return `${date.getHours()}:${date.getMinutes()}`;
|
|
return `${date.getHours()}:${date.getMinutes()}`;
|
|
|
- })
|
|
|
|
|
|
|
+ }),
|
|
|
},
|
|
},
|
|
|
yAxis: {
|
|
yAxis: {
|
|
|
- type: 'value',
|
|
|
|
|
- name: '电压 (V)'
|
|
|
|
|
|
|
+ type: "value",
|
|
|
|
|
+ name: "电压 (V)",
|
|
|
},
|
|
},
|
|
|
series: [
|
|
series: [
|
|
|
{
|
|
{
|
|
|
- name: 'A相电压',
|
|
|
|
|
- type: 'line',
|
|
|
|
|
- data: data.map(item => parseFloat(item.aVoltage || 0))
|
|
|
|
|
|
|
+ name: "A相电压",
|
|
|
|
|
+ type: "line",
|
|
|
|
|
+ data: data.map((item) => parseFloat(item.aVoltage || 0)),
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- name: 'B相电压',
|
|
|
|
|
- type: 'line',
|
|
|
|
|
- data: data.map(item => parseFloat(item.bVoltage || 0))
|
|
|
|
|
|
|
+ name: "B相电压",
|
|
|
|
|
+ type: "line",
|
|
|
|
|
+ data: data.map((item) => parseFloat(item.bVoltage || 0)),
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- name: 'C相电压',
|
|
|
|
|
- type: 'line',
|
|
|
|
|
- data: data.map(item => parseFloat(item.cVoltage || 0))
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ name: "C相电压",
|
|
|
|
|
+ type: "line",
|
|
|
|
|
+ data: data.map((item) => parseFloat(item.cVoltage || 0)),
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -103,51 +103,51 @@ const powerChartOption = computed(() => {
|
|
|
const data = electricityRecords.value.slice().reverse();
|
|
const data = electricityRecords.value.slice().reverse();
|
|
|
return {
|
|
return {
|
|
|
tooltip: {
|
|
tooltip: {
|
|
|
- trigger: 'axis'
|
|
|
|
|
|
|
+ trigger: "axis",
|
|
|
},
|
|
},
|
|
|
legend: {
|
|
legend: {
|
|
|
- data: ['总有功功率', 'A相功率', 'B相功率', 'C相功率']
|
|
|
|
|
|
|
+ data: ["总有功功率", "A相功率", "B相功率", "C相功率"],
|
|
|
},
|
|
},
|
|
|
grid: {
|
|
grid: {
|
|
|
- left: '3%',
|
|
|
|
|
- right: '4%',
|
|
|
|
|
- bottom: '3%',
|
|
|
|
|
- containLabel: true
|
|
|
|
|
|
|
+ left: "3%",
|
|
|
|
|
+ right: "4%",
|
|
|
|
|
+ bottom: "3%",
|
|
|
|
|
+ containLabel: true,
|
|
|
},
|
|
},
|
|
|
xAxis: {
|
|
xAxis: {
|
|
|
- type: 'category',
|
|
|
|
|
|
|
+ type: "category",
|
|
|
boundaryGap: false,
|
|
boundaryGap: false,
|
|
|
- data: data.map(item => {
|
|
|
|
|
|
|
+ data: data.map((item) => {
|
|
|
const date = new Date(item.createTime);
|
|
const date = new Date(item.createTime);
|
|
|
return `${date.getHours()}:${date.getMinutes()}`;
|
|
return `${date.getHours()}:${date.getMinutes()}`;
|
|
|
- })
|
|
|
|
|
|
|
+ }),
|
|
|
},
|
|
},
|
|
|
yAxis: {
|
|
yAxis: {
|
|
|
- type: 'value',
|
|
|
|
|
- name: '功率 (kW)'
|
|
|
|
|
|
|
+ type: "value",
|
|
|
|
|
+ name: "功率 (kW)",
|
|
|
},
|
|
},
|
|
|
series: [
|
|
series: [
|
|
|
{
|
|
{
|
|
|
- name: '总有功功率',
|
|
|
|
|
- type: 'line',
|
|
|
|
|
- data: data.map(item => parseFloat(item.totalActivePower || 0))
|
|
|
|
|
|
|
+ name: "总有功功率",
|
|
|
|
|
+ type: "line",
|
|
|
|
|
+ data: data.map((item) => parseFloat(item.totalActivePower || 0)),
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- name: 'A相功率',
|
|
|
|
|
- type: 'line',
|
|
|
|
|
- data: data.map(item => parseFloat(item.aActivePower || 0))
|
|
|
|
|
|
|
+ name: "A相功率",
|
|
|
|
|
+ type: "line",
|
|
|
|
|
+ data: data.map((item) => parseFloat(item.aActivePower || 0)),
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- name: 'B相功率',
|
|
|
|
|
- type: 'line',
|
|
|
|
|
- data: data.map(item => parseFloat(item.bActivePower || 0))
|
|
|
|
|
|
|
+ name: "B相功率",
|
|
|
|
|
+ type: "line",
|
|
|
|
|
+ data: data.map((item) => parseFloat(item.bActivePower || 0)),
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
- name: 'C相功率',
|
|
|
|
|
- type: 'line',
|
|
|
|
|
- data: data.map(item => parseFloat(item.cActivePower || 0))
|
|
|
|
|
- }
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ name: "C相功率",
|
|
|
|
|
+ type: "line",
|
|
|
|
|
+ data: data.map((item) => parseFloat(item.cActivePower || 0)),
|
|
|
|
|
+ },
|
|
|
|
|
+ ],
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
|
|
|
|
@@ -155,15 +155,17 @@ const powerChartOption = computed(() => {
|
|
|
const getNewElectricityData = async () => {
|
|
const getNewElectricityData = async () => {
|
|
|
loading.value = true;
|
|
loading.value = true;
|
|
|
try {
|
|
try {
|
|
|
- const arr = [{
|
|
|
|
|
- column: "create_time",
|
|
|
|
|
- type: "orderByDesc"
|
|
|
|
|
- }];
|
|
|
|
|
|
|
+ const arr = [
|
|
|
|
|
+ {
|
|
|
|
|
+ column: "create_time",
|
|
|
|
|
+ type: "orderByDesc",
|
|
|
|
|
+ },
|
|
|
|
|
+ ];
|
|
|
|
|
|
|
|
const res = await request.get("/messageParse/getAll", {
|
|
const res = await request.get("/messageParse/getAll", {
|
|
|
params: {
|
|
params: {
|
|
|
- conditionJson: encodeURIComponent(JSON.stringify(arr))
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ conditionJson: encodeURIComponent(JSON.stringify(arr)),
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
if (res.code !== 200) {
|
|
if (res.code !== 200) {
|
|
@@ -188,31 +190,32 @@ const getNewElectricityData = async () => {
|
|
|
const getElectricityData = async () => {
|
|
const getElectricityData = async () => {
|
|
|
tableLoading.value = true;
|
|
tableLoading.value = true;
|
|
|
try {
|
|
try {
|
|
|
- const conditions = [{
|
|
|
|
|
- column: "create_time",
|
|
|
|
|
- type: "orderByDesc"
|
|
|
|
|
- }];
|
|
|
|
|
|
|
+ const conditions = [
|
|
|
|
|
+ {
|
|
|
|
|
+ column: "create_time",
|
|
|
|
|
+ type: "orderByDesc",
|
|
|
|
|
+ },
|
|
|
|
|
+ ];
|
|
|
conditions.push({
|
|
conditions.push({
|
|
|
column: "table_number",
|
|
column: "table_number",
|
|
|
type: "eq",
|
|
type: "eq",
|
|
|
- value: props.tableNumber
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ value: props.tableNumber,
|
|
|
|
|
+ });
|
|
|
|
|
|
|
|
// Add search condition if query exists
|
|
// Add search condition if query exists
|
|
|
if (searchQuery.value) {
|
|
if (searchQuery.value) {
|
|
|
conditions.push({
|
|
conditions.push({
|
|
|
column: "table_number",
|
|
column: "table_number",
|
|
|
type: "like",
|
|
type: "like",
|
|
|
- value: searchQuery.value
|
|
|
|
|
|
|
+ value: searchQuery.value,
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (dateRange.value && dateRange.value.length === 2) {
|
|
if (dateRange.value && dateRange.value.length === 2) {
|
|
|
-
|
|
|
|
|
conditions.push({
|
|
conditions.push({
|
|
|
column: "create_time",
|
|
column: "create_time",
|
|
|
type: "between",
|
|
type: "between",
|
|
|
- value: parseTime(dateRange.value[0]) + ',' + parseTime(dateRange.value[1])
|
|
|
|
|
|
|
+ value: parseTime(dateRange.value[0]) + "," + parseTime(dateRange.value[1]),
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -220,8 +223,8 @@ const getElectricityData = async () => {
|
|
|
params: {
|
|
params: {
|
|
|
pageNum: currentPage.value,
|
|
pageNum: currentPage.value,
|
|
|
pageSize: pageSize.value,
|
|
pageSize: pageSize.value,
|
|
|
- conditionJson: encodeURIComponent(JSON.stringify(conditions))
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ conditionJson: encodeURIComponent(JSON.stringify(conditions)),
|
|
|
|
|
+ },
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
if (res.code !== 200) {
|
|
if (res.code !== 200) {
|
|
@@ -262,12 +265,11 @@ const refreshData = () => {
|
|
|
|
|
|
|
|
// Format date for display
|
|
// Format date for display
|
|
|
const formatDate = (dateString) => {
|
|
const formatDate = (dateString) => {
|
|
|
- if (!dateString) return '';
|
|
|
|
|
|
|
+ if (!dateString) return "";
|
|
|
const date = new Date(dateString);
|
|
const date = new Date(dateString);
|
|
|
return date.toLocaleString();
|
|
return date.toLocaleString();
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-
|
|
|
|
|
// Lifecycle hooks
|
|
// Lifecycle hooks
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
getNewElectricityData();
|
|
getNewElectricityData();
|
|
@@ -313,15 +315,21 @@ onMounted(() => {
|
|
|
<div class="grid grid-cols-3 gap-2 text-center">
|
|
<div class="grid grid-cols-3 gap-2 text-center">
|
|
|
<div>
|
|
<div>
|
|
|
<h4 class="text-sm text-gray-500">A相</h4>
|
|
<h4 class="text-sm text-gray-500">A相</h4>
|
|
|
- <p class="text-lg font-semibold text-green-600">{{ formattedVoltages.a }}</p>
|
|
|
|
|
|
|
+ <p class="text-lg font-semibold text-green-600">
|
|
|
|
|
+ {{ formattedVoltages.a }}
|
|
|
|
|
+ </p>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
<h4 class="text-sm text-gray-500">B相</h4>
|
|
<h4 class="text-sm text-gray-500">B相</h4>
|
|
|
- <p class="text-lg font-semibold text-green-600">{{ formattedVoltages.b }}</p>
|
|
|
|
|
|
|
+ <p class="text-lg font-semibold text-green-600">
|
|
|
|
|
+ {{ formattedVoltages.b }}
|
|
|
|
|
+ </p>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
<h4 class="text-sm text-gray-500">C相</h4>
|
|
<h4 class="text-sm text-gray-500">C相</h4>
|
|
|
- <p class="text-lg font-semibold text-green-600">{{ formattedVoltages.c }}</p>
|
|
|
|
|
|
|
+ <p class="text-lg font-semibold text-green-600">
|
|
|
|
|
+ {{ formattedVoltages.c }}
|
|
|
|
|
+ </p>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</el-card>
|
|
</el-card>
|
|
@@ -338,15 +346,21 @@ onMounted(() => {
|
|
|
<div class="grid grid-cols-3 gap-2 text-center">
|
|
<div class="grid grid-cols-3 gap-2 text-center">
|
|
|
<div>
|
|
<div>
|
|
|
<h4 class="text-sm text-gray-500">A相</h4>
|
|
<h4 class="text-sm text-gray-500">A相</h4>
|
|
|
- <p class="text-lg font-semibold text-orange-600">{{ formattedCurrents.a }}</p>
|
|
|
|
|
|
|
+ <p class="text-lg font-semibold text-orange-600">
|
|
|
|
|
+ {{ formattedCurrents.a }}
|
|
|
|
|
+ </p>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
<h4 class="text-sm text-gray-500">B相</h4>
|
|
<h4 class="text-sm text-gray-500">B相</h4>
|
|
|
- <p class="text-lg font-semibold text-orange-600">{{ formattedCurrents.b }}</p>
|
|
|
|
|
|
|
+ <p class="text-lg font-semibold text-orange-600">
|
|
|
|
|
+ {{ formattedCurrents.b }}
|
|
|
|
|
+ </p>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
<h4 class="text-sm text-gray-500">C相</h4>
|
|
<h4 class="text-sm text-gray-500">C相</h4>
|
|
|
- <p class="text-lg font-semibold text-orange-600">{{ formattedCurrents.c }}</p>
|
|
|
|
|
|
|
+ <p class="text-lg font-semibold text-orange-600">
|
|
|
|
|
+ {{ formattedCurrents.c }}
|
|
|
|
|
+ </p>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</el-card>
|
|
</el-card>
|
|
@@ -362,9 +376,19 @@ onMounted(() => {
|
|
|
</template>
|
|
</template>
|
|
|
<div class="text-center">
|
|
<div class="text-center">
|
|
|
<h3 class="text-lg font-semibold text-gray-700">
|
|
<h3 class="text-lg font-semibold text-gray-700">
|
|
|
- {{ newElectricityData ? formatDate(newElectricityData.createTime) : '暂无数据' }}
|
|
|
|
|
|
|
+ {{
|
|
|
|
|
+ newElectricityData
|
|
|
|
|
+ ? formatDate(newElectricityData.createTime)
|
|
|
|
|
+ : "暂无数据"
|
|
|
|
|
+ }}
|
|
|
</h3>
|
|
</h3>
|
|
|
- <el-button type="primary" size="small" @click="refreshData" :loading="loading" class="mt-2">
|
|
|
|
|
|
|
+ <el-button
|
|
|
|
|
+ type="primary"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ @click="refreshData"
|
|
|
|
|
+ :loading="loading"
|
|
|
|
|
+ class="mt-2"
|
|
|
|
|
+ >
|
|
|
刷新数据
|
|
刷新数据
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
@@ -385,7 +409,11 @@ onMounted(() => {
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<div class="h-80">
|
|
<div class="h-80">
|
|
|
- <e-charts v-if="electricityRecords.length" :option="voltageChartOption" autoresize/>
|
|
|
|
|
|
|
+ <e-charts
|
|
|
|
|
+ v-if="electricityRecords.length"
|
|
|
|
|
+ :option="voltageChartOption"
|
|
|
|
|
+ autoresize
|
|
|
|
|
+ />
|
|
|
<div v-else class="h-full flex items-center justify-center text-gray-400">
|
|
<div v-else class="h-full flex items-center justify-center text-gray-400">
|
|
|
暂无数据
|
|
暂无数据
|
|
|
</div>
|
|
</div>
|
|
@@ -404,7 +432,11 @@ onMounted(() => {
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<div class="h-80">
|
|
<div class="h-80">
|
|
|
- <e-charts v-if="electricityRecords.length" :option="powerChartOption" autoresize/>
|
|
|
|
|
|
|
+ <e-charts
|
|
|
|
|
+ v-if="electricityRecords.length"
|
|
|
|
|
+ :option="powerChartOption"
|
|
|
|
|
+ autoresize
|
|
|
|
|
+ />
|
|
|
<div v-else class="h-full flex items-center justify-center text-gray-400">
|
|
<div v-else class="h-full flex items-center justify-center text-gray-400">
|
|
|
暂无数据
|
|
暂无数据
|
|
|
</div>
|
|
</div>
|
|
@@ -421,11 +453,11 @@ onMounted(() => {
|
|
|
|
|
|
|
|
<div class="flex flex-wrap items-center gap-4">
|
|
<div class="flex flex-wrap items-center gap-4">
|
|
|
<el-input
|
|
<el-input
|
|
|
- v-model="searchQuery"
|
|
|
|
|
- placeholder="搜索表号"
|
|
|
|
|
- clearable
|
|
|
|
|
- @keyup.enter="handleSearch"
|
|
|
|
|
- class="w-60"
|
|
|
|
|
|
|
+ v-model="searchQuery"
|
|
|
|
|
+ placeholder="搜索表号"
|
|
|
|
|
+ clearable
|
|
|
|
|
+ @keyup.enter="handleSearch"
|
|
|
|
|
+ class="w-60"
|
|
|
>
|
|
>
|
|
|
<template #append>
|
|
<template #append>
|
|
|
<el-button @click="handleSearch">
|
|
<el-button @click="handleSearch">
|
|
@@ -435,12 +467,12 @@ onMounted(() => {
|
|
|
</el-input>
|
|
</el-input>
|
|
|
|
|
|
|
|
<el-date-picker
|
|
<el-date-picker
|
|
|
- v-model="dateRange"
|
|
|
|
|
- type="daterange"
|
|
|
|
|
- range-separator="至"
|
|
|
|
|
- start-placeholder="开始日期"
|
|
|
|
|
- end-placeholder="结束日期"
|
|
|
|
|
- @change="handleSearch"
|
|
|
|
|
|
|
+ v-model="dateRange"
|
|
|
|
|
+ type="daterange"
|
|
|
|
|
+ range-separator="至"
|
|
|
|
|
+ start-placeholder="开始日期"
|
|
|
|
|
+ end-placeholder="结束日期"
|
|
|
|
|
+ @change="handleSearch"
|
|
|
/>
|
|
/>
|
|
|
|
|
|
|
|
<el-button type="primary" @click="refreshData" :loading="tableLoading">
|
|
<el-button type="primary" @click="refreshData" :loading="tableLoading">
|
|
@@ -451,14 +483,14 @@ onMounted(() => {
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<el-table
|
|
<el-table
|
|
|
- :data="electricityRecords"
|
|
|
|
|
- stripe
|
|
|
|
|
- border
|
|
|
|
|
- style="width: 100%"
|
|
|
|
|
- v-loading="tableLoading"
|
|
|
|
|
- height="500"
|
|
|
|
|
|
|
+ :data="electricityRecords"
|
|
|
|
|
+ stripe
|
|
|
|
|
+ border
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ v-loading="tableLoading"
|
|
|
|
|
+ height="500"
|
|
|
>
|
|
>
|
|
|
- <el-table-column prop="tableNumber" label="表号" min-width="120"/>
|
|
|
|
|
|
|
+ <el-table-column prop="tableNumber" label="表号" min-width="120" />
|
|
|
<el-table-column label="电压 (V)" min-width="220">
|
|
<el-table-column label="电压 (V)" min-width="220">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<div class="grid grid-cols-3 gap-2">
|
|
<div class="grid grid-cols-3 gap-2">
|
|
@@ -543,21 +575,27 @@ onMounted(() => {
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column prop="totalElectricity" label="总用电量 (kWh)" min-width="120"/>
|
|
|
|
|
|
|
+ <el-table-column prop="totalElectricity" label="总用电量 (kWh)" min-width="120" />
|
|
|
<el-table-column label="分时电量 (kWh)" min-width="220">
|
|
<el-table-column label="分时电量 (kWh)" min-width="220">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<div class="grid grid-cols-2 gap-2">
|
|
<div class="grid grid-cols-2 gap-2">
|
|
|
<div>
|
|
<div>
|
|
|
<span class="text-xs text-gray-500">尖峰:</span>
|
|
<span class="text-xs text-gray-500">尖峰:</span>
|
|
|
- <span>{{ parseFloat(scope.row.sharpActivePowerConsumption || 0).toFixed(2) }}</span>
|
|
|
|
|
|
|
+ <span>{{
|
|
|
|
|
+ parseFloat(scope.row.sharpActivePowerConsumption || 0).toFixed(2)
|
|
|
|
|
+ }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
<span class="text-xs text-gray-500">峰:</span>
|
|
<span class="text-xs text-gray-500">峰:</span>
|
|
|
- <span>{{ parseFloat(scope.row.peakActivePowerConsumption || 0).toFixed(2) }}</span>
|
|
|
|
|
|
|
+ <span>{{
|
|
|
|
|
+ parseFloat(scope.row.peakActivePowerConsumption || 0).toFixed(2)
|
|
|
|
|
+ }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
<span class="text-xs text-gray-500">平:</span>
|
|
<span class="text-xs text-gray-500">平:</span>
|
|
|
- <span>{{ parseFloat(scope.row.averageActivePowerConsumption || 0).toFixed(2) }}</span>
|
|
|
|
|
|
|
+ <span>{{
|
|
|
|
|
+ parseFloat(scope.row.averageActivePowerConsumption || 0).toFixed(2)
|
|
|
|
|
+ }}</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
<span class="text-xs text-gray-500">谷:</span>
|
|
<span class="text-xs text-gray-500">谷:</span>
|
|
@@ -566,7 +604,7 @@ onMounted(() => {
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column prop="state" label="状态" min-width="100"/>
|
|
|
|
|
|
|
+ <el-table-column prop="state" label="状态" min-width="100" />
|
|
|
<el-table-column label="创建时间" min-width="180">
|
|
<el-table-column label="创建时间" min-width="180">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
{{ formatDate(scope.row.createTime) }}
|
|
{{ formatDate(scope.row.createTime) }}
|
|
@@ -576,14 +614,14 @@ onMounted(() => {
|
|
|
|
|
|
|
|
<div class="flex justify-center mt-4">
|
|
<div class="flex justify-center mt-4">
|
|
|
<el-pagination
|
|
<el-pagination
|
|
|
- background
|
|
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
- :total="totalRecords"
|
|
|
|
|
- :page-size="pageSize"
|
|
|
|
|
- :current-page="currentPage"
|
|
|
|
|
- :page-sizes="[10, 20, 50, 100]"
|
|
|
|
|
- @size-change="handleSizeChange"
|
|
|
|
|
- @current-change="handlePageChange"
|
|
|
|
|
|
|
+ background
|
|
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
|
|
+ :total="totalRecords"
|
|
|
|
|
+ :page-size="pageSize"
|
|
|
|
|
+ :current-page="currentPage"
|
|
|
|
|
+ :page-sizes="[10, 20, 50, 100]"
|
|
|
|
|
+ @size-change="handleSizeChange"
|
|
|
|
|
+ @current-change="handlePageChange"
|
|
|
/>
|
|
/>
|
|
|
</div>
|
|
</div>
|
|
|
</el-card>
|
|
</el-card>
|
|
@@ -618,4 +656,3 @@ onMounted(() => {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|
|
|
-
|
|
|