wzyyy 3 лет назад
Родитель
Сommit
92b6e67faf

+ 4 - 4
config/proxy.ts

@@ -9,14 +9,14 @@
 export default {
   dev: {
     '/api': {
-      // target: 'http://192.168.32.28:8844/',
-      // ws: 'ws://192.168.32.28:8844/',
+      target: 'http://192.168.32.28:8844/',
+      ws: 'ws://192.168.32.28:8844/',
       // 开发环境
       // target: 'http://120.79.18.123:8844/',
       // ws: 'ws://120.79.18.123:8844/',
       // 测试环境
-      target: 'http://120.77.179.54:8844/',
-      ws: 'ws://120.77.179.54:8844/',
+      // target: 'http://120.77.179.54:8844/',
+      // ws: 'ws://120.77.179.54:8844/',
       // target: 'http://192.168.66.5:8844/',
       // ws: 'ws://192.168.66.5:8844/',
       // ws: 'ws://demo.jetlinks.cn/jetlinks',

+ 1 - 1
src/pages/home/init/index.tsx

@@ -53,7 +53,7 @@ const Init = (props: Props) => {
           type="primary"
           onClick={() => {
             service
-              .setView({
+              .setViews({
                 name: 'view',
                 content: value,
               })

+ 14 - 0
src/pages/init-home/components/basis.tsx

@@ -32,6 +32,12 @@ const Basis = forwardRef((props: Props, ref) => {
               api: formData.apikey,
             },
           },
+          {
+            scope: 'basePath',
+            properties: {
+              basePath: formData.basePath,
+            },
+          },
         ];
         const res = await service.save(item);
         if (res.status === 200) {
@@ -100,6 +106,14 @@ const Basis = forwardRef((props: Props, ref) => {
           <Form.Item label="高德API Key" name="apikey" tooltip="配置后平台可调用高德地图GIS服务">
             <Input placeholder={'请输入高德API Key'} />
           </Form.Item>
+          <Form.Item
+            label="base-path"
+            name="basePath"
+            tooltip="界面访问后台服务器的URL(统一资源定位符)"
+            required
+          >
+            <Input />
+          </Form.Item>
           <Row gutter={[24, 24]}>
             <Col>
               <Form.Item

+ 13 - 11
src/pages/link/Channel/Modbus/index.tsx

@@ -338,17 +338,19 @@ const NewModbus = () => {
   }, []);
 
   useEffect(() => {
-    const id = `collector-data-modbus`;
-    const topic = `/collector/MODBUS_TCP/${activeKey}/data`;
-    wsRef.current = subscribeTopic?.(id, topic, {
-      pointId: pointList.map((item: any) => item.id),
-    })
-      ?.pipe(map((res: any) => res.payload))
-      .subscribe((payload: any) => {
-        const { pointId, hex } = payload;
-        current[pointId] = hex;
-        setCurrentData({ ...current });
-      });
+    if (pointList && activeKey) {
+      const id = `collector-data-modbus`;
+      const topic = `/collector/MODBUS_TCP/${activeKey}/data`;
+      wsRef.current = subscribeTopic?.(id, topic, {
+        pointId: pointList.map((item: any) => item.id),
+      })
+        ?.pipe(map((res: any) => res.payload))
+        .subscribe((payload: any) => {
+          const { pointId, hex } = payload;
+          current[pointId] = hex;
+          setCurrentData({ ...current });
+        });
+    }
     return () => wsRef.current && wsRef.current?.unsubscribe();
   }, [pointList]);
 

+ 2 - 2
src/pages/rule-engine/Alarm/Config/index.tsx

@@ -320,8 +320,8 @@ const Config = () => {
         <div style={{ marginLeft: 20 }} className={styles.doc}>
           <h1>功能说明</h1>
           <div>1、告警级别用于描述告警的严重程度,请根据业务管理方式进行自定义。</div>
-          <div>2、告警级别将会在告警配置中被引用</div>
-          <div>3、最多可配置5个级别</div>
+          <div>2、告警级别将会在告警配置中被引用</div>
+          <div>3、最多可配置5个级别</div>
         </div>
       </Col>
     </Row>

+ 19 - 2
src/pages/system/Basis/index.tsx

@@ -22,10 +22,12 @@ const Basis = () => {
     if (res.status === 200) {
       const basis = res.result?.filter((item: any) => item.scope === 'basis');
       const api = res?.result.filter((item: any) => item.scope === 'api');
+      const basePath = res?.result.filter((item: any) => item.scope === 'basePath');
       localStorage.setItem(SystemConst.AMAP_KEY, api[0].properties.api);
       form.setFieldsValue({
         ...basis[0].properties,
         apikey: api[0].properties.api,
+        basePath: basePath[0].properties.basePath,
       });
       setInitialState({
         ...initialState,
@@ -45,6 +47,7 @@ const Basis = () => {
           properties: {
             ...formData,
             apikey: '',
+            basePath: '',
           },
         },
         {
@@ -53,17 +56,23 @@ const Basis = () => {
             api: formData.apikey,
           },
         },
+        {
+          scope: 'basePath',
+          properties: {
+            basePath: formData.basePath,
+          },
+        },
       ];
       const res = await service.save(item);
       if (res.status === 200) {
         onlyMessage('保存成功');
-        detail(['basis', 'api']);
+        detail(['basis', 'api', 'basePath']);
       }
     }
   };
 
   useEffect(() => {
-    detail(['basis', 'api']);
+    detail(['basis', 'api', 'basePath']);
   }, []);
   return (
     <PageContainer>
@@ -99,6 +108,14 @@ const Basis = () => {
               >
                 <Input />
               </Form.Item>
+              <Form.Item
+                label="base-path"
+                name="basePath"
+                tooltip="界面访问后台服务器的URL(统一资源定位符)"
+                required
+              >
+                <Input />
+              </Form.Item>
               <Row gutter={[24, 24]}>
                 <Col>
                   <Form.Item

+ 8 - 0
src/pages/system/Relationship/index.tsx

@@ -35,6 +35,14 @@ const Relationship = () => {
       dataIndex: 'objectTypeName',
       title: '关联方',
       ellipsis: true,
+      valueType: 'select',
+      request: async () => {
+        const res = await service.getTypes();
+        if (res.status === 200) {
+          return res.result.map((item: any) => ({ label: item.name, value: item.name }));
+        }
+        return [];
+      },
     },
     {
       dataIndex: 'targetTypeName',