严智鑫
2024-05-29 ad7f461a110cd30ae219bcaa977bbeb0c8409599
Albania_Mes-ui/src/views/Electrical/Sign.vue
@@ -25,7 +25,7 @@
                item.unit
              }}</span> -->
        <span  style="width: 100%;" class="in_mc">{{
                item.name
                language === 'zh-CN'?item.name1:item.name
              }}</span>
      </div>
@@ -50,8 +50,7 @@
        params: [],
        xyData: [],
      },
      language :this.$i18n.locale,
      messagepack: {
        data: { taskname: "" }
      },
@@ -63,13 +62,14 @@
    }
  },
  created () {
    //this.showdata();
  },
  activated(){
    this.init();
    this.record.xyData = this.jsonData.sign;
    const language = this.$i18n.locale;
    if (language === 'zh-CN') {
            this.replaceChineseWithEnglish();
          } else {
@@ -78,8 +78,6 @@
 },
  methods: {
    showdata () {
      console.log(1111);
      console.log(this.jsonData.sign[0].name);
      // console.log(this.record.xyData);
    },
@@ -128,7 +126,6 @@
          this.record.params[0] = obj.sig[0];
          this.record.xyData = this.jsonData.sign;
          console.log(this.jsonData.sign)
          for (let a = 0; a < this.record.xyData.length; a++) {
            this.record.xyData[a].value = this.record.params[0][a];
@@ -141,7 +138,8 @@
          );
          const language = this.$i18n.locale;
          const language = this.$i18n.locale;language
          console.log(language);
          if (language === 'zh-CN') {
            this.replaceChineseWithEnglish();
          } else {
@@ -164,12 +162,12 @@
    //语言转换
    replaceChineseWithEnglish () {
      const translation = this.$t('Signlang');
      // const translation = this.$t('Signlang');
      if (translation != null) {
        this.record.xyData = this.record.xyData.map(item => { return { name: translation[item.name] || item.name, value: item.value,unit:item.unit }; });
        //console.log(translation);
      }
      // if (translation != null) {
      //   this.record.xyData = this.record.xyData.map(item => { return { name: translation[item.name] || item.name, value: item.value,unit:item.unit }; });
      //   //console.log(translation);
      // }
    }
  }