This commit is contained in:
lxj
2025-09-09 06:26:29 +08:00
2 changed files with 44 additions and 19 deletions

View File

@@ -83,19 +83,36 @@ onMounted(loadChannelTree);
@check="$emit('checked')" @check="$emit('checked')"
@select="onSelect" @select="onSelect"
> >
<template #title="{ label, level, key }"> <template #title="{ label, level, key, data: { data } }">
<div class="flex"> <div class="flex">
<!-- 通道节点显示图标 --> <!-- 通道节点显示图标 -->
<div v-if="level == 2" class="tree-icon"> <div v-if="level == 2" class="tree-icon">
<!-- --> <!-- 在线图标 -->
<div
v-if="data && data.channelState == 1"
class="h-full w-full"
>
<!-- 播放中的设备 -->
<div <div
v-if="selectKeys.indexOf(key) > -1" v-if="selectKeys.indexOf(key) > -1"
class="icon playing" class="icon playing"
></div> ></div>
<!-- 未播放的设备 -->
<div v-else class="icon unplay"></div> <div v-else class="icon unplay"></div>
</div> </div>
<!-- 离线的设备 -->
<div v-else class="icon offLine"></div>
</div>
<span :style="currentSelectKey == key ? 'color:blue' : ''"> <div>
<span v-if="data && data.channelState == 0">
<span style="color: red">{{ label }}</span>
</span>
<span
v-else
:style="currentSelectKey == key ? 'color:blue' : ''"
>
<span v-if="label.indexOf(searchValue) > -1"> <span v-if="label.indexOf(searchValue) > -1">
{{ label.substring(0, label.indexOf(searchValue)) }} {{ label.substring(0, label.indexOf(searchValue)) }}
<span style="color: #f50">{{ searchValue }}</span> <span style="color: #f50">{{ searchValue }}</span>
@@ -107,10 +124,11 @@ onMounted(loadChannelTree);
</span> </span>
<span v-else> <span v-else>
<span>{{ label }}</span> <span>{{ data }}</span>
</span> </span>
</span> </span>
</div> </div>
</div>
</template> </template>
</Tree> </Tree>
</div> </div>
@@ -138,5 +156,12 @@ onMounted(loadChannelTree);
background: url('/src/assets/tree/playering.png') no-repeat; background: url('/src/assets/tree/playering.png') no-repeat;
background-size: 100% 100%; background-size: 100% 100%;
} }
.offLine {
width: 100%;
height: 100%;
background: url('/src/assets/tree/player-err.png') no-repeat;
background-size: 100% 100%;
}
} }
</style> </style>

View File

@@ -27,7 +27,7 @@ export default defineConfig(async () => {
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''), rewrite: (path) => path.replace(/^\/api/, ''),
// mock代理目标地址 // mock代理目标地址
target: 'http://localhost:8080', target: 'http://183.230.235.66:11010/api',
ws: true, ws: true,
}, },
}, },