|
@@ -0,0 +1,553 @@
|
|
|
+<template>
|
|
|
+ <div class="health-6">
|
|
|
+ <div class="header-info mg-b-16">
|
|
|
+ <div class="selections">
|
|
|
+ <div
|
|
|
+ class="item"
|
|
|
+ @click="tabSelect('1')"
|
|
|
+ :class="{ active: type === '1' }"
|
|
|
+ >
|
|
|
+ <i class="svg-icon svg-icon-sm">
|
|
|
+ <svg-icon :svgid="'svg-wind-site'" />
|
|
|
+ </i>
|
|
|
+ <span>风场</span>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="item"
|
|
|
+ @click="tabSelect('2')"
|
|
|
+ :class="{ active: type === '2' }"
|
|
|
+ >
|
|
|
+ <i class="svg-icon svg-icon-sm">
|
|
|
+ <svg-icon :svgid="'svg-h-project'" />
|
|
|
+ </i>
|
|
|
+ <span>项目</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="state" v-if="false">
|
|
|
+ <div class="state-item green">
|
|
|
+ <div class="dot"></div>
|
|
|
+ <div class="text">良好数量:</div>
|
|
|
+ <div class="value">999</div>
|
|
|
+ </div>
|
|
|
+ <div class="state-item purple">
|
|
|
+ <div class="dot"></div>
|
|
|
+ <div class="text">正常数量:</div>
|
|
|
+ <div class="value">999</div>
|
|
|
+ </div>
|
|
|
+ <div class="state-item yellow">
|
|
|
+ <div class="dot"></div>
|
|
|
+ <div class="text">注意数量:</div>
|
|
|
+ <div class="value">999</div>
|
|
|
+ </div>
|
|
|
+ <div class="state-item orange">
|
|
|
+ <div class="dot"></div>
|
|
|
+ <div class="text">严重数量:</div>
|
|
|
+ <div class="value">999</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <row :type="'flex'" class="mg-b-16">
|
|
|
+ <Col :span="12">
|
|
|
+ <panel :title="'报警统计图'" :showLine="false">
|
|
|
+ <dual-pie-chart
|
|
|
+ :innerData="healPieData"
|
|
|
+ :outerData="healPieData"
|
|
|
+ :height="'150px'"
|
|
|
+ />
|
|
|
+ </panel>
|
|
|
+ </Col>
|
|
|
+ <Col :span="12">
|
|
|
+ <panel :title="'故障统计图'" :showLine="false">
|
|
|
+ <dual-pie-chart
|
|
|
+ :innerData="stopPieData"
|
|
|
+ :outerData="stopPieData"
|
|
|
+ :height="'150px'"
|
|
|
+ />
|
|
|
+ </panel>
|
|
|
+ </Col>
|
|
|
+ <!-- <Col :span="16">
|
|
|
+ <panel :title="'矩阵'" :showLine="false">
|
|
|
+ <div class="matrix">
|
|
|
+ <div class="item green">1号</div>
|
|
|
+ <div class="item purple">2号</div>
|
|
|
+ <div class="item orange">3号</div>
|
|
|
+ <div class="item" v-for="index of 150" :key="index">{{ index + 3 }}号</div>
|
|
|
+ <div class="blank" v-for="index of 30" :key="index"></div>
|
|
|
+ </div>
|
|
|
+ </panel>
|
|
|
+ </Col> -->
|
|
|
+ </row>
|
|
|
+ <div class="mg-b-16">
|
|
|
+ <panel :title="'健康状态占比'" :showLine="false">
|
|
|
+ <bar-line-chart
|
|
|
+ :bardata="barData"
|
|
|
+ :lineData="[]"
|
|
|
+ :height="'390px'"
|
|
|
+ :pageSize="10"
|
|
|
+ />
|
|
|
+ </panel>
|
|
|
+ </div>
|
|
|
+ <div class="mg-b-16 curStyle">
|
|
|
+ <panel :title="'健康趋势'" :showLine="false">
|
|
|
+ <MultipleLineChart :list="statusData" :units="['']" :height="'150px'" />
|
|
|
+ </panel>
|
|
|
+ <div class="selections">
|
|
|
+ <div
|
|
|
+ class="item"
|
|
|
+ @click="changeStatus('1')"
|
|
|
+ :class="{ green: status === '1' }"
|
|
|
+ >
|
|
|
+ 良好
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="item"
|
|
|
+ @click="changeStatus('2')"
|
|
|
+ :class="{ green: status === '2' }"
|
|
|
+ >
|
|
|
+ 注意
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import BarLineChart from "@/components/chart/combination/bar-line-chart.vue";
|
|
|
+import MultipleLineChart from "@/components/chart/line/double-line-chart.vue";
|
|
|
+import DualPieChart from "@/components/chart/pie/dual-pie-chart.vue";
|
|
|
+import Col from "@/components/coms/grid/col.vue";
|
|
|
+import Row from "@/components/coms/grid/row.vue";
|
|
|
+import SvgIcon from "@/components/coms/icon/svg-icon.vue";
|
|
|
+import Panel from "@/components/coms/panel/panel.vue";
|
|
|
+import api from "@api/wisdomOverhaul/health/index.js";
|
|
|
+export default {
|
|
|
+ name: "overview",
|
|
|
+ setup() {},
|
|
|
+ components: {
|
|
|
+ SvgIcon,
|
|
|
+ Panel,
|
|
|
+ MultipleLineChart,
|
|
|
+ BarLineChart,
|
|
|
+ Row,
|
|
|
+ Col,
|
|
|
+ DualPieChart,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ type: "2",
|
|
|
+ status: "1",
|
|
|
+ healPieData: [],
|
|
|
+ stopPieData: [],
|
|
|
+ statusData: [],
|
|
|
+ barData: {
|
|
|
+ area: [],
|
|
|
+ legend: [],
|
|
|
+ data: [],
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.requestData();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ requestData() {
|
|
|
+ this.getWpwarn();
|
|
|
+ this.getStop();
|
|
|
+ this.getWpOrProStatus();
|
|
|
+ this.getStatus();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取健康走势图
|
|
|
+ getWpwarn() {
|
|
|
+ api
|
|
|
+ .healthoperationCountWpwarn({
|
|
|
+ type: this.type,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ let healPieData = [];
|
|
|
+
|
|
|
+ res.data.forEach((ele) => {
|
|
|
+ healPieData.push({
|
|
|
+ value: ele.value,
|
|
|
+ unit: "次",
|
|
|
+ name: ele.name,
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ this.healPieData = healPieData;
|
|
|
+ });
|
|
|
+
|
|
|
+ // let that = this;
|
|
|
+ // that.API.requestData({
|
|
|
+ // method: "POST",
|
|
|
+ // subUrl: "healthoperation/countWpwarn",
|
|
|
+ // data: {
|
|
|
+ // type: that.type,
|
|
|
+ // },
|
|
|
+ // success(res) {
|
|
|
+ // let healPieData = [];
|
|
|
+
|
|
|
+ // res.data.forEach((ele) => {
|
|
|
+ // healPieData.push({
|
|
|
+ // value: ele.value,
|
|
|
+ // unit: "次",
|
|
|
+ // name: ele.name,
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+
|
|
|
+ // that.healPieData = healPieData;
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取故障统计图
|
|
|
+ getStop() {
|
|
|
+ api
|
|
|
+ .healthoperationCountStop({
|
|
|
+ type: this.type,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ let stopPieData = [];
|
|
|
+
|
|
|
+ res.data.forEach((ele) => {
|
|
|
+ stopPieData.push({
|
|
|
+ value: ele.value,
|
|
|
+ unit: "次",
|
|
|
+ name: ele.name,
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ this.stopPieData = stopPieData;
|
|
|
+ });
|
|
|
+
|
|
|
+ // let that = this;
|
|
|
+ // that.API.requestData({
|
|
|
+ // method: "POST",
|
|
|
+ // subUrl: "healthoperation/countStop",
|
|
|
+ // data: {
|
|
|
+ // type: that.type,
|
|
|
+ // },
|
|
|
+ // success(res) {
|
|
|
+ // let stopPieData = [];
|
|
|
+
|
|
|
+ // res.data.forEach((ele) => {
|
|
|
+ // stopPieData.push({
|
|
|
+ // value: ele.value,
|
|
|
+ // unit: "次",
|
|
|
+ // name: ele.name,
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+
|
|
|
+ // that.stopPieData = stopPieData;
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取健康状态占比
|
|
|
+ getWpOrProStatus() {
|
|
|
+ api
|
|
|
+ .healthoperationCountWpOrProStatus({
|
|
|
+ type: this.type,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ let barData = {
|
|
|
+ area: res.data.name,
|
|
|
+ legend: ["良好数量", "合格数量", "注意数量", "严重数量"],
|
|
|
+ data: [],
|
|
|
+ };
|
|
|
+
|
|
|
+ barData.data.push(
|
|
|
+ res.data.lhList,
|
|
|
+ res.data.hgList,
|
|
|
+ res.data.zyList,
|
|
|
+ res.data.yzList
|
|
|
+ );
|
|
|
+
|
|
|
+ this.barData = barData;
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取健康状态
|
|
|
+ getStatus() {
|
|
|
+ api
|
|
|
+ .healthoperationFindWpOrProStatusForHistory({
|
|
|
+ type: this.type,
|
|
|
+ status: this.status,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ let statusData = [];
|
|
|
+
|
|
|
+ const time = res.data.time;
|
|
|
+ for (let key in res.data) {
|
|
|
+ if (key !== "name" && key !== "time") {
|
|
|
+ let item = res.data[key];
|
|
|
+
|
|
|
+ let statusItem = {
|
|
|
+ title: res.data.name[0][key],
|
|
|
+ smooth: true,
|
|
|
+ value: [],
|
|
|
+ };
|
|
|
+
|
|
|
+ time.forEach((text, index) => {
|
|
|
+ statusItem.value.push({
|
|
|
+ text: text,
|
|
|
+ value: item[index],
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ statusData.push(statusItem);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ this.statusData = statusData;
|
|
|
+ });
|
|
|
+
|
|
|
+ // let that = this;
|
|
|
+ // that.API.requestData({
|
|
|
+ // method: "POST",
|
|
|
+ // subUrl: "healthoperation/findWpOrProStatusForHistory",
|
|
|
+ // data: {
|
|
|
+ // type: that.type,
|
|
|
+ // status: that.status,
|
|
|
+ // },
|
|
|
+ // success(res) {
|
|
|
+ // let statusData = [];
|
|
|
+
|
|
|
+ // const time = res.data.time;
|
|
|
+ // for (let key in res.data) {
|
|
|
+ // if (key !== "name" && key !== "time") {
|
|
|
+ // let item = res.data[key];
|
|
|
+
|
|
|
+ // let statusItem = {
|
|
|
+ // title: res.data.name[0][key],
|
|
|
+ // smooth: true,
|
|
|
+ // value: [],
|
|
|
+ // };
|
|
|
+
|
|
|
+ // time.forEach((text, index) => {
|
|
|
+ // statusItem.value.push({
|
|
|
+ // text: text,
|
|
|
+ // value: item[index],
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+
|
|
|
+ // statusData.push(statusItem);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // that.statusData = statusData;
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ },
|
|
|
+
|
|
|
+ tabSelect(type) {
|
|
|
+ this.type = type;
|
|
|
+ this.requestData();
|
|
|
+ },
|
|
|
+
|
|
|
+ changeStatus(status) {
|
|
|
+ this.status = status;
|
|
|
+ this.getStatus();
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less">
|
|
|
+.health-6 {
|
|
|
+ .curStyle {
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ .selections {
|
|
|
+ position: absolute;
|
|
|
+ display: flex;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ width: 50%;
|
|
|
+ justify-content: flex-end;
|
|
|
+ color: @gray;
|
|
|
+ .item {
|
|
|
+ margin-right: 15px;
|
|
|
+ cursor: pointer;
|
|
|
+ // flex: 0 0 80px;
|
|
|
+ // text-align: center;
|
|
|
+ // line-height: 33px;
|
|
|
+ // margin-right: 8px;
|
|
|
+ // color: @font-color;
|
|
|
+ // font-size: @fontsize-s;
|
|
|
+ // background: fade(@gray, 20);
|
|
|
+ // border: 1px solid fade(@gray, 20);
|
|
|
+ // display: flex;
|
|
|
+ // justify-content: center;
|
|
|
+ // align-items: center;
|
|
|
+ // cursor: pointer;
|
|
|
+ .green {
|
|
|
+ color: @green;
|
|
|
+ }
|
|
|
+ &:hover,
|
|
|
+ &.active {
|
|
|
+ // background: fade(@green, 20);
|
|
|
+ // border: 1px solid @green;
|
|
|
+ color: @green;
|
|
|
+ // cursor: pointer;
|
|
|
+
|
|
|
+ i svg use {
|
|
|
+ fill: @green;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .header-info {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .selections {
|
|
|
+ display: flex;
|
|
|
+ flex: 0 0 200px;
|
|
|
+
|
|
|
+ .item {
|
|
|
+ flex: 0 0 80px;
|
|
|
+ text-align: center;
|
|
|
+ height: 33px;
|
|
|
+ line-height: 33px;
|
|
|
+ margin-right: 8px;
|
|
|
+ color: @font-color;
|
|
|
+ font-size: @fontsize-s;
|
|
|
+ background: fade(@gray, 20);
|
|
|
+ border: 1px solid fade(@gray, 20);
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ i {
|
|
|
+ margin-right: 8px;
|
|
|
+
|
|
|
+ svg use {
|
|
|
+ fill: @gray;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &:hover,
|
|
|
+ &.active {
|
|
|
+ background: fade(@green, 20);
|
|
|
+ border: 1px solid @green;
|
|
|
+ color: @green;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ i svg use {
|
|
|
+ fill: @green;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .state {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ .state-item {
|
|
|
+ display: flex;
|
|
|
+ height: 32px;
|
|
|
+ align-items: center;
|
|
|
+ .dot {
|
|
|
+ width: 8px;
|
|
|
+ height: 8px;
|
|
|
+ margin-right: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .text {
|
|
|
+ margin-left: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .value {
|
|
|
+ height: 32px;
|
|
|
+ line-height: 32px;
|
|
|
+ background: fade(@gray, 20);
|
|
|
+ padding: 0 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.green {
|
|
|
+ .dot {
|
|
|
+ background: @green;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.purple {
|
|
|
+ .dot {
|
|
|
+ background: @purple;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.yellow {
|
|
|
+ .dot {
|
|
|
+ background: @yellow;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ &.orange {
|
|
|
+ .dot {
|
|
|
+ background: @orange;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ & + .state-item {
|
|
|
+ margin-left: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .matrix {
|
|
|
+ display: flex;
|
|
|
+ flex-wrap: wrap;
|
|
|
+
|
|
|
+ .item {
|
|
|
+ flex: 1 0 calc(100% / 20 - 4px);
|
|
|
+ line-height: 26px;
|
|
|
+ background: fade(@gray, 20);
|
|
|
+ color: @gray-l;
|
|
|
+ font-size: 12px;
|
|
|
+ margin-bottom: 4px;
|
|
|
+ text-align: center;
|
|
|
+ border: 1px solid transparent;
|
|
|
+
|
|
|
+ & + .item {
|
|
|
+ margin-left: 4px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &:nth-child(20n + 1) {
|
|
|
+ margin-left: 0px;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.green {
|
|
|
+ color: @green;
|
|
|
+ background: fade(@green, 20);
|
|
|
+ border-color: @green;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.purple {
|
|
|
+ color: @purple;
|
|
|
+ background: fade(@purple, 20);
|
|
|
+ border-color: @purple;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.orange {
|
|
|
+ color: @orange;
|
|
|
+ background: fade(@orange, 20);
|
|
|
+ border-color: @orange;
|
|
|
+ }
|
|
|
+
|
|
|
+ &.red {
|
|
|
+ color: @red;
|
|
|
+ background: fade(@red, 20);
|
|
|
+ border-color: @red;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .blank {
|
|
|
+ flex: 1 0 calc(100% / 20 - 4px);
|
|
|
+ margin-left: 4px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|