100011797 пре 3 година
родитељ
комит
0bfbc267fd

+ 28 - 0
src/components/ProTableCard/index.less

@@ -121,6 +121,34 @@
             -webkit-line-clamp: 2;
           }
         }
+
+        .card-item-content-scene {
+          display: flex;
+          .card-item-content-scene-item {
+            min-width: 80px;
+            div {
+              color: rgba(0, 0, 0, 0.65);
+              font-size: 14px;
+              span.item-icon {
+                margin-right: 10px;
+              }
+            }
+            &:last-child {
+              margin-left: 16px;
+            }
+            .scene-item-trigger {
+              width: 100%;
+              overflow: hidden;
+              color: #000;
+              font-size: 14px;
+              white-space: nowrap; //文本不会换行
+              text-overflow: ellipsis; //文本溢出显示省略号
+            }
+            .scene-item-action {
+              border: 1px solid #f0f2f3;
+            }
+          }
+        }
       }
     }
   }

+ 14 - 0
src/pages/link/DataCollect/components/Point/Save/modbus.tsx

@@ -429,12 +429,26 @@ export default (props: Props) => {
           ...props.data,
           ...value,
           pointKey: value?.configuration?.parameter?.address,
+          configuration: {
+            ...value?.configuration,
+            codec: {
+              ...value?.configuration?.codec,
+              provider: value?.configuration?.codec?.provider || 'int8',
+            },
+          },
         })
       : await service.savePoint({
           ...obj,
           ...props.data,
           ...value,
           pointKey: value?.configuration?.parameter?.address,
+          configuration: {
+            ...value?.configuration,
+            codec: {
+              ...value?.configuration?.codec,
+              provider: value?.configuration?.codec?.provider || 'int8',
+            },
+          },
         });
     if (response && response?.status === 200) {
       onlyMessage('操作成功');

+ 7 - 2
src/pages/rule-engine/Scene/Save/index.tsx

@@ -3,6 +3,8 @@ import { Form, Input } from 'antd';
 import TriggerWay from '@/pages/rule-engine/Scene/Save/components/TriggerWay';
 import type { SceneItem } from '@/pages/rule-engine/Scene/typings';
 import { useEffect } from 'react';
+import { getMenuPathByCode } from '@/utils/menu';
+import useHistory from '@/hooks/route/useHistory';
 
 interface Props {
   close: () => void;
@@ -11,6 +13,7 @@ interface Props {
 
 export default (props: Props) => {
   const [form] = Form.useForm();
+  const history = useHistory();
 
   useEffect(() => {
     form.setFieldsValue({
@@ -28,7 +31,9 @@ export default (props: Props) => {
       }}
       onOk={async () => {
         const values = await form.validateFields();
-        console.log(values);
+        props.close();
+        const url = getMenuPathByCode('rule-engine/Scene/Detail');
+        history.push(`${url}?type=${values.trigger?.type}`);
       }}
       width={700}
     >
@@ -56,7 +61,7 @@ export default (props: Props) => {
             // onSelect={(val) => {
             //   // console.log(val);
             // }}
-            disabled={!!props.data.id}
+            disabled={!!props.data?.id}
           />
         </Form.Item>
       </Form>