mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-10 20:53:47 +08:00
v3.0.0
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<template>
|
||||
<a-config-provider :locale="antdLocale">
|
||||
<!---全局loading--->
|
||||
<a-spin :spinning="spinning" tip="稍等片刻,我在拼命加载中..." size="large">
|
||||
<a-spin :spinning="spinning" tip="稍等片刻,我在拼命加载中..." size="large">
|
||||
<!--- 路由 -->
|
||||
<RouterView />
|
||||
</a-spin>
|
||||
@@ -21,7 +21,7 @@
|
||||
<script setup>
|
||||
import dayjs from 'dayjs';
|
||||
import { computed } from 'vue';
|
||||
import { messages } from '/@/i18n/index';
|
||||
import { messages } from '/@/i18n';
|
||||
import { useAppConfigStore } from '/@/store/modules/system/app-config';
|
||||
import { useSpinStore } from './store/modules/system/spin';
|
||||
|
||||
|
||||
@@ -27,8 +27,4 @@ export const categoryApi = {
|
||||
updateCategory: (param) => {
|
||||
return postRequest('/category/update', param);
|
||||
},
|
||||
// 查询类目详情 @author 卓大
|
||||
getCategory: (categoryId) => {
|
||||
return getRequest(`/category/${categoryId}`);
|
||||
},
|
||||
};
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
* @LastEditTime: 2022-06-23
|
||||
* @LastEditors: zhuoda
|
||||
*/
|
||||
import { postRequest, getRequest } from '/@/lib/axios';
|
||||
import {postRequest, getRequest, getDownload} from '/@/lib/axios';
|
||||
|
||||
export const goodsApi = {
|
||||
// 添加商品 @author zhuoda
|
||||
@@ -28,4 +28,14 @@ export const goodsApi = {
|
||||
updateGoods: (param) => {
|
||||
return postRequest('/goods/update', param);
|
||||
},
|
||||
|
||||
// 导入 @author 卓大
|
||||
importGoods : (file) =>{
|
||||
return postRequest('/goods/importGoods',file);
|
||||
},
|
||||
|
||||
// 导出 @author 卓大
|
||||
exportGoods : () =>{
|
||||
return getDownload('/goods/exportGoods');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -7,58 +7,63 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest, getRequest } from '/@/lib/axios';
|
||||
import {postRequest, getRequest, postDownload} from '/@/lib/axios';
|
||||
|
||||
export const enterpriseApi = {
|
||||
// 新建企业 @author 开云
|
||||
create: (param) => {
|
||||
return postRequest('/oa/enterprise/create', param);
|
||||
},
|
||||
// 新建企业 @author 开云
|
||||
create: (param) => {
|
||||
return postRequest('/oa/enterprise/create', param);
|
||||
},
|
||||
|
||||
// 删除企业 @author 开云
|
||||
delete: (enterpriseId) => {
|
||||
return getRequest(`/oa/enterprise/delete/${enterpriseId}`);
|
||||
},
|
||||
// 删除企业 @author 开云
|
||||
delete: (enterpriseId) => {
|
||||
return getRequest(`/oa/enterprise/delete/${enterpriseId}`);
|
||||
},
|
||||
|
||||
// 查询企业详情 @author 开云
|
||||
detail: (enterpriseId) => {
|
||||
return getRequest(`/oa/enterprise/get/${enterpriseId}`);
|
||||
},
|
||||
// 查询企业详情 @author 开云
|
||||
detail: (enterpriseId) => {
|
||||
return getRequest(`/oa/enterprise/get/${enterpriseId}`);
|
||||
},
|
||||
|
||||
// 分页查询企业模块 @author 开云
|
||||
pageQuery: (param) => {
|
||||
return postRequest('/oa/enterprise/page/query', param);
|
||||
},
|
||||
// 分页查询企业模块 @author 开云
|
||||
pageQuery: (param) => {
|
||||
return postRequest('/oa/enterprise/page/query', param);
|
||||
},
|
||||
|
||||
//企业列表查询 含数据范围 @author 开云
|
||||
queryList: (type) => {
|
||||
let query = '';
|
||||
if (type) {
|
||||
query = `?type=${type}`;
|
||||
}
|
||||
return getRequest(`/oa/enterprise/query/list${query}`);
|
||||
},
|
||||
// 导出企业数据excel @author 卓大
|
||||
exportExcel: (param) => {
|
||||
return postDownload('/oa/enterprise/exportExcel', param);
|
||||
},
|
||||
|
||||
// 编辑企业 @author 开云
|
||||
update: (param) => {
|
||||
return postRequest('/oa/enterprise/update', param);
|
||||
},
|
||||
// 企业全部员工List @author yandy
|
||||
employeeList: (param) => {
|
||||
return postRequest('/oa/enterprise/employee/list', param);
|
||||
},
|
||||
// 分页查询企业员工List @author 卓大
|
||||
queryPageEmployeeList: (param) => {
|
||||
return postRequest('/oa/enterprise/employee/queryPage', param);
|
||||
},
|
||||
// 添加员工 @author yandy
|
||||
addEmployee: (param) => {
|
||||
return postRequest('/oa/enterprise/employee/add', param);
|
||||
},
|
||||
//企业列表查询 含数据范围 @author 开云
|
||||
queryList: (type) => {
|
||||
let query = '';
|
||||
if (type) {
|
||||
query = `?type=${type}`;
|
||||
}
|
||||
return getRequest(`/oa/enterprise/query/list${query}`);
|
||||
},
|
||||
|
||||
// 删除员工 @author yandy
|
||||
deleteEmployee: (param) => {
|
||||
return postRequest('/oa/enterprise/employee/delete', param);
|
||||
},
|
||||
// 编辑企业 @author 开云
|
||||
update: (param) => {
|
||||
return postRequest('/oa/enterprise/update', param);
|
||||
},
|
||||
// 企业全部员工List @author yandy
|
||||
employeeList: (param) => {
|
||||
return postRequest('/oa/enterprise/employee/list', param);
|
||||
},
|
||||
// 分页查询企业员工List @author 卓大
|
||||
queryPageEmployeeList: (param) => {
|
||||
return postRequest('/oa/enterprise/employee/queryPage', param);
|
||||
},
|
||||
// 添加员工 @author yandy
|
||||
addEmployee: (param) => {
|
||||
return postRequest('/oa/enterprise/employee/add', param);
|
||||
},
|
||||
|
||||
// 删除员工 @author yandy
|
||||
deleteEmployee: (param) => {
|
||||
return postRequest('/oa/enterprise/employee/delete', param);
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* 接口:加密、解密
|
||||
*
|
||||
* @Author: 1024创新实验室-主任-卓大
|
||||
* @Date: 2023-10-17 20:02:37
|
||||
* @Copyright 1024创新实验室
|
||||
*/
|
||||
import { postRequest, postEncryptRequest } from '/src/lib/axios';
|
||||
|
||||
export const encryptApi = {
|
||||
|
||||
/**
|
||||
* 测试 请求加密 @author 1024创新实验室-主任-卓大
|
||||
*/
|
||||
testRequestEncrypt: (param) => {
|
||||
return postEncryptRequest('/support/apiEncrypt/testRequestEncrypt', param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 测试 返回加密 @author 1024创新实验室-主任-卓大
|
||||
*/
|
||||
testResponseEncrypt: (param) => {
|
||||
return postRequest('/support/apiEncrypt/testResponseEncrypt', param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 测试 请求参数加密和解密、返回数据加密和解密 @author 1024创新实验室-主任-卓大
|
||||
*/
|
||||
testDecryptAndEncrypt: (param) => {
|
||||
return postEncryptRequest('/support/apiEncrypt/testDecryptAndEncrypt', param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 测试 数组加解密 @author 1024创新实验室-主任-卓大
|
||||
*/
|
||||
testArray : (param) => {
|
||||
return postEncryptRequest('/support/apiEncrypt/testArray', param);
|
||||
},
|
||||
|
||||
};
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest, getRequest } from '/@/lib/axios';
|
||||
import {getRequest} from '/src/lib/axios';
|
||||
|
||||
export const cacheApi = {
|
||||
// 获取某个缓存的所有key @author 罗伊
|
||||
@@ -5,41 +5,41 @@
|
||||
* @Date: 2022-09-26 14:53:50
|
||||
* @Copyright 1024创新实验室
|
||||
*/
|
||||
import { postRequest, getRequest } from '/@/lib/axios';
|
||||
import { postRequest, getRequest } from '/src/lib/axios';
|
||||
|
||||
export const changeLogApi = {
|
||||
/**
|
||||
* 分页查询 @author 卓大
|
||||
*/
|
||||
queryPage : (param) => {
|
||||
return postRequest('/changeLog/queryPage', param);
|
||||
queryPage: (param) => {
|
||||
return postRequest('/support/changeLog/queryPage', param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 增加 @author 卓大
|
||||
*/
|
||||
add: (param) => {
|
||||
return postRequest('/changeLog/add', param);
|
||||
return postRequest('/support/changeLog/add', param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改 @author 卓大
|
||||
*/
|
||||
update: (param) => {
|
||||
return postRequest('/changeLog/update', param);
|
||||
return postRequest('/support/changeLog/update', param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除 @author 卓大
|
||||
*/
|
||||
delete: (id) => {
|
||||
return getRequest(`/changeLog/delete/${id}`);
|
||||
return getRequest(`/support/changeLog/delete/${id}`);
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量删除 @author 卓大
|
||||
*/
|
||||
batchDelete: (idList) => {
|
||||
return postRequest('/changeLog/batchDelete', idList);
|
||||
return postRequest('/support/changeLog/batchDelete', idList);
|
||||
},
|
||||
};
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { getRequest, postRequest,download } from '/@/lib/axios';
|
||||
import { getRequest, postRequest,getDownload } from '/src/lib/axios';
|
||||
|
||||
export const codeGeneratorApi = {
|
||||
// 查询数据库的表 @author 卓大
|
||||
@@ -41,6 +41,6 @@ export const codeGeneratorApi = {
|
||||
|
||||
// 下载代码 @author 卓大
|
||||
downloadCode: (tableName) => {
|
||||
return download(`${tableName}.zip`,`/support/codeGenerator/code/download/${tableName}`);
|
||||
return getDownload(`${tableName}.zip`,`/support/codeGenerator/code/download/${tableName}`);
|
||||
},
|
||||
};
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest, getRequest } from '/@/lib/axios';
|
||||
import { postRequest, getRequest } from '/src/lib/axios';
|
||||
|
||||
export const configApi = {
|
||||
// 分页查询 @author 卓大
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest } from '/@/lib/axios';
|
||||
import { postRequest } from '/src/lib/axios';
|
||||
|
||||
export const dataTracerApi = {
|
||||
// 分页查询业务操作日志 - @author 卓大
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest, getRequest } from '/@/lib/axios';
|
||||
import { postRequest, getRequest } from '/src/lib/axios';
|
||||
|
||||
export const dictApi = {
|
||||
// 分页查询数据字典KEY - @author 卓大
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest } from '/@/lib/axios';
|
||||
import { postRequest } from '/src/lib/axios';
|
||||
|
||||
export const feedbackApi = {
|
||||
// 意见反馈-新增
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest, getRequest, download } from '/@/lib/axios';
|
||||
import { postRequest, getRequest, getDownload } from '/src/lib/axios';
|
||||
|
||||
export const fileApi = {
|
||||
// 文件上传 @author 卓大
|
||||
@@ -33,6 +33,6 @@ export const fileApi = {
|
||||
* 下载文件流(根据fileKey) @author 胡克
|
||||
*/
|
||||
downLoadFile: (fileName, fileKey) => {
|
||||
return download(fileName, '/support/file/downLoad', { fileKey });
|
||||
return getDownload(fileName, '/support/file/downLoad', { fileKey });
|
||||
},
|
||||
};
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest } from '/@/lib/axios';
|
||||
import { postRequest } from '/src/lib/axios';
|
||||
|
||||
export const heartBeatApi = {
|
||||
// 分页查询 @author 卓大
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest, getRequest } from '/@/lib/axios';
|
||||
import { postRequest, getRequest } from '/src/lib/axios';
|
||||
|
||||
export const helpDocApi = {
|
||||
// 【管理】帮助文档-分页查询 @author zhuoda
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest, getRequest } from '/@/lib/axios';
|
||||
import { postRequest, getRequest } from '/src/lib/axios';
|
||||
|
||||
export const helpDocCatalogApi = {
|
||||
//帮助文档目录-获取全部 @author zhuoda
|
||||
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* 登录锁定 api 封装
|
||||
*
|
||||
* @Author: 1024创新实验室-主任-卓大
|
||||
* @Date: 2023-10-17 18:02:37
|
||||
* @Copyright 1024创新实验室
|
||||
*/
|
||||
import { postRequest, getRequest } from '/src/lib/axios';
|
||||
|
||||
export const loginFailApi = {
|
||||
|
||||
/**
|
||||
* 分页查询 @author 1024创新实验室-主任-卓大
|
||||
*/
|
||||
queryPage : (param) => {
|
||||
return postRequest('/support/protect/loginFail/queryPage', param);
|
||||
},
|
||||
|
||||
/**
|
||||
* 批量删除 @author 1024创新实验室-主任-卓大
|
||||
*/
|
||||
batchDelete: (idList) => {
|
||||
return postRequest('/support/protect/loginFail/batchDelete', idList);
|
||||
},
|
||||
|
||||
};
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest, getRequest } from '/@/lib/axios';
|
||||
import { postRequest, getRequest } from '/src/lib/axios';
|
||||
|
||||
export const loginLogApi = {
|
||||
// 分页查询 @author 卓大
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest, getRequest } from '/@/lib/axios';
|
||||
import { postRequest, getRequest } from '/src/lib/axios';
|
||||
|
||||
export const operateLogApi = {
|
||||
// 分页查询 @author 卓大
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest, getRequest } from '/@/lib/axios';
|
||||
import { postRequest, getRequest } from '/src/lib/axios';
|
||||
|
||||
export const reloadApi = {
|
||||
// 查询reload列表 @author 卓大
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { postRequest, getRequest } from '/@/lib/axios';
|
||||
import { postRequest, getRequest } from '/src/lib/axios';
|
||||
|
||||
export const serialNumberApi = {
|
||||
// 生成单号 @author 卓大
|
||||
@@ -6,7 +6,7 @@
|
||||
* @LastEditors: zhuoda
|
||||
* @LastEditTime: 2022-08-21
|
||||
*/
|
||||
import { postRequest, getRequest } from '/@/lib/axios';
|
||||
import { postRequest, getRequest } from '/src/lib/axios';
|
||||
|
||||
export const tableColumnApi = {
|
||||
// 修改表格列 @author zhuoda
|
||||
@@ -7,47 +7,37 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { getRequest, postRequest } from '/@/lib/axios';
|
||||
import { getRequest, postRequest } from '/src/lib/axios';
|
||||
|
||||
export const departmentApi = {
|
||||
/**
|
||||
* @description: 查询部门列表 @author 卓大
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* 查询部门列表 @author 卓大
|
||||
*/
|
||||
queryAllDepartment: () => {
|
||||
return getRequest('/department/listAll');
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: 查询部门树形列表 @author 卓大
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* 查询部门树形列表 @author 卓大
|
||||
*/
|
||||
queryDepartmentTree: () => {
|
||||
queryDepartmentTree: () => {
|
||||
return getRequest('/department/treeList');
|
||||
},
|
||||
|
||||
/**
|
||||
* @description: 添加部门 @author 卓大
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* 添加部门 @author 卓大
|
||||
*/
|
||||
addDepartment: (param) => {
|
||||
return postRequest('/department/add', param);
|
||||
},
|
||||
/**
|
||||
* @description: 更新部门信息 @author 卓大
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* 更新部门信息 @author 卓大
|
||||
*/
|
||||
updateDepartment: (param) => {
|
||||
return postRequest('/department/update', param);
|
||||
},
|
||||
/**
|
||||
* @description: 获取校区列表 @author 卓大
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* 删除
|
||||
*/
|
||||
deleteDepartment: (departmentId) => {
|
||||
return getRequest(`/department/delete/${departmentId}`);
|
||||
@@ -8,90 +8,73 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
|
||||
import { getRequest, postRequest } from '/@/lib/axios';
|
||||
import { getRequest, postRequest } from '/src/lib/axios';
|
||||
|
||||
export const employeeApi = {
|
||||
/**
|
||||
* @description: 查询所有员工 @author 卓大
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* 查询所有员工 @author 卓大
|
||||
*/
|
||||
queryAll: () => {
|
||||
return getRequest('/employee/queryAll');
|
||||
},
|
||||
/**
|
||||
* @description: 员工管理查询
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
* 员工管理查询
|
||||
*/
|
||||
queryEmployee: (params) => {
|
||||
return postRequest('/employee/query', params);
|
||||
},
|
||||
/**
|
||||
* @description: 添加员工
|
||||
* @param {EmployeeAddDto} params
|
||||
* @return {*}
|
||||
* 添加员工
|
||||
*/
|
||||
addEmployee: (params) => {
|
||||
return postRequest('/employee/add', params);
|
||||
},
|
||||
/**
|
||||
* @description: 更新员工信息
|
||||
* @param {EmployeeUpdateDto} params
|
||||
* @return {*}
|
||||
* 更新员工信息
|
||||
*/
|
||||
updateEmployee: (params) => {
|
||||
return postRequest('/employee/update', params);
|
||||
},
|
||||
/**
|
||||
* @description: 删除员工
|
||||
* @param {number} employeeId
|
||||
* @return {*}
|
||||
* 删除员工
|
||||
*/
|
||||
deleteEmployee: (employeeId) => {
|
||||
return getRequest(`/employee/delete/${employeeId}`);
|
||||
},
|
||||
/**
|
||||
* @description: 批量删除员工
|
||||
* @param {number} employeeIdList
|
||||
* @return {*}
|
||||
* 批量删除员工
|
||||
*/
|
||||
batchDeleteEmployee: (employeeIdList) => {
|
||||
return postRequest('/employee/update/batch/delete', employeeIdList);
|
||||
},
|
||||
/**
|
||||
* @description: 批量调整员工部门
|
||||
* @return {*}
|
||||
* 批量调整员工部门
|
||||
*/
|
||||
batchUpdateDepartmentEmployee: (updateParam) => {
|
||||
return postRequest('/employee/update/batch/department', updateParam);
|
||||
},
|
||||
/**
|
||||
* @description: 重置员工密码
|
||||
* @param {number} employeeId
|
||||
* @return {*}
|
||||
* 重置员工密码
|
||||
*/
|
||||
resetPassword: (employeeId) => {
|
||||
return getRequest(`/employee/update/password/reset/${employeeId}`);
|
||||
},
|
||||
/**
|
||||
* @description: 修改面面
|
||||
* @param {number} employeeId
|
||||
* @return {*}
|
||||
* 修改面面
|
||||
*/
|
||||
updateEmployeePassword: (param) => {
|
||||
return postRequest('/employee/update/password',param);
|
||||
return postRequest('/employee/update/password', param);
|
||||
},
|
||||
/**
|
||||
* @description: 更新员工禁用状态
|
||||
* @param {number} employeeId
|
||||
* @return {*}
|
||||
* 更新员工禁用状态
|
||||
*/
|
||||
updateDisabled: (employeeId) => {
|
||||
return getRequest(`/employee/update/disabled/${employeeId}`);
|
||||
},
|
||||
|
||||
// 查询员工-根据部门id
|
||||
/**
|
||||
* 查询员工-根据部门id
|
||||
*/
|
||||
queryEmployeeByDeptId: (departmentId) => {
|
||||
return getRequest(`/employee/query/dept/${departmentId}`);
|
||||
},
|
||||
@@ -7,21 +7,17 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { getRequest } from '/@/lib/axios';
|
||||
import { getRequest } from '/src/lib/axios';
|
||||
|
||||
export const homeApi = {
|
||||
/**
|
||||
* @description: 首页-金额统计(业绩、收款、订单数等) @author 卓大
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
homeAmountStatistics: () => {
|
||||
return getRequest('/home/amount/statistics');
|
||||
},
|
||||
/**
|
||||
* @description: 首页-待办信息 @author 卓大
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
homeWaitHandle: () => {
|
||||
return getRequest('home/wait/handle');
|
||||
@@ -7,12 +7,11 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { getRequest, postRequest } from '/@/lib/axios';
|
||||
import { getRequest, postRequest } from '/src/lib/axios';
|
||||
|
||||
export const loginApi = {
|
||||
/**
|
||||
* 登录 @author 卓大
|
||||
* @param param
|
||||
*/
|
||||
login: (param) => {
|
||||
return postRequest('/login', param);
|
||||
@@ -20,7 +19,6 @@ export const loginApi = {
|
||||
|
||||
/**
|
||||
* 退出登录 @author 卓大
|
||||
* @param param
|
||||
*/
|
||||
logout: () => {
|
||||
return getRequest('/login/logout');
|
||||
@@ -28,7 +26,6 @@ export const loginApi = {
|
||||
|
||||
/**
|
||||
* 获取验证码 @author 卓大
|
||||
* @param param
|
||||
*/
|
||||
getCaptcha: () => {
|
||||
return getRequest('/login/getCaptcha');
|
||||
@@ -36,16 +33,8 @@ export const loginApi = {
|
||||
|
||||
/**
|
||||
* 获取登录信息 @author 卓大
|
||||
* @param param
|
||||
*/
|
||||
getLoginInfo: () => {
|
||||
return getRequest('/login/getLoginInfo');
|
||||
},
|
||||
|
||||
/**
|
||||
* 刷新用户信息(包含用户基础信息、权限信息等等) @author 卓大
|
||||
*/
|
||||
refresh: () => {
|
||||
return getRequest('/login/refresh');
|
||||
},
|
||||
};
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { getRequest, postRequest } from '/@/lib/axios';
|
||||
import { getRequest, postRequest } from '/src/lib/axios';
|
||||
|
||||
export const menuApi = {
|
||||
/**
|
||||
@@ -7,102 +7,77 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { getRequest, postRequest } from '/@/lib/axios';
|
||||
import { getRequest, postRequest } from '/src/lib/axios';
|
||||
|
||||
export const roleApi = {
|
||||
/**
|
||||
* @description: 获取所有角色
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
queryAll: () => {
|
||||
return getRequest('/role/getAll');
|
||||
},
|
||||
/**
|
||||
* @description:添加角色
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
addRole: (data) => {
|
||||
return postRequest('/role/add', data);
|
||||
},
|
||||
/**
|
||||
* @description:更新角色
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
updateRole: (data) => {
|
||||
return postRequest('/role/update', data);
|
||||
},
|
||||
/**
|
||||
* @description: 删除角色
|
||||
* @param {number} roleId
|
||||
* @return {*}
|
||||
*/
|
||||
deleteRole: (roleId) => {
|
||||
return getRequest(`/role/delete/${roleId}`);
|
||||
},
|
||||
/**
|
||||
* @description: 批量设置某角色数据范围
|
||||
* @param {DataScopeBatchSetRoleDto} data
|
||||
* @return {*}
|
||||
*/
|
||||
updateDataScope: (data) => {
|
||||
return postRequest('/role/dataScope/updateRoleDataScopeList', data);
|
||||
},
|
||||
/**
|
||||
* @description: 获取当前系统所配置的所有数据范围
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
getDataScopeList: () => {
|
||||
return getRequest('/dataScope/list');
|
||||
},
|
||||
/**
|
||||
* @description: 获取某角色所设置的数据范围
|
||||
* @param {number} roleId
|
||||
* @return {*}
|
||||
*/
|
||||
getDataScopeByRoleId: (roleId) => {
|
||||
return getRequest(`/role/dataScope/getRoleDataScopeList/${roleId}`);
|
||||
},
|
||||
/**
|
||||
* @description: 获取角色成员-员工列表
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
queryRoleEmployee: (params) => {
|
||||
return postRequest('/role/employee/queryEmployee', params);
|
||||
},
|
||||
/**
|
||||
* @description: 从角色成员列表中移除员工
|
||||
* @param {number} employeeId
|
||||
* @param {number} roleId
|
||||
* @return {*}
|
||||
*/
|
||||
deleteEmployeeRole: (employeeId, roleId) => {
|
||||
return getRequest('/role/employee/removeEmployee?employeeId=' + employeeId + '&roleId=' + roleId);
|
||||
},
|
||||
/**
|
||||
* @description: 从角色成员列表中批量移除员工
|
||||
* @param {RoleEmployeeBatchDto} data
|
||||
* @return {*}
|
||||
*/
|
||||
batchRemoveRoleEmployee: (data) => {
|
||||
return postRequest('/role/employee/batchRemoveRoleEmployee', data);
|
||||
},
|
||||
/**
|
||||
* @description: 根据角色id获取角色员工列表(无分页)
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
getRoleAllEmployee: (roleId) => {
|
||||
return getRequest(`/role/employee/getAllEmployeeByRoleId/${roleId}`);
|
||||
},
|
||||
/**
|
||||
* @description: 角色成员列表中批量添加员工
|
||||
* @param data
|
||||
* @return {*}
|
||||
*/
|
||||
batchAddRoleEmployee: (data) => {
|
||||
return postRequest('/role/employee/batchAddRoleEmployee', data);
|
||||
@@ -7,20 +7,16 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { getRequest, postRequest } from '/@/lib/axios';
|
||||
import { getRequest, postRequest } from '/src/lib/axios';
|
||||
export const roleMenuApi = {
|
||||
/**
|
||||
* @description: 获取角色关联菜单权限
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
getRoleSelectedMenu: (roleId) => {
|
||||
return getRequest(`role/menu/getRoleSelectedMenu/${roleId}`);
|
||||
},
|
||||
/**
|
||||
* @description: 更新角色权限
|
||||
* @param {*}
|
||||
* @return {*}
|
||||
*/
|
||||
updateRoleMenu: (data) => {
|
||||
return postRequest('role/menu/updateRoleMenu', data);
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 382 KiB |
@@ -22,14 +22,13 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { PROVINCE_CITY_DISTRICT } from "./province-city-district";
|
||||
import { PROVINCE_CITY } from "./province-city";
|
||||
import { ref, toRaw, watch } from "vue";
|
||||
import { PROVINCE_CITY_DISTRICT } from './province-city-district';
|
||||
import { PROVINCE_CITY } from './province-city';
|
||||
import { ref, toRaw, watch } from 'vue';
|
||||
|
||||
// ============ 组件属性 ============
|
||||
|
||||
const TYPE_PROVINCE_CITY_DISTRICT = "province_city_district";
|
||||
const TYPE_PROVINCE_CITY = "province_city";
|
||||
const TYPE_PROVINCE_CITY_DISTRICT = 'province_city_district';
|
||||
|
||||
const props = defineProps({
|
||||
type: String,
|
||||
@@ -55,22 +54,21 @@
|
||||
const emit = defineEmits(['update:value', 'change']);
|
||||
|
||||
// ============ 组件业务 ============
|
||||
const areaOptionData =
|
||||
props.type === TYPE_PROVINCE_CITY_DISTRICT ? PROVINCE_CITY_DISTRICT : PROVINCE_CITY;
|
||||
const areaOptionData = props.type === TYPE_PROVINCE_CITY_DISTRICT ? PROVINCE_CITY_DISTRICT : PROVINCE_CITY;
|
||||
|
||||
// 绑定地区数据
|
||||
const areaValue = ref([]);
|
||||
// 监听value变化
|
||||
watch(
|
||||
() => props.value,
|
||||
(newValue) => {
|
||||
if (newValue) {
|
||||
let array = [];
|
||||
for (let index = 0; index < 3; index++) {
|
||||
if (newValue[index]) {
|
||||
array.push(newValue[index].value);
|
||||
}
|
||||
() => props.value,
|
||||
(newValue) => {
|
||||
if (newValue) {
|
||||
let array = [];
|
||||
for (let index = 0; index < 3; index++) {
|
||||
if (newValue[index]) {
|
||||
array.push(newValue[index].value);
|
||||
}
|
||||
}
|
||||
areaValue.value = array;
|
||||
} else {
|
||||
areaValue.value = [];
|
||||
@@ -78,14 +76,12 @@
|
||||
}
|
||||
);
|
||||
|
||||
function handleChange(value, selectedOptions){
|
||||
emit("update:value", toRaw(selectedOptions));
|
||||
emit("change", value, toRaw(selectedOptions));
|
||||
function handleChange(value, selectedOptions) {
|
||||
emit('update:value', toRaw(selectedOptions));
|
||||
emit('change', value, toRaw(selectedOptions));
|
||||
}
|
||||
|
||||
const filter = (inputValue, path) => {
|
||||
return path.some(
|
||||
(option) => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1
|
||||
);
|
||||
return path.some((option) => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
console.log('boolean enum select', value);
|
||||
let booleanResult = null;
|
||||
if (!_.isUndefined(value)) {
|
||||
booleanResult = value === 1 ? true : false;
|
||||
booleanResult = value === 1;
|
||||
}
|
||||
emit('update:value', booleanResult);
|
||||
emit('change', booleanResult);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<a-popover v-model:visible="visible" placement="bottomLeft" trigger="click">
|
||||
<a-popover v-model:open="visible" placement="bottomLeft" trigger="click">
|
||||
<template #title>
|
||||
<a-form-item>
|
||||
<a-radio-group @change="updateSelectIconArray" v-model:value="iconStyle" style="margin: 8px">
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<script setup>
|
||||
import { shallowRef, onBeforeUnmount, watch, ref } from 'vue';
|
||||
import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const';
|
||||
import { fileApi } from '/@/api/support/file/file-api';
|
||||
import { fileApi } from '/src/api/support/file-api';
|
||||
import '@wangeditor/editor/dist/css/style.css';
|
||||
import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
<!--
|
||||
* 数据变更记录,以table形式显示
|
||||
*
|
||||
* @Author: 1024创新实验室-主任:卓大
|
||||
* @Date: 2022-08-12 21:01:52
|
||||
* @Wechat: zhuda1024
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-table size="small" :dataSource="tableData" :columns="columns" rowKey="dataTracerId" :pagination="false" bordered>
|
||||
<template #bodyCell="{ record, index, column }">
|
||||
<template v-if="column.dataIndex === 'dataTracerId'">
|
||||
<div>{{ index + 1 }}</div>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'userName'">
|
||||
<div>{{ record.userName }} ({{ $smartEnumPlugin.getDescByValue('USER_TYPE_ENUM', record.userType) }})</div>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'userAgent'">
|
||||
<div>{{ record.browser }} / {{ record.os }} / {{ record.device }}</div>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'content'">
|
||||
<div class="operate-content" v-html="record.content"></div>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'action'">
|
||||
<a-button v-if="record.diffOld || record.diffNew" @click="showDetail(record)" type="link">详情 </a-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</template>
|
||||
<script setup>
|
||||
import { reactive } from 'vue';
|
||||
|
||||
const props = defineProps({
|
||||
tableData: {
|
||||
type: Array,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['showDetail']);
|
||||
function showDetail(record) {
|
||||
emit('showDetail', record);
|
||||
}
|
||||
|
||||
const columns = reactive([
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'dataTracerId',
|
||||
width: 50,
|
||||
},
|
||||
{
|
||||
title: '操作时间',
|
||||
dataIndex: 'createTime',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '操作人',
|
||||
dataIndex: 'userName',
|
||||
width: 100,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: 'IP',
|
||||
dataIndex: 'ip',
|
||||
ellipsis: true,
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: 'IP地区',
|
||||
dataIndex: 'ipRegion',
|
||||
ellipsis: true,
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '客户端',
|
||||
dataIndex: 'userAgent',
|
||||
ellipsis: true,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '操作内容',
|
||||
dataIndex: 'content',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
fixed: 'right',
|
||||
width: 80,
|
||||
},
|
||||
]);
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.operate-content {
|
||||
font-size: 14px;
|
||||
display: inline;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,50 @@
|
||||
<!--
|
||||
* 数据变更记录,以 timeline 形式显示
|
||||
*
|
||||
* @Author: 1024创新实验室-主任:卓大
|
||||
* @Date: 2022-08-12 21:01:52
|
||||
* @Wechat: zhuda1024
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-timeline>
|
||||
<a-timeline-item v-for="record in tableData" :key="record.dataTracerId">
|
||||
<div class="trace-div">
|
||||
<div>
|
||||
<!-- <div class="operate-content" >{{ record.content }}</div> -->
|
||||
<div class="operate-content" v-html="record.content"></div>
|
||||
<a href="javascript:void(0)" v-if="record.diffOld || record.diffNew" @click="showDetail(record)">(查看修改)</a>
|
||||
</div>
|
||||
<div class="ip-font">
|
||||
{{ record.createTime }} | {{ record.userName }} | {{ record.ipRegion }} | {{ record.ip }} | {{ record.browser }} | {{ record.os }}
|
||||
</div>
|
||||
</div>
|
||||
</a-timeline-item>
|
||||
</a-timeline>
|
||||
</template>
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
tableData: {
|
||||
type: Array,
|
||||
},
|
||||
});
|
||||
|
||||
const emit = defineEmits(['showDetail']);
|
||||
function showDetail(record) {
|
||||
emit('showDetail', record);
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.operate-content {
|
||||
font-size: 14px;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
.ip-font {
|
||||
margin-top: 5px;
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
@@ -35,42 +35,26 @@
|
||||
</a-form>
|
||||
|
||||
<a-card size="small" :bordered="false">
|
||||
<a-table size="small" :dataSource="tableData" :columns="columns" rowKey="dataTracerId" :pagination="false" bordered>
|
||||
<template #bodyCell="{ record, index, column }">
|
||||
<template v-if="column.dataIndex === 'dataTracerId'">
|
||||
<div>{{ index + 1 }}</div>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'userName'">
|
||||
<div>{{record.userName}} ({{ $smartEnumPlugin.getDescByValue('USER_TYPE_ENUM', record.userType) }})</div>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'userAgent'">
|
||||
<div>{{ record.browser }} / {{ record.os }} / {{ record.device }}</div>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'content'">
|
||||
<div class="operate-content" v-html="record.content"></div>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'action'">
|
||||
<a-button v-if="record.diffOld || record.diffNew" @click="showDetail(record)" type="link">详情 </a-button>
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<!---以表格形式 显示-->
|
||||
<!-- <DataTracerTable :tableData="tableData" @showDetail="showDetail" /> -->
|
||||
|
||||
<div class="smart-query-table-page">
|
||||
<a-pagination
|
||||
showSizeChanger
|
||||
showQuickJumper
|
||||
show-less-items
|
||||
:pageSizeOptions="PAGE_SIZE_OPTIONS"
|
||||
:defaultPageSize="queryForm.pageSize"
|
||||
v-model:current="queryForm.pageNum"
|
||||
v-model:pageSize="queryForm.pageSize"
|
||||
:total="total"
|
||||
@change="onSearch"
|
||||
@showSizeChange="onSearch"
|
||||
:show-total="(total) => `共${total}条`"
|
||||
/>
|
||||
</div>
|
||||
<a-modal v-model:visible="visibleDiff" width="90%" title="数据比对" :footer="null">
|
||||
<!---以 timeline 时间轴形式 显示-->
|
||||
<DataTracerTimeline :tableData="tableData" @showDetail="showDetail" />
|
||||
|
||||
<a-pagination
|
||||
showSizeChanger
|
||||
showQuickJumper
|
||||
show-less-items
|
||||
:pageSizeOptions="PAGE_SIZE_OPTIONS"
|
||||
:defaultPageSize="queryForm.pageSize"
|
||||
v-model:current="queryForm.pageNum"
|
||||
v-model:pageSize="queryForm.pageSize"
|
||||
:total="total"
|
||||
@change="ajaxQuery"
|
||||
@showSizeChange="ajaxQuery"
|
||||
:show-total="(total) => `共${total}条`"
|
||||
/>
|
||||
<a-modal v-model:open="visibleDiff" width="90%" title="数据比对" :footer="null">
|
||||
<div v-html="prettyHtml"></div>
|
||||
</a-modal>
|
||||
</a-card>
|
||||
@@ -80,10 +64,11 @@
|
||||
import * as Diff2Html from 'diff2html';
|
||||
import 'diff2html/bundles/css/diff2html.min.css';
|
||||
import uaparser from 'ua-parser-js';
|
||||
import { nextTick, reactive, ref, watch } from 'vue';
|
||||
import { dataTracerApi } from '/@/api/support/data-tracer/data-tracer-api';
|
||||
import { nextTick, reactive, ref, watch } from 'vue';
|
||||
import { dataTracerApi } from '/src/api/support/data-tracer-api';
|
||||
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import DataTracerTimeline from './data-tracer-timeline.vue';
|
||||
|
||||
let props = defineProps({
|
||||
// 数据id
|
||||
@@ -96,47 +81,6 @@
|
||||
},
|
||||
});
|
||||
|
||||
const columns = reactive([
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'dataTracerId',
|
||||
width: 50,
|
||||
},
|
||||
{
|
||||
title: '操作时间',
|
||||
dataIndex: 'createTime',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '操作人',
|
||||
dataIndex: 'userName',
|
||||
width: 100,
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: 'IP',
|
||||
dataIndex: 'ip',
|
||||
ellipsis: true,
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '客户端',
|
||||
dataIndex: 'userAgent',
|
||||
ellipsis: true,
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '操作内容',
|
||||
dataIndex: 'content',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
fixed: 'right',
|
||||
width: 80,
|
||||
},
|
||||
]);
|
||||
|
||||
// --------------- 查询表单、查询方法 ---------------
|
||||
|
||||
const queryFormState = {
|
||||
@@ -155,7 +99,12 @@
|
||||
onSearch();
|
||||
}
|
||||
|
||||
async function onSearch() {
|
||||
function onSearch() {
|
||||
queryForm.pageNum = 1;
|
||||
ajaxQuery();
|
||||
}
|
||||
|
||||
async function ajaxQuery() {
|
||||
try {
|
||||
tableLoading.value = true;
|
||||
let responseModel = await dataTracerApi.queryList(Object.assign({}, queryForm, { dataId: props.dataId, type: props.type }));
|
||||
@@ -163,6 +112,7 @@
|
||||
if (!e.userAgent) {
|
||||
continue;
|
||||
}
|
||||
// e.content = e.content.replaceAll('<br/>',';');
|
||||
let ua = uaparser(e.userAgent);
|
||||
e.browser = ua.browser.name;
|
||||
e.os = ua.os.name;
|
||||
@@ -190,17 +140,14 @@
|
||||
{ immediate: true }
|
||||
);
|
||||
|
||||
|
||||
// --------------- diff 特效 ---------------
|
||||
// diff
|
||||
const visibleDiff = ref(false);
|
||||
let prettyHtml = ref('');
|
||||
function showDetail(record) {
|
||||
visibleDiff.value = true;
|
||||
let diffOld = record.diffOld.replaceAll('<br/>','\r\n');
|
||||
let diffNew = record.diffNew.replaceAll('<br/>','\r\n');
|
||||
console.log(diffOld)
|
||||
console.log(diffNew)
|
||||
let diffOld = record.diffOld.replaceAll('<br/>', '\r\n');
|
||||
let diffNew = record.diffNew.replaceAll('<br/>', '\r\n');
|
||||
const args = ['', diffOld, diffNew, '变更前', '变更后'];
|
||||
|
||||
let diffPatch = Diff.createPatch(...args);
|
||||
@@ -218,12 +165,12 @@
|
||||
let left = diffDiv[0],
|
||||
right = diffDiv[1];
|
||||
left.addEventListener('scroll', function (e) {
|
||||
if (left.scrollLeft != right.scrollLeft) {
|
||||
if (left.scrollLeft !== right.scrollLeft) {
|
||||
right.scrollLeft = left.scrollLeft;
|
||||
}
|
||||
});
|
||||
right.addEventListener('scroll', function (e) {
|
||||
if (left.scrollLeft != right.scrollLeft) {
|
||||
if (left.scrollLeft !== right.scrollLeft) {
|
||||
left.scrollLeft = right.scrollLeft;
|
||||
}
|
||||
});
|
||||
@@ -231,9 +178,3 @@
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.operate-content {
|
||||
line-height: 20px;
|
||||
margin: 5px 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { dictApi } from '/@/api/support/dict/dict-api';
|
||||
import { dictApi } from '/src/api/support/dict-api';
|
||||
|
||||
const props = defineProps({
|
||||
value: [Array, String],
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { dictApi } from '/@/api/support/dict/dict-api';
|
||||
import { dictApi } from '/src/api/support/dict-api';
|
||||
|
||||
const props = defineProps({
|
||||
keyCode: String,
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { download } from '/@/lib/axios';
|
||||
import { fileApi } from '/@/api/support/file/file-api';
|
||||
import { getDownload } from '/@/lib/axios';
|
||||
import { fileApi } from '/src/api/support/file-api';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
setVisible(true);
|
||||
return;
|
||||
}
|
||||
download(fileItem.fileName, fileItem.fileUrl);
|
||||
getDownload(fileItem.fileName, fileItem.fileUrl);
|
||||
}
|
||||
|
||||
// 判断图片类型
|
||||
|
||||
@@ -9,11 +9,11 @@
|
||||
*
|
||||
-->
|
||||
<template>
|
||||
<div >
|
||||
<template v-if="type == 'text'">
|
||||
<div>
|
||||
<template v-if="type === 'text'">
|
||||
<a v-for="(item, index) in fileList" :key="index" @click="preview(item, index)">
|
||||
{{ item.fileName }}
|
||||
<span v-if="index != fileList.length - 1" v-html="separator"></span>
|
||||
<span v-if="index !== fileList.length - 1" v-html="separator"></span>
|
||||
</a>
|
||||
</template>
|
||||
<a-space>
|
||||
@@ -22,7 +22,7 @@
|
||||
v-for="(item, index) in fileList"
|
||||
:key="index"
|
||||
:src="item.fileUrl"
|
||||
:style="{ display: type == 'text' ? 'none' : '' }"
|
||||
:style="{ display: type === 'text' ? 'none' : '' }"
|
||||
:width="width"
|
||||
/>
|
||||
</a-image-preview-group>
|
||||
@@ -31,7 +31,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import { download } from '/@/lib/axios';
|
||||
import { getDownload } from '/@/lib/axios';
|
||||
|
||||
let props = defineProps({
|
||||
fileList: {
|
||||
@@ -64,7 +64,7 @@
|
||||
previewCurrent.value = index;
|
||||
visible.value = true;
|
||||
} else {
|
||||
download(file.fileName, file.fileUrl);
|
||||
getDownload(file.fileName, file.fileUrl);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,13 +22,13 @@
|
||||
@remove="handleRemove"
|
||||
>
|
||||
<div v-if="fileList.length < props.maxUploadSize">
|
||||
<template v-if="listType == 'picture-card'">
|
||||
<template v-if="listType === 'picture-card'">
|
||||
<PlusOutlined />
|
||||
<div class="ant-upload-text">
|
||||
{{ buttonText }}
|
||||
</div>
|
||||
</template>
|
||||
<template v-if="listType == 'text'">
|
||||
<template v-if="listType === 'text'">
|
||||
<a-button>
|
||||
<upload-outlined />
|
||||
{{ buttonText }}
|
||||
@@ -36,7 +36,7 @@
|
||||
</template>
|
||||
</div>
|
||||
</a-upload>
|
||||
<a-modal :footer="null" :visible="previewVisible" @cancel="handleCancel">
|
||||
<a-modal :footer="null" :open="previewVisible" @cancel="handleCancel">
|
||||
<img :src="previewUrl" alt="example" style="width: 100%" />
|
||||
</a-modal>
|
||||
</div>
|
||||
@@ -44,11 +44,11 @@
|
||||
<script setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { fileApi } from '/@/api/support/file/file-api';
|
||||
import { fileApi } from '/src/api/support/file-api';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const';
|
||||
import { download } from '/@/lib/axios';
|
||||
import { getDownload } from '/@/lib/axios';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
const props = defineProps({
|
||||
value: String,
|
||||
@@ -149,9 +149,9 @@
|
||||
function handleChange(info) {
|
||||
let fileStatus = info.file.status;
|
||||
let file = info.file;
|
||||
if (fileStatus == 'removed') {
|
||||
let index = fileList.value.findIndex((e) => e.fileId == file.fileId);
|
||||
if (index != -1) {
|
||||
if (fileStatus === 'removed') {
|
||||
let index = fileList.value.findIndex((e) => e.fileId === file.fileId);
|
||||
if (index !== -1) {
|
||||
fileList.value.splice(index, 1);
|
||||
emit('change', fileList.value);
|
||||
}
|
||||
@@ -179,7 +179,7 @@
|
||||
previewUrl.value = file.url || file.preview;
|
||||
previewVisible.value = true;
|
||||
} else {
|
||||
download(file.fileName, file.fileUrl);
|
||||
getDownload(file.fileName, file.fileUrl);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
|
||||
<script setup>
|
||||
import _ from 'lodash';
|
||||
import { tableColumnApi } from '/@/api/support/table/table-column-api';
|
||||
import { tableColumnApi } from '/src/api/support/table-column-api';
|
||||
import { onMounted, reactive, ref, watch } from 'vue';
|
||||
import SmartTableColumnModal from './smart-table-column-modal.vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*
|
||||
-->
|
||||
<template>
|
||||
<a-modal :width="700" :visible="visible" title="设置列" :destroyOnClose="true" :closable="false">
|
||||
<a-modal :width="700" :open="visible" title="设置列" :destroyOnClose="true" :closable="false">
|
||||
<a-alert type="info" show-icon class="smart-margin-bottom10">
|
||||
<template #icon><smile-outlined /></template>
|
||||
<template #message> 可以通过拖拽行直接修改顺序哦;( <pushpin-outlined />为固定列,不可拖拽 )</template>
|
||||
@@ -54,8 +54,8 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { tableColumnApi } from '/@/api/support/table/table-column-api';
|
||||
import { ref, reactive, nextTick, computed } from 'vue';
|
||||
import { tableColumnApi } from '/src/api/support/table-column-api';
|
||||
import { nextTick, ref } from 'vue';
|
||||
import _ from 'lodash';
|
||||
import Sortable from 'sortablejs';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
@@ -107,7 +107,6 @@
|
||||
for (const item of tableData.value) {
|
||||
if (item.showFlag) {
|
||||
selectedRowKeyList.value.push(item.columnKey);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +147,7 @@
|
||||
chosenClass: 'smart-ghost-class', //设置选中样式类名
|
||||
handle: '.handle',
|
||||
onEnd({ newIndex, oldIndex }) {
|
||||
if (newIndex == oldIndex) {
|
||||
if (newIndex === oldIndex) {
|
||||
return;
|
||||
}
|
||||
moveTableData(oldIndex, newIndex);
|
||||
@@ -240,7 +239,7 @@
|
||||
if (item.width) {
|
||||
column.width = item.width;
|
||||
}
|
||||
column.showFlag = selectedRowKeyList.value.indexOf(item.columnKey) > -1 ? true : false;
|
||||
column.showFlag = selectedRowKeyList.value.indexOf(item.columnKey) > -1;
|
||||
columnList.push(column);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import _ from 'lodash';
|
||||
import { departmentApi } from '/@/api/system/department/department-api';
|
||||
import { departmentApi } from '/src/api/system/department-api';
|
||||
|
||||
const props = defineProps({
|
||||
// 绑定值
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { employeeApi } from '/@/api/system/employee/employee-api';
|
||||
import { employeeApi } from '/src/api/system/employee-api';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
// =========== 属性定义 和 事件方法暴露 =============
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-modal v-model:visible="visible" :width="900" title="选择人员" @cancel="closeModal" @ok="onSelectEmployee">
|
||||
<a-modal v-model:open="visible" :width="900" title="选择人员" @cancel="closeModal" @ok="onSelectEmployee">
|
||||
<a-form class="smart-query-form">
|
||||
<a-row class="smart-query-form-row">
|
||||
<a-form-item label="关键字" class="smart-query-form-item">
|
||||
@@ -24,7 +24,7 @@
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item class="smart-query-form-item smart-margin-left10">
|
||||
<a-button type="primary" @click="queryEmployee">
|
||||
<a-button type="primary" @click="onSearch">
|
||||
<template #icon>
|
||||
<SearchOutlined />
|
||||
</template>
|
||||
@@ -80,13 +80,13 @@
|
||||
<script setup>
|
||||
import { message } from 'ant-design-vue';
|
||||
import { computed, reactive, ref } from 'vue';
|
||||
import { employeeApi } from '/@/api/system/employee/employee-api';
|
||||
import { employeeApi } from '/src/api/system/employee-api';
|
||||
import { PAGE_SIZE, PAGE_SIZE_OPTIONS } from '/@/constants/common-const';
|
||||
import DepartmentTreeSelect from '/@/components/system/department-tree-select/index.vue';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
// ----------------------- 以下是字段定义 emits props ---------------------
|
||||
const emits = defineEmits('selectData');
|
||||
const emits = defineEmits(['selectData']);
|
||||
defineExpose({
|
||||
showModal,
|
||||
});
|
||||
@@ -97,7 +97,7 @@
|
||||
async function showModal(selectEmployeeId) {
|
||||
selectedRowKeyList.value = selectEmployeeId || [];
|
||||
visible.value = true;
|
||||
queryEmployee();
|
||||
onSearch();
|
||||
}
|
||||
function closeModal() {
|
||||
Object.assign(params, defaultParams);
|
||||
@@ -124,6 +124,12 @@
|
||||
Object.assign(params, defaultParams);
|
||||
queryEmployee();
|
||||
}
|
||||
|
||||
function onSearch() {
|
||||
params.pageNum = 1;
|
||||
queryEmployee();
|
||||
}
|
||||
|
||||
async function queryEmployee() {
|
||||
tableLoading.value = true;
|
||||
try {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import _ from 'lodash';
|
||||
import { menuApi } from '/@/api/system/menu/menu-api';
|
||||
import { menuApi } from '/src/api/system/menu-api';
|
||||
import { buildMenuTableTree } from '/@/views/system/menu/menu-data-handler';
|
||||
import { MENU_TYPE_ENUM } from '/@/constants/system/menu-const';
|
||||
|
||||
|
||||
@@ -10,12 +10,14 @@
|
||||
export const appDefaultConfig = {
|
||||
// i18n 语言选择
|
||||
language: 'zh_CN',
|
||||
// 布局: side 或者 side-expand
|
||||
// 布局: side 或者 side-expand 或者 top
|
||||
layout: 'side',
|
||||
// 侧边菜单宽度 , 默认为200px
|
||||
sideMenuWidth: 200,
|
||||
// 菜单主题
|
||||
sideMenuTheme: 'dark',
|
||||
// 顶部菜单页面宽度
|
||||
pageWidth: '99%',
|
||||
// 标签页
|
||||
pageTagFlag: true,
|
||||
// 面包屑
|
||||
@@ -24,6 +26,10 @@ export const appDefaultConfig = {
|
||||
footerFlag: true,
|
||||
// 帮助文档
|
||||
helpDocFlag: true,
|
||||
// 水印
|
||||
watermarkFlag: true,
|
||||
// 网站名称
|
||||
websiteName: 'SmartAdmin 2.X',
|
||||
websiteName: 'SmartAdmin 3.X',
|
||||
// 主题颜色
|
||||
primaryColor: 'red',
|
||||
};
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
export const PAGE_SIZE = 10;
|
||||
|
||||
export const PAGE_SIZE_OPTIONS = ['10', '15', '20', '30', '40', '50', '75', '100', '150', '200', '300', '500'];
|
||||
export const PAGE_SIZE_OPTIONS = ['5', '10', '15', '20', '30', '40', '50', '75', '100', '150', '200', '300', '500'];
|
||||
|
||||
//登录页面名字
|
||||
export const PAGE_PATH_LOGIN = '/login';
|
||||
@@ -56,3 +56,15 @@ export const USER_TYPE_ENUM = {
|
||||
|
||||
};
|
||||
|
||||
export const DATA_TYPE_ENUM = {
|
||||
NORMAL: {
|
||||
value: 1,
|
||||
desc: '普通',
|
||||
},
|
||||
ENCRYPT: {
|
||||
value: 10,
|
||||
desc: '加密',
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -8,12 +8,16 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
export const LAYOUT_ENUM = {
|
||||
SIDE_EXPAND: {
|
||||
value: 'side-expand',
|
||||
desc: '展开菜单',
|
||||
},
|
||||
SIDE: {
|
||||
value: 'side',
|
||||
desc: '传统菜单',
|
||||
desc: '传统',
|
||||
},
|
||||
SIDE_EXPAND: {
|
||||
value: 'side-expand',
|
||||
desc: '展开',
|
||||
},
|
||||
TOP: {
|
||||
value: 'top',
|
||||
desc: '顶部',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -26,14 +26,10 @@ export const MENU_TYPE_ENUM = {
|
||||
* 权限类型
|
||||
*/
|
||||
export const MENU_PERMS_TYPE_ENUM = {
|
||||
SPRING_SECURITY: {
|
||||
SA_TOKEN: {
|
||||
value: 1,
|
||||
desc: 'Security模式',
|
||||
},
|
||||
URL: {
|
||||
value: 2,
|
||||
desc: 'URL模式',
|
||||
},
|
||||
desc: 'Sa-Token模式',
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import lodash from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
export function privilegeDirective(el, binding) {
|
||||
// 超级管理员
|
||||
@@ -22,7 +22,7 @@ export function privilegeDirective(el, binding) {
|
||||
return false;
|
||||
}
|
||||
// 如果有权限,删除节点
|
||||
if (!lodash.some(userPointsList,['webPerms',binding.value])) {
|
||||
if (!_.some(userPointsList, ['webPerms', binding.value])) {
|
||||
el.parentNode.removeChild(el);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import antd from 'ant-design-vue/es/locale-provider/en_US';
|
||||
import antd from 'ant-design-vue/es/locale/en_US';
|
||||
import dayjs from 'dayjs/locale/eu';
|
||||
|
||||
export default {
|
||||
@@ -17,8 +17,10 @@ export default {
|
||||
'setting.menu.layout': 'Menu Layout',
|
||||
'setting.menu.width': 'Menu Width',
|
||||
'setting.menu.theme': 'Menu Theme',
|
||||
'setting.page.width': 'Page Width',
|
||||
'setting.bread': 'Show Bread',
|
||||
'setting.pagetag': 'Show PageTag',
|
||||
'setting.footer': 'Show Footer',
|
||||
'setting.helpdoc': 'Show Helpdoc',
|
||||
'setting.watermark': 'Show Watermark',
|
||||
};
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import antd from 'ant-design-vue/es/locale-provider/zh_CN';
|
||||
import antd from 'ant-design-vue/es/locale/zh_CN';
|
||||
import dayjs from 'dayjs/locale/zh-cn';
|
||||
|
||||
export default {
|
||||
@@ -17,8 +17,10 @@ export default {
|
||||
'setting.menu.layout': '菜单布局',
|
||||
'setting.menu.width': '菜单宽度',
|
||||
'setting.menu.theme': '菜单主题',
|
||||
'setting.page.width': '页面宽度',
|
||||
'setting.bread': '面包屑',
|
||||
'setting.pagetag': '标签页',
|
||||
'setting.footer': '页脚',
|
||||
'setting.helpdoc': '帮助文档',
|
||||
'setting.watermark': '水印',
|
||||
};
|
||||
|
||||
@@ -18,9 +18,6 @@
|
||||
</div>
|
||||
<template #overlay>
|
||||
<a-menu :class="['avatar-menu']">
|
||||
<a-menu-item @click="onRefresh">
|
||||
<span>刷新权限</span>
|
||||
</a-menu-item>
|
||||
<a-menu-item @click="showUpdatePwdModal">
|
||||
<span>修改密码</span>
|
||||
</a-menu-item>
|
||||
@@ -34,7 +31,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, ref, onMounted } from 'vue';
|
||||
import { loginApi } from '/@/api/system/login/login-api';
|
||||
import { loginApi } from '/src/api/system/login-api';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import { clearAllCoolies } from '/@/utils/cookie-util';
|
||||
import { localClear } from '/@/utils/local-util';
|
||||
@@ -59,12 +56,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 刷新用户信息(包含用户基础信息、权限信息等等)
|
||||
async function onRefresh() {
|
||||
await loginApi.refresh();
|
||||
location.reload();
|
||||
}
|
||||
|
||||
// ------------------------ 修改密码 ------------------------
|
||||
const resetPasswordRef = ref();
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<a-dropdown trigger="click" v-model:visible="show">
|
||||
<a-dropdown trigger="click" v-model:open="show">
|
||||
<div @click="fetchMessage">
|
||||
<a-badge count="12">
|
||||
<div style="width: 26px; height: 26px">
|
||||
@@ -110,7 +110,6 @@
|
||||
|
||||
.dropdown-tabs {
|
||||
background-color: @base-bg-color;
|
||||
box-shadow: 0 2px 8px @shadow-color;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-modal :visible="visible" title="修改密码" ok-text="确认" cancel-text="取消" @ok="updatePwd" @cancel="cancelModal">
|
||||
<a-modal :open="visible" title="修改密码" ok-text="确认" cancel-text="取消" @ok="updatePwd" @cancel="cancelModal">
|
||||
<a-form ref="formRef" :model="form" :rules="rules" :label-col="{ span: 5 }">
|
||||
<a-form-item label="原密码" name="oldPassword">
|
||||
<a-input v-model:value.trim="form.oldPassword" type="password" placeholder="请输入原密码" />
|
||||
@@ -25,19 +25,19 @@
|
||||
<script setup>
|
||||
import { ref, reactive } from 'vue';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { employeeApi } from '/@/api/system/employee/employee-api';
|
||||
import { employeeApi } from '/src/api/system/employee-api';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
const visible = ref(false);
|
||||
const formRef = ref();
|
||||
const tips = '字母(不限大小写)+数字组合,6-15位'; //校验规则
|
||||
const reg = /(^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,15}$)/; //校验正则
|
||||
const tips = '密码长度8-20位且包含大写字母、小写字母、数字三种'; //校验规则
|
||||
const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,20}$/;
|
||||
|
||||
const rules = {
|
||||
oldPassword: [{ required: true, message: '请输入原密码' }],
|
||||
newPassword: [{ type: 'string', pattern: reg, message: '密码格式错误' }],
|
||||
confirmPwd: [{ type: 'string', pattern: reg, message: '请输入确认密码' }],
|
||||
newPassword: [{ type: 'string', pattern: reg, message: '密码格式错误' }],
|
||||
confirmPwd: [{ type: 'string', pattern: reg, message: '请输入确认密码' }],
|
||||
};
|
||||
|
||||
const formDefault = {
|
||||
@@ -75,6 +75,9 @@
|
||||
|
||||
function showModal() {
|
||||
visible.value = true;
|
||||
form.oldPassword = '';
|
||||
form.newPassword = '';
|
||||
form.confirmPwd = '';
|
||||
}
|
||||
|
||||
function cancelModal() {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
-->
|
||||
|
||||
<template>
|
||||
<a-drawer :title="$t('setting.title')" placement="right" :visible="visible" @close="close">
|
||||
<a-drawer :title="$t('setting.title')" placement="right" :open="visible" @close="close">
|
||||
<a-form layout="horizontal" :label-col="{ span: 8 }">
|
||||
<a-form-item label="语言/Language">
|
||||
<a-select v-model:value="formState.language" @change="changeLanguage" style="width: 120px">
|
||||
@@ -27,6 +27,10 @@
|
||||
<a-input-number @change="changeSideMenuWidth" v-model:value="formState.sideMenuWidth" :min="1" />
|
||||
像素(px)
|
||||
</a-form-item>
|
||||
<a-form-item :label="$t('setting.page.width')" v-if="formState.layout === LAYOUT_ENUM.TOP.value">
|
||||
<a-input @change="changePageWidth" v-model:value="formState.pageWidth" />
|
||||
像素(px)或者 百分比
|
||||
</a-form-item>
|
||||
<a-form-item :label="$t('setting.menu.theme')">
|
||||
<a-radio-group v-model:value="formState.sideMenuTheme" button-style="solid" @change="changeMenuTheme">
|
||||
<a-radio-button value="dark">Dark</a-radio-button>
|
||||
@@ -45,6 +49,9 @@
|
||||
<a-form-item :label="$t('setting.helpdoc')">
|
||||
<a-switch @change="changeHelpDocFlag" v-model:checked="formState.helpDocFlag" checked-children="显示" un-checked-children="隐藏" />
|
||||
</a-form-item>
|
||||
<a-form-item :label="$t('setting.watermark')">
|
||||
<a-switch @change="changeWatermarkFlag" v-model:checked="formState.watermarkFlag" checked-children="显示" un-checked-children="隐藏" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<div class="footer">
|
||||
<a-button style="margin-right: 8px" type="primary" @click="copy">复制配置信息</a-button>
|
||||
@@ -121,6 +128,8 @@
|
||||
language: appConfigStore.language,
|
||||
// 布局: side 或者 side-expand
|
||||
layout: appConfigStore.layout,
|
||||
// 页面宽度
|
||||
pageWidth: appConfigStore.pageWidth,
|
||||
// 侧边菜单宽度
|
||||
sideMenuWidth: appConfigStore.sideMenuWidth,
|
||||
// 菜单主题
|
||||
@@ -133,6 +142,8 @@
|
||||
footerFlag: appConfigStore.footerFlag,
|
||||
// 帮助文档
|
||||
helpDocFlag: appConfigStore.helpDocFlag,
|
||||
// 水印
|
||||
watermarkFlag: appConfigStore.watermarkFlag,
|
||||
};
|
||||
|
||||
let formState = reactive({ ...formValue });
|
||||
@@ -156,6 +167,13 @@
|
||||
sideMenuWidth: value,
|
||||
});
|
||||
}
|
||||
|
||||
function changePageWidth(e) {
|
||||
appConfigStore.$patch({
|
||||
pageWidth: e.target.value,
|
||||
});
|
||||
}
|
||||
|
||||
function changeMenuTheme(e) {
|
||||
appConfigStore.$patch({
|
||||
sideMenuTheme: e.target.value,
|
||||
@@ -185,6 +203,12 @@
|
||||
helpDocFlag: e,
|
||||
});
|
||||
}
|
||||
|
||||
function changeWatermarkFlag(e) {
|
||||
appConfigStore.$patch({
|
||||
watermarkFlag: e,
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.footer {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<a-input-search
|
||||
@click="search"
|
||||
style="margin-right: 30px; width: 250px"
|
||||
placeholder="1024创新实验室、小镇程序员"
|
||||
placeholder="搜索:六边形工程师、1024"
|
||||
enter-button="搜索"
|
||||
size="small"
|
||||
/>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-breadcrumb separator=">" style="display: inline" v-if="breadCrumbFlag">
|
||||
<a-breadcrumb separator=">" v-if="breadCrumbFlag" class="breadcrumb">
|
||||
<a-breadcrumb-item v-for="(item, index) in parentMenuList" :key="index">{{ item.title }}</a-breadcrumb-item>
|
||||
<a-breadcrumb-item>{{ currentRoute.meta.title }}</a-breadcrumb-item>
|
||||
</a-breadcrumb>
|
||||
@@ -33,3 +33,8 @@
|
||||
return menuParentIdListMap.get(currentName) || [];
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.breadcrumb{
|
||||
line-height: @page-tag-height;
|
||||
}
|
||||
</style>
|
||||
@@ -12,7 +12,7 @@
|
||||
<a-row style="border-bottom: 1px solid #eeeeee; position: relative" v-show="pageTagFlag">
|
||||
<a-dropdown :trigger="['contextmenu']">
|
||||
<div class="smart-page-tag">
|
||||
<a-tabs :tab-position="mode" v-model:activeKey="selectedKey" size="small" @tabClick="selectTab">
|
||||
<a-tabs style="width: 100%" :tab-position="mode" v-model:activeKey="selectedKey" size="small" @tabClick="selectTab" >
|
||||
<a-tab-pane v-for="item in tagNav" :key="item.menuName">
|
||||
<template #tab>
|
||||
<span>
|
||||
@@ -23,7 +23,7 @@
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</div>
|
||||
<template #overlay>
|
||||
<template #rightExtra>
|
||||
<a-menu>
|
||||
<a-menu-item @click="closeByMenu(false)">关闭其他</a-menu-item>
|
||||
<a-menu-item @click="closeByMenu(true)">关闭所有</a-menu-item>
|
||||
@@ -56,6 +56,12 @@
|
||||
import { useAppConfigStore } from '/@/store/modules/system/app-config';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
|
||||
// //样式
|
||||
// const tagOperateWidth = ref(40);
|
||||
// const tabBarStyle = {
|
||||
// width: 'calc(100% - 80px)'
|
||||
// }
|
||||
|
||||
//标签页 是否显示
|
||||
const pageTagFlag = computed(() => useAppConfigStore().$state.pageTagFlag);
|
||||
|
||||
@@ -84,7 +90,8 @@
|
||||
router.push({ name: HOME_PAGE_NAME });
|
||||
return;
|
||||
}
|
||||
router.push({ name, query: tag.menuQuery, params: { keepAlive: 1 } });
|
||||
// router.push({ name, query: Object.assign({ _keepAlive: 1 }, tag.menuQuery) });
|
||||
router.push({ name, query: tag.menuQuery });
|
||||
}
|
||||
|
||||
//通过菜单关闭
|
||||
@@ -116,7 +123,8 @@
|
||||
goQuery = leftTagNav.menuQuery;
|
||||
}
|
||||
}
|
||||
router.push({ name: goName, query: goQuery, params: { keepAlive: 1 } });
|
||||
// router.push({ name: goName, query: Object.assign({ _keepAlive: 1 }, goQuery) });
|
||||
router.push({ name: goName, query: goQuery });
|
||||
} else if (!item && closeAll) {
|
||||
// 关闭所有tag
|
||||
router.push({ name: HOME_PAGE_NAME });
|
||||
@@ -173,13 +181,6 @@
|
||||
background: #fff;
|
||||
width: calc(100% - @smart-page-tag-operate-width);
|
||||
|
||||
.smart-page-tag-tabs {
|
||||
width: calc(100% - 100px);
|
||||
height: 26px;
|
||||
background-color: red;
|
||||
margin: 2px;
|
||||
}
|
||||
|
||||
.smart-page-tag-close {
|
||||
margin-left: 5px;
|
||||
font-size: 10px;
|
||||
|
||||
@@ -9,40 +9,64 @@
|
||||
-->
|
||||
<template>
|
||||
<div class="menu-container">
|
||||
<!-- logo 第一列:一级导航 -->
|
||||
<TopMenu ref="topMenu" class="topMenu" :menuTree="menuTree" />
|
||||
<!-- 第二列:导航 -->
|
||||
<RecursionMenu v-if="showRecursionMenu" class="recursion-menu" :selectedMenu="selectedMenu" />
|
||||
<!-- 第一列:一级导航 -->
|
||||
<TopMenu ref="topMenuRef" class="top-menu" />
|
||||
<!-- 第二列:二级导航 -->
|
||||
<RecursionMenu ref="recursionMenuRef" class="recursion-menu" />
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { onMounted, ref, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import RecursionMenu from './recursion-menu.vue';
|
||||
import TopMenu from './top-menu.vue';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
|
||||
defineEmits(['update:value']);
|
||||
const menuTree = computed(() => useUserStore().getMenuTree || []);
|
||||
|
||||
const topMenu = ref();
|
||||
const selectedMenu = computed(() => {
|
||||
if (topMenu.value) {
|
||||
return topMenu.value.selectedMenu;
|
||||
}
|
||||
return {};
|
||||
const props = defineProps({
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '请选择',
|
||||
},
|
||||
});
|
||||
const showRecursionMenu = computed(() => {
|
||||
return selectedMenu.value && selectedMenu.value.children && selectedMenu.value.children.some((e) => e.visibleFlag);
|
||||
|
||||
// 选中的顶级菜单
|
||||
const topMenuRef = ref();
|
||||
// 二级菜单引用
|
||||
const recursionMenuRef = ref();
|
||||
|
||||
let currentRoute = useRoute();
|
||||
|
||||
// 根据路由更新菜单展开和选中状态
|
||||
function updateSelectKeyAndOpenKey() {
|
||||
// 第一步,根据路由 更新选中 顶级菜单
|
||||
let parentList = useUserStore().menuParentIdListMap.get(currentRoute.name) || [];
|
||||
if (parentList.length === 0) {
|
||||
topMenuRef.value.updateSelectKey(currentRoute.name);
|
||||
return;
|
||||
}
|
||||
topMenuRef.value.updateSelectKey(parentList[0].name);
|
||||
|
||||
//第二步,根据路由 更新 二级菜单的selectKey和openKey
|
||||
recursionMenuRef.value.updateSelectKeyAndOpenKey(parentList, currentRoute.name);
|
||||
}
|
||||
|
||||
onMounted(updateSelectKeyAndOpenKey);
|
||||
|
||||
//监听路由的变化,进行更新菜单展开项目
|
||||
watch(currentRoute, () => {
|
||||
updateSelectKeyAndOpenKey();
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.menu-container {
|
||||
display: flex;
|
||||
height: 100%;
|
||||
.topMenu {
|
||||
|
||||
.top-menu {
|
||||
width: 114px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.recursion-menu {
|
||||
min-width: 126px;
|
||||
flex: 1;
|
||||
|
||||
@@ -8,14 +8,14 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<div class="resursion-container">
|
||||
<div class="recursion-container" v-show="topMenu.children && topMenu.children.length > 0">
|
||||
<!-- 顶部顶级菜单名称 -->
|
||||
<div class="top-menu">
|
||||
<span class="ant-menu">{{ props.selectedMenu.menuName }}</span>
|
||||
<span class="ant-menu">{{ topMenu.menuName }}</span>
|
||||
</div>
|
||||
<!-- 次级菜单展示 -->
|
||||
<a-menu :selectedKeys="selectedKeys" :openKeys="openKeys" mode="inline">
|
||||
<template v-for="item in props.selectedMenu.children" :key="item.menuId">
|
||||
<template v-for="item in topMenu.children" :key="item.menuId">
|
||||
<template v-if="item.visibleFlag">
|
||||
<template v-if="$lodash.isEmpty(item.children)">
|
||||
<a-menu-item :key="item.menuId.toString()" @click="turnToPage(item)">
|
||||
@@ -34,59 +34,60 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import { router } from '/@/router';
|
||||
import SubMenu from './sub-menu.vue';
|
||||
import { ref } from 'vue';
|
||||
import { HOME_PAGE_NAME } from '/@/constants/system/home-const';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import SubMenu from './sub-menu.vue';
|
||||
import { router } from '/@/router';
|
||||
import _ from 'lodash';
|
||||
import menuEmitter from './side-expand-menu-mitt';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
|
||||
let props = defineProps({
|
||||
selectedMenu: Object,
|
||||
});
|
||||
// 选中的顶级菜单
|
||||
let topMenu = ref({});
|
||||
menuEmitter.on('selectTopMenu', onSelectTopMenu);
|
||||
|
||||
defineEmits('update:value');
|
||||
// 监听选中顶级菜单事件
|
||||
function onSelectTopMenu(selectedTopMenu) {
|
||||
topMenu.value = selectedTopMenu;
|
||||
if (selectedTopMenu.children && selectedTopMenu.children.length > 0) {
|
||||
openKeys.value = _.map(selectedTopMenu.children, 'menuId').map((e) => e.toString());
|
||||
} else {
|
||||
openKeys.value = [];
|
||||
}
|
||||
selectedKeys.value = [];
|
||||
}
|
||||
|
||||
//展开的菜单
|
||||
let currentRoute = useRoute();
|
||||
const selectedKeys = computed(() => {
|
||||
return [currentRoute.name];
|
||||
});
|
||||
const selectedKeys = ref([]);
|
||||
const openKeys = ref([]);
|
||||
|
||||
const parentMenuList = computed(() => {
|
||||
let currentName = currentRoute.name;
|
||||
if (!currentName || typeof currentName !== 'string') {
|
||||
return [];
|
||||
function updateSelectKeyAndOpenKey(parentList, currentSelectKey) {
|
||||
if (!parentList) {
|
||||
return;
|
||||
}
|
||||
let menuParentIdListMap = useUserStore().getMenuParentIdListMap;
|
||||
return menuParentIdListMap.get(currentName) || [];
|
||||
});
|
||||
//获取需要展开的menu key集合
|
||||
openKeys.value = _.map(parentList, 'name');
|
||||
selectedKeys.value = [currentSelectKey];
|
||||
}
|
||||
|
||||
const openKeys = computed(() => {
|
||||
// // 仅展开当前页面
|
||||
// return parentMenuList.value.map((e) => e.name);
|
||||
// 展开所有
|
||||
let children = props.selectedMenu.children;
|
||||
if (!children || _.isEmpty(children)) {
|
||||
return [];
|
||||
}
|
||||
return children.map((e) => e.menuId.toString());
|
||||
});
|
||||
// 页面跳转
|
||||
function turnToPage(route) {
|
||||
useUserStore().deleteKeepAliveIncludes(route.menuId.toString());
|
||||
router.push({ name: route.menuId.toString() });
|
||||
}
|
||||
|
||||
function goHome() {
|
||||
router.push({ name: HOME_PAGE_NAME });
|
||||
}
|
||||
|
||||
defineExpose({ updateSelectKeyAndOpenKey });
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.resursion-container {
|
||||
.recursion-container {
|
||||
height: 100%;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.top-menu {
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* 展开菜单 event bus
|
||||
*
|
||||
* @Author: 1024创新实验室-主任:卓大
|
||||
* @Date: 2022-07-12 23:32:48
|
||||
* @Wechat: zhuda1024
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import mitt from 'mitt';
|
||||
export default mitt();
|
||||
@@ -32,7 +32,7 @@
|
||||
</template>
|
||||
<script setup>
|
||||
let props = defineProps({
|
||||
menuInfo: Array,
|
||||
menuInfo: Object,
|
||||
});
|
||||
const emits = defineEmits(['turnToPage']);
|
||||
const turnToPage = (route) => {
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
<!-- 顶部logo区域 -->
|
||||
<div class="logo" @click="onGoHome">
|
||||
<img class="logo-img" :src="logoImg" />
|
||||
<div class="title">SmartAdmin 2.X</div>
|
||||
<div class="title">{{ websiteName }}</div>
|
||||
</div>
|
||||
<!-- 一级菜单展示 -->
|
||||
<a-menu :selectedKeys="selectedKeys" mode="inline" :theme="theme">
|
||||
<template v-for="item in props.menuTree" :key="item.menuId">
|
||||
<template v-for="item in menuTree" :key="item.menuId">
|
||||
<template v-if="item.visibleFlag">
|
||||
<a-menu-item :key="item.menuId.toString()" @click="onSelectMenu(item)">
|
||||
<template #icon>
|
||||
@@ -31,75 +31,52 @@
|
||||
</template>
|
||||
<script setup>
|
||||
import _ from 'lodash';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import logoImg from '/@/assets/images/logo/smart-admin-logo.png';
|
||||
import { computed, ref } from 'vue';
|
||||
import { HOME_PAGE_NAME } from '/@/constants/system/home-const';
|
||||
import { MENU_TYPE_ENUM } from '/@/constants/system/menu-const';
|
||||
import { router } from '/@/router';
|
||||
import { useAppConfigStore } from '/@/store/modules/system/app-config';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import logoImg from '/@/assets/images/logo/smart-admin-logo.png';
|
||||
import menuEmitter from './side-expand-menu-mitt';
|
||||
|
||||
const websiteName = computed(() => useAppConfigStore().websiteName);
|
||||
const theme = computed(() => useAppConfigStore().$state.sideMenuTheme);
|
||||
|
||||
const props = defineProps({
|
||||
menuTree: Array,
|
||||
});
|
||||
const selectedMenu = ref();
|
||||
let currentRoute = useRoute();
|
||||
|
||||
const parentMenuList = computed(() => {
|
||||
let currentName = currentRoute.name;
|
||||
if (!currentName || typeof currentName !== 'string') {
|
||||
return [];
|
||||
}
|
||||
let menuParentIdListMap = useUserStore().getMenuParentIdListMap;
|
||||
return menuParentIdListMap.get(currentName) || [];
|
||||
});
|
||||
|
||||
const selectedKeys = computed(() => {
|
||||
if (selectedMenu.value) {
|
||||
return [selectedMenu.value.menuId.toString()];
|
||||
}
|
||||
return parentMenuList.value.map((e) => e.name);
|
||||
});
|
||||
const menuTree = computed(() => useUserStore().getMenuTree || []);
|
||||
|
||||
// 展开菜单的顶级目录名字适配,只展示两个字为好
|
||||
function menuNameAdapter(name){
|
||||
return name.substr(0,2);
|
||||
function menuNameAdapter(name) {
|
||||
return name.substr(0, 2);
|
||||
}
|
||||
|
||||
//监听路由的变化,进行更新菜单展开项目
|
||||
watch(
|
||||
currentRoute,
|
||||
() => {
|
||||
selectedMenu.value = undefined;
|
||||
let menuList = props.menuTree.map((e) => e.menuId.toString());
|
||||
let parentIdList = _.intersection(menuList, selectedKeys.value);
|
||||
if (parentIdList.length > 0) {
|
||||
let parentId = parentIdList[0];
|
||||
let parentItem = props.menuTree.find((e) => e.menuId == Number(parentId));
|
||||
selectedMenu.value = parentItem;
|
||||
}
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
// 选中的顶级菜单
|
||||
const selectedKeys = ref([]);
|
||||
|
||||
// 选中菜单,页面跳转
|
||||
function onSelectMenu(route) {
|
||||
selectedMenu.value = route;
|
||||
if (route.menuType == MENU_TYPE_ENUM.MENU.value && (_.isEmpty(route.children) || route.children.every((e) => !e.visibleFlag))) {
|
||||
router.push({ name: route.menuId.toString() });
|
||||
function onSelectMenu(menuItem) {
|
||||
selectedKeys.value = [menuItem.menuId.toString()];
|
||||
if (menuItem.menuType === MENU_TYPE_ENUM.MENU.value && (_.isEmpty(menuItem.children) || menuItem.children.every((e) => !e.visibleFlag))) {
|
||||
useUserStore().deleteKeepAliveIncludes(menuItem.menuId.toString());
|
||||
router.push({ name: menuItem.menuId.toString() });
|
||||
}
|
||||
menuEmitter.emit('selectTopMenu', menuItem);
|
||||
}
|
||||
|
||||
// 更新选中的菜单
|
||||
function updateSelectKey(key) {
|
||||
selectedKeys.value = [key];
|
||||
let selectMenu = _.find(menuTree.value, { menuId: Number(key) });
|
||||
if (selectMenu) {
|
||||
menuEmitter.emit('selectTopMenu', selectMenu);
|
||||
}
|
||||
}
|
||||
|
||||
//点击logo回到首页
|
||||
function onGoHome() {
|
||||
router.push({ name: HOME_PAGE_NAME });
|
||||
}
|
||||
defineExpose({
|
||||
selectedMenu,
|
||||
});
|
||||
|
||||
defineExpose({ updateSelectKey });
|
||||
</script>
|
||||
<style scoped lang="less">
|
||||
.top-menu-container {
|
||||
@@ -110,7 +87,7 @@
|
||||
line-height: @header-user-height;
|
||||
padding: 0px 15px 0px 15px;
|
||||
width: 100%;
|
||||
z-index: 9999;
|
||||
z-index: 100;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
cursor: pointer;
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-modal :visible="visible" width="600px" title="联系客服人员" :closable="false" :maskClosable="true">
|
||||
<a-row><div style="margin-left: 180px">客服(卓大)电话:18637925892 ;</div> </a-row>
|
||||
<a-modal :open="visible" width="600px" title="联系客服人员" :closable="false" :maskClosable="true">
|
||||
<a-row><div style="margin-left: 180px;font-weight:bolder">客服(卓大)电话:18637925892 ;</div> </a-row>
|
||||
<br />
|
||||
<div class="app-qr-box">
|
||||
<div class="app-qr">
|
||||
@@ -19,8 +19,8 @@
|
||||
</div>
|
||||
<div class="app-qr">
|
||||
<img :src="xiaozhen" />
|
||||
<span class="qr-desc strong"> 关注:小镇程序员 </span>
|
||||
<span class="qr-desc"> 程序员的工作生活 </span>
|
||||
<span class="qr-desc strong"> 六边形工程师 </span>
|
||||
<span class="qr-desc"> 赚钱、代码、生活 </span>
|
||||
</div>
|
||||
<div class="app-qr">
|
||||
<img :src="lab1024" />
|
||||
@@ -37,7 +37,7 @@
|
||||
import { ref, reactive, nextTick, computed } from 'vue';
|
||||
import zhuoda from '/@/assets/images/1024lab/zhuoda-wechat.jpg';
|
||||
import lab1024 from '/@/assets/images/1024lab/1024lab-gzh.jpg';
|
||||
import xiaozhen from '/@/assets/images/1024lab/xiaozhen-gzh.jpg';
|
||||
import xiaozhen from '/@/assets/images/1024lab/gzh.jpg';
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-modal :visible="visible" title="意见反馈" :closable="false" :maskClosable="true" >
|
||||
<a-modal :open="visible" title="意见反馈" :closable="false" :maskClosable="true" >
|
||||
<a-form :labelCol="{ span: 6 }">
|
||||
<a-form-item label="我要吐槽/建议:">
|
||||
<a-textarea v-model:value="form.feedbackContent" placeholder="请输入让您不满意的点,我们争取做到更好~" :rows="3"/>
|
||||
@@ -34,7 +34,7 @@
|
||||
<script setup>
|
||||
import { reactive, ref } from 'vue';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { feedbackApi } from '/@/api/support/feedback/feedback-api';
|
||||
import { feedbackApi } from '/src/api/support/feedback-api';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { FILE_FOLDER_TYPE_ENUM } from '/@/constants/support/file-const';
|
||||
import Upload from '/@/components/support/file-upload/index.vue';
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
<!-----文档列表---->
|
||||
<div class="help-doc-list">
|
||||
<div class="help-doc-item-all">
|
||||
<router-link tag="a" target="_blank" :to="{ path: '/help-doc/detail' }">系统手册文档 >></router-link>
|
||||
<router-link tag="a" target="_blank" :to="{ path: '/help-doc/detail' }">系统帮助文档 >></router-link>
|
||||
</div>
|
||||
<div class="help-doc-item" v-for="item in helpDocList" :key="item.helpDocId">
|
||||
<router-link tag="a" target="_blank" :to="{ path: '/help-doc/detail', query: { helpDocId: item.helpDocId } }">{{ item.title }}</router-link>
|
||||
@@ -59,11 +59,11 @@
|
||||
import { onMounted, ref, watch, reactive } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import _ from 'lodash';
|
||||
import { helpDocApi } from '/@/api/support/help-doc/help-doc-api';
|
||||
import { helpDocApi } from '/src/api/support/help-doc-api';
|
||||
import ContactModal from './components/contact-modal.vue';
|
||||
import FeedbackModal from './components/feedback-modal.vue';
|
||||
import { useAppConfigStore } from '/@/store/modules/system/app-config';
|
||||
import { feedbackApi } from '/@/api/support/feedback/feedback-api';
|
||||
import { feedbackApi } from '/src/api/support/feedback-api';
|
||||
import { HOME_PAGE_NAME } from '/@/constants/system/home-const';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
}
|
||||
|
||||
scheduleShowInterval = setInterval(() => {
|
||||
if (feedbackList.length == 0) {
|
||||
if (feedbackList.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -187,6 +187,7 @@
|
||||
justify-content: space-between;
|
||||
.help-doc-contact-left {
|
||||
width: 30px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.help-doc-contact-right {
|
||||
margin-top: 10px;
|
||||
@@ -194,19 +195,20 @@
|
||||
.help-doc-contac-time {
|
||||
color: #888;
|
||||
font-size: 12px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.feedback {
|
||||
.feedback-message-list {
|
||||
margin: 6px 0px;
|
||||
height: 40px;
|
||||
margin: 12px 0px;
|
||||
height: 70px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
.feedback-message {
|
||||
margin: 2px 2px;
|
||||
color: #888;
|
||||
margin: 10px 2px;
|
||||
color: #a9a9a9;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,19 +13,19 @@
|
||||
<!-- 1、顶部logo区域 -->
|
||||
<div class="logo" @click="onGoHome" :style="sideMenuWidth" v-if="!collapsed">
|
||||
<img class="logo-img" :src="logoImg" />
|
||||
<div class="title title-light" v-if="sideMenuTheme === 'light'">{{websiteName}}</div>
|
||||
<div class="title title-dark" v-if="sideMenuTheme === 'dark'">{{websiteName}}</div>
|
||||
<div class="title title-light" v-if="sideMenuTheme === 'light'">{{ websiteName }}</div>
|
||||
<div class="title title-dark" v-if="sideMenuTheme === 'dark'">{{ websiteName }}</div>
|
||||
</div>
|
||||
<div class="min-logo" @click="onGoHome" v-if="collapsed">
|
||||
<img class="logo-img" :src="logoImg" />
|
||||
</div>
|
||||
|
||||
<!-- 2、下方菜单区域: 这里使用一个递归菜单解决 -->
|
||||
<RecursionMenu :collapsed="collapsed" ref="menu" />
|
||||
<RecursionMenu :collapsed="collapsed" ref="menuRef" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { computed, nextTick, ref, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import RecursionMenu from './recursion-menu.vue';
|
||||
import logoImg from '/@/assets/images/logo/smart-admin-logo.png';
|
||||
@@ -44,14 +44,14 @@
|
||||
},
|
||||
});
|
||||
|
||||
const menu = ref();
|
||||
const menuRef = ref();
|
||||
|
||||
watch(
|
||||
() => props.collapsed,
|
||||
(newValue, oldValue) => {
|
||||
// 如果是展开菜单的话,重新获取更新菜单的展开项: openkeys和selectKeys
|
||||
if (!newValue) {
|
||||
menu.value.updateOpenKeysAndSelectKeys();
|
||||
nextTick(() => menuRef.value.updateOpenKeysAndSelectKeys());
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -76,7 +76,7 @@
|
||||
line-height: @header-user-height;
|
||||
padding: 0px 15px 0px 15px;
|
||||
width: 100%;
|
||||
z-index: 9999;
|
||||
z-index: 21;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
.logo-img {
|
||||
@@ -89,10 +89,10 @@
|
||||
height: @header-user-height;
|
||||
line-height: @header-user-height;
|
||||
padding: 0px 15px 0px 15px;
|
||||
z-index: 9999;
|
||||
z-index: 21;
|
||||
display: flex;
|
||||
cursor: pointer;
|
||||
justify-content:space-around;
|
||||
justify-content: center;
|
||||
|
||||
.logo-img {
|
||||
width: 40px;
|
||||
@@ -102,13 +102,13 @@
|
||||
.title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin-left:8px;
|
||||
margin-left: 8px;
|
||||
}
|
||||
.title-light {
|
||||
color:#001529;
|
||||
color: #001529;
|
||||
}
|
||||
.title-dark {
|
||||
color:#ffffff;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
class="smart-menu"
|
||||
mode="inline"
|
||||
:theme="theme"
|
||||
:inlineCollapsed="inlineCollapsed"
|
||||
:inlineCollapsed="collapsed"
|
||||
>
|
||||
<template v-for="item in menuTree" :key="item.menuId">
|
||||
<template v-if="item.visibleFlag && !item.disabledFlag">
|
||||
@@ -45,7 +45,7 @@
|
||||
const theme = computed(() => useAppConfigStore().$state.sideMenuTheme);
|
||||
|
||||
const props = defineProps({
|
||||
inlineCollapsed: {
|
||||
collapsed: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
@@ -60,6 +60,7 @@
|
||||
|
||||
// 页面跳转
|
||||
function turnToPage(menu) {
|
||||
useUserStore().deleteKeepAliveIncludes(menu.menuId.toString());
|
||||
router.push({ path: menu.path });
|
||||
}
|
||||
|
||||
@@ -77,9 +78,13 @@
|
||||
//获取需要展开的menu key集合
|
||||
let menuParentIdListMap = useUserStore().getMenuParentIdListMap;
|
||||
let parentList = menuParentIdListMap.get(currentRoute.name) || [];
|
||||
let needOpenKeys = _.map(parentList, 'name').map(Number);
|
||||
// 使用lodash的union函数,进行 去重合并两个数组
|
||||
openKeys.value = _.union(openKeys.value, needOpenKeys);
|
||||
|
||||
// 如果是折叠菜单的话,则不需要设置openkey
|
||||
if(!props.collapsed){
|
||||
// 使用lodash的union函数,进行 去重合并两个数组
|
||||
let needOpenKeys = _.map(parentList, 'name').map(Number);
|
||||
openKeys.value = _.union(openKeys.value, needOpenKeys);
|
||||
}
|
||||
}
|
||||
|
||||
watch(
|
||||
|
||||
@@ -8,10 +8,8 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<div class="version" >
|
||||
<a target="_blank" href="https://www.1024lab.net">
|
||||
SmartAdmin V2.x @copyright 河南·洛阳【1024创新实验室】 Since 2012-{{ currentYear }}
|
||||
</a>
|
||||
<div class="version">
|
||||
<a target="_blank" href="javascript:void(0)"> SmartAdmin V3.x @copyright 河南·洛阳【1024创新实验室】 Since 2012-{{ currentYear }} </a>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
|
||||
@@ -0,0 +1,173 @@
|
||||
<!--
|
||||
* 顶部菜单
|
||||
*
|
||||
* @Author: 1024创新实验室-主任:卓大
|
||||
* @Date: 2022-09-06 20:29:12
|
||||
* @Wechat: zhuda1024
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<!--总共3部分:1、logo区域,包含 logo和名称; 2、菜单区域 ;3、用户操作区域-->
|
||||
<div class="header-main">
|
||||
<!-- 1、logo区域 -->
|
||||
<div class="logo" @click="onGoHome">
|
||||
<img class="logo-img" :src="logoImg" />
|
||||
<div class="title title-light" v-if="sideMenuTheme === 'light'">{{ websiteName }}</div>
|
||||
<div class="title title-dark" v-if="sideMenuTheme === 'dark'">{{ websiteName }}</div>
|
||||
</div>
|
||||
<!-- 2、菜单区域 -->
|
||||
<RecursionMenu ref="menuRef" />
|
||||
|
||||
<!-- 3、用户操作区域 -->
|
||||
<div class="user-space">
|
||||
<div class="setting">
|
||||
<!---消息通知--->
|
||||
<HeaderMessage ref="headerMessage" />
|
||||
<!---设置--->
|
||||
<a-button type="text" @click="showSetting" class="operate-icon">
|
||||
<template #icon><setting-outlined /></template>
|
||||
</a-button>
|
||||
</div>
|
||||
<!---头像信息--->
|
||||
<div class="user-space-item">
|
||||
<HeaderAvatar />
|
||||
</div>
|
||||
<HeaderSetting ref="headerSetting" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import RecursionMenu from './recursion-menu.vue';
|
||||
import logoImg from '/@/assets/images/logo/smart-admin-logo.png';
|
||||
import { HOME_PAGE_NAME } from '/@/constants/system/home-const';
|
||||
import { useAppConfigStore } from '/@/store/modules/system/app-config';
|
||||
import HeaderAvatar from '../header-user-space/header-avatar.vue';
|
||||
import HeaderSetting from '../header-user-space/header-setting.vue';
|
||||
import HeaderMessage from '../header-user-space/header-message.vue';
|
||||
|
||||
// 设置
|
||||
const headerSetting = ref();
|
||||
function showSetting() {
|
||||
headerSetting.value.show();
|
||||
}
|
||||
|
||||
//消息通知
|
||||
const headerMessage = ref();
|
||||
function showMessage() {
|
||||
headerMessage.value.showMessage();
|
||||
}
|
||||
|
||||
const websiteName = computed(() => useAppConfigStore().websiteName);
|
||||
const sideMenuTheme = computed(() => useAppConfigStore().sideMenuTheme);
|
||||
|
||||
const props = defineProps({
|
||||
collapsed: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
});
|
||||
|
||||
const menuRef = ref();
|
||||
|
||||
watch(
|
||||
() => props.collapsed,
|
||||
(newValue, oldValue) => {
|
||||
// 如果是展开菜单的话,重新获取更新菜单的展开项: openkeys和selectKeys
|
||||
if (!newValue) {
|
||||
menuRef.value.updateSelectKeys();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
const color = computed(() => {
|
||||
let isLight = useAppConfigStore().$state.sideMenuTheme === 'light';
|
||||
return {
|
||||
color: isLight ? '#001529' : '#FFFFFF',
|
||||
background:isLight ? '#FFFFFF' : '#001529',
|
||||
}
|
||||
});
|
||||
|
||||
const router = useRouter();
|
||||
function onGoHome() {
|
||||
router.push({ name: HOME_PAGE_NAME });
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.header-main {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: flex-start;
|
||||
width: 100%;
|
||||
padding-left: 16px;
|
||||
height: 48px;
|
||||
z-index: 21;
|
||||
border-bottom: 1px solid rgb(238, 238, 238);
|
||||
|
||||
.logo {
|
||||
min-width: 192px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.logo-img {
|
||||
display: inline-block;
|
||||
height: 45px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
margin-left: 8px;
|
||||
}
|
||||
.title-light {
|
||||
color: #001529;
|
||||
}
|
||||
.title-dark {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
|
||||
.user-space {
|
||||
min-width: 208px;
|
||||
margin-left: auto;
|
||||
padding-right: 10px;
|
||||
color: v-bind('color.color');
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
vertical-align: middle;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
|
||||
.setting {
|
||||
height: @header-user-height;
|
||||
line-height: @header-user-height;
|
||||
vertical-align: middle;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
:deep(.ant-badge) {
|
||||
color: v-bind('color.color');
|
||||
}
|
||||
}
|
||||
.operate-icon {
|
||||
margin-left: 20px;
|
||||
color: v-bind('color.color');
|
||||
}
|
||||
|
||||
.user-space-item{
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ant-menu-horizontal){
|
||||
border-bottom:0;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,88 @@
|
||||
<!--
|
||||
* 顶部菜单-递归菜单
|
||||
*
|
||||
* @Author: 1024创新实验室-主任:卓大
|
||||
* @Date: 2022-09-06 20:29:12
|
||||
* @Wechat: zhuda1024
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-menu
|
||||
v-model:openKeys="openKeys"
|
||||
v-model:selectedKeys="selectedKeys"
|
||||
class="smart-menu"
|
||||
mode="horizontal"
|
||||
:theme="theme"
|
||||
>
|
||||
<template v-for="item in menuTree" :key="item.menuId">
|
||||
<template v-if="item.visibleFlag && !item.disabledFlag">
|
||||
<template v-if="$lodash.isEmpty(item.children)">
|
||||
<a-menu-item :key="item.menuId" @click="turnToPage(item)">
|
||||
<template #icon>
|
||||
<component :is="$antIcons[item.icon]" />
|
||||
</template>
|
||||
{{ item.menuName }}
|
||||
</a-menu-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<SubMenu :menu-info="item" :key="item.menuId" @turnToPage="turnToPage" />
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</a-menu>
|
||||
</template>
|
||||
<script setup>
|
||||
import _ from 'lodash';
|
||||
import { computed, ref, watch } from 'vue';
|
||||
import { useRoute } from 'vue-router';
|
||||
import SubMenu from './sub-menu.vue';
|
||||
import { router } from '/@/router/index';
|
||||
import { useAppConfigStore } from '/@/store/modules/system/app-config';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
|
||||
const theme = computed(() => useAppConfigStore().$state.sideMenuTheme);
|
||||
|
||||
const menuTree = computed(() => useUserStore().getMenuTree || []);
|
||||
|
||||
//展开的菜单
|
||||
let currentRoute = useRoute();
|
||||
const selectedKeys = ref([]);
|
||||
const openKeys = ref([]);
|
||||
|
||||
// 页面跳转
|
||||
function turnToPage(menu) {
|
||||
useUserStore().deleteKeepAliveIncludes(menu.menuId.toString());
|
||||
router.push({ path: menu.path });
|
||||
}
|
||||
|
||||
/**
|
||||
* SmartAdmin中 router的name 就是 后端存储menu的id
|
||||
* 所以此处可以直接监听路由,根据路由更新菜单的选中和展开
|
||||
*/
|
||||
function updateSelectKeys() {
|
||||
// 更新选中
|
||||
selectedKeys.value = [_.toNumber(currentRoute.name)];
|
||||
}
|
||||
|
||||
watch(
|
||||
currentRoute,
|
||||
() => {
|
||||
updateSelectKeys();
|
||||
},
|
||||
{
|
||||
immediate: true,
|
||||
}
|
||||
);
|
||||
|
||||
defineExpose({
|
||||
updateSelectKeys,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.smart-menu {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -0,0 +1,45 @@
|
||||
<!--
|
||||
* 顶部菜单-递归菜单
|
||||
*
|
||||
* @Author: 1024创新实验室-主任:卓大
|
||||
* @Date: 2022-09-06 20:29:12
|
||||
* @Wechat: zhuda1024
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
-->
|
||||
<template>
|
||||
<a-sub-menu :key="menuInfo.menuId">
|
||||
<template #icon>
|
||||
<component :is="$antIcons[menuInfo.icon]" />
|
||||
</template>
|
||||
<template #title>{{ menuInfo.menuName }}</template>
|
||||
<template v-for="item in menuInfo.children" :key="item.menuId">
|
||||
<template v-if="item.visibleFlag && !item.disabledFlag">
|
||||
<template v-if="!item.children">
|
||||
<a-menu-item :key="item.menuId" @click="turnToPage(item)">
|
||||
<template #icon>
|
||||
<component :is="$antIcons[item.icon]" />
|
||||
</template>
|
||||
{{ item.menuName }}
|
||||
</a-menu-item>
|
||||
</template>
|
||||
<template v-else>
|
||||
<SubMenu :menu-info="item" :key="item.menuId" @turnToPage="turnToPage" />
|
||||
</template>
|
||||
</template>
|
||||
</template>
|
||||
</a-sub-menu>
|
||||
</template>
|
||||
<script setup>
|
||||
const props = defineProps({
|
||||
menuInfo: {
|
||||
type: Object,
|
||||
default: () => ({}),
|
||||
},
|
||||
});
|
||||
|
||||
const emits = defineEmits(['turnToPage']);
|
||||
const turnToPage = (menu) => {
|
||||
emits('turnToPage', menu);
|
||||
};
|
||||
</script>
|
||||
@@ -18,9 +18,9 @@
|
||||
<!-- 顶部头部信息 -->
|
||||
<a-layout-header class="layout-header">
|
||||
<a-row class="layout-header-title">
|
||||
<img class="logo-img" :src="logoImg" />
|
||||
<div class="title">{{ websiteName }}</div>
|
||||
<div class="title">帮助文档</div>
|
||||
<img class="logo-img" :src="logoImg" />
|
||||
<div class="title">{{ websiteName }}</div>
|
||||
<div class="title">帮助文档</div>
|
||||
<a-col class="avatar">
|
||||
<HeaderAvatar />
|
||||
</a-col>
|
||||
@@ -67,12 +67,12 @@
|
||||
import { smartSentry } from '../lib/smart-sentry';
|
||||
import { useAppConfigStore } from '../store/modules/system/app-config';
|
||||
import SmartFooter from './components/smart-footer/index.vue';
|
||||
import { helpDocApi } from '/@/api/support/help-doc/help-doc-api';
|
||||
import { helpDocCatalogApi } from '/@/api/support/help-doc/help-doc-catalog-api';
|
||||
import { helpDocApi } from '/src/api/support/help-doc-api';
|
||||
import { helpDocCatalogApi } from '/src/api/support/help-doc-catalog-api';
|
||||
import logoImg from '/@/assets/images/logo/smart-admin-logo-white.png';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { HOME_PAGE_NAME } from '/@/constants/system/home-const';
|
||||
import watermark from '/@/lib/smart-wartermark';
|
||||
import watermark from '../lib/smart-watermark';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import HeaderAvatar from './components/header-user-space/header-avatar.vue';
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
expandedKeys.value = [TYPE_HELP_DOC_PREFIX + helpDocId];
|
||||
selectedKeys.value = [TYPE_HELP_DOC_PREFIX + helpDocId];
|
||||
|
||||
let helpDoc = helpDocList.filter((e) => e.helpDocId == helpDocId);
|
||||
let helpDoc = helpDocList.filter((e) => e.helpDocId === helpDocId);
|
||||
let catalogId = null;
|
||||
if (helpDoc.length > 0) {
|
||||
catalogId = helpDoc[0].helpDocCatalogId;
|
||||
@@ -121,7 +121,7 @@
|
||||
|
||||
let parentId = catalogId;
|
||||
while (parentId !== 0) {
|
||||
let catalog = catalogList.filter((e) => e.helpDocCatalogId == parentId);
|
||||
let catalog = catalogList.filter((e) => e.helpDocCatalogId === parentId);
|
||||
if (catalog.length > 0) {
|
||||
parentId = catalog[0].parentId;
|
||||
expandedKeys.value.push(TYPE_CATALOG_PREFIX + catalog[0].helpDocCatalogId);
|
||||
@@ -201,6 +201,7 @@
|
||||
if (e.key.indexOf(TYPE_HELP_DOC_PREFIX) > -1) {
|
||||
continue;
|
||||
}
|
||||
e.isLeaf = false;
|
||||
e.children = buildHelpDocCatalogTree(data, e.helpDocCatalogId, helpDocMap);
|
||||
}
|
||||
|
||||
@@ -216,7 +217,7 @@
|
||||
height: auto;
|
||||
}
|
||||
:deep(.ant-tree-treenode) {
|
||||
margin: 2px 0px;
|
||||
margin: 2px 0;
|
||||
}
|
||||
|
||||
.help-doc-layout {
|
||||
@@ -300,3 +301,4 @@
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
../lib/smart-watermark
|
||||
@@ -9,15 +9,18 @@
|
||||
-->
|
||||
<template>
|
||||
<!--左侧菜单 模式-->
|
||||
<SmartSideLayout v-if="layout === LAYOUT_ENUM.SIDE.value" />
|
||||
<SideLayout v-if="layout === LAYOUT_ENUM.SIDE.value" />
|
||||
<!--左侧展开菜单 模式-->
|
||||
<SmartSideExpandLayout v-if="layout === LAYOUT_ENUM.SIDE_EXPAND.value" />
|
||||
<SideExpandLayout v-if="layout === LAYOUT_ENUM.SIDE_EXPAND.value" />
|
||||
<!--顶部菜单 模式-->
|
||||
<TopLayout v-if="layout === LAYOUT_ENUM.TOP.value" />
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import SmartSideExpandLayout from './smart-side-expand-layout.vue';
|
||||
import { LAYOUT_ENUM } from '/@/constants/layout-const';
|
||||
import SmartSideLayout from '/@/layout/smart-side-layout.vue';
|
||||
import SideExpandLayout from './side-expand-layout.vue';
|
||||
import SideLayout from './side-layout.vue';
|
||||
import TopLayout from './top-layout.vue';
|
||||
import { useAppConfigStore } from '/@/store/modules/system/app-config';
|
||||
|
||||
const layout = computed(() => useAppConfigStore().$state.layout);
|
||||
@@ -59,9 +59,7 @@
|
||||
<div v-show="!iframeNotKeepAlivePageFlag && keepAliveIframePages.every((e) => route.name != e.name)">
|
||||
<router-view v-slot="{ Component }">
|
||||
<keep-alive :include="keepAliveIncludes">
|
||||
<div :key="route.name" style="height: 100%">
|
||||
<component :is="Component" />
|
||||
</div>
|
||||
<component :is="Component" :key="route.name" />
|
||||
</keep-alive>
|
||||
</router-view>
|
||||
</div>
|
||||
@@ -78,15 +76,15 @@
|
||||
</a-layout>
|
||||
</template>
|
||||
<script setup>
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import HeaderUserSpace from './components/header-user-space/index.vue';
|
||||
import MenuLocationBreadcrumb from './components/menu-location-breadcrumb/index.vue';
|
||||
import PageTag from './components/page-tag/index.vue';
|
||||
import SideExpandMenu from './components/side-expand-menu/index.vue';
|
||||
import SmartFooter from './components/smart-footer/index.vue';
|
||||
import { smartKeepAlive } from './smart-keep-alive';
|
||||
import { smartKeepAlive } from './components/smart-keep-alive';
|
||||
import IframeIndex from '/@/components/framework/iframe/iframe-index.vue';
|
||||
import watermark from '/@/lib/smart-wartermark';
|
||||
import watermark from '../lib/smart-watermark';
|
||||
import { useAppConfigStore } from '/@/store/modules/system/app-config';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import SideHelpDoc from './components/side-help-doc/index.vue';
|
||||
@@ -103,6 +101,8 @@
|
||||
const helpDocFlag = computed(() => useAppConfigStore().$state.helpDocFlag);
|
||||
// 是否显示页脚
|
||||
const footerFlag = computed(() => useAppConfigStore().$state.footerFlag);
|
||||
// 是否显示水印
|
||||
const watermarkFlag = computed(() => useAppConfigStore().$state.watermarkFlag);
|
||||
// 多余高度
|
||||
const dueHeight = computed(() => {
|
||||
let due = 40;
|
||||
@@ -119,9 +119,24 @@
|
||||
|
||||
//页面初始化的时候加载水印
|
||||
onMounted(() => {
|
||||
watermark.set('smartAdminLayoutContent', useUserStore().actualName);
|
||||
if (watermarkFlag.value) {
|
||||
watermark.set('smartAdminLayoutContent', useUserStore().actualName);
|
||||
} else {
|
||||
watermark.clear();
|
||||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
() => watermarkFlag.value,
|
||||
(newValue) => {
|
||||
if (newValue) {
|
||||
watermark.set('smartAdminLayoutContent', useUserStore().actualName);
|
||||
} else {
|
||||
watermark.clear();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
window.addEventListener('resize', function () {
|
||||
windowHeight.value = window.innerHeight;
|
||||
});
|
||||
@@ -148,7 +163,7 @@
|
||||
.smart-layout-header {
|
||||
background: #fff;
|
||||
padding: 0;
|
||||
z-index: 999;
|
||||
z-index: 21;
|
||||
}
|
||||
|
||||
.smart-layout-header-user {
|
||||
@@ -237,14 +252,14 @@
|
||||
min-height: auto;
|
||||
position: relative;
|
||||
padding: 10px 10px 0px 10px;
|
||||
height: calc(100% - v-bind(dueHeight)px);
|
||||
height: calc(100% - v-bind(dueHeight) px);
|
||||
overflow-x: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.smart-layout-footer {
|
||||
position: relative;
|
||||
padding: 10px 0px;
|
||||
padding: 10px 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
@@ -71,16 +71,16 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { useAppConfigStore } from '../store/modules/system/app-config';
|
||||
import HeaderUserSpace from './components/header-user-space/index.vue';
|
||||
import MenuLocationBreadcrumb from './components/menu-location-breadcrumb/index.vue';
|
||||
import PageTag from './components/page-tag/index.vue';
|
||||
import SideMenu from './components/side-menu/index.vue';
|
||||
import SmartFooter from './components/smart-footer/index.vue';
|
||||
import { smartKeepAlive } from './smart-keep-alive';
|
||||
import { smartKeepAlive } from './components/smart-keep-alive';
|
||||
import IframeIndex from '/@/components/framework/iframe/iframe-index.vue';
|
||||
import watermark from '/@/lib/smart-wartermark';
|
||||
import watermark from '../lib/smart-watermark';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import SideHelpDoc from './components/side-help-doc/index.vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
@@ -97,6 +97,8 @@
|
||||
const helpDocFlag = computed(() => useAppConfigStore().$state.helpDocFlag);
|
||||
// 是否显示页脚
|
||||
const footerFlag = computed(() => useAppConfigStore().$state.footerFlag);
|
||||
// 是否显示水印
|
||||
const watermarkFlag = computed(() => useAppConfigStore().$state.watermarkFlag);
|
||||
// 多余高度
|
||||
const dueHeight = computed(() => {
|
||||
let due = 40;
|
||||
@@ -113,9 +115,24 @@
|
||||
|
||||
//页面初始化的时候加载水印
|
||||
onMounted(() => {
|
||||
watermark.set('smartAdminLayoutContent', useUserStore().actualName);
|
||||
if (watermarkFlag.value) {
|
||||
watermark.set('smartAdminLayoutContent', useUserStore().actualName);
|
||||
} else {
|
||||
watermark.clear();
|
||||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
() => watermarkFlag.value,
|
||||
(newValue) => {
|
||||
if (newValue) {
|
||||
watermark.set('smartAdminLayoutContent', useUserStore().actualName);
|
||||
} else {
|
||||
watermark.clear();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
//回到顶部
|
||||
const backTopTarget = () => {
|
||||
return document.getElementById('smartAdminMain');
|
||||
@@ -138,6 +155,7 @@
|
||||
:deep(.ant-layout-header) {
|
||||
height: auto;
|
||||
}
|
||||
|
||||
:deep(.layout-header) {
|
||||
height: auto;
|
||||
}
|
||||
@@ -145,7 +163,7 @@
|
||||
.layout-header {
|
||||
background: #fff;
|
||||
padding: 0;
|
||||
z-index: 999;
|
||||
z-index: 21;
|
||||
}
|
||||
|
||||
.layout-header-user {
|
||||
@@ -193,7 +211,7 @@
|
||||
.side-menu {
|
||||
height: 100vh;
|
||||
overflow-x: hidden;
|
||||
|
||||
overflow-y: scroll;
|
||||
&.fixed-side {
|
||||
position: fixed;
|
||||
height: 100vh;
|
||||
@@ -202,12 +220,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
.side-menu::-webkit-scrollbar {
|
||||
width: 4px;
|
||||
}
|
||||
.side-menu::-webkit-scrollbar-thumb {
|
||||
border-radius: 10px;
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
.side-menu::-webkit-scrollbar-track {
|
||||
border-radius: 0;
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.help-doc-sider {
|
||||
flex: 0 !important;
|
||||
min-width: 100px;
|
||||
height: 100vh;
|
||||
max-width: 100px;
|
||||
width: auto !important;
|
||||
|
||||
&.fixed-side {
|
||||
position: fixed;
|
||||
height: 100vh;
|
||||
@@ -215,6 +246,7 @@
|
||||
top: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.virtual-side {
|
||||
transition: all 0.2s;
|
||||
}
|
||||
@@ -239,7 +271,7 @@
|
||||
position: relative;
|
||||
overflow-x: hidden;
|
||||
padding: 10px 10px 0px 10px;
|
||||
height: calc(100% - v-bind(dueHeight)px);
|
||||
height: calc(100% - v-bind(dueHeight) px);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
<template>
|
||||
<a-layout class="admin-layout">
|
||||
<!-- 顶部菜单 -->
|
||||
<a-layout-header class="top-menu" :theme="theme">
|
||||
<TopMenu />
|
||||
</a-layout-header>
|
||||
|
||||
<!--中间内容-->
|
||||
<a-layout-content id="smartAdminLayoutContent" class="admin-layout-content">
|
||||
<!---标签页-->
|
||||
<div class="page-tag-div" v-show="pageTagFlag">
|
||||
<PageTag />
|
||||
</div>
|
||||
|
||||
<!--不keepAlive的iframe使用单个iframe组件-->
|
||||
<IframeIndex v-if="iframeNotKeepAlivePageFlag" :key="route.name" :name="route.name" :url="route.meta.frameUrl" />
|
||||
|
||||
<!--keepAlive的iframe 每个页面一个iframe组件-->
|
||||
<IframeIndex
|
||||
v-for="item in keepAliveIframePages"
|
||||
v-show="route.name == item.name"
|
||||
:key="item.name"
|
||||
:name="item.name"
|
||||
:url="item.meta.frameUrl"
|
||||
/>
|
||||
|
||||
<!--非iframe使用router-view-->
|
||||
<div v-show="!iframeNotKeepAlivePageFlag && keepAliveIframePages.every((e) => route.name != e.name)">
|
||||
<router-view v-slot="{ Component }">
|
||||
<keep-alive :include="keepAliveIncludes">
|
||||
<component :is="Component" :key="route.name" />
|
||||
</keep-alive>
|
||||
</router-view>
|
||||
</div>
|
||||
</a-layout-content>
|
||||
|
||||
<!-- footer 版权公司信息 -->
|
||||
<a-layout-footer class="layout-footer" v-show="footerFlag">
|
||||
<smart-footer />
|
||||
</a-layout-footer>
|
||||
<!--- 回到顶部 -->
|
||||
<a-back-top :target="backTopTarget" :visibilityHeight="80" />
|
||||
</a-layout>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, ref, watch } from 'vue';
|
||||
import { useAppConfigStore } from '../store/modules/system/app-config';
|
||||
import PageTag from './components/page-tag/index.vue';
|
||||
import TopMenu from './components/top-menu/index.vue';
|
||||
import SmartFooter from './components/smart-footer/index.vue';
|
||||
import { smartKeepAlive } from './components/smart-keep-alive';
|
||||
import IframeIndex from '/@/components/framework/iframe/iframe-index.vue';
|
||||
import watermark from '../lib/smart-watermark';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { HOME_PAGE_NAME } from '/@/constants/system/home-const';
|
||||
|
||||
const windowHeight = ref(window.innerHeight);
|
||||
//主题颜色
|
||||
const theme = computed(() => useAppConfigStore().$state.sideMenuTheme);
|
||||
const color = computed(() => {
|
||||
let isLight = useAppConfigStore().$state.sideMenuTheme === 'light';
|
||||
return {
|
||||
color: isLight ? '#001529' : '#FFFFFF',
|
||||
background: isLight ? '#FFFFFF' : '#001529',
|
||||
};
|
||||
});
|
||||
|
||||
//是否显示标签页
|
||||
const pageTagFlag = computed(() => useAppConfigStore().$state.pageTagFlag);
|
||||
// 是否显示页脚
|
||||
const footerFlag = computed(() => useAppConfigStore().$state.footerFlag);
|
||||
// 是否显示水印
|
||||
const watermarkFlag = computed(() => useAppConfigStore().$state.watermarkFlag);
|
||||
// 页面宽度
|
||||
const pageWidth = computed(() => useAppConfigStore().$state.pageWidth);
|
||||
// 多余高度
|
||||
const dueHeight = computed(() => {
|
||||
let due = '45px';
|
||||
if (useAppConfigStore().$state.pageTagFlag) {
|
||||
due = '85px';
|
||||
}
|
||||
return due;
|
||||
});
|
||||
|
||||
//页面初始化的时候加载水印
|
||||
onMounted(() => {
|
||||
if (watermarkFlag.value) {
|
||||
watermark.set('smartAdminLayoutContent', useUserStore().actualName);
|
||||
} else {
|
||||
watermark.clear();
|
||||
}
|
||||
});
|
||||
|
||||
watch(
|
||||
() => watermarkFlag.value,
|
||||
(newValue) => {
|
||||
if (newValue) {
|
||||
watermark.set('smartAdminLayoutContent', useUserStore().actualName);
|
||||
} else {
|
||||
watermark.clear();
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
//回到顶部
|
||||
const backTopTarget = () => {
|
||||
return document.getElementById('smartAdminMain');
|
||||
};
|
||||
|
||||
const router = useRouter();
|
||||
function goHome() {
|
||||
router.push({ name: HOME_PAGE_NAME });
|
||||
}
|
||||
|
||||
window.addEventListener('resize', function () {
|
||||
windowHeight.value = window.innerHeight;
|
||||
});
|
||||
|
||||
// ----------------------- keep-alive相关 -----------------------
|
||||
let { route, keepAliveIncludes, iframeNotKeepAlivePageFlag, keepAliveIframePages } = smartKeepAlive();
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.admin-layout {
|
||||
min-height: 100%;
|
||||
|
||||
.top-menu {
|
||||
padding: 0px;
|
||||
height: 48px;
|
||||
line-height: 48px;
|
||||
width: 100%;
|
||||
z-index: 100;
|
||||
right: 0px;
|
||||
position: fixed;
|
||||
background-color: v-bind('color.background');
|
||||
}
|
||||
|
||||
.admin-layout-content {
|
||||
background-color: inherit;
|
||||
min-height: auto;
|
||||
position: relative;
|
||||
overflow-x: hidden;
|
||||
padding: 10px 0;
|
||||
width: v-bind(pageWidth);
|
||||
margin-top: v-bind(dueHeight);
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
|
||||
.page-tag-div {
|
||||
position: fixed;
|
||||
top: 48px;
|
||||
width: v-bind(pageWidth);
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
z-index: 11;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.layout-footer {
|
||||
position: relative;
|
||||
padding: 7px 0px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
||||
@@ -7,10 +7,13 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import { message } from 'ant-design-vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import axios from 'axios';
|
||||
import { clearAllCoolies, getTokenFromCookie } from '/@/utils/cookie-util';
|
||||
import { localClear } from '/@/utils/local-util';
|
||||
import { decryptData, encryptData } from './encrypt';
|
||||
import { DATA_TYPE_ENUM } from '../constants/common-const';
|
||||
import _ from 'lodash';
|
||||
|
||||
// token的消息头
|
||||
const TOKEN_HEADER = 'x-access-token';
|
||||
@@ -44,20 +47,67 @@ smartAxios.interceptors.request.use(
|
||||
// 添加响应拦截器
|
||||
smartAxios.interceptors.response.use(
|
||||
(response) => {
|
||||
// 对响应数据做点什么
|
||||
// 根据content-type ,判断是否为 json 数据
|
||||
let contentType = response.headers['content-type'] ? response.headers['content-type'] : response.headers['Content-Type'];
|
||||
if (contentType.indexOf('application/json') === -1) {
|
||||
return Promise.resolve(response);
|
||||
}
|
||||
|
||||
// 如果是json数据
|
||||
if (response.data && response.data instanceof Blob) {
|
||||
return Promise.reject(response.data);
|
||||
}
|
||||
|
||||
// 如果是加密数据
|
||||
if (response.data.dataType === DATA_TYPE_ENUM.ENCRYPT.value) {
|
||||
response.data.encryptData = response.data.data;
|
||||
let decryptStr = decryptData(response.data.data);
|
||||
if (decryptStr) {
|
||||
response.data.data = JSON.parse(decryptStr);
|
||||
}
|
||||
}
|
||||
|
||||
const res = response.data;
|
||||
if (res.code && res.code !== 1) {
|
||||
// `token` 过期或者账号已在别处登录
|
||||
if (res.code === 30007 || res.code === 30008) {
|
||||
message.destroy();
|
||||
message.error('您没有登录,请重新登录');
|
||||
clearAllCoolies();
|
||||
localClear();
|
||||
//跳转到登录页面,直接使用页面刷新的策略
|
||||
setTimeout(() => {
|
||||
location.href = '/';
|
||||
}, 300);
|
||||
return Promise.reject(response);
|
||||
}
|
||||
|
||||
// 等保安全的登录提醒
|
||||
if (res.code === 30010 || res.code === 30011) {
|
||||
Modal.error({
|
||||
title: '重要提醒',
|
||||
content: res.msg,
|
||||
});
|
||||
return Promise.reject(response);
|
||||
}
|
||||
|
||||
// 长时间未操作系统,需要重新登录
|
||||
if (res.code === 30012) {
|
||||
Modal.error({
|
||||
title: '重要提醒',
|
||||
content: res.msg,
|
||||
onOk() {
|
||||
return new Promise((resolve, reject) => {
|
||||
clearAllCoolies();
|
||||
localClear();
|
||||
setTimeout(() => {
|
||||
location.href = '/';
|
||||
}, 300);
|
||||
}).catch(() => console.log('Oops errors!'));
|
||||
},
|
||||
});
|
||||
return Promise.reject(response);
|
||||
}
|
||||
message.destroy();
|
||||
message.error(res.msg);
|
||||
return Promise.reject(response);
|
||||
} else {
|
||||
@@ -66,11 +116,14 @@ smartAxios.interceptors.response.use(
|
||||
},
|
||||
(error) => {
|
||||
// 对响应错误做点什么
|
||||
if (error.message.indexOf('timeout') != -1) {
|
||||
if (error.message.indexOf('timeout') !== -1) {
|
||||
message.destroy();
|
||||
message.error('网络超时');
|
||||
} else if (error.message == 'Network Error') {
|
||||
} else if (error.message === 'Network Error') {
|
||||
message.destroy();
|
||||
message.error('网络连接错误');
|
||||
}else if (error.message.indexOf('Request') != -1) {
|
||||
} else if (error.message.indexOf('Request') !== -1) {
|
||||
message.destroy();
|
||||
message.error('网络发生错误');
|
||||
}
|
||||
return Promise.reject(error);
|
||||
@@ -79,6 +132,13 @@ smartAxios.interceptors.response.use(
|
||||
|
||||
// ================================= 对外提供请求方法:通用请求,get, post, 下载download等 =================================
|
||||
|
||||
/**
|
||||
* get请求
|
||||
*/
|
||||
export const getRequest = (url, params) => {
|
||||
return request({ url, method: 'get', params });
|
||||
};
|
||||
|
||||
/**
|
||||
* 通用请求封装
|
||||
* @param config
|
||||
@@ -91,39 +151,104 @@ export const request = (config) => {
|
||||
* post请求
|
||||
*/
|
||||
export const postRequest = (url, data) => {
|
||||
return request({ data, url, method: 'post' });
|
||||
return request({
|
||||
data,
|
||||
url,
|
||||
method: 'post',
|
||||
});
|
||||
};
|
||||
|
||||
// ================================= 加密 =================================
|
||||
|
||||
/**
|
||||
* get请求
|
||||
* 加密请求参数的post请求
|
||||
*/
|
||||
export const getRequest = (url, params) => {
|
||||
return request({ url, method: 'get', params });
|
||||
export const postEncryptRequest = (url, data) => {
|
||||
return request({
|
||||
data: { encryptData: encryptData(data) },
|
||||
url,
|
||||
method: 'post',
|
||||
});
|
||||
};
|
||||
|
||||
// ================================= 下载 =================================
|
||||
|
||||
export const postDownload = function (url, data) {
|
||||
request({
|
||||
method: 'post',
|
||||
url,
|
||||
data,
|
||||
responseType: 'blob',
|
||||
})
|
||||
.then((data) => {
|
||||
handleDownloadData(data);
|
||||
})
|
||||
.catch((error) => {
|
||||
handleDownloadError(error);
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 文件下载
|
||||
*/
|
||||
export const download = function (fileName, url, params) {
|
||||
export const getDownload = function (url, params) {
|
||||
request({
|
||||
method: 'get',
|
||||
url: url,
|
||||
params: params,
|
||||
url,
|
||||
params,
|
||||
responseType: 'blob',
|
||||
})
|
||||
.then((data) => {
|
||||
if (!data) {
|
||||
return;
|
||||
}
|
||||
let url = window.URL.createObjectURL(new Blob([data]));
|
||||
let link = document.createElement('a');
|
||||
link.style.display = 'none';
|
||||
link.href = url;
|
||||
link.setAttribute('download', fileName);
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
handleDownloadData(data);
|
||||
})
|
||||
.catch((error) => {
|
||||
throw error;
|
||||
handleDownloadError(error);
|
||||
});
|
||||
};
|
||||
|
||||
function handleDownloadError(error) {
|
||||
if (error instanceof Blob) {
|
||||
const fileReader = new FileReader();
|
||||
fileReader.readAsText(error);
|
||||
fileReader.onload = () => {
|
||||
const msg = fileReader.result;
|
||||
const jsonMsg = JSON.parse(msg);
|
||||
message.destroy();
|
||||
message.error(jsonMsg.msg);
|
||||
};
|
||||
} else {
|
||||
message.destroy();
|
||||
message.error('网络发生错误', error);
|
||||
}
|
||||
}
|
||||
|
||||
function handleDownloadData(response) {
|
||||
if (!response) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取返回类型
|
||||
let contentType = _.isUndefined(response.headers['content-type']) ? response.headers['Content-Type'] : response.headers['content-type'];
|
||||
|
||||
// 构建下载数据
|
||||
let url = window.URL.createObjectURL(new Blob([response.data], { type: contentType }));
|
||||
let link = document.createElement('a');
|
||||
link.style.display = 'none';
|
||||
link.href = url;
|
||||
|
||||
// 从消息头获取文件名
|
||||
let str = _.isUndefined(response.headers['content-disposition'])
|
||||
? response.headers['Content-Disposition'].split(';')[1]
|
||||
: response.headers['content-disposition'].split(';')[1];
|
||||
|
||||
let filename = _.isUndefined(str.split('fileName=')[1]) ? str.split('filename=')[1] : str.split('fileName=')[1];
|
||||
link.setAttribute('download', decodeURIComponent(filename));
|
||||
|
||||
// 触发点击下载
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
// 下载完释放
|
||||
document.body.removeChild(link); // 下载完成移除元素
|
||||
window.URL.revokeObjectURL(url); // 释放掉blob对象
|
||||
}
|
||||
|
||||
@@ -9,21 +9,21 @@
|
||||
*/
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
import {ref} from 'vue';
|
||||
|
||||
export const defaultTimeRanges = {
|
||||
今日: [dayjs(), dayjs()],
|
||||
昨日: [dayjs().subtract(1, 'days'), dayjs().subtract(1, 'days')],
|
||||
本月: [dayjs().startOf('month'), dayjs().endOf('month')],
|
||||
上月: [dayjs().subtract(1, 'months').startOf('month'), dayjs().subtract(1, 'months').endOf('month')],
|
||||
本年度: [dayjs().startOf('year'), dayjs().endOf('year')],
|
||||
上年度: [dayjs().subtract(1, 'years').startOf('year'), dayjs().subtract(1, 'years').endOf('year')],
|
||||
};
|
||||
export const defaultTimeRanges = ref([{label: '今日', value: [dayjs(), dayjs()]}, {
|
||||
label: '昨日',
|
||||
value: [dayjs().subtract(1, 'days'), dayjs().subtract(1, 'days')]
|
||||
}, {label: '本月', value: [dayjs().startOf('month'), dayjs().endOf('month')]}, {
|
||||
label: '上个月',
|
||||
value: [dayjs().subtract(1, 'months').startOf('month'), dayjs().subtract(1, 'months').endOf('month')]
|
||||
}, {
|
||||
label: '下个月',
|
||||
value: [dayjs().subtract(-1, 'months').startOf('month'), dayjs().subtract(-1, 'months').endOf('month')]
|
||||
},
|
||||
|
||||
{label: '本年度', value: [dayjs().startOf('year'), dayjs().endOf('year')]}, {
|
||||
label: '上年度',
|
||||
value: [dayjs().subtract(1, 'years').startOf('year'), dayjs().subtract(1, 'years').endOf('year')]
|
||||
}]);
|
||||
|
||||
// 不可跨月
|
||||
export const defaultLimitMonth = {
|
||||
今日: [dayjs(), dayjs()],
|
||||
昨日: [dayjs().subtract(1, 'days'), dayjs().subtract(1, 'days')],
|
||||
本月: [dayjs().startOf('month'), dayjs().endOf('month')],
|
||||
上月: [dayjs().subtract(1, 'months').startOf('month'), dayjs().subtract(1, 'months').endOf('month')],
|
||||
下个月: [dayjs().subtract(-1, 'months').startOf('month'), dayjs().subtract(-1, 'months').endOf('month')],
|
||||
};
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
import CryptoJS from 'crypto-js';
|
||||
import CryptoSM from 'sm-crypto';
|
||||
|
||||
function object2string(data) {
|
||||
if (typeof data === 'Object') {
|
||||
return JSON.stringify(data);
|
||||
}
|
||||
|
||||
let str = JSON.stringify(data);
|
||||
if (str.startsWith("'") || str.startsWith('"')) {
|
||||
str = str.substring(1);
|
||||
}
|
||||
if (str.endsWith("'") || str.endsWith('"')) {
|
||||
str = str.substring(0, str.length - 1);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
// ----------------------- AES 加密、解密 -----------------------
|
||||
const AES_KEY = '1024abcd1024abcd1024abcd1024abcd';
|
||||
|
||||
const AES = {
|
||||
encryptData: function (data) {
|
||||
// AES 加密 并转为 base64
|
||||
let utf8Data = CryptoJS.enc.Utf8.parse(object2string(data));
|
||||
const key = CryptoJS.enc.Utf8.parse(AES_KEY);
|
||||
const encrypted = CryptoJS.AES.encrypt(utf8Data, key, {
|
||||
mode: CryptoJS.mode.ECB,
|
||||
padding: CryptoJS.pad.Pkcs7,
|
||||
});
|
||||
|
||||
return encrypted.toString();
|
||||
},
|
||||
|
||||
decryptData: function (data) {
|
||||
// 第一步:Base64 解码
|
||||
let words = CryptoJS.enc.Base64.parse(data);
|
||||
|
||||
// 第二步:AES 解密
|
||||
const key = CryptoJS.enc.Utf8.parse(AES_KEY);
|
||||
return CryptoJS.AES.decrypt({ ciphertext: words }, key, {
|
||||
mode: CryptoJS.mode.ECB,
|
||||
padding: CryptoJS.pad.Pkcs7,
|
||||
}).toString(CryptoJS.enc.Utf8);
|
||||
},
|
||||
};
|
||||
|
||||
// ----------------------- 国密SM4算法 加密、解密 -----------------------
|
||||
const SM4_KEY = '1024abcd1024abcd1024abcd1024abcd';
|
||||
|
||||
const SM4 = {
|
||||
encryptData: function (data) {
|
||||
// 第一步:SM4 加密
|
||||
let encryptData = CryptoSM.sm4.encrypt(object2string(data), SM4_KEY);
|
||||
// 第二步: Base64 编码
|
||||
return CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(encryptData));
|
||||
},
|
||||
|
||||
decryptData: function (data) {
|
||||
// 第一步:Base64 解码
|
||||
let words = CryptoJS.enc.Base64.parse(data);
|
||||
let decode64Str = CryptoJS.enc.Utf8.stringify(words);
|
||||
|
||||
// 第二步:SM4 解密
|
||||
return CryptoSM.sm4.decrypt(decode64Str, SM4_KEY);
|
||||
},
|
||||
};
|
||||
|
||||
// ----------------------- 对外暴露: 加密、解密 -----------------------
|
||||
|
||||
// 默认使用SM4算法
|
||||
const EncryptObject = SM4;
|
||||
// const EncryptObject = AES;
|
||||
|
||||
/**
|
||||
* 加密
|
||||
*/
|
||||
export const encryptData = function (data) {
|
||||
return !data ? null : EncryptObject.encryptData(data);
|
||||
};
|
||||
|
||||
/**
|
||||
* 解密
|
||||
*/
|
||||
export const decryptData = function (data) {
|
||||
return !data ? null : EncryptObject.decryptData(data);
|
||||
};
|
||||
@@ -9,14 +9,14 @@
|
||||
*/
|
||||
|
||||
export const smartSentry = {
|
||||
/**
|
||||
* sentry 主动上报
|
||||
*/
|
||||
captureError: (error) => {
|
||||
if (error.config && error.data && error && error.headers && error.request && error.status) {
|
||||
return;
|
||||
}
|
||||
// Sentry.captureException(error);
|
||||
console.error(error);
|
||||
},
|
||||
/**
|
||||
* sentry 主动上报
|
||||
*/
|
||||
captureError: (error) => {
|
||||
if (error.config && error.data && error && error.headers && error.request && error.status) {
|
||||
return;
|
||||
}
|
||||
// Sentry.captureException(error);
|
||||
console.error(error);
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
/*
|
||||
* 水印
|
||||
*
|
||||
* @Author: 1024创新实验室-主任:卓大
|
||||
* @Date: 2022-09-06 20:50:10
|
||||
* @Wechat: zhuda1024
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
/**
|
||||
* 水印DOM id
|
||||
*/
|
||||
const WATER_MARK_DOM_ID = 'smart_admin_water_mark';
|
||||
let smartAdminWaterMarkIntervalId = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* 因为modal的z-index为1000,所以为了modal的黑色背景隐藏掉,z-index为 999
|
||||
*
|
||||
* @param id
|
||||
* @param str
|
||||
* @param watermarkId
|
||||
* @returns
|
||||
*/
|
||||
|
||||
function setWatermark(id, str) {
|
||||
//删掉之前的水印
|
||||
if (document.getElementById(WATER_MARK_DOM_ID) !== null) {
|
||||
document.getElementById(WATER_MARK_DOM_ID).remove();
|
||||
}
|
||||
|
||||
str = str + ' ' + dayjs().format('YYYY-MM-DD HH:mm');
|
||||
|
||||
//创建一个画布
|
||||
const can = document.createElement('canvas');
|
||||
//设置画布的长宽
|
||||
can.width = 400;
|
||||
can.height = 200;
|
||||
|
||||
const cans = can.getContext('2d');
|
||||
//旋转角度
|
||||
cans.rotate((-15 * Math.PI) / 150);
|
||||
cans.font = '16px Microsoft JhengHei';
|
||||
//设置填充绘画的颜色、渐变或者模式
|
||||
cans.fillStyle = 'rgba(190, 190, 190, 0.30)';
|
||||
//设置文本内容的当前对齐方式
|
||||
cans.textAlign = 'left';
|
||||
//设置在绘制文本时使用的当前文本基线
|
||||
cans.textBaseline = 'middle';
|
||||
//在画布上绘制填色的文本(输出的文本,开始绘制文本的X坐标位置,开始绘制文本的Y坐标位置)
|
||||
cans.fillText(str, can.width / 8, can.height / 2);
|
||||
const div = document.createElement('div');
|
||||
div.id = WATER_MARK_DOM_ID;
|
||||
div.style.pointerEvents = 'none';
|
||||
div.style.top = '0px';
|
||||
div.style.left = '0px';
|
||||
div.style.position = 'absolute';
|
||||
div.style.zIndex = '999';
|
||||
div.style.width = '100%';
|
||||
div.style.height = '100%';
|
||||
div.style.background = 'url(' + can.toDataURL('image/png') + ') left top repeat';
|
||||
document.getElementById(id).appendChild(div);
|
||||
}
|
||||
|
||||
const watermark = {
|
||||
show: function () {
|
||||
document.getElementById(WATER_MARK_DOM_ID).style.display = 'block';
|
||||
},
|
||||
hide: function () {
|
||||
document.getElementById(WATER_MARK_DOM_ID).style.display = 'hide';
|
||||
},
|
||||
// 该方法只允许调用一次
|
||||
set: function (id, str) {
|
||||
// 如果存在水印,则不允许再调用了
|
||||
if (document.getElementById(WATER_MARK_DOM_ID) !== null) {
|
||||
alert('已经添加过全局水印了,请不要再重复添加!');
|
||||
return;
|
||||
}
|
||||
|
||||
setWatermark(id, str);
|
||||
|
||||
//每隔1分钟检查一次水印
|
||||
smartAdminWaterMarkIntervalId = setInterval(() => {
|
||||
setWatermark(id, str);
|
||||
}, 60000);
|
||||
|
||||
window.onresize = () => {
|
||||
setWatermark(id, str);
|
||||
};
|
||||
},
|
||||
// 清空水印
|
||||
clear: function () {
|
||||
document.getElementById(WATER_MARK_DOM_ID).remove();
|
||||
window.removeEventListener('resize', setWatermark);
|
||||
if (smartAdminWaterMarkIntervalId) {
|
||||
clearInterval(smartAdminWaterMarkIntervalId);
|
||||
}
|
||||
},
|
||||
};
|
||||
export default watermark;
|
||||
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* 水印
|
||||
*
|
||||
* @Author: 1024创新实验室-主任:卓大
|
||||
* @Date: 2022-09-06 20:50:10
|
||||
* @Wechat: zhuda1024
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
/**
|
||||
* 水印DOM id
|
||||
*/
|
||||
const WATER_MARK_DOM_ID = 'smart_admin_water_mark';
|
||||
let smartAdminWaterMarkIntervalId = null;
|
||||
|
||||
/**
|
||||
*
|
||||
* 因为modal的z-index为1000,所以为了modal的黑色背景隐藏掉,z-index为 999
|
||||
*
|
||||
* @param id
|
||||
* @param str
|
||||
* @returns
|
||||
*/
|
||||
|
||||
function setWatermark(id, str) {
|
||||
//删掉之前的水印
|
||||
if (document.getElementById(WATER_MARK_DOM_ID) !== null) {
|
||||
document.getElementById(WATER_MARK_DOM_ID).remove();
|
||||
}
|
||||
|
||||
str = str + ' ' + dayjs().format('YYYY-MM-DD HH:mm');
|
||||
|
||||
//创建一个画布
|
||||
const can = document.createElement('canvas');
|
||||
//设置画布的长宽
|
||||
can.width = 400;
|
||||
can.height = 200;
|
||||
|
||||
const cans = can.getContext('2d');
|
||||
//旋转角度
|
||||
cans.rotate((-15 * Math.PI) / 150);
|
||||
cans.font = '16px Microsoft JhengHei';
|
||||
//设置填充绘画的颜色、渐变或者模式
|
||||
cans.fillStyle = 'rgba(190, 190, 190, 0.30)';
|
||||
//设置文本内容的当前对齐方式
|
||||
cans.textAlign = 'left';
|
||||
//设置在绘制文本时使用的当前文本基线
|
||||
cans.textBaseline = 'middle';
|
||||
//在画布上绘制填色的文本(输出的文本,开始绘制文本的X坐标位置,开始绘制文本的Y坐标位置)
|
||||
cans.fillText(str, can.width / 8, can.height / 2);
|
||||
const div = document.createElement('div');
|
||||
div.id = WATER_MARK_DOM_ID;
|
||||
div.style.pointerEvents = 'none';
|
||||
div.style.top = '0px';
|
||||
div.style.left = '0px';
|
||||
div.style.position = 'absolute';
|
||||
div.style.zIndex = '99';
|
||||
div.style.width = '100%';
|
||||
div.style.height = '100%';
|
||||
div.style.background = 'url(' + can.toDataURL('image/png') + ') left top repeat';
|
||||
document.getElementById(id).appendChild(div);
|
||||
}
|
||||
|
||||
const watermark = {
|
||||
show: function () {
|
||||
document.getElementById(WATER_MARK_DOM_ID).style.display = 'block';
|
||||
},
|
||||
hide: function () {
|
||||
document.getElementById(WATER_MARK_DOM_ID).style.display = 'hide';
|
||||
},
|
||||
// 该方法只允许调用一次
|
||||
set: function (id, str) {
|
||||
// 如果存在水印,则不允许再调用了
|
||||
if (document.getElementById(WATER_MARK_DOM_ID) !== null) {
|
||||
return;
|
||||
}
|
||||
|
||||
setWatermark(id, str);
|
||||
|
||||
//每隔1分钟检查一次水印
|
||||
smartAdminWaterMarkIntervalId = setInterval(() => {
|
||||
setWatermark(id, str);
|
||||
}, 60000);
|
||||
|
||||
window.onresize = () => {
|
||||
setWatermark(id, str);
|
||||
};
|
||||
},
|
||||
// 清空水印
|
||||
clear: function () {
|
||||
let watermarkDom = document.getElementById(WATER_MARK_DOM_ID);
|
||||
if (watermarkDom) {
|
||||
watermarkDom.remove();
|
||||
}
|
||||
|
||||
window.removeEventListener('resize', setWatermark);
|
||||
if (smartAdminWaterMarkIntervalId) {
|
||||
clearInterval(smartAdminWaterMarkIntervalId);
|
||||
smartAdminWaterMarkIntervalId = null;
|
||||
}
|
||||
},
|
||||
};
|
||||
export default watermark;
|
||||
@@ -15,14 +15,14 @@ import JsonViewer from 'vue3-json-viewer';
|
||||
import 'vue3-json-viewer/dist/index.css';
|
||||
import App from './App.vue';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import { loginApi } from '/@/api/system/login/login-api';
|
||||
import { loginApi } from '/src/api/system/login-api';
|
||||
import constantsInfo from '/@/constants/index';
|
||||
import { privilegeDirective } from '/@/directives/privilege';
|
||||
import i18n from '/@/i18n/index';
|
||||
import privilegePlugin from '/@/plugins/privilege-plugin';
|
||||
import smartEnumPlugin from '/@/plugins/smart-enums-plugin';
|
||||
import { buildRoutes, router } from '/@/router/index';
|
||||
import { store } from '/@/store/index';
|
||||
import { buildRoutes, router } from '/@/router';
|
||||
import { store } from '/@/store';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import '/@/theme/index.less';
|
||||
import { getTokenFromCookie } from '/@/utils/cookie-util';
|
||||
@@ -36,7 +36,7 @@ import { getTokenFromCookie } from '/@/utils/cookie-util';
|
||||
* 2.1)如果存在登录信息,则先ajax请求用户的所有路由,然后加载,再去创建vue实例和挂载路由
|
||||
* 2.2)如果不存在路由信息,则创建vue实例和挂载路由(此时的路由应该只有login页面,因为用户拥有哪些路由是登录之后才知道的)
|
||||
* 3、以上,在main.js里两个方法,一个是 获取登录信息getLoginInfo,另一个初始化vue: initVue,在最下的if操作里
|
||||
*
|
||||
*
|
||||
* -------------------- ※ 着重 解释说明下main.js的初始化逻辑 end ※ --------------------
|
||||
*/
|
||||
|
||||
@@ -54,7 +54,7 @@ async function getLoginInfo() {
|
||||
//更新用户信息到pinia
|
||||
useUserStore().setUserLoginInfo(res.data);
|
||||
} catch (e) {
|
||||
message.error(e);
|
||||
message.error(e.data ? e.data.msg : e.message);
|
||||
smartSentry.captureError(e);
|
||||
initVue();
|
||||
}
|
||||
|
||||
@@ -14,11 +14,11 @@ import { createRouter, createWebHashHistory } from 'vue-router';
|
||||
import { routerArray } from './routers';
|
||||
import { PAGE_PATH_404, PAGE_PATH_LOGIN } from '/@/constants/common-const';
|
||||
import { HOME_PAGE_NAME } from '/@/constants/system/home-const';
|
||||
import SmartLayout from '/@/layout/smart-layout.vue';
|
||||
import SmartLayout from '../layout/index.vue';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import { clearAllCoolies, getTokenFromCookie } from '/@/utils/cookie-util';
|
||||
import { localClear } from '/@/utils/local-util';
|
||||
import lodash from 'lodash';
|
||||
import _ from 'lodash';
|
||||
|
||||
export const router = createRouter({
|
||||
history: createWebHashHistory(),
|
||||
@@ -48,14 +48,14 @@ router.beforeEach(async (to, from, next) => {
|
||||
}
|
||||
|
||||
// 首页( 需要登录 ,但不需要验证权限)
|
||||
if (to.path == HOME_PAGE_NAME) {
|
||||
if (to.path === HOME_PAGE_NAME) {
|
||||
next();
|
||||
return;
|
||||
}
|
||||
|
||||
// 下载路由对应的 页面组件,并修改组件的Name,如果修改过,则不需要修改
|
||||
let toRouterInfo = routerMap.get(to.name);
|
||||
if (toRouterInfo && lodash.isFunction(toRouterInfo.component) && toRouterInfo.meta.renameComponentFlag === false) {
|
||||
if (toRouterInfo && _.isFunction(toRouterInfo.component) && toRouterInfo.meta.renameComponentFlag === false) {
|
||||
// 因为组件component 为 lazy load是个方法,所以可以直接执行 component()方法
|
||||
toRouterInfo.component().then((val) => {
|
||||
// 修改组件的name
|
||||
@@ -65,22 +65,16 @@ router.beforeEach(async (to, from, next) => {
|
||||
});
|
||||
}
|
||||
|
||||
// 是否刷新缓存
|
||||
// 当前路由是否在tag中 存在tag中且没有传递keepAlive则刷新缓存
|
||||
let findTag = (useUserStore().tagNav || []).find((e) => e.menuName == to.name);
|
||||
let reloadKeepAlive = findTag && !to.params.keepAlive;
|
||||
|
||||
// 设置tagNav
|
||||
useUserStore().setTagNav(to, from);
|
||||
// 设置keepAlive 或 删除KeepAlive
|
||||
|
||||
// 设置keepAlive
|
||||
if (to.meta.keepAlive) {
|
||||
if (reloadKeepAlive) {
|
||||
useUserStore().deleteKeepAliveIncludes(to.meta.componentName);
|
||||
}
|
||||
nextTick(() => {
|
||||
useUserStore().pushKeepAliveIncludes(to.meta.componentName);
|
||||
});
|
||||
}
|
||||
|
||||
next();
|
||||
});
|
||||
|
||||
@@ -114,23 +108,15 @@ export function buildRoutes(menuRouterList) {
|
||||
if (e.deletedFlag && e.deletedFlag === true) {
|
||||
continue;
|
||||
}
|
||||
let componentName = e.menuId.toString();
|
||||
if (e.component) {
|
||||
let lastIndex = e.component.lastIndexOf('/');
|
||||
let fileName = lodash.camelCase(e.component.substring(lastIndex + 1, e.component.length));
|
||||
componentName = lodash.camelCase(fileName) + componentName;
|
||||
componentName = lodash.upperFirst(componentName);
|
||||
}
|
||||
|
||||
let route = {
|
||||
path: e.path.startsWith('/') ? e.path : `/${e.path}`,
|
||||
// 使用【组件文件名+menuId】作为name唯一标识
|
||||
// 使用【menuId】作为name唯一标识
|
||||
name: e.menuId.toString(),
|
||||
meta: {
|
||||
// 数据库菜单(页面)id
|
||||
id: e.menuId.toString(),
|
||||
// 组件名称
|
||||
componentName: componentName,
|
||||
componentName: e.menuId.toString(),
|
||||
// 菜单展示
|
||||
title: e.menuName,
|
||||
// 菜单图标展示
|
||||
@@ -150,7 +136,6 @@ export function buildRoutes(menuRouterList) {
|
||||
|
||||
if (e.frameFlag) {
|
||||
route.component = () => import('../components/framework/iframe/iframe-index.vue');
|
||||
|
||||
} else {
|
||||
let componentPath = e.component && e.component.startsWith('/') ? e.component : '/' + e.component;
|
||||
let relativePath = `../views${componentPath}`;
|
||||
|
||||
@@ -10,5 +10,13 @@
|
||||
import { homeRouters } from './system/home';
|
||||
import { loginRouters } from './system/login';
|
||||
import { helpDocRouters } from './support/help-doc';
|
||||
import NotFound from '/@/views/system/40X/404.vue';
|
||||
import NoPrivilege from '/@/views/system/40X/403.vue';
|
||||
|
||||
export const routerArray = [...loginRouters, ...homeRouters, ...helpDocRouters];
|
||||
export const routerArray = [
|
||||
...loginRouters,
|
||||
...homeRouters,
|
||||
...helpDocRouters,
|
||||
{ path: '/:pathMatch(.*)*', name: '404', component: NotFound },
|
||||
{ path: '/403', name: '403', component: NoPrivilege }
|
||||
];
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
* @Email: lab1024@163.com
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
import SmartHelpDocLayout from '/@/layout/smart-help-doc-layout.vue';
|
||||
import HelpDocLayout from '/@/layout/help-doc-layout.vue';
|
||||
|
||||
export const helpDocRouters = [
|
||||
{
|
||||
path: '/help-doc',
|
||||
name: 'HelpDoc',
|
||||
component: SmartHelpDocLayout,
|
||||
component: HelpDocLayout,
|
||||
meta: {
|
||||
title: '帮助文档',
|
||||
hideInMenu: true,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
*/
|
||||
import { HOME_PAGE_NAME } from '/@/constants/system/home-const';
|
||||
import { MENU_TYPE_ENUM } from '/@/constants/system/menu-const';
|
||||
import SmartLayout from '/@/layout/smart-layout.vue';
|
||||
import SmartLayout from '/@/layout/index.vue';
|
||||
|
||||
export const homeRouters = [
|
||||
{
|
||||
|
||||
@@ -17,5 +17,5 @@ export const loginRouters = [
|
||||
title: '登录',
|
||||
hideInMenu: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
];
|
||||
|
||||
@@ -24,15 +24,15 @@ export const useRoleStore = defineStore({
|
||||
},
|
||||
// 选中
|
||||
addCheckedData(data) {
|
||||
if (this.checkedData.some((e) => e == data)) {
|
||||
if (this.checkedData.some((e) => e === data)) {
|
||||
return;
|
||||
}
|
||||
this.checkedData.push(data);
|
||||
},
|
||||
// 选中本级以及子级
|
||||
addCheckedDataAndChildren(data) {
|
||||
let findIndex = this.checkedData.findIndex((val) => val == data.menuId);
|
||||
if (data.menuId && findIndex == -1) {
|
||||
let findIndex = this.checkedData.findIndex((val) => val === data.menuId);
|
||||
if (data.menuId && findIndex === -1) {
|
||||
this.addCheckedData(data.menuId);
|
||||
}
|
||||
if (data.children) {
|
||||
@@ -47,8 +47,8 @@ export const useRoleStore = defineStore({
|
||||
},
|
||||
// 取消选中本级以及子级
|
||||
deleteCheckedDataAndChildren(data) {
|
||||
let findIndex = this.checkedData.findIndex((val) => val == data.menuId);
|
||||
if (findIndex != -1) {
|
||||
let findIndex = this.checkedData.findIndex((val) => val === data.menuId);
|
||||
if (findIndex !== -1) {
|
||||
this.deleteCheckedData(findIndex);
|
||||
}
|
||||
if (data.children) {
|
||||
@@ -83,7 +83,7 @@ export const useRoleStore = defineStore({
|
||||
}
|
||||
// 选中父级
|
||||
let parentIndex = this.checkedData.findIndex((e) => parentModule.menuId === e);
|
||||
if (parentModule.menuId && parentIndex == -1) {
|
||||
if (parentModule.menuId && parentIndex === -1) {
|
||||
this.addCheckedData(parentModule.menuId);
|
||||
}
|
||||
// 如果上级还有上级 则进行递归
|
||||
|
||||
@@ -35,6 +35,8 @@ export const useUserStore = defineStore({
|
||||
administratorFlag: true,
|
||||
//上次登录ip
|
||||
lastLoginIp: '',
|
||||
//上次登录ip地区
|
||||
lastLoginIpRegion: '',
|
||||
//上次登录 设备
|
||||
lastLoginUserAgent: '',
|
||||
//上次登录时间
|
||||
@@ -120,6 +122,7 @@ export const useUserStore = defineStore({
|
||||
this.departmentName = data.departmentName;
|
||||
this.administratorFlag = data.administratorFlag;
|
||||
this.lastLoginIp = data.lastLoginIp;
|
||||
this.lastLoginIpRegion = data.lastLoginIpRegion;
|
||||
this.lastLoginUserAgent = data.lastLoginUserAgent;
|
||||
this.lastLoginTime = data.lastLoginTime;
|
||||
|
||||
@@ -143,10 +146,10 @@ export const useUserStore = defineStore({
|
||||
if (_.isEmpty(this.getTagNav)) this.tagNav = [];
|
||||
// name唯一标识
|
||||
let name = route.name;
|
||||
if (!name || name == HOME_PAGE_NAME) {
|
||||
if (!name || name === HOME_PAGE_NAME) {
|
||||
return;
|
||||
}
|
||||
let findTag = (this.tagNav || []).find((e) => e.menuName == name);
|
||||
let findTag = (this.tagNav || []).find((e) => e.menuName === name);
|
||||
if (findTag) {
|
||||
// @ts-ignore
|
||||
findTag.fromMenuName = from.name;
|
||||
@@ -173,9 +176,9 @@ export const useUserStore = defineStore({
|
||||
this.tagNav = [];
|
||||
this.clearKeepAliveIncludes();
|
||||
} else {
|
||||
let findIndex = (this.tagNav || []).findIndex((e) => e.menuName == menuName);
|
||||
let findIndex = (this.tagNav || []).findIndex((e) => e.menuName === menuName);
|
||||
if (closeAll) {
|
||||
if (findIndex == -1) {
|
||||
if (findIndex === -1) {
|
||||
this.tagNav = [];
|
||||
this.clearKeepAliveIncludes();
|
||||
} else {
|
||||
@@ -197,12 +200,12 @@ export const useUserStore = defineStore({
|
||||
router.push({ path });
|
||||
} else {
|
||||
// 寻找tagNav
|
||||
let index = this.getTagNav.findIndex((e) => e.menuName == route.name);
|
||||
if (index == -1) {
|
||||
let index = this.getTagNav.findIndex((e) => e.menuName === route.name);
|
||||
if (index === -1) {
|
||||
router.push({ name: HOME_PAGE_NAME });
|
||||
} else {
|
||||
let tagNav = this.getTagNav[index];
|
||||
if (tagNav.fromMenuName && this.getTagNav.some((e) => e.menuName == tagNav.fromMenuName)) {
|
||||
if (tagNav.fromMenuName && this.getTagNav.some((e) => e.menuName === tagNav.fromMenuName)) {
|
||||
router.push({ name: tagNav.fromMenuName, query: tagNav.fromMenuQuery });
|
||||
} else {
|
||||
// 查询左侧tag
|
||||
@@ -261,7 +264,7 @@ function buildMenuParentIdListMap(menuTree) {
|
||||
function recursiveBuildMenuParentIdListMap(menuList, parentMenuList, menuParentIdListMap) {
|
||||
for (const e of menuList) {
|
||||
// 顶级parentMenuList清空
|
||||
if (e.parentId == 0) {
|
||||
if (e.parentId === 0) {
|
||||
parentMenuList = [];
|
||||
}
|
||||
let menuIdStr = e.menuId.toString();
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { theme } from 'ant-design-vue/lib';
|
||||
import convertLegacyToken from 'ant-design-vue/lib/theme/convertLegacyToken';
|
||||
|
||||
const { defaultAlgorithm, defaultSeed } = theme;
|
||||
|
||||
const mapToken = defaultAlgorithm(defaultSeed);
|
||||
const token = convertLegacyToken.default(mapToken);
|
||||
|
||||
export default {
|
||||
'@primary-color': token['primary-color'], // 全局主色
|
||||
'@base-bg-color': '#fff',
|
||||
'@hover-bg-color': 'rgba(0, 0, 0, 0.025)',
|
||||
'@hover-bg-color-night': 'rgba(255, 255, 255, 0.025)',
|
||||
'@header-light-bg-hover-color': '#f6f6f6',
|
||||
'@header-height': '80px',
|
||||
'@header-user-height': '40px',
|
||||
'@page-tag-height': '40px',
|
||||
'@theme-list': ['light', 'dark', 'night'],
|
||||
};
|
||||
@@ -8,32 +8,9 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
|
||||
@import 'ant-design-vue/dist/antd.css';
|
||||
@import 'ant-design-vue/dist/reset.css';
|
||||
@import './smart-admin.less';
|
||||
|
||||
|
||||
/********************************** ant design vue 颜色变量 begin **********************************/
|
||||
@primary-color:#1890ff;
|
||||
@success-color: #52c41a; // 成功色
|
||||
@error-color :#f5222d; // 错误色
|
||||
@text-color:rgba(0, 0, 0, 0.65); // 主文本色
|
||||
@text-color-secondary:rgba(0, 0, 0, 0.45); // 次文本色
|
||||
@primary-7: #1890ff;
|
||||
@base-bg-color: #fff;
|
||||
@shadow-color:rgba(0, 0, 0, 0.15);
|
||||
|
||||
/********************************** ant design vue 颜色变量 end **********************************/
|
||||
|
||||
/********************************** 页面头部 begin **********************************/
|
||||
@hover-bg-color: rgba(0, 0, 0, 0.025);
|
||||
@hover-bg-color-night: rgba(255, 255, 255, 0.025);
|
||||
@header-light-bg-hover-color: #f6f6f6;
|
||||
@header-height: 80px;
|
||||
@header-user-height: 40px;
|
||||
@page-tag-height: 40px;
|
||||
@theme-list: light, dark, night;
|
||||
/********************************** 页面头部 end **********************************/
|
||||
|
||||
/********************************** 基础样式 **********************************/
|
||||
* {
|
||||
margin: 0;
|
||||
|
||||
@@ -8,21 +8,6 @@
|
||||
* @Copyright 1024创新实验室 ( https://1024lab.net ),Since 2012
|
||||
*/
|
||||
|
||||
/********************************** 滚动条 **********************************/
|
||||
::-webkit-scrollbar {
|
||||
width: 2px;
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #cdcdcd;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
-webkit-box-shadow: inset 0 0 6px rgb(0 0 0 / 30%);
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 1px;
|
||||
}
|
||||
|
||||
/********************************** 宽度 **********************************/
|
||||
.smart-width-100 {
|
||||
width: 100%;
|
||||
@@ -45,6 +30,22 @@
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
/********************************** 右间距 **********************************/
|
||||
.smart-margin-right5 {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.smart-margin-right10 {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.smart-margin-right15 {
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.smart-margin-right20 {
|
||||
margin-right: 20px;
|
||||
}
|
||||
|
||||
/******************************** 上间距 ********************************/
|
||||
.smart-margin-top5 {
|
||||
@@ -73,6 +74,7 @@
|
||||
.smart-table-operate {
|
||||
.ant-btn {
|
||||
padding: 0px 3px !important;
|
||||
height: auto;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user