|
@@ -11,14 +11,14 @@
|
|
</Row>
|
|
</Row>
|
|
</template>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
|
+ import _ from 'lodash-es';
|
|
import { Row, Col } from 'ant-design-vue';
|
|
import { Row, Col } from 'ant-design-vue';
|
|
import { BasicTree } from '/@/components/Tree';
|
|
import { BasicTree } from '/@/components/Tree';
|
|
import type { TreeProps } from 'ant-design-vue';
|
|
import type { TreeProps } from 'ant-design-vue';
|
|
import { BillboardType, DEFAULT_TEST_DATA, VENTILATION_STATUS_HEADER_CONFIG, VENTILATION_STATUS_TREE_CONFIG } from '../billboard.data';
|
|
import { BillboardType, DEFAULT_TEST_DATA, VENTILATION_STATUS_HEADER_CONFIG, VENTILATION_STATUS_TREE_CONFIG } from '../billboard.data';
|
|
import MiniBoard from './MiniBoard.vue';
|
|
import MiniBoard from './MiniBoard.vue';
|
|
- import { onMounted, ref, shallowRef } from 'vue';
|
|
|
|
- import CommonTitle from './CommonTitle.vue';
|
|
|
|
- import _ from 'lodash-es';
|
|
|
|
|
|
+ import { ref, shallowRef, watch } from 'vue';
|
|
|
|
+ // import CommonTitle from './CommonTitle.vue';
|
|
// import mapComponent from './components/3Dmap/index.vue';
|
|
// import mapComponent from './components/3Dmap/index.vue';
|
|
|
|
|
|
const props = withDefaults(
|
|
const props = withDefaults(
|
|
@@ -36,14 +36,15 @@
|
|
const expandedKeys = ref<string[]>([]);
|
|
const expandedKeys = ref<string[]>([]);
|
|
|
|
|
|
function fetchData() {
|
|
function fetchData() {
|
|
- const info = props.data.ventInfo || DEFAULT_TEST_DATA.ventInfo;
|
|
|
|
|
|
+ const info = props.data.ventInfo;
|
|
|
|
+ if (!info) return;
|
|
const { prefix, suffix, prop, children } = VENTILATION_STATUS_TREE_CONFIG;
|
|
const { prefix, suffix, prop, children } = VENTILATION_STATUS_TREE_CONFIG;
|
|
// ventilatorCount.value = info.fanMainList.length.toString();
|
|
// ventilatorCount.value = info.fanMainList.length.toString();
|
|
headerData.value = info;
|
|
headerData.value = info;
|
|
expandedKeys.value = [];
|
|
expandedKeys.value = [];
|
|
|
|
|
|
// 处理树状图的数据
|
|
// 处理树状图的数据
|
|
- treeData.value = info.fanMainList.map((mainfan, i) => {
|
|
|
|
|
|
+ treeData.value = _.get(info, 'fanMainList', []).map((mainfan, i) => {
|
|
expandedKeys.value.push(i.toString());
|
|
expandedKeys.value.push(i.toString());
|
|
return {
|
|
return {
|
|
title: `${prefix}${mainfan[prop]}${suffix}`,
|
|
title: `${prefix}${mainfan[prop]}${suffix}`,
|
|
@@ -67,9 +68,14 @@
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
- onMounted(() => {
|
|
|
|
- fetchData();
|
|
|
|
- });
|
|
|
|
|
|
+ watch(
|
|
|
|
+ () => props.data,
|
|
|
|
+ () => {
|
|
|
|
+ console.log('debug');
|
|
|
|
+ fetchData();
|
|
|
|
+ },
|
|
|
|
+ { immediate: true }
|
|
|
|
+ );
|
|
</script>
|
|
</script>
|
|
<style lang="less" scoped>
|
|
<style lang="less" scoped>
|
|
.ventilate-status-card {
|
|
.ventilate-status-card {
|
|
@@ -85,7 +91,7 @@
|
|
// }
|
|
// }
|
|
|
|
|
|
.ventilate-status-card__tree {
|
|
.ventilate-status-card__tree {
|
|
- height: 1650px;
|
|
|
|
|
|
+ height: 160px;
|
|
overflow: auto;
|
|
overflow: auto;
|
|
}
|
|
}
|
|
}
|
|
}
|