优化页面样式
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
<!doctype html>
|
<!doctype html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>SaiAdmin</title>
|
<title>Dafuweng-Dice</title>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<meta
|
<meta
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import { headerBarConfig } from './modules/headerBar'
|
|||||||
const appConfig: SystemConfig = {
|
const appConfig: SystemConfig = {
|
||||||
// 系统信息
|
// 系统信息
|
||||||
systemInfo: {
|
systemInfo: {
|
||||||
name: 'SaiAdmin' // 系统名称
|
name: 'Dafuweng-Dice' // 系统名称
|
||||||
},
|
},
|
||||||
// 系统主题
|
// 系统主题
|
||||||
systemThemeStyles: {
|
systemThemeStyles: {
|
||||||
|
|||||||
@@ -150,8 +150,8 @@
|
|||||||
},
|
},
|
||||||
"login": {
|
"login": {
|
||||||
"leftView": {
|
"leftView": {
|
||||||
"title": "A backend system of beauty and efficiency",
|
"title": "Monopoly Game Management",
|
||||||
"subTitle": "A sleek and practical interface for a great user experience"
|
"subTitle": "Monopoly Game Management"
|
||||||
},
|
},
|
||||||
"title": "Welcome back",
|
"title": "Welcome back",
|
||||||
"subTitle": "Please enter your account and password to login",
|
"subTitle": "Please enter your account and password to login",
|
||||||
|
|||||||
@@ -150,8 +150,8 @@
|
|||||||
},
|
},
|
||||||
"login": {
|
"login": {
|
||||||
"leftView": {
|
"leftView": {
|
||||||
"title": "一款兼具设计美学与高效开发的后台系统",
|
"title": "大富翁游戏管理",
|
||||||
"subTitle": "美观实用的界面,经过视觉优化,确保卓越的用户体验"
|
"subTitle": "大富翁游戏管理"
|
||||||
},
|
},
|
||||||
"title": "欢迎回来",
|
"title": "欢迎回来",
|
||||||
"subTitle": "输入您的账号和密码登录",
|
"subTitle": "输入您的账号和密码登录",
|
||||||
|
|||||||
@@ -190,7 +190,13 @@
|
|||||||
saiSecond: 'email'
|
saiSecond: 'email'
|
||||||
},
|
},
|
||||||
{ prop: 'phone', label: '手机号', width: 120 },
|
{ prop: 'phone', label: '手机号', width: 120 },
|
||||||
{ prop: 'depts.name', label: '部门', minWidth: 150 },
|
{
|
||||||
|
prop: 'dept_id',
|
||||||
|
label: '部门',
|
||||||
|
minWidth: 150,
|
||||||
|
sortable: true,
|
||||||
|
formatter: (row: any) => row.depts?.name ?? ''
|
||||||
|
},
|
||||||
{ prop: 'status', label: '状态', width: 80, saiType: 'dict', saiDict: 'data_status' },
|
{ prop: 'status', label: '状态', width: 80, saiType: 'dict', saiDict: 'data_status' },
|
||||||
{ prop: 'dashboard', label: '首页', width: 100, saiType: 'dict', saiDict: 'dashboard' },
|
{ prop: 'dashboard', label: '首页', width: 100, saiType: 'dict', saiDict: 'dashboard' },
|
||||||
{ prop: 'login_time', label: '上次登录', width: 170, sortable: true },
|
{ prop: 'login_time', label: '上次登录', width: 170, sortable: true },
|
||||||
|
|||||||
@@ -117,7 +117,10 @@ class SystemDeptLogic extends BaseLogic
|
|||||||
public function accessDept(array $where = []): array
|
public function accessDept(array $where = []): array
|
||||||
{
|
{
|
||||||
$query = $this->search($where);
|
$query = $this->search($where);
|
||||||
$query->auth($this->adminInfo['deptList']);
|
// 超级管理员(id=1)可查看全部部门,普通管理员按部门权限过滤
|
||||||
|
if (isset($this->adminInfo['id']) && $this->adminInfo['id'] > 1) {
|
||||||
|
$query->auth($this->adminInfo['deptList'] ?? []);
|
||||||
|
}
|
||||||
$query->field('id, id as value, name as label, parent_id');
|
$query->field('id, id as value, name as label, parent_id');
|
||||||
$query->order('sort', 'desc');
|
$query->order('sort', 'desc');
|
||||||
$data = $this->getAll($query);
|
$data = $this->getAll($query);
|
||||||
|
|||||||
@@ -40,7 +40,10 @@ class SystemUserLogic extends BaseLogic
|
|||||||
{
|
{
|
||||||
$query = $this->search($where);
|
$query = $this->search($where);
|
||||||
$query->with(['depts']);
|
$query->with(['depts']);
|
||||||
$query->auth($this->adminInfo['deptList']);
|
// 超级管理员(id=1)可查看全部用户,普通管理员按部门权限过滤
|
||||||
|
if (isset($this->adminInfo['id']) && $this->adminInfo['id'] > 1) {
|
||||||
|
$query->auth($this->adminInfo['deptList'] ?? []);
|
||||||
|
}
|
||||||
return $this->getList($query);
|
return $this->getList($query);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,9 +135,11 @@ class SystemUserLogic extends BaseLogic
|
|||||||
return $this->transaction(function () use ($data, $id) {
|
return $this->transaction(function () use ($data, $id) {
|
||||||
$role_ids = $data['role_ids'] ?? [];
|
$role_ids = $data['role_ids'] ?? [];
|
||||||
$post_ids = $data['post_ids'] ?? [];
|
$post_ids = $data['post_ids'] ?? [];
|
||||||
// 仅可修改当前部门和子部门的用户
|
// 超级管理员可修改任意用户,普通管理员仅可修改当前部门和子部门的用户
|
||||||
$query = $this->model->where('id', $id);
|
$query = $this->model->where('id', $id);
|
||||||
$query->auth($this->adminInfo['deptList']);
|
if (isset($this->adminInfo['id']) && $this->adminInfo['id'] > 1) {
|
||||||
|
$query->auth($this->adminInfo['deptList'] ?? []);
|
||||||
|
}
|
||||||
$user = $query->findOrEmpty();
|
$user = $query->findOrEmpty();
|
||||||
if ($user->isEmpty()) {
|
if ($user->isEmpty()) {
|
||||||
throw new ApiException('没有权限操作该数据');
|
throw new ApiException('没有权限操作该数据');
|
||||||
@@ -182,7 +187,10 @@ class SystemUserLogic extends BaseLogic
|
|||||||
throw new ApiException('超级管理员禁止删除');
|
throw new ApiException('超级管理员禁止删除');
|
||||||
}
|
}
|
||||||
$query = $this->model->where('id', $ids);
|
$query = $this->model->where('id', $ids);
|
||||||
$query->auth($this->adminInfo['deptList']);
|
// 超级管理员可删除任意用户,普通管理员仅可删除当前部门和子部门的用户
|
||||||
|
if (isset($this->adminInfo['id']) && $this->adminInfo['id'] > 1) {
|
||||||
|
$query->auth($this->adminInfo['deptList'] ?? []);
|
||||||
|
}
|
||||||
$user = $query->findOrEmpty();
|
$user = $query->findOrEmpty();
|
||||||
if ($user->isEmpty()) {
|
if ($user->isEmpty()) {
|
||||||
throw new ApiException('没有权限操作该数据');
|
throw new ApiException('没有权限操作该数据');
|
||||||
|
|||||||
@@ -42,11 +42,14 @@ class SystemDept extends BaseModel
|
|||||||
*/
|
*/
|
||||||
public function scopeAuth($query, $value)
|
public function scopeAuth($query, $value)
|
||||||
{
|
{
|
||||||
if (!empty($value)) {
|
if (!empty($value) && isset($value['id'])) {
|
||||||
$deptIds = [$value['id']];
|
$deptIds = [$value['id']];
|
||||||
$deptLevel = $value['level'] . $value['id'] . ',';
|
$level = $value['level'] ?? '';
|
||||||
$ids = static::whereLike('level', $deptLevel . '%')->column('id');
|
if ($level !== '' && $level !== null) {
|
||||||
$deptIds = array_merge($deptIds, $ids);
|
$deptLevel = $level . $value['id'] . ',';
|
||||||
|
$ids = static::whereLike('level', $deptLevel . '%')->column('id');
|
||||||
|
$deptIds = array_merge($deptIds, $ids);
|
||||||
|
}
|
||||||
$query->whereIn('id', $deptIds);
|
$query->whereIn('id', $deptIds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user