Commit 2d4e630c authored by 耿迪迪's avatar 耿迪迪

停气监管

parent 0d0f96d0
package com.zehong.web.controller.supplybalance;
import java.util.List;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.TSupBalStopSup;
import com.zehong.system.service.ITSupBalStopSupService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 供需平衡-停气监管Controller
*
* @author zehong
* @date 2024-06-21
*/
@RestController
@RequestMapping("/supplyBalance/stop")
public class TSupBalStopSupController extends BaseController
{
@Autowired
private ITSupBalStopSupService tSupBalStopSupService;
/**
* 查询供需平衡-停气监管列表
*/
@GetMapping("/list")
public TableDataInfo list(TSupBalStopSup tSupBalStopSup)
{
startPage();
List<TSupBalStopSup> list = tSupBalStopSupService.selectTSupBalStopSupList(tSupBalStopSup);
return getDataTable(list);
}
/**
* 导出供需平衡-停气监管列表
*/
@Log(title = "供需平衡-停气监管", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TSupBalStopSup tSupBalStopSup)
{
List<TSupBalStopSup> list = tSupBalStopSupService.selectTSupBalStopSupList(tSupBalStopSup);
ExcelUtil<TSupBalStopSup> util = new ExcelUtil<TSupBalStopSup>(TSupBalStopSup.class);
return util.exportExcel(list, "供需平衡-停气监管数据");
}
/**
* 获取供需平衡-停气监管详细信息
*/
@GetMapping(value = "/{fGasStopId}")
public AjaxResult getInfo(@PathVariable("fGasStopId") Long fGasStopId)
{
return AjaxResult.success(tSupBalStopSupService.selectTSupBalStopSupById(fGasStopId));
}
/**
* 新增供需平衡-停气监管
*/
@Log(title = "供需平衡-停气监管", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TSupBalStopSup tSupBalStopSup)
{
return toAjax(tSupBalStopSupService.insertTSupBalStopSup(tSupBalStopSup));
}
/**
* 修改供需平衡-停气监管
*/
@Log(title = "供需平衡-停气监管", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TSupBalStopSup tSupBalStopSup)
{
return toAjax(tSupBalStopSupService.updateTSupBalStopSup(tSupBalStopSup));
}
/**
* 删除供需平衡-停气监管
*/
@Log(title = "供需平衡-停气监管", businessType = BusinessType.DELETE)
@DeleteMapping("/{fGasStopIds}")
public AjaxResult remove(@PathVariable Long[] fGasStopIds)
{
return toAjax(tSupBalStopSupService.deleteTSupBalStopSupByIds(fGasStopIds));
}
}
package com.zehong.system.domain;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 供需平衡-停气监管对象 t_sup_bal_stop_sup
*
* @author zehong
* @date 2024-06-21
*/
public class TSupBalStopSup extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long fGasStopId;
/** 企业uuid */
@Excel(name = "企业uuid")
private String fCompanyInfoId;
/** 停气开始日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "停气开始日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date fStartDate;
/** 停气结束日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "停气结束日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date fEndDate;
/** 停气类型 */
@Excel(name = "停气类型")
private String fStopType;
/** 影响用户 */
@Excel(name = "影响用户")
private Long fInfluenceCus;
/** 停气原因 */
@Excel(name = "停气原因")
private String fStopReason;
/** 停气范围 */
@Excel(name = "停气范围")
private String fStopRange;
/** 停气进度 */
@Excel(name = "停气进度")
private String fStopProgress;
/** 恢复供气时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "恢复供气时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date fRecoveryGasTime;
/** 上报状态 0-未上报,1-已上报 */
@Excel(name = "上报状态 0-未上报,1-已上报")
private String fRepStatus;
/** 停气区域 */
@Excel(name = "停气区域")
private String fGasStopArea;
/** 是否删除(0正常,1删除) */
@Excel(name = "是否删除(0正常,1删除)")
private String isDel;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setfGasStopId(Long fGasStopId)
{
this.fGasStopId = fGasStopId;
}
public Long getfGasStopId()
{
return fGasStopId;
}
public void setfCompanyInfoId(String fCompanyInfoId)
{
this.fCompanyInfoId = fCompanyInfoId;
}
public String getfCompanyInfoId()
{
return fCompanyInfoId;
}
public void setfStartDate(Date fStartDate)
{
this.fStartDate = fStartDate;
}
public Date getfStartDate()
{
return fStartDate;
}
public void setfEndDate(Date fEndDate)
{
this.fEndDate = fEndDate;
}
public Date getfEndDate()
{
return fEndDate;
}
public void setfStopType(String fStopType)
{
this.fStopType = fStopType;
}
public String getfStopType()
{
return fStopType;
}
public void setfInfluenceCus(Long fInfluenceCus)
{
this.fInfluenceCus = fInfluenceCus;
}
public Long getfInfluenceCus()
{
return fInfluenceCus;
}
public void setfStopReason(String fStopReason)
{
this.fStopReason = fStopReason;
}
public String getfStopReason()
{
return fStopReason;
}
public void setfStopRange(String fStopRange)
{
this.fStopRange = fStopRange;
}
public String getfStopRange()
{
return fStopRange;
}
public void setfStopProgress(String fStopProgress)
{
this.fStopProgress = fStopProgress;
}
public String getfStopProgress()
{
return fStopProgress;
}
public void setfRecoveryGasTime(Date fRecoveryGasTime)
{
this.fRecoveryGasTime = fRecoveryGasTime;
}
public Date getfRecoveryGasTime()
{
return fRecoveryGasTime;
}
public void setfRepStatus(String fRepStatus)
{
this.fRepStatus = fRepStatus;
}
public String getfRepStatus()
{
return fRepStatus;
}
public void setfGasStopArea(String fGasStopArea)
{
this.fGasStopArea = fGasStopArea;
}
public String getfGasStopArea()
{
return fGasStopArea;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("fGasStopId", getfGasStopId())
.append("fCompanyInfoId", getfCompanyInfoId())
.append("fStartDate", getfStartDate())
.append("fEndDate", getfEndDate())
.append("fStopType", getfStopType())
.append("fInfluenceCus", getfInfluenceCus())
.append("fStopReason", getfStopReason())
.append("fStopRange", getfStopRange())
.append("fStopProgress", getfStopProgress())
.append("fRecoveryGasTime", getfRecoveryGasTime())
.append("fRepStatus", getfRepStatus())
.append("fGasStopArea", getfGasStopArea())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("isDel", getIsDel())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.TSupBalStopSup;
/**
* 供需平衡-停气监管Mapper接口
*
* @author zehong
* @date 2024-06-21
*/
public interface TSupBalStopSupMapper
{
/**
* 查询供需平衡-停气监管
*
* @param fGasStopId 供需平衡-停气监管ID
* @return 供需平衡-停气监管
*/
public TSupBalStopSup selectTSupBalStopSupById(Long fGasStopId);
/**
* 查询供需平衡-停气监管列表
*
* @param tSupBalStopSup 供需平衡-停气监管
* @return 供需平衡-停气监管集合
*/
public List<TSupBalStopSup> selectTSupBalStopSupList(TSupBalStopSup tSupBalStopSup);
/**
* 新增供需平衡-停气监管
*
* @param tSupBalStopSup 供需平衡-停气监管
* @return 结果
*/
public int insertTSupBalStopSup(TSupBalStopSup tSupBalStopSup);
/**
* 修改供需平衡-停气监管
*
* @param tSupBalStopSup 供需平衡-停气监管
* @return 结果
*/
public int updateTSupBalStopSup(TSupBalStopSup tSupBalStopSup);
/**
* 删除供需平衡-停气监管
*
* @param fGasStopId 供需平衡-停气监管ID
* @return 结果
*/
public int deleteTSupBalStopSupById(Long fGasStopId);
/**
* 批量删除供需平衡-停气监管
*
* @param fGasStopIds 需要删除的数据ID
* @return 结果
*/
public int deleteTSupBalStopSupByIds(Long[] fGasStopIds);
}
package com.zehong.system.service;
import java.util.List;
import com.zehong.system.domain.TSupBalStopSup;
/**
* 供需平衡-停气监管Service接口
*
* @author zehong
* @date 2024-06-21
*/
public interface ITSupBalStopSupService
{
/**
* 查询供需平衡-停气监管
*
* @param fGasStopId 供需平衡-停气监管ID
* @return 供需平衡-停气监管
*/
public TSupBalStopSup selectTSupBalStopSupById(Long fGasStopId);
/**
* 查询供需平衡-停气监管列表
*
* @param tSupBalStopSup 供需平衡-停气监管
* @return 供需平衡-停气监管集合
*/
public List<TSupBalStopSup> selectTSupBalStopSupList(TSupBalStopSup tSupBalStopSup);
/**
* 新增供需平衡-停气监管
*
* @param tSupBalStopSup 供需平衡-停气监管
* @return 结果
*/
public int insertTSupBalStopSup(TSupBalStopSup tSupBalStopSup);
/**
* 修改供需平衡-停气监管
*
* @param tSupBalStopSup 供需平衡-停气监管
* @return 结果
*/
public int updateTSupBalStopSup(TSupBalStopSup tSupBalStopSup);
/**
* 批量删除供需平衡-停气监管
*
* @param fGasStopIds 需要删除的供需平衡-停气监管ID
* @return 结果
*/
public int deleteTSupBalStopSupByIds(Long[] fGasStopIds);
/**
* 删除供需平衡-停气监管信息
*
* @param fGasStopId 供需平衡-停气监管ID
* @return 结果
*/
public int deleteTSupBalStopSupById(Long fGasStopId);
}
package com.zehong.system.service.impl;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TSupBalStopSupMapper;
import com.zehong.system.domain.TSupBalStopSup;
import com.zehong.system.service.ITSupBalStopSupService;
/**
* 供需平衡-停气监管Service业务层处理
*
* @author zehong
* @date 2024-06-21
*/
@Service
public class TSupBalStopSupServiceImpl implements ITSupBalStopSupService
{
@Autowired
private TSupBalStopSupMapper tSupBalStopSupMapper;
/**
* 查询供需平衡-停气监管
*
* @param fGasStopId 供需平衡-停气监管ID
* @return 供需平衡-停气监管
*/
@Override
public TSupBalStopSup selectTSupBalStopSupById(Long fGasStopId)
{
return tSupBalStopSupMapper.selectTSupBalStopSupById(fGasStopId);
}
/**
* 查询供需平衡-停气监管列表
*
* @param tSupBalStopSup 供需平衡-停气监管
* @return 供需平衡-停气监管
*/
@Override
public List<TSupBalStopSup> selectTSupBalStopSupList(TSupBalStopSup tSupBalStopSup)
{
return tSupBalStopSupMapper.selectTSupBalStopSupList(tSupBalStopSup);
}
/**
* 新增供需平衡-停气监管
*
* @param tSupBalStopSup 供需平衡-停气监管
* @return 结果
*/
@Override
public int insertTSupBalStopSup(TSupBalStopSup tSupBalStopSup)
{
tSupBalStopSup.setCreateTime(DateUtils.getNowDate());
return tSupBalStopSupMapper.insertTSupBalStopSup(tSupBalStopSup);
}
/**
* 修改供需平衡-停气监管
*
* @param tSupBalStopSup 供需平衡-停气监管
* @return 结果
*/
@Override
public int updateTSupBalStopSup(TSupBalStopSup tSupBalStopSup)
{
tSupBalStopSup.setUpdateTime(DateUtils.getNowDate());
return tSupBalStopSupMapper.updateTSupBalStopSup(tSupBalStopSup);
}
/**
* 批量删除供需平衡-停气监管
*
* @param fGasStopIds 需要删除的供需平衡-停气监管ID
* @return 结果
*/
@Override
public int deleteTSupBalStopSupByIds(Long[] fGasStopIds)
{
return tSupBalStopSupMapper.deleteTSupBalStopSupByIds(fGasStopIds);
}
/**
* 删除供需平衡-停气监管信息
*
* @param fGasStopId 供需平衡-停气监管ID
* @return 结果
*/
@Override
public int deleteTSupBalStopSupById(Long fGasStopId)
{
return tSupBalStopSupMapper.deleteTSupBalStopSupById(fGasStopId);
}
}
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zehong.system.mapper.TSupBalStopSupMapper">
<resultMap type="TSupBalStopSup" id="TSupBalStopSupResult">
<result property="fGasStopId" column="f_gas_stop_id" />
<result property="fCompanyInfoId" column="f_company_info_id" />
<result property="fStartDate" column="f_start_date" />
<result property="fEndDate" column="f_end_date" />
<result property="fStopType" column="f_stop_type" />
<result property="fInfluenceCus" column="f_influence_cus" />
<result property="fStopReason" column="f_stop_reason" />
<result property="fStopRange" column="f_stop_range" />
<result property="fStopProgress" column="f_stop_progress" />
<result property="fRecoveryGasTime" column="f_recovery_gas_time" />
<result property="fRepStatus" column="f_rep_status" />
<result property="fGasStopArea" column="f_gas_stop_area" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTSupBalStopSupVo">
select f_gas_stop_id, f_company_info_id, f_start_date, f_end_date, f_stop_type, f_influence_cus, f_stop_reason, f_stop_range, f_stop_progress, f_recovery_gas_time, f_rep_status, f_gas_stop_area, create_by, create_time, update_by, update_time, is_del, remarks from t_sup_bal_stop_sup
</sql>
<select id="selectTSupBalStopSupList" parameterType="TSupBalStopSup" resultMap="TSupBalStopSupResult">
<include refid="selectTSupBalStopSupVo"/>
<where>
<if test="fCompanyInfoId != null and fCompanyInfoId != ''"> and f_company_info_id = #{fCompanyInfoId}</if>
<if test="fStopType != null and fStopType != ''"> and f_stop_type = #{fStopType}</if>
<if test="fStopProgress != null and fStopProgress != ''"> and f_stop_progress = #{fStopProgress}</if>
<if test="fRepStatus != null and fRepStatus != ''"> and f_rep_status = #{fRepStatus}</if>
</where>
</select>
<select id="selectTSupBalStopSupById" parameterType="Long" resultMap="TSupBalStopSupResult">
<include refid="selectTSupBalStopSupVo"/>
where f_gas_stop_id = #{fGasStopId}
</select>
<insert id="insertTSupBalStopSup" parameterType="TSupBalStopSup" useGeneratedKeys="true" keyProperty="fGasStopId">
insert into t_sup_bal_stop_sup
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fCompanyInfoId != null">f_company_info_id,</if>
<if test="fStartDate != null">f_start_date,</if>
<if test="fEndDate != null">f_end_date,</if>
<if test="fStopType != null and fStopType != ''">f_stop_type,</if>
<if test="fInfluenceCus != null">f_influence_cus,</if>
<if test="fStopReason != null">f_stop_reason,</if>
<if test="fStopRange != null and fStopRange != ''">f_stop_range,</if>
<if test="fStopProgress != null and fStopProgress != ''">f_stop_progress,</if>
<if test="fRecoveryGasTime != null">f_recovery_gas_time,</if>
<if test="fRepStatus != null and fRepStatus != ''">f_rep_status,</if>
<if test="fGasStopArea != null">f_gas_stop_area,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fCompanyInfoId != null">#{fCompanyInfoId},</if>
<if test="fStartDate != null">#{fStartDate},</if>
<if test="fEndDate != null">#{fEndDate},</if>
<if test="fStopType != null and fStopType != ''">#{fStopType},</if>
<if test="fInfluenceCus != null">#{fInfluenceCus},</if>
<if test="fStopReason != null">#{fStopReason},</if>
<if test="fStopRange != null and fStopRange != ''">#{fStopRange},</if>
<if test="fStopProgress != null and fStopProgress != ''">#{fStopProgress},</if>
<if test="fRecoveryGasTime != null">#{fRecoveryGasTime},</if>
<if test="fRepStatus != null and fRepStatus != ''">#{fRepStatus},</if>
<if test="fGasStopArea != null">#{fGasStopArea},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTSupBalStopSup" parameterType="TSupBalStopSup">
update t_sup_bal_stop_sup
<trim prefix="SET" suffixOverrides=",">
<if test="fCompanyInfoId != null">f_company_info_id = #{fCompanyInfoId},</if>
<if test="fStartDate != null">f_start_date = #{fStartDate},</if>
<if test="fEndDate != null">f_end_date = #{fEndDate},</if>
<if test="fStopType != null and fStopType != ''">f_stop_type = #{fStopType},</if>
<if test="fInfluenceCus != null">f_influence_cus = #{fInfluenceCus},</if>
<if test="fStopReason != null">f_stop_reason = #{fStopReason},</if>
<if test="fStopRange != null and fStopRange != ''">f_stop_range = #{fStopRange},</if>
<if test="fStopProgress != null and fStopProgress != ''">f_stop_progress = #{fStopProgress},</if>
<if test="fRecoveryGasTime != null">f_recovery_gas_time = #{fRecoveryGasTime},</if>
<if test="fRepStatus != null and fRepStatus != ''">f_rep_status = #{fRepStatus},</if>
<if test="fGasStopArea != null">f_gas_stop_area = #{fGasStopArea},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where f_gas_stop_id = #{fGasStopId}
</update>
<delete id="deleteTSupBalStopSupById" parameterType="Long">
delete from t_sup_bal_stop_sup where f_gas_stop_id = #{fGasStopId}
</delete>
<delete id="deleteTSupBalStopSupByIds" parameterType="String">
delete from t_sup_bal_stop_sup where f_gas_stop_id in
<foreach item="fGasStopId" collection="array" open="(" separator="," close=")">
#{fGasStopId}
</foreach>
</delete>
</mapper>
\ No newline at end of file
import request from '@/utils/request'
// 查询供需平衡-停气监管列表
export function listSup(query) {
return request({
url: '/supplyBalance/stop/list',
method: 'get',
params: query
})
}
// 查询供需平衡-停气监管详细
export function getSup(fGasStopId) {
return request({
url: '/supplyBalance/stop/' + fGasStopId,
method: 'get'
})
}
// 新增供需平衡-停气监管
export function addSup(data) {
return request({
url: '/supplyBalance/stop',
method: 'post',
data: data
})
}
// 修改供需平衡-停气监管
export function updateSup(data) {
return request({
url: '/supplyBalance/stop',
method: 'put',
data: data
})
}
// 删除供需平衡-停气监管
export function delSup(fGasStopId) {
return request({
url: '/supplyBalance/stop/' + fGasStopId,
method: 'delete'
})
}
// 导出供需平衡-停气监管
export function exportSup(query) {
return request({
url: '/supplyBalance/stop/export',
method: 'get',
params: query
})
}
<template>
<div style="position: relative">
<div class="search-wrapper pos">
<el-input
v-model="searchinput"
class="searchinput"
placeholder="请输入内容"
size="mini"
style="width: 150px"
ref="input"
></el-input>
</div>
<div
id="drawArea"
:style="{height: this.height + 'px'}"
></div>
</div>
</template>
<script>
import { EditorMap } from "@/utils/mapClass/getPath.js";
export default {
name: "draw-area",
props:{
value: {
type: Array,
default: ()=>[],
},
height:{
type: Number,
default: 500
}
},
data(){
return{
gaoMap: null,
mouseTool: null,
overlays: null,
firstClick: 0,
nowMouseTarget: null,
isClickPolygonFlag: false,
opts:{
fillColor:'#00b0ff',
strokeColor:'#80d8ff'
},
searchinput: ""
}
},
mounted(){
this.initMap();
this.$nextTick(() => {
const input = this.$refs.input.$refs.input;
this.gaoMap.positionSearch(input);
});
},
methods:{
//地图初始化
initMap(){
const path = eval(this.$store.state.user.systemSetting.map_center);
this.gaoMap = new EditorMap("drawArea", {center:path}, this);
this.initMapEvent();
if(this.value.length > 0){
this.loadArea();
}else{
this.initMouseEvent();
}
},
initMapEvent(){
let that = this;
this.gaoMap.map.on("click", () => {
if(that.nowMouseTarget && !that.isClickPolygonFlag){
that.$confirm("是否重新绘制区域", { type: "warning" })
.then(() => {
that.$emit("input", []);
that.mouseTool && that.mouseTool.close();
that.nowMouseTarget.polygonEditor && that.nowMouseTarget.polygonEditor.close();
that.gaoMap.map.remove(that.nowMouseTarget);
that.mouseTool && that.mouseTool.polygon(that.opts);
if(!that.mouseTool){
that.initMouseEvent();
}
that.isClickPolygonFlag = true;
}).catch(() => {});
}
});
},
//初始化鼠标事件
initMouseEvent(){
let that = this;
this.gaoMap.map.plugin(["AMap.MouseTool"], () => {
that.mouseTool = new AMap.MouseTool(this.gaoMap.map);
that.mouseTool.polygon(that.opts);
that.mouseTool.on('draw',function(e){
that.nowMouseTarget = e.obj;
that.$emit("input", that.nowMouseTarget._opts.path);
that.isClickPolygonFlag = false;
if(that.nowMouseTarget._opts.path.length > 2){
that.mouseTool.close();
that.isClickPolygonFlag = true;
}
that.firstClick = 0;
e.obj.on('click',function () {
that.isClickPolygonFlag = true;
that.firstClick++;
if(that.firstClick < 2){
that.gaoMap.map.plugin(["AMap.PolygonEditor"],(n) => {
const polygonEditor = new AMap.PolygonEditor(that.gaoMap.map,e.obj);
that.nowMouseTarget.polygonEditor = polygonEditor;
polygonEditor.on("removenode", (e) => {
that.$emit("input", e.target._opts.path);
that.isClickPolygonFlag = true;
if(that.nowMouseTarget._opts.path.length == 0){
setTimeout(() => {
that.mouseTool.polygon(that.opts);
}, 230);
}
});
polygonEditor.on("adjust",(e) =>{
that.$emit("input", e.target._opts.path);
})
polygonEditor.on("addnode",(e) =>{
that.$emit("input", e.target._opts.path);
})
polygonEditor.open();
});
}
});
e.obj.on("mouseout", (e) => {
that.isClickPolygonFlag = false;
})
//右键关闭区域编辑
e.obj.on("rightclick",() => {
that.firstClick = 0;
that.nowMouseTarget.polygonEditor.close();
})
})
});
},
//区域回显
loadArea(){
const polygon = new AMap.Polygon({
map:this.gaoMap.map,
path: this.value,
fillColor:'#00b0ff',
strokeColor:'#80d8ff'
});
this.nowMouseTarget = polygon;
this.firstClick = 0;
polygon.on("click",(e) =>{
this.isClickPolygonFlag = true;
this.firstClick++;
if(this.firstClick < 2){
this.gaoMap.map.plugin(["AMap.PolygonEditor"],()=> {
this.nowMouseTarget.polygonEditor = new AMap.PolygonEditor(this.gaoMap.map,e.target);
this.nowMouseTarget.polygonEditor.on("removenode", (e) => {
this.isClickPolygonFlag = true;
this.$emit("input", e.target._opts.path);
});
this.nowMouseTarget.polygonEditor.on("adjust",(e) =>{
this.$emit("input", e.target._opts.path);
})
this.nowMouseTarget.polygonEditor.on("addnode",(e) =>{
this.$emit("input", e.target._opts.path);
})
this.nowMouseTarget.polygonEditor.open();
})
}
});
polygon.on("mouseout", (e) => {
this.isClickPolygonFlag = false;
})
polygon.on("rightclick",() => {
this.firstClick = 0;
this.nowMouseTarget.polygonEditor && this.nowMouseTarget.polygonEditor.close();
})
}
}
}
</script>
<style scoped lang="scss">
.search-wrapper {
left: 30px;
}
.positionBtn {
right: 30px;
}
.pos {
position: absolute;
top: 20px;
left: 20px;
z-index: 20;
}
#drawArea {
width: 100%;
border: 1px solid;
}
</style>
<template>
<el-dialog title="详情" :visible.sync="detailOpen" width="900px" append-to-body destroy-on-close :close-on-click-modal="false">
<el-form label-width="120px">
<el-row class="el-row-table">
<el-col :span="12">
<el-form-item label="企业名称">
<span v-if="detailInfo.enterpriseName">{{ detailInfo.enterpriseName }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="计划量/wm³">
<span v-if="detailInfo.fPlanQuan">{{ detailInfo.fPlanQuan }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="批复量/wm³">
<span v-if="detailInfo.fApprQuan">{{ detailInfo.fApprQuan }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="供气量/wm³">
<span v-if="detailInfo.fSupGasVol">{{ detailInfo.fSupGasVol }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="存储量/wm³">
<span v-if="detailInfo.fStorageVol">{{ detailInfo.fStorageVol }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="监管气量日期">
<span v-if="detailInfo.fSupDate">{{ detailInfo.fSupDate }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="上报状态">
<span v-if="detailInfo.fRepStatus == '0'">未上报</span>
<span v-else-if="detailInfo.fRepStatus == '1'">已上报</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="上报日期">
<span v-if="detailInfo.fRepDate">{{ detailInfo.fRepDate }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="创建时间">
<span v-if="detailInfo.createTime">{{ detailInfo.createTime }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="更新时间">
<span v-if="detailInfo.updateTime">{{ detailInfo.updateTime }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="备注">
<span v-if="detailInfo.remarks">{{ detailInfo.remarks }}</span>
<span v-else>-</span>
</el-form-item>
</el-col>
</el-row>
</el-form>
</el-dialog>
</template>
<script>
import { getSup } from "@/api/supplybalance/gas";
export default {
name: "detail-info",
data(){
return{
detailInfo: {
fDeleteFlag: 0
},
detailOpen: false
}
},
methods:{
getDetailInfo(id){
getSup(id).then(res =>{
if(res.code == 200 && res.data){
this.detailInfo = res.data;
this.detailOpen = true;
}
})
}
}
}
</script>
<style scoped>
</style>
...@@ -77,10 +77,10 @@ ...@@ -77,10 +77,10 @@
<el-table v-loading="loading" :data="supList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="supList" @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="enterpriseName" /> <el-table-column label="企业名称" align="center" prop="enterpriseName" />
<el-table-column label="计划量" align="center" prop="fPlanQuan" /> <el-table-column label="计划量/wm³" align="center" prop="fPlanQuan" />
<el-table-column label="批复量" align="center" prop="fApprQuan" /> <el-table-column label="批复量/wm³" align="center" prop="fApprQuan" />
<el-table-column label="供气量" align="center" prop="fSupGasVol" /> <el-table-column label="供气量/wm³" align="center" prop="fSupGasVol" />
<el-table-column label="存储量" align="center" prop="fStorageVol" /> <el-table-column label="存储量/wm³" align="center" prop="fStorageVol" />
<el-table-column label="监管气量日期" align="center" prop="fSupDate" /> <el-table-column label="监管气量日期" align="center" prop="fSupDate" />
<el-table-column label="上报状态" align="center" prop="fRepStatus"> <el-table-column label="上报状态" align="center" prop="fRepStatus">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -102,6 +102,12 @@ ...@@ -102,6 +102,12 @@
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
>修改</el-button>--> >修改</el-button>-->
<el-button
size="mini"
type="text"
icon="el-icon-document"
@click="handleDetail(scope.row)"
>详情</el-button>
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
...@@ -247,7 +253,8 @@ ...@@ -247,7 +253,8 @@
</div> </div>
<!-- 详情 -->
<DetailInfo ref="detail"/>
</div> </div>
</template> </template>
...@@ -255,10 +262,12 @@ ...@@ -255,10 +262,12 @@
import { listSup, getSup, delSup, addSup, updateSup, exportSup, getReportInfoByCompany, reportInfoList } from "@/api/supplybalance/gas"; import { listSup, getSup, delSup, addSup, updateSup, exportSup, getReportInfoByCompany, reportInfoList } from "@/api/supplybalance/gas";
import Calendar from "@/components/Calendar"; import Calendar from "@/components/Calendar";
import moment from "moment"; import moment from "moment";
import DetailInfo from "./components/DetailInfo";
export default { export default {
name: "Sup", name: "Sup",
components: { components: {
Calendar Calendar,
DetailInfo
}, },
data() { data() {
return { return {
...@@ -516,7 +525,11 @@ export default { ...@@ -516,7 +525,11 @@ export default {
timeChange(val){ timeChange(val){
this.queryParams.beginRepDate = val[0]; this.queryParams.beginRepDate = val[0];
this.queryParams.endRepDate = val[1]; this.queryParams.endRepDate = val[1];
} },
//详情
handleDetail(row){
this.$refs.detail.getDetailInfo(row.fGasSupId);
},
} }
}; };
</script> </script>
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="企业名称" prop="fCompanyInfoId">
<el-input
v-model="queryParams.fCompanyInfoId"
placeholder="请输入企业名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="停气类型" prop="fStopType">
<el-select v-model="queryParams.fStopType" placeholder="请选择停气类型" clearable size="small">
<el-option
v-for="dict in fStopTypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="停气进度" prop="fStopProgress">
<el-select v-model="queryParams.fStopProgress" placeholder="请选择停气进度" clearable size="small">
<el-option
v-for="dict in fStopProgressOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
/>
</el-select>
</el-form-item>
<el-form-item label="上报状态" prop="fRepStatus">
<el-select v-model="queryParams.fRepStatus" placeholder="请选择上报状态" clearable size="small">
<el-option label="未上报" value="0" />
<el-option label="已上报" value="2" />
</el-select>
</el-form-item>
<el-form-item>
<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-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
:loading="exportLoading"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="supList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="企业名称" align="center" prop="fCompanyInfoId" />
<el-table-column label="停气开始日期" align="center" prop="fStartDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.fStartDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="停气结束日期" align="center" prop="fEndDate" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.fEndDate, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="停气类型" align="center" prop="fStopType" :formatter="fStopTypeFormat" />
<el-table-column label="影响用户" align="center" prop="fInfluenceCus" />
<el-table-column label="停气进度" align="center" prop="fStopProgress" :formatter="fStopProgressFormat" />
<el-table-column label="恢复供气时间" align="center" prop="fRecoveryGasTime" width="180">
<template slot-scope="scope">
<span v-if="scope.row.fRecoveryGasTime">{{ parseTime(scope.row.fRecoveryGasTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="上报状态" align="center" prop="fRepStatus">
<template slot-scope="scope">
<span v-if="scope.row.fRepStatus == '0'">未上报</span>
<span v-else-if="scope.row.fRepStatus == '1'">已上报</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</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 destroy-on-close :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<el-col :span="12">
<el-row class="el-row-table">
<el-col :span="12">
<el-form-item label="停气开始日期" prop="fStartDate">
<el-date-picker clearable size="small"
v-model="form.fStartDate"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%"
placeholder="选择停气开始日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="停气结束日期" prop="fEndDate">
<el-date-picker clearable size="small"
v-model="form.fEndDate"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
style="width: 100%"
placeholder="选择停气结束日期">
</el-date-picker>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="停气类型" prop="fStopType">
<el-select v-model="form.fStopType" style="width: 100%" placeholder="请选择停气类型">
<el-option
v-for="dict in fStopTypeOptions"
:key="dict.dictValue"
:label="dict.dictLabel"
:value="dict.dictValue"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="影响用户" prop="fInfluenceCus">
<el-input type="Number" v-model="form.fInfluenceCus" placeholder="请输入影响用户" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="停气原因" prop="fStopReason">
<el-input type="textarea" v-model="form.fStopReason" placeholder="请输入停气原因" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item label="停气范围" prop="fStopRange">
<el-input type="textarea" v-model="form.fStopRange" placeholder="请输入停气范围" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="停气区域" prop="fGasStopArea">
<el-input v-model="form.fGasStopArea" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-col>
</el-row>
</el-col>
<el-col :span="12" style="padding-left: 10px">
<div>停气</div>
<DrawArea v-model="path"/>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listSup, getSup, delSup, addSup, updateSup, exportSup } from "@/api/supplybalance/stop";
import DrawArea from "@/components/DrawArea";
export default {
name: "Sup",
components: {
DrawArea
},
data() {
return {
// 遮罩层
loading: true,
// 导出遮罩层
exportLoading: false,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 停气监管表格数据
supList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 停气类型字典
fStopTypeOptions: [],
// 停气进度字典
fStopProgressOptions: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
fCompanyInfoId: null,
fStopType: null,
fStopProgress: null,
fRepStatus: null,
},
// 表单参数
form: {},
// 表单校验
rules: {
fStartDate: [
{ required: true, message: "停气开始日期不能为空", trigger: "blur" }
],
fEndDate: [
{ required: true, message: "停气结束日期不能为空", trigger: "blur" }
],
fStopType: [
{ required: true, message: "停气类型不能为空", trigger: "change" }
],
fInfluenceCus: [
{ required: true, message: "影响用户不能为空", trigger: "blur" }
],
fStopRange: [
{ required: true, message: "停气范围不能为空", trigger: "blur" }
],
fStopProgress: [
{ required: true, message: "停气进度不能为空", trigger: "change" }
],
fRepStatus: [
{ required: true, message: "上报状态 0-未上报,1-已上报不能为空", trigger: "blur" }
],
},
path:[
[114.602763,38.071221],
[114.762751,38.056354],
[114.657695,38.020932],
[114.655978,38.020121]
]
};
},
created() {
this.getList();
this.getDicts("t_stop_type").then(response => {
this.fStopTypeOptions = response.data;
});
this.getDicts("t_stop_progress").then(response => {
this.fStopProgressOptions = response.data;
});
},
watch:{
path(newVal,oldVal){
this.form.fGasStopArea = JSON.stringify(newVal);
}
},
methods: {
/** 查询停气监管列表 */
getList() {
this.loading = true;
listSup(this.queryParams).then(response => {
this.supList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 停气类型字典翻译
fStopTypeFormat(row, column) {
return this.selectDictLabel(this.fStopTypeOptions, row.fStopType);
},
// 停气进度字典翻译
fStopProgressFormat(row, column) {
return this.selectDictLabel(this.fStopProgressOptions, row.fStopProgress);
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
fGasStopId: null,
fCompanyInfoId: null,
fStartDate: null,
fEndDate: null,
fStopType: null,
fInfluenceCus: null,
fStopReason: null,
fStopRange: null,
fStopProgress: null,
fRecoveryGasTime: null,
fRepStatus: "0",
fGasStopArea: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
isDel: null,
remarks: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.fGasStopId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加停气监管";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const fGasStopId = row.fGasStopId || this.ids
getSup(fGasStopId).then(response => {
this.form = response.data;
if(this.form.fGasStopArea){
this.path = JSON.parse(this.form.fGasStopArea);
}
this.open = true;
this.title = "修改停气监管";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.fGasStopId != null) {
updateSup(this.form).then(response => {
this.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addSup(this.form).then(response => {
this.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const fGasStopIds = row.fGasStopId || this.ids;
this.$confirm('是否确认删除停气监管编号为"' + fGasStopIds + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function() {
return delSup(fGasStopIds);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有停气监管数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(() => {
this.exportLoading = true;
return exportSup(queryParams);
}).then(response => {
this.download(response.msg);
this.exportLoading = false;
}).catch(() => {});
}
}
};
</script>
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