valentichu il y a 1 an
Parent
commit
eba8b56ea3
5 fichiers modifiés avec 15 ajouts et 9 suppressions
  1. 0 0
      lib/index.js
  2. 6 3
      src/App.jsx
  3. 2 1
      src/entry.jsx
  4. 2 2
      src/pages/Alarm/components/complex.jsx
  5. 5 3
      src/pages/Alarm/components/easy.jsx

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
lib/index.js


+ 6 - 3
src/App.jsx

@@ -7,17 +7,20 @@ function Home(props) {
 
   return (
     <>
-      <Alarm.DetailModal
+      {/* <Alarm.DetailModal
         open={open}
         onCancel={() => setOpen(false)}
         options={{ ruleId: 25 }}
         // options={{
         //   pointId: "ABC123_AAA_chr1_AEff_MIN_H",
         // }}
-      ></Alarm.DetailModal>
+      ></Alarm.DetailModal> */}
       {/* <Alarm.ComplexConfig ref={compRef} editId={50}></Alarm.ComplexConfig> */}
       {/* <button onClick={() => compRef?.current?.ok()}>测试</button> */}
-      {/* <Alarm.EasyConfig pointId="ABC123_AAA_chr1_AEff_MIN_H" ></Alarm.EasyConfig> */}
+      <Alarm.EasyConfig
+        pointId="ZWB_ALARM_chr_5_AE"
+        readonly
+      ></Alarm.EasyConfig>
     </>
   );
 }

+ 2 - 1
src/entry.jsx

@@ -20,7 +20,7 @@ import dayjs from "dayjs";
 dayjs.locale("zh-cn");
 
 const EasyConfig = forwardRef((props, ref) => {
-  const { editId = -1, onConfirm, groupList, pointId } = props;
+  const { editId = -1, onConfirm, groupList, pointId, readonly } = props;
   const compRef = useRef(null);
 
   const [themeName, setThemeName] = useState();
@@ -52,6 +52,7 @@ const EasyConfig = forwardRef((props, ref) => {
               pointId={pointId}
               onConfirm={onConfirm}
               groupList={groupList}
+              readonly={readonly}
             />
           </App>
         </ConfigProvider>

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

@@ -328,10 +328,10 @@ const Complex = (props, ref) => {
                       -
                     </Button>
                     <Button type="primary" onClick={symbClick}>
-                      ×
+                      *
                     </Button>
                     <Button type="primary" onClick={symbClick}>
-                      ÷
+                      /
                     </Button>
                   </div>
                 </Form.Item>

+ 5 - 3
src/pages/Alarm/components/easy.jsx

@@ -327,9 +327,11 @@ const Easy = (props, ref) => {
     } else {
       form.setFieldsValue({
         alarm_level: 1,
-        sub_type: 13,
+        sub_type: 14,
+        point_id: props.pointId ?? '',
+        point_name: props.pointId ?? ''
       });
-      setSubType(13);
+      setSubType(14);
     }
   }, [data]);
 
@@ -438,7 +440,7 @@ const Easy = (props, ref) => {
       >
         <Select
           showSearch
-          disabled={alarmId !== -1}
+          disabled={alarmId !== -1 || props.readonly}
           filterOption={false}
           dropdownMatchSelectWidth={400}
           labelInValue={true}

Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff