|
@@ -15,7 +15,7 @@
|
|
|
<span>项目</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="state">
|
|
|
+ <div class="state" v-if="false">
|
|
|
<div class="state-item green">
|
|
|
<div class="dot "></div>
|
|
|
<div class="text">良好数量:</div>
|
|
@@ -39,12 +39,17 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<row :type="'flex'" class="mg-b-16">
|
|
|
- <Col :span="8">
|
|
|
+ <Col :span="12">
|
|
|
<panel :title="'健康走势图'" :showLine="false">
|
|
|
- <dual-pie-chart :height="'250px'" />
|
|
|
+ <dual-pie-chart :innerData="healPieData" :outerData="healPieData" :height="'250px'" />
|
|
|
</panel>
|
|
|
</Col>
|
|
|
- <Col :span="16">
|
|
|
+ <Col :span="12">
|
|
|
+ <panel :title="'故障统计图'" :showLine="false">
|
|
|
+ <dual-pie-chart :innerData="stopPieData" :outerData="stopPieData" :height="'250px'" />
|
|
|
+ </panel>
|
|
|
+ </Col>
|
|
|
+ <!-- <Col :span="16">
|
|
|
<panel :title="'矩阵'" :showLine="false">
|
|
|
<div class="matrix">
|
|
|
<div class="item green">1号</div>
|
|
@@ -54,24 +59,32 @@
|
|
|
<div class="blank" v-for="index of 30" :key="index"></div>
|
|
|
</div>
|
|
|
</panel>
|
|
|
- </Col>
|
|
|
+ </Col> -->
|
|
|
</row>
|
|
|
<div class="mg-b-16">
|
|
|
- <panel :title="'健康走势图'" :showLine="false">
|
|
|
- <bar-line-chart :lineData="[]" :height="'250px'" />
|
|
|
+ <panel :title="'健康状态占比'" :showLine="false">
|
|
|
+ <bar-line-chart :bardata="barData" :lineData="[]" :height="'250px'" />
|
|
|
</panel>
|
|
|
</div>
|
|
|
- <div class="mg-b-16">
|
|
|
- <panel :title="'健康走势图'" :showLine="false">
|
|
|
- <normal-line-chart :height="'250px'" />
|
|
|
+ <div class="mg-b-16 curStyle">
|
|
|
+ <panel :title="'健康状态'" :showLine="false">
|
|
|
+ <MultipleLineChart :height="'250px'" />
|
|
|
</panel>
|
|
|
+ <div class="selections">
|
|
|
+ <div class="item" @click="changeStatus('1')" :class="{ active: status === '1' }">
|
|
|
+ <span>良好</span>
|
|
|
+ </div>
|
|
|
+ <div class="item" @click="changeStatus('2')" :class="{ active: status === '2' }">
|
|
|
+ <span>注意</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import BarLineChart from "../../components/chart/combination/bar-line-chart.vue";
|
|
|
-import NormalLineChart from "../../components/chart/line/normal-line-chart.vue";
|
|
|
+import MultipleLineChart from "../../components/chart/line/multiple-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";
|
|
@@ -79,22 +92,192 @@ import SvgIcon from "../../components/coms/icon/svg-icon.vue";
|
|
|
import Panel from "../../components/coms/panel/panel.vue";
|
|
|
export default {
|
|
|
setup() {},
|
|
|
- components: { SvgIcon, Panel, NormalLineChart, BarLineChart, Row, Col, DualPieChart },
|
|
|
+ components: { SvgIcon, Panel, MultipleLineChart, BarLineChart, Row, Col, DualPieChart },
|
|
|
data() {
|
|
|
return {
|
|
|
- type: '1',
|
|
|
+ type: "1",
|
|
|
+ status: "1",
|
|
|
+ healPieData: [],
|
|
|
+ stopPieData:[],
|
|
|
+ barData:{
|
|
|
+ area: [],
|
|
|
+ legend: [],
|
|
|
+ data: []
|
|
|
+ }
|
|
|
};
|
|
|
},
|
|
|
+ created(){
|
|
|
+ this.requestData();
|
|
|
+ },
|
|
|
methods: {
|
|
|
+ requestData(){
|
|
|
+ this.getWpwarn();
|
|
|
+ this.getStop();
|
|
|
+ this.getWpOrProStatus();
|
|
|
+ this.getStatus();
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取健康走势图
|
|
|
+ getWpwarn(){
|
|
|
+ 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(){
|
|
|
+ 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(){
|
|
|
+ let that = this;
|
|
|
+ that.API.requestData({
|
|
|
+ method: "POST",
|
|
|
+ subUrl: "healthoperation/countWpOrProStatus",
|
|
|
+ data: {
|
|
|
+ type: that.type
|
|
|
+ },
|
|
|
+ success (res) {
|
|
|
+ let barData = {
|
|
|
+ area: res.data.name,
|
|
|
+ legend: ["良好数量", "正常数量", "注意数量", "严重数量"],
|
|
|
+ data: []
|
|
|
+ };
|
|
|
+
|
|
|
+ let length=res.data.name.length;
|
|
|
+
|
|
|
+ for(let i=0;i<length;i++){
|
|
|
+ barData.data.push([]);
|
|
|
+ }
|
|
|
+
|
|
|
+ for(let i=0;i<length;i++){
|
|
|
+ barData.data[i].push(res.data.lhList[i]);
|
|
|
+ barData.data[i].push(res.data.hgList[i]);
|
|
|
+ barData.data[i].push(res.data.zyList[i]);
|
|
|
+ barData.data[i].push(res.data.yzList[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ that.barData=barData;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取健康状态
|
|
|
+ getStatus(){
|
|
|
+ let that = this;
|
|
|
+ that.API.requestData({
|
|
|
+ method: "POST",
|
|
|
+ subUrl: "healthoperation/findWpOrProStatusForHistory",
|
|
|
+ data: {
|
|
|
+ type: that.type,
|
|
|
+ status: that.status
|
|
|
+ },
|
|
|
+ success (res) {
|
|
|
+
|
|
|
+ let statusData = [];
|
|
|
+
|
|
|
+
|
|
|
+ console.log(111,res);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
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;
|
|
|
+
|
|
|
+ .item{
|
|
|
+ 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;
|
|
|
+
|
|
|
+ &:hover,
|
|
|
+ &.active {
|
|
|
+ background: fade(@green, 20);
|
|
|
+ border: 1px solid @green;
|
|
|
+ color: @green;
|
|
|
+ cursor: pointer;
|
|
|
+
|
|
|
+ i svg use {
|
|
|
+ fill: @green;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
.header-info {
|
|
|
display: flex;
|
|
|
|