Commit 4035af86151ece1c965d3ce2d171a784b816fd69

Authored by ww
1 parent 924d6571

fix: 修复gbt产品无传输协议

... ... @@ -5,6 +5,7 @@ export enum TransportTypeEnum {
5 5 LWM2M = 'LWM2M',
6 6 SNMP = 'SNMP',
7 7 TCP = 'TCP',
  8 + GBT28181 = 'GBT28181',
8 9 }
9 10
10 11 export enum ReadAndWriteEnum {
... ...
... ... @@ -15,7 +15,11 @@
15 15 <Tabs.TabPane key="topic" tab="Topic">
16 16 <TopicPanel />
17 17 </Tabs.TabPane>
18   - <Tabs.TabPane key="modelOfMatter" tab="物模型管理">
  18 + <Tabs.TabPane
  19 + v-if="record?.profileData?.transportConfiguration?.type !== TransportTypeEnum.GBT28181"
  20 + key="modelOfMatter"
  21 + tab="物模型管理"
  22 + >
19 23 <PhysicalModelManagementStep :record="record" />
20 24 </Tabs.TabPane>
21 25 </Tabs>
... ... @@ -28,10 +32,11 @@
28 32 import PhysicalModelManagementStep from './step/PhysicalModelManagementStep.vue';
29 33 import { nextTick, ref, unref } from 'vue';
30 34 import { deviceConfigGetDetail } from '/@/api/device/deviceConfigApi';
31   - import { DeviceRecord } from '/@/api/device/model/deviceModel';
32 35 import TopicPanel from './step/TopicPanel.vue';
33 36 import ProductDescription from './components/ProductDescription.vue';
34 37 import { TransportDescription } from './components/TransportDescript';
  38 + import { DeviceProfileDetail } from '/@/api/device/model/deviceConfigModel';
  39 + import { TransportTypeEnum } from '/@/enums/deviceEnum';
35 40
36 41 defineEmits(['register']);
37 42
... ... @@ -39,7 +44,7 @@
39 44
40 45 const activeKey = ref<ActiveKey>('modelOfMatter');
41 46
42   - const record = ref<DeviceRecord>({} as unknown as DeviceRecord);
  47 + const record = ref<DeviceProfileDetail>({} as unknown as DeviceProfileDetail);
43 48
44 49 const DevConStRef = ref<InstanceType<typeof ProductDescription>>();
45 50 const TransConStRef = ref<InstanceType<typeof TransportConfigurationStep>>();
... ... @@ -52,7 +57,7 @@
52 57 unref(TransConStRef)?.setFormData(res);
53 58 };
54 59
55   - const [register, {}] = useDrawerInner(async (data: { record: DeviceRecord }) => {
  60 + const [register, {}] = useDrawerInner(async (data: { record: DeviceProfileDetail }) => {
56 61 activeKey.value = 'product';
57 62 record.value = data.record;
58 63 record.value = await deviceConfigGetDetail(data.record.id);
... ...
1 1 <script lang="ts" setup>
2   - import { DeviceRecord } from '/@/api/device/model/deviceModel';
  2 + import { DeviceProfileDetail } from '/@/api/device/model/deviceConfigModel';
3 3 import { useDescription, Description } from '/@/components/Description';
4 4
5 5 const props = defineProps<{
6   - record: DeviceRecord['profileData']['transportConfiguration'];
  6 + record: DeviceProfileDetail['profileData']['transportConfiguration'];
7 7 }>();
8 8
9 9 const [register] = useDescription({
... ...
... ... @@ -23,7 +23,7 @@
23 23 <section>
24 24 <DefaultConfiguration
25 25 :record="getTransportInfo"
26   - v-if="getTransportInfo.type === TransportTypeEnum.DEFAULT"
  26 + v-if="getTransportInfo.type === TransportTypeEnum.DEFAULT || TransportTypeEnum.GBT28181"
27 27 />
28 28
29 29 <MQTTConfiguration
... ...