Browse Source

系统设置-数据源终端管理

jwyu 1 year ago
parent
commit
31e10437d7

+ 33 - 2
src/lang/modules/systemManage/DataSourceAccount.js

@@ -4,13 +4,44 @@
 
 /* 英文 */
 export const DataSourceAccountEn = {
-
+    add_btn:'Add terminal account',
+    edit_btn:'Edit terminal account',
+    table_col01:'Terminal Code',
+    table_col02:'Terminal Name',
+    table_col03:'Folder Path',
+    table_col04:'Terminal Address',
+    table_col05:'Terminal Token',
+    table_col06:'Data Source Type',
+    table_col07:'Status',
+    table_col08:'Indicator Data Volume',
+    table_col09:'Update Time',
+    placeholder01:'请输入终端名称',
+    placeholder02:'请输入文件夹路径',
+    placeholder03:'请输入终端地址',
+    placeholder04:'请输入终端token',
+    placeholder05:'Please select data source type',
+    placeholder06:'请输入指标数据量',
 };
   
 /* 中文 */
 export const DataSourceAccountZh = {
     add_btn:'新增终端账号',
-    
+    edit_btn:'编辑终端账号',
+    table_col01:'终端编码',
+    table_col02:'终端名称',
+    table_col03:'文件夹路径',
+    table_col04:'终端地址',
+    table_col05:'终端token',
+    table_col06:'数据源类型',
+    table_col07:'状态',
+    table_col08:'指标数据量',
+    table_col09:'更新时间',
+    placeholder01:'请输入终端名称',
+    placeholder02:'请输入文件夹路径',
+    placeholder03:'请输入终端地址',
+    placeholder04:'请输入终端token',
+    placeholder05:'请选择数据源类型',
+    placeholder06:'请输入指标数据量',
 };
   
 /**

+ 64 - 21
src/views/dataSource_manage/accountList.vue

@@ -5,7 +5,7 @@
             type="primary" 
             @click="showEditAccount=true;activeTermId=0;initData={}"
             v-permission="permissionBtn.dataSourcePermission.dataSource_account_add"
-        >新增终端账号</el-button>
+        >{{$t('SystemManage.DataSourceAccount.add_btn')}}</el-button>
         <el-table
             style="margin-top:30px"
             :data="tableData"
@@ -23,33 +23,33 @@
                     <span 
                         v-if="col.key==='Status'"
                         :style="{color:scope.row.Status===1?'':'#FF0000'}"
-                    >{{scope.row.Status===1?'启用':'禁用'}}</span>
+                    >{{scope.row.Status===1?$t('Common.enable'):$t('Common.disable')}}</span>
                     <span v-else>{{scope.row[col.key]}}</span>
                 </template>
             </el-table-column>
-            <el-table-column label="操作" align="center" width="100">
+            <el-table-column :label="$t('Table.column_operations')" align="center" width="100">
                 <template slot-scope="scope">
                     <span 
                         style="color:#409EFF;cursor: pointer;" 
                         @click="handleEditAccount(scope.row)"
                         v-permission="permissionBtn.dataSourcePermission.dataSource_account_edit"
-                    >编辑</span>
+                    >{{$t('Table.edit_btn')}}</span>
                     <span 
                         style="color:#409EFF;cursor: pointer;" 
                         @click="handleSetAccountStatus(scope.row,2)" 
                         v-if="scope.row.Status===1"
                         v-permission="permissionBtn.dataSourcePermission.dataSource_account_enable"
-                    >禁用</span>
+                    >{{$t('Common.disable')}}</span>
                     <span 
                         style="color:#409EFF;cursor: pointer;" 
                         @click="handleSetAccountStatus(scope.row,1)" 
                         v-if="scope.row.Status===2"
                         v-permission="permissionBtn.dataSourcePermission.dataSource_account_enable"
-                    >启用</span>
+                    >{{$t('Common.enable')}}</span>
                 </template>
             </el-table-column>
             <div slot="empty">
-                <tableNoData text="暂无数据"/>
+                <tableNoData :text="$t('Table.prompt_slogan')"/>
             </div>
         </el-table>
 
@@ -68,48 +68,91 @@ import EditAccount from './components/EditAccount.vue'
 import {apiDataSource} from '@/api/modules/dataSource.js'
 export default {
     components:{EditAccount},
-    data() {
-        return {
-            tableData:[],
-            tableColOpts:[
+    computed:{
+        tableColOpts(){
+            return [
                 {
-                    name:'终端编码',
+                    name:this.$t('SystemManage.DataSourceAccount.table_col01'),
                     key:'TerminalCode',
                 },
                 {
-                    name:'终端名称',
+                    name:this.$t('SystemManage.DataSourceAccount.table_col02'),
                     key:'Name',
                 },
                 {
-                    name:'文件夹路径',
+                    name:this.$t('SystemManage.DataSourceAccount.table_col03'),
                     key:'DirPath',
                 },
                 {
-                    name:'终端地址',
+                    name:this.$t('SystemManage.DataSourceAccount.table_col04'),
                     key:'ServerUrl',
                 },
                 {
-                    name:'终端token',
+                    name:this.$t('SystemManage.DataSourceAccount.table_col05'),
                     key:'Value',
                 },
                 {
-                    name:'数据源类型',
+                    name:this.$t('SystemManage.DataSourceAccount.table_col06'),
                     key:'Source',
                 },
                 {
-                    name:'状态',
+                    name:this.$t('SystemManage.DataSourceAccount.table_col07'),
                     key:'Status',
                 },
                 {
-                    name:'指标数据量',
+                    name:this.$t('SystemManage.DataSourceAccount.table_col08'),
                     key:'Num',
                 },
                 {
-                    name:'更新时间',
+                    name:this.$t('SystemManage.DataSourceAccount.table_col09'),
                     key:'ModifyTime',
                     sortable:true
                 },
-            ],
+            ]
+        }
+    },
+    data() {
+        return {
+            tableData:[],
+            // tableColOpts:[
+            //     {
+            //         name:'终端编码',
+            //         key:'TerminalCode',
+            //     },
+            //     {
+            //         name:'终端名称',
+            //         key:'Name',
+            //     },
+            //     {
+            //         name:'文件夹路径',
+            //         key:'DirPath',
+            //     },
+            //     {
+            //         name:'终端地址',
+            //         key:'ServerUrl',
+            //     },
+            //     {
+            //         name:'终端token',
+            //         key:'Value',
+            //     },
+            //     {
+            //         name:'数据源类型',
+            //         key:'Source',
+            //     },
+            //     {
+            //         name:'状态',
+            //         key:'Status',
+            //     },
+            //     {
+            //         name:'指标数据量',
+            //         key:'Num',
+            //     },
+            //     {
+            //         name:'更新时间',
+            //         key:'ModifyTime',
+            //         sortable:true
+            //     },
+            // ],
 
             showEditAccount:false,
             activeTermId:0,

+ 12 - 12
src/views/dataSource_manage/components/EditAccount.vue

@@ -1,6 +1,6 @@
 <template>
     <el-dialog
-      :title="TerminalId?'编辑终端账号':'新增终端账号'"
+      :title="TerminalId?$t('SystemManage.DataSourceAccount.edit_btn'):$t('SystemManage.DataSourceAccount.add_btn')"
       :visible.sync="show"
       :modal-append-to-body="false"
       :close-on-click-modal="false"
@@ -14,25 +14,25 @@
             :model="formState" 
             :rules="rules" 
             ref="formIns" 
-            label-width="120px" 
+            label-width="130px" 
             class="demo-ruleForm"
         >
-            <el-form-item label="终端名称" prop="name">
+            <el-form-item :label="$t('SystemManage.DataSourceAccount.table_col02')" prop="name">
                 <el-input placeholder="请输入终端名称" v-model="formState.name" style="width:300px"></el-input>
             </el-form-item>
-            <el-form-item label="文件夹路径" prop="dirUrl">
+            <el-form-item :label="$t('SystemManage.DataSourceAccount.table_col03')" prop="dirUrl">
                 <el-input placeholder="请输入文件夹路径" v-model="formState.dirUrl"  style="width:300px" :disabled="TerminalId"></el-input>
             </el-form-item>
-            <el-form-item label="终端地址" prop="url">
+            <el-form-item :label="$t('SystemManage.DataSourceAccount.table_col04')" prop="url">
                 <el-input placeholder="请输入终端地址" v-model="formState.url"  style="width:300px"></el-input>
             </el-form-item>
-            <el-form-item label="终端token" prop="token">
+            <el-form-item :label="$t('SystemManage.DataSourceAccount.table_col05')" prop="token">
                 <el-input placeholder="请输入终端token" v-model="formState.token"  style="width:300px"></el-input>
             </el-form-item>
-            <el-form-item label="数据源类型" prop="type">
+            <el-form-item :label="$t('SystemManage.DataSourceAccount.table_col06')" prop="type">
                 <el-select 
                     v-model="formState.type" 
-                    placeholder="请选择数据源类型"
+                    :placeholder="$t('SystemManage.DataSourceAccount.placeholder05')"
                     style="width:300px"
                     :disabled="TerminalId"
                 >
@@ -44,13 +44,13 @@
                     />
                 </el-select>
             </el-form-item>
-            <el-form-item label="指标数据量" prop="num">
+            <el-form-item :label="$t('SystemManage.DataSourceAccount.table_col08')" prop="num">
                 <el-input placeholder="请输入指标数据量" type="number" min="0" v-model.number="formState.num"  style="width:300px"></el-input>
             </el-form-item>
         </el-form>
         <div style="text-align:center;margin:30px 0">
-            <el-button type="primary" plain @click="handleClose">取消</el-button>
-            <el-button type="primary" @click="handleSave">确定</el-button>
+            <el-button type="primary" plain @click="handleClose">{{$t('Dialog.cancel_btn')}}</el-button>
+            <el-button type="primary" @click="handleSave">{{$t('Dialog.confirm_btn')}}</el-button>
         </div>
     </el-dialog>
 </template>
@@ -133,7 +133,7 @@ export default {
             console.log(params);
             const res=await apiDataSource.accountSave(params)
             if(res.Ret===200){
-                this.$message.success('保存成功')
+                this.$message.success(this.$t('MsgPrompt.saved_msg'))
                 this.$emit('change')
                 this.handleClose()
             }