|
@@ -1,29 +1,16 @@
|
|
<template>
|
|
<template>
|
|
- <el-dialog
|
|
|
|
- id="checkGraphy"
|
|
|
|
- title="添加平面图"
|
|
|
|
- :visible.sync="checkGraphyVisible"
|
|
|
|
- width="40%"
|
|
|
|
- :before-close="handleClose"
|
|
|
|
- >
|
|
|
|
|
|
+ <el-dialog id="checkGraphy" title="添加平面图" :visible.sync="checkGraphyVisible" width="40%" @close="handleClose">
|
|
<div class="bodys">
|
|
<div class="bodys">
|
|
- <el-cascader :props="props" :show-all-levels="false" @change="handleChange" placeholder="请选择模型文件"></el-cascader>
|
|
|
|
|
|
+ <el-cascader :options="options" :show-all-levels="false" :props="props" @change="handleChange" @active-item-change='handleItemChange' clearable
|
|
|
|
+ placeholder="请选择模型文件" v-model="casVal"></el-cascader>
|
|
<div>
|
|
<div>
|
|
或
|
|
或
|
|
<el-button type="text">上传图片</el-button>
|
|
<el-button type="text">上传图片</el-button>
|
|
</div>
|
|
</div>
|
|
<!-- 展示框 -->
|
|
<!-- 展示框 -->
|
|
<div class="showBox">
|
|
<div class="showBox">
|
|
- <drawFloor
|
|
|
|
- ref="drawFloor"
|
|
|
|
- :findGraphyItemId="findGraphyItemId"
|
|
|
|
- :dataKey="dataKey"
|
|
|
|
- :point="point"
|
|
|
|
- :pointWidth="pointWidth"
|
|
|
|
- :cadWidth="720"
|
|
|
|
- :cadHeight="300"
|
|
|
|
- :isScale="true"
|
|
|
|
- ></drawFloor>
|
|
|
|
|
|
+ <drawFloor ref="drawFloor" :findGraphyItemId="findGraphyItemId" :dataKey="dataKey" :point="point" :pointWidth="pointWidth" :cadWidth="720"
|
|
|
|
+ :cadHeight="300" :isScale="true"></drawFloor>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
@@ -47,66 +34,40 @@ export default {
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
- value: "",
|
|
|
|
|
|
+ casVal:[],
|
|
dataKey: "", //url
|
|
dataKey: "", //url
|
|
jsonKey: "", //map.josn
|
|
jsonKey: "", //map.josn
|
|
point: [40703.54760591985, 42678.14510522981], //坐标
|
|
point: [40703.54760591985, 42678.14510522981], //坐标
|
|
pointWidth: 2000,
|
|
pointWidth: 2000,
|
|
findGraphyItemId: "", //高亮的i
|
|
findGraphyItemId: "", //高亮的i
|
|
checkGraphyVisible: false,
|
|
checkGraphyVisible: false,
|
|
|
|
+ options: [],
|
|
props: {
|
|
props: {
|
|
- //联级框
|
|
|
|
- lazy: true,
|
|
|
|
- lazyLoad(node, resolve) {
|
|
|
|
- const { level } = node;
|
|
|
|
- if (level == 0) {
|
|
|
|
- request.queryModel("", res => {
|
|
|
|
- const nodes = Array.from(res.Content).map(item => ({
|
|
|
|
- value: item.Id,
|
|
|
|
- label: item.Name,
|
|
|
|
- leaf: level >= 1
|
|
|
|
- }));
|
|
|
|
- // 通过调用resolve将子节点数据返回,通知组件数据加载完成
|
|
|
|
- resolve(nodes);
|
|
|
|
- });
|
|
|
|
- } else {
|
|
|
|
- // 查询楼层文件
|
|
|
|
- let data = {
|
|
|
|
- FolderId: node.value,
|
|
|
|
- ProjectId: this.projectId
|
|
|
|
- };
|
|
|
|
- request.queryFloorList(data, res => {
|
|
|
|
- const nodes = Array.from(res.Content).map(item => ({
|
|
|
|
- value: item.Url,
|
|
|
|
- label: item.FloorName,
|
|
|
|
- leaf: level >= 1
|
|
|
|
- }));
|
|
|
|
- // 通过调用resolve将子节点数据返回,通知组件数据加载完成
|
|
|
|
- resolve(nodes);
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ value: 'value',
|
|
|
|
+ label: 'label',
|
|
|
|
+ children: 'children'
|
|
},
|
|
},
|
|
- floor:'', // 当前选中的楼层数据
|
|
|
|
|
|
+ floor: '', // 当前选中的楼层数据
|
|
};
|
|
};
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// 弹窗显示
|
|
// 弹窗显示
|
|
- showDialog(floor){
|
|
|
|
|
|
+ showDialog(floor) {
|
|
this.floor = floor;
|
|
this.floor = floor;
|
|
this.checkGraphyVisible = true;
|
|
this.checkGraphyVisible = true;
|
|
},
|
|
},
|
|
// 关闭弹窗
|
|
// 关闭弹窗
|
|
handleClose() {
|
|
handleClose() {
|
|
this.checkGraphyVisible = false;
|
|
this.checkGraphyVisible = false;
|
|
|
|
+ this.casVal = []
|
|
},
|
|
},
|
|
// 更新楼层 平面图文件
|
|
// 更新楼层 平面图文件
|
|
bindGraphy() {
|
|
bindGraphy() {
|
|
- if(!this.jsonKey){
|
|
|
|
|
|
+ if (!this.jsonKey) {
|
|
this.$message.warning("请选择模型文件");
|
|
this.$message.warning("请选择模型文件");
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(!this.floor.StructureInfo){
|
|
|
|
|
|
+ if (!this.floor.StructureInfo) {
|
|
this.floor.StructureInfo = {}
|
|
this.floor.StructureInfo = {}
|
|
}
|
|
}
|
|
this.floor.StructureInfo.FloorMap = this.jsonKey
|
|
this.floor.StructureInfo.FloorMap = this.jsonKey
|
|
@@ -119,15 +80,6 @@ export default {
|
|
this.$emit('refresh')
|
|
this.$emit('refresh')
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- initOption() {
|
|
|
|
- // let data = {
|
|
|
|
- // FloorName: item.FloorLocalName,
|
|
|
|
- // ProjectId: this.projectId
|
|
|
|
- // };
|
|
|
|
- },
|
|
|
|
- queryModel() {
|
|
|
|
- return new Promose((resolve, reject) => {});
|
|
|
|
- },
|
|
|
|
// 点击多级联动
|
|
// 点击多级联动
|
|
handleChange(val) {
|
|
handleChange(val) {
|
|
console.log(val)
|
|
console.log(val)
|
|
@@ -136,15 +88,56 @@ export default {
|
|
this.jsonKey = val[1]
|
|
this.jsonKey = val[1]
|
|
// this.jsonKey = val[1];
|
|
// this.jsonKey = val[1];
|
|
// this.dataKey = `/image-service/common/file_get/${this.jsonKey}?systemId=revit`;
|
|
// this.dataKey = `/image-service/common/file_get/${this.jsonKey}?systemId=revit`;
|
|
- }
|
|
|
|
|
|
+ },
|
|
|
|
+ // 通过id查询文件夹下模型文件
|
|
|
|
+ handleItemChange(val) {
|
|
|
|
+ let data = {
|
|
|
|
+ FolderId: val[0],
|
|
|
|
+ ProjectId: this.projectId
|
|
|
|
+ };
|
|
|
|
+ request.queryFloorList(data, res => {
|
|
|
|
+ let tempArr = res.Content.map(t => {
|
|
|
|
+ return {
|
|
|
|
+ value: t.CurrentModelId,
|
|
|
|
+ label: t.FloorName
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.pushChild(this.options, tempArr, val[0])
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 将模型文件list填到相应的文件夹下
|
|
|
|
+ pushChild(options, arr, Code) {
|
|
|
|
+ options.map(option => {
|
|
|
|
+ if (option.value == Code) {
|
|
|
|
+ option.children = arr;
|
|
|
|
+ } else {
|
|
|
|
+ if (option.children) {
|
|
|
|
+ this.pushChild(option.children, arr, Code)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }) },
|
|
|
|
+ init() {
|
|
|
|
+ this.getDirectory()
|
|
|
|
+ },
|
|
|
|
+ // 获取文件夹
|
|
|
|
+ getDirectory() {
|
|
|
|
+ request.queryModel("", res => {
|
|
|
|
+ this.options = res.Content.map(t => {
|
|
|
|
+ return {
|
|
|
|
+ value: t.Id,
|
|
|
|
+ label: t.Name,
|
|
|
|
+ children: []
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ },
|
|
},
|
|
},
|
|
- mounted() {
|
|
|
|
- this.initOption();
|
|
|
|
|
|
+ created(){
|
|
|
|
+ this.init()
|
|
},
|
|
},
|
|
watch: {
|
|
watch: {
|
|
projectId() {
|
|
projectId() {
|
|
- // todo
|
|
|
|
- this.initOption();
|
|
|
|
|
|
+ this.init()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
};
|