修改测试bug
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
<template>
|
||||
<Tree ref="treRef" @check-change="handleCheckChange" :default-checked-keys="defaultCheckedKeys"
|
||||
<Tree ref="treRef" @check-change="handleCheckChange" :default-checked-keys="defaultCheckedKeys" default-expand-all
|
||||
:show-checkbox="props.showCheckbox" :data="tree" :height="props.height" @changeDeviceType="changeDeviceType"
|
||||
@changeTreeType="loadTree" :engineering="props.engineering" leaf-mode="device" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted } from 'vue'
|
||||
import { throttle } from 'lodash'
|
||||
import { ref, onMounted, onBeforeUnmount } from 'vue'
|
||||
import { debounce } from 'lodash-es'
|
||||
import Tree from '../device.vue'
|
||||
import { getDeviceTree } from '@/api/cs-device-boot/csLedger'
|
||||
import { useConfig } from '@/stores/config'
|
||||
@@ -39,7 +39,11 @@ const tree = ref<any[]>([])
|
||||
const treRef = ref<InstanceType<typeof Tree>>()
|
||||
const decorators = createLineTreeDecorators(() => config.getColorVal('elementUiPrimary'))
|
||||
|
||||
const changeDeviceType = (val: any, obj: any) => emit('deviceTypeChange', val, obj)
|
||||
const changeDeviceType = debounce((val: any, obj: any) => {
|
||||
emit('deviceTypeChange', val, obj)
|
||||
}, 300)
|
||||
|
||||
onBeforeUnmount(() => changeDeviceType.cancel())
|
||||
|
||||
async function selectInitialNode(type: string | undefined, leaves: LineTreeLeaves) {
|
||||
const candidates: { refKey: TreeRefKey; list: any[]; level: number }[] =
|
||||
@@ -70,7 +74,7 @@ const loadTree = (type?: string) => {
|
||||
})
|
||||
}
|
||||
|
||||
onMounted(() => loadTree(props.engineering ? '2' : '1'))
|
||||
onMounted(() => loadTree( '2' ))
|
||||
|
||||
const handleCheckChange =
|
||||
(data: any, checked: any, indeterminate: any) => {
|
||||
|
||||
Reference in New Issue
Block a user