浏览代码

系统设置-手工数据权限

jwyu 1 年之前
父节点
当前提交
9268c35328

+ 35 - 0
src/lang/modules/systemManage/DataAuth.js

@@ -0,0 +1,35 @@
+/**
+ * 系统设置-手工数据权限
+ */
+
+/* 英文 */
+export const DataAuthEn = {
+    placehloder_msg01:'User Name',
+    placehloder_msg02:'Please select a parent category',
+    msg01:'Please select a user',
+    msg02:'The category that contains subcategories cannot be deleted',
+    msg03:'Deletion is irreversible. Are you sure you want to proceed?',
+    title:'Manual Indicator Categories',
+    add_category:'Add Category',
+    edit_category:'Edit Category',
+    parent_classify:'Parent Category',
+    classify_name:'Category Name'
+};
+  
+/* 中文 */
+export const DataAuthZh = {
+    placehloder_msg01:'用户名称',
+    placehloder_msg02:'请选择上级分类',
+    msg01:'请选择用户',
+    msg02:'该分类下包含子分类不可删除',
+    msg03:'删除后不可恢复,是否确认删除?',
+    title:'手工指标分类',
+    add_category:'添加分类',
+    edit_category:'编辑分类',
+    parent_classify:'上级分类',
+    classify_name:'分类名称'
+};
+  
+/**
+* $t('SystemManage.DataAuth.XXX')
+*/

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

@@ -1,13 +1,15 @@
 import { DepartManageEn } from "./DepartManage";
 import { RoleManageEn } from "./RoleManage";
 import { OperateAuthEn } from "./OperateAuth";
+import {DataAuthEn} from './DataAuth'
 
 export default {
   // 系统设置
   SystemManage: {
     DepartManage: DepartManageEn,
     RoleManage: RoleManageEn,
-    OperateAuth:OperateAuthEn
+    OperateAuth:OperateAuthEn,
+    DataAuth:DataAuthEn
   },
 };
 

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

@@ -1,12 +1,14 @@
 import { DepartManageZh } from "./DepartManage";
 import { RoleManageZh } from "./RoleManage";
 import { OperateAuthZh } from "./OperateAuth";
+import {DataAuthZh} from './DataAuth'
 
 export default {
   // 系统设置
   SystemManage: {
     DepartManage: DepartManageZh,
     RoleManage: RoleManageZh,
-    OperateAuth:OperateAuthZh
+    OperateAuth:OperateAuthZh,
+    DataAuth:DataAuthZh
   },
 };

+ 11 - 11
src/views/system_manage/components/authDialog.vue

@@ -15,15 +15,15 @@
 				ref="diaForm"
 				label-position="left"
 				hide-required-asterisk
-				label-width="80px"
+				label-width="120px"
 				:model="formData"
 				:rules="formRules">
-						<el-form-item label="上级分类" prop="classify">
+						<el-form-item :label="$t('SystemManage.DataAuth.parent_classify')" prop="classify">
 							<el-select 
 							v-model="formData.classify" 
-							placeholder="请选择上级分类" 
+							:placeholder="$t('SystemManage.DataAuth.placehloder_msg02')" 
 							style="width:80%"
-							:disabled="title==='编辑分类'&&!form.parentId">
+							:disabled="title===$t('SystemManage.DataAuth.edit_category')&&!form.parentId">
 								<el-option
 									v-for="item in classifyArr"
 									:key="item.ClassifyId"
@@ -32,17 +32,17 @@
 								</el-option>
 							</el-select>
 						</el-form-item>
-						<el-form-item label="分类名称" prop="nodeName">
+						<el-form-item :label="$t('SystemManage.DataAuth.classify_name')" prop="nodeName">
 							<el-input
 							v-model="formData.nodeName"
 							style="width: 80%"
-							placeholder="分类名称"></el-input>
+							:placeholder="$t('SystemManage.DataAuth.classify_name')"></el-input>
 						</el-form-item>
 				</el-form>
 			</div>
 			<div class="dia-bot">
-				<el-button type="primary" style="margin-right:20px" @click="saveHandle">保存</el-button>
-				<el-button type="primary" plain @click="cancelHandle">取消</el-button>
+				<el-button type="primary" style="margin-right:20px" @click="saveHandle">{{$t('Dialog.confirm_save_btn')}}</el-button>
+				<el-button type="primary" plain @click="cancelHandle">{{$t('Dialog.cancel_btn')}}</el-button>
 			</div>
 		</el-dialog>
 	</div>
@@ -98,7 +98,7 @@ export default {
 			const res = await dataAuthInterface.classifyOne();
 			if(res.Ret !== 200) return
 			this.classifyArr = res.Data || [];
-			if(this.title === '添加分类' || !this.form.parentId) {
+			if(this.title === this.$t('SystemManage.DataAuth.add_category') || !this.form.parentId) {
 				this.classifyArr.unshift({
 					ClassifyId: 0,
 					ClassifyName: '无'
@@ -109,7 +109,7 @@ export default {
 		async saveHandle() {
 			await this.$refs.diaForm.validate();
 
-			const res = this.title === '添加分类' 
+			const res = this.title === this.$t('SystemManage.DataAuth.add_category') 
 				? await	dataAuthInterface.classifyAdd({
 						ParentId: this.formData.classify,
 						ClassifyName: this.formData.nodeName
@@ -121,7 +121,7 @@ export default {
 					})
 
 			if(res.Ret !== 200) return
-			this.$message.success('保存成功');
+			this.$message.success(this.$t('MsgPrompt.saved_msg'));
 			this.callbackHandle();
 		},
 		/* 成功回调 */

+ 9 - 9
src/views/system_manage/components/targetClasifyDialog.vue

@@ -3,7 +3,7 @@
 		<!-- :modal-append-to-body='false' -->
 		<el-dialog
 		:visible.sync="isOpenDialog"
-		:title="title"
+		:title="$t('SystemManage.DataAuth.title')"
 		:close-on-click-modal="false"
 		:append-to-body="true"
 		@close="cancelHandle"
@@ -12,7 +12,7 @@
 		width="650px"
 		v-dialogDrag>
 			<div class="add-cont">
-				<el-button type="text" @click="() => {cancelHandle();$parent.editClassify()}">添加分类</el-button>
+				<el-button type="text" @click="() => {cancelHandle();$parent.editClassify()}">{{$t('SystemManage.DataAuth.add_category')}}</el-button>
 			</div>
 			<el-tree
 				:data="classifyArr"
@@ -27,14 +27,14 @@
 				<div class="custom-tree-node" slot-scope="{ data }">
 					<span>{{ data.ClassifyName }}</span>
 					<div>
-						<span class="editsty" style="margin-right: 10px;" @click.stop="editNode(data)">编辑</span>
-						<span class="deletesty" @click.stop="delNode(data)">删除</span>
+						<span class="editsty" style="margin-right: 10px;" @click.stop="editNode(data)">{{$t('Table.edit_btn')}}</span>
+						<span class="deletesty" @click.stop="delNode(data)">{{$t('Table.delete_btn')}}</span>
 					</div>
 				</div>
 			</el-tree>
 			<div class="dia-bot">
-				<el-button type="primary" style="margin-right:20px" @click="cancelHandle">确定</el-button>
-				<el-button type="primary" plain @click="cancelHandle">取消</el-button>
+				<el-button type="primary" style="margin-right:20px" @click="cancelHandle">{{$t('Dialog.confirm_btn')}}</el-button>
+				<el-button type="primary" plain @click="cancelHandle">{{$t('Dialog.cancel_btn')}}</el-button>
 			</div>
 		</el-dialog>
 	</div>
@@ -85,9 +85,9 @@ export default {
 
 		/* 删除 */
 		async delNode(data) {
-			let message = !data.Child ? '删除后不可恢复,是否确认删除?' : '该分类下包含子分类不可删除'
+			let message = !data.Child ? this.$t('SystemManage.DataAuth.msg03') : this.$t('SystemManage.DataAuth.msg02')
 
-			await this.$confirm(message,'提示',{
+			await this.$confirm(message,this.$t('Confirm.prompt'),{
 				type: 'warning'
 			})
 
@@ -96,7 +96,7 @@ export default {
 			const {Ret} = await dataAuthInterface.classifyDel({ ClassifyId:data.ClassifyId })
 
 			if(Ret !== 200) return
-			this.$message.success('删除成功');
+			this.$message.success(this.$t('MsgPrompt.delete_msg'));
 			this.cancelHandle();
 			this.$emit('success');
 		},

+ 7 - 7
src/views/system_manage/dataAuthManage.vue

@@ -6,7 +6,7 @@
 		:props="classifyProp"
 		:show-all-levels="false"
 		style="width: 500px"
-		placeholder="用户名称"
+		:placeholder="$t('SystemManage.DataAuth.placehloder_msg01')"
 		filterable
 		clearable
 		@change="chooseUser"
@@ -61,18 +61,18 @@
 						class="el-icon-circle-plus-outline"
 						style="color: #5882ef; font-size: 16px"
 					/>
-					<span>手工指标分类</span>
+					<span>{{$t('SystemManage.DataAuth.title')}}</span>
 				</span>
 			</div>
 			<div class="btn-cont" v-if="userList.length">
-				<el-button type="primary" class="btn" @click="saveAuthHandle">保存</el-button>
-				<el-button type="primary" plain class="btn" @click="getAuth">取消</el-button>
+				<el-button type="primary" class="btn" @click="saveAuthHandle">{{$t('Dialog.confirm_save_btn')}}</el-button>
+				<el-button type="primary" plain class="btn" @click="getAuth">{{$t('Dialog.cancel_btn')}}</el-button>
 			</div>
 		</div>
 
 		<!-- 修改分类弹窗 -->
 		<authDialog
-			:title="formData.classifyId?'编辑分类':'添加分类'"
+			:title="formData.classifyId?$t('SystemManage.DataAuth.edit_category'):$t('SystemManage.DataAuth.add_category')"
 			:isOpenDialog.sync="isOpenDialog"
 			:form="formData"
 			@closeDia="isOpenDialog=false"
@@ -229,7 +229,7 @@ export default {
 		/* 保存权限 */
 		saveAuthHandle() {
 			if(!this.default_user) {
-				this.$message.warning("请选择用户");
+				this.$message.warning(this.$t('SystemManage.DataAuth.msg01'));
 			}else {
 				let arr = [];
 				this.authList.map(item => {
@@ -246,7 +246,7 @@ export default {
 				}
 				dataAuthInterface.saveAuth(params).then(res => {
 					if(res.Ret === 200) {
-						this.$message.success('保存成功');
+						this.$message.success(this.$t('MsgPrompt.saved_msg'));
 					}
 				})
 			}