jwyu 1 年之前
父節點
當前提交
71ae6b3d4d

+ 52 - 0
src/lang/modules/systemManage/ChartSet.js

@@ -0,0 +1,52 @@
+/**
+ * 系统设置-图表配置
+ */
+
+/* 英文 */
+export const ChartSetEn = {
+    label01:'Chart Types',
+    label02:'ETA Chart Library Default Theme',
+    add_btn:'Add Custom Theme',
+    edit_btn:'Edit Custom Theme',
+    theme_name:'Theme Name',
+    theme_name_placeholder:'Please enter theme name',
+    alert_msg:'After deletion, all charts using this theme will adopt the ETA theme. Are you sure you want to proceed with the deletion?',
+
+    opt_label01:'Line Setting',
+    opt_label02:'Scatter Setting',
+    opt_label03:'Legend Setting',
+    opt_label04:'Title Setting',
+    opt_label05:'Annotation Text Settings (Source & Identification)',
+    opt_label06:'Horizontal Axis Setting',
+    opt_label07:'Vertical Axis Setting',
+    opt_label08:'Plot Area Setting',
+    opt_label09:'Bar Setting',
+    opt_label10:'Lines, Bar Setting',
+};
+  
+/* 中文 */
+export const ChartSetZh = {
+    label01:'图表类型',
+    label02:'ETA图库默认主题',
+    add_btn:'添加自定义主题',
+    edit_btn:'编辑自定义主题',
+    theme_name:'主题名称',
+    theme_name_placeholder:'请输入主题名称',
+    alert_msg:'删除后,所有采用该主题的图表,将采用ETA主题,是否确定删除?',
+
+    opt_label01:'线条设置',
+    opt_label02:'散点设置',
+    opt_label03:'图例设置',
+    opt_label04:'标题设置',
+    opt_label05:'标记文字设置(来源,标识)',
+    opt_label06:'横轴设置',
+    opt_label07:'纵轴设置',
+    opt_label08:'绘图区设置',
+    opt_label09:'柱形设置',
+    opt_label10:'线条、柱形设置',
+
+};
+  
+/**
+* $t('SystemManage.ChartSet.XXX')
+*/

+ 3 - 1
src/lang/modules/systemManage/indexEn.js

@@ -6,6 +6,7 @@ import {EnAuthSetEn} from './EnAuthSet'
 import {BaseConfigEn} from './BaseConfig'
 import {OutLinkConfigEn} from './OutLinkConfig'
 import {DataSourceAccountEn} from './DataSourceAccount'
+import {ChartSetEn} from './ChartSet'
 
 export default {
   // 系统设置
@@ -17,7 +18,8 @@ export default {
     EnAuthSet:EnAuthSetEn,
     BaseConfig:BaseConfigEn,
     OutLinkConfig:OutLinkConfigEn,
-    DataSourceAccount:DataSourceAccountEn
+    DataSourceAccount:DataSourceAccountEn,
+    ChartSet:ChartSetEn
   },
 };
 

+ 3 - 1
src/lang/modules/systemManage/indexZh.js

@@ -6,6 +6,7 @@ import {EnAuthSetZh} from './EnAuthSet'
 import {BaseConfigZh} from './BaseConfig'
 import { OutLinkConfigZh } from "./OutLinkConfig";
 import{DataSourceAccountZh} from './DataSourceAccount'
+import { ChartSetZh } from "./ChartSet";
 
 export default {
   // 系统设置
@@ -17,6 +18,7 @@ export default {
     EnAuthSet:EnAuthSetZh,
     BaseConfig:BaseConfigZh,
     OutLinkConfig:OutLinkConfigZh,
-    DataSourceAccount:DataSourceAccountZh
+    DataSourceAccount:DataSourceAccountZh,
+    ChartSet:ChartSetZh
   },
 };

+ 46 - 20
src/views/system_manage/chartTheme/components/optionsSection.vue

@@ -214,6 +214,32 @@ export default {
     chartType() {
     }
   },
+  computed:{
+    labelMap(){
+      return new Map([
+        ['lineOptions',this.$t('SystemManage.ChartSet.opt_label01')],
+        ['scatterOptions',this.$t('SystemManage.ChartSet.opt_label02')],
+        ['legendOptions',this.$t('SystemManage.ChartSet.opt_label03')],
+        ['titleOptions',this.$t('SystemManage.ChartSet.opt_label04')],
+        ['markerOptions',this.$t('SystemManage.ChartSet.opt_label05')],
+        ['xAxisOptions',this.$t('SystemManage.ChartSet.opt_label06')],
+        ['yAxisOptions',this.$t('SystemManage.ChartSet.opt_label07')],
+        ['drawOption',this.$t('SystemManage.ChartSet.opt_label08')],
+      ])
+    },
+    typeLabelMap(){
+      return {
+        1: {label:this.$t('SystemManage.ChartSet.opt_label01'),lineLabel: '条'},
+        2: {label:this.$t('SystemManage.ChartSet.opt_label01'),lineLabel: '条'},
+        4: {label:this.$t('SystemManage.ChartSet.opt_label09'),lineLabel: '根'},
+        5: {label:this.$t('SystemManage.ChartSet.opt_label02'),lineLabel: '系列'},
+        6: {label:this.$t('SystemManage.ChartSet.opt_label10'),lineLabel: '系列'},
+        7: {label:this.$t('SystemManage.ChartSet.opt_label09'),lineLabel: '根'},
+        10: {label:this.$t('SystemManage.ChartSet.opt_label02'),lineLabel: '系列'},
+        11: {label:this.$t('SystemManage.ChartSet.opt_label01'),lineLabel: '条'},
+      }
+    }
+  },
   data() {
     return {
       predefineColors,
@@ -238,26 +264,26 @@ export default {
         drawOption: defaultETAOptions.drawOption
       },
       lengendPositions: verticalPositions.filter(_ => _.value!=='middle'),
-      typeLabelMap: {
-        1: {label:'线条设置',lineLabel: '条'},
-        2: {label:'线条设置',lineLabel: '条'},
-        4: {label:'柱形设置',lineLabel: '根'},
-        5: {label:'散点设置',lineLabel: '系列'},
-        6: {label:'线条、柱形设置',lineLabel: '系列'},
-        7: {label:'柱形设置',lineLabel: '根'},
-        10: {label:'散点设置',lineLabel: '系列'},
-        11: {label:'线条设置',lineLabel: '条'},
-      },
-      labelMap: new Map([
-        ['lineOptions','线条设置'],
-        ['scatterOptions','散点设置'],
-        ['legendOptions','图例设置'],
-        ['titleOptions','标题设置'],
-        ['markerOptions','标记文字设置(来源,标识)'],
-        ['xAxisOptions','横轴设置'],
-        ['yAxisOptions','纵轴设置'],
-        ['drawOption','绘图区设置'],
-      ]),
+      // typeLabelMap: {
+      //   1: {label:'线条设置',lineLabel: '条'},
+      //   2: {label:'线条设置',lineLabel: '条'},
+      //   4: {label:'柱形设置',lineLabel: '根'},
+      //   5: {label:'散点设置',lineLabel: '系列'},
+      //   6: {label:'线条、柱形设置',lineLabel: '系列'},
+      //   7: {label:'柱形设置',lineLabel: '根'},
+      //   10: {label:'散点设置',lineLabel: '系列'},
+      //   11: {label:'线条设置',lineLabel: '条'},
+      // },
+      // labelMap: new Map([
+      //   ['lineOptions','线条设置'],
+      //   ['scatterOptions','散点设置'],
+      //   ['legendOptions','图例设置'],
+      //   ['titleOptions','标题设置'],
+      //   ['markerOptions','标记文字设置(来源,标识)'],
+      //   ['xAxisOptions','横轴设置'],
+      //   ['yAxisOptions','纵轴设置'],
+      //   ['drawOption','绘图区设置'],
+      // ]),
       configOptions: []
     }
   },

+ 18 - 18
src/views/system_manage/chartTheme/index.vue

@@ -4,7 +4,7 @@
       <div style="display: flex;gap:20px;">
         <div class="select-item">
           <div class="select-item">
-            <label>图表类型</label>
+            <label>{{$t('SystemManage.ChartSet.label01')}}</label>
             <el-select v-model="formData.chartType" style="margin-left: 15px;" @change="getThemeList();">
               <el-option
                 v-for="item in chartTypeOpts"
@@ -16,7 +16,7 @@
           </div>
         </div>
         <div class="select-item">
-          <label>ETA图库默认主题</label>
+          <label>{{$t('SystemManage.ChartSet.label02')}}</label>
           <el-select v-model="formData.theme" style="margin-left: 10px;">
             <el-option
               v-for="item in themeOpts"
@@ -28,7 +28,7 @@
         </div>
       </div>
 
-      <el-button type="primary" v-permission="permissionBtn.chartThemePermission.chartTheme_edit" @click="setConfigTheme">保存</el-button>
+      <el-button type="primary" v-permission="permissionBtn.chartThemePermission.chartTheme_edit" @click="setConfigTheme">{{$t('Dialog.confirm_save_btn')}}</el-button>
     </div>
 
     <!-- 主题列表 -->
@@ -43,8 +43,8 @@
             <div slot="header" class="item-top">
               <span class="text_oneLine">{{item.ChartThemeName}}</span>
               <div>
-                <el-button type="text" @click="editThemeHandle(item)" v-permission="permissionBtn.chartThemePermission.chartTheme_edit">编辑</el-button>
-                <span class="deletesty" @click="delThemeHandle(item,index)" v-permission="permissionBtn.chartThemePermission.chartTheme_del" v-if="!item.IsSystemTheme">删除</span>
+                <el-button type="text" @click="editThemeHandle(item)" v-permission="permissionBtn.chartThemePermission.chartTheme_edit">{{$t('Table.edit_btn')}}</el-button>
+                <span class="deletesty" @click="delThemeHandle(item,index)" v-permission="permissionBtn.chartThemePermission.chartTheme_del" v-if="!item.IsSystemTheme">{{$t('Table.delete_btn')}}</span>
               </div>
             </div>
             <div class="chart-img" :style="`backgroundImage:url(${item.ChartImage})`"></div>
@@ -54,7 +54,7 @@
           <div class="chart-img"></div>
           <div class="add-cont">
             <i class="el-icon-plus"/>
-            <el-button type="text" style="font-size:16px;">添加自定义主题</el-button>
+            <el-button type="text" style="font-size:16px;">{{$t('SystemManage.ChartSet.add_btn')}}</el-button>
           </div>
         </li>
       </ul>
@@ -64,16 +64,16 @@
 
    <!-- 弹窗 -->
     <m-dialog 
-      :title="`${addThemeForm.id?'编辑':'添加'}自定义主题`" 
+      :title="`${addThemeForm.id?$t('SystemManage.ChartSet.edit_btn'):$t('SystemManage.ChartSet.edit_btn')}`" 
       :show.sync="isOpenThemeDia" 
       width="650px"
     >
       <div style="padding:30px 60px">
         <div>
-          <label class="el-form-item__label">主题名称</label>
+          <label class="el-form-item__label">{{$t('SystemManage.ChartSet.theme_name')}}</label>
           <el-input 
             v-model="addThemeForm.themeName" 
-            placeholder="请输入主题名称"
+            :placeholder="$t('SystemManage.ChartSet.theme_name_placeholder')"
           />
         </div>
       </div>
@@ -82,11 +82,11 @@
           @click="saveThemeHandle"
           type="primary"
           style="width: 132px; height: 40px"
-          >保存</el-button>
+          >{{$t('Dialog.confirm_save_btn')}}</el-button>
         <el-button
         @click="isOpenThemeDia=false"
         style="width: 132px; height: 40px"
-        >取消</el-button>
+        >{{$t('Dialog.cancel_btn')}}</el-button>
       </div>
     </m-dialog>
 
@@ -159,10 +159,10 @@ export default {
     },
 
     async delThemeHandle(item,index) {
-      await this.$confirm('删除后,所有采用该主题的图表,将采用ETA主题,是否确定删除?',
-       '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
+      await this.$confirm(this.$t('SystemManage.ChartSet.alert_msg'),
+       this.$t('Confirm.prompt'), {
+          // confirmButtonText: '确定',
+          // cancelButtonText: '取消',
           type: 'warning'
       })
 
@@ -170,7 +170,7 @@ export default {
       if(res.Ret!==200) return 
 
       this.themeOpts.splice(index,1)
-      this.$message.success('删除成功')
+      this.$message.success(this.$t('MsgPrompt.delete_msg'))
     },
 
     editThemeHandle({ChartThemeId}) {
@@ -185,7 +185,7 @@ export default {
 
 
     async saveThemeHandle() {
-      if(!this.addThemeForm.themeName) return this.$message.warning('请输入主题名称')
+      if(!this.addThemeForm.themeName) return this.$message.warning(this.$t('SystemManage.ChartSet.theme_name_placeholder'))
 
       let res = await chartThemeInterface.addTheme({
         ChartThemeName: this.addThemeForm.themeName,
@@ -193,7 +193,7 @@ export default {
       })
 
       if(res.Ret !== 200) return
-      this.$message.success('添加成功')
+      this.$message.success(this.$t('MsgPrompt.add_msg'))
       this.isOpenThemeDia = false;
 
       this.getThemeList()

+ 2 - 2
src/views/system_manage/chartTheme/themeSetting.vue

@@ -21,8 +21,8 @@
         </el-select>
       </div>
       <div>
-        <el-button type="primary" plain @click="$router.go(-1)">取消</el-button>
-        <el-button type="primary" @click="setThemeOptions">保存</el-button>
+        <el-button type="primary" plain @click="$router.go(-1)">{{$t('Dialog.cancel_btn')}}</el-button>
+        <el-button type="primary" @click="setThemeOptions">{{$t('Dialog.confirm_save_btn')}}</el-button>
       </div>
     </div>