“yu” 2024-07-17 17:55:47 +08:00
parent 6ae8e0286c
commit b822d3f3a8
4 changed files with 148 additions and 26 deletions

BIN
dist.zip

Binary file not shown.

View File

@ -29,5 +29,14 @@ export function running_api(data: any) {
}
// 车网的能量调节指令接口
export function ajustInfo_api(data: any) {
return request({
url: "/api_car/wwpm/ev-data/v1/ctrl/command",
method: "POST",
data,
});
}

View File

@ -112,7 +112,12 @@
<div class="load_runstatus_box">
<div class="infotitle">
<span>充电桩运行状态</span>
<div class="posbtn" @click="ajustCarPage"></div>
<div
:class="[btndownFlag === true ? '' : 'no_click', 'posbtn']"
@click="ajustCarPage"
>
能量调节
</div>
</div>
<div class="list_box">
<div class="box_d">
@ -326,13 +331,13 @@
></el-pagination>
</div>
</div>
<div class="ajustCar" v-if="false">
<!-- <div class="ajustCar" v-if="false"> -->
<!-- <div class="ajustCar" v-if="ajustCarPageFlag"> -->
<div class="ajustCar" v-if="ajustCarPageFlag">
<div class="tip">
<img src="@/assets/images/mainPage/icon_title2.png" alt="" />
<span class="jianbian">能量调节</span>
<div class="closebtn" @click="adjustInfoFlag = false"></div>
<span class="jianbian fs45">能量调节</span>
<div class="closebtn" @click="ajustCarPageFlag = false"></div>
</div>
<div class="content">
<el-form
@ -345,8 +350,9 @@
<!-- 添加表单项 -->
<el-form-item label="调节类型" prop="type">
<el-select
popper-class="customSelectAdjust"
v-model="formData.type"
placeholder="Select"
placeholder="类型"
size="large"
style="width: 240px"
>
@ -361,7 +367,7 @@
<!-- <el-input v-model="form.password" type="password"></el-input> -->
<el-radio-group v-model="formData.whether" class="ml-4">
<el-radio value="1" size="large"></el-radio>
<el-radio value="2" size="large"></el-radio>
<el-radio value="0" size="large"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="调节值" prop="number">
@ -384,11 +390,20 @@
<span class="text-gray-500">-</span>
</el-col>
<el-col :span="11">
<el-time-picker
<!-- <el-time-picker
v-model="formData.start_time"
placeholder="Pick a time"
style="width: 100%"
/>
-->
<el-time-select
v-model="formData.start_time"
style="width: 240px"
start="08:30"
step="00:15"
end="18:30"
placeholder="开始时间"
/>
</el-col>
</el-form-item>
@ -406,22 +421,23 @@
<span class="text-gray-500">-</span>
</el-col>
<el-col :span="11">
<el-time-picker
<el-time-select
v-model="formData.end_time"
placeholder="Pick a time"
style="width: 100%"
style="width: 240px"
start="08:30"
step="00:15"
end="18:30"
placeholder="结束时间"
/>
</el-col>
</el-form-item>
<!-- 添加提交按钮 -->
<el-form-item>
<el-button
type="primary"
@click="submitForm('formRef')"
></el-button>
<el-button type="primary" @click="submitForm('formRef')"
<el-button type="primary"></el-button>
<el-button type="primary" @click="submitForm()"
>下发指令</el-button
>
<!-- @click="submitForm('formRef')" -->
<!-- <el-button @click="resetForm('formRef')"></el-button> -->
</el-form-item>
</el-form>
@ -452,10 +468,12 @@ import load_c_echart from "./load_c_echart.vue";
import load_info_echart from "./load_info_echart.vue";
import cdz_echart from "./cdz_echart.vue";
import carTree from "@/views/commonPage/carTree.vue";
import {
powerCurve_api,
transformerOverloadCount_api,
running_api,
ajustInfo_api,
} from "@/api/carPage/index";
import {
handleEchartsData,
@ -496,6 +514,7 @@ const send3D = () => {
console.log("SelectChargingstation,显示全部的变电站");
});
};
//
let currentData = reactive<any>({});
let currentLevel = ref<any>({});
@ -517,6 +536,12 @@ const getTreeKey = (treeKey: any) => {
//
getRunning_api();
}
//
if (currentData.type === "station") {
btndownFlag.value = true;
} else {
btndownFlag.value = false;
}
};
//
@ -643,6 +668,7 @@ let getPowerCurve_api = () => {
//
} else if (currentData.type === "station") {
//
setData.stationId = currentData.id;
} else if (currentData.type === "dewellerpipe" && currentLevel.value === 6) {
//
@ -660,7 +686,7 @@ let getPowerCurve_api = () => {
item.measValue = item.p;
});
let result = handleEchartsData(res.data, 60);
let result = handleEchartsData(res.data, 15);
carRightData.echartsData = result;
});
} else {
@ -670,7 +696,7 @@ let getPowerCurve_api = () => {
item.datetime = item.dateTime;
});
let result = handleEchartsData(res.data, 60);
let result = handleEchartsData(res.data, 15);
carRightData.echartsData = result;
});
@ -721,13 +747,49 @@ let formData = ref({
end_date: "",
end_time: "",
});
// let newcarAjustDate = reactive<any>([]);
// newcarAjustDate.push(formData);
const handledata_time = (data_s: any, time_s: any) => {
const date = new Date(data_s);
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, "0");
const day = String(date.getDate()).padStart(2, "0");
const formattedDate = `${year}-${month}-${day}`;
return `${formattedDate} ${time_s}`;
};
const submitForm = () => {
console.log(formData, "1--------------formData");
// let dataNew
let datat_start = handledata_time(
formData.value.start_date,
formData.value.start_time
);
let datat_end = handledata_time(
formData.value.end_date,
formData.value.end_time
);
// console.log(datat_start,datat_end,"3---------");
let datainput = {
chargingStationID: currentData.id,
type: parseInt(formData.value.type),
isForce: parseInt(formData.value.whether),
targetValue: parseInt(formData.value.number),
startTime: datat_start,
endTime: datat_end,
};
ajustInfo_api(datainput).then((res: any) => {
console.log(res, "1-------car");
});
};
//
let ajustCarPageFlag = ref(true);
let ajustCarPageFlag = ref(false);
let btndownFlag = ref(false);
const ajustCarPage = () => {
ajustCarPageFlag.value = true;
if (currentData.type === "station") {
ajustCarPageFlag.value = true;
}
};
//
@ -871,6 +933,10 @@ const styleVar = computed(() => {
background: url("@/assets/images/btnType/send_btn.png") no-repeat;
background-size: 100% 100%;
}
.no_click {
color: #ccc;
cursor: not-allowed;
}
}
.infotitle_short {
width: 100%;
@ -1910,7 +1976,7 @@ const styleVar = computed(() => {
align-items: center;
img {
height: changeHeight(45);
height: changeHeight(55);
margin-right: changeHeight(14);
}
@ -1942,9 +2008,7 @@ const styleVar = computed(() => {
margin-top: 3%;
width: 95%;
height: 100%;
border: 1px solid pink;
:deep(.el-form) {
border: 1px solid red;
height: 100%;
// label
.el-form-item__label {
@ -1963,20 +2027,54 @@ const styleVar = computed(() => {
width: changeHeight(300) !important;
height: changeHeight(80) !important;
}
.el-select__wrapper {
width: changeHeight(350) !important;
height: changeHeight(80) !important;
padding-top: 1%;
background: transparent !important;
}
// .el-select,
.el-input__inner {
color: #fff !important;
height: changeHeight(50) !important;
line-height: changeHeight(50) !important;
}
.el-select__placeholder {
color: #fff !important;
height: changeHeight(50) !important;
line-height: changeHeight(50) !important;
font-size: changeHeight(35) !important;
}
.el-radio__label {
color: #fff !important;
font-size: changeHeight(35) !important;
}
.el-select__popper {
width: changeHeight(500) !important;
height: changeHeight(200) !important;
line-height: changeHeight(200) !important;
font-size: changeHeight(35) !important;
}
.el-select-dropdown__list {
width: changeHeight(500) !important;
height: changeHeight(200) !important;
}
// .el-select__selected-item .el-select__placeholder,.el-select__selected-item .el-select__placeholder.is-transparent{
// height: changeHeight(80) !important;
// }
//
.el-button {
width: changeHeight(250);
height: changeHeight(80);
font-size: changeHeight(35) !important;
background-color: transparent !important;
}
.el-button:nth-child(1) {
background-color: transparent !important;
@ -1984,12 +2082,16 @@ const styleVar = computed(() => {
}
.el-button:nth-child(2) {
margin-top: 2%;
margin-left: changeHeight(180);
margin-left: 34%;
width: changeHeight(250);
height: changeHeight(80);
background: url("@/assets/images/btnType/send_btn.png") no-repeat;
background-size: 100% 100%;
}
//
.el-form-item {
height: changeHeight(80) !important;
margin-bottom: changeHeight(50) !important;
margin-bottom: changeHeight(30) !important;
}
}
}

View File

@ -101,7 +101,7 @@ export default defineConfig({
// only https
secure: false,
},
"/api/api-svg": {
"/api-svg": {
// target: "http://192.168.18.106:8080",
target: "http://127.0.0.1:19081",
// 天津地址
@ -112,6 +112,17 @@ export default defineConfig({
// only https
secure: false,
},
"/api_car": {
// target: "http://192.168.18.106:8080",
target: "http://127.0.0.1:16091",
// 天津地址
// target:"http://192.168.5.102:18801",
changeOrigin: true,
ws: true,
rewrite: (path: string) => path.replace(new RegExp(`^/api-svg`), ""),
// only https
secure: false,
},
// "/ba-api": {
// // target: "http://localhost:8080",
// // 桐乡地址