diff --git a/package.json b/package.json
index 0b43c319..434db7e3 100644
--- a/package.json
+++ b/package.json
@@ -60,7 +60,8 @@
"vue-meta": "2.4.0",
"vue-router": "3.4.9",
"vuedraggable": "2.24.3",
- "vuex": "3.6.0"
+ "vuex": "3.6.0",
+ "webstomp-client": "^1.2.6"
},
"devDependencies": {
"@vue/cli-plugin-babel": "4.4.6",
diff --git a/src/App.vue b/src/App.vue
index 97626af5..e8b1f8b7 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -9,6 +9,7 @@
import ThemePicker from "@/components/ThemePicker";
import { mapActions } from 'vuex'
import { get } from '@/utils/config'
+// import AlertNotification from "@/views/warning/AlertNotification.vue";
export default {
name: "App",
diff --git a/src/api/system/log.js b/src/api/system/log.js
index 80d6e06a..37abfb25 100644
--- a/src/api/system/log.js
+++ b/src/api/system/log.js
@@ -30,7 +30,7 @@ export function getSysLogs(data) {
//备份系统日志列表
export function downloadSysLogs(data) {
return request({
- url: '/sys/sysLog/downloadSysLogs',
+ url: '/system/sys/sysLog/downloadSysLogs',
method: 'get',
params: data,
responseType: 'blob'
@@ -92,6 +92,12 @@ export function getLogSize(data) {
})
}
+export function handleNoWarningLog(data) {
+ return request({
+ url: '/system/sys/sysLog/logWarn',
+ method: 'get'
+ })
+}
diff --git a/src/layout/index.vue b/src/layout/index.vue
index 26f9ebf7..e3c246a1 100644
--- a/src/layout/index.vue
+++ b/src/layout/index.vue
@@ -25,10 +25,6 @@
-
重置
-
+
日志类型
操作类型
+ 操作人
查询
diff --git a/src/views/system/log/logCapacity/index.vue b/src/views/system/log/logCapacity/index.vue
index 5829b1b9..36df825f 100644
--- a/src/views/system/log/logCapacity/index.vue
+++ b/src/views/system/log/logCapacity/index.vue
@@ -12,7 +12,7 @@
clearable
style="width: 240px"
/>
- MB
+ GB
diff --git a/src/views/system/log/systemLog/index.vue b/src/views/system/log/systemLog/index.vue
index caccb27e..b99a7783 100644
--- a/src/views/system/log/systemLog/index.vue
+++ b/src/views/system/log/systemLog/index.vue
@@ -42,9 +42,9 @@
重置
-
+
-
+
@@ -123,7 +123,7 @@
-
+
item.roleId)
- this.single = selection.length != 1
- this.multiple = !selection.length
- },
+ // 过滤掉不可选的行(虽然界面上不可选,但为了安全起见还是过滤一次)
+ const validSelection = selection.filter(row => this.checkSelectable(row));
+
+ // 更新选中的roleId数组
+ this.ids = validSelection.map(item => item.roleId);
+ // 更新单选和多选状态
+ this.single = validSelection.length !== 1;
+ this.multiple = !validSelection.length;
+ },
// 更多操作触发
handleCommand(command, row) {
switch (command) {
@@ -626,7 +631,33 @@ export default {
this.download('system/role/export', {
...this.queryParams
}, `role_${new Date().getTime()}.xlsx`)
- }
+ },
+ // 检查行是否可选
+ checkSelectable(row) {
+ return !(row.roleId === 1 || row.isBuiltIn === '0');
+ },
+
+
+ getRowClassName(row) {
+ return !this.checkSelectable(row) ? 'disabled-row' : '';
+ },
}
}
+
+
+
\ No newline at end of file
diff --git a/src/views/system/user/authRole.vue b/src/views/system/user/authRole.vue
index 943710e5..b282fd32 100644
--- a/src/views/system/user/authRole.vue
+++ b/src/views/system/user/authRole.vue
@@ -17,7 +17,7 @@
-
+
{{(pageNum - 1) * pageSize + scope.$index + 1}}
@@ -113,5 +113,12 @@ export default {
this.$tab.closeOpenPage(obj);
},
},
+
+ computed: {
+ filteredRoles() {
+ // 超级管理员不允许分配给其他人
+ return this.roles.filter(role => role.roleId !== 1);
+ }
+ }
};
\ No newline at end of file
diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index ba4e99ee..21890c37 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -82,7 +82,7 @@
-
+
+ >
+
+ {{ hidePhone(scope.row.phonenumber) }}
+
+
-
+
修改
@@ -244,7 +248,7 @@
:key="item.roleId"
:label="item.roleName"
:value="item.roleId"
- :disabled="item.status == 1"
+ :disabled="item.status == 1 || item.roleId === 1"
>
@@ -470,6 +474,11 @@ export default {
})
},
methods: {
+ /* 手机号码脱敏 */
+ hidePhone(phone) {
+ if (!phone) return '';
+ return phone.replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
+ },
/* 表单登录权限自定义校验 */
validateLoginType(rule, value, callback) {
if (this.loginTypeArr.length > 0) {
@@ -575,15 +584,20 @@ export default {
},
// 多选框选中数据
handleSelectionChange(selection) {
- this.ids = selection.map(item => item.userId)
- this.single = selection.length != 1
- this.multiple = !selection.length
+ // 过滤掉不可选的行(虽然界面上不可选,但为了安全起见还是过滤一次)
+ const validSelection = selection.filter(row => this.checkSelectable(row));
+
+ // 更新选中的roleId数组
+ this.ids = validSelection.map(item => item.userId);
+ // 更新单选和多选状态
+ this.single = validSelection.length !== 1;
+ this.multiple = !validSelection.length;
},
// 更多操作触发
handleCommand(command, row) {
switch (command) {
case 'handleResetPwd':
- this.handleResetPwd(row)
+ this.confirmResetPwd(row)
break
case 'handleAuthRole':
this.handleAuthRole(row)
@@ -653,6 +667,32 @@ export default {
}).catch(() => {
})
},
+ confirmResetPwd(row){
+ this.$prompt('请输入密码,鉴别用户', '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ closeOnClickModal: false,
+ inputPattern: /^.{8,16}$/,
+ inputErrorMessage: '用户密码长度必须介于 8 和 16 之间',
+ inputValidator: (value) => {
+ // 调用 validateNewPassword 校验
+ const errorMessage=function(error) {
+ if (error) {
+ return error.message;
+ } else {
+ console.log('验证通过');
+ }
+ };
+ validateNewPassword(null, value, errorMessage);
+ }
+ }).then(({ value }) => {
+ confirmPassword(value).then(response => {
+ this.$modal.msgSuccess('验证成功')
+ this.handleResetPwd(row)
+ })
+ }).catch(() => {
+ })
+ },
/** 重置密码按钮操作 */
handleResetPwd(row) {
this.$prompt('请输入"' + row.userName + '"的新密码', '提示', {
@@ -747,7 +787,41 @@ export default {
// 提交上传文件
submitFileForm() {
this.$refs.upload.submit()
- }
+ },
+
+ hasSystemOrAuditrRole(roles) {
+ if (!roles || !Array.isArray(roles)) {
+ return false; // 如果 roles 为空或不是数组,返回 false
+ }
+ return roles.some(role => role.roleKey === 'systemAdmin' || role.roleKey === 'audit'); // 检查是否存在 roleKey 为 admin 的角色
+ },
+
+ // 检查行是否可选
+ checkSelectable(row) {
+ return !(row.userId === 1 || row.isBuiltIn === '0' || this.hasSystemOrAuditrRole(row.roles));
+ },
+
+
+ getRowClassName(row) {
+ return !this.checkSelectable(row) ? 'disabled-row' : '';
+ },
+
}
}
+
+
\ No newline at end of file
diff --git a/src/views/warning/AlertNotification.vue b/src/views/warning/AlertNotification.vue
new file mode 100644
index 00000000..c583e09b
--- /dev/null
+++ b/src/views/warning/AlertNotification.vue
@@ -0,0 +1,126 @@
+
+
+
告警系统
+
WebSocket 已连接
+
WebSocket 连接中...
+
+
+
+
+
+