|
@@ -21,7 +21,7 @@
|
|
|
<div class="space-function-item">
|
|
|
<div class="space-function-label">空间名称</div>
|
|
|
<div class="space-function-value">
|
|
|
- <el-input v-model="room.name" disabled></el-input>
|
|
|
+ <el-input v-model="room.roomNumber" disabled></el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="space-function-item">
|
|
@@ -78,7 +78,7 @@
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
- getProjectTreeList,
|
|
|
+ getProjectRoomTreeList,
|
|
|
getHouseDetailById,
|
|
|
updateHouse
|
|
|
} from '@/httpApi/space'
|
|
@@ -98,7 +98,7 @@
|
|
|
treeData: [],
|
|
|
defaultProps: {
|
|
|
children: 'children',
|
|
|
- label: 'name'
|
|
|
+ label: 'optionName'
|
|
|
},
|
|
|
projectItem: {},
|
|
|
nullType: '',
|
|
@@ -121,20 +121,18 @@
|
|
|
},
|
|
|
methods: {
|
|
|
init() {
|
|
|
- getProjectTreeList(this.$store.getters.project.id).then(res => {
|
|
|
+ getProjectRoomTreeList(this.$store.getters.project.id).then(res => {
|
|
|
if (res.state) {
|
|
|
- let list = roomList(res.data.projectItemList, 'room');
|
|
|
- console.log(list);
|
|
|
- return;
|
|
|
+ let list = roomList(res.data.projectItemList);
|
|
|
let item = list.filter(item => {
|
|
|
if (!item.projectItemTargetList) return false;
|
|
|
- if (item.projectItemTargetList.length === 0) return false;
|
|
|
- let target = item.projectItemTargetList.filter(target => {
|
|
|
+ item.projectItemTargetList = item.projectItemTargetList.filter(target => {
|
|
|
if (!target.projectItemTargetRoomList) return false;
|
|
|
if (target.projectItemTargetRoomList.length === 0) return false;
|
|
|
return true;
|
|
|
})
|
|
|
- return target.length > 0
|
|
|
+ if (item.projectItemTargetList.length === 0) return false;
|
|
|
+ return item.projectItemTargetList.length > 0
|
|
|
})
|
|
|
this.treeData = [{
|
|
|
id: -1,
|
|
@@ -167,8 +165,8 @@
|
|
|
getHouseDetailById(item.roomId).then(res => {
|
|
|
if (res.state) {
|
|
|
this.room = res.data;
|
|
|
- if (res.data.value) {
|
|
|
- this.roomData = JSON.parse(res.data.value);
|
|
|
+ if (res.data.dataValue) {
|
|
|
+ this.roomData = JSON.parse(res.data.dataValue);
|
|
|
this.form.color = this.roomData.roomColor;
|
|
|
} else {
|
|
|
this.roomData = {};
|
|
@@ -228,7 +226,7 @@
|
|
|
this.roomData['roomColor'] = this.form.color;
|
|
|
updateHouse({
|
|
|
id: this.room.id,
|
|
|
- value: JSON.stringify(this.roomData)
|
|
|
+ dataValue: JSON.stringify(this.roomData)
|
|
|
}).then(res => {
|
|
|
if (res.state) {
|
|
|
this.$message.success('保存成功');
|
|
@@ -249,6 +247,7 @@
|
|
|
},
|
|
|
roomSaved: data => {
|
|
|
this.roomData = data;
|
|
|
+ this.positionData = [];
|
|
|
},
|
|
|
click: data => {
|
|
|
if (!this.isSet) return;
|