master
“yu” 2024-07-18 01:11:37 +08:00
parent 622a29616c
commit 81e639336a
5 changed files with 121 additions and 94 deletions

5
components.d.ts vendored
View File

@ -7,6 +7,8 @@ export {}
/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
ElButton: typeof import('element-plus/es')['ElButton']
ElCarousel: typeof import('element-plus/es')['ElCarousel']
ElCarouselItem: typeof import('element-plus/es')['ElCarouselItem']
@ -15,12 +17,15 @@ declare module 'vue' {
ElForm: typeof import('element-plus/es')['ElForm']
ElFormItem: typeof import('element-plus/es')['ElFormItem']
ElInput: typeof import('element-plus/es')['ElInput']
ElMenu: typeof import('element-plus/es')['ElMenu']
ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
ElOption: typeof import('element-plus/es')['ElOption']
ElPagination: typeof import('element-plus/es')['ElPagination']
ElPopover: typeof import('element-plus/es')['ElPopover']
ElRadio: typeof import('element-plus/es')['ElRadio']
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
ElSelect: typeof import('element-plus/es')['ElSelect']
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
ElTable: typeof import('element-plus/es')['ElTable']
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
ElTimeSelect: typeof import('element-plus/es')['ElTimeSelect']

BIN
dist.zip

Binary file not shown.

View File

@ -1,111 +1,128 @@
// 处理一些常用的方法
// 处理单位换算
export function handleUnit(data) {
if (Number(data) > 10000) {
return (data / 1000).toFixed(2)
} else {
return data
}
if (Number(data) > 10000) {
return (data / 1000).toFixed(2);
} else {
return data;
}
}
// 处理echarts数据
export function handleEchartsData(data, value) {
// 间隔可以设置成动态的
let timeArray_1 = [];
for (let hour = 0; hour < 24; hour++) {
for (let minute = 0; minute < 60; minute += value) {
let timeString = (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute);
timeArray_1.push(
{ datetime: timeString, measValue: '-' }
);
}
// 间隔可以设置成动态的
let timeArray_1 = [];
for (let hour = 0; hour < 24; hour++) {
for (let minute = 0; minute < 60; minute += value) {
let timeString =
(hour < 10 ? "0" + hour : hour) +
":" +
(minute < 10 ? "0" + minute : minute);
timeArray_1.push({ datetime: timeString, measValue: "-" });
}
console.log(timeArray_1)
timeArray_1.forEach(item => {
data.forEach(ite => {
let iteTime = ite.datetime.split(' ')[1].split(':')[0] + ':' + ite.datetime.split(' ')[1].split(':')[1]
if (iteTime === item.datetime) {
item.measValue =ite.measValue
}
})
})
}
console.log(timeArray_1);
timeArray_1.forEach((item) => {
data.forEach((ite) => {
let iteTime =
ite.datetime.split(" ")[1].split(":")[0] +
":" +
ite.datetime.split(" ")[1].split(":")[1];
if (iteTime === item.datetime) {
item.measValue = ite.measValue;
}
});
});
return timeArray_1
return timeArray_1;
}
export function handleEchartsData_datatime_measValue(data, value) {
// 间隔可以设置成动态的
let timeArray_1 = [];
for (let hour = 0; hour < 24; hour++) {
for (let minute = 0; minute < 60; minute += value) {
let timeString = (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute);
timeArray_1.push(
{ datetime: timeString, measValue: '-' }
);
}
// 间隔可以设置成动态的
let timeArray_1 = [];
for (let hour = 0; hour < 24; hour++) {
for (let minute = 0; minute < 60; minute += value) {
let timeString =
(hour < 10 ? "0" + hour : hour) +
":" +
(minute < 10 ? "0" + minute : minute);
timeArray_1.push({ datetime: timeString, measValue: "-" });
}
console.log(timeArray_1)
timeArray_1.forEach(item => {
data.forEach(ite => {
let iteTime = ite.datetime.split(' ')[1].split(':')[0] + ':' + ite.datetime.split(' ')[1].split(':')[1]
if (iteTime === item.datetime) {
item.measValue =ite.measValue
}
})
})
}
console.log(timeArray_1);
timeArray_1.forEach((item) => {
data.forEach((ite) => {
let iteTime =
ite.datetime.split(" ")[1].split(":")[0] +
":" +
ite.datetime.split(" ")[1].split(":")[1];
if (iteTime === item.datetime) {
item.measValue = ite.measValue;
}
});
});
return timeArray_1
return timeArray_1;
}
export function handleEchartsData_timeStamp_p(data, value) {
// 间隔可以设置成动态的
let timeArray_1 = [];
for (let hour = 0; hour < 24; hour++) {
for (let minute = 0; minute < 60; minute += value) {
let timeString = (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute);
timeArray_1.push(
{ timeStamp: timeString, p: '-' }
);
}
// 间隔可以设置成动态的
let timeArray_1 = [];
for (let hour = 0; hour < 24; hour++) {
for (let minute = 0; minute < 60; minute += value) {
let timeString =
(hour < 10 ? "0" + hour : hour) +
":" +
(minute < 10 ? "0" + minute : minute);
timeArray_1.push({ timeStamp: timeString, p: "-" });
}
console.log(timeArray_1)
timeArray_1.forEach(item => {
data.forEach(ite => {
let iteTime = ite.timeStamp.split(' ')[1].split(':')[0] + ':' + ite.timeStamp.split(' ')[1].split(':')[1]
if (iteTime === item.timeStamp) {
item.p =ite.p
}
})
})
}
console.log(timeArray_1);
timeArray_1.forEach((item) => {
data.forEach((ite) => {
let iteTime =
ite.timeStamp.split(" ")[1].split(":")[0] +
":" +
ite.timeStamp.split(" ")[1].split(":")[1];
if (iteTime === item.timeStamp) {
item.p = ite.p;
}
});
});
return timeArray_1
return timeArray_1;
}
export function handleEchartsData_timeStamp_p_u_i(data, value) {
// 间隔可以设置成动态的
let timeArray_1 = [];
for (let hour = 0; hour < 24; hour++) {
for (let minute = 0; minute < 60; minute += value) {
let timeString = (hour < 10 ? '0' + hour : hour) + ':' + (minute < 10 ? '0' + minute : minute);
timeArray_1.push(
{ timeStamp: timeString, p: '-',u:'',i:''}
);
}
// 间隔可以设置成动态的
let timeArray_1 = [];
for (let hour = 0; hour < 24; hour++) {
for (let minute = 0; minute < 60; minute += value) {
let timeString =
(hour < 10 ? "0" + hour : hour) +
":" +
(minute < 10 ? "0" + minute : minute);
timeArray_1.push({ timeStamp: timeString, p: "-", u: "", i: "" });
}
console.log(timeArray_1)
timeArray_1.forEach(item => {
data.forEach(ite => {
let iteTime = ite.timeStamp.split(' ')[1].split(':')[0] + ':' + ite.timeStamp.split(' ')[1].split(':')[1]
if (iteTime === item.timeStamp) {
item.p =ite.p
item.u =ite.u
item.i =ite.i
}
console.log(timeArray_1);
timeArray_1.forEach((item) => {
data.forEach((ite) => {
let iteTime =
ite.timeStamp.split(" ")[1].split(":")[0] +
":" +
ite.timeStamp.split(" ")[1].split(":")[1];
if (iteTime === item.timeStamp) {
item.p = ite.p;
item.u = ite.u;
item.i = ite.i;
}
});
});
}
})
})
return timeArray_1
return timeArray_1;
}
// 处理取随机数
export function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}

View File

@ -489,6 +489,7 @@ import {
} from "@/api/carPage/index";
import {
handleEchartsData,
getRandomInt,
handleEchartsData_timeStamp_p,
} from "@/hooks/handleFun";
import { usrzApi } from "@/api/Osp/svgApi";
@ -784,25 +785,29 @@ const submitForm = () => {
);
// console.log(datat_start,datat_end,"3---------");
let datainput = {
chargingStationID: currentData.id,
chargingStationID: currentData.id.replace("@", ""),
type: parseInt(formData.value.type),
isForce: parseInt(formData.value.whether),
targetValue: parseInt(formData.value.number),
startTime: datat_start,
endTime: datat_end,
};
const randomDelay=getRandomInt(2000,5000)//2000-5000ms
setTimeout(() => {
send_Status.value=false
ajustCarPageFlag.value=false
}, 2000);
setTimeout(() => {
ElMessage({
showClose: true,
message: "指令下发成功",
type: "success",
});
}, 3000);
}, randomDelay);
// setTimeout(() => {
// }, 3000);
// send_Status.value=false
ajustInfo_api(datainput).then((res: any) => {
console.log(res, "1-------car");

View File

@ -88,7 +88,7 @@ const drawOneLine = () => {
},
grid: {
top: '25%',
left: '8%',
left: '18%',
right: '12%',
bottom: '13%'
},