From 5a84728f49a5c708d21212b1a395bd62684efd48 Mon Sep 17 00:00:00 2001
From: zhoushihao <zsh19950802@163.com>
Date: 星期三, 26 六月 2024 14:06:38 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
UI-Project/src/views/User/userlist.vue | 79 +++++++++++++++++++++------------------
1 files changed, 42 insertions(+), 37 deletions(-)
diff --git a/UI-Project/src/views/User/userlist.vue b/UI-Project/src/views/User/userlist.vue
index ecd91ed..da399b6 100644
--- a/UI-Project/src/views/User/userlist.vue
+++ b/UI-Project/src/views/User/userlist.vue
@@ -10,6 +10,9 @@
import { ref, onMounted } from "vue";
// import { ref } from 'vue'
import { ElMessage, ElMessageBox } from 'element-plus'
+ import { useI18n } from 'vue-i18n'
+ const { t } = useI18n()
+ let language = ref(localStorage.getItem('lang') || 'zh')
// import LanguageMixin from './lang/LanguageMixin'
const selectedProjectNoa = ref(''); // 褰撳墠閫変腑鐨勮鑹�
// const options = ref<any[]>([]); // 涓嬫媺閫夐」鍒楄〃
@@ -31,16 +34,16 @@
});
// 閲嶇疆瀵嗙爜
const open = async(row) => {
- try {
+ try {
const confirmResult = await ElMessageBox.confirm(
- '鏄惁閲嶇疆鐢ㄦ埛瀵嗙爜?',
- '鎻愮ず',
+ t('productStock.repassword'),
+ t('productStock.prompt'),
{
- confirmButtonText: '鏄�',
- cancelButtonText: '鍙栨秷',
+ confirmButtonText: t('productStock.yes'),
+ cancelButtonText: t('productStock.cancel'),
type: 'warning',
- }
- );
+ }
+ );
if (confirmResult === 'confirm') {
// 鐢ㄦ埛鐐瑰嚮浜嗏�滄槸鈥濓紝鐜板湪璋冪敤鍒犻櫎鎺ュ彛
var url="/loadGlass/sys/user/resetPassword?userId="+row.id;
@@ -148,16 +151,16 @@
};
// 鍒犻櫎
const opena = async(row) => {
- try {
+ try {
const confirmResult = await ElMessageBox.confirm(
- '鏄惁鍒犻櫎璇ョ敤鎴�?',
- '鎻愮ず',
+ t('productStock.deusername'),
+ t('productStock.prompt'),
{
- confirmButtonText: '鏄�',
- cancelButtonText: '鍙栨秷',
+ confirmButtonText: t('productStock.yes'),
+ cancelButtonText: t('productStock.cancel'),
type: 'warning',
- }
- );
+ }
+ );
if (confirmResult === 'confirm') {
// 鐢ㄦ埛鐐瑰嚮浜嗏�滄槸鈥濓紝鐜板湪璋冪敤鍒犻櫎鎺ュ彛
const response = await request.post("/loadGlass/sys/user/deleteUser", {
@@ -219,32 +222,32 @@
<template>
<div>
- <el-button type="primary" style="margin-top: 10px;margin-left: 10px;" size="mini" id="searchButton" @click="add = true">娣诲姞鐢ㄦ埛</el-button>
+ <el-button type="primary" style="margin-top: 10px;margin-left: 10px;" size="mini" id="searchButton" @click="add = true">{{ $t('productStock.addusers') }}</el-button>
<el-card style="flex: 1;margin-left: 10px;margin-top: 20px;" v-loading="loading">
<div style="width: 98%; height: calc(100% - 35px); overflow-y: auto;">
<el-table height="240" ref="table"
@selection-change="handleSelectionChange"
:data="tableData" :header-cell-style="{background:'#F2F3F5 ',color:'#1D2129'}">
- <el-table-column prop="userName" align="center" label="鐢ㄦ埛鍚�" min-width="180" />
- <el-table-column align="center" label="瑙掕壊" min-width="80">
+ <el-table-column prop="userName" align="center" :label="$t('productStock.username')" min-width="180" />
+ <el-table-column align="center" :label="$t('productStock.role')" min-width="80">
<template #default="scope">
<el-tag v-for="role in scope.row.roleList">
{{role.name}}
</el-tag>
</template>
</el-table-column>
- <el-table-column fixed="right" label="鎿嶄綔" align="center" width="200">
+ <el-table-column fixed="right" :label="$t('productStock.operate')" align="center" width="270">
<template #default="scope">
- <el-button size="mini" type="text" plain @click="open(scope.row)">閲嶇疆瀵嗙爜</el-button>
- <el-button size="mini" type="text" plain @click="handleEdit(scope.row)">缂栬緫</el-button>
- <el-button size="mini" type="text" plain @click="opena(scope.row)">鍒犻櫎</el-button>
+ <el-button size="mini" type="text" plain @click="open(scope.row)">{{ $t('productStock.resetpassword') }}</el-button>
+ <el-button size="mini" type="text" plain @click="handleEdit(scope.row)">{{ $t('productStock.exit') }}</el-button>
+ <el-button size="mini" type="text" plain @click="opena(scope.row)">{{ $t('productStock.delete') }}</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-card>
</div>
- <el-dialog v-model="add" top="23vh" width="37%" title="娣诲姞鐢ㄦ埛" >
+ <el-dialog v-model="add" top="23vh" width="37%" :title="$t('productStock.addusers')">
<div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;">
<el-form size="mini" label-width="150px">
<el-form label-width="100px" label-position="right">
@@ -252,8 +255,8 @@
<el-col :span="6">
<div id="dt" style="font-size: 15px;">
<div>
- <el-form-item label="鐢ㄦ埛鍚嶏細" :required="true" style="width: 25vw">
- <el-input v-model="userName" autocomplete="off" />
+ <el-form-item :label="$t('productStock.usernamea')" :required="true" style="width: 25vw">
+ <el-input v-model="userName" autocomplete="off" :placeholder="$t('productStock.inusername')" />
</el-form-item></div></div>
</el-col>
</el-row>
@@ -261,12 +264,12 @@
<el-col :span="6">
<div id="dt" style="font-size: 15px;">
<div>
- <el-form-item label="瑙掕壊锛�" :required="true" style="width: 25vw;">
+ <el-form-item :label="$t('productStock.rolea')" :required="true" style="width: 25vw;">
<el-select
v-model="selectedProjectNoa"
filterable
clearable
- placeholder="璇烽�夋嫨瑙掕壊"
+ :placeholder="$t('productStock.inrole')"
style="width: 330px"
>
<el-option
@@ -283,9 +286,10 @@
<el-col :span="6">
<div id="dt" style="font-size: 15px;">
<div>
- <el-form-item label="瀵嗙爜锛�" :required="true" style="width: 25vw;">
+ <el-form-item :label="$t('productStock.password')" :required="true" style="width: 25vw;">
<el-input style="width: 340px;"
v-model="password"
+ :placeholder="$t('productStock.inpassword')"
autocomplete="off"
:prefix-icon="Lock"
show-password/>
@@ -298,13 +302,13 @@
<template #footer>
<div id="dialog-footer">
<el-button type="primary" @click="getTableRow">
- 纭
+ {{ $t('productStock.sure') }}
</el-button>
- <el-button @click="add = false">鍙栨秷</el-button>
+ <el-button @click="add = false">{{ $t('productStock.cancel') }}</el-button>
</div>
</template>
</el-dialog>
- <el-dialog v-model="adda" top="23vh" width="37%" title="淇敼鐢ㄦ埛" >
+ <el-dialog v-model="adda" top="23vh" width="37%" :title="$t('productStock.reusername')" >
<div style="margin-left: -50px;margin-top: 10px;margin-bottom: 10px;">
<el-form :model="editingUser" ref="formRef" size="mini" label-width="150px">
<el-form label-width="100px" label-position="right">
@@ -312,8 +316,8 @@
<el-col :span="6">
<div id="dt" style="font-size: 15px;">
<div>
- <el-form-item label="鐢ㄦ埛鍚嶏細" :required="true" style="width: 25vw">
- <el-input v-model="editingUser.userName" autocomplete="off" />
+ <el-form-item :label="$t('productStock.usernamea')" :required="true" style="width: 25vw">
+ <el-input :placeholder="$t('productStock.inusername')" v-model="editingUser.userName" autocomplete="off" />
</el-form-item></div></div>
</el-col>
</el-row>
@@ -328,12 +332,12 @@
</el-tag>
</template>
</el-table-column> -->
- <el-form-item label="瑙掕壊锛�" :required="true" style="width: 25vw;">
+ <el-form-item :label="$t('productStock.rolea')" :required="true" style="width: 25vw;">
<el-select
v-model="selectedProjectNoa"
filterable
clearable
- placeholder="璇烽�夋嫨瑙掕壊"
+ :placeholder="$t('productStock.inrole')"
style="width: 330px"
>
<el-option
@@ -350,9 +354,10 @@
<el-col :span="6">
<div id="dt" style="font-size: 15px;">
<div>
- <el-form-item label="瀵嗙爜锛�" :required="true" style="width: 25vw;">
+ <el-form-item :label="$t('productStock.password')" :required="true" style="width: 25vw;">
<el-input style="width: 340px;"
v-model="editingUser.password"
+ :placeholder="$t('productStock.inpassword')"
autocomplete="off"
:prefix-icon="Lock"
show-password/>
@@ -365,9 +370,9 @@
<template #footer>
<div id="dialog-footer">
<el-button type="primary" @click="getTableRowa">
- 纭
+ {{ $t('productStock.sure') }}
</el-button>
- <el-button @click="adda = false">鍙栨秷</el-button>
+ <el-button @click="adda = false">{{ $t('productStock.cancel') }}</el-button>
</div>
</template>
</el-dialog>
--
Gitblit v1.8.0