he wei
2024-01-15 d592480beb70716a59b6ec5a00c73e92ff6ea986
src/pages/xmlResult.vue
@@ -20,12 +20,12 @@
                  'icon-tuichuquanping': fullScreen,
                },
              ]"
              :title="fullScreen ? '还原' : '全屏'"
              :title="fullScreen ? $t('Restore') : $t('FullScreen')"
              @click="toggleScreen(item)"
            ></div>
            <div
              class="btn iconfont icon-guanbi"
              title="关闭"
              :title="$t('operate.close')"
              @click="closeItem(item)"
            ></div>
          </div>
@@ -79,7 +79,7 @@
    ></chart-context-menu>
    <!-- 文件属性 -->
    <el-dialog
      title="属性"
      :title="$t('result.Properties')"
      class="file-info"
      :visible.sync="fileInfoVisible"
      append-to-body
@@ -113,37 +113,44 @@
  updateFileParam,
} from "@/apis";
import { toFixed } from "@/assets/js/util";
import i18n from "./i18n/compare";
import { createI18nOption } from "@/assets/js/tools/i18n";
import xmlResult from "./i18n/xmlResult";
const i18nMixin = createI18nOption(i18n, [[xmlResult, "result"]]);
// 保留三位小数
const BIT = 3;
export default {
  name: "",
  mixins: [i18nMixin],
  data() {
    const titles = {
      resVisiable: "内阻(mΩ)",
      volVisiable: "电压(V)",
      capVisiable: "容量(Ah)",
      chainVisiable: "连接条(uΩ)",
      condVisiable: "电导(S)",
      tableVisiable: "数据表格",
      resVisiable: this.$t("Resistance") + "(mΩ)",
      volVisiable: this.$t("Voltage") + "(V)",
      capVisiable: this.$t("result.Capacity") + "(Ah)",
      chainVisiable: this.$t("result.ConnectionBar") + "(uΩ)",
      condVisiable: this.$t("result.Conductance") + "(S)",
      tableVisiable: this.$t("result.DataSheet"),
    };
    const marks = {
      resVisiable: [
        {
          name: "内阻告警",
          name: this.$t("ResistanceAlarm"),
          y: 0,
          type: "high",
          color: "#ff0",
        },
        {
          name: "内阻更换",
          name: this.$t("ResistanceFail"),
          y: 0,
          type: "high",
          color: "#d9001b",
        },
        {
          name: "平均值",
          name: this.$t("result.average"),
          y: 0,
          type: "agv",
          color: "#0f0",
@@ -151,19 +158,19 @@
      ],
      volVisiable: [
        {
          name: "高压告警",
          name: this.$t("HighvoltageAlarm"),
          y: 0,
          type: "high",
          color: "#d9001b",
        },
        {
          name: "低压告警",
          name: this.$t("LowvoltageAlarm"),
          y: 0,
          type: "low",
          color: "#ff0",
        },
        {
          name: "平均值",
          name: this.$t("result.average"),
          y: 0,
          type: "agv",
          color: "#0f0",
@@ -171,19 +178,19 @@
      ],
      chainVisiable: [
        {
          name: "连接条告警",
          name: this.$t("result.ConnectionBarAlarm"),
          y: 0,
          type: "high",
          color: "#ff0",
        },
        {
          name: "连接条更换",
          name: this.$t("result.ConnectionBarFail"),
          y: 0,
          type: "high",
          color: "#d9001b",
        },
        {
          name: "平均值",
          name: this.$t("result.average"),
          y: 0,
          type: "agv",
          color: "#0f0",
@@ -200,8 +207,8 @@
      // stdDevCr: "",
      resPic: "",
      volPic: "",
      chainPic: '',
      condPic: '',
      chainPic: "",
      condPic: "",
      fileParam: undefined,
      stationInfo: undefined,
      marks,
@@ -215,32 +222,32 @@
      headers: [
        {
          prop: "monNum",
          label: "电池",
          label: this.$t("result.Battery"),
          minWidth: 80,
        },
        {
          prop: "bv",
          label: "电压(V)",
          label: this.$t("Voltage") + "(V)",
          minWidth: 100,
        },
        {
          prop: "estimatedCap",
          label: "预估容量(Ah)",
          label: this.$t("result.estimatedCapacity") + "(Ah)",
          minWidth: 100,
        },
        {
          prop: "br",
          label: "内阻(mΩ)",
          label: this.$t("Resistance") + "(mΩ)",
          minWidth: 100,
        },
        {
          prop: "cr",
          label: "连接条(μΩ)",
          label: this.$t("result.ConnectionBar") + "(μΩ)",
          minWidth: 120,
        },
        {
          prop: "bs",
          label: "电导(S)",
          label: this.$t("result.Conductance") + "(S)",
          minWidth: 100,
        },
      ],
@@ -285,7 +292,11 @@
        condData.push(v.bs);
        // capData.push() TODO
        chainData.push(v.cr);
        tableData.push({ ...v, estimatedCap: toFixed(v.estimatedCap, 1), monNum: "#" + v.monNum });
        tableData.push({
          ...v,
          estimatedCap: toFixed(v.estimatedCap, 1),
          monNum: "#" + v.monNum,
        });
      });
      return {
        xLabel,
@@ -374,19 +385,19 @@
          if (!this.marks.volVisiable.length) {
            this.marks.volVisiable = [
              {
                name: "高压告警",
                name: this.$t("HighvoltageAlarm"),
                y: 0,
                type: "high",
                color: "#d9001b",
              },
              {
                name: "低压告警",
                name: this.$t("LowvoltageAlarm"),
                y: 0,
                type: "low",
                color: "#ff0",
              },
              {
                name: "平均值",
                name: this.$t('result.average'),
                y: 0,
                type: "agv",
                color: "#0f0",
@@ -413,7 +424,7 @@
            default:
              this.marks.volVisiable = [
                {
                  name: "平均值",
                  name: this.$t('result.average'),
                  y: 0,
                  type: "agv",
                  color: "#0f0",
@@ -443,7 +454,7 @@
            this.initChart();
          });
        } else {
          this.$message.error("查询数据失败");
          this.$message.error(this.$t('result.Dataqueryfailure'));
        }
      });
    },
@@ -484,19 +495,19 @@
          if (!this.marks.volVisiable.length) {
            this.marks.volVisiable = [
              {
                name: "高压告警",
                name: this.$t("HighvoltageAlarm"),
                y: 0,
                type: "high",
                color: "#d9001b",
              },
              {
                name: "低压告警",
                name: this.$t("LowvoltageAlarm"),
                y: 0,
                type: "low",
                color: "#ff0",
              },
              {
                name: "平均值",
                name: this.$t('result.average'),
                y: 0,
                type: "agv",
                color: "#0f0",
@@ -523,7 +534,7 @@
            default:
              this.marks.volVisiable = [
                {
                  name: "平均值",
                  name: this.$t('result.average'),
                  y: 0,
                  type: "agv",
                  color: "#0f0",
@@ -558,7 +569,7 @@
            this.initChart();
          });
        } else {
          this.$message.error("文件解析失败");
          this.$message.error(this.$t("FileParsingFailed"));
        }
      });
    },
@@ -716,7 +727,7 @@
        this.toggleScreen(item);
      }
      if (this.windowList.length <= 1) {
        this.$message.warning("最少保留一个模块");
        this.$message.warning(this.$t("Keepatleastonemodule"));
        return;
      }
      const idx = this.windowList.indexOf(item);
@@ -752,11 +763,11 @@
      updateFileParam(this.stationId, data).then((res) => {
        const { code, data } = res.data;
        if (code && data) {
          this.$message.success("修改成功");
          this.$message.success(this.$t('result.ModifySuccessfully'));
          this.refreshPage();
          this.fileInfoVisible = false;
        } else {
          this.$message.error("修改失败");
          this.$message.error(this.$t('result.ModifyFailed'));
        }
      });
    },
@@ -778,7 +789,7 @@
            this.fileData = data2.fileParam;
            this.fileInfoVisible = true;
          } else {
            this.$message.error("读取文件失败");
            this.$message.error(this.$t('result.Failedtoreadthefile'));
          }
        });
        return false;
@@ -789,7 +800,7 @@
          this.fileData = data2;
          this.fileInfoVisible = true;
        } else {
          this.$message.error("获取参数失败");
          this.$message.error(this.$t('result.Parameterreadfailure'));
        }
      });
    },
@@ -844,7 +855,7 @@
          const matchRes = /filename=(.*)/.exec(headers["content-disposition"]);
          const fileName = matchRes
            ? decodeURI(matchRes[1].trim())
            : "未知文件名.xls";
            : this.$t("UnknownFileName") + ".xls";
          let link = document.createElement("a");
          link.style.display = "none";
@@ -855,7 +866,7 @@
          document.body.removeChild(link);
          window.URL.revokeObjectURL(url);
        } else {
          this.$message.error("操作失败");
          this.$message.error(this.$t("OperationFailed"));
        }
      });
    },