瀏覽代碼

fix: 运行状态obj

100011797 3 年之前
父節點
當前提交
6ee8c14c79

二進制
public/images/running/obj.png


+ 3 - 1
src/pages/device/Instance/Detail/Running/Property/FileComponent/Detail.tsx

@@ -1,5 +1,5 @@
 import LivePlayer from '@/components/Player';
-import { Image, Modal } from 'antd';
+import { Image, Input, Modal } from 'antd';
 
 interface Props {
   close: () => void;
@@ -15,6 +15,8 @@ const Detail = (props: Props) => {
       return <Image src={value?.formatValue} />;
     } else if (['.flv', '.m3u8', '.mp4'].includes(type)) {
       return <LivePlayer live={false} url={value?.formatValue} />;
+    } else if (type === 'obj') {
+      return <Input.TextArea rows={15} bordered={false} value={value?.formatValue} />;
     }
     return null;
   };

+ 14 - 1
src/pages/device/Instance/Detail/Running/Property/FileComponent/index.tsx

@@ -23,6 +23,7 @@ imgMap.set('img', require('/public/images/running/img.png'));
 imgMap.set('error', require('/public/images/running/error.png'));
 imgMap.set('video', require('/public/images/running/video.png'));
 imgMap.set('other', require('/public/images/running/other.png'));
+imgMap.set('obj', require('/public/images/running/obj.png'));
 
 const FileComponent = (props: Props) => {
   const { data, value } = props;
@@ -121,7 +122,19 @@ const FileComponent = (props: Props) => {
           </div>
         );
       }
-    } else if (data?.valueType?.type === 'object' || data?.valueType?.type === 'geoPoint') {
+    } else if (data?.valueType?.type === 'object') {
+      return (
+        <div
+          className={props.type === 'card' ? styles.cardValue : styles.otherValue}
+          onClick={() => {
+            setType('obj');
+            setVisible(true);
+          }}
+        >
+          <img src={imgMap.get('obj')} />
+        </div>
+      );
+    } else if (data?.valueType?.type === 'geoPoint') {
       return (
         <div className={props.type === 'card' ? styles.cardValue : styles.otherValue}>
           <Tooltip placement="topLeft" title={JSON.stringify(value?.formatValue)}>