【代码评审】IoT:数据桥梁的 review

This commit is contained in:
YunaiV 2025-03-25 21:07:18 +08:00
parent 966f1b8b7e
commit 7cb4c48d47

View File

@ -19,23 +19,23 @@ defineOptions({ name: 'ThingModelTSL' })
const dialogVisible = ref(false) //
const dialogTitle = ref('物模型 TSL') //
const product = inject<Ref<ProductVO>>(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 || '&nbsp;'
}