|
@@ -25,14 +25,16 @@
|
|
|
<div class="typeli">
|
|
|
<i
|
|
|
class="iconfont iconscene_map_3d"
|
|
|
- :class="{ iconjump: item.type !== 'house' }"
|
|
|
+ :class="{ iconjump: item.type != 'house'&&item.byType!='garden' }"
|
|
|
></i>
|
|
|
</div>
|
|
|
<div class="img">
|
|
|
- <img :src="item.icon" alt="">
|
|
|
+ <img :key="i" :src="`${item.icon}?rnd=${Math.random()}`" alt="" />
|
|
|
</div>
|
|
|
<div class="ui-title">
|
|
|
- <span>{{item.type=='house'?item.roomName:item.sceneTitle}}</span>
|
|
|
+ <span>{{
|
|
|
+ item.type == "house" ? item.roomName : item.sceneTitle
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
</li>
|
|
|
</ul>
|
|
@@ -41,7 +43,7 @@
|
|
|
</Select>
|
|
|
</div>
|
|
|
|
|
|
- <div class="dialog" style="z-index:2000" v-if="huxingshow">
|
|
|
+ <div class="dialog" style="z-index: 2000" v-if="huxingshow">
|
|
|
<Select
|
|
|
:houseList="houseList"
|
|
|
@updateList="updateHX"
|
|
@@ -138,10 +140,11 @@ import Combox from "@/components/shared/Combox";
|
|
|
|
|
|
import {
|
|
|
saveSomeData,
|
|
|
- getPanoList,
|
|
|
+ getSearchPanoList,
|
|
|
getHouseNameList,
|
|
|
getHouseList,
|
|
|
saveHouse,
|
|
|
+ savePanoHouse,
|
|
|
} from "@/api";
|
|
|
|
|
|
export default {
|
|
@@ -168,11 +171,15 @@ export default {
|
|
|
houseActive: 0,
|
|
|
houseDataActive: "",
|
|
|
houseList: [],
|
|
|
- hasChange:false,
|
|
|
+ hasChange: false,
|
|
|
huxing: {
|
|
|
sceneName: "",
|
|
|
roomId: "",
|
|
|
},
|
|
|
+ gardenHX: {
|
|
|
+ sceneName: "",
|
|
|
+ roomId: "",
|
|
|
+ },
|
|
|
reNameItem: {
|
|
|
id: "",
|
|
|
reName: "",
|
|
@@ -186,6 +193,7 @@ export default {
|
|
|
showSize: 8,
|
|
|
current: 1,
|
|
|
},
|
|
|
+ type: "",
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -206,7 +214,7 @@ export default {
|
|
|
});
|
|
|
this.activeItem = tmp;
|
|
|
},
|
|
|
- "paging.pageNum": function() {
|
|
|
+ "paging.pageNum": function () {
|
|
|
this.getHouseList();
|
|
|
},
|
|
|
showAddHouse(newVal) {
|
|
@@ -217,14 +225,12 @@ export default {
|
|
|
size: 1000,
|
|
|
},
|
|
|
(res) => {
|
|
|
- this.houseNameList = res.data
|
|
|
- ? res.data.records
|
|
|
- : [];
|
|
|
+ this.houseNameList = res.data ? res.data.records : [];
|
|
|
if (this.huxing.roomId) {
|
|
|
this.houseActive = this.houseNameList.findIndex(
|
|
|
(item) => this.huxing.roomId == item.id
|
|
|
);
|
|
|
- }
|
|
|
+ }
|
|
|
this.houseDataActive = this.houseNameList[this.houseActive];
|
|
|
}
|
|
|
);
|
|
@@ -234,6 +240,8 @@ export default {
|
|
|
if (newVal) {
|
|
|
this.searchKey = "";
|
|
|
this.getPanoList();
|
|
|
+ } else {
|
|
|
+ this.activeId = "";
|
|
|
}
|
|
|
},
|
|
|
huxingshow(newVal) {
|
|
@@ -245,12 +253,12 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
- updateHX(data){
|
|
|
- this.hxsearchKey = data
|
|
|
+ updateHX(data) {
|
|
|
+ this.hxsearchKey = data;
|
|
|
this.getHouseList();
|
|
|
},
|
|
|
- updateScene(data){
|
|
|
- this.searchKey = data
|
|
|
+ updateScene(data) {
|
|
|
+ this.searchKey = data;
|
|
|
this.getPanoList();
|
|
|
},
|
|
|
handleShow(data) {
|
|
@@ -261,20 +269,27 @@ export default {
|
|
|
this.paging.pageNum = data;
|
|
|
},
|
|
|
handleAddvr(data) {
|
|
|
- this.showAddHouse = true;
|
|
|
+ this.type = data.type;
|
|
|
this.currentId = "";
|
|
|
- this.huxing = {
|
|
|
- sceneName: "",
|
|
|
- roomId: "",
|
|
|
- };
|
|
|
-
|
|
|
- if (data) {
|
|
|
- this.huxing.roomId = data.roomId;
|
|
|
- this.huxing.sceneName = data.sceneTitle;
|
|
|
- this.huxing.id = data.vrModelId;
|
|
|
- this.huxing.webSite = data.webSite;
|
|
|
- this.huxing.num = data.sceneCode;
|
|
|
- this.currentId = data.id;
|
|
|
+ if (data.type == "house") {
|
|
|
+ this.showAddHouse = true;
|
|
|
+ this.huxing = {
|
|
|
+ sceneName: "",
|
|
|
+ roomId: "",
|
|
|
+ };
|
|
|
+ if (data.data) {
|
|
|
+ this.huxing.roomId = data.data.roomId;
|
|
|
+ this.huxing.sceneName = data.data.sceneTitle;
|
|
|
+ this.huxing.id = data.data.vrModelId;
|
|
|
+ this.huxing.webSite = data.data.webSite;
|
|
|
+ this.huxing.num = data.data.sceneCode;
|
|
|
+ this.currentId = data.data.id;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.huxingshow = true;
|
|
|
+ if (data.data) {
|
|
|
+ this.currentId = data.data.id;
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
getHouseList() {
|
|
@@ -295,7 +310,7 @@ export default {
|
|
|
onHouseChange(data, index) {
|
|
|
this.houseActive = index;
|
|
|
this.houseDataActive = data;
|
|
|
- this.hasChange = true
|
|
|
+ this.hasChange = true;
|
|
|
},
|
|
|
onRename(data) {
|
|
|
this.reNameItem.id = data.id;
|
|
@@ -320,58 +335,92 @@ export default {
|
|
|
},
|
|
|
|
|
|
handleHouse() {
|
|
|
-
|
|
|
- if (!this.huxing.id||!(this.houseDataActive&&this.houseDataActive.id)) {
|
|
|
- return this.$alert({ content: "请选择样板间名称和VR模型" });
|
|
|
- }
|
|
|
+ if (
|
|
|
+ !this.huxing.id ||
|
|
|
+ !(this.houseDataActive && this.houseDataActive.id)
|
|
|
+ ) {
|
|
|
+ return this.$alert({ content: "请选择样板间名称和VR模型" });
|
|
|
+ }
|
|
|
|
|
|
- if (!this.hasChange) {
|
|
|
- return this.showAddHouse = false;
|
|
|
+ if (!this.hasChange) {
|
|
|
+ return (this.showAddHouse = false);
|
|
|
+ }
|
|
|
+
|
|
|
+ saveHouse(
|
|
|
+ {
|
|
|
+ icon: this.huxing.thumb,
|
|
|
+ roomId: this.houseDataActive && this.houseDataActive.id,
|
|
|
+ roomName: this.houseDataActive && this.houseDataActive.name,
|
|
|
+ id: this.currentId || null,
|
|
|
+ sceneTitle: this.huxing.sceneName,
|
|
|
+ vrModelId: this.huxing.id,
|
|
|
+ webSite: this.huxing.webSite,
|
|
|
+ sceneCode: this.huxing.num,
|
|
|
+ },
|
|
|
+ (res) => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.$tips({
|
|
|
+ content: this.currentId ? "修改成功" : "添加成功",
|
|
|
+ icon: "ok",
|
|
|
+ });
|
|
|
+ this.hasChange = false;
|
|
|
+ this.huxingshow = false;
|
|
|
+ this.showAddHouse = false;
|
|
|
+ this.$bus.emit("refresh");
|
|
|
+ } else {
|
|
|
+ return this.$alert({ content: res.msg });
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- saveHouse(
|
|
|
- {
|
|
|
- icon: this.huxing.thumb,
|
|
|
- roomId: (this.houseDataActive&&this.houseDataActive.id),
|
|
|
- roomName: (this.houseDataActive&&this.houseDataActive.name),
|
|
|
- id: this.currentId || null,
|
|
|
- sceneTitle: this.huxing.sceneName,
|
|
|
- vrModelId: this.huxing.id,
|
|
|
- webSite: this.huxing.webSite,
|
|
|
- sceneCode: this.huxing.num,
|
|
|
- },
|
|
|
- (res) => {
|
|
|
- if (res.code == 0) {
|
|
|
- this.$tips({
|
|
|
- content: this.currentId ? "修改成功" : "添加成功",
|
|
|
- icon: "ok",
|
|
|
- });
|
|
|
- this.hasChange = false
|
|
|
- this.huxingshow = false;
|
|
|
- this.showAddHouse = false;
|
|
|
- this.$bus.emit("refresh");
|
|
|
- } else {
|
|
|
- return this.$alert({ content: res.msg });
|
|
|
- }
|
|
|
+ );
|
|
|
+ },
|
|
|
+
|
|
|
+ handlePanoHouse() {
|
|
|
+ savePanoHouse(
|
|
|
+ {
|
|
|
+ icon: this.gardenHX.thumb,
|
|
|
+ fileName: this.gardenHX.sceneName,
|
|
|
+ id: this.currentId || null,
|
|
|
+ sceneTitle: this.gardenHX.sceneName,
|
|
|
+ vrModelId: this.gardenHX.id,
|
|
|
+ sceneCode: this.gardenHX.num,
|
|
|
+ },
|
|
|
+ (res) => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.$tips({
|
|
|
+ content: this.currentId ? "修改成功" : "添加成功",
|
|
|
+ icon: "ok",
|
|
|
+ });
|
|
|
+ this.hasChange = false;
|
|
|
+ this.huxingshow = false;
|
|
|
+ this.$bus.emit("refresh");
|
|
|
+ } else {
|
|
|
+ return this.$alert({ content: res.msg });
|
|
|
}
|
|
|
- );
|
|
|
+ }
|
|
|
+ );
|
|
|
},
|
|
|
selectHX(data) {
|
|
|
- this.hasChange = true
|
|
|
- this.huxing = data;
|
|
|
+ this.hasChange = true;
|
|
|
this.huxingshow = false;
|
|
|
+ if (this.type == "house") {
|
|
|
+ this.huxing = data;
|
|
|
+ } else {
|
|
|
+ this.gardenHX = data;
|
|
|
+ this.handlePanoHouse()
|
|
|
+ }
|
|
|
},
|
|
|
+
|
|
|
handelSelect() {
|
|
|
this.$bus.emit("updateParams", {
|
|
|
id: this.activeItem.id,
|
|
|
isIndex: 1,
|
|
|
});
|
|
|
- this.$bus.emit('initScene',this.activeItem)
|
|
|
+ this.$bus.emit("initScene", this.activeItem);
|
|
|
this.$bus.emit("getInitScene", this.activeItem);
|
|
|
this.show = false;
|
|
|
},
|
|
|
getPanoList() {
|
|
|
- getPanoList(
|
|
|
+ getSearchPanoList(
|
|
|
{
|
|
|
pageNum: 1,
|
|
|
pageSize: 1000,
|