Browse Source

英文图表领先单位英文转换

Karsa 2 years ago
parent
commit
7363316d39
2 changed files with 12 additions and 2 deletions
  1. 1 1
      package.json
  2. 11 1
      src/views/chartShow/index.vue

+ 1 - 1
package.json

@@ -9,7 +9,7 @@
   },
   "dependencies": {
     "axios": "^0.21.1",
-    "element-plus": "^1.1.0-beta.9",
+    "element-plus": "^2.0.1",
     "highcharts": "^9.2.2",
     "less": "^4.1.1",
     "less-loader": "^8.0.0",

+ 11 - 1
src/views/chartShow/index.vue

@@ -832,12 +832,22 @@ export default defineComponent({
       }:{
         0: 'lead'
       }
+
+      const leadUnitEnMap:any = {
+        '年': 'year',
+        '季': 'quarter',
+        '月': 'month',
+        '周': 'week',
+        '天': 'day',
+      }
+      //英文领先单位转换
+      const edbLeadUnit = lang=='ch' ? LeadUnit : leadUnitEnMap[LeadUnit];
       
       let axis_tag = axisLabelMap[IsAxis] || '';
       //逆序拼接
       let order_tag = orderLabelMap[Number(IsOrder)] ? `${axis_tag ? ',': ''}${orderLabelMap[Number(IsOrder)]}` : ''
       //领先拼接
-      let edb_tag = edbInfoMap[EdbInfoType] ? `${(axis_tag||order_tag) ? ',' : '' }${edbInfoMap[EdbInfoType]}${LeadValue}${LeadUnit}` : '';
+      let edb_tag = edbInfoMap[EdbInfoType] ? `${(axis_tag||order_tag) ? ',' : '' }${edbInfoMap[EdbInfoType]}${LeadValue}${edbLeadUnit}` : '';
 
       return (axis_tag || order_tag || edb_tag) ? `(${axis_tag}${order_tag}${edb_tag})` : ''
     }