超级管理员页面的国际化提交 7.24

main
zz 4 months ago
parent ed9cd9adc0
commit deb483f881

@ -1,56 +1,58 @@
<template>
<el-popover placement="bottom" width="280" trigger="hover">
<el-popover placement="bottom" width="300" trigger="hover">
<template #reference>
<el-text type="primary" class="cursor-default">
<el-icon><ele-InfoFilled /></el-icon>
<el-icon><ele-InfoFilled /></el-icon>{{$t('message.user_zz.Details')}}
</el-text>
</template>
<el-descriptions direction="vertical" :column="2" border>
<el-descriptions-item width="140">
<template #label>
<el-text>
<el-icon><ele-UserFilled /></el-icon>
<el-icon><ele-UserFilled /></el-icon>{{$t('message.user_zz.Creator')}}
</el-text>
</template>
<el-tag>{{ props.data.createUserName ?? '无' }}</el-tag>
<el-tag>{{ props.data.createUserName ?? t('message.user_zz.There_no') }}</el-tag>
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<el-text>
<el-icon><ele-Calendar /></el-icon>
<el-icon><ele-Calendar /></el-icon>{{$t('message.user_zz.Creation_time')}}
</el-text>
</template>
<el-tag>{{ props.data.createTime ?? '无' }}</el-tag>
<el-tag>{{ props.data.createTime ?? t('message.user_zz.There_no') }}</el-tag>
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<el-text>
<el-icon><ele-UserFilled /></el-icon>
<el-icon><ele-UserFilled /></el-icon>{{$t('message.user_zz.modifier')}}
</el-text>
</template>
<el-tag>{{ props.data.updateUserName ?? '无' }}</el-tag>
<el-tag>{{ props.data.updateUserName ?? t('message.user_zz.There_no') }}</el-tag>
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<el-text>
<el-icon><ele-Calendar /></el-icon>
<el-icon><ele-Calendar /></el-icon>{{$t('message.user_zz.Modification_time')}}
</el-text>
</template>
<el-tag>{{ props.data.updateTime ?? '无' }}</el-tag>
<el-tag>{{ props.data.updateTime ?? t('message.user_zz.There_no') }}</el-tag>
</el-descriptions-item>
<el-descriptions-item>
<template #label>
<el-text>
<el-icon><ele-Tickets /></el-icon>
<el-icon><ele-Tickets /></el-icon>{{$t('message.user_zz.Remarks')}}
</el-text>
</template>
{{ props.data.remark ?? '无' }}
{{ props.data.remark ?? t('message.user_zz.There_no') }}
</el-descriptions-item>
</el-descriptions>
</el-popover>
</template>
<script lang="ts" setup>
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const props = defineProps<{
data: ModifyRecord;
}>();

@ -519,8 +519,192 @@ export default {
uploaded: "Uploaded",
operation: "Operation",
reportToCloud: "Report to Cloud"
}
},
//new zz
user_zz:{
account:"account",
Mobile_phone_number:"Mobile phone number",
search: "search",
reset: "reset",
New_additions:"New additions",
Serial_number:"Serial number",
Head_shot:"Head shot",
Name:"Name",
Account_Type:"Account Type",
Collection_roles:"Collection of roles",
Affiliated_Organization:"Affiliated Organization",
Job_Title:"Job Title",
State:"State",
Sorting:"Sorting",
Modifying_records:"Modifying records",
Operation:"Operation",
Details:"Details",
Editing:"Editing",
Creator:"Creator",
modifier:"modifier",
Creation_time:"Creation time",
Modification_time:"Modification time",
Edit_account:"Edit account",
Remarks:"Remarks",
Basic_information:"Basic information",
Account_name:"Account name",
Nickname:"Nickname",
Real_name:"Real name",
Email_address:"Email address",
Cancel: 'Cancel',
Confirmation: 'Confirmation',
There_no:"There is no",
System_administrator:'System administrator',
Regular_account_number:'Regular account number',
Member:'Member',
Reset_Password:'Reset Password',
Unlock_lock:'Unlock the lock',
Deleting_Account:'Deleting an Account',
Adding_account:'Adding an account',
Make_sure_delete_account:'Make sure to delete an account',
Tips:'Tips',
Delete_successfully:'Delete successfully',
The_account_status_successfully:'The account status was set successfully',
Make_sure_reset_password:'Make sure to reset the password:',
Password_reset_successful:'Password reset was successful',
Make_sure_unlock_login:'Make sure to unlock the login:',
Unlocking_logon_successful:'Unlocking logon was successful',
Others:"Others",
Change_successful:'Change successful',
Added_success:'Added success',
Add_failed:'Add failed',
Change_failed:'Change failed',
The_input_field_cannot_empty:"The input field cannot be empty",
},
role:{
Role_name:'Role name',
Role_encoding:'Role encoding',
search: "search",
reset: "reset",
New_additions:"New additions",
Serial_number:"Serial number",
Data_range:'Data range',
All_data:'All the data',
This_department_following_data:'This department and the following data',
Data_Department:'Data of the Department',
Personal_data_only:'Personal data only',
Custom_data:'Custom data',
Sorting:'Sorting',
State:'State',
Enable:'Enable',
Disable:'Disable',
Modifying_records:'Modifying records',
Operation:"Operation",
Editing:"Editing",
Delete:'Delete',
Adding_role:'Adding a role',
Editing_role:'Editing role',
Cancel: 'Cancel',
Confirmation: 'Confirmation',
Determine_delete_role:'Determine the delete role:',
Delete_successfully:'Delete successfully',
Tips:'Tips',
Menu_permissions:'Menu permissions',
Please_enter_remarks:'Please enter the remarks',
Authorized_data_scope:'Authorized data scope',
List_Institutions:'List of Institutions:',
},
menu:{
Menu_name:'Menu name',
Types:'Types',
Directory:'Directory',
Menu:'Menu',
Button:'Button',
Routing_path:'Routing path',
Component_paths:'Component paths',
Permission_identification:'Permission identification',
Sorting:'Sorting',
State:"State",
Modifying_records:"Modifying records",
Operation:"Operation",
Adding_menu:"Adding a menu",
Edit_menu:"Edit menu",
Determine_delete_menu:"Determine the delete menu:",
search: "search",
reset: "reset",
New_additions:"New additions",
Editing:"Editing",
Delete:'Delete',
Upper_level_menu:"Upper level menu",
Menu_types:"Menu types",
Route_name:"Route name",
Menu_ICONS:"Menu ICONS",
Redirection:"Redirection",
Link_Address:"Link Address",
Sorting_menus:"Sorting menus",
Whether_hide:"Whether to hide",
Cache_not:"Cache or not",
Fixed_not:"Fixed or not",
Inline_not:"Inline or not",
Enabled_not:"Enabled or not",
Remarks:"Remarks",
Hide:"Hide",
Don_hide:"Don't hide",
caching:"caching",
Not_caching:"Not caching",
fixed:"fixed",
Not_fixed:"Not fixed",
inlay:"inlay",
Not_inlined:"Not inlined",
Please_enter_remarks:"Please enter the remarks",
External_link_embedded_link_address:"External link/embedded link address",
The_menu_type_cannot_empty:"The menu type cannot be empty",
Please_select_superior_menu:"Please select the superior menu",
Menu_names_cannot_empty:"Menu names cannot be empty",
},
vislog:{
Clear_out:"Clear out",
Serial_number:"Serial number",
Display_name:"Display name",
Method_name:"Method name",
Account_name:"Account name",
Real_ame:"Real name",
IP_address:"IP address",
Where_to_log_in:"Where to log in",
longitude:"longitude",
latitude:"latitude",
Browser:"Browser",
Operating_system:"Operating system",
status:"status",
Time_consuming:"Time consuming(ms)",
Log_time:"Log time",
Empty_successfully:"Empty successfully",
today:"today",
yesterday:"yesterday",
Last_week:"Last week",
},
oplog:{
Export:"Export",
Module_name:"Module name",
Request_address:"Request address",
Level:"Level",
Debugging:"Debugging",
Message:"Message",
Warnings:"Warnings",
Error:"Error",
Others:"Others",
Event_Id:"Event Id",
Thread_Id:"Thread Id",
Request_trace_Id:"Request trace Id",
Operation:"Operation",
Log_details:"Log details",
Request_method:"Request method",
Exception_object:"Exception object",
},
difflog:{
Difference_operation:"Difference operation",
Sql_statements:"Sql statements",
parameters:"parameters",
Log_messages:"Log messages",
Record_before_operation:"Record before operation",
Post_operation_record:"Post operation record",
Business_object:"Business object",
Operation_time:"Operation time",
},
};

@ -1,3 +1,5 @@
import User from "/@/layout/navBars/topBar/user.vue";
// 定义内容
export default {
label: {
@ -518,5 +520,201 @@ export default {
uploaded: "已上传",
operation: "操作",
reportToCloud: "上报云端"
}
},
//new zz
user_zz:{
account:"账号",
Mobile_phone_number:"手机号码",
search: "查询",
reset: "重置",
New_additions:"新增",
Serial_number:"序号",
Head_shot:"头像",
Name:"姓名",
Account_Type:"账号类型",
Collection_roles:"角色集合",
Affiliated_Organization:"所属机构",
Job_Title:"职位名称",
State:"状态",
Sorting:"排序",
Modifying_records:"修改记录",
Operation:"操作",
Details:"详情",
Editing:"编辑",
Creator:"创建者",
modifier:"修改者",
Creation_time:"创建时间",
Modification_time:"修改时间",
Remarks:"备注",
Edit_account:"编辑账号",
Basic_information:"基础信息",
Account_name:"账号名称",
Nickname:"昵称",
Real_name:"真实姓名",
Email_address:"邮箱",
Cancel: '取消',
Confirmation: '确认',
There_no:"无",
//
System_administrator:'系统管理员',
Regular_account_number:'普通账号',
Member:'会员',
Reset_Password:'重置密码',
Unlock_lock:'解除锁定',
Deleting_Account:'删除账号',
Adding_account:'添加账号',
Make_sure_delete_account:'确定删除账号:',
Tips:'提示',
Delete_successfully:'删除成功',
The_account_status_successfully:'账号状态设置成功',
Make_sure_reset_password:'确定重置密码:',
Password_reset_successful:'密码重置成功为',
Make_sure_unlock_login:'确定解除登录锁定:',
Unlocking_logon_successful:'解除登录锁定成功',
Others:"其他",
Change_successful:'修改成功',
Change_failed:'修改失败',
Added_success:'新增成功',
Add_failed:'新增失败',
The_input_field_cannot_empty:"输入框不能为空",
},
role:{
Role_name:'角色名称',
Role_encoding:'角色编码',
search: "查询",
reset: "重置",
New_additions:"新增",
Serial_number:"序号",
Data_range:'数据范围',
All_data:'全部数据',
This_department_following_data:'本部门及以下数据',
Data_Department:'本部门数据',
Personal_data_only:'仅本人数据',
Custom_data:'自定义数据',
Sorting:'排序',
State:'状态',
Enable:'启用',
Disable:'禁用',
Modifying_records:'修改记录',
Operation:"操作",
Editing:"编辑",
Delete:'删除',
Adding_role:'添加角色',
Editing_role:'编辑角色',
Cancel: '取消',
Confirmation: '确认',
Tips:'提示',
Determine_delete_role:'确定删角色:',
Delete_successfully:'删除成功',
Menu_permissions:'菜单权限',
Please_enter_remarks:'请输入备注内容',
Authorized_data_scope:'授权数据范围',
List_Institutions:'机构列表:',
},
menu:{
Menu_name:'菜单名称',
Types:'类型',
Directory:'目录',
Menu:'菜单',
Button:'按钮',
Routing_path:'路由路径',
Component_paths:'组件路径',
Permission_identification:'权限标识',
Sorting:'排序',
State:"状态",
Modifying_records:"修改记录",
Operation:"操作",
Adding_menu:"添加菜单",
Edit_menu:"编辑菜单",
Determine_delete_menu:"确定删除菜单:",
search: "查询",
reset: "重置",
New_additions:"新增",
Editing:"编辑",
Delete:'删除',
Upper_level_menu:"上级菜单",
Menu_types:"菜单类型",
Route_name:"路由名称",
Menu_ICONS:"菜单图标",
Redirection:"重定向",
Link_Address:"链接地址",
Sorting_menus:"菜单排序",
Whether_hide:"是否隐藏",
Cache_not:"是否缓存",
Fixed_not:"是否固定",
Inline_not:"是否内嵌",
Enabled_not:"是否启用",
Remarks:"备注",
Hide:"隐藏",
Don_hide:"不隐藏",
caching:"缓存",
Not_caching:"不缓存",
fixed:"固定",
Not_fixed:"不固定",
inlay:"内嵌",
Not_inlined:"不内嵌",
Please_enter_remarks:"请输入备注内容",
External_link_embedded_link_address:"外链/内嵌时链接地址",
The_menu_type_cannot_empty:"菜单类型不能为空",
Please_select_superior_menu:"请选择上级菜单",
Menu_names_cannot_empty:"菜单名称不能为空",
},
vislog:{
Clear_out:"清空",
Serial_number:"序号",
Display_name:"显示名称",
Method_name:"方法名称",
Account_name:"账号名称",
Real_ame:"真实姓名",
IP_address:"IP地址",
Where_to_log_in:"登录地点",
longitude:"经度",
latitude:"纬度",
Browser:"浏览器",
Operating_system:"操作系统",
status:"状态",
Time_consuming:"耗时(ms)",
Log_time:"日志时间",
Empty_successfully:"清空成功",
today:"今天",
yesterday:"昨天",
Last_week:"上周",
},
oplog:{
Export:"导出",
Module_name:"模块名称",
Request_address:"请求地址",
Level:"级别",
Debugging:"调试",
Message:"消息",
Warnings:"警告",
Error:"错误",
Others:"其他",
Event_Id:"事件Id",
Thread_Id:"线程Id",
Request_trace_Id:"请求跟踪Id",
Operation:"操作",
Log_details:"日志详情",
Request_method:"请求方式",
Exception_object:"异常对象",
},
difflog:{
Difference_operation:"差异操作",
Sql_statements:"Sql语句",
parameters:"参数",
Log_messages:"日志消息",
Record_before_operation:"操作前记录",
Post_operation_record:"操作后记录",
Business_object:"业务对象",
Operation_time:"操作时间",
},
};

@ -103,6 +103,7 @@ import { SysAuthApi, SysNoticeApi } from '/@/api-services/api';
import Push from 'push.js';
import { signalR } from '/@/views/system/onlineUser/signalR';
//
const UserNews = defineAsyncComponent(() => import('/@/layout/navBars/topBar/userNews.vue'));
const Search = defineAsyncComponent(() => import('/@/layout/navBars/topBar/search.vue'));

@ -14,7 +14,6 @@
<label class="label">{{ $t('message.system_base_config.charge_soc') }}:</label>
<el-input-number v-model="ChooseSpace.chargeSoc" />
</div>
<div style="margin-top: 10px">
<el-popconfirm :title="$t('message.system_base_config.isset_strategy')" @confirm="SetChooseSpace">
<template #reference>

@ -2,36 +2,36 @@
<div class="sys-difflog-container">
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
<el-form :model="state.queryParams" ref="queryForm" :inline="true">
<el-form-item label="开始时间">
<el-date-picker v-model="state.queryParams.startTime" type="datetime" placeholder="开始时间" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
<el-form-item :label="$t('message.replace_log.startTime')">
<el-date-picker v-model="state.queryParams.startTime" type="datetime" :placeholder="$t('message.replace_log.startTime')" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
</el-form-item>
<el-form-item label="结束时间">
<el-date-picker v-model="state.queryParams.endTime" type="datetime" placeholder="结束时间" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
<el-form-item :label="$t('message.replace_log.endTime')">
<el-date-picker v-model="state.queryParams.endTime" type="datetime" :placeholder="$t('message.replace_log.endTime')" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysDifflog:page'"> </el-button>
<el-button icon="ele-Refresh" @click="resetQuery"> </el-button>
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysDifflog:page'"> {{$t('message.menu.search')}} </el-button>
<el-button icon="ele-Refresh" @click="resetQuery"> {{$t('message.menu.reset')}} </el-button>
</el-button-group>
</el-form-item>
<el-form-item>
<el-button icon="ele-DeleteFilled" type="danger" @click="clearLog" v-auth="'sysDifflog:clear'"> </el-button>
<el-button icon="ele-DeleteFilled" type="danger" @click="clearLog" v-auth="'sysDifflog:clear'"> {{$t('message.vislog.Clear_out')}} </el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
<el-table :data="state.logData" style="width: 100%" v-loading="state.loading" border>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column prop="diffType" label="差异操作" header-align="center" show-overflow-tooltip />
<el-table-column prop="sql" label="Sql语句" header-align="center" show-overflow-tooltip />
<el-table-column prop="parameters" label="参数" header-align="center" show-overflow-tooltip />
<el-table-column prop="elapsed" label="耗时(ms)" header-align="center" show-overflow-tooltip />
<el-table-column prop="message" label="日志消息" header-align="center" show-overflow-tooltip />
<el-table-column prop="beforeData" label="操作前记录" header-align="center" show-overflow-tooltip />
<el-table-column prop="afterData" label="操作后记录" header-align="center" show-overflow-tooltip />
<el-table-column prop="businessData" label="业务对象" header-align="center" show-overflow-tooltip />
<el-table-column prop="createTime" label="操作时间" align="center" show-overflow-tooltip />
<el-table-column type="index" :label="$t('message.vislog.Serial_number')" width="55" align="center" />
<el-table-column prop="diffType" :label="$t('message.difflog.Difference_operation')" header-align="center" show-overflow-tooltip />
<el-table-column prop="sql" :label="$t('message.difflog.Sql_statements')" header-align="center" show-overflow-tooltip />
<el-table-column prop="parameters" :label="$t('message.difflog.parameters')" header-align="center" show-overflow-tooltip />
<el-table-column prop="elapsed" :label="$t('message.vislog.Time_consuming')" header-align="center" show-overflow-tooltip />
<el-table-column prop="message" :label="$t('message.difflog.Log_messages')" header-align="center" show-overflow-tooltip />
<el-table-column prop="beforeData" :label="$t('message.difflog.Record_before_operation')" header-align="center" show-overflow-tooltip />
<el-table-column prop="afterData" :label="$t('message.difflog.Post_operation_record')" header-align="center" show-overflow-tooltip />
<el-table-column prop="businessData" :label="$t('message.difflog.Business_object')" header-align="center" show-overflow-tooltip />
<el-table-column prop="createTime" :label="$t('message.difflog.Operation_time')" align="center" show-overflow-tooltip />
</el-table>
<el-pagination
v-model:currentPage="state.tableParams.pageNum"
@ -55,7 +55,8 @@ import { ElMessage } from 'element-plus';
import { getAPI } from '/@/utils/axios-utils';
import { SysLogDiffApi } from '/@/api-services/api';
import { SysLogDiff } from '/@/api-services/models';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const state = reactive({
loading: false,
queryParams: {
@ -100,7 +101,7 @@ const clearLog = async () => {
await getAPI(SysLogDiffApi).apiSysLogDiffClearPost();
state.loading = false;
ElMessage.success('清空成功');
ElMessage.success(t('message.vislog.Empty_successfully'));
handleQuery();
};
@ -118,11 +119,11 @@ const handleCurrentChange = (val: number) => {
const shortcuts = [
{
text: '今天',
text: t('message.vislog.today'),
value: new Date(),
},
{
text: '昨天',
text: t('message.vislog.yesterday'),
value: () => {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
@ -130,7 +131,7 @@ const shortcuts = [
},
},
{
text: '上周',
text: t('message.vislog.Last_week'),
value: () => {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);

@ -2,68 +2,68 @@
<div class="sys-exlog-container" v-loading="state.loading">
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
<el-form :model="state.queryParams" ref="queryForm" :inline="true">
<el-form-item label="开始时间">
<el-date-picker v-model="state.queryParams.startTime" type="datetime" placeholder="开始时间" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
<el-form-item :label="$t('message.replace_log.startTime')">
<el-date-picker v-model="state.queryParams.startTime" type="datetime" :placeholder="$t('message.replace_log.startTime')" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
</el-form-item>
<el-form-item label="结束时间">
<el-date-picker v-model="state.queryParams.endTime" type="datetime" placeholder="结束时间" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
<el-form-item :label="$t('message.replace_log.endTime')">
<el-date-picker v-model="state.queryParams.endTime" type="datetime" :placeholder="$t('message.replace_log.endTime')" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysExlog:page'"> </el-button>
<el-button icon="ele-Refresh" @click="resetQuery"> </el-button>
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysExlog:page'"> {{$t('message.menu.search')}} </el-button>
<el-button icon="ele-Refresh" @click="resetQuery"> {{$t('message.menu.reset')}} </el-button>
</el-button-group>
</el-form-item>
<el-form-item>
<el-button icon="ele-DeleteFilled" type="danger" @click="clearLog" v-auth="'sysExlog:clear'"> </el-button>
<el-button icon="ele-FolderOpened" @click="exportLog" v-auth="'sysOplog:export'"> </el-button>
<el-button icon="ele-DeleteFilled" type="danger" @click="clearLog" v-auth="'sysExlog:clear'"> {{$t('message.vislog.Clear_out')}} </el-button>
<el-button icon="ele-FolderOpened" @click="exportLog" v-auth="'sysOplog:export'"> {{$t('message.oplog.Export')}} </el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
<el-table :data="state.logData" @sort-change="sortChange" style="width: 100%" border :row-class-name="tableRowClassName">
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column prop="controllerName" label="模块名称" width="100" header-align="center" show-overflow-tooltip />
<el-table-column prop="displayTitle" label="显示名称" width="150" header-align="center" show-overflow-tooltip />
<el-table-column prop="actionName" label="方法名称" width="100" header-align="center" show-overflow-tooltip />
<el-table-column prop="httpMethod" label="请求方式" width="90" align="center" show-overflow-tooltip />
<el-table-column prop="requestUrl" label="请求地址" width="300" header-align="center" show-overflow-tooltip />
<el-table-column type="index" :label="$t('message.vislog.Serial_number')" width="55" align="center" />
<el-table-column prop="controllerName" :label="$t('message.oplog.Module_name')" width="100" header-align="center" show-overflow-tooltip />
<el-table-column prop="displayTitle" :label="$t('message.vislog.Display_name')" width="150" header-align="center" show-overflow-tooltip />
<el-table-column prop="actionName" :label="$t('message.vislog.Method_name')" width="100" header-align="center" show-overflow-tooltip />
<el-table-column prop="httpMethod" :label="$t('message.oplog.Request_method')" width="90" align="center" show-overflow-tooltip />
<el-table-column prop="requestUrl" :label="$t('message.oplog.Request_address')" width="300" header-align="center" show-overflow-tooltip />
<!-- <el-table-column prop="requestParam" label="请求参数" show-overflow-tooltip />
<el-table-column prop="returnResult" label="返回结果" show-overflow-tooltip /> -->
<el-table-column prop="logLevel" label="级别" width="70" align="center" show-overflow-tooltip>
<el-table-column prop="logLevel" :label="$t('message.oplog.Level')" width="70" align="center" show-overflow-tooltip>
<template #default="scope">
<el-tag v-if="scope.row.logLevel === 1"></el-tag>
<el-tag v-else-if="scope.row.logLevel === 2">消息</el-tag>
<el-tag v-else-if="scope.row.logLevel === 3">警告</el-tag>
<el-tag v-else-if="scope.row.logLevel === 4">错误</el-tag>
<el-tag v-else></el-tag>
<el-tag v-if="scope.row.logLevel === 1">{{$t('message.oplog.Debugging')}}</el-tag>
<el-tag v-else-if="scope.row.logLevel === 2">{{$t('message.oplog.Message')}}</el-tag>
<el-tag v-else-if="scope.row.logLevel === 3">{{$t('message.oplog.Warnings')}}</el-tag>
<el-tag v-else-if="scope.row.logLevel === 4">{{$t('message.oplog.Error')}}</el-tag>
<el-tag v-else>{{$t('message.oplog.Others')}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="eventId" label="事件Id" width="70" align="center" show-overflow-tooltip />
<el-table-column prop="threadId" label="线程Id" sortable="custom" width="90" align="center" show-overflow-tooltip />
<el-table-column prop="traceId" label="请求跟踪Id" width="150" header-align="center" sortable="custom" show-overflow-tooltip />
<el-table-column prop="account" label="账号名称" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="realName" label="真实姓名" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="remoteIp" label="IP地址" width="120" align="center" show-overflow-tooltip />
<el-table-column prop="location" label="登录地点" width="150" align="center" show-overflow-tooltip />
<el-table-column prop="longitude" label="经度" min-width="100" align="center" show-overflow-tooltip />
<el-table-column prop="latitude" label="纬度" min-width="100" align="center" show-overflow-tooltip />
<el-table-column prop="browser" label="浏览器" width="160" align="center" show-overflow-tooltip />
<el-table-column prop="os" label="操作系统" width="120" align="center" show-overflow-tooltip />
<el-table-column prop="status" label="状态" width="70" align="center" show-overflow-tooltip>
<el-table-column prop="eventId" :label="$t('message.oplog.Event_Id')" width="70" align="center" show-overflow-tooltip />
<el-table-column prop="threadId" :label="$t('message.oplog.Thread_Id')" sortable="custom" width="90" align="center" show-overflow-tooltip />
<el-table-column prop="traceId" :label="$t('message.oplog.Request_trace_Id')" width="150" header-align="center" sortable="custom" show-overflow-tooltip />
<el-table-column prop="account" :label="$t('message.vislog.Account_name')" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="realName" :label="$t('message.vislog.Real_ame')" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="remoteIp" :label="$t('message.vislog.IP_address')" width="120" align="center" show-overflow-tooltip />
<el-table-column prop="location" :label="$t('message.vislog.Where_to_log_in')" width="150" align="center" show-overflow-tooltip />
<el-table-column prop="longitude" :label="$t('message.vislog.longitude')" min-width="100" align="center" show-overflow-tooltip />
<el-table-column prop="latitude" :label="$t('message.vislog.latitude')" min-width="100" align="center" show-overflow-tooltip />
<el-table-column prop="browser" :label="$t('message.vislog.Browser')" width="160" align="center" show-overflow-tooltip />
<el-table-column prop="os" :label="$t('message.vislog.Operating_system')" width="120" align="center" show-overflow-tooltip />
<el-table-column prop="status" :label="$t('message.vislog.status')" width="70" align="center" show-overflow-tooltip>
<template #default="scope">
<el-tag type="success" v-if="scope.row.status === '200'"></el-tag>
<el-tag type="danger" v-else></el-tag>
<el-tag type="success" v-if="scope.row.status === '200'">{{$t('message.station_battery_total_result.success')}}</el-tag>
<el-tag type="danger" v-else>{{$t('message.station_battery_total_result.failure')}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="elapsed" label="耗时(ms)" width="90" align="center" show-overflow-tooltip />
<el-table-column prop="exception" label="异常对象" width="150" header-align="center" show-overflow-tooltip />
<el-table-column prop="elapsed" :label="$t('message.vislog.Time_consuming')" width="90" align="center" show-overflow-tooltip />
<el-table-column prop="exception" :label="$t('message.oplog.Exception_object')" width="150" header-align="center" show-overflow-tooltip />
<!-- <el-table-column prop="message" label="日志消息" width="160" fixed="right" show-overflow-tooltip /> -->
<el-table-column prop="logDateTime" label="日志时间" width="160" align="center" fixed="right" show-overflow-tooltip />
<el-table-column label="操作" width="80" align="center" fixed="right" show-overflow-tooltip>
<el-table-column prop="logDateTime" :label="$t('message.vislog.Log_time')" width="160" align="center" fixed="right" show-overflow-tooltip />
<el-table-column :label="$t('message.oplog.Operation')" width="80" align="center" fixed="right" show-overflow-tooltip>
<template #default="scope">
<el-button icon="ele-InfoFilled" size="small" text type="primary" @click="viewDetail(scope.row)" v-auth="'sysOplog:page'"> </el-button>
<el-button icon="ele-InfoFilled" size="small" text type="primary" @click="viewDetail(scope.row)" v-auth="'sysOplog:page'">{{$t('message.user_zz.Details')}} </el-button>
</template>
</el-table-column>
</el-table>
@ -83,7 +83,7 @@
<template #header>
<div style="color: #fff">
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Document /> </el-icon>
<span> 日志详情 </span>
<span> {{$t('message.oplog.Log_details')}} </span>
</div>
</template>
<pre>{{ state.content }}</pre>
@ -99,7 +99,8 @@ import { downloadByData, getFileName } from '/@/utils/download';
import { getAPI } from '/@/utils/axios-utils';
import { SysLogExApi } from '/@/api-services/api';
import { SysLogEx } from '/@/api-services/models';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const state = reactive({
loading: false,
queryParams: {
@ -149,7 +150,7 @@ const clearLog = async () => {
await getAPI(SysLogExApi).apiSysLogExClearPost();
state.loading = false;
ElMessage.success('清空成功');
ElMessage.success(t('message.vislog.Empty_successfully'));
handleQuery();
};
@ -189,11 +190,11 @@ const tableRowClassName = (row: any) => {
const shortcuts = [
{
text: '今天',
text: t('message.vislog.today'),
value: new Date(),
},
{
text: '昨天',
text: t('message.vislog.yesterday'),
value: () => {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
@ -201,7 +202,7 @@ const shortcuts = [
},
},
{
text: '上周',
text: t('message.vislog.Last_week'),
value: () => {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);

@ -2,68 +2,68 @@
<div class="sys-oplog-container" v-loading="state.loading">
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
<el-form :model="state.queryParams" ref="queryForm" :inline="true">
<el-form-item label="开始时间">
<el-date-picker v-model="state.queryParams.startTime" type="datetime" placeholder="开始时间" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
<el-form-item :label="$t('message.replace_log.startTime')">
<el-date-picker v-model="state.queryParams.startTime" type="datetime" :placeholder="$t('message.replace_log.startTime')" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
</el-form-item>
<el-form-item label="结束时间">
<el-date-picker v-model="state.queryParams.endTime" type="datetime" placeholder="结束时间" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
<el-form-item :label="$t('message.replace_log.endTime')">
<el-date-picker v-model="state.queryParams.endTime" type="datetime" :placeholder="$t('message.replace_log.endTime')" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysOplog:page'"> </el-button>
<el-button icon="ele-Refresh" @click="resetQuery"> </el-button>
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysOplog:page'"> {{$t('message.menu.search')}} </el-button>
<el-button icon="ele-Refresh" @click="resetQuery"> {{$t('message.menu.reset')}} </el-button>
</el-button-group>
</el-form-item>
<el-form-item>
<el-button icon="ele-DeleteFilled" type="danger" @click="clearLog" v-auth="'sysOplog:clear'"> </el-button>
<el-button icon="ele-FolderOpened" @click="exportLog" v-auth="'sysOplog:export'"> </el-button>
<el-button icon="ele-DeleteFilled" type="danger" @click="clearLog" v-auth="'sysOplog:clear'"> {{$t('message.vislog.Clear_out')}} </el-button>
<el-button icon="ele-FolderOpened" @click="exportLog" v-auth="'sysOplog:export'"> {{$t('message.oplog.Export')}} </el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
<el-table :data="state.logData" @sort-change="sortChange" style="width: 100%" border :row-class-name="tableRowClassName">
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column prop="controllerName" label="模块名称" min-width="120" header-align="center" show-overflow-tooltip />
<el-table-column prop="displayTitle" label="显示名称" width="170" header-align="center" show-overflow-tooltip />
<el-table-column prop="actionName" label="方法名称" width="150" header-align="center" show-overflow-tooltip />
<el-table-column prop="httpMethod" label="请求方式" width="90" align="center" show-overflow-tooltip />
<el-table-column prop="requestUrl" label="请求地址" width="300" header-align="center" show-overflow-tooltip />
<el-table-column type="index" :label="$t('message.vislog.Serial_number')" width="55" align="center" />
<el-table-column prop="controllerName" :label="$t('message.oplog.Module_name')" min-width="120" header-align="center" show-overflow-tooltip />
<el-table-column prop="displayTitle" :label="$t('message.vislog.Display_name')" width="170" header-align="center" show-overflow-tooltip />
<el-table-column prop="actionName" :label="$t('message.vislog.Method_name')" width="150" header-align="center" show-overflow-tooltip />
<el-table-column prop="httpMethod" :label="$t('message.oplog.Request_method')" width="90" align="center" show-overflow-tooltip />
<el-table-column prop="requestUrl" :label="$t('message.oplog.Request_address')" width="300" header-align="center" show-overflow-tooltip />
<!-- <el-table-column prop="requestParam" label="请求参数" show-overflow-tooltip />
<el-table-column prop="returnResult" label="返回结果" show-overflow-tooltip /> -->
<el-table-column prop="logLevel" label="级别" width="70" align="center" show-overflow-tooltip>
<el-table-column prop="logLevel" :label="$t('message.oplog.Level')" width="70" align="center" show-overflow-tooltip>
<template #default="scope">
<el-tag v-if="scope.row.logLevel === 1"></el-tag>
<el-tag v-else-if="scope.row.logLevel === 2">消息</el-tag>
<el-tag v-else-if="scope.row.logLevel === 3">警告</el-tag>
<el-tag v-else-if="scope.row.logLevel === 4">错误</el-tag>
<el-tag v-else></el-tag>
<el-tag v-if="scope.row.logLevel === 1">{{$t('message.oplog.Debugging')}}</el-tag>
<el-tag v-else-if="scope.row.logLevel === 2">{{$t('message.oplog.Message')}}</el-tag>
<el-tag v-else-if="scope.row.logLevel === 3">{{$t('message.oplog.Warnings')}}</el-tag>
<el-tag v-else-if="scope.row.logLevel === 4">{{$t('message.oplog.Error')}}</el-tag>
<el-tag v-else>{{$t('message.oplog.Others')}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="eventId" label="事件Id" width="70" align="center" show-overflow-tooltip />
<el-table-column prop="threadId" label="线程Id" sortable="custom" width="90" align="center" show-overflow-tooltip />
<el-table-column prop="traceId" label="请求跟踪Id" width="150" header-align="center" sortable="custom" show-overflow-tooltip />
<el-table-column prop="account" label="账号名称" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="realName" label="真实姓名" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="remoteIp" label="IP地址" min-width="120" align="center" show-overflow-tooltip />
<el-table-column prop="location" label="登录地点" min-width="150" align="center" show-overflow-tooltip />
<el-table-column prop="longitude" label="经度" min-width="100" align="center" show-overflow-tooltip />
<el-table-column prop="latitude" label="纬度" min-width="100" align="center" show-overflow-tooltip />
<el-table-column prop="browser" label="浏览器" min-width="150" align="center" show-overflow-tooltip />
<el-table-column prop="os" label="操作系统" width="120" align="center" show-overflow-tooltip />
<el-table-column prop="status" label="状态" width="70" align="center" show-overflow-tooltip>
<el-table-column prop="eventId" :label="$t('message.oplog.Event_Id')" width="70" align="center" show-overflow-tooltip />
<el-table-column prop="threadId" :label="$t('message.oplog.Thread_Id')" sortable="custom" width="90" align="center" show-overflow-tooltip />
<el-table-column prop="traceId" :label="$t('message.oplog.Request_trace_Id')" width="150" header-align="center" sortable="custom" show-overflow-tooltip />
<el-table-column prop="account" :label="$t('message.vislog.Account_name')" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="realName" :label="$t('message.vislog.Real_ame')" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="remoteIp" :label="$t('message.vislog.IP_address')" min-width="120" align="center" show-overflow-tooltip />
<el-table-column prop="location" :label="$t('message.vislog.Where_to_log_in')" min-width="150" align="center" show-overflow-tooltip />
<el-table-column prop="longitude" :label="$t('message.vislog.longitude')" min-width="100" align="center" show-overflow-tooltip />
<el-table-column prop="latitude" :label="$t('message.vislog.latitude')" min-width="100" align="center" show-overflow-tooltip />
<el-table-column prop="browser" :label="$t('message.vislog.Browser')" min-width="150" align="center" show-overflow-tooltip />
<el-table-column prop="os" :label="$t('message.vislog.Operating_system')" width="120" align="center" show-overflow-tooltip />
<el-table-column prop="status" :label="$t('message.vislog.status')" width="70" align="center" show-overflow-tooltip>
<template #default="scope">
<el-tag type="success" v-if="scope.row.status === '200'"></el-tag>
<el-tag type="danger" v-else></el-tag>
<el-tag type="success" v-if="scope.row.status === '200'">{{$t('message.station_battery_total_result.success')}}</el-tag>
<el-tag type="danger" v-else>{{$t('message.station_battery_total_result.failure')}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="elapsed" label="耗时(ms)" width="90" align="center" show-overflow-tooltip />
<el-table-column prop="elapsed" :label="$t('message.vislog.Time_consuming')" width="90" align="center" show-overflow-tooltip />
<!-- <el-table-column prop="exception" label="异常对象" width="150" show-overflow-tooltip /> -->
<!-- <el-table-column prop="message" label="日志消息" width="160" fixed="right" show-overflow-tooltip /> -->
<el-table-column prop="logDateTime" label="日志时间" width="160" align="center" fixed="right" show-overflow-tooltip />
<el-table-column label="操作" width="80" align="center" fixed="right" show-overflow-tooltip>
<el-table-column prop="logDateTime" :label="$t('message.vislog.Log_time')" width="160" align="center" fixed="right" show-overflow-tooltip />
<el-table-column :label="$t('message.oplog.Operation')" width="80" align="center" fixed="right" show-overflow-tooltip>
<template #default="scope">
<el-button icon="ele-InfoFilled" size="small" text type="primary" @click="viewDetail(scope.row)" v-auth="'sysOplog:page'"> </el-button>
<el-button icon="ele-InfoFilled" size="small" text type="primary" @click="viewDetail(scope.row)" v-auth="'sysOplog:page'"> {{$t('message.user_zz.Details')}}</el-button>
</template>
</el-table-column>
</el-table>
@ -83,7 +83,7 @@
<template #header>
<div style="color: #fff">
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Document /> </el-icon>
<span> 日志详情 </span>
<span> {{$t('message.oplog.Log_details')}} </span>
</div>
</template>
<pre>{{ state.content }}</pre>
@ -99,7 +99,8 @@ import { downloadByData, getFileName } from '/@/utils/download';
import { getAPI } from '/@/utils/axios-utils';
import { SysLogOpApi } from '/@/api-services/api';
import { SysLogOp } from '/@/api-services/models';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const state = reactive({
loading: false,
queryParams: {
@ -151,7 +152,7 @@ const clearLog = async () => {
await getAPI(SysLogOpApi).apiSysLogOpClearPost();
state.loading = false;
ElMessage.success('清空成功');
ElMessage.success(t('message.vislog.Empty_successfully'));
handleQuery();
};
@ -160,7 +161,7 @@ const exportLog = async () => {
state.loading = true;
var res = await getAPI(SysLogOpApi).apiSysLogOpExportPost(state.queryParams, { responseType: 'blob' });
state.loading = false;
console.log(res,'导出');
console.log(res,t('message.oplog.Export'));
var fileName = getFileName(res.headers);
downloadByData(res.data as any, fileName);
@ -191,11 +192,11 @@ const tableRowClassName = (row: any) => {
const shortcuts = [
{
text: '今天',
text: t('message.vislog.today'),
value: new Date(),
},
{
text: '昨天',
text: t('message.vislog.yesterday'),
value: () => {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
@ -203,7 +204,7 @@ const shortcuts = [
},
},
{
text: '上周',
text: t('message.vislog.Last_week'),
value: () => {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);

@ -2,45 +2,45 @@
<div class="sys-vislog-container">
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
<el-form :model="state.queryParams" ref="queryForm" :inline="true">
<el-form-item label="开始时间">
<el-date-picker v-model="state.queryParams.startTime" type="datetime" placeholder="开始时间" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
<el-form-item :label="$t('message.replace_log.startTime')">
<el-date-picker v-model="state.queryParams.startTime" type="datetime" :placeholder="$t('message.replace_log.startTime')" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
</el-form-item>
<el-form-item label="结束时间" prop="code">
<el-date-picker v-model="state.queryParams.endTime" type="datetime" placeholder="结束时间" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
<el-form-item :label="$t('message.replace_log.endTime')" prop="code">
<el-date-picker v-model="state.queryParams.endTime" type="datetime" :placeholder="$t('message.replace_log.endTime')" value-format="YYYY-MM-DD HH:mm:ss" :shortcuts="shortcuts" />
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysVislog:page'"> </el-button>
<el-button icon="ele-Refresh" @click="resetQuery"> </el-button>
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysVislog:page'"> {{$t('message.menu.search')}}</el-button>
<el-button icon="ele-Refresh" @click="resetQuery"> {{$t('message.menu.reset')}}</el-button>
</el-button-group>
</el-form-item>
<el-form-item>
<el-button icon="ele-DeleteFilled" type="danger" @click="clearLog" v-auth="'sysVislog:clear'" disabled> 清空 </el-button>
<el-button icon="ele-DeleteFilled" type="danger" @click="clearLog" v-auth="'sysVislog:clear'" disabled> {{$t('message.vislog.Clear_out')}}</el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
<el-table :data="state.logData" style="width: 100%" v-loading="state.loading" border>
<el-table-column type="index" label="序号" width="55" align="center" />
<el-table-column prop="displayTitle" label="显示名称" width="150" align="center" show-overflow-tooltip />
<el-table-column prop="actionName" label="方法名称" width="150" header-align="center" show-overflow-tooltip />
<el-table-column prop="account" label="账号名称" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="realName" label="真实姓名" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="remoteIp" label="IP地址" min-width="120" align="center" show-overflow-tooltip />
<el-table-column prop="location" label="登录地点" min-width="150" align="center" show-overflow-tooltip />
<el-table-column prop="longitude" label="经度" min-width="100" align="center" show-overflow-tooltip />
<el-table-column prop="latitude" label="纬度" min-width="100" align="center" show-overflow-tooltip />
<el-table-column prop="browser" label="浏览器" min-width="150" align="center" show-overflow-tooltip />
<el-table-column prop="os" label="操作系统" width="120" align="center" show-overflow-tooltip />
<el-table-column prop="status" label="状态" width="70" align="center" show-overflow-tooltip>
<el-table-column type="index" :label="$t('message.vislog.Serial_number')" width="55" align="center" />
<el-table-column prop="displayTitle" :label="$t('message.vislog.Display_name')" width="150" align="center" show-overflow-tooltip />
<el-table-column prop="actionName" :label="$t('message.vislog.Method_name')" width="150" header-align="center" show-overflow-tooltip />
<el-table-column prop="account" :label="$t('message.vislog.Account_name')" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="realName" :label="$t('message.vislog.Real_ame')" width="100" align="center" show-overflow-tooltip />
<el-table-column prop="remoteIp" :label="$t('message.vislog.IP_address')" min-width="120" align="center" show-overflow-tooltip />
<el-table-column prop="location" :label="$t('message.vislog.Where_to_log_in')" min-width="150" align="center" show-overflow-tooltip />
<el-table-column prop="longitude" :label="$t('message.vislog.longitude')" min-width="100" align="center" show-overflow-tooltip />
<el-table-column prop="latitude" :label="$t('message.vislog.latitude')" min-width="100" align="center" show-overflow-tooltip />
<el-table-column prop="browser" :label="$t('message.vislog.Browser')" min-width="150" align="center" show-overflow-tooltip />
<el-table-column prop="os" :label="$t('message.vislog.Operating_system')" width="120" align="center" show-overflow-tooltip />
<el-table-column prop="status" :label="$t('message.vislog.status')" width="70" align="center" show-overflow-tooltip>
<template #default="scope">
<el-tag type="success" v-if="scope.row.status === '200'"></el-tag>
<el-tag type="danger" v-else></el-tag>
<el-tag type="success" v-if="scope.row.status === '200'">{{$t('message.station_battery_total_result.success')}}</el-tag>
<el-tag type="danger" v-else>{{$t('message.station_battery_total_result.failure')}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="elapsed" label="耗时(ms)" width="90" align="center" show-overflow-tooltip />
<el-table-column prop="logDateTime" label="日志时间" width="160" align="center" fixed="right" show-overflow-tooltip />
<el-table-column prop="elapsed" :label="$t('message.vislog.Time_consuming')" width="90" align="center" show-overflow-tooltip />
<el-table-column prop="logDateTime" :label="$t('message.vislog.Log_time')" width="160" align="center" fixed="right" show-overflow-tooltip />
</el-table>
<el-pagination
v-model:currentPage="state.tableParams.pageNum"
@ -64,7 +64,8 @@ import { ElMessage } from 'element-plus';
import { getAPI } from '/@/utils/axios-utils';
import { SysLogVisApi } from '/@/api-services/api';
import { SysLogVis } from '/@/api-services/models';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const state = reactive({
loading: false,
queryParams: {
@ -109,7 +110,7 @@ const clearLog = async () => {
await getAPI(SysLogVisApi).apiSysLogVisClearPost();
state.loading = false;
ElMessage.success('清空成功');
ElMessage.success(t('message.vislog.Empty_successfully'));
handleQuery();
};
@ -127,11 +128,11 @@ const handleCurrentChange = (val: number) => {
const shortcuts = [
{
text: '今天',
text: t('message.vislog.today'),
value: new Date(),
},
{
text: '昨天',
text: t('message.vislog.yesterday'),
value: () => {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24);
@ -139,7 +140,7 @@ const shortcuts = [
},
},
{
text: '上周',
text: t('message.vislog.Last_week'),
value: () => {
const date = new Date();
date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);

@ -1,6 +1,6 @@
<template>
<div class="sys-menu-container">
<el-dialog v-model="state.isShowDialog" draggable :close-on-click-modal="false" width="700px">
<el-dialog v-model="state.isShowDialog" draggable :close-on-click-modal="false" width="780px">
<template #header>
<div style="color: #fff">
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit />
@ -11,10 +11,10 @@
<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="auto">
<el-row :gutter="35">
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="上级菜单">
<el-form-item :label="$t('message.menu.Upper_level_menu')">
<el-cascader :options="props.menuData"
:props="{ checkStrictly: true, emitPath: false, value: 'id', label: 'title' }"
placeholder="请选择上级菜单" clearable class="w100" v-model="state.ruleForm.pid">
:placeholder="$t('message.menu.Please_select_superior_menu')" clearable class="w100" v-model="state.ruleForm.pid">
<template #default="{ node, data }">
<span>{{ data.title }}</span>
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
@ -23,122 +23,122 @@
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="菜单类型" prop="type"
:rules="[{ required: true, message: '菜单类型不能为空', trigger: 'blur' }]">
<el-form-item :label="$t('message.menu.Menu_types')" prop="type"
:rules="[{ required: true, message: $t('message.menu.The_menu_type_cannot_empty'), trigger: 'blur' }]">
<el-radio-group v-model="state.ruleForm.type">
<el-radio :value="1">目录</el-radio>
<el-radio :value="2">菜单</el-radio>
<el-radio :value="3">按钮</el-radio>
<el-radio :value="1">{{$t('message.menu.Directory')}}</el-radio>
<el-radio :value="2">{{$t('message.menu.Menu')}}</el-radio>
<el-radio :value="3">{{$t('message.menu.Button')}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="菜单名称" prop="title"
:rules="[{ required: true, message: '菜单名称不能为空', trigger: 'blur' }]">
<el-input v-model="state.ruleForm.title" placeholder="菜单名称" clearable />
<el-form-item :label="$t('message.menu.Menu_name')" prop="title"
:rules="[{ required: true, message: $t('message.menu.Menu_names_cannot_empty'), trigger: 'blur' }]">
<el-input v-model="state.ruleForm.title" :placeholder="$t('message.menu.Menu_name')" clearable />
</el-form-item>
</el-col>
<template v-if="state.ruleForm.type === 1 || state.ruleForm.type === 2">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="路由名称">
<el-input v-model="state.ruleForm.name" placeholder="路由名称" clearable />
<el-form-item :label="$t('message.menu.Route_name')">
<el-input v-model="state.ruleForm.name" :placeholder="$t('message.menu.Route_name')" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="路由路径">
<el-input v-model="state.ruleForm.path" placeholder="路由路径" clearable />
<el-form-item :label="$t('message.menu.Routing_path')">
<el-input v-model="state.ruleForm.path" :placeholder="$t('message.menu.Routing_path')" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="组件路径">
<el-input v-model="state.ruleForm.component" placeholder="组件路径" clearable />
<el-form-item :label="$t('message.menu.Component_paths')">
<el-input v-model="state.ruleForm.component" :placeholder="$t('message.menu.Component_paths')" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="菜单图标">
<el-form-item :label="$t('message.menu.Menu_ICONS')">
<IconSelector v-model="state.ruleForm.icon" :size="getGlobalComponentSize"
placeholder="菜单图标" type="all" />
:placeholder="$t('message.menu.Menu_ICONS')" type="all" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="重定向">
<el-input v-model="state.ruleForm.redirect" placeholder="重定向地址" clearable />
<el-form-item :label="$t('message.menu.Redirection')">
<el-input v-model="state.ruleForm.redirect" :placeholder="$t('message.menu.Redirection')" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="链接地址">
<el-input v-model="state.ruleForm.outLink" placeholder="外链/内嵌时链接地址" clearable />
<el-form-item :label="$t('message.menu.Link_Address')">
<el-input v-model="state.ruleForm.outLink" :placeholder="$t('message.menu.External_link_embedded_link_address')" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="菜单排序">
<el-input-number v-model="state.ruleForm.orderNo" placeholder="排序" class="w100" />
<el-form-item :label="$t('message.menu.Sorting_menus')">
<el-input-number v-model="state.ruleForm.orderNo" :placeholder="$t('message.menu.Sorting_menus')" class="w100" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="是否隐藏">
<el-form-item :label="$t('message.menu.Whether_hide')">
<el-radio-group v-model="state.ruleForm.isHide">
<el-radio :value="true">隐藏</el-radio>
<el-radio :value="false">不隐藏</el-radio>
<el-radio :value="true">{{$t('message.menu.Hide')}}</el-radio>
<el-radio :value="false">{{$t('message.menu.Don_hide')}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="是否缓存">
<el-form-item :label="$t('message.menu.Cache_not')">
<el-radio-group v-model="state.ruleForm.isKeepAlive">
<el-radio :value="true">缓存</el-radio>
<el-radio :value="false">不缓存</el-radio>
<el-radio :value="true">{{$t('message.menu.caching')}}</el-radio>
<el-radio :value="false">{{$t('message.menu.Not_caching')}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="是否固定">
<el-form-item :label="$t('message.menu.Fixed_not')">
<el-radio-group v-model="state.ruleForm.isAffix">
<el-radio :value="true">固定</el-radio>
<el-radio :value="false">不固定</el-radio>
<el-radio :value="true">{{$t('message.menu.fixed')}}</el-radio>
<el-radio :value="false">{{$t('message.menu.Not_fixed')}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="是否内嵌">
<el-form-item :label="$t('message.menu.Inline_not')">
<el-radio-group v-model="state.ruleForm.isIframe">
<el-radio :value="true">内嵌</el-radio>
<el-radio :value="false">不内嵌</el-radio>
<el-radio :value="true">{{$t('message.menu.inlay')}}</el-radio>
<el-radio :value="false">{{$t('message.menu.Not_inlined')}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</template>
<template v-if="state.ruleForm.type === 3">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="权限标识">
<el-input v-model="state.ruleForm.permission" placeholder="权限标识" clearable />
<el-form-item :label="$t('message.menu.Permission_identification')">
<el-input v-model="state.ruleForm.permission" :placeholder="$t('message.menu.Permission_identification')" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="菜单排序">
<el-input-number v-model="state.ruleForm.orderNo" placeholder="排序" class="w100" />
<el-form-item :label="$t('message.menu.Sorting_menus')">
<el-input-number v-model="state.ruleForm.orderNo" :placeholder="$t('message.menu.Sorting_menus')" class="w100" />
</el-form-item>
</el-col>
</template>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="是否启用">
<el-form-item :label="$t('message.menu.Enabled_not')">
<el-radio-group v-model="state.ruleForm.status">
<el-radio :value="1">启用</el-radio>
<el-radio :value="2">不启用</el-radio>
<el-radio :value="1">{{$t('message.role.Enable')}}</el-radio>
<el-radio :value="2">{{$t('message.role.Disable')}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="备注">
<el-input v-model="state.ruleForm.remark" placeholder="请输入备注内容" clearable type="textarea" />
<el-form-item :label="$t('message.menu.Remarks')">
<el-input v-model="state.ruleForm.remark" :placeholder="$t('message.role.Please_enter_remarks')" clearable type="textarea" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="cancel">{{$t('message.role.Cancel')}}</el-button>
<el-button type="primary" @click="submit">{{$t('message.role.Confirmation')}}</el-button>
</span>
</template>
</el-dialog>
@ -154,7 +154,8 @@ import { getAPI } from '/@/utils/axios-utils';
import other from '/@/utils/other';
import { SysMenuApi } from '/@/api-services/api';
import { SysMenu, UpdateMenuInput } from '/@/api-services/models';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const props = defineProps({
title: String,
menuData: Array<SysMenu>,
@ -196,16 +197,16 @@ const submit = () => {
if (state.ruleForm.id != undefined && state.ruleForm.id > 0) {
const res = await getAPI(SysMenuApi).apiSysMenuUpdatePost(state.ruleForm);
if (res.data.data == 200) {
ElMessage.success('修改成功');
ElMessage.success(t('message.user_zz.Change_successful'));
} else {
ElMessage.error('修改失败');
ElMessage.error(t('message.user_zz.Change_failed'));
}
} else {
const res = await getAPI(SysMenuApi).apiSysMenuAddPost(state.ruleForm);
if (res.data.data == 200) {
ElMessage.success('新增成功');
ElMessage.success(t('message.user_zz.Added_success'));
} else {
ElMessage.error('新增失败');
ElMessage.error(t('message.user_zz.Add_failed'));
}
}
closeDialog();

@ -2,29 +2,29 @@
<div class="sys-menu-container">
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
<el-form :model="state.queryParams" ref="queryForm" :inline="true">
<el-form-item label="菜单名称">
<el-input v-model="state.queryParams.title" placeholder="菜单名称" clearable />
<el-form-item :label="$t('message.menu.Menu_name')">
<el-input v-model="state.queryParams.title" :placeholder="$t('message.menu.Menu_name')" clearable />
</el-form-item>
<el-form-item label="类型">
<el-select v-model="state.queryParams.type" placeholder="类型" clearable>
<el-option label="目录" :value="1" />
<el-option label="菜单" :value="2" />
<el-option label="按钮" :value="3" />
<el-form-item :label="$t('message.menu.Types')">
<el-select v-model="state.queryParams.type" :placeholder="$t('message.menu.Types')" clearable>
<el-option :label="$t('message.menu.Directory')" :value="1" />
<el-option :label="$t('message.menu.Menu')" :value="2" />
<el-option :label="$t('message.menu.Button')" :value="3" />
</el-select>
</el-form-item>
<el-form-item>
<el-button-group>
<!-- <el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysMenu:list'">
</el-button> -->
<el-button type="primary" icon="ele-Search" @click="handleQuery">
<el-button type="primary" icon="ele-Search" @click="handleQuery"> {{$t('message.menu.search')}}
</el-button>
<el-button icon="ele-Refresh" @click="resetQuery"> </el-button>
<el-button icon="ele-Refresh" @click="resetQuery"> {{$t('message.menu.reset')}}</el-button>
</el-button-group>
</el-form-item>
<el-form-item>
<!-- <el-button type="primary" icon="ele-Plus" @click="openAddMenu" v-auth="'sysMenu:add'">
</el-button> -->
<el-button type="primary" icon="ele-Plus" @click="openAddMenu">
<el-button type="primary" icon="ele-Plus" @click="openAddMenu"> {{$t('message.menu.New_additions')}}
</el-button>
</el-form-item>
</el-form>
@ -33,43 +33,43 @@
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
<el-table :data="state.menuData" v-loading="state.loading" row-key="id"
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }" border>
<el-table-column label="菜单名称" header-align="center" show-overflow-tooltip>
<el-table-column :label="$t('message.menu.Menu_name')" header-align="center" show-overflow-tooltip>
<template #default="scope">
<SvgIcon :name="scope.row.icon" />
<span class="ml10">{{ $t(scope.row.title) }}</span>
</template>
</el-table-column>
<el-table-column label="类型" width="70" align="center" show-overflow-tooltip>
<el-table-column :label="$t('message.menu.Types')" width="70" align="center" show-overflow-tooltip>
<template #default="scope">
<el-tag type="warning" v-if="scope.row.type === 1"></el-tag>
<el-tag v-else-if="scope.row.type === 2">菜单</el-tag>
<el-tag type="info" v-else></el-tag>
<el-tag type="warning" v-if="scope.row.type === 1">{{$t('message.menu.Directory')}}</el-tag>
<el-tag v-else-if="scope.row.type === 2">{{$t('message.menu.Menu')}}</el-tag>
<el-tag type="info" v-else>{{$t('message.menu.Button')}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="path" label="路由路径" header-align="center" show-overflow-tooltip />
<el-table-column prop="component" label="组件路径" align="center" show-overflow-tooltip />
<el-table-column prop="permission" label="权限标识" align="center" show-overflow-tooltip />
<el-table-column prop="orderNo" label="排序" width="70" align="center" show-overflow-tooltip />
<el-table-column label="状态" width="80" align="center" show-overflow-tooltip>
<el-table-column prop="path" :label="$t('message.menu.Routing_path')" header-align="center" show-overflow-tooltip />
<el-table-column prop="component" :label="$t('message.menu.Component_paths')" align="center" show-overflow-tooltip />
<el-table-column prop="permission" :label="$t('message.menu.Permission_identification')" align="center" show-overflow-tooltip />
<el-table-column prop="orderNo" :label="$t('message.menu.Sorting')" width="70" align="center" show-overflow-tooltip />
<el-table-column :label="$t('message.menu.State')" width="80" align="center" show-overflow-tooltip>
<template #default="scope">
<el-tag type="success" v-if="scope.row.status === 1"></el-tag>
<el-tag type="danger" v-else></el-tag>
<el-tag type="success" v-if="scope.row.status === 1">{{$t('message.role.Enable')}}</el-tag>
<el-tag type="danger" v-else>{{$t('message.role.Disable')}}</el-tag>
</template>
</el-table-column>
<el-table-column label="修改记录" width="100" align="center" show-overflow-tooltip>
<el-table-column :label="$t('message.menu.Modifying_records')" width="100" align="center" show-overflow-tooltip>
<template #default="scope">
<ModifyRecord :data="scope.row" />
</template>
</el-table-column>
<el-table-column label="操作" width="140" fixed="right" align="center" show-overflow-tooltip>
<el-table-column :label="$t('message.menu.Operation')" width="140" fixed="right" align="center" show-overflow-tooltip>
<template #default="scope">
<!-- <el-button icon="ele-Edit" size="small" text type="primary" @click="openEditMenu(scope.row)"
v-auth="'sysMenu:update'"> 编辑 </el-button>
<el-button icon="ele-Delete" size="small" text type="danger" @click="delMenu(scope.row)"
v-auth="'sysMenu:delete'"> 删除 </el-button> -->
<el-button icon="ele-Edit" size="small" text type="primary" @click="openEditMenu(scope.row)">
<el-button icon="ele-Edit" size="small" text type="primary" @click="openEditMenu(scope.row)"> {{$t('message.menu.Editing')}}
</el-button>
<el-button icon="ele-Delete" size="small" text type="danger" @click="delMenu(scope.row)">
<el-button icon="ele-Delete" size="small" text type="danger" @click="delMenu(scope.row)"> {{$t('message.menu.Delete')}}
</el-button>
</template>
</el-table-column>
@ -90,7 +90,8 @@ import ModifyRecord from '/@/components/table/modifyRecord.vue';
import { getAPI } from '/@/utils/axios-utils';
import { SysMenuApi } from '/@/api-services/api';
import { SysMenu } from '/@/api-services/models';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const editMenuRef = ref<InstanceType<typeof EditMenu>>();
const state = reactive({
loading: false,
@ -126,27 +127,27 @@ const resetQuery = () => {
//
const openAddMenu = () => {
state.editMenuTitle = '添加菜单';
state.editMenuTitle = t('message.menu.Adding_menu');
editMenuRef.value?.openDialog({ type: 2, isHide: false, isKeepAlive: true, isAffix: false, isIframe: false, status: 1, orderNo: 100 });
};
//
const openEditMenu = (row: any) => {
state.editMenuTitle = '编辑菜单';
state.editMenuTitle = t('message.menu.Edit_menu');
editMenuRef.value?.openDialog(row);
};
//
const delMenu = (row: any) => {
ElMessageBox.confirm(`确定删除菜单:${row.title}】?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
ElMessageBox.confirm(t('message.menu.Determine_delete_menu')+`${row.title}】?`, t('message.role.Tips'), {
confirmButtonText: t('message.role.Confirmation'),
cancelButtonText: t('message.role.Cancel'),
type: 'warning',
})
.then(async () => {
await getAPI(SysMenuApi).apiSysMenuDeletePost({ id: row.id });
handleQuery();
ElMessage.success('删除成功');
ElMessage.success(t('message.role.Delete_successfully'));
})
.catch(() => { });
};

@ -11,38 +11,38 @@
<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="auto">
<el-row :gutter="35">
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="角色名称" prop="name"
:rules="[{ required: true, message: '角色名称不能为空', trigger: 'blur' }]">
<el-input v-model="state.ruleForm.name" placeholder="角色名称" clearable />
<el-form-item :label="$t('message.role.Role_name')" prop="name"
:rules="[{ required: true, message: $t('message.user_zz.The_input_field_cannot_empty'), trigger: 'blur' }]">
<el-input v-model="state.ruleForm.name" :placeholder="$t('message.role.Role_name')" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="角色编码" prop="code"
:rules="[{ required: true, message: '角色编码不能为空', trigger: 'blur' }]">
<el-input v-model="state.ruleForm.code" placeholder="角色编码" clearable
<el-form-item :label="$t('message.role.Role_encoding')" prop="code"
:rules="[{ required: true, message: $t('message.user_zz.The_input_field_cannot_empty'), trigger: 'blur' }]">
<el-input v-model="state.ruleForm.code" :placeholder="$t('message.role.Role_encoding')" clearable
:disabled="state.ruleForm.code == 'sys_admin' && state.ruleForm.id != undefined" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="排序">
<el-input-number v-model="state.ruleForm.orderNo" placeholder="排序" class="w100" />
<el-form-item :label="$t('message.role.Sorting')">
<el-input-number v-model="state.ruleForm.orderNo" :placeholder="$t('message.role.Sorting')" class="w100" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="状态">
<el-radio-group v-model="state.ruleForm.status">
<el-radio :value="1">启用</el-radio>
<el-radio :value="2">禁用</el-radio>
<el-radio :value="1">{{$t('message.role.Enable')}}</el-radio>
<el-radio :value="2">{{$t('message.role.Disable')}}</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="备注">
<el-input v-model="state.ruleForm.remark" placeholder="请输入备注内容" clearable type="textarea" />
<el-form-item :label="$t('message.user_zz.Remarks')">
<el-input v-model="state.ruleForm.remark" :placeholder="$t('message.role.Please_enter_remarks')" clearable type="textarea" />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl="24" class="mb20">
<el-form-item label="菜单权限" v-loading="state.loading">
<el-form-item :label="$t('message.role.Menu_permissions')" v-loading="state.loading">
<el-tree ref="treeRef" :data="state.menuData" node-key="id" show-checkbox
:props="{ children: 'children', label: 'title', class: treeNodeClass }" icon="ele-Menu"
highlight-current default-expand-all style="height: 600px;overflow-y: auto;" />
@ -52,8 +52,8 @@
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="cancel">{{$t('message.role.Cancel')}}</el-button>
<el-button type="primary" @click="submit">{{$t('message.role.Confirmation')}}</el-button>
</span>
</template>
</el-dialog>
@ -68,7 +68,8 @@ import { ElMessageBox, ElMessage } from 'element-plus';
import { getAPI } from '/@/utils/axios-utils';
import { SysMenuApi, SysRoleApi } from '/@/api-services/api';
import { SysMenu, UpdateRoleInput } from '/@/api-services/models';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const props = defineProps({
title: String,
});
@ -124,16 +125,16 @@ const submit = () => {
if (state.ruleForm.id != undefined && state.ruleForm.id > 0) {
const res = await getAPI(SysRoleApi).apiSysRoleUpdatePost(state.ruleForm);
if (res.data.data == 200) {
ElMessage.success('修改成功');
ElMessage.success(t('message.user_zz.Change_successful'));
} else {
ElMessage.error('修改失败');
ElMessage.error(t('message.user_zz.Change_failed'));
}
} else {
const res = await getAPI(SysRoleApi).apiSysRoleAddPost(state.ruleForm);
if (res.data.data == 200) {
ElMessage.success('新增成功');
ElMessage.success(t('message.user_zz.Added_success'));
} else {
ElMessage.error('新增失败');
ElMessage.error(t('message.user_zz.Add_failed'));
}
}
closeDialog();

@ -4,20 +4,20 @@
<template #header>
<div style="color: #fff">
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
<span> 授权数据范围 </span>
<span> {{$t('message.role.Authorized_data_scope')}} </span>
</div>
</template>
<el-form :model="state.ruleForm" label-position="top">
<el-row :gutter="35">
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl1="24" class="mb20">
<el-form-item label="数据范围:">
<el-select v-model="state.ruleForm.dataScope" placeholder="数据范围" style="width: 100%">
<el-form-item :label="$t('message.role.Data_range')">
<el-select v-model="state.ruleForm.dataScope" :placeholder="$t('message.role.Data_range')" style="width: 100%">
<el-option v-for="d in state.dataScopeType" :key="d.value" :label="d.label" :value="d.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="24" :md="24" :lg="24" :xl1="24" v-show="state.ruleForm.dataScope === 5">
<el-form-item label="机构列表:">
<el-form-item label="$t('message.role.List_Institutions')">
<OrgTree ref="orgTreeRef" class="w100" />
</el-form-item>
</el-col>
@ -25,8 +25,8 @@
</el-form>
<template #footer>
<span class="dialog-footer">
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="cancel">{{$t('message.role.Cancel')}}</el-button>
<el-button type="primary" @click="submit">{{$t('message.role.Confirmation')}}</el-button>
</span>
</template>
</el-dialog>
@ -40,18 +40,19 @@ import OrgTree from '/@/views/system/org/component/orgTree.vue';
import { getAPI } from '/@/utils/axios-utils';
import { SysRoleApi } from '/@/api-services/api';
import { RoleOrgInput } from '/@/api-services/models';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const emits = defineEmits(['handleQuery']);
const orgTreeRef = ref();
const state = reactive({
isShowDialog: false,
ruleForm: {} as RoleOrgInput,
dataScopeType: [
{ value: 1, label: '全部数据' },
{ value: 2, label: '本部门及以下数据' },
{ value: 3, label: '本部门数据' },
{ value: 4, label: '仅本人数据' },
{ value: 5, label: '自定义数据' },
{ value: 1, label: t('message.role.All_data')},
{ value: 2, label: t('message.role.This_department_following_data')},
{ value: 3, label: t('message.role.Data_Department') },
{ value: 4, label: t('message.role.Personal_data_only')},
{ value: 5, label: t('message.role.Custom_data')},
],
});

@ -2,55 +2,55 @@
<div class="sys-role-container">
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
<el-form :model="state.queryParams" ref="queryForm" :inline="true">
<el-form-item label="角色名称">
<el-input v-model="state.queryParams.name" placeholder="角色名称" clearable />
<el-form-item :label="$t('message.role.Role_name')">
<el-input v-model="state.queryParams.name" :placeholder="$t('message.role.Role_name')" clearable />
</el-form-item>
<el-form-item label="角色编码">
<el-input v-model="state.queryParams.code" placeholder="角色编码" clearable />
<el-form-item :label="$t('message.role.Role_encoding')">
<el-input v-model="state.queryParams.code" :placeholder="$t('message.role.Role_encoding')" clearable />
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysRole:page'"> </el-button>
<el-button icon="ele-Refresh" @click="resetQuery"> </el-button>
<el-button type="primary" icon="ele-Search" @click="handleQuery" v-auth="'sysRole:page'"> {{$t('message.role.search')}} </el-button>
<el-button icon="ele-Refresh" @click="resetQuery"> {{$t('message.role.reset')}} </el-button>
</el-button-group>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="ele-Plus" @click="openAddRole" v-auth="'sysRole:add'"> </el-button>
<el-button type="primary" icon="ele-Plus" @click="openAddRole" v-auth="'sysRole:add'"> {{$t('message.role.New_additions')}} </el-button>
</el-form-item>
</el-form>
</el-card>
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
<el-table :data="state.roleData" style="width: 100%" v-loading="state.loading" border>
<el-table-column type="index" label="序号" width="55" align="center" fixed />
<el-table-column prop="name" label="角色名称" align="center" show-overflow-tooltip />
<el-table-column prop="code" label="角色编码" align="center" show-overflow-tooltip />
<el-table-column label="数据范围" align="center" show-overflow-tooltip>
<el-table-column type="index" :label="$t('message.role.Serial_number')" width="55" align="center" fixed />
<el-table-column prop="name" :label="$t('message.role.Role_name')" align="center" show-overflow-tooltip />
<el-table-column prop="code" :label="$t('message.role.Role_encoding')" align="center" show-overflow-tooltip />
<el-table-column :label="$t('message.role.Data_range')" align="center" show-overflow-tooltip>
<template #default="scope">
<el-tag effect="plain" v-if="scope.row.dataScope === 1"></el-tag>
<el-tag effect="plain" v-else-if="scope.row.dataScope === 2">本部门及以下数据</el-tag>
<el-tag effect="plain" v-else-if="scope.row.dataScope === 3">本部门数据</el-tag>
<el-tag effect="plain" v-else-if="scope.row.dataScope === 4">仅本人数据</el-tag>
<el-tag effect="plain" v-else-if="scope.row.dataScope === 5">自定义数据</el-tag>
<el-tag effect="plain" v-if="scope.row.dataScope === 1"> {{$t('message.role.All_data')}}</el-tag>
<el-tag effect="plain" v-else-if="scope.row.dataScope === 2"> {{$t('message.role.This_department_following_data')}}</el-tag>
<el-tag effect="plain" v-else-if="scope.row.dataScope === 3"> {{$t('message.role.Data_Department')}}</el-tag>
<el-tag effect="plain" v-else-if="scope.row.dataScope === 4"> {{$t('message.role.Personal_data_only')}}</el-tag>
<el-tag effect="plain" v-else-if="scope.row.dataScope === 5"> {{$t('message.role.Custom_data')}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="orderNo" label="排序" width="70" align="center" show-overflow-tooltip />
<el-table-column label="状态" width="70" align="center" show-overflow-tooltip>
<el-table-column prop="orderNo" :label="$t('message.role.Sorting')" width="70" align="center" show-overflow-tooltip />
<el-table-column :label="$t('message.role.State')" width="70" align="center" show-overflow-tooltip>
<template #default="scope">
<el-tag type="success" v-if="scope.row.status === 1"></el-tag>
<el-tag type="danger" v-else></el-tag>
<el-tag type="success" v-if="scope.row.status === 1"> {{$t('message.role.Enable')}}</el-tag>
<el-tag type="danger" v-else> {{$t('message.role.Disable')}}</el-tag>
</template>
</el-table-column>
<el-table-column label="修改记录" width="100" align="center" show-overflow-tooltip>
<el-table-column :label="$t('message.role.Modifying_records')" width="100" align="center" show-overflow-tooltip>
<template #default="scope">
<ModifyRecord :data="scope.row" />
</template>
</el-table-column>
<el-table-column label="操作" width="240" fixed="right" align="center" show-overflow-tooltip>
<el-table-column :label="$t('message.role.Operation')" width="240" fixed="right" align="center" show-overflow-tooltip>
<template #default="scope">
<el-button icon="ele-OfficeBuilding" size="small" text type="primary" @click="openGrantData(scope.row)" v-auth="'sysRole:grantDataScope'"> </el-button>
<el-button icon="ele-Edit" size="small" text type="primary" @click="openEditRole(scope.row)" v-auth="'sysRole:update'"> </el-button>
<el-button icon="ele-Delete" size="small" text type="danger" @click="delRole(scope.row)" v-auth="'sysRole:delete'"> </el-button>
<el-button icon="ele-OfficeBuilding" size="small" text type="primary" @click="openGrantData(scope.row)" v-auth="'sysRole:grantDataScope'"> {{$t('message.role.Disable')}} </el-button>
<el-button icon="ele-Edit" size="small" text type="primary" @click="openEditRole(scope.row)" v-auth="'sysRole:update'"> {{$t('message.role.Editing')}} </el-button>
<el-button icon="ele-Delete" size="small" text type="danger" @click="delRole(scope.row)" v-auth="'sysRole:delete'"> {{$t('message.role.Delete')}} </el-button>
</template>
</el-table-column>
</el-table>
@ -83,7 +83,8 @@ import ModifyRecord from '/@/components/table/modifyRecord.vue';
import { getAPI } from '/@/utils/axios-utils';
import { SysRoleApi } from '/@/api-services/api';
import { SysRole } from '/@/api-services/models';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const editRoleRef = ref<InstanceType<typeof EditRole>>();
const grantDataRef = ref<InstanceType<typeof GrantData>>();
const state = reactive({
@ -126,13 +127,13 @@ const resetQuery = () => {
//
const openAddRole = () => {
state.editRoleTitle = '添加角色';
state.editRoleTitle = t('message.role.Adding_role');
editRoleRef.value?.openDialog({ id: undefined, status: 1, orderNo: 100 });
};
//
const openEditRole = async (row: any) => {
state.editRoleTitle = '编辑角色';
state.editRoleTitle = t('message.role.Editing_role');
editRoleRef.value?.openDialog(row);
};
@ -145,15 +146,15 @@ const openGrantData = (row: any) => {
const delRole = (row: any) => {
console.log(row,'row');
ElMessageBox.confirm(`确定删角色:${row.name}】?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
ElMessageBox.confirm(t('message.role.Determine_delete_role')+`${row.name}】?`, t('message.role.Tips'), {
confirmButtonText: t('message.role.Confirmation'),
cancelButtonText: t('message.role.Cancel'),
type: 'warning',
})
.then(async () => {
await getAPI(SysRoleApi).apiSysRoleDeletePost({ id: row.id });
handleQuery();
ElMessage.success('删除成功');
ElMessage.success(t('message.role.Delete_successfully'));
})
.catch(() => {});
};

@ -1,6 +1,6 @@
<template>
<div class="sys-user-container">
<el-dialog v-model="state.isShowDialog" draggable :close-on-click-modal="false" width="700px">
<el-dialog v-model="state.isShowDialog" draggable :close-on-click-modal="false" width="900px">
<template #header>
<div style="color: #fff">
<el-icon size="16" style="margin-right: 3px; display: inline; vertical-align: middle"> <ele-Edit /> </el-icon>
@ -8,53 +8,53 @@
</div>
</template>
<el-tabs v-loading="state.loading" v-model="state.selectedTabName">
<el-tab-pane label="基础信息" style="height: 200px">
<el-tab-pane :label="$t('message.user_zz.Basic_information')" style="height: 200px">
<el-form :model="state.ruleForm" ref="ruleFormRef" label-width="auto">
<el-row :gutter="35">
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="账号名称" prop="account" :rules="[{ required: true, message: '账号名称不能为空', trigger: 'blur' }]">
<el-input v-model="state.ruleForm.account" placeholder="账号名称" clearable />
<el-form-item :label= "$t('message.user_zz.Account_name')" prop="account" :rules="[{ required: true, message: $t('message.user_zz.The_input_field_cannot_empty'), trigger: 'blur' }]">
<el-input v-model="state.ruleForm.account" :placeholder="$t('message.user_zz.Account_name')" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="昵称">
<el-input v-model="state.ruleForm.nickName" placeholder="昵称" clearable />
<el-form-item :label="$t('message.user_zz.Nickname')">
<el-input v-model="state.ruleForm.nickName" :placeholder="$t('message.user_zz.Nickname')" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="手机号码" prop="phone" :rules="[{ required: true, message: '手机号码不能为空', trigger: 'blur' }]">
<el-input v-model="state.ruleForm.phone" placeholder="手机号码" clearable />
<el-form-item :label="$t('message.user_zz.Mobile_phone_number')" prop="phone" :rules="[{ required: true, message: $t('message.user_zz.The_input_field_cannot_empty'), trigger: 'blur' }]">
<el-input v-model="state.ruleForm.phone" :placeholder="$t('message.user_zz.Mobile_phone_number')" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="真实姓名" prop="realName" :rules="[{ required: true, message: '真实姓名不能为空', trigger: 'blur' }]">
<el-input v-model="state.ruleForm.realName" placeholder="真实姓名" clearable />
<el-form-item :label="$t('message.user_zz.Real_name')" prop="realName" :rules="[{ required: true, message: $t('message.user_zz.The_input_field_cannot_empty'), trigger: 'blur' }]">
<el-input v-model="state.ruleForm.realName" :placeholder="$t('message.user_zz.Real_name')" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="角色集合" prop="roleIdList" :rules="[{ required: true, message: '角色集合不能为空', trigger: 'blur' }]">
<el-select v-model="state.ruleForm.roleIdList" multiple value-key="id" clearable placeholder="角色集合" collapse-tags collapse-tags-tooltip class="w100" filterable>
<el-form-item :label="$t('message.user_zz.Collection_roles')" prop="roleIdList" :rules="[{ required: true, message: $t('message.user_zz.The_input_field_cannot_empty'), trigger: 'blur' }]">
<el-select v-model="state.ruleForm.roleIdList" multiple value-key="id" clearable :placeholder="$t('message.user_zz.Collection_roles')" collapse-tags collapse-tags-tooltip class="w100" filterable>
<el-option v-for="item in state.roleData" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="账号类型" prop="accountType" :rules="[{ required: true, message: '账号类型不能为空', trigger: 'blur' }]">
<el-select v-model="state.ruleForm.accountType" placeholder="账号类型" collapse-tags collapse-tags-tooltip class="w100">
<el-option label="系统管理员" :value="888" :disabled="userInfos.accountType != 888 && userInfos.accountType != 999" />
<el-option label="普通账号" :value="777" />
<el-option label="会员" :value="666" />
<el-form-item :label="$t('message.user_zz.Account_Type')" prop="accountType" :rules="[{ required: true, message: $t('message.user_zz.The_input_field_cannot_empty'), trigger: 'blur' }]">
<el-select v-model="state.ruleForm.accountType" :placeholder="$t('message.user_zz.Account_Type')" collapse-tags collapse-tags-tooltip class="w100">
<el-option :label="$t('message.user_zz.System_administrator')" :value="888" :disabled="userInfos.accountType != 888 && userInfos.accountType != 999" />
<el-option :label="$t('message.user_zz.Regular_account_number')" :value="777" />
<el-option :label="$t('message.user_zz.Member')" :value="666" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb20">
<el-form-item label="邮箱">
<el-input v-model="state.ruleForm.email" placeholder="邮箱" clearable />
<el-form-item :label="$t('message.user_zz.Email_address')">
<el-input v-model="state.ruleForm.email" :placeholder="$t('message.user_zz.Email_address')" clearable />
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12" class="mb5">
<el-form-item label="排序">
<el-input-number v-model="state.ruleForm.orderNo" placeholder="排序" class="w100" />
<el-form-item :label="$t('message.user_zz.Sorting')">
<el-input-number v-model="state.ruleForm.orderNo" :placeholder="$t('message.user_zz.Sorting')" class="w100" />
</el-form-item>
</el-col>
<!-- <el-divider border-style="dashed" content-position="center">
@ -251,8 +251,8 @@
</el-tabs>
<template #footer>
<span class="dialog-footer">
<el-button @click="cancel"> </el-button>
<el-button type="primary" @click="submit"> </el-button>
<el-button @click="cancel">{{$t('message.user_zz.Cancel')}}</el-button>
<el-button type="primary" @click="submit">{{$t('message.user_zz.Confirmation')}}</el-button>
</span>
</template>
</el-dialog>
@ -269,7 +269,8 @@ import { getAPI } from '/@/utils/axios-utils';
import { SysPosApi, SysRoleApi, SysUserApi } from '/@/api-services/api';
import { RoleOutput, SysOrg, SysPos, UpdateUserInput } from '/@/api-services/models';
import { log } from 'console';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const props = defineProps({
title: String,
orgData: Array<SysOrg>,
@ -334,16 +335,16 @@ const submit = () => {
if (state.ruleForm.id != undefined && state.ruleForm.id > 0) {
const res = await getAPI(SysUserApi).apiSysUserUpdatePost(state.ruleForm);
if (res.data.isSuccess) {
ElMessage.success('修改成功');
ElMessage.success(t('message.user_zz.Change_successful'));
} else {
ElMessage.error('修改失败');
ElMessage.error(t('message.user_zz.Change_failed'));
}
} else {
const res = await getAPI(SysUserApi).apiSysUserAddPost(state.ruleForm);
if (res.data.isSuccess) {
ElMessage.success('新增成功');
ElMessage.success(t('message.user_zz.Added_success'));
} else {
ElMessage.error('新增失败');
ElMessage.error(t('message.user_zz.Add_failed'));
}
}
closeDialog();

@ -4,28 +4,28 @@
<!-- <el-col :span="4" :xs="24">
<OrgTree ref="orgTreeRef" @node-click="nodeClick" />
</el-col> -->
<!-- $t('message.emeter_total_energy_value.Serial_number') -->
<el-col :span="24" :xs="24" style="display: flex; flex-direction: column">
<el-card shadow="hover" :body-style="{ paddingBottom: '0' }">
<el-form :model="state.queryParams" ref="queryForm" :inline="true">
<el-form-item label="账号">
<el-input v-model="state.queryParams.account" placeholder="账号" clearable />
<el-form-item :label="$t('message.user_zz.account')">
<el-input v-model="state.queryParams.account" :placeholder="$t('message.user_zz.account')" clearable />
</el-form-item>
<!-- <el-form-item label="姓名">
<el-input v-model="state.queryParams.realName" placeholder="姓名" clearable />
</el-form-item> -->
<el-form-item label="手机号码">
<el-input v-model="state.queryParams.phone" placeholder="手机号码" clearable />
<el-form-item :label="$t('message.user_zz.Mobile_phone_number')">
<el-input v-model="state.queryParams.phone" :placeholder="$t('message.user_zz.Mobile_phone_number')" clearable />
</el-form-item>
<el-form-item>
<el-button-group>
<el-button type="primary" icon="ele-Search" @click="handleQuery"
v-auth="'sysUser:page'"> 查询 </el-button>
<el-button icon="ele-Refresh" @click="resetQuery"> </el-button>
v-auth="'sysUser:page'"> {{$t('message.user_zz.search')}} </el-button>
<el-button icon="ele-Refresh" @click="resetQuery">{{$t('message.user_zz.reset')}}</el-button>
</el-button-group>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="ele-Plus" @click="openAddUser" v-auth="'sysUser:add'">
<el-button type="primary" icon="ele-Plus" @click="openAddUser" v-auth="'sysUser:add'"> {{$t('message.user_zz.New_additions')}}
</el-button>
</el-form-item>
</el-form>
@ -33,17 +33,17 @@
<el-card class="full-table" shadow="hover" style="margin-top: 5px">
<el-table :data="state.userData" style="width: 100%" v-loading="state.loading" border>
<el-table-column type="index" label="序号" width="55" align="center" fixed />
<el-table-column label="头像" width="80" align="center" show-overflow-tooltip>
<el-table-column type="index" :label="$t('message.user_zz.Serial_number')" width="55" align="center" fixed />
<el-table-column :label="$t('message.user_zz.Head_shot')" width="80" align="center" show-overflow-tooltip>
<template #default="scope">
<el-avatar :src="scope.row.avatar" size="small">{{ scope.row.nickName?.slice(0, 1) ??
scope.row.realName?.slice(0, 1) }} </el-avatar>
</template>
</el-table-column>
<el-table-column prop="account" label="账号" width="120" align="center" show-overflow-tooltip />
<el-table-column prop="account" :label="$t('message.user_zz.account')" width="120" align="center" show-overflow-tooltip />
<!-- <el-table-column prop="nickName" label="昵称" width="120" align="center" show-overflow-tooltip /> -->
<el-table-column prop="realName" label="姓名" width="120" align="center" show-overflow-tooltip />
<el-table-column prop="phone" label="手机号码" width="120" align="center" show-overflow-tooltip />
<el-table-column prop="realName" :label="$t('message.user_zz.Name')" width="120" align="center" show-overflow-tooltip />
<el-table-column prop="phone" :label="$t('message.user_zz.Mobile_phone_number')" width="120" align="center" show-overflow-tooltip />
<!-- <el-table-column label="出生日期" width="100" align="center" show-overflow-tooltip>
<template #default="scope">
{{ formatDate(new Date(scope.row.birthday), 'YYYY-mm-dd') }}
@ -56,47 +56,47 @@
<el-tag type="info" v-else> </el-tag>
</template>
</el-table-column> -->
<el-table-column label="账号类型" width="110" align="center" show-overflow-tooltip>
<el-table-column :label="$t('message.user_zz.Account_Type')" width="110" align="center" show-overflow-tooltip>
<template #default="scope">
<el-tag v-if="scope.row.accountType === 888"> </el-tag>
<el-tag v-else-if="scope.row.accountType === 777"> 普通账号 </el-tag>
<el-tag v-else-if="scope.row.accountType === 666"> 会员 </el-tag>
<el-tag v-else> </el-tag>
<el-tag v-if="scope.row.accountType === 888"> {{$t('message.user_zz.System_administrator')}}</el-tag>
<el-tag v-else-if="scope.row.accountType === 777"> {{$t('message.user_zz.Regular_account_number')}}</el-tag>
<el-tag v-else-if="scope.row.accountType === 666"> {{$t('message.user_zz.Member')}}</el-tag>
<el-tag v-else>{{$t('message.user_zz.Others')}}</el-tag>
</template>
</el-table-column>
<el-table-column prop="roleName" label="角色集合" min-width="150" align="center"
<el-table-column prop="roleName" :label="$t('message.user_zz.Collection_roles')" min-width="150" align="center"
show-overflow-tooltip />
<el-table-column prop="orgName" label="所属机构" min-width="120" align="center"
<el-table-column prop="orgName" :label="$t('message.user_zz.Affiliated_Organization')" min-width="120" align="center"
show-overflow-tooltip />
<el-table-column prop="posName" label="职位名称" min-width="120" align="center"
<el-table-column prop="posName" :label="$t('message.user_zz.Job_Title')" min-width="120" align="center"
show-overflow-tooltip />
<el-table-column label="状态" width="70" align="center" show-overflow-tooltip>
<el-table-column :label="$t('message.user_zz.State')" width="70" align="center" show-overflow-tooltip>
<template #default="scope">
<el-switch v-model="scope.row.status" :active-value="1" :inactive-value="2" size="small"
@change="changeStatus(scope.row)" v-auth="'sysUser:setStatus'" />
</template>
</el-table-column>
<el-table-column prop="orderNo" label="排序" width="70" align="center" show-overflow-tooltip />
<el-table-column label="修改记录" width="100" align="center" show-overflow-tooltip>
<el-table-column prop="orderNo" :label="$t('message.user_zz.Sorting')" width="70" align="center" show-overflow-tooltip />
<el-table-column :label="$t('message.user_zz.Modifying_records')" width="100" align="center" show-overflow-tooltip>
<template #default="scope">
<ModifyRecord :data="scope.row" />
</template>
</el-table-column>
<el-table-column label="操作" width="130" align="center" fixed="right" show-overflow-tooltip>
<el-table-column :label="$t('message.user_zz.Operation')" width="130" align="center" fixed="right" show-overflow-tooltip>
<template #default="scope">
<el-button icon="ele-Edit" size="small" text type="primary"
@click="openEditUser(scope.row)" v-auth="'sysUser:update'"> 编辑 </el-button>
@click="openEditUser(scope.row)" v-auth="'sysUser:update'"> {{$t('message.user_zz.Editing')}} </el-button>
<el-dropdown>
<el-button icon="ele-MoreFilled" size="small" text type="primary"
style="padding-left: 12px" />
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item icon="ele-RefreshLeft" @click="resetUserPwd(scope.row)"
:disabled="!auth('sysUser:resetPwd')"> 重置密码 </el-dropdown-item>
:disabled="!auth('sysUser:resetPwd')"> {{$t('message.user_zz.Reset_Password')}}</el-dropdown-item>
<el-dropdown-item icon="ele-Unlock" @click="unlockLogin(scope.row)" divided
:disabled="!auth('sysUser:unlockLogin')"> 解除锁定 </el-dropdown-item>
:disabled="!auth('sysUser:unlockLogin')"> {{$t('message.user_zz.Unlock_lock')}}</el-dropdown-item>
<el-dropdown-item icon="ele-Delete" @click="delUser(scope.row)" divided
:disabled="!auth('sysUser:delete')"> 删除账号 </el-dropdown-item>
:disabled="!auth('sysUser:delete')"> {{$t('message.user_zz.Deleting_Account')}}</el-dropdown-item>
</el-dropdown-menu>
</template>
</el-dropdown>
@ -128,7 +128,8 @@ import ModifyRecord from '/@/components/table/modifyRecord.vue';
import { getAPI } from '/@/utils/axios-utils';
import { SysUserApi, SysOrgApi } from '/@/api-services/api';
import { SysUser, SysOrg } from '/@/api-services/models';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const orgTreeRef = ref<InstanceType<typeof OrgTree>>();
const editUserRef = ref<InstanceType<typeof EditUser>>();
const state = reactive({
@ -182,27 +183,27 @@ const resetQuery = () => {
//
const openAddUser = () => {
state.editUserTitle = '添加账号';
state.editUserTitle = t('message.user_zz.Adding_account');
editUserRef.value?.openDialog({ id: undefined, birthday: '2000-01-01', sex: 1, orderNo: 100, cardType: 0, cultureLevel: 5 });
};
//
const openEditUser = (row: any) => {
state.editUserTitle = '编辑账号';
state.editUserTitle = t('message.user_zz.Edit_account');
editUserRef.value?.openDialog(row);
};
//
const delUser = (row: any) => {
ElMessageBox.confirm(`确定删除账号:${row.account}?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
ElMessageBox.confirm(t('message.user_zz.Make_sure_delete_account')+`${row.account}`+"?", t('message.user_zz.Tips'), {
confirmButtonText:t('message.user_zz.Confirmation'),
cancelButtonText: t('message.user_zz.Cancel'),
type: 'warning',
})
.then(async () => {
await getAPI(SysUserApi).apiSysUserDeletePost({ id: row.id });
handleQuery();
ElMessage.success('删除成功');
ElMessage.success(t('message.user_zz.Delete_successfully'));
})
.catch(() => { });
};
@ -224,7 +225,7 @@ const changeStatus = (row: any) => {
getAPI(SysUserApi)
.apiSysUserSetStatusPost({ id: row.id, status: row.status })
.then(() => {
ElMessage.success('账号状态设置成功');
ElMessage.success(t('message.user_zz.The_account_status_successfully'));
})
.catch(() => {
row.status = row.status == 1 ? 2 : 1;
@ -233,9 +234,9 @@ const changeStatus = (row: any) => {
//
const resetUserPwd = async (row: any) => {
ElMessageBox.confirm(`确定重置密码:${row.account}?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
ElMessageBox.confirm(t('message.user_zz.Make_sure_reset_password')+`${row.account}`+"?", t('message.user_zz.Tips'), {
confirmButtonText: t('message.user_zz.Confirmation'),
cancelButtonText: t('message.user_zz.Cancel'),
type: 'warning',
})
.then(async () => {
@ -243,7 +244,7 @@ const resetUserPwd = async (row: any) => {
.apiSysUserResetPwdPost({ id: row.id })
.then((res) => {
// console.log(res,'res');
ElMessage.success(`密码重置成功为:${res.data.msg}`);
ElMessage.success(t('message.user_zz.Password_reset_successful')+`${res.data.msg}`);
});
})
.catch(() => { });
@ -251,16 +252,16 @@ const resetUserPwd = async (row: any) => {
//
const unlockLogin = async (row: any) => {
ElMessageBox.confirm(`确定解除登录锁定:${row.account}】?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
ElMessageBox.confirm(t('message.user_zz.Make_sure_unlock_login')+`${row.account}】?`, t('message.user_zz.Tips'), {
confirmButtonText: t('message.user_zz.Confirmation'),
cancelButtonText: t('message.user_zz.Cancel'),
type: 'warning',
})
.then(async () => {
await getAPI(SysUserApi)
.apiSysUserUnlockLoginPost({ id: row.id })
.then(() => {
ElMessage.success('解除登录锁定成功');
ElMessage.success( t('message.user_zz.Unlocking_logon_successful'));
});
})
.catch(() => { });

Loading…
Cancel
Save