bim 模型管理

dev_xd
haha 2025-04-04 00:25:29 +08:00
parent 060632dd82
commit d07e2e8129
12 changed files with 1172 additions and 3 deletions

View File

@ -0,0 +1,222 @@
package com.yanzhu.bim.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.yanzhu.common.core.annotation.Excel;
import com.yanzhu.common.core.web.domain.BaseEntity;
/**
* Bim bim_model_info
*
* @author yanzhu
* @date 2025-04-02
*/
public class BimModelInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long modelId;
/** 租户id */
@Excel(name = "租户id")
private Long comId;
/** 项目id */
@Excel(name = "项目id")
private Long projectId;
/** 单位id */
@Excel(name = "单位id")
private Long deptId;
/** 模型名称 */
@Excel(name = "模型名称")
private String modelName;
/** 轻量化名称 */
@Excel(name = "轻量化名称")
private String lightweightName;
/** api服务返回的json */
@Excel(name = "api服务返回的json")
private String gisJson;
/** 轻量化状态 */
@Excel(name = "轻量化状态")
private Long modelStatus;
/** 模型类型 */
@Excel(name = "模型类型")
private String modelType;
/** 模型文件类型 */
@Excel(name = "模型文件类型")
private String fileType;
/** 文件大小 */
@Excel(name = "文件大小")
private Long fileSize;
/** 是否有效 */
@Excel(name = "是否有效")
private Long isDel;
public Long getIsDel() {
return isDel;
}
public void setIsDel(Long isDel) {
this.isDel = isDel;
}
public String getLightweightName() {
return lightweightName;
}
public void setLightweightName(String lightweightName) {
this.lightweightName = lightweightName;
}
/** 是否在沙盘显示0不显示1显示 */
@Excel(name = "是否在沙盘显示0不显示1显示")
private Long showSand;
/** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Long status;
public void setModelId(Long modelId)
{
this.modelId = modelId;
}
public Long getModelId()
{
return modelId;
}
public void setComId(Long comId)
{
this.comId = comId;
}
public Long getComId()
{
return comId;
}
public void setProjectId(Long projectId)
{
this.projectId = projectId;
}
public Long getProjectId()
{
return projectId;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public Long getDeptId()
{
return deptId;
}
public void setModelName(String modelName)
{
this.modelName = modelName;
}
public String getModelName()
{
return modelName;
}
public void setGisJson(String gisJson)
{
this.gisJson = gisJson;
}
public String getGisJson()
{
return gisJson;
}
public void setModelStatus(Long modelStatus)
{
this.modelStatus = modelStatus;
}
public Long getModelStatus()
{
return modelStatus;
}
public void setModelType(String modelType)
{
this.modelType = modelType;
}
public String getModelType()
{
return modelType;
}
public void setFileType(String fileType)
{
this.fileType = fileType;
}
public String getFileType()
{
return fileType;
}
public void setFileSize(Long fileSize)
{
this.fileSize = fileSize;
}
public Long getFileSize()
{
return fileSize;
}
public void setShowSand(Long showSand)
{
this.showSand = showSand;
}
public Long getShowSand()
{
return showSand;
}
public void setStatus(Long status)
{
this.status = status;
}
public Long getStatus()
{
return status;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("modelId", getModelId())
.append("comId", getComId())
.append("projectId", getProjectId())
.append("deptId", getDeptId())
.append("modelName", getModelName())
.append("lightweightName", getLightweightName())
.append("gisJson", getGisJson())
.append("modelStatus", getModelStatus())
.append("modelType", getModelType())
.append("fileType", getFileType())
.append("fileSize", getFileSize())
.append("showSand", getShowSand())
.append("status", getStatus())
.append("remark", getRemark())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,62 @@
package com.yanzhu.bim.mapper;
import com.yanzhu.bim.domain.BimModelInfo;
import java.util.List;
/**
* BimMapper
*
* @author yanzhu
* @date 2025-04-02
*/
public interface BimModelInfoMapper
{
/**
* Bim
*
* @param modelId Bim
* @return Bim
*/
public BimModelInfo selectBimModelInfoByModelId(Long modelId);
/**
* Bim
*
* @param bimModelInfo Bim
* @return Bim
*/
public List<BimModelInfo> selectBimModelInfoList(BimModelInfo bimModelInfo);
/**
* Bim
*
* @param bimModelInfo Bim
* @return
*/
public int insertBimModelInfo(BimModelInfo bimModelInfo);
/**
* Bim
*
* @param bimModelInfo Bim
* @return
*/
public int updateBimModelInfo(BimModelInfo bimModelInfo);
/**
* Bim
*
* @param modelId Bim
* @return
*/
public int deleteBimModelInfoByModelId(Long modelId);
/**
* Bim
*
* @param modelIds
* @return
*/
public int deleteBimModelInfoByModelIds(Long[] modelIds);
}

View File

@ -0,0 +1,136 @@
<?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.yanzhu.bim.mapper.BimModelInfoMapper">
<resultMap type="BimModelInfo" id="BimModelInfoResult">
<result property="modelId" column="model_id" />
<result property="comId" column="com_id" />
<result property="projectId" column="project_id" />
<result property="deptId" column="dept_id" />
<result property="modelName" column="model_name" />
<result property="lightweightName" column="lightweightName" />
<result property="gisJson" column="gis_json" />
<result property="modelStatus" column="model_status" />
<result property="modelType" column="model_type" />
<result property="fileType" column="file_type" />
<result property="fileSize" column="file_size" />
<result property="showSand" column="show_sand" />
<result property="status" column="status" />
<result property="isDel" column="is_del"/>
<result property="remark" column="remark" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectBimModelInfoVo">
select model_id, com_id, project_id, dept_id, model_name, lightweightName, gis_json, model_status, model_type,
file_type, file_size, show_sand, status, remark, create_by, create_time, update_by, update_time,is_del
from bim_model_info
</sql>
<select id="selectBimModelInfoList" parameterType="BimModelInfo" resultMap="BimModelInfoResult">
<include refid="selectBimModelInfoVo"/>
<where>
is_del &lt;&gt; 1
<if test="comId != null "> and com_id = #{comId}</if>
<if test="projectId != null "> and project_id = #{projectId}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="modelName != null and modelName != ''"> and model_name like concat('%', #{modelName}, '%')</if>
<if test="lightweightName != null and lightweightName != ''"> and lightweightName like concat('%', #{lightweightName}, '%')</if>
<if test="gisJson != null and gisJson != ''"> and gis_json = #{gisJson}</if>
<if test="modelStatus != null "> and model_status = #{modelStatus}</if>
<if test="modelType != null and modelType != ''"> and model_type = #{modelType}</if>
<if test="fileType != null and fileType != ''"> and file_type = #{fileType}</if>
<if test="fileSize != null "> and file_size = #{fileSize}</if>
<if test="showSand != null "> and show_sand = #{showSand}</if>
<if test="status != null "> and status = #{status}</if>
</where>
</select>
<select id="selectBimModelInfoByModelId" parameterType="Long" resultMap="BimModelInfoResult">
<include refid="selectBimModelInfoVo"/>
where model_id = #{modelId}
</select>
<insert id="insertBimModelInfo" parameterType="BimModelInfo" useGeneratedKeys="true" keyProperty="modelId">
insert into bim_model_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="comId != null">com_id,</if>
<if test="projectId != null">project_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="modelName != null">model_name,</if>
<if test="lightweightName != null">lightweightName,</if>
<if test="gisJson != null">gis_json,</if>
<if test="modelStatus != null">model_status,</if>
<if test="modelType != null">model_type,</if>
<if test="fileType != null">file_type,</if>
<if test="fileSize != null">file_size,</if>
<if test="showSand != null">show_sand,</if>
<if test="status != null">status,</if>
<if test="remark != null">remark,</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>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="comId != null">#{comId},</if>
<if test="projectId != null">#{projectId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="modelName != null">#{modelName},</if>
<if test="lightweightName != null">#{lightweightName},</if>
<if test="gisJson != null">#{gisJson},</if>
<if test="modelStatus != null">#{modelStatus},</if>
<if test="modelType != null">#{modelType},</if>
<if test="fileType != null">#{fileType},</if>
<if test="fileSize != null">#{fileSize},</if>
<if test="showSand != null">#{showSand},</if>
<if test="status != null">#{status},</if>
<if test="remark != null">#{remark},</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>
</trim>
</insert>
<update id="updateBimModelInfo" parameterType="BimModelInfo">
update bim_model_info
<trim prefix="SET" suffixOverrides=",">
<if test="comId != null">com_id = #{comId},</if>
<if test="projectId != null">project_id = #{projectId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="modelName != null">model_name = #{modelName},</if>
<if test="lightweightName != null">lightweightName = #{lightweightName},</if>
<if test="gisJson != null">gis_json = #{gisJson},</if>
<if test="modelStatus != null">model_status = #{modelStatus},</if>
<if test="modelType != null">model_type = #{modelType},</if>
<if test="fileType != null">file_type = #{fileType},</if>
<if test="fileSize != null">file_size = #{fileSize},</if>
<if test="showSand != null">show_sand = #{showSand},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="status != null">status = #{status},</if>
<if test="remark != null">remark = #{remark},</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>
</trim>
where model_id = #{modelId}
</update>
<delete id="deleteBimModelInfoByModelId" parameterType="Long">
delete from bim_model_info where model_id = #{modelId}
</delete>
<delete id="deleteBimModelInfoByModelIds" parameterType="String">
delete from bim_model_info where model_id in
<foreach item="modelId" collection="array" open="(" separator="," close=")">
#{modelId}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,115 @@
package com.yanzhu.manage.controller.bim;
import java.util.List;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse;
import com.yanzhu.bim.domain.BimModelInfo;
import com.yanzhu.common.core.utils.StringUtils;
import com.yanzhu.common.core.utils.poi.ExcelUtil;
import com.yanzhu.common.core.web.controller.BaseController;
import com.yanzhu.common.core.web.domain.AjaxResult;
import com.yanzhu.common.core.web.page.TableDataInfo;
import com.yanzhu.common.log.enums.BusinessType;
import com.yanzhu.common.security.annotation.RequiresPermissions;
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.yanzhu.manage.service.IBimModelInfoService;
import com.yanzhu.common.log.annotation.Log;
/**
* BimController
*
* @author yanzhu
* @date 2025-04-02
*/
@RestController
@RequestMapping("/bim/bimModel")
public class BimModelInfoController extends BaseController
{
@Autowired
private IBimModelInfoService bimModelInfoService;
/**
* Bim
*/
@RequiresPermissions("bim:bimModel:list")
@GetMapping("/list")
public TableDataInfo list(BimModelInfo bimModelInfo)
{
startPage();
List<BimModelInfo> list = bimModelInfoService.selectBimModelInfoList(bimModelInfo);
return getDataTable(list);
}
/**
* Bim
*/
@RequiresPermissions("bim:bimModel:export")
@Log(title = "Bim模型", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BimModelInfo bimModelInfo)
{
List<BimModelInfo> list = bimModelInfoService.selectBimModelInfoList(bimModelInfo);
ExcelUtil<BimModelInfo> util = new ExcelUtil<BimModelInfo>(BimModelInfo.class);
util.exportExcel(response, list, "Bim模型数据");
}
/**
* Bim
*/
@RequiresPermissions("bim:bimModel:query")
@GetMapping(value = "/{modelId}")
public AjaxResult getInfo(@PathVariable("modelId") Long modelId)
{
return success(bimModelInfoService.selectBimModelInfoByModelId(modelId));
}
/**
* Bim
*/
@RequiresPermissions("bim:bimModel:add")
@Log(title = "Bim模型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BimModelInfo bimModelInfo)
{
return toAjax(bimModelInfoService.insertBimModelInfo(bimModelInfo));
}
/**
* Bim
*/
@RequiresPermissions("bim:bimModel:edit")
@Log(title = "Bim模型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BimModelInfo bimModelInfo)
{
return toAjax(bimModelInfoService.updateBimModelInfo(bimModelInfo));
}
/**
* Bim
*/
@RequiresPermissions("bim:bimModel:remove")
@Log(title = "Bim模型", businessType = BusinessType.DELETE)
@DeleteMapping("/{modelIds}")
public AjaxResult remove(@PathVariable Long[] modelIds)
{
return toAjax(bimModelInfoService.deleteBimModelInfoByModelIds(modelIds));
}
@RequiresPermissions("bim:bimModel:add")
@PostMapping("/checkLightweightName")
public AjaxResult checkLightweightName(@RequestBody List<String> lightweightNames){
List<String> list=bimModelInfoService.selectBimModelInfoList(new BimModelInfo())
.stream().map(d->d.getLightweightName()).filter(d-> StringUtils.isNotEmpty(d)).collect(Collectors.toList());
List<String> result=lightweightNames.stream().filter(d->!list.contains(d)).collect(Collectors.toList());
return AjaxResult.success(result);
}
}

View File

@ -0,0 +1,62 @@
package com.yanzhu.manage.service;
import com.yanzhu.bim.domain.BimModelInfo;
import java.util.List;
/**
* BimService
*
* @author yanzhu
* @date 2025-04-02
*/
public interface IBimModelInfoService
{
/**
* Bim
*
* @param modelId Bim
* @return Bim
*/
public BimModelInfo selectBimModelInfoByModelId(Long modelId);
/**
* Bim
*
* @param bimModelInfo Bim
* @return Bim
*/
public List<BimModelInfo> selectBimModelInfoList(BimModelInfo bimModelInfo);
/**
* Bim
*
* @param bimModelInfo Bim
* @return
*/
public int insertBimModelInfo(BimModelInfo bimModelInfo);
/**
* Bim
*
* @param bimModelInfo Bim
* @return
*/
public int updateBimModelInfo(BimModelInfo bimModelInfo);
/**
* Bim
*
* @param modelIds Bim
* @return
*/
public int deleteBimModelInfoByModelIds(Long[] modelIds);
/**
* Bim
*
* @param modelId Bim
* @return
*/
public int deleteBimModelInfoByModelId(Long modelId);
}

View File

@ -0,0 +1,101 @@
package com.yanzhu.manage.service.impl;
import com.yanzhu.bim.domain.BimModelInfo;
import com.yanzhu.bim.mapper.BimModelInfoMapper;
import com.yanzhu.common.core.context.SecurityContextHolder;
import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.manage.service.IBimModelInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* BimService
*
* @author yanzhu
* @date 2025-04-02
*/
@Service
public class BimModelInfoServiceImpl implements IBimModelInfoService
{
@Autowired
private BimModelInfoMapper bimModelInfoMapper;
/**
* Bim
*
* @param modelId Bim
* @return Bim
*/
@Override
public BimModelInfo selectBimModelInfoByModelId(Long modelId)
{
return bimModelInfoMapper.selectBimModelInfoByModelId(modelId);
}
/**
* Bim
*
* @param bimModelInfo Bim
* @return Bim
*/
@Override
public List<BimModelInfo> selectBimModelInfoList(BimModelInfo bimModelInfo)
{
return bimModelInfoMapper.selectBimModelInfoList(bimModelInfo);
}
/**
* Bim
*
* @param bimModelInfo Bim
* @return
*/
@Override
public int insertBimModelInfo(BimModelInfo bimModelInfo)
{
bimModelInfo.setCreateBy(SecurityContextHolder.getUserName());
bimModelInfo.setCreateTime(DateUtils.getNowDate());
return bimModelInfoMapper.insertBimModelInfo(bimModelInfo);
}
/**
* Bim
*
* @param bimModelInfo Bim
* @return
*/
@Override
public int updateBimModelInfo(BimModelInfo bimModelInfo)
{
bimModelInfo.setUpdateBy(SecurityContextHolder.getUserName());
bimModelInfo.setUpdateTime(DateUtils.getNowDate());
return bimModelInfoMapper.updateBimModelInfo(bimModelInfo);
}
/**
* Bim
*
* @param modelIds Bim
* @return
*/
@Override
public int deleteBimModelInfoByModelIds(Long[] modelIds)
{
return bimModelInfoMapper.deleteBimModelInfoByModelIds(modelIds);
}
/**
* Bim
*
* @param modelId Bim
* @return
*/
@Override
public int deleteBimModelInfoByModelId(Long modelId)
{
return bimModelInfoMapper.deleteBimModelInfoByModelId(modelId);
}
}

View File

@ -0,0 +1,18 @@
import axios from "axios";
import bimCfg from "./bimCfg";
import { pa } from "element-plus/es/locales.mjs";
export function queryModels() {
return axios({
method: "get",
url: bimCfg.BimServer + "/api/app/model/complete-transcoding",
headers: {
"Content-Type": "application/json",
Token: bimCfg.Token,
},
params: {
PageIndex: 0,
MaxResultCount: 100,
},
});
}

View File

@ -0,0 +1,5 @@
export default {
Token:
"cbe8c300dfb0280d71bf6546087c6d2fa49260085f53fca8e5bdce7cde8509800e60acd60891a0dfaedaed48706cede62c884a84004218a7c2eb3de18b4f3783258c47f45b34485a2edb350010e2f42cd5b388af45c6b070850288d284cbbbcda2d085ba47169a7d4fc79609ffbef2dc54455448c112333d4b48d4870843cd1a156822f418515a2ad17683749ba4ff5118ae3f686e966fbfdd71fd75e0bbc3738a94867b381ae88ecd6668e8ca6b6d286dce7e5d799b0a175d5afe5554a4332203e774bed8a04535067c9aac0a18108055b1db541f70363b277050951ab91fcbccd8329463d92cd2f81b95abdf8d437c4965454914fcc7b07d28062bc2976948356e76d9d11fd5b479eb391b46cc93e66da10e0ba1fed735c8b1b1f086973f6152b6a2299e3e22c9cc8c33b16ea71cc03013404ec41c18c9cc748e652ce16fe7061c32d550edfda330c1555e0c08e51f698f96b91615d8220acd9cb22f32e9757681487e0680adfbfacb9b5d2ce5a13b664d8466043270f9f3bde6ac6a05cf25ab0ccc0659a290c9669997be7ccc0086c3d61f7cf5f649cb25f0dbad9f7f66e3165cad25065145affac91bea061f4ff485af667dd7ebaf4baeea64611acbe5c74018be5a8b704fcd4f53d18504940411fac91bea061f4ff49a2f853c245297edc3d61f7cf5f649cb0f9b84173857a7b67c27928b58b4a6a65f517a43f106335e8b1d5c423a171723ffa04d0ac4e5c1a1853fcb2bc95ee8056cd5b4826fa55926733ef859a5f169e6afafd0506174e86864d53d967da98ab0b0e08d14be6d452c6c69755ac3a391993370a029761da893cfbf575da87c6b5ca602467b79c6c9532f438aaafb9ec915692f0287a8db979969e5635404d6fdfb753151533a277044afdd825f7197f2896c69755ac3a391993370a029761da893af24d88c02bccfae6cd5b4826fa55926f7722b78090b30b986f9287101582d8841187054ec673ebd2042f9836ea453c3afafd0506174e86800225b7f4102e3585b1923cb186fe0ceee54c6f17ab8555da26ecd334722494fc515b205e9624a4494c772ef4f023a606882e118fa6321c24ddee4821c840fb56aac929d6d0a052d5ff97d71e43811db939f7340826236af6f10316a04bf618d494a26e0fd06f7daa07177989e1680a4cf14829a5847f70377d6c12f1649400fcab44f4ff52989cf129aa6cca660be152a75b8e35648925dbce381b345d9e137c04a02a4c8252625f5625eed58fd34b7be4266e54212e88b23f012bead9abaef9e18aa308f0ecffaf3dda7d7b4efd2e0c4b8de161864620fc1f2af98bde031b29e0865381c96bbc10921b48a068558915ff023d18526f5d399e0893df43db7122415d52565dc982ea24fbd825734dbaefadc6df0f19d925c7f63d343a622134b1c934d130d662447add19064adbbb2fd24a82c0fbfcbc3175fc32761df099156daf4e86455740207eb4e4a5300d9c1a17ffd43703d476c36ef07df2206bd8d232b844ff3c1d7cf7c47ec502183af4e27b644d89a77efad286dee59796b124081510f8a6ea5c1dff9c3d61f7cf5f649cb25f0dbad9f7f66e3e0e7c3406ae4dd4eebc424f09f933d0eb1a881ed05ca8d5c70958237eb5b91d4e574440ea0c9179a582dc966bcfc1f21cf3630a2823a9a2d22bd09a00b213aae3866768ae2f24dde6784fbf292c2cba136689b286e75a81e016aa63061505f57a8c1113b833628e3a18dff8ae8ac8eaa7a4fba6045bc9b4b",
BimServer: "http://szgc.jhncidg.com/mapmodel",
};

View File

@ -0,0 +1,52 @@
import request from "@/utils/request";
// 查询Bim模型列表
export function listBimModel(query) {
return request({
url: "/manage/bim/bimModel/list",
method: "get",
params: query,
});
}
// 查询Bim模型详细
export function getBimModel(modelId) {
return request({
url: "/manage/bim/bimModel/" + modelId,
method: "get",
});
}
// 新增Bim模型
export function addBimModel(data) {
return request({
url: "/manage/bim/bimModel",
method: "post",
data: data,
});
}
// 修改Bim模型
export function updateBimModel(data) {
return request({
url: "/manage/bim/bimModel",
method: "put",
data: data,
});
}
// 删除Bim模型
export function delBimModel(modelId) {
return request({
url: "/manage/bim/bimModel/" + modelId,
method: "delete",
});
}
export function checkLightweightName(data) {
return request({
url: "/manage/bim/bimModel/checkLightweightName",
method: "post",
data: data,
});
}

View File

@ -0,0 +1,311 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px"
:key="data.elKey">
<el-form-item label="项目名称" prop="projectId">
<el-select v-model="queryParams.projectId" clearable :disabled="data.currentPrjId ? true : false" filterable
placeholder="请选择所属项目" style="width: 200px" @change="queryProjectChange">
<el-option v-for="item in data.projects" :key="item.id" :label="item.projectName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="所属单位" prop="deptId">
<el-select v-model="queryParams.deptId" clearable filterable placeholder="请选择所属单位" style="width: 200px">
<el-option v-for="item in data.subDepts" :key="item.id" :label="item.subDeptName" :value="item.id">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="模型名称" prop="modelName">
<el-input v-model="queryParams.modelName" placeholder="请输入模型名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @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="Plus" v-if="data.isAdmin" @click="handleAdd"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="bimModelList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="${comment}" align="center" prop="modelId" />
<el-table-column label="租户id" align="center" prop="comId" />
<el-table-column label="项目id" align="center" prop="projectId" />
<el-table-column label="单位id" align="center" prop="deptId" />
<el-table-column label="模型名称" align="center" prop="modelName" />
<el-table-column label="轻量化名称" align="center" prop="lightweightNam lightweightName" />
<el-table-column label="api服务返回的json" align="center" prop="gisJson" />
<el-table-column label="轻量化状态" align="center" prop="modelStatus" />
<el-table-column label="模型类型" align="center" prop="modelType" />
<el-table-column label="模型文件类型" align="center" prop="fileType" />
<el-table-column label="文件大小" align="center" prop="fileSize" />
<el-table-column label="是否在沙盘显示0不显示1显示" align="center" prop="showSand" />
<el-table-column label="${comment}" align="center" prop="status" />
<el-table-column label="${comment}" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
v-hasPermi="['bim:bimModel:edit']">修改</el-button>
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
v-hasPermi="['bim:bimModel:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize" @pagination="getList" />
<!-- 添加或修改Bim模型对话框 -->
<el-dialog :title="title" v-model="open" width="600px" append-to-body>
<div style="line-height: 60px;">
<el-button type="primary" @click="selectModelHandler"></el-button>
</div>
<el-form ref="bimModelRef" :model="form" :rules="rules" label-width="100px">
<el-form-item label="所属单位" prop="deptId">
<el-input v-model="form.deptId" placeholder="请输入单位id" />
</el-form-item>
<el-form-item label="模型名称" prop="modelName">
<el-input v-model="form.modelName" placeholder="请输入模型名称" />
</el-form-item>
<el-form-item label="轻量化名称" prop="lightweightNam lightweightName">
<el-input v-model="form.lightweightName" placeholder="请输入轻量化名称" />
</el-form-item>
<el-form-item label="api服务返回的json" prop="gisJson">
<el-input v-model="form.gisJson" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="文件大小" prop="fileSize">
<el-input v-model="form.fileSize" placeholder="请输入文件大小" />
</el-form-item>
<el-form-item label="是否在沙盘显示0不显示1显示" prop="showSand">
<el-input v-model="form.showSand" placeholder="请输入是否在沙盘显示0不显示1显示" />
</el-form-item>
<el-form-item label="${comment}" prop="remark">
<el-input v-model="form.remark" placeholder="请输入${comment}" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
<modelSelectDialog ref="selDlg" />
</div>
</template>
<script setup name="BimModel">
import { listBimModel, getBimModel, delBimModel, addBimModel, updateBimModel } from "@/api/bim/bimModel";
import { listProProjectInfoSubdepts } from "@/api/manage/proProjectInfoSubdepts";
import { findMyProjectList } from "@/api/publics";
import useUserStore from '@/store/modules/user'
import { onMounted } from "vue";
import modelSelectDialog from './modelSelectDialog.vue'
const { proxy } = getCurrentInstance();
const userStore = useUserStore()
const bimModelList = ref([]);
const open = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
const selDlg = ref();
const data = reactive({
form: {},
queryParams: {
pageNum: 1,
pageSize: 10,
comId: null,
projectId: null,
deptId: null,
modelName: null,
lightweightName: null,
gisJson: null,
modelStatus: null,
modelType: null,
fileType: null,
fileSize: null,
showSand: null,
status: null,
},
rules: {
comId: [
{ required: true, message: "租户id不能为空", trigger: "blur" }
],
projectId: [
{ required: true, message: "项目id不能为空", trigger: "blur" }
],
deptId: [
{ required: true, message: "单位id不能为空", trigger: "blur" }
],
},
isAdmin: false,
projects: [],
currentPrjId: null,
subDepts: [],
});
const { queryParams, form, rules } = toRefs(data);
function selectModelHandler() {
selDlg.value.showDialog();
}
/** 查询Bim模型列表 */
function getList() {
loading.value = true;
listBimModel(queryParams.value).then(response => {
bimModelList.value = response.rows;
total.value = response.total;
loading.value = false;
});
}
//
function cancel() {
open.value = false;
reset();
}
//
function reset() {
form.value = {
modelId: null,
comId: null,
projectId: null,
deptId: null,
modelName: null,
lightweightName: null,
gisJson: null,
modelStatus: null,
modelType: null,
fileType: null,
fileSize: null,
showSand: null,
status: null,
remark: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null
};
proxy.resetForm("bimModelRef");
}
/** 搜索按钮操作 */
function handleQuery() {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
function resetQuery() {
proxy.resetForm("queryRef");
handleQuery();
}
//
function handleSelectionChange(selection) {
ids.value = selection.map(item => item.modelId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
function handleAdd() {
reset();
open.value = true;
title.value = "添加Bim模型";
}
/** 修改按钮操作 */
function handleUpdate(row) {
reset();
const _modelId = row.modelId || ids.value
getBimModel(_modelId).then(response => {
form.value = response.data;
open.value = true;
title.value = "修改Bim模型";
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["bimModelRef"].validate(valid => {
if (valid) {
if (form.value.modelId != null) {
updateBimModel(form.value).then(response => {
proxy.$modal.msgSuccess("修改成功");
open.value = false;
getList();
});
} else {
addBimModel(form.value).then(response => {
proxy.$modal.msgSuccess("新增成功");
open.value = false;
getList();
});
}
}
});
}
/** 删除按钮操作 */
function handleDelete(row) {
const _modelIds = row.modelId || ids.value;
proxy.$modal.confirm('是否确认删除Bim模型编号为"' + _modelIds + '"的数据项?').then(function () {
return delBimModel(_modelIds);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
}).catch(() => { });
}
/** 导出按钮操作 */
function handleExport() {
proxy.download('bim/bimModel/export', {
...queryParams.value
}, `bimModel_${new Date().getTime()}.xlsx`)
}
function queryProjectChange() {
data.subDepts = []
queryParams.value.deptId = "";
if (queryParams.value.projectId) {
getSubDepts(queryParams.value.projectId, res => {
data.subDepts = res;
})
}
}
function getSubDepts(prjId, cb) {
listProProjectInfoSubdepts({ projectId: prjId, pageNum: 1, pageSize: 100, activeTags: "finished" }).then(d => {
let subdepts = d.rows || [];
cb && cb(subdepts);
});
}
/** 查询项目列表 */
function getProjectList() {
findMyProjectList({ pageNum: 1, pageSize: 100 }).then(response => {
data.projects = response.rows;
});
}
onMounted(() => {
queryParams.value.projectId = userStore.currentPrjId;
queryParams.value.comId = userStore.currentComId;
queryParams.value.deptId = '';
data.isAdmin = userStore.isAdmin;
queryProjectChange();
data.currentPrjId = userStore.currentPrjId;
getProjectList();
getList();
});
</script>

View File

@ -0,0 +1,79 @@
<template>
<el-dialog v-model="show" append-to-body :close-on-click-modal="false" :close-on-press-escape="false" title="选择模型"
width="960px" modal-class="model-select-dialog">
<el-table v-loading="loading" :data="modelList" height="50vh" highlight-current-row>
<el-table-column label="模型名" align="center" prop="name" />
<el-table-column label="轻量化名称" align="center" prop="lightweightName" />
<el-table-column label="软件类型" align="center" prop="fileType" />
<el-table-column label="文件大小" align="center" prop="fileSize" />
<el-table-column label="状态" align="center" prop="statusDescription" />
<el-table-column label="DB同步状态" align="center" prop="statusDescription">
<template #default="scope">
<span v-if="scope.row.dbSyncStatus == 2"></span>
<span v-else-if="scope.row.dbSyncStatus == 1">同步失败</span>
<span v-else></span>
</template>
</el-table-column>
</el-table>
<template #footer>
<div class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="show = false"> </el-button>
</div>
</template>
</el-dialog>
</template>
<script>
import { queryModels } from '@/api/bim/bimApi'
import { checkLightweightName, getBimModel, addBimModel, updateBimModel, delBimModel } from '@/api/bim/bimModel'
export default {
data() {
return {
loading: true,
show: false,
modelList: []
}
},
methods: {
showDialog() {
this.show = true;
queryModels().then(d => {
let models = d.data.datas || [];
let modelIds = models.map(it => it.lightweightName);
if (modelIds.length > 0) {
checkLightweightName(modelIds).then(res => {
this.modelList = models.filter(item => res.data.includes(item.lightweightName) && item.fileSize > 0)
this.loading = false;
});
} else {
this.modelList = [];
this.loading = false;
}
});
},
submitForm() {
}
}
}
</script>
<style lang="scss">
.model-select-dialog {
td {
cursor: pointer;
}
.el-table__body tr.current-row>td.el-table__cell {
background: rgb(30, 144, 255);
color: #fff;
}
.dialog-footer {
text-align: center;
}
}
</style>

View File

@ -1,10 +1,11 @@
<template> <template>
<div class="app-container home"> <div class="app-container home">
<Demo />
</div> </div>
</template> </template>
<script setup name="Index"> <script setup name="Index">
import Demo from './demo.vue'
const version = ref('3.6.3') const version = ref('3.6.3')
function goTarget(url) { function goTarget(url) {
@ -20,12 +21,14 @@ function goTarget(url) {
font-size: 17.5px; font-size: 17.5px;
border-left: 5px solid #eee; border-left: 5px solid #eee;
} }
hr { hr {
margin-top: 20px; margin-top: 20px;
margin-bottom: 20px; margin-bottom: 20px;
border: 0; border: 0;
border-top: 1px solid #eee; border-top: 1px solid #eee;
} }
.col-item { .col-item {
margin-bottom: 20px; margin-bottom: 20px;
} }
@ -35,7 +38,11 @@ function goTarget(url) {
margin: 0; margin: 0;
} }
font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: "open sans",
"Helvetica Neue",
Helvetica,
Arial,
sans-serif;
font-size: 13px; font-size: 13px;
color: #676a6c; color: #676a6c;
overflow-x: hidden; overflow-x: hidden;
@ -75,4 +82,3 @@ function goTarget(url) {
} }
} }
</style> </style>