完成承载能力评估联调
This commit is contained in:
@@ -28,10 +28,9 @@ const treeRef = ref()
|
||||
const loadData = () => {
|
||||
let nodeKey = ''
|
||||
carryCapacityTree().then(res => {
|
||||
console.log(res)
|
||||
nodeKey = res.data[0].children[0].children[0].children[0].children[0].children[0].id
|
||||
emit('init', res.data[0].children[0].children[0].children[0].children[0].children[0])
|
||||
tree.value = res.data[0].children[0].children
|
||||
tree.value = res.data[0].children[0].children
|
||||
if (nodeKey) {
|
||||
nextTick(() => {
|
||||
treeRef.value.treeRef.setCurrentKey(nodeKey)
|
||||
@@ -41,6 +40,10 @@ const loadData = () => {
|
||||
})
|
||||
}
|
||||
loadData()
|
||||
const setKey = (key: string) => {
|
||||
treeRef.value.treeRef.setCurrentKey(key)
|
||||
}
|
||||
defineExpose({ setKey })
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.point-tree {
|
||||
@@ -1,30 +1,30 @@
|
||||
<template>
|
||||
<div class="point-tree">
|
||||
<div style="flex: 1; overflow: hidden">
|
||||
<vxe-table
|
||||
ref="tableRef"
|
||||
:data="tree"
|
||||
height="auto"
|
||||
v-bind="defaultAttribute"
|
||||
:tree-config="{ children: 'children', expandAll: true }"
|
||||
>
|
||||
<vxe-column field="name" align="left" title="部门" tree-node></vxe-column>
|
||||
<vxe-column width="200" title="操作">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" size="small" link @click="tactics(row.id, 0)">自动</el-button>
|
||||
<el-button type="primary" size="small" link @click="tactics(row.id, 1)">手动</el-button>
|
||||
<el-button type="primary" size="small" link @click="tactics(row.id, 2)">排除</el-button>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
<el-input
|
||||
v-model="input"
|
||||
style="width: 240px"
|
||||
placeholder="请输入电站数"
|
||||
class="mr10"
|
||||
@input="handleEdit"
|
||||
></el-input>
|
||||
<el-button type="primary" :disabled="!input.length > 0" icon="el-icon-Operation" @click="Tick">
|
||||
按配置勾选
|
||||
</el-button>
|
||||
<el-tree
|
||||
style="height: 550px; overflow-y: auto; overflow-x: hidden"
|
||||
:data="tree"
|
||||
show-checkbox
|
||||
default-expand-all
|
||||
node-key="id"
|
||||
:default-expanded-keys="[2, 3]"
|
||||
:default-checked-keys="[5]"
|
||||
:props="defaultProps"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { nextTick, onMounted, ref, useAttrs } from 'vue'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { ElTree } from 'element-plus'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { initDetpStataionTree } from '@/api/process-boot/generalTest'
|
||||
|
||||
@@ -40,6 +40,7 @@ const dictData = useDictData()
|
||||
const config = useConfig()
|
||||
const tree = ref()
|
||||
const treeRef = ref()
|
||||
const input: any = ref('')
|
||||
|
||||
const loadData = () => {
|
||||
let nodeKey = ''
|
||||
@@ -48,6 +49,9 @@ const loadData = () => {
|
||||
tree.value = res.data
|
||||
})
|
||||
}
|
||||
const handleEdit = () => {}
|
||||
// 配置
|
||||
const Tick = () => {}
|
||||
const tactics = (deptId, grade) => {
|
||||
emit('tactics', deptId, grade)
|
||||
}
|
||||
@@ -55,21 +59,9 @@ loadData()
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.point-tree {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 10px;
|
||||
background: #fff;
|
||||
border: 1px solid var(--el-border-color);
|
||||
}
|
||||
.custom {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
width: 100%;
|
||||
padding-right: 20px;
|
||||
// font-size: 14px;
|
||||
// padding-right: 8px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user