Compare commits
14 Commits
7690f72636
...
9dfc3173ac
Author | SHA1 | Date | |
---|---|---|---|
![]() |
9dfc3173ac | ||
![]() |
7745f55803 | ||
![]() |
f915dab012 | ||
![]() |
9031837695 | ||
![]() |
bd4fec4c7e | ||
![]() |
f10045b64d | ||
![]() |
85cd183493 | ||
![]() |
a83f8d868a | ||
![]() |
bf4a3fd581 | ||
![]() |
2a6de583e1 | ||
![]() |
ddf0514182 | ||
![]() |
1be888feba | ||
![]() |
5c902d174d | ||
![]() |
c2e69b4d36 |
@@ -48,169 +48,24 @@
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
// :deep(.ant-menu-item),
|
||||
// :deep(.ant-menu-submenu-title) {
|
||||
// &:not(.ant-menu-item-selected) {
|
||||
// // &:not(.ant-menu-item-active) {
|
||||
// .anticon {
|
||||
// color: rgb(141, 150, 163);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// :deep(.ns-content) {
|
||||
// // padding-top: 80px !important;
|
||||
// }
|
||||
// #app {
|
||||
// width: 100%;
|
||||
// height: 100%;
|
||||
// }
|
||||
|
||||
// :deep(.ant-menu-title-content) {
|
||||
// background: unset !important;
|
||||
// z-index: 9 !important;
|
||||
// }
|
||||
// :deep(.ns-left-menu) {
|
||||
// .ant-menu-item-selected {
|
||||
// // color: #fff !important;
|
||||
// background: @primary-color;
|
||||
// border-radius: 12px;
|
||||
// // height: 40px;
|
||||
// // line-height: 40px;
|
||||
// padding: 5px @ns-gap;
|
||||
// position: relative;
|
||||
// a {
|
||||
// color: @white !important;
|
||||
// }
|
||||
// }
|
||||
|
||||
// .ant-menu-item-active,
|
||||
// .ant-submenu-item-active {
|
||||
// // color: rgba(@primary-color, 0.1) !important;
|
||||
// }
|
||||
// }
|
||||
|
||||
// :deep(.ant-menu-light.ant-menu-horizontal > .ant-menu-item:hover) {
|
||||
// // background: @primary-color;
|
||||
// }
|
||||
// // :deep(.ant-menu-inline .ant-menu-submenu-title) {
|
||||
// // color: rgba(255, 255, 255, 0.9) !important;
|
||||
// // }
|
||||
// :deep(.ns-left-menu .ant-layout-sider-children .ant-menu-sub.ant-menu-inline) {
|
||||
// // position: relative;
|
||||
// // &::before {
|
||||
// // display: flex;
|
||||
// // width: 2px;
|
||||
// // height: calc(100% - 40px);
|
||||
// // position: absolute;
|
||||
// // top: 20px;
|
||||
// // left: 20px;
|
||||
// // content: '';
|
||||
// // background-color: rgba(255, 255, 255, 0.2);
|
||||
// // }
|
||||
// }
|
||||
|
||||
// //*************************含tab的 list列表样式 */
|
||||
// :deep(.tabListTable) {
|
||||
// .ns-table-title {
|
||||
// text-align: left;
|
||||
// height: 46px;
|
||||
// line-height: 46px;
|
||||
// font-size: 18px;
|
||||
// font-weight: bold;
|
||||
// user-select: text;
|
||||
// padding-left: 16px;
|
||||
// background: #fff;
|
||||
// width: calc(100% + 32px);
|
||||
// margin-left: -16px;
|
||||
// }
|
||||
// .tabs-list {
|
||||
// overflow: visible !important;
|
||||
// }
|
||||
// .ant-tabs-nav {
|
||||
// width: calc(100% + 32px);
|
||||
// margin-left: -16px !important;
|
||||
// background: #fff;
|
||||
// }
|
||||
// .ant-tabs-nav-wrap {
|
||||
// padding: 0 16px;
|
||||
// }
|
||||
// }
|
||||
|
||||
// //*********************详情页返回修改 */
|
||||
// :deep(.nsDetailView) {
|
||||
// min-height: 100%;
|
||||
// height: 100%;
|
||||
// .ns-detail-content {
|
||||
// padding: 0px 24px;
|
||||
// border-top: 16px solid #e5ebf0;
|
||||
// }
|
||||
// .ant-descriptions-item-label {
|
||||
// color: rgba(0, 0, 0, 0.5);
|
||||
// font-family: PingFang SC;
|
||||
// font-size: 14px;
|
||||
// }
|
||||
// .ant-descriptions-item-content {
|
||||
// color: rgba(0, 0, 0, 0.95);
|
||||
// font-family: PingFang SC;
|
||||
// font-size: 14px;
|
||||
// }
|
||||
// .ant-descriptions-title {
|
||||
// &::after {
|
||||
// content: '';
|
||||
// width: 75px;
|
||||
// height: 7px;
|
||||
// display: block;
|
||||
// background: linear-gradient(90deg, #537fff 0%, #fff 82.67%);
|
||||
// margin-left: 2px;
|
||||
// margin-top: -2px;
|
||||
// }
|
||||
// }
|
||||
|
||||
// .ant-descriptions-row > th,
|
||||
// .ant-descriptions-row > td {
|
||||
// padding-bottom: 8px;
|
||||
// }
|
||||
// .ns-page-header {
|
||||
// margin-bottom: 0 !important;
|
||||
// padding-top: 7px !important;
|
||||
// padding-bottom: 7px !important;
|
||||
// width: calc(100% + 32px);
|
||||
// margin-left: -16px;
|
||||
// .title {
|
||||
// cursor: pointer;
|
||||
// font-size: 18px !important;
|
||||
// }
|
||||
// }
|
||||
// .ant-descriptions-header {
|
||||
// margin: 16px 0 16px 0 !important;
|
||||
|
||||
// .ant-descriptions-title {
|
||||
// line-height: 16px;
|
||||
// font-size: 16px;
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// :deep(.ns-detail .ant-descriptions-header .descriptions-title) {
|
||||
// &:after {
|
||||
// content: '';
|
||||
// width: 75px;
|
||||
// height: 7px;
|
||||
// display: block;
|
||||
// background: linear-gradient(90deg, @primary-color 0%, #fff 82.67%);
|
||||
// margin-left: 2px;
|
||||
// margin-top: -2px;
|
||||
// }
|
||||
// }
|
||||
// :deep(.ant-descriptions-header .descriptions-title) {
|
||||
// &:after {
|
||||
// content: '';
|
||||
// width: 75px;
|
||||
// height: 7px;
|
||||
// display: block;
|
||||
// background: linear-gradient(90deg, @primary-color 0%, #fff 82.67%);
|
||||
// margin-left: 2px;
|
||||
// margin-top: -2px;
|
||||
// }
|
||||
// }
|
||||
:deep(.ant-tree-node-content-wrapper) {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-wrap: nowrap;
|
||||
}
|
||||
:deep(.ns-table-search) {
|
||||
.ns-flexv2-form {
|
||||
.ns-operate {
|
||||
text-align: left;
|
||||
margin-left: 0;
|
||||
.ant-btn {
|
||||
margin: 0;
|
||||
margin-right: 6px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.ns-form-body {
|
||||
max-width: 1000px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
@@ -31,4 +31,8 @@ export enum quickCalculation {
|
||||
creat = '/carbon-smart/api/carbon/energy/correlation/creat',
|
||||
update = '/carbon-smart/api/carbon/energy/correlation/update',
|
||||
del = '/carbon-smart/api/carbon/energy/correlation/del',
|
||||
}
|
||||
// 碳排管理-碳排统计接口
|
||||
export enum carbonEmission {
|
||||
carbonEmissionStatistics = '/carbon-smart/api/carbon/energy/correlation/carbonEmissionStatistics',
|
||||
}
|
13
hx-ai-intelligent/src/api/monitor.ts
Normal file
13
hx-ai-intelligent/src/api/monitor.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
export enum deviceMonitor {
|
||||
// getTableList = '/carbon/emission/factor/queryCarbonFactorPage',
|
||||
// addNewData = '/carbon/emission/factor/creatOrUpdate',
|
||||
// editUser = '/carbon-smart/api/user/edit',
|
||||
// frozen = '/carbon-smart/api/user/frozen',
|
||||
// resetPwd = '/carbon-smart/api/user/resetPwd',
|
||||
// del = '/carbon-smart/api/user/del',
|
||||
// batchDel = '/carbon-smart/api/user/batchDel',
|
||||
// getCarbonFactorTree = '/carbon/emission/type/getCarbonFactorTree',
|
||||
// queryDeptTree = '/carbon-smart/api/user/queryDeptTree',
|
||||
// queryUserPerList = '/carbon-smart/api/user/queryUserPerList',
|
||||
getDeviceGraph = '/carbon-smart/api/monitor/getDeviceGraph',
|
||||
}
|
107
hx-ai-intelligent/src/components/ns-steps.vue
Normal file
107
hx-ai-intelligent/src/components/ns-steps.vue
Normal file
@@ -0,0 +1,107 @@
|
||||
<template>
|
||||
<a-steps direction="vertical" :current="size">
|
||||
<template v-for="(item, index) in dataSource" :key="index">
|
||||
<a-step>
|
||||
<template #icon>
|
||||
<img :style="{ width: item.status === '2' ? '19px' : '20px' }" :src="getSrc(item)" />
|
||||
</template>
|
||||
<template #description>
|
||||
<div
|
||||
style="
|
||||
width: 400px;
|
||||
min-height: 0px;
|
||||
background-color: #f8fafc;
|
||||
margin-left: 20px;
|
||||
border-radius: 4px; /* 设置圆角半径 */
|
||||
padding: 12px;
|
||||
">
|
||||
<div style="width: 100%; height: 30px; display: flex; position: relative">
|
||||
<a-tag
|
||||
style="width: 60px; height: 20px; text-align: center"
|
||||
:color="getColor(item)"
|
||||
>{{ getStatus(item) }}</a-tag
|
||||
>
|
||||
<div
|
||||
style="
|
||||
position: absolute;
|
||||
left: 35%;
|
||||
top: -2px;
|
||||
transform: translateX(-50%);
|
||||
color: #3a3a3a;
|
||||
"
|
||||
>{{ item.name }}</div
|
||||
>
|
||||
<div style="position: absolute; right: 10px; top: -2px; color: #ff7602"
|
||||
>2024-03-11 11:30:06</div
|
||||
>
|
||||
</div>
|
||||
<div style="width: 100%; color: #3a3a3a; height: 25px; overflow: auto">
|
||||
工单已完成并通过验收</div
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</a-step>
|
||||
</template>
|
||||
</a-steps>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { toRefs } from 'vue';
|
||||
|
||||
type Props = {
|
||||
dataSource: any;
|
||||
size: any;
|
||||
};
|
||||
const props = withDefaults(defineProps<Props>(), {});
|
||||
const getColor = (item: any) => {
|
||||
switch (item.status) {
|
||||
case '0':
|
||||
return '#ff7602';
|
||||
case '1':
|
||||
return '#00a1e6';
|
||||
case '2':
|
||||
return '#04d919';
|
||||
case '3':
|
||||
return '#d9001b';
|
||||
case '4':
|
||||
return '#a6a6a6';
|
||||
}
|
||||
};
|
||||
const getSrc = (item: any) => {
|
||||
return '../../../../src/icon/status-' + item.status + '.svg';
|
||||
};
|
||||
const getStatus = (item: any) => {
|
||||
switch (item.status) {
|
||||
case '0':
|
||||
return '待处理';
|
||||
case '1':
|
||||
return '处理中';
|
||||
case '2':
|
||||
return '已完成';
|
||||
case '3':
|
||||
return '超时';
|
||||
case '4':
|
||||
return '已关闭';
|
||||
}
|
||||
};
|
||||
const { dataSource } = toRefs(props);
|
||||
const { size } = toRefs(props);
|
||||
|
||||
defineExpose({});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.ant-steps-vertical {
|
||||
margin-left: 20px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
:deep(.ant-steps-item-tail) {
|
||||
position: absolute !important;
|
||||
top: -10px !important;
|
||||
left: 16px !important;
|
||||
width: 1px !important;
|
||||
height: 150% !important;
|
||||
}
|
||||
:deep(.ant-steps-item) {
|
||||
margin-top: 20px !important;
|
||||
}
|
||||
</style>
|
@@ -1,12 +1 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="36px" height="36px" viewBox="0 0 36 36" enable-background="new 0 0 36 36" xml:space="preserve"> <image id="image0" width="36" height="36" x="0" y="0"
|
||||
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACQAAAAkBAMAAAATLoWrAAAAIGNIUk0AAHomAACAhAAA+gAAAIDo
|
||||
AAB1MAAA6mAAADqYAAAXcJy6UTwAAAASUExURQAAAI2Vo46Wo4uXo42Wo////3MrvScAAAAEdFJO
|
||||
UwCAv0BHJ479AAAAAWJLR0QF+G/pxwAAAAd0SU1FB+gHBAISL9sg4ewAAABSSURBVCjPY2CgCxBU
|
||||
cVJGFRFxAQIUMUYXMBBAV+Ti4ogQYXZxQVfGBBNygAuZwIQQOlXwCDnBhVzgAL+QA8vQFcIELi4Y
|
||||
nsQUcnHBEMMiREsAALpDPLVxCYzSAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTA3LTA0VDAyOjE4
|
||||
OjQ3KzAwOjAwPdooNQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0wNy0wNFQwMjoxODo0NyswMDow
|
||||
MEyHkIkAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMDctMDRUMDI6MTg6NDcrMDA6MDAbkrFW
|
||||
AAAAAElFTkSuQmCC" />
|
||||
</svg>
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1721184652893" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10631" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M0 916.48h1024v71.68H0v-71.68z m71.68-76.8H947.2v71.68H71.68v-71.68zM512 35.84c-199.68 0-363.52 163.84-363.52 363.52v404.48H332.8V440.32h71.68v363.52h476.16V404.48C875.52 199.68 711.68 35.84 512 35.84z" p-id="10632"></path></svg>
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 563 B |
6
hx-ai-intelligent/src/icon/gaojingtonglan.svg
Normal file
6
hx-ai-intelligent/src/icon/gaojingtonglan.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="48px" height="48px" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="matrix(1 0 0 1 -485 -23 )">
|
||||
<path d="M 47 42.32727272727272 C 47.78181818181818 45.381818181818176 45.381818181818176 47.78181818181818 42.54545454545455 47 L 5.454545454545454 47 C 2.6181818181818186 47.78181818181818 0.21818181818181742 45.381818181818176 1 42.32727272727272 L 1 29 L 47 29 L 47 42.32727272727272 Z M 29.89090909090909 41 L 29.89090909090909 36 L 6.1090909090909085 36 L 6.1090909090909085 41 L 29.89090909090909 41 Z M 41.89090909090909 41.89090909090909 L 41.89090909090909 36 L 36 36 L 36 41.89090909090909 L 41.89090909090909 41.89090909090909 Z M 1 26 L 1 5.454545454545454 C 0.21818181818181742 2.399999999999999 2.6181818181818186 0 5.454545454545454 0 L 42.54545454545455 0 C 45.38181818181818 0 47.78181818181818 2.399999999999999 47 5.454545454545454 L 47 26 L 1 26 Z M 5.454545454545454 19.418181818181814 L 9.818181818181818 21.818181818181817 L 14.181818181818183 14.399999999999999 L 24.218181818181822 21.16363636363636 L 29.67272727272728 12.654545454545453 L 40.36363636363637 18.76363636363636 L 42.763636363636365 14.399999999999995 L 27.92727272727273 5.018181818181814 L 22.90909090909091 13.745454545454539 L 12 7.85454545454545 L 5.454545454545454 19.418181818181814 Z " fill-rule="nonzero" fill="#d9001b" stroke="none" transform="matrix(1 0 0 1 485 23 )" />
|
||||
</g>
|
||||
</svg>
|
6
hx-ai-intelligent/src/icon/status-0.svg
Normal file
6
hx-ai-intelligent/src/icon/status-0.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="16px" height="16px" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="matrix(1 0 0 1 -305 -366 )">
|
||||
<path d="M 8.03885714285714 0.641142857142857 L 8.03885714285714 0.64 C 12.1181901007502 0.64 15.4251428571429 3.94695275639267 15.4251428571429 8.02628571428571 C 15.4251430928625 8.02704758957974 15.4251432107223 8.02780946489393 15.4251432107223 8.02857134022442 C 15.4251432107223 12.1085354806887 12.117678779758 15.415999911653 8.03771463929375 15.415999911653 C 3.95775049882947 15.415999911653 0.650286067865178 12.1085354806887 0.650286067865178 8.02857134022442 C 0.650286067865178 3.94860719976014 3.95775049882947 0.64114276879585 8.03771463929375 0.64114276879585 C 8.03809547381657 0.64114276879585 8.03847630833888 0.641142798244853 8.03885714285714 0.641142857142857 Z M 8 6.85714285714286 C 7.36881742876481 6.85714285714286 6.85714285714286 7.36881742876481 6.85714285714286 8 C 6.85714285714286 8.63118257123519 7.36881742876481 9.14285714285714 8 9.14285714285714 C 8.63118257123519 9.14285714285714 9.14285714285714 8.63118257123519 9.14285714285714 8 C 9.14285714285714 7.36881742876481 8.63118257123519 6.85714285714286 8 6.85714285714286 Z M 11.4285714285714 6.85714285714286 C 10.7973888573362 6.85714285714286 10.2857142857143 7.36881742876481 10.2857142857143 8 C 10.2857142857143 8.63118257123519 10.7973888573362 9.14285714285714 11.4285714285714 9.14285714285714 C 12.0597539998066 9.14285714285714 12.5714285714286 8.63118257123519 12.5714285714286 8 C 12.5714285714286 7.36881742876481 12.0597539998066 6.85714285714286 11.4285714285714 6.85714285714286 Z M 4.57142857142857 6.85714285714286 C 3.94024600019338 6.85714285714286 3.42857142857143 7.36881742876481 3.42857142857143 8 C 3.42857142857143 8.63118257123519 3.94024600019338 9.14285714285714 4.57142857142857 9.14285714285714 C 5.20261114266376 9.14285714285714 5.71428571428571 8.63118257123519 5.71428571428571 8 C 5.71428571428571 7.36881742876481 5.20261114266376 6.85714285714286 4.57142857142857 6.85714285714286 Z " fill-rule="nonzero" fill="#ff7602" stroke="none" transform="matrix(1 0 0 1 305 366 )" />
|
||||
</g>
|
||||
</svg>
|
6
hx-ai-intelligent/src/icon/status-1.svg
Normal file
6
hx-ai-intelligent/src/icon/status-1.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="16px" height="16px" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="matrix(1 0 0 1 -305 -340 )">
|
||||
<path d="M 15.52 8 C 15.52 3.848 12.152 0.48 8 0.48 C 3.848 0.48 0.48 3.848 0.48 8 C 0.48 12.152 3.848 15.52 8 15.52 C 12.152 15.52 15.52 12.152 15.52 8 Z M 11.608 9.256 C 11.84 9.368 11.936 9.648 11.832 9.88 C 11.72 10.112 11.44 10.216 11.208 10.104 L 7.8 8.48 C 7.632 8.392 7.52 8.216 7.512 8.024 L 7.512 2.648 C 7.512 2.392 7.72 2.176 7.984 2.176 C 8.24 2.176 8.456 2.384 8.456 2.648 L 8.456 7.752 L 11.608 9.256 Z " fill-rule="nonzero" fill="#009de1" stroke="none" transform="matrix(1 0 0 1 305 340 )" />
|
||||
</g>
|
||||
</svg>
|
6
hx-ai-intelligent/src/icon/status-2.svg
Normal file
6
hx-ai-intelligent/src/icon/status-2.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="15px" height="15px" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="matrix(1 0 0 1 -305 -264 )">
|
||||
<path d="M 12.8044865917969 12.8044945019531 C 15.7317833056641 9.87949759277344 15.7317833056641 5.12019596191406 12.8044865917969 2.19521370117188 C 11.3984961283515 0.787326048146557 9.48966705506673 -0.00260805552580251 7.4999560546875 3.046875E-05 C 5.50996955094545 -0.00406567496305449 3.60061659376305 0.786091774555939 2.19546946289063 2.19521370117188 C -0.731548930664062 5.12021061035156 -0.731548930664062 9.87951224121094 2.19546946289063 12.8044945019531 C 3.60067093003941 14.2135352022771 5.50998850312976 15.0036780086136 7.4999560546875 14.999677734375 C 9.49029165514025 15.0054765279533 11.4002873723065 14.2150596299848 12.8044865917969 12.8044945019531 Z M 11.9376369140625 5.54019552246094 L 6.89940004394531 10.9003754150391 C 6.87578802320076 10.9269018017654 6.84623229984903 10.9474623058395 6.81315013183594 10.9603753564453 C 6.78748609863281 10.9776751464844 6.77046462890625 10.9949895849609 6.73585041503906 11.003060859375 C 6.67362025830789 11.0304200226738 6.60651003916783 11.0449431326059 6.53853616699219 11.0457610107422 C 6.47426031328986 11.0436752198275 6.41062363711127 11.0323076485925 6.34960082519531 11.0120110400391 L 6.28960088378906 10.9773821777344 C 6.25364523541476 10.9604965742554 6.21927871922921 10.9404159360992 6.18691545410156 10.9173822363281 L 3.30259719726562 8.07866452148437 C 3.20194835437246 7.98256406662991 3.14591207112094 7.8488594603371 3.14796845214844 7.70971472167969 C 3.14796845214844 7.57240041503906 3.20046839355469 7.43510075683594 3.29421830566406 7.34076490722656 C 3.50055541080613 7.14332002945278 3.8257661663423 7.14332002945278 4.03210327148437 7.34076490722656 L 6.52210063476562 9.79326232910156 L 11.1824668212891 4.83721775390625 C 11.3839239859071 4.63706235688665 11.705600292055 4.62599539544477 11.9203371386719 4.81183204101562 C 12.0250169736047 4.90583460723342 12.0845359910269 5.04009087589488 12.0839014160156 5.18078184082031 C 12.0834323759743 5.31515796660418 12.0310295272497 5.44414958696638 11.9376515625 5.54078145996094 Z " fill-rule="nonzero" fill="#04d719" stroke="none" transform="matrix(1 0 0 1 305 264 )" />
|
||||
</g>
|
||||
</svg>
|
6
hx-ai-intelligent/src/icon/status-3.svg
Normal file
6
hx-ai-intelligent/src/icon/status-3.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="15px" height="15px" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="matrix(1 0 0 1 -305 -315 )">
|
||||
<path d="M 15 7.5 C 15 3.358125 11.641875 0 7.5 0 C 3.358125 0 0 3.358125 0 7.5 C 0 11.641875 3.358125 15 7.5 15 C 11.641875 15 15 11.641875 15 7.5 Z M 6.96437500488281 8.4375 L 6.96437500488281 3.8840625 C 6.96454594411788 3.81021458429416 7.02427767945776 3.75034328445354 7.09812499511719 3.75 L 7.90187500488281 3.75 C 7.97572232054224 3.75034328445354 8.03545405588212 3.81021458429416 8.03562499511719 3.8840625 L 8.03562499511719 8.4375 C 8.03545405588212 8.51134791570584 7.97572232054224 8.57121921554647 7.90187500488281 8.5715625 L 7.09812499511719 8.5715625 C 7.02427767945776 8.57121921554647 6.96454594411788 8.51134791570584 6.96437500488281 8.4375 Z M 7.5 11.25 C 7.05616214821327 11.2499137187178 6.69640622993007 10.8900878577318 6.69640622993007 10.4462499975586 C 6.69640622993007 10.0023511201461 7.05625737014613 9.64249997993007 7.50015624755859 9.64249997993007 C 7.94415034690392 9.64258627639936 8.30390626518712 10.0024121373854 8.30390626518712 10.4462499975586 C 8.30390626518712 10.8901488749711 7.94405512497106 11.2500000151871 7.50015624755859 11.2500000151871 Z " fill-rule="nonzero" fill="#d8001b" stroke="none" transform="matrix(1 0 0 1 305 315 )" />
|
||||
</g>
|
||||
</svg>
|
6
hx-ai-intelligent/src/icon/status-4.svg
Normal file
6
hx-ai-intelligent/src/icon/status-4.svg
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="15px" height="15px" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="matrix(1 0 0 1 -305 -289 )">
|
||||
<path d="M 14.8828125 7.5 C 14.8828125 3.42891475341797 11.571085246582 0.1171875 7.5 0.1171875 C 3.42942502441406 0.1171875 0.1171875 3.42891475341797 0.1171875 7.5 C 0.1171875 11.571085246582 3.42891475341797 14.8828125 7.5 14.8828125 C 11.5705749755859 14.8828125 14.8828125 11.571085246582 14.8828125 7.5 Z M 8.24725339416504 7.50209775695801 L 10.5116636334229 9.77390681030273 C 10.717328404541 9.98062045166015 10.7167897888184 10.3139079473877 10.5106147631836 10.5195727185059 C 10.4077965582275 10.6218806689453 10.2733136187744 10.6735590710449 10.1383204248047 10.6735590710449 C 10.0027886151123 10.6735590710449 9.86779542114258 10.6218806524658 9.76494885498047 10.5185238317871 L 7.49736364379883 8.24407840576172 L 5.22240794677735 10.4947965600586 C 5.11958974182129 10.5960556237793 4.98561707336426 10.6471954266357 4.85167274963379 10.6471954266357 C 4.71563066894531 10.6471954266357 4.58009887573242 10.5949784088135 4.47674203857422 10.490572701416 C 4.27212613769531 10.2833204443359 4.27371362365723 9.9500329486084 4.4809658972168 9.74490679321289 L 6.75328522155762 7.49736362731933 L 4.4893852532959 5.22609317321777 C 4.28372048217773 5.01988978637695 4.28425909790039 4.68609203613281 4.49043412353516 4.48042726501465 C 4.69663751037598 4.27422387817383 5.02989664489746 4.27530110961914 5.23610003173828 4.4814761352539 L 7.50314662719727 6.75538294555664 L 9.77810232421875 4.50469313598633 C 9.98481596557617 4.29956698059082 10.319152331543 4.30166472106934 10.5237682324219 4.5089169946289 C 10.7288943878174 4.71616925170898 10.7267966473389 5.04996700195312 10.5195443737793 5.25458290283203 L 8.24725339416504 7.50209775695801 Z " fill-rule="nonzero" fill="#a6a6a6" stroke="none" transform="matrix(1 0 0 1 305 289 )" />
|
||||
</g>
|
||||
</svg>
|
@@ -15,7 +15,6 @@ const alarmManagement = {
|
||||
{
|
||||
path: 'index',
|
||||
name: 'alarmOverviewIndex',
|
||||
// component: () => import('/nerv-lib/saas/view/menuManage/index.vue'),
|
||||
component: () => import('/@/view/alarmManagement/alarmOverview/index.vue'),
|
||||
meta: {
|
||||
title: '告警总览',
|
||||
@@ -26,16 +25,15 @@ const alarmManagement = {
|
||||
],
|
||||
},
|
||||
{
|
||||
path: 'equipmentAlarm ',
|
||||
path: 'equipmentAlarm',
|
||||
name: 'EquipmentAlarm',
|
||||
meta: { title: '设备告警', hideChildren: true, icon: 'gaojingguanli' },
|
||||
component: Base,
|
||||
redirect: { name: 'equipmentAlarmIndex' },
|
||||
redirect: { name: 'EquipmentAlarmIndex' },
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
name: 'equipmentAlarmIndex',
|
||||
// component: () => import('/nerv-lib/saas/view/menuManage/index.vue'),
|
||||
name: 'EquipmentAlarmIndex',
|
||||
component: () => import('/@/view/alarmManagement/equipmentAlarm/index.vue'),
|
||||
meta: {
|
||||
title: '设备告警',
|
||||
@@ -55,11 +53,34 @@ const alarmManagement = {
|
||||
{
|
||||
path: 'index',
|
||||
name: 'alarmSettingsIndex',
|
||||
// component: () => import('/nerv-lib/saas/view/menuManage/index.vue'),
|
||||
component: () => import('/@/view/alarmManagement/alarmSettings/index.vue'),
|
||||
meta: {
|
||||
title: '告警设置',
|
||||
keepAlive: true,
|
||||
operates: [
|
||||
{ title: '设备告警新增', code: 'equipmentAlarmAdd' },
|
||||
{ title: '设备告警导入', code: 'equipmentAlarmImport' },
|
||||
{ title: '设备告警导出', code: 'equipmentAlarmExports' },
|
||||
{ title: '设备告警删除', code: 'equipmentAlarmDel' },
|
||||
{ title: '设备告警编辑', code: 'equipmentAlarmEdit' },
|
||||
{ title: '能源告警新增', code: 'energyAlarmAdd' },
|
||||
{ title: '能源告警导入', code: 'energyAlarmImport' },
|
||||
{ title: '能源告警导出', code: 'energyAlarmExports' },
|
||||
{ title: '能源告警删除', code: 'energyAlarmDel' },
|
||||
{ title: '能源告警编辑', code: 'energyAlarmEdit' },
|
||||
{ title: '设备告警规则新增', code: 'configureEquipmentAlarmAdd' },
|
||||
{ title: '设备告警规则导入', code: 'configureEquipmentAlarmImport' },
|
||||
{ title: '设备告警规则导出', code: 'configureEquipmentAlarmExports' },
|
||||
{ title: '设备告警规则批量删除', code: 'configureEquipmentAlarmDels' },
|
||||
{ title: '设备告警规则编辑', code: 'configureEquipmentAlarmEdit' },
|
||||
{ title: '设备告警规则删除', code: 'configureEquipmentAlarmDel' },
|
||||
{ title: '能源告警规则新增', code: 'configureEnergyAlarmAdd' },
|
||||
{ title: '能源告警规则导入', code: 'configureEnergyAlarmImport' },
|
||||
{ title: '能源告警规则导出', code: 'configureEnergyAlarmExports' },
|
||||
{ title: '能源告警规则批量删除', code: 'configureEnergyAlarmDels' },
|
||||
{ title: '能源告警规则编辑', code: 'configureEnergyAlarmEdit' },
|
||||
{ title: '能源告警规则删除', code: 'configureEnergyAlarmDel' },
|
||||
],
|
||||
// backApi: [],
|
||||
},
|
||||
},
|
||||
|
@@ -31,7 +31,6 @@ const organizationManage = {
|
||||
{ title: '重置密码', code: 'userCodeReset' },
|
||||
{ title: '删除', code: 'userDelete' },
|
||||
],
|
||||
// backApi: [],
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -50,7 +49,16 @@ const organizationManage = {
|
||||
meta: {
|
||||
title: '部门/权限',
|
||||
keepAlive: true,
|
||||
// backApi: [],
|
||||
operates: [
|
||||
{ title: '新增部门', code: 'authorityDeptAdd' },
|
||||
{ title: '新增子部门', code: 'authorityDeptSonAdd' },
|
||||
{ title: '删除部门', code: 'authorityDeptDelete' },
|
||||
{ title: '编辑部门', code: 'authorityDeptEdit' },
|
||||
{ title: '新增角色', code: 'authorityRoleAdd' },
|
||||
{ title: '新增子角色', code: 'authorityRoleSonAdd' },
|
||||
{ title: '删除角色', code: 'authorityRoleDelete' },
|
||||
{ title: '编辑角色', code: 'authorityRoleEdit' },
|
||||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="item-box-right">
|
||||
<img width="54px" height="54px" src="../../../../src/icon/gaojingguanli.svg" />
|
||||
<img width="54px" height="54px" src="../../../../src/icon/gaojingtonglan.svg" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -45,7 +45,7 @@
|
||||
import * as echarts from 'echarts';
|
||||
|
||||
defineOptions({
|
||||
name: 'alarmOverview', // 与页面路由name一致缓存才可生效
|
||||
name: 'alarmOverviewIndex', // 与页面路由name一致缓存才可生效
|
||||
});
|
||||
|
||||
const info = ref({});
|
||||
@@ -134,13 +134,13 @@
|
||||
itemGap: 30, // 这里可以调整图例项之间的间距,单位为像素
|
||||
},
|
||||
],
|
||||
toolbox: {
|
||||
show: true,
|
||||
feature: {
|
||||
restore: {},
|
||||
saveAsImage: {},
|
||||
},
|
||||
},
|
||||
// toolbox: {
|
||||
// show: true,
|
||||
// feature: {
|
||||
// restore: {},
|
||||
// saveAsImage: {},
|
||||
// },
|
||||
// },
|
||||
calculable: true,
|
||||
xAxis: [
|
||||
{
|
||||
|
@@ -106,7 +106,7 @@
|
||||
headerActions: [
|
||||
{
|
||||
label: '新增',
|
||||
name: 'RoleTypeAdd',
|
||||
name: 'configureEnergyAlarmAdd',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
editConfigureEnergyAlarms.value.toggle(null, configureEnergyAlarmsData.value);
|
||||
@@ -114,7 +114,7 @@
|
||||
},
|
||||
{
|
||||
label: '导入',
|
||||
name: 'groupImport',
|
||||
name: 'configureEnergyAlarmImport',
|
||||
type: 'primary',
|
||||
extra: {
|
||||
// api: props.postImportApi, // 导入接口名
|
||||
@@ -131,7 +131,7 @@
|
||||
},
|
||||
{
|
||||
label: '导出',
|
||||
name: 'groupExports',
|
||||
name: 'configureEnergyAlarmExports',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
doWnload('/hx-ai-intelligent/asset/file/whiteListUser.xlsx');
|
||||
@@ -140,7 +140,7 @@
|
||||
{
|
||||
label: '批量删除',
|
||||
type: 'primary',
|
||||
name: 'userBatchDel',
|
||||
name: 'configureEnergyAlarmDels',
|
||||
confirm: true,
|
||||
dynamicDisabled: (data: any) => {
|
||||
return data.list.length === 0;
|
||||
@@ -205,7 +205,7 @@
|
||||
actions: [
|
||||
{
|
||||
label: '编辑',
|
||||
name: 'FeedBackDetail',
|
||||
name: 'configureEnergyAlarmEdit',
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
handle: (data: any) => {
|
||||
editConfigureEnergyAlarms.value.toggle(data, configureEnergyAlarmsData.value);
|
||||
@@ -213,7 +213,7 @@
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
name: 'FeedBackDetail',
|
||||
name: 'configureEnergyAlarmDel',
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
confirm: true,
|
||||
handle: (data: any) => {
|
||||
|
@@ -11,6 +11,9 @@
|
||||
}"
|
||||
@click="clickSwitch({ enableRules: record.enableRules, record: record })" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'valueType'">
|
||||
{{ record.valueType.label }}
|
||||
</template>
|
||||
</template>
|
||||
</ns-view-list-table>
|
||||
<!-- 新增or编辑界面 -->
|
||||
@@ -79,7 +82,7 @@
|
||||
headerActions: [
|
||||
{
|
||||
label: '新增',
|
||||
name: 'RoleTypeAdd',
|
||||
name: 'configureEquipmentAlarmAdd',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
editConfigureDeviceAlarms.value.toggle(null, configureDeviceAlarmsData.value);
|
||||
@@ -87,7 +90,7 @@
|
||||
},
|
||||
{
|
||||
label: '导入',
|
||||
name: 'groupImport',
|
||||
name: 'configureEquipmentAlarmImport',
|
||||
type: 'primary',
|
||||
extra: {
|
||||
// api: props.postImportApi, // 导入接口名
|
||||
@@ -104,7 +107,7 @@
|
||||
},
|
||||
{
|
||||
label: '导出',
|
||||
name: 'groupExports',
|
||||
name: 'configureEquipmentAlarmExports',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
doWnload('/hx-ai-intelligent/asset/file/whiteListUser.xlsx');
|
||||
@@ -112,7 +115,7 @@
|
||||
},
|
||||
{
|
||||
label: '批量删除',
|
||||
name: 'groupTemDownload',
|
||||
name: 'configureEquipmentAlarmDels',
|
||||
type: 'primary',
|
||||
confirm: true,
|
||||
dynamicDisabled: (data: any) => {
|
||||
@@ -177,7 +180,7 @@
|
||||
actions: [
|
||||
{
|
||||
label: '编辑',
|
||||
name: 'FeedBackDetail',
|
||||
name: 'configureEquipmentAlarmEdit',
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
handle: (data: any) => {
|
||||
editConfigureDeviceAlarms.value.toggle(data, configureDeviceAlarmsData);
|
||||
@@ -185,7 +188,7 @@
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
name: 'FeedBackDetail',
|
||||
name: 'configureEquipmentAlarmDel',
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
confirm: true,
|
||||
handle: (data: any) => {
|
||||
|
@@ -235,8 +235,8 @@
|
||||
};
|
||||
//取值类型
|
||||
const qzOptions = ref<SelectProps['options']>([
|
||||
{ value: 1, label: '实时值', code: '1' },
|
||||
{ value: 2, label: '平均值', code: '2' },
|
||||
{ value: 1, label: '实时值' },
|
||||
{ value: 2, label: '平均值' },
|
||||
]);
|
||||
//逻辑
|
||||
const ljOptions = ref<SelectProps['options']>([
|
||||
@@ -331,6 +331,7 @@
|
||||
infoObject.value.alarmList = infoObject.value.hxAlarmRuleLogicList || [];
|
||||
delete infoObject.value.hxAlarmRuleLogicList;
|
||||
infoObject.value.deviceType = selectDevice;
|
||||
infoObject.value.valueType = infoObject.value.valueType.value;
|
||||
infoObject.value.ruleType = infoObject.value.ruleType + '';
|
||||
}
|
||||
});
|
||||
|
@@ -126,7 +126,7 @@
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
export default {
|
||||
name: 'AlarmSettings',
|
||||
name: 'AlarmSettingsIndex',
|
||||
components: {
|
||||
editeEquipmentAlarm,
|
||||
configureDeviceAlarms,
|
||||
|
@@ -44,7 +44,7 @@
|
||||
width: 5px;
|
||||
height: 15px;
|
||||
background: inherit;
|
||||
background-color: rgba(251, 156, 67, 1);
|
||||
background-color: #2778ff;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
-moz-box-shadow: none;
|
||||
@@ -66,6 +66,9 @@
|
||||
:scroll="{ x: 800, y: 700 }"
|
||||
:pagination="pagination">
|
||||
<template #bodyCell="{ record, column }">
|
||||
<template v-if="column.dataIndex === 'address'">
|
||||
{{ record.userRoleInfos?.[0].deptRoleInfoList }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'operation'">
|
||||
<a style="color: rgb(210, 0, 5)" @click="remove(record)">移除</a>
|
||||
</template>
|
||||
@@ -93,7 +96,7 @@
|
||||
const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'index',
|
||||
width: 80,
|
||||
fixed: 'left',
|
||||
customRender: (text: any) => {
|
||||
@@ -102,7 +105,7 @@
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'deviceName',
|
||||
dataIndex: 'realName',
|
||||
width: 80,
|
||||
fixed: 'left',
|
||||
key: 'deviceName',
|
||||
@@ -115,13 +118,13 @@
|
||||
},
|
||||
{
|
||||
title: '组织关系',
|
||||
dataIndex: 'site',
|
||||
dataIndex: 'orgName',
|
||||
key: 'site',
|
||||
},
|
||||
{
|
||||
title: '部门',
|
||||
dataIndex: 'department',
|
||||
key: 'department',
|
||||
dataIndex: 'address',
|
||||
key: 'address',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
@@ -155,7 +158,7 @@
|
||||
visibleModel.value = true;
|
||||
let ids = [];
|
||||
dataSource.value.forEach((item) => {
|
||||
ids.push(item.id);
|
||||
ids.push(item.userId);
|
||||
});
|
||||
linkPeoples.value.getData({ id: ids, data: dataSource });
|
||||
};
|
||||
@@ -223,7 +226,7 @@
|
||||
//移除数据
|
||||
const remove = (data: any) => {
|
||||
dataSource.value.forEach((item, index) => {
|
||||
if (item.id === data.id) {
|
||||
if (item.userId === data.userId) {
|
||||
dataSource.value.splice(index, 1);
|
||||
}
|
||||
});
|
||||
@@ -236,7 +239,7 @@
|
||||
obj.selectList = [];
|
||||
dataSource.value.forEach((item) => {
|
||||
obj.selectList.push({
|
||||
people: item.id,
|
||||
userId: item.userId,
|
||||
});
|
||||
});
|
||||
console.log(obj, '数据');
|
||||
|
@@ -24,20 +24,18 @@
|
||||
src="https://files.axshare.com/gsc/4T0UQR/7e/5d/a2/7e5da2a277344db8af30521cefeb70cc/images/告警设置/u150.svg?pageId=1f58c1ba-b461-4fe8-a2b3-295f1e7b0aa0" />
|
||||
<div style="width: 100%; height: 370px; overflow-y: auto">
|
||||
<a-tree
|
||||
:expanded-keys="expandedKeys"
|
||||
:auto-expand-parent="autoExpandParent"
|
||||
:tree-data="gData"
|
||||
v-model:selectedKeys="selectedKeys"
|
||||
v-model:expandedKeys="expandedKeys"
|
||||
:tree-data="deptTreeData"
|
||||
@select="onSelect"
|
||||
@expand="onExpand"
|
||||
/></div>
|
||||
<!-- <ns-tree-api v-bind="config" @select="treeSelect" /> -->
|
||||
</div>
|
||||
<div class="box-right">
|
||||
<div style="width: 100%; display: flex; position: relative">
|
||||
<div class="border-card"></div>
|
||||
<span style="margin-left: 24px; color: #333333">人员列表 </span>
|
||||
<a-input-search
|
||||
v-model:value="name"
|
||||
v-model:value="realName"
|
||||
style="margin-bottom: 8px; width: 280px; position: absolute; right: 20px"
|
||||
placeholder="请输入"
|
||||
allowClear="true"
|
||||
@@ -54,11 +52,18 @@
|
||||
onChange: onSelectChange,
|
||||
}"
|
||||
:columns="columns"
|
||||
:loading="loading"
|
||||
:data-source="dataSource"
|
||||
:rowKey="(record: any) => record.id"
|
||||
:rowKey="(record: any) => record.userId"
|
||||
:pagination="pagination"
|
||||
:bordered="true"
|
||||
:size="'middle'" />
|
||||
:size="'middle'">
|
||||
<template #bodyCell="{ record, column }">
|
||||
<template v-if="column.dataIndex === 'address'">
|
||||
{{ record.userRoleInfos?.[0].deptRoleInfoList }}
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -69,51 +74,23 @@
|
||||
import { ref, watch, computed } from 'vue';
|
||||
import { defineComponent } from 'vue';
|
||||
import type { TreeProps } from 'ant-design-vue';
|
||||
import { device } from '/@/api/deviceManage';
|
||||
import { origanizemanage } from '/@/api/origanizemanage';
|
||||
import { department } from '/@/api/origanizemanage';
|
||||
|
||||
import { http } from '/nerv-lib/util';
|
||||
// import { editTreeConfig } from './config';
|
||||
|
||||
const x = 3;
|
||||
const y = 2;
|
||||
const z = 1;
|
||||
const genData: TreeProps['treeData'] = [];
|
||||
|
||||
const generateData = (_level: number, _preKey?: string, _tns?: TreeProps['treeData']) => {
|
||||
const preKey = _preKey || '0';
|
||||
const tns = _tns || genData;
|
||||
|
||||
const children = [];
|
||||
for (let i = 0; i < x; i++) {
|
||||
const key = `${preKey}-${i}`;
|
||||
tns.push({ title: key, key });
|
||||
if (i < y) {
|
||||
children.push(key);
|
||||
}
|
||||
}
|
||||
if (_level < 0) {
|
||||
return tns;
|
||||
}
|
||||
const level = _level - 1;
|
||||
children.forEach((key, index) => {
|
||||
tns[index].children = [];
|
||||
return generateData(level, key, tns[index].children);
|
||||
});
|
||||
};
|
||||
generateData(z);
|
||||
|
||||
//搜索存储
|
||||
const dataList: TreeProps['treeData'] = [];
|
||||
const generateList = (data: TreeProps['treeData']) => {
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
const node = data[i];
|
||||
const key = node.key;
|
||||
dataList.push({ key, title: key });
|
||||
dataList.push({ key, title: node.title });
|
||||
if (node.children) {
|
||||
generateList(node.children);
|
||||
}
|
||||
}
|
||||
};
|
||||
generateList(genData);
|
||||
|
||||
const getParentKey = (
|
||||
key: string | number,
|
||||
tree: TreeProps['treeData'],
|
||||
@@ -133,55 +110,101 @@
|
||||
};
|
||||
export default defineComponent({
|
||||
setup(props, { emit }) {
|
||||
// const config = computed(() => {
|
||||
// return editTreeConfig(result);
|
||||
// });
|
||||
//组织数
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
orgId.value = result;
|
||||
const dataSource = ref([]);
|
||||
const loading = ref(false);
|
||||
const selectedRowKey = ref([]);
|
||||
const selectedRow = ref([]);
|
||||
const name = ref(null);
|
||||
const realName = ref(null);
|
||||
// 树方法
|
||||
const expandedKeys = ref<(string | number)[]>([]);
|
||||
const selectedKeys = ref([]);
|
||||
const searchValue = ref<string>('');
|
||||
const deviceName = ref<string>('');
|
||||
const autoExpandParent = ref<boolean>(true);
|
||||
const deptTreeData = ref([]);
|
||||
//选择 组织
|
||||
const selectOrgId = ref('');
|
||||
selectOrgId.value = result;
|
||||
//选择部门
|
||||
const selectDeptId = ref('');
|
||||
|
||||
const onSearch = () => {
|
||||
pagination.value.current = 1;
|
||||
getList();
|
||||
};
|
||||
const onSelect = (selectedKeys: any, info: any) => {
|
||||
selectedKeys.value = selectedKeys;
|
||||
if (info.node.dataRef.deptInfo) {
|
||||
selectDeptId.value = info.node.dataRef.deptInfo.deptId;
|
||||
selectOrgId.value = info.node.dataRef.deptInfo.orgId;
|
||||
}
|
||||
if (info.node.dataRef.orgInfo) {
|
||||
selectOrgId.value = info.node.dataRef.orgInfo.orgId;
|
||||
selectDeptId.value = '';
|
||||
}
|
||||
pagination.value.current = 1;
|
||||
getList();
|
||||
};
|
||||
// 递归处理部门树数据
|
||||
const processDepartmentTree = (tree) => {
|
||||
tree.forEach((item) => {
|
||||
item.deptInfo = item.deptInfo;
|
||||
item.key = item.deptInfo.deptId;
|
||||
item.title = item.deptInfo.deptName;
|
||||
item.children = processDepartmentTree(item.children); // 递归处理子节点
|
||||
});
|
||||
return tree;
|
||||
};
|
||||
|
||||
// 获取部门树
|
||||
const getDepartList = (params) => {
|
||||
return http.post(department.queryDeptTree, params).then((res) => {
|
||||
const result = res.data.map((item) => ({
|
||||
key: item.orgInfo.orgId,
|
||||
orgInfo: item.orgInfo,
|
||||
title: item.orgInfo.orgName,
|
||||
children: processDepartmentTree(item.deptTrees),
|
||||
}));
|
||||
|
||||
return result;
|
||||
});
|
||||
};
|
||||
//获取树
|
||||
const getTreeData = () => {
|
||||
getDepartList({ orgId: orgId.value }).then((res) => {
|
||||
deptTreeData.value = res;
|
||||
selectedKeys.value = [orgId.value];
|
||||
generateList(deptTreeData.value);
|
||||
});
|
||||
};
|
||||
//获取列表
|
||||
const getList = () => {
|
||||
loading.value = true;
|
||||
http
|
||||
.post(device.queryDevicePage, {
|
||||
.post(origanizemanage.userList, {
|
||||
pageNum: pagination.value.current,
|
||||
pageSize: pagination.value.pageSize,
|
||||
deviceName: name.value,
|
||||
orgId: orgId.value,
|
||||
orgId: selectOrgId.value,
|
||||
deptId: selectDeptId.value,
|
||||
realName: realName.value,
|
||||
})
|
||||
.then((res) => {
|
||||
dataSource.value = res.data.records;
|
||||
pagination.value.total = res.data.total;
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
const onSelect = (selectedKeys: any, info: any) => {
|
||||
console.log('selected', selectedKeys, info.node.dataRef);
|
||||
pagination.value.current = 1;
|
||||
onSearch();
|
||||
};
|
||||
|
||||
const handleChangePage = (current: number, pageSize: number) => {
|
||||
pagination.value.current = current;
|
||||
pagination.value.pageSize = pageSize;
|
||||
http
|
||||
.post(device.queryDevicePage, {
|
||||
pageNum: pagination.value.current,
|
||||
pageSize: pagination.value.pageSize,
|
||||
orgId: orgId.value,
|
||||
})
|
||||
.then((res) => {
|
||||
dataSource.value = res.data.records;
|
||||
pagination.value.total = res.data.total;
|
||||
});
|
||||
console.log(selectedRowKey.value, selectedRow.value);
|
||||
getList();
|
||||
};
|
||||
const onSelectChange = (selectedRowKeys: any, selectedRows: any) => {
|
||||
console.log(selectedRowKeys, selectedRows);
|
||||
console.log(selectedRows, '数据');
|
||||
|
||||
const onSelectChange = (selectedRowKeys: any, selectedRows: any) => {
|
||||
selectedRowKey.value = selectedRowKeys;
|
||||
selectedRow.value = selectedRows;
|
||||
};
|
||||
@@ -200,14 +223,14 @@
|
||||
const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'index',
|
||||
customRender: (text: any) => {
|
||||
return text.index + 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'deviceName',
|
||||
dataIndex: 'realName',
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
@@ -215,7 +238,7 @@
|
||||
},
|
||||
{
|
||||
title: '组织关系',
|
||||
dataIndex: 'address',
|
||||
dataIndex: 'orgName',
|
||||
},
|
||||
{
|
||||
title: '部门 ',
|
||||
@@ -227,48 +250,32 @@
|
||||
emit('handleOk', { id: selectedRowKey.value, data: selectedRow.value });
|
||||
show.value = false;
|
||||
pagination.value.current = 1;
|
||||
realName.value = null;
|
||||
searchValue.value = '';
|
||||
};
|
||||
const getData = (data: any) => {
|
||||
selectedRow.value = data.data;
|
||||
selectedRowKey.value = data.id;
|
||||
show.value = true;
|
||||
http
|
||||
.post(device.queryDevicePage, {
|
||||
pageNum: pagination.value.current,
|
||||
pageSize: pagination.value.pageSize,
|
||||
orgId: orgId.value,
|
||||
})
|
||||
.then((res) => {
|
||||
dataSource.value = res.data.records;
|
||||
pagination.value.total = res.data.total;
|
||||
});
|
||||
//获取列表
|
||||
getList();
|
||||
//获取树
|
||||
getTreeData();
|
||||
};
|
||||
const show = ref(false);
|
||||
const handleCancel = () => {
|
||||
// 处理取消按钮的逻辑
|
||||
pagination.value.current = 1;
|
||||
realName.value = null;
|
||||
emit('handleCancel', null);
|
||||
show.value = false;
|
||||
};
|
||||
// 树方法
|
||||
const expandedKeys = ref<(string | number)[]>([]);
|
||||
const searchValue = ref<string>('');
|
||||
const deviceName = ref<string>('');
|
||||
const autoExpandParent = ref<boolean>(true);
|
||||
const gData = ref<TreeProps['treeData']>(genData);
|
||||
|
||||
const onExpand = (keys: string[]) => {
|
||||
expandedKeys.value = keys;
|
||||
autoExpandParent.value = false;
|
||||
console.log(keys, '数据');
|
||||
};
|
||||
watch(searchValue, (value) => {
|
||||
console.log(gData.value, '数据');
|
||||
|
||||
const expanded = dataList
|
||||
.map((item: TreeProps['treeData'][number]) => {
|
||||
if (item.title.indexOf(value) > -1) {
|
||||
return getParentKey(item.key, gData.value);
|
||||
console.log(item.title.indexOf(value));
|
||||
return getParentKey(item.key, deptTreeData.value);
|
||||
}
|
||||
return null;
|
||||
})
|
||||
@@ -276,30 +283,35 @@
|
||||
expandedKeys.value = expanded;
|
||||
searchValue.value = value;
|
||||
autoExpandParent.value = true;
|
||||
console.log(expandedKeys.value, '数据');
|
||||
});
|
||||
return {
|
||||
columns,
|
||||
name,
|
||||
realName,
|
||||
orgId,
|
||||
// config,
|
||||
processDepartmentTree,
|
||||
onSearch,
|
||||
getList,
|
||||
loading,
|
||||
dataSource,
|
||||
onSelect,
|
||||
gData,
|
||||
onExpand,
|
||||
deptTreeData,
|
||||
selectedRow,
|
||||
selectedRowKey,
|
||||
autoExpandParent,
|
||||
expandedKeys,
|
||||
selectedKeys,
|
||||
onSelectChange,
|
||||
pagination,
|
||||
handleOk,
|
||||
show,
|
||||
getData,
|
||||
getTreeData,
|
||||
getDepartList,
|
||||
searchValue,
|
||||
deviceName,
|
||||
handleCancel,
|
||||
selectDeptId,
|
||||
selectOrgId,
|
||||
};
|
||||
},
|
||||
});
|
||||
@@ -313,7 +325,7 @@
|
||||
width: 5px;
|
||||
height: 15px;
|
||||
background: inherit;
|
||||
background-color: rgba(251, 156, 67, 1);
|
||||
background-color: @primary-color;
|
||||
border: none;
|
||||
border-radius: 5px;
|
||||
-moz-box-shadow: none;
|
||||
|
@@ -57,7 +57,7 @@ export const energyAlarmConfigs = (
|
||||
headerActions: [
|
||||
{
|
||||
label: '新增',
|
||||
name: 'RoleTypeAdd',
|
||||
name: 'energyAlarmAdd',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
editeEnergyAlarm.value.toggle();
|
||||
@@ -65,7 +65,7 @@ export const energyAlarmConfigs = (
|
||||
},
|
||||
{
|
||||
label: '导入',
|
||||
name: 'groupImport',
|
||||
name: 'energyAlarmImport',
|
||||
type: 'primary',
|
||||
extra: {
|
||||
title: '设备信息', // 弹窗title
|
||||
@@ -81,7 +81,7 @@ export const energyAlarmConfigs = (
|
||||
},
|
||||
{
|
||||
label: '导出',
|
||||
name: 'groupExports',
|
||||
name: 'energyAlarmExports',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
doWnload('/hx-ai-intelligent/asset/file/whiteListUser.xlsx');
|
||||
@@ -95,7 +95,7 @@ export const energyAlarmConfigs = (
|
||||
actions: [
|
||||
{
|
||||
label: '编辑',
|
||||
name: 'FeedBackDetail',
|
||||
name: 'energyAlarmEdit',
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
handle: (data: any) => {
|
||||
data.monitorFrequency = data.monitorFrequency.value;
|
||||
@@ -106,7 +106,7 @@ export const energyAlarmConfigs = (
|
||||
},
|
||||
{
|
||||
label: '配置',
|
||||
name: 'FeedBackDetail',
|
||||
name: 'alarmSettingsIndex',
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
handle: (data: any) => {
|
||||
energyAlarm.value = !energyAlarm.value;
|
||||
@@ -115,7 +115,7 @@ export const energyAlarmConfigs = (
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
name: 'FeedBackDetail',
|
||||
name: 'energyAlarmDel',
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
confirm: true,
|
||||
handle: (data: any) => {
|
||||
|
@@ -61,7 +61,7 @@ export const equipmentAlarmTableConfig = (
|
||||
headerActions: [
|
||||
{
|
||||
label: '新增',
|
||||
name: 'RoleTypeAdd',
|
||||
name: 'equipmentAlarmAdd',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
editEquipmentAlarm.value.toggle();
|
||||
@@ -69,7 +69,7 @@ export const equipmentAlarmTableConfig = (
|
||||
},
|
||||
{
|
||||
label: '导入',
|
||||
name: 'groupImport',
|
||||
name: 'equipmentAlarmImport',
|
||||
type: 'primary',
|
||||
extra: {
|
||||
// api: props.postImportApi, // 导入接口名
|
||||
@@ -86,7 +86,7 @@ export const equipmentAlarmTableConfig = (
|
||||
},
|
||||
{
|
||||
label: '导出',
|
||||
name: 'groupExports',
|
||||
name: 'equipmentAlarmExports',
|
||||
type: 'primary',
|
||||
handle: () => {
|
||||
doWnload('/hx-ai-intelligent/asset/file/whiteListUser.xlsx');
|
||||
@@ -100,7 +100,7 @@ export const equipmentAlarmTableConfig = (
|
||||
actions: [
|
||||
{
|
||||
label: '编辑',
|
||||
name: 'FeedBackDetail',
|
||||
name: 'equipmentAlarmEdit',
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
handle: (data: any) => {
|
||||
data.priority = data.priority.value;
|
||||
@@ -111,7 +111,7 @@ export const equipmentAlarmTableConfig = (
|
||||
},
|
||||
{
|
||||
label: '配置',
|
||||
name: 'FeedBackDetail',
|
||||
name: 'alarmSettingsIndex',
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
handle: (data: any) => {
|
||||
equipmentAlarm.value = !equipmentAlarm.value;
|
||||
@@ -120,7 +120,7 @@ export const equipmentAlarmTableConfig = (
|
||||
},
|
||||
{
|
||||
label: '删除',
|
||||
name: 'FeedBackDetail',
|
||||
name: 'equipmentAlarmDel',
|
||||
dynamicParams: ['uuid', 'appealType'],
|
||||
confirm: true,
|
||||
handle: (data: any) => {
|
||||
|
@@ -12,6 +12,7 @@
|
||||
import { ref } from 'vue';
|
||||
|
||||
export default {
|
||||
name: 'EquipmentAlarmIndex',
|
||||
components: { Look, Status },
|
||||
|
||||
setup() {
|
||||
|
@@ -8,7 +8,7 @@
|
||||
:cancel="handleClose"
|
||||
placement="right"
|
||||
@close="handleClose">
|
||||
<div style="width: 100%; height: 100%; overflow-y: auto">
|
||||
<div style="width: 100%; height: 100%; overflow-y: auto; overflow-x: hidden">
|
||||
<!-- top -->
|
||||
<div
|
||||
style="
|
||||
@@ -28,247 +28,202 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- center -->
|
||||
<div style="width: 100%; height: 300px; border: 1px solid red" ref="graphChart"></div>
|
||||
<div style="width: 100%; height: 400px">
|
||||
<div style="width: 100%; height: 100%" ref="graphChart"></div>
|
||||
</div>
|
||||
<!-- bottom -->
|
||||
<div style="width: 100%; margin-top: 10px">
|
||||
<a-descriptions :column="1" bordered>
|
||||
<a-descriptions-item label="优先级">紧急</a-descriptions-item>
|
||||
<a-descriptions-item label="状态">新告警</a-descriptions-item>
|
||||
<a-descriptions-item label="错误码">C003</a-descriptions-item>
|
||||
<a-descriptions-item label="告警描述"
|
||||
><div style="color: #ff7602">用电量超标</div> 当日用电量超出预设值</a-descriptions-item
|
||||
>
|
||||
<a-descriptions-item label="设备信息"> 1栋10层低压柜 </a-descriptions-item>
|
||||
<a-descriptions-item label="重复次数"> 0 </a-descriptions-item>
|
||||
</a-descriptions>
|
||||
</div>
|
||||
</div>
|
||||
<template #footer>
|
||||
<a-button type="primary" @click="handleClose">确定</a-button>
|
||||
</template>
|
||||
</ns-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
<script lang="ts" setup>
|
||||
defineOptions({
|
||||
name: 'look', // 与页面路由name一致缓存才可生效
|
||||
});
|
||||
import { ref } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
let chartInstance = null;
|
||||
const graphChart = ref(null);
|
||||
const visible = ref(false);
|
||||
const handleClose = () => {
|
||||
visible.value = false;
|
||||
};
|
||||
const btnClick = () => {
|
||||
console.log('btnClick');
|
||||
};
|
||||
const toggle = (data) => {
|
||||
console.log(data, 'data');
|
||||
visible.value = true;
|
||||
getChatr();
|
||||
};
|
||||
const getChatr = () => {
|
||||
let dayData = [];
|
||||
let energyAlarm = [];
|
||||
let wgAlarm = [];
|
||||
let equipmentAlarm = [];
|
||||
let total = [];
|
||||
|
||||
// Extend data for 30 days
|
||||
for (let i = 1; i < 30; i++) {
|
||||
dayData.push(`3/${i}`);
|
||||
energyAlarm.push(Math.floor(Math.random() * 11)); // Assuming the same value for simplicity
|
||||
wgAlarm.push(Math.floor(Math.random() * 11)); // Assuming the same value for simplicity
|
||||
equipmentAlarm.push(Math.floor(Math.random() * 11)); // Assuming the same value for simplicity
|
||||
total.push(0); // Assuming the same value for simplicity
|
||||
}
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose();
|
||||
}
|
||||
chartInstance = echarts.init(graphChart.value);
|
||||
const option = {
|
||||
title: {
|
||||
text: '告警趋势/ 近30天',
|
||||
textStyle: {
|
||||
fontSize: 16,
|
||||
fontWeight: 'normal',
|
||||
color: '#aaaaaa',
|
||||
},
|
||||
left: '1%',
|
||||
top: '2%',
|
||||
let chartInstance: echarts.ECharts | null = null;
|
||||
const graphChart = ref(null);
|
||||
const visible = ref(false);
|
||||
const handleClose = () => {
|
||||
visible.value = false;
|
||||
};
|
||||
const btnClick = () => {
|
||||
console.log('btnClick');
|
||||
handleClose();
|
||||
};
|
||||
const toggle = (data: any) => {
|
||||
console.log(data, 'data');
|
||||
visible.value = true;
|
||||
setTimeout(() => {
|
||||
getChatr();
|
||||
}, 500);
|
||||
};
|
||||
const getChatr = () => {
|
||||
let dayData = [];
|
||||
let energyAlarm = [];
|
||||
|
||||
// Extend data for 30 days
|
||||
for (let i = 1; i < 30; i++) {
|
||||
dayData.push(`3/${i}`);
|
||||
energyAlarm.push(Math.floor(Math.random() * 250));
|
||||
}
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose();
|
||||
}
|
||||
chartInstance = echarts.init(graphChart.value);
|
||||
const option = {
|
||||
// title: {
|
||||
// text: '告警趋势/ 近30天',
|
||||
// textStyle: {
|
||||
// fontSize: 16,
|
||||
// fontWeight: 'normal',
|
||||
// color: '#aaaaaa',
|
||||
// },
|
||||
// left: '1%',
|
||||
// top: '2%',
|
||||
// },
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow',
|
||||
},
|
||||
formatter: function (params: any) {
|
||||
let res = params[0].marker + ' ' + params[0].seriesName + ' : ' + params[0].data;
|
||||
return res;
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
left: '10%', // 设置图表距离左边的距离
|
||||
right: '4%', // 设置图表距离右边的距离
|
||||
top: '6%',
|
||||
borderWidth: 0,
|
||||
y2: 60, // 距离底边
|
||||
},
|
||||
legend: [
|
||||
{
|
||||
show: false,
|
||||
top: 5,
|
||||
left: 'center', // 将图例居中显示
|
||||
textStyle: {
|
||||
color: 'rgb(89, 89, 89)',
|
||||
fontSize: '14',
|
||||
fontWeight: 'normal',
|
||||
}, // 注意这里的颜色值要用引号括起来
|
||||
data: ['电压值'],
|
||||
itemGap: 30, // 这里可以调整图例项之间的间距,单位为像素
|
||||
},
|
||||
],
|
||||
// toolbox: {
|
||||
// show: true,
|
||||
// feature: {
|
||||
// restore: {},
|
||||
// saveAsImage: {},
|
||||
// },
|
||||
// },
|
||||
calculable: true,
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
tooltip: {
|
||||
trigger: 'axis',
|
||||
axisPointer: {
|
||||
type: 'shadow',
|
||||
},
|
||||
formatter: function (params) {
|
||||
let res =
|
||||
params[0].axisValue +
|
||||
'<br/>' +
|
||||
params[0].marker +
|
||||
' ' +
|
||||
params[0].seriesName +
|
||||
' : ' +
|
||||
params[0].data +
|
||||
'<br/>' +
|
||||
params[1].marker +
|
||||
' ' +
|
||||
params[1].seriesName +
|
||||
' : ' +
|
||||
params[1].data +
|
||||
'<br/>' +
|
||||
params[2].marker +
|
||||
' ' +
|
||||
params[2].seriesName +
|
||||
' : ' +
|
||||
params[2].data +
|
||||
'<br/>';
|
||||
return res;
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
left: '2%', // 设置图表距离左边的距离
|
||||
right: '2%', // 设置图表距离右边的距离
|
||||
borderWidth: 0,
|
||||
y2: 60, // 距离底边
|
||||
},
|
||||
legend: [
|
||||
{
|
||||
top: 5,
|
||||
left: 'center', // 将图例居中显示
|
||||
textStyle: {
|
||||
color: 'rgb(89, 89, 89)',
|
||||
fontSize: '14',
|
||||
fontWeight: 'normal',
|
||||
}, // 注意这里的颜色值要用引号括起来
|
||||
data: ['设备告警', '网关告警', '能源告警'],
|
||||
itemGap: 30, // 这里可以调整图例项之间的间距,单位为像素
|
||||
},
|
||||
],
|
||||
toolbox: {
|
||||
axisTick: {
|
||||
show: true,
|
||||
feature: {
|
||||
restore: {},
|
||||
saveAsImage: {},
|
||||
},
|
||||
splitArea: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
show: true, // 显示 X 轴刻度标签
|
||||
color: 'rgb(89, 89, 89)', // X 轴刻度标签的字体颜色
|
||||
fontSize: 12, // X 轴刻度标签的字体大小
|
||||
formatter: function (value) {
|
||||
// 可选:格式化 X 轴刻度标签文本
|
||||
return value;
|
||||
},
|
||||
},
|
||||
calculable: true,
|
||||
xAxis: [
|
||||
{
|
||||
type: 'category',
|
||||
splitLine: {
|
||||
show: false,
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
splitArea: {
|
||||
show: false,
|
||||
},
|
||||
data: dayData,
|
||||
data: dayData,
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
shwo: false,
|
||||
splitLine: {
|
||||
show: true,
|
||||
},
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
splitArea: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
show: true, // 显示
|
||||
formatter: function (value) {
|
||||
return value + ' V'; // 在刻度值后加上单位
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
shwo: false,
|
||||
splitLine: {
|
||||
show: true,
|
||||
},
|
||||
axisLine: {
|
||||
show: false,
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
splitArea: {
|
||||
show: false,
|
||||
},
|
||||
axisLabel: {
|
||||
show: false, // 不显示刻度值
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
dataZoom: [
|
||||
{
|
||||
height: 12,
|
||||
start: 0,
|
||||
end: 100,
|
||||
handleSize: '300%', // 设置滑块的大小
|
||||
bottom: 15,
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '电压值',
|
||||
type: 'line',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
barBorderRadius: 0,
|
||||
color: '#6395F9',
|
||||
},
|
||||
],
|
||||
dataZoom: [
|
||||
{
|
||||
height: 12,
|
||||
start: 0,
|
||||
end: 100,
|
||||
handleSize: '300%', // 设置滑块的大小
|
||||
bottom: 15,
|
||||
},
|
||||
symbol: 'circle', // 数据点的形状,这里设置为圆形
|
||||
symbolSize: 8,
|
||||
label: {
|
||||
show: true,
|
||||
color: 'rgb(89, 89, 89)',
|
||||
position: 'top',
|
||||
top: '10',
|
||||
formatter: function (value) {
|
||||
return Number(energyAlarm[value.dataIndex]) + 'V';
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: '能源告警',
|
||||
type: 'bar',
|
||||
stack: '能源告警',
|
||||
barMaxWidth: 40,
|
||||
barGap: '10%',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
barBorderRadius: 0,
|
||||
color: 'rgb(246, 189, 22)',
|
||||
},
|
||||
},
|
||||
data: energyAlarm,
|
||||
},
|
||||
{
|
||||
name: '网关告警',
|
||||
type: 'bar',
|
||||
stack: '能源告警',
|
||||
barMaxWidth: 40,
|
||||
barGap: '10%',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
barBorderRadius: 0,
|
||||
color: 'rgb(91, 143, 249)',
|
||||
},
|
||||
},
|
||||
data: wgAlarm,
|
||||
},
|
||||
{
|
||||
name: '设备告警',
|
||||
type: 'bar',
|
||||
stack: '能源告警',
|
||||
barMaxWidth: 40,
|
||||
barGap: '10%',
|
||||
itemStyle: {
|
||||
normal: {
|
||||
barBorderRadius: 0,
|
||||
color: 'rgb(48, 191, 120)',
|
||||
},
|
||||
},
|
||||
data: equipmentAlarm,
|
||||
},
|
||||
{
|
||||
name: '总数',
|
||||
type: 'bar',
|
||||
stack: '能源告警',
|
||||
barMaxWidth: 40,
|
||||
barHight: 0,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
barBorderRadius: 0,
|
||||
color: 'rgba(0,0,0,0)',
|
||||
},
|
||||
},
|
||||
label: {
|
||||
show: true,
|
||||
color: '#000000',
|
||||
position: 'top',
|
||||
top: '10',
|
||||
formatter: function (value) {
|
||||
return (
|
||||
Number(energyAlarm[value.dataIndex]) +
|
||||
Number(wgAlarm[value.dataIndex]) +
|
||||
Number(equipmentAlarm[value.dataIndex])
|
||||
);
|
||||
},
|
||||
},
|
||||
data: total,
|
||||
},
|
||||
],
|
||||
};
|
||||
chartInstance = echarts.init(graphChart.value);
|
||||
chartInstance.setOption(option);
|
||||
};
|
||||
return {
|
||||
btnClick,
|
||||
visible,
|
||||
chartInstance,
|
||||
handleClose,
|
||||
toggle,
|
||||
graphChart,
|
||||
getChatr,
|
||||
};
|
||||
},
|
||||
},
|
||||
data: energyAlarm,
|
||||
},
|
||||
],
|
||||
};
|
||||
chartInstance = echarts.init(graphChart.value);
|
||||
chartInstance.setOption(option);
|
||||
};
|
||||
defineExpose({
|
||||
toggle,
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
@@ -280,4 +235,7 @@
|
||||
height: 35px;
|
||||
background-color: rgb(254, 118, 2);
|
||||
}
|
||||
:deep(.ant-descriptions-item-label) {
|
||||
width: 25%;
|
||||
}
|
||||
</style>
|
||||
|
@@ -8,16 +8,81 @@
|
||||
:cancel="handleClose"
|
||||
placement="right"
|
||||
@close="handleClose">
|
||||
状态
|
||||
<a-tabs>
|
||||
<a-tab-pane key="1" tab="更新状态">Content of Tab Pane 1</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="状态流程">
|
||||
<!-- <a-steps direction="vertical" :current="4">
|
||||
<template v-for="index in 4">
|
||||
<a-step>
|
||||
<template #icon>
|
||||
<img src="../../../../src/icon/status-off.svg" />
|
||||
</template>
|
||||
<template #description>
|
||||
<div
|
||||
style="
|
||||
width: 400px;
|
||||
min-height: 40px;
|
||||
background-color: #f8fafc;
|
||||
margin-left: 20px;
|
||||
border-radius: 4px; /* 设置圆角半径 */
|
||||
padding: 12px;
|
||||
">
|
||||
<div style="width: 100%; height: 40px; display: flex; position: relative">
|
||||
<a-tag style="width: 60px; height: 20px; text-align: center" color="#04d919"
|
||||
>已完成</a-tag
|
||||
>
|
||||
<div
|
||||
style="
|
||||
position: absolute;
|
||||
left: 30%;
|
||||
top: -2px;
|
||||
transform: translateX(-50%);
|
||||
color: #3a3a3a;
|
||||
"
|
||||
>李四</div
|
||||
>
|
||||
<div style="position: absolute; right: 10px; top: -2px; color: #ff7602"
|
||||
>2024-03-11 11:30:06</div
|
||||
>
|
||||
</div>
|
||||
<div style="width: 100%; color: #3a3a3a"> 工单已完成并通过验收 </div>
|
||||
</div>
|
||||
</template>
|
||||
</a-step>
|
||||
</template>
|
||||
</a-steps> -->
|
||||
<NsSteps v-bind="config" />
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
<template #footer>
|
||||
<a-button style="margin-right: 8px" type="primary" @click="createOrder">创建工单</a-button>
|
||||
<a-button type="primary" @click="btnClick">确定</a-button>
|
||||
</template>
|
||||
</ns-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { defineComponent } from 'vue';
|
||||
import { ref } from 'vue';
|
||||
import { ref, createVNode } from 'vue';
|
||||
import NsSteps from '/@/components/ns-steps.vue';
|
||||
import { NsMessage, NsModal } from '/nerv-lib/component';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
export default defineComponent({
|
||||
components: { NsSteps },
|
||||
|
||||
setup() {
|
||||
const visible = ref(false);
|
||||
const logList = ref([
|
||||
{ name: '李四', status: '2' },
|
||||
{ name: '王五', status: '4' },
|
||||
{ name: '王五', status: '3' },
|
||||
{ name: '王五', status: '1' },
|
||||
{ name: '赵六', status: '0' },
|
||||
]);
|
||||
const config = ref({
|
||||
size: logList.value.length,
|
||||
dataSource: logList.value,
|
||||
});
|
||||
const handleClose = () => {
|
||||
visible.value = false;
|
||||
};
|
||||
@@ -28,12 +93,42 @@
|
||||
console.log(data, 'data');
|
||||
visible.value = true;
|
||||
};
|
||||
const createOrder = () => {
|
||||
NsModal.confirm({
|
||||
title: '提示',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '是否创建工单',
|
||||
okText: '确认',
|
||||
okType: 'primary',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
NsModal.confirm({
|
||||
title: '提示',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '工单创建成功,工单号xxxxxxxxx',
|
||||
okText: '确认',
|
||||
okType: 'primary',
|
||||
cancelButtonProps: { style: { display: 'none' } }, // 正确设置取消按钮样式
|
||||
onOk() {
|
||||
console.log('创建工单');
|
||||
},
|
||||
});
|
||||
},
|
||||
onCancel() {
|
||||
console.log('Cancel');
|
||||
},
|
||||
});
|
||||
};
|
||||
return {
|
||||
btnClick,
|
||||
createOrder,
|
||||
visible,
|
||||
logList,
|
||||
config,
|
||||
handleClose,
|
||||
toggle,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="less"></style>
|
||||
|
@@ -130,18 +130,10 @@ export const notificationtableConfig = (look: any, status: any) => {
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'provider',
|
||||
label: '告警标题',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入告警标题关键字',
|
||||
},
|
||||
},
|
||||
{
|
||||
field: 'provider',
|
||||
label: '错误码',
|
||||
component: 'NsInputApi',
|
||||
component: 'NsInput',
|
||||
componentProps: {
|
||||
placeholder: '请输入告警错误码',
|
||||
},
|
||||
|
@@ -1,179 +0,0 @@
|
||||
<template>
|
||||
<a-table :columns="columns" :data-source="data" bordered />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, watch, ref, onMounted } from 'vue';
|
||||
import type { TableColumnType } from 'ant-design-vue';
|
||||
import { inject } from 'vue';
|
||||
|
||||
// let data: any[] = [];
|
||||
|
||||
export default defineComponent({
|
||||
name: 'EnvironmentTable',
|
||||
setup() {
|
||||
let data = ref<any[]>([]);
|
||||
let columns = ref<TableColumnType[]>([]);
|
||||
|
||||
interface PageData {
|
||||
tableList: any[];
|
||||
tableColumns: any[];
|
||||
graphList: any[];
|
||||
}
|
||||
const pageData = inject<PageData>('pageData');
|
||||
|
||||
if (!pageData) {
|
||||
throw new Error('pageData is not provided');
|
||||
}
|
||||
// 监听 pageData 的变化
|
||||
watch(
|
||||
() => pageData as PageData,
|
||||
(_newValue, _oldValue) => {
|
||||
data.value = pageData.tableList;
|
||||
|
||||
let columnA: any[] = [...column];
|
||||
columnA.push(...pageData.tableColumns);
|
||||
columns.value = columnA;
|
||||
// pageData.graphList;
|
||||
// 执行你的逻辑代码
|
||||
},
|
||||
{ deep: true },
|
||||
);
|
||||
|
||||
const getRowSpan = (dataIndex: string, record: any, data: any, dependents: string[] = []) => {
|
||||
let rowSpan = 1;
|
||||
for (let i = data.indexOf(record) + 1; i < data.length; i++) {
|
||||
let shouldMerge = true;
|
||||
for (const dependent of dependents) {
|
||||
if (data[i][dependent] !== record[dependent]) {
|
||||
shouldMerge = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (shouldMerge && data[i][dataIndex] === record[dataIndex]) {
|
||||
rowSpan++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rowSpan;
|
||||
};
|
||||
|
||||
const column: TableColumnType[] = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'key',
|
||||
customCell: (record, rowIndex) => {
|
||||
if (rowIndex == undefined) {
|
||||
return {
|
||||
rowSpan: 0,
|
||||
colSpan: 0,
|
||||
};
|
||||
}
|
||||
const rowSpan = getRowSpan('name', record, data.value);
|
||||
if (rowIndex != 0 && data.value[rowIndex - 1].key == record.key) {
|
||||
return {
|
||||
rowSpan: 0,
|
||||
colSpan: 0,
|
||||
};
|
||||
}
|
||||
return {
|
||||
rowSpan: rowSpan,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '设备名称',
|
||||
dataIndex: 'name',
|
||||
customCell: (record, rowIndex) => {
|
||||
if (rowIndex == undefined) {
|
||||
return {
|
||||
rowSpan: 0,
|
||||
colSpan: 0,
|
||||
};
|
||||
}
|
||||
const rowSpan = getRowSpan('name', record, data.value);
|
||||
if (rowIndex != 0 && data.value[rowIndex - 1].name == record.name) {
|
||||
return {
|
||||
rowSpan: 0,
|
||||
colSpan: 0,
|
||||
};
|
||||
}
|
||||
return {
|
||||
rowSpan: rowSpan,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '设备点位',
|
||||
dataIndex: 'position',
|
||||
customCell: (record, rowIndex) => {
|
||||
if (rowIndex == undefined) {
|
||||
return {
|
||||
rowSpan: 0,
|
||||
colSpan: 0,
|
||||
};
|
||||
}
|
||||
const rowSpan = getRowSpan('position', record, data.value, ['name']);
|
||||
if (
|
||||
rowIndex != 0 &&
|
||||
data.value[rowIndex - 1].name == record.name &&
|
||||
data.value[rowIndex - 1].position == record.position
|
||||
) {
|
||||
return {
|
||||
rowSpan: 0,
|
||||
colSpan: 0,
|
||||
};
|
||||
}
|
||||
return {
|
||||
rowSpan: rowSpan,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '计量单位',
|
||||
dataIndex: 'unit',
|
||||
customCell: (record, rowIndex) => {
|
||||
if (rowIndex == undefined) {
|
||||
return {
|
||||
rowSpan: 0,
|
||||
colSpan: 0,
|
||||
};
|
||||
}
|
||||
const rowSpan = getRowSpan('unit', record, data.value, ['name', 'position']);
|
||||
if (
|
||||
rowIndex != 0 &&
|
||||
data.value[rowIndex - 1].name == record.name &&
|
||||
data.value[rowIndex - 1].position == record.position &&
|
||||
data.value[rowIndex - 1].unit == record.unit
|
||||
) {
|
||||
return {
|
||||
rowSpan: 0,
|
||||
colSpan: 0,
|
||||
};
|
||||
}
|
||||
return {
|
||||
rowSpan: rowSpan,
|
||||
};
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
onMounted(() => {
|
||||
data.value = pageData.tableList;
|
||||
|
||||
let columnA: any[] = [...column];
|
||||
columnA.push(...pageData.tableColumns);
|
||||
columns.value = columnA;
|
||||
});
|
||||
return {
|
||||
data,
|
||||
column,
|
||||
columns,
|
||||
pageData,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped></style>
|
@@ -1,13 +1,13 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-table
|
||||
:columns="tableColumns"
|
||||
:columns="column"
|
||||
:data-source="data"
|
||||
bordered
|
||||
:pagination="false"
|
||||
:scroll="{ x: 2000 }">
|
||||
<template #title>
|
||||
<a-date-picker v-model:value="selectYear" picker="year" @change="changeYearData" />
|
||||
<a-date-picker v-model:value="selectYear" picker="year" @change="changeYearData" valueFormat="YYYY" />
|
||||
</template>
|
||||
</a-table>
|
||||
<a-pagination
|
||||
@@ -24,36 +24,146 @@
|
||||
import { ref } from 'vue';
|
||||
import { http } from '/nerv-lib/util/http';
|
||||
import { Pagination } from 'ant-design-vue';
|
||||
import { tableColumns } from '../config';
|
||||
import { energyConsumption } from '/@/api/carbonEmissionFactorLibrary';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
import { carbonEmission } from '/@/api/carbonEmissionFactorLibrary';
|
||||
defineOptions({
|
||||
energyType: 'CarbonEmissions', // 与页面路由name一致缓存才可生效
|
||||
components: {
|
||||
'a-pagination': Pagination,
|
||||
},
|
||||
});
|
||||
const data = ref([]);
|
||||
const selectYear = ref<Dayjs>();
|
||||
const total = ref<number>()
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
})
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
orgId.value = result;
|
||||
const fetch = (api, params = { orgId } ) => {
|
||||
return http.post(api, params);
|
||||
};
|
||||
const data = ref([]);
|
||||
const selectYear = ref<Dayjs>(dayjs( new Date().getFullYear().toString()));
|
||||
const total = ref<number>()
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
year: selectYear.value.format('YYYY'),
|
||||
orgId: orgId.value
|
||||
})
|
||||
|
||||
// 年份选择改变触发
|
||||
const changeYearData = () => {
|
||||
queryParams.value.year = selectYear.value.format('YYYY')
|
||||
queryParams.value.year = selectYear.value
|
||||
getTableList()
|
||||
}
|
||||
// 表头
|
||||
const column: TableColumnsType [] = [
|
||||
{
|
||||
title: '排放类型',
|
||||
dataIndex: 'cnValue',
|
||||
customCell: (record, rowIndex) => {
|
||||
if (rowIndex == undefined) {
|
||||
return {
|
||||
rowSpan: 0,
|
||||
colSpan: 0,
|
||||
};
|
||||
}
|
||||
const rowSpan = getRowSpan('cnValue', record, data.value);
|
||||
if (rowIndex != 0 && data.value[rowIndex - 1].name == record.name) {
|
||||
return {
|
||||
rowSpan: 0,
|
||||
colSpan: 0,
|
||||
};
|
||||
}
|
||||
return {
|
||||
rowSpan: rowSpan,
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '能源种类',
|
||||
dataIndex: 'energyType',
|
||||
},
|
||||
{
|
||||
title: '计量单位',
|
||||
dataIndex: 'unit',
|
||||
},
|
||||
{
|
||||
title: '加权平均',
|
||||
dataIndex: 'averageFactorValue',
|
||||
},
|
||||
{
|
||||
title: '全年',
|
||||
dataIndex: 'carbonYearly',
|
||||
},
|
||||
{
|
||||
title: '1月',
|
||||
dataIndex: 'jan',
|
||||
},
|
||||
{
|
||||
title: '2月',
|
||||
dataIndex: 'feb',
|
||||
},
|
||||
{
|
||||
title: '3月',
|
||||
dataIndex: 'mar',
|
||||
},
|
||||
{
|
||||
title: '4月',
|
||||
dataIndex: 'apr',
|
||||
},
|
||||
{
|
||||
title: '5月',
|
||||
dataIndex: 'may',
|
||||
},
|
||||
{
|
||||
title: '6月',
|
||||
dataIndex: 'jun',
|
||||
},
|
||||
{
|
||||
title: '7月',
|
||||
dataIndex: 'jul',
|
||||
},
|
||||
{
|
||||
title: '8月',
|
||||
dataIndex: 'aug',
|
||||
},
|
||||
{
|
||||
title: '9月',
|
||||
dataIndex: 'sep',
|
||||
},
|
||||
{
|
||||
title: '10月',
|
||||
dataIndex: 'oct',
|
||||
},
|
||||
{
|
||||
title: '11月',
|
||||
dataIndex: 'nov',
|
||||
},
|
||||
{
|
||||
title: '12月',
|
||||
dataIndex: 'dec',
|
||||
},
|
||||
];
|
||||
// 合并单元格
|
||||
const getRowSpan = (dataIndex: string, record: any, data: any, dependents: string[] = []) => {
|
||||
let rowSpan = 1;
|
||||
for (let i = data.indexOf(record) + 1; i < data.length; i++) {
|
||||
let shouldMerge = true;
|
||||
for (const dependent of dependents) {
|
||||
if (data[i][dependent] !== record[dependent]) {
|
||||
shouldMerge = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (shouldMerge && data[i][dataIndex] === record[dataIndex]) {
|
||||
rowSpan++;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return rowSpan;
|
||||
};
|
||||
// 获取表格数据
|
||||
const getTableList = () => {
|
||||
fetch(energyConsumption.pageList , queryParams.value).then((res) => {
|
||||
fetch(carbonEmission.carbonEmissionStatistics , queryParams.value).then((res) => {
|
||||
data.value = res.data.records
|
||||
total.value = res.data.total
|
||||
});
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// 能耗统计表表头
|
||||
export const tableColumns = [
|
||||
{
|
||||
title: '序号',
|
||||
@@ -78,6 +79,7 @@ export const tableColumns = [
|
||||
width: 130
|
||||
},
|
||||
];
|
||||
// 碳排速算表表头
|
||||
export const columns = [
|
||||
{
|
||||
title: '序号',
|
||||
@@ -101,8 +103,8 @@ export const columns = [
|
||||
},
|
||||
{
|
||||
title: '启用时间',
|
||||
className: 'startTime ',
|
||||
dataIndex: 'startTime ',
|
||||
className: 'startTime',
|
||||
dataIndex: 'startTime',
|
||||
},
|
||||
{
|
||||
title: '结束时间',
|
||||
@@ -120,6 +122,7 @@ export const columns = [
|
||||
width: 130
|
||||
},
|
||||
];
|
||||
// 碳排速算新增页中表头
|
||||
export const drawerColumns = [
|
||||
{
|
||||
title: '名称',
|
||||
|
@@ -16,7 +16,7 @@
|
||||
</template>
|
||||
</template>
|
||||
<template #title>
|
||||
<a-date-picker v-model:value="selectYear" picker="year" @change="changeYearData" />
|
||||
<a-date-picker v-model:value="selectYear" picker="year" @change="changeYearData" valueFormat="YYYY" />
|
||||
<div class="buttonGroup">
|
||||
<a-button type="primary" @click="addNewData">新增</a-button>
|
||||
<a-button type="primary">导入</a-button>
|
||||
@@ -54,14 +54,13 @@
|
||||
<a-input v-model:value="formState.energyType" placeholder="请输入能源种类" />
|
||||
</a-form-item>
|
||||
<a-form-item label="计量单位" name="unit">
|
||||
<a-cascader v-model:value="formState.unit" :options="options" />
|
||||
<a-cascader v-model:value="formState.unit" :options="measurementUnit" />
|
||||
</a-form-item>
|
||||
<a-form-item label="自动采集节点" name="collectionNode">
|
||||
<a-tree-select
|
||||
v-model:value="formState.collectionNode"
|
||||
:tree-line="true"
|
||||
:tree-data="treeData"
|
||||
tree-node-filter-prop="title"
|
||||
>
|
||||
</a-tree-select>
|
||||
</a-form-item>
|
||||
@@ -73,7 +72,7 @@
|
||||
</a-form-item>
|
||||
<a-form-item label="排放类型" name="emissionType" :required="isRequired">
|
||||
<a-select v-model:value="formState.emissionType" placeholder="请选择排放类型">
|
||||
<a-select-option v-for="(item, index) in emissionTypeDic" :key="index" :value="item.cnValue">
|
||||
<a-select-option v-for="(item, index) in emissionTypeDic" :key="index" :value="item.id">
|
||||
{{ item.cnValue }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
@@ -159,10 +158,11 @@
|
||||
import { Pagination,message,Modal } from 'ant-design-vue';
|
||||
import { InboxOutlined } from '@ant-design/icons-vue';
|
||||
import type { CascaderProps,TreeSelectProps,UploadChangeParam } from 'ant-design-vue';
|
||||
import type { Dayjs } from 'dayjs';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
import { http } from '/nerv-lib/util/http';
|
||||
import { tableColumns } from '../config';
|
||||
import { energyConsumption } from '/@/api/carbonEmissionFactorLibrary';
|
||||
import { energyConsumption,carbonEmissionFactorLibrary } from '/@/api/carbonEmissionFactorLibrary';
|
||||
import { group } from '/@/api/deviceManage';
|
||||
import { dict } from '/@/api';
|
||||
defineOptions({
|
||||
energyType: 'EnergyConsumption', // 与页面路由name一致缓存才可生效
|
||||
@@ -176,12 +176,13 @@
|
||||
const fetch = (api, params = { orgId } ) => {
|
||||
return http.post(api, params);
|
||||
};
|
||||
const selectYear = ref<Dayjs>();
|
||||
const selectYear = ref<Dayjs>(dayjs( new Date().getFullYear().toString()));
|
||||
const total = ref<number>()
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orgId: orgId.value,
|
||||
year: selectYear.value.format('YYYY')
|
||||
})
|
||||
const isRequired = ref(false);
|
||||
const visible = ref(false);
|
||||
@@ -217,74 +218,15 @@
|
||||
energyType: [{ required: true, message: '请输入能源种类', trigger: 'change' }],
|
||||
isComputeCarbon: [{ required: true, message: '请选择是否计算碳排', trigger: 'change' }]
|
||||
};
|
||||
// 定义计量单位级联选择的变量
|
||||
const options: CascaderProps['options'] = [
|
||||
{
|
||||
value: 'zhejiang',
|
||||
label: 'Zhejiang',
|
||||
children: [
|
||||
{
|
||||
value: 'hangzhou',
|
||||
label: 'Hangzhou',
|
||||
children: [
|
||||
{
|
||||
value: 'xihu',
|
||||
label: 'West Lake',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
value: 'jiangsu',
|
||||
label: 'Jiangsu',
|
||||
children: [
|
||||
{
|
||||
value: 'nanjing',
|
||||
label: 'Nanjing',
|
||||
children: [
|
||||
{
|
||||
value: 'zhonghuamen',
|
||||
label: 'Zhong Hua Men',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
// const options = ref([])
|
||||
// 排放类型的变量
|
||||
const emissionTypeDic = ref()
|
||||
// 计量单位的变量
|
||||
const measurementUnit = ref([])
|
||||
// 定义自动采集节点数的变量
|
||||
const treeData = ref<TreeSelectProps['treeData']>([
|
||||
{
|
||||
title: 'parent 1',
|
||||
value: 'parent 1',
|
||||
children: [
|
||||
{
|
||||
title: 'parent 1-0',
|
||||
value: 'parent 1-0',
|
||||
children: [
|
||||
{
|
||||
title: 'my leaf',
|
||||
value: 'leaf1',
|
||||
},
|
||||
{
|
||||
title: 'your leaf',
|
||||
value: 'leaf2',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'parent 1-1',
|
||||
value: 'parent 1-1',
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
const treeData = ref<TreeSelectProps['treeData']>([]);
|
||||
// 年份选择改变触发
|
||||
const changeYearData = () => {
|
||||
queryParams.value.year = selectYear.value.format('YYYY')
|
||||
queryParams.value.year = selectYear.value
|
||||
getTableList()
|
||||
}
|
||||
// 获取表格数据
|
||||
@@ -326,9 +268,19 @@
|
||||
});
|
||||
}else{
|
||||
fetch(energyConsumption.creat , formState.value).then((res) => {
|
||||
visible.value = false
|
||||
message.success('操作成功!');
|
||||
getTableList()
|
||||
if(res.data === '新增数据已存在'){
|
||||
visible.value = false
|
||||
queryParams.value = formState.value
|
||||
queryParams.value.pageNum = 1,
|
||||
queryParams.value.pageSize = 10,
|
||||
queryParams.value.orgId = orgId.value,
|
||||
queryParams.value.year = selectYear.value.format('YYYY')
|
||||
getTableList()
|
||||
}else{
|
||||
visible.value = false
|
||||
message.success('操作成功!');
|
||||
getTableList()
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
@@ -338,12 +290,34 @@
|
||||
};
|
||||
// 获取字典值
|
||||
const getDictList = () => {
|
||||
// 获取排放类型的数据
|
||||
fetch(energyConsumption.getDicList , {grp: 'EMISSION_TYPE'}).then((res) => {
|
||||
emissionTypeDic.value = res.data
|
||||
});
|
||||
// fetch(energyConsumption.getDicList , {grp: 'MEASUREMENT_UNIT'}).then((res) => {
|
||||
// options.value = res.data
|
||||
// });
|
||||
// 获取计量单位的数据
|
||||
fetch(carbonEmissionFactorLibrary.dictionaryUnitManagement, { grp: 'MEASUREMENT_UNIT'}).then((res) => {
|
||||
measurementUnit.value = res.data
|
||||
measurementUnit.value = measurementUnit.value.map(item => ({
|
||||
value: item.cnValue,
|
||||
label: item.cnValue,
|
||||
children: item.children ? item.children.map(child => ({
|
||||
value: child.cnValue,
|
||||
label: child.cnValue
|
||||
})) : []
|
||||
}));
|
||||
});
|
||||
// 获取自动采集节点的数据
|
||||
fetch(group.queryDeviceGroupTree, { energyType: 'ELECTRICITY_USAGE',orgId: orgId.value }).then((res) => {
|
||||
treeData.value = res.data
|
||||
treeData.value = treeData.value.map(item => ({
|
||||
value: item.pointName,
|
||||
label: item.pointName,
|
||||
children: item.children ? item.children.map(child => ({
|
||||
value: child.pointName,
|
||||
label: child.pointName
|
||||
})) : []
|
||||
}));
|
||||
});
|
||||
}
|
||||
// 点击新增按钮
|
||||
const addNewData = () => {
|
||||
|
@@ -20,6 +20,7 @@
|
||||
v-if="gData && gData.length > 0"
|
||||
:expanded-keys="expandedKeys"
|
||||
:auto-expand-parent="autoExpandParent"
|
||||
:selectedKeys="selectedKeys"
|
||||
:tree-data="gData"
|
||||
show-line
|
||||
@expand="onExpand"
|
||||
@@ -84,12 +85,12 @@
|
||||
>
|
||||
<a-row>
|
||||
<a-col :span="12">
|
||||
<a-form-item ref="name" label="能源种类" name="energyType">
|
||||
<a-range-picker v-model:value="formState.energyType" picker="month" style="width:200px;" />
|
||||
<a-form-item ref="name" label="日期范围" name="dateRange">
|
||||
<a-range-picker v-model:value="formState.dateRange" picker="month" valueFormat="YYYY-MM" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<a-form-item ref="name" label="排放因子" name="energyType">
|
||||
<a-form-item ref="name" label="排放因子" name="emissionFactors">
|
||||
<ns-input v-model:value="formState.emissionFactors" disabled />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
@@ -197,7 +198,8 @@
|
||||
}
|
||||
return parentKey;
|
||||
};
|
||||
const expandedKeys = ref<(string | number)[]>([]);
|
||||
const expandedKeys = ref<(string | number)[]>(['0-0']);
|
||||
const selectedKeys = ref<string[]>(['0-0-0']);
|
||||
const searchValue = ref<string>('');
|
||||
const autoExpandParent = ref<boolean>(true);
|
||||
const gData = ref<TreeProps['treeData']>(genData);
|
||||
@@ -207,9 +209,11 @@
|
||||
autoExpandParent.value = false;
|
||||
};
|
||||
// 被选中的树节点
|
||||
const onSelect = (selectedKeys: string[], info: any) => {
|
||||
const onSelect = (selectedKey: string[], info: any) => {
|
||||
selectedKeys.value = selectedKey;
|
||||
if(info.selected){
|
||||
queryParams.value.energyType = info.node.id
|
||||
statsId.value = info.node.id
|
||||
getTableList()
|
||||
}
|
||||
};
|
||||
@@ -230,10 +234,15 @@
|
||||
// 查询因子分类树数据
|
||||
const onSearchTreeData = () => {
|
||||
};
|
||||
const statsId = ref()
|
||||
// 获取因子分类树数据
|
||||
const getTreeData = () => {
|
||||
fetch(quickCalculation.carbonQuickTree).then((res) => {
|
||||
gData.value = res.data
|
||||
debugger
|
||||
queryParams.value.energyType = gData.value[0].children[0].id
|
||||
statsId.value = gData.value[0].children[0].id
|
||||
getTableList()
|
||||
});
|
||||
};
|
||||
getTreeData()
|
||||
@@ -242,7 +251,7 @@
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orgId: orgId.value,
|
||||
orgId: orgId.value
|
||||
})
|
||||
const tableData = ref([]);
|
||||
// 获取列表数据
|
||||
@@ -252,7 +261,6 @@
|
||||
total.value = res.data.total
|
||||
});
|
||||
};
|
||||
getTableList()
|
||||
// 分页器
|
||||
const onChange = (pageNumber: number,size: number) => {
|
||||
queryParams.value.pageNum = pageNumber;
|
||||
@@ -268,7 +276,8 @@
|
||||
|
||||
// 定义form表单的必填
|
||||
const rules: Record<string, Rule[]> = {
|
||||
energyType: [{ required: true, message: '请输入能源种类', trigger: 'change' }],
|
||||
dateRange: [{ required: true, message: '请选择日期范围', trigger: 'change' }],
|
||||
emissionFactors: [{ required: true, message: '请输入能源种类', trigger: 'change' }],
|
||||
};
|
||||
// 点击新增按钮
|
||||
const addNewData = () => {
|
||||
@@ -280,6 +289,7 @@
|
||||
const onSelectionChange = (selectedKeys, selectedRows) => {
|
||||
selectedRowKeys.value = selectedKeys;
|
||||
formState.value.emissionFactors = selectedRows[0].emissionFactors
|
||||
formState.value.carbonId = selectedRows[0].id
|
||||
};
|
||||
const queryData = ref({
|
||||
orgId: orgId.value,
|
||||
@@ -294,18 +304,41 @@
|
||||
};
|
||||
// 点击编辑按钮
|
||||
const editData = (record) =>{
|
||||
selectedRowKeys.value = [record.carbonId];
|
||||
formState.value.id = record.id
|
||||
formState.value.emissionFactors = record.emissionFactors
|
||||
formState.value.dateRange = [record.startTime, record.endTime];
|
||||
formState.value.carbonId = record.carbonId
|
||||
visible.value = true
|
||||
getNewTable()
|
||||
};
|
||||
// 点击确定提交
|
||||
const onSubmit = () => {
|
||||
formRef.value
|
||||
.validate()
|
||||
.then(() => {
|
||||
formState.value.statsId = statsId.value
|
||||
formState.value.startTime = formState.value.dateRange[0]
|
||||
formState.value.endTime = formState.value.dateRange[1]
|
||||
console.log('values', formState, toRaw(formState));
|
||||
fetch(quickCalculation.creat,formState.value).then((res) => {
|
||||
console.log(res);
|
||||
|
||||
});
|
||||
debugger
|
||||
if(formState.value.id){
|
||||
fetch(quickCalculation.update,formState.value).then((res) => {
|
||||
visible.value = false
|
||||
selectedRowKeys.value = [];
|
||||
formState.value = {}
|
||||
formRef.value.resetFields();
|
||||
getTableList()
|
||||
});
|
||||
}else{
|
||||
fetch(quickCalculation.creat,formState.value).then((res) => {
|
||||
visible.value = false
|
||||
selectedRowKeys.value = [];
|
||||
formState.value = {}
|
||||
formRef.value.resetFields();
|
||||
getTableList()
|
||||
});
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.log('error', error);
|
||||
@@ -334,6 +367,7 @@
|
||||
const onClose = () => {
|
||||
visible.value = false;
|
||||
selectedRowKeys.value = [];
|
||||
formState.value = {}
|
||||
formRef.value.resetFields();
|
||||
};
|
||||
</script>
|
||||
|
@@ -242,7 +242,7 @@ export const tableConfig = (orgId) => {
|
||||
fieldMap: ['manufactureBeginDate', 'manufactureEndDate'],
|
||||
componentProps: {
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
placeholder: ['设备生产开始日期', '设备生产结束日期'],
|
||||
placeholder: ['生产开始日期', '生产结束日期'],
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -252,7 +252,7 @@ export const tableConfig = (orgId) => {
|
||||
fieldMap: ['purchaseBeginDate', 'purchaseEndDate'],
|
||||
componentProps: {
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
placeholder: ['设备采购开始日期', '设备采购结束日期'],
|
||||
placeholder: ['采购开始日期', '采购结束日期'],
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -262,7 +262,7 @@ export const tableConfig = (orgId) => {
|
||||
fieldMap: ['startBeginDate', 'startEndDate'],
|
||||
componentProps: {
|
||||
valueFormat: 'YYYY-MM-DD',
|
||||
placeholder: ['设备启用开始日期', '设备启用结束日期'],
|
||||
placeholder: ['启用开始日期', '启用结束日期'],
|
||||
},
|
||||
},
|
||||
],
|
||||
|
@@ -17,6 +17,7 @@
|
||||
tableList: any[];
|
||||
tableColumns: any[];
|
||||
graphList: any[];
|
||||
XData: any[];
|
||||
}
|
||||
const pageData = inject<PageData>('pageData');
|
||||
|
||||
@@ -37,32 +38,40 @@
|
||||
|
||||
const draw = () => {
|
||||
data.value = pageData.graphList;
|
||||
let XData = pageData.XData;
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose();
|
||||
}
|
||||
chartInstance = echarts.init(graphChart.value);
|
||||
|
||||
var seriesList = [];
|
||||
var date = [];
|
||||
// var date = [];
|
||||
var legendList: string | any[] = [];
|
||||
for (let i = 0; i < data.value.length; i++) {
|
||||
date.push(data.value[i].date);
|
||||
seriesList.push({
|
||||
name: data.value[i].deviceName,
|
||||
data: data.value[i].data,
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
});
|
||||
legendList.push(data.value[i].deviceName);
|
||||
// date.push(data.value[i].date);
|
||||
|
||||
for (let j = 0; j < data.value[i].data.length; j++) {
|
||||
if (seriesList.length < j + 1) {
|
||||
seriesList.push({
|
||||
name: data.value[i].data[j].name,
|
||||
data: [data.value[i].data[j].value],
|
||||
type: 'line',
|
||||
smooth: true,
|
||||
});
|
||||
} else {
|
||||
seriesList[j].data.push(data.value[i].data[j].value);
|
||||
}
|
||||
if (legendList.length == 0 || legendList.length < j + 1) {
|
||||
legendList.push(data.value[i].data[j].name);
|
||||
}
|
||||
}
|
||||
// for (let j = 0; j < data.value[i].data.length; j++) {
|
||||
// if (seriesList.length < j + 1) {
|
||||
// seriesList.push({
|
||||
// name: data.value[i].data[j].name,
|
||||
// data: [data.value[i].data[j].value],
|
||||
// type: 'line',
|
||||
// smooth: true,
|
||||
// });
|
||||
// } else {
|
||||
// seriesList[j].data.push(data.value[i].data[j].value);
|
||||
// }
|
||||
// if (legendList.length == 0 || legendList.length < j + 1) {
|
||||
// legendList.push(data.value[i].data[j].name);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
const option = {
|
||||
legend: {
|
||||
@@ -76,7 +85,7 @@
|
||||
const date = params[0].name;
|
||||
const values = params
|
||||
.map((param: any) => {
|
||||
const unit = data.value.find((d) => d.date === date)?.unit || '';
|
||||
const unit = data.value.find((d) => d.date === date)?.devicePositionUnit || '';
|
||||
return `<tr>
|
||||
<td>${param.marker}${param.seriesName}</td>
|
||||
<td style="text-align: right;">${param.value} ${unit}</td>
|
||||
@@ -88,7 +97,7 @@
|
||||
},
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
data: date,
|
||||
data: XData,
|
||||
},
|
||||
yAxis: {
|
||||
type: 'value',
|
||||
|
@@ -12,6 +12,7 @@
|
||||
tableList: [],
|
||||
tableColumns: [],
|
||||
graphList: [],
|
||||
XData: [],
|
||||
});
|
||||
|
||||
// 使用 provide 函数来提供这个响应式对象
|
||||
|
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<graph ref="graphRef" v-if="isGraph" />
|
||||
<environment-table ref="tableRef" v-else />
|
||||
<environment-table ref="tableRef" style="width: 100%" v-else />
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
@@ -1,5 +1,10 @@
|
||||
<template>
|
||||
<a-table :columns="columns" :data-source="data" bordered />
|
||||
<a-table
|
||||
:columns="columns"
|
||||
:data-source="data"
|
||||
bordered
|
||||
style="width: 100%"
|
||||
:scroll="{ x: 2000 }" />
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
@@ -7,14 +12,14 @@
|
||||
import type { TableColumnType } from 'ant-design-vue';
|
||||
import { inject } from 'vue';
|
||||
|
||||
// let data: any[] = [];
|
||||
|
||||
export default defineComponent({
|
||||
name: 'EnvironmentTable',
|
||||
setup() {
|
||||
let data = ref<any[]>([]);
|
||||
let columns = ref<TableColumnType[]>([]);
|
||||
|
||||
let index = ref(0);
|
||||
|
||||
interface PageData {
|
||||
tableList: any[];
|
||||
tableColumns: any[];
|
||||
@@ -29,13 +34,14 @@
|
||||
watch(
|
||||
() => pageData as PageData,
|
||||
(_newValue, _oldValue) => {
|
||||
data.value = pageData.tableList;
|
||||
// data.value = pageData.tableList;
|
||||
|
||||
let columnA: any[] = [...column];
|
||||
columnA.push(...pageData.tableColumns);
|
||||
columns.value = columnA;
|
||||
// pageData.graphList;
|
||||
// 执行你的逻辑代码
|
||||
// let columnA: any[] = [...column];
|
||||
// columnA.push(...pageData.tableColumns);
|
||||
// columns.value = columnA;
|
||||
// // pageData.graphList;
|
||||
// // 执行你的逻辑代码
|
||||
init();
|
||||
},
|
||||
{ deep: true },
|
||||
);
|
||||
@@ -62,7 +68,13 @@
|
||||
const column: TableColumnType[] = [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'key',
|
||||
customRender: ({ record, index }) => {
|
||||
// 自定义单元格内容,这里返回序号
|
||||
if (index == 0 || data.value[index - 1].deviceName == record.deviceName) {
|
||||
return index + 1;
|
||||
}
|
||||
return index;
|
||||
},
|
||||
customCell: (record, rowIndex) => {
|
||||
if (rowIndex == undefined) {
|
||||
return {
|
||||
@@ -70,8 +82,8 @@
|
||||
colSpan: 0,
|
||||
};
|
||||
}
|
||||
const rowSpan = getRowSpan('name', record, data.value);
|
||||
if (rowIndex != 0 && data.value[rowIndex - 1].key == record.key) {
|
||||
const rowSpan = getRowSpan('deviceName', record, data.value);
|
||||
if (rowIndex != 0 && data.value[rowIndex - 1].deviceName == record.deviceName) {
|
||||
return {
|
||||
rowSpan: 0,
|
||||
colSpan: 0,
|
||||
@@ -82,9 +94,16 @@
|
||||
};
|
||||
},
|
||||
},
|
||||
// {
|
||||
// title: '序号',
|
||||
// customRender: (text: any) => {
|
||||
// index.value += 1;
|
||||
// return index.value;
|
||||
// },
|
||||
// },
|
||||
{
|
||||
title: '设备名称',
|
||||
dataIndex: 'name',
|
||||
dataIndex: 'deviceName',
|
||||
customCell: (record, rowIndex) => {
|
||||
if (rowIndex == undefined) {
|
||||
return {
|
||||
@@ -92,8 +111,8 @@
|
||||
colSpan: 0,
|
||||
};
|
||||
}
|
||||
const rowSpan = getRowSpan('name', record, data.value);
|
||||
if (rowIndex != 0 && data.value[rowIndex - 1].name == record.name) {
|
||||
const rowSpan = getRowSpan('deviceName', record, data.value);
|
||||
if (rowIndex != 0 && data.value[rowIndex - 1].deviceName == record.deviceName) {
|
||||
return {
|
||||
rowSpan: 0,
|
||||
colSpan: 0,
|
||||
@@ -106,7 +125,7 @@
|
||||
},
|
||||
{
|
||||
title: '设备点位',
|
||||
dataIndex: 'position',
|
||||
dataIndex: 'devicePositionName',
|
||||
customCell: (record, rowIndex) => {
|
||||
if (rowIndex == undefined) {
|
||||
return {
|
||||
@@ -114,11 +133,11 @@
|
||||
colSpan: 0,
|
||||
};
|
||||
}
|
||||
const rowSpan = getRowSpan('position', record, data.value, ['name']);
|
||||
const rowSpan = getRowSpan('devicePositionName', record, data.value, ['deviceName']);
|
||||
if (
|
||||
rowIndex != 0 &&
|
||||
data.value[rowIndex - 1].name == record.name &&
|
||||
data.value[rowIndex - 1].position == record.position
|
||||
data.value[rowIndex - 1].deviceName == record.deviceName &&
|
||||
data.value[rowIndex - 1].devicePositionName == record.devicePositionName
|
||||
) {
|
||||
return {
|
||||
rowSpan: 0,
|
||||
@@ -132,7 +151,7 @@
|
||||
},
|
||||
{
|
||||
title: '计量单位',
|
||||
dataIndex: 'unit',
|
||||
dataIndex: 'devicePositionUnit',
|
||||
customCell: (record, rowIndex) => {
|
||||
if (rowIndex == undefined) {
|
||||
return {
|
||||
@@ -140,12 +159,15 @@
|
||||
colSpan: 0,
|
||||
};
|
||||
}
|
||||
const rowSpan = getRowSpan('unit', record, data.value, ['name', 'position']);
|
||||
const rowSpan = getRowSpan('devicePositionUnit', record, data.value, [
|
||||
'deviceName',
|
||||
'devicePositionName',
|
||||
]);
|
||||
if (
|
||||
rowIndex != 0 &&
|
||||
data.value[rowIndex - 1].name == record.name &&
|
||||
data.value[rowIndex - 1].position == record.position &&
|
||||
data.value[rowIndex - 1].unit == record.unit
|
||||
data.value[rowIndex - 1].deviceName == record.deviceName &&
|
||||
data.value[rowIndex - 1].devicePositionName == record.devicePositionName &&
|
||||
data.value[rowIndex - 1].devicePositionUnit == record.devicePositionUnit
|
||||
) {
|
||||
return {
|
||||
rowSpan: 0,
|
||||
@@ -157,14 +179,26 @@
|
||||
};
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '日期',
|
||||
dataIndex: 'time',
|
||||
},
|
||||
];
|
||||
|
||||
onMounted(() => {
|
||||
const init = () => {
|
||||
index.value = 0;
|
||||
data.value = pageData.tableList;
|
||||
|
||||
let columnA: any[] = [...column];
|
||||
columnA.push(...pageData.tableColumns);
|
||||
let columnB: any[] = [];
|
||||
pageData.tableColumns.forEach((item) => {
|
||||
columnB.push({ title: item, dataIndex: item });
|
||||
});
|
||||
columnA.push(...columnB);
|
||||
columns.value = columnA;
|
||||
};
|
||||
onMounted(() => {
|
||||
init();
|
||||
});
|
||||
return {
|
||||
data,
|
||||
|
@@ -46,9 +46,6 @@
|
||||
<a-button type="primary" style="width: 100%; margin-bottom: 10px" @click="getSelect">
|
||||
查询
|
||||
</a-button>
|
||||
<a-button type="primary" style="width: 100%; margin-bottom: 10px" @click="getSelect11">
|
||||
模拟不同数据查询
|
||||
</a-button>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -60,6 +57,7 @@
|
||||
import { inject } from 'vue';
|
||||
import { http } from '/nerv-lib/util';
|
||||
import { device } from '/@/api/deviceManage';
|
||||
import { deviceMonitor } from '/@/api/monitor';
|
||||
|
||||
export default defineComponent({
|
||||
// eslint-disable-next-line vue/multi-word-component-names
|
||||
@@ -163,6 +161,7 @@
|
||||
tableList: any[];
|
||||
tableColumns: any[];
|
||||
graphList: any[];
|
||||
XData: any[];
|
||||
}
|
||||
const pageData = inject<PageData>('pageData');
|
||||
if (!pageData) {
|
||||
@@ -170,278 +169,180 @@
|
||||
}
|
||||
// 查询数据后放入pageData
|
||||
const getSelect = () => {
|
||||
pageData.tableList = [
|
||||
{
|
||||
key: '1',
|
||||
name: 'AC_002(暖通电表)',
|
||||
position: 'A 相电压',
|
||||
unit: 'V',
|
||||
date: '2023-12-01',
|
||||
'1:00': '3626',
|
||||
},
|
||||
{
|
||||
key: '1',
|
||||
name: 'AC_002(暖通电表)',
|
||||
position: 'A 相电压',
|
||||
unit: 'V',
|
||||
date: '2023-12-01',
|
||||
'1:00': '3626',
|
||||
},
|
||||
{
|
||||
key: '2',
|
||||
name: 'AC_003(照明电表)',
|
||||
position: 'A 相电压',
|
||||
unit: 'V',
|
||||
date: '2023-12-01',
|
||||
'1:00': '3626',
|
||||
},
|
||||
{
|
||||
key: '2',
|
||||
name: 'AC_003(照明电表)',
|
||||
position: 'A 相电压',
|
||||
unit: 'V',
|
||||
date: '2023-12-01',
|
||||
'1:00': '3626',
|
||||
},
|
||||
{
|
||||
key: '3',
|
||||
name: 'AC_004(给排水电表)',
|
||||
position: 'A 相电压',
|
||||
unit: 'V',
|
||||
date: '2023-12-01',
|
||||
'1:00': '3626',
|
||||
},
|
||||
];
|
||||
pageData.tableColumns = [
|
||||
{
|
||||
title: '日期',
|
||||
dataIndex: 'date',
|
||||
},
|
||||
{
|
||||
title: '1:00',
|
||||
dataIndex: '1:00',
|
||||
},
|
||||
];
|
||||
pageData.graphList = [
|
||||
{
|
||||
date: '2023-12-01 0:00',
|
||||
unit: 'V',
|
||||
data: [
|
||||
{
|
||||
name: 'AC_002(暖通电表)',
|
||||
value: '21',
|
||||
},
|
||||
{
|
||||
name: 'AC_003(照明电表)',
|
||||
value: '36',
|
||||
},
|
||||
{
|
||||
name: 'AC_004(给排水电表)',
|
||||
value: '5',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
date: '2023-12-02 0:00',
|
||||
unit: 'V',
|
||||
data: [
|
||||
{
|
||||
name: 'AC_002(暖通电表)',
|
||||
value: '26',
|
||||
},
|
||||
{
|
||||
name: 'AC_003(照明电表)',
|
||||
value: '25',
|
||||
},
|
||||
{
|
||||
name: 'AC_004(给排水电表)',
|
||||
value: '47',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
date: '2023-12-03 0:00',
|
||||
unit: 'V',
|
||||
data: [
|
||||
{
|
||||
name: 'AC_002(暖通电表)',
|
||||
value: '18',
|
||||
},
|
||||
{
|
||||
name: 'AC_003(照明电表)',
|
||||
value: '22',
|
||||
},
|
||||
{
|
||||
name: 'AC_004(给排水电表)',
|
||||
value: '26',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
date: '2023-12-04 0:00',
|
||||
unit: 'V',
|
||||
data: [
|
||||
{
|
||||
name: 'AC_002(暖通电表)',
|
||||
value: '40',
|
||||
},
|
||||
{
|
||||
name: 'AC_003(照明电表)',
|
||||
value: '15',
|
||||
},
|
||||
{
|
||||
name: 'AC_004(给排水电表)',
|
||||
value: '12',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
date: '2023-12-05 0:00',
|
||||
unit: 'V',
|
||||
data: [
|
||||
{
|
||||
name: 'AC_002(暖通电表)',
|
||||
value: '15',
|
||||
},
|
||||
{
|
||||
name: 'AC_003(照明电表)',
|
||||
value: '18',
|
||||
},
|
||||
{
|
||||
name: 'AC_004(给排水电表)',
|
||||
value: '15',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
date: '2023-12-06 0:00',
|
||||
unit: 'V',
|
||||
data: [
|
||||
{
|
||||
name: 'AC_002(暖通电表)',
|
||||
value: '15',
|
||||
},
|
||||
{
|
||||
name: 'AC_003(照明电表)',
|
||||
value: '18',
|
||||
},
|
||||
{
|
||||
name: 'AC_004(给排水电表)',
|
||||
value: '15',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
};
|
||||
// 测试查询 模拟不同数据
|
||||
const getSelect11 = () => {
|
||||
pageData.tableList = [
|
||||
{
|
||||
key: '1',
|
||||
name: 'AC_002(暖通电表)',
|
||||
position: 'A 相电压',
|
||||
unit: 'V',
|
||||
date: '2023-12-01',
|
||||
'1:00': '3626',
|
||||
'2:00': '2222',
|
||||
},
|
||||
{
|
||||
key: '1',
|
||||
name: 'AC_002(暖通电表)',
|
||||
position: 'A 相电压',
|
||||
unit: 'V',
|
||||
date: '2023-12-01',
|
||||
'1:00': '3626',
|
||||
'2:00': '2222',
|
||||
},
|
||||
{
|
||||
key: '2',
|
||||
name: 'AC_003(照明电表)',
|
||||
position: 'A 相电压',
|
||||
unit: 'V',
|
||||
date: '2023-12-01',
|
||||
'1:00': '3626',
|
||||
'2:00': '2222',
|
||||
},
|
||||
{
|
||||
key: '2',
|
||||
name: 'AC_003(照明电表)',
|
||||
position: 'A 相电压',
|
||||
unit: 'V',
|
||||
date: '2023-12-01',
|
||||
'1:00': '3626',
|
||||
'2:00': '2222',
|
||||
},
|
||||
{
|
||||
key: '3',
|
||||
name: 'AC_004(给排水电表)',
|
||||
position: 'A 相电压',
|
||||
unit: 'V',
|
||||
date: '2023-12-01',
|
||||
'1:00': '3626',
|
||||
'2:00': '2222',
|
||||
},
|
||||
];
|
||||
pageData.tableColumns = [
|
||||
{
|
||||
title: '日期',
|
||||
dataIndex: 'date',
|
||||
},
|
||||
{
|
||||
title: '1:00',
|
||||
dataIndex: '1:00',
|
||||
},
|
||||
{
|
||||
title: '2:00',
|
||||
dataIndex: '2:00',
|
||||
},
|
||||
];
|
||||
pageData.graphList = [
|
||||
{
|
||||
date: '2023-12-01 0:00',
|
||||
unit: 'V',
|
||||
data: [
|
||||
{
|
||||
name: 'AC_002(暖通电表)',
|
||||
value: '21',
|
||||
},
|
||||
{
|
||||
name: 'AC_003(照明电表)',
|
||||
value: '36',
|
||||
},
|
||||
{
|
||||
name: 'AC_004(给排水电表)',
|
||||
value: '5',
|
||||
},
|
||||
{
|
||||
name: 'AC_005(1111111)',
|
||||
value: '14',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
date: '2023-12-02 0:00',
|
||||
unit: 'V',
|
||||
data: [
|
||||
{
|
||||
name: 'AC_002(暖通电表)',
|
||||
value: '26',
|
||||
},
|
||||
{
|
||||
name: 'AC_003(照明电表)',
|
||||
value: '25',
|
||||
},
|
||||
{
|
||||
name: 'AC_004(给排水电表)',
|
||||
value: '47',
|
||||
},
|
||||
{
|
||||
name: 'AC_005(1111111)',
|
||||
value: '28',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
http
|
||||
.post(deviceMonitor.getDeviceGraph, {
|
||||
deviceIds: ['HLlmTZp8-0601-0001', 'HLlmTZp-0804-0001'],
|
||||
devicePointCode: 'ua',
|
||||
devicePointId: 32,
|
||||
endDate: '2024-07-02',
|
||||
startDate: '2024-07-01',
|
||||
timeRate: '2',
|
||||
})
|
||||
.then((res) => {
|
||||
pageData.tableList = res.data.tableList;
|
||||
pageData.tableColumns = res.data.tableHeaderList;
|
||||
|
||||
pageData.graphList = res.data.graphData;
|
||||
pageData.XData = res.data.XData;
|
||||
});
|
||||
// pageData.tableList = [
|
||||
// {
|
||||
// key: '1',
|
||||
// name: 'AC_002(暖通电表)',
|
||||
// position: 'A 相电压',
|
||||
// unit: 'V',
|
||||
// date: '2023-12-01',
|
||||
// '1:00': '3626',
|
||||
// },
|
||||
// {
|
||||
// key: '1',
|
||||
// name: 'AC_002(暖通电表)',
|
||||
// position: 'A 相电压',
|
||||
// unit: 'V',
|
||||
// date: '2023-12-01',
|
||||
// '1:00': '3626',
|
||||
// },
|
||||
// {
|
||||
// key: '2',
|
||||
// name: 'AC_003(照明电表)',
|
||||
// position: 'A 相电压',
|
||||
// unit: 'V',
|
||||
// date: '2023-12-01',
|
||||
// '1:00': '3626',
|
||||
// },
|
||||
// {
|
||||
// key: '2',
|
||||
// name: 'AC_003(照明电表)',
|
||||
// position: 'A 相电压',
|
||||
// unit: 'V',
|
||||
// date: '2023-12-01',
|
||||
// '1:00': '3626',
|
||||
// },
|
||||
// {
|
||||
// key: '3',
|
||||
// name: 'AC_004(给排水电表)',
|
||||
// position: 'A 相电压',
|
||||
// unit: 'V',
|
||||
// date: '2023-12-01',
|
||||
// '1:00': '3626',
|
||||
// },
|
||||
// ];
|
||||
// pageData.tableColumns = [
|
||||
// {
|
||||
// title: '00:00',
|
||||
// dataIndex: '00:00',
|
||||
// },
|
||||
// ];
|
||||
// pageData.graphList = [
|
||||
// {
|
||||
// date: '2023-12-01 0:00',
|
||||
// unit: 'V',
|
||||
// data: [
|
||||
// {
|
||||
// name: 'AC_002(暖通电表)',
|
||||
// value: '21',
|
||||
// },
|
||||
// {
|
||||
// name: 'AC_003(照明电表)',
|
||||
// value: '36',
|
||||
// },
|
||||
// {
|
||||
// name: 'AC_004(给排水电表)',
|
||||
// value: '5',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// date: '2023-12-02 0:00',
|
||||
// unit: 'V',
|
||||
// data: [
|
||||
// {
|
||||
// name: 'AC_002(暖通电表)',
|
||||
// value: '26',
|
||||
// },
|
||||
// {
|
||||
// name: 'AC_003(照明电表)',
|
||||
// value: '25',
|
||||
// },
|
||||
// {
|
||||
// name: 'AC_004(给排水电表)',
|
||||
// value: '47',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// date: '2023-12-03 0:00',
|
||||
// unit: 'V',
|
||||
// data: [
|
||||
// {
|
||||
// name: 'AC_002(暖通电表)',
|
||||
// value: '18',
|
||||
// },
|
||||
// {
|
||||
// name: 'AC_003(照明电表)',
|
||||
// value: '22',
|
||||
// },
|
||||
// {
|
||||
// name: 'AC_004(给排水电表)',
|
||||
// value: '26',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// date: '2023-12-04 0:00',
|
||||
// unit: 'V',
|
||||
// data: [
|
||||
// {
|
||||
// name: 'AC_002(暖通电表)',
|
||||
// value: '40',
|
||||
// },
|
||||
// {
|
||||
// name: 'AC_003(照明电表)',
|
||||
// value: '15',
|
||||
// },
|
||||
// {
|
||||
// name: 'AC_004(给排水电表)',
|
||||
// value: '12',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// date: '2023-12-05 0:00',
|
||||
// unit: 'V',
|
||||
// data: [
|
||||
// {
|
||||
// name: 'AC_002(暖通电表)',
|
||||
// value: '15',
|
||||
// },
|
||||
// {
|
||||
// name: 'AC_003(照明电表)',
|
||||
// value: '18',
|
||||
// },
|
||||
// {
|
||||
// name: 'AC_004(给排水电表)',
|
||||
// value: '15',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// date: '2023-12-06 0:00',
|
||||
// unit: 'V',
|
||||
// data: [
|
||||
// {
|
||||
// name: 'AC_002(暖通电表)',
|
||||
// value: '15',
|
||||
// },
|
||||
// {
|
||||
// name: 'AC_003(照明电表)',
|
||||
// value: '18',
|
||||
// },
|
||||
// {
|
||||
// name: 'AC_004(给排水电表)',
|
||||
// value: '15',
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// ];
|
||||
};
|
||||
|
||||
type RangeValue = [Dayjs, Dayjs];
|
||||
@@ -493,7 +394,6 @@
|
||||
dateRange,
|
||||
getDianWeiList,
|
||||
getSelect,
|
||||
getSelect11,
|
||||
disabledDate,
|
||||
onCalendarChange,
|
||||
onOpenChange,
|
||||
|
@@ -0,0 +1,36 @@
|
||||
export const tableColumns = [
|
||||
{
|
||||
title: '序号',
|
||||
customRender: (text: any) => {
|
||||
return text.index + 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '时间',
|
||||
dataIndex: 'areaName',
|
||||
},
|
||||
{
|
||||
title: '温度(℃)',
|
||||
dataIndex: 'point',
|
||||
},
|
||||
{
|
||||
title: '湿度(%)',
|
||||
dataIndex: 'date',
|
||||
},
|
||||
{
|
||||
title: 'CO2浓度(ppm)',
|
||||
dataIndex: 'areaName',
|
||||
},
|
||||
{
|
||||
title: 'PM2.5(μg/m³)',
|
||||
dataIndex: 'point',
|
||||
},
|
||||
{
|
||||
title: 'TVOC(mg/m³)',
|
||||
dataIndex: 'date',
|
||||
},
|
||||
{
|
||||
title: 'TVOC(mg/m³)',
|
||||
dataIndex: '光照度(lux)',
|
||||
},
|
||||
];
|
@@ -0,0 +1,250 @@
|
||||
<!-- eslint-disable vue/v-on-event-hyphenation -->
|
||||
<template>
|
||||
<div>
|
||||
<a-table :columns="tableColumns" :data-source="data" bordered :pagination="false">
|
||||
<template #title>
|
||||
<div
|
||||
style="display: flex; align-items: center; justify-content: space-between; width: 100%">
|
||||
<div style="display: flex; align-items: center; width: 85%">
|
||||
<div style="width: 10%">数据报表</div>
|
||||
|
||||
<a-select
|
||||
v-model:value="frequencyValue"
|
||||
placeholder="请选择频率"
|
||||
style="width: 17%; margin-left: 10px"
|
||||
:options="frequencyOptions" />
|
||||
<!-- <a-date-picker style="width: 13%; margin-left: 10px" v-model:value="timeValue" /> -->
|
||||
<a-range-picker
|
||||
:value="hackValue || dateRange"
|
||||
:disabled-date="disabledDate"
|
||||
@change="onChangeDate"
|
||||
@openChange="onOpenChange"
|
||||
@calendarChange="onCalendarChange"
|
||||
style="width: 17%; margin-left: 10px"
|
||||
:placeholder="['请选择日期', '请选择日期']" />
|
||||
<a-button type="primary" style="margin-left: 10px" @click="getSelect"> 查询 </a-button>
|
||||
</div>
|
||||
<a-button type="primary"> 导出 </a-button>
|
||||
</div>
|
||||
</template>
|
||||
</a-table>
|
||||
<a-pagination
|
||||
:current="queryParams.pageNum"
|
||||
:total="total"
|
||||
:page-size="queryParams.pageSize"
|
||||
style="display: flex; justify-content: center; margin-top: 16px"
|
||||
:show-size-changer="true"
|
||||
:show-quick-jumper="true"
|
||||
@change="onChange" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
// import { http } from '/nerv-lib/util/http';
|
||||
import { Pagination, SelectProps, TreeSelectProps, TableColumnType } from 'ant-design-vue';
|
||||
import { tableColumns } from './config';
|
||||
import type { Dayjs } from 'dayjs';
|
||||
// import { energyConsumption } from '/@/api/carbonEmissionFactorLibrary';
|
||||
defineOptions({
|
||||
energyType: 'AverageData', // 与页面路由name一致缓存才可生效
|
||||
components: {
|
||||
'a-pagination': Pagination,
|
||||
},
|
||||
});
|
||||
|
||||
const typeList = ref();
|
||||
// 采集频率
|
||||
const frequencyValue = ref<string | undefined>();
|
||||
|
||||
// 采集频率list
|
||||
const frequencyOptions = ref<SelectProps['options']>([]);
|
||||
|
||||
const treeData2 = ref<TreeSelectProps['treeData']>([]);
|
||||
const data = ref([]);
|
||||
// let tableColumns = ref<TableColumnType[]>([]);
|
||||
|
||||
const total = ref<number>();
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
orgId.value = result;
|
||||
|
||||
type RangeValue = [Dayjs, Dayjs];
|
||||
const dates = ref<RangeValue>();
|
||||
const hackValue = ref<RangeValue>();
|
||||
const dateRange = ref<[Dayjs, Dayjs] | undefined>();
|
||||
|
||||
const onChangeDate = (val: RangeValue) => {
|
||||
dateRange.value = val;
|
||||
};
|
||||
const onOpenChange = (open: boolean) => {
|
||||
if (open) {
|
||||
dates.value = [] as any;
|
||||
hackValue.value = [] as any;
|
||||
} else {
|
||||
hackValue.value = undefined;
|
||||
}
|
||||
};
|
||||
const disabledDate = (current: Dayjs) => {
|
||||
if (!dates.value || (dates.value as any).length === 0) {
|
||||
return false;
|
||||
}
|
||||
const tooLate = dates.value[0] && current.diff(dates.value[0], 'days') > 2;
|
||||
const tooEarly = dates.value[1] && dates.value[1].diff(current, 'days') > 2;
|
||||
return tooEarly || tooLate;
|
||||
};
|
||||
const onCalendarChange = (val: RangeValue) => {
|
||||
dates.value = val;
|
||||
};
|
||||
// 获取表格数据
|
||||
const getTableList = () => {
|
||||
// fetch(energyConsumption.pageList, queryParams.value).then((res) => {
|
||||
// data.value = res.data.records;
|
||||
// total.value = res.data.total;
|
||||
// });
|
||||
};
|
||||
onMounted(() => {
|
||||
frequencyOptions.value = [
|
||||
{
|
||||
value: '1',
|
||||
label: '30分钟',
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '小时',
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '天',
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '月',
|
||||
},
|
||||
{
|
||||
value: '5',
|
||||
label: '年',
|
||||
},
|
||||
];
|
||||
typeList.value = [
|
||||
{
|
||||
id: 1,
|
||||
value: '温度',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
value: 'CO2浓度',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
value: 'PM2.5',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
value: '光照度',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
value: 'TVOC',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
value: '湿度',
|
||||
},
|
||||
];
|
||||
treeData2.value = [
|
||||
{
|
||||
label: '办公区',
|
||||
value: '0-0',
|
||||
children: [
|
||||
{
|
||||
label: '办公一区',
|
||||
value: '0-0-0',
|
||||
},
|
||||
{
|
||||
label: '办公二区',
|
||||
value: '0-0-1',
|
||||
},
|
||||
{
|
||||
label: '办公三区',
|
||||
value: '0-0-2',
|
||||
},
|
||||
{
|
||||
label: '办公四区',
|
||||
value: '0-0-3',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '站厅',
|
||||
value: '0-1',
|
||||
|
||||
children: [
|
||||
{
|
||||
label: '站厅一区',
|
||||
value: '0-1-0',
|
||||
// disabled: true,
|
||||
},
|
||||
{
|
||||
label: '站厅二区',
|
||||
value: '0-1-1',
|
||||
},
|
||||
{
|
||||
label: '站厅三区',
|
||||
value: '0-1-2',
|
||||
},
|
||||
{
|
||||
label: '站厅四区',
|
||||
value: '0-1-3',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
// let tableColumnsB = [
|
||||
// {
|
||||
// title: '1:00',
|
||||
// dataIndex: '1:00',
|
||||
// },
|
||||
// {
|
||||
// title: '2:00',
|
||||
// dataIndex: '2:00',
|
||||
// },
|
||||
// {
|
||||
// title: '3:00',
|
||||
// dataIndex: '3:00',
|
||||
// },
|
||||
// {
|
||||
// title: '4:00',
|
||||
// dataIndex: '4:00',
|
||||
// },
|
||||
// ];
|
||||
// let columnA: any[] = [...tableColumnsA];
|
||||
// columnA.push(...tableColumnsB);
|
||||
// tableColumns.value = columnA;
|
||||
});
|
||||
|
||||
getTableList();
|
||||
// 分页器
|
||||
const onChange = (pageNumber: number, size: number) => {
|
||||
queryParams.value.pageNum = pageNumber;
|
||||
queryParams.value.pageSize = size;
|
||||
getTableList();
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
::v-deep .ant-table-title {
|
||||
display: flex;
|
||||
}
|
||||
::v-deep .ant-table-container {
|
||||
padding: 0px 16px;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
th.column-money,
|
||||
td.column-money {
|
||||
text-align: right !important;
|
||||
}
|
||||
</style>
|
@@ -0,0 +1,20 @@
|
||||
export const tableColumns = [
|
||||
{
|
||||
title: '序号',
|
||||
customRender: (text: any) => {
|
||||
return text.index + 1;
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '区域名称',
|
||||
dataIndex: 'areaName',
|
||||
},
|
||||
{
|
||||
title: '点位',
|
||||
dataIndex: 'point',
|
||||
},
|
||||
{
|
||||
title: '日期',
|
||||
dataIndex: 'date',
|
||||
},
|
||||
];
|
@@ -0,0 +1,243 @@
|
||||
<!-- eslint-disable vue/multi-word-component-names -->
|
||||
<template>
|
||||
<div>
|
||||
<a-table
|
||||
:columns="tableColumns"
|
||||
:data-source="data"
|
||||
bordered
|
||||
:pagination="false"
|
||||
:scroll="{ x: 100 }">
|
||||
<template #title>
|
||||
<div
|
||||
style="display: flex; align-items: center; justify-content: space-between; width: 100%">
|
||||
<div style="display: flex; align-items: center; width: 85%">
|
||||
<div style="width: 10%">数据报表</div>
|
||||
<a-select
|
||||
v-model:value="typeValue"
|
||||
placeholder="请选择环境参数"
|
||||
style="width: 15%"
|
||||
:options="typeList" />
|
||||
<a-tree-select
|
||||
v-model:value="quyuvalue"
|
||||
style="width: 15%; margin-left: 10px"
|
||||
:tree-data="treeData2"
|
||||
tree-checkable
|
||||
allow-clear
|
||||
placeholder="请选择区域"
|
||||
tree-node-filter-prop="label"
|
||||
:maxTagCount="1" />
|
||||
<a-select
|
||||
v-model:value="frequencyValue"
|
||||
placeholder="请选择采集频率"
|
||||
style="width: 15%; margin-left: 10px"
|
||||
:options="frequencyOptions" />
|
||||
<a-date-picker style="width: 15%; margin-left: 10px" v-model:value="timeValue" />
|
||||
<a-button type="primary" style="margin-left: 10px" @click="getSelect"> 查询 </a-button>
|
||||
</div>
|
||||
<a-button type="primary"> 导出 </a-button>
|
||||
</div>
|
||||
</template>
|
||||
</a-table>
|
||||
<a-pagination
|
||||
:current="queryParams.pageNum"
|
||||
:total="total"
|
||||
:page-size="queryParams.pageSize"
|
||||
style="display: flex; justify-content: center; margin-top: 16px"
|
||||
:show-size-changer="true"
|
||||
:show-quick-jumper="true"
|
||||
@change="onChange" />
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted, defineOptions } from 'vue';
|
||||
// import { http } from '/nerv-lib/util/http';
|
||||
import { Pagination, SelectProps, TreeSelectProps, TableColumnType } from 'ant-design-vue';
|
||||
import { tableColumns as tableColumnsA } from './config';
|
||||
import type { Dayjs } from 'dayjs';
|
||||
// import { energyConsumption } from '/@/api/carbonEmissionFactorLibrary';
|
||||
defineOptions({
|
||||
energyType: 'HistoryData', // 与页面路由name一致缓存才可生效
|
||||
components: {
|
||||
'a-pagination': Pagination,
|
||||
},
|
||||
});
|
||||
const typeList = ref();
|
||||
const typeValue = ref();
|
||||
const quyuvalue = ref<string[]>([]);
|
||||
// 采集频率
|
||||
const frequencyValue = ref<string | undefined>();
|
||||
|
||||
// 采集频率list
|
||||
const frequencyOptions = ref<SelectProps['options']>([]);
|
||||
|
||||
const treeData2 = ref<TreeSelectProps['treeData']>([]);
|
||||
const data = ref([]);
|
||||
const timeValue = ref<Dayjs>();
|
||||
let tableColumns = ref<TableColumnType[]>([]);
|
||||
|
||||
const total = ref<number>();
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
});
|
||||
const orgId = ref('');
|
||||
const result = JSON.parse(sessionStorage.getItem('ORGID')!);
|
||||
orgId.value = result;
|
||||
// const fetch = (api, params = { orgId }) => {
|
||||
// return http.post(api, params);
|
||||
// };
|
||||
|
||||
// 年份选择改变触发
|
||||
// const changeYearData = () => {
|
||||
// queryParams.value.year = selectYear.value.format('YYYY');
|
||||
// getTableList();
|
||||
// };
|
||||
// 获取表格数据
|
||||
const getTableList = () => {
|
||||
// fetch(energyConsumption.pageList, queryParams.value).then((res) => {
|
||||
// data.value = res.data.records;
|
||||
// total.value = res.data.total;
|
||||
// });
|
||||
};
|
||||
onMounted(() => {
|
||||
frequencyOptions.value = [
|
||||
{
|
||||
value: '1',
|
||||
label: '5分钟',
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
label: '10分钟',
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
label: '30分钟',
|
||||
},
|
||||
{
|
||||
value: '4',
|
||||
label: '1小时',
|
||||
},
|
||||
{
|
||||
value: '5',
|
||||
label: '天',
|
||||
},
|
||||
];
|
||||
typeList.value = [
|
||||
{
|
||||
id: 1,
|
||||
value: '温度',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
value: 'CO2浓度',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
value: 'PM2.5',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
value: '光照度',
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
value: 'TVOC',
|
||||
},
|
||||
{
|
||||
id: 6,
|
||||
value: '湿度',
|
||||
},
|
||||
];
|
||||
treeData2.value = [
|
||||
{
|
||||
label: '办公区',
|
||||
value: '0-0',
|
||||
children: [
|
||||
{
|
||||
label: '办公一区',
|
||||
value: '0-0-0',
|
||||
},
|
||||
{
|
||||
label: '办公二区',
|
||||
value: '0-0-1',
|
||||
},
|
||||
{
|
||||
label: '办公三区',
|
||||
value: '0-0-2',
|
||||
},
|
||||
{
|
||||
label: '办公四区',
|
||||
value: '0-0-3',
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: '站厅',
|
||||
value: '0-1',
|
||||
|
||||
children: [
|
||||
{
|
||||
label: '站厅一区',
|
||||
value: '0-1-0',
|
||||
// disabled: true,
|
||||
},
|
||||
{
|
||||
label: '站厅二区',
|
||||
value: '0-1-1',
|
||||
},
|
||||
{
|
||||
label: '站厅三区',
|
||||
value: '0-1-2',
|
||||
},
|
||||
{
|
||||
label: '站厅四区',
|
||||
value: '0-1-3',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
let tableColumnsB = [
|
||||
{
|
||||
title: '1:00',
|
||||
dataIndex: '1:00',
|
||||
},
|
||||
{
|
||||
title: '2:00',
|
||||
dataIndex: '2:00',
|
||||
},
|
||||
{
|
||||
title: '3:00',
|
||||
dataIndex: '3:00',
|
||||
},
|
||||
{
|
||||
title: '4:00',
|
||||
dataIndex: '4:00',
|
||||
},
|
||||
];
|
||||
let columnA: any[] = [...tableColumnsA];
|
||||
columnA.push(...tableColumnsB);
|
||||
tableColumns.value = columnA;
|
||||
});
|
||||
|
||||
getTableList();
|
||||
// 分页器
|
||||
const onChange = (pageNumber: number, size: number) => {
|
||||
queryParams.value.pageNum = pageNumber;
|
||||
queryParams.value.pageSize = size;
|
||||
getTableList();
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
::v-deep .ant-table-title {
|
||||
display: flex;
|
||||
}
|
||||
::v-deep .ant-table-container {
|
||||
padding: 0px 16px;
|
||||
}
|
||||
</style>
|
||||
<style scoped>
|
||||
th.column-money,
|
||||
td.column-money {
|
||||
text-align: right !important;
|
||||
}
|
||||
</style>
|
@@ -4,14 +4,16 @@
|
||||
<a-tab-pane key="2" tab="历史数据" force-render>Content of Tab Pane 2</a-tab-pane>
|
||||
<a-tab-pane key="3" tab="平均数据">Content of Tab Pane 3</a-tab-pane>
|
||||
</a-tabs>
|
||||
<!-- <ns-view-list-table v-bind="tableConfig" v-if="activeKey == '1'" /> -->
|
||||
|
||||
<aggregate-data ref="aggregateDataRef" v-if="activeKey == '1'" style="height: 85%" />
|
||||
<history-data v-if="activeKey == '2'" />
|
||||
<average-data v-if="activeKey == '3'" />
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue';
|
||||
import { tableConfig } from './config';
|
||||
import aggregateData from './aggregateData/index.vue';
|
||||
import historyData from './historyData/index.vue';
|
||||
import averageData from './averageData/index.vue';
|
||||
|
||||
const aggregateDataRef = ref();
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
@select="SelectApartmentTree">
|
||||
<template #title="data">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||
<span>{{ data.deptInfo?.deptName }}</span>
|
||||
<span class="treeContent">{{ data.deptInfo?.deptName }}</span>
|
||||
<a-dropdown>
|
||||
<ns-icon name="actionMore" size="14" class="actionMore" />
|
||||
<template #overlay>
|
||||
@@ -96,7 +96,7 @@
|
||||
@select="SelectUserTree">
|
||||
<template #title="data">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center">
|
||||
<span> {{ data.zhName }}</span>
|
||||
<span class="treeContent"> {{ data.zhName }}</span>
|
||||
<a-dropdown>
|
||||
<ns-icon name="actionMore" size="14" class="actionMore" />
|
||||
<template #overlay>
|
||||
@@ -495,11 +495,13 @@
|
||||
formData.value = {};
|
||||
opMap.type = '';
|
||||
opMap.fuc = '';
|
||||
disabled.value = true;
|
||||
};
|
||||
const clearRoleData = () => {
|
||||
roleFormData.value = {};
|
||||
opMap.type = '';
|
||||
opMap.fuc = '';
|
||||
roleDisabled.value = true;
|
||||
};
|
||||
|
||||
// 部门权限选择
|
||||
@@ -623,7 +625,8 @@
|
||||
|
||||
// 部门切换需要调整角色tab
|
||||
roleActiveKey.value = 1;
|
||||
|
||||
// 需要重置数据
|
||||
clearDeptData();
|
||||
const { selected } = info;
|
||||
if (!selectedKeys?.length) return;
|
||||
|
||||
@@ -633,6 +636,7 @@
|
||||
// 确定是否是企业
|
||||
if (!selectRef.value.hasOwnProperty('own') && !selectRef.value.hasOwnProperty('orgInfo')) {
|
||||
// 部门
|
||||
formRef.value?.reset();
|
||||
formData.value = cloneDeep(info.node.dataRef.deptInfo);
|
||||
} else {
|
||||
activeKey.value = 1;
|
||||
@@ -672,10 +676,13 @@
|
||||
const SelectUserTree = (selectedKeys: any, info: any) => {
|
||||
const { selected } = info;
|
||||
// roleDisabled.value = !selected;
|
||||
|
||||
// 重置原操作逻辑
|
||||
clearRoleData();
|
||||
if (!selectedKeys?.length) return;
|
||||
roleTreeSelectedKeys.value = [info.node.key];
|
||||
selectRoleRef.value = info.node.dataRef;
|
||||
formRoleRef.value?.reset();
|
||||
|
||||
roleFormData.value = cloneDeep(info.node.dataRef);
|
||||
roleCheckedKeys.value = [];
|
||||
if (selectRoleRef.value?.proleId) {
|
||||
@@ -819,6 +826,7 @@
|
||||
border-radius: @ns-border-radius;
|
||||
border: 1px solid #ebeef5;
|
||||
padding: 16px;
|
||||
min-width: 100px;
|
||||
}
|
||||
.list {
|
||||
padding-left: @ns-gap;
|
||||
@@ -863,4 +871,10 @@
|
||||
.form {
|
||||
margin: 20px;
|
||||
}
|
||||
|
||||
.treeContent {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
text-wrap: nowrap;
|
||||
}
|
||||
</style>
|
||||
|
@@ -343,22 +343,23 @@
|
||||
customRender: (text: any) => {
|
||||
return text.index + 1;
|
||||
},
|
||||
sorter: true,
|
||||
textNumber: 3,
|
||||
// sorter: true,
|
||||
},
|
||||
{
|
||||
title: '账号',
|
||||
dataIndex: 'accountNo',
|
||||
sorter: true,
|
||||
// sorter: true,
|
||||
},
|
||||
{
|
||||
title: '姓名',
|
||||
dataIndex: 'realName',
|
||||
sorter: true,
|
||||
// sorter: true,
|
||||
},
|
||||
{
|
||||
title: '性别',
|
||||
dataIndex: 'sex',
|
||||
sorter: true,
|
||||
// sorter: true,
|
||||
textNumber: 4,
|
||||
},
|
||||
{
|
||||
|
@@ -37,9 +37,11 @@
|
||||
</template>
|
||||
</ns-form-item>
|
||||
</template>
|
||||
|
||||
<!-- space-between兼容 -->
|
||||
<a-col
|
||||
v-if="
|
||||
showAction
|
||||
getFormClass.justify === 'space-between' && showAction
|
||||
? expandRef && getSchema.length % splitNumber === 0
|
||||
: (getSchema.length + 1) % splitNumber === 0
|
||||
"
|
||||
|
@@ -12,7 +12,7 @@ export const formProps = {
|
||||
},
|
||||
model: PropTypes.object.def(() => reactive({})),
|
||||
loading: PropTypes.bool.def(false),
|
||||
formLayout: PropTypes.string.def('flex'),
|
||||
formLayout: PropTypes.string.def('flexv2'),
|
||||
expand: PropTypes.bool.def(true),
|
||||
showExpand: PropTypes.bool.def(false),
|
||||
// 收起全部
|
||||
|
@@ -10,7 +10,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="min-height: 300px; overflow-y: scroll">
|
||||
<div style="min-height: 150px; overflow-y: scroll">
|
||||
<ns-tree v-if="treeData?.length" v-bind="getBindValue" v-model:selectedKeys="selectedKeys">
|
||||
<template #[item]="data" v-for="(item, index) in Object.keys($slots)" :key="index">
|
||||
<slot :name="item" v-bind="{ ...data, formModel } || {}"></slot>
|
||||
@@ -138,9 +138,9 @@
|
||||
font-weight: bold;
|
||||
user-select: text;
|
||||
padding: @gap;
|
||||
margin-bottom: @gap;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #e9e9e9;
|
||||
// margin-bottom: @gap;
|
||||
// padding-bottom: 10px;
|
||||
// border-bottom: 1px solid #e9e9e9;
|
||||
|
||||
> span {
|
||||
padding-left: 6px;
|
||||
|
@@ -35,13 +35,14 @@ export const formConfig = {
|
||||
},
|
||||
flexv2: {
|
||||
// layout: 'horizontal',
|
||||
class: 'ns-flex-form ns-flex-form-horizontal',
|
||||
wrapperCol: { span: 16 },
|
||||
class: 'ns-flex-form ns-flex-form-horizontal ns-flexv2-form',
|
||||
wrapperCol: { span: 24 },
|
||||
labelCol: { span: 0 },
|
||||
span: 6,
|
||||
sm: 8, //≥576px <=768
|
||||
lg: 6, //>= 768
|
||||
gutter: [16, 16],
|
||||
justify: 'space-between',
|
||||
// sm: 8, //≥576px <=768
|
||||
// lg: 6, //>= 768
|
||||
gutter: [20, 0],
|
||||
justify: 'flex-start',
|
||||
},
|
||||
flexVertical: {
|
||||
layout: 'vertical',
|
||||
|
Reference in New Issue
Block a user