From 7cb4c48d476bc81c50473c54befa3060f045e3bd Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 25 Mar 2025 21:07:18 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BB=A3=E7=A0=81=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E3=80=91IoT=EF=BC=9A=E6=95=B0=E6=8D=AE=E6=A1=A5=E6=A2=81?= =?UTF-8?q?=E7=9A=84=20review?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/iot/thingmodel/ThingModelTSL.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/iot/thingmodel/ThingModelTSL.vue b/src/views/iot/thingmodel/ThingModelTSL.vue index aceed4570..19a840c53 100644 --- a/src/views/iot/thingmodel/ThingModelTSL.vue +++ b/src/views/iot/thingmodel/ThingModelTSL.vue @@ -19,23 +19,23 @@ defineOptions({ name: 'ThingModelTSL' }) const dialogVisible = ref(false) // 弹窗的是否展示 const dialogTitle = ref('物模型 TSL') // 弹窗的标题 const product = inject>(IOT_PROVIDE_KEY.PRODUCT) // 注入产品信息 + /** 打开弹窗 */ const open = () => { dialogVisible.value = true } defineExpose({ open }) -const thingModelTSL = ref('') /** 获取 TSL */ +const thingModelTSL = ref('') const getTsl = async () => { const res = await ThingModelApi.getThingModelTSLByProductId(product?.value?.id || 0) thingModelTSL.value = JSON.stringify(res, null, 2) } -/** - * 代码高亮 - */ +/** 代码高亮 */ const highlightedCode = () => { + // TODO @puhui999:可以考虑 highlight 的告警解决下;另外,可以考虑配置设置里面,有个 json editor 预览 const result = hljs.highlight('json', thingModelTSL.value, true) return result.value || ' ' }