|
@@ -87,6 +87,7 @@ export default {
|
|
|
modelId: '', //
|
|
|
isEdit: false, // 是否编辑模式
|
|
|
FloorID: '',
|
|
|
+ currentModelId: null, // 当前楼层
|
|
|
file: {},
|
|
|
alreadyRelatedModel: [],
|
|
|
sign: false,
|
|
@@ -149,7 +150,7 @@ export default {
|
|
|
},
|
|
|
// 替换模型文件
|
|
|
changeGraphy() {
|
|
|
- this.$refs.checkGraphy.showDialog({ FloorID: this.FloorID, BuildID: this.BuildID })
|
|
|
+ this.$refs.checkGraphy.showDialog({ FloorID: this.FloorID, BuildID: this.BuildID, CurrentModelId: this.currentModelId })
|
|
|
},
|
|
|
// 确认保存
|
|
|
confirm() {
|
|
@@ -191,14 +192,22 @@ export default {
|
|
|
editGraphy() {
|
|
|
this.isEdit = true
|
|
|
},
|
|
|
- // 替换模型文件成功
|
|
|
- refresh(modelId) {
|
|
|
+ // 替换模型文件成功.第二个参数只在替换模型文件的时候会有
|
|
|
+ refresh(modelId, pa) {
|
|
|
+ // 替换成图片或者模型 模型应该是模型id不会有json的
|
|
|
this.modelId = modelId
|
|
|
this.hasGraph = true;
|
|
|
const temp = this.modelId.split('.');
|
|
|
- if (temp[1] && temp[1].toLowerCase() != 'png' && temp[1].toLowerCase() != 'jpg') {
|
|
|
+ if (temp[1]) {
|
|
|
+ if (temp[1].toLowerCase() != 'png' && temp[1].toLowerCase() != 'jpg') {
|
|
|
+ // do nothing
|
|
|
+ } else {
|
|
|
+ // do nothing
|
|
|
+ }
|
|
|
+ } else {
|
|
|
this.key = '';
|
|
|
- this.getFileName(this.modelId)
|
|
|
+ pa && pa.Id && this.getFileName(pa.Id)
|
|
|
+ this.initFromModelId(this.modelId)
|
|
|
}
|
|
|
},
|
|
|
// 获取文件夹名称
|
|
@@ -230,6 +239,7 @@ export default {
|
|
|
this.alreadyRelatedModel = res.Content.map((t) => {
|
|
|
if (t.FloorID != this.FloorID) return t.ModelId
|
|
|
this.sign = t.Sign > 0
|
|
|
+ this.currentModelId = t.ModelId;
|
|
|
t.ModelId && this.getFileName(t.ModelId)
|
|
|
}).filter((t) => t)
|
|
|
})
|
|
@@ -469,16 +479,16 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- modelId(n, o) {
|
|
|
- if (n != o) {
|
|
|
- if (n) {
|
|
|
- // 替换的时候需要走
|
|
|
- this.$nextTick(() => {
|
|
|
- this.initFromModelId(n)
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
+ // modelId(n, o) {
|
|
|
+ // if (n != o) {
|
|
|
+ // if (n) {
|
|
|
+ // // 替换的时候需要走
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.initFromModelId(n)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // },
|
|
|
},
|
|
|
}
|
|
|
</script>
|