|
|
@@ -1,53 +1,55 @@
|
|
|
<template>
|
|
|
- <card style="font-size:15px">
|
|
|
- <van-row class="row" style="border-bottom:1px solid black">
|
|
|
- <van-col span="16">{{ data.hostName }}</van-col>
|
|
|
- <van-col span="8" style="text-align:right" @click="()=>expanded=!expanded"
|
|
|
-
|
|
|
- >
|
|
|
- <van-tag v-if="data.state == 0" type="success">正常</van-tag>
|
|
|
- <van-tag v-else-if="data.state == 1" type="warning">异常</van-tag>
|
|
|
- <van-tag v-else type="primary">未知</van-tag>
|
|
|
- <van-icon style="margin-left:10px;" :name="expanded ? 'arrow-up' : 'arrow-down'"></van-icon>
|
|
|
- </van-col>
|
|
|
- </van-row>
|
|
|
- <van-row class="row">
|
|
|
- <van-col span="8">所属机构</van-col>
|
|
|
- <van-col span="16" style="text-align:right">{{ data.orgName }}</van-col>
|
|
|
- </van-row>
|
|
|
- <van-row>
|
|
|
- <van-col span="24">
|
|
|
- <span v-show="expanded" class="cell-channel-item" v-for="channel in data.channels" :key="channel.channelCode">
|
|
|
- <van-button
|
|
|
- style="width: 20vw"
|
|
|
- size="small"
|
|
|
- v-if="channel.state == 0"
|
|
|
- type="primary"
|
|
|
- @click="itemClick(data.hostCode, channel.channelCode)"
|
|
|
- >
|
|
|
- {{ '通道' + channel.channelCode }}</van-button
|
|
|
- >
|
|
|
- <van-button
|
|
|
- style="width: 20vw"
|
|
|
- size="small"
|
|
|
- v-else-if="channel.state == 1"
|
|
|
- type="warning"
|
|
|
- @click="itemClick(data.hostCode, channel.channelCode)"
|
|
|
- >
|
|
|
- {{ '通道' + channel.channelCode }}</van-button
|
|
|
- >
|
|
|
- <van-button
|
|
|
- style="width: 20vw"
|
|
|
- size="small"
|
|
|
- v-else-if="channel.state == 2 || channel.state == null"
|
|
|
- type="default"
|
|
|
- @click="itemClick(data.hostCode, channel.channelCode)"
|
|
|
- >
|
|
|
- {{ '通道' + channel.channelCode }}</van-button
|
|
|
- >
|
|
|
- </span>
|
|
|
- </van-col>
|
|
|
- </van-row>
|
|
|
+ <card style="font-size: 15px">
|
|
|
+ <van-cell-group>
|
|
|
+ <van-cell :title="data.hostName">
|
|
|
+ <template #default>
|
|
|
+ <van-tag v-if="data.state == 0" type="success">正常</van-tag>
|
|
|
+ <van-tag v-else-if="data.state == 1" type="warning">异常</van-tag>
|
|
|
+ <van-tag v-else type="primary">未知</van-tag>
|
|
|
+ </template>
|
|
|
+ <template #right-icon>
|
|
|
+ <van-icon
|
|
|
+ style="margin-left: 10px"
|
|
|
+ :name="expanded ? 'arrow-up' : 'arrow-down'"
|
|
|
+ @click="() => (expanded = !expanded)"
|
|
|
+ ></van-icon>
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ <van-cell title="所属机构" :value="data.orgName"></van-cell>
|
|
|
+ <van-cell title-style="display:none" value-class="cell-channel-list">
|
|
|
+ <template #default>
|
|
|
+ <span v-show="expanded" class="cell-channel-item" v-for="channel in data.channels" :key="channel.channelCode">
|
|
|
+ <van-button
|
|
|
+ style="width: 20vw"
|
|
|
+ size="small"
|
|
|
+ v-if="channel.state == 0"
|
|
|
+ type="primary"
|
|
|
+ @click="itemClick(data.hostCode, channel.channelCode)"
|
|
|
+ >
|
|
|
+ {{ '通道' + channel.channelCode }}</van-button
|
|
|
+ >
|
|
|
+ <van-button
|
|
|
+ style="width: 20vw"
|
|
|
+ size="small"
|
|
|
+ v-else-if="channel.state == 1"
|
|
|
+ type="warning"
|
|
|
+ @click="itemClick(data.hostCode, channel.channelCode)"
|
|
|
+ >
|
|
|
+ {{ '通道' + channel.channelCode }}</van-button
|
|
|
+ >
|
|
|
+ <van-button
|
|
|
+ style="width: 20vw"
|
|
|
+ size="small"
|
|
|
+ v-else-if="channel.state == 2 || channel.state == null"
|
|
|
+ type="default"
|
|
|
+ @click="itemClick(data.hostCode, channel.channelCode)"
|
|
|
+ >
|
|
|
+ {{ '通道' + channel.channelCode }}</van-button
|
|
|
+ >
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </van-cell>
|
|
|
+ </van-cell-group>
|
|
|
</card>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -68,10 +70,8 @@ export default {
|
|
|
data: {}
|
|
|
},
|
|
|
methods: {
|
|
|
- itemClick(hostCode,channelCode) {
|
|
|
- this.$router.push(
|
|
|
- `/iot/videoDiagnosis/detail?hostCode=${hostCode}&channelCode=${channelCode}`
|
|
|
- )
|
|
|
+ itemClick(hostCode, channelCode) {
|
|
|
+ this.$router.push(`/iot/videoDiagnosis/detail?hostCode=${hostCode}&channelCode=${channelCode}`)
|
|
|
}
|
|
|
},
|
|
|
async created() {},
|
|
|
@@ -79,11 +79,14 @@ export default {
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
-.row{
|
|
|
+.row {
|
|
|
height: 8vw;
|
|
|
display: flex;
|
|
|
- flex-direction: row;
|
|
|
- align-items: center;
|
|
|
+ flex-direction: row;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.cell-channel-list {
|
|
|
+ width: 100%;
|
|
|
}
|
|
|
.cell-channel-item {
|
|
|
width: 25%;
|