|
|
@@ -0,0 +1,55 @@
|
|
|
+<template>
|
|
|
+ <a-card
|
|
|
+
|
|
|
+ >
|
|
|
+ <!-- -->
|
|
|
+ <template #title>
|
|
|
+ <a-row :gutter="[8, 8]">
|
|
|
+ <a-col> <h1>{{state.model?.modelLabel}}</h1> </a-col>
|
|
|
+ <a-col> <span class="subtitle" >ID: {{state.model?.id}}</span> </a-col>
|
|
|
+ </a-row>
|
|
|
+ </template>
|
|
|
+ <a-descriptions
|
|
|
+ :column="{ xs: 1, sm: 1, md: 2, lg: 2, xl: 2}"
|
|
|
+ :labelStyle="{color: '#8a8e99'}"
|
|
|
+ :contentStyle="{fontSize: '12px'}"
|
|
|
+ >
|
|
|
+ <a-descriptions-item label="产品名称">{{state.model?.modelLabel}}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="设备类型">{{state.model?.deviceType}}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="协议类型">{{state.model?.transportType}}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="数据类型">{{state.model?.payloadType}}</a-descriptions-item>
|
|
|
+ <a-descriptions-item label="产品描述">{{state.model?.modelDescription}}</a-descriptions-item>
|
|
|
+ </a-descriptions>
|
|
|
+ </a-card>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script lang="ts" setup >
|
|
|
+import { ModelController } from '@/controller'
|
|
|
+import { onMounted, reactive } from 'vue'
|
|
|
+import { useRoute } from 'vue-router'
|
|
|
+
|
|
|
+const queryParams = useRoute().query as {id: string}
|
|
|
+
|
|
|
+const state = reactive<{
|
|
|
+ model: IOT.API.MODEL.ModelDot | null
|
|
|
+}>({
|
|
|
+ model: null
|
|
|
+})
|
|
|
+
|
|
|
+const getModelById = async (id: string) => {
|
|
|
+ state.model = await ModelController.detail(id)
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getModelById(queryParams.id)
|
|
|
+})
|
|
|
+
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped >
|
|
|
+@import "~@/styles/theme.less";
|
|
|
+.subtitle {
|
|
|
+ font-size: 12px;
|
|
|
+ color: @label-color;
|
|
|
+}
|
|
|
+</style>
|