Commit e2897c3f authored by 耿迪迪's avatar 耿迪迪

企业信息管理

parent db714c11
package com.zehong.web.controller.baseinfo;
import com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.core.page.TableDataInfo;
import com.zehong.common.enums.BusinessType;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.system.domain.baseinfo.TEnterpriseInfo;
import com.zehong.system.service.baseinfo.ITEnterpriseInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 企业基础信息管理Controller
*
* @author zehong
* @date 2022-06-23
*/
@RestController
@RequestMapping("/baseInfo/enterpriseInfo")
public class TEnterpriseInfoController extends BaseController
{
@Autowired
private ITEnterpriseInfoService tEnterpriseInfoService;
/**
* 查询企业基础信息管理列表
*/
//@PreAuthorize("@ss.hasPermi('safetyManagement:enterpriseInfo:list')")
@GetMapping("/list")
public TableDataInfo list(TEnterpriseInfo tEnterpriseInfo)
{
startPage();
List<TEnterpriseInfo> list = tEnterpriseInfoService.selectTEnterpriseInfoList(tEnterpriseInfo);
return getDataTable(list);
}
/**
* 导出企业基础信息管理列表
*/
@Log(title = "企业基础信息管理", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TEnterpriseInfo tEnterpriseInfo)
{
List<TEnterpriseInfo> list = tEnterpriseInfoService.selectTEnterpriseInfoList(tEnterpriseInfo);
ExcelUtil<TEnterpriseInfo> util = new ExcelUtil<TEnterpriseInfo>(TEnterpriseInfo.class);
return util.exportExcel(list, "企业基础信息管理数据");
}
/**
* 获取企业基础信息管理详细信息
*/
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(tEnterpriseInfoService.selectTEnterpriseInfoById(id));
}
/**
* 新增企业基础信息管理
*/
@Log(title = "企业基础信息管理", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TEnterpriseInfo tEnterpriseInfo)
{
return toAjax(tEnterpriseInfoService.insertTEnterpriseInfo(tEnterpriseInfo));
}
/**
* 修改企业基础信息管理
*/
@Log(title = "企业基础信息管理", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TEnterpriseInfo tEnterpriseInfo)
{
return toAjax(tEnterpriseInfoService.updateTEnterpriseInfo(tEnterpriseInfo));
}
/**
* 删除企业基础信息管理
*/
@Log(title = "企业基础信息管理", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tEnterpriseInfoService.deleteTEnterpriseInfoByIds(ids));
}
}
package com.zehong.system.domain.baseinfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
import java.util.Date;
/**
* 企业基础信息管理对象 t_enterprise_info
*
* @author zehong
* @date 2022-06-23
*/
public class TEnterpriseInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 单位名称 */
@Excel(name = "单位名称")
private String unitName;
/** 社会统一信用代码 */
@Excel(name = "社会统一信用代码")
private String orgCode;
/** 生产经营地址 */
@Excel(name = "生产经营地址")
private String runAddress;
/** 注册地址 */
@Excel(name = "注册地址")
private String regAddress;
/** 安全监管分类 */
@Excel(name = "安全监管分类")
private String regulationType;
/** 成立日期 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "成立日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date regDate;
/** 营业期限 */
@Excel(name = "营业期限")
private String businessTerm;
/** 值班电话 */
@Excel(name = "值班电话")
private String dutyPhone;
/** 经度 */
@Excel(name = "经度")
private BigDecimal longitude;
/** 纬度 */
@Excel(name = "纬度")
private BigDecimal latitude;
/** 经营范围 */
@Excel(name = "经营范围")
private String businessScope;
/** 从业人员数量 */
@Excel(name = "从业人员数量")
private String employeeNum;
/** 法定代表人 */
@Excel(name = "法定代表人")
private String legalPerson;
/** 法定代表人手机 */
@Excel(name = "法定代表人手机")
private String legalPersonPhone;
/** 主要负责人 */
@Excel(name = "主要负责人")
private String keyPerson;
/** 主要负责人手机 */
@Excel(name = "主要负责人手机")
private String keyPersonPhone;
/** 安全负责人 */
@Excel(name = "安全负责人")
private String safetyPerson;
/** 安全负责人手机 */
@Excel(name = "安全负责人手机")
private String safetyPersonPhone;
/** 创建人id */
@Excel(name = "创建人id")
private String createUserId;
/** 更新人id */
@Excel(name = "更新人id")
private String updateUserId;
/** 备注 */
@Excel(name = "备注")
private String remarks;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setUnitName(String unitName)
{
this.unitName = unitName;
}
public String getUnitName()
{
return unitName;
}
public void setOrgCode(String orgCode)
{
this.orgCode = orgCode;
}
public String getOrgCode()
{
return orgCode;
}
public void setRunAddress(String runAddress)
{
this.runAddress = runAddress;
}
public String getRunAddress()
{
return runAddress;
}
public void setRegAddress(String regAddress)
{
this.regAddress = regAddress;
}
public String getRegAddress()
{
return regAddress;
}
public void setRegulationType(String regulationType)
{
this.regulationType = regulationType;
}
public String getRegulationType()
{
return regulationType;
}
public void setRegDate(Date regDate)
{
this.regDate = regDate;
}
public Date getRegDate()
{
return regDate;
}
public void setBusinessTerm(String businessTerm)
{
this.businessTerm = businessTerm;
}
public String getBusinessTerm()
{
return businessTerm;
}
public void setLongitude(BigDecimal longitude)
{
this.longitude = longitude;
}
public BigDecimal getLongitude()
{
return longitude;
}
public void setLatitude(BigDecimal latitude)
{
this.latitude = latitude;
}
public BigDecimal getLatitude()
{
return latitude;
}
public void setBusinessScope(String businessScope)
{
this.businessScope = businessScope;
}
public String getBusinessScope()
{
return businessScope;
}
public void setEmployeeNum(String employeeNum)
{
this.employeeNum = employeeNum;
}
public String getEmployeeNum()
{
return employeeNum;
}
public void setLegalPerson(String legalPerson)
{
this.legalPerson = legalPerson;
}
public String getLegalPerson()
{
return legalPerson;
}
public void setLegalPersonPhone(String legalPersonPhone)
{
this.legalPersonPhone = legalPersonPhone;
}
public String getLegalPersonPhone()
{
return legalPersonPhone;
}
public void setKeyPerson(String keyPerson)
{
this.keyPerson = keyPerson;
}
public String getKeyPerson()
{
return keyPerson;
}
public void setKeyPersonPhone(String keyPersonPhone)
{
this.keyPersonPhone = keyPersonPhone;
}
public String getKeyPersonPhone()
{
return keyPersonPhone;
}
public void setSafetyPerson(String safetyPerson)
{
this.safetyPerson = safetyPerson;
}
public String getSafetyPerson()
{
return safetyPerson;
}
public void setSafetyPersonPhone(String safetyPersonPhone)
{
this.safetyPersonPhone = safetyPersonPhone;
}
public String getSafetyPersonPhone()
{
return safetyPersonPhone;
}
public void setCreateUserId(String createUserId)
{
this.createUserId = createUserId;
}
public String getCreateUserId()
{
return createUserId;
}
public void setUpdateUserId(String updateUserId)
{
this.updateUserId = updateUserId;
}
public String getUpdateUserId()
{
return updateUserId;
}
public void setRemarks(String remarks)
{
this.remarks = remarks;
}
public String getRemarks()
{
return remarks;
}
public String getDutyPhone() {
return dutyPhone;
}
public void setDutyPhone(String dutyPhone) {
this.dutyPhone = dutyPhone;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("unitName", getUnitName())
.append("orgCode", getOrgCode())
.append("runAddress", getRunAddress())
.append("regAddress", getRegAddress())
.append("regulationType", getRegulationType())
.append("regDate", getRegDate())
.append("businessTerm", getBusinessTerm())
.append("longitude", getLongitude())
.append("latitude", getLatitude())
.append("businessScope", getBusinessScope())
.append("employeeNum", getEmployeeNum())
.append("legalPerson", getLegalPerson())
.append("legalPersonPhone", getLegalPersonPhone())
.append("keyPerson", getKeyPerson())
.append("keyPersonPhone", getKeyPersonPhone())
.append("safetyPerson", getSafetyPerson())
.append("safetyPersonPhone", getSafetyPersonPhone())
.append("createUserId", getCreateUserId())
.append("updateUserId", getUpdateUserId())
.append("updateTime", getUpdateTime())
.append("createTime", getCreateTime())
.append("remarks", getRemarks())
.toString();
}
}
package com.zehong.system.mapper.baseinfo;
import com.zehong.system.domain.baseinfo.TEnterpriseInfo;
import java.util.List;
/**
* 企业基础信息管理Mapper接口
*
* @author zehong
* @date 2022-06-23
*/
public interface TEnterpriseInfoMapper
{
/**
* 查询企业基础信息管理
*
* @param id 企业基础信息管理ID
* @return 企业基础信息管理
*/
public TEnterpriseInfo selectTEnterpriseInfoById(Long id);
/**
* 查询企业基础信息管理列表
*
* @param tEnterpriseInfo 企业基础信息管理
* @return 企业基础信息管理集合
*/
public List<TEnterpriseInfo> selectTEnterpriseInfoList(TEnterpriseInfo tEnterpriseInfo);
/**
* 新增企业基础信息管理
*
* @param tEnterpriseInfo 企业基础信息管理
* @return 结果
*/
public int insertTEnterpriseInfo(TEnterpriseInfo tEnterpriseInfo);
/**
* 修改企业基础信息管理
*
* @param tEnterpriseInfo 企业基础信息管理
* @return 结果
*/
public int updateTEnterpriseInfo(TEnterpriseInfo tEnterpriseInfo);
/**
* 删除企业基础信息管理
*
* @param id 企业基础信息管理ID
* @return 结果
*/
public int deleteTEnterpriseInfoById(Long id);
/**
* 批量删除企业基础信息管理
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteTEnterpriseInfoByIds(Long[] ids);
}
package com.zehong.system.service.baseinfo;
import com.zehong.system.domain.baseinfo.TEnterpriseInfo;
import java.util.List;
/**
* 企业基础信息管理Service接口
*
* @author zehong
* @date 2022-06-23
*/
public interface ITEnterpriseInfoService
{
/**
* 查询企业基础信息管理
*
* @param id 企业基础信息管理ID
* @return 企业基础信息管理
*/
public TEnterpriseInfo selectTEnterpriseInfoById(Long id);
/**
* 查询企业基础信息管理列表
*
* @param tEnterpriseInfo 企业基础信息管理
* @return 企业基础信息管理集合
*/
public List<TEnterpriseInfo> selectTEnterpriseInfoList(TEnterpriseInfo tEnterpriseInfo);
/**
* 新增企业基础信息管理
*
* @param tEnterpriseInfo 企业基础信息管理
* @return 结果
*/
public int insertTEnterpriseInfo(TEnterpriseInfo tEnterpriseInfo);
/**
* 修改企业基础信息管理
*
* @param tEnterpriseInfo 企业基础信息管理
* @return 结果
*/
public int updateTEnterpriseInfo(TEnterpriseInfo tEnterpriseInfo);
/**
* 批量删除企业基础信息管理
*
* @param ids 需要删除的企业基础信息管理ID
* @return 结果
*/
public int deleteTEnterpriseInfoByIds(Long[] ids);
/**
* 删除企业基础信息管理信息
*
* @param id 企业基础信息管理ID
* @return 结果
*/
public int deleteTEnterpriseInfoById(Long id);
}
package com.zehong.system.service.impl.baseinfo;
import com.zehong.common.utils.DateUtils;
import com.zehong.system.domain.baseinfo.TEnterpriseInfo;
import com.zehong.system.mapper.baseinfo.TEnterpriseInfoMapper;
import com.zehong.system.service.baseinfo.ITEnterpriseInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 企业基础信息管理Service业务层处理
*
* @author zehong
* @date 2022-06-23
*/
@Service
public class TEnterpriseInfoServiceImpl implements ITEnterpriseInfoService
{
@Autowired
private TEnterpriseInfoMapper tEnterpriseInfoMapper;
/**
* 查询企业基础信息管理
*
* @param id 企业基础信息管理ID
* @return 企业基础信息管理
*/
@Override
public TEnterpriseInfo selectTEnterpriseInfoById(Long id)
{
return tEnterpriseInfoMapper.selectTEnterpriseInfoById(id);
}
/**
* 查询企业基础信息管理列表
*
* @param tEnterpriseInfo 企业基础信息管理
* @return 企业基础信息管理
*/
@Override
public List<TEnterpriseInfo> selectTEnterpriseInfoList(TEnterpriseInfo tEnterpriseInfo)
{
return tEnterpriseInfoMapper.selectTEnterpriseInfoList(tEnterpriseInfo);
}
/**
* 新增企业基础信息管理
*
* @param tEnterpriseInfo 企业基础信息管理
* @return 结果
*/
@Override
public int insertTEnterpriseInfo(TEnterpriseInfo tEnterpriseInfo)
{
tEnterpriseInfo.setCreateTime(DateUtils.getNowDate());
return tEnterpriseInfoMapper.insertTEnterpriseInfo(tEnterpriseInfo);
}
/**
* 修改企业基础信息管理
*
* @param tEnterpriseInfo 企业基础信息管理
* @return 结果
*/
@Override
public int updateTEnterpriseInfo(TEnterpriseInfo tEnterpriseInfo)
{
tEnterpriseInfo.setUpdateTime(DateUtils.getNowDate());
return tEnterpriseInfoMapper.updateTEnterpriseInfo(tEnterpriseInfo);
}
/**
* 批量删除企业基础信息管理
*
* @param ids 需要删除的企业基础信息管理ID
* @return 结果
*/
@Override
public int deleteTEnterpriseInfoByIds(Long[] ids)
{
return tEnterpriseInfoMapper.deleteTEnterpriseInfoByIds(ids);
}
/**
* 删除企业基础信息管理信息
*
* @param id 企业基础信息管理ID
* @return 结果
*/
@Override
public int deleteTEnterpriseInfoById(Long id)
{
return tEnterpriseInfoMapper.deleteTEnterpriseInfoById(id);
}
}
<?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.baseinfo.TEnterpriseInfoMapper">
<resultMap type="TEnterpriseInfo" id="TEnterpriseInfoResult">
<result property="id" column="id" />
<result property="unitName" column="unit_name" />
<result property="orgCode" column="org_code" />
<result property="runAddress" column="run_address" />
<result property="regAddress" column="reg_address" />
<result property="regulationType" column="regulation_type" />
<result property="regDate" column="reg_date" />
<result property="businessTerm" column="business_term" />
<result property="dutyPhone" column="duty_phone" />
<result property="longitude" column="longitude" />
<result property="latitude" column="latitude" />
<result property="businessScope" column="business_scope" />
<result property="employeeNum" column="employee_num" />
<result property="legalPerson" column="legal_person" />
<result property="legalPersonPhone" column="legal_person_phone" />
<result property="keyPerson" column="key_person" />
<result property="keyPersonPhone" column="key_person_phone" />
<result property="safetyPerson" column="safety_person" />
<result property="safetyPersonPhone" column="safety_person_phone" />
<result property="createUserId" column="create_user_id" />
<result property="updateUserId" column="update_user_id" />
<result property="updateTime" column="update_time" />
<result property="createTime" column="create_time" />
<result property="remarks" column="remarks" />
</resultMap>
<sql id="selectTEnterpriseInfoVo">
select id, unit_name, org_code, run_address, reg_address, regulation_type, reg_date, business_term, duty_phone, longitude, latitude, business_scope, employee_num, legal_person, legal_person_phone, key_person, key_person_phone, safety_person, safety_person_phone, create_user_id, update_user_id, update_time, create_time, remarks from t_enterprise_info
</sql>
<select id="selectTEnterpriseInfoList" parameterType="TEnterpriseInfo" resultMap="TEnterpriseInfoResult">
<include refid="selectTEnterpriseInfoVo"/>
<where>
<if test="unitName != null and unitName != ''"> and unit_name like concat('%', #{unitName}, '%')</if>
<if test="orgCode != null and orgCode != ''"> and org_code = #{orgCode}</if>
<if test="runAddress != null and runAddress != ''"> and run_address = #{runAddress}</if>
<if test="regAddress != null and regAddress != ''"> and reg_address = #{regAddress}</if>
<if test="regulationType != null and regulationType != ''"> and regulation_type = #{regulationType}</if>
<if test="regDate != null "> and reg_date = #{regDate}</if>
<if test="businessTerm != null and businessTerm != ''"> and business_term = #{businessTerm}</if>
<if test="longitude != null "> and longitude = #{longitude}</if>
<if test="latitude != null "> and latitude = #{latitude}</if>
<if test="businessScope != null and businessScope != ''"> and business_scope = #{businessScope}</if>
<if test="employeeNum != null and employeeNum != ''"> and employee_num = #{employeeNum}</if>
<if test="legalPerson != null and legalPerson != ''"> and legal_person = #{legalPerson}</if>
<if test="legalPersonPhone != null and legalPersonPhone != ''"> and legal_person_phone = #{legalPersonPhone}</if>
<if test="keyPerson != null and keyPerson != ''"> and key_person = #{keyPerson}</if>
<if test="keyPersonPhone != null and keyPersonPhone != ''"> and key_person_phone = #{keyPersonPhone}</if>
<if test="safetyPerson != null and safetyPerson != ''"> and safety_person = #{safetyPerson}</if>
<if test="safetyPersonPhone != null and safetyPersonPhone != ''"> and safety_person_phone = #{safetyPersonPhone}</if>
<if test="createUserId != null and createUserId != ''"> and create_user_id = #{createUserId}</if>
<if test="updateUserId != null and updateUserId != ''"> and update_user_id = #{updateUserId}</if>
<if test="remarks != null and remarks != ''"> and remarks = #{remarks}</if>
</where>
</select>
<select id="selectTEnterpriseInfoById" parameterType="Long" resultMap="TEnterpriseInfoResult">
<include refid="selectTEnterpriseInfoVo"/>
where id = #{id}
</select>
<insert id="insertTEnterpriseInfo" parameterType="TEnterpriseInfo">
insert into t_enterprise_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="unitName != null">unit_name,</if>
<if test="orgCode != null">org_code,</if>
<if test="runAddress != null">run_address,</if>
<if test="regAddress != null">reg_address,</if>
<if test="regulationType != null">regulation_type,</if>
<if test="regDate != null">reg_date,</if>
<if test="businessTerm != null">business_term,</if>
<if test="dutyPhone != null">duty_phone,</if>
<if test="longitude != null">longitude,</if>
<if test="latitude != null">latitude,</if>
<if test="businessScope != null">business_scope,</if>
<if test="employeeNum != null">employee_num,</if>
<if test="legalPerson != null">legal_person,</if>
<if test="legalPersonPhone != null">legal_person_phone,</if>
<if test="keyPerson != null">key_person,</if>
<if test="keyPersonPhone != null">key_person_phone,</if>
<if test="safetyPerson != null">safety_person,</if>
<if test="safetyPersonPhone != null">safety_person_phone,</if>
<if test="createUserId != null">create_user_id,</if>
<if test="updateUserId != null">update_user_id,</if>
<if test="updateTime != null">update_time,</if>
<if test="createTime != null">create_time,</if>
<if test="remarks != null">remarks,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="unitName != null">#{unitName},</if>
<if test="orgCode != null">#{orgCode},</if>
<if test="runAddress != null">#{runAddress},</if>
<if test="regAddress != null">#{regAddress},</if>
<if test="regulationType != null">#{regulationType},</if>
<if test="regDate != null">#{regDate},</if>
<if test="businessTerm != null">#{businessTerm},</if>
<if test="dutyPhone != null">#{dutyPhone},</if>
<if test="longitude != null">#{longitude},</if>
<if test="latitude != null">#{latitude},</if>
<if test="businessScope != null">#{businessScope},</if>
<if test="employeeNum != null">#{employeeNum},</if>
<if test="legalPerson != null">#{legalPerson},</if>
<if test="legalPersonPhone != null">#{legalPersonPhone},</if>
<if test="keyPerson != null">#{keyPerson},</if>
<if test="keyPersonPhone != null">#{keyPersonPhone},</if>
<if test="safetyPerson != null">#{safetyPerson},</if>
<if test="safetyPersonPhone != null">#{safetyPersonPhone},</if>
<if test="createUserId != null">#{createUserId},</if>
<if test="updateUserId != null">#{updateUserId},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createTime != null">#{createTime},</if>
<if test="remarks != null">#{remarks},</if>
</trim>
</insert>
<update id="updateTEnterpriseInfo" parameterType="TEnterpriseInfo">
update t_enterprise_info
<trim prefix="SET" suffixOverrides=",">
<if test="unitName != null">unit_name = #{unitName},</if>
<if test="orgCode != null">org_code = #{orgCode},</if>
<if test="runAddress != null">run_address = #{runAddress},</if>
<if test="regAddress != null">reg_address = #{regAddress},</if>
<if test="regulationType != null">regulation_type = #{regulationType},</if>
<if test="regDate != null">reg_date = #{regDate},</if>
<if test="businessTerm != null">business_term = #{businessTerm},</if>
duty_phone = #{dutyPhone},
longitude = #{longitude},
latitude = #{latitude},
business_scope = #{businessScope},
employee_num = #{employeeNum},
legal_person = #{legalPerson},
legal_person_phone = #{legalPersonPhone},
key_person = #{keyPerson},
key_person_phone = #{keyPersonPhone},
safety_person = #{safetyPerson},
safety_person_phone = #{safetyPersonPhone},
<if test="createUserId != null">create_user_id = #{createUserId},</if>
<if test="updateUserId != null">update_user_id = #{updateUserId},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="remarks != null">remarks = #{remarks},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTEnterpriseInfoById" parameterType="Long">
delete from t_enterprise_info where id = #{id}
</delete>
<delete id="deleteTEnterpriseInfoByIds" parameterType="String">
delete from t_enterprise_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
......@@ -7,6 +7,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title>
<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>
<!-- 为了路径 -->
<!--[if lt IE 11]><script>window.location.href='/html/ie.html';</script><![endif]-->
<style>
html,
......
import request from '@/utils/request'
// 查询企业基础信息管理列表
export function listEnterpriseInfo(query) {
return request({
url: '/baseInfo/enterpriseInfo/list',
method: 'get',
params: query
})
}
// 查询企业基础信息管理详细
export function getEnterpriseInfo(id) {
return request({
url: '/baseInfo/enterpriseInfo/' + id,
method: 'get'
})
}
// 新增企业基础信息管理
export function addEnterpriseInfo(data) {
return request({
url: '/baseInfo/enterpriseInfo',
method: 'post',
data: data
})
}
// 修改企业基础信息管理
export function updateEnterpriseInfo(data) {
return request({
url: '/baseInfo/enterpriseInfo',
method: 'put',
data: data
})
}
// 删除企业基础信息管理
export function delEnterpriseInfo(id) {
return request({
url: '/baseInfo/enterpriseInfo/' + id,
method: 'delete'
})
}
// 导出企业基础信息管理
export function exportEnterpriseInfo(query) {
return request({
url: '/baseInfo/enterpriseInfo/export',
method: 'get',
params: query
})
}
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1644901265903" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7343" width="32" height="32" xmlns:xlink="http://www.w3.org/1999/xlink"><defs><style type="text/css"></style></defs><path d="M527.053 96.924c-169.131 0.322-306.127 137.496-306.127 306.7 0 157.986 128.978 324.17 278.121 502.935 7.838 9.418 17.977 14.485 28.006 15.061 10.029-0.576 20.168-5.643 28.002-15.061 149.144-178.765 278.123-344.948 278.123-502.935 0-169.205-136.997-306.378-306.126-306.7zM527.053 500.967c-66.070-0.358-119.562-53.956-119.562-120.099s53.492-119.74 119.562-120.099c66.069 0.358 119.557 53.956 119.557 120.099s-53.487 119.74-119.557 120.099z" p-id="7344" fill="#1296db"></path></svg>
\ No newline at end of file
<!--
* @Author: your name
* @Date: 2022-02-12 11:07:10
* @LastEditTime: 2022-02-22 15:08:10
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /test/hello-world/src/components/GetPos.vue/index.vue
-->
<template>
<el-dialog
class="getpos"
title="定位"
:visible.sync="dialogVisible"
width="60%"
:before-close="handleClose"
append-to-body
>
<template v-if="inputVisible">
<div class="search-wrapper pos">
<el-input
v-model="searchinput"
class="searchinput"
placeholder="请输入内容"
size="mini"
style="width: 150px"
ref="input"
></el-input>
</div>
<div @click="pos" class="positionBtn pos">
<el-button type="primary" size="mini" icon="el-icon-position"
> 确定 </el-button
>
</div>
</template>
<div id="getposmap"></div>
</el-dialog>
</template>
<script>
import { EditorMap } from "@/utils/mapClass/getPath.js";
export default {
props: {
//管道路径,二维数组s
pipePath: {
type: Array,
default: () => [],
},
// marker位置,数组
devicePos: {
type: Array,
default: () => [],
},
// 设备类型,管道传pipe,marker就不用传值
device: {
type: String,
default: "",
},
// 显示隐藏
dialogVisible: {
type: Boolean,
default: false,
},
// input跟定位按钮是否展示
inputVisible: {
type: Boolean,
default: true,
},
},
data() {
return {
// dialogVisible: false,
map: null,
searchinput: "",
};
},
watch: {
dialogVisible(newValue) {
if (newValue) {
this.init();
} else {
this.map.destroy();
this.searchinput="";
}
this.$nextTick(() => {
const input = this.$refs.input.$refs.input;
this.map.positionSearch(input);
});
},
},
mounted() {},
methods: {
init() {
this.$nextTick(() => {
const path = eval(this.$store.state.user.systemSetting.map_center);
console.log("path",path);
this.map = new EditorMap("getposmap", {center:path}, this);
// 如果不传值就是设备,传pipe就是管道
if (this.device == "") {
// 如果传了路径就创建一个marker,如果没传就直接激活手动创建
if (this.devicePos.length > 0) {
this.map.addDevice({ path: this.devicePos });
} else {
this.map.mouseAddMarker();
}
} else {
//console.log(this.pipePath.length)
if (this.pipePath!=null && this.pipePath.length > 0) {
this.map.addPipeLine({ path: this.pipePath });
} else {
this.map.mouseAddPipeline();
}
}
});
},
handleClose() {
this.$emit("close");
},
open() {
this.dialogVisible = true;
},
// 返回坐标
pos() {
this.path = this.map.getPath();
this.$emit("getPath", this.path);
if (this.path?.length > 0) {
this.$emit("update:dialogVisible", false);
}
},
},
};
</script>
<style lang="scss" scoped>
.search-wrapper {
left: 30px;
}
.positionBtn {
right: 30px;
}
.pos {
position: absolute;
top: 90px;
z-index: 20;
}
#getposmap {
width: 100%;
height: 500px;
}
</style>
This diff is collapsed.
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