|
|
@@ -26,19 +26,18 @@
|
|
|
<a-card style="margin-top: 20px;" >
|
|
|
<a-tabs v-model:activeKey="state.activeKey" @change="changeTabs">
|
|
|
<a-tab-pane :key="item.key" :tab="item.label" v-for="item in tabsdata">
|
|
|
-
|
|
|
</a-tab-pane>
|
|
|
</a-tabs>
|
|
|
<ModelDefine v-if="state.activeKey === 0"/>
|
|
|
- <OnlineTest v-else-if="state.activeKey === 2" />
|
|
|
<Plugins v-else-if="state.activeKey === 1" />
|
|
|
- <Topic v-else-if="state.activeKey === 3" />
|
|
|
+ <OnlineTest v-else-if="state.activeKey === 2 " />
|
|
|
+ <Topic v-else-if="state.activeKey === 3 " />
|
|
|
</a-card>
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup >
|
|
|
import { DeviceContriller, ModelController } from '@/controller'
|
|
|
-import { onMounted, reactive } from 'vue'
|
|
|
+import { computed, onMounted, reactive } from 'vue'
|
|
|
import { useRoute } from 'vue-router'
|
|
|
import ModelDefine from './components/modelDefine.vue'
|
|
|
import OnlineTest from './components/onlineTest.vue'
|
|
|
@@ -60,24 +59,33 @@ const state = reactive<{
|
|
|
deviceCount: ''
|
|
|
})
|
|
|
|
|
|
-const tabsdata = [
|
|
|
- {
|
|
|
- label: '模型定义',
|
|
|
- key: 0
|
|
|
- },
|
|
|
- {
|
|
|
- label: '插件开发',
|
|
|
- key: 1
|
|
|
- },
|
|
|
- {
|
|
|
- label: '在线调试',
|
|
|
- key: 2
|
|
|
- },
|
|
|
- {
|
|
|
- label: 'Topic管理',
|
|
|
- key: 3
|
|
|
- }
|
|
|
-]
|
|
|
+const tabsdata = computed(() => modelType === 'model'
|
|
|
+ ? [
|
|
|
+ {
|
|
|
+ label: '模型定义',
|
|
|
+ key: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '插件开发',
|
|
|
+ key: 1
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '在线调试',
|
|
|
+ key: 2
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: 'Topic管理',
|
|
|
+ key: 3
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ : [{
|
|
|
+ label: '模型定义',
|
|
|
+ key: 0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: '插件开发',
|
|
|
+ key: 1
|
|
|
+ }])
|
|
|
|
|
|
const getDeviceCount = async () => {
|
|
|
const data = await DeviceContriller.statistics({ modelId: modelId })
|