|
|
@@ -0,0 +1,214 @@
|
|
|
+<template>
|
|
|
+ <a-row>
|
|
|
+ <a-col :span="13">
|
|
|
+ <a-card title="调试输出" style="background-color: #eef0f5;">
|
|
|
+ <a-row>
|
|
|
+ <a-col :span="6" class="app-imitate" >应用模拟器</a-col>
|
|
|
+ <a-col :span="3" class="app-to-platform" >
|
|
|
+ <div class="equipment-platform" >
|
|
|
+ <div class="border-dot-top">命令下发</div>
|
|
|
+ <div class="border-dot-bottom">数据上报</div>
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6" class="IOT" >IOT平台</a-col>
|
|
|
+ <a-col :span="3" class="app-to-platform" >
|
|
|
+ <div class="equipment-platform" >
|
|
|
+ <div class="border-dot-top">命令下发</div>
|
|
|
+ <div class="border-dot-bottom">数据上报</div>
|
|
|
+ </div>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="6" class="device-imitate" >设备模拟器</a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-row style="height: 505px;width: 100%" justify="space-between" >
|
|
|
+ <a-col :span="11" style="height: 100%;background-color: #fff" ></a-col>
|
|
|
+ <a-col :span="11" style='background-color: #fff;eight: 100%' ></a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-card>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="9">
|
|
|
+ <a-row justify='end' >
|
|
|
+ <a-col>
|
|
|
+ <a-button type="link" >{{state.device.deviceLabel ? state.device.deviceLabel : "尚未选择产品"}}</a-button>
|
|
|
+ <a-button type="primary" @click="state.drawerVisible = true" >选择设备</a-button>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ <a-card
|
|
|
+ style="width: 100%;height: 100%;margin-top: 10px;"
|
|
|
+ :tab-list="tabListNoTitle"
|
|
|
+ :active-tab-key="state.activeKey"
|
|
|
+ @tabChange="onTabChange"
|
|
|
+ >
|
|
|
+ <div></div>
|
|
|
+ </a-card>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+
|
|
|
+<a-drawer
|
|
|
+ v-model:visible="state.drawerVisible"
|
|
|
+ size="large"
|
|
|
+ class="custom-class"
|
|
|
+ title="选择设备"
|
|
|
+ placement="right"
|
|
|
+ >
|
|
|
+ <SelectDevice ref="selectDeviceRef" />
|
|
|
+ <template #footer >
|
|
|
+ <a-row justify="end" >
|
|
|
+ <a-col>
|
|
|
+ <a-space>
|
|
|
+ <a-button @click="state.drawerVisible = false">取消</a-button>
|
|
|
+ <a-button type="primary" @click="handleSelectDevice">确定</a-button>
|
|
|
+ </a-space>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </template>
|
|
|
+ </a-drawer>
|
|
|
+</template>
|
|
|
+<script lang='ts' setup >
|
|
|
+import { reactive, ref } from 'vue'
|
|
|
+import SelectDevice from '@/pages/iot/rule/components/selectDevice.vue'
|
|
|
+import { message } from 'ant-design-vue'
|
|
|
+
|
|
|
+const tabListNoTitle = [
|
|
|
+ {
|
|
|
+ key: 'app',
|
|
|
+ tab: '应用模拟器'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'device',
|
|
|
+ tab: '设备模拟器'
|
|
|
+ }
|
|
|
+]
|
|
|
+
|
|
|
+const selectDeviceRef = ref()
|
|
|
+
|
|
|
+const state = reactive({
|
|
|
+ activeKey: 'app',
|
|
|
+ drawerVisible: false,
|
|
|
+ device: {
|
|
|
+ deviceLabel: ''
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+const handleSelectDevice = () => {
|
|
|
+ const _device = selectDeviceRef.value.getSelectDevice()
|
|
|
+ if (_device) {
|
|
|
+ state.device = _device
|
|
|
+ state.drawerVisible = false
|
|
|
+ } else {
|
|
|
+ message.warn('请选择产品')
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+const onTabChange = (key: string) => {
|
|
|
+ state.activeKey = key
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang='less' scoped >
|
|
|
+.app-imitate {
|
|
|
+ width: 250px;
|
|
|
+ height: 80px;
|
|
|
+ background-color: #fff;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 20px;
|
|
|
+}
|
|
|
+.IOT {
|
|
|
+ width: 250px;
|
|
|
+ height: 64px;
|
|
|
+ background-color: #fff;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 20px;
|
|
|
+}
|
|
|
+.app-to-platform {
|
|
|
+ height: 100%;
|
|
|
+ // width: 12.5%;
|
|
|
+ // float: left;
|
|
|
+ // height: 100%;
|
|
|
+}
|
|
|
+.device-imitate {
|
|
|
+ width: 250px;
|
|
|
+ height: 80px;
|
|
|
+ background-color: #fff;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 20px;
|
|
|
+}
|
|
|
+.equipment-platform {
|
|
|
+ position: absolute;
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: middle;
|
|
|
+ width: 100%;
|
|
|
+ line-height: 1;
|
|
|
+ color: #4d4d4d;
|
|
|
+ text-align: center;
|
|
|
+ font-size: 12px;
|
|
|
+ .border-dot-top {
|
|
|
+ position: relative;
|
|
|
+ padding-bottom: 0.6rem;
|
|
|
+ margin-bottom: 1rem;
|
|
|
+ border-bottom: 2px #999 solid;
|
|
|
+ }
|
|
|
+ .border-dot-top::before {
|
|
|
+ left: 0;
|
|
|
+ top: 100%;
|
|
|
+ margin-top: -0.15rem;
|
|
|
+ content: "";
|
|
|
+ display: block;
|
|
|
+ width: 0.4rem;
|
|
|
+ height: 0.4rem;
|
|
|
+ border-radius: 0.2rem;
|
|
|
+ border: 2px #999 solid;
|
|
|
+ background-color: #ebedf0;
|
|
|
+ position: absolute;
|
|
|
+ }
|
|
|
+ .border-dot-top::after {
|
|
|
+ content: "";
|
|
|
+ display: block;
|
|
|
+ border: 4px #999 solid;
|
|
|
+ width: 0;
|
|
|
+ height: 0;
|
|
|
+ transform: rotate(45deg);
|
|
|
+ position: absolute;
|
|
|
+ right: 0;
|
|
|
+ top: 97%;
|
|
|
+ margin-top: -0.15rem;
|
|
|
+ border-color: #999 #999 transparent transparent;
|
|
|
+ }
|
|
|
+ .border-dot-bottom {
|
|
|
+ border-color: #ccc;
|
|
|
+ position: relative;
|
|
|
+ padding-top: 0.6rem;
|
|
|
+ border-top: 2px #999 dashed;
|
|
|
+ }
|
|
|
+ .border-dot-bottom::before {
|
|
|
+ content: "";
|
|
|
+ display: block;
|
|
|
+ border: 4px #999 solid;
|
|
|
+ width: 0;
|
|
|
+ height: 0;
|
|
|
+ transform: rotate(-135deg);
|
|
|
+ position: absolute;
|
|
|
+ top: -11%;
|
|
|
+ margin-top: -0.15rem;
|
|
|
+ border-color: #999 #999 transparent transparent;
|
|
|
+ }
|
|
|
+ .border-dot-bottom::after {
|
|
|
+ right: 0;
|
|
|
+ top: -1px;
|
|
|
+ margin-top: -0.15rem;
|
|
|
+ content: "";
|
|
|
+ display: block;
|
|
|
+ width: 0.4rem;
|
|
|
+ height: 0.4rem;
|
|
|
+ border-radius: 0.2rem;
|
|
|
+ border: 2px #999 solid;
|
|
|
+ background-color: #ebedf0;
|
|
|
+ position: absolute;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|