设备监控问题修改

This commit is contained in:
zhujiyan
2024-09-25 16:31:45 +08:00
parent 470c8f5bd6
commit 96602ffe04
15 changed files with 467 additions and 531 deletions

View File

@@ -5,11 +5,12 @@
:default-checked-keys="defaultCheckedKeys"
:show-checkbox="props.showCheckbox"
:data="tree"
@changeDeviceType="changeDeviceType"
/>
</template>
<script lang="ts" setup>
import { ref, nextTick } from 'vue'
import { ref, nextTick, defineEmits } from 'vue'
import Tree from '../device.vue'
import { getDeviceTree } from '@/api/cs-device-boot/csLedger'
import { useConfig } from '@/stores/config'
@@ -26,13 +27,14 @@ const props = withDefaults(
defaultCheckedKeys: []
}
)
const emit = defineEmits(['init', 'checkChange'])
const emit = defineEmits(['init', 'checkChange','deviceTypeChange'])
const config = useConfig()
const tree = ref()
const treRef = ref()
const changeDeviceType = (val: any, obj: any) => {
emit('deviceTypeChange', val, obj)
}
getDeviceTree().then(res => {
console.log(res, '000000')
let arr: any[] = []
//治理设备
res.data.map((item: any) => {
@@ -77,7 +79,6 @@ getDeviceTree().then(res => {
tree.value = res.data
nextTick(() => {
if (arr.length) {
console.log(treRef.value.treeRef1, '99999999')
treRef.value.treeRef1.setCurrentKey(arr[0].id)
// 注册父组件事件
emit('init', {