fix: iot && IconifyIcon
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import type { Ref } from 'vue';
|
||||
|
||||
import type { ProductVO } from '#/api/iot/product/product';
|
||||
import type { IotProductApi } from '#/api/iot/product/product';
|
||||
|
||||
import { inject, onMounted, ref } from 'vue';
|
||||
|
||||
import { Modal, Radio } from 'ant-design-vue';
|
||||
import hljs from 'highlight.js'; // 导入代码高亮文件
|
||||
import json from 'highlight.js/lib/languages/json';
|
||||
|
||||
@@ -17,7 +18,7 @@ defineOptions({ name: 'ThingModelTSL' });
|
||||
|
||||
const dialogVisible = ref(false); // 弹窗的是否展示
|
||||
const dialogTitle = ref('物模型 TSL'); // 弹窗的标题
|
||||
const product = inject<Ref<ProductVO>>(IOT_PROVIDE_KEY.PRODUCT); // 注入产品信息
|
||||
const product = inject<Ref<IotProductApi.Product>>(IOT_PROVIDE_KEY.PRODUCT); // 注入产品信息
|
||||
const viewMode = ref('code'); // 查看模式:code-代码视图,editor-编辑器视图
|
||||
|
||||
/** 打开弹窗 */
|
||||
@@ -43,17 +44,17 @@ onMounted(async () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Dialog v-model="dialogVisible" :title="dialogTitle">
|
||||
<Modal v-model="dialogVisible" :title="dialogTitle">
|
||||
<JsonEditor
|
||||
v-model="thingModelTSL"
|
||||
:mode="viewMode === 'editor' ? 'code' : 'view'"
|
||||
height="600px"
|
||||
/>
|
||||
<template #footer>
|
||||
<el-radio-group v-model="viewMode" size="small">
|
||||
<el-radio-button label="code">代码视图</el-radio-button>
|
||||
<el-radio-button label="editor">编辑器视图</el-radio-button>
|
||||
</el-radio-group>
|
||||
<Radio.Group v-model="viewMode" size="small">
|
||||
<Radio.Button label="code">代码视图</Radio.Button>
|
||||
<Radio.Button label="editor">编辑器视图</Radio.Button>
|
||||
</Radio.Group>
|
||||
</template>
|
||||
</Dialog>
|
||||
</Modal>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user