开发BIM交底功能
parent
f19dc47e8f
commit
64e18f1e89
|
@ -31,13 +31,6 @@ body{
|
|||
position: relative;
|
||||
overflow: auto;
|
||||
}
|
||||
.login-bgd{
|
||||
position: relative;
|
||||
height: 100%;
|
||||
width:1400px;
|
||||
background: url("../images/login_bgd.png") no-repeat 50%;
|
||||
background-size: cover;
|
||||
}
|
||||
.login-max{
|
||||
height: 100%;
|
||||
position: relative;
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.8 MiB |
Binary file not shown.
Before Width: | Height: | Size: 1.5 MiB |
Binary file not shown.
Before Width: | Height: | Size: 1.4 MiB |
Binary file not shown.
Before Width: | Height: | Size: 2.5 MiB |
Binary file not shown.
Before Width: | Height: | Size: 1.8 MiB |
|
@ -69,28 +69,53 @@ function getProperty(that) {
|
|||
});
|
||||
}
|
||||
|
||||
function getModelUnit(that, modelId) {
|
||||
let find = that.models.find((d) => d.modelId == modelId);
|
||||
return find ? find.unit || 1.0 : 1.0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取构件尺寸信息
|
||||
*/
|
||||
function subFeatureSize(that) {
|
||||
let api = bimBriefingApi;
|
||||
let result = [
|
||||
{ name: "构建尺寸", data: [] },
|
||||
{ name: "构建表面积", data: [] },
|
||||
{ name: "构建体积", data: [] },
|
||||
];
|
||||
that.info = [];
|
||||
api.Public.clearHandler(), api.Measurement.clearAllTrace();
|
||||
api.Feature.getByEvent(true, (n) => {
|
||||
console.log(n);
|
||||
if (n && n["id"]) {
|
||||
let featureId = n.id;
|
||||
let modelId = featureId.split("^")[0];
|
||||
let unit = getModelUnit(that, modelId);
|
||||
clearSelectFeature(that);
|
||||
api.Feature.getGeometrySizeById(featureId, (res) => {
|
||||
let size = res.size || {};
|
||||
that.info = [
|
||||
{ name: "长", value: (size.x || 0).toFixed(2) + "" },
|
||||
{ name: "宽", value: (size.y || 0).toFixed(2) + "" },
|
||||
{ name: "高", value: (size.z || 0).toFixed(2) + "" },
|
||||
let x = (size.x || 0) * unit * 1.0;
|
||||
let y = (size.y || 0) * unit * 1.0;
|
||||
let z = (size.z || 0) * unit * 1.0;
|
||||
result[0].data = [
|
||||
{ name: "长", value: x.toFixed(2) + "" },
|
||||
{ name: "宽", value: y.toFixed(2) + "" },
|
||||
{ name: "高", value: z.toFixed(2) + "" },
|
||||
];
|
||||
result[1].data = [{ name: "面积", value: (x * y).toFixed(2) + "" }];
|
||||
result[2].data = [{ name: "体积", value: (x * y * z).toFixed(2) }];
|
||||
api.Feature.setColor(featureId, "rgba(255,0,255,1)", modelId);
|
||||
that.selFeatureId = featureId;
|
||||
that.info = result;
|
||||
// api.Measurement.featureArea(featureId, (res) => {
|
||||
// result[1].data = [{ name: "面积", value: ((+res || 0) * unit * unit * 1.0).toFixed(2) + "" }];
|
||||
// api.Measurement.featureVolume(featureId, (res) => {
|
||||
// result[2].data = [{ name: "体积", value: ((+res || 0) * unit * unit * unit * 1.0).toFixed(2) }];
|
||||
// api.Feature.setColor(featureId, "rgba(255,0,255,1)", modelId);
|
||||
// that.selFeatureId = featureId;
|
||||
// that.info=result
|
||||
// });
|
||||
// });
|
||||
});
|
||||
}
|
||||
});
|
||||
|
@ -107,9 +132,7 @@ function measurementArea(that) {
|
|||
let modelId = featureId.split("^")[0];
|
||||
clearSelectFeature(that);
|
||||
api.Measurement.featureArea(featureId, (res) => {
|
||||
that.info = [
|
||||
{ name: "面积", value: (+res || 0).toFixed(2) + "" }
|
||||
];
|
||||
that.info = [{ name: "面积", value: (+res || 0).toFixed(2) + "" }];
|
||||
api.Feature.setColor(featureId, "rgba(255,0,255,1)", modelId);
|
||||
that.selFeatureId = featureId;
|
||||
});
|
||||
|
@ -118,23 +141,15 @@ function measurementArea(that) {
|
|||
}
|
||||
|
||||
//构件体积
|
||||
function measuringVolume(that){
|
||||
|
||||
}
|
||||
function measuringVolume(that) {}
|
||||
//构件距离
|
||||
function distance(that){
|
||||
|
||||
}
|
||||
function distance(that) {}
|
||||
|
||||
//剖切
|
||||
function initClipping(that){
|
||||
|
||||
}
|
||||
function initClipping(that) {}
|
||||
|
||||
//构件隐藏
|
||||
function actorVisible(){
|
||||
|
||||
}
|
||||
function actorVisible() {}
|
||||
|
||||
export default {
|
||||
measurementArea,
|
||||
|
|
|
@ -67,13 +67,23 @@
|
|||
</template>
|
||||
<template v-if="selectMenu == 1 || selectMenu == 2">
|
||||
<div class="info-list">
|
||||
<table class="model-property-table my-table" v-if="info.length > 0">
|
||||
<tr v-for="(item, index) in info" :key="index">
|
||||
<th width="50%">{{ item.name }}</th>
|
||||
<td width="50%">{{ item.value }}</td>
|
||||
<div v-for="(item, index) in info" :key="index">
|
||||
<div class="group-info">
|
||||
<svg-icon icon-class="info" />
|
||||
<span>{{ item.name }}</span>
|
||||
</div>
|
||||
<table class="model-property-table my-table">
|
||||
<tr v-for="(item2, index2) in item.data" :key="index2+'-'+index">
|
||||
<th width="50%">{{ item2.name }}</th>
|
||||
<td width="50%">{{ item2.value }}
|
||||
<span v-if="index==0">米</span>
|
||||
<span v-if="index==1">米<sup>2</sup></span>
|
||||
<span v-if="index==2">米<sup>3</sup></span>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -116,14 +126,14 @@
|
|||
</div>
|
||||
|
||||
<div class="tool-item" :class="{ 'is-selected': selectMenu == 1 }" @click="doSelectMenu(1)">
|
||||
<el-tooltip content="构建尺寸" placement="top">
|
||||
<el-tooltip content="构建测量" placement="top">
|
||||
<div class="icon">
|
||||
<svg-icon icon-class="size2" />
|
||||
</div>
|
||||
</el-tooltip>
|
||||
</div>
|
||||
|
||||
<div class="tool-item" :class="{ 'is-selected': selectMenu == 2 }" @click="doSelectMenu(2)">
|
||||
<div class="tool-item" :class="{ 'is-selected': selectMenu == 2 }" @click="doSelectMenu(2)" v-if="1==2">
|
||||
<el-tooltip content="构建面积" placement="top">
|
||||
<div class="icon">
|
||||
<svg-icon icon-class="area2" />
|
||||
|
@ -131,7 +141,7 @@
|
|||
</el-tooltip>
|
||||
</div>
|
||||
|
||||
<div class="tool-item" :class="{ 'is-selected': selectMenu == 3 }" @click="doSelectMenu(3)">
|
||||
<div class="tool-item" :class="{ 'is-selected': selectMenu == 3 }" @click="doSelectMenu(3)" v-if="1==2">
|
||||
<el-tooltip content="构建体积" placement="top">
|
||||
<div class="icon">
|
||||
<svg-icon icon-class="volume" />
|
||||
|
@ -238,7 +248,7 @@ export default {
|
|||
break;
|
||||
case 1:
|
||||
briefingTools.subFeatureSize(this);
|
||||
this.title = "尺寸测量";
|
||||
this.title = "构建测量";
|
||||
break;
|
||||
case 2:
|
||||
briefingTools.measurementArea(this);
|
||||
|
@ -446,6 +456,7 @@ export default {
|
|||
this.models
|
||||
.map((d) => {
|
||||
d.gis = JSON.parse(d.gisJson);
|
||||
d.modelId = d.lightweightName;
|
||||
return d;
|
||||
})
|
||||
.forEach((d) => {
|
||||
|
@ -601,7 +612,7 @@ export default {
|
|||
position: absolute;
|
||||
top: calc(80vh - 50px);
|
||||
left: 50%;
|
||||
margin-left: -200px;
|
||||
margin-left: -150px;
|
||||
display: flex;
|
||||
background: #00000080;
|
||||
border-radius: 10px;
|
||||
|
|
|
@ -1019,6 +1019,7 @@ export default {
|
|||
position: absolute;
|
||||
top: calc(80vh - 50px);
|
||||
left: 50%;
|
||||
margin-left:-170px;
|
||||
display: flex;
|
||||
background: #00000080;
|
||||
border-radius: 10px;
|
||||
|
|
|
@ -54,6 +54,9 @@ public class BimModelInfo extends BaseEntity
|
|||
@Excel(name = "模型文件类型")
|
||||
private String fileType;
|
||||
|
||||
@Excel(name = "单位")
|
||||
private Double unit;
|
||||
|
||||
/** 文件大小 */
|
||||
@Excel(name = "文件大小")
|
||||
private Long fileSize;
|
||||
|
@ -65,6 +68,14 @@ public class BimModelInfo extends BaseEntity
|
|||
private String projectName;
|
||||
private String deptName;
|
||||
|
||||
public Double getUnit() {
|
||||
return unit;
|
||||
}
|
||||
|
||||
public void setUnit(Double unit) {
|
||||
this.unit = unit;
|
||||
}
|
||||
|
||||
public String getComName() {
|
||||
return comName;
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="modelType" column="model_type" />
|
||||
<result property="fileType" column="file_type" />
|
||||
<result property="fileSize" column="file_size" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="showSand" column="show_sand" />
|
||||
<result property="status" column="status" />
|
||||
<result property="isDel" column="is_del"/>
|
||||
|
@ -32,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<sql id="selectBimModelInfoVo">
|
||||
select bmi.model_id, bmi.com_id, bmi.project_id,
|
||||
sp.dept_name projectName,
|
||||
sd.dept_name com_name,pd.sub_dept_name dept_name,
|
||||
sd.dept_name com_name,pd.sub_dept_name dept_name,bmi.unit,
|
||||
bmi.dept_id, bmi.model_name, bmi.lightweightName, bmi.gis_json, bmi.model_status, bmi.model_type,
|
||||
bmi.file_type, bmi.file_size, bmi.show_sand, bmi.status, bmi.remark, bmi.create_by, bmi.create_time, bmi.update_by, bmi.update_time,bmi.is_del
|
||||
from bim_model_info bmi
|
||||
|
@ -78,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="modelType != null">model_type,</if>
|
||||
<if test="fileType != null">file_type,</if>
|
||||
<if test="fileSize != null">file_size,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="showSand != null">show_sand,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
|
@ -97,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="modelType != null">#{modelType},</if>
|
||||
<if test="fileType != null">#{fileType},</if>
|
||||
<if test="fileSize != null">#{fileSize},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="showSand != null">#{showSand},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
|
@ -120,6 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<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="unit != null">unit = #{unit},</if>
|
||||
<if test="showSand != null">show_sand = #{showSand},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
|
|
|
@ -319,6 +319,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
pro_project_info_subdepts_users
|
||||
WHERE
|
||||
use_status = 0
|
||||
and approve_status >= 100
|
||||
<if test="comId != null">and com_id = #{comId}</if>
|
||||
<if test="projectId != null">and project_id = #{projectId}</if>
|
||||
GROUP BY
|
||||
|
|
|
@ -40,8 +40,9 @@
|
|||
<el-table-column label="轻量化名称" align="center" prop="lightweightName" />
|
||||
<el-table-column label="模型类型" align="center" prop="modelType" />
|
||||
<el-table-column label="模型文件类型" align="center" prop="fileType" />
|
||||
<el-table-column label="模型尺寸单位" align="center" prop="unitStr" />
|
||||
<el-table-column label="文件大小" align="center" prop="fileSize">
|
||||
<template #default="scope">{{scope.row.fileSize?toSize(scope.row.fileSize):'-'}}</template>
|
||||
<template #default="scope">{{ scope.row.fileSize ? toSize(scope.row.fileSize) : "-" }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否在沙盘显示" align="center" prop="showSand">
|
||||
<template #default="scope">
|
||||
|
@ -67,8 +68,8 @@
|
|||
</el-select>
|
||||
|
||||
</el-form-item> -->
|
||||
<div style="margin-bottom:10px;">
|
||||
<el-button type="primary" style="margin-left:20px;" @click="selectModelHandler">从模型服务器选择模型</el-button>
|
||||
<div style="margin-bottom: 10px">
|
||||
<el-button type="primary" style="margin-left: 20px" @click="selectModelHandler">从模型服务器选择模型</el-button>
|
||||
</div>
|
||||
<el-form-item label="模型名称" prop="modelName">
|
||||
<el-input v-model="form.modelName" disabled placeholder="请输入模型名称" />
|
||||
|
@ -82,6 +83,10 @@
|
|||
<el-form-item label="在沙盘显示" prop="sand">
|
||||
<el-switch v-model="form.sand" size="large" active-text="显示" inactive-text="隐藏" />
|
||||
</el-form-item>
|
||||
<el-form-item label="模型尺寸单位" prop="unit">
|
||||
<el-select v-model="form.unit" placeholder="请选择模型尺寸单位" style="width: 200px"> <el-option v-for="item in unitInfos" :key="item.value" :label="item.label" :value="item.value"></el-option> </el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="备注说明" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
|
@ -100,30 +105,38 @@
|
|||
</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'
|
||||
import uploadModelDialog from './uploadModelDialog.vue'
|
||||
import modelDialog from './modelDialog2.vue'
|
||||
import { fileSize } from '@/utils'
|
||||
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 uploadDlg = ref()
|
||||
const mDlg = ref()
|
||||
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";
|
||||
import uploadModelDialog from "./uploadModelDialog.vue";
|
||||
import modelDialog from "./modelDialog2.vue";
|
||||
import { fileSize } from "@/utils";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const unitInfos = [
|
||||
{ value: 1, label: "米" },
|
||||
{ value: 0.1, label: "分米" },
|
||||
{ value: 0.01, label: "厘米" },
|
||||
{ value: 0.001, label: "毫米" },
|
||||
{ value: 0.0001, label: "微米" },
|
||||
{ value: 0.0254, label: "英寸" },
|
||||
{ value: 1000, label: "千米" },
|
||||
];
|
||||
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 uploadDlg = ref();
|
||||
const mDlg = ref();
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
|
@ -143,59 +156,63 @@ const data = reactive({
|
|||
status: null,
|
||||
},
|
||||
rules: {
|
||||
comId: [{ required: true, message: '租户id不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目id不能为空', trigger: 'blur' }],
|
||||
comId: [{ required: true, message: "租户id不能为空", trigger: "blur" }],
|
||||
projectId: [{ required: true, message: "项目id不能为空", trigger: "blur" }],
|
||||
},
|
||||
isAdmin: false,
|
||||
projects: [],
|
||||
currentPrjId: null,
|
||||
subDepts: [],
|
||||
selModel: null,
|
||||
})
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
function showModel(row) {
|
||||
mDlg.value.showDialog(JSON.parse(row.gisJson))
|
||||
mDlg.value.showDialog(JSON.parse(row.gisJson));
|
||||
}
|
||||
function toSize(size) {
|
||||
return fileSize(size)
|
||||
return fileSize(size);
|
||||
}
|
||||
function doModelSelect(model) {
|
||||
data.selModel = model
|
||||
form.value.modelName = model.name
|
||||
form.value.lightweightName = model.lightweightName
|
||||
form.value.fileSize = model.fileSize
|
||||
form.value.gisJson = JSON.stringify(model)
|
||||
form.value.fileType = model.fileType
|
||||
form.value.modelType = model.softwareType
|
||||
form.value.modelStatus = model.status
|
||||
form.value.sand = true
|
||||
data.selModel = model;
|
||||
form.value.modelName = model.name;
|
||||
form.value.lightweightName = model.lightweightName;
|
||||
form.value.fileSize = model.fileSize;
|
||||
form.value.gisJson = JSON.stringify(model);
|
||||
form.value.fileType = model.fileType;
|
||||
form.value.modelType = model.softwareType;
|
||||
form.value.modelStatus = model.status;
|
||||
form.value.sand = true;
|
||||
}
|
||||
//上传模型
|
||||
function handleUpload() {
|
||||
//uploadDlg.value.showDialog()
|
||||
uploadDlg.value.show()
|
||||
uploadDlg.value.show();
|
||||
}
|
||||
function selectModelHandler() {
|
||||
selDlg.value.showDialog()
|
||||
selDlg.value.showDialog();
|
||||
}
|
||||
/** 查询Bim模型列表 */
|
||||
function getList() {
|
||||
loading.value = true
|
||||
loading.value = true;
|
||||
listBimModel(queryParams.value).then((response) => {
|
||||
bimModelList.value = (response.rows || []).map((it) => {
|
||||
it.sand = it.showSand == 1
|
||||
return it
|
||||
})
|
||||
total.value = response.total
|
||||
loading.value = false
|
||||
})
|
||||
it.sand = it.showSand == 1;
|
||||
it.unit = it.unit || 1;
|
||||
let obj = unitInfos.find((it2) => it2.value == it.unit);
|
||||
it.unitStr = obj ? obj.label : "米";
|
||||
it.unit = obj ? obj.value : 1;
|
||||
return it;
|
||||
});
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false
|
||||
reset()
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
|
@ -219,131 +236,136 @@ function reset() {
|
|||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
}
|
||||
proxy.resetForm('bimModelRef')
|
||||
};
|
||||
proxy.resetForm("bimModelRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1
|
||||
getList()
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm('queryRef')
|
||||
handleQuery()
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map((item) => item.modelId)
|
||||
single.value = selection.length != 1
|
||||
multiple.value = !selection.length
|
||||
ids.value = selection.map((item) => item.modelId);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset()
|
||||
open.value = true
|
||||
reset();
|
||||
open.value = true;
|
||||
if (data.subDepts.length > 0) {
|
||||
form.value.deptId = data.subDepts[0].id
|
||||
form.value.deptId = data.subDepts[0].id;
|
||||
} else {
|
||||
form.value.deptId = null
|
||||
form.value.deptId = null;
|
||||
}
|
||||
form.value.comId = userStore.currentComId
|
||||
form.value.projectId = data.currentPrjId
|
||||
title.value = '添加Bim模型'
|
||||
form.value.comId = userStore.currentComId;
|
||||
form.value.projectId = data.currentPrjId;
|
||||
title.value = "添加Bim模型";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset()
|
||||
const _modelId = row.modelId || ids.value
|
||||
reset();
|
||||
const _modelId = row.modelId || ids.value;
|
||||
getBimModel(_modelId).then((response) => {
|
||||
form.value = response.data
|
||||
open.value = true
|
||||
title.value = '修改Bim模型'
|
||||
})
|
||||
let it = response.data;
|
||||
form.value = it;
|
||||
form.value.unit = it.unit || 1;
|
||||
let obj = unitInfos.find((it2) => it2.value == it.unit);
|
||||
form.value.unitStr = obj ? obj.label : "米";
|
||||
form.value.unit = obj ? obj.value : 1;
|
||||
open.value = true;
|
||||
title.value = "修改Bim模型";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs['bimModelRef'].validate((valid) => {
|
||||
proxy.$refs["bimModelRef"].validate((valid) => {
|
||||
if (valid) {
|
||||
form.value.showSand = form.value.sand ? 1 : 0
|
||||
form.value.showSand = form.value.sand ? 1 : 0;
|
||||
if (form.value.modelId != null) {
|
||||
updateBimModel(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('修改成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addBimModel(form.value).then((response) => {
|
||||
proxy.$modal.msgSuccess('新增成功')
|
||||
open.value = false
|
||||
getList()
|
||||
})
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _modelIds = row.modelId || ids.value
|
||||
const _modelIds = row.modelId || ids.value;
|
||||
proxy.$modal
|
||||
.confirm('是否确认删除Bim模型编号为"' + _modelIds + '"的数据项?')
|
||||
.then(function () {
|
||||
return delBimModel(_modelIds)
|
||||
return delBimModel(_modelIds);
|
||||
})
|
||||
.then(() => {
|
||||
getList()
|
||||
proxy.$modal.msgSuccess('删除成功')
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
'bim/bimModel/export',
|
||||
"bim/bimModel/export",
|
||||
{
|
||||
...queryParams.value,
|
||||
},
|
||||
`bimModel_${new Date().getTime()}.xlsx`
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
function queryProjectChange() {
|
||||
data.subDepts = []
|
||||
queryParams.value.deptId = ''
|
||||
data.subDepts = [];
|
||||
queryParams.value.deptId = "";
|
||||
if (queryParams.value.projectId) {
|
||||
getSubDepts(queryParams.value.projectId, (res) => {
|
||||
data.subDepts = 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)
|
||||
})
|
||||
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
|
||||
})
|
||||
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()
|
||||
})
|
||||
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>
|
||||
|
|
|
@ -94,13 +94,11 @@ export default {
|
|||
devices: [],
|
||||
positionByModalId: "",
|
||||
selItem: null,
|
||||
iconVideo: "",
|
||||
addLabels: [],
|
||||
viewPoint:null,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.iconVideo = icons["video"];
|
||||
emitter.on("routeChanged", ({ to, from }) => {
|
||||
if (to.name === "SandTableSetting") {
|
||||
this.initEngine();
|
||||
|
|
Loading…
Reference in New Issue