Эх сурвалжийг харах

系统设置-数据操作权限

jwyu 1 жил өмнө
parent
commit
54eaf856e3

+ 4 - 0
src/lang/commonLang.js

@@ -17,6 +17,10 @@ export default {
       en: "Return",
       zh: "返回",
     },
+    set_btn:{
+      en:"Set",
+      zh:'设置'
+    },
   },
   Table: {
     add_btn: {

+ 59 - 5
src/lang/modules/systemManage/OperateAuth.js

@@ -4,11 +4,38 @@
 
 /* 英文 */
 export const OperateAuthEn = {
-    tab01:'手工数据指标',
-    tab02:'钢联化工数据库',
-    tab03:'ETA指标库',
-    tab04:'ETA预测指标',
-    tab05:'图库',
+    tab01:'Manual Data Indicators',
+    tab02:'My Steel Chemical Database',
+    tab03:'ETA Indicator Library',
+    tab04:'ETA Predictive Indicators',
+    tab05:'Image Library',
+
+    placeholder01:'请输入图表名称',
+    placeholder02:'Enter Indicator ID/Indicator Name',
+    placeholder03:'Select Category',
+    placeholder04:'Select User',
+
+    btn_text01:'Batch Edit',
+    btn_text02:'Permission Settings',
+
+    table_col_name01:'图表名称',
+    table_col_name02:'图分类',
+    table_col_name03:'Creator',
+    table_col_name04:'Indicator ID',
+    table_col_name05:'Indicator Name',
+
+    edit_title01:'Edit Permissions',
+    edit_title02:'Batch Edit Permissions',
+    original_creator:'Original Creator',
+    new_creator:'New Creator',
+
+    msg01:'Please select at least one',
+
+    permission_title01:'Permission Settings',
+    permission_title02:'批量权限设置',
+    invisible_users:'Invisible Users',
+    permission_confirm_msg:"Are you sure you want to delete the user's invisible permission?",
+    set_success:'Setting Successful'
 };
   
 /* 中文 */
@@ -18,6 +45,33 @@ export const OperateAuthZh = {
     tab03:'ETA指标库',
     tab04:'ETA预测指标',
     tab05:'图库',
+
+    placeholder01:'请输入图表名称',
+    placeholder02:'请输入指标Id/指标名称',
+    placeholder03:'请选择分类',
+    placeholder04:'请选择用户',
+
+    btn_text01:'批量编辑',
+    btn_text02:'权限设置',
+
+    table_col_name01:'图表名称',
+    table_col_name02:'图分类',
+    table_col_name03:'创建人',
+    table_col_name04:'指标ID',
+    table_col_name05:'指标名称',
+
+    edit_title01:'编辑权限',
+    edit_title02:'批量编辑权限',
+    original_creator:'原创建人',
+    new_creator:'新创建人',
+
+    msg01:'请至少勾选一个',
+
+    permission_title01:'权限设置',
+    permission_title02:'批量权限设置',
+    invisible_users:'不可见用户',
+    permission_confirm_msg:'是否确认删除该用户的不可见权限?',
+    set_success:'配置成功'
 };
   
 /**

+ 26 - 17
src/views/system_manage/components/authSetDialog.vue

@@ -13,7 +13,7 @@
 	>
     <div class="cont">
       <div class="header">
-        <span>不可见用户</span>
+        <span>{{$t('SystemManage.OperateAuth.invisible_users')}}</span>
         <el-cascader
           v-model="filterUsers"
           :options="userList"
@@ -29,12 +29,12 @@
           :show-all-levels="false"
           clearable
           filterable
-          placeholder="请选择用户" 
+          :placeholder="$t('SystemManage.OperateAuth.placeholder04')" 
           style="margin: 0 20px"
         />
-        <el-button type="primary" @click="setAuthHandle">设置</el-button>
+        <el-button type="primary" @click="setAuthHandle">{{$t('Dialog.set_btn')}}</el-button>
       </div>
-      <template v-if="edbForm.title==='权限设置'">
+      <template v-if="edbForm.title===$t('SystemManage.OperateAuth.permission_title01')">
         <el-table
           :data="filterTable"
           border
@@ -45,13 +45,13 @@
               <span>{{ row[item.key] }}</span>
             </template>
           </el-table-column>
-          <el-table-column align="center" label="操作">
+          <el-table-column align="center" :label="$t('Table.column_operations')">
             <template slot-scope="{row}" >
               <el-popconfirm
-                title="是否确认删除该用户的不可见权限?"
+                :title="$t('SystemManage.OperateAuth.permission_confirm_msg')"
                 @onConfirm="removeUser(row)"
               >
-                <span slot="reference" class="deletesty">删除</span>
+                <span slot="reference" class="deletesty">{{$t('Table.delete_btn')}}</span>
               </el-popconfirm>
             </template>
           </el-table-column>
@@ -92,7 +92,16 @@ export default {
       let uers_arr = _.cloneDeep(this.users);
       this.disableCreaterHandle(uers_arr);
       this.userList = uers_arr;
-      this.edbForm.title==='权限设置' && this.getTableList()
+      this.edbForm.title===this.$t('SystemManage.OperateAuth.permission_title01') && this.getTableList()
+    }
+  },
+  computed:{
+    tableColums(){
+      return [
+        { label:this.$t('SystemManage.DepartManage.user_table_name'),key: 'RealName' },
+        { label:this.$t('SystemManage.DepartManage.user_table_role'),key: 'RoleName' },
+        { label:this.$t('SystemManage.DepartManage.user_table_depart'),key: 'DepartmentGroup' },
+      ]
     }
   },
   data() {
@@ -102,11 +111,11 @@ export default {
 
       tableData: [],
       filterTable: [],
-      tableColums:[
-        { label:'姓名',key: 'RealName' },
-        { label:'角色',key: 'RoleName' },
-        { label:'部门/分组',key: 'DepartmentGroup' },
-      ],
+      // tableColums:[
+      //   { label:'姓名',key: 'RealName' },
+      //   { label:'角色',key: 'RoleName' },
+      //   { label:'部门/分组',key: 'DepartmentGroup' },
+      // ],
       pageNo:1,
       pageSize: 10,
       total: 0,
@@ -158,14 +167,14 @@ export default {
             AdminId
           }).then(res => {
             if(res.Ret !== 200) return 
-            this.$message.success('删除成功');
+            this.$message.success(this.$t('MsgPrompt.delete_msg'));
             this.getTableList();
           })
     },
 
     /* 设置权限 */
     async setAuthHandle() {
-      if(!this.filterUsers.length) return this.$message.warning('请选择用户')
+      if(!this.filterUsers.length) return this.$message.warning(this.$t('SystemManage.OperateAuth.placeholder04'))
       // let res = this.edbForm.title === '权限设置' 
       //   ? await operateAuthInterface.edbNoAuthSet({
       //       EdbInfoId: Number(this.edbForm.ids[0]),
@@ -178,8 +187,8 @@ export default {
         })
 
       if(res.Ret !== 200) return 
-      this.$message.success('配置成功')
-      if(this.edbForm.title === '权限设置') {
+      this.$message.success(this.$t('SystemManage.OperateAuth.set_success'))
+      if(this.edbForm.title === this.$t('SystemManage.OperateAuth.permission_title01')) {
         this.filterUsers=[]
         this.getTableList()
       }else {

+ 28 - 28
src/views/system_manage/operateAuthManage.vue

@@ -10,7 +10,7 @@
         <div v-if="authTabs.length">
             <el-input 
             v-model="searchForm.key_word" 
-            :placeholder="default_tab === 5 ? '请输入图表名称' : '请输入指标Id/指标名称'" 
+            :placeholder="default_tab === 5 ? this.$t('SystemManage.OperateAuth.placeholder01') : this.$t('SystemManage.OperateAuth.placeholder02')" 
             style="width: 300px;margin-right:20px;"
             @change="changeUser"
             clearable
@@ -35,7 +35,7 @@
             clearable
             filterable
             @change="changeUser"
-            placeholder="请选择分类" 
+            :placeholder="this.$t('SystemManage.OperateAuth.placeholder03')" 
             style="width: 250px;"
           />
           <el-cascader
@@ -52,15 +52,15 @@
             clearable
             @change="changeUser"
             filterable
-            placeholder="请选择用户" 
+            :placeholder="this.$t('SystemManage.OperateAuth.placeholder04')" 
             style="margin: 0 20px"
           />
         </div>
         <div>
           <el-button type="primary" @click="editAuthHandle({},'multiple')" 
-          v-if="[3,4].includes(default_tab)?authBtn('edit'):authTabs.length">批量编辑</el-button>
+          v-if="[3,4].includes(default_tab)?authBtn('edit'):authTabs.length">{{$t('SystemManage.OperateAuth.btn_text01')}}</el-button>
           <el-button type="primary" @click="edbAuthSetHandle({},'multiple')" v-if="[3,4].includes(default_tab
-        )&&authBtn('auth')">权限设置</el-button>
+        )&&authBtn('auth')">{{$t('SystemManage.OperateAuth.btn_text02')}}</el-button>
         </div>
     </div>
      <el-table
@@ -97,7 +97,7 @@
         </el-table-column>
         
         <div slot="empty" style="padding: 100px 0">
-          <tableNoData text="暂无数据" size="mini"/>
+          <tableNoData :text="$t('Table.prompt_slogan')" size="mini"/>
 				</div>
     </el-table>
     <el-col :span="24" style="height:35px;text-align: right;float: none;">
@@ -126,10 +126,10 @@
           :rules="dialogFormRules"
           @close="cancelDialogHandle"
         >
-          <el-form-item label="原创建人">
+          <el-form-item :label="$t('SystemManage.OperateAuth.original_creator')">
             <span>{{ dialogForm.old_user_name }}</span>
           </el-form-item>
-          <el-form-item label="新创建人" prop="new_user">
+          <el-form-item :label="$t('SystemManage.OperateAuth.new_creator')" prop="new_user">
             <el-cascader
               v-model="dialogForm.new_user"
               :options="userList"
@@ -143,7 +143,7 @@
               :show-all-levels="false"
               clearable
               filterable
-              placeholder="请选择用户" 
+              :placeholder="$t('SystemManage.OperateAuth.placeholder04')" 
               style="width: 250px"
             />
           </el-form-item>
@@ -154,10 +154,10 @@
           type="primary"
           style="margin-right: 60px"
           @click="saveHandle"
-          >保存</el-button
+          >{{$t('Dialog.confirm_save_btn')}}</el-button
         >
         <el-button type="primary" plain @click="cancelDialogHandle"
-          >取消</el-button
+          >{{$t('Dialog.cancel_btn')}}</el-button
         >
       </div>
     </m-dialog>
@@ -184,15 +184,15 @@ export default {
   computed: {
     tableColums() {
       return this.default_tab === 5 ? [
-        { label: '图表名称',key: 'Name' },
-        { label: '图分类',key: 'ClassifyName' },
-        { label: '创建人',key: 'CreateUserName' },
-        { label: '操作',key: 'handle' },
+        { label: this.$t('SystemManage.OperateAuth.table_col_name01'),key: 'Name' },
+        { label: this.$t('SystemManage.OperateAuth.table_col_name02'),key: 'ClassifyName' },
+        { label: this.$t('SystemManage.OperateAuth.table_col_name03'),key: 'CreateUserName' },
+        { label: this.$t('Table.column_operations'),key: 'handle' },
       ] : [
-        { label: '指标ID',key: 'Code' },
-        { label: '指标名称',key: 'Name' },
-        { label: '创建人',key: 'CreateUserName' },
-        { label: '操作',key: 'handle' },
+        { label: this.$t('SystemManage.OperateAuth.table_col_name04'),key: 'Code' },
+        { label: this.$t('SystemManage.OperateAuth.table_col_name05'),key: 'Name' },
+        { label: this.$t('SystemManage.OperateAuth.table_col_name03'),key: 'CreateUserName' },
+        { label: this.$t('Table.column_operations'),key: 'handle' },
       ]
     },
     //权限配置化后的tabs
@@ -216,11 +216,11 @@ export default {
     },
     tabs(){
       return [
-        { label: '手工数据指标', key: 1 },
-        { label: '钢联化工数据库', key: 2 },
-        { label: 'ETA指标库', key: 3 },
-        { label: 'ETA预测指标', key: 4 },
-        { label: '图库', key: 5 }
+        { label: this.$t('SystemManage.OperateAuth.tab01'), key: 1 },
+        { label: this.$t('SystemManage.OperateAuth.tab02'), key: 2 },
+        { label: this.$t('SystemManage.OperateAuth.tab03'), key: 3 },
+        { label: this.$t('SystemManage.OperateAuth.tab04'), key: 4 },
+        { label: this.$t('SystemManage.OperateAuth.tab05'), key: 5 }
       ]
     }
   },
@@ -350,10 +350,10 @@ export default {
 
     /* 编辑 */
     editAuthHandle({DataId,CreateUserName,},type='single') {
-      if(type === 'multiple' && !this.selectedArr.length) return this.$message.warning('请至少勾选一个')
+      if(type === 'multiple' && !this.selectedArr.length) return this.$message.warning(this.$t('SystemManage.OperateAuth.msg01'))
 
       this.dialogForm = {
-        title: type === 'multiple' ? '批量编辑权限' : '编辑权限',
+        title: type === 'multiple' ? this.$t('SystemManage.OperateAuth.edit_title02') : this.$t('SystemManage.OperateAuth.edit_title01'),
         old_user_name: type === 'multiple' ? this.selectedArr[0].CreateUserName : CreateUserName,
         ids: type === 'multiple' ? this.selectedArr.map(_ => _.DataId) : [DataId],
         new_user: ''
@@ -378,11 +378,11 @@ export default {
 
     /* 指标权限配置 */
     edbAuthSetHandle({DataId,CreateUserId},type='') {
-      if(type === 'multiple' && !this.selectedArr.length) return this.$message.warning('请至少勾选一个')
+      if(type === 'multiple' && !this.selectedArr.length) return this.$message.warning(this.$t('SystemManage.OperateAuth.msg01'))
       if(type === 'multiple' && this.selectedArr.some(_ => this.selectedArr[0].CreateUserId!==_.CreateUserId)) return this.$message.warning('所选指标创建人不是同一用户,请重新选择!')
 
       this.edbForm = {
-        title: type === 'multiple' ? '批量权限设置' : '权限设置',
+        title: type === 'multiple' ? this.$t('SystemManage.OperateAuth.permission_title02') : this.$t('SystemManage.OperateAuth.permission_title01'),
         createId: type === 'multiple' ? this.selectedArr[0].CreateUserId : CreateUserId,
         ids: type === 'multiple' ? this.selectedArr.map(_ => _.DataId) : [DataId],
       }