diff --git a/README.md b/README.md
index 0bfecb0..81554c0 100644
--- a/README.md
+++ b/README.md
@@ -6,4 +6,19 @@ This template should help get you started developing with Vue 3 and TypeScript i
- [VS Code](https://code.visualstudio.com/) + [Vue - Official](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (previously Volar) and disable Vetur
-- Use [vue-tsc](https://github.com/vuejs/language-tools/tree/master/packages/tsc) for performing the same type checking from the command line, or for generating d.ts files for SFCs.
+- Use [vue-tsc](https://github.com/vuejs/language-tools/tree/master/packages/tsc) for performing the same type checking
+from the command line, or for generating d.ts files for SFCs.
+
+
+##分辨率
+3840*2160 天津城南分辨率
+1920*1080 普通电脑分辨率
+3840*1080 上海院的分辨率
+/* 针对3840x1080分辨率的样式 */
+@media screen and (min-width: 3840px) and (max-height: 2150px) {
+ .main {
+ /* margin-top: 7.8125rem; */
+ flex: 1;
+ margin-top: 3%;
+}
+}
diff --git a/dist.zip b/dist.zip
deleted file mode 100644
index 8176b10..0000000
Binary files a/dist.zip and /dev/null differ
diff --git a/src/api/ajust/tree.ts b/src/api/ajust/tree.ts
index ec076e4..f1042a2 100644
--- a/src/api/ajust/tree.ts
+++ b/src/api/ajust/tree.ts
@@ -3,13 +3,13 @@ import request from "@/utils/http/request";
interface idInfo {
orgID?: string,
-
+ mrid?:string,
}
// 设备树 0 一级服务
export function treeT(data: idInfo) {
return request({
- url: '/api/wwpm/biz/v1/device_0',
+ url: '/api/wwpm/biz/v1/er_tree',
method: 'POST',
data
})
@@ -21,9 +21,9 @@ interface treeInfo {
transformId: string;
}
// 设备树 1 二级服务
-export function treeSecond(data: treeInfo) {
+export function treeSecond(data: idInfo) {
return request({
- url: '/api/wwpm/biz/v1/device_1',
+ url: '/api/wwpm/biz/v1/er_tree/node',
method: 'POST',
data
})
@@ -32,12 +32,22 @@ export function treeSecond(data: treeInfo) {
// 设备树 充电站
export function carTree_api(data: idInfo) {
return request({
- url: '/api/wwpm/biz/v1/car_tree',
+ url: '/api/wwpm/biz/v1/cn_tree',
method: 'POST',
data
})
}
-// 设备树 充电站
+
+export function carTree_api2(data: idInfo) {
+ return request({
+ url: '/api/wwpm/biz/v1/cn_tree/node',
+ method: 'POST',
+ data
+ })
+}
+
+
+// 设备树 光伏
export function pvTree_api(data: idInfo) {
return request({
url: '/api/wwpm/biz/v1/pv_tree',
diff --git a/src/api/pvPage/pvApi.ts b/src/api/pvPage/pvApi.ts
index fd17ec4..261d3b3 100644
--- a/src/api/pvPage/pvApi.ts
+++ b/src/api/pvPage/pvApi.ts
@@ -10,4 +10,13 @@ interface idInfo {
method: "POST",
data,
});
- }
\ No newline at end of file
+ }
+ // 光伏实时信息
+ export function pvCurInfo_api(data: idInfo) {
+ return request({
+ url: "/api/wwpm/biz/v1/photo_voltaic/real_time/info",
+ method: "POST",
+ data,
+ });
+ }
+
\ No newline at end of file
diff --git a/src/enums/CitySourceID.ts b/src/enums/CitySourceID.ts
new file mode 100644
index 0000000..e69de29
diff --git a/src/hooks/transFormSize.ts b/src/hooks/transFormSize.ts
index f3d7f8c..a47dc8d 100644
--- a/src/hooks/transFormSize.ts
+++ b/src/hooks/transFormSize.ts
@@ -4,21 +4,27 @@ const transformFontSize = (fontsize: number) => {
const width = window.screen.width;
const height = window.screen.height;
- let ratio: any = 0
- if (width > 3000) {
- ratio = width / 4240;
- } else if(width>2100){
- ratio = width / 2220;
- // 宁波分辨率
- // ratio = width / 3220;
- }else if(width>1900){
- ratio = width / 4240;
-
- }else{
- ratio = width / 2620;
+ let ratio: any = 0;
+ //高度大于1080
+ if (height > 1080) {
+ // 3840*2160 天津城南分辨率
+ if (width > 3000) {
+ ratio = width / 4240;
+ }
+ } else {
+ //高度小于1080
+ if (width > 3000) {
+ // 3840*1080 上海院的分辨率
+ ratio = width / 11940;
+ } else if (width > 1900) {
+ // 1920*1080 普通电脑分辨率
+ ratio = width / 5960;
+ } else {
+ ratio = width / 3620;
+ }
}
// 取下整
return parseInt(fontsize * ratio);
};
-export default transformFontSize
\ No newline at end of file
+export default transformFontSize;
diff --git a/src/views/LoadManagementPage/loadlayout.vue b/src/views/LoadManagementPage/loadlayout.vue
index 8d4e414..a8f9d3f 100644
--- a/src/views/LoadManagementPage/loadlayout.vue
+++ b/src/views/LoadManagementPage/loadlayout.vue
@@ -165,6 +165,7 @@
}
.header_layout {
+ height: changeHeight(166);
/* height: 186px; */
width: 100%;
position: absolute;
@@ -215,10 +216,6 @@
flex: 1;
margin-top: 3%;
}
- // @media screen and (max-width:1920px) {
- // .main {
- // margin-top: 6%;
- // }
- // }
+
\ No newline at end of file
diff --git a/src/views/commonPage/carTree.vue b/src/views/commonPage/carTree.vue
index f12ddef..311dac7 100644
--- a/src/views/commonPage/carTree.vue
+++ b/src/views/commonPage/carTree.vue
@@ -15,11 +15,15 @@
:expand-on-click-node="false"
empty-text="数据读取中..."
:props="targetProps"
- :default-expanded-keys="['tongxiang']"
lazy
:load="loadNode"
@node-click="handleTargetInfo"
- >
+ >
+
+ {{ node.label }}
+
+
@@ -28,7 +32,7 @@
import { onMounted, ref, watch } from "vue";
import { ElTree } from "element-plus";
import treeDatas from "@/assets/json/tree-right2.json";
-import { treeT, treeSecond, carTree_api } from "@/api/ajust/tree";
+import { carTree_api, carTree_api2 } from "@/api/ajust/tree";
// defineProps<{
// elec_list: EList[]
@@ -108,80 +112,82 @@ const loadNode = async (node: any, resolve: any) => {
});
treeData = result.data;
resolve(treeData);
- } else if (node.level > 0 && node.level < 4) {
+ } else if (node.level > 0 && node.level < 3) {
//默认展开的层级,需要默认几层就判断一下.
resolve(node.data.children);
- } else if (node.level === 4) {
- // 利用设备中的信息调用接口
- // ---------
+ }
+ // else if (node.level === 4) {
+ // 利用设备中的信息调用接口
+ // ---------
- // ---------
- //懒加载
- let res = await treeSecond({
+ // ---------
+ //懒加载
+ // let res = await treeSecond({
+ // orgID: "8af8470a47aad8e20147aad92e400335",
+ // transformId: node.key,
+ // });
+ // if (res.data.energySupplyStation.length || res.data.dwellerPile.length) {
+ // let datanames = [];
+
+ // if (res.data.energySupplyStation.length) {
+ // datanames.push({
+ // name: `充电站(${res.data.energySupplyStation.length})`,
+ // id: "chongdianzhan",
+ // });
+ // }
+
+ // if (res.data.dwellerPile.length) {
+ // datanames.push({
+ // name: `居民充电桩(${res.data.dwellerPile.length})`,
+ // id: "chongdianzhuang",
+ // });
+ // }
+ // resolve(datanames);
+ // } else {
+ // resolve([{ name: "暂无数据", leaf: true }]);
+ // console.log(res); //需要将上一级的加号去掉
+ // }
+ // }
+ // else if (node.level === 5) {
+ // if (node.key === "chongdianzhan") {
+ // if (res.data.energySupplyStation.length) {
+ // resolve(
+ // res.data.energySupplyStation.map((item) => ({
+ // id: item.mrid,
+ // name: item.name,
+ // type: item.type,
+ // }))
+ // );
+ // }
+ // }
+ // if (node.key === "chongdianzhuang") {
+ // if (res.data.dwellerPile.length) {
+ // resolve(
+ // res.data.dwellerPile.map((item) => ({
+ // id: item.mrid,
+ // name: item.name,
+ // type: item.type,
+ // }))
+ // );
+ // }
+ // }
+
+ // resolve();
+ // resolve([
+ // {
+ // name: `懒加载第${node.level + 1}级` + +new Date(),
+ // id: `${+new Date()}`,
+ // },
+ // ]);
+ // }
+ else if (node.level === 3) {
+ let result = await carTree_api2({
orgID: "8af8470a47aad8e20147aad92e400335",
- transformId: node.key,
+ mrid: node.key,
});
- if (res.data.energySupplyStation.length || res.data.dwellerPile.length) {
- let datanames = [];
-
- if (res.data.energySupplyStation.length) {
- datanames.push({
- name: `充电站(${res.data.energySupplyStation.length})`,
- id: "chongdianzhan",
- });
- }
-
- if (res.data.dwellerPile.length) {
- datanames.push({
- name: `居民充电桩(${res.data.dwellerPile.length})`,
- id: "chongdianzhuang",
- });
- }
- resolve(datanames);
- } else {
- resolve([{ name: "暂无数据", leaf: true }]);
- console.log(res); //需要将上一级的加号去掉
- }
- } else if (node.level === 5) {
- //懒加载
- let res = await treeSecond({
- orgID: "8af8470a47aad8e20147aad92e400335",
- transformId: node.parent.key,
- // transformId: "ed7d892d4f8af8514b6dc01fde016ded55e58",
- });
-
- if (node.key === "chongdianzhan") {
- if (res.data.energySupplyStation.length) {
- resolve(
- res.data.energySupplyStation.map((item) => ({
- id: item.mrid,
- name: item.name,
- type: item.type,
- }))
- );
- }
- }
- if (node.key === "chongdianzhuang") {
- if (res.data.dwellerPile.length) {
- resolve(
- res.data.dwellerPile.map((item) => ({
- id: item.mrid,
- name: item.name,
- type: item.type,
- }))
- );
- }
- }
-
- // resolve();
- // resolve([
- // {
- // name: `懒加载第${node.level + 1}级` + +new Date(),
- // id: `${+new Date()}`,
- // },
- // ]);
- } else {
- resolve([{ name: "暂无数据", leaf: true }]);
+ resolve(result.data);
+ } else if (node.level > 3) {
+ resolve(node.data.children);
}
};
@@ -255,8 +261,8 @@ const handleTarget = (node: any) => {
.tree {
// height: 1300px;
- height: changeHeight(980);
- width: changeWidth(901.19);
+ // height: changeHeight(980);
+ // width: changeWidth(901.19);
margin-left: changeHeight(56);
}
@@ -392,7 +398,12 @@ const handleTarget = (node: any) => {
// 修改鼠标点击时的颜色以及节点失去焦点时的背景色
:deep(.el-tree-node:focus > .el-tree-node__content) {
- background-color: transparent !important;
+ // background-color: transparent !important;
+ background: linear-gradient(
+ 90deg,
+ rgba(82, 127, 243, 0.8) 0%,
+ rgba(59, 38, 148, 0) 100%
+ );
}
:deep(.el-tree-node__content:hover) {
@@ -610,4 +621,5 @@ const handleTarget = (node: any) => {
// }
// }
// }
+
diff --git a/src/views/commonPage/pvTree.vue b/src/views/commonPage/pvTree.vue
index 10f564b..a0ba894 100644
--- a/src/views/commonPage/pvTree.vue
+++ b/src/views/commonPage/pvTree.vue
@@ -13,13 +13,19 @@
:data="treeData"
node-key="id"
:props="targetProps"
- :default-expanded-keys="['tongxiang']"
lazy
:load="loadNode"
@node-click="handleTargetInfo"
:expand-on-click-node="false"
empty-text="数据读取中..."
- >
+ :highlight-current="true"
+ :current-node-key="'id'"
+ >
+
+ {{ node.label }}
+
+
@@ -28,7 +34,7 @@
import { onMounted, ref, watch } from "vue";
import { ElTree } from "element-plus";
import treeDatas from "@/assets/json/tree-right2.json";
-import { treeT, treeSecond,pvTree_api } from "@/api/ajust/tree";
+import { treeT, treeSecond, pvTree_api } from "@/api/ajust/tree";
// defineProps<{
// elec_list: EList[]
@@ -110,65 +116,65 @@ const loadNode = async (node: any, resolve: any) => {
}).then((res) => {
resolve(res.data); //默认加载第1层
});
- } else if (node.level > 0 && node.level < 4) {
+ // } else if (node.level > 0 && node.level < 4) {
+ } else if (node.level > 0) {
+
//默认展开的层级,需要默认几层就判断一下.
resolve(node.data.children);
- } else if (node.level === 4) {
- console.log(node, node.level, "4------");
+ }
+ //设备树中插入 光伏类型
+ // else if (node.level === 4) {
+ // console.log(node, node.level, "4------");
- //懒加载
- let res = await treeSecond({
- orgID: "8af8470a47aad8e20147aad92e400335",
- transformId: node.key,
- });
- if (
- res.data.photoVoltaicUnit.length ||
- res.data.energySupplyStation.length ||
- res.data.batteryUnit.length
- ) {
- let datanames = [];
+ // //懒加载
+ // let res = await treeSecond({
+ // orgID: "8af8470a47aad8e20147aad92e400335",
+ // transformId: node.key,
+ // });
+ // if (
+ // res.data.photoVoltaicUnit.length ||
+ // res.data.energySupplyStation.length ||
+ // res.data.batteryUnit.length
+ // ) {
+ // let datanames = [];
- if (res.data.photoVoltaicUnit.length) {
- datanames.push({
- name: `光伏(${res.data.photoVoltaicUnit.length})`,
- id: "guangfu",
- });
- }
+ // if (res.data.photoVoltaicUnit.length) {
+ // datanames.push({
+ // name: `光伏(${res.data.photoVoltaicUnit.length})`,
+ // id: "guangfu",
+ // });
+ // }
- resolve(datanames);
- } else {
- resolve([{ name: "加载数据", leaf: true }]);
- console.log(res); //需要将上一级的加号去掉
- }
- } else if (node.level === 5) {
- console.log(node.parent, node.level);
- //懒加载
- let res = await treeSecond({
- orgID: "8af8470a47aad8e20147aad92e400335",
- transformId: node.parent.key,
- // transformId: "ed7d892d4f8af8514b6dc01fde016ded55e58",
- });
- // 二级服务只挂光伏
+ // resolve(datanames);
+ // } else {
+ // resolve([{ name: "加载数据", leaf: true }]);
+ // console.log(res); //需要将上一级的加号去掉
+ // }
+ // }
+ // else if (node.level === 5) {
+ // else if (node.level === 4||node.level===5) {
+ // console.log(node.parent, node.level);
+ // //懒加载
+ // let res = await treeSecond({
+ // orgID: "8af8470a47aad8e20147aad92e400335",
+ // transformId: node.parent.key,
+ // // transformId: "ed7d892d4f8af8514b6dc01fde016ded55e58",
+
+ // });
+ // // 二级服务只挂光伏
- if (res.data.photoVoltaicUnit.length) {
- resolve(
- res.data.photoVoltaicUnit.map((item) => ({
- id: item.mrid,
- name: item.name,
- }))
- );
- }
-
- // resolve();
- // resolve([
- // {
- // name: `懒加载第${node.level + 1}级` + +new Date(),
- // id: `${+new Date()}`,
- // },
- // ]);
- } else {
- resolve([{ name: "加载数据", leaf: true }]);
- }
+ // if (res.data.photoVoltaicUnit.length) {
+ // resolve(
+ // res.data.photoVoltaicUnit.map((item) => ({
+ // id: item.mrid,
+ // name: item.name,
+ // type:item.type,
+ // }))
+ // );
+ // }
+ // } else {
+ // // resolve([{ name: "加载数据", leaf: true }]);
+ // }
};
const emits = defineEmits(["update-node-key"]); ////接收父组件的事件,子组件中触发父组件使用
@@ -177,18 +183,13 @@ const emits = defineEmits(["update-node-key"]); ////接收父组件的事件,
// 处理选中target数据,最终得到由高层到底层的数组
const handleTargetInfo = (data: TreeData, node: any) => {
// console.log(1111111,node);
-
+
// targetInfo.resultArr = [];
// handleTarget(e);
// 利用设备中的信息调用接口
// ---------
- // emits("update-node-key", node); //获取id,用于二级接口服务返回接口给可调资源列表
-
- if (node.level === 6) {
- //点中第4层 为单个光伏时 去返回id到父组件 并让父组件获取可调资源的相关信息和表格
- emits("update-node-key", node); //获取id,用于二级接口服务返回接口给可调资源列表
- }
-
+ //点中每一层设备树 去返回id到父组件 并让父组件获取可调资源的相关信息和表格
+ emits("update-node-key", node); //获取id,用于二级接口服务返回接口给可调资源列表
// ---------
};
const handleTarget = (node: any) => {
@@ -252,8 +253,8 @@ const handleTarget = (node: any) => {
.tree {
// height: 1300px;
- height: changeHeight(980);
- width: changeWidth(901.19);
+ // height: changeHeight(980);
+ // width: changeWidth(901.19);
margin-left: changeHeight(56);
}
@@ -389,7 +390,12 @@ const handleTarget = (node: any) => {
// 修改鼠标点击时的颜色以及节点失去焦点时的背景色
:deep(.el-tree-node:focus > .el-tree-node__content) {
- background-color: transparent !important;
+ // background-color: transparent !important;
+ background: linear-gradient(
+ 90deg,
+ rgba(82, 127, 243, 0.8) 0%,
+ rgba(59, 38, 148, 0) 100%
+ );
}
:deep(.el-tree-node__content:hover) {
@@ -607,4 +613,5 @@ const handleTarget = (node: any) => {
// }
// }
// }
+
diff --git a/src/views/commonPage/tree.vue b/src/views/commonPage/tree.vue
index fae5da3..452502e 100644
--- a/src/views/commonPage/tree.vue
+++ b/src/views/commonPage/tree.vue
@@ -1,26 +1,33 @@
-