Commit 47f46b34 authored by 王晓倩's avatar 王晓倩
parents 0443a8fb 4f794384
...@@ -133,4 +133,11 @@ public class TWorkOrderController extends BaseController ...@@ -133,4 +133,11 @@ public class TWorkOrderController extends BaseController
{ {
return toAjax(tWorkOrderService.deleteTWorkOrderByIds(workIds)); return toAjax(tWorkOrderService.deleteTWorkOrderByIds(workIds));
} }
@GetMapping("/selectWorkOrderNum")
public AjaxResult selectWorkOrderNum(String enterpriseId)
{
return AjaxResult.success(tWorkOrderService.selectWorkOrderNum(enterpriseId));
}
} }
...@@ -6,10 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -6,10 +6,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
...@@ -68,16 +65,30 @@ public class PipeInterfaceController { ...@@ -68,16 +65,30 @@ public class PipeInterfaceController {
DeviceList deviceList=new DeviceList(); DeviceList deviceList=new DeviceList();
//调压箱数据循环 //调压箱数据循环
for (int i=0;i<deviceData.size();i++){ for (int i=0;i<deviceData.size();i++){
//临时存下级数据id //临时存储压力表数据数组
List<PressureFlow> pressList=new ArrayList<>(); List<PressureFlow> pressureList=new ArrayList<>();
//临时存储流量计数据数组
List<PressureFlow> flowmeterList=new ArrayList<>();
//存储全部数据
List<PressureFlow> List=new ArrayList<>();
for (int s=0;s<pressureFlows1.size();s++){ for (int s=0;s<pressureFlows1.size();s++){
//判断调压箱id与下级数据调压箱id是否相等 //判断调压箱id与下级数据调压箱id是否相等
if (pressureFlows1.get(s).getDeviceId()==deviceData.get(i).getDeviceId()){ if (pressureFlows1.get(s).getDeviceId()==deviceData.get(i).getDeviceId()){
//下级数据添加进临时存储数据的数组中 //下级数据添加进临时存储数据的数组中
pressList.add(pressureFlows1.get(s)); List.add(pressureFlows1.get(s));
//判断是压力表还是流量计 1压力表 2流量计
if (pressureFlows1.get(s).getDeviceType()=="1"){
pressureList.add(pressureFlows1.get(s));
}else {
flowmeterList.add(pressureFlows1.get(s));
}
} }
} }
deviceData.get(i).setPressureFlows(pressList); //压力表设备数量添加
deviceData.get(i).setNumberPressureGauges(pressureList.size());
deviceData.get(i).setPressureFlows(List);
//流量计设备数量添加
deviceData.get(i).setNumberEquipment(flowmeterList.size());
deviceData.get(i).setIconType(2); deviceData.get(i).setIconType(2);
} }
deviceList.setData(deviceData); deviceList.setData(deviceData);
...@@ -93,11 +104,32 @@ public class PipeInterfaceController { ...@@ -93,11 +104,32 @@ public class PipeInterfaceController {
public TSiteStationInfoDataList selectTSiteStationInfoData(){ public TSiteStationInfoDataList selectTSiteStationInfoData(){
//场站信息查询方法 //场站信息查询方法
List<TSiteStationInfoData> tSiteStationInfoData = iPipeInterfaceService.selectTSiteStationInfoData(); List<TSiteStationInfoData> tSiteStationInfoData = iPipeInterfaceService.selectTSiteStationInfoData();
//查询场站下级设备数据
List<PressureFlow> pressureFlows = iPipeInterfaceService.selecttSiteStationInfoDataList("1");
TSiteStationInfoDataList tSiteStationInfoDataList=new TSiteStationInfoDataList(); TSiteStationInfoDataList tSiteStationInfoDataList=new TSiteStationInfoDataList();
for (int i=0;i<tSiteStationInfoData.size();i++){ for (int i=0;i<tSiteStationInfoData.size();i++){
//查询场站下级设备数据 //临时存储压力表数据数组
List<PressureFlow> pressureFlows = iPipeInterfaceService.selecttSiteStationInfoDataList(tSiteStationInfoData.get(i).getSiteStationId()); List<PressureFlow> pressureList=new ArrayList<>();
tSiteStationInfoData.get(i).setPressureFlows(pressureFlows); //临时存储流量计数据数组
List<PressureFlow> flowmeterList=new ArrayList<>();
//存储全部数据
List<PressureFlow> List=new ArrayList<>();
for (int s=0;s<pressureFlows.size();s++){
if (tSiteStationInfoData.get(i).getSiteStationId()==pressureFlows.get(s).getDeviceId()){
List.add(pressureFlows.get(s));
//判断是压力表还是流量计 1压力表 2流量计
if (pressureFlows.get(s).getDeviceType()=="1"){
pressureList.add(pressureFlows.get(s));
}else {
flowmeterList.add(pressureFlows.get(s));
}
}
}
//压力表设备数量添加
tSiteStationInfoData.get(i).setNumberPressureGauges(pressureList.size());
tSiteStationInfoData.get(i).setPressureFlows(List);
//流量计设备数量添加
tSiteStationInfoData.get(i).setNumberEquipment(flowmeterList.size());
tSiteStationInfoData.get(i).setIconType(4); tSiteStationInfoData.get(i).setIconType(4);
} }
tSiteStationInfoDataList.setData(tSiteStationInfoData); tSiteStationInfoDataList.setData(tSiteStationInfoData);
...@@ -164,16 +196,29 @@ public class PipeInterfaceController { ...@@ -164,16 +196,29 @@ public class PipeInterfaceController {
DeviceDataList deviceDataList=new DeviceDataList(); DeviceDataList deviceDataList=new DeviceDataList();
//调压箱数据循环 //调压箱数据循环
for (int i=0;i<pipeDates.size();i++){ for (int i=0;i<pipeDates.size();i++){
//临时存下级数据id //临时存储压力表数据数组
List<PressureFlow> pressList=new ArrayList<>(); List<PressureFlow> pressureList=new ArrayList<>();
//临时存储流量计数据数组
List<PressureFlow> flowmeterList=new ArrayList<>();
//存储全部数据
List<PressureFlow> List=new ArrayList<>();
for (int s=0;s<pressureFlows1.size();s++){ for (int s=0;s<pressureFlows1.size();s++){
//判断调压箱id与下级数据调压箱id是否相等 //判断调压箱id与下级数据调压箱id是否相等
if (pressureFlows1.get(s).getDeviceId()==pipeDates.get(i).getDeviceId()){ if (pressureFlows1.get(s).getDeviceId()==pipeDates.get(i).getDeviceId()){
//下级数据添加进临时存储数据的数组中 List.add(pressureFlows1.get(s));
pressList.add(pressureFlows1.get(s)); //判断是压力表还是流量计 1压力表 2流量计
if (pressureFlows1.get(s).getDeviceType()=="1"){
pressureList.add(pressureFlows1.get(s));
}else {
flowmeterList.add(pressureFlows1.get(s));
}
} }
} }
pipeDates.get(i).setPressureFlows(pressList); //压力表设备数量添加
pipeDates.get(i).setNumberPressureGauges(pressureList.size());
pipeDates.get(i).setPressureFlows(List);
//流量计设备数量添加
pipeDates.get(i).setNumberEquipment(flowmeterList.size());
pipeDates.get(i).setIconType(3); pipeDates.get(i).setIconType(3);
} }
deviceDataList.setData(pipeDates); deviceDataList.setData(pipeDates);
......
...@@ -30,6 +30,139 @@ public class DeviceData { ...@@ -30,6 +30,139 @@ public class DeviceData {
private int iconType; private int iconType;
//压力表设备数量
private int numberPressureGauges;
//压力表在线设备
private int onlineEquipment;
//压力表离线设备
private int offlineEquipment;
//压力表历史报警
private int historicalAlarm;
//压力表已处理报警
private int alarmProcessed;
//压力表报警中
private int inAlarm;
//流量计设备数量
private int numberEquipment;
//流量计在线设备
private int numberOnlineEquipment;
//流量计离线设备
private int numberOfflineEquipment;
//流量计历史报警
private int numberHistoricalAlarm;
//流量计已处理报警
private int numberAlarmProcessed;
//流量计报警中
private int numberInAlarm;
public int getNumberPressureGauges() {
return numberPressureGauges;
}
public void setNumberPressureGauges(int numberPressureGauges) {
this.numberPressureGauges = numberPressureGauges;
}
public int getNumberOnlineEquipment() {
return numberOnlineEquipment;
}
public void setNumberOnlineEquipment(int numberOnlineEquipment) {
this.numberOnlineEquipment = numberOnlineEquipment;
}
public int getNumberOfflineEquipment() {
return numberOfflineEquipment;
}
public void setNumberOfflineEquipment(int numberOfflineEquipment) {
this.numberOfflineEquipment = numberOfflineEquipment;
}
public int getNumberHistoricalAlarm() {
return numberHistoricalAlarm;
}
public void setNumberHistoricalAlarm(int numberHistoricalAlarm) {
this.numberHistoricalAlarm = numberHistoricalAlarm;
}
public int getNumberAlarmProcessed() {
return numberAlarmProcessed;
}
public void setNumberAlarmProcessed(int numberAlarmProcessed) {
this.numberAlarmProcessed = numberAlarmProcessed;
}
public int getNumberInAlarm() {
return numberInAlarm;
}
public void setNumberInAlarm(int numberInAlarm) {
this.numberInAlarm = numberInAlarm;
}
public int getOnlineEquipment() {
return onlineEquipment;
}
public void setOnlineEquipment(int onlineEquipment) {
this.onlineEquipment = onlineEquipment;
}
public int getOfflineEquipment() {
return offlineEquipment;
}
public void setOfflineEquipment(int offlineEquipment) {
this.offlineEquipment = offlineEquipment;
}
public int getHistoricalAlarm() {
return historicalAlarm;
}
public void setHistoricalAlarm(int historicalAlarm) {
this.historicalAlarm = historicalAlarm;
}
public int getAlarmProcessed() {
return alarmProcessed;
}
public void setAlarmProcessed(int alarmProcessed) {
this.alarmProcessed = alarmProcessed;
}
public int getInAlarm() {
return inAlarm;
}
public void setInAlarm(int inAlarm) {
this.inAlarm = inAlarm;
}
public int getNumberEquipment() {
return numberEquipment;
}
public void setNumberEquipment(int numberEquipment) {
this.numberEquipment = numberEquipment;
}
public int getIconType() { public int getIconType() {
return iconType; return iconType;
} }
...@@ -126,6 +259,7 @@ public class DeviceData { ...@@ -126,6 +259,7 @@ public class DeviceData {
this.pressureFlows = pressureFlows; this.pressureFlows = pressureFlows;
} }
@Override @Override
public String toString() { public String toString() {
return "DeviceData{" + return "DeviceData{" +
...@@ -141,6 +275,18 @@ public class DeviceData { ...@@ -141,6 +275,18 @@ public class DeviceData {
", pressureFlows=" + pressureFlows + ", pressureFlows=" + pressureFlows +
", beyondEnterpriseName='" + beyondEnterpriseName + '\'' + ", beyondEnterpriseName='" + beyondEnterpriseName + '\'' +
", iconType=" + iconType + ", iconType=" + iconType +
", numberPressureGauges=" + numberPressureGauges +
", onlineEquipment=" + onlineEquipment +
", offlineEquipment=" + offlineEquipment +
", historicalAlarm=" + historicalAlarm +
", alarmProcessed=" + alarmProcessed +
", inAlarm=" + inAlarm +
", numberEquipment=" + numberEquipment +
", numberOnlineEquipment=" + numberOnlineEquipment +
", numberOfflineEquipment=" + numberOfflineEquipment +
", numberHistoricalAlarm=" + numberHistoricalAlarm +
", numberAlarmProcessed=" + numberAlarmProcessed +
", numberInAlarm=" + numberInAlarm +
'}'; '}';
} }
} }
package com.zehong.system.domain; package com.zehong.system.domain;
import java.util.List; import java.util.List;
public class TSiteStationInfoData { public class TSiteStationInfoData {
...@@ -23,13 +22,148 @@ public class TSiteStationInfoData { ...@@ -23,13 +22,148 @@ public class TSiteStationInfoData {
private String buildCompany; private String buildCompany;
private String powerCompany; private String powerCompany;
//流量计数组
private List<PressureFlow> pressureFlows; private List<PressureFlow> pressureFlows;
private int iconType; private int iconType;
private String companyType; private String companyType;
//压力表设备数量
private int numberPressureGauges;
//压力表在线设备
private int onlineEquipment;
//压力表离线设备
private int offlineEquipment;
//压力表历史报警
private int historicalAlarm;
//压力表已处理报警
private int alarmProcessed;
//压力表报警中
private int inAlarm;
//流量计设备数量
private int numberEquipment;
//流量计在线设备
private int numberOnlineEquipment;
//流量计离线设备
private int numberOfflineEquipment;
//流量计历史报警
private int numberHistoricalAlarm;
//流量计已处理报警
private int numberAlarmProcessed;
//流量计报警中
private int numberInAlarm;
public int getNumberOnlineEquipment() {
return numberOnlineEquipment;
}
public void setNumberOnlineEquipment(int numberOnlineEquipment) {
this.numberOnlineEquipment = numberOnlineEquipment;
}
public int getNumberOfflineEquipment() {
return numberOfflineEquipment;
}
public void setNumberOfflineEquipment(int numberOfflineEquipment) {
this.numberOfflineEquipment = numberOfflineEquipment;
}
public int getNumberHistoricalAlarm() {
return numberHistoricalAlarm;
}
public void setNumberHistoricalAlarm(int numberHistoricalAlarm) {
this.numberHistoricalAlarm = numberHistoricalAlarm;
}
public int getNumberAlarmProcessed() {
return numberAlarmProcessed;
}
public void setNumberAlarmProcessed(int numberAlarmProcessed) {
this.numberAlarmProcessed = numberAlarmProcessed;
}
public int getNumberInAlarm() {
return numberInAlarm;
}
public void setNumberInAlarm(int numberInAlarm) {
this.numberInAlarm = numberInAlarm;
}
public int getNumberPressureGauges() {
return numberPressureGauges;
}
public void setNumberPressureGauges(int numberPressureGauges) {
this.numberPressureGauges = numberPressureGauges;
}
public int getNumberEquipment() {
return numberEquipment;
}
public void setNumberEquipment(int numberEquipment) {
this.numberEquipment = numberEquipment;
}
public int getOnlineEquipment() {
return onlineEquipment;
}
public void setOnlineEquipment(int onlineEquipment) {
this.onlineEquipment = onlineEquipment;
}
public int getOfflineEquipment() {
return offlineEquipment;
}
public void setOfflineEquipment(int offlineEquipment) {
this.offlineEquipment = offlineEquipment;
}
public int getHistoricalAlarm() {
return historicalAlarm;
}
public void setHistoricalAlarm(int historicalAlarm) {
this.historicalAlarm = historicalAlarm;
}
public int getAlarmProcessed() {
return alarmProcessed;
}
public void setAlarmProcessed(int alarmProcessed) {
this.alarmProcessed = alarmProcessed;
}
public int getInAlarm() {
return inAlarm;
}
public void setInAlarm(int inAlarm) {
this.inAlarm = inAlarm;
}
public String getCompanyType() { public String getCompanyType() {
return companyType; return companyType;
} }
...@@ -150,6 +284,18 @@ public class TSiteStationInfoData { ...@@ -150,6 +284,18 @@ public class TSiteStationInfoData {
", pressureFlows=" + pressureFlows + ", pressureFlows=" + pressureFlows +
", iconType=" + iconType + ", iconType=" + iconType +
", companyType='" + companyType + '\'' + ", companyType='" + companyType + '\'' +
", numberPressureGauges=" + numberPressureGauges +
", onlineEquipment=" + onlineEquipment +
", offlineEquipment=" + offlineEquipment +
", historicalAlarm=" + historicalAlarm +
", alarmProcessed=" + alarmProcessed +
", inAlarm=" + inAlarm +
", numberEquipment=" + numberEquipment +
", numberOnlineEquipment=" + numberOnlineEquipment +
", numberOfflineEquipment=" + numberOfflineEquipment +
", numberHistoricalAlarm=" + numberHistoricalAlarm +
", numberAlarmProcessed=" + numberAlarmProcessed +
", numberInAlarm=" + numberInAlarm +
'}'; '}';
} }
} }
package com.zehong.system.mapper; package com.zehong.system.mapper;
import java.util.List; import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TWorkOrder; import com.zehong.system.domain.TWorkOrder;
import com.zehong.system.domain.vo.HomepageVo; import com.zehong.system.domain.vo.HomepageVo;
import org.apache.ibatis.annotations.Param;
/** /**
* 燃气任务Mapper接口 * 燃气任务Mapper接口
...@@ -66,4 +69,11 @@ public interface TWorkOrderMapper ...@@ -66,4 +69,11 @@ public interface TWorkOrderMapper
* @return 结果 * @return 结果
*/ */
public int deleteTWorkOrderByIds(Long[] workIds); public int deleteTWorkOrderByIds(Long[] workIds);
/**
* 查询任务完成率
* @param enterpriseId
* @return
*/
public Map<String,Object> selectWorkOrderNum(@Param("enterpriseIds")String[] enterpriseIds);
} }
package com.zehong.system.service; package com.zehong.system.service;
import java.util.List; import java.util.List;
import java.util.Map;
import com.zehong.system.domain.TWorkOrder; import com.zehong.system.domain.TWorkOrder;
import com.zehong.system.domain.vo.HomepageVo; import com.zehong.system.domain.vo.HomepageVo;
...@@ -66,4 +68,6 @@ public interface ITWorkOrderService ...@@ -66,4 +68,6 @@ public interface ITWorkOrderService
* @return 结果 * @return 结果
*/ */
public int deleteTWorkOrderById(Long workId); public int deleteTWorkOrderById(Long workId);
public Map<String,Object> selectWorkOrderNum(String enterpriseId);
} }
...@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -13,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 燃气任务Service业务层处理 * 燃气任务Service业务层处理
...@@ -132,4 +133,15 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService ...@@ -132,4 +133,15 @@ public class TWorkOrderServiceImpl implements ITWorkOrderService
{ {
return tWorkOrderMapper.deleteTWorkOrderById(workId); return tWorkOrderMapper.deleteTWorkOrderById(workId);
} }
/**
*
* @param enterpriseId
* @return
*/
@Override
public Map<String,Object> selectWorkOrderNum(String enterpriseId){
return tWorkOrderMapper.selectWorkOrderNum(enterpriseId.split(","));
}
} }
...@@ -115,8 +115,8 @@ ...@@ -115,8 +115,8 @@
<!--查询场站下级数据--> <!--查询场站下级数据-->
<select id="selecttSiteStationInfoDataList" parameterType="DeviceData" resultMap="PressureFlowResult"> <select id="selecttSiteStationInfoDataList" parameterType="DeviceData" resultMap="PressureFlowResult">
select device_model,device_type,create_time from t_relation_device_detail_info select device_model,device_type,create_time,relation_device_id from t_relation_device_detail_info
where relation_device_id=#{deviceId} and relation_device_type='2' where relation_device_type='2'
</select> </select>
<!--监控信息查询--> <!--监控信息查询-->
......
...@@ -208,4 +208,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -208,4 +208,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{workId} #{workId}
</foreach> </foreach>
</delete> </delete>
<select id="selectWorkOrderNum" resultType="java.util.HashMap">
SELECT IFNULL(SUM(IF(work_status=3 AND work_type=1,1,0))/SUM(IF(work_type=1,1,0)),0) AS typeOne,
IFNULL(SUM(IF(work_status=3 AND work_type=2,1,0))/SUM(IF(work_type=2,1,0)),0) AS typeTwo,
IFNULL(SUM(IF(work_status=3 AND work_type=3,1,0))/SUM(IF(work_type=3,1,0)),0) AS typeThree,
IFNULL(SUM(IF(work_status=3 AND work_type=4,1,0))/SUM(IF(work_type=4,1,0)),0) AS typeFor,
(SELECT COUNT(employed_people_id) FROM t_employed_people_info WHERE is_del = 0
AND beyond_enterprise_id IN
<foreach item="enterpriseId" collection="enterpriseIds" open="(" separator="," close=")">
#{enterpriseId}
</foreach>
) AS peopleNum,
(SELECT CAST(SUM(pipe_length) AS DECIMAL(20,0)) FROM t_pipe_info WHERE is_del = 0
AND beyond_enterprise_id IN
<foreach item="enterpriseId" collection="enterpriseIds" open="(" separator="," close=")">
#{enterpriseId}
</foreach>
)AS allPipeLength
FROM t_work_order WHERE is_del = 0
AND work_assign_enterprose_id IN
<foreach item="enterpriseId" collection="enterpriseIds" open="(" separator="," close=")">
#{enterpriseId}
</foreach>
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -51,3 +51,11 @@ export function exportOrder(query) { ...@@ -51,3 +51,11 @@ export function exportOrder(query) {
params: query params: query
}) })
} }
export function selectWorkOrderNum(query) {
return request({
url: '/system/order/selectWorkOrderNum',
method: 'get',
params: query
})
}
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
<div class="left-top" style="margin-top: 40px;width: 430px;margin-left: 10px;display: flex;justify-content: space-around;"> <div class="left-top" style="margin-top: 40px;width: 430px;margin-left: 10px;display: flex;justify-content: space-around;">
<div style="width: 40%;text-align: center;color: #339CC9;"> <div style="width: 40%;text-align: center;color: #339CC9;">
<div class="div-p">从业人员数</div> <div class="div-p">从业人员数</div>
<span style="font-family: 'arialbd';font-size: 35px;background-image:-webkit-linear-gradient(bottom,#f0c41b,#e4dbb7);-webkit-background-clip:text;-webkit-text-fill-color:transparent; ">{{datanow.congyeNum}}</span> <span style="font-family: 'arialbd';font-size: 35px;background-image:-webkit-linear-gradient(bottom,#f0c41b,#e4dbb7);-webkit-background-clip:text;-webkit-text-fill-color:transparent; ">{{allNum.peopleNum}}</span>
</div> </div>
<div style="width: 40%;text-align: center;color: #339CC9;"> <div style="width: 40%;text-align: center;color: #339CC9;">
<div class="div-p">管道长度(m)</div> <div class="div-p">管道长度(m)</div>
<span style="font-family: 'arialbd';font-size: 35px;background-image:-webkit-linear-gradient(bottom,#f86742,#f0c41b);-webkit-background-clip:text;-webkit-text-fill-color:transparent; ">{{datanow.guandaoNum}}</span> <span style="font-family: 'arialbd';font-size: 35px;background-image:-webkit-linear-gradient(bottom,#f86742,#f0c41b);-webkit-background-clip:text;-webkit-text-fill-color:transparent; ">{{allNum.allPipeLength}}</span>
</div> </div>
</div> </div>
...@@ -46,34 +46,29 @@ ...@@ -46,34 +46,29 @@
<div class="fong-div" style="width: 8px;height: 12px;background-color: #11e9e9b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div> <div class="fong-div" style="width: 8px;height: 12px;background-color: #11e9e9b3;float: right;margin-top: 10px;margin-right: 10px;transform: skewX(-25deg)"></div>
</div> </div>
</div> </div>
<!-- <div id="myCharttwo" :style="{width: '450px', height: '270px'}"></div>
<div class="titleTex" style="height: 20px;margin-top: 0px;font-size: 15px;">
● 已完成数量:{{datanow.renwu[1]}}
</div>
<div class="titleTex" style="height: 20px;margin-top: 0px;font-size: 15px;color: #0099ff">
● 未成数量:{{datanow.renwu[0]}}
</div> -->
<div class="div-el"> <div class="div-el">
<div class="el-left">入户安检</div> <div class="el-left">入户安检</div>
<el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="63"></el-progress> <el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="allNum.typeOne*100"></el-progress>
</div> </div>
<div class="div-el"> <div class="div-el">
<div class="el-left">巡查</div> <div class="el-left">巡查</div>
<el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="50" status="success"></el-progress> <el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="allNum.typeTwo*100" status="success"></el-progress>
</div> </div>
<div class="div-el"> <div class="div-el">
<div class="el-left">报警巡查</div> <div class="el-left">报警巡查</div>
<el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="80" status="warning"></el-progress> <el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="allNum.typeThree*100" status="warning"></el-progress>
</div> </div>
<div class="div-el"> <div class="div-el">
<div class="el-left">其他</div> <div class="el-left">其他</div>
<el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="50" status="exception"></el-progress> <el-progress class="el-progress_text" :text-inside="true" :stroke-width="18" :percentage="allNum.typeFor*100" status="exception"></el-progress>
</div> </div>
<!-- </div> --> <!-- </div> -->
</div> </div>
</template> </template>
<script> <script>
import { selectWorkOrderNum } from "@/api/operationMonitor/order";
// 引入基本模板 // 引入基本模板
let echarts = require('echarts/lib/echarts') let echarts = require('echarts/lib/echarts')
// 引入柱状图组件 // 引入柱状图组件
...@@ -84,6 +79,18 @@ ...@@ -84,6 +79,18 @@
export default { export default {
data () { data () {
  return {   return {
allNum:{},
zeroNum:{
allPipeLength: 0,
peopleNum: 0,
typeFor: 0,
typeOne: 0,
typeThree: 0,
typeTwo: 0
},
enterpriseIds:{
enterpriseId:""
},
dataAll:{ dataAll:{
congyeNum:1544, congyeNum:1544,
guandaoNum:3658495, guandaoNum:3658495,
...@@ -128,30 +135,42 @@ ...@@ -128,30 +135,42 @@
mounted(){ mounted(){
this.datanow = this.dataAll; this.datanow = this.dataAll;
this.drawLine(this.datanow); this.drawLine(this.datanow);
this.initdata(this.datanow); //this.getNum(null)
}, },
methods: { methods: {
choice(index){ choice(val){
console.log("-----"+index) // if(index==0){
if(index==0){ // this.datanow = this.dataAll;
this.datanow = this.dataAll; // this.drawLine(this.datanow);
this.drawLine(this.datanow); // this.getNum(index);
this.initdata(this.datanow); // }else
}else this.getNum(val);
if(index==1){ // if(index==1){
this.datanow = this.dataone; // this.datanow = this.dataone;
this.drawLine(this.datanow); // this.drawLine(this.datanow);
this.initdata(this.datanow); // }else if(index==2){
}else if(index==2){ // this.datanow = this.datatwo;
this.datanow = this.datatwo; // this.drawLine(this.datanow);
this.drawLine(this.datanow); // }else if(index==3){
this.initdata(this.datanow); // this.datanow = this.datathree;
}else if(index==3){ // this.drawLine(this.datanow);
this.datanow = this.datathree; // }
this.drawLine(this.datanow); },
this.initdata(this.datanow); getNum( val){
if(val!=null && val!=''){
this.enterpriseIds.enterpriseId = val.toString();
selectWorkOrderNum (this.enterpriseIds).then(response => {
console.log(response);
this.allNum=response.data;
});
}else {
this.allNum = this.zeroNum;
} }
}, },
//折线图
drawLine(data){ drawLine(data){
// 基于准备好的dom,初始化echarts实例 // 基于准备好的dom,初始化echarts实例
let myChart = echarts.init(document.getElementById('main1')) let myChart = echarts.init(document.getElementById('main1'))
...@@ -248,86 +267,6 @@ ...@@ -248,86 +267,6 @@
] ]
}); });
}, },
initdata(data){
// 基于准备好的dom,初始化echarts实例
//console.log(data.renwu[0]+"=-=-=-"+data.renwu[1])
let myChart2 = this.$echarts.init(document.getElementById('myCharttwo'))
// 绘制图表
myChart2.setOption({
title: {
text: '任务总数量:'+data.renwuzong,
left: 'center',
top :20,
textStyle:{
color: "#00ffff"
}
},
tooltip: {
trigger: 'item',
},
series: [
{
name: '任务概况',
type: 'pie',
radius: '60%',
center: ['50%','58%'],
data: [
{
value: data.renwu[0],
name: '未完成',
itemStyle: { color: '#09f' }
},
{
value: data.renwu[1],
name: '已完成' ,
itemStyle: { color: '#00ffff' }
},
],
labelLine:{
length:20,
length2:50,
},
label:{
color:'#fff',
fontSize: 14,
// formatter:"{b}\n\n",
// padding:[0,-55],
normal: {
show: true,
position: 'outer',
// formatter: '{d}%, {c} \n\n',
//模板变量有 {a}, {b},{c},{d},{e},分别表示系列名,数据名,数据值等。
formatter: "{a_set|{b}}\n{b_set|{d}%}\n\n\n",
// formatter: "{a_set|{b}}\n{c_set|{d}%}\n{b|}\n\n",
borderWidth: 20,
borderRadius: 4,
padding: [0, -55],
rich: {
a_set: {
color: "#fff",
lineHeight: 20,
align: "center",
padding: [55, -40, -15, -40],
},
b_set:{
color: "auto",
},
}
}
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
});
},
} }
......
...@@ -321,7 +321,7 @@ export default { ...@@ -321,7 +321,7 @@ export default {
} }
this.currentTime(); this.currentTime();
this.$refs.mychild.choice(0); this.$refs.mychild.choice(0);
this.$refs.mychild2.choice(0); this.$refs.mychild2.choice(this.selarr);
}, },
methods: { methods: {
...mapActions({ ...mapActions({
...@@ -404,6 +404,7 @@ export default { ...@@ -404,6 +404,7 @@ export default {
this.map.allfilter(this.selarr, this.selarr1); this.map.allfilter(this.selarr, this.selarr1);
this.map.infowindowClose(); this.map.infowindowClose();
this.show = false; this.show = false;
this.$refs.mychild2.choice(this.selarr);
}, },
sel(index, item) { sel(index, item) {
this.map.infowindowClose(); this.map.infowindowClose();
...@@ -425,6 +426,7 @@ export default { ...@@ -425,6 +426,7 @@ export default {
} }
// this.map.companyFilter(this.selarr); // this.map.companyFilter(this.selarr);
this.map.allfilter(this.selarr, this.selarr1); this.map.allfilter(this.selarr, this.selarr1);
this.$refs.mychild2.choice(this.selarr);
}, },
sel1(index, item) { sel1(index, item) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment