|
@@ -22,12 +22,20 @@
|
|
|
:contentStyle="{fontSize: '12px'}"
|
|
:contentStyle="{fontSize: '12px'}"
|
|
|
style="margin-top: 20px;"
|
|
style="margin-top: 20px;"
|
|
|
>
|
|
>
|
|
|
- <a-descriptions-item label="设备标识码">{{state.deviceDetail?.modelLabel}}</a-descriptions-item>
|
|
|
|
|
|
|
+ <a-descriptions-item label="设备标识码">{{state.deviceDetail?.deviceStatus}}</a-descriptions-item>
|
|
|
<a-descriptions-item label="设备ID">{{state.deviceDetail?.id}}</a-descriptions-item>
|
|
<a-descriptions-item label="设备ID">{{state.deviceDetail?.id}}</a-descriptions-item>
|
|
|
- <a-descriptions-item label="认证类型">{{state.deviceDetail?.deviceNodeType}}</a-descriptions-item>
|
|
|
|
|
- <a-descriptions-item label="设备密钥">{{state.deviceDetail?.deviceCode}}</a-descriptions-item>
|
|
|
|
|
- <a-descriptions-item label="注册时间">{{state.deviceDetail?.lastActivityTs}}</a-descriptions-item>
|
|
|
|
|
- <a-descriptions-item label="节点类型">{{ state.deviceDetail?.deviceNodeType === 'GATEWAY' ? '直连' : '非直连'}}</a-descriptions-item>
|
|
|
|
|
|
|
+ <a-descriptions-item label="认证类型">{{state.deviceDetail?.authType === 'SECRET' ? '密钥认证' : '证书'}}</a-descriptions-item>
|
|
|
|
|
+ <a-descriptions-item label="设备密钥">
|
|
|
|
|
+ <a-space>
|
|
|
|
|
+ <span >{{ secretState.visible ? secretState.secret : '******' }}</span>
|
|
|
|
|
+ <span>
|
|
|
|
|
+ <eye-invisible-two-tone v-if="secretState.visible" style="font-size: 20px;" @click="secretState.visible = false" />
|
|
|
|
|
+ <eye-two-tone v-else style="font-size: 20px;" @click="getSecret" />
|
|
|
|
|
+ </span>
|
|
|
|
|
+ </a-space>
|
|
|
|
|
+ </a-descriptions-item>
|
|
|
|
|
+ <a-descriptions-item label="注册时间">{{ dayjs(state.deviceDetail?.createAt).format('YYYY-MM-DD hh:mm:ss') }}</a-descriptions-item>
|
|
|
|
|
+ <a-descriptions-item label="节点类型">{{ state.deviceDetail?.deviceNodeType === 'GATEWAY' ? '直连' : '非直连'}}</a-descriptions-item>
|
|
|
</a-descriptions>
|
|
</a-descriptions>
|
|
|
|
|
|
|
|
<a-row justify="space-between" align="middle" style="width: 100%;height: 68px; margin-bottom: 10px;" class="title">
|
|
<a-row justify="space-between" align="middle" style="width: 100%;height: 68px; margin-bottom: 10px;" class="title">
|
|
@@ -68,9 +76,11 @@
|
|
|
<script lang="ts" setup >
|
|
<script lang="ts" setup >
|
|
|
import { CommonController, DeviceContriller } from '@/controller'
|
|
import { CommonController, DeviceContriller } from '@/controller'
|
|
|
import { useScheduler } from '@/hooks'
|
|
import { useScheduler } from '@/hooks'
|
|
|
-import { onMounted, reactive } from 'vue'
|
|
|
|
|
|
|
+import { onMounted, reactive, h } from 'vue'
|
|
|
import { useRoute } from 'vue-router'
|
|
import { useRoute } from 'vue-router'
|
|
|
import dayjs from 'dayjs'
|
|
import dayjs from 'dayjs'
|
|
|
|
|
+import { EyeTwoTone, EyeInvisibleTwoTone } from '@ant-design/icons-vue'
|
|
|
|
|
+import { message } from 'ant-design-vue'
|
|
|
|
|
|
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
|
const deviceId = route.query.id as string
|
|
const deviceId = route.query.id as string
|
|
@@ -81,6 +91,11 @@ interface IProps {
|
|
|
|
|
|
|
|
const props = defineProps<IProps>()
|
|
const props = defineProps<IProps>()
|
|
|
|
|
|
|
|
|
|
+const secretState = reactive({
|
|
|
|
|
+ visible: false,
|
|
|
|
|
+ secret: '*******'
|
|
|
|
|
+})
|
|
|
|
|
+
|
|
|
const state = reactive <{
|
|
const state = reactive <{
|
|
|
deviceDetail: IOT.API.DEVICE.Device | null,
|
|
deviceDetail: IOT.API.DEVICE.Device | null,
|
|
|
visible: boolean,
|
|
visible: boolean,
|
|
@@ -93,6 +108,14 @@ const state = reactive <{
|
|
|
liveDataSource: []
|
|
liveDataSource: []
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
+const getSecret = async () => {
|
|
|
|
|
+ message.info('查询中')
|
|
|
|
|
+ const { data } = await DeviceContriller.secret({ deviceId: state.deviceDetail!.id, authType: state.deviceDetail!.authType })
|
|
|
|
|
+ secretState.visible = true
|
|
|
|
|
+ message.success('查询成功')
|
|
|
|
|
+ secretState.secret = data
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
const ok = async () => {
|
|
const ok = async () => {
|
|
|
await DeviceContriller.updateLabel({ id: props.deviceId, deviceLabel: state.deviceLabel })
|
|
await DeviceContriller.updateLabel({ id: props.deviceId, deviceLabel: state.deviceLabel })
|
|
|
state.visible = false
|
|
state.visible = false
|