Commit fff2f8c5 authored by zhangjianqian's avatar zhangjianqian

Merge remote-tracking branch 'origin/master'

parents 33f941cc 942c09f7
package com.zehong.web.controller.statistic;
import com.zehong.common.config.GassafetyProgressConfig;
import com.zehong.common.constant.Constants;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.utils.StringUtils;
import com.zehong.common.utils.file.FileUploadUtils;
import com.zehong.common.utils.file.FileUtils;
import com.zehong.framework.config.ServerConfig;
import com.zehong.system.domain.THiddenDangerStandingBook;
import com.zehong.system.domain.TTroubleStandingBook;
import com.zehong.system.domain.form.THiddenDangerStandingBookForm;
import com.zehong.system.domain.form.TTroubleStandingBookForm;
import com.zehong.system.domain.vo.THiddenDangerStandingBookVo;
import com.zehong.system.domain.vo.TTroubleStandingBookVo;
import com.zehong.system.service.ITHiddenDangerStandingBookService;
import com.zehong.system.service.ITTroubleStandingBookService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 统计分析
*
* @author zehong
*/
@RestController
@RequestMapping("/statistic")
public class StatisticController
{
private static final Logger log = LoggerFactory.getLogger(StatisticController.class);
@Autowired
private ITTroubleStandingBookService tTroubleStandingBookService;
@Autowired
private ITHiddenDangerStandingBookService tHiddenDangerStandingBookService;
/**
* 燃气事故台账统计
*/
@GetMapping("/troubleStatistic")
public AjaxResult troubleStatistic()
{
return AjaxResult.success(tTroubleStandingBookService.selectTTroubleStandingBookStatistic());
}
/**
* 隐患整治台账统计
*/
@GetMapping("/hiddenStatistic")
public AjaxResult hiddenStatistic()
{
return AjaxResult.success(tHiddenDangerStandingBookService.selectTHiddenDangerStandingBookStatistic());
}
}
...@@ -12,7 +12,7 @@ import com.zehong.common.core.domain.BaseEntity; ...@@ -12,7 +12,7 @@ import com.zehong.common.core.domain.BaseEntity;
* 设备监控对象 t_device_report_data * 设备监控对象 t_device_report_data
* *
* @author zehong * @author zehong
* @date 2022-02-16 * @date 2022-02-17
*/ */
public class TDeviceReportData extends BaseEntity public class TDeviceReportData extends BaseEntity
{ {
...@@ -21,6 +21,10 @@ public class TDeviceReportData extends BaseEntity ...@@ -21,6 +21,10 @@ public class TDeviceReportData extends BaseEntity
/** 设备上报id */ /** 设备上报id */
private Long deviceReportDataId; private Long deviceReportDataId;
/** 设备名称 */
@Excel(name = "设备名称")
private String deviceName;
/** 设备id(物联网编号) */ /** 设备id(物联网编号) */
@Excel(name = "设备id", readConverterExp = "物=联网编号") @Excel(name = "设备id", readConverterExp = "物=联网编号")
private String deviceNum; private String deviceNum;
...@@ -70,6 +74,14 @@ public class TDeviceReportData extends BaseEntity ...@@ -70,6 +74,14 @@ public class TDeviceReportData extends BaseEntity
@Excel(name = "设备状态") @Excel(name = "设备状态")
private String deviceStatus; private String deviceStatus;
/** 所属企业id */
@Excel(name = "所属企业id")
private Long beyondEnterpriseId;
/** 所属企业名称 */
@Excel(name = "所属企业名称")
private String beyondEnterpriseName;
/** 是否删除(0正常,1删除) */ /** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)") @Excel(name = "是否删除(0正常,1删除)")
private String isDel; private String isDel;
...@@ -87,6 +99,15 @@ public class TDeviceReportData extends BaseEntity ...@@ -87,6 +99,15 @@ public class TDeviceReportData extends BaseEntity
{ {
return deviceReportDataId; return deviceReportDataId;
} }
public void setDeviceName(String deviceName)
{
this.deviceName = deviceName;
}
public String getDeviceName()
{
return deviceName;
}
public void setDeviceNum(String deviceNum) public void setDeviceNum(String deviceNum)
{ {
this.deviceNum = deviceNum; this.deviceNum = deviceNum;
...@@ -195,6 +216,24 @@ public class TDeviceReportData extends BaseEntity ...@@ -195,6 +216,24 @@ public class TDeviceReportData extends BaseEntity
{ {
return deviceStatus; return deviceStatus;
} }
public void setBeyondEnterpriseId(Long beyondEnterpriseId)
{
this.beyondEnterpriseId = beyondEnterpriseId;
}
public Long getBeyondEnterpriseId()
{
return beyondEnterpriseId;
}
public void setBeyondEnterpriseName(String beyondEnterpriseName)
{
this.beyondEnterpriseName = beyondEnterpriseName;
}
public String getBeyondEnterpriseName()
{
return beyondEnterpriseName;
}
public void setIsDel(String isDel) public void setIsDel(String isDel)
{ {
this.isDel = isDel; this.isDel = isDel;
...@@ -218,6 +257,7 @@ public class TDeviceReportData extends BaseEntity ...@@ -218,6 +257,7 @@ public class TDeviceReportData extends BaseEntity
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("deviceReportDataId", getDeviceReportDataId()) .append("deviceReportDataId", getDeviceReportDataId())
.append("deviceName", getDeviceName())
.append("deviceNum", getDeviceNum()) .append("deviceNum", getDeviceNum())
.append("standardConditionAccumulation", getStandardConditionAccumulation()) .append("standardConditionAccumulation", getStandardConditionAccumulation())
.append("workingConditionAccumulation", getWorkingConditionAccumulation()) .append("workingConditionAccumulation", getWorkingConditionAccumulation())
...@@ -230,6 +270,8 @@ public class TDeviceReportData extends BaseEntity ...@@ -230,6 +270,8 @@ public class TDeviceReportData extends BaseEntity
.append("reportTime", getReportTime()) .append("reportTime", getReportTime())
.append("communicationStatus", getCommunicationStatus()) .append("communicationStatus", getCommunicationStatus())
.append("deviceStatus", getDeviceStatus()) .append("deviceStatus", getDeviceStatus())
.append("beyondEnterpriseId", getBeyondEnterpriseId())
.append("beyondEnterpriseName", getBeyondEnterpriseName())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
......
package com.zehong.system.domain.vo;
import lombok.Data;
@Data
public class THiddenDangerStandingBookVo
{
// 隐患总数
private int hiddenTotal;
// 一级隐患总数
private int oneLevelTotal;
// 二级隐患总数
private int twoLevelTotal;
// 三级隐患总数
private int threeLevelTotal;
// 已完成总数
private int completedTotal;
// 未完成总数
private int incompleteTotal;
}
package com.zehong.system.domain.vo;
import lombok.Data;
@Data
public class TTroubleStandingBookVo
{
// 事故总数
private int troubleTotal;
// 受伤总数
private int injuryTotal;
// 死亡总数
private int deathTotal;
// 事故处理办结率
private String completionRate;
}
...@@ -3,6 +3,7 @@ package com.zehong.system.mapper; ...@@ -3,6 +3,7 @@ package com.zehong.system.mapper;
import java.util.List; import java.util.List;
import com.zehong.system.domain.THiddenDangerStandingBook; import com.zehong.system.domain.THiddenDangerStandingBook;
import com.zehong.system.domain.form.THiddenDangerStandingBookForm; import com.zehong.system.domain.form.THiddenDangerStandingBookForm;
import com.zehong.system.domain.vo.THiddenDangerStandingBookVo;
/** /**
* 隐患整治台账Mapper接口 * 隐患整治台账Mapper接口
...@@ -28,6 +29,13 @@ public interface THiddenDangerStandingBookMapper ...@@ -28,6 +29,13 @@ public interface THiddenDangerStandingBookMapper
*/ */
public List<THiddenDangerStandingBook> selectTHiddenDangerStandingBookList(THiddenDangerStandingBookForm tHiddenDangerStandingBook); public List<THiddenDangerStandingBook> selectTHiddenDangerStandingBookList(THiddenDangerStandingBookForm tHiddenDangerStandingBook);
/**
* 隐患台账统计
*
* @return 隐患整治台账集合
*/
public THiddenDangerStandingBookVo selectTHiddenDangerStandingBookStatistic();
/** /**
* 新增隐患整治台账 * 新增隐患整治台账
* *
......
...@@ -3,6 +3,7 @@ package com.zehong.system.mapper; ...@@ -3,6 +3,7 @@ package com.zehong.system.mapper;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TTroubleStandingBook; import com.zehong.system.domain.TTroubleStandingBook;
import com.zehong.system.domain.form.TTroubleStandingBookForm; import com.zehong.system.domain.form.TTroubleStandingBookForm;
import com.zehong.system.domain.vo.TTroubleStandingBookVo;
/** /**
* 事故台账Mapper接口 * 事故台账Mapper接口
...@@ -28,6 +29,13 @@ public interface TTroubleStandingBookMapper ...@@ -28,6 +29,13 @@ public interface TTroubleStandingBookMapper
*/ */
public List<TTroubleStandingBook> selectTTroubleStandingBookList(TTroubleStandingBookForm tTroubleStandingBook); public List<TTroubleStandingBook> selectTTroubleStandingBookList(TTroubleStandingBookForm tTroubleStandingBook);
/**
* 事故台账统计
*
* @return 事故台账统计
*/
public TTroubleStandingBookVo selectTTroubleStandingBookStatistic();
/** /**
* 新增事故台账 * 新增事故台账
* *
......
...@@ -3,6 +3,7 @@ package com.zehong.system.service; ...@@ -3,6 +3,7 @@ package com.zehong.system.service;
import java.util.List; import java.util.List;
import com.zehong.system.domain.THiddenDangerStandingBook; import com.zehong.system.domain.THiddenDangerStandingBook;
import com.zehong.system.domain.form.THiddenDangerStandingBookForm; import com.zehong.system.domain.form.THiddenDangerStandingBookForm;
import com.zehong.system.domain.vo.THiddenDangerStandingBookVo;
/** /**
* 隐患整治台账Service接口 * 隐患整治台账Service接口
...@@ -28,6 +29,13 @@ public interface ITHiddenDangerStandingBookService ...@@ -28,6 +29,13 @@ public interface ITHiddenDangerStandingBookService
*/ */
public List<THiddenDangerStandingBook> selectTHiddenDangerStandingBookList(THiddenDangerStandingBookForm tHiddenDangerStandingBook); public List<THiddenDangerStandingBook> selectTHiddenDangerStandingBookList(THiddenDangerStandingBookForm tHiddenDangerStandingBook);
/**
* 隐患台账统计
*
* @return 隐患整治台账集合
*/
public THiddenDangerStandingBookVo selectTHiddenDangerStandingBookStatistic();
/** /**
* 新增隐患整治台账 * 新增隐患整治台账
* *
......
...@@ -3,6 +3,7 @@ package com.zehong.system.service; ...@@ -3,6 +3,7 @@ package com.zehong.system.service;
import java.util.List; import java.util.List;
import com.zehong.system.domain.TTroubleStandingBook; import com.zehong.system.domain.TTroubleStandingBook;
import com.zehong.system.domain.form.TTroubleStandingBookForm; import com.zehong.system.domain.form.TTroubleStandingBookForm;
import com.zehong.system.domain.vo.TTroubleStandingBookVo;
/** /**
* 事故台账Service接口 * 事故台账Service接口
...@@ -28,6 +29,13 @@ public interface ITTroubleStandingBookService ...@@ -28,6 +29,13 @@ public interface ITTroubleStandingBookService
*/ */
public List<TTroubleStandingBook> selectTTroubleStandingBookList(TTroubleStandingBookForm tTroubleStandingBook); public List<TTroubleStandingBook> selectTTroubleStandingBookList(TTroubleStandingBookForm tTroubleStandingBook);
/**
* 事故台账统计
*
* @return 事故台账统计
*/
public TTroubleStandingBookVo selectTTroubleStandingBookStatistic();
/** /**
* 新增事故台账 * 新增事故台账
* *
......
...@@ -3,6 +3,7 @@ package com.zehong.system.service.impl; ...@@ -3,6 +3,7 @@ package com.zehong.system.service.impl;
import java.util.List; import java.util.List;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.form.THiddenDangerStandingBookForm; import com.zehong.system.domain.form.THiddenDangerStandingBookForm;
import com.zehong.system.domain.vo.THiddenDangerStandingBookVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.mapper.THiddenDangerStandingBookMapper; import com.zehong.system.mapper.THiddenDangerStandingBookMapper;
...@@ -45,6 +46,16 @@ public class THiddenDangerStandingBookServiceImpl implements ITHiddenDangerStand ...@@ -45,6 +46,16 @@ public class THiddenDangerStandingBookServiceImpl implements ITHiddenDangerStand
return tHiddenDangerStandingBookMapper.selectTHiddenDangerStandingBookList(tHiddenDangerStandingBook); return tHiddenDangerStandingBookMapper.selectTHiddenDangerStandingBookList(tHiddenDangerStandingBook);
} }
/**
* 隐患台账统计
*
* @return 隐患整治台账集合
*/
public THiddenDangerStandingBookVo selectTHiddenDangerStandingBookStatistic()
{
return tHiddenDangerStandingBookMapper.selectTHiddenDangerStandingBookStatistic();
}
/** /**
* 新增隐患整治台账 * 新增隐患整治台账
* *
......
...@@ -3,6 +3,7 @@ package com.zehong.system.service.impl; ...@@ -3,6 +3,7 @@ package com.zehong.system.service.impl;
import java.util.List; import java.util.List;
import com.zehong.common.utils.DateUtils; import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.form.TTroubleStandingBookForm; import com.zehong.system.domain.form.TTroubleStandingBookForm;
import com.zehong.system.domain.vo.TTroubleStandingBookVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TTroubleStandingBookMapper; import com.zehong.system.mapper.TTroubleStandingBookMapper;
...@@ -45,6 +46,17 @@ public class TTroubleStandingBookServiceImpl implements ITTroubleStandingBookSer ...@@ -45,6 +46,17 @@ public class TTroubleStandingBookServiceImpl implements ITTroubleStandingBookSer
return tTroubleStandingBookMapper.selectTTroubleStandingBookList(tTroubleStandingBook); return tTroubleStandingBookMapper.selectTTroubleStandingBookList(tTroubleStandingBook);
} }
/**
* 事故台账统计
*
* @return 事故台账统计
*/
@Override
public TTroubleStandingBookVo selectTTroubleStandingBookStatistic()
{
return tTroubleStandingBookMapper.selectTTroubleStandingBookStatistic();
}
/** /**
* 新增事故台账 * 新增事故台账
* *
......
...@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -6,6 +6,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="TDeviceReportData" id="TDeviceReportDataResult"> <resultMap type="TDeviceReportData" id="TDeviceReportDataResult">
<result property="deviceReportDataId" column="device_report_data_id" /> <result property="deviceReportDataId" column="device_report_data_id" />
<result property="deviceName" column="device_name" />
<result property="deviceNum" column="device_num" /> <result property="deviceNum" column="device_num" />
<result property="standardConditionAccumulation" column="standard_condition_accumulation" /> <result property="standardConditionAccumulation" column="standard_condition_accumulation" />
<result property="workingConditionAccumulation" column="working_condition_accumulation" /> <result property="workingConditionAccumulation" column="working_condition_accumulation" />
...@@ -18,6 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -18,6 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="reportTime" column="report_time" /> <result property="reportTime" column="report_time" />
<result property="communicationStatus" column="communication_status" /> <result property="communicationStatus" column="communication_status" />
<result property="deviceStatus" column="device_status" /> <result property="deviceStatus" column="device_status" />
<result property="beyondEnterpriseId" column="beyond_enterprise_id" />
<result property="beyondEnterpriseName" column="beyond_enterprise_name" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
...@@ -27,13 +30,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -27,13 +30,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectTDeviceReportDataVo"> <sql id="selectTDeviceReportDataVo">
select device_report_data_id, device_num, standard_condition_accumulation, working_condition_accumulation, backing_standard_condition_accumulation, residual_quantity, standard_condition_flow, working_condition_flow, temperature, pressure, report_time, communication_status, device_status, create_by, create_time, update_by, update_time, is_del, remarks from t_device_report_data select device_report_data_id, device_name, device_num, standard_condition_accumulation, working_condition_accumulation, backing_standard_condition_accumulation, residual_quantity, standard_condition_flow, working_condition_flow, temperature, pressure, report_time, communication_status, device_status, beyond_enterprise_id, beyond_enterprise_name, create_by, create_time, update_by, update_time, is_del, remarks from t_device_report_data
</sql> </sql>
<select id="selectTDeviceReportDataList" parameterType="TDeviceReportData" resultMap="TDeviceReportDataResult"> <select id="selectTDeviceReportDataList" parameterType="TDeviceReportData" resultMap="TDeviceReportDataResult">
<include refid="selectTDeviceReportDataVo"/> <include refid="selectTDeviceReportDataVo"/>
<where> <where>
<if test="deviceNum != null and deviceNum != ''"> and device_num = #{deviceNum}</if> <if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
<if test="deviceNum != null and deviceNum != ''"> and device_num like concat('%', #{deviceNum}, '%')</if>
<if test="standardConditionAccumulation != null "> and standard_condition_accumulation = #{standardConditionAccumulation}</if> <if test="standardConditionAccumulation != null "> and standard_condition_accumulation = #{standardConditionAccumulation}</if>
<if test="workingConditionAccumulation != null "> and working_condition_accumulation = #{workingConditionAccumulation}</if> <if test="workingConditionAccumulation != null "> and working_condition_accumulation = #{workingConditionAccumulation}</if>
<if test="backingStandardConditionAccumulation != null "> and backing_standard_condition_accumulation = #{backingStandardConditionAccumulation}</if> <if test="backingStandardConditionAccumulation != null "> and backing_standard_condition_accumulation = #{backingStandardConditionAccumulation}</if>
...@@ -45,6 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -45,6 +49,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="reportTime != null "> and report_time = #{reportTime}</if> <if test="reportTime != null "> and report_time = #{reportTime}</if>
<if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if> <if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if>
<if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if> <if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if>
<if test="beyondEnterpriseId != null "> and beyond_enterprise_id = #{beyondEnterpriseId}</if>
<if test="beyondEnterpriseName != null and beyondEnterpriseName != ''"> and beyond_enterprise_name like concat('%', #{beyondEnterpriseName}, '%')</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if> <if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if> <if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where> </where>
...@@ -58,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -58,6 +64,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertTDeviceReportData" parameterType="TDeviceReportData" useGeneratedKeys="true" keyProperty="deviceReportDataId"> <insert id="insertTDeviceReportData" parameterType="TDeviceReportData" useGeneratedKeys="true" keyProperty="deviceReportDataId">
insert into t_device_report_data insert into t_device_report_data
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="deviceName != null">device_name,</if>
<if test="deviceNum != null and deviceNum != ''">device_num,</if> <if test="deviceNum != null and deviceNum != ''">device_num,</if>
<if test="standardConditionAccumulation != null">standard_condition_accumulation,</if> <if test="standardConditionAccumulation != null">standard_condition_accumulation,</if>
<if test="workingConditionAccumulation != null">working_condition_accumulation,</if> <if test="workingConditionAccumulation != null">working_condition_accumulation,</if>
...@@ -70,6 +77,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -70,6 +77,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="reportTime != null">report_time,</if> <if test="reportTime != null">report_time,</if>
<if test="communicationStatus != null">communication_status,</if> <if test="communicationStatus != null">communication_status,</if>
<if test="deviceStatus != null">device_status,</if> <if test="deviceStatus != null">device_status,</if>
<if test="beyondEnterpriseId != null">beyond_enterprise_id,</if>
<if test="beyondEnterpriseName != null">beyond_enterprise_name,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
...@@ -78,6 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -78,6 +87,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remarks != null">remarks,</if> <if test="remarks != null">remarks,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="deviceName != null">#{deviceName},</if>
<if test="deviceNum != null and deviceNum != ''">#{deviceNum},</if> <if test="deviceNum != null and deviceNum != ''">#{deviceNum},</if>
<if test="standardConditionAccumulation != null">#{standardConditionAccumulation},</if> <if test="standardConditionAccumulation != null">#{standardConditionAccumulation},</if>
<if test="workingConditionAccumulation != null">#{workingConditionAccumulation},</if> <if test="workingConditionAccumulation != null">#{workingConditionAccumulation},</if>
...@@ -90,6 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -90,6 +100,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="reportTime != null">#{reportTime},</if> <if test="reportTime != null">#{reportTime},</if>
<if test="communicationStatus != null">#{communicationStatus},</if> <if test="communicationStatus != null">#{communicationStatus},</if>
<if test="deviceStatus != null">#{deviceStatus},</if> <if test="deviceStatus != null">#{deviceStatus},</if>
<if test="beyondEnterpriseId != null">#{beyondEnterpriseId},</if>
<if test="beyondEnterpriseName != null">#{beyondEnterpriseName},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
...@@ -102,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -102,6 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateTDeviceReportData" parameterType="TDeviceReportData"> <update id="updateTDeviceReportData" parameterType="TDeviceReportData">
update t_device_report_data update t_device_report_data
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="deviceName != null">device_name = #{deviceName},</if>
<if test="deviceNum != null and deviceNum != ''">device_num = #{deviceNum},</if> <if test="deviceNum != null and deviceNum != ''">device_num = #{deviceNum},</if>
<if test="standardConditionAccumulation != null">standard_condition_accumulation = #{standardConditionAccumulation},</if> <if test="standardConditionAccumulation != null">standard_condition_accumulation = #{standardConditionAccumulation},</if>
<if test="workingConditionAccumulation != null">working_condition_accumulation = #{workingConditionAccumulation},</if> <if test="workingConditionAccumulation != null">working_condition_accumulation = #{workingConditionAccumulation},</if>
...@@ -114,6 +127,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -114,6 +127,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="reportTime != null">report_time = #{reportTime},</if> <if test="reportTime != null">report_time = #{reportTime},</if>
<if test="communicationStatus != null">communication_status = #{communicationStatus},</if> <if test="communicationStatus != null">communication_status = #{communicationStatus},</if>
<if test="deviceStatus != null">device_status = #{deviceStatus},</if> <if test="deviceStatus != null">device_status = #{deviceStatus},</if>
<if test="beyondEnterpriseId != null">beyond_enterprise_id = #{beyondEnterpriseId},</if>
<if test="beyondEnterpriseName != null">beyond_enterprise_name = #{beyondEnterpriseName},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
......
...@@ -38,6 +38,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -38,6 +38,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="hiddenFindDateStart != null "> and hidden_find_date &gt;= #{hiddenFindDateStart}</if> <if test="hiddenFindDateStart != null "> and hidden_find_date &gt;= #{hiddenFindDateStart}</if>
<if test="hiddenFindDateEnd != null "> and hidden_find_date &lt;= #{hiddenFindDateEnd}</if> <if test="hiddenFindDateEnd != null "> and hidden_find_date &lt;= #{hiddenFindDateEnd}</if>
</where> </where>
order by create_time desc
</select>
<select id="selectTHiddenDangerStandingBookStatistic" resultType="THiddenDangerStandingBookVo">
select COUNT(t.hidden_id) AS hiddenTotal,
SUM(CASE t.hidden_type WHEN '1' THEN 1 ELSE 0 END) AS oneLevelTotal,
SUM(CASE t.hidden_type WHEN '2' THEN 1 ELSE 0 END) AS twoLevelTotal,
SUM(CASE t.hidden_type WHEN '3' THEN 1 ELSE 0 END) AS threeLevelTotal,
SUM(CASE t.remediation WHEN '1' THEN 1 ELSE 0 END) AS completedTotal,
SUM(CASE t.remediation WHEN '2' THEN 1 ELSE 0 END) AS incompleteTotal
from (select * from t_hidden_danger_standing_book where is_del = '0') t
</select> </select>
<select id="selectTHiddenDangerStandingBookById" parameterType="Long" resultMap="THiddenDangerStandingBookResult"> <select id="selectTHiddenDangerStandingBookById" parameterType="Long" resultMap="THiddenDangerStandingBookResult">
......
...@@ -33,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -33,6 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="installTimeStart != null "> and install_time &gt;= #{installTimeStart}</if> <if test="installTimeStart != null "> and install_time &gt;= #{installTimeStart}</if>
<if test="installTimeEnd != null "> and install_time &lt;= #{installTimeEnd}</if> <if test="installTimeEnd != null "> and install_time &lt;= #{installTimeEnd}</if>
</where> </where>
order by create_time desc
</select> </select>
<select id="selectTSafeEquipmentStandingBookById" parameterType="Long" resultMap="TSafeEquipmentStandingBookResult"> <select id="selectTSafeEquipmentStandingBookById" parameterType="Long" resultMap="TSafeEquipmentStandingBookResult">
......
...@@ -44,6 +44,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -44,6 +44,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="dealDateStart != null "> and deal_date &gt;= #{dealDateStart}</if> <if test="dealDateStart != null "> and deal_date &gt;= #{dealDateStart}</if>
<if test="dealDateEnd != null "> and deal_date &lt;= #{dealDateEnd}</if> <if test="dealDateEnd != null "> and deal_date &lt;= #{dealDateEnd}</if>
</where> </where>
order by create_time desc
</select>
<select id="selectTTroubleStandingBookStatistic" resultType="TTroubleStandingBookVo">
select COUNT(t.trouble_id) AS troubleTotal,
SUM(t.injury_num) AS injutyTotal,
SUM(t.death_num) AS deathTotal,
ROUND(SUM(CASE t.is_deal WHEN '1' THEN 1 ELSE 0 END)/COUNT(t.trouble_id)*100, 1) AS completionRate
from (select * from t_trouble_standing_book where is_del = '0') t
</select> </select>
<select id="selectTTroubleStandingBookById" parameterType="Long" resultMap="TTroubleStandingBookResult"> <select id="selectTTroubleStandingBookById" parameterType="Long" resultMap="TTroubleStandingBookResult">
......
...@@ -40,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -40,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectTWorkOrderList" parameterType="TWorkOrder" resultMap="TWorkOrderResult"> <select id="selectTWorkOrderList" parameterType="TWorkOrder" resultMap="TWorkOrderResult">
<include refid="selectTWorkOrderVo"/> <include refid="selectTWorkOrderVo"/>
<where> <where>
<if test="workTitle != null and workTitle != ''"> and work_title = #{workTitle}</if> <if test="workTitle != null and workTitle != ''"> and work_title like concat('%', #{workTitle}, '%')</if>
<if test="workType != null and workType != ''"> and work_type = #{workType}</if> <if test="workType != null and workType != ''"> and work_type = #{workType}</if>
<if test="workContent != null and workContent != ''"> and work_content = #{workContent}</if> <if test="workContent != null and workContent != ''"> and work_content = #{workContent}</if>
<if test="workCreateEnterpriseName != null and workCreateEnterpriseName != ''"> and work_create_enterprise_name like concat('%', #{workCreateEnterpriseName}, '%')</if> <if test="workCreateEnterpriseName != null and workCreateEnterpriseName != ''"> and work_create_enterprise_name like concat('%', #{workCreateEnterpriseName}, '%')</if>
......
...@@ -33,11 +33,12 @@ ...@@ -33,11 +33,12 @@
], ],
"repository": {}, "repository": {},
"dependencies": { "dependencies": {
"@easydarwin/easywasmplayer": "^4.0.13",
"@riophae/vue-treeselect": "0.4.0", "@riophae/vue-treeselect": "0.4.0",
"axios": "0.21.0", "axios": "0.21.0",
"clipboard": "2.0.6", "clipboard": "2.0.6",
"core-js": "^3.19.1", "core-js": "^3.19.1",
"echarts": "4.9.0", "echarts": "^5.3.0",
"element-ui": "2.15.0", "element-ui": "2.15.0",
"file-saver": "2.0.4", "file-saver": "2.0.4",
"fuse.js": "6.4.3", "fuse.js": "6.4.3",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* Created by wangweijie5 on 2016/12/16.
*/
"use strict";
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var __instance = function () {
var instance = void 0;
return function (newInstance) {
if (newInstance) instance = newInstance;
return instance;
};
}();
var AudioRenderer = function () {
function AudioRenderer() {
_classCallCheck(this, AudioRenderer);
if (__instance()) return __instance();
// 确保只有单例
if (AudioRenderer.unique !== undefined) {
return AudioRenderer.unique;
}
AudioRenderer.unique = this;
this.oAudioContext = null;
this.currentVolume = 0.8; // 初始音量
this.bSetVolume = false;
this.gainNode = null;
this.iWndNum = -1; // 窗口号
this.mVolumes = new Map(); // 用于存储所有音量
// Init AudioContext
var AudioContext = window.AudioContext || window.webkitAudioContext;
this.oAudioContext = new AudioContext();
this.writeString = function (view, offset, string) {
for (var i = 0; i < string.length; i++) {
view.setUint8(offset + i, string.charCodeAt(i));
}
};
this.setBufferToDataview = function (output, offset, input) {
for (var i = 0; i < input.length; i++, offset++) {
output.setUint8(offset, input[i]);
}
};
__instance(this);
}
/**
* @synopsis 音频播放
*
* @param dataBuf [IN] 音频缓存
* @param dataLen [IN] 缓存长度
* @param audioInfo [IN] 音频参数
*
* @returns 状态码
*/
_createClass(AudioRenderer, [{
key: 'Play',
value: function Play(dataBuf, dataLen, audioInfo) {
var bufferData = new ArrayBuffer(44 + dataLen);
var viewTalk = new DataView(bufferData);
var sampleRates = audioInfo.samplesPerSec;
var channels = audioInfo.channels;
var bitsPerSample = audioInfo.bitsPerSample;
//console.log("audiorender sampleRates"+sampleRates+"channels:"+channels+"bitsPerSample:"+bitsPerSample);
/* RIFF identifier */
this.writeString(viewTalk, 0, 'RIFF');
/* file length */
viewTalk.setUint32(4, 32 + dataLen * 2, true);
/* RIFF type */
this.writeString(viewTalk, 8, 'WAVE');
/* format chunk identifier */
this.writeString(viewTalk, 12, 'fmt ');
/* format chunk length */
viewTalk.setUint32(16, 16, true);
/* sample format (raw) */
viewTalk.setUint16(20, 1, true);
/* channel count */
viewTalk.setUint16(22, channels, true);
/* sample rate */
viewTalk.setUint32(24, sampleRates, true);
/* byte rate (sample rate * block align) */
viewTalk.setUint32(28, sampleRates * 2, true);
/* block align (channel count * bytes per sample)/8 */
viewTalk.setUint16(32, channels * bitsPerSample / 8, true);
/* bits per sample */
viewTalk.setUint16(34, bitsPerSample, true);
/* data chunk identifier */
this.writeString(viewTalk, 36, 'data');
/* data chunk length */
viewTalk.setUint32(40, dataLen, true);
this.setBufferToDataview(viewTalk, 44, dataBuf);
var self = this;
this.oAudioContext.decodeAudioData(viewTalk.buffer, function (buffer) {
var bufferSource = self.oAudioContext.createBufferSource();
if (bufferSource == null) {
return -1;
}
bufferSource.buffer = buffer;
bufferSource.start(0);
if (self.gainNode == null || self.bSetVolume) {
self.gainNode = self.oAudioContext.createGain();
// self.gainNode.gain.value = self.currentVolume;
// // self.currentVolume = self.gainNode.gain.value;
// self.gainNode.connect(self.oAudioContext.destination);
self.bSetVolume = false;
}
self.gainNode.gain.value = self.currentVolume;
// self.currentVolume = self.gainNode.gain.value;
self.gainNode.connect(self.oAudioContext.destination);
bufferSource.connect(self.gainNode);
}, function (e) {
console.log("decode error");
return -1;
});
return 0;
}
/**
* @synopsis 停止播放
*
* @returns 返回音量
*/
}, {
key: 'Stop',
value: function Stop() {
if (this.gainNode != null) {
this.gainNode.disconnect();
this.gainNode = null;
}
// this.oAudioContext.close();
// AudioRenderer.unique = undefined;
// __instance() = null;
return true;
}
/**
* @synopsis 设置音量
*
* @param iVolume [IN] 音量
*
* @returns 状态码
*/
}, {
key: 'SetVolume',
value: function SetVolume(iVolume) {
this.bSetVolume = true;
this.currentVolume = iVolume;
// 储存当前窗口设置音量值
this.mVolumes.set(this.iWndNum, iVolume);
return true;
}
/**
* @synopsis 设置窗口号
*
* @param iWndNum [IN] 窗口号
*
* @returns 状态码
*/
}, {
key: 'SetWndNum',
value: function SetWndNum(iWndNum) {
this.iWndNum = iWndNum;
// 获取当前窗口设置音量值
var iVolume = this.mVolumes.get(iWndNum);
if (iVolume == undefined) {
iVolume = 0.8; // 默认音量
}
this.currentVolume = iVolume;
return true;
}
/**
* @synopsis 获取音量
*
* @returns 返回音量
*/
}, {
key: 'GetVolume',
value: function GetVolume() {
// 获取当前窗口设置音量值
var iVolume = this.mVolumes.get(this.iWndNum);
if (iVolume == undefined) {
iVolume = 0.8; // 默认音量
}
return iVolume;
}
}]);
return AudioRenderer;
}();
//# sourceMappingURL=AudioRenderer.js.map
\ No newline at end of file
/**
* Created by wangweijie5 on 2016/12/5.
*/
(function (event) {
const AUDIO_TYPE = 0; // 音频
const VIDEO_TYPE = 1; // 视频
const PRIVT_TYPE = 2; // 私有帧
const PLAYM4_AUDIO_FRAME = 100; // 音频帧
const PLAYM4_VIDEO_FRAME = 101; // 视频帧
const PLAYM4_OK = 1;
const PLAYM4_DECODE_ERROR = 44 // 解码失败
const PLAYM4_NOT_KEYFRAME = 48; // 非关键帧
const PLAYM4_NEED_MORE_DATA = 31; // 需要更多数据才能解析
const PLAYM4_SYS_NOT_SUPPORT = 16; // 不支持
const PLAYM4_PARA_ENCODER_ERROR = 71; //音频编码参数错误
const PLAYM4_PRECONDITION_ENCODER_ERROR = 72; //不满足音频编码条件错误
const PLAYM4_ENCODER_ERROR = 73; //音频编码失败
const PLAYM4_CREATE_ENCODER_ERROR = 74; //创建音频编码器失败
const PLAYM4_NOSUPPORT_ENCODER_ERROR = 75; //音频编码不支持
const PLAYM4_ALLOC_MEMORY_ENCODER_ERROR = 76; //音频编码相关内存申请失败
const PLAYM4_BUF_OVER_ENCODER_ERROR = 77; //音频编码相关buffer满
const PLAYM4_NEED_MORE_DATA_ENCODER_ERROR = 78; //音频编码需要更多数据进行编码
const PLAYM4_CALL_ORDER_ENCODER_ERROR = 79; //音频编码调用顺序错误
const PLAYM4_ITYPE_DECODE_ERROR =100; //定位后送进来的第一帧I帧解码失败
const PLAYM4_FIRST_FRAME_NOT_ICURRENT =101; //定位后送进来的第一帧不是定位帧所在的I帧(Ni>Mp)
importScripts('Decoder.js');
Module.postRun.push(function () {
postMessage({'function': "loaded"});
});
var iStreamMode = 0; // 流模式
var bOpenMode = false;
var bOpenStream = false;
var funGetFrameData = null;
var funGetAudFrameData = null;
var bWorkerPrintLog=false;//worker层log开关
onmessage = function (event)
{
var eventData = event.data;
var res = 0;
switch (eventData.command)
{
case "printLog":
let downloadFlag=eventData.data;
if(downloadFlag===true)
{
bWorkerPrintLog=true;
res = Module._SetPrintLogFlag(downloadFlag);
}
else
{
bWorkerPrintLog=false;
res = Module._SetPrintLogFlag(downloadFlag);
}
if (res !== PLAYM4_OK)
{
console.log("DecodeWorker.js: PlayerSDK print log failed,res"+res);
postMessage({'function': "printLog", 'errorCode': res});
}
break;
case "SetPlayPosition":
let nFrameNumOrTime=eventData.data;
let enPosType=eventData.type;
res = Module._SetPlayPosition(nFrameNumOrTime,enPosType);
if (res !== PLAYM4_OK)
{
postMessage({'function': "SetPlayPosition", 'errorCode': res});
return;
}
//有没有buffer需要清除
break;
case "SetStreamOpenMode":
iStreamMode = eventData.data;
res = Module._SetStreamOpenMode(iStreamMode);
if (res !== PLAYM4_OK)
{
postMessage({'function': "SetStreamOpenMode", 'errorCode': res});
return;
}
bOpenMode = true;
break;
case "OpenStream":
// 接收到的数据
var iHeadLen = eventData.dataSize;
var pHead = Module._malloc(iHeadLen + 4);
if (pHead === null)
{
return;
}
var aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen);
aHead.set(eventData.data);
res = Module._OpenStream(pHead, iHeadLen, eventData.bufPoolSize);
postMessage({'function': "OpenStream", 'errorCode': res});
if (res !== PLAYM4_OK)
{
//释放内存
Module._free(pHead);
pHead = null;
return;
}
bOpenStream = true;
// 加4字节长度信息
var a32 = new Uint32Array([iHeadLen]);
var a8 = new Uint8Array(a32.buffer);
var tempBuf = new Uint8Array(iHeadLen + 4);
tempBuf.set(a8, 0);
tempBuf.set(eventData.data, 4);
a32 = null;
a8 = null;
aHead = Module.HEAPU8.subarray(pHead, pHead + iHeadLen + 4);
aHead.set(tempBuf);
tempBuf = null;
res = Module._InputData(pHead, iHeadLen + 4);
if (res !== PLAYM4_OK)
{
postMessage({'function': "InputData", 'errorCode': res});
Module._free(pHead);
pHead = null;
return;
}
// 释放内存
Module._free(pHead);
pHead = null;
if (funGetFrameData === null) {
funGetFrameData = Module.cwrap('GetFrameData', 'number');
}
if (iStreamMode === 0) {
// Module._GetFrameData();
funGetFrameData();
}
break;
case "InputData":
// 接收到的数据
var iLen = eventData.dataSize;
if(bWorkerPrintLog)
{
console.log("<<<Worker: DecodeWorker-InputData iLen:"+iLen);
}
if (iLen > 0)
{
var pInputData = Module._malloc(iLen);
if (pInputData === null)
{
return;
}
var inputData = new Uint8Array(eventData.data);
// var aInputData = Module.HEAPU8.subarray(pInputData, pInputData + iLen);
// aInputData.set(inputData);
Module.writeArrayToMemory(inputData, pInputData);
inputData = null;
res = Module._InputData(pInputData, iLen);
//console.log("DecodeWorker-InputData-ret:%d", res);
if(bWorkerPrintLog)
{
console.log("<<<Worker:InputData result:"+ +res);
}
if (res !== PLAYM4_OK)
{
if (res === 98)
{
res = 1;
}
postMessage({'function': "InputData", 'errorCode': res});
}
Module._free(pInputData);
pInputData = null;
}
/////////////////////
if (funGetFrameData === null)
{
funGetFrameData = Module.cwrap('GetFrameData', 'number');
}
while (bOpenMode && bOpenStream)
{
var ret = getFrameData(funGetFrameData);
// 直到获取视频帧或数据不足为止
if (PLAYM4_VIDEO_FRAME === ret || PLAYM4_NEED_MORE_DATA === ret)
{
break;
}
}
break;
case "SetSecretKey":
var keyLen = eventData.nKeyLen;
var pKeyData = Module._malloc(keyLen);
if (pKeyData === null) {
return;
}
var nKeySize = eventData.data.length
var bufData = stringToBytes (eventData.data);
var aKeyData = Module.HEAPU8.subarray(pKeyData, pKeyData + keyLen);
aKeyData.set(new Uint8Array(bufData));
res = Module._SetSecretKey(eventData.nKeyType, pKeyData, keyLen, nKeySize);
if (res !== PLAYM4_OK) {
postMessage({'function': "SetSecretKey", 'errorCode': res});
Module._free(pKeyData);
pKeyData = null;
return;
}
Module._free(pKeyData);
pKeyData = null;
break;
case "GetBMP":
var nBMPWidth = eventData.width;
var nBMPHeight = eventData.height;
var pYUVData = eventData.data;
var nYUVSize = nBMPWidth * nBMPHeight * 3 / 2;
var oBMPCropRect = eventData.rect;
var pDataYUV = Module._malloc(nYUVSize);
if (pDataYUV === null) {
return;
}
Module.writeArrayToMemory(new Uint8Array(pYUVData, 0, nYUVSize), pDataYUV);
// 分配BMP空间
var nBmpSize = nBMPWidth * nBMPHeight * 4 + 60;
var pBmpData = Module._malloc(nBmpSize);
var pBmpSize = Module._malloc(4);
if (pBmpData === null || pBmpSize === null) {
Module._free(pDataYUV);
pDataYUV = null;
if (pBmpData != null) {
Module._free(pBmpData);
pBmpData = null;
}
if (pBmpSize != null) {
Module._free(pBmpSize);
pBmpSize = null;
}
return;
}
Module._memset(pBmpSize, nBmpSize, 4); // 防止bmp截图出现输入数据过大的错误码
res = Module._GetBMP(pDataYUV, nYUVSize, pBmpData, pBmpSize,
oBMPCropRect.left, oBMPCropRect.top, oBMPCropRect.right, oBMPCropRect.bottom);
if (res !== PLAYM4_OK) {
postMessage({'function': "GetBMP", 'errorCode': res});
Module._free(pDataYUV);
pDataYUV = null;
Module._free(pBmpData);
pBmpData = null;
Module._free(pBmpSize);
pBmpSize = null;
return;
}
// 获取BMP图片大小
var nBmpDataSize = Module.getValue(pBmpSize, "i32");
// 获取BMP图片数据
var aBmpData = new Uint8Array(nBmpDataSize);
aBmpData.set(Module.HEAPU8.subarray(pBmpData, pBmpData + nBmpDataSize));
postMessage({'function': "GetBMP", 'data': aBmpData, 'errorCode': res}, [aBmpData.buffer]);
aBmpData=null;
if (pDataYUV != null) {
Module._free(pDataYUV);
pDataYUV = null;
}
if (pBmpData != null) {
Module._free(pBmpData);
pBmpData = null;
}
if (pBmpSize != null) {
Module._free(pBmpSize);
pBmpSize = null;
}
break;
case "GetJPEG":
var nJpegWidth = eventData.width;
var nJpegHeight = eventData.height;
var pYUVData1 = eventData.data;
var nYUVSize1 = nJpegWidth * nJpegHeight * 3 / 2;
var oJpegCropRect = eventData.rect;
var pDataYUV1 = Module._malloc(nYUVSize1);
if (pDataYUV1 === null) {
return;
}
Module.writeArrayToMemory(new Uint8Array(pYUVData1, 0, nYUVSize1), pDataYUV1);
// 分配JPEG空间
var pJpegData = Module._malloc(nYUVSize1);
var pJpegSize = Module._malloc(4);
if (pJpegData === null || pJpegSize === null) {
if (pJpegData != null) {
Module._free(pJpegData);
pJpegData = null;
}
if (pJpegSize != null) {
Module._free(pJpegSize);
pJpegSize = null;
}
if (pDataYUV1 != null) {
Module._free(pDataYUV1);
pDataYUV1 = null;
}
return;
}
Module.setValue(pJpegSize, nJpegWidth * nJpegHeight * 2, "i32"); // JPEG抓图,输入缓冲长度不小于当前帧YUV大小
res = Module._GetJPEG(pDataYUV1, nYUVSize1, pJpegData, pJpegSize,
oJpegCropRect.left, oJpegCropRect.top, oJpegCropRect.right, oJpegCropRect.bottom);
if (res !== PLAYM4_OK) {
postMessage({'function': "GetJPEG", 'errorCode': res});
if (pJpegData != null) {
Module._free(pJpegData);
pJpegData = null;
}
if (pJpegSize != null) {
Module._free(pJpegSize);
pJpegSize = null;
}
if (pDataYUV1 != null) {
Module._free(pDataYUV1);
pDataYUV1 = null;
}
return;
}
// 获取JPEG图片大小
var nJpegSize = Module.getValue(pJpegSize, "i32");
// 获取JPEG图片数据
var aJpegData = new Uint8Array(nJpegSize);
aJpegData.set(Module.HEAPU8.subarray(pJpegData, pJpegData + nJpegSize));
postMessage({'function': "GetJPEG", 'data': aJpegData, 'errorCode': res}, [aJpegData.buffer]);
nJpegSize = null;
aJpegData = null;
if (pDataYUV1 != null) {
Module._free(pDataYUV1);
pDataYUV1 = null;
}
if (pJpegData != null) {
Module._free(pJpegData);
pJpegData = null;
}
if (pJpegSize != null) {
Module._free(pJpegSize);
pJpegSize = null;
}
break;
case "SetDecodeFrameType":
var nFrameType = eventData.data;
res = Module._SetDecodeFrameType(nFrameType);
if (res !== PLAYM4_OK) {
postMessage({'function': "SetDecodeFrameType", 'errorCode': res});
return;
}
break;
case "DisplayRegion":
var nRegionNum = eventData.nRegionNum;
var srcRect = eventData.srcRect;
var hDestWnd = eventData.hDestWnd;
var bEnable = eventData.bEnable;
res = Module._SetDisplayRegion(nRegionNum, srcRect, hDestWnd, bEnable);
if (res !== PLAYM4_OK) {
postMessage({'function': "DisplayRegion", 'errorCode': res});
return;
}
break;
case "CloseStream":
res = Module._CloseStream();
if (res !== PLAYM4_OK) {
postMessage({'function': "CloseStream", 'errorCode': res});
return;
}
break;
case "SetIFrameDecInterval":
Module._SetIFrameDecInterval(eventData.data);
break;
/*******************************************worker音频编码相关接口实现**********************************************************/
case "CreateAudEncode":
res = Module._CreateAudEncode(eventData.encodertype);
postMessage({'function':"CreateAudEncode",'errorCode':res});
break;
case "SetAudEncodeParam":
res = Module._SetAudEncodeParam(eventData.samplerate, eventData.channel, eventData.bitrate, eventData.bitwidth);
postMessage({'function':"SetAudEncodeParam",'errorCode':res});
break;
case "DestroyAudEncode":
res = Module._DestroyAudEncode();
postMessage({'function':"DestroyAudEncode",'errorCode':res});
break;
case "InputAudEncodeData":
if(bWorkerPrintLog)
{
console.log("<<<Worker: 20200113 DecodeWorker-InputAudEncodeData 1");
}
var iLen = eventData.dataSize;
if(iLen > 0)
{
var pAudInputData = Module._malloc(iLen);
if (pAudInputData === null)
{
return;
}
var audinputData = new Uint8Array(eventData.data);
Module.writeArrayToMemory(audinputData, pAudInputData);
audinputData = null;
res = Module._InputAudEncodeData(pAudInputData, iLen);
if(bWorkerPrintLog)
{
console.log("<<<Worker: 20200113 DecodeWorker-InputAudEncodeData 2 res:"+res);
}
if(res == PLAYM4_OK) //接口返回成功,表明已编码好一帧音频数据
{
if (funGetAudFrameData === null)
{
funGetAudFrameData = Module.cwrap('GetAudFrameData', 'number');
}
if(bWorkerPrintLog)
{
console.log("<<<Worker: 20200113 DecodeWorker-InputAudEncodeData 2-1 succ");
}
//调用C++ GetAudFrameData
var ret = getAudFrameData(funGetAudFrameData);
}
Module._free(pAudInputData);
pAudInputData = null;
}
break;
default:
break;
}
};
function getOSDTime(oFrameInfo) {
var iYear = oFrameInfo.year;
var iMonth = oFrameInfo.month;
var iDay = oFrameInfo.day;
var iHour = oFrameInfo.hour;
var iMinute = oFrameInfo.minute;
var iSecond = oFrameInfo.second;
if (iMonth < 10) {
iMonth = "0" + iMonth;
}
if (iDay < 10) {
iDay = "0" + iDay;
}
if (iHour < 10) {
iHour = "0" + iHour;
}
if (iMinute < 10) {
iMinute = "0" + iMinute;
}
if (iSecond < 10) {
iSecond = "0" + iSecond;
}
return iYear + "-" + iMonth + "-" + iDay + " " + iHour + ":" + iMinute + ":" + iSecond;
}
function getAudFrameData(fun)
{
if(bWorkerPrintLog)
{
console.log("<<<Worker: DecodeWorker-getAudFrameData 1");
}
var res = fun(); // 调用C++GetAudFrameData函数
if(res === PLAYM4_OK)
{
var oFrameInfo = Module._GetAudFrameInfo();
var iSize = oFrameInfo.frameSize;
if (0 === iSize)
{
return null;
}
var pEncodeAud = Module._GetAudFrameBuffer();
if(pEncodeAud == null)
{
return null;
}
var aEncodeAudData = new Uint8Array(iSize);
aEncodeAudData.set(Module.HEAPU8.subarray(pEncodeAud, pEncodeAud + iSize));
if(bWorkerPrintLog)
{
console.log("<<<Worker: DecodeWorker-getAudFrameData 2");
}
//获取到音频编码帧数据通过worker返回
postMessage({'function':"GetAudEncodeData",'data':aEncodeAudData.buffer,'dataSize':iSize, 'errorCode': res});
}
else
{
postMessage({'function':"GetAudEncodeData",'data':null,'dataSize':-1, 'errorCode': res});
}
oFrameInfo=null;
pEncodeAud=null;
aEncodeAudData=null;
return res;
}
// 获取帧数据
function getFrameData(fun)
{
// function getFrameData() {
// 获取帧数据
// var res = Module._GetFrameData();
var res = fun();
if(bWorkerPrintLog)
{
console.log("<<<Worker: getFrameData Result:"+res);
}
if (res === PLAYM4_OK)
{
var oFrameInfo = Module._GetFrameInfo();
switch (oFrameInfo.frameType)
{
case AUDIO_TYPE:
var iSize = oFrameInfo.frameSize;
if (0 === iSize)
{
return -1;
}
var pPCM = Module._GetFrameBuffer();
// var audioBuf = new ArrayBuffer(iSize);
var aPCMData = new Uint8Array(iSize);
aPCMData.set(Module.HEAPU8.subarray(pPCM, pPCM + iSize));
if(bWorkerPrintLog)
{
console.log("<<<Worker: audio media Info: nSise:"+ oFrameInfo.frameSize+",nSampleRate:"+oFrameInfo.samplesPerSec+',channel:'+oFrameInfo.channels+',bitsPerSample:'+oFrameInfo.bitsPerSample);
}
postMessage({
'function': "GetFrameData", 'type': "audioType", 'data': aPCMData.buffer,
'frameInfo': oFrameInfo, 'errorCode': res
}, [aPCMData.buffer]);
oFrameInfo = null;
pPCM = null;
aPCMData = null;
return PLAYM4_AUDIO_FRAME;
case VIDEO_TYPE:
var szOSDTime = getOSDTime(oFrameInfo);
var iWidth = oFrameInfo.width;
var iHeight = oFrameInfo.height;
var iYUVSize = iWidth * iHeight * 3 / 2;
if (0 === iYUVSize)
{
return -1;
}
var pYUV = Module._GetFrameBuffer();
// 图像数据渲染后压回,若从主码流切到子码流,存在数组大小与图像大小不匹配现象
var aYUVData = new Uint8Array(iYUVSize);
aYUVData.set(Module.HEAPU8.subarray(pYUV, pYUV + iYUVSize));
if(bWorkerPrintLog)
{
console.log("<<<Worker: InputData-getFrameData Video: Width:"+ oFrameInfo.width+",Height:"+oFrameInfo.height+",timeStamp:"+oFrameInfo.timeStamp);
}
postMessage({
'function': "GetFrameData", 'type': "videoType", 'data': aYUVData.buffer,
'dataLen': aYUVData.length,'osd': szOSDTime, 'frameInfo': oFrameInfo, 'errorCode': res
}, [aYUVData.buffer]);
oFrameInfo = null;
pYUV = null;
aYUVData = null;
return PLAYM4_VIDEO_FRAME;
case PRIVT_TYPE:
postMessage({
'function': "GetFrameData", 'type': "", 'data': null,
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
});
return PLAYM4_SYS_NOT_SUPPORT;
default:
postMessage({
'function': "GetFrameData", 'type': "", 'data': null,
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': PLAYM4_SYS_NOT_SUPPORT
});
return PLAYM4_SYS_NOT_SUPPORT;
}
}
else {
//解码失败返回裸数据
if(PLAYM4_DECODE_ERROR===res)
{
var rawInfo=Module._GetRawDataInfo();
var pRawData = Module._GetRawDataBuffer();
var aRawData = new Uint8Array(rawInfo.isize);
aRawData.set(Module.HEAPU8.subarray(pRawData, pRawData + rawInfo.isize));
postMessage({
'function': "GetRawData", 'type': "", 'data':aRawData.buffer,
'rawDataLen': rawInfo.isize, 'osd': 0, 'frameInfo': null, 'errorCode': res
});
rawInfo=null;
pRawData=null;
aRawData=null;
}
//定位返回的错误
if(PLAYM4_FIRST_FRAME_NOT_ICURRENT===res|| PLAYM4_ITYPE_DECODE_ERROR===res)
{
postMessage({
'function': "GetFrameData", 'type': "", 'data': null,
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': res
});
}
//需要更多数据
if (PLAYM4_NEED_MORE_DATA === res || PLAYM4_SYS_NOT_SUPPORT === res || PLAYM4_NOT_KEYFRAME === res){
postMessage({
'function': "GetFrameData", 'type': "", 'data': null,
'dataLen': -1, 'osd': 0, 'frameInfo': null, 'errorCode': res
});
}
return res;
}
}
// 开始计算时间
function startTime() {
return new Date().getTime();
}
// 结束计算时间
function endTime() {
return new Date().getTime();
}
// 字母字符串转byte数组
function stringToBytes ( str ) {
var ch, st, re = [];
for (var i = 0; i < str.length; i++ ) {
ch = str.charCodeAt(i); // get char
st = []; // set up "stack"
do {
st.push( ch & 0xFF ); // push byte to stack
ch = ch >> 8; // shift value down by 1 byte
}
while ( ch );
// add stack contents to result
// done because chars have "wrong" endianness
re = re.concat( st.reverse() );
}
// return an array of bytes
return re;
}
})();
\ No newline at end of file
var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;if(Module["ENVIRONMENT"]){if(Module["ENVIRONMENT"]==="WEB"){ENVIRONMENT_IS_WEB=true}else if(Module["ENVIRONMENT"]==="WORKER"){ENVIRONMENT_IS_WORKER=true}else if(Module["ENVIRONMENT"]==="NODE"){ENVIRONMENT_IS_NODE=true}else if(Module["ENVIRONMENT"]==="SHELL"){ENVIRONMENT_IS_SHELL=true}else{throw new Error("The provided Module['ENVIRONMENT'] value is not valid. It must be one of: WEB|WORKER|NODE|SHELL.")}}else{ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER}if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=console.log;if(!Module["printErr"])Module["printErr"]=console.warn;var nodeFS;var nodePath;Module["read"]=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);var ret=nodeFS["readFileSync"](filename);return binary?ret:ret.toString()};Module["readBinary"]=function readBinary(filename){var ret=Module["read"](filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};Module["load"]=function load(f){globalEval(read(f))};if(!Module["thisProgram"]){if(process["argv"].length>1){Module["thisProgram"]=process["argv"][1].replace(/\\/g,"/")}else{Module["thisProgram"]="unknown-program"}}Module["arguments"]=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",(function(ex){if(!(ex instanceof ExitStatus)){throw ex}}));Module["inspect"]=(function(){return"[Emscripten Module object]"})}else if(ENVIRONMENT_IS_SHELL){if(!Module["print"])Module["print"]=print;if(typeof printErr!="undefined")Module["printErr"]=printErr;if(typeof read!="undefined"){Module["read"]=read}else{Module["read"]=function shell_read(){throw"no read() available"}}Module["readBinary"]=function readBinary(f){if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}var data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){Module["arguments"]=scriptArgs}else if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof quit==="function"){Module["quit"]=(function(status,toThrow){quit(status)})}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){Module["read"]=function shell_read(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){Module["readBinary"]=function readBinary(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}Module["readAsync"]=function readAsync(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function xhr_onload(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response)}else{onerror()}};xhr.onerror=onerror;xhr.send(null)};if(typeof arguments!="undefined"){Module["arguments"]=arguments}if(typeof console!=="undefined"){if(!Module["print"])Module["print"]=function shell_print(x){console.log(x)};if(!Module["printErr"])Module["printErr"]=function shell_printErr(x){console.warn(x)}}else{var TRY_USE_DUMP=false;if(!Module["print"])Module["print"]=TRY_USE_DUMP&&typeof dump!=="undefined"?(function(x){dump(x)}):(function(x){})}if(ENVIRONMENT_IS_WORKER){Module["load"]=importScripts}if(typeof Module["setWindowTitle"]==="undefined"){Module["setWindowTitle"]=(function(title){document.title=title})}}else{throw"Unknown runtime environment. Where are we?"}function globalEval(x){eval.call(null,x)}if(!Module["load"]&&Module["read"]){Module["load"]=function load(f){globalEval(Module["read"](f))}}if(!Module["print"]){Module["print"]=(function(){})}if(!Module["printErr"]){Module["printErr"]=Module["print"]}if(!Module["arguments"]){Module["arguments"]=[]}if(!Module["thisProgram"]){Module["thisProgram"]="./this.program"}if(!Module["quit"]){Module["quit"]=(function(status,toThrow){throw toThrow})}Module.print=Module["print"];Module.printErr=Module["printErr"];Module["preRun"]=[];Module["postRun"]=[];for(var key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=undefined;var Runtime={setTempRet0:(function(value){tempRet0=value;return value}),getTempRet0:(function(){return tempRet0}),stackSave:(function(){return STACKTOP}),stackRestore:(function(stackTop){STACKTOP=stackTop}),getNativeTypeSize:(function(type){switch(type){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:{if(type[type.length-1]==="*"){return Runtime.QUANTUM_SIZE}else if(type[0]==="i"){var bits=parseInt(type.substr(1));assert(bits%8===0);return bits/8}else{return 0}}}}),getNativeFieldSize:(function(type){return Math.max(Runtime.getNativeTypeSize(type),Runtime.QUANTUM_SIZE)}),STACK_ALIGN:16,prepVararg:(function(ptr,type){if(type==="double"||type==="i64"){if(ptr&7){assert((ptr&7)===4);ptr+=4}}else{assert((ptr&3)===0)}return ptr}),getAlignSize:(function(type,size,vararg){if(!vararg&&(type=="i64"||type=="double"))return 8;if(!type)return Math.min(size,8);return Math.min(size||(type?Runtime.getNativeFieldSize(type):0),Runtime.QUANTUM_SIZE)}),dynCall:(function(sig,ptr,args){if(args&&args.length){return Module["dynCall_"+sig].apply(null,[ptr].concat(args))}else{return Module["dynCall_"+sig].call(null,ptr)}}),functionPointers:[],addFunction:(function(func){for(var i=0;i<Runtime.functionPointers.length;i++){if(!Runtime.functionPointers[i]){Runtime.functionPointers[i]=func;return 2*(1+i)}}throw"Finished up all reserved function pointers. Use a higher value for RESERVED_FUNCTION_POINTERS."}),removeFunction:(function(index){Runtime.functionPointers[(index-2)/2]=null}),warnOnce:(function(text){if(!Runtime.warnOnce.shown)Runtime.warnOnce.shown={};if(!Runtime.warnOnce.shown[text]){Runtime.warnOnce.shown[text]=1;Module.printErr(text)}}),funcWrappers:{},getFuncWrapper:(function(func,sig){if(!func)return;assert(sig);if(!Runtime.funcWrappers[sig]){Runtime.funcWrappers[sig]={}}var sigCache=Runtime.funcWrappers[sig];if(!sigCache[func]){if(sig.length===1){sigCache[func]=function dynCall_wrapper(){return Runtime.dynCall(sig,func)}}else if(sig.length===2){sigCache[func]=function dynCall_wrapper(arg){return Runtime.dynCall(sig,func,[arg])}}else{sigCache[func]=function dynCall_wrapper(){return Runtime.dynCall(sig,func,Array.prototype.slice.call(arguments))}}}return sigCache[func]}),getCompilerSetting:(function(name){throw"You must build with -s RETAIN_COMPILER_SETTINGS=1 for Runtime.getCompilerSetting or emscripten_get_compiler_setting to work"}),stackAlloc:(function(size){var ret=STACKTOP;STACKTOP=STACKTOP+size|0;STACKTOP=STACKTOP+15&-16;return ret}),staticAlloc:(function(size){var ret=STATICTOP;STATICTOP=STATICTOP+size|0;STATICTOP=STATICTOP+15&-16;return ret}),dynamicAlloc:(function(size){var ret=HEAP32[DYNAMICTOP_PTR>>2];var end=(ret+size+15|0)&-16;HEAP32[DYNAMICTOP_PTR>>2]=end;if(end>=TOTAL_MEMORY){var success=enlargeMemory();if(!success){HEAP32[DYNAMICTOP_PTR>>2]=ret;return 0}}return ret}),alignMemory:(function(size,quantum){var ret=size=Math.ceil(size/(quantum?quantum:16))*(quantum?quantum:16);return ret}),makeBigInt:(function(low,high,unsigned){var ret=unsigned?+(low>>>0)+ +(high>>>0)*4294967296:+(low>>>0)+ +(high|0)*4294967296;return ret}),GLOBAL_BASE:1024,QUANTUM_SIZE:4,__dummy__:0};Module["Runtime"]=Runtime;var ABORT=0;var EXITSTATUS=0;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function getCFunc(ident){var func=Module["_"+ident];if(!func){try{func=eval("_"+ident)}catch(e){}}assert(func,"Cannot call unknown function "+ident+" (perhaps LLVM optimizations or closure removed it?)");return func}var cwrap,ccall;((function(){var JSfuncs={"stackSave":(function(){Runtime.stackSave()}),"stackRestore":(function(){Runtime.stackRestore()}),"arrayToC":(function(arr){var ret=Runtime.stackAlloc(arr.length);writeArrayToMemory(arr,ret);return ret}),"stringToC":(function(str){var ret=0;if(str!==null&&str!==undefined&&str!==0){var len=(str.length<<2)+1;ret=Runtime.stackAlloc(len);stringToUTF8(str,ret,len)}return ret})};var toC={"string":JSfuncs["stringToC"],"array":JSfuncs["arrayToC"]};ccall=function ccallFunc(ident,returnType,argTypes,args,opts){var func=getCFunc(ident);var cArgs=[];var stack=0;if(args){for(var i=0;i<args.length;i++){var converter=toC[argTypes[i]];if(converter){if(stack===0)stack=Runtime.stackSave();cArgs[i]=converter(args[i])}else{cArgs[i]=args[i]}}}var ret=func.apply(null,cArgs);if(returnType==="string")ret=Pointer_stringify(ret);if(stack!==0){if(opts&&opts.async){EmterpreterAsync.asyncFinalizers.push((function(){Runtime.stackRestore(stack)}));return}Runtime.stackRestore(stack)}return ret};var sourceRegex=/^function\s*[a-zA-Z$_0-9]*\s*\(([^)]*)\)\s*{\s*([^*]*?)[\s;]*(?:return\s*(.*?)[;\s]*)?}$/;function parseJSFunc(jsfunc){var parsed=jsfunc.toString().match(sourceRegex).slice(1);return{arguments:parsed[0],body:parsed[1],returnValue:parsed[2]}}var JSsource=null;function ensureJSsource(){if(!JSsource){JSsource={};for(var fun in JSfuncs){if(JSfuncs.hasOwnProperty(fun)){JSsource[fun]=parseJSFunc(JSfuncs[fun])}}}}cwrap=function cwrap(ident,returnType,argTypes){argTypes=argTypes||[];var cfunc=getCFunc(ident);var numericArgs=argTypes.every((function(type){return type==="number"}));var numericRet=returnType!=="string";if(numericRet&&numericArgs){return cfunc}var argNames=argTypes.map((function(x,i){return"$"+i}));var funcstr="(function("+argNames.join(",")+") {";var nargs=argTypes.length;if(!numericArgs){ensureJSsource();funcstr+="var stack = "+JSsource["stackSave"].body+";";for(var i=0;i<nargs;i++){var arg=argNames[i],type=argTypes[i];if(type==="number")continue;var convertCode=JSsource[type+"ToC"];funcstr+="var "+convertCode.arguments+" = "+arg+";";funcstr+=convertCode.body+";";funcstr+=arg+"=("+convertCode.returnValue+");"}}var cfuncname=parseJSFunc((function(){return cfunc})).returnValue;funcstr+="var ret = "+cfuncname+"("+argNames.join(",")+");";if(!numericRet){var strgfy=parseJSFunc((function(){return Pointer_stringify})).returnValue;funcstr+="ret = "+strgfy+"(ret);"}if(!numericArgs){ensureJSsource();funcstr+=JSsource["stackRestore"].body.replace("()","(stack)")+";"}funcstr+="return ret})";return eval(funcstr)}}))();Module["ccall"]=ccall;Module["cwrap"]=cwrap;function setValue(ptr,value,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":HEAP8[ptr>>0]=value;break;case"i8":HEAP8[ptr>>0]=value;break;case"i16":HEAP16[ptr>>1]=value;break;case"i32":HEAP32[ptr>>2]=value;break;case"i64":tempI64=[value>>>0,(tempDouble=value,+Math_abs(tempDouble)>=1?tempDouble>0?(Math_min(+Math_floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math_ceil((tempDouble- +(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[ptr>>2]=tempI64[0],HEAP32[ptr+4>>2]=tempI64[1];break;case"float":HEAPF32[ptr>>2]=value;break;case"double":HEAPF64[ptr>>3]=value;break;default:abort("invalid type for setValue: "+type)}}Module["setValue"]=setValue;function getValue(ptr,type,noSafe){type=type||"i8";if(type.charAt(type.length-1)==="*")type="i32";switch(type){case"i1":return HEAP8[ptr>>0];case"i8":return HEAP8[ptr>>0];case"i16":return HEAP16[ptr>>1];case"i32":return HEAP32[ptr>>2];case"i64":return HEAP32[ptr>>2];case"float":return HEAPF32[ptr>>2];case"double":return HEAPF64[ptr>>3];default:abort("invalid type for setValue: "+type)}return null}Module["getValue"]=getValue;var ALLOC_NORMAL=0;var ALLOC_STACK=1;var ALLOC_STATIC=2;var ALLOC_DYNAMIC=3;var ALLOC_NONE=4;Module["ALLOC_NORMAL"]=ALLOC_NORMAL;Module["ALLOC_STACK"]=ALLOC_STACK;Module["ALLOC_STATIC"]=ALLOC_STATIC;Module["ALLOC_DYNAMIC"]=ALLOC_DYNAMIC;Module["ALLOC_NONE"]=ALLOC_NONE;function allocate(slab,types,allocator,ptr){var zeroinit,size;if(typeof slab==="number"){zeroinit=true;size=slab}else{zeroinit=false;size=slab.length}var singleType=typeof types==="string"?types:null;var ret;if(allocator==ALLOC_NONE){ret=ptr}else{ret=[typeof _malloc==="function"?_malloc:Runtime.staticAlloc,Runtime.stackAlloc,Runtime.staticAlloc,Runtime.dynamicAlloc][allocator===undefined?ALLOC_STATIC:allocator](Math.max(size,singleType?1:types.length))}if(zeroinit){var ptr=ret,stop;assert((ret&3)==0);stop=ret+(size&~3);for(;ptr<stop;ptr+=4){HEAP32[ptr>>2]=0}stop=ret+size;while(ptr<stop){HEAP8[ptr++>>0]=0}return ret}if(singleType==="i8"){if(slab.subarray||slab.slice){HEAPU8.set(slab,ret)}else{HEAPU8.set(new Uint8Array(slab),ret)}return ret}var i=0,type,typeSize,previousType;while(i<size){var curr=slab[i];if(typeof curr==="function"){curr=Runtime.getFunctionIndex(curr)}type=singleType||types[i];if(type===0){i++;continue}if(type=="i64")type="i32";setValue(ret+i,curr,type);if(previousType!==type){typeSize=Runtime.getNativeTypeSize(type);previousType=type}i+=typeSize}return ret}Module["allocate"]=allocate;function getMemory(size){if(!staticSealed)return Runtime.staticAlloc(size);if(!runtimeInitialized)return Runtime.dynamicAlloc(size);return _malloc(size)}Module["getMemory"]=getMemory;function Pointer_stringify(ptr,length){if(length===0||!ptr)return"";var hasUtf=0;var t;var i=0;while(1){t=HEAPU8[ptr+i>>0];hasUtf|=t;if(t==0&&!length)break;i++;if(length&&i==length)break}if(!length)length=i;var ret="";if(hasUtf<128){var MAX_CHUNK=1024;var curr;while(length>0){curr=String.fromCharCode.apply(String,HEAPU8.subarray(ptr,ptr+Math.min(length,MAX_CHUNK)));ret=ret?ret+curr:curr;ptr+=MAX_CHUNK;length-=MAX_CHUNK}return ret}return Module["UTF8ToString"](ptr)}Module["Pointer_stringify"]=Pointer_stringify;function AsciiToString(ptr){var str="";while(1){var ch=HEAP8[ptr++>>0];if(!ch)return str;str+=String.fromCharCode(ch)}}Module["AsciiToString"]=AsciiToString;function stringToAscii(str,outPtr){return writeAsciiToMemory(str,outPtr,false)}Module["stringToAscii"]=stringToAscii;var UTF8Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf8"):undefined;function UTF8ArrayToString(u8Array,idx){var endPtr=idx;while(u8Array[endPtr])++endPtr;if(endPtr-idx>16&&u8Array.subarray&&UTF8Decoder){return UTF8Decoder.decode(u8Array.subarray(idx,endPtr))}else{var u0,u1,u2,u3,u4,u5;var str="";while(1){u0=u8Array[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}u1=u8Array[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}u2=u8Array[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u3=u8Array[idx++]&63;if((u0&248)==240){u0=(u0&7)<<18|u1<<12|u2<<6|u3}else{u4=u8Array[idx++]&63;if((u0&252)==248){u0=(u0&3)<<24|u1<<18|u2<<12|u3<<6|u4}else{u5=u8Array[idx++]&63;u0=(u0&1)<<30|u1<<24|u2<<18|u3<<12|u4<<6|u5}}}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}}}Module["UTF8ArrayToString"]=UTF8ArrayToString;function UTF8ToString(ptr){return UTF8ArrayToString(HEAPU8,ptr)}Module["UTF8ToString"]=UTF8ToString;function stringToUTF8Array(str,outU8Array,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){if(outIdx>=endIdx)break;outU8Array[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;outU8Array[outIdx++]=192|u>>6;outU8Array[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;outU8Array[outIdx++]=224|u>>12;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=2097151){if(outIdx+3>=endIdx)break;outU8Array[outIdx++]=240|u>>18;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else if(u<=67108863){if(outIdx+4>=endIdx)break;outU8Array[outIdx++]=248|u>>24;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}else{if(outIdx+5>=endIdx)break;outU8Array[outIdx++]=252|u>>30;outU8Array[outIdx++]=128|u>>24&63;outU8Array[outIdx++]=128|u>>18&63;outU8Array[outIdx++]=128|u>>12&63;outU8Array[outIdx++]=128|u>>6&63;outU8Array[outIdx++]=128|u&63}}outU8Array[outIdx]=0;return outIdx-startIdx}Module["stringToUTF8Array"]=stringToUTF8Array;function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}Module["stringToUTF8"]=stringToUTF8;function lengthBytesUTF8(str){var len=0;for(var i=0;i<str.length;++i){var u=str.charCodeAt(i);if(u>=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127){++len}else if(u<=2047){len+=2}else if(u<=65535){len+=3}else if(u<=2097151){len+=4}else if(u<=67108863){len+=5}else{len+=6}}return len}Module["lengthBytesUTF8"]=lengthBytesUTF8;var UTF16Decoder=typeof TextDecoder!=="undefined"?new TextDecoder("utf-16le"):undefined;function demangle(func){var __cxa_demangle_func=Module["___cxa_demangle"]||Module["__cxa_demangle"];if(__cxa_demangle_func){try{var s=func.substr(1);var len=lengthBytesUTF8(s)+1;var buf=_malloc(len);stringToUTF8(s,buf,len);var status=_malloc(4);var ret=__cxa_demangle_func(buf,0,0,status);if(getValue(status,"i32")===0&&ret){return Pointer_stringify(ret)}}catch(e){}finally{if(buf)_free(buf);if(status)_free(status);if(ret)_free(ret)}return func}Runtime.warnOnce("warning: build with -s DEMANGLE_SUPPORT=1 to link in libcxxabi demangling");return func}function demangleAll(text){var regex=/__Z[\w\d_]+/g;return text.replace(regex,(function(x){var y=demangle(x);return x===y?x:x+" ["+y+"]"}))}function jsStackTrace(){var err=new Error;if(!err.stack){try{throw new Error(0)}catch(e){err=e}if(!err.stack){return"(no stack trace available)"}}return err.stack.toString()}function stackTrace(){var js=jsStackTrace();if(Module["extraStackTrace"])js+="\n"+Module["extraStackTrace"]();return demangleAll(js)}Module["stackTrace"]=stackTrace;var WASM_PAGE_SIZE=65536;var ASMJS_PAGE_SIZE=16777216;function alignUp(x,multiple){if(x%multiple>0){x+=multiple-x%multiple}return x}var HEAP,buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function updateGlobalBuffer(buf){Module["buffer"]=buffer=buf}function updateGlobalBufferViews(){Module["HEAP8"]=HEAP8=new Int8Array(buffer);Module["HEAP16"]=HEAP16=new Int16Array(buffer);Module["HEAP32"]=HEAP32=new Int32Array(buffer);Module["HEAPU8"]=HEAPU8=new Uint8Array(buffer);Module["HEAPU16"]=HEAPU16=new Uint16Array(buffer);Module["HEAPU32"]=HEAPU32=new Uint32Array(buffer);Module["HEAPF32"]=HEAPF32=new Float32Array(buffer);Module["HEAPF64"]=HEAPF64=new Float64Array(buffer)}var STATIC_BASE,STATICTOP,staticSealed;var STACK_BASE,STACKTOP,STACK_MAX;var DYNAMIC_BASE,DYNAMICTOP_PTR;STATIC_BASE=STATICTOP=STACK_BASE=STACKTOP=STACK_MAX=DYNAMIC_BASE=DYNAMICTOP_PTR=0;staticSealed=false;function abortOnCannotGrowMemory(){abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value "+TOTAL_MEMORY+", (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime, or (3) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 ")}function enlargeMemory(){abortOnCannotGrowMemory()}var TOTAL_STACK=Module["TOTAL_STACK"]||5242880;var TOTAL_MEMORY=Module["TOTAL_MEMORY"]||134217728;if(TOTAL_MEMORY<TOTAL_STACK)Module.printErr("TOTAL_MEMORY should be larger than TOTAL_STACK, was "+TOTAL_MEMORY+"! (TOTAL_STACK="+TOTAL_STACK+")");if(Module["buffer"]){buffer=Module["buffer"]}else{if(typeof WebAssembly==="object"&&typeof WebAssembly.Memory==="function"){Module["wasmMemory"]=new WebAssembly.Memory({"initial":TOTAL_MEMORY/WASM_PAGE_SIZE,"maximum":TOTAL_MEMORY/WASM_PAGE_SIZE});buffer=Module["wasmMemory"].buffer}else{buffer=new ArrayBuffer(TOTAL_MEMORY)}}updateGlobalBufferViews();function getTotalMemory(){return TOTAL_MEMORY}HEAP32[0]=1668509029;HEAP16[1]=25459;if(HEAPU8[2]!==115||HEAPU8[3]!==99)throw"Runtime error: expected the system to be little-endian!";Module["HEAP"]=HEAP;Module["buffer"]=buffer;Module["HEAP8"]=HEAP8;Module["HEAP16"]=HEAP16;Module["HEAP32"]=HEAP32;Module["HEAPU8"]=HEAPU8;Module["HEAPU16"]=HEAPU16;Module["HEAPU32"]=HEAPU32;Module["HEAPF32"]=HEAPF32;Module["HEAPF64"]=HEAPF64;function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback();continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){Module["dynCall_v"](func)}else{Module["dynCall_vi"](func,callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function ensureInitRuntime(){if(runtimeInitialized)return;runtimeInitialized=true;callRuntimeCallbacks(__ATINIT__)}function preMain(){callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){callRuntimeCallbacks(__ATEXIT__);runtimeExited=true}function postRun(){if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}Module["addOnPreRun"]=addOnPreRun;function addOnInit(cb){__ATINIT__.unshift(cb)}Module["addOnInit"]=addOnInit;function addOnPreMain(cb){__ATMAIN__.unshift(cb)}Module["addOnPreMain"]=addOnPreMain;function addOnExit(cb){__ATEXIT__.unshift(cb)}Module["addOnExit"]=addOnExit;function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}Module["addOnPostRun"]=addOnPostRun;function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}Module["intArrayFromString"]=intArrayFromString;function intArrayToString(array){var ret=[];for(var i=0;i<array.length;i++){var chr=array[i];if(chr>255){chr&=255}ret.push(String.fromCharCode(chr))}return ret.join("")}Module["intArrayToString"]=intArrayToString;function writeStringToMemory(string,buffer,dontAddNull){Runtime.warnOnce("writeStringToMemory is deprecated and should not be called! Use stringToUTF8() instead!");var lastChar,end;if(dontAddNull){end=buffer+lengthBytesUTF8(string);lastChar=HEAP8[end]}stringToUTF8(string,buffer,Infinity);if(dontAddNull)HEAP8[end]=lastChar}Module["writeStringToMemory"]=writeStringToMemory;function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}Module["writeArrayToMemory"]=writeArrayToMemory;function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i<str.length;++i){HEAP8[buffer++>>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}Module["writeAsciiToMemory"]=writeAsciiToMemory;if(!Math["imul"]||Math["imul"](4294967295,5)!==-5)Math["imul"]=function imul(a,b){var ah=a>>>16;var al=a&65535;var bh=b>>>16;var bl=b&65535;return al*bl+(ah*bl+al*bh<<16)|0};Math.imul=Math["imul"];if(!Math["fround"]){var froundBuffer=new Float32Array(1);Math["fround"]=(function(x){froundBuffer[0]=x;return froundBuffer[0]})}Math.fround=Math["fround"];if(!Math["clz32"])Math["clz32"]=(function(x){x=x>>>0;for(var i=0;i<32;i++){if(x&1<<31-i)return i}return 32});Math.clz32=Math["clz32"];if(!Math["trunc"])Math["trunc"]=(function(x){return x<0?Math.ceil(x):Math.floor(x)});Math.trunc=Math["trunc"];var Math_abs=Math.abs;var Math_cos=Math.cos;var Math_sin=Math.sin;var Math_tan=Math.tan;var Math_acos=Math.acos;var Math_asin=Math.asin;var Math_atan=Math.atan;var Math_atan2=Math.atan2;var Math_exp=Math.exp;var Math_log=Math.log;var Math_sqrt=Math.sqrt;var Math_ceil=Math.ceil;var Math_floor=Math.floor;var Math_pow=Math.pow;var Math_imul=Math.imul;var Math_fround=Math.fround;var Math_round=Math.round;var Math_min=Math.min;var Math_clz32=Math.clz32;var Math_trunc=Math.trunc;var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function addRunDependency(id){runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}Module["addRunDependency"]=addRunDependency;function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["removeRunDependency"]=removeRunDependency;Module["preloadedImages"]={};Module["preloadedAudios"]={};var memoryInitializer=null;function integrateWasmJS(){var method=Module["wasmJSMethod"]||"native-wasm";Module["wasmJSMethod"]=method;var wasmTextFile=Module["wasmTextFile"]||"Decoder.wast";var wasmBinaryFile=Module["wasmBinaryFile"]||"Decoder.wasm";var asmjsCodeFile=Module["asmjsCodeFile"]||"Decoder.temp.asm.js";if(typeof Module["locateFile"]==="function"){wasmTextFile=Module["locateFile"](wasmTextFile);wasmBinaryFile=Module["locateFile"](wasmBinaryFile);asmjsCodeFile=Module["locateFile"](asmjsCodeFile)}var wasmPageSize=64*1024;var asm2wasmImports={"f64-rem":(function(x,y){return x%y}),"f64-to-int":(function(x){return x|0}),"i32s-div":(function(x,y){return(x|0)/(y|0)|0}),"i32u-div":(function(x,y){return(x>>>0)/(y>>>0)>>>0}),"i32s-rem":(function(x,y){return(x|0)%(y|0)|0}),"i32u-rem":(function(x,y){return(x>>>0)%(y>>>0)>>>0}),"debugger":(function(){debugger})};var info={"global":null,"env":null,"asm2wasm":asm2wasmImports,"parent":Module};var exports=null;function lookupImport(mod,base){var lookup=info;if(mod.indexOf(".")<0){lookup=(lookup||{})[mod]}else{var parts=mod.split(".");lookup=(lookup||{})[parts[0]];lookup=(lookup||{})[parts[1]]}if(base){lookup=(lookup||{})[base]}if(lookup===undefined){abort("bad lookupImport to ("+mod+")."+base)}return lookup}function mergeMemory(newBuffer){var oldBuffer=Module["buffer"];if(newBuffer.byteLength<oldBuffer.byteLength){Module["printErr"]("the new buffer in mergeMemory is smaller than the previous one. in native wasm, we should grow memory here")}var oldView=new Int8Array(oldBuffer);var newView=new Int8Array(newBuffer);if(!memoryInitializer){oldView.set(newView.subarray(Module["STATIC_BASE"],Module["STATIC_BASE"]+Module["STATIC_BUMP"]),Module["STATIC_BASE"])}newView.set(oldView);updateGlobalBuffer(newBuffer);updateGlobalBufferViews()}var WasmTypes={none:0,i32:1,i64:2,f32:3,f64:4};function fixImports(imports){if(!0)return imports;var ret={};for(var i in imports){var fixed=i;if(fixed[0]=="_")fixed=fixed.substr(1);ret[fixed]=imports[i]}return ret}function getBinary(){try{var binary;if(Module["wasmBinary"]){binary=Module["wasmBinary"];binary=new Uint8Array(binary)}else if(Module["readBinary"]){binary=Module["readBinary"](wasmBinaryFile)}else{throw"on the web, we need the wasm binary to be preloaded and set on Module['wasmBinary']. emcc.py will do that for you when generating HTML (but not JS)"}return binary}catch(err){abort(err)}}function getBinaryPromise(){if(!Module["wasmBinary"]&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then((function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}))}return new Promise((function(resolve,reject){resolve(getBinary())}))}function doNativeWasm(global,env,providedBuffer){if(typeof WebAssembly!=="object"){Module["printErr"]("no native wasm support detected");return false}if(!(Module["wasmMemory"]instanceof WebAssembly.Memory)){Module["printErr"]("no native wasm Memory in use");return false}env["memory"]=Module["wasmMemory"];info["global"]={"NaN":NaN,"Infinity":Infinity};info["global.Math"]=global.Math;info["env"]=env;function receiveInstance(instance){exports=instance.exports;if(exports.memory)mergeMemory(exports.memory);Module["asm"]=exports;Module["usingWasm"]=true;removeRunDependency("wasm-instantiate")}addRunDependency("wasm-instantiate");if(Module["instantiateWasm"]){try{return Module["instantiateWasm"](info,receiveInstance)}catch(e){Module["printErr"]("Module.instantiateWasm callback failed with error: "+e);return false}}function receiveInstantiatedSource(output){receiveInstance(output["instance"])}function instantiateArrayBuffer(receiver){getBinaryPromise().then((function(binary){return WebAssembly.instantiate(binary,info)})).then(receiver).catch((function(reason){Module["printErr"]("failed to asynchronously prepare wasm: "+reason);abort(reason)}))}if(!Module["wasmBinary"]&&typeof WebAssembly.instantiateStreaming==="function"){WebAssembly.instantiateStreaming(fetch(wasmBinaryFile,{credentials:"same-origin"}),info).then(receiveInstantiatedSource).catch((function(reason){Module["printErr"]("wasm streaming compile failed: "+reason);Module["printErr"]("falling back to ArrayBuffer instantiation");instantiateArrayBuffer(receiveInstantiatedSource)}))}else{instantiateArrayBuffer(receiveInstantiatedSource)}return{}}Module["asmPreload"]=Module["asm"];var asmjsReallocBuffer=Module["reallocBuffer"];var wasmReallocBuffer=(function(size){var PAGE_MULTIPLE=Module["usingWasm"]?WASM_PAGE_SIZE:ASMJS_PAGE_SIZE;size=alignUp(size,PAGE_MULTIPLE);var old=Module["buffer"];var oldSize=old.byteLength;if(Module["usingWasm"]){try{var result=Module["wasmMemory"].grow((size-oldSize)/wasmPageSize);if(result!==(-1|0)){return Module["buffer"]=Module["wasmMemory"].buffer}else{return null}}catch(e){return null}}else{exports["__growWasmMemory"]((size-oldSize)/wasmPageSize);return Module["buffer"]!==old?Module["buffer"]:null}});Module["reallocBuffer"]=(function(size){if(finalMethod==="asmjs"){return asmjsReallocBuffer(size)}else{return wasmReallocBuffer(size)}});var finalMethod="";Module["asm"]=(function(global,env,providedBuffer){global=fixImports(global);env=fixImports(env);if(!env["table"]){var TABLE_SIZE=Module["wasmTableSize"];if(TABLE_SIZE===undefined)TABLE_SIZE=1024;var MAX_TABLE_SIZE=Module["wasmMaxTableSize"];if(typeof WebAssembly==="object"&&typeof WebAssembly.Table==="function"){if(MAX_TABLE_SIZE!==undefined){env["table"]=new WebAssembly.Table({"initial":TABLE_SIZE,"maximum":MAX_TABLE_SIZE,"element":"anyfunc"})}else{env["table"]=new WebAssembly.Table({"initial":TABLE_SIZE,element:"anyfunc"})}}else{env["table"]=new Array(TABLE_SIZE)}Module["wasmTable"]=env["table"]}if(!env["memoryBase"]){env["memoryBase"]=Module["STATIC_BASE"]}if(!env["tableBase"]){env["tableBase"]=0}var exports;exports=doNativeWasm(global,env,providedBuffer);if(!exports)abort("no binaryen method succeeded. consider enabling more options, like interpreting, if you want that: https://github.com/kripken/emscripten/wiki/WebAssembly#binaryen-methods");return exports});var methodHandler=Module["asm"]}integrateWasmJS();var ASM_CONSTS=[];STATIC_BASE=Runtime.GLOBAL_BASE;STATICTOP=STATIC_BASE+282224;__ATINIT__.push({func:(function(){__GLOBAL__sub_I_Decoder_cpp()})},{func:(function(){__GLOBAL__sub_I_bind_cpp()})});memoryInitializer=Module["wasmJSMethod"].indexOf("asmjs")>=0||Module["wasmJSMethod"].indexOf("interpret-asm2wasm")>=0?"Decoder.js.mem":null;var STATIC_BUMP=282224;Module["STATIC_BASE"]=STATIC_BASE;Module["STATIC_BUMP"]=STATIC_BUMP;var tempDoublePtr=STATICTOP;STATICTOP+=16;var structRegistrations={};function embind_init_charCodes(){var codes=new Array(256);for(var i=0;i<256;++i){codes[i]=String.fromCharCode(i)}embind_charCodes=codes}var embind_charCodes=undefined;function readLatin1String(ptr){var ret="";var c=ptr;while(HEAPU8[c]){ret+=embind_charCodes[HEAPU8[c++]]}return ret}var char_0=48;var char_9=57;function makeLegalFunctionName(name){if(undefined===name){return"_unknown"}name=name.replace(/[^a-zA-Z0-9_]/g,"$");var f=name.charCodeAt(0);if(f>=char_0&&f<=char_9){return"_"+name}else{return name}}function createNamedFunction(name,body){name=makeLegalFunctionName(name);return(new Function("body","return function "+name+"() {\n"+' "use strict";'+" return body.apply(this, arguments);\n"+"};\n"))(body)}function extendError(baseErrorType,errorName){var errorClass=createNamedFunction(errorName,(function(message){this.name=errorName;this.message=message;var stack=(new Error(message)).stack;if(stack!==undefined){this.stack=this.toString()+"\n"+stack.replace(/^Error(:[^\n]*)?\n/,"")}}));errorClass.prototype=Object.create(baseErrorType.prototype);errorClass.prototype.constructor=errorClass;errorClass.prototype.toString=(function(){if(this.message===undefined){return this.name}else{return this.name+": "+this.message}});return errorClass}var BindingError=undefined;function throwBindingError(message){throw new BindingError(message)}function requireFunction(signature,rawFunction){signature=readLatin1String(signature);function makeDynCaller(dynCall){var args=[];for(var i=1;i<signature.length;++i){args.push("a"+i)}var name="dynCall_"+signature+"_"+rawFunction;var body="return function "+name+"("+args.join(", ")+") {\n";body+=" return dynCall(rawFunction"+(args.length?", ":"")+args.join(", ")+");\n";body+="};\n";return(new Function("dynCall","rawFunction",body))(dynCall,rawFunction)}var fp;if(Module["FUNCTION_TABLE_"+signature]!==undefined){fp=Module["FUNCTION_TABLE_"+signature][rawFunction]}else if(typeof FUNCTION_TABLE!=="undefined"){fp=FUNCTION_TABLE[rawFunction]}else{var dc=Module["asm"]["dynCall_"+signature];if(dc===undefined){dc=Module["asm"]["dynCall_"+signature.replace(/f/g,"d")];if(dc===undefined){throwBindingError("No dynCall invoker for signature: "+signature)}}fp=makeDynCaller(dc)}if(typeof fp!=="function"){throwBindingError("unknown function pointer with signature "+signature+": "+rawFunction)}return fp}function __embind_register_value_object(rawType,name,constructorSignature,rawConstructor,destructorSignature,rawDestructor){structRegistrations[rawType]={name:readLatin1String(name),rawConstructor:requireFunction(constructorSignature,rawConstructor),rawDestructor:requireFunction(destructorSignature,rawDestructor),fields:[]}}function ___assert_fail(condition,filename,line,func){ABORT=true;throw"Assertion failed: "+Pointer_stringify(condition)+", at: "+[filename?Pointer_stringify(filename):"unknown filename",line,func?Pointer_stringify(func):"unknown function"]+" at "+stackTrace()}var awaitingDependencies={};var registeredTypes={};var typeDependencies={};var InternalError=undefined;function throwInternalError(message){throw new InternalError(message)}function whenDependentTypesAreResolved(myTypes,dependentTypes,getTypeConverters){myTypes.forEach((function(type){typeDependencies[type]=dependentTypes}));function onComplete(typeConverters){var myTypeConverters=getTypeConverters(typeConverters);if(myTypeConverters.length!==myTypes.length){throwInternalError("Mismatched type converter count")}for(var i=0;i<myTypes.length;++i){registerType(myTypes[i],myTypeConverters[i])}}var typeConverters=new Array(dependentTypes.length);var unregisteredTypes=[];var registered=0;dependentTypes.forEach((function(dt,i){if(registeredTypes.hasOwnProperty(dt)){typeConverters[i]=registeredTypes[dt]}else{unregisteredTypes.push(dt);if(!awaitingDependencies.hasOwnProperty(dt)){awaitingDependencies[dt]=[]}awaitingDependencies[dt].push((function(){typeConverters[i]=registeredTypes[dt];++registered;if(registered===unregisteredTypes.length){onComplete(typeConverters)}}))}}));if(0===unregisteredTypes.length){onComplete(typeConverters)}}function registerType(rawType,registeredInstance,options){options=options||{};if(!("argPackAdvance"in registeredInstance)){throw new TypeError("registerType registeredInstance requires argPackAdvance")}var name=registeredInstance.name;if(!rawType){throwBindingError('type "'+name+'" must have a positive integer typeid pointer')}if(registeredTypes.hasOwnProperty(rawType)){if(options.ignoreDuplicateRegistrations){return}else{throwBindingError("Cannot register type '"+name+"' twice")}}registeredTypes[rawType]=registeredInstance;delete typeDependencies[rawType];if(awaitingDependencies.hasOwnProperty(rawType)){var callbacks=awaitingDependencies[rawType];delete awaitingDependencies[rawType];callbacks.forEach((function(cb){cb()}))}}function __embind_register_void(rawType,name){name=readLatin1String(name);registerType(rawType,{isVoid:true,name:name,"argPackAdvance":0,"fromWireType":(function(){return undefined}),"toWireType":(function(destructors,o){return undefined})})}function _pthread_mutex_destroy(){}function __ZSt18uncaught_exceptionv(){return!!__ZSt18uncaught_exceptionv.uncaught_exception}var EXCEPTIONS={last:0,caught:[],infos:{},deAdjust:(function(adjusted){if(!adjusted||EXCEPTIONS.infos[adjusted])return adjusted;for(var ptr in EXCEPTIONS.infos){var info=EXCEPTIONS.infos[ptr];if(info.adjusted===adjusted){return ptr}}return adjusted}),addRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount++}),decRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];assert(info.refcount>0);info.refcount--;if(info.refcount===0&&!info.rethrown){if(info.destructor){Module["dynCall_vi"](info.destructor,ptr)}delete EXCEPTIONS.infos[ptr];___cxa_free_exception(ptr)}}),clearRef:(function(ptr){if(!ptr)return;var info=EXCEPTIONS.infos[ptr];info.refcount=0})};function ___resumeException(ptr){if(!EXCEPTIONS.last){EXCEPTIONS.last=ptr}throw ptr+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."}function ___cxa_find_matching_catch(){var thrown=EXCEPTIONS.last;if(!thrown){return(Runtime.setTempRet0(0),0)|0}var info=EXCEPTIONS.infos[thrown];var throwntype=info.type;if(!throwntype){return(Runtime.setTempRet0(0),thrown)|0}var typeArray=Array.prototype.slice.call(arguments);var pointer=Module["___cxa_is_pointer_type"](throwntype);if(!___cxa_find_matching_catch.buffer)___cxa_find_matching_catch.buffer=_malloc(4);HEAP32[___cxa_find_matching_catch.buffer>>2]=thrown;thrown=___cxa_find_matching_catch.buffer;for(var i=0;i<typeArray.length;i++){if(typeArray[i]&&Module["___cxa_can_catch"](typeArray[i],throwntype,thrown)){thrown=HEAP32[thrown>>2];info.adjusted=thrown;return(Runtime.setTempRet0(typeArray[i]),thrown)|0}}thrown=HEAP32[thrown>>2];return(Runtime.setTempRet0(throwntype),thrown)|0}function ___cxa_throw(ptr,type,destructor){EXCEPTIONS.infos[ptr]={ptr:ptr,adjusted:ptr,type:type,destructor:destructor,refcount:0,caught:false,rethrown:false};EXCEPTIONS.last=ptr;if(!("uncaught_exception"in __ZSt18uncaught_exceptionv)){__ZSt18uncaught_exceptionv.uncaught_exception=1}else{__ZSt18uncaught_exceptionv.uncaught_exception++}throw ptr+" - Exception catching is disabled, this exception cannot be caught. Compile with -s DISABLE_EXCEPTION_CATCHING=0 or DISABLE_EXCEPTION_CATCHING=2 to catch."}function getShiftFromSize(size){switch(size){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+size)}}function __embind_register_bool(rawType,name,size,trueValue,falseValue){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":(function(wt){return!!wt}),"toWireType":(function(destructors,o){return o?trueValue:falseValue}),"argPackAdvance":8,"readValueFromPointer":(function(pointer){var heap;if(size===1){heap=HEAP8}else if(size===2){heap=HEAP16}else if(size===4){heap=HEAP32}else{throw new TypeError("Unknown boolean type size: "+name)}return this["fromWireType"](heap[pointer>>shift])}),destructorFunction:null})}function ___gxx_personality_v0(){}function _pthread_cond_signal(){return 0}function _abort(){Module["abort"]()}function _pthread_cond_destroy(){return 0}function simpleReadValueFromPointer(pointer){return this["fromWireType"](HEAPU32[pointer>>2])}function __embind_register_std_string(rawType,name){name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":(function(value){var length=HEAPU32[value>>2];var a=new Array(length);for(var i=0;i<length;++i){a[i]=String.fromCharCode(HEAPU8[value+4+i])}_free(value);return a.join("")}),"toWireType":(function(destructors,value){if(value instanceof ArrayBuffer){value=new Uint8Array(value)}function getTAElement(ta,index){return ta[index]}function getStringElement(string,index){return string.charCodeAt(index)}var getElement;if(value instanceof Uint8Array){getElement=getTAElement}else if(value instanceof Uint8ClampedArray){getElement=getTAElement}else if(value instanceof Int8Array){getElement=getTAElement}else if(typeof value==="string"){getElement=getStringElement}else{throwBindingError("Cannot pass non-string to std::string")}var length=value.length;var ptr=_malloc(4+length);HEAPU32[ptr>>2]=length;for(var i=0;i<length;++i){var charCode=getElement(value,i);if(charCode>255){_free(ptr);throwBindingError("String has UTF-16 code units that do not fit in 8 bits")}HEAPU8[ptr+4+i]=charCode}if(destructors!==null){destructors.push(_free,ptr)}return ptr}),"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:(function(ptr){_free(ptr)})})}function _embind_repr(v){if(v===null){return"null"}var t=typeof v;if(t==="object"||t==="array"||t==="function"){return v.toString()}else{return""+v}}function integerReadValueFromPointer(name,shift,signed){switch(shift){case 0:return signed?function readS8FromPointer(pointer){return HEAP8[pointer]}:function readU8FromPointer(pointer){return HEAPU8[pointer]};case 1:return signed?function readS16FromPointer(pointer){return HEAP16[pointer>>1]}:function readU16FromPointer(pointer){return HEAPU16[pointer>>1]};case 2:return signed?function readS32FromPointer(pointer){return HEAP32[pointer>>2]}:function readU32FromPointer(pointer){return HEAPU32[pointer>>2]};default:throw new TypeError("Unknown integer type: "+name)}}function __embind_register_integer(primitiveType,name,size,minRange,maxRange){name=readLatin1String(name);if(maxRange===-1){maxRange=4294967295}var shift=getShiftFromSize(size);var fromWireType=(function(value){return value});if(minRange===0){var bitshift=32-8*size;fromWireType=(function(value){return value<<bitshift>>>bitshift})}var isUnsignedType=name.indexOf("unsigned")!=-1;registerType(primitiveType,{name:name,"fromWireType":fromWireType,"toWireType":(function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}if(value<minRange||value>maxRange){throw new TypeError('Passing a number "'+_embind_repr(value)+'" from JS side to C/C++ side to an argument of type "'+name+'", which is outside the valid range ['+minRange+", "+maxRange+"]!")}return isUnsignedType?value>>>0:value|0}),"argPackAdvance":8,"readValueFromPointer":integerReadValueFromPointer(name,shift,minRange!==0),destructorFunction:null})}function _pthread_once(ptr,func){if(!_pthread_once.seen)_pthread_once.seen={};if(ptr in _pthread_once.seen)return;Module["dynCall_v"](func);_pthread_once.seen[ptr]=1}function _pthread_create(){return 11}function __embind_register_value_object_field(structType,fieldName,getterReturnType,getterSignature,getter,getterContext,setterArgumentType,setterSignature,setter,setterContext){structRegistrations[structType].fields.push({fieldName:readLatin1String(fieldName),getterReturnType:getterReturnType,getter:requireFunction(getterSignature,getter),getterContext:getterContext,setterArgumentType:setterArgumentType,setter:requireFunction(setterSignature,setter),setterContext:setterContext})}function ___lock(){}function ___unlock(){}var PTHREAD_SPECIFIC={};function _pthread_getspecific(key){return PTHREAD_SPECIFIC[key]||0}function runDestructors(destructors){while(destructors.length){var ptr=destructors.pop();var del=destructors.pop();del(ptr)}}function __embind_finalize_value_object(structType){var reg=structRegistrations[structType];delete structRegistrations[structType];var rawConstructor=reg.rawConstructor;var rawDestructor=reg.rawDestructor;var fieldRecords=reg.fields;var fieldTypes=fieldRecords.map((function(field){return field.getterReturnType})).concat(fieldRecords.map((function(field){return field.setterArgumentType})));whenDependentTypesAreResolved([structType],fieldTypes,(function(fieldTypes){var fields={};fieldRecords.forEach((function(field,i){var fieldName=field.fieldName;var getterReturnType=fieldTypes[i];var getter=field.getter;var getterContext=field.getterContext;var setterArgumentType=fieldTypes[i+fieldRecords.length];var setter=field.setter;var setterContext=field.setterContext;fields[fieldName]={read:(function(ptr){return getterReturnType["fromWireType"](getter(getterContext,ptr))}),write:(function(ptr,o){var destructors=[];setter(setterContext,ptr,setterArgumentType["toWireType"](destructors,o));runDestructors(destructors)})}}));return[{name:reg.name,"fromWireType":(function(ptr){var rv={};for(var i in fields){rv[i]=fields[i].read(ptr)}rawDestructor(ptr);return rv}),"toWireType":(function(destructors,o){for(var fieldName in fields){if(!(fieldName in o)){throw new TypeError("Missing field")}}var ptr=rawConstructor();for(fieldName in fields){fields[fieldName].write(ptr,o[fieldName])}if(destructors!==null){destructors.push(rawDestructor,ptr)}return ptr}),"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:rawDestructor}]}))}var PTHREAD_SPECIFIC_NEXT_KEY=1;var ERRNO_CODES={EPERM:1,ENOENT:2,ESRCH:3,EINTR:4,EIO:5,ENXIO:6,E2BIG:7,ENOEXEC:8,EBADF:9,ECHILD:10,EAGAIN:11,EWOULDBLOCK:11,ENOMEM:12,EACCES:13,EFAULT:14,ENOTBLK:15,EBUSY:16,EEXIST:17,EXDEV:18,ENODEV:19,ENOTDIR:20,EISDIR:21,EINVAL:22,ENFILE:23,EMFILE:24,ENOTTY:25,ETXTBSY:26,EFBIG:27,ENOSPC:28,ESPIPE:29,EROFS:30,EMLINK:31,EPIPE:32,EDOM:33,ERANGE:34,ENOMSG:42,EIDRM:43,ECHRNG:44,EL2NSYNC:45,EL3HLT:46,EL3RST:47,ELNRNG:48,EUNATCH:49,ENOCSI:50,EL2HLT:51,EDEADLK:35,ENOLCK:37,EBADE:52,EBADR:53,EXFULL:54,ENOANO:55,EBADRQC:56,EBADSLT:57,EDEADLOCK:35,EBFONT:59,ENOSTR:60,ENODATA:61,ETIME:62,ENOSR:63,ENONET:64,ENOPKG:65,EREMOTE:66,ENOLINK:67,EADV:68,ESRMNT:69,ECOMM:70,EPROTO:71,EMULTIHOP:72,EDOTDOT:73,EBADMSG:74,ENOTUNIQ:76,EBADFD:77,EREMCHG:78,ELIBACC:79,ELIBBAD:80,ELIBSCN:81,ELIBMAX:82,ELIBEXEC:83,ENOSYS:38,ENOTEMPTY:39,ENAMETOOLONG:36,ELOOP:40,EOPNOTSUPP:95,EPFNOSUPPORT:96,ECONNRESET:104,ENOBUFS:105,EAFNOSUPPORT:97,EPROTOTYPE:91,ENOTSOCK:88,ENOPROTOOPT:92,ESHUTDOWN:108,ECONNREFUSED:111,EADDRINUSE:98,ECONNABORTED:103,ENETUNREACH:101,ENETDOWN:100,ETIMEDOUT:110,EHOSTDOWN:112,EHOSTUNREACH:113,EINPROGRESS:115,EALREADY:114,EDESTADDRREQ:89,EMSGSIZE:90,EPROTONOSUPPORT:93,ESOCKTNOSUPPORT:94,EADDRNOTAVAIL:99,ENETRESET:102,EISCONN:106,ENOTCONN:107,ETOOMANYREFS:109,EUSERS:87,EDQUOT:122,ESTALE:116,ENOTSUP:95,ENOMEDIUM:123,EILSEQ:84,EOVERFLOW:75,ECANCELED:125,ENOTRECOVERABLE:131,EOWNERDEAD:130,ESTRPIPE:86};function _pthread_key_create(key,destructor){if(key==0){return ERRNO_CODES.EINVAL}HEAP32[key>>2]=PTHREAD_SPECIFIC_NEXT_KEY;PTHREAD_SPECIFIC[PTHREAD_SPECIFIC_NEXT_KEY]=0;PTHREAD_SPECIFIC_NEXT_KEY++;return 0}function _pthread_mutex_init(){}var emval_free_list=[];var emval_handle_array=[{},{value:undefined},{value:null},{value:true},{value:false}];function __emval_decref(handle){if(handle>4&&0===--emval_handle_array[handle].refcount){emval_handle_array[handle]=undefined;emval_free_list.push(handle)}}function count_emval_handles(){var count=0;for(var i=5;i<emval_handle_array.length;++i){if(emval_handle_array[i]!==undefined){++count}}return count}function get_first_emval(){for(var i=5;i<emval_handle_array.length;++i){if(emval_handle_array[i]!==undefined){return emval_handle_array[i]}}return null}function init_emval(){Module["count_emval_handles"]=count_emval_handles;Module["get_first_emval"]=get_first_emval}function __emval_register(value){switch(value){case undefined:{return 1};case null:{return 2};case true:{return 3};case false:{return 4};default:{var handle=emval_free_list.length?emval_free_list.pop():emval_handle_array.length;emval_handle_array[handle]={refcount:1,value:value};return handle}}}function __embind_register_emval(rawType,name){name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":(function(handle){var rv=emval_handle_array[handle].value;__emval_decref(handle);return rv}),"toWireType":(function(destructors,value){return __emval_register(value)}),"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:null})}function _pthread_setspecific(key,value){if(!(key in PTHREAD_SPECIFIC)){return ERRNO_CODES.EINVAL}PTHREAD_SPECIFIC[key]=value;return 0}function _pthread_cond_timedwait(){return 0}function ___cxa_allocate_exception(size){return _malloc(size)}var SYSCALLS={varargs:0,get:(function(varargs){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret}),getStr:(function(){var ret=Pointer_stringify(SYSCALLS.get());return ret}),get64:(function(){var low=SYSCALLS.get(),high=SYSCALLS.get();if(low>=0)assert(high===0);else assert(high===-1);return low}),getZero:(function(){assert(SYSCALLS.get()===0)})};function ___syscall54(which,varargs){SYSCALLS.varargs=varargs;try{return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___cxa_pure_virtual(){ABORT=true;throw"Pure virtual function called!"}function floatReadValueFromPointer(name,shift){switch(shift){case 2:return(function(pointer){return this["fromWireType"](HEAPF32[pointer>>2])});case 3:return(function(pointer){return this["fromWireType"](HEAPF64[pointer>>3])});default:throw new TypeError("Unknown float type: "+name)}}function __embind_register_float(rawType,name,size){var shift=getShiftFromSize(size);name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":(function(value){return value}),"toWireType":(function(destructors,value){if(typeof value!=="number"&&typeof value!=="boolean"){throw new TypeError('Cannot convert "'+_embind_repr(value)+'" to '+this.name)}return value}),"argPackAdvance":8,"readValueFromPointer":floatReadValueFromPointer(name,shift),destructorFunction:null})}function _gettimeofday(ptr){var now=Date.now();HEAP32[ptr>>2]=now/1e3|0;HEAP32[ptr+4>>2]=now%1e3*1e3|0;return 0}function _pthread_join(){}function _pthread_cond_init(){return 0}function ___syscall6(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD();FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___setErrNo(value){if(Module["___errno_location"])HEAP32[Module["___errno_location"]()>>2]=value;return value}function _emscripten_memcpy_big(dest,src,num){HEAPU8.set(HEAPU8.subarray(src,src+num),dest);return dest}function __embind_register_std_wstring(rawType,charSize,name){name=readLatin1String(name);var getHeap,shift;if(charSize===2){getHeap=(function(){return HEAPU16});shift=1}else if(charSize===4){getHeap=(function(){return HEAPU32});shift=2}registerType(rawType,{name:name,"fromWireType":(function(value){var HEAP=getHeap();var length=HEAPU32[value>>2];var a=new Array(length);var start=value+4>>shift;for(var i=0;i<length;++i){a[i]=String.fromCharCode(HEAP[start+i])}_free(value);return a.join("")}),"toWireType":(function(destructors,value){var HEAP=getHeap();var length=value.length;var ptr=_malloc(4+length*charSize);HEAPU32[ptr>>2]=length;var start=ptr+4>>shift;for(var i=0;i<length;++i){HEAP[start+i]=value.charCodeAt(i)}if(destructors!==null){destructors.push(_free,ptr)}return ptr}),"argPackAdvance":8,"readValueFromPointer":simpleReadValueFromPointer,destructorFunction:(function(ptr){_free(ptr)})})}function ___cxa_begin_catch(ptr){var info=EXCEPTIONS.infos[ptr];if(info&&!info.caught){info.caught=true;__ZSt18uncaught_exceptionv.uncaught_exception--}if(info)info.rethrown=false;EXCEPTIONS.caught.push(ptr);EXCEPTIONS.addRef(EXCEPTIONS.deAdjust(ptr));return ptr}function new_(constructor,argumentList){if(!(constructor instanceof Function)){throw new TypeError("new_ called with constructor type "+typeof constructor+" which is not a function")}var dummy=createNamedFunction(constructor.name||"unknownFunctionName",(function(){}));dummy.prototype=constructor.prototype;var obj=new dummy;var r=constructor.apply(obj,argumentList);return r instanceof Object?r:obj}function craftInvokerFunction(humanName,argTypes,classType,cppInvokerFunc,cppTargetFunc){var argCount=argTypes.length;if(argCount<2){throwBindingError("argTypes array size mismatch! Must at least get return value and 'this' types!")}var isClassMethodFunc=argTypes[1]!==null&&classType!==null;var needsDestructorStack=false;for(var i=1;i<argTypes.length;++i){if(argTypes[i]!==null&&argTypes[i].destructorFunction===undefined){needsDestructorStack=true;break}}var returns=argTypes[0].name!=="void";var argsList="";var argsListWired="";for(var i=0;i<argCount-2;++i){argsList+=(i!==0?", ":"")+"arg"+i;argsListWired+=(i!==0?", ":"")+"arg"+i+"Wired"}var invokerFnBody="return function "+makeLegalFunctionName(humanName)+"("+argsList+") {\n"+"if (arguments.length !== "+(argCount-2)+") {\n"+"throwBindingError('function "+humanName+" called with ' + arguments.length + ' arguments, expected "+(argCount-2)+" args!');\n"+"}\n";if(needsDestructorStack){invokerFnBody+="var destructors = [];\n"}var dtorStack=needsDestructorStack?"destructors":"null";var args1=["throwBindingError","invoker","fn","runDestructors","retType","classParam"];var args2=[throwBindingError,cppInvokerFunc,cppTargetFunc,runDestructors,argTypes[0],argTypes[1]];if(isClassMethodFunc){invokerFnBody+="var thisWired = classParam.toWireType("+dtorStack+", this);\n"}for(var i=0;i<argCount-2;++i){invokerFnBody+="var arg"+i+"Wired = argType"+i+".toWireType("+dtorStack+", arg"+i+"); // "+argTypes[i+2].name+"\n";args1.push("argType"+i);args2.push(argTypes[i+2])}if(isClassMethodFunc){argsListWired="thisWired"+(argsListWired.length>0?", ":"")+argsListWired}invokerFnBody+=(returns?"var rv = ":"")+"invoker(fn"+(argsListWired.length>0?", ":"")+argsListWired+");\n";if(needsDestructorStack){invokerFnBody+="runDestructors(destructors);\n"}else{for(var i=isClassMethodFunc?1:2;i<argTypes.length;++i){var paramName=i===1?"thisWired":"arg"+(i-2)+"Wired";if(argTypes[i].destructorFunction!==null){invokerFnBody+=paramName+"_dtor("+paramName+"); // "+argTypes[i].name+"\n";args1.push(paramName+"_dtor");args2.push(argTypes[i].destructorFunction)}}}if(returns){invokerFnBody+="var ret = retType.fromWireType(rv);\n"+"return ret;\n"}else{}invokerFnBody+="}\n";args1.push(invokerFnBody);var invokerFunction=new_(Function,args1).apply(null,args2);return invokerFunction}function ensureOverloadTable(proto,methodName,humanName){if(undefined===proto[methodName].overloadTable){var prevFunc=proto[methodName];proto[methodName]=(function(){if(!proto[methodName].overloadTable.hasOwnProperty(arguments.length)){throwBindingError("Function '"+humanName+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+proto[methodName].overloadTable+")!")}return proto[methodName].overloadTable[arguments.length].apply(this,arguments)});proto[methodName].overloadTable=[];proto[methodName].overloadTable[prevFunc.argCount]=prevFunc}}function exposePublicSymbol(name,value,numArguments){if(Module.hasOwnProperty(name)){if(undefined===numArguments||undefined!==Module[name].overloadTable&&undefined!==Module[name].overloadTable[numArguments]){throwBindingError("Cannot register public name '"+name+"' twice")}ensureOverloadTable(Module,name,name);if(Module.hasOwnProperty(numArguments)){throwBindingError("Cannot register multiple overloads of a function with the same number of arguments ("+numArguments+")!")}Module[name].overloadTable[numArguments]=value}else{Module[name]=value;if(undefined!==numArguments){Module[name].numArguments=numArguments}}}function heap32VectorToArray(count,firstElement){var array=[];for(var i=0;i<count;i++){array.push(HEAP32[(firstElement>>2)+i])}return array}function replacePublicSymbol(name,value,numArguments){if(!Module.hasOwnProperty(name)){throwInternalError("Replacing nonexistant public symbol")}if(undefined!==Module[name].overloadTable&&undefined!==numArguments){Module[name].overloadTable[numArguments]=value}else{Module[name]=value;Module[name].argCount=numArguments}}var UnboundTypeError=undefined;function getTypeName(type){var ptr=___getTypeName(type);var rv=readLatin1String(ptr);_free(ptr);return rv}function throwUnboundTypeError(message,types){var unboundTypes=[];var seen={};function visit(type){if(seen[type]){return}if(registeredTypes[type]){return}if(typeDependencies[type]){typeDependencies[type].forEach(visit);return}unboundTypes.push(type);seen[type]=true}types.forEach(visit);throw new UnboundTypeError(message+": "+unboundTypes.map(getTypeName).join([", "]))}function __embind_register_function(name,argCount,rawArgTypesAddr,signature,rawInvoker,fn){var argTypes=heap32VectorToArray(argCount,rawArgTypesAddr);name=readLatin1String(name);rawInvoker=requireFunction(signature,rawInvoker);exposePublicSymbol(name,(function(){throwUnboundTypeError("Cannot call "+name+" due to unbound types",argTypes)}),argCount-1);whenDependentTypesAreResolved([],argTypes,(function(argTypes){var invokerArgsArray=[argTypes[0],null].concat(argTypes.slice(1));replacePublicSymbol(name,craftInvokerFunction(name,invokerArgsArray,null,rawInvoker,fn),argCount-1);return[]}))}function _pthread_cond_wait(){return 0}function __embind_register_memory_view(rawType,dataTypeIndex,name){var typeMapping=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];var TA=typeMapping[dataTypeIndex];function decodeMemoryView(handle){handle=handle>>2;var heap=HEAPU32;var size=heap[handle];var data=heap[handle+1];return new TA(heap["buffer"],data,size)}name=readLatin1String(name);registerType(rawType,{name:name,"fromWireType":decodeMemoryView,"argPackAdvance":8,"readValueFromPointer":decodeMemoryView},{ignoreDuplicateRegistrations:true})}function ___syscall140(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(),offset_high=SYSCALLS.get(),offset_low=SYSCALLS.get(),result=SYSCALLS.get(),whence=SYSCALLS.get();var offset=offset_low;FS.llseek(stream,offset,whence);HEAP32[result>>2]=stream.position;if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function ___syscall146(which,varargs){SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.get(),iov=SYSCALLS.get(),iovcnt=SYSCALLS.get();var ret=0;if(!___syscall146.buffer){___syscall146.buffers=[null,[],[]];___syscall146.printChar=(function(stream,curr){var buffer=___syscall146.buffers[stream];assert(buffer);if(curr===0||curr===10){(stream===1?Module["print"]:Module["printErr"])(UTF8ArrayToString(buffer,0));buffer.length=0}else{buffer.push(curr)}})}for(var i=0;i<iovcnt;i++){var ptr=HEAP32[iov+i*8>>2];var len=HEAP32[iov+(i*8+4)>>2];for(var j=0;j<len;j++){___syscall146.printChar(stream,HEAPU8[ptr+j])}ret+=len}return ret}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}embind_init_charCodes();BindingError=Module["BindingError"]=extendError(Error,"BindingError");InternalError=Module["InternalError"]=extendError(Error,"InternalError");init_emval();UnboundTypeError=Module["UnboundTypeError"]=extendError(Error,"UnboundTypeError");__ATEXIT__.push((function(){var fflush=Module["_fflush"];if(fflush)fflush(0);var printChar=___syscall146.printChar;if(!printChar)return;var buffers=___syscall146.buffers;if(buffers[1].length)printChar(1,10);if(buffers[2].length)printChar(2,10)}));DYNAMICTOP_PTR=allocate(1,"i32",ALLOC_STATIC);STACK_BASE=STACKTOP=Runtime.alignMemory(STATICTOP);STACK_MAX=STACK_BASE+TOTAL_STACK;DYNAMIC_BASE=Runtime.alignMemory(STACK_MAX);HEAP32[DYNAMICTOP_PTR>>2]=DYNAMIC_BASE;staticSealed=true;Module["wasmTableSize"]=564;Module["wasmMaxTableSize"]=564;function invoke_iiiiiiii(index,a1,a2,a3,a4,a5,a6,a7){try{return Module["dynCall_iiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiii(index,a1,a2,a3,a4,a5){try{Module["dynCall_viiiii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vi(index,a1){try{Module["dynCall_vi"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_vii(index,a1,a2){try{Module["dynCall_vii"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiii(index,a1,a2,a3,a4,a5,a6){try{return Module["dynCall_iiiiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_ii(index,a1){try{return Module["dynCall_ii"](index,a1)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11){try{Module["dynCall_viiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiii(index,a1,a2,a3,a4,a5){try{return Module["dynCall_iiiiii"](index,a1,a2,a3,a4,a5)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiii(index,a1,a2,a3){try{return Module["dynCall_iiii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{Module["dynCall_viiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiii(index,a1,a2,a3,a4,a5,a6){try{Module["dynCall_viiiiii"](index,a1,a2,a3,a4,a5,a6)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13){try{Module["dynCall_viiiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiii(index,a1,a2,a3,a4,a5,a6,a7){try{Module["dynCall_viiiiiii"](index,a1,a2,a3,a4,a5,a6,a7)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9){try{Module["dynCall_viiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10){try{Module["dynCall_viiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iii(index,a1,a2){try{return Module["dynCall_iii"](index,a1,a2)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_i(index){try{return Module["dynCall_i"](index)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiiiiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12){try{Module["dynCall_viiiiiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiii(index,a1,a2,a3,a4){try{return Module["dynCall_iiiii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viii(index,a1,a2,a3){try{Module["dynCall_viii"](index,a1,a2,a3)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_v(index){try{Module["dynCall_v"](index)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_iiiiiiiii(index,a1,a2,a3,a4,a5,a6,a7,a8){try{return Module["dynCall_iiiiiiiii"](index,a1,a2,a3,a4,a5,a6,a7,a8)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}function invoke_viiii(index,a1,a2,a3,a4){try{Module["dynCall_viiii"](index,a1,a2,a3,a4)}catch(e){if(typeof e!=="number"&&e!=="longjmp")throw e;Module["setThrew"](1,0)}}Module.asmGlobalArg={"Math":Math,"Int8Array":Int8Array,"Int16Array":Int16Array,"Int32Array":Int32Array,"Uint8Array":Uint8Array,"Uint16Array":Uint16Array,"Uint32Array":Uint32Array,"Float32Array":Float32Array,"Float64Array":Float64Array,"NaN":NaN,"Infinity":Infinity};Module.asmLibraryArg={"abort":abort,"assert":assert,"enlargeMemory":enlargeMemory,"getTotalMemory":getTotalMemory,"abortOnCannotGrowMemory":abortOnCannotGrowMemory,"invoke_iiiiiiii":invoke_iiiiiiii,"invoke_viiiii":invoke_viiiii,"invoke_vi":invoke_vi,"invoke_vii":invoke_vii,"invoke_iiiiiii":invoke_iiiiiii,"invoke_ii":invoke_ii,"invoke_viiiiiiiiiii":invoke_viiiiiiiiiii,"invoke_iiiiii":invoke_iiiiii,"invoke_iiii":invoke_iiii,"invoke_viiiiiiii":invoke_viiiiiiii,"invoke_viiiiii":invoke_viiiiii,"invoke_viiiiiiiiiiiii":invoke_viiiiiiiiiiiii,"invoke_viiiiiii":invoke_viiiiiii,"invoke_viiiiiiiii":invoke_viiiiiiiii,"invoke_viiiiiiiiii":invoke_viiiiiiiiii,"invoke_iii":invoke_iii,"invoke_i":invoke_i,"invoke_viiiiiiiiiiii":invoke_viiiiiiiiiiii,"invoke_iiiii":invoke_iiiii,"invoke_viii":invoke_viii,"invoke_v":invoke_v,"invoke_iiiiiiiii":invoke_iiiiiiiii,"invoke_viiii":invoke_viiii,"requireFunction":requireFunction,"_pthread_cond_wait":_pthread_cond_wait,"_pthread_join":_pthread_join,"simpleReadValueFromPointer":simpleReadValueFromPointer,"new_":new_,"___syscall54":___syscall54,"__embind_register_integer":__embind_register_integer,"throwInternalError":throwInternalError,"get_first_emval":get_first_emval,"_abort":_abort,"whenDependentTypesAreResolved":whenDependentTypesAreResolved,"___gxx_personality_v0":___gxx_personality_v0,"extendError":extendError,"___assert_fail":___assert_fail,"__embind_register_void":__embind_register_void,"___cxa_find_matching_catch":___cxa_find_matching_catch,"__embind_register_value_object_field":__embind_register_value_object_field,"exposePublicSymbol":exposePublicSymbol,"_pthread_cond_init":_pthread_cond_init,"__embind_register_function":__embind_register_function,"embind_init_charCodes":embind_init_charCodes,"___cxa_begin_catch":___cxa_begin_catch,"___setErrNo":___setErrNo,"__emval_register":__emval_register,"readLatin1String":readLatin1String,"___cxa_allocate_exception":___cxa_allocate_exception,"_emscripten_memcpy_big":_emscripten_memcpy_big,"__embind_register_bool":__embind_register_bool,"___resumeException":___resumeException,"__ZSt18uncaught_exceptionv":__ZSt18uncaught_exceptionv,"_embind_repr":_embind_repr,"__embind_register_std_wstring":__embind_register_std_wstring,"_pthread_getspecific":_pthread_getspecific,"createNamedFunction":createNamedFunction,"__embind_register_emval":__embind_register_emval,"_pthread_cond_signal":_pthread_cond_signal,"__embind_finalize_value_object":__embind_finalize_value_object,"_pthread_mutex_destroy":_pthread_mutex_destroy,"throwUnboundTypeError":throwUnboundTypeError,"craftInvokerFunction":craftInvokerFunction,"__emval_decref":__emval_decref,"_pthread_once":_pthread_once,"getShiftFromSize":getShiftFromSize,"makeLegalFunctionName":makeLegalFunctionName,"_pthread_key_create":_pthread_key_create,"___unlock":___unlock,"heap32VectorToArray":heap32VectorToArray,"init_emval":init_emval,"_pthread_create":_pthread_create,"floatReadValueFromPointer":floatReadValueFromPointer,"__embind_register_value_object":__embind_register_value_object,"_pthread_setspecific":_pthread_setspecific,"integerReadValueFromPointer":integerReadValueFromPointer,"registerType":registerType,"___cxa_throw":___cxa_throw,"___lock":___lock,"_pthread_cond_timedwait":_pthread_cond_timedwait,"___syscall6":___syscall6,"throwBindingError":throwBindingError,"ensureOverloadTable":ensureOverloadTable,"count_emval_handles":count_emval_handles,"_pthread_cond_destroy":_pthread_cond_destroy,"__embind_register_float":__embind_register_float,"_gettimeofday":_gettimeofday,"getTypeName":getTypeName,"___syscall140":___syscall140,"_pthread_mutex_init":_pthread_mutex_init,"__embind_register_memory_view":__embind_register_memory_view,"__embind_register_std_string":__embind_register_std_string,"replacePublicSymbol":replacePublicSymbol,"___cxa_pure_virtual":___cxa_pure_virtual,"___syscall146":___syscall146,"runDestructors":runDestructors,"DYNAMICTOP_PTR":DYNAMICTOP_PTR,"tempDoublePtr":tempDoublePtr,"ABORT":ABORT,"STACKTOP":STACKTOP,"STACK_MAX":STACK_MAX};var asm=Module["asm"](Module.asmGlobalArg,Module.asmLibraryArg,buffer);Module["asm"]=asm;var stackSave=Module["stackSave"]=(function(){return Module["asm"]["stackSave"].apply(null,arguments)});var _SetIFrameDecInterval=Module["_SetIFrameDecInterval"]=(function(){return Module["asm"]["_SetIFrameDecInterval"].apply(null,arguments)});var _CloseStream=Module["_CloseStream"]=(function(){return Module["asm"]["_CloseStream"].apply(null,arguments)});var setThrew=Module["setThrew"]=(function(){return Module["asm"]["setThrew"].apply(null,arguments)});var _GetFrameData=Module["_GetFrameData"]=(function(){return Module["asm"]["_GetFrameData"].apply(null,arguments)});var _sbrk=Module["_sbrk"]=(function(){return Module["asm"]["_sbrk"].apply(null,arguments)});var _fflush=Module["_fflush"]=(function(){return Module["asm"]["_fflush"].apply(null,arguments)});var _SetPrintLogFlag=Module["_SetPrintLogFlag"]=(function(){return Module["asm"]["_SetPrintLogFlag"].apply(null,arguments)});var ___cxa_is_pointer_type=Module["___cxa_is_pointer_type"]=(function(){return Module["asm"]["___cxa_is_pointer_type"].apply(null,arguments)});var _memset=Module["_memset"]=(function(){return Module["asm"]["_memset"].apply(null,arguments)});var _SetDisplayRegion=Module["_SetDisplayRegion"]=(function(){return Module["asm"]["_SetDisplayRegion"].apply(null,arguments)});var _memcpy=Module["_memcpy"]=(function(){return Module["asm"]["_memcpy"].apply(null,arguments)});var ___errno_location=Module["___errno_location"]=(function(){return Module["asm"]["___errno_location"].apply(null,arguments)});var stackAlloc=Module["stackAlloc"]=(function(){return Module["asm"]["stackAlloc"].apply(null,arguments)});var getTempRet0=Module["getTempRet0"]=(function(){return Module["asm"]["getTempRet0"].apply(null,arguments)});var __GLOBAL__sub_I_bind_cpp=Module["__GLOBAL__sub_I_bind_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_bind_cpp"].apply(null,arguments)});var setTempRet0=Module["setTempRet0"]=(function(){return Module["asm"]["setTempRet0"].apply(null,arguments)});var _SetSecretKey=Module["_SetSecretKey"]=(function(){return Module["asm"]["_SetSecretKey"].apply(null,arguments)});var _DestroyAudEncode=Module["_DestroyAudEncode"]=(function(){return Module["asm"]["_DestroyAudEncode"].apply(null,arguments)});var _pthread_mutex_unlock=Module["_pthread_mutex_unlock"]=(function(){return Module["asm"]["_pthread_mutex_unlock"].apply(null,arguments)});var _GetRawDataBuffer=Module["_GetRawDataBuffer"]=(function(){return Module["asm"]["_GetRawDataBuffer"].apply(null,arguments)});var __GLOBAL__sub_I_Decoder_cpp=Module["__GLOBAL__sub_I_Decoder_cpp"]=(function(){return Module["asm"]["__GLOBAL__sub_I_Decoder_cpp"].apply(null,arguments)});var runPostSets=Module["runPostSets"]=(function(){return Module["asm"]["runPostSets"].apply(null,arguments)});var _SetPlayPosition=Module["_SetPlayPosition"]=(function(){return Module["asm"]["_SetPlayPosition"].apply(null,arguments)});var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=(function(){return Module["asm"]["_emscripten_get_global_libc"].apply(null,arguments)});var _InputData=Module["_InputData"]=(function(){return Module["asm"]["_InputData"].apply(null,arguments)});var ___getTypeName=Module["___getTypeName"]=(function(){return Module["asm"]["___getTypeName"].apply(null,arguments)});var _GetJPEG=Module["_GetJPEG"]=(function(){return Module["asm"]["_GetJPEG"].apply(null,arguments)});var _OpenStream=Module["_OpenStream"]=(function(){return Module["asm"]["_OpenStream"].apply(null,arguments)});var _GetBMP=Module["_GetBMP"]=(function(){return Module["asm"]["_GetBMP"].apply(null,arguments)});var _pthread_cond_broadcast=Module["_pthread_cond_broadcast"]=(function(){return Module["asm"]["_pthread_cond_broadcast"].apply(null,arguments)});var _InputAudEncodeData=Module["_InputAudEncodeData"]=(function(){return Module["asm"]["_InputAudEncodeData"].apply(null,arguments)});var _llvm_bswap_i32=Module["_llvm_bswap_i32"]=(function(){return Module["asm"]["_llvm_bswap_i32"].apply(null,arguments)});var _GetFrameBuffer=Module["_GetFrameBuffer"]=(function(){return Module["asm"]["_GetFrameBuffer"].apply(null,arguments)});var ___cxa_can_catch=Module["___cxa_can_catch"]=(function(){return Module["asm"]["___cxa_can_catch"].apply(null,arguments)});var _free=Module["_free"]=(function(){return Module["asm"]["_free"].apply(null,arguments)});var _CreateAudEncode=Module["_CreateAudEncode"]=(function(){return Module["asm"]["_CreateAudEncode"].apply(null,arguments)});var establishStackSpace=Module["establishStackSpace"]=(function(){return Module["asm"]["establishStackSpace"].apply(null,arguments)});var _SetDecodeFrameType=Module["_SetDecodeFrameType"]=(function(){return Module["asm"]["_SetDecodeFrameType"].apply(null,arguments)});var _SetStreamOpenMode=Module["_SetStreamOpenMode"]=(function(){return Module["asm"]["_SetStreamOpenMode"].apply(null,arguments)});var _GetAudFrameBuffer=Module["_GetAudFrameBuffer"]=(function(){return Module["asm"]["_GetAudFrameBuffer"].apply(null,arguments)});var stackRestore=Module["stackRestore"]=(function(){return Module["asm"]["stackRestore"].apply(null,arguments)});var _malloc=Module["_malloc"]=(function(){return Module["asm"]["_malloc"].apply(null,arguments)});var _Pause=Module["_Pause"]=(function(){return Module["asm"]["_Pause"].apply(null,arguments)});var _pthread_mutex_lock=Module["_pthread_mutex_lock"]=(function(){return Module["asm"]["_pthread_mutex_lock"].apply(null,arguments)});var _SetAudEncodeParam=Module["_SetAudEncodeParam"]=(function(){return Module["asm"]["_SetAudEncodeParam"].apply(null,arguments)});var _memmove=Module["_memmove"]=(function(){return Module["asm"]["_memmove"].apply(null,arguments)});var _GetAudFrameData=Module["_GetAudFrameData"]=(function(){return Module["asm"]["_GetAudFrameData"].apply(null,arguments)});var _Stop=Module["_Stop"]=(function(){return Module["asm"]["_Stop"].apply(null,arguments)});var dynCall_iiiiiiii=Module["dynCall_iiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiii"].apply(null,arguments)});var dynCall_viiiii=Module["dynCall_viiiii"]=(function(){return Module["asm"]["dynCall_viiiii"].apply(null,arguments)});var dynCall_vi=Module["dynCall_vi"]=(function(){return Module["asm"]["dynCall_vi"].apply(null,arguments)});var dynCall_vii=Module["dynCall_vii"]=(function(){return Module["asm"]["dynCall_vii"].apply(null,arguments)});var dynCall_iiiiiii=Module["dynCall_iiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiii"].apply(null,arguments)});var dynCall_ii=Module["dynCall_ii"]=(function(){return Module["asm"]["dynCall_ii"].apply(null,arguments)});var dynCall_viiiiiiiiiii=Module["dynCall_viiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiiii=Module["dynCall_iiiiii"]=(function(){return Module["asm"]["dynCall_iiiiii"].apply(null,arguments)});var dynCall_iiii=Module["dynCall_iiii"]=(function(){return Module["asm"]["dynCall_iiii"].apply(null,arguments)});var dynCall_viiiiiiii=Module["dynCall_viiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiii"].apply(null,arguments)});var dynCall_viiiiii=Module["dynCall_viiiiii"]=(function(){return Module["asm"]["dynCall_viiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiiiiii=Module["dynCall_viiiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiii=Module["dynCall_viiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiii=Module["dynCall_viiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiii"].apply(null,arguments)});var dynCall_viiiiiiiiii=Module["dynCall_viiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiii"].apply(null,arguments)});var dynCall_iii=Module["dynCall_iii"]=(function(){return Module["asm"]["dynCall_iii"].apply(null,arguments)});var dynCall_i=Module["dynCall_i"]=(function(){return Module["asm"]["dynCall_i"].apply(null,arguments)});var dynCall_viiiiiiiiiiii=Module["dynCall_viiiiiiiiiiii"]=(function(){return Module["asm"]["dynCall_viiiiiiiiiiii"].apply(null,arguments)});var dynCall_iiiii=Module["dynCall_iiiii"]=(function(){return Module["asm"]["dynCall_iiiii"].apply(null,arguments)});var dynCall_viii=Module["dynCall_viii"]=(function(){return Module["asm"]["dynCall_viii"].apply(null,arguments)});var dynCall_v=Module["dynCall_v"]=(function(){return Module["asm"]["dynCall_v"].apply(null,arguments)});var dynCall_iiiiiiiii=Module["dynCall_iiiiiiiii"]=(function(){return Module["asm"]["dynCall_iiiiiiiii"].apply(null,arguments)});var dynCall_viiii=Module["dynCall_viiii"]=(function(){return Module["asm"]["dynCall_viiii"].apply(null,arguments)});Runtime.stackAlloc=Module["stackAlloc"];Runtime.stackSave=Module["stackSave"];Runtime.stackRestore=Module["stackRestore"];Runtime.establishStackSpace=Module["establishStackSpace"];Runtime.setTempRet0=Module["setTempRet0"];Runtime.getTempRet0=Module["getTempRet0"];Module["asm"]=asm;if(memoryInitializer){if(typeof Module["locateFile"]==="function"){memoryInitializer=Module["locateFile"](memoryInitializer)}else if(Module["memoryInitializerPrefixURL"]){memoryInitializer=Module["memoryInitializerPrefixURL"]+memoryInitializer}if(ENVIRONMENT_IS_NODE||ENVIRONMENT_IS_SHELL){var data=Module["readBinary"](memoryInitializer);HEAPU8.set(data,Runtime.GLOBAL_BASE)}else{addRunDependency("memory initializer");var applyMemoryInitializer=(function(data){if(data.byteLength)data=new Uint8Array(data);HEAPU8.set(data,Runtime.GLOBAL_BASE);if(Module["memoryInitializerRequest"])delete Module["memoryInitializerRequest"].response;removeRunDependency("memory initializer")});function doBrowserLoad(){Module["readAsync"](memoryInitializer,applyMemoryInitializer,(function(){throw"could not load memory initializer "+memoryInitializer}))}if(Module["memoryInitializerRequest"]){function useRequest(){var request=Module["memoryInitializerRequest"];if(request.status!==200&&request.status!==0){console.warn("a problem seems to have happened with Module.memoryInitializerRequest, status: "+request.status+", retrying "+memoryInitializer);doBrowserLoad();return}applyMemoryInitializer(request.response)}if(Module["memoryInitializerRequest"].response){setTimeout(useRequest,0)}else{Module["memoryInitializerRequest"].addEventListener("load",useRequest)}}else{doBrowserLoad()}}}function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}ExitStatus.prototype=new Error;ExitStatus.prototype.constructor=ExitStatus;var initialStackTop;var preloadStartTime=null;var calledMain=false;dependenciesFulfilled=function runCaller(){if(!Module["calledRun"])run();if(!Module["calledRun"])dependenciesFulfilled=runCaller};Module["callMain"]=Module.callMain=function callMain(args){args=args||[];ensureInitRuntime();var argc=args.length+1;function pad(){for(var i=0;i<4-1;i++){argv.push(0)}}var argv=[allocate(intArrayFromString(Module["thisProgram"]),"i8",ALLOC_NORMAL)];pad();for(var i=0;i<argc-1;i=i+1){argv.push(allocate(intArrayFromString(args[i]),"i8",ALLOC_NORMAL));pad()}argv.push(0);argv=allocate(argv,"i32",ALLOC_NORMAL);try{var ret=Module["_main"](argc,argv,0);exit(ret,true)}catch(e){if(e instanceof ExitStatus){return}else if(e=="SimulateInfiniteLoop"){Module["noExitRuntime"]=true;return}else{var toLog=e;if(e&&typeof e==="object"&&e.stack){toLog=[e,e.stack]}Module.printErr("exception thrown: "+toLog);Module["quit"](1,e)}}finally{calledMain=true}};function run(args){args=args||Module["arguments"];if(preloadStartTime===null)preloadStartTime=Date.now();if(runDependencies>0){return}preRun();if(runDependencies>0)return;if(Module["calledRun"])return;function doRun(){if(Module["calledRun"])return;Module["calledRun"]=true;if(ABORT)return;ensureInitRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(Module["_main"]&&shouldRunNow)Module["callMain"](args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout((function(){setTimeout((function(){Module["setStatus"]("")}),1);doRun()}),1)}else{doRun()}}Module["run"]=Module.run=run;function exit(status,implicit){if(implicit&&Module["noExitRuntime"]){return}if(Module["noExitRuntime"]){}else{ABORT=true;EXITSTATUS=status;STACKTOP=initialStackTop;exitRuntime();if(Module["onExit"])Module["onExit"](status)}if(ENVIRONMENT_IS_NODE){process["exit"](status)}Module["quit"](status,new ExitStatus(status))}Module["exit"]=Module.exit=exit;var abortDecorators=[];function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(what!==undefined){Module.print(what);Module.printErr(what);what=JSON.stringify(what)}else{what=""}ABORT=true;EXITSTATUS=1;var extra="\nIf this abort() is unexpected, build with -s ASSERTIONS=1 which can give more information.";var output="abort("+what+") at "+stackTrace()+extra;if(abortDecorators){abortDecorators.forEach((function(decorator){output=decorator(output,what)}))}throw output}Module["abort"]=Module.abort=abort;if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"]){shouldRunNow=false}run()
"use strict";
//顶点着色器
//attribute修饰符用于声明由浏览器(javascript)传输给顶点着色器的变量值;
// vertexPos即我们定义的顶点坐标;
// gl_Position是一个内建的传出变量。
var vertexYUVShader = [
'attribute vec4 vertexPos;',
'attribute vec2 texturePos;',
'varying vec2 textureCoord;',
'void main()',
'{',
'gl_Position = vertexPos;',
'textureCoord = texturePos;',
'}'
].join('\n');
//像素着色器(yuv->rgb)
var fragmentYUVShader = [
'precision highp float;',
'varying highp vec2 textureCoord;',
'uniform sampler2D ySampler;',
'uniform sampler2D uSampler;',
'uniform sampler2D vSampler;',
'const mat4 YUV2RGB = mat4',
'(',
'1.1643828125, 0, 1.59602734375, -.87078515625,',
'1.1643828125, -.39176171875, -.81296875, .52959375,',
'1.1643828125, 2.017234375, 0, -1.081390625,',
'0, 0, 0, 1',
');',
'void main(void) {',
'highp float y = texture2D(ySampler, textureCoord).r;',
'highp float u = texture2D(uSampler, textureCoord).r;',
'highp float v = texture2D(vSampler, textureCoord).r;',
'gl_FragColor = vec4(y, u, v, 1) * YUV2RGB;',
'}'
].join('\n');
(function (root, factory) {
root.SuperRender = factory();
}(this, function () {
function RenderManager(canvas) {
this.canvasElement = document.getElementById(canvas);
this.initContextGL();
if(this.contextGL) {
this.YUVProgram = this.initProgram(vertexYUVShader, fragmentYUVShader);
this.initBuffers();
this.initTextures();
}
};
/**
* 初始化WebGL上下文
*/
RenderManager.prototype.initContextGL = function() {
var canvas = this.canvasElement;
var gl = null;
try {
gl = canvas.getContext("webgl") || canvas.getContext("experimental-webgl");
} catch (e) {
gl = null;
}
if(!gl || typeof gl.getParameter !== "function") {
gl = null;
}
this.contextGL = gl;
console.log("WebGL1.0");
};
/**
* 初始化着色器程序
* @param vertexShaderScript 顶点着色器脚本
* @param fragmentShaderScript 片段着色器脚本
*/
RenderManager.prototype.initProgram = function(vertexShaderScript, fragmentShaderScript) {
var gl = this.contextGL;
var vertexShader = gl.createShader(gl.VERTEX_SHADER); //创建定点着色器
gl.shaderSource(vertexShader, vertexShaderScript);
gl.compileShader(vertexShader);
if(!gl.getShaderParameter(vertexShader, gl.COMPILE_STATUS)) {
console.log('Vertex shader failed to compile: ' + gl.getShaderInfoLog(vertexShader));
}
var fragmentShader = gl.createShader(gl.FRAGMENT_SHADER);
gl.shaderSource(fragmentShader, fragmentShaderScript);
gl.compileShader(fragmentShader);
if(!gl.getShaderParameter(fragmentShader, gl.COMPILE_STATUS)) {
console.log('Fragment shader failed to compile: ' + gl.getShaderInfoLog(fragmentShader));
}
var program = gl.createProgram();
gl.attachShader(program, vertexShader);
gl.attachShader(program, fragmentShader);
gl.linkProgram(program);
if(!gl.getProgramParameter(program, gl.LINK_STATUS)) {
console.log('Program failed to compile: ' + gl.getProgramInfoLog(program));
}
gl.deleteShader(vertexShader);
gl.deleteShader(fragmentShader);
return program;
};
/**
* 初始化数据缓存
*/
RenderManager.prototype.initBuffers = function() {
var gl = this.contextGL;
var vertexPosBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, vertexPosBuffer);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 1, -1, 1, 1, -1, -1, -1]), gl.STATIC_DRAW);
gl.bindBuffer(gl.ARRAY_BUFFER, null);
var texturePosBuffer = gl.createBuffer();
gl.bindBuffer(gl.ARRAY_BUFFER, texturePosBuffer);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([1, 0, 0, 0, 1, 1, 0, 1]), gl.DYNAMIC_DRAW);
gl.bindBuffer(gl.ARRAY_BUFFER, null);
this.vertexPosBuffer = vertexPosBuffer;
this.texturePosBuffer = texturePosBuffer;
};
/**
* 创建纹理
*/
RenderManager.prototype.initTexture = function() {
var gl = this.contextGL;
var textureRef = gl.createTexture();
gl.bindTexture(gl.TEXTURE_2D, textureRef);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
gl.bindTexture(gl.TEXTURE_2D, null);
return textureRef;
};
/**
* 初始化YUV纹理
*/
RenderManager.prototype.initTextures = function() {
var gl = this.contextGL;
var program = this.YUVProgram;
gl.useProgram(program);
var yTextureRef = this.initTexture();
var ySamplerRef = gl.getUniformLocation(program, 'ySampler');
gl.uniform1i(ySamplerRef, 0);
this.yTextureRef = yTextureRef;
var uTextureRef = this.initTexture();
var uSamplerRef = gl.getUniformLocation(program, 'uSampler');
gl.uniform1i(uSamplerRef, 1);
this.uTextureRef = uTextureRef;
var vTextureRef = this.initTexture();
var vSamplerRef = gl.getUniformLocation(program, 'vSampler');
gl.uniform1i(vSamplerRef, 2);
this.vTextureRef = vTextureRef;
gl.useProgram(null);
};
/**
* 显示帧数据
* @param nWidth 宽度
* @param nHeight 高度
* @param nHeight 帧数据
*/
RenderManager.prototype.SR_DisplayFrameData = function(nWidth, nHeight, pData,dWidth,dHeight) {
if(nWidth <= 0 || nHeight <= 0)
{
return;
}
var gl = this.contextGL;
if(null == pData)
{
gl.clearColor(0.0, 0.0, 0.0, 0.0);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
return;
}
var canvas = this.canvasElement;
this.nWindowWidth = canvas.width;
this.nWindowHeight = canvas.height;
var nWindowWidth = this.nWindowWidth;
var nWindowHeight = this.nWindowHeight;
gl.clearColor(0.8, 0.8, 1.0, 1.0);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
gl.viewport(0, 0, nWindowWidth, nWindowHeight);
this.updateFrameData(nWidth, nHeight, pData,dWidth,dHeight);
var program = this.YUVProgram;
gl.useProgram(program);
var vertexPosBuffer = this.vertexPosBuffer;
gl.bindBuffer(gl.ARRAY_BUFFER, vertexPosBuffer);
var vertexPosRef = gl.getAttribLocation(program, 'vertexPos');
gl.enableVertexAttribArray(vertexPosRef);
gl.vertexAttribPointer(vertexPosRef, 2, gl.FLOAT, false, 0, 0);
gl.bindBuffer(gl.ARRAY_BUFFER, null);
var texturePosBuffer = this.texturePosBuffer;
gl.bindBuffer(gl.ARRAY_BUFFER, texturePosBuffer);
var texturePosRef = gl.getAttribLocation(program, 'texturePos');
gl.enableVertexAttribArray(texturePosRef);
gl.vertexAttribPointer(texturePosRef, 2, gl.FLOAT, false, 0, 0);
gl.bindBuffer(gl.ARRAY_BUFFER, null);
gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);
gl.disableVertexAttribArray(vertexPosRef);
gl.disableVertexAttribArray(texturePosRef);
gl.useProgram(null);
};
/**
* 上传YUV数据到纹理
* @param nWidth 宽度
* @param nHeight 高度
* @param nHeight 帧数据
*/
RenderManager.prototype.updateFrameData = function(width, height, data,dWidth,dHeight) {
var gl = this.contextGL;
var yTextureRef = this.yTextureRef;
var uTextureRef = this.uTextureRef;
var vTextureRef = this.vTextureRef;
var i420Data = data;
// debugger;
// var yDataLength = dWidth * dHeight;
// var yData = i420Data.subarray(0, yDataLength);
// gl.activeTexture(gl.TEXTURE0);
// gl.bindTexture(gl.TEXTURE_2D, yTextureRef);
// gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, dWidth, dHeight, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, yData);
//
// var cbDataLength = dWidth/2 * dHeight/2;
// var cbData = i420Data.subarray(width*height, width*height + cbDataLength);
// gl.activeTexture(gl.TEXTURE1);
// gl.bindTexture(gl.TEXTURE_2D, uTextureRef);
// gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, dWidth/2, dHeight/2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, cbData);
//
// var crDataLength = cbDataLength;
// var crData = i420Data.subarray(width*height + width*height/4, width*height + width*height/4 + crDataLength);
// gl.activeTexture(gl.TEXTURE2);
// gl.bindTexture(gl.TEXTURE_2D, vTextureRef);
// gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, dWidth/2, dHeight/2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, crData);
// //裁剪宽
var yDataLength = dWidth * dHeight;
var yData=new Uint8Array(yDataLength) ;
for(var i=0;i<dHeight;i++)
{
//var ySonData=new Uint8Array(dWidth) ;
var ySonData = i420Data.subarray(i*width, i*width+dWidth);
for (var j = 0; j < dWidth; j++) {
yData[i*dWidth + j] = ySonData[j];
}
}
gl.activeTexture(gl.TEXTURE0);
gl.bindTexture(gl.TEXTURE_2D, yTextureRef);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, dWidth, dHeight, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, yData);
yData=null;
ySonData=null;
var cbDataLength = dWidth/2 * dHeight/2;
var cbData =new Uint8Array(cbDataLength);
//var cbSonData=new Uint8Array(dWidth/2) ;
for(var i=0;i<dHeight/2;i++)
{
var cbSonData = i420Data.subarray(width*height+i*width/2, width*height+i*width/2+dWidth/2);
for (var j = 0; j < dWidth/2; j++) {
cbData[i*dWidth/2 + j] = cbSonData[j];
}
}
gl.activeTexture(gl.TEXTURE1);
gl.bindTexture(gl.TEXTURE_2D, uTextureRef);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, dWidth/2, dHeight/2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, cbData);
cbData=null;
cbSonData=null;
var crDataLength = cbDataLength;
var crData = new Uint8Array(crDataLength);
for(var i=0;i<dHeight/2;i++)
{
var crSonData = i420Data.subarray(width*height*5/4+i*width/2, width*height*5/4+i*width/2+dWidth/2);
for (var j = 0; j < dWidth/2; j++) {
crData[i*dWidth/2 + j] = crSonData[j];
}
}
gl.activeTexture(gl.TEXTURE2);
gl.bindTexture(gl.TEXTURE_2D, vTextureRef);
gl.texImage2D(gl.TEXTURE_2D, 0, gl.LUMINANCE, dWidth/2, dHeight/2, 0, gl.LUMINANCE, gl.UNSIGNED_BYTE, crData);
crData=null;
crSonData=null;
};
/**
* 设置显示区域
* @param stDisplayRect 显示区域
*/
RenderManager.prototype.SR_SetDisplayRect = function(stDisplayRect) {
var gl = this.contextGL;
var nWindowWidth = this.nWindowWidth;
var nWindowHeight = this.nWindowHeight;
var texturePosValues = null;
if(stDisplayRect && nWindowWidth > 0 && nWindowHeight > 0) {
var fLeft = stDisplayRect.left / nWindowWidth;
var fTop = stDisplayRect.top / nWindowHeight;
var fRight = stDisplayRect.right / nWindowWidth;
var fBottom = stDisplayRect.bottom / nWindowHeight;
texturePosValues = new Float32Array([fRight, fTop, fLeft, fTop, fRight, fBottom, fLeft, fBottom]);
}
else {
texturePosValues = new Float32Array([1, 0, 0, 0, 1, 1, 0, 1]);
}
var texturePosBuffer = this.texturePosBuffer;
gl.bindBuffer(gl.ARRAY_BUFFER, texturePosBuffer);
gl.bufferSubData(gl.ARRAY_BUFFER, 0, texturePosValues);
gl.bindBuffer(gl.ARRAY_BUFFER, null);
};
/**
* 释放显示资源
*/
RenderManager.prototype.SR_Destroy = function() {
var gl = this.contextGL;
var YUVProgram = this.YUVProgram;
gl.deleteProgram(YUVProgram);
var vertexPosBuffer = this.vertexPosBuffer;
var texturePosBuffer = this.texturePosBuffer;
gl.deleteBuffer(vertexPosBuffer);
gl.deleteBuffer(texturePosBuffer);
var yTextureRef = this.yTextureRef;
var uTextureRef = this.uTextureRef;
var vTextureRef = this.vTextureRef;
gl.deleteTexture(yTextureRef);
gl.deleteTexture(uTextureRef);
gl.deleteTexture(vTextureRef);
};
return RenderManager;
}));
\ No newline at end of file
"use strict";var vertexYUVShader=["#version 300 es","layout(location = 0) in vec4 vertexPos;","layout(location = 1) in vec2 texturePos;","out vec2 textureCoord;","void main()","{","gl_Position = vertexPos;","textureCoord = texturePos;","}"].join("\n");var fragmentYUVShader=["#version 300 es","precision highp float;","in vec2 textureCoord;","out vec4 fragColor;","uniform sampler2D ySampler;","uniform sampler2D uSampler;","uniform sampler2D vSampler;","const mat4 YUV2RGB = mat4","(","1.1643828125, 0, 1.59602734375, -.87078515625,","1.1643828125, -.39176171875, -.81296875, .52959375,","1.1643828125, 2.017234375, 0, -1.081390625,","0, 0, 0, 1",");","void main(void) {","float y = texture(ySampler, textureCoord).r;","float u = texture(uSampler, textureCoord).r;","float v = texture(vSampler, textureCoord).r;","fragColor = vec4(y, u, v, 1) * YUV2RGB;","}"].join("\n");var vertexLineShader=["#version 300 es","layout(location = 0) in vec4 vertexPosLine;","void main()","{","gl_Position = vertexPosLine;","}"].join("\n");var fragmentLineShader=["#version 300 es","precision highp float;","uniform mediump float fRcom;","uniform mediump float fGcom;","uniform mediump float fBcom;","out vec4 fragColor;","void main()","{","fragColor = vec4(fRcom,fGcom,fBcom,1.0);","}"].join("\n");(function(e,r){e.SuperRender2=r()})(this,function(){function e(e){this.canvasElement=document.getElementById(e);this.initContextGL();if(this.contextGL){this.YUVProgram=this.initProgram(vertexYUVShader,fragmentYUVShader);this.LineProgram=this.initProgram(vertexLineShader,fragmentLineShader);this.initBuffers();this.initTextures()}}e.prototype.initContextGL=function(){var e=this.canvasElement;var r=null;try{r=e.getContext("webgl2")}catch(e){r=null}if(!r||typeof r.getParameter!=="function"){r=null}this.contextGL=r;console.log("WebGL2.0")};e.prototype.initProgram=function(e,r){var t=this.contextGL;var a=t.createShader(t.VERTEX_SHADER);t.shaderSource(a,e);t.compileShader(a);if(!t.getShaderParameter(a,t.COMPILE_STATUS)){console.log("Vertex shader failed to compile: "+t.getShaderInfoLog(a))}var i=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(i,r);t.compileShader(i);if(!t.getShaderParameter(i,t.COMPILE_STATUS)){console.log("Fragment shader failed to compile: "+t.getShaderInfoLog(i))}var o=t.createProgram();t.attachShader(o,a);t.attachShader(o,i);t.linkProgram(o);if(!t.getProgramParameter(o,t.LINK_STATUS)){console.log("Program failed to compile: "+t.getProgramInfoLog(o))}t.deleteShader(a);t.deleteShader(i);return o};e.prototype.initBuffers=function(){var e=this.contextGL;var r=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,r);e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,1,-1,1,1,-1,-1,-1]),e.STATIC_DRAW);e.bindBuffer(e.ARRAY_BUFFER,null);var t=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,t);e.bufferData(e.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),e.DYNAMIC_DRAW);e.bindBuffer(e.ARRAY_BUFFER,null);var a=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,a);e.bufferData(e.ARRAY_BUFFER,16,e.DYNAMIC_DRAW);e.bindBuffer(e.ARRAY_BUFFER,null);this.vertexPosBuffer=r;this.texturePosBuffer=t;this.vertexLineBuffer=a};e.prototype.initTextures=function(){var e=this.contextGL;var r=this.YUVProgram;e.useProgram(r);var t=this.initTexture();var a=e.getUniformLocation(r,"ySampler");e.uniform1i(a,0);this.yTextureRef=t;var i=this.initTexture();var o=e.getUniformLocation(r,"uSampler");e.uniform1i(o,1);this.uTextureRef=i;var n=this.initTexture();var f=e.getUniformLocation(r,"vSampler");e.uniform1i(f,2);this.vTextureRef=n;e.useProgram(null)};e.prototype.initTexture=function(){var e=this.contextGL;var r=e.createTexture();e.bindTexture(e.TEXTURE_2D,r);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);e.bindTexture(e.TEXTURE_2D,null);return r};e.prototype.SR_DisplayFrameData=function(e,r,t){if(e<=0||r<=0){return}var a=this.contextGL;if(null==t){a.clearColor(0,0,0,0);a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);return}var i=this.canvasElement;this.nWindowWidth=i.width;this.nWindowHeight=i.height;var o=this.nWindowWidth;var n=this.nWindowHeight;a.clearColor(.8,.8,1,1);a.clear(a.COLOR_BUFFER_BIT|a.DEPTH_BUFFER_BIT);a.viewport(0,0,o,n);this.updateFrameData(e,r,t);var f=this.YUVProgram;a.useProgram(f);var u=this.vertexPosBuffer;a.bindBuffer(a.ARRAY_BUFFER,u);var s=a.getAttribLocation(f,"vertexPos");a.enableVertexAttribArray(s);a.vertexAttribPointer(s,2,a.FLOAT,false,0,0);a.bindBuffer(a.ARRAY_BUFFER,null);var v=this.texturePosBuffer;a.bindBuffer(a.ARRAY_BUFFER,v);var l=a.getAttribLocation(f,"texturePos");a.enableVertexAttribArray(l);a.vertexAttribPointer(l,2,a.FLOAT,false,0,0);a.bindBuffer(a.ARRAY_BUFFER,null);a.drawArrays(a.TRIANGLE_STRIP,0,4);a.disableVertexAttribArray(s);a.disableVertexAttribArray(l);a.useProgram(null)};e.prototype.updateFrameData=function(e,r,t){var a=this.contextGL;var i=this.yTextureRef;var o=this.uTextureRef;var n=this.vTextureRef;var f=t;var u=e*r;var s=f.subarray(0,u);a.activeTexture(a.TEXTURE0);a.bindTexture(a.TEXTURE_2D,i);a.texImage2D(a.TEXTURE_2D,0,a.LUMINANCE,e,r,0,a.LUMINANCE,a.UNSIGNED_BYTE,s);var v=e/2*r/2;var l=f.subarray(u,u+v);a.activeTexture(a.TEXTURE1);a.bindTexture(a.TEXTURE_2D,o);a.texImage2D(a.TEXTURE_2D,0,a.LUMINANCE,e/2,r/2,0,a.LUMINANCE,a.UNSIGNED_BYTE,l);var R=v;var m=f.subarray(u+v,u+v+R);a.activeTexture(a.TEXTURE2);a.bindTexture(a.TEXTURE_2D,n);a.texImage2D(a.TEXTURE_2D,0,a.LUMINANCE,e/2,r/2,0,a.LUMINANCE,a.UNSIGNED_BYTE,m)};e.prototype.SR_DrawLine=function(e,r,t,a){var i=this.contextGL;var o=this.nWindowWidth;var n=this.nWindowHeight;var f=this.LineProgram;i.useProgram(f);var u=i.getUniformLocation(f,"fRcom");i.uniform1f(u,t.fR);var s=i.getUniformLocation(f,"fGcom");i.uniform1f(s,t.fG);var v=i.getUniformLocation(f,"fBcom");i.uniform1f(v,t.fB);var l=e.fX/o*2-1;var R=-(e.fY/n)*2+1;var m=r.fX/o*2-1;var h=-(r.fY/n)*2+1;var E=this.vertexLineBuffer;i.bindBuffer(i.ARRAY_BUFFER,E);i.bufferSubData(i.ARRAY_BUFFER,0,new Float32Array([l,R,m,h]));var T=i.getAttribLocation(f,"vertexPosLine");i.enableVertexAttribArray(T);i.vertexAttribPointer(T,2,i.FLOAT,false,0,0);i.bindBuffer(i.ARRAY_BUFFER,null);i.drawArrays(i.LINES,0,2);i.disableVertexAttribArray(T);i.useProgram(null)};e.prototype.SR_SetDisplayRect=function(e){var r=this.contextGL;var t=this.nWindowWidth;var a=this.nWindowHeight;var i=null;if(e&&t>0&&a>0){var o=e.left/t;var n=e.top/a;var f=e.right/t;var u=e.bottom/a;i=new Float32Array([f,n,o,n,f,u,o,u])}else{i=new Float32Array([1,0,0,0,1,1,0,1])}var s=this.texturePosBuffer;r.bindBuffer(r.ARRAY_BUFFER,s);r.bufferSubData(r.ARRAY_BUFFER,0,i);r.bindBuffer(r.ARRAY_BUFFER,null)};e.prototype.SR_Destroy=function(){var e=this.contextGL;var r=this.YUVProgram;e.deleteProgram(r);var t=this.LineProgram;e.deleteProgram(t);var a=this.vertexPosBuffer;var i=this.texturePosBuffer;var o=this.vertexLineBuffer;e.deleteBuffer(a);e.deleteBuffer(i);e.deleteBuffer(o);var n=this.yTextureRef;var f=this.uTextureRef;var u=this.vTextureRef;e.deleteTexture(n);e.deleteTexture(f);e.deleteTexture(u)};return e});
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* @license
* Copyright 2015 The Emscripten Authors
* SPDX-License-Identifier: MIT
*/
// Pthread Web Worker startup routine:
// This is the entry point file that is loaded first by each Web Worker
// that executes pthreads on the Emscripten application.
// Thread-local:
var initializedJS = false; // Guard variable for one-time init of the JS state (currently only embind types registration)
var Module = {};
function assert(condition, text) {
if (!condition) abort('Assertion failed: ' + text);
}
function threadPrintErr() {
var text = Array.prototype.slice.call(arguments).join(' ');
console.error(text);
}
function threadAlert() {
var text = Array.prototype.slice.call(arguments).join(' ');
postMessage({cmd: 'alert', text: text, threadId: Module['_pthread_self']()});
}
// We don't need out() for now, but may need to add it if we want to use it
// here. Or, if this code all moves into the main JS, that problem will go
// away. (For now, adding it here increases code size for no benefit.)
var out = function() {
throw 'out() is not defined in worker.js.';
}
var err = threadPrintErr;
this.alert = threadAlert;
Module['instantiateWasm'] = function(info, receiveInstance) {
// Instantiate from the module posted from the main thread.
// We can just use sync instantiation in the worker.
var instance = new WebAssembly.Instance(Module['wasmModule'], info);
// TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193,
// the above line no longer optimizes out down to the following line.
// When the regression is fixed, we can remove this if/else.
receiveInstance(instance);
// We don't need the module anymore; new threads will be spawned from the main thread.
Module['wasmModule'] = null;
return instance.exports;
};
function moduleLoaded() {
}
this.onmessage = function(e) {
try {
if (e.data.cmd === 'load') { // Preload command that is called once per worker to parse and load the Emscripten code.
// Module and memory were sent from main thread
Module['wasmModule'] = e.data.wasmModule;
Module['wasmMemory'] = e.data.wasmMemory;
Module['buffer'] = Module['wasmMemory'].buffer;
Module['ENVIRONMENT_IS_PTHREAD'] = true;
if (typeof e.data.urlOrBlob === 'string') {
importScripts(e.data.urlOrBlob);
} else {
var objectUrl = URL.createObjectURL(e.data.urlOrBlob);
importScripts(objectUrl);
URL.revokeObjectURL(objectUrl);
}
JSPlayerModule(Module).then(function (instance) {
Module = instance;
moduleLoaded();
});
} else if (e.data.cmd === 'objectTransfer') {
Module['PThread'].receiveObjectTransfer(e.data);
} else if (e.data.cmd === 'run') {
// This worker was idle, and now should start executing its pthread entry
// point.
// performance.now() is specced to return a wallclock time in msecs since
// that Web Worker/main thread launched. However for pthreads this can
// cause subtle problems in emscripten_get_now() as this essentially
// would measure time from pthread_create(), meaning that the clocks
// between each threads would be wildly out of sync. Therefore sync all
// pthreads to the clock on the main browser thread, so that different
// threads see a somewhat coherent clock across each of them
// (+/- 0.1msecs in testing).
Module['__performance_now_clock_drift'] = performance.now() - e.data.time;
// Pass the thread address inside the asm.js scope to store it for fast access that avoids the need for a FFI out.
Module['__emscripten_thread_init'](e.data.threadInfoStruct, /*isMainBrowserThread=*/0, /*isMainRuntimeThread=*/0);
// Establish the stack frame for this thread in global scope
// The stack grows downwards
var max = e.data.stackBase;
var top = e.data.stackBase + e.data.stackSize;
assert(e.data.threadInfoStruct);
assert(top != 0);
assert(max != 0);
assert(top > max);
// Also call inside JS module to set up the stack frame for this pthread in JS module scope
Module['establishStackSpace'](top, max);
Module['PThread'].receiveObjectTransfer(e.data);
Module['PThread'].threadInit();
// Embind must initialize itself on all threads, as it generates support JS.
// We only do this once per worker since they get reused
if (!initializedJS) {
Module['___embind_register_native_and_builtin_types']();
initializedJS = true;
}
try {
// pthread entry points are always of signature 'void *ThreadMain(void *arg)'
// Native codebases sometimes spawn threads with other thread entry point signatures,
// such as void ThreadMain(void *arg), void *ThreadMain(), or void ThreadMain().
// That is not acceptable per C/C++ specification, but x86 compiler ABI extensions
// enable that to work. If you find the following line to crash, either change the signature
// to "proper" void *ThreadMain(void *arg) form, or try linking with the Emscripten linker
// flag -s EMULATE_FUNCTION_POINTER_CASTS=1 to add in emulation for this x86 ABI extension.
var result = Module['invokeEntryPoint'](e.data.start_routine, e.data.arg);
Module['checkStackCookie']();
if (Module['keepRuntimeAlive']()) {
Module['PThread'].setExitStatus(result);
} else {
Module['PThread'].threadExit(result);
}
} catch(ex) {
if (ex === 'Canceled!') {
Module['PThread'].threadCancel();
} else if (ex != 'unwind') {
// FIXME(sbc): Figure out if this is still needed or useful. Its not
// clear to me how this check could ever fail. In order to get into
// this try/catch block at all we have already called bunch of
// functions on `Module`.. why is this one special?
if (typeof(Module['_emscripten_futex_wake']) !== "function") {
err("Thread Initialisation failed.");
throw ex;
}
// ExitStatus not present in MINIMAL_RUNTIME
if (ex instanceof Module['ExitStatus']) {
if (Module['keepRuntimeAlive']()) {
err('Pthread 0x' + Module['_pthread_self']().toString(16) + ' called exit(), staying alive due to noExitRuntime.');
} else {
err('Pthread 0x' + Module['_pthread_self']().toString(16) + ' called exit(), calling threadExit.');
Module['PThread'].threadExit(ex.status);
}
}
else
{
Module['PThread'].threadExit(-2);
throw ex;
}
} else {
// else e == 'unwind', and we should fall through here and keep the pthread alive for asynchronous events.
err('Pthread 0x' + Module['_pthread_self']().toString(16) + ' completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.');
}
}
} else if (e.data.cmd === 'cancel') { // Main thread is asking for a pthread_cancel() on this thread.
if (Module['_pthread_self']()) {
Module['PThread'].threadCancel();
}
} else if (e.data.target === 'setimmediate') {
// no-op
} else if (e.data.cmd === 'processThreadQueue') {
if (Module['_pthread_self']()) { // If this thread is actually running?
Module['_emscripten_current_thread_process_queued_calls']();
}
} else {
err('worker.js received unknown command ' + e.data.cmd);
err(e.data);
}
} catch(ex) {
err('worker.js onmessage() captured an uncaught exception: ' + ex);
if (ex && ex.stack) err(ex.stack);
throw ex;
}
};
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/**
* @license
* Copyright 2015 The Emscripten Authors
* SPDX-License-Identifier: MIT
*/
// Pthread Web Worker startup routine:
// This is the entry point file that is loaded first by each Web Worker
// that executes pthreads on the Emscripten application.
// Thread-local:
var initializedJS = false; // Guard variable for one-time init of the JS state (currently only embind types registration)
var Module = {};
function assert(condition, text) {
if (!condition) abort('Assertion failed: ' + text);
}
function threadPrintErr() {
var text = Array.prototype.slice.call(arguments).join(' ');
console.error(text);
}
function threadAlert() {
var text = Array.prototype.slice.call(arguments).join(' ');
postMessage({cmd: 'alert', text: text, threadId: Module['_pthread_self']()});
}
// We don't need out() for now, but may need to add it if we want to use it
// here. Or, if this code all moves into the main JS, that problem will go
// away. (For now, adding it here increases code size for no benefit.)
var out = function() {
throw 'out() is not defined in worker.js.';
}
var err = threadPrintErr;
this.alert = threadAlert;
Module['instantiateWasm'] = function(info, receiveInstance) {
// Instantiate from the module posted from the main thread.
// We can just use sync instantiation in the worker.
var instance = new WebAssembly.Instance(Module['wasmModule'], info);
// TODO: Due to Closure regression https://github.com/google/closure-compiler/issues/3193,
// the above line no longer optimizes out down to the following line.
// When the regression is fixed, we can remove this if/else.
receiveInstance(instance);
// We don't need the module anymore; new threads will be spawned from the main thread.
Module['wasmModule'] = null;
return instance.exports;
};
function moduleLoaded() {
}
this.onmessage = function(e) {
try {
if (e.data.cmd === 'load') { // Preload command that is called once per worker to parse and load the Emscripten code.
// Module and memory were sent from main thread
Module['wasmModule'] = e.data.wasmModule;
Module['wasmMemory'] = e.data.wasmMemory;
Module['buffer'] = Module['wasmMemory'].buffer;
Module['ENVIRONMENT_IS_PTHREAD'] = true;
if (typeof e.data.urlOrBlob === 'string') {
importScripts(e.data.urlOrBlob);
} else {
var objectUrl = URL.createObjectURL(e.data.urlOrBlob);
importScripts(objectUrl);
URL.revokeObjectURL(objectUrl);
}
JSAudioInterComModule(Module).then(function (instance) {
Module = instance;
moduleLoaded();
});
} else if (e.data.cmd === 'objectTransfer') {
Module['PThread'].receiveObjectTransfer(e.data);
} else if (e.data.cmd === 'run') {
// This worker was idle, and now should start executing its pthread entry
// point.
// performance.now() is specced to return a wallclock time in msecs since
// that Web Worker/main thread launched. However for pthreads this can
// cause subtle problems in emscripten_get_now() as this essentially
// would measure time from pthread_create(), meaning that the clocks
// between each threads would be wildly out of sync. Therefore sync all
// pthreads to the clock on the main browser thread, so that different
// threads see a somewhat coherent clock across each of them
// (+/- 0.1msecs in testing).
Module['__performance_now_clock_drift'] = performance.now() - e.data.time;
// Pass the thread address inside the asm.js scope to store it for fast access that avoids the need for a FFI out.
Module['__emscripten_thread_init'](e.data.threadInfoStruct, /*isMainBrowserThread=*/0, /*isMainRuntimeThread=*/0);
// Establish the stack frame for this thread in global scope
// The stack grows downwards
var max = e.data.stackBase;
var top = e.data.stackBase + e.data.stackSize;
assert(e.data.threadInfoStruct);
assert(top != 0);
assert(max != 0);
assert(top > max);
// Also call inside JS module to set up the stack frame for this pthread in JS module scope
Module['establishStackSpace'](top, max);
Module['PThread'].receiveObjectTransfer(e.data);
Module['PThread'].threadInit();
// Embind must initialize itself on all threads, as it generates support JS.
// We only do this once per worker since they get reused
if (!initializedJS) {
Module['___embind_register_native_and_builtin_types']();
initializedJS = true;
}
try {
// pthread entry points are always of signature 'void *ThreadMain(void *arg)'
// Native codebases sometimes spawn threads with other thread entry point signatures,
// such as void ThreadMain(void *arg), void *ThreadMain(), or void ThreadMain().
// That is not acceptable per C/C++ specification, but x86 compiler ABI extensions
// enable that to work. If you find the following line to crash, either change the signature
// to "proper" void *ThreadMain(void *arg) form, or try linking with the Emscripten linker
// flag -s EMULATE_FUNCTION_POINTER_CASTS=1 to add in emulation for this x86 ABI extension.
var result = Module['invokeEntryPoint'](e.data.start_routine, e.data.arg);
Module['checkStackCookie']();
if (Module['keepRuntimeAlive']()) {
Module['PThread'].setExitStatus(result);
} else {
Module['PThread'].threadExit(result);
}
} catch(ex) {
if (ex === 'Canceled!') {
Module['PThread'].threadCancel();
} else if (ex != 'unwind') {
// FIXME(sbc): Figure out if this is still needed or useful. Its not
// clear to me how this check could ever fail. In order to get into
// this try/catch block at all we have already called bunch of
// functions on `Module`.. why is this one special?
if (typeof(Module['_emscripten_futex_wake']) !== "function") {
err("Thread Initialisation failed.");
throw ex;
}
// ExitStatus not present in MINIMAL_RUNTIME
if (ex instanceof Module['ExitStatus']) {
if (Module['keepRuntimeAlive']()) {
err('Pthread 0x' + Module['_pthread_self']().toString(16) + ' called exit(), staying alive due to noExitRuntime.');
} else {
err('Pthread 0x' + Module['_pthread_self']().toString(16) + ' called exit(), calling threadExit.');
Module['PThread'].threadExit(ex.status);
}
}
else
{
Module['PThread'].threadExit(-2);
throw ex;
}
} else {
// else e == 'unwind', and we should fall through here and keep the pthread alive for asynchronous events.
err('Pthread 0x' + Module['_pthread_self']().toString(16) + ' completed its pthread main entry point with an unwind, keeping the pthread worker alive for asynchronous operation.');
}
}
} else if (e.data.cmd === 'cancel') { // Main thread is asking for a pthread_cancel() on this thread.
if (Module['_pthread_self']()) {
Module['PThread'].threadCancel();
}
} else if (e.data.target === 'setimmediate') {
// no-op
} else if (e.data.cmd === 'processThreadQueue') {
if (Module['_pthread_self']()) { // If this thread is actually running?
Module['_emscripten_current_thread_process_queued_calls']();
}
} else {
err('worker.js received unknown command ' + e.data.cmd);
err(e.data);
}
} catch(ex) {
err('worker.js onmessage() captured an uncaught exception: ' + ex);
if (ex && ex.stack) err(ex.stack);
throw ex;
}
};
// Node.js support
if (typeof process === 'object' && typeof process.versions === 'object' && typeof process.versions.node === 'string') {
// Create as web-worker-like an environment as we can.
self = {
location: {
href: __filename
}
};
var onmessage = this.onmessage;
var nodeWorkerThreads = require('worker_threads');
global.Worker = nodeWorkerThreads.Worker;
var parentPort = nodeWorkerThreads.parentPort;
parentPort.on('message', function(data) {
onmessage({ data: data });
});
var nodeFS = require('fs');
var nodeRead = function(filename) {
return nodeFS.readFileSync(filename, 'utf8');
};
function globalEval(x) {
global.require = require;
global.Module = Module;
eval.call(null, x);
}
importScripts = function(f) {
globalEval(nodeRead(f));
};
postMessage = function(msg) {
parentPort.postMessage(msg);
};
if (typeof performance === 'undefined') {
performance = {
now: function() {
return Date.now();
}
};
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
importScripts('libSystemTransform.js');
const RECORDRTP = 0; //录制一份未经过转封装的码流原始数据,用于定位问题
let dataType = 1;
// 转封装库回调函数
self.STCallBack = function (fileIndex,indexLen, data, dataLen)
{
//stFrameInfo的类型见DETAIL_FRAME_INFO
let stFrameInfo = Module._GetDetialFrameInfo();
let nIsMp4Index = stFrameInfo.nIsMp4Index;
//console.log("FrameType is " , stFrameInfo);
//console.log("nIsMp4Index is " + nIsMp4Index);
//debugger
var pData = null;
pData = new Uint8Array(dataLen);
pData.set(Module.HEAPU8.subarray(data, data + dataLen));
if (dataType === 1) {
if (pData[0] == 0x49 && pData[1] == 0x4d && pData[2] == 0x4b && pData[3] == 0x48) {//码流头丢掉
return;
}
postMessage({type: "outputData", buf: pData, dType: 1});
dataType = 2;
} else {
if (nIsMp4Index) {
postMessage({type: "outputData", buf: pData, dType: 6}); //6:索引类型
} else {
postMessage({type: "outputData", buf: pData, dType: 2}); //2:码流
}
}
//stFrameInfo的类型见DETAIL_FRAME_INFO
//let stFrameInfo = Module._GetDetialFrameInfo();
//let stFrameType = stFrameInfo.nFrameType;
//let nFrameNum = stFrameInfo.nFrameNum;
//let nTimeStamp = stFrameInfo.nTimeStamp;
//let nIsMp4Index = stFrameInfo.nIsMp4Index;
//console.log("FrameType is " + stFrameType);
//console.log("nIsMp4Index is " + nIsMp4Index);
}
// self.Module = { memoryInitializerRequest: loadMemInitFile(), TOTAL_MEMORY: 128*1024*1024 };
// importScripts('SystemTransform.js');
self.Module['onRuntimeInitialized'] = function (){
postMessage({type: "loaded"});
}
onmessage = function (e) {
var data = e.data;
if ("create" === data.type) {
if (RECORDRTP) {
postMessage({type: "created"});
postMessage({type: "outputData", buf: data.buf, dType: 1});
} else {
var iHeadLen = data.len;
var pHead = Module._malloc(iHeadLen);
self.writeArrayToMemory(new Uint8Array(data.buf), pHead);
var iTransType = data.packType;//目标格式
var iRet = Module._CreatHandle(pHead, iTransType, 4096);
if (iRet != 0) {
console.log("_CreatHandle failed!" + iRet);
} else {
iRet = Module._SysTransRegisterDataCallBack();
if(iRet != 0)
{
console.log("_SysTransRegisterDataCallBack Failed:" + iRet);
}
iRet = Module._SysTransStart(null, null);
if(iRet != 0)
{
console.log("_SysTransStart Failed:" + iRet);
}
postMessage({type: "created"});
}
}
} else if ("inputData" === data.type) {
if (RECORDRTP) {
var aFileData = new Uint8Array(data.buf); // 拷贝一份
var iBufferLen = aFileData.length;
var szBufferLen = iBufferLen.toString(16);
if (szBufferLen.length === 1) {
szBufferLen = "000" + szBufferLen;
} else if (szBufferLen.length === 2) {
szBufferLen = "00" + szBufferLen;
} else if (szBufferLen.length === 3) {
szBufferLen = "0" + szBufferLen;
}
var aData = [0, 0, parseInt(szBufferLen.substring(0, 2), 16), parseInt(szBufferLen.substring(2, 4), 16)];
for(var iIndex = 0, iDataLength = aFileData.length; iIndex < iDataLength; iIndex++) {
aData[iIndex + 4] = aFileData[iIndex]
}
var dataUint8 = new Uint8Array(aData);
postMessage({type: "outputData", buf: dataUint8.buffer, dType: 2});
} else {
let pInputDataBuf = Module._malloc(data.len);
var idataLen = data.len;
self.writeArrayToMemory(new Uint8Array(data.buf), pInputDataBuf);
// 输入数据,每次最多2m
let pp = Module._SysTransInputData(0, pInputDataBuf, idataLen);
if(pp != 0) {
//console.log("InputData Failed:" + pp);
}
Module._free(pInputDataBuf);
}
} else if ("release" === data.type) {
var iRet = Module._SysTransStop();
if (iRet != 0) {
console.log("_SysTransStop Failed:", iRet);
}
Module._SysTransRelease();
if (iRet != 0) {
console.log("_SysTransRelease Failed:", iRet);
}
close();
}
};
\ No newline at end of file
...@@ -8,7 +8,8 @@ ...@@ -8,7 +8,8 @@
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title> <title><%= webpackConfig.name %></title>
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]--> <!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<script src="https://webapi.amap.com/maps?v=2.0&key=eed7ca3167f765467aa377fa78e61ece&plugin=Map3D,AMap.DistrictSearch,AMap.Scale,AMap.OverView,AMap.ToolBar,AMap.MouseTool,AMap.ControlBar,AMap.CircleEditor,AMap.PolyEditor"></script> <script src="https://webapi.amap.com/maps?v=2.0&key=49fcb156d466062435d7d33437099582&plugin=Map3D,AMap.DistrictSearch,AMap.Scale,AMap.OverView,AMap.ToolBar,AMap.MouseTool,AMap.ControlBar,AMap.CircleEditor,AMap.PolyEditor"></script>
<script src="h5player/h5player.min.js"></script> <script src="h5player/h5player.min.js"></script>
<style> <style>
html, html,
......
import request from '@/utils/request'
// 燃气事故台账统计
export function troubleStatistic(query) {
return request({
url: '/statistic/troubleStatistic',
method: 'get',
params: query
})
}
// 隐患整治台账统计
export function hiddenStatistic(query) {
return request({
url: '/statistic/hiddenStatistic',
method: 'get',
params: query
})
}
@font-face {
font-family: "arialbd";
src: url('~@/assets/fonts/UnidreamLED.ttf') format('truetype');
font-weight: normal;
font-style: normal;
}
\ No newline at end of file
@font-face {
font-family: 'UnidreamLED';
src: url('UnidreamLED.ttf');
font-weight: normal;
font-style: normal;
}
\ No newline at end of file
<svg id="组_2445" data-name="组 2445" xmlns="http://www.w3.org/2000/svg" width="18" height="25" viewBox="0 0 23 34.049">
<path id="路径_169" data-name="路径 169" d="M-2160.2,287.287a9.537,9.537,0,0,1,9.538,9.537,9.537,9.537,0,0,1-9.538,9.537,9.538,9.538,0,0,1-9.537-9.537A9.538,9.538,0,0,1-2160.2,287.287Zm0,1.467a8.069,8.069,0,0,0-8.069,8.07,8.069,8.069,0,0,0,8.069,8.07,8.069,8.069,0,0,0,8.07-8.07A8.069,8.069,0,0,0-2160.2,288.754Zm-.109,1.485a6.691,6.691,0,0,1,6.681,6.68,6.691,6.691,0,0,1-6.681,6.68,6.691,6.691,0,0,1-6.68-6.68A6.691,6.691,0,0,1-2160.309,290.239Zm.144,11.685h-.276v1.1h.276Zm-3.65-1.433-.771.772.2.2.772-.772-.2-.2Zm6.748,0-.2.2.771.772.2-.2Zm-1.874-6.328-1.808,2.094a.671.671,0,0,0-.265.286.825.825,0,0,0,.375,1.081.831.831,0,0,0,1.08-.375.723.723,0,0,0,.089-.375l.529-2.711Z" transform="translate(2171.7 -284.903)" fill="#7bf8f4"/>
<g id="路径_188" data-name="路径 188" fill="none">
<path d="M11.5,0A11.5,11.5,0,0,1,23,11.5c0,6.351-11.6,18.226-11.5,18.3S0,17.851,0,11.5A11.5,11.5,0,0,1,11.5,0Z" stroke="none"/>
<path d="M 11.5 0.9999980926513672 C 5.71027946472168 0.9999980926513672 1 5.710289001464844 1 11.50002861022949 C 1 15.44052600860596 6.295671463012695 22.62869071960449 11.47669506072998 28.3024730682373 C 12.68497657775879 26.95182228088379 15.33078575134277 23.97880554199219 17.65543937683105 20.72857856750488 C 19.63740921020508 17.95747756958008 22 14.10697841644287 22 11.50002861022949 C 22 5.710289001464844 17.28972053527832 0.9999980926513672 11.5 0.9999980926513672 M 11.5 -1.9073486328125e-06 C 17.85127067565918 -1.9073486328125e-06 23 5.148738861083984 23 11.50002861022949 C 23 17.82768249511719 11.48916530609131 29.63789749145508 11.49940204620361 29.80171585083008 C 11.36462783813477 29.63818168640137 0 17.7873649597168 0 11.50002861022949 C 0 5.148738861083984 5.14872932434082 -1.9073486328125e-06 11.5 -1.9073486328125e-06 Z M 11.49940204620361 29.80171585083008 C 11.50076866149902 29.80337524414062 11.50098419189453 29.8038387298584 11.5 29.80305862426758 C 11.49963855743408 29.80277252197266 11.49944019317627 29.80232810974121 11.49940204620361 29.80171585083008 Z" stroke="none" fill="#7bf8f4"/>
</g>
<path id="多边形_35" data-name="多边形 35" d="M4.524,0,9.049,6.033H0Z" transform="translate(16.59 29.951) rotate(180)" fill="#7bf8f4"/>
</svg>
<svg id="组_2447" data-name="组 2447" xmlns="http://www.w3.org/2000/svg" width="18" height="25" viewBox="0 0 23.304 34.295">
<path id="路径_168" data-name="路径 168" d="M-1603.123-57.691a9.445,9.445,0,0,0-9.234-8.255,9.5,9.5,0,0,0-9.333,9.663,9.5,9.5,0,0,0,9.333,9.663,9.445,9.445,0,0,0,9.234-8.255h.76v-2.817Zm-16.383.73a7.312,7.312,0,0,1,6.469-6.722v1.475a5.871,5.871,0,0,0-5.045,5.246Zm6.469,8.079a7.311,7.311,0,0,1-6.465-6.67h1.425a5.869,5.869,0,0,0,5.039,5.2Zm-.242-6.99v3.214h-1.149v-7.262h4.784V-58.9h-3.635v2.014h3.429v1.017Zm1.6,6.99v-1.475a5.869,5.869,0,0,0,5.039-5.2h1.425A7.311,7.311,0,0,1-1611.677-48.883Zm5.045-8.079a5.871,5.871,0,0,0-5.045-5.246v-1.475a7.313,7.313,0,0,1,6.469,6.722Z" transform="translate(1624.104 68.362)" fill="#7bf8f4"/>
<g id="路径_185" data-name="路径 185" fill="none">
<path d="M11.652,0A11.652,11.652,0,0,1,23.3,11.652c0,6.435-11.75,18.467-11.652,18.545S0,18.087,0,11.652A11.652,11.652,0,0,1,11.652,0Z" stroke="none"/>
<path d="M 11.65185546875 0.9999942779541016 C 5.77839469909668 0.9999942779541016 0.9999961853027344 5.778413772583008 0.9999961853027344 11.65188407897949 C 0.9999961853027344 15.65063667297363 6.374073028564453 22.94361305236816 11.62834739685059 28.69588470458984 C 12.84814071655273 27.33243751525879 15.5371789932251 24.3126106262207 17.89928436279297 21.01001358032227 C 19.90856552124023 18.20073509216309 22.3037052154541 14.29677486419678 22.3037052154541 11.65188407897949 C 22.3037052154541 5.778413772583008 17.52530479431152 0.9999942779541016 11.65185546875 0.9999942779541016 M 11.65185546875 -5.7220458984375e-06 C 18.08699607849121 -5.7220458984375e-06 23.3037052154541 5.216724395751953 23.3037052154541 11.65188407897949 C 23.3037052154541 18.06309509277344 11.64087867736816 30.02925682067871 11.65124988555908 30.19523429870605 C 11.5146951675415 30.02953720092773 -3.814697265625e-06 18.02224731445312 -3.814697265625e-06 11.65188407897949 C -3.814697265625e-06 5.216724395751953 5.216714859008789 -5.7220458984375e-06 11.65185546875 -5.7220458984375e-06 Z M 11.65124988555908 30.19523429870605 C 11.65263366699219 30.19691467285156 11.65285301208496 30.19738388061523 11.65185546875 30.19659423828125 C 11.6514892578125 30.19630432128906 11.65128803253174 30.19585609436035 11.65124988555908 30.19523429870605 Z" stroke="none" fill="#7bf8f4"/>
</g>
<path id="多边形_32" data-name="多边形 32" d="M4.53,0l4.53,6.039H0Z" transform="translate(16.306 30.197) rotate(180)" fill="#7bf8f4"/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="25" viewBox="0 0 23 34.049">
<g id="组_2451" data-name="组 2451" transform="translate(7189 23993)">
<g id="路径_188" data-name="路径 188" transform="translate(-7189 -23993)" fill="none">
<path d="M11.5,0A11.5,11.5,0,0,1,23,11.5c0,6.351-11.6,18.226-11.5,18.3S0,17.851,0,11.5A11.5,11.5,0,0,1,11.5,0Z" stroke="none"/>
<path d="M 11.5 0.9999980926513672 C 5.71027946472168 0.9999980926513672 1 5.710289001464844 1 11.50002861022949 C 1 15.44052600860596 6.295671463012695 22.62869071960449 11.47669506072998 28.3024730682373 C 12.68497657775879 26.95182228088379 15.33078575134277 23.97880554199219 17.65543937683105 20.72857856750488 C 19.63740921020508 17.95747756958008 22 14.10697841644287 22 11.50002861022949 C 22 5.710289001464844 17.28972053527832 0.9999980926513672 11.5 0.9999980926513672 M 11.5 -1.9073486328125e-06 C 17.85127067565918 -1.9073486328125e-06 23 5.148738861083984 23 11.50002861022949 C 23 17.82768249511719 11.48916530609131 29.63789749145508 11.49940204620361 29.80171585083008 C 11.36462783813477 29.63818168640137 0 17.7873649597168 0 11.50002861022949 C 0 5.148738861083984 5.14872932434082 -1.9073486328125e-06 11.5 -1.9073486328125e-06 Z M 11.49940204620361 29.80171585083008 C 11.50076866149902 29.80337524414062 11.50098419189453 29.8038387298584 11.5 29.80305862426758 C 11.49963855743408 29.80277252197266 11.49944019317627 29.80232810974121 11.49940204620361 29.80171585083008 Z" stroke="none" fill="#7bf8f4"/>
</g>
<path id="多边形_35" data-name="多边形 35" d="M4.524,0,9.049,6.033H0Z" transform="translate(-7172.411 -23963.049) rotate(180)" fill="#7bf8f4"/>
<path id="路径_1298" data-name="路径 1298" d="M21.1,8.659v7.97l-2.46-.621V13.532l-5.534-1.863V9.8h-.613V8.563l-3.428.807,1.315-1.4-.129-.791c-.1.323-.282.54-.508.573-.476.081-.992-.67-1.154-1.67-.145-.928.065-1.75.484-1.92L7.742,2.577l-.1-.04-1.888.307.016.452,1.3-.21L7.4,5.191l-.694.1L5.168,3.593,5.12,2.327,6.5,2.109l.9-.145.791-.129L16.51.512l.976.371,1.452,2.549L10.025,4.86a3.109,3.109,0,0,1,.21.549L18.2,4.134,18.624,6.8,17.285,8.062l-2.323.508V9.813h-.613v1.242L18.656,12.3V9.2ZM9.323,5.175c-.21.032-.315.411-.25.839s.29.758.5.726.315-.411.25-.839S9.532,5.142,9.323,5.175ZM7.943,8.119l-.411-2.6-.6.1.46,2.864,1.549.96.46-.419Z" transform="translate(-7191.327 -23989.652)" fill="#7bf8f4"/>
</g>
</svg>
<svg id="组_2448" data-name="组 2448" xmlns="http://www.w3.org/2000/svg" width="18" height="25" viewBox="0 0 23 33.9">
<path id="路径_173" data-name="路径 173" d="M-1877.09-49.461a9.537,9.537,0,0,0-9.537,9.537,9.537,9.537,0,0,0,9.537,9.537,9.537,9.537,0,0,0,9.537-9.537A9.537,9.537,0,0,0-1877.09-49.461Zm5.722,12.875h-.954v1.431h-1.43v.954h-1.907v-.954h-2.384v.954h-1.907v-.954h-1.431v-1.431h-.954v-6.676h.954v-1.431h1.431v-.477h1.431v.477h.953v-.477h1.431v.477h.954v-.477h1.431v.477h1.43v1.431h.954Zm-9.537,0h8.107v-7.153h-8.107Zm7.153-6.676h.477v6.2h-.477Zm-.954,0h.477v6.2h-.477Zm-.953,0h.477v6.2h-.477Zm-.954,0h.477v6.2h-.477Zm-.954,0h.477v6.2h-.477Zm-.953,0h.477v6.2h-.477Zm-.954,0h.477v6.2h-.477Zm-.954,0h.477v6.2h-.477Z" transform="translate(1888.59 51.845)" fill="#7bf8f4"/>
<g id="路径_186" data-name="路径 186" fill="none">
<path d="M11.5,0A11.5,11.5,0,0,1,23,11.5c0,6.351-11.6,18.226-11.5,18.3S0,17.851,0,11.5A11.5,11.5,0,0,1,11.5,0Z" stroke="none"/>
<path d="M 11.5 0.9999942779541016 C 5.71027946472168 0.9999942779541016 1 5.710294723510742 1 11.50003433227539 C 1 15.44047451019287 6.295700073242188 22.62868881225586 11.47670364379883 28.30246925354004 C 12.68497562408447 26.95181846618652 15.33078575134277 23.97880172729492 17.65543937683105 20.72857475280762 C 19.63740921020508 17.95747375488281 22 14.10698509216309 22 11.50003433227539 C 22 5.710294723510742 17.28972053527832 0.9999942779541016 11.5 0.9999942779541016 M 11.5 -5.7220458984375e-06 C 17.85128021240234 -5.7220458984375e-06 23 5.148744583129883 23 11.50003433227539 C 23 17.82767868041992 11.48916530609131 29.63789367675781 11.49940204620361 29.80171203613281 C 11.36462783813477 29.63816833496094 0 17.78736114501953 0 11.50003433227539 C 0 5.148744583129883 5.14872932434082 -5.7220458984375e-06 11.5 -5.7220458984375e-06 Z M 11.49940204620361 29.80171203613281 C 11.50076866149902 29.80337142944336 11.50098419189453 29.80383491516113 11.5 29.80305480957031 C 11.49963855743408 29.80276870727539 11.49944019317627 29.80232429504395 11.49940204620361 29.80171203613281 Z" stroke="none" fill="#7bf8f4"/>
</g>
<path id="多边形_33" data-name="多边形 33" d="M4.471,0,8.941,5.961H0Z" transform="translate(16.094 29.803) rotate(180)" fill="#7bf8f4"/>
</svg>
<svg id="组_2446" data-name="组 2446" xmlns="http://www.w3.org/2000/svg" width="18" height="25" viewBox="0 0 23 33.9">
<path id="路径_170" data-name="路径 170" d="M-1583.57,295.955a3.719,3.719,0,0,0-3.714,3.713,3.719,3.719,0,0,0,3.714,3.713,3.719,3.719,0,0,0,3.713-3.713,3.719,3.719,0,0,0-3.713-3.713Zm2.287,4.15a.608.608,0,0,1-.437.184h-1.862a.618.618,0,0,1-.621-.621V297.2a.618.618,0,0,1,.621-.621.608.608,0,0,1,.437.184.608.608,0,0,1,.184.437v1.862h1.242a.618.618,0,0,1,.621.621.6.6,0,0,1-.184.425Zm-8.966-5.047a4.143,4.143,0,0,0,4.161,0,4.166,4.166,0,0,0,2.081-3.61,4.161,4.161,0,0,0-4.162-4.161,4.16,4.16,0,0,0-4.161,4.161A4.179,4.179,0,0,0-1590.249,295.058Zm1.724,4.61a4.872,4.872,0,0,1,.391-1.931,5.639,5.639,0,0,1,.54-.966,4.67,4.67,0,0,1-.575.035,5.145,5.145,0,0,1-2.081-.425,5.006,5.006,0,0,1-.943-.517,1.2,1.2,0,0,0-1.345-.011,7.8,7.8,0,0,0-3.414,6.265v.069a.6.6,0,0,0,.6.575h7.92a5.215,5.215,0,0,1-.7-1.161,5.035,5.035,0,0,1-.391-1.931Z" transform="translate(1599.528 -284.903)" fill="#7bf8f4" opacity="0.996"/>
<g id="路径_190" data-name="路径 190" fill="none">
<path d="M11.5,0A11.5,11.5,0,0,1,23,11.5c0,6.351-11.6,18.226-11.5,18.3S0,17.851,0,11.5A11.5,11.5,0,0,1,11.5,0Z" stroke="none"/>
<path d="M 11.5 1.000003814697266 C 5.71027946472168 1.000003814697266 1 5.710294723510742 1 11.50003433227539 C 1 15.44052124023438 6.295677185058594 22.62869262695312 11.47670078277588 28.30246353149414 C 12.68496322631836 26.95182609558105 15.33070659637451 23.97891044616699 17.65538024902344 20.72865295410156 C 19.63738059997559 17.95753479003906 22 14.10700416564941 22 11.50003433227539 C 22 5.710294723510742 17.28972053527832 1.000003814697266 11.5 1.000003814697266 M 11.5 3.814697265625e-06 C 17.85128021240234 3.814697265625e-06 23 5.148744583129883 23 11.50003433227539 C 23 17.82767677307129 11.48916530609131 29.63790130615234 11.49940204620361 29.80170249938965 C 11.36462783813477 29.63816833496094 0 17.78736114501953 0 11.50003433227539 C 0 5.148744583129883 5.14872932434082 3.814697265625e-06 11.5 3.814697265625e-06 Z M 11.49940204620361 29.80170249938965 C 11.50076866149902 29.80335998535156 11.50098419189453 29.80382347106934 11.5 29.80304336547852 C 11.49963855743408 29.80275726318359 11.49944019317627 29.80231475830078 11.49940204620361 29.80170249938965 Z" stroke="none" fill="#7bf8f4"/>
</g>
<path id="多边形_37" data-name="多边形 37" d="M4.471,0,8.941,5.961H0Z" transform="translate(16.094 29.803) rotate(180)" fill="#7bf8f4"/>
</svg>
<svg id="组_2449" data-name="组 2449" xmlns="http://www.w3.org/2000/svg" width="18" height="25" viewBox="0 0 23 33.9">
<g id="路径_186" data-name="路径 186" fill="none">
<path d="M11.5,0A11.5,11.5,0,0,1,23,11.5c0,6.351-11.6,18.226-11.5,18.3S0,17.851,0,11.5A11.5,11.5,0,0,1,11.5,0Z" stroke="none"/>
<path d="M 11.5 0.9999942779541016 C 5.71027946472168 0.9999942779541016 1 5.710294723510742 1 11.50003433227539 C 1 15.44047451019287 6.295700073242188 22.62868881225586 11.47670364379883 28.30246925354004 C 12.68497562408447 26.95181846618652 15.33078575134277 23.97880172729492 17.65543937683105 20.72857475280762 C 19.63740921020508 17.95747375488281 22 14.10698509216309 22 11.50003433227539 C 22 5.710294723510742 17.28972053527832 0.9999942779541016 11.5 0.9999942779541016 M 11.5 -5.7220458984375e-06 C 17.85127067565918 -5.7220458984375e-06 23 5.148744583129883 23 11.50003433227539 C 23 17.82767868041992 11.48916530609131 29.63789367675781 11.49940204620361 29.80171203613281 C 11.36462783813477 29.63816833496094 0 17.78736114501953 0 11.50003433227539 C 0 5.148744583129883 5.14872932434082 -5.7220458984375e-06 11.5 -5.7220458984375e-06 Z M 11.49940204620361 29.80171203613281 C 11.50076866149902 29.80337142944336 11.50098419189453 29.80383491516113 11.5 29.80305480957031 C 11.49963855743408 29.80276870727539 11.49944019317627 29.80232429504395 11.49940204620361 29.80171203613281 Z" stroke="none" fill="#7bf8f4"/>
</g>
<path id="多边形_33" data-name="多边形 33" d="M4.471,0,8.941,5.961H0Z" transform="translate(16.094 29.804) rotate(180)" fill="#7bf8f4"/>
<path id="路径_966" data-name="路径 966" d="M99.476,156.616a6.028,6.028,0,0,1-1.622,2.267.9.9,0,0,1-.583.252.8.8,0,0,1-.567-.236.765.765,0,0,1-.236-.535.705.705,0,0,1,.236-.535,6.035,6.035,0,0,0,1.748-4.377A5.726,5.726,0,0,0,96.7,149.2a6.645,6.645,0,0,0-9.085.016,5.836,5.836,0,0,0-1.763,4.283,6.134,6.134,0,0,0,1.952,4.346.765.765,0,0,1,.236.535.705.705,0,0,1-.236.535.748.748,0,0,1-.567.236.8.8,0,0,1-.567-.236,7.414,7.414,0,0,1-2.047-2.724,7.528,7.528,0,0,1,1.748-8.266,7.836,7.836,0,0,1,2.629-1.685,9.392,9.392,0,0,1,6.361-.063,6.113,6.113,0,0,1,2.141,1.26c2.866,2.425,3.023,5.9,2.047,8.943Zm-7.337-7.684a4.366,4.366,0,0,0-4.377,4.267.5.5,0,0,1-.236.5.527.527,0,0,1-.567,0,.513.513,0,0,1-.236-.5,5.254,5.254,0,0,1,1.575-3.684,5.533,5.533,0,0,1,7.7,0,5.208,5.208,0,0,1,1.606,3.732.5.5,0,0,1-.236.5.527.527,0,0,1-.567,0,.513.513,0,0,1-.236-.5,4.382,4.382,0,0,0-4.424-4.314Zm.913,5.4a1.113,1.113,0,0,1-1.559-.047,1.054,1.054,0,0,1-.268-1.149l-1.212-1.2a.418.418,0,0,1,0-.6.479.479,0,0,1,.63,0l1.228,1.2a1.162,1.162,0,0,1,1.2.268,1.024,1.024,0,0,1,.331.771A1.093,1.093,0,0,1,93.052,154.333Zm.016-.016" transform="translate(-80.582 -142.727)" fill="#7bf8f4"/>
</svg>
/**
* 通用css样式布局处理
* Copyright (c) 2019 gassafety
*/
/** 基础通用 **/
.pt5 {
padding-top: 5px;
}
.pr5 {
padding-right: 5px;
}
.pb5 {
padding-bottom: 5px;
}
.mt5 {
margin-top: 5px;
}
.mr5 {
margin-right: 5px;
}
.mb5 {
margin-bottom: 5px;
}
.mb8 {
margin-bottom: 8px;
}
.ml5 {
margin-left: 5px;
}
.mt10 {
margin-top: 10px;
}
.mr10 {
margin-right: 10px;
}
.mb10 {
margin-bottom: 10px;
}
.ml0 {
margin-left: 10px;
}
.mt20 {
margin-top: 20px;
}
.mr20 {
margin-right: 20px;
}
.mb20 {
margin-bottom: 20px;
}
.m20 {
margin-left: 20px;
}
.el-dialog:not(.is-fullscreen) {
margin-top: 6vh !important;
}
.bigwindow {
// 全局表格样式
.el-table {
.el-table__header-wrapper,
.el-table__fixed-header-wrapper {
th {
word-break: break-word;
background-color: #053b6a;
color: #fff;
height: 40px;
font-size: 13px;
}
}
.el-table__body-wrapper {
.el-table__row:nth-child(2n + 1) {
background-color: #e6e6e6;
// &:hover {
// td {
// background-color: #f4f4f4;
// }
// }
td {
.cell {
color: #525252;
}
}
}
.el-table__row:nth-child(2n) {
background-color: #f4f4f4;
// &:hover {
// td {
// background-color: #e6e6e6;
// }
// }
td {
.cell {
color: #053b6a;
}
}
}
}
.el-table__body-wrapper {
.el-button [class*="el-icon-"] + span {
margin-left: 1px;
}
}
}
// gis地图中底部table样式
.drawer {
.el-button {
color: #ffffff;
&:not(.is-disabled):hover {
color: rgb(46, 231, 231);
}
&.is-disabled {
border-color: #ccccccc3 !important;
color: #ccccccc3;
}
}
}
.right-bottom-data-left {
.el-table {
background-color: rgba(0, 0, 0, 0) !important;
.el-table__body {
width: 100% !important;
}
&::before {
height: 0px !important;
}
td {
border-bottom: none !important;
}
.el-table__header-wrapper,
.el-table__fixed-header-wrapper {
tr {
background-color: #213b52 !important;
}
th {
word-break: break-word;
background-color: #213b52 !important;
color: rgba(123, 248, 244, 1);
height: 30px;
font-size: 13px;
padding: 0;
&.is-leaf {
border-bottom: none;
}
}
}
.el-table__body-wrapper {
.el-table__row:nth-child(2n + 1) {
background-color: #063157;
&:hover td {
background-color: #7bf8f430 !important;
}
td {
.cell {
// color: #525252;
color: rgba(123, 248, 244, 1);
}
}
}
.el-table__row:nth-child(2n) {
background-color: #213b52;
&:hover td {
background-color: #7bf8f430 !important;
}
td {
.cell {
color: #fff;
}
}
}
}
.el-table__body-wrapper {
.el-button [class*="el-icon-"] + span {
// margin-left: 1px;
}
}
}
// 滚动条样式
.el-table--scrollable-y {
.el-table__body-wrapper {
&::-webkit-scrollbar {
width: 10px;
background: #012a53;
position: absolute;
top: 0;
}
&::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
// border-radius: 10px;
// box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #00000052;
border-radius: 8px;
}
&::-webkit-scrollbar-track {
/*滚动条里面轨道*/
// box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
// border-radius: 10px;
// background-color: red;
}
&::-webkit-scrollbar-button:start {
// overflow: hidden;
}
&::-webkit-scrollbar-button:end {
// overflow: hidden;
}
// overflow-y: none !important;
}
}
}
// gis地图右上角的滚动条隐藏
.rightPic {
.el-table {
.el-table__body-wrapper {
overflow-y: hidden;
overflow-x: hidden;
}
}
}
.videoView {
.el-dialog__body {
padding: 0;
}
}
// center下的分页
.myCenter {
.el-pagination {
button:disabled {
background-color: rgba(0, 0, 0, 0);
}
.el-pager li {
background-color: rgba(0, 0, 0, 0);
color: #fff;
cursor: pointer;
&.active {
color: #1890ff;
}
&:hover {
color: #7bf8f4;
}
}
.btn-prev,
.el-pagination .btn-next {
background-color: rgba(0, 0, 0, 0);
}
}
.el-pagination .btn-prev,
.el-pagination .btn-next {
background-color: rgba(0, 0, 0, 0);
}
// 禁用状态的左箭头
button[disabled] {
&:hover {
.el-icon-arrow-left,
.el-icon-arrow-right {
&::before {
color: #909399 !important;
}
}
}
.el-icon-arrow-left,
.el-icon-arrow-right {
&::before {
color: #909399;
}
}
}
button {
&:hover {
.el-icon-arrow-left,
.el-icon-arrow-right {
&::before {
color: #7bf8f4 !important;
}
}
}
}
// 平常状态下的
.el-icon-arrow-left,
.el-icon-arrow-right {
&::before {
color: #ffffff;
}
}
.el-pagination__jump {
color: #fff;
}
.el-input__inner {
background-color: rgba(0, 0, 0, 0);
border-color: #1890ff;
color: #fff;
}
}
// gis地图里抽屉的搜索样式
.search-input {
.el-input__inner {
height: 28px;
min-height: 28px;
outline: #053b6a;
background: none !important;
color: #fff;
&:focus {
// outline: #053b6a;
border-color: #fff;
}
}
}
/** 表单布局 **/
.form-header {
font-size: 15px;
color: #6379bb;
border-bottom: 1px solid #ddd;
margin: 8px 10px 25px 10px;
padding-bottom: 5px;
}
/** 表格布局 **/
.pagination-container {
position: relative;
height: 25px;
margin-bottom: 10px;
margin-top: 15px;
padding: 10px 20px !important;
}
/* tree border */
.tree-border {
margin-top: 5px;
border: 1px solid #e5e6e7;
background: #ffffff none;
border-radius: 4px;
}
.pagination-container .el-pagination {
right: 0;
position: absolute;
}
.el-table .fixed-width .el-button--mini {
padding-left: 0;
padding-right: 0;
width: inherit;
}
.el-tree-node__content > .el-checkbox {
margin-right: 8px;
}
.list-group-striped > .list-group-item {
border-left: 0;
border-right: 0;
border-radius: 0;
padding-left: 0;
padding-right: 0;
}
.list-group {
padding-left: 0px;
list-style: none;
}
.list-group-item {
border-bottom: 1px solid #e7eaec;
border-top: 1px solid #e7eaec;
margin-bottom: -1px;
padding: 11px 0px;
font-size: 13px;
}
.pull-right {
float: right !important;
}
.el-card__header {
padding: 14px 15px 7px;
min-height: 40px;
}
.el-card__body {
padding: 15px 20px 20px 20px;
}
.card-box {
padding-right: 15px;
padding-left: 15px;
margin-bottom: 10px;
}
/* button color */
.el-button--cyan.is-active,
.el-button--cyan:active {
background: #20b2aa;
border-color: #20b2aa;
color: #ffffff;
}
.el-button--cyan:focus,
.el-button--cyan:hover {
background: #48d1cc;
border-color: #48d1cc;
color: #ffffff;
}
.el-button--cyan {
background-color: #20b2aa;
border-color: #20b2aa;
color: #ffffff;
}
/* text color */
.text-navy {
color: #1ab394;
}
.text-primary {
color: inherit;
}
.text-success {
color: #1c84c6;
}
.text-info {
color: #23c6c8;
}
.text-warning {
color: #f8ac59;
}
.text-danger {
color: #ed5565;
}
.text-muted {
color: #888888;
}
/* image */
.img-circle {
border-radius: 50%;
}
.img-lg {
width: 120px;
height: 120px;
}
.avatar-upload-preview {
position: absolute;
top: 50%;
transform: translate(50%, -50%);
width: 200px;
height: 200px;
border-radius: 50%;
box-shadow: 0 0 4px #ccc;
overflow: hidden;
}
/* 拖拽列样式 */
.sortable-ghost {
opacity: 0.8;
color: #fff !important;
background: #42b983 !important;
}
.top-right-btn {
position: relative;
float: right;
}
// 上传按钮
.hide {
.el-upload--picture-card {
display: none;
}
}
// 所有的提示框标题
.el-dialog__header {
padding-bottom: 0;
padding: 0px;
height: 51px;
line-height: 50px;
background-color: #053b6a;
.el-dialog__title {
display: inline-block;
margin-left: 22px;
color: #fff;
}
.el-dialog__headerbtn {
i {
color: #fff;
}
}
// background-color: ;
}
// gis地图内的bottom列表,如果隐藏在出现会有一个bug,这样可以解决
.b {
& > .el-bottom {
.el-table__body-wrapper {
height: 140px !important;
}
}
}
// center
.myCenter {
.el-bottom {
.el-table__body-wrapper {
max-height: 600px !important;
}
}
}
.rightPic {
.el-bottom {
.el-table__body-wrapper {
max-height: 250px !important;
}
}
}
// 设备巡检详情页表格样式
.inspectiondetail {
.el-table {
.el-table__header-wrapper,
.el-table__fixed-header-wrapper {
th {
word-break: break-word;
background-color: #1181e8;
color: #fff;
height: 40px;
font-size: 14px;
}
}
.el-table__body-wrapper {
.el-table__row:nth-child(2n + 1) {
background-color: #e6e6e6;
// &:hover {
// td {
// background-color: #f4f4f4;
// }
// }
td {
.cell {
color: #053b6a;
}
}
}
.el-table__row:nth-child(2n) {
background-color: #f4f4f4;
// &:hover {
// td {
// background-color: #e6e6e6;
// }
// }
td {
.cell {
color: #053b6a;
}
}
}
}
.el-table__body-wrapper {
.el-button [class*="el-icon-"] + span {
margin-left: 1px;
}
}
}
}
.zzz {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
// 滚动条公共样式
.scrollStyle {
&::-webkit-scrollbar {
width: 10px;
background: rgba(6, 29, 51, 0.8);
// position: absolute;
// top: 0;
}
&::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
// border-radius: 10px;
// box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #00000053;
border-radius: 8px;
}
&::-webkit-scrollbar-track {
/*滚动条里面轨道*/
// box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
// border-radius: 10px;
// background-color: red;
}
&::-webkit-scrollbar-button:start {
// overflow: hidden;
}
&::-webkit-scrollbar-button:end {
// overflow: hidden;
}
// overflow-y: none !important;
}
.amap-info {
position: fixed !important;
z-index: 999 !important;
}
}
<template>
<div v-if="show" class="myCenter">
<div class="left">
<div class="title-wrapper">
<div class="title">报警器列表</div>
<div class="close" @click="close">
<img src="@/assets/mapImages/closeBtn.png" alt="" />
</div>
</div>
<div class="bottom right-bottom-data-left">
<el-table
size="mini"
:data="tableData"
class="el-bottom"
>
<!-- :height="tableHeight" -->
<el-table-column prop="detectorCode" label="设备编号" width="">
<template slot-scope="scope">
<div :title="scope.row.deviceNo" class="zzz">
{{ scope.row.deviceNo }}
</div>
</template>
</el-table-column>
<el-table-column prop="deviceType" label="设备类型" width="">
<template slot-scope="scope">
<div :title="scope.row.deviceType" class="zzz">
{{ scope.row.deviceType == 1 ? "流量计" : "压力表" }}
</div>
</template>
</el-table-column>
<el-table-column prop="deviceState" label="设备状态" width="">
<template slot-scope="scope">
<div v-if="scope.row.deviceState == 1">正常</div>
<div style="color: red" v-else-if="scope.row.deviceState == 2">
报警
</div>
</template>
</el-table-column>
<el-table-column prop="reportTime" label="报警时间" width="">
<template slot-scope="scope">
<div>{{ scope.row.reportTime }}</div>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination
@current-change="handleCurrentChangvale"
:page-size="pageSize"
:current-page="pageCurrent"
layout="prev, pager, next, jumper"
:total="total"
:hide-on-single-page="total < pageSize"
>
</el-pagination>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
centerData: {
type: Array,
},
show: {
type: Boolean,
},
},
data() {
return {
// 动画效果的切换
tableHeight: 600,
pageSize: 16,
pageCurrent: 1,
};
},
created() {
// this.getList();
},
watch: {
// 当组件显示的时候
show(newVal) {
if (newVal) {
this.pageCurrent = 1;
}
},
},
computed: {
total() {
return this.centerData.length;
},
tableData() {
return this.centerData.filter((item, index) => {
return (
index < this.pageCurrent * this.pageSize &&
index >= (this.pageCurrent - 1) * this.pageSize
);
});
},
},
methods: {
handleSizeChange(val) {
console.log(val);
this.pageCurrent = val;
},
handleCurrentChangvale(val) {
console.log(val);
this.pageCurrent = val;
},
close() {
this.$parent.centerShow(false);
},
},
};
</script>
<style lang="scss" >
.myCenter {
// width: 978px;
max-height: 600px;
position: fixed;
top: 50%;
left: 50%;
margin-top: -300px;
margin-left: -500px;
// background-color: #fff;
display: flex;
justify-content: space-between;
z-index: 9999;
& > div {
}
.left {
// width: 100px;
max-height: 598px;
margin-right: 12px;
// box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.16);
// background-color: #fff;
// color: #fff;
font-size: 14px;
font-weight: 400;
.title-wrapper {
// width: 99%;
width: 100%;
height: 30px;
display: flex;
justify-content: space-between;
background: #1890ff;
padding: 5px;
.title {
width: 100%;
color: #fff;
text-align: center;
line-height: 30px;
}
.close {
box-sizing: border-box;
padding-top: 5px;
padding-right: 5px;
cursor: pointer;
}
}
.el-table__body-wrappe {
height: 140px !important;
}
.top {
height: 19px;
// background-color: #053b6a;
color: #fff;
// line-height: 32px;
// padding-left: 12px;
position: relative;
.title {
position: absolute;
left: 50%;
margin-left: -92px;
top: -5px;
}
.repeat {
position: absolute;
top: -5px;
right: 160px;
color: #fff;
cursor: pointer;
&:hover {
color: #2788ea;
}
}
.repeat2 {
position: absolute;
right: 206px;
color: #67c23a;
}
.more {
position: absolute;
right: 38px;
top: -5px;
color: #fff;
float: right;
margin-right: 20px;
cursor: pointer;
&:hover {
color: #2788ea;
}
}
}
.bottom {
width: 1000px;
margin: 0 auto;
position: relative;
}
}
.right {
width: 740px;
display: flex;
flex-wrap: wrap;
// justify-content: space-between;
align-content: flex-start;
// margin-top: 7px;
& > .right-content {
background-color: #fff;
width: 238px;
height: 82px;
margin-bottom: 29px;
box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.16);
margin-right: 10px;
display: flex;
&.three {
margin-right: 0px;
}
// align-items: center;
.text-icon {
line-height: 82px;
padding-left: 22px;
margin-right: 22px;
i {
color: #053b6a;
font-size: 60px;
}
}
.text {
font-size: 14px;
padding-top: 16px;
.top {
color: #000;
margin-bottom: 10px;
font-weight: 600;
}
.bottom {
color: #2788ea;
}
}
}
}
.iconfont {
cursor: pointer;
}
// 单独调整下最后一个icon的大小
.iconFontSize {
font-size: 50px !important;
}
}
</style>
\ No newline at end of file
<!--
* @Author: your name
* @Date: 2022-01-26 20:07:52
* @LastEditTime: 2022-02-17 10:13:02
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/views/components/deviceA.vue
-->
<template>
<div class="devicea-wrapper">
<div class="title">
{{
deviceData.deviceName ? deviceData.deviceName : deviceData.stationName
}}
</div>
<div class="close" @click="close">
<img src="@/assets/mapImages/closeBtn.png" alt="" />
</div>
<div class="top flex">
<div class="group">
<div class="left">所属公司:</div>
<div class="right zzz">{{ companyType[deviceData.companyType] }}</div>
</div>
<div class="group">
<div class="left">设备类型:</div>
<div class="right zzz">
{{ deviceType[deviceData.type] }}
</div>
</div>
<div class="group">
<div class="left">设备地址:</div>
<div
v-if="deviceData.deviceAddr"
:title="deviceData.deviceAddr"
class="right last zzz"
>
{{ deviceData.deviceAddr || "-" }}
</div>
<div
v-else-if="deviceData.stationAddr"
:title="deviceData.stationAddr"
class="right last zzz"
>
{{ deviceData.stationAddr || "-" }}
</div>
</div>
</div>
<div class="middle">{{ profile }}</div>
<div class="foot">
<div class="thead flex">
<div class="first">设备类型</div>
<div>设备数量</div>
<div>在线设备</div>
<div>离线设备</div>
<div>历史报警</div>
<div>已处理报警</div>
<div class="last">报警中</div>
</div>
<div class="tbody flex">
<div class="first zzz">{{ "流量计与压力表" }}</div>
<div class="">{{ deviceData.pressureFlow.length }}</div>
<div class="">
{{ (Math.random() * deviceData.pressureFlow.length) >> 1 }}
</div>
<div class="">
{{ (Math.random() * deviceData.pressureFlow.length) >> 1 }}
</div>
<div class="">
{{ (Math.random() * deviceData.pressureFlow.length) >> 1 }}
</div>
<div class="">
{{ (Math.random() * deviceData.pressureFlow.length) >> 1 }}
</div>
<div class="last zzz">
{{
deviceData.pressureFlow.filter((item) => {
return item.deviceState == 2;
}).length
}}
</div>
</div>
</div>
<div class="btn">
<div @click="btnClick">感知设备</div>
</div>
</div>
</template>
<script>
import { companyType, deviceType } from "@/utils/mapClass/config.js";
export default {
data() {
return {
companyType,
deviceType,
profile:
"公司位于长江三角洲经济快速增长、风景秀丽的太湖之畔——无锡。 公司自1984年成立至今,已经过了3次跨越式的发展。2004年至今公司投入5000多万元资金建设新的生产基地,目前已竣工并投入生产,占地面积达40000m2,厂房面积近15000m2。公司2004年的年产值达4350多万元,并且每年以平均30%的速度快速增长。",
};
},
methods: {
close() {
this.mapClass.infowindowClose();
},
btnClick() {
this.vueRoot.centerDataFunc(this.deviceData.pressureFlow);
},
},
};
</script>
<style lang="scss" scoped>
.devicea-wrapper {
background-color: rgba(9, 18, 32, 0.6);
padding: 10px;
position: relative;
width: 700px;
.title {
// padding-top: 10px;
// padding-left: 10px;
font-size: 14px;
line-height: 14px;
color: #ffffff;
}
.close {
position: absolute;
right: 10px;
top: 5px;
cursor: pointer;
}
.top {
margin-top: 10px;
margin-bottom: 10px;
border: 1px solid #cccccc;
box-sizing: border-box;
.group {
height: 30px;
flex: 1;
display: flex;
justify-content: space-between;
box-sizing: border-box;
div {
flex: 1;
box-sizing: border-box;
border-right: 1px solid #cccccc;
text-align: center;
font-size: 14px;
color: #ffffff;
line-height: 30px;
padding: 0 5px;
&.last {
border-right: none;
}
}
.left {
text-align: right;
background-color: rgba(255, 255, 255, 0.1);
}
}
}
.middle {
width: 100%;
padding: 5px;
border: 1px solid #ffffff;
box-sizing: border-box;
font-size: 14px;
color: #ffffff;
text-indent: 2em;
margin-bottom: 10px;
}
.foot {
font-size: 14px;
color: #ffffff;
.thead,
.tbody {
border: 1px solid #cccccc;
div {
flex: 1;
text-align: left;
border-right: 1px solid #cccccc;
box-sizing: border-box;
padding: 0 5px;
}
.first {
flex: 2;
}
.last {
border-right: none;
}
}
.tbody {
border-top: none;
}
.thead {
div {
background-color: rgba(255, 255, 255, 0.1);
}
}
}
.btn {
position: relative;
margin-top: 10px;
text-align: right;
div {
font-size: 14px;
color: #ffffff;
padding: 2px 4px;
box-sizing: border-box;
display: inline-block;
cursor: pointer;
border: 1px solid #cccccc;
background-color: #1890ff;
&:hover {
// background: rgba(9, 18, 32, 0.6);
background-color: #18baff;
}
}
}
.flex {
display: flex;
justify-content: space-between;
}
}
</style>
\ No newline at end of file
<!--
* @Author: your name
* @Date: 2022-01-27 14:25:45
* @LastEditTime: 2022-02-17 10:11:42
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /hello-world/src/views/components/User.vue
-->
<template>
<div class="user-wrapper">
<div class="title">{{ companyType[deviceData.companyType] }}</div>
<div class="close" @click="close">
<img src="@/assets/mapImages/closeBtn.png" alt="" />
</div>
<div class="group flex first">
<div class="left first">管道长度:</div>
<div class="right zzz">{{ deviceData.pipeLength }}</div>
<div class="left">管径:</div>
<div class="right last">{{ deviceData.pipeDiameter }}</div>
</div>
<!-- <div class="group flex">
</div> -->
<div class="group flex">
<div class="left first">管道压力:</div>
<div :title="deviceData.address" class="right zzz">
{{ pipePressure[deviceData.pipePressure] }}
</div>
<div class="left">所属公司:</div>
<div class="right last">{{ companyType[deviceData.companyType] }}</div>
</div>
<div class="group flex">
<div class="first left">管道材质:</div>
<div class="right">{{ deviceData.pipeMaterial }}</div>
<div class="left">管道埋深:</div>
<div class="right last">{{ deviceData.pipeDepth }}</div>
</div>
<div class="group flex">
<div class="left first">管道走向:</div>
<div class="right">{{ deviceData.pipeTrend }}</div>
<div class="left">权属单位:</div>
<div :title="deviceData.powerCompany" class="right last zzz">{{ deviceData.powerCompany }}</div>
</div>
<div class="group flex">
<div class="first left">建设年代:</div>
<div class="right">{{ deviceData.buildyear }}</div>
<div class="left">建设单位:</div>
<div class="last right">{{ deviceData.buildCompany }}</div>
</div>
<div class="group flex">
<div class="first once left">管道位置:</div>
<div :title="deviceData.pipeAddr" class=" last pipeAddr right zzz">
{{ deviceData.pipeAddr }}
</div>
</div>
</div>
</template>
<script>
import { companyType, pipePressure } from "@/utils/mapClass/config.js";
export default {
data() {
return {
companyType,
pipePressure,
};
},
methods: {
close() {
this.mapClass.infowindowClose();
},
},
};
</script>
<style lang="scss" scoped>
.user-wrapper {
background-color: rgba(9, 18, 32, 0.6);
padding: 10px;
position: relative;
width: 400px;
.title {
font-size: 14px;
line-height: 14px;
color: #ffffff;
}
.close {
position: absolute;
right: 10px;
top: 5px;
cursor: pointer;
}
.group {
border: 1px solid #cccccc;
border-top: none;
height: 28px;
font-size: 14px;
line-height: 28px;
color: #ffffff;
&.first {
border-top: 1px solid #cccccc;
margin-top: 10px;
}
div {
flex: 1;
border-right: 1px solid #cccccc;
}
.left {
background-color: rgba(255, 255, 255, 0.1);
text-align: right;
}
.right {
box-sizing: border-box;
text-align: left;
padding: 0 1em;
}
.last {
border: none;
}
.once{
flex:1;
}
.pipeAddr{
flex:3;
padding:0 3em 0 1em;
}
}
.flex {
display: flex;
justify-content: space-between;
}
}
</style>
\ No newline at end of file
<!--
* @Author: your name
* @Date: 2022-01-26 10:52:10
* @LastEditTime: 2022-02-17 10:11:35
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/components/PipeColor.vue
-->
<template>
<div>
<div class="pipePressure">
<!-- <div>管道压力</div> -->
<div class="hasColorBox" :style="{ color: pipeColor[`1`] }">
<div :style="{ backgroundColor: pipeColor[`1`] }"></div>
低压
</div>
<div class="hasColorBox" :style="{ color: pipeColor[`2`] }">
<div :style="{ backgroundColor: pipeColor[`2`] }"></div>
中压
</div>
<div class="hasColorBox" :style="{ color: pipeColor[`3`] }">
<div :style="{ backgroundColor: pipeColor[`3`] }"></div>
次高压
</div>
<div class="hasColorBox" :style="{ color: pipeColor[`4`] }">
<div :style="{ backgroundColor: pipeColor[`4`] }"></div>
高压
</div>
</div>
<div class="mapChange">
<div :class="{ active: !mapStyle }" @click="mapChange(1)">卫星地图</div>
<div :class="{ active: mapStyle }" @click="mapChange(2)">全景地图</div>
</div>
</div>
</template>
<script>
import { pipeColor } from "@/utils/mapClass/config.js";
export default {
data() {
return {
pipeColor,
mapStyle:true
};
},
methods: {
// 更改卫星图
mapChange(num) {
if (num == 1) {
this.mapStyle = false;
} else {
this.mapStyle = true;
}
this.$parent.map.changeMap(this.mapStyle);
},
},
};
</script>
<style lang="scss" scoped>
.pipePressure {
position: fixed;
color: #fff;
left: 460px;
top: 120px;
padding: 1px;
// background: rgba(6, 29, 51, 0.8);
.hasColorBox {
// border: 1px solid #053b6a;
padding: 2px 5px;
margin-bottom: 5px;
& > div {
display: inline-block;
width: 10px;
height: 10px;
}
}
}
.mapChange {
left: 460px;
top: 76px;
color: #fff;
position: absolute;
display: flex;
div {
padding: 4px 8px;
border: 1px solid #fff;
margin-left: 8px;
cursor: pointer;
&.active,
&:hover {
background-color: #053b6a;
color: #31eaea;
}
}
}
</style>
\ No newline at end of file
<!--
* @Author: your name
* @Date: 2022-01-11 13:44:17
* @LastEditTime: 2022-01-20 14:30:03
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /hello-world/src/views/About.vue
-->
<template>
<div class="wrapper">
<div @click="click">点我</div>
<div>{{deviceData.lat}}</div>
<div>{{deviceData.id}}</div>
<div>{{deviceData.type}}</div>
<div>{{deviceData.lng}}</div>
<div>12312312321{{a}}</div>
</div>
</template>
<script>
//这个东西是用新的实例创建的,跟主vue没有关联,必须传进来才可以
// vueRoot,
// // 自己写的map类
// mapClass,
// // 数据
// deviceData,
export default {
name: "Pipe",
data() {
return {
a:123
};
},
// props: {
// // 代表地图页面的vue
// vueRoot: {
// type: Object,
// default: () => null,
// },
// // 数据
// deviceData: {
// type: Object,
// default: () => null,
// },
// },
mounted(){
console.log(this.deviceData)
},
methods: {
click() {
},
},
};
</script>
<style lang="scss" scoped>
.wrapper {
width: 200px;
height: 200px;
background: red;
}
</style>
\ No newline at end of file
<!--
* @Author: your name
* @Date: 2022-01-27 14:25:45
* @LastEditTime: 2022-02-17 10:12:02
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /hello-world/src/views/components/User.vue
-->
<template>
<div class="user-wrapper">
<div class="title">{{ deviceData.usrName }}</div>
<div class="close" @click="close">
<img src="@/assets/mapImages/closeBtn.png" alt="" />
</div>
<div class="group flex first">
<div class="left">用户姓名:</div>
<div :title="deviceData.usrName" class="right zzz">{{ deviceData.usrName }}</div>
</div>
<div class="group flex">
<div class="left">联系方式:</div>
<div class="right">{{ deviceData.phone }}</div>
</div>
<div class="group flex">
<div class="left">用户地址:</div>
<div :title="deviceData.address" class="right zzz">
{{ deviceData.address }}
</div>
</div>
<div class="group flex">
<div class="left">所属公司:</div>
<div class="right">{{ companyType[deviceData.companyType] }}</div>
</div>
</div>
</template>
<script>
import { companyType } from "@/utils/mapClass/config.js";
export default {
data() {
return {
companyType,
};
},
methods: {
close() {
this.mapClass.infowindowClose();
},
},
};
</script>
<style lang="scss" scoped>
.user-wrapper {
background-color: rgba(9, 18, 32, 0.6);
padding: 10px;
position: relative;
width: 300px;
.title {
font-size: 14px;
line-height: 14px;
color: #ffffff;
}
.close {
position: absolute;
right: 10px;
top: 5px;
cursor: pointer;
}
.group {
border: 1px solid #cccccc;
border-top:none;
height: 28px;
font-size: 14px;
line-height: 28px;
color: #ffffff;
&.first {
border-top:1px solid #cccccc;
margin-top: 10px;
}
div {
flex: 1;
}
.left {
border-right: 1px solid #cccccc;
background-color: rgba(255, 255, 255, 0.1);
text-align: right;
}
.right {
box-sizing: border-box;
text-align: left;
padding:0 1em;
}
}
.flex {
display: flex;
justify-content: space-between;
}
}
</style>
\ No newline at end of file
<!--
* @Author: your name
* @Date: 2022-01-26 22:44:02
* @LastEditTime: 2022-01-27 10:12:46
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/views/components/videoView.vue
-->
<template>
<div class="box-wrapper">
<div class="title">{{ deviceData.videoName }}</div>
<div class="close" @click="close">
<img src="@/assets/mapImages/closeBtn.png" alt="" />
</div>
<div class="box videoBox">
<div id="video"></div>
</div>
<span slot="footer" class="dialog-footer">
<!-- <el-button type="primary" @click="dialogVisible = false"
>确 定
</el-button>
<el-button @click="dialogVisible = false">取 消</el-button> -->
</span>
</div>
</template>
<script>
import WasmPlayer from "@easydarwin/easywasmplayer"; //导入WasmPlayer.js
export default {
data() {
return {
// dialogVisible: true,
// AfterClose: true,
};
},
watch: {},
mounted() {
setTimeout(() => {
this.player = new WasmPlayer(null, "video", this.callBack, {
Height: true,
});
this.player.play(this.deviceData.usr, 1);
}, 1);
},
methods: {
show() {
this.dialogVisible = true;
},
handleClose() {
console.log("关闭");
this.player.destroy(this.deviceData.usr);
// document.body.removeChild(this.$refs.videoBox.$el);
},
callBack() {},
close() {
this.handleClose();
this.mapClass.infowindowClose();
},
},
};
</script>
<style lang="scss">
.box-wrapper {
background-color: rgba(9, 18, 32, 0.6);
position: relative;
.title {
padding-top: 10px;
padding-left: 10px;
font-size: 14px;
line-height: 14px;
color: #ffffff;
}
.close {
position: absolute;
right: 10px;
top: 5px;
cursor: pointer;
}
.box {
padding: 5px 12px 10px 10px;
width: 350px;
height: 200px;
#video {
height: 100%;
}
}
}
</style>
<template>
<div>
<div class="left-top" style="margin-top: 70px;width: 430px;margin-left: 10px;display: flex;justify-content: space-around;">
<div style="width: 40%;text-align: center;color: #00ffff;">
<p>从业人员数</p>
<span style="font-family: 'arialbd';font-size: 30px;background-image:-webkit-linear-gradient(bottom,#f0c41b,#e4dbb7);-webkit-background-clip:text;-webkit-text-fill-color:transparent; ">{{datanow.congyeNum}}</span>
</div>
<div style="width: 40%;text-align: center;color: #00ffff;">
<p>管道长度(m)</p>
<span style="font-family: 'arialbd';font-size: 30px;background-image:-webkit-linear-gradient(bottom,#f86742,#f0c41b);-webkit-background-clip:text;-webkit-text-fill-color:transparent; ">{{datanow.guandaoNum}}</span>
</div>
</div>
<div>
<div class="item1" style="margin-top: 40px;">
<span class="dot">
<span class="dot-inner"></span>
</span>
<span>安全监管</span>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #2c888899;float: right;margin-top: 10px;transform: skewX(-25deg)"></div>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #24b1b1b3;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 id="main1" style="width: 100%;height: 280px;"></div>
<div class="echarts-two" style="margin-top: 30px;width: 430px;margin-left: 10px;">
<div>
<div class="item1">
<span class="dot">
<span class="dot-inner"></span>
</span>
<span>任务完成率</span>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #2c888899;float: right;margin-top: 10px;transform: skewX(-25deg)"></div>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #24b1b1b3;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 id="myCharttwo" :style="{width: '450px', height: '300px'}"></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>
</div>
</template>
<script>
// 引入基本模板
let echarts = require('echarts/lib/echarts')
// 引入柱状图组件
require('echarts/lib/chart/bar')
// 引入提示框和title组件
require('echarts/lib/component/tooltip')
require('echarts/lib/component/title')
export default {
data () {
  return {
dataAll:{
congyeNum:1544,
guandaoNum:3658495,
shigu1:[820, 932, 901, 934, 1290, 1330, 1320,820, 932, 901, 934, 1290],
shigu2:[452, 786, 456, 732, 458, 165, 198,489, 158, 358, 345, 675],
shigu3:[ 932, 901, 198,489, 158, 358, 345, 675, 901, 934, 1290, 888],
renwu:[50,92],
renwuzong:142
},
dataone:{
congyeNum:521,
guandaoNum:1254848,
shigu1:[223, 44, 332, 321, 458, 456, 653,122, 345, 133, 421, 123],
shigu2:[123, 234, 456, 567, 235, 12,89, 158, 158, 145, 175,224],
shigu3:[ 432, 301, 108,189, 18, 158, 145, 175, 401, 334, 590, 388],
renwu:[4,27],
renwuzong:31
},
datatwo:{
congyeNum:488,
guandaoNum:1244495,
shigu1:[653,122, 345, 133, 456, 653,122, 345, 133, 421, 123,500],
shigu2:[432, 301, 456, 567, 235, 12, 145, 175, 401, 334, 590, 388],
shigu3:[ 123, 234, 108,189, 18, 158, 123, 234, 456, 567, 235, 12],
renwu:[8,25],
renwuzong:33
},
datathree:{
congyeNum:535,
guandaoNum:1189492,
shigu1:[653,122, 345, 133, 456, 653,122, 345, 133, 421, 123,500],
shigu2:[432, 301, 456, 567, 456, 653,122, 175, 401, 334, 590, 388],
shigu3:[ 334, 590, 388, 133, 456, 123, 234, 653,122, 345, 133],
renwu:[38,40],
renwuzong:78
},
datanow:{
renwu:[0,0]
}
};
 },
mounted(){
this.datanow = this.dataAll;
this.drawLine(this.datanow);
this.initdata(this.datanow);
},
methods: {
choice(index){
console.log("-----"+index)
if(index==0){
this.datanow = this.dataAll;
this.drawLine(this.datanow);
this.initdata(this.datanow);
}else
if(index==1){
this.datanow = this.dataone;
this.drawLine(this.datanow);
this.initdata(this.datanow);
}else if(index==2){
this.datanow = this.datatwo;
this.drawLine(this.datanow);
this.initdata(this.datanow);
}else if(index==3){
this.datanow = this.datathree;
this.drawLine(this.datanow);
this.initdata(this.datanow);
}
},
drawLine(data){
// 基于准备好的dom,初始化echarts实例
let myChart = echarts.init(document.getElementById('main1'))
// 绘制图表
myChart.setOption({
legend: {
top:20,
textStyle:{
color:"#fff"
},
},
grid: {
left: '5%',
right: '7%',
bottom: '4%',
containLabel: true
},
xAxis: {
axisLine: {
show: true,
lineStyle: {
color: '#bbb6b6',
},
},
axisTick: { //去掉坐标轴刻线
show: false
},
type: 'category',
data: ['1', '2', '3', '4', '5', '6', '7','8', '9', '10', '11', '12']
},
yAxis: {
axisLine: {
show: true,
lineStyle: {
color: '#bbb6b6'
},
},
splitLine: {
show:true,
lineStyle:{
type:"dashed",
color: '#bbb6b6',
}
},
type: 'value'
},
series: [
{
name:"事故数量",
data: data.shigu1,
type: 'line',
smooth: true
},
{
data: data.shigu2,
type: 'line',
smooth: true,
name:"隐患整治数"
},
{
data: data.shigu3,
type: 'line',
smooth: true,
name:"预警数量"
}
]
});
},
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: '70%',
center: ['50%','58%'],
data: [
{
value: data.renwu[0],
name: '未完成',
itemStyle: { color: '#09f' }
},
{
value: data.renwu[1],
name: '已完成' ,
itemStyle: { color: '#00ffff' }
},
],
label:{
color:'#fff',
fontSize: 18
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
});
},
}
}
</script>
<style lang="scss" scoped>
/* @font-face {
font-family: 'arialbd';
} */
.item1{
width: 95%;
height: 30px;
font-size: 18px;
line-height: 30px;
color: #ffffff;
padding-left: 10px;
margin-top: 10px;
font-weight: 700;
font-style: italic;
margin-left: 10px;
background-image: linear-gradient(to left, #122033, rgb(51 152 243 / 50%) 50%, #111a22);
}
.dot {
display: inline-block;
position: relative;
width: 10px;
height: 10px;
background: rgb(30, 185, 190);
border-radius: 50%;
margin-right: 10px;
margin-left: 10px;
margin-bottom: 2px;
}
.dot-inner {
background: #44d7dc;
position: absolute;
top: 0;
left: 0;
box-sizing: border-box;
display: block;
width: 100%;
height: 100%;
border-radius: 50%;
-webkit-animation: vabDot 1.2s ease-in-out infinite;
animation: vabDot 1.2s ease-in-out infinite;
}
@-webkit-keyframes vabDot {
0% {
opacity: .6;
transform: scale(.8)
}
to {
opacity: 0;
transform: scale(2.4)
}
}
@keyframes vabDot {
0% {
opacity: .6;
transform: scale(.8)
}
to {
opacity: 0;
transform: scale(2.4)
}
}
</style>
<template>
<div id="">
qqqq
</div>
</template>
<script>
// import moment from "moment";
//line移入时的的infowindow
// export default {
// props: {
// obj: { typs: Object },
// title: "",
// data: {},
// map: null,
// },
// methods: {
// moment,
// deviceMore() {
// this.data.class.view.$router.push({
// // path: "/dataMonitoring/realtimedetail",
// path: "/device/deviceInfoDetail",
// query: {
// deviceId: this.data.deviceId,
// // deviceType: this.data.deviceType,
// },
// });
// },
// close() {
// this.map.clearInfoWindow();
// this.data.class.view.domAllShow()
// },
// },
// };
</script>
</style>
<template>
<div style="height: 100%">
<div>
<div class="item1" style="margin-top: 60px;">
<span class="dot">
<span class="dot-inner"></span>
</span>
<span>用户安全监控设备</span>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #2c888899;float: right;margin-top: 10px;transform: skewX(-25deg)"></div>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #24b1b1b3;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 class="divfen" style="width: 100%;height: 30%;">
<div class ="divall" style="width: 50%">
<div class="titleTex">属地巡查</div>
<div class="titleTex divfen" style="height: 50px;margin-top: 0px">
<div class="numdiv">{{datanow.xunchaAllOne1}}</div>
<div class="numdiv" style="margin-left: 5px">{{datanow.xunchaAllOne2}}</div>
<div class="numdiv" style="margin-left: 5px">{{datanow.xunchaAllOne3}}</div>
<div class="numdiv" style="margin-left: 5px">{{datanow.xunchaAllOne4}}</div>
</div>
<div id="main21" style="height: 50%;width: 100%"></div>
<div class="titleTex" style="height: 20px;margin-top: 0px;font-size: 10px;">
● 巡查次数:{{datanow.xunoneevery1}}
</div>
<div class="titleTex" style="height: 20px;margin-top: 0px;font-size: 10px;color: #f0c41b">
● 发现问题数:{{datanow.xunoneevery2}}
</div>
</div>
<div style="width:14px;height: 100%;color: white;font-size: 13px;margin-top: 150px;">
<div style="width: 100%;height: 10px;background: #188df0"></div>
已整改
<div style="width: 100%;height: 10px;background: #f0c41b;margin-top: 15px;"></div>
未整改
</div>
<div class="divall" style="width: 50%" >
<div class="titleTex">行业检查</div>
<div class="titleTex divfen" style="height: 50px;margin-top: 0px">
<div class="numdiv">{{datanow.xunchaAllTwo1}}</div>
<div class="numdiv" style="margin-left: 5px">{{datanow.xunchaAllTwo2}}</div>
<div class="numdiv" style="margin-left: 5px">{{datanow.xunchaAllTwo3}}</div>
<div class="numdiv" style="margin-left: 5px">{{datanow.xunchaAllTwo4}}</div>
</div>
<div id="main22" style="height: 50%;width: 100%"></div>
<div class="titleTex" style="height: 20px;margin-top: 0px;font-size: 10px;">
● 巡查次数:{{datanow.xuntwoevery1}}
</div>
<div class="titleTex" style="height: 20px;margin-top: 0px;font-size: 10px;color: #f0c41b">
● 发现问题数:{{datanow.xuntwoevery2}}
</div>
</div>
</div>
<div class="echarts-one" style="margin-top: 10px;width: 430px;margin-left: 10px;">
<div>
<div class="item1">
<span class="dot">
<span class="dot-inner"></span>
</span>
<span>资源统计</span>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #2c888899;float: right;margin-top: 10px;transform: skewX(-25deg)"></div>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #24b1b1b3;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 id="myChartone" :style="{width: '420px', height: '250px'}"></div>
</div>
<div>
<div class="item1">
<span class="dot">
<span class="dot-inner"></span>
</span>
<span>投诉统计</span>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #2c888899;float: right;margin-top: 10px;transform: skewX(-25deg)"></div>
<div class="fong-div" style="width: 8px;height: 12px;background-color: #24b1b1b3;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 class="divfen" style="width: 100%;height: 280px;margin-top: 10px">
<div style="width: 50%;height: 100%">
<div id="main31" style="width: 100%;height: 66%"></div>
<div class="titleTex" style="height: 20px;margin-top: 0px;font-size: 10px;">
● 已处理:{{datanow.tousuevery1}}
</div>
<div class="titleTex" style="height: 20px;margin-top: 0px;font-size: 10px;color: #ff4040">
● 未处理:{{datanow.tousuevery2}}
</div>
</div>
<div style="width: 50%;height: 100%">
<div id="main32" style="width: 100%;height: 66%"></div>
<div class="titleTex" style="height: 20px;margin-top: 0px;font-size: 10px;color: #0000ff">
● 在线数量:{{datanow.deviceevery1}}
</div>
<div class="titleTex" style="height: 20px;margin-top: 0px;font-size: 10px;color: #ffff00">
● 离线数量:{{datanow.deviceevery2}}
</div>
<div class="titleTex" style="height: 20px;margin-top: 0px;font-size: 10px;color: #ff4040">
● 报警数量:{{datanow.deviceevery3}}
</div>
</div>
</div>
</div>
</template>
<script>
// 引入基本模板
import * as echarts from 'echarts';
export default {
data () {
return {
dataall:{
xunchaAllOne1: 1,
xunchaAllOne2: 3,
xunchaAllOne3: 8,
xunchaAllOne4: 3,
xunchaAllTwo1: 2,
xunchaAllTwo2: 2,
xunchaAllTwo3: 2,
xunchaAllTwo4: 6,
xunList1:[
{ value: 678,name: '30.4%' },
{ value: 1548,name: '69.6%' }
],
xunList11:[
{ value: 1048 },
{ value: 335}
],
xunoneevery1:1048,
xunoneevery2:355,
xunList2:[
{ value: 678,name: '28.5%' },
{ value: 1548,name: '71.5%' }
],
xunList22:[
{ value: 1048 },
{ value: 335}
],
xuntwoevery1:1674,
xuntwoevery2:552,
shigu1:[820, 932, 901, 934, 1290, 1330, 1320,820, 932, 901, 934, 1290],
shigu2:[452, 786, 456, 732, 458, 165, 198,489, 158, 358, 345, 675],
shigu3:[ 932, 901, 198,489, 158, 358, 345, 675, 901, 934, 1290, 888],
tousu:[{ value: 1048, name: '已处理' },
{ value: 255, name: '未处理' }
],
tousuNum:1303,
tousuevery1:1048,
tousuevery2:255,
divice:[
{ value: 31, name: '在线数量' },
{ value: 19, name: '离线数量' },
{ value: 1, name: '报警数量' }
],
deviceNum:51,
deviceevery1:31,
deviceevery2:19,
deviceevery3:1,
zhuzhuang:[16,13,27,2]
},
dataone:{
xunchaAllOne1: 0,
xunchaAllOne2: 3,
xunchaAllOne3: 8,
xunchaAllOne4: 3,
xunchaAllTwo1: 0,
xunchaAllTwo2: 7,
xunchaAllTwo3: 2,
xunchaAllTwo4: 6,
xunList1:[
{ value: 224,name: '32.3%' },
{ value: 641,name: '67.7%' }
],
xunList11:[
{ value: 338 },
{ value: 112}
],
xunoneevery1:335,
xunoneevery2:141,
xunList2:[
{ value: 224,name: '29.1%' },
{ value: 544,name: '78.9%' }
],
xunList22:[
{ value: 354 },
{ value: 111}
],
xuntwoevery1:511,
xuntwoevery2:199,
shigu1:[223, 44, 332, 321, 458, 456, 653,122, 345, 133, 421, 123],
shigu2:[123, 234, 456, 567, 235, 12,89, 158, 158, 145, 175,224],
shigu3:[ 432, 301, 108,189, 18, 158, 145, 175, 401, 334, 590, 388],
tousu:[{ value: 322, name: '已处理' },
{ value: 181, name: '未处理' }
],
tousuNum:503,
tousuevery1:322,
tousuevery2:181,
divice:[
{ value: 11, name: '在线数量' },
{ value: 8, name: '离线数量' },
{ value: 1, name: '报警数量' }
],
deviceNum:21,
deviceevery1:11,
deviceevery2:8,
deviceevery3:1,
zhuzhuang:[8,3,11,1]
},
datatwo:{
xunchaAllOne1: 0,
xunchaAllOne2: 4,
xunchaAllOne3: 2,
xunchaAllOne4: 1,
xunchaAllTwo1: 0,
xunchaAllTwo2: 6,
xunchaAllTwo3: 7,
xunchaAllTwo4: 5,
xunList1:[
{ value: 224,name: '30.4%' },
{ value: 400,name: '69.6%' }
],
xunList11:[
{ value: 212 },
{ value: 209}
],
xunoneevery1:335,
xunoneevery2:141,
xunList2:[
{ value: 224,name: '28.5%' },
{ value: 300,name: '71.5%' }
],
xunList22:[
{ value: 475 },
{ value: 200}
],
xuntwoevery1:475,
xuntwoevery2:200,
shigu1:[653,122, 345, 133, 456, 653,122, 345, 133, 421, 123,500],
shigu2:[432, 301, 456, 567, 235, 12, 145, 175, 401, 334, 590, 388],
shigu3:[ 123, 234, 108,189, 18, 158, 123, 234, 456, 567, 235, 12],
tousu:[{ value: 344, name: '已处理' },
{ value: 121, name: '未处理' }
],
tousuNum:322,
tousuevery1:211,
tousuevery2:111,
divice:[
{ value: 2, name: '在线数量' },
{ value: 4, name: '离线数量' },
{ value: 0, name: '报警数量' }
],
deviceNum:6,
deviceevery1:2,
deviceevery2:4,
deviceevery3:0,
zhuzhuang:[2,5,7,1]
},
datathree:{
xunchaAllOne1: 0,
xunchaAllOne2: 5,
xunchaAllOne3: 7,
xunchaAllOne4: 9,
xunchaAllTwo1: 0,
xunchaAllTwo2: 8,
xunchaAllTwo3: 8,
xunchaAllTwo4: 9,
xunList1:[
{ value: 124,name: '30.4%' },
{ value: 400,name: '69.6%' }
],
xunList11:[
{ value: 212 },
{ value: 309}
],
xunoneevery1:335,
xunoneevery2:141,
xunList2:[
{ value: 224,name: '28.5%' },
{ value: 300,name: '71.5%' }
],
xunList22:[
{ value: 475 },
{ value: 200}
],
xuntwoevery1:475,
xuntwoevery2:200,
shigu1:[653,122, 345, 133, 456, 653,122, 345, 133, 421, 123,500],
shigu2:[432, 301, 456, 567, 456, 653,122, 175, 401, 334, 590, 388],
shigu3:[ 334, 590, 388, 133, 456, 123, 234, 653,122, 345, 133],
tousu:[{ value: 124, name: '已处理' },
{ value: 111, name: '未处理' }
],
tousuNum:335,
tousuevery1:124,
tousuevery2:111,
divice:[
{ value: 12, name: '在线数量' },
{ value: 6, name: '离线数量' },
{ value: 0, name: '报警数量' }
],
deviceNum:24,
deviceevery1:12,
deviceevery2:6,
deviceevery3:0,
zhuzhuang:[6,5,9,0]
},
datanow:{}
};
},
mounted(){
this.datanow = this.dataall;
this.drawLine(this.datanow);
this.drawLine2(this.datanow);
this.drawLine3(this.datanow);
},
methods: {
choice(index){
console.log("===="+index)
if(index==0){
this.datanow = this.dataall;
this.drawLine(this.datanow);
this.drawLine2(this.datanow);
this.drawLine3(this.datanow);
}else
if(index==1){
this.datanow = this.dataone;
this.drawLine(this.datanow);
this.drawLine2(this.datanow);
this.drawLine3(this.datanow);
}else if(index==2){
this.datanow = this.datatwo;
this.drawLine(this.datanow);
this.drawLine2(this.datanow);
this.drawLine3(this.datanow);
}else if(index==3){
this.datanow = this.datathree;
this.drawLine(this.datanow);
this.drawLine2(this.datanow);
this.drawLine3(this.datanow);
}
},
drawLine(data){
// 基于准备好的dom,初始化echarts实例
let myChart1 = this.$echarts.init(document.getElementById('myChartone'))
// 绘制图表
myChart1.setOption({
grid:{
x:30,
y:30,
x2:30,
y2:30
},
title: {
// text: '资源统计',
textStyle:{
//文字颜色
color:'#ccc',
//字体风格,'normal','italic','oblique'
fontStyle:'normal',
//字体粗细 'normal','bold','bolder','lighter',100 | 200 | 300 | 400...
fontWeight:'bold',
//字体系列
fontFamily:'sans-serif',
//字体大小
     fontSize:18
}
},
tooltip: {},
xAxis: {
data: ["阀井","调压箱","场站","监控"],
splitLine: {
show: false
},
axisLabel: {
show: true,
textStyle: {
color: '#bbb6b6'
}
}
},
yAxis: {
splitLine: {
show: false
},
axisLabel: {
show: true,
textStyle: {
color: '#bbb6b6'
}
}
},
series: [{
name: '',
type: 'bar',
data: data.zhuzhuang,
barWidth: 20,
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#83bff6' },
{ offset: 0.5, color: '#188df0' },
{ offset: 1, color: '#188df0' }
])
}
}]
});
},
drawLine2(data){
// 基于准备好的dom,初始化echarts实例
let myChart2 = echarts.init(document.getElementById('main21'));
let myChart22 = echarts.init(document.getElementById('main22'));
// 绘制图表
myChart2.setOption({
// tooltip: {
// trigger: 'item',
// formatter: '{a} <br/>{b}: {c} ({d}%)'
// },
series: [
{
name: 'Access From',
type: 'pie',
selectedMode: 'single',
radius: [0, '55%'],
label: {
position: 'inner',
fontSize: 14
},
labelLine: {
show: false
},
data:data.xunList1,
color:['#f0c41b','#188df0']
},
{
name: 'Access From',
type: 'pie',
radius: ['70%', '80%'],
label: {
position: 'inner',
fontSize: 14
},
center: ['50%', '50%'],
data:data.xunList11,
color:['#00ffff','#f0c41b']
}
]
});
myChart22.setOption({
// tooltip: {
// trigger: 'item',
// formatter: '{a} <br/>{b}: {c} ({d}%)'
// },
series: [
{
name: 'Access From',
type: 'pie',
selectedMode: 'single',
radius: [0, '55%'],
label: {
position: 'inner',
fontSize: 14
},
labelLine: {
show: false
},
data: data.xunList2,
color:['#f0c41b','#188df0']
},
{
name: 'Access From',
type: 'pie',
radius: ['70%', '80%'],
label: {
position: 'inner',
fontSize: 14
},
center: ['50%', '50%'],
data:data.xunList22,
color:['#00ffff','#f0c41b']
}
]
});
},
drawLine3(data){
// 基于准备好的dom,初始化echarts实例
let myChart31 = echarts.init(document.getElementById('main31'))
let myChart32 = echarts.init(document.getElementById('main32'))
// 绘制图表
myChart31.setOption({
title: {
text: '投诉统计:'+data.tousuNum,
left: 'center',
textStyle: {
color: "#0ff"
}
},
tooltip: {
trigger: 'item'
},
series: [
{
name: '投诉统计',
type: 'pie',
radius: ['50%', '70%'],
center: ['50%', '60%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: '40',
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: data.tousu,
color:["#00ffff","#FF4040"]
}
]
});
myChart32.setOption({
title: {
text: '设备数量:'+data.deviceNum,
left: 'center',
textStyle: {
color: "#0ff"
}
},
tooltip: {
trigger: 'item'
},
series: [
{
name: '设备概况',
type: 'pie',
radius: ['50%', '70%'],
center: ['50%', '60%'],
avoidLabelOverlap: false,
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: '40',
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data:data.divice,
color:["#188df0","#ffff00","#FF4040"]
}
]
});
}
}
}
</script>
<style>
.titleTex{
height: 30px;
width: 100%;
color: aqua;
text-align: center;
line-height: 30px;
margin-top: 10px;
}
.divall{
height: 100%;
width: 100%;
}
.divfen{
display:flex;
justify-content:center;
align-items:center;
}
.numdiv{
background: #47aed5;
color: white;
width: 27px;
font-size: 30px;
}
.item1{
width: 90%;
height: 30px;
font-size: 18px;
line-height: 30px;
color: #ffffff;
padding-left: 10px;
margin-top: 10px;
font-weight: 700;
font-style: italic;
margin-left: 10px;
background-image: linear-gradient(to left, #121a22, rgb(51 152 243 / 50%) 50%, #112238);
}
.dot {
display: inline-block;
position: relative;
width: 10px;
height: 10px;
background: rgb(30, 185, 190);
border-radius: 50%;
margin-right: 10px;
margin-left: 10px;
margin-bottom: 2px;
}
.dot-inner {
background: #44d7dc;
position: absolute;
top: 0;
left: 0;
box-sizing: border-box;
display: block;
width: 100%;
height: 100%;
border-radius: 50%;
-webkit-animation: vabDot 1.2s ease-in-out infinite;
animation: vabDot 1.2s ease-in-out infinite;
}
@-webkit-keyframes vabDot {
0% {
opacity: .6;
transform: scale(.8)
}
to {
opacity: 0;
transform: scale(2.4)
}
}
@keyframes vabDot {
0% {
opacity: .6;
transform: scale(.8)
}
to {
opacity: 0;
transform: scale(2.4)
}
}
</style>
/*
* @Author: your name
* @Date: 2022-01-07 11:29:13
* @LastEditTime: 2022-02-17 11:35:38
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafety-progress/gassafetyprogress-web/src/main.js
*/
import Vue from 'vue' import Vue from 'vue'
import Cookies from 'js-cookie' import Cookies from 'js-cookie'
...@@ -7,11 +15,14 @@ import './assets/styles/element-variables.scss' ...@@ -7,11 +15,14 @@ import './assets/styles/element-variables.scss'
import '@/assets/styles/index.scss' // global css import '@/assets/styles/index.scss' // global css
import '@/assets/styles/zehong.scss' // zehong css import '@/assets/styles/zehong.scss' // zehong css
import './assets/css/font.css'
import './assets/styles/all.scss'
import App from './App' import App from './App'
import store from './store' import store from './store'
import router from './router' import router from './router'
import permission from './directive/permission' import permission from './directive/permission'
import * as echarts from 'echarts'
import './assets/icons' // icon import './assets/icons' // icon
import './permission' // permission control import './permission' // permission control
import { getDicts } from "@/api/system/dict/data"; import { getDicts } from "@/api/system/dict/data";
...@@ -21,7 +32,10 @@ import Pagination from "@/components/Pagination"; ...@@ -21,7 +32,10 @@ import Pagination from "@/components/Pagination";
// 自定义表格工具扩展 // 自定义表格工具扩展
import RightToolbar from "@/components/RightToolbar" import RightToolbar from "@/components/RightToolbar"
// 全局方法挂载 // 全局方法挂载
Vue.prototype.$echarts = echarts
Vue.prototype.$Vue = Vue;
Vue.prototype.getDicts = getDicts Vue.prototype.getDicts = getDicts
Vue.prototype.getConfigKey = getConfigKey Vue.prototype.getConfigKey = getConfigKey
Vue.prototype.parseTime = parseTime Vue.prototype.parseTime = parseTime
......
...@@ -19,7 +19,7 @@ module.exports = { ...@@ -19,7 +19,7 @@ module.exports = {
/** /**
* 是否显示 tagsView * 是否显示 tagsView
*/ */
tagsView: true, tagsView: false,
/** /**
* 是否固定头部 * 是否固定头部
......
This source diff could not be displayed because it is too large. You can view the blob instead.
/* /*
* @Author: your name * @Author: your name
* @Date: 2022-01-11 13:45:12 * @Date: 2022-01-11 13:45:12
* @LastEditTime: 2022-02-12 15:13:52 * @LastEditTime: 2022-02-17 10:10:11
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/untils/mapClass.js * @FilePath: /test/hello-world/src/utils/mapClass.js
*/ */
// 编辑类 // 编辑类
......
/*
* @Author: your name
* @Date: 2022-01-11 13:45:12
* @LastEditTime: 2022-02-17 10:12:27
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/utils/mapClass.js
*/
import { pipeColor, svgUrl } from "@/utils/mapClass/config.js";
// 编辑类
// 在地图上新增的设备可以直接编辑,
// 已经保存完成的设备需要点编辑才可以编辑
export class EditorMap {
// 地图的对象实例
map = null;
// 父vue的实例
vue = null;
// 操作 新建,编辑,删除,编辑跟删除只对已经在图上的设备有效 默认值:0, 新建:1,编辑:2, 删除: 3。
// 新建的时候会把未保存的线条清空
control = 0;
// 鼠标事件对象,用来将点跟线上图
mousetool = null;
// 当前正在手动绘制的对象
nowMouseTarget = null;
// 当线mousetool线被按下的时候的flag 当线被按下的时候为true,就不询问是否删除了
mosueToolPolineDownFlag = false;
// 绘制marer的时候的配置,在绘制完挂载事件的时候需要使用
mouseToolMarkerOptions = null;
// 绘制poline的时候的配置,在绘制完挂载事件的时候需要使用
mouseToolPolineOptions = null;
// 存放所有的设备的数组集合,这是一个对象,对象里面是各种设备的数组
allDevic = {};
// 存放所有的管道
pipeArr = {};
// 当前的infowindow的组件
infowindowComponent = null;
// infowindow本身
infowindow = null;
constructor(contaienr, config = {}, vue) {
this.map = new AMap.Map(contaienr, {
viewMode: "3D",
center: [114.196007, 38.260288],
layers: [AMap.createDefaultLayer()], // layers 字段为空或者不赋值将会自动创建默认底图。
zoom: 14,
...config,
});
this.vue = vue;
this.init();
}
init() {
// 地图事件
this.mapEvent();
// 手动点线上图准备,编辑模式
this.mouseAddDevice();
// this.mouseAddMarker();
// this.mouseAddPipeline();
}
// map的事件监听
mapEvent() {
this.map.on("click", () => {
// mousetool对象画出的对象的操作
// 如果有手动绘制对象,要手动清楚一下,因为画线的时候不好清除旧线,这其实是用来清楚旧线的
// 当画出来的线被mousedown,不删除,但是mouseToolPipeLineFlag要归位,在移出线的时候统一归位
// 如果对象是marker,直接删除
if (this.nowMouseTarget?.type == "AMap.Marker") {
this.mouseToolDrawClear();
} else {
// 当地图上已经画了线,并且没有点在线上,询问是否删除
if (this.nowMouseTarget && !this.mosueToolPolineDownFlag) {
this.confirm("是否重新绘制管道", { type: "warning" })
.then(() => {
// 删除原来的线
this.mouseToolDrawClear();
// 鼠标事件开启,并且赋值原来的属性,this.mouseToolMarkerOptions是开启绘制的时候记录的
this.mousetool.polyline(this.mouseToolPolineOptions);
})
.catch(() => {});
}
}
});
this.map.on("moveend", () => {
console.log("地图停止移动");
if (this.flag) {
console.log("弹框");
this.flag = false;
}
});
window.panTo = () => {
this.flag = true;
this.map.panTo([116.428285, 39.886129]);
};
}
// 弹框工具
confirm(message, obj) {
return this.vue.$confirm(message, obj);
}
// 改变操作状态
changeControl(num) {
this.control = num;
}
// 点线编辑上图准备
mouseAddDevice() {
this.map.plugin(["AMap.MouseTool"], () => {
this.mousetool = new AMap.MouseTool(this.map);
});
// 挂载绘制结束的事件
this.mouseDrawEvent();
}
// 点或者线上图结束后触发的事件
mouseDrawEvent() {
this.mousetool.on("draw", (e) => {
const target = e.obj;
// console.log([target._position.lng, target._position.lat]);
const { type: targetType } = target;
// 当这个点是marker的时候
if (targetType == "AMap.Marker") {
this.mouseToolMarkerEvent(target);
} else {
// 如果是线,挂上编辑
this.lineEditor(target);
this.mousetool.close();
this.mouseToolPolineEvent(target);
console.log(targetType, "当前对象是管道");
}
this.nowMouseTarget = target;
});
}
// 绘制marker结束后,在marker身上添加的事件
mouseToolMarkerEvent(target) {
// 由于画出来的marker点击会换位置,所以当移入的时候删除绘制事件,移出去在增加绘制事件
target.on("mouseover", (e) => {
// 鼠标事件关闭
this.mousetool.close(false);
});
target.on("mouseout", (e) => {
// 这里不方便获取原来的属性,因为position不好解决,还是设置一个值吧
// 鼠标事件开启,并且赋值原来的属性,this.mouseToolMarkerOptions是开启绘制的时候记录的
this.mousetool.marker(this.mouseToolMarkerOptions);
});
// 点
target.on("click", (e) => {
// 弹框
});
}
// 挂上线以及线的事件
lineEditor(line) {
// line.editor && line.editor.close();
// 当前点击次数,1次为编辑,2次为弹框
line.editorNum = 0;
line.editor = new AMap.PolyEditor(this.map, line);
}
// 绘制管道的时候,挂载的事件
mouseToolPolineEvent(target) {
// 线按下的时候会变成编辑,mousetool事件会清空 移出线的时候 在把polyline事件加上
target.on("mouseover", (e) => {
// 鼠标事件关闭
// this.mousetool.close(false);
});
target.on("mouseout", (e) => {
// 有时候按在线上移动地图,map点击事件中mosueToolPolineDownFlag无法归位,在这里归位
this.mosueToolPolineDownFlag = false;
// 鼠标事件开启,并且赋值原来的属性,this.mouseToolMarkerOptions是开启绘制的时候记录的
// this.mousetool.polyline(this.mouseToolPolineOptions);
});
// 线
target.on("mousedown", (e) => {
const line = e.target;
// mosueTool按下的flag,按在线上,不询问是否删除
this.mosueToolPolineDownFlag = true;
// 按下的时候要关闭事件
this.mousetool.close(false);
// 如果当前状态不是编辑,则进入编辑状态
if (line.editorNum < 1) {
// 打开并且++
line.editor.open();
line.editorNum++;
} else {
// 这里就要弹框了
console.log(line.getPath());
}
});
}
// 设备点击上图开启
mouseAddMarker(markerObj = {}) {
// 清空已经绘制完的对象
this.mousetoolClose(true);
// 记录一下配置项,在挂载点击的时候,需要使用
this.mouseToolMarkerOptions = {
draggable: true,
...markerObj,
};
this.mousetool.marker(this.mouseToolMarkerOptions);
}
// 管线点击上图开启
mouseAddPipeline(pipeObj = {}) {
this.mousetoolClose(true);
// 开始画线
this.mosuetoolPolineFlag = true;
this.mouseToolPolineOptions = {
strokeWeight: 5,
...pipeObj,
};
this.mousetool.polyline(this.mouseToolPolineOptions);
}
// 手动清除map上绘制的对象
mouseToolDrawClear() {
if (this.nowMouseTarget) {
this.map.remove(this.nowMouseTarget);
// 如果有editor,则关闭
this.nowMouseTarget.editor && this.nowMouseTarget.editor.close();
this.nowMouseTarget = null;
}
}
// 关闭点击上图事件 true清除之前绘制的图像,false 仅关闭上图事件
mousetoolClose(boolean) {
// 清空地图上的绘制对象的同时,也要清楚这个nowMouseTarget控制对象
if (this.nowMouseTarget) {
// 如果有editor,则关闭
this.nowMouseTarget.editor && this.nowMouseTarget.editor.close();
this.nowMouseTarget = null;
}
this.mousetool.close(boolean);
}
/**
*
*
*
*
*
*
* 地图上add设备
*
*
* @description:
* @param {*} deviceData marker的数据
* @param {*} compontent marker点击弹出的infowindow的组件
* @return {*}
*/
addDevice(deviceData, compontent) {
const { longitude: lng, latitude: lat, type, companyType } = deviceData;
const icon = svgUrl[type];
let device = this.createMarker({
map: this.map,
anchor: "bottom-center",
icon,
position: [lng, lat],
extData: deviceData,
});
// device.hide();
// 如果没有有这个公司的数组,就创建,有就直接push
if (!Array.isArray(this.allDevic[companyType])) {
this.allDevic[companyType] = [];
}
this.allDevic[companyType].push(device);
// 设备的事件函数
this.deviceEvent(device, compontent);
}
deviceEvent(device, compontent) {
device.on("click", (e) => {
const target = e.target;
// 如果control==0就是默认值,没有使用123功能,就显示infowindow
if (this.control == 0) {
this.markerClick(target, compontent);
} else if (this.control == 2) {
// 2是已经上图的设备拥有的编辑功能
} else if (this.control == 3) {
// 3是删除操作
}
});
}
/** 点击marker出现infowindow
* @description:
* @param {*} target 点击的对象
* @param {*} compontent marker点击弹出的infowindow的组件
* @return {*}
*/
markerClick(target, compontent) {
const deviceExtData = target.getExtData();
const { longitude: lng, latitude: lat } = deviceExtData;
// 创建一个可以控制的组件,将其dom插入infowindow
this.infowindowComponent = this.createInfowindowDom(
this.vue,
this,
deviceExtData,
compontent
);
// 没恩么用,控制台测试的时候用着玩的
window.func = () => {
const { longitude: lng, latitude: lat } = target.getExtData();
const cd = {
id: 1,
name: "9",
lng,
lat,
};
this.infowindowComponentChange(cd);
target.setExtData(cd);
};
this.infowindow = new AMap.InfoWindow({
isCustom: true,
content: this.infowindowComponent.$el,
position: [lng, lat],
// anchor: "top-left",
// offset: [20, -45],
anchor: "middle-left",
offset: [20, -10],
});
this.infowindow.open(this.map);
}
// 创建要加入到infowindow里的
createInfowindowDom(vueRoot, mapClass, deviceData, compontent) {
const Component = this.vue.$Vue.extend(compontent, {});
return new Component({
data() {
return {
// 当前vue实例
vueRoot,
// 自己写的map类
mapClass,
// 数据
deviceData,
};
},
}).$mount();
}
// 当前显示的infowindow内部的数据发生变化,一般在socket传回数据的时候使用
infowindowComponentChange(data) {
this.infowindowComponent.deviceData = data;
}
// 创建marker
createMarker(MarkerOptions) {
return new AMap.Marker(MarkerOptions);
}
// 地图上add管道
addPipeLine(objData, component) {
const { path, pipePressure, companyType } = objData;
// 根据压力获取颜色
const color = pipeColor[pipePressure];
const pipe = this.createPipeLine({
path,
strokeWeight: 4,
strokeColor: color,
extData: objData,
cursor: "pointer",
});
this.map.add(pipe);
// pipe.hide();
if (!Array.isArray(this.pipeArr[companyType])) {
this.pipeArr[companyType] = [];
}
this.pipeArr[companyType].push(pipe);
// console.log(this.pipeArr);
// this.map.panTo([path[0][0], path[0][1]]);
this.pipeEvent(pipe, component);
}
createPipeLine(pipeLineOptions) {
return new AMap.Polyline(pipeLineOptions);
}
pipeEvent(pipe, compontent) {
pipe.on("mouseover", (e) => {
const target = e.target;
// 获取当前颜色
const options = target.getOptions();
options.strokeColor = "blue";
target.setOptions(options);
});
pipe.on("mouseout", (e) => {
const target = e.target;
// 根据管道压力获取颜色
const { pipePressure } = target.getExtData();
const color = pipeColor[pipePressure];
// 获取当前颜色
const options = target.getOptions();
options.strokeColor = color;
target.setOptions(options);
});
pipe.on("click", (e) => {
const target = e.target;
target.lnglat = e.lnglat;
// 如果control==0就是默认值,没有使用123功能,就显示infowindow
if (this.control == 0) {
this.pipeClick(target, compontent);
} else if (this.control == 2) {
// 2是已经上图的设备拥有的编辑功能
} else if (this.control == 3) {
// 3是删除操作
}
});
}
pipeClick(target, compontent) {
const deviceExtData = target.getExtData();
const { lng, lat } = target.lnglat;
// 创建一个可以控制的组件,将其dom插入infowindow
this.infowindowComponent = this.createInfowindowDom(
this.vue,
this,
deviceExtData,
compontent
);
// 没恩么用,控制台测试的时候用着玩的
// window.func = () => {
// const { lng, lat } = target.getExtData();
// const cd = {
// id: 1,
// name: "9",
// lng,
// lat,
// };
// this.infowindowComponentChange(cd);
// target.setExtData(cd);
// };
this.infowindow = new AMap.InfoWindow({
isCustom: true,
content: this.infowindowComponent.$el,
position: [lng, lat],
// anchor: "top-left",
// offset: [20, -15],
anchor: "middle-left",
offset: [20, 0],
});
this.infowindow.open(this.map);
}
infowindowClose() {
if(!this.infowindow) return;
this.infowindow.close();
}
// 根据公司过滤是否显示 公司由一个数组传过来
companyFilter(companyArr) {
for (let pipeItem in this.pipeArr) {
// 如果item属于数组说明要显示,凑则就是隐藏
if (companyArr.indexOf(+pipeItem) >= 0) {
this.pipeArr[pipeItem].forEach((pipe) => {
pipe.show();
});
} else {
this.pipeArr[pipeItem].forEach((pipe) => {
pipe.hide();
});
}
}
for (let deviceItem in this.allDevic) {
if (companyArr.indexOf(+deviceItem) >= 0) {
this.allDevic[deviceItem].forEach((device) => {
device.show();
});
} else {
this.allDevic[deviceItem].forEach((device) => {
device.hide();
});
}
}
}
// 卫星图切换
satellite = null;
changeMap(bool) {
// 卫星图
if (!bool) {
if (this.satellite) return;
this.satellite = new AMap.TileLayer.Satellite();
this.map.addLayer(this.satellite);
} else {
if (this.satellite) {
this.map.removeLayer(this.satellite);
this.satellite = null;
}
}
}
}
<!-- <!--
* @Author: your name * @Author: your name
* @Date: 2022-01-07 13:36:55 * @Date: 2022-01-11 13:44:17
* @LastEditTime: 2022-01-07 14:32:07 * @LastEditTime: 2022-02-17 11:47:53
* @LastEditors: Please set LastEditors * @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /gassafetyprogress-web/src/views/bigWindow/index.vue * @FilePath: /test/hello-world/src/views/Home.vue
--> -->
<template> <template>
<div > <div class="home bigwindow">
<div>big window</div> <div class="goSystem" @click="$router.push('/index')">进入管理系统</div>
<button class="go" @click="goIndex">go index</button> <div id="map"></div>
<Center :show="show" :centerData="centerData" />
<PipeColor />
<div class="home-div">
<img
src="@/assets/mapImages/bottom.png"
alt=""
style="width: 100%; height: 100%; z-index: 999"
/>
<div class="listingsSty fangy">
<div
@click="allCompany"
:class="selarr.length == 3 ? 'active' : ''"
class="firsty"
>
全部
</div>
<div
class="firsty"
:class="selarr.indexOf(item.val) >= 0 ? 'active' : ''"
v-for="(item, index) in typeList"
:key="item.val"
@click="sel(index, item)"
>
{{ item.name }}
</div>
</div>
</div>
<!-- 弹框 -->
<div
id=""
style="position: fixed; top: 0; right: 0; width: 100px; height: 100px"
>
<!-- <markerInfoWindow></markerInfoWindow> -->
</div>
<!-- 头部 -->
<div class="banner-test">
<!-- <dv-decoration-5 style="width:100%;height:100%;" /> -->
<img src="@/assets/mapImages/top-banner.png" alt="" />
<div
style="
color: #fff;
width: 100%;
text-align: center;
font-weight: 700;
font-size: 32px;
position: fixed;
top: 0;
margin-top: 10px;
font-family: Impact, Haettenschweiler, 'Arial Narrow Bold', sans-serif;
"
>
<span class="tttt" style="">智慧管网安全监管平台</span>
</div>
</div>
<!-- 左边 -->
<div class="leftbar">
<leftBar ref="mychild2"></leftBar>
</div>
<!-- 右边 -->
<div class="rightbar">
<rightBar ref="mychild"></rightBar>
</div>
<!-- 左上角天气 -->
<div
class="weather"
style="
position: fixed;
top: 0;
margin-top: 5px;
margin-left: 10px;
left: 0;
z-index: 999;
width: 100px;
height: 50px;
"
>
<!-- <iframe src="../../static/weather.html" frameborder="0"></iframe> -->
<iframe
scrolling="no"
src="https://yiketianqi.com/api.php?style=ty&skin=pitaya&color=fff"
frameborder="0"
width="200"
height="55"
allowtransparency="true"
></iframe>
<!-- <iframe scrolling="no" src="https://yiketianqi.com/api.php?style=ty&skin=pitaya" frameborder="0" width="300" height="75" allowtransparency="true"></iframe> -->
</div>
<!-- 右上角时间 -->
<div
class="right-time"
style="
position: fixed;
top: 0;
margin-top: 10px;
margin-right: 5px;
right: 0;
z-index: 999;
width: 190px;
height: 50px;
color: #fff;
"
>
<div style="height: 50px; width: 49%; float: right; font-size: 14px">
<div>{{ nowweek }}</div>
<div>{{ nowDate }}</div>
</div>
<div style="height: 50px; width: 45%; line-height: 47px; font-size: 20px">
{{ nowtime }}
</div>
</div>
<div style="height: 50px; width: 45%; line-height: 47px; font-size: 20px">
{{ nowtime }}
</div>
</div> </div>
</template> </template>
<script> <script>
// @ is an alias to /src
import { EditorMap } from "@/utils/mapClass/map";
import {
pipeData,
tiaoyaxiang,
famen,
changzhan,
jiankong,
user,
} from "@/utils/mapClass/config.js";
import Line from "@/components/bigWindow/Line.vue";
import VideoView from "@/components/bigWindow/VideoView.vue";
import DeviceA from "@/components/bigWindow/DeviceA.vue";
import User from "@/components/bigWindow/User.vue";
import Center from "@/components/bigWindow/Center.vue";
import PipeColor from "@/components/bigWindow/PipeColor.vue";
// import markerInfoWindow from './components/markerInfoWindow.vue'
import leftBar from "@/components/bigWindow/leftBar.vue";
import rightBar from "@/components/bigWindow/rightBar.vue";
export default { export default {
methods:{ name: "Home",
goIndex(){ components: {
this.$router.push('/index') leftBar,
rightBar,
Center,
PipeColor,
},
data() {
return {
map: null,
show: false,
centerData: null,
selarr: [1, 2, 3],
weather: "",
lower: "",
higher: "",
nowDate: "",
nowweek: "",
nowtime: "", // 当前日期
typeList: [
{
val: 1,
name: "中燃祥科",
},
{
val: 2,
name: "中诚然气",
},
{
val: 3,
name: "中燃韵科",
},
],
};
},
watch: {
selarr(newValue) {
if (newValue.length == 3) {
this.$refs.mychild.choice(0);
this.$refs.mychild2.choice(0);
}
},
},
mounted() {
this.map = new EditorMap(
"map",
{
mapStyle: "amap://styles/f71d3a3d73e14f5b2bf5508bf1411758",
zoom: 14.5,
},
this
);
this.addPipeLine();
this.addDevice(tiaoyaxiang, DeviceA);
this.addDevice(famen, DeviceA);
this.addDevice(changzhan, DeviceA);
this.addDevice(user, User);
this.addDevice(jiankong, VideoView);
this.currentTime();
this.$refs.mychild.choice(0);
this.$refs.mychild2.choice(0);
},
methods: {
addPipeLine() {
for (let comp in pipeData) {
pipeData[comp].forEach((pipe) => {
this.map.addPipeLine(pipe, Line);
});
}
},
// 设备上图
addDevice(data, component) {
for (let comp in data) {
data[comp].forEach((pipe) => {
this.map.addDevice(pipe, component);
});
}
},
centerShow(boolean) {
this.show = boolean;
},
centerDataFunc(centerData) {
this.centerData = centerData;
console.log(centerData);
this.show = true;
},
allCompany() {
if (this.selarr.length == 3) {
this.selarr = [];
} else {
this.selarr = [1, 2, 3];
}
this.map.companyFilter(this.selarr);
this.map.infowindowClose();
this.show = false;
},
sel(index, item) {
this.map.infowindowClose();
this.show = false;
const ind = this.selarr.indexOf(item.val);
if (ind >= 0) {
this.selarr.splice(ind, 1);
if (item.val == 3) {
this.$refs.mychild.choice(1);
this.$refs.mychild2.choice(1);
} else {
this.$refs.mychild.choice(item.val + 1);
this.$refs.mychild2.choice(item.val + 1);
}
} else {
this.selarr.push(item.val);
this.$refs.mychild.choice(item.val);
this.$refs.mychild2.choice(item.val);
}
this.map.companyFilter(this.selarr);
},
currentTime() {
setInterval(() => {
this.formatDate();
}, 1000);
},
formatDate() {
let date = new Date();
let year = date.getFullYear(); // 年
let month = date.getMonth() + 1; // 月
let day = date.getDate(); // 日
let week = date.getDay(); // 星期
let weekArr = [
"星期日",
"星期一",
"星期二",
"星期三",
"星期四",
"星期五",
"星期六",
];
let hour = date.getHours(); // 时
hour = hour < 10 ? "0" + hour : hour; // 如果只有一位,则前面补零
let minute = date.getMinutes(); // 分
minute = minute < 10 ? "0" + minute : minute; // 如果只有一位,则前面补零
let second = date.getSeconds(); // 秒
second = second < 10 ? "0" + second : second; // 如果只有一位,则前面补零
this.nowtime = `${hour}:${minute}:${second}`;
this.nowweek = `${weekArr[week]}`;
this.nowDate = `${year}/${month}/${day}`;
},
},
// 销毁定时器
beforeDestroy() {
if (this.formatDate) {
clearInterval(this.formatDate); // 在Vue实例销毁前,清除时间定时器
} }
},
};
</script>
<style lang="scss" scoped>
.home {
position: relative;
height: 100vh;
}
.goSystem {
position: fixed;
z-index: 9999;
top: 20px;
right: 210px;
font-size: 18px;
color: #18baff;
cursor: pointer;
&:hover {
color: #1890ff;
} }
} }
</script> #map {
position: absolute;
top: 0px;
bottom: 0;
width: 100%;
}
.banner-test {
width: 100%;
height: 70px;
position: relative;
top: 0;
z-index: 999;
}
.banner-test img {
width: 100%;
height: 100%;
}
<style lang="scss" scoped> .leftbar {
.go{ width: 450px;
cursor: pointer; height: 100%;
position: fixed;
top: 0;
left: 0;
background-image: -webkit-gradient(
linear,
right top,
left top,
color-stop(20%, rgb(17 34 56 / 90%)),
color-stop(80%, rgb(18 24 29))
);
}
.rightbar {
width: 450px;
height: 100%;
position: fixed;
top: 0;
right: 0;
background-image: -webkit-gradient(
linear,
left top,
right top,
color-stop(20%, rgb(17 34 56 / 90%)),
color-stop(80%, rgb(18 24 29))
);
} }
</style>> .home-div {
width: 70%;
height: 70px;
position: fixed;
bottom: 0;
margin-left: 15%;
z-index: 1000;
}
.listingsSty {
// width: 24%;
/* height: 25px; */
position: fixed;
/* border: 1px solid #fff; */
bottom: 0;
margin-bottom: 10px;
left: 37%;
}
.firsty {
width: 90px;
height: 35px;
text-align: center;
line-height: 35px;
/* border: 1px solid #fff; */
color: #fff;
font-size: 17px;
float: left;
margin-left: 20px;
cursor: pointer;
}
.active {
text-shadow: 0 0 10px #2ee7e7, 0 0 10px #2ee7e7, 0 0 15px #2ee7e7,
0 0 20px #2ee7e7;
/*position:relative;*/
/*&::after{
width: 80px;
height: 50px;
z-index: -1;
content: " ";
position: absolute;
top: -7px;
left: 50%;
margin-left:-40px;
background: url(/img/bac1.0ec28f27.png);
background-repeat: no-repeat;
background-size: 100% 100%;
background-position: center;
color: aquamarine;
}*/
}
.weather-icon {
float: left;
width: 30px !important;
height: 30px !important;
margin-top: 10px !important;
margin-left: 10px !important;
padding-right: 5px;
}
.tttt {
background-image: -webkit-linear-gradient(
bottom,
rgb(134, 185, 233),
#ffffff
);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
</style>
\ No newline at end of file
<template> <template>
<div class="app-container home"> <div class="app-container homeA">
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :sm="24" :lg="24"> <el-col :sm="24" :lg="24">
<blockquote class="text-warning" style="font-size: 14px"> <blockquote class="text-warning" style="font-size: 14px">
...@@ -581,7 +581,7 @@ export default { ...@@ -581,7 +581,7 @@ export default {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.home { .homeA {
blockquote { blockquote {
padding: 10px 20px; padding: 10px 20px;
margin: 0 0 20px; margin: 0 0 20px;
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="设备名称" prop="deviceName">
<el-input
v-model="queryParams.deviceName"
placeholder="请输入设备名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="设备编号" prop="deviceNum"> <el-form-item label="设备编号" prop="deviceNum">
<el-input <el-input
v-model="queryParams.deviceNum" v-model="queryParams.deviceNum"
...@@ -10,6 +19,23 @@ ...@@ -10,6 +19,23 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="所属企业" prop="beyondEnterpriseId">
<!--<el-input
v-model="queryParams.beyondEnterpriseName"
placeholder="请输入所属企业名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>-->
<el-select v-model="queryParams.beyondEnterpriseId" placeholder="请选择所属企业">
<el-option
v-for="item in enterprises"
:key="item.enterpriseId"
:label="item.enterpriseName"
:value="item.enterpriseId"
></el-option>
</el-select>
</el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
...@@ -65,20 +91,22 @@ ...@@ -65,20 +91,22 @@
<el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="dataList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="设备名称" align="center" prop="deviceName" width="155"/>
<el-table-column label="设备编号" align="center" prop="deviceNum" width="155"/> <el-table-column label="设备编号" align="center" prop="deviceNum" width="155"/>
<el-table-column label="标况累计量" align="center" prop="standardConditionAccumulation" /> <el-table-column label="所属企业" align="center" prop="beyondEnterpriseName" />
<el-table-column label="工况累计量" align="center" prop="workingConditionAccumulation" /> <el-table-column label="标况累计量(m³)" align="center" prop="standardConditionAccumulation"/>
<el-table-column label="逆向标况累计量" align="center" prop="backingStandardConditionAccumulation" /> <el-table-column label="工况累计量(m³)" align="center" prop="workingConditionAccumulation" />
<el-table-column label="剩余量" align="center" prop="residualQuantity" /> <el-table-column label="逆向标况累计量(m³)" align="center" prop="backingStandardConditionAccumulation" />
<el-table-column label="标况流量" align="center" prop="standardConditionFlow" /> <el-table-column label="剩余量(m³)" align="center" prop="residualQuantity" />
<el-table-column label="工况流量" align="center" prop="workingConditionFlow" /> <el-table-column label="标况流量(m³/h)" align="center" prop="standardConditionFlow" />
<el-table-column label="温度" align="center" prop="temperature" /> <el-table-column label="工况流量(m³/h)" align="center" prop="workingConditionFlow" />
<el-table-column label="压力" align="center" prop="pressure" /> <el-table-column label="温度(℃)" align="center" prop="temperature" />
<el-table-column label="上报时间" align="center" prop="reportTime" width="180"> <el-table-column label="压力(KPa)" align="center" prop="pressure" />
<template slot-scope="scope"> <el-table-column label="上报时间" align="center" prop="createTime" width="180" />
<!-- <template slot-scope="scope">
<span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.reportTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>-->
<!--<el-table-column label="创建时间" align="center" prop="createTime" />--> <!--<el-table-column label="创建时间" align="center" prop="createTime" />-->
<!--<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <!--<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -173,7 +201,7 @@ ...@@ -173,7 +201,7 @@
<script> <script>
import { listData, getData, delData, addData, updateData, exportData } from "@/api/operationMonitor/data"; import { listData, getData, delData, addData, updateData, exportData } from "@/api/operationMonitor/data";
import { enterpriseLists } from "@/api/regulation/info";
export default { export default {
name: "Data", name: "Data",
components: { components: {
...@@ -226,11 +254,13 @@ export default { ...@@ -226,11 +254,13 @@ export default {
deviceNum: [ deviceNum: [
{ required: true, message: "设备id不能为空", trigger: "blur" } { required: true, message: "设备id不能为空", trigger: "blur" }
], ],
} },
enterprises:[]
}; };
}, },
created() { created() {
this.getList(); this.getList();
this.getEnterpriseLists();
}, },
methods: { methods: {
/** 查询设备监控列表 */ /** 查询设备监控列表 */
...@@ -352,6 +382,12 @@ export default { ...@@ -352,6 +382,12 @@ export default {
this.download(response.msg); this.download(response.msg);
this.exportLoading = false; this.exportLoading = false;
}).catch(() => {}); }).catch(() => {});
},
//所属单位
getEnterpriseLists(){
enterpriseLists().then(response => {
this.enterprises = response.rows;
});
} }
} }
}; };
......
<template> <template>
<div class="app-container"> <div class="app-container" style="">
<el-row> <div style="height: 100%;">
<el-col :span="5"> <el-col style="border:1px solid #cccccc;height: 100%;" :span="4">
<el-tree :data="videoData" :props="defaultProps" @node-click="handleNodeClick"></el-tree> <el-tree :data="videoData" :props="defaultProps" @node-click="handleNodeClick"></el-tree>
</el-col> </el-col>
<el-col :span="19"> <el-col :span="20" style="height: 100%;">
<div id="player" style="width: calc(67vw - 8px);height: calc((67vw - 8px) * 5 / 8)"></div> <div id="player"></div>
</el-col> </el-col>
</el-row> </div>
</div> </div>
</template> </template>
<!--<script src="@api/video/h5player.js"></script>-->
<script> <script>
import { getVideoTree } from "@/api/video/manager"; import { getVideoTree } from "@/api/video/manager";
import { getPreviewURLs } from "@/api/video/artemis" import { getPreviewURLs } from "@/api/video/artemis"
...@@ -116,3 +112,15 @@ export default { ...@@ -116,3 +112,15 @@ export default {
} }
}; };
</script> </script>
<style scoped lang="scss">
.app-container{
position:absolute;
top:0;
bottom:0;
width: 100%;
}
#player{
width: 100% ;
height: 100% ;
}
</style>
...@@ -147,7 +147,7 @@ ...@@ -147,7 +147,7 @@
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
v-hasPermi="['system:order:remove']" v-hasPermi="['system:order:remove']"
>删除</el-button> >删除</el-button>
<el-button v-if="'inpector'!= roleType && (scope.row.workAssignManId == '' || scope.row.workAssignManId == null) && scope.row.workStatus == '0'" <el-button v-if="(('enterprise'== roleType && (scope.row.workAssignManId == '' || scope.row.workAssignManId == null)) || ('zhengfu'== roleType && (scope.row.workAssignEnterproseId == '' || scope.row.workAssignEnterproseId == null))) && scope.row.workStatus == '0'"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
...@@ -184,7 +184,7 @@ ...@@ -184,7 +184,7 @@
/> />
<!-- 添加或修改燃气任务对话框 --> <!-- 添加或修改燃气任务对话框 -->
<el-dialog :title="title" :visible.sync="open" width="900px" @closed="dialogClose" @open="dialogOpen"> <el-dialog :title="title" :visible.sync="open" width="900px" @closed="dialogClose" @open="dialogOpen" :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
<el-form-item label="巡检路线" prop="inspectionRoute" v-show="form.workType=='2'"> <el-form-item label="巡检路线" prop="inspectionRoute" v-show="form.workType=='2'">
<el-input v-model="form.inspectionRoute" type="textarea" placeholder="请输入巡检路线" :disabled="isDetail"/> <el-input v-model="form.inspectionRoute" type="textarea" placeholder="请输入巡检路线" :disabled="isDetail"/>
</el-form-item> </el-form-item>
<el-form-item label="问题描述" prop="problemDescription"> <el-form-item label="问题描述" prop="problemDescription" v-show="form.workType=='3'">
<el-input v-model="form.problemDescription" type="textarea" placeholder="请输入问题描述" :disabled="isDetail"/> <el-input v-model="form.problemDescription" type="textarea" placeholder="请输入问题描述" :disabled="isDetail"/>
</el-form-item> </el-form-item>
<el-form-item label="整改方案" prop="rectificationPlan" v-show="form.workType=='3' && isDetail && (form.workStatus =='2' || form.workStatus =='3')"> <el-form-item label="整改方案" prop="rectificationPlan" v-show="form.workType=='3' && isDetail && (form.workStatus =='2' || form.workStatus =='3')">
...@@ -626,9 +626,10 @@ export default { ...@@ -626,9 +626,10 @@ export default {
this.form = response.data; this.form = response.data;
this.open = true; this.open = true;
this.title = "修改燃气任务"; this.title = "修改燃气任务";
this.getEnterpriseLists();
this.getInspectionUserList(response.data.workAssignEnterproseId);
}); });
this.getEnterpriseLists();
this.getInspectionUserList(row.workAssignEnterproseId);
}, },
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
......
<template>
<div class="app-container">
<div style="width: 100%;height: 10em;">
<div class="second-div">
<div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
<img src="../../../assets/hidden.png" width="40%" style="margin-top: 2rem;">
<p>隐患数量</p>
</div>
<div style="width: 50%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">{{hiddenObj.hiddenTotal}}</div>
</div>
<div class="second-div">
<div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
<img src="../../../assets/hidden.png" width="40%" style="margin-top: 2rem;">
<p>已完成数量</p>
</div>
<div style="width: 50%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">{{hiddenObj.completedTotal}}</div>
</div>
<div class="second-div">
<div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
<img src="../../../assets/hidden.png" width="40%" style="margin-top: 2rem;">
<p>未完成数量</p>
</div>
<div style="width: 50%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">{{hiddenObj.incompleteTotal}}</div>
</div>
<div class="second-div">
<div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
<img src="../../../assets/yh1.png" width="40%" style="margin-top: 2rem;">
<p>一级隐患</p>
</div>
<div style="width: 50%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">{{hiddenObj.oneLevelTotal}}</div>
</div>
<div class="second-div">
<div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
<img src="../../../assets/yh2.png" width="40%" style="margin-top: 2rem;">
<p>二级隐患</p>
</div>
<div style="width: 50%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">{{hiddenObj.twoLevelTotal}}</div>
</div>
<div class="second-div">
<div style="width: 50%;height: 100%; text-align: center;float: left;font-size: 15px;">
<img src="../../../assets/yh3.png" width="40%" style="margin-top: 2rem;">
<p>三级隐患</p>
</div>
<div style="width: 50%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">{{hiddenObj.threeLevelTotal}}</div>
</div>
</div>
<div style="width: 100%; padding: 30px 10px 0px 15px;">
<el-table v-loading="loading" :data="hiddenList" >
<el-table-column label="隐患名称" align="center" prop="hiddenTitle" width="200px"/>
<el-table-column label="隐患等级" align="center" prop="hiddenType">
<template slot-scope="scope">
<span v-if="scope.row.hiddenType == '1'">一级隐患</span>
<span v-if="scope.row.hiddenType == '2'">二级隐患</span>
<span v-if="scope.row.hiddenType == '3'">三级隐患</span>
</template>
</el-table-column>
<el-table-column label="隐患位置" align="center" prop="hiddenLocation" width="300px"/>
<el-table-column label="隐患发现人员" align="center" prop="hiddenFindPeople"/>
<el-table-column label="发现时间" align="center" prop="hiddenFindDate" width="150px"/>
<el-table-column label="处理方案" align="center" prop="dealPlanUrl" width="150px">
<template slot-scope="scope">
<span
class="dbtn"
@click="checkFile(scope.row.dealPlanUrl)"
v-if="scope.row.dealPlan != ''"
>
<i class="el-icon el-icon-view"></i>查看/下载
</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="整治情况" align="center" prop="remediation" width="120px">
<template slot-scope="scope">
<span v-if="scope.row.remediation == '1'">已完成</span>
<span v-if="scope.row.remediation == '2'">未完成</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120px">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="showDetail(scope.row)"
v-hasPermi="['standingBook:hidden:query']"
>详情</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body @cancel="cancel" @close="cancel">
<el-row>
<el-col :span="14">
<el-form ref="detailForm" :model="detailForm" label-width="120px">
<el-row>
<el-col :span="10">
<el-form-item label="隐患名称:">
<font>{{detailForm.hiddenTitle}}</font>
</el-form-item>
<el-form-item label="隐患发现人员:">
<font>{{detailForm.hiddenFindPeople}}</font>
</el-form-item>
<el-form-item label="发现时间:">
<font>{{detailForm.hiddenFindDate}}</font>
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item label="隐患等级:">
<font v-if="detailForm.hiddenType == '1'">一级隐患</font>
<font v-if="detailForm.hiddenType == '2'">二级隐患</font>
<font v-if="detailForm.hiddenType == '3'">三级隐患</font>
</el-form-item>
<el-form-item label="隐患位置:">
<font>{{detailForm.hiddenLocation}}</font>
</el-form-item>
<el-form-item label="处理方案:">
<span class="dbtn" @click="checkFile(detailForm.dealPlanUrl)" v-if="detailForm.dealPlan != ''">
<i class="el-icon el-icon-view"></i>查看/下载
</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="隐患内容:">
<font>{{detailForm.hiddenContent}}</font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="整治情况:">
<font v-if="detailForm.remediation == '1'">已完成</font>
<font v-if="detailForm.remediation == '2'">未完成</font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="备注信息:">
<font v-if="detailForm.remarks != '' && detailForm.remarks != null">{{detailForm.remarks}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
</el-form>
</el-col>
<el-col :span="9">
<div style="width: 100%;height: 390px;margin-top: -25px; border: 1px solid rgb(218, 213, 213);margin-bottom: 10px;">
<div style="width: 100%;height: 100%" id="hiddenContainer"></div>
</div>
</el-col>
</el-row>
</el-dialog>
</div>
</div>
</template>
<script>
import { hiddenStatistic } from "@/api/statistic/statisticAnalysis";
import { listHidden, getHidden } from "@/api/standingBook/hidden";
import { EditorMap } from "@/utils/mapClass/getPath.js";
export default {
name: "HiddenStatisticAnalysis",
components: {
},
data() {
return {
// 统计数据
hiddenObj: {},
// 遮罩层
loading: true,
// 隐患台账表格数据
hiddenList: [],
// 总条数
total: 0,
// 地图
map: null,
devicePos: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
},
// 表单参数
detailForm: {},
};
},
created() {
},
mounted() {
this.getStatiData();
this.getList();
},
methods: {
getStatiData() {
hiddenStatistic().then(response => {
this.hiddenObj = response.data;
console.log("this.hiddenObj",this.hiddenObj)
});
},
getList() {
this.loading = true;
listHidden(this.queryParams).then(response => {
this.hiddenList = response.rows;
this.total = response.total;
this.loading = false;
});
},
checkFile(url) {
window.open(url,'_blank');
},
reset() {
this.detailForm = {
hiddenId: null,
hiddenTitle: null,
hiddenContent: null,
hiddenLocation: null,
longitude:null,
latitude: null,
hiddenType: null,
hiddenFindPeople: null,
hiddenFindDate: null,
dealPlan: null,
remediation: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
isDel: null,
remarks: null
};
this.resetForm("detailForm");
this.devicePos = [];
},
/** 详细信息跳转 */
showDetail(row) {
this.reset();
getHidden(row.hiddenId).then(response => {
this.detailForm = response.data;
this.devicePos = [this.detailForm.longitude, this.detailForm.latitude];
console.log("this.devicePos",this.devicePos);
this.open = true;
this.title = "隐患整治台账详情";
this.$nextTick(() => {
this.map = new EditorMap("hiddenContainer", {}, this);
this.map.addDevice({ path: this.devicePos });
this.map.nowMouseTarget = null;
this.map.mousetoolClose(false);
});
});
},
cancel() {
this.open = false;
this.reset();
this.map.destroy();
},
}
};
</script>
<style>
.second-div{
margin-top: 20px;
width: 15%;
float: left;
margin-left: 1.5%;
height: 9rem;
color: #515a6e;
background-color: #FFF;
border-radius: 5px;
border: 2px solid rgb(22, 151, 207, 0.3);
box-shadow: 0 0 8px 8px rgba(131, 229, 255, 0.1)inset, 0 0 7px 7px rgba(22, 151, 207, 0.2);
}
.dbtn {
display: inline-block;
line-height: normal;
padding-left: 2px;
padding-right: 2px;
cursor: pointer;
border-radius: 3px;
border-style: solid;
border-width: 0;
color: rgb(48, 180, 107);
}
.dbtn:hover {
border-width: 1px;
border-color: rgb(48, 180, 107);
}
</style>
<template>
<div class="app-container">
<div style="width: 100%;height: 10em;">
<div class="first-div">
<div style="width: 40%;height: 100%; text-align: center;float: left;font-size: 15px;">
<img src="../../../assets/trouble.png" width="25%" style="margin-top: 2rem;">
<p>事故发生数</p>
</div>
<div style="width: 60%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">{{troubleObj.troubleTotal}}</div>
</div>
<div class="first-div">
<div style="width: 40%;height: 100%; text-align: center;float: left;font-size: 15px;">
<img src="../../../assets/trouble.png" width="25%" style="margin-top: 2rem;">
<p>伤亡人数</p>
</div>
<div style="width: 60%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">{{troubleObj.injuryTotal+troubleObj.deathTotal}}</div>
</div>
<div class="first-div">
<div style="width: 40%;height: 100%; text-align: center;float: left;font-size: 15px;">
<img src="../../../assets/trouble.png" width="25%" style="margin-top: 2rem;">
<p>事故处理办结率</p>
</div>
<div style="width: 60%;height: 100%;text-align: center;line-height: 9rem;float: right;font-size: 3rem;font-family: 'UnidreamLED';">{{troubleObj.completionRate}}%</div>
</div>
</div>
<div style="width: 100%; padding: 30px;">
<el-table v-loading="loading" :data="troubleList" >
<el-table-column label="事故名称" align="center" prop="troubleName" width="200px"/>
<el-table-column label="事故类型" align="center" prop="troubleType" width="130px">
<template slot-scope="scope">
<span v-if="scope.row.troubleType == 1">生产安全事故</span>
<span v-if="scope.row.troubleType == 2">非生产安全事故</span>
</template>
</el-table-column>
<el-table-column label="事故地点" align="center" prop="troubleLocation" width="300px"/>
<el-table-column label="事故发生时间" align="center" prop="happenDate" width="150px"/>
<el-table-column label="是否人员伤亡" align="center" prop="isCasualties" width="150px">
<template slot-scope="scope">
<span v-if="scope.row.isCasualties == 1"></span>
<span v-if="scope.row.isCasualties == 2"></span>
</template>
</el-table-column>
<el-table-column label="责任单位" align="center" prop="responsibleUnit" width="180px"/>
<el-table-column label="责任人员" align="center" prop="responsiblePeople"/>
<el-table-column label="是否处理" align="center" prop="isDeal">
<template slot-scope="scope">
<span v-if="scope.row.isDeal == 1">已处理</span>
<span v-if="scope.row.isDeal == 2">未处理</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120px">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="showDetail(scope.row)"
v-hasPermi="['standingBook:trouble:query']"
>详情</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<el-dialog :title="title" :visible.sync="open" width="1200px" append-to-body @cancel="cancel" @close="cancel">
<el-row>
<el-col :span="14">
<el-form ref="detailForm" :model="detailForm" label-width="120px">
<el-row>
<el-col :span="10">
<el-form-item label="事故名称:">
<font>{{detailForm.troubleName}}</font>
</el-form-item>
<el-form-item label="事故原因:">
<font>{{detailForm.troubleReason}}</font>
</el-form-item>
<el-form-item label="责任单位:">
<font v-if="detailForm.responsibleUnit != '' && detailForm.responsibleUnit != null">{{detailForm.responsibleUnit}}</font>
<font v-else> - </font>
</el-form-item>
<el-form-item label="是否人员伤亡:">
<font v-if="detailForm.isCasualties == '1'"></font>
<font v-if="detailForm.isCasualties == '2'"></font>
</el-form-item>
</el-col>
<el-col :span="13">
<el-form-item label="事故类型:">
<font v-if="detailForm.troubleType == '1'">安全生产事故</font>
<font v-if="detailForm.troubleType == '2'">非生产安全事故</font>
</el-form-item>
<el-form-item label="事故地点:">
<font>{{detailForm.troubleLocation}}</font>
</el-form-item>
<el-form-item label="责任人员:">
<font v-if="detailForm.responsiblePeople != '' && detailForm.responsiblePeople != null">{{detailForm.responsiblePeople}}</font>
<font v-else> - </font>
</el-form-item>
<el-form-item label="是否处理:">
<font v-if="detailForm.isDeal == '1'">已处理</font>
<font v-if="detailForm.isDeal == '2'">未处理</font>
</el-form-item>
</el-col>
</el-row>
<el-row v-if="detailForm.isCasualties == '1'">
<el-col :span="11">
<el-form-item label="受伤人数:">
<font>{{detailForm.injuryNum}}</font>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="死亡人数:">
<font>{{detailForm.deathNum}}</font>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-form-item label="处理完成时间:">
<font v-if="detailForm.dealDate != '' && detailForm.dealDate != null">{{detailForm.dealDate}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="简要经过:">
<font v-if="detailForm.briefProcess != '' && detailForm.briefProcess != null">{{detailForm.briefProcess}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
<el-row>
<el-form-item label="备注信息:">
<font v-if="detailForm.remarks != '' && detailForm.remarks != null">{{detailForm.remarks}}</font>
<font v-else> - </font>
</el-form-item>
</el-row>
</el-form>
</el-col>
<el-col :span="9">
<div style="width: 100%;height: 390px;margin-top: -25px; border: 1px solid rgb(218, 213, 213);margin-bottom: 10px;">
<div style="width: 100%;height: 100%" id="troubleContainer"></div>
</div>
</el-col>
</el-row>
</el-dialog>
</div>
</div>
</template>
<script>
import { troubleStatistic } from "@/api/statistic/statisticAnalysis";
import { listTrouble, getTrouble } from "@/api/standingBook/trouble";
import { EditorMap } from "@/utils/mapClass/getPath.js";
export default {
name: "TroubleStatisticAnalysis",
components: {
},
data() {
return {
// 统计数据
troubleObj: {},
// 遮罩层
loading: true,
// 事故台账表格数据
troubleList: [],
// 总条数
total: 0,
// 地图
map: null,
devicePos: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
},
// 表单参数
detailForm: {},
};
},
created() {
},
mounted() {
this.getStatiData();
this.getList();
},
methods: {
getStatiData() {
troubleStatistic().then(response => {
this.troubleObj = response.data;
});
},
getList() {
this.loading = true;
listTrouble(this.queryParams).then(response => {
this.troubleList = response.rows;
this.total = response.total;
this.loading = false;
});
},
reset() {
this.detailForm = {
troubleId: null,
troubleName: null,
troubleLocation: null,
longitude: null,
latitude: null,
troubleType: null,
briefProcess: null,
troubleReason: null,
isCasualties: null,
injuryNum: null,
deathNum: null,
responsibleUnit: null,
responsiblePeople: null,
isDeal: null,
happenDate: null,
dealDate: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
isDel: null,
remarks: null
};
this.resetForm("detailForm");
this.devicePos = [];
},
/** 详细信息跳转 */
showDetail(row) {
this.reset();
getTrouble(row.troubleId).then(response => {
this.detailForm = response.data;
this.devicePos = [this.detailForm.longitude, this.detailForm.latitude];
console.log("this.devicePos",this.devicePos);
this.open = true;
this.title = "燃气事故台账详情";
this.$nextTick(() => {
this.map = new EditorMap("troubleContainer", {}, this);
this.map.addDevice({ path: this.devicePos });
this.map.nowMouseTarget = null;
this.map.mousetoolClose(false);
});
});
},
cancel() {
this.open = false;
this.reset();
this.map.destroy();
},
}
};
</script>
<style>
.first-div{
margin-top: 20px;
width: 30%;
float: left;
margin-left: 2.5%;
height: 9rem;
color: #515a6e;
background-color: #FFF;
border-radius: 5px;
border: 2px solid rgb(22, 151, 207, 0.3);
box-shadow: 0 0 8px 8px rgba(131, 229, 255, 0.1)inset, 0 0 7px 7px rgba(22, 151, 207, 0.2);
}
</style>
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