wuyouming666
2023-09-07 0b6ddf2bf0d6c70867611b730ac445a242a89931
CanadaMes-ui/src/views/Electrical/alarm.vue
@@ -47,11 +47,9 @@
      },
      roles: [],
<<<<<<< HEAD
      localizedRoles:[],
=======
      localizedRoles: [],
>>>>>>> 36acd690614dd276428530a59f448c543bac52d4
      messagepack: {
        data: { taskname: "" }
      },
@@ -68,27 +66,7 @@
  },
  methods: {
<<<<<<< HEAD
    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
  }));
},
=======
    load () {
      setAll().then(res => {
        this.roles = res.data.list;
@@ -108,7 +86,7 @@
        content: translation[role.content] || role.content
      }));
    },
>>>>>>> 36acd690614dd276428530a59f448c543bac52d4
    init () {
      let viewname = "alarm";