hear 3 роки тому
батько
коміт
43cf470727

+ 1 - 0
src/components/ProTableCard/CardItems/DataCollect/channel.tsx

@@ -26,6 +26,7 @@ export default (props: ChannelCardProps) => {
     <TableCard
       actions={props.actions}
       status={props.state?.value}
+      showStatus={false}
       statusText={props.state?.text}
       showMask={false}
       statusNames={{

+ 11 - 9
src/pages/device/Instance/Detail/ChildDevice/SaveChild/index.tsx

@@ -34,14 +34,16 @@ const SaveChild = (props: Props) => {
 
   useEffect(() => {
     if (props.childData.id) {
-      const product = productList.filter((i: any) => i.id === props.childData.productId)[0];
-      // console.log(JSON.parse(item.metadata || []));
-      if (product && product.metadata) {
-        const metadata = JSON.parse(product?.metadata || {})?.properties?.map((item: any) => ({
-          metadataId: item.id,
-          metadataName: `${item.name}(${item.id})`,
-          metadataType: 'property',
-        }));
+      // const product = productList.filter((i: any) => i.id === props.childData.productId)[0];
+      // console.log(props.childData,'product');
+      if (props.childData.deriveMetadata) {
+        const metadata = JSON.parse(props.childData?.deriveMetadata || {})?.properties?.map(
+          (item: any) => ({
+            metadataId: item.id,
+            metadataName: `${item.name}(${item.id})`,
+            metadataType: 'property',
+          }),
+        );
         if (metadata && metadata.length !== 0) {
           service
             .getMap(props.data.id, {
@@ -77,7 +79,7 @@ const SaveChild = (props: Props) => {
         }
       }
     }
-  }, [productList]);
+  }, [props.childData]);
 
   return (
     <>

+ 1 - 0
src/pages/device/Instance/Detail/EdgeMap/index.tsx

@@ -24,6 +24,7 @@ const EdgeMap = (props: Props) => {
       metadataName: `${item.name}(${item.id})`,
       metadataType: 'property',
     }));
+    console.log(metadata, 2222);
     if (metadata && metadata.length !== 0) {
       service
         .getMap(data.parentId, {

+ 1 - 0
src/pages/device/Instance/Detail/EdgeMap/mapTable/index.tsx

@@ -408,6 +408,7 @@ const MapTable = (props: Props) => {
   };
 
   useEffect(() => {
+    console.log(metaData, 1111111);
     service.edgeChannel(edgeId).then((res) => {
       if (res.status === 200) {
         const list = res.result?.[0].map((item: any) => ({