12 Commits a901aa13b1 ... 8f4cc18ca5

Autore SHA1 Messaggio Data
  valentichu 8f4cc18ca5 v1.1.33 3 settimane fa
  valentichu b5761f1b91 bugfix 3 settimane fa
  valentichu 38568c103b v1.1.32 3 settimane fa
  valentichu b2cea1f42e bugfix 3 settimane fa
  valentichu 8e8af5a8ed v1.1.31 1 mese fa
  valentichu 5d1fb180a2 完善翻译 1 mese fa
  valentichu 9dc05b7e77 完善翻译 1 mese fa
  valentichu 93d00a6af1 v1.1.30 1 mese fa
  valentichu eddb9eae35 Fix: Format history data and threshold values to two decimal places for better readability 1 mese fa
  valentichu 3ab9aa8bab v1.1.29 1 mese fa
  valentichu 48cb7a535f Refactor Alarm components for improved internationalization and data handling 1 mese fa
  valentichu 04e03da27d v1.1.28 2 mesi fa

File diff suppressed because it is too large
+ 0 - 0
lib/index.js


+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "dt-alarm-component",
-  "version": "1.1.27",
+  "version": "1.1.33",
   "description": "",
   "main": "lib/index.js",
   "scripts": {

+ 33 - 16
src/pages/Alarm/components/complex.jsx

@@ -32,6 +32,11 @@ function TranslateText(arr) {
   return arr?.[0];
 }
 
+const getPaginationTotalText = (total) => {
+  const dtLanguage = localStorage.getItem("dtLanguage");
+  return dtLanguage === "en" ? `${total} items` : `共${total}条`;
+};
+
 const Complex = (props, ref) => {
   const { message } = App.useApp();
   const { editId, groupList = [], showList, formula } = props;
@@ -50,7 +55,7 @@ const Complex = (props, ref) => {
   const [paginationProps, setPaginationProps] = useState({
     pageSize: 15,
     current: 1,
-    showTotal: (total) => `共${total}条`,
+    showTotal: (total) => getPaginationTotalText(total),
     // showQuickJumper: true,
     // showSizeChanger:true,
     // size:'Large',
@@ -60,7 +65,10 @@ const Complex = (props, ref) => {
   const [ruleOptions, setRuleOptions] = useState([]);
 
   const handleTableChange = async (pagination) => {
-    setPaginationProps({ ...pagination, showTotal: (total) => `共${total}条` });
+    setPaginationProps({
+      ...pagination,
+      showTotal: (total) => getPaginationTotalText(total),
+    });
     // setCurrentPage(pagination.current);
     // setPageSize(pagination.pageSize)
   };
@@ -117,7 +125,7 @@ const Complex = (props, ref) => {
       if (state === 0) {
         props?.onConfirm?.(data?.id);
         form.resetFields();
-        message.success("保存成功");
+        message.success(TranslateText(["保存成功", "Seted"]));
       } else {
         message.error(state_info);
       }
@@ -140,7 +148,7 @@ const Complex = (props, ref) => {
       if (state === 0) {
         props?.onConfirm?.(data.id);
         form.resetFields();
-        message.success("保存成功");
+        message.success(TranslateText(["保存成功", "Seted"]));
       } else {
         message.error(state_info);
       }
@@ -179,12 +187,12 @@ const Complex = (props, ref) => {
 
   const columns = [
     {
-      title: TranslateText(["点位编号", "Point id"]),
+      title: TranslateText(["点位编号", "Point Id"]),
       dataIndex: "point_id",
       ellipsis: true,
     },
     {
-      title: TranslateText(["点位名称", "Point name"]),
+      title: TranslateText(["点位名称", "Point Name"]),
       dataIndex: "name",
       ellipsis: true,
     },
@@ -278,14 +286,20 @@ const Complex = (props, ref) => {
           >
             {showList && (
               <>
-                <Form.Item label="告警类型">
+                <Form.Item label={TranslateText(["告警类型", "Alarm type"])}>
                   <Radio.Group
                     value={type}
                     onChange={(e) => setType(e.target.value)}
                   >
-                    <Radio value={0}>无规则</Radio>
-                    <Radio value={1}>关联规则</Radio>
-                    <Radio value={2}>新建规则</Radio>
+                    <Radio value={0}>
+                      {TranslateText(["无规则", "No rule"])}
+                    </Radio>
+                    <Radio value={1}>
+                      {TranslateText(["关联规则", "Linked rule"])}
+                    </Radio>
+                    <Radio value={2}>
+                      {TranslateText(["新建规则", "Add rule"])}
+                    </Radio>
                   </Radio.Group>
                 </Form.Item>
                 {type === 1 && (
@@ -294,7 +308,7 @@ const Complex = (props, ref) => {
                     rules={[
                       {
                         required: true,
-                        message: "请选择规则",
+                        message: TranslateText(["请选择规则", "Please choose rule"]),
                         validator: () => {
                           return new Promise((resolve, reject) => {
                             if (alarmId) {
@@ -306,14 +320,14 @@ const Complex = (props, ref) => {
                         },
                       },
                     ]}
-                    label="关联规则"
+                    label={TranslateText(["关联规则", "Linked rule"])}
                   >
                     <Select
                       value={alarmId}
                       onChange={setAlarmId}
                       style={{ width: 320 }}
                       options={ruleOptions}
-                      placeholder={TranslateText(["请选择", "Please choose"])}
+                      placeholder={TranslateText(["请选择规则", "Please choose rule"])}
                     />
                   </Form.Item>
                 )}
@@ -352,7 +366,7 @@ const Complex = (props, ref) => {
                     options={[
                       ...[
                         {
-                          label: "未分组",
+                          label: TranslateText(["未分组", "Ungrouped"]),
                           value: 0,
                         },
                       ],
@@ -444,7 +458,10 @@ const Complex = (props, ref) => {
                   rules={[
                     {
                       required: true,
-                      message: "请输入条件",
+                      message: TranslateText([
+                        "请输入条件",
+                        "Please input condition",
+                      ]),
                       validator: () => {
                         return new Promise((resolve, reject) => {
                           if (formuRef.current.getFinalStr()) {
@@ -524,7 +541,7 @@ const Complex = (props, ref) => {
                       ["", undefined, null].indexOf(dateTime) !== -1 &&
                       status === 1 && (
                         <div style={{ color: "var(--dt-error-color1)" }}>
-                          请输入数字
+                          {TranslateText(["请输入数字", "Please input number"])}
                         </div>
                       )}
                   </div>

+ 4 - 2
src/pages/Alarm/components/components/AlarmConfirm/index.jsx

@@ -39,7 +39,7 @@ const Index = (props) => {
     });
 
     if (res.state === 0) {
-      message.success("确认成功");
+      message.success(TranslateText(["确认成功", "Confirmed"]));
       props.onCancel?.();
       props.onConfirm?.(res?.data?.[0]);
       window.dispatchEvent(new CustomEvent("refreshAlarmHistoryFromConfirm"));
@@ -59,13 +59,15 @@ const Index = (props) => {
   return (
     <Modal
       width={500}
-      title={TranslateText(["告警确认", "Alarm Confirm"])}
+      title={TranslateText(["告警确认", "Confirm Alarm"])}
       open={props.open}
       confirmLoading={loading}
       onOk={onModalOk}
       onCancel={onModalCancel}
       destroyOnClose
       zIndex={1002}
+      okText={TranslateText(["确定", "OK"])}
+      cancelText={TranslateText(["取消", "Cancel"])}
     >
       <Form
         name="basic"

+ 82 - 34
src/pages/Alarm/components/components/AlarmDetail/index.jsx

@@ -70,9 +70,9 @@ const Check = (props) => (
 );
 
 const alarmTypeMap = {
-  1: "过程告警",
-  2: "指令告警",
-  3: "系统告警",
+  1: TranslateText(["过程告警", "Process alarm"]),
+  2: TranslateText(["指令告警", "Command alarm"]),
+  3: TranslateText(["系统告警", "System alarm"]),
 };
 
 function TranslateText(arr) {
@@ -112,16 +112,46 @@ const levelMap = {
 };
 
 const rangePresets = [
-  { label: "最近30分钟", value: [dayjs().add(-30, "minute"), dayjs()] },
-  { label: "最近60分钟", value: [dayjs().add(-60, "minute"), dayjs()] },
-  { label: "最近2小时", value: [dayjs().add(-2, "hour"), dayjs()] },
-  { label: "最近4小时", value: [dayjs().add(-4, "hour"), dayjs()] },
-  { label: "最近8小时", value: [dayjs().add(-8, "hour"), dayjs()] },
-  { label: "最近12小时", value: [dayjs().add(-12, "hour"), dayjs()] },
-  { label: "最近24小时", value: [dayjs().add(-24, "hour"), dayjs()] },
-  { label: "最近48小时", value: [dayjs().add(-48, "hour"), dayjs()] },
-  { label: "最近72小时", value: [dayjs().add(-72, "hour"), dayjs()] },
-  { label: "最近7天", value: [dayjs().add(-7, "d"), dayjs()] },
+  {
+    label: TranslateText(["最近30分钟", "Last 30 minutes"]),
+    value: [dayjs().add(-30, "minute"), dayjs()],
+  },
+  {
+    label: TranslateText(["最近60分钟", "Last 60 minutes"]),
+    value: [dayjs().add(-60, "minute"), dayjs()],
+  },
+  {
+    label: TranslateText(["最近2小时", "Last 2 hours"]),
+    value: [dayjs().add(-2, "hour"), dayjs()],
+  },
+  {
+    label: TranslateText(["最近4小时", "Last 4 hours"]),
+    value: [dayjs().add(-4, "hour"), dayjs()],
+  },
+  {
+    label: TranslateText(["最近8小时", "Last 8 hours"]),
+    value: [dayjs().add(-8, "hour"), dayjs()],
+  },
+  {
+    label: TranslateText(["最近12小时", "Last 12 hours"]),
+    value: [dayjs().add(-12, "hour"), dayjs()],
+  },
+  {
+    label: TranslateText(["最近24小时", "Last 24 hours"]),
+    value: [dayjs().add(-24, "hour"), dayjs()],
+  },
+  {
+    label: TranslateText(["最近48小时", "Last 48 hours"]),
+    value: [dayjs().add(-48, "hour"), dayjs()],
+  },
+  {
+    label: TranslateText(["最近72小时", "Last 72 hours"]),
+    value: [dayjs().add(-72, "hour"), dayjs()],
+  },
+  {
+    label: TranslateText(["最近7天", "Last 7 days"]),
+    value: [dayjs().add(-7, "d"), dayjs()],
+  },
 ];
 
 const getDur = (text) => {
@@ -222,7 +252,7 @@ const initialOption = {
   },
   yAxis: {
     type: "value",
-    name: "单位",
+    name: TranslateText(["单位", "Unit"]),
     nameTextStyle: {
       color: getVariable("--dt-text-color3"),
       fontSize: 12,
@@ -258,7 +288,7 @@ const initialOption = {
   ],
   series: [
     {
-      name: "值",
+      name: TranslateText(["值", "Value"]),
       type: "line",
       data: [],
       itemStyle: {
@@ -288,6 +318,11 @@ const Index = (props) => {
     dayjs(props.data?.data?.created_time).subtract(20, "minute"),
     dayjs(props.data?.data?.created_time).add(20, "minute"),
   ]);
+  const labelWidth =
+    typeof localStorage !== "undefined" &&
+    localStorage.getItem("dtLanguage") === "en"
+      ? 102
+      : 72;
   const fetchData = useMemoizedFn(async () => {
     if (
       props.data?.data?.rule_id === null ||
@@ -309,7 +344,7 @@ const Index = (props) => {
     newData.yAxis.name = props.data?.data?.unit;
     if (res?.data?.hh) {
       newData.series.push({
-        name: "上上限",
+        name: TranslateText(["上上限", "Ultra Upper Limit"]),
         type: "line",
         data: res?.data?.hh?.map((item) => item[1]),
         symbol: "none",
@@ -321,7 +356,7 @@ const Index = (props) => {
     }
     if (res?.data?.h) {
       newData.series.push({
-        name: "上限",
+        name: TranslateText(["上限", "Upper Limit"]),
         type: "line",
         data: res?.data?.h?.map((item) => item[1]),
         symbol: "none",
@@ -333,7 +368,7 @@ const Index = (props) => {
     }
     if (res?.data?.l) {
       newData.series.push({
-        name: "下限",
+        name: TranslateText(["下限", "Lower Limit"]),
         type: "line",
         data: res?.data?.l?.map((item) => item[1]),
         symbol: "none",
@@ -345,7 +380,7 @@ const Index = (props) => {
     }
     if (res?.data?.ll) {
       newData.series.push({
-        name: "下下限",
+        name: TranslateText(["下下限", "Ultra Lower Limit"]),
         type: "line",
         data: res?.data?.ll?.map((item) => item[1]),
         symbol: "none",
@@ -357,7 +392,7 @@ const Index = (props) => {
     }
     if (res?.data?.threshold) {
       newData.series.push({
-        name: "告警值",
+        name: TranslateText(["告警值", "Alarm value"]),
         type: "line",
         data: res?.data?.threshold?.map((item) => item[1]),
         symbol: "none",
@@ -399,46 +434,53 @@ const Index = (props) => {
             margin: "0px 0px",
             width: "calc(100% - 287px)",
           }}
-          labelStyle={{ width: 72 }}
+          labelStyle={{ width: labelWidth }}
         >
-          <Descriptions.Item span={3} label="告警名称">
+          <Descriptions.Item
+            span={3}
+            label={TranslateText(["告警名称", "Alarm name"])}
+          >
             {props.data?.data?.name}
           </Descriptions.Item>
           {props.data?.data?.point_id !== null &&
             props.data?.data?.point_id !== "" &&
             props.data?.data?.point_id !== undefined && (
-              <Descriptions.Item label="点位编号">
+              <Descriptions.Item
+                label={TranslateText(["点位编号", "Point id"])}
+              >
                 {props.data?.data?.point_id}
               </Descriptions.Item>
             )}
-          <Descriptions.Item label="告警类型">
+          <Descriptions.Item label={TranslateText(["告警类型", "Alarm type"])}>
             {alarmTypeMap[props.data?.data?.type]}
           </Descriptions.Item>
-          <Descriptions.Item label="告警级别">
+          <Descriptions.Item label={TranslateText(["告警级别", "Alarm level"])}>
             {levelMap[props.data?.data?.alarm_level]}
           </Descriptions.Item>
-          <Descriptions.Item label="告警时间">
+          <Descriptions.Item label={TranslateText(["告警时间", "Alarm time"])}>
             {props.data?.data?.created_time}
           </Descriptions.Item>
-          <Descriptions.Item label="恢复时间">
+          <Descriptions.Item label={TranslateText(["恢复时间", "Recovery at"])}>
             {props.data?.data?.recovery_time || "-"}
           </Descriptions.Item>
-          <Descriptions.Item label="持续时间">
+          <Descriptions.Item label={TranslateText(["持续时间", "Duration"])}>
             {getDur(props?.data?.data?.duration)}
           </Descriptions.Item>
-          <Descriptions.Item label="确认人">
+          <Descriptions.Item label={TranslateText(["确认人", "Confirmed by"])}>
             {props.data?.data?.confirmed_oper_name}
           </Descriptions.Item>
-          <Descriptions.Item label="确认时间">
+          <Descriptions.Item
+            label={TranslateText(["确认时间", "Confirmed at"])}
+          >
             {props.data?.data?.confirmed_time}
           </Descriptions.Item>
-          <Descriptions.Item label="备注信息">
+          <Descriptions.Item label={TranslateText(["备注信息", "Remark"])}>
             {props.data?.data?.remark}
           </Descriptions.Item>
         </Descriptions>
         <div className={styles.divide}></div>
         <div className={styles.oper}>
-          {props.data?.data?.status === 2 ? <Check></Check> : <Alert></Alert>}
+          {props.data?.data?.status === 2 ? <Check /> : <Alert />}
           <div className={styles.status}>
             {alarmStatusMap[props.data?.data?.status]}
           </div>
@@ -449,7 +491,7 @@ const Index = (props) => {
                 props?.onSetting(props.data?.data?.rule_id);
               }}
             >
-              告警配置
+              {TranslateText(["告警配置", "Alarm config"])}
             </div>
             <div className={styles.divide}></div>
             <div
@@ -458,7 +500,9 @@ const Index = (props) => {
                 props.data?.data?.op_status === 1 ? styles.disabled : ""
               }`}
             >
-              {props.data?.data?.op_status === 1 ? "已确认" : "告警确认"}
+              {props.data?.data?.op_status === 1
+                ? TranslateText(["已确认", "Confirmed"])
+                : TranslateText(["告警确认", "Confirm"])}
             </div>
           </div>
         </div>
@@ -474,6 +518,10 @@ const Index = (props) => {
               onChange={setRange}
               style={{ width: 360, zIndex: 99999 }}
               presets={rangePresets}
+              placeholder={[
+                TranslateText(["开始日期", "Start date"]),
+                TranslateText(["结束日期", "End date"]),
+              ]}
             />
           </div>
 

+ 31 - 15
src/pages/Alarm/components/components/AlarmHistory/index.jsx

@@ -96,7 +96,10 @@ const alarmStatusMap = {
   2: TranslateText(["已结束", "Ended"]),
 };
 
-const showTotal = (total) => `共${total}条`;
+const getPaginationTotalText = (total) => {
+  const dtLanguage = localStorage.getItem("dtLanguage");
+  return dtLanguage === "en" ? `${total} items` : `共${total}条`;
+};
 
 const alarmStatusOptions = [
   {
@@ -220,15 +223,17 @@ const Index = (props) => {
     //     `${(paginationProps.current - 1) * (paginationProps.pageSize) + (index + 1)}`
     // },
     {
-      title: TranslateText(["告警时间", "Alarm time"]),
+      title: TranslateText(["告警时间", "Alarm Time"]),
       width: 180,
       dataIndex: "created_time",
       fixed: "left",
       render: (text, record) =>
-        text ? dayjs(text).format("YYYY-MM-DD HH:mm:ss") : "暂无",
+        text
+          ? dayjs(text).format("YYYY-MM-DD HH:mm:ss")
+          : TranslateText(["暂无", "None"]),
     },
     {
-      title: TranslateText(["告警名称", "Alarm name"]),
+      title: TranslateText(["告警名称", "Alarm Name"]),
       dataIndex: "name",
       ellipsis: true,
       width: 400,
@@ -256,7 +261,7 @@ const Index = (props) => {
       },
     },
     {
-      title: TranslateText(["持续时间", "duration"]),
+      title: TranslateText(["持续时间", "Duration"]),
       dataIndex: "duration",
       width: 180,
       render: (text, record) => {
@@ -303,8 +308,8 @@ const Index = (props) => {
     {
       title: () => {
         return (
-          <Tooltip title={TranslateText(["确认人", "Confirm person"])}>
-            <span>{TranslateText(["确认人", "Confirm person"])}</span>
+          <Tooltip title={TranslateText(["确认人", "Confirmd By"])}>
+            <span>{TranslateText(["确认人", "Confirmd By"])}</span>
           </Tooltip>
         );
       },
@@ -319,7 +324,7 @@ const Index = (props) => {
       width: 100,
     },
     {
-      title: TranslateText(["确认时间", "Confirm time"]),
+      title: TranslateText(["确认时间", "Confirmed At"]),
       dataIndex: "confirmed_time",
       width: 180,
       render: (text, record) =>
@@ -333,7 +338,7 @@ const Index = (props) => {
       render: (_, record) => (
         <div style={{ display: "flex" }}>
           <a onClick={() => props.onSelect(record)} type="link">
-            详情
+            {TranslateText(["详情", "Detail"])}
           </a>
           <a
             onClick={() => onConfirm(record)}
@@ -341,7 +346,9 @@ const Index = (props) => {
             disabled={record.op_status === 1}
             style={{ marginLeft: 10 }}
           >
-            {record.op_status !== 1 ? "确认" : "已确认"}
+            {record.op_status !== 1
+              ? TranslateText(["确认", "Confirm"])
+              : TranslateText(["已确认", "Confirmed"])}
           </a>
         </div>
       ),
@@ -362,7 +369,10 @@ const Index = (props) => {
               setPage(1);
               run();
             }}
-            placeholder="请输入告警名称"
+            placeholder={TranslateText([
+              "请输入告警名称",
+              "Please enter alarm name",
+            ])}
             style={{
               width: 240,
             }}
@@ -388,7 +398,7 @@ const Index = (props) => {
             }}
             allowClear
             options={alarmStatusOptions}
-            placeholder="告警状态"
+            placeholder={TranslateText(["告警状态", "Alarm status"])}
           ></Select>
           <Select
             value={opStatus}
@@ -401,7 +411,7 @@ const Index = (props) => {
               width: 120,
               marginLeft: 16,
             }}
-            placeholder="确认状态"
+            placeholder={TranslateText(["确认状态", "Confirm status"])}
             allowClear
             options={periodOptions}
           ></Select>
@@ -417,11 +427,17 @@ const Index = (props) => {
               marginLeft: 16,
             }}
             allowClear={true}
+            placeholder={[
+              TranslateText(["开始日期", "Start date"]),
+              TranslateText(["结束日期", "End date"]),
+            ]}
             disabledDate={disabledDate}
           />
         </div>
         <div>
-          <Button onClick={onExport}>导出</Button>
+          <Button onClick={onExport}>
+            {TranslateText(["导出", "Export"])}
+          </Button>
         </div>
       </div>
       <Table
@@ -441,7 +457,7 @@ const Index = (props) => {
         <Pagination
           onChange={setPage}
           total={total}
-          showTotal={showTotal}
+          showTotal={getPaginationTotalText}
           showSizeChanger={false}
           pageSize={15}
           current={page}

+ 27 - 4
src/pages/Alarm/components/detail.jsx

@@ -16,6 +16,23 @@ import AlarmDetail from "./components/AlarmDetail";
 import AlarmConfirm from "./components/AlarmConfirm";
 // import { AlarmConfig } from "./components/AlarmConfig";
 
+function TranslateText(arr) {
+  const dtLanguage = localStorage.getItem("dtLanguage");
+  if (!Array.isArray(arr)) {
+    return arr;
+  }
+
+  if (arr.length < 2 && arr.length > 0) {
+    return arr?.[0];
+  }
+
+  if (dtLanguage === "en") {
+    return arr?.[1];
+  }
+
+  return arr?.[0];
+}
+
 const Detail = (props) => {
   const { options, isDiagram } = props;
   const [tags, setTags] = useState([]);
@@ -85,7 +102,7 @@ const Detail = (props) => {
   return (
     <>
       <Modal
-        title="告警记录"
+        title={TranslateText(["告警记录", "Alarm History"])}
         centered
         open={props.open}
         width="90vw"
@@ -119,11 +136,17 @@ const Detail = (props) => {
                   activeKey={current}
                   type="card"
                   items={[
-                    { label: "告警记录", children: null, key: "history" },
+                    {
+                      label: TranslateText(["告警记录", "Alarm History"]),
+                      children: null,
+                      key: "history",
+                    },
                     ...tags.map((item, index) => ({
                       label: (
                         <div className={styles.tagContainer}>
-                          <div className={styles.label}>详情</div>
+                          <div className={styles.label}>
+                            {TranslateText(["详情", "Detail"])}
+                          </div>
                           <CloseOutlined
                             style={{ fontSize: 10 }}
                             onClick={(e) => {
@@ -176,7 +199,7 @@ const Detail = (props) => {
                 )} */}
                 {current === "history" && !props.noSettings && (
                   <Button onClick={props?.onSetting} style={{ marginLeft: 10 }}>
-                    告警配置
+                    {TranslateText(["告警配置", "Alarm config"])}
                   </Button>
                 )}
               </div>

+ 25 - 12
src/pages/Alarm/components/easy.jsx

@@ -155,7 +155,7 @@ const Easy = (props, ref) => {
         .then((res) => {
           if (res?.state === 0) {
             form.resetFields();
-            message.success("保存成功");
+            message.success(TranslateText(["保存成功", "Seted"]));
             props.onConfirm();
           } else {
             message.error(res?.state_info);
@@ -248,7 +248,7 @@ const Easy = (props, ref) => {
         .then((res) => {
           if (res?.state === 0) {
             form.resetFields();
-            message.success("保存成功");
+            message.success(TranslateText(["保存成功", "Seted"]));
             props.onConfirm();
           } else {
             message.error(res?.state_info);
@@ -598,7 +598,11 @@ const Easy = (props, ref) => {
               <div>
                 <Space size={8}>
                   <div className={styles.itemContainer}>
-                    {!!ah && <div className={styles.label}>{TranslateText(["上限", "Upper Limit"])}</div>}
+                    {!!ah && (
+                      <div className={styles.label}>
+                        {TranslateText(["上限", "Upper Limit"])}
+                      </div>
+                    )}
                     <Form.Item
                       name="ah_value"
                       key={ahEnable}
@@ -642,7 +646,11 @@ const Easy = (props, ref) => {
                     className={styles.itemContainer}
                     style={{ marginLeft: 8 }}
                   >
-                    {!!ahh && <div className={styles.label}>{TranslateText(["上上限", "Ultra Upper Limit"])}</div>}
+                    {!!ahh && (
+                      <div className={styles.label}>
+                        {TranslateText(["上上限", "Ultra Upper Limit"])}
+                      </div>
+                    )}
                     <Form.Item
                       name="ahh_value"
                       key={ahhEnable}
@@ -693,7 +701,11 @@ const Easy = (props, ref) => {
               <div style={{ marginTop: 10 }}>
                 <Space size={8}>
                   <div className={styles.itemContainer}>
-                    {!!al && <div className={styles.label}>{TranslateText(["下限", "Lower Limit"])}</div>}
+                    {!!al && (
+                      <div className={styles.label}>
+                        {TranslateText(["下限", "Lower Limit"])}
+                      </div>
+                    )}
                     <Form.Item
                       name="al_value"
                       key={alEnable}
@@ -738,7 +750,11 @@ const Easy = (props, ref) => {
                     className={styles.itemContainer}
                     style={{ marginLeft: 8 }}
                   >
-                    {!!all && <div className={styles.label}>{TranslateText(["下下限", "Ultra Lower Limit"])}</div>}
+                    {!!all && (
+                      <div className={styles.label}>
+                        {TranslateText(["下下限", "Ultra Lower Limit"])}
+                      </div>
+                    )}
                     <Form.Item
                       name="all_value"
                       key={allEnable}
@@ -813,7 +829,7 @@ const Easy = (props, ref) => {
         <Form.Item label={TranslateText(["启用状态", "Enable"])} name="status">
           <Switch size={"small"} />
         </Form.Item>
-        
+
         <Form.Item
           label={TranslateText(["单位", "Unit"])}
           name="unit"
@@ -830,10 +846,7 @@ const Easy = (props, ref) => {
           />
         </Form.Item>
 
-        <Form.Item
-          label={TranslateText(["告警组", "Group"])}
-          name={"group_id"}
-        >
+        <Form.Item label={TranslateText(["告警组", "Group"])} name={"group_id"}>
           <Select
             style={{ width: 200 }}
             options={[
@@ -916,7 +929,7 @@ const Easy = (props, ref) => {
               status === 1 &&
               !isDisabled && (
                 <div style={{ color: "var(--dt-error-color1)" }}>
-                  请输入数字
+                  {TranslateText(["请输入数字", "Please input number"])}
                 </div>
               )}
           </div>

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

@@ -340,11 +340,11 @@ const TopoDetail = (props) => {
 
     const seriesData = historyData.map((point) => {
       // 转换为百分比显示
-      return (point.value * 100).toFixed(2);
+      return point.value.toFixed(2);
     });
 
     // 阈值也转换为百分比
-    const thresholdValue = (threshold * 100).toFixed(2);
+    const thresholdValue = threshold.toFixed(2);
 
     // 配置数据点样式
     newData.series[0] = {

Some files were not shown because too many files changed in this diff