wuyouming666
2023-09-07 db0b4745458fd22b6552912b0572a89b2af09564
CanadaMes-ui/src/views/Electrical/alarm.vue
@@ -3,7 +3,7 @@
    <!--面包屑导航区域-->
    <el-breadcrumb separator-class="el-icon-arrow-right" class="el-breadcrumb">
      <router-link to="/home" tag="el-button" type="text">{{ $t('langHome') }}</router-link>
      <el-button type="text">设备管理</el-button>
      <el-button type="text">Electrical</el-button>
      <router-link to="/Electrical/Parameter" tag="el-button" type="text">Parameter</router-link>
      <router-link to="/Electrical/Action" tag="el-button" type="text">Action</router-link>
      <router-link to="/Electrical/Sign" tag="el-button" type="text">Sign</router-link>
@@ -47,7 +47,11 @@
      },
      roles: [],
<<<<<<< HEAD
      localizedRoles:[],
=======
      localizedRoles: [],
>>>>>>> 36acd690614dd276428530a59f448c543bac52d4
      messagepack: {
        data: { taskname: "" }
      },
@@ -64,6 +68,7 @@
  },
  methods: {
<<<<<<< HEAD
    load() {
  setAll().then(res => {
    this.roles = res.data.list;
@@ -83,6 +88,27 @@
    content: translation[role.content] || role.content
  }));
},
=======
    load () {
      setAll().then(res => {
        this.roles = res.data.list;
        const language = this.$i18n.locale;
        if (language === 'zh-CN') {
          this.replaceChineseWithEnglish();
        } else {
          this.localizedRoles = [...this.roles];
        }
        console.log(this.localizedRoles);
      });
    },
    replaceChineseWithEnglish () {
      const translation = this.$t('translation');
      this.localizedRoles = this.roles.map(role => ({
        ...role,
        content: translation[role.content] || role.content
      }));
    },
>>>>>>> 36acd690614dd276428530a59f448c543bac52d4
    init () {
      let viewname = "alarm";