소스 검색

更新App.jsx中的组件,替换TopoDetailModal为ComplexConfig,并传递formula属性;在entry.jsx和complex.jsx中相应调整以支持新组件的功能。

valentichu 7 달 전
부모
커밋
4dd0ed6f08
5개의 변경된 파일23개의 추가작업 그리고 6개의 파일을 삭제
  1. 0 0
      lib/index.js
  2. 10 2
      src/App.jsx
  3. 2 2
      src/api/alarm.js
  4. 2 0
      src/entry.jsx
  5. 9 2
      src/pages/Alarm/components/complex.jsx

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
lib/index.js


+ 10 - 2
src/App.jsx

@@ -59,12 +59,20 @@ function Home(props) {
           editId={-1}
         ></Alarm.EasyConfig>
       </div> */}
-      <Alarm.TopoDetailModal
+      <Alarm.ComplexConfig
+        style={{ paddingTop: 50 }}
+        ref={compRef}
+        editId={props.ruleId}
+        groupList={[]}
+        showList={true}
+        formula="([CAR_PID_Ki]+[CAR_PID_Ki])/[CSZ_1_AF]"
+      ></Alarm.ComplexConfig>
+      {/* <Alarm.TopoDetailModal
         id={690384}
         alarmTime="2025-06-17 00:00:00"
         open={true}
         onCancel={() => {}}
-      />
+      /> */}
     </>
   );
 }

+ 2 - 2
src/api/alarm.js

@@ -2,8 +2,8 @@ import axios from "axios";
 
 function getConfig() {
   return {
-    // baseURL: "http://192.168.1.109:32080",
-    baseURL: "/",
+    baseURL: "http://192.168.1.109:32080",
+    // baseURL: "/",
     noNeedInterceptor: false,
     headers: {
       Authorization: localStorage.getItem("token"),

+ 2 - 0
src/entry.jsx

@@ -71,6 +71,7 @@ const ComplexConfig = forwardRef((props, ref) => {
     showList,
     style,
     rightStyle,
+    formula,
   } = props;
   const compRef = useRef(null);
 
@@ -104,6 +105,7 @@ const ComplexConfig = forwardRef((props, ref) => {
               groupList={groupList}
               showList={showList}
               style={style}
+              formula={formula}
               rightStyle={rightStyle}
             />
           </App>

+ 9 - 2
src/pages/Alarm/components/complex.jsx

@@ -33,7 +33,7 @@ function TranslateText(arr) {
 }
 
 const Complex = (props, ref) => {
-  const { editId, groupList = [], showList } = props;
+  const { editId, groupList = [], showList, formula } = props;
 
   const [form] = Form.useForm();
   const formuRef = useRef();
@@ -208,7 +208,14 @@ const Complex = (props, ref) => {
           setType(1);
         }
       } else if (showList) {
-        setType(0);
+        if (formula) {
+          setType(2);
+          setTimeout(() => {
+            formuRef.current.backEndInput(formula);
+          }, 100);
+        } else {
+          setType(0);
+        }
       } else if (!showList) {
         setAlarmId(-1);
       }

이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.