Forráskód Böngészése

线索数据国际化调整

qymljy 1 hónapja
szülő
commit
2edabe4cdf

+ 10 - 2
src/views/clueData/modules/clueAdd.vue

@@ -107,11 +107,19 @@ export default {
       this.lineChart = res.data.lineChart.map(item=>{
         return {
           date: item.date,
-          type:"同比增长率",
+          type:this.$t("同比增长率"),
           value: Math.round((item.value * 100)*100)/100
         }
       })
       this.newHistogram = lastYear.concat(nowYear)
+
+      this.newHistogram = this.newHistogram.map(item=>{
+        return {
+          date: item.date,
+          type:this.$t(item.type),
+          value: item.value
+        }
+      })
       this.chartDualAxes.changeData([this.newHistogram,this.lineChart])
       state == '状态' ? this.personData() : ''
     },
@@ -149,7 +157,7 @@ export default {
         ],
         tooltip: {
           formatter: (datum) => {
-            return { name: datum.type, value: datum.type == '同比增长率'? datum.value + '%' : datum.value };
+            return { name: datum.type, value: datum.type == this.$t('同比增长率')? datum.value + '%' : datum.value };
           },
         },
       });

+ 9 - 2
src/views/clueData/modules/clueChange.vue

@@ -90,10 +90,17 @@ export default {
       this.lineChart = res.data.lineChart.map(item=>{
         return {
           date: item.date,
-          key:"总次数同比增长率",
+          key:this.$t("总次数同比增长率"),
           value: Math.round((item.value * 100)*100)/100
         }
       })
+      this.histogram = this.histogram.map(item=>{
+        return {
+          date: item.date,
+          key:this.$t(item.key),
+          value: item.value
+        }
+      })
       this.chartDualAxes.changeData([this.histogram,this.lineChart])
       state == '状态' ? this.personData() : ''
     },
@@ -129,7 +136,7 @@ export default {
         ],
         tooltip: {
           formatter: (datum) => {
-            return { name: datum.key, value: datum.key === '总次数同比增长率'?datum.value + '%': datum.value };
+            return { name: datum.key, value: datum.key === this.$t('总次数同比增长率')?datum.value + '%': datum.value };
           },
         },
       });

+ 10 - 2
src/views/clueData/modules/clueFollow.vue

@@ -109,11 +109,19 @@ export default {
       this.lineChart = res.data.lineChart.map(item=>{
         return {
           date: item.date,
-          key:"同比增长率",
+          key:this.$t("同比增长率"),
           value: Math.round((item.value * 100)*100)/100
         }
       })
       this.newHistogram = lastYear.concat(nowYear)
+
+      this.newHistogram = this.newHistogram.map(item=>{
+        return {
+          date: item.date,
+          key:this.$t(item.key),
+          value: item.value
+        }
+      })
       this.chartDualAxes.changeData([this.newHistogram,this.lineChart])
       state == '状态' ? this.personData() : ''
     },
@@ -150,7 +158,7 @@ export default {
         ],
         tooltip: {
           formatter: (datum) => {
-            return { name: datum.key, value: datum.key == '同比增长率'? datum.value + '%' : datum.value };
+            return { name: datum.key, value: datum.key == this.$t('同比增长率')? datum.value + '%' : datum.value };
           },
         },
       });

+ 3 - 3
src/views/clueData/modules/clueUnFollow.vue

@@ -42,7 +42,7 @@
       <div class="chart">
         <div id="clueUnFollowAnalysisChart" :style="{height: heightChart}"></div>
       </div>
-      <div style="font-size: 16px;color: #333333;margin: 10px 0 10px 0">{{param.content.dateType?param.content.dateType:'全部'}}</div>
+      <div style="font-size: 16px;color: #333333;margin: 10px 0 10px 0">{{$t(param.content.dateType?param.content.dateType:'全部')}}</div>
       <div :style="{height: heightTable}">
         <tableTemplate  ref="table" :layout="tablecols" :data="list" :opwidth="200" :custom="true" :height="height" fixedName="operation">
           <template v-slot:customcol="scope">
@@ -217,8 +217,8 @@ export default {
         return {
           "sequence": item.sequence,
           "value": item.value,
-          "key": item.key,
-          "type":"线索数"
+          "key": this.$t(item.key),
+          "type":this.$t("线索数")
         }
       })
       this.chartColumn.changeData(this.columnData)