whx 7 月之前
父節點
當前提交
635928611e

+ 38 - 0
virgo.wzfrontend/console/src/bimAttribute/index.js

@@ -0,0 +1,38 @@
+/*
+    自定义模态框组件
+    调用
+    model.show();
+    model.close();
+*/
+import Vue from 'vue'
+import model from './index.vue'
+let _MODEL = {
+	component: null
+};
+const createModel = (isShow, arg) => {
+	let modelCompoent = Vue.extend(model);
+	_MODEL.component = new modelCompoent();
+	let element = _MODEL.component.$mount().$el;
+	document.body.appendChild(element);
+	if (arg) {
+		_MODEL.component.bimintegrateid = arg.bimIntegrateId;
+		_MODEL.component.fileid = arg.fileId;
+		_MODEL.component.objectid = arg.objectId;
+	}
+	_MODEL.component.show = _MODEL.show = isShow;
+}
+export default {
+	show(arg) {
+		if (!_MODEL.component) return createModel(true, arg);
+		if (_MODEL.component.show) return;
+		_MODEL.component.show = _MODEL.show = true;
+		_MODEL.component.bimintegrateid = arg.bimIntegrateId;
+		_MODEL.component.fileid = arg.fileId;
+		_MODEL.component.objectid = arg.objectId;
+	},
+	close() {
+		if (!_MODEL.component) return createModel(false);
+		if (!_MODEL.component.show) return;
+		_MODEL.component.show = _MODEL.show = false;
+	}
+}

+ 464 - 0
virgo.wzfrontend/console/src/bimAttribute/index.vue

@@ -0,0 +1,464 @@
+<template>
+	<div class="bim-attribute color-font" v-show="show">
+		<div class="bim-attribute-box">
+			<div class="bim-attribute-view hui-flex">
+				<div class="bim-attribute-title">
+					<div class="hui-title-label">模型属性</div>
+					<div class="hui-title-right">
+						<el-button size="medium" type="primary" v-if="!isUpdate" @click="isUpdate = true">编辑</el-button>
+						<el-button size="medium" type="primary" v-else @click="cancelUpdate">取消编辑</el-button>
+						<i class="iconfont huifont-guanbi" title="关闭" @click="show = false"></i>
+					</div>
+				</div>
+				<div class="hui-flex-box">
+					<div class="bim-attribute-content" v-if="nowItem.group">
+						<div class="bim-attribute-tab">
+							<div :class="nowItem.group === node.group ? 'attribute-tab-title active':'attribute-tab-title'"
+								v-for="(node,i) in dataList" :key="i" @click="changeItem(node)">
+								{{node.group}}
+							</div>
+						</div>
+						<div class="bim-attribute-tab-content-box">
+							<div class="bim-attribute-tab-contents" v-if="nowItem.group === '运营属性'">
+								<operational-attributes></operational-attributes>
+							</div>
+							<div class="bim-attribute-tab-content" v-else>
+								<div class="property-item" v-for="(item,indexs) in nowItem.node" :key="indexs">
+									<div class="property-item-title">
+										<div class="property-item-title-label">
+											{{item.group}}
+											<span class="color-primary" v-if="isUpdate"
+												@click="updateGroup(item.group,indexs)">
+												编辑
+											</span>
+										</div>
+										<div class="property-item-title-delete" v-if="isUpdate"
+											@click="deleteGroup(nowItem.node,indexs)">
+											<i class="iconfont huifont-shanchu"></i>
+										</div>
+									</div>
+									<table border="1" cellspacing="0" cellpadding="0">
+										<tr class="th-title">
+											<th style="width: 400px;">属性名称</th>
+											<th>属性值</th>
+										</tr>
+										<tr v-for="(items,index) in item.items" :key="index">
+											<td>
+												<div class="td-value" v-if="!isUpdate">{{items.key}}</div>
+												<div v-else>
+													<el-input v-model="items.key"></el-input>
+												</div>
+											</td>
+											<td>
+												<div class="td-value" v-if="!isUpdate">{{items.value}}</div>
+												<div class="td-input" v-else>
+													<el-input v-model="items.value"></el-input>
+													<div class="td-icon" @click="deleteRow(item,index)">
+														<i class="iconfont huifont-guanbi"></i>
+													</div>
+												</div>
+											</td>
+										</tr>
+										<tr v-if="isUpdate">
+											<td colspan="2">
+												<div class="insert-icon color-primary" @click="insertRow(item)">
+													<i class="iconfont huifont-xinzeng"></i>
+													新增
+												</div>
+											</td>
+										</tr>
+									</table>
+								</div>
+								<div class="no-data" v-if="nowItem.node.length === 0 && !isUpdate">
+									<empty description="暂无数据"></empty>
+								</div>
+								<div style="padding: 10px 0;text-align: center;" v-if="isUpdate">
+									<el-button type="primary" size="medium"
+										@click="insertList(nowItem)">+新增属性标题</el-button>
+								</div>
+							</div>
+						</div>
+					</div>
+					<div class="no-data" v-else>
+						<empty description="暂无数据"></empty>
+					</div>
+				</div>
+				<div class="hui-drawer-submit">
+					<el-button size="medium" @click="close">取 消</el-button>
+					<el-button size="medium" type="primary" @click="submit">保 存</el-button>
+				</div>
+			</div>
+		</div>
+	</div>
+</template>
+
+<script>
+	import {
+		getElementByIntegrate,
+		insertBimAttribute,
+		putBimAttribute
+	} from '@/httpApi/bim'
+
+	export default {
+		data() {
+			return {
+				bimintegrateid: '',
+				fileid: '',
+				objectid: '',
+				show: true,
+				dataList: [],
+				isUpdate: false,
+				oldForm: [],
+				item: {},
+				nowItem: {},
+				projectId: ''
+			}
+		},
+		created() {
+			this.projectId = localStorage.getItem('projectId');
+		},
+		methods: {
+			init() {
+				getElementByIntegrate(this.bimintegrateid, {
+					"filter": [],
+					"ids": [{
+						"fileIdHash": this.fileid,
+						"elementIds": [this.objectid]
+					}]
+				}).then(res => {
+					if (res.state) {
+						if (res.data.code == 'success') {
+							if (res.data.data.length == 0) {
+								this.dataList = [];
+								this.oldForm = [];
+								return;
+							}
+							this.dataList = [{
+								group: '基本属性',
+								node: res.data.data[0].properties
+							}];
+							this.nowItem = this.dataList[0];
+							this.oldForm = JSON.parse(JSON.stringify(this.dataList));
+						} else {
+							this.item = res.data[0];
+							this.dataList = JSON.parse(res.data[0].elementAttribute);
+							this.nowItem = this.dataList[0];
+							this.oldForm = JSON.parse(JSON.stringify(this.dataList));
+						}
+					}
+				})
+			},
+			cancelUpdate() {
+				this.dataList = JSON.parse(JSON.stringify(this.oldForm));
+				this.nowItem = this.dataList[0];
+				this.isUpdate = false;
+			},
+			insertList(node) {
+				node.node.push({
+					group: '标题',
+					items: []
+				})
+			},
+			insertRow(item) {
+				item.items.push({
+					key: '',
+					value: ''
+				});
+			},
+			updateGroup(val, indexs) {
+				this.$prompt('请输入标题名称', '系统提示', {
+					confirmButtonText: '确定',
+					cancelButtonText: '取消',
+					inputValue: val
+				}).then(({
+					value
+				}) => {
+					this.nowItem.node[indexs].group = value;
+				}).catch();
+			},
+			deleteRow(item, index) {
+				item.items.splice(index, 1);
+			},
+			deleteGroup(item, index) {
+				item.splice(index, 1);
+			},
+			changeItem(item) {
+				this.nowItem = item;
+			},
+			submit() {
+				this.item.id ? putBimAttribute({
+					id: this.item.id,
+					elementAttribute: JSON.stringify(this.dataList)
+				}).then(this.successFunc) : insertBimAttribute({
+					integrateId: this.bimintegrateid,
+					fileId: this.fileid,
+					elementId: this.objectid,
+					elementAttribute: JSON.stringify(this.dataList)
+				}).then(this.successFunc);
+			},
+			successFunc(res) {
+				if (res.state) {
+					this.$message.success('操作成功');
+					this.isUpdate = false;
+				}
+			},
+			close() {
+				if (!this.isUpdate) this.show = false;
+				let obj = JSON.parse(JSON.stringify(this.oldForm));
+				this.dataList = Object.assign({}, obj);
+				this.isUpdate = false;
+			}
+		},
+		watch: {
+			show(value) {
+				this.show = value;
+				if (!this.show) this.close();
+				if (this.show) this.init();
+			},
+			objectid(value) {
+				if (this.show) this.init();
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.bim-attribute {
+		position: fixed;
+		top: 0;
+		left: 0;
+		right: 0;
+		bottom: 0;
+		background: rgba(0, 0, 0, 0.4);
+		z-index: 2000;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+
+		.bim-attribute-title {
+			display: flex;
+			height: 55px;
+			align-items: center;
+			padding: 0 24px;
+			border-bottom: 1px solid $--color-border;
+			font-size: 16px;
+			justify-content: space-between;
+
+			.hui-title-right {
+				display: flex;
+				align-items: center;
+
+				.iconfont {
+					margin-left: 30px;
+					margin-right: 6px;
+					font-size: 18px;
+					cursor: pointer;
+					color: #5F7285;
+				}
+
+				.iconfont:hover {
+					color: $--color-primary;
+				}
+			}
+		}
+
+		.insert-icon {
+			text-align: center;
+			cursor: pointer;
+			border-radius: 2px;
+			border: 1px dashed #2B3852;
+			line-height: 30px;
+		}
+
+		.hui-drawer-submit {
+			padding: 10px;
+			text-align: right;
+			border-color: $--color-border;
+		}
+
+		.td-input {
+			display: flex;
+			align-items: center;
+
+			.el-input {
+				flex: 1;
+				width: 0;
+				overflow: hidden;
+			}
+
+			.td-icon {
+				width: 20px;
+				height: 20px;
+				background: #171F2D;
+				border-radius: 10px;
+				border: 1px solid #8596B0;
+				opacity: 0.6;
+				text-align: center;
+				line-height: 16px;
+				margin-left: 12px;
+				color: #8596B0;
+				cursor: pointer;
+			}
+
+			.td-icon:hover {
+				color: $--color-red;
+				border-color: $--color-red;
+			}
+
+			.iconfont {
+				font-size: 10px;
+				margin-left: 1px;
+			}
+		}
+
+		.bim-attribute-box {
+			width: 80%;
+			height: 90%;
+			background: #141A24;
+			align-items: center;
+			justify-content: center;
+
+			.no-data {
+				width: 100%;
+				height: 100%;
+				display: flex;
+				align-items: center;
+				justify-content: center;
+			}
+
+			.bim-attribute-view {
+				width: 100%;
+				height: 100%;
+
+				.bim-attribute-content {
+					width: 100%;
+					height: 100%;
+					position: relative;
+				}
+
+				.bim-attribute-tab {
+					position: absolute;
+					width: 140px;
+					top: 0;
+					left: 0;
+					bottom: 0;
+					border-right: 1px solid $--color-border;
+					padding-top: 20px;
+				}
+
+				.attribute-tab-title {
+					height: 40px;
+					line-height: 40px;
+					padding-left: 30px;
+					cursor: pointer;
+				}
+
+				.attribute-tab-title.active,
+				.attribute-tab-title.active:hover {
+					color: #F2F3F5;
+					background: $--color-primary;
+				}
+
+				.attribute-tab-title:hover {
+					color: $--color-primary;
+				}
+
+				.bim-attribute-tab-contents {
+					width: 100%;
+					height: 100%;
+					padding-left: 140px;
+				}
+
+				.bim-attribute-tab-content-box {
+					width: 100%;
+					height: 100%;
+				}
+
+				.bim-attribute-tab-content {
+					width: 100%;
+					height: 100%;
+					padding: 0 30px;
+					padding-left: 170px;
+					overflow-y: auto;
+
+					.el-input__inner {
+						background: #171F2D;
+						border-radius: 2px;
+						border-color: #2B3852;
+					}
+
+					.el-input__inner:focus,
+					.el-input__inner:hover,
+					.el-textarea__inner:focus,
+					.el-textarea__inner:hover,
+					.el-select:hover .el-input__inner,
+					.el-cascader:hover .el-input__inner {
+						border-color: $--color-primary;
+					}
+				}
+
+				table {
+					width: 100%;
+					border: 1px solid #1F2A3F;
+					border-collapse: collapse;
+					table-layout: fixed;
+				}
+
+				table th {
+					padding: 10px 0;
+					border: 1px solid #1F2A3F;
+					font-weight: 500;
+				}
+
+
+				table td {
+					border: 1px solid #1F2A3F;
+					padding: 11px 20px;
+				}
+
+
+				.property-item {
+					margin-bottom: 10px;
+
+					.td-value {
+						padding-left: 20px;
+					}
+
+					.property-item-title {
+						margin-top: 20px;
+						font-weight: 600;
+						margin-bottom: 10px;
+						display: flex;
+						align-items: center;
+						justify-content: space-between;
+					}
+
+					.property-item-title-label {
+						span {
+							margin-left: 8px;
+							cursor: pointer;
+						}
+					}
+
+					.property-item-title-delete {
+						width: 24px;
+						height: 24px;
+						background: #1E293B;
+						border-radius: 2px;
+						line-height: 24px;
+						text-align: center;
+						cursor: pointer;
+					}
+
+					.th-title {
+						background: rgba(97, 133, 214, 0.05);
+					}
+
+					.property-box-document {
+						cursor: pointer;
+					}
+				}
+			}
+		}
+	}
+</style>

+ 73 - 0
virgo.wzfrontend/console/src/components/common/bimUpload.vue

@@ -0,0 +1,73 @@
+<template>
+	<div class="bim-upload">
+		<el-upload :action="action" name="uploadFile" ref="upload" :headers="headers" :on-success="successFile"
+			:before-upload="beforeUpload" :on-error="errorUpload" :show-file-list="false" :on-progress="progress">
+			<div class="bim-update-button">
+				<i class="el-icon-plus"></i>
+			</div>
+		</el-upload>
+	</div>
+</template>
+
+<script>
+	import config from '@/config';
+	import {
+		getToken
+	} from '@/uitls/auth';
+	export default {
+		props: ['type'],
+		data() {
+			return {
+				action: '',
+				headers: {}
+			}
+		},
+		created() {
+			this.headers.token = getToken();
+			this.action = config.baseURL + '/bim/bim/uploadFile/' + this.type;
+		},
+		methods: {
+			beforeUpload() {
+				this.$loading();
+			},
+			progress(e) {
+				let percent = e.percent >= 100 ? 99 : parseInt(e.percent)
+				this.$loading({
+					percent: (percent + '%')
+				});
+			},
+			reloadUpload(row) {
+				this.action = config.baseURL + '/bim/bim/uploadFile/' + row.type + '/' + row.id;
+				this.$refs['upload'].$children[0].$refs.input.click();
+			},
+			errorUpload() {
+				this.$loading.close();
+				this.$message.error('上传失败');
+			},
+			successFile(data) {
+				this.$loading.close();
+				if (data.code != '200') return this.$message.error('上传失败');
+				this.$message.success('上传成功');
+				
+				this.$emit('changeBim', data.data);
+			},
+		},
+		watch: {
+			type() {
+				this.action = config.baseURL + '/bim/bim/uploadFile/' + this.type;
+			}
+		},
+	}
+</script>
+
+<style lang="scss">
+	.bim-upload {
+		.bim-update-button {
+			width: 50px;
+			height: 50px;
+			border: 1px solid $--color-border;
+			text-align: center;
+			line-height: 48px;
+		}
+	}
+</style>

+ 151 - 0
virgo.wzfrontend/console/src/components/work/bim/bimForm.vue

@@ -0,0 +1,151 @@
+<template>
+	<div class="hui-flex hui-dialog bim-form">
+		<div class="hui-flex-box hui-dialog-content">
+			<project-item ref="projectItem" :form="bimForm"></project-item>
+			<el-form ref="bimForm" :model="bimForm" :rules="bimRuler" label-position="top">
+				<el-form-item label="模型类型">
+					<el-select v-model="bimForm.type" placeholder="请选择" :disabled="!bimForm.bim.id ? false : true">
+						<el-option v-for="item in typeList" :key="item.id" :label="item.typeName" :value="item.id">
+						</el-option>
+					</el-select>
+				</el-form-item>
+				<el-form-item label="上传模型">
+					<div class="bim-update-image" v-if="bimForm.bim.id">
+						<el-image src="">
+							<div slot="error" class="image-slot">
+								<el-tooltip class="item" effect="dark" :content="bimForm.bim.name" placement="bottom">
+									<div class="image-slot">
+										<div class="image-text">BIM</div>
+									</div>
+								</el-tooltip>
+							</div>
+						</el-image>
+						<div class="bim-update-close" @click="removeFile">
+							<i class="el-icon-close"></i>
+						</div>
+					</div>
+					<bim-upload v-if="!bimForm.bim.id && bimForm.type" :type="bimForm.type" @changeBim="changeBim">
+					</bim-upload>
+				</el-form-item>
+			</el-form>
+		</div>
+		<div class="hui-dialog-submit">
+			<el-button size="medium" @click="$emit('callback')">取 消</el-button>
+			<el-button size="medium" type="primary" @click="submit">保 存</el-button>
+		</div>
+	</div>
+</template>
+
+<script>
+	import {
+		getBimType,
+		getProjectItemTargetBimList,
+		insertProjectItemTargetBim,
+		updateProjectItemTargetBim
+	} from '@/httpApi/bim';
+	import projectItem from '@/components/common/projectItem'
+	import bimUpload from '@/components/common/bimUpload'
+	import preview from '@/components/work/bim/preview';
+	export default {
+		data() {
+			return {
+				bimForm: {
+					type: 5,
+					bim: {}
+				},
+				bimRuler: {},
+				typeList: [{
+						"id": 5,
+						"typeName": "结构"
+					},
+					{
+						"id": 6,
+						"typeName": "建筑"
+					},
+					{
+						"id": 7,
+						"typeName": "机电"
+					}
+				]
+			}
+		},
+		created() {},
+		methods: {
+			changeBim(data) {
+				this.bimForm.bim = data;
+			},
+			removeFile() {
+				this.bimForm.bim = {};
+			},
+			submit() {
+				let id = this.$refs.projectItem.formBox.projectItemTargetId;
+				getProjectItemTargetBimList(id).then(res => {
+					if (res.state) {
+						let bims = res.data ? res.data.bims : res.data;
+						!bims ? this.insertProjectItemTargetBim(id) : this.updateProjectItemTargetBim(id, bims, res
+							.data.id);
+					}
+				})
+			},
+			insertProjectItemTargetBim(projectItemTargetId) {
+				insertProjectItemTargetBim({
+					projectItemTargetId: projectItemTargetId,
+					bims: this.bimForm.bim.id
+				}).then(this.successFunc);
+			},
+			updateProjectItemTargetBim(projectItemTargetId, bimsItem, bimId) {
+				let bims = bimsItem.split(',');
+				if (bims.filter(node => node === this.bimForm.bim.id).length === 0) bims.push(this.bimForm.bim.id);
+				updateProjectItemTargetBim({
+					projectItemTargetId: projectItemTargetId,
+					bims: bims.join(','),
+					id: bimId
+				}).then(this.successFunc);
+			},
+			successFunc(res) {
+				if (res.state) {
+					this.$message.success('操作成功');
+					this.$emit('callback', 'init');
+				}
+			}
+		},
+		components: {
+			projectItem,
+			bimUpload
+		},
+	}
+</script>
+
+<style lang="scss">
+	.bim-form {
+		.bim-update-image {
+			margin-right: 10px;
+			position: relative;
+			width: 50px;
+			height: 50px;
+			line-height: 50px;
+			text-align: center;
+
+			.el-image {
+				width: 50px;
+				height: 50px;
+				border: 1px solid $--color-primary;
+			}
+
+			.bim-update-close {
+				position: absolute;
+				right: -7px;
+				top: -7px;
+				background: orangered;
+				color: #fff;
+				width: 16px;
+				height: 16px;
+				line-height: 16px;
+				text-align: center;
+				border-radius: 50%;
+				font-size: 12px;
+				cursor: pointer;
+			}
+		}
+	}
+</style>

+ 185 - 0
virgo.wzfrontend/console/src/components/work/bim/integration.vue

@@ -0,0 +1,185 @@
+<template>
+	<div class="integration-bim">
+		<div class="hui-flex hui-table">
+			<div class="hui-flex-box">
+				<el-table ref="multipleTable" :data="tableData" height="100%"
+					@selection-change="val=>{multipleSelection = val}" border>
+					<el-table-column type="selection" width="45">
+					</el-table-column>
+					<el-table-column prop="name" label="模型名称">
+					</el-table-column>
+					<el-table-column prop="projectItemTargetName" label="具体位置" width="100">
+					</el-table-column>
+					<el-table-column label="类型" width="80">
+						<template slot-scope="scope">
+							<div class="hui-tag">
+								{{typeList.filter(item=>item.id == scope.row.type)[0].typeName}}
+							</div>
+						</template>
+					</el-table-column>
+					<el-table-column prop="address" label="操作" width="80">
+						<template slot-scope="scope">
+							<div class="hui-table-operation">
+								<span class="table-operation" @click="previewBim(scope.row)">预览</span>
+							</div>
+						</template>
+					</el-table-column>
+					<template slot="empty">
+						<empty description="暂无数据"></empty>
+					</template>
+				</el-table>
+			</div>
+			<div class="hui-table-box-foot">
+				<div class="tips"><span style="color: red;">* </span>注:请勿选择两个相同的模型文件,否则导致模型数据错误。</div>
+				<el-button size="medium" type="primary" @click="integrateBim">
+					{{ (projectItem.bimIntegrateId ? '重新集成' : '集成') + '(' + (3 - projectItem.bimIntegrateNumber) + '次)' }}
+				</el-button>
+			</div>
+		</div>
+		<div class="integration-bim-show">
+			<div class="integration-bim-box">
+				<div class="no-empty" v-if="!projectItem.bimIntegrateId">
+					<empty description="暂未集成模型"></empty>
+				</div>
+				<preview v-else type="integrate" :file="{id:projectItem.bimIntegrateId}" :key="1"></preview>
+			</div>
+		</div>
+		<el-dialog title="预览模型" :visible.sync="dialogVisible" :append-to-body="true" width="80%">
+			<preview v-if="dialogVisible" @close="dialogVisible = false" type="model" :file="file" :key="2"></preview>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+	import {
+		getProjectItemTargetList,
+		updateProjectItem,
+		bimIntegrateNumber
+	} from '@/httpApi/space'
+	import {
+		getBimListByBims,
+		getBimType,
+		integrate,
+		modelIntegrateFiles
+	} from '@/httpApi/bim'
+	import preview from '@/components/work/bim/preview'
+	export default {
+		props: ['projectItem', 'type'],
+		data() {
+			return {
+				tableData: [],
+				typeList: [],
+				dialogVisible: false,
+				multipleSelection: [],
+				file: {}
+			}
+		},
+		created() {
+			getBimType().then(res => {
+				if (res.state) this.typeList = res.data;
+				this.init();
+			});
+		},
+		methods: {
+			init() {
+				getProjectItemTargetList(this.projectItem.id).then(res => {
+					if (res.state) {
+						let projectItemTargetList = res.data;
+						let bims = projectItemTargetList.filter(node => node.bims).map(node => node.bims).join(
+							',');
+						if (!bims) return this.tableData = [];
+						this.getBimList(bims, projectItemTargetList);
+					}
+				})
+			},
+			getBimList(bims, projectItemTargetList) {
+				getBimListByBims(bims).then(reslute => {
+					if (reslute.state) {
+						this.tableData = reslute.data.filter(node => node.status === 2).map(item => {
+							item['projectItemTargetName'] = projectItemTargetList.filter(node => {
+								return node.bims ? (node.bims.indexOf(item.id) > -1) : false
+							})[0].name;
+							return item;
+						});
+						if (this.projectItem.bimIntegrateId) this.setRowSelection();
+					}
+				});
+			},
+			setRowSelection() {
+				modelIntegrateFiles(this.projectItem.bimIntegrateId).then(node => {
+					if (node.state) {
+						let fileId = node.data.data.map(item => item.fileId);
+						for (let i = 0; i < fileId.length; i++) {
+							this.$refs.multipleTable.toggleRowSelection(this
+								.tableData.filter(item => item.bimfaceInfo
+									.fileId == fileId[i])[0]);
+						}
+					}
+				})
+			},
+			previewBim(item) {
+				this.file = {
+					id: item.bimfaceInfo.fileId,
+					name: item.name
+				}
+				this.dialogVisible = true;
+			},
+			integrateBim() {
+				if (this.projectItem.bimIntegrateNumber >= 3) return this.$message.warning('您已使用完3次集成,请联系客服增加次数');
+				if (this.multipleSelection.length === 0) return this.$message.warning('请至少选择一个模型');
+				this.$confirm('是否要集成模型?', () => {
+					this.integrateBimFunc();
+				});
+			},
+			integrateBimFunc() {
+				this.$loading()
+				integrate(this.multipleSelection.map(node => node.bimfaceInfo.fileId)).then(res => {
+					if (res.state) {
+						this.projectItem.bimIntegrateId = res.data.integrateId;
+						bimIntegrateNumber(this.projectItem.id);
+						this.projectItem.bimIntegrateNumber += 1;
+						updateProjectItem(this.projectItem).then(node => {
+							if (node.state) {
+								this.$emit('callback');
+								this.$message.success('操作成功');
+							}
+							this.$loading.close();
+						});
+					} else {
+						this.$loading.close();
+					}
+				});
+			}
+		},
+		components: {
+			preview
+		},
+	}
+</script>
+
+<style lang="scss">
+	.integration-bim {
+		width: 100%;
+		height: 100%;
+		display: flex;
+
+		.hui-table {
+			flex: 1;
+			width: 0;
+			height: 100%;
+		}
+
+		.integration-bim-show {
+			flex: 1;
+			width: 0;
+			height: 100%;
+			padding: 12px 20px 20px 0;
+
+			.integration-bim-box {
+				width: 100%;
+				height: 100%;
+				border: 1px solid $--color-border;
+			}
+		}
+	}
+</style>

+ 74 - 0
virgo.wzfrontend/console/src/components/work/bim/preview.vue

@@ -0,0 +1,74 @@
+<template>
+	<div class="bim-preview">
+		<div class="no-empty" v-if="!state">
+			<empty :description="type == 'model'?'模型转换中':'模型集成中'"></empty>
+		</div>
+		<div :id="'previewBim'+_uid" class="previewBim" v-else></div>
+	</div>
+</template>
+
+<script>
+	import bimView from '@/uitls/controls'
+	import {
+		getBimViewToken,
+		getIntegrateViewToken
+	} from '@/httpApi/bim';
+	export default {
+		props: ['file', 'type'],
+		data() {
+			return {
+				state: false,
+				bimViewer: null
+			}
+		},
+		created() {
+			this.init();
+		},
+		beforeDestroy() {
+			if (this.bimViewer) this.bimViewer.destroy();
+		},
+		methods: {
+			init() {
+				this.type === 'model' ? getBimViewToken(this.file.id).then(this.successFunc) : getIntegrateViewToken(this
+					.file.id).then(this.successFunc)
+			},
+			successFunc(res) {
+				if (res.state) {
+					if (!res.data) return;
+					this.state = true;
+					this.$nextTick(() => {
+						this.bimViewer = new bimView({
+							dom: document.getElementById('previewBim' + this._uid),
+							viewToken: res.data,
+							bimIntegrateId: this.file.id,
+							type: this.type,
+							renderSuccess: () => {
+								this.bimViewer.setToolbars(true)
+								this.$emit('renderSuccess');
+							}
+						})
+					})
+				}
+			},
+			colorAll() {
+				this.bimViewer.overrideComponentsColorByObjectData()
+			},
+			colorElement(elementIds, option) {
+				this.bimViewer.colorElementById(elementIds, option)
+			}
+		},
+	}
+</script>
+
+
+<style lang="scss">
+	.bim-preview {
+		width: 100%;
+		height: 100%;
+
+		.previewBim {
+			width: 100%;
+			height: 100%;
+		}
+	}
+</style>

+ 172 - 0
virgo.wzfrontend/console/src/httpApi/bim.js

@@ -0,0 +1,172 @@
+import request from '@/axios'
+
+/*
+ * 获取项目模型列表
+ * 
+ * 
+ */
+export function getBimList(id) {
+	return request({
+		url: `/api/project/bimList/${id}`,
+		method: 'get',
+	})
+}
+/* 
+ * 获取具体位置BIM列表
+ * 
+ * 
+ */
+export function getProjectItemTargetBimList(projectItemTargetId) {
+	return request({
+		url: `/api/projectItem/target/${projectItemTargetId}`,
+		method: 'get'
+	})
+}
+/* 
+ * 新增具体位置的bim列表
+ * 
+ * 
+ */
+export function insertProjectItemTargetBim(data) {
+	return request({
+		url: `/api/projectItem/target`,
+		method: 'post',
+		data: data
+	})
+}
+/* 
+ * 编辑具体位置的bim列表
+ * 
+ * 
+ */
+export function updateProjectItemTargetBim(data) {
+	return request({
+		url: `/api/projectItem/target`,
+		method: 'put',
+		data: data
+	})
+}
+/* 
+ * 转换BIM
+ * 
+ * 
+ */
+export function translateBim(id) {
+	return request({
+		url: `/bim/bim/translate/${id}`,
+		method: 'get',
+	});
+}
+/* 
+ * 提交到bimface平台
+ * @param {String} params = {id}
+ * 
+ */
+export function toBimFace(id) {
+	return request({
+		url: `/bim/bim/${id}`,
+		method: 'get',
+	});
+}
+/* 
+ * 获取bim类型
+ * 
+ * 
+ */
+export function getBimType() {
+	return request({
+		url: `/api/projectItem/bimType`,
+		method: 'get'
+	})
+}
+/* 
+ * 获取模型viewToken
+ * 
+ * 
+ */
+export function getBimViewToken(fileId) {
+	return request({
+		url: `/bim/bim/viewToken/${fileId}`,
+		method: 'get',
+	});
+}
+/* 
+ * 获取集成模型viewToken
+ * 
+ * 
+ */
+export function getIntegrateViewToken(fileId) {
+	return request({
+		url: `/bim/bim/viewToken/integrate/${fileId}`,
+		method: 'get',
+	});
+}
+/*
+ * 获取集成构件修改属性
+ * 
+ * 
+ */
+export function getElementByIntegrate(integrateId, data) {
+	return request({
+		url: `/bim/bim/batch/integrate/${integrateId}`,
+		method: 'post',
+		data: data
+	})
+}
+/*
+ * 获取集成构件修改属性
+ * 
+ * 
+ */
+export function insertBimAttribute(data) {
+	return request({
+		url: `/bim/bimAttribute`,
+		method: 'post',
+		data: data
+	})
+}
+/*
+ * 修改集成构件修改属性
+ * 
+ * 
+ */
+export function putBimAttribute(data) {
+	return request({
+		url: `/bim/bimAttribute`,
+		method: 'put',
+		data: data
+	})
+}
+/* 
+ * 获取BIM列表
+ * 
+ */
+export function getBimListByBims(bimId) {
+	return request({
+		url: `/bim/bim/list/${bimId}`,
+		method: 'get'
+	})
+}
+/* 
+ * 集成模型
+ * 
+ * 
+ */
+export function integrate(data) {
+	return request({
+		url: `/bim/bim/integrate`,
+		method: 'put',
+		data: data
+	});
+}
+/* 
+ * 获取集成文件
+ * @param {data}
+ * 
+ */
+export function modelIntegrateFiles(integrateId) {
+	return request({
+		url: `/bim/bim/integrate/files/${integrateId}`,
+		method: 'get',
+	});
+}

+ 24 - 2
virgo.wzfrontend/console/src/httpApi/space.js

@@ -114,6 +114,28 @@ export function deleteProjectItemById(id) {
 		method: 'delete'
 		method: 'delete'
 	})
 	})
 }
 }
+/* 
+ * 计算次数
+ * @param {data}
+ * 
+ */
+export function bimIntegrateNumber(projectItemId) {
+	return request({
+		url: `/api/projectItem/update/integrate/${projectItemId}`,
+		method: 'put',
+	})
+}
+/* 
+ * 获取具体位置列表
+ * 
+ * 
+ */
+export function getProjectItemTargetList(projectItemId) {
+	return request({
+		url: `/api/projectItemTarget/projectItem/${projectItemId}`,
+		method: 'get'
+	})
+}
 /* 
 /* 
  * 新增楼层
  * 新增楼层
  * 
  * 
@@ -127,7 +149,7 @@ export function insertProjectItemTarget(data) {
 	})
 	})
 }
 }
 /* 
 /* 
- * 获取楼详情
+ * 获取楼详情
  * 
  * 
  * 
  * 
  */
  */
@@ -375,7 +397,7 @@ export function search(keyWord) {
 		url: `/api/projectItemTargetRoom/query/${keyWord}`,
 		url: `/api/projectItemTargetRoom/query/${keyWord}`,
 		method: 'get'
 		method: 'get'
 	})
 	})
-}
+}
 /* 
 /* 
  * 新增看房预约
  * 新增看房预约
  * 
  * 

+ 16 - 0
virgo.wzfrontend/console/src/router/modules/bim.js

@@ -0,0 +1,16 @@
+const bim = [{
+	path: 'bim',
+	component: () => import('@/views/work/bim'),
+	name: '模型管理',
+	meta: {
+		title: '模型管理'
+	}
+}, {
+	path: 'bim/integration',
+	component: () => import('@/views/work/bim/integration'),
+	name: '集成模型',
+	meta: {
+		title: '集成模型'
+	}
+}]
+export default bim;

+ 21 - 51
virgo.wzfrontend/console/src/uitls/controls.js

@@ -1,3 +1,5 @@
+import $ from 'jquery';
+import model from '@/bimAttribute'
 import {
 import {
 	Message
 	Message
 } from 'element-ui'
 } from 'element-ui'
@@ -10,8 +12,7 @@ class bimView {
 				fileId: '',
 				fileId: '',
 				objectId: ''
 				objectId: ''
 			},
 			},
-			extObjMng, roomEditorToolbar, bimIntegrateId, roamAngle, wallEffect, lightMng, directionalLight,
-			bloomEffectConfig, bloomEffect;
+			extObjMng, roomEditorToolbar, bimIntegrateId, roamAngle, wallEffect;
 		dom = arg.dom
 		dom = arg.dom
 		viewToken = arg.viewToken;
 		viewToken = arg.viewToken;
 		renderSuccess = arg.renderSuccess;
 		renderSuccess = arg.renderSuccess;
@@ -43,6 +44,9 @@ class bimView {
 		this.getCamera = () => {
 		this.getCamera = () => {
 			return viewer3D.getCamera();
 			return viewer3D.getCamera();
 		}
 		}
+		this.toggleContextMenuDisplay = (isEnabled) => {
+			viewer3D.toggleContextMenuDisplay(isEnabled)
+		}
 		this.View3DRender = () => {
 		this.View3DRender = () => {
 			let webAppConfig = new Glodon.Bimface.Application.WebApplication3DConfig();
 			let webAppConfig = new Glodon.Bimface.Application.WebApplication3DConfig();
 			webAppConfig.domElement = dom;
 			webAppConfig.domElement = dom;
@@ -53,17 +57,16 @@ class bimView {
 				color: bgcolor,
 				color: bgcolor,
 				stop: "100%"
 				stop: "100%"
 			}]
 			}]
+			webAppConfig.enableCSMShadow = false;
 			// 设置全局单位
 			// 设置全局单位
 			webAppConfig.globalUnit = Glodon.Bimface.Common.Units.LengthUnits.Millimeter;
 			webAppConfig.globalUnit = Glodon.Bimface.Common.Units.LengthUnits.Millimeter;
 			// 创建WebApplication
 			// 创建WebApplication
 			app = new Glodon.Bimface.Application.WebApplication3D(webAppConfig);
 			app = new Glodon.Bimface.Application.WebApplication3D(webAppConfig);
 			// 添加待显示的模型
 			// 添加待显示的模型
 			app.addView(viewToken);
 			app.addView(viewToken);
-
 			// 从WebApplication获取viewer3D对象
 			// 从WebApplication获取viewer3D对象
 			viewer3D = app.getViewer();
 			viewer3D = app.getViewer();
 			viewer3D.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.MouseClicked, data => {
 			viewer3D.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.MouseClicked, data => {
-				console.log(data);
 				if (data.eventType == 'Click') { //左击
 				if (data.eventType == 'Click') { //左击
 					if (click) click(data);
 					if (click) click(data);
 				} else {
 				} else {
@@ -83,6 +86,7 @@ class bimView {
 			})
 			})
 			viewer3D.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.ViewAdded, () => {
 			viewer3D.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.ViewAdded, () => {
 				model3D = viewer3D.getModel();
 				model3D = viewer3D.getModel();
+				viewer3D.enableSSAOEffect(false);
 				this.setCamera({
 				this.setCamera({
 					isPan: true,
 					isPan: true,
 					isRotate: true,
 					isRotate: true,
@@ -94,11 +98,12 @@ class bimView {
 						.MeshBasicClipMaterial({
 						.MeshBasicClipMaterial({
 							color: '#3669b8',
 							color: '#3669b8',
 							opacity: 0.7,
 							opacity: 0.7,
+							transparent: !0,
 						})
 						})
 					return elementColor;
 					return elementColor;
 				}
 				}
-				// if ($('.gld-bf-properties')[0]) $('.gld-bf-properties')[0].onclick = this.bimAttribute;
-				// if ($('.gld-bf-firstperson')[0]) $('.gld-bf-firstperson')[0].onclick = this.walkStatus;
+				if ($('.gld-bf-properties')[0]) $('.gld-bf-properties')[0].onclick = this.bimAttribute;
+				if ($('.gld-bf-firstperson')[0]) $('.gld-bf-firstperson')[0].onclick = this.walkStatus;
 				if (renderSuccess) renderSuccess();
 				if (renderSuccess) renderSuccess();
 			})
 			})
 			viewer3D.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.SelectionChanged, data => {
 			viewer3D.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.SelectionChanged, data => {
@@ -118,6 +123,13 @@ class bimView {
 		this.walkStatus = () => {
 		this.walkStatus = () => {
 			if (roamAngle) this.setStatus(roamAngle)
 			if (roamAngle) this.setStatus(roamAngle)
 		}
 		}
+		this.enableWireframe = (isTrue) => {
+			viewer3D.enableWireframe(isTrue);
+		}
+		this.hideComponentsByObjectData = (option) => {
+			model3D.hideComponentsByObjectData(option);
+			viewer3D.render();
+		}
 		this.bimAttribute = () => {
 		this.bimAttribute = () => {
 			if (type === 'model') return;
 			if (type === 'model') return;
 			$('.bf-close').click();
 			$('.bf-close').click();
@@ -373,7 +385,7 @@ class bimView {
 		this.clearAllRooms = () => {
 		this.clearAllRooms = () => {
 			if (roomManager) roomManager.clearAllRooms();
 			if (roomManager) roomManager.clearAllRooms();
 		}
 		}
-		this.add3DMaker = (markerType, position, imageSrc, clickFn) => {
+		this.add3DMaker = (markerType, position, imageSrc, clickFn, id) => {
 			if (!marker3D) {
 			if (!marker3D) {
 				let markerConfig = new Glodon.Bimface.Plugins.Marker3D.Marker3DContainerConfig();
 				let markerConfig = new Glodon.Bimface.Plugins.Marker3D.Marker3DContainerConfig();
 				markerConfig.viewer = viewer3D;
 				markerConfig.viewer = viewer3D;
@@ -386,6 +398,7 @@ class bimView {
 			} else if (markerType == 'canvas') {};
 			} else if (markerType == 'canvas') {};
 			marker3dConfig.worldPosition = position;
 			marker3dConfig.worldPosition = position;
 			marker3dConfig.size = 60;
 			marker3dConfig.size = 60;
+			if (id) marker3dConfig.id = id;
 			let marker3d = new Glodon.Bimface.Plugins.Marker3D.Marker3D(marker3dConfig);
 			let marker3d = new Glodon.Bimface.Plugins.Marker3D.Marker3D(marker3dConfig);
 			if (clickFn) marker3d.onClick(clickFn)
 			if (clickFn) marker3d.onClick(clickFn)
 			marker3D.addItem(marker3d);
 			marker3D.addItem(marker3d);
@@ -486,10 +499,6 @@ class bimView {
 				this.setGlowEffectById(data);
 				this.setGlowEffectById(data);
 			})
 			})
 		}
 		}
-		this.removeGlowEffectById = (ids) => {
-			model3D.removeGlowEffectById(ids);
-			viewer3D.render();
-		}
 		this.clearGlowEffect = () => {
 		this.clearGlowEffect = () => {
 			model3D.clearGlowEffect();
 			model3D.clearGlowEffect();
 			viewer3D.render();
 			viewer3D.render();
@@ -603,48 +612,9 @@ class bimView {
 			// 构造电子围墙扫描效果对象
 			// 构造电子围墙扫描效果对象
 			wallEffect = new Glodon.Bimface.Plugins.Animation.WallEffect(wallEffectConfig);
 			wallEffect = new Glodon.Bimface.Plugins.Animation.WallEffect(wallEffectConfig);
 		}
 		}
-		this.setLight = () => {
-			if (!lightMng) lightMng = viewer3D.getLightManager();
-			// 获取默认用于控制投影的方向光
-			if (!directionalLight) directionalLight = lightMng.getAllDirectionalLights()[0];
-			// 开启阴影
-			directionalLight.enableShadow(true);
-			// 设置曝光补偿量
-			viewer3D.setExposureShift(-0.1);
-		}
-		this.setExposureShift = (num) => {
-			viewer3D.setExposureShift(num);
-		}
-		this.setLightShow = (ids) => {
-			if (!bloomEffectConfig) {
-				// 构造辉光效果的配置项
-				bloomEffectConfig = new Glodon.Bimface.Plugins.Effect.BloomEffectConfig();
-				// 设置构件ID数组、强度、扩散程度、viewer参数
-				bloomEffectConfig.ids = [{
-					"modelId": model3D.modelId,
-					"objectIds": ids
-				}];
-				bloomEffectConfig.intensity = 0.8;
-				bloomEffectConfig.spread = 4;
-				bloomEffectConfig.viewer = viewer3D;
-				// 构造辉光效果
-				bloomEffect = new Glodon.Bimface.Plugins.Effect.BloomEffect(bloomEffectConfig);
-			} else {
-				bloomEffect.setIds([{
-					"modelId": model3D.modelId,
-					"objectIds": ids
-				}])
-				bloomEffect.update();
-			}
-			viewer3D.render();
-		}
-		this.clearLight = () => {
-			bloomEffect.clear();
-			viewer3D.render();
-		}
 		this.destroy = () => {
 		this.destroy = () => {
 			console.log('销毁场景');
 			console.log('销毁场景');
-			viewer3D.destroy();
+			app.destroy();
 		}
 		}
 		this.init();
 		this.init();
 	}
 	}

+ 1 - 1
virgo.wzfrontend/console/src/uitls/message.js

@@ -130,7 +130,7 @@ export default {
 	messageContent(params) {
 	messageContent(params) {
 		let message = '';
 		let message = '';
 		if (params.messageType === 6) {
 		if (params.messageType === 6) {
-			message = `【项目邀请】${store.getters.user.name}在${dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')}邀请加入<${store.getters.project.name}>项目,请及时处理。`
+			message = `【项目邀请】${store.getters.user.name}在${dayjs(new Date()).format('YYYY-MM-DD HH:mm:ss')}邀请加入<${store.getters.project.name}>项目,请及时处理。`
 		}
 		}
 		return message;
 		return message;
 	},
 	},

+ 222 - 0
virgo.wzfrontend/console/src/views/work/bim/index.vue

@@ -0,0 +1,222 @@
+<template>
+	<div class="hui-flex hui-content">
+		<div class="hui-content-title">
+			<div class="hui-title-item active">模型列表</div>
+		</div>
+		<div class="hui-flex-box hui-flex hui-table">
+			<div class="hui-content-insert">
+				<el-button type="primary" size="medium" @click="drawer = true">上传模型</el-button>
+				<bim-upload ref="bimUpload" v-show="false" @changeBim="init"></bim-upload>
+			</div>
+			<div class="hui-flex-box">
+				<el-table ref="singleTable" :data="tableData" border height="100%">
+					<el-table-column label="序号" width="50">
+						<template slot-scope="scope">
+							{{scope.$index + 1}}
+						</template>
+					</el-table-column>
+					<el-table-column width="120" label="上传时间">
+						<template slot-scope="scope">
+							<span>{{$dayjs(scope.row.createTime).format('YYYY-MM-DD')}}</span>
+						</template>
+					</el-table-column>
+					<el-table-column prop="name" label="模型名称"></el-table-column>
+					<el-table-column prop="projectItemName" label="单位工程"></el-table-column>
+					<el-table-column prop="projectItemTargetName" label="具体位置"></el-table-column>
+					<el-table-column prop="createUserName" width="100" label="上传人"></el-table-column>
+					<el-table-column width="100" label="类型">
+						<template slot-scope="scope">
+							<div class="hui-table-tag">
+								<div class="hui-tag">
+									{{typeList.filter(item=>item.id == scope.row.type)[0].typeName}}
+								</div>
+							</div>
+						</template>
+					</el-table-column>
+					<el-table-column width="100" label="状态">
+						<template slot-scope="scope">
+							<div class="hui-table-tag">
+								<div class="hui-tag hui-tag-success" v-if="scope.row.status === 2">
+									转换成功
+								</div>
+								<div class="hui-tag hui-tag-warning" v-if="scope.row.status === 1">
+									转换中
+								</div>
+								<div class="hui-tag hui-tag-warning" v-if="scope.row.status === 0">
+									等待转换
+								</div>
+							</div>
+						</template>
+					</el-table-column>
+					<el-table-column width="220" label="操作">
+						<template slot-scope="scope">
+							<div class="hui-table-operation">
+								<span class="table-operation" @click="reloadUpload(scope.row)">
+									重新上传
+								</span>
+								<span class="table-operation" v-if="scope.row.status === 0"
+									@click="convertBim(scope.row)">
+									转换
+								</span>
+								<span class="table-operation" v-if="scope.row.status === 2"
+									@click="previewBim(scope.row)">
+									预览
+								</span>
+								<span class="table-operation" @click="deleteBim(scope.row)">
+									删除
+								</span>
+								<span class="table-operation" @click="downloadBim(scope.row)">
+									下载
+								</span>
+							</div>
+						</template>
+					</el-table-column>
+					<template slot="empty">
+						<empty description="暂无数据"></empty>
+					</template>
+				</el-table>
+			</div>
+		</div>
+		<el-dialog title="上传模型" :visible.sync="drawer" width="900px" :append-to-body="true">
+			<bim-form @callback="callback" v-if="drawer"></bim-form>
+		</el-dialog>
+		<el-dialog title="预览模型" :visible.sync="dialogVisible" :append-to-body="true" width="80%">
+			<preview v-if="dialogVisible" @close="dialogVisible = false" type="model" :file="file"></preview>
+		</el-dialog>
+	</div>
+</template>
+
+<script>
+	import {
+		getBimList,
+		updateProjectItemTargetBim,
+		getProjectItemTargetBimList,
+		translateBim,
+		toBimFace
+	} from '@/httpApi/bim';
+	import bimForm from '@/components/work/bim/bimForm'
+	import preview from '@/components/work/bim/preview'
+	import config from '@/config';
+	import bimUpload from '@/components/common/bimUpload'
+	export default {
+		data() {
+			return {
+				tableData: [],
+				drawer: false,
+				typeList: [{
+						"id": 5,
+						"typeName": "结构"
+					},
+					{
+						"id": 6,
+						"typeName": "建筑"
+					},
+					{
+						"id": 7,
+						"typeName": "机电"
+					}
+				],
+				dialogVisible: false,
+				file: {},
+				projectTargetBim: {},
+				timer: null
+			}
+		},
+		created() {
+			this.init();
+		},
+		beforeDestroy() {
+			if (this.timer) {
+				clearInterval(this.timer);
+				this.timer = null;
+			}
+		},
+		methods: {
+			init() {
+				getBimList(this.$store.getters.project.id).then(res => {
+					if (res.state) {
+						this.tableData = res.data;
+						this.projectTargetBimFunc(res.data);
+						let loading = this.tableData.filter(node => node.status === 1).length;
+						if (loading === 0 && this.timer) {
+							clearInterval(this.timer);
+							return this.timer = null;
+						}
+						if (loading > 0 && !this.timer) {
+							this.timer = setInterval(this.init, 30000);
+						}
+					}
+				})
+			},
+			projectTargetBimFunc(data) {
+				let obj = {};
+				for (let i = 0; i < data.length; i++) {
+					if (!obj[data[i].projectItemTargetId]) obj[data[i].projectItemTargetId] = [];
+					obj[data[i].projectItemTargetId].push(data[i].id)
+				}
+				this.projectTargetBim = obj;
+			},
+			callback(type) {
+				this.drawer = false;
+				if (type == 'init') this.init();
+			},
+			convertBim(item) {
+				this.$confirm('确定要转换该模型?', () => {
+					item.status == 0 ? toBimFace(item.id).then(res => {
+						if (res.state) this.translateBim(item);
+					}) : this.translateBim(item);
+				});
+			},
+			translateBim(item) {
+				translateBim(item.id).then(res => {
+					if (res.state) {
+						this.$message.success('开始转换模型');
+						this.init();
+						this.timer = setInterval(this.init, 30000);
+					}
+				})
+			},
+			previewBim(item) {
+				this.file = {
+					id: item.bimfaceInfo.fileId,
+					name: item.name
+				}
+				this.dialogVisible = true;
+			},
+			deleteBim(item) {
+				this.$confirm('确定要删除该模型?', () => {
+					let bims = this.projectTargetBim[item.projectItemTargetId];
+					let index = bims.findIndex(node => node == item.id);
+					bims.splice(index, 1);
+					getProjectItemTargetBimList(item.projectItemTargetId).then(node => {
+						if (node.state) {
+							updateProjectItemTargetBim({
+								projectItemTargetId: item.projectItemTargetId,
+								bims: bims.join(','),
+								id: node.data.id
+							}).then(res => {
+								if (res.state) {
+									this.$message.success('操作成功');
+									this.init();
+								}
+							});
+						}
+					})
+				})
+			},
+			reloadUpload(row) {
+				this.$refs.bimUpload.reloadUpload(row);
+			},
+			downloadBim(row) {
+				window.location.href = config.baseURL + '/bim/bim/download/' + row.id;
+			}
+		},
+		components: {
+			bimForm,
+			preview,
+			bimUpload
+		},
+	}
+</script>
+
+<style lang="scss"></style>

+ 73 - 0
virgo.wzfrontend/console/src/views/work/bim/integration.vue

@@ -0,0 +1,73 @@
+<template>
+	<div class="yui-tree-box">
+		<div class="hui-left-tree">
+			<div class="hui-left-tree-title">
+				<svg-icon name="zhuangshi" width="16" height="20"></svg-icon>
+				<span class="hui-left-tree-sub">单位工程列表</span>
+			</div>
+			<div class="hui-left-tree-content">
+				<div class="project-list">
+					<div :class="'project-list-item' + (projectItem.id === item.id?' active':'') "
+						v-for="(item,index) in list" :key="item.id" @click="changeProject(item)">
+						<i class="iconfont huifont-shuzhuangcaidantubiao"></i>
+						<span class="project-item-name">{{item.name}}</span>
+					</div>
+				</div>
+			</div>
+		</div>
+		<div class="hui-tree-content">
+			<div class="hui-flex hui-content box-background">
+				<div class="hui-content-title">
+					<div class="hui-title-item active">集成模型</div>
+				</div>
+				<div class="hui-flex-box hui-flex">
+					<integration v-if="projectItem.id" :projectItem="projectItem" :key="projectItem.id">
+					</integration>
+				</div>
+			</div>
+		</div>
+	</div>
+</template>
+
+<script>
+	import {
+		getProjectItemList
+	} from '@/httpApi/space'
+	import integration from '@/components/work/bim/integration'
+	export default {
+		data() {
+			return {
+				list: [],
+				projectItem: {}
+			}
+		},
+		created() {
+			this.init();
+		},
+		methods: {
+			init() {
+				getProjectItemList({
+					projectId: this.$store.getters.project.id,
+					currPage: 1,
+					pageSize: 100
+				}).then(res => {
+					if (res.state) {
+						this.list = res.data.dataList;
+						if (this.list.length > 0) {
+							this.projectItem = this.list[0];
+						}
+					}
+				})
+			},
+			changeProject(item) {
+				this.projectItem = item;
+			}
+		},
+		components: {
+			integration
+		},
+	}
+</script>
+
+<style lang="scss">
+</style>