Переглянути джерело

fix: 设备详情中的topic列表根据设备的产品类型是否为网关来显示不同的topic

yanglzh 1 рік тому
батько
коміт
a5578704e1
1 змінених файлів з 16 додано та 31 видалено
  1. 16 31
      src/views/iot/device/instance/detail.vue

+ 16 - 31
src/views/iot/device/instance/detail.vue

@@ -554,7 +554,22 @@ export default defineComponent({
           re.forEach((item: any) => propertyMap.set(item.key, item?.valueType));
         });
 
-        topicData.value = [
+
+        const deviceType = res.data?.product?.deviceType
+
+        topicData.value = deviceType === '网关' ? [
+          {
+            url: `/sys/${res.data.productKey}/${deviceKey}/thing/service/property/pack/post`,
+            info: '网关批量上传事件和属性(网关发起)',
+            type: '请求',
+          },
+          {
+            url: `/sys/${res.data.productKey}/${deviceKey}/thing/service/property/pack/post`,
+            info: '网关批量上传事件和属性(网关发起)',
+            type: '响应',
+          }
+        ] : [
+
           {
             url: `/sys/${res.data.productKey}/${deviceKey}/thing/event/property/post`,
             info: '设备上报属性(设备端发起)',
@@ -574,36 +589,6 @@ export default defineComponent({
             url: `/sys/${res.data.productKey}/${deviceKey}/thing/event/${'${eventIdentifier}'}/property/post_reply`,
             info: '设备上报事件(设备端发起)',
             type: '响应',
-          },
-          {
-            url: `/sys/${res.data.productKey}/${deviceKey}/thing/service/property/set`,
-            info: '设备属性设置(平台侧发起)',
-            type: '请求',
-          },
-          {
-            url: `/sys/${res.data.productKey}/${deviceKey}/thing/service/property/set_reply`,
-            info: '设备属性设置(平台侧发起)',
-            type: '响应',
-          },
-          {
-            url: `/sys/${res.data.productKey}/${deviceKey}/thing/service/property/pack/post`,
-            info: '网关批量上传事件和属性(网关发起)',
-            type: '请求',
-          },
-          {
-            url: `/sys/${res.data.productKey}/${deviceKey}/thing/service/property/pack/post`,
-            info: '网关批量上传事件和属性(网关发起)',
-            type: '响应',
-          },
-          {
-            url: `/sys/${res.data.productKey}/${deviceKey}/thing/service/${'${tsl.service.identifier}'}`,
-            info: '服务调用(平台侧发起)',
-            type: '请求',
-          },
-          {
-            url: `/sys/${res.data.productKey}/${deviceKey}//thing/service/${'${tsl.service.identifier}'}_reply`,
-            info: '服务调用(平台侧发起)',
-            type: '响应',
           }
         ]