From 5c7c8268a362dab89a00ffc9e4e6f158f0f14d46 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E2=80=9Cyu=E2=80=9D?= <“winebunny@163.com”>
Date: Sun, 14 Jul 2024 15:24:01 +0800
Subject: [PATCH] u
---
src/api/ajust/tree.ts | 4 +
.../pages/CapacityAdjustmentPage/index.vue | 120 +++++++++++-------
2 files changed, 76 insertions(+), 48 deletions(-)
diff --git a/src/api/ajust/tree.ts b/src/api/ajust/tree.ts
index 2158c67..3259fb1 100644
--- a/src/api/ajust/tree.ts
+++ b/src/api/ajust/tree.ts
@@ -50,4 +50,8 @@ export function strategyApi(data: any) {
}
+// 全部的能量调节页面的接口
+
+
+
diff --git a/src/views/pages/CapacityAdjustmentPage/index.vue b/src/views/pages/CapacityAdjustmentPage/index.vue
index c0f0cdb..1766e5b 100644
--- a/src/views/pages/CapacityAdjustmentPage/index.vue
+++ b/src/views/pages/CapacityAdjustmentPage/index.vue
@@ -120,7 +120,11 @@
当前负载率
-
+
@@ -368,17 +372,15 @@ import { ITEM_RENDER_EVT } from "element-plus/es/components/virtual-list/src/def
// });
onMounted(() => {
-
// getstrategyDate() //获取策略配置服务
// let result = await loadRateApi({});
// console.log(result, "负载率");
});
-let treeAreaId=ref('')//点击设备树二级服务获取的台区id去获取台区负载率
+let treeAreaId = ref(""); //点击设备树二级服务获取的台区id去获取台区负载率
// 设备树传来的设备树节点id treeKey是id
const getTreeKey = (treeKey: any) => {
-
getTreeSourceList(treeKey); //可调资源 先从设备树获取到id 再调用二级服务去获取可调资源列表
- treeAreaId=treeKey//台区的id
+ treeAreaId = treeKey; //台区的id
// console.log(treeAreaId,'treeAreaId----------------------');
getRateDate(treeKey); //获取负载率 点击设备树二级服务获取的台区id去获取台区负载率
};
@@ -445,29 +447,31 @@ let key2 = ref
(2);
let rateDate_cur = reactive([]); //当前的负载率
let rateDate_will = reactive([]); //预测负载率
-const getRateDate = (treeAreaId:string) => {
+const getRateDate = (treeAreaId: string) => {
// 定时15分钟获取接口数据
// console.log(treeAreaId, treeAreaId.value,"treeAreaId==========");
-
+
// setInterval(() => {
- loadRateApi({mrid:treeAreaId,orgID:"8af8470a47aad8e20147aad92e400335",}).then((res)=>{
- console.log(res, "res");
-
- if(res?.data.result.length){
- rateDate_cur=res?.data.result
- // console.log(res, "res");
-
- }else{
- ElMessage({
- showClose: true,
- message: "获取负载率失败",
- type: "error",
- });
- }
- })
+ loadRateApi({
+ mrid: treeAreaId,
+ orgID: "8af8470a47aad8e20147aad92e400335",
+ }).then((res) => {
+ console.log(res, "res");
+
+ if (res?.data.result.length) {
+ rateDate_cur = res?.data.result;
+ // console.log(res, "res");
+ } else {
+ ElMessage({
+ showClose: true,
+ message: "获取负载率失败",
+ type: "error",
+ });
+ }
+ });
// let rateDate = rateJSONData as any;
// console.log(rateDate, "15分钟一次接口");
-
+
// }, 15*60*1000);
};
// 当前负载率------------
@@ -509,11 +513,51 @@ let sourceAjustObj = reactive({});
// 右 -能量调节
let adjustContentFlag = ref(true);
// 点击下达指令 进入调节进度页面
+let newAjustTableData = reactive([]);
+
const haneleprogress = () => {
// adjustContentFlag.value = false
// progressContentFlag.value = true
- console.log(adjustTableData, "adjustTableData");
+ console.log(newAjustTableData, "newAjustTableData2-2-2-");
+ newAjustTableData.forEach((item) => {
+ console.log(item, "item");
+ console.log(YMD,YMD+item.end_date, "item.start+item.end_date");
+
+ //循环发完配置中的可调资源
+ let inputdata = {
+ type: "FEEDER",
+ mrId: "03DKX-555",
+ name: "555",
+ startTime: "2024-07-05 00:00:00",
+ endTime: "2024-07-05 00:00:10",
+ regulatedValue: "60",
+ };
+ strategyApi(inputdata)
+ .then((res) => {
+ console.log(res, "邮箱");
+ })
+ .catch((error) => {
+ ElMessage({
+ showClose: true,
+ message: `接口服务正在计算中${error}`,
+ type: "error",
+ });
+ });
+ });
};
+// const getstrategyDate = () => {
+// let inputdata = {
+// type: "FEEDER",
+// mrId: "03DKX-555",
+// name: "555",
+// startTime: "2024-07-05 00:00:00",
+// endTime: "2024-07-05 00:00:10",
+// regulatedValue: "60",
+// };
+
+// let res = Ajust_strategy as any;
+// console.log(res, "iiiii");
+// };
interface TablepvDate {
index?: number;
name: string;
@@ -715,30 +759,6 @@ let handleClickPC = () => {
console.log(newData, "newData");
adjustTableData = newData;
};
-const getstrategyDate = () => {
- let inputdata = {
- type: "FEEDER",
- mrId: "03DKX-555",
- name: "555",
- startTime: "2024-07-05 00:00:00",
- endTime: "2024-07-05 00:00:10",
- regulatedValue: "60",
- };
- // strategyApi(inputdata)
- // .then((res) => {
- // console.log(res, "邮箱");
- // })
- // .catch((error) => {
- // ElMessage({
- // showClose: true,
- // message: `接口服务正在计算中${error}`,
- // type: "error",
- // });
- // });
-
- let res = Ajust_strategy as any;
- console.log(res, "iiiii");
-};
/** 鼠标移入cell */
const handleCellEnter = (row: any, column: any, cell: any, event: any) => {
@@ -750,7 +770,11 @@ const handleSaveDate = (val: any) => {
val.forEach((ite: any) => {
ite.isEdit = false; //所有的编辑状态全部为假
});
+ // 赋值给一个数组给下发指令的接口用
+ newAjustTableData = adjustTableData;
+ console.log(newAjustTableData, "newAjustTableData1-1-1-");
};
+
// 点击
// 开始时间
const getStart_time = () => {};