|
@@ -1,30 +1,18 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="ele-body">
|
|
<div class="ele-body">
|
|
|
<el-card shadow="never" v-loading="loading">
|
|
<el-card shadow="never" v-loading="loading">
|
|
|
- <ele-split-layout
|
|
|
|
|
- width="266px"
|
|
|
|
|
- allow-collapse
|
|
|
|
|
- :right-style="{ overflow: 'hidden' }"
|
|
|
|
|
- >
|
|
|
|
|
|
|
+ <ele-split-layout width="266px" allow-collapse :right-style="{ overflow: 'hidden' }">
|
|
|
<div>
|
|
<div>
|
|
|
<div class="ele-border-lighter sys-organization-list">
|
|
<div class="ele-border-lighter sys-organization-list">
|
|
|
- <AssetTree
|
|
|
|
|
- @handleNodeClick="handleNodeClick"
|
|
|
|
|
- @setRootId="setRootId"
|
|
|
|
|
- id="26"
|
|
|
|
|
- :paramsType="'type'"
|
|
|
|
|
- ref="treeList"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <AssetTree @handleNodeClick="handleNodeClick" @setRootId="setRootId" id="26" :paramsType="'type'"
|
|
|
|
|
+ ref="treeList" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <template v-slot:content>
|
|
|
|
|
- <equipment-list
|
|
|
|
|
- v-if="current"
|
|
|
|
|
- :category-id="current.id"
|
|
|
|
|
- :root-id="rootId"
|
|
|
|
|
- :current="current"
|
|
|
|
|
- ref="listRef"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <template v-slot:content v-if="current">
|
|
|
|
|
+ <equipment-list :category-id="current.id" :root-id="rootId" :current="current" ref="listRef" />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-slot:content v-else>
|
|
|
|
|
+ <el-empty :image-size="200" description='暂无数据'></el-empty>
|
|
|
</template>
|
|
</template>
|
|
|
</ele-split-layout>
|
|
</ele-split-layout>
|
|
|
</el-card>
|
|
</el-card>
|
|
@@ -32,56 +20,54 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
- import AssetTree from '@/components/AssetTree';
|
|
|
|
|
- import EquipmentList from './components/equipment-list.vue';
|
|
|
|
|
- export default {
|
|
|
|
|
- components: {
|
|
|
|
|
- AssetTree,
|
|
|
|
|
- EquipmentList
|
|
|
|
|
- },
|
|
|
|
|
- data() {
|
|
|
|
|
- return {
|
|
|
|
|
- // 加载状态
|
|
|
|
|
- loading: false,
|
|
|
|
|
- // 表格选中数据
|
|
|
|
|
- selection: [],
|
|
|
|
|
- current: null,
|
|
|
|
|
- rootId: null
|
|
|
|
|
- };
|
|
|
|
|
|
|
+import AssetTree from '@/components/AssetTree';
|
|
|
|
|
+import EquipmentList from './components/equipment-list.vue';
|
|
|
|
|
+export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ AssetTree,
|
|
|
|
|
+ EquipmentList
|
|
|
|
|
+ },
|
|
|
|
|
+ data() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ // 加载状态
|
|
|
|
|
+ loading: false,
|
|
|
|
|
+ // 表格选中数据
|
|
|
|
|
+ selection: [],
|
|
|
|
|
+ current: null,
|
|
|
|
|
+ rootId: null
|
|
|
|
|
+ };
|
|
|
|
|
+ },
|
|
|
|
|
+ computed: {},
|
|
|
|
|
+ methods: {
|
|
|
|
|
+ handleNodeClick(info) {
|
|
|
|
|
+ console.log(info);
|
|
|
|
|
+ this.current = info;
|
|
|
|
|
+ this.$nextTick(() => {
|
|
|
|
|
+ this.$refs.listRef.sucesstion(false);
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
- computed: {},
|
|
|
|
|
- methods: {
|
|
|
|
|
- handleNodeClick(info) {
|
|
|
|
|
- console.log(info);
|
|
|
|
|
- this.current = info;
|
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
|
- this.$refs.listRef.sucesstion(false);
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- // 获取根节点id
|
|
|
|
|
- setRootId(id) {
|
|
|
|
|
- this.rootId = id;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 获取根节点id
|
|
|
|
|
+ setRootId(id) {
|
|
|
|
|
+ this.rootId = id;
|
|
|
}
|
|
}
|
|
|
- };
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+};
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
|
- .sys-organization-list {
|
|
|
|
|
- position: absolute;
|
|
|
|
|
- top: 0;
|
|
|
|
|
- bottom: 0;
|
|
|
|
|
- left: 0;
|
|
|
|
|
- right: 0;
|
|
|
|
|
- box-sizing: border-box;
|
|
|
|
|
- border-width: 1px;
|
|
|
|
|
- border-style: solid;
|
|
|
|
|
- overflow: auto;
|
|
|
|
|
- }
|
|
|
|
|
- .sys-organization-list :deep(.el-tree-node__content) {
|
|
|
|
|
- height: 40px;
|
|
|
|
|
- & > .el-tree-node__expand-icon {
|
|
|
|
|
- margin-left: 10px;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+.sys-organization-list {
|
|
|
|
|
+ height: calc(100vh - 264px);
|
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
|
+ border-width: 1px;
|
|
|
|
|
+ border-style: solid;
|
|
|
|
|
+ overflow: auto;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+.sys-organization-list :deep(.el-tree-node__content) {
|
|
|
|
|
+ height: 40px;
|
|
|
|
|
+
|
|
|
|
|
+ &>.el-tree-node__expand-icon {
|
|
|
|
|
+ margin-left: 10px;
|
|
|
}
|
|
}
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|